text:
## Metrics

### Couchbase

| Name | Unit | Dimensions |
|------|------|------------|
| Couchbase active check latency | s |  |
| Couchbase active check uptime | % |  |
| Couchbase current number of buckets | # |  |
| Couchbase max bucket count | # |  |

### Couchbase / Bucket

| Name | Unit | Dimensions |
|------|------|------------|
| Couchbase active items in disk queue | # | Bucket |
| Couchbase amount of disk used | b | Bucket |
| Couchbase amount of memory used by the bucket | b | Bucket |
| Couchbase amount of RAM used by the bucket | b | Bucket |
| Couchbase amount of raw RAM used by the bucket | b | Bucket |
| Couchbase bytes read | b | Bucket |
| Couchbase bytes written | b | Bucket |
| Couchbase check and set hits | # | Bucket |
| Couchbase check and set misses | # | Bucket |
| Couchbase current connections | conn | Bucket |
| Couchbase current items | items | Bucket |
| Couchbase current items total | items | Bucket |
| Couchbase decrement hits | hits | Bucket |
| Couchbase decrement misses | misses | Bucket |
| Couchbase delete hits | hits | Bucket |
| Couchbase delete misses | misses | Bucket |
| Couchbase ep_cache_miss_rate |  | Bucket |
| Couchbase ep_diskqueue_drain |  | Bucket |
| Couchbase ep_diskqueue_fill |  | Bucket |
| Couchbase ep_flusher_todo |  | Bucket |
| Couchbase ep_item_commit_failed |  | Bucket |
| Couchbase ep_num_non_resident |  | Bucket |
| Couchbase ep_num_value_ejects |  | Bucket |
| Couchbase ep_queue_size |  | Bucket |
| Couchbase extra memory used by transient data | b | Bucket |
| Couchbase free memory | b | Bucket |
| Couchbase get commands | # | Bucket |
| Couchbase get hits | hits | Bucket |
| Couchbase get misses | misses | Bucket |
| Couchbase high water mark for auto-evictions |  | Bucket |
| Couchbase increment hits | hits | Bucket |
| Couchbase increment misses | misses | Bucket |
| Couchbase low water mark for auto-evictions |  | Bucket |
| Couchbase max amount of data allowed in memory | b | Bucket |
| Couchbase memory used | b | Bucket |
| Couchbase number of active vBuckets. | # | Bucket |
| Couchbase number of create operations | # | Bucket |
| Couchbase number of disk fetches | # | Bucket |
| Couchbase number of disk fetches performed since server was started for a bucket | # | Bucket |
| Couchbase number of items associated with the bucket | # | Bucket |
| Couchbase number of items/documents that are replicas for a bucket | # | Bucket |
| Couchbase number of operations per second | # | Bucket |
| Couchbase number of replica vBuckets | # | Bucket |
| Couchbase number of times temporary OOMs | # | Bucket |
| Couchbase number of times unrecoverable OOMs | # | Bucket |
| Couchbase percentage of RAM used (for active objects) against the configure bucket size | % | Bucket |
| Couchbase replica items in disk queue | # | Bucket |
| Couchbase set commands | # | Bucket |
| Couchbase size of user data within buckets of the specified state that are resident in RAM | % | Bucket |
| Couchbase total drained items | # | Bucket |
| Couchbase total enqueued items | # | Bucket |
| Couchbase total memory | b | Bucket |
| Couchbase total memory used by meta data | b | Bucket |
| Couchbase total metadata memory |  | Bucket |

### Couchbase / Fragmentation

| Name | Unit | Dimensions |
|------|------|------------|
| Couchbase database fragmentation threshold | % |  |
| Couchbase index fragmentation threshold | % |  |
| Couchbase view fragmentation threshold | % |  |

### Couchbase / HDD

| Name | Unit | Dimensions |
|------|------|------------|
| Couchbase free harddrive space in the cluster | b |  |
| Couchbase harddrive quota total for the cluster | b |  |
| Couchbase harddrive space used by the cluster | b |  |
| Couchbase harddrive use by the data in the cluster | b |  |
| Couchbase total harddrive space available to cluster | b |  |

### Couchbase / Node

| Name | Unit | Dimensions |
|------|------|------------|
| Couchbase amount of disk space occupied by Couch views | b |  |
| Couchbase amount of disk space used by Couch docs | b |  |
| Couchbase amount of memcached memory allocated | # |  |
| Couchbase amount of memcached memory reserved | b |  |
| Couchbase cluster compatibility |  |  |
| Couchbase couch spatial data size | b |  |
| Couchbase couch spatial disk size | b |  |
| Couchbase data size of couch documents associated with a node | b |  |
| Couchbase memory used by the node | b |  |
| Couchbase number of current items | # |  |
| Couchbase number of disk fetches performed since server was started | # |  |
| Couchbase number of get hits | # |  |
| Couchbase number of items/documents that are replicas | # |  |
| Couchbase number of operations performed | # |  |
| Couchbase size of object data for Couch views | b |  |
| Couchbase total number of items associated with node | # |  |

### Couchbase / Node / System

| Name | Unit | Dimensions |
|------|------|------------|
| Couchbase amount of swap space used | b |  |
| Couchbase free memory available to the node | b |  |
| Couchbase number of get commands | # |  |
| Couchbase the CPU utilization rate | % |  |
| Couchbase total memory available to the node | b |  |
| Couchbase total swap size allocated | b |  |

### Couchbase / RAM

| Name | Unit | Dimensions |
|------|------|------------|
| Couchbase RAM quota total for the cluster | b |  |
| Couchbase RAM quota used by the cluster | b |  |
| Couchbase RAM used by the cluster | b |  |
| Couchbase RAM used by the data in the cluster | b |  |
| Couchbase total RAM available to cluster | b |  |

## Events

| Name | Description | Attributes |
|------|-------------|------------|
| COUCHBASE service state watcher | State watcher | status |

repository: CoScale/docs

branch_name: refs/heads/develop

repo_name: CoScale/docs


text:
# dappbot-types

Typescript bindings describing the core data types and API interactions with DappBot.  Extracted into their own repository in order to :

- Guarantee consistency across multiple client and server projects
- Make the overall DappBot codebase DRYer
- Share these types with our API customers

### [Full Changelog](./CHANGELOG.md)

There is full generated documentation from the source code hosted at `eximchain.github.io/dappbot-types`.  Briefly, the types are grouped into nested namespaces in order to minimize both collisions and stuttering. They are nested like:

- `DappBotTypes`: Overall namespace, package's default export
  - `Dapp`: Interfaces, type guards, and factories related to the `DappItem` data type
  - `User`:  Interfaces, type guards, and factories related to the `User` & auth data types
  - `Responses`: Interfaces and helper functions for our API responses
  - `Methods`: Each sub-module within here (`Auth`, `Payment`, `Private`, `Public`) contains all types related to that resource's available methods.  Each method contains keys `Args`, `Result`, `Response`, `HTTP`, & `Path`.  The `Result` corresponds to the `res.data` in a successful call, `Response` just wraps that shape in `data`/`err`.

As a consumer, you can import either import the full namespace from the top or instead use the import string to grab one of the more nested ones.  All of the individual namespaces & types are declared within the `spec` folder, which you can directly refer to in your import.  By example, below are two ways of getting at the same type:

```typescript
// Grab the overall types object and drill down through
// the namespaces to get the interface we want
import Types from 'dappbot-types';
const argsFromType:Types.Methods.Auth.Login.Args = {
  username : 'wuddup',
  password : 'we here',
  yis : 'this prop is not legal and gets an error'
}

// Now we're going through the file structure to more
// directly grab the namespace with the types we're
// concerned about in this hypothetical file.
import { Login } from 'dappbot-types/spec/methods/auth';
const argsFromAuth:Login.Args = {
  username : "this object will have err because it's missing a property"
}
```

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
YOUR BITCOIN MANAGER
----------------
Thanks for downloading this package.

Thanks to this plugin you will be able to include Bitcoin cryptocurreny and Blockchain signning authentication
in your games and applications.

TUTORIAL
--------

 1. SET UP THE RUNTIME:

	First of all, we make sure that the Scripting Runtime Version: ".NET 4.x Equivalent" in order for the NBitcoin DLL to work.

 2. INSTALLATION OF NBitcoin DLL:

	On Visual Studio open the NuGet console and run the command line: "Install-Package NBitcoin"

	After installing the DLL you will be able to run the code without problems.

  3. You can find the basic installation video tutorial:

		https://youtu.be/qqK3heJMsNk

  4. Run the scene YourBitcoinManager.unity and you will be able to perform operations with Bitcoins.

	 Follow the instructions on the video tutorial playlist:

		https://www.youtube.com/playlist?list=PLPtjK_bez3T6TksPR5b7IsVbNmdLHmz8_


text:
# Amp.NET
[![Travis](https://img.shields.io/travis/joncloud/amp-net.svg)](https://travis-ci.org/joncloud/amp-net/)
[![NuGet](https://img.shields.io/nuget/v/Amp.svg)](https://www.nuget.org/packages/Amp/)

<img src="https://raw.githubusercontent.com/joncloud/amp-net/master/logo.png" alt="amp.net" />

## Description
Amp.NET provides warm up routines to ASP.NET Core applications.

## Licensing
Released under the MIT License.  See the [LICENSE][] file for further details.

[license]: LICENSE.md

## Installation
In the Package Manager Console execute

```powershell
Install-Package Amp
```

Or update `*.csproj` to include a dependency on

```xml
<ItemGroup>
  <PackageReference Include="Amp" Version="0.1.0-*" />
</ItemGroup>
```

## Usage
You can configure your application in order to specify Amp's behavior.
* Path - (`"/warmup"`) The path which invokes the asynchronous initialization
* Parallelism - (`WarmUpParallelism.Parallel`) Execution flow for each individual `IWarmUp`.

```csharp
public void ConfigureServices(IServiceCollection services) =>
  services.AddWarmUp(builder => {
    builder.Path = "/my-custom-path";
    builder.Parallelism = WarmUpParallelism.Sequential;
  });
```

You can warm up your application in one of two ways: asynchronous or synchronous.

### Asynchronous
Use asynchronous warm up when you want to initialize the system separately from application boot up.
```csharp
public void Configure(IApplicationBuilder app, IHostingEnvironment env) =>
  app.UseWarmUp().UseMvc();
```

### Synchronous
Use synchronous warm up when you need to initialize the system before the application begins to take requests.
```csharp
public void Configure(IApplicationBuilder app, IHostingEnvironment env) {
  app.WarmUpAsync().GetAwaiter().GetResult();
  app.UseMvc();
}
```

### Code Samples
Sample integration with Entity Framework Core:
```csharp
class Startup {
  ...

  public void ConfigureServices(IServiceCollection services) =>
    services.AddWarmUp().AddScoped<IWarmUp, ApplicationDbContextWarmUp>();

  public void Configure(IApplicationBuilder app, IHostingEnvironment env) =>
    app.UseWarmUp().UseMvc();
}

class ApplicationDbContextWarmUp : IWarmUp {
  readonly ApplicationDbContext _context;
  public ApplicationDbContextWarmUp(ApplicationDbContext context) => _context = context;

  public Task InvokeAsync() => _context.Users.AnyAsync();
}
```

For additional usage see [Tests][].

[Tests]: tests/Amp.Tests

repository: jangocheng/amp-net

repo_name: jangocheng/amp-net


text:
# xml-object-stream-sax

xml-object-stream-sax is a simple wrapper on top of sax.js that extracts json objects that match a given xpath-ish expression from an xml stream and passes them to a callback or stuffs them into a promised array.

## Usage

```javascript
var xos = require('xml-object-stream-sax')(/* config object */);
var xml = '<library>' +
          '<book published="1622"><author>John</author></book>' +
          '<book author="Jane"><author country="Uganda">Jane</author></book>' +
          '</library>';
xos(xml, '//book', function(book) { console.log(book); });
```

## Configuration

The config object is passed straight through to sax.js createStream, so any additional options applicable there are also applicable here.

### strict
**default: true**

Passed through to sax.js createStream to turn on strict parsing. Non-strict parsing assumes icase is true.

### pojo
**default: false**

Instead of creating a dom-ish tree, plain object trees will be assembled with xml attributes and children set as properties. Text is available as the text property. Same-named attributes and children are turned into array properties. If there are no children or attributes, the text will be used instead of an object.

### icase
**default: true**

If set to true, the xpath-ish query will be case-insensitive. Non-strict mode enables this by default.

### chunk
**default: 8196**

If the callback function accepts a done callback, then xml will be processed *chunk* characters at a time. So, there will be a short flood of match callbacks and the xml processor will wait until all of the callbacks are complete before releasing the next chunk. This is convenient for processing very large xml files with callbacks that do a lot of I/O. Instead of firing and queuing tons of callbacks while the rest of xml processing uses the cpu, the xml processor yields control until all of the callbacks are done for each chunk.

## Arguments

function(xml, xpath[, callback]);

### xml

This can be a string containing xml, in which case, it will be written directly to the sax stream.

It can be a string starting with 'http://', which will be opened with the node http module as a stream and piped to the sax stream.

It can be a string starting with 'file://', which will have the first 7 characters stripped off, be opened with the node fs module as a stream, and piped to the sax stream.

It can be an object with a pipe method, which will be called with the sax stream.

Anything else will cause an exception to be thrown.

### xpath

This is a very limited subset of xpath-ish syntax. /foo/bar will match bar nodes attached to a foo node, which is the root element. //bar will match any bar node in the hierarchy, including nested bar nodes. The direct descendent / and descendent // selectors may be intermingled as needed. /foo//bar//baz/bat will match bat nodes directly descended from baz nodes, which have bar ancestors, which have a foo root ancestor.

The matching is done using a non-gready regular expression made out of the xpath string. Only nodes that match or descend from a match of the xpath are kept around while the stream is being processed, so (theoretically) very large chunks of xml that have bits that are interesting deeply embedded in them should not consume too many resources.

### callback

function(node[, callback]);

For each matching object, the callback will be called with the matched object. If the callback itself accepts a callback, it is expected to call the callback when it is done so that processing may resume.

If no callback is provided a promise will be returned. If the promise is resolved, it will contain an array of all matched objects.

If a callback is provided, an object with an `onEnd` method will be returned. The `onEnd` method accepts a callback that will be called when all processing is complete.

## Changes

### 0.5.0

* CDATA is now considered to be text.
* Typings are now provided.

### 0.4.0

* Text from unmatched nodes is now discarded thanks to @sheershoff. Matching should also have slightly less overhead.

### 0.3.0

* __BUG:__ Fixed issues with the wrapped readable stream.
* The global `Promise` is now used rather than `when`.

### 0.2.0

* If the parser detects a URL starting with `https://` as xml input, it will use the proper client to open the stream.

### 0.1.0

* Harmony is no longer required.
* Multiple queries can be run simultaneously by passing an array of XPath-ish strings.
* If a callback is supplied, the object returned from the initial call to process xml will have an `onEnd` method that can be used to set a callback to be triggered after processing is complete.

repository: evs-chris/xml-object-stream

gha_language: JavaScript

repo_name: evs-chris/xml-object-stream


text:
# Documentation

Welcome to MikuBot's documentation page.

[Invite the bot here](https://discord.com/api/oauth2/authorize?client_id=512354713602228265&permissions=8&scope=bot)

[Source Code](https://github.com/darenliang/MikuBot)

[Support Server](https://discord.gg/Tpa3cJB)

The default prefix is `!` and is configurable via the [`@MikuBot prefix`](#prefix) command. Direct mentions `@MikuBot <command name>` also work.

You use [`@MikuBot help`](#help) to get the server prefix. Alternatively you can use the [`@MikuBot info`](#info) command.

MikuBot is currently in early stages of development. If you have any cool bot command ideas or have feedback, please feel free to DM me at **SirPlumPits#1760**. Thanks!

## Anime Commands

### anime

`anime <anime name>` gets anime info.

### manga

`manga <manga name>` gets manga info.

### musicquiz

`musicquiz` starts an anime music quiz.

`musicquiz <guess>` to guess the anime.

`musicquiz hint` to get hints.

`musicquiz giveup` to giveup.

### leaderboard

`leaderboard` displays your own music quiz score. It also shows your global and server rank.

`leaderboard server <optional page number>` display the anime music quiz leaderboard of your server.

`leaderboard global <optional page number>` display the global anime music quiz leaderboard.

### trivia

`trivia` starts an anime trivia question.

### sauce

`sauce <artwork or screenshot (attachment or url)>` attempts to determine where the image is from.

## Fun Commands

### image

`image` get a random user submitted server image.

`image <url or attachment>` submit images.

`image delete` to get directions on how to delete images.

`image delete <id>` delete image by id.

### snipe

`snipe` shows the last deleted message in the channel.

### owofy

`owofy <message>` owofies a message 😳.

### 8ball

`8ball <question>` to get a response.

### kaomoji

`kaomoji` returns a random kaomoji (づ｡◕‿‿◕｡)づ.

## Music Commands

### play

`play <url or video name>` to add song to queue and play music.

### skip

`skip` to skip current track.

### pause

`pause` to pause current track.

### resume

`resume` to resume current track.

### stop

`stop` to stop music and leave voice channel.

### queue

`queue <optional page number>` displays current queue.

### nowplaying

`nowplaying` show now playing track.

## Utility Commands

### help

`help` brings up a list of commands.

`help <command name>` gets help for specific command and displays a command's aliases.

### info

`info` gets bot info.

### prefix

`prefix` gets current prefix.

`prefix <prefix>` configures the server prefix.

### translate

`translate <message>` translates message to English.

`translate to:<language> <message>` translates message to specified language.

**Note:**

Please consult [ISO-639-1/2](https://cloud.google.com/translate/docs/languages) for all the language codes.

```
af, am, ar, az, be, bg, bn, bs, ca, ceb, co, cs, cy, da, de, el, en, eo, es, et,
eu, fa, fi, fr, fy, ga, gd, gl, gu, ha, haw, hi, hmn, hr, ht, hu, hy, id, ig, is,
it, iw, ja, jw, ka, kk, km, kn, ko, ku, ky, la, lb, lo, lt, lv, ma, mg, mi, mk,
ml, mn, mr, ms, mt, my, ne, nl, no, ny, pl, ps, pt, ro, ru, sd, si, sk, sl, sm,
sn, so, sq, sr, st, su, sv, sw, ta, te, tg, th, tl, tr, ug, uk, ur, uz, vi, xh,
yi, yo, zh-cn, zh-tw, zu
```

### avatar

`avatar` gets your own profile picture.

`avatar <mention|username|nickname|ID>` returns the respective profile picture.

### cloc

`cloc` gets the code line count of this bot.

`cloc <GitHub username / repo name>` gets the code line count of mentioned GitHub repo.

### ping

`ping` pings bot.

repository: darenliang/MikuBot

gha_language: TypeScript

gha_license_id: MIT

repo_name: darenliang/MikuBot


text:
# Advent of Code

## 2021

### Day 7: The Treachery of Whales

[Visit the original challenge page.](https://adventofcode.com/2021/day/7)

repository: DavidPesta/AdventOfCode

branch_name: refs/heads/main

repo_name: DavidPesta/AdventOfCode


text:
`nix-top`
=========

This is a script to help users figure out what's building.

Usage:

```
 $ nix-env -if .
 $ nix-top --help
Usage: nix-top [options]
   -d, --delay [seconds]            In seconds (default: 0.5)
   -1, --once                       Only run once (generates one screen)

```

### Privilege

If this script has enough privileges to read the `nixbld` user's processes
informations under `/proc/`, it will show the out path.

If it doesn't, it will make assumptions based on the contents of `/tmp`.


text:
# KPhotoAlbum_Export

## Usage
Here are the step to produce the export.

1.    Put in the same directory the index.xml from KPhotoAlbum and the script parseXML_KPA.py
1.    Run python parseXML_KPA.py, It will produce a file named: photos.js
1.    Copy your photos in a /mini folder and resize them to have a heigth of 150 px
1.    Now, organize your files this way:

..*In your root folder : tagGallery.js, index.html, style_js.css, mustache.js, photos.js (the file you produced), and a folder named "Photos"

..* In your "Photos" folder : your photos in a correct web size and a folder named "mini"

..* In your folder named "mini" : your tiny photos, heigth 150px.

## Live Demo
I have put here a [live demo](http://poivron-robotique.fr/Demo_KPA_export/)

## Based on
This project is using (Mustache.js)[https://mustache.github.io/] under
The MIT License

Copyright (c) 2009 Chris Wanstrath (Ruby)
Copyright (c) 2010-2014 Jan Lehnardt (JavaScript)
Copyright (c) 2010-2015 The mustache.js community

This project is using Lightbox2 under
The MIT License

by [Lokesh Dhakar](http://www.lokeshdhakar.com)

This project is using [JQuery](https://jquery.com/) under the MIT License


text:
# Active patterns

```fsharp
module Yacht

type Category =
    | Ones
    | Twos
    | Threes
    | Fours
    | Fives
    | Sixes
    | FullHouse
    | FourOfAKind
    | LittleStraight
    | BigStraight
    | Choice
    | Yacht

type Die =
    | One
    | Two
    | Three
    | Four
    | Five
    | Six

let private dieScore (die: Die): int =
    match die with
    | One   -> 1
    | Two   -> 2
    | Three -> 3
    | Four  -> 4
    | Five  -> 5
    | Six   -> 6

let private (|SingleThrow|) (target: Die) (dice: Die list): int =
    dice
    |> List.filter (fun die -> die = target)
    |> List.length

let private (|FullHouseThrow|_|) (dice: Die list): unit option =
    match List.countBy id dice |> List.sortBy snd with
    | [(_, 2); (_, 3)] -> Some ()
    | _ -> None

let private (|FourOfAKindThrow|_|) (dice: Die list): Die option =
    match List.countBy id dice |> List.sortBy snd with
    | [(number, 5)] | [_; (number, 4)] -> Some number
    | _ -> None

let private (|LittleStraightThrow|_|) (dice: Die list): unit option =
    match List.sort dice with
    | [Die.One; Die.Two; Die.Three; Die.Four; Die.Five] -> Some ()
    | _ -> None

let private (|BigStraightThrow|_|) (dice: Die list): unit option =
    match List.sort dice with
    | [Die.Two; Die.Three; Die.Four; Die.Five; Die.Six] -> Some ()
    | _ -> None

let private (|YachtThrow|_|) (dice: Die list): unit option =
    match List.distinct dice with
    | [_] -> Some ()
    | _ -> None

let score (category: Category) (dice: Die list): int =
    match category, dice with
    | Ones,           SingleThrow Die.One count   -> count * 1
    | Twos,           SingleThrow Die.Two count   -> count * 2
    | Threes,         SingleThrow Die.Three count -> count * 3
    | Fours,          SingleThrow Die.Four count  -> count * 4
    | Fives,          SingleThrow Die.Five count  -> count * 5
    | Sixes,          SingleThrow Die.Six count   -> count * 6
    | FullHouse,      FullHouseThrow              -> List.sumBy dieScore dice
    | FourOfAKind,    FourOfAKindThrow die        -> dieScore die * 4
    | LittleStraight, LittleStraightThrow         -> 30
    | BigStraight,    BigStraightThrow            -> 30
    | Yacht,          YachtThrow                  -> 50
    | Choice,         _                           -> List.sumBy dieScore dice
    | _,              _                           -> 0
```

This approach combines a number of functions from the [`List` module][list-module] with some pattern matching to score the dice.

## Scoring dice

A `Die` is defined by a discriminated union.
We need some way to convert its individual values to scores (e.g. `Three` should equal `3`).
One way to do this is by converting the discriminated union to an enum type:

```fsharp
type Die =
    | One   = 1
    | Two   = 2
    | Three = 3
    | Four  = 4
    | Five  = 5
    | Six   = 6
```

While this may look appealing, it is actually not recommend. As explained in this
[discriminated union vs enum types article][enum-types], it is possible to construct an enum value that doesn't match any of the predefined values.
For that reason, we'll stick with the discriminated union.

We'll support converting dice to scores via a function that uses some basic pattern matching:

```fsharp
let private dieScore (die: Die): int =
    match die with
    | One   -> 1
    | Two   -> 2
    | Three -> 3
    | Four  -> 4
    | Five  -> 5
    | Six   -> 6
```

````exercism/note
Another option would have been to add a member to the discriminated union:

```fsharp
type Die =
    | One
    | Two
    | Three
    | Four
    | Five
    | Six

    member this.Score: int =
        match this with
        | One -> 1
        | Two -> 2
        | Three -> 3
        | Four -> 4
        | Five -> 5
        | Six -> 6
```

We've chosen not to do this, as members are more awkward to use in higher-order functions, which we rely on a lot in this approach.
````

## Active patterns

[Active patterns][active-patterns] are used in pattern matching and can be used to categorize input and/or extract data from input.

There are two types of active patterns:

- Regular active patterns: these patterns will match any input
- Partial active patterns: these pattern will match some inputs, but not all

## Scoring categories

In this approach, we'll define active patterns for the different categories.
The idea is that if we're try to match category named `A`, then we have a corresponding active pattern named `AThrow` that will check if the dice match the category.

We'll use a combination of regular and partial active patterns.

Note that the active patterns do _not_ calculate scores, they're just there to help match input data.
This better separates responsiblities and opens up the active patterns for usage elsewhere.

These functions will then later on be called in the `score` function, like this:

```fsharp
let score (category: Category) (dice: Die list): int =
    match category, dice with
    | Yacht, YachtThrow -> 50
```

You can see that we're using regular pattern matching on the `category` parameter, which is a discriminated union.
However, we're _also_ pattern matching on the `dice` using a custom `YachtThrow` (active) pattern.
Let's start defining these active patterns!

### Single score

To score a single die, we need to:

1. Find the number of dice that match the target die
2. Multiply the number of matching dice with the die value

With the above steps, the output is also correct when the target die could not be found (zero times any dice value is zero).
Therefore, our active pattern can be a regular, non-partial active pattern as it will always match the input.

#### Score ones

Let's start by scoring the six die (`Die.Six`).
Our active pattern will take the thing we're matching on (the dice) as its sole parameter.
It wil return an `int` representing the number of six dice found, as the `score` function will require that information to calculate the score:

```fsharp
let private (|SixesThrow|) (dice: Die list): int =
    dice
    |> List.filter (fun die -> die = Die.Six)
    |> List.length
```

```exercism/note
Active patterns functions have their name specified between `(|` and `|)`.
This name will be used it in pattern matching, so choose the name accordingly.
```

The implementation is fairly straightforward.
We first filter the dice matching the six dice by using [`List.filter`][list.filter].
Then, we count those dice via [`List.length`][list.length], which is subsequently returned.

A different way to read this is: to use the `SixesThrow` active pattern, one has to pass it a list of dice and you'll get back their count.

We can now use this pattern in our `score` function:

```fsharp
match category, dice with
| Sixes, SixesThrow count -> count * 6
```

This is saying: if the category is `Sixes` _and_ the dice match the `SixesThrow` pattern (which they will always do), multiply the count (as returned by the `SixesThrow` pattern) by six to determine score.

We could continue defining similar patterns for the other five dice, but we can do something much nicer: parameterizing our active pattern.

##### Converting to a parameterized active pattern

Active patterns, like regular functions, can have parameters besides the value that is being matched on.
The only constraint is that the value to match on must be the last parameter.

To make our `SixesThrow` active pattern more generic, let's rename it to `SingleThrow` (as in: single dice throw) and add a parameter which is the target die:

```fsharp
let private (|SingleThrow|) (target: Die) (dice: Die list): int =
    dice
    |> List.filter (fun die -> die = target)
    |> List.length
```

The only thing we then need to change is to replace `Die.Six` with our `target` parameter in the `List.filter` call's lambda.

We can do use this pattern to score the six single dice categories:

```fsharp
match category, dice with
| Ones,    SingleThrow Die.One count   -> count * 1
| Twos,    SingleThrow Die.Two count   -> count * 2
| Threes,  SingleThrow Die.Three count -> count * 3
| Fours,   SingleThrow Die.Four count  -> count * 4
| Fives,   SingleThrow Die.Five count  -> count * 5
| Sixes,   SingleThrow Die.Six count   -> count * 6
```

### Full house score

A four of a kind score contains one dice at least four times.
We can use [`List.countBy`][list.countby] to return a list of pairs where the first value is the unique value and the second value is the number times it occurred in the list.

Then we pattern match the result of the `List.countBy` call with the two possible full house patterns:

1. The dice contain two numbers, and the first number occurs twice and the second number thrice times: `[(_, 2); (_, 3)]`
2. The dice contain two numbers, and the first number occurs thrice and the second number twice times: `[(_, 3); (_, 2)]`

As a full house is the sum of its dice, we don't have to return any value from our active pattern so we'll just return [`unit`][unit] (which is F#'s way of representing the absence of a value).

```fsharp
let private (|FullHouseThrow|_|) (dice: Die list): unit option =
    match List.countBy id dice with
    | [(_, 2); (_, 3)] | [(_, 3); (_, 2)] -> Some ()
    | _ -> None
```

```exercism/note
We have to define the `FullHouseThrow` active pattern as a _partial_ active pattern (indicated by the `|_|` suffix), as not all dice are a full house.
```

#### Simplifying

We can simplify things a bit by sorting the results, ordering by the second value (the count) using [`List.sortBy`][list.sortby] and [`snd`][snd] (which selects the second value).
This allows us to merge the second and third pattern:

```fsharp
let private (|FullHouseThrow|_|) (dice: Die list): unit option =
    match List.countBy id dice |> List.sortBy snd with
    | [(_, 2); (_, 3)] -> Some ()
    | _ -> None
```

#### Scoring

Let's use this pattern in our `score` function, where the score is just summing the dice scores via [`List.sumBy`][list.sumby] and our `dieScore` function:

```fsharp
match category, dice with
| FullHouse, FullHouseThrow -> List.sumBy dieScore dice
```

### Four of a kind score

A four of a kind score contains one dice at least four times.
We'll use the same strategy we just used for a full house, but this time looking for the following count patterns:

1. The dice contain just one number and it occurs five times: `[(number, 5)]`
2. The dice contain two numbers, and the first number occurs four times: `[(number, 4); _]`
3. The dice contain two numbers, and the second number occurs four times: `[_; (number, 4)`

We can use the same [`List.countBy`][list.countby] and pattern matching strategy

```fsharp
let private (|FourOfAKindThrow|_|) (dice: Die list): Die option =
    match List.countBy id dice with
    | [(number, 5)] | [(number, 4); _] | [_; (number, 4)] -> Some number
    | _ -> None
```

As scoring a four of a kind throw requires multipying the die occuring four times, we'll return that die from our function.

#### Simplifying

Once again, we can simplify things a bit by sorting the results, ordering by the second value (the count) using [`List.sortBy`][list.sortby] and [`snd`][snd] (which selects the second value).
This allows us to merge the second and third pattern:

```fsharp
let private (|FourOfAKindThrow|_|) (dice: Die list): Die option =
    match List.countBy id dice |> List.sortBy snd with
    | [(number, 5)] | [_; (number, 4)] -> Some number
    | _ -> None
```

#### Scoring

For the scoring of a four of kind throw, we'll capture the die in our active pattern, converting it to an `int` via `dieScore` and then multiply by four:

```fsharp
match category, dice with
| FourOfAKind, FourOfAKindThrow die -> dieScore die * 4
```

### Little straight score

A little straight contains the dice with face values 1, 2, 3, 4 and 5.
This can be directly translated into pattern matching:

```fsharp
let private (|LittleStraightThrow|_|) (dice: Die list): unit option =
    match List.sort dice with
    | [Die.One; Die.Two; Die.Three; Die.Four; Die.Five] -> Some ()
    | _ -> None
```

Note that we do need to call [`List.sort`][list.sort] first, as the dice aren't necessarily in order and pattern matching is sensitive to the ordering.

The pattern is defined as a partial active pattern (not all throws are little straights) and returns `unit`, as a little straight's score is always the same.

#### Scoring

Scoring little straights is very straightforward (pun intended):

```fsharp
match category, dice with
| LittleStraight, LittleStraightThrow -> 30
```

### Big straight score

A big straight contains the dice with face values 2, 3, 4, 5 and 6.
This can be directly translated into pattern matching:

```fsharp
let private (|BigStraightThrow|_|) (dice: Die list): unit option =
    match List.sort dice with
    | [Die.Two; Die.Three; Die.Four; Die.Five; Die.Six] -> Some ()
    | _ -> None
```

Once again, we need [`List.sort`][list.sort] to fix the ordering.

Like the little straight pattern, we're using a partial active pattern (not all throws are big straights) and return `unit`, as a big straight's score is always the same.

#### Scoring

We can score big straights as follows:

```fsharp
match category, dice with
| BigStraight, BigStraightThrow -> 30
```

### Yacht score

For the yacht category, we need to determine if all dice have the same face.
We can check this by using [`List.distinct`][list.distinct] to first remove any duplicates, and then use pattern matching to check if there is only one unique die:

```fsharp
let private (|YachtThrow|_|) (dice: Die list): unit option =
    match List.distinct dice with
    | [_] -> Some ()
    | _ -> None
```

````exercism/note
Alternatively, we could have counted the number of unique dice and checked if that was equal to one in an `if` expression:

```fsharp
let private (|YachtThrow|_|) (dice: Die list): unit option =
    if List.distinct dice |> List.length = 1 then Some () else None
```
````

#### Scoring

We can score yachts as follows:

```fsharp
match category, dice with
| Yacht, YachtThrow -> 50
```

### Choice score

Scoring the choice category is simple: we just need to sum all the dice.
We therefore don't need to define an active pattern and can just add the following to the `score` function's pattern matching:

```fsharp
| Choice, _ -> List.sumBy dieScore dice
```

```exercism/note
We're matching the dice using the wildcard pattern (`_`), which will match any input.
```

## Handling non-matching dice

So far, we've secretly ignored something quite important: what to do if the dice _don't_ match a category's active pattern!

The solution for this is simple though.
As dice that don't match the pattern should be scored as zero, we can just add two wildcards at the end of our `score` function and return zero:

```fsharp
| _, _ -> 0
```

## Putting it all together

Now that we support all categories and handle non-matching dice, let's see what the `score` function looks like:

```fsharp
let score (category: Category) (dice: Die list): int =
    match category, dice with
    | Ones,           SingleThrow Die.One count   -> count * 1
    | Twos,           SingleThrow Die.Two count   -> count * 2
    | Threes,         SingleThrow Die.Three count -> count * 3
    | Fours,          SingleThrow Die.Four count  -> count * 4
    | Fives,          SingleThrow Die.Five count  -> count * 5
    | Sixes,          SingleThrow Die.Six count   -> count * 6
    | FullHouse,      FullHouseThrow              -> List.sumBy dieScore dice
    | FourOfAKind,    FourOfAKindThrow die        -> dieScore die * 4
    | LittleStraight, LittleStraightThrow         -> 30
    | BigStraight,    BigStraightThrow            -> 30
    | Yacht,          YachtThrow                  -> 50
    | Choice,         _                           -> List.sumBy dieScore dice
    | _,              _                           -> 0
```

Quite nice!

[enum-types]: https://fsharpforfunandprofit.com/posts/enum-types/
[list-module]: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-listmodule.html
[list.distinct]: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-listmodule.html#distinct
[list.filter]: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-listmodule.html#filter
[list.length]: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-listmodule.html#length
[list.sumby]: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-listmodule.html#sumBy
[list.sort]: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-listmodule.html#sort
[list.sortby]: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-listmodule.html#sortBy
[list.countby]: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-listmodule.html#countBy
[active-patterns]: https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/active-patterns
[id]: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-operators.html#id
[snd]: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-operators.html#snd
[unit]: https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/unit-type

repository: exercism/fsharp

gha_language: F#

repo_name: exercism/fsharp


text:
# Contribute to the CoE Starter Kit

Welcome, and thank you for your interest in contributing to the CoE Starter Kit.

There are many ways in which you can contribute to the CoE Starter Kit. The goal of this document is to provide a high-level overview of how you can get involved.

## Asking and Answering Questions

Join the [discussions](https://github.com/microsoft/coe-starter-kit/discussions) and ask your question or contribute by answering questions from others. This is a great way to contribute by helping the CoE Starter Kit community

## Report a Bug or submit a Feature Request

Have you found a bug in the CoE Starter Kit or do you want to suggest a new feature? Either way, please let us now by filing an issue while observing the following guidelines

### Look for an existing issue

Before submitting your issue please search the [issues](https://github.com/microsoft/coe-starter-kit/issues) to ensure your issue has not already been reported

If your bug or feature request has already been reported you are welcome to join the conversation by commenting and adding your reaction. Please use reactions to vote and not "+1" comments.

- 👍 - upvote
- 👎 - downvote

### Submitting your Issue

Select the Issue template that matches the solution for which you want to submit an issue.

File a single issue per problem and feature request. Do not enumerate multiple bugs or feature requests in the same issue.

Do not add your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes.

The more information you can provide, the more likely someone will be successful at reproducing the issue and finding a fix.

Observe the inline guidelines of the Issue template.

## Contribute with Code

If you are interested in contributing to the CoE Starter Kit by fixing issues or adding features please read the [How to Contribute](HOW_TO_CONTRIBUTE.md) guide.

## Thank You

repository: microsoft/coe-starter-kit

gha_license_id: NOASSERTION

repo_name: microsoft/coe-starter-kit


text:
# Introduction

This plugin implements github/github entreprise configuration to build
an SCM environment for GIT repositories upstream.

It has been implemented as REST API. See ...(TBD) for FORJJ REST API description.

Forjj call this plugin, when you declare the following in your Forjfile:

```yaml
applications:
  <app name>:
    type: upstream
    driver: github
```

You can add several application options.

For flag details, see https://github.com/forj-oss/forjj-contribs/blob/master/upstream/github/github.yaml#L29

Complete example:
```yaml
applications:
  github:
    type: upstream
    driver: github
    # teams-disabled: false
    # organization-webhooks-disabled: false
    # repos-webhooks-disabled: false
    # repos-disabled: false
    # token: MygithubToken  -  Forjj template only
    organization: myOrganization # if github && forjj organization are different
    org-hook-policy: manage # 'manage' will maintain only listed hooks. by default, 'sync' is defined and will eliminate any extra webhooks not listed.
    server: github.mycompany.com
```

forjj-github manage several objects: For details, see https://github.com/forj-oss/forjj-contribs/blob/master/upstream/github/github.yaml
- app (the application ie `applications` section)
- group # To maintain a collection of groups with members. **Warning!** not defined groups are removed by default!
- user  # To maintain a collection of users at organization level
- repo  # To create/update a collection of repository. **Repo are never removed**.
- webhooks # To maintain a collection of webhook at organization or repo level.

A good example is in https://github.com/forj-oss/forj-oss-infra/blob/master/Forjfile

# How Forjj interacts with the plugin?

`Forjj` has a simplified list of actions: `create`/`update`/`maintain`
Following explains what `forjj-github` will do for `Forjj`.

## Create task

`Create` properly configure the server side to have at least the `infra` repository created.

It will create a `<infra>/apps/upstream/github.yaml` which describes how github must be configured properly.

On github server, through Github API, the driver will ensure element requested will exist. So it can:
- Create/Configure the organization (with members)
- Create/Configure the `infra` repository (with members)

The creation of the initial repositories/organization/... are done automatically at create time by the maintain task described below.

As soon as `<infra>/apps/upstream/github.yaml` exists, create will fails and ask to use update instead.
**Warning!!!** If the server side has already been configured, create will create the file and start the maintain task, as usual. And then Maintain will change anything to comply the newly created `github.yaml`

## Update task

Update mainly do update in the local `infra` repo and reports file updated to forjj. (The flow must be configured to push to the right place.)
It may (TBD) do the following:
- Update the list of repositories and rights
- Update github configuration data about each repositories in `<organization>-infra/repos/<repo>/`

## Maintain task
This will ensure the SCM server side is properly configured and really update the server:

- update organization/rights
- update repositories/rights
- create/remove repositories
  By default it initializes the repository with a README.md
  But if a migrate upstream has been identified, it will clone it and push it as a new repo in github.

Usually this tasks a 'Ops' task that has the appropriate right to update the infra. And it should be update by an automated job, like a jenkins job or a hubot task.

This does mean you no one approve this to be done. It depends on the flow you choose.

In the github PR flow, a jenkins job should be started as soon as the Ops infra team accept the update through a PR and merge it.

# Local remotes

Depending on the flow the team want to use, local git remote can have 'origin' + 'upstream'

# github flows

The way you use github depends on your need.
A flow usually means that you have CI/CHAT/SCM/... tools integrated to realize your flow.
So a real flow should be implemented technically by apply a flow to your repository. This could be part of the forjj link task. But this part still under reflexion and needs to be shortly implemented.

The idea could be to implement the flow by calling a 'flow create/update/maintain' that a specific github or other app driver will do.
For example, for a PR with github/jenkins, who will take care of configuring them (jenkins/github) ? may be both but not completely sure.
For now, the jenkins-ci discussed a little about this flow implementation details as what we need to see on jenkins side in term of jobs.

See [jenkins-ci README](https://github.com/forj-oss/forjj-contribs/ci/jenkins-ci/README.md)

This will be analyzed and a proposal will be posted later.

The FORJ Team

repository: clarsonneur/forjj-github

repo_name: clarsonneur/forjj-github


text:
Reference:
https://docs.docker.com/engine/security/

##Docker security introduction
------------------------------

Four major areas to consider when reviewing Docker security:
	- intrinsic security of the kernel and its support for namespaces and cgroups;
	- attack surface of the Docker daemon itself;
	- loopholes in the container configuration profile,
		either by default,
		or when customized by users.
	- “hardening” security features of the kernel and how they interact with containers.

#Kernel namespaces
------------------
Docker containers
	very similar to LXC containers
	have similar security features.

	Start a container with docker run,
		behind the scenes
			Docker creates a set of
				namespaces and
				control groups
					for the container.

Namespaces provide the first and most straightforward form of isolation:

Each container also gets its own
	network stack
	i.e. container doesn’t get privileged access to the sockets or interfaces of another container.
	When you specify
		public ports for your containers or
		use links
	then IP traffic is allowed between containers.

	They can
		ping each other,
		send/receive UDP packets
		establish TCP connections,
	This can be restricted if required.

	From a network architecture point of view,
		all containers on a given Docker host are sitting on bridge interfaces (default).
	ie.. they are just like physical machines connected through a common Ethernet switch;
		no more,
		no less.

How mature is the code providing kernel namespaces and private networking?
Kernel namespaces
	introduced between kernel version 2.6.15 and 2.6.26.
		in July 2008 (date of the 2.6.26 release ),
	code has been exercised and scrutinized on a large number of production systems.
	The design and inspiration for the namespaces code are even older.
		features of OpenVZ
			initially released in 2005
			both the design and the implementation are pretty mature.

#Control groups
---------------
Control Groups
	another key component of Linux Containers.
	Implement resource accounting and limiting.
	Provide
		many useful metrics,
		ensure that each container gets its fair share of
			memory,
			CPU,
			disk I/O;
			ect.
		Ensure a single container cannot bring the system down
			by exhausting one of those resources.
			So reduced risk of impact on the host system kernel.
			This helps to reduce denial-of-service attacks probablity.
			Particularly important on multi-tenant platforms like aws
				guarantee a consistent
					uptime (and performance)
						even when some applications start to misbehave.

Control Groups have been around for a while as well:
	the code was started in 2006
	initially merged in kernel 2.6.24.

#Docker daemon attack surface
-----------------------------
Running containers (and applications) with Docker implies running the Docker daemon.
This daemon requires root privileges
	[unless you opt-in to Rootless mode],
This exposes some risk. So.
	Only trusted users should be allowed to control your Docker daemon.
	This is a direct consequence of some powerful Docker features.
	Docker allows you to
		share a directory between the Docker host and a guest container
		you can do that without limiting the access rights of the container.
	So you can start a container where the critical directories are shared.
	Solution: Use volumes as much as possible.
	Security risk can be even higher if your container is exposed through API
	So always
		expose REST Api over https and secure it using certificates.
		ensure that it is reachable only from a trusted network or VPN.

	The REST API server endpoint
		(used by the Docker CLI to communicate with the Docker daemon) changed in Docker 0.5.2,
		now uses a UNIX socket instead of a TCP socket bound on <IP_ADDRESS>
		(TCP socket is prone to cross-site request forgery attacks if you happen to run Docker directly on your local machine, outside of a VM).
	Use traditional UNIX permission checks to limit access to the control socket.

	If you prefer SSH over TLS
		You can also use DOCKER_HOST=ssh://USER@HOST or ssh -L /path/to/docker.sock:/var/run/docker.sock.

The daemon is also potentially vulnerable to other inputs
	e.g. image loading from either disk with docker load
or
	docker pull.

As of Docker 1.3.2,
	images are now extracted in a chrooted subprocess on Linux/Unix platforms,
		first-step in a wider effort toward privilege separation.
As of Docker 1.10.0
	all images are stored and accessed by the cryptographic checksums of their contents,
	limiting the possibility of an attacker causing a collision with an existing image.
Recommendation
	Run Docker exclusively on a server with bear min. other software

#Linux kernel capabilities
By default,
	Docker starts containers with a restricted set of capabilities.

	Capabilities turn the binary “root/non-root” dichotomy into a fine-grained access control system.
	Processes (like web servers) that just need to bind on a port below 1024
		do not need to run as root:
		they can just be granted the net_bind_service capability instead.
		And there are many other capabilities, for almost all the specific areas where root privileges are usually needed.

This means a lot for container security; let’s see why!

Typical servers run several processes as root
	including the SSH daemon,
	cron daemon,
	logging daemons,
	kernel modules,
	network configuration tools,
	ect.
In containers most of those tasks are handled by the infrastructure around the container:

	SSH
		managed by a single server running on the Docker host
	cron,
		can run as a user process
	log management
		can be handed to Docker, or
		third-party services like Loggly or Splunk;
	hardware management
		irrelevant,
	network management
		happens outside of the containers
		what is happening within containers can be well managed.
	So most containers do not need “real” root privileges at all.
		deny all “mount” operations;
		deny access to raw sockets (to prevent packet spoofing);
		deny access to some filesystem operations,
			like creating new device nodes,
			changing the owner of files
			altering attributes etc;
		deny module loading;
		etc.
So if an intruder manages to escalate to root within a container
	it is much harder to do serious damage
	or to escalate to the host.

This doesn’t affect regular web apps
but reduces the vectors of attack by malicious users considerably.

One primary risk with running Docker containers with
	default set of capabilities and mounts given to a container may provide
		incomplete isolation

Docker supports the addition and removal of capabilities
	allowing use of a non-default profile.
	This may make Docker more secure through capability removal, or less secure through the addition of capabilities. The best practice for users would be to remove all capabilities except those explicitly required for their processes.

#Docker Content Trust Signature Verification
The Docker Engine can be configured to only run signed images.
The Docker Content Trust signature verification feature
	built directly into the dockerd binary.

This is configured in the Dockerd configuration file.
To enable this feature
	trustpinning can be configured in daemon.json
	whereby only repositories signed with a user-specified root key can be pulled and run.

Provides more insight to administrators
	than previously available with the CLI
	for enforcing and performing image signature verification.

More details: https://docs.docker.com/engine/security/trust/

#Other kernel security features
Capabilities
	security feature provided by modern Linux kernels.
	Possible to inegrate existing Docker with well-known systems like
		TOMOYO,
		AppArmor,
		SELinux,
		GRSEC,
		etc. with Docker.

While Docker currently only enables capabilities
	it doesn’t interfere with the other systems.

So there are different ways to harden a Docker host.
For examples.
	Run a kernel with GRSEC and PAX.
		This adds many safety checks, both at compile-time and run-time; it also defeats many exploits, thanks to techniques like address randomization. It doesn’t require Docker-specific configuration, since those security features apply system-wide, independent of containers.

	Docker ships a template that works with AppArmor
	Red Hat comes with SELinux policies for Docker.
	These templates provide an extra safety net
	N.B: It may overlap greatly with capabilities.

	Define your own policies using your favorite access control mechanism.
	Use third-party tools to augment Docker containers, including special network topologies or shared filesystems, tools exist to harden Docker containers without the need to modify Docker itself.

As of Docker 1.10 User Namespaces are supported directly by the docker daemon. This feature allows for the root user in a container to be mapped to a non uid-0 user outside the container, which can help to mitigate the risks of container breakout. This facility is available but not enabled by default.

Refer to the daemon command in the command line reference for more information on this feature. Additional information on the implementation of User Namespaces in Docker can be found in this blog post.

##List of vulnerablities already fixed
https://docs.docker.com/engine/security/non-events/

## Protect Docker Daemon Host
https://docs.docker.com/engine/security/protect-access/

#Protect the Docker daemon socket

By default,
	Docker runs through a non-networked UNIX socket.
	OPTIONALLY communicate using SSH or a TLS (HTTPS) socket.

#Use SSH to protect the Docker daemon socket

The given USERNAME
	must have permissions to access the docker socket on the remote machine.
	How to give a non-root user access to the docker socket.
		Refer: https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user

Creates a docker context to connect with a remote dockerd daemon on host1.example.com using SSH, and as the docker-user user on the remote machine:

 docker context create \
    --docker<EMAIL_ADDRESS>\
    --description="Remote engine" \
    my-remote-engine
After creating the context, use docker context use to switch the docker CLI to use it, and to connect to the remote engine:

	docker context use my-remote-engine
	docker info

Use the default context to switch back to the default (local) daemon:
	docker context use default

------------------------------------------------
Alternatively, use the DOCKER_HOST environment variable to temporarily switch the docker CLI to connect to the remote host using SSH. This does not require creating a context, and can be useful to create an ad-hoc connection with a different engine:

 export<EMAIL_ADDRESS> docker info
------------------------------------------------

#Use TLS (HTTPS) to protect the Docker daemon socket
To make Docker reachable through HTTP (not SSH) in a safe manner
	enable TLS (HTTPS)
	specify the tlsverify flag
		pointing Docker’s tlscacert flag to a trusted CA certificate.

In the daemon mode,
	(dockerd -D #more details: https://docs.docker.com/engine/reference/commandline/dockerd/)
	it only allows connections from clients authenticated by a certificate signed by that CA.
	In the client mode, it only connects to servers with a certificate signed by that CA.

Create a CA, server and client keys with OpenSSL
Note: Replace all instances of $HOST in the following example with the DNS name of your Docker daemon’s host.

First, on the Docker daemon’s host machine, generate CA private and public keys:

For TLS and SSH

Reference: https://docs.docker.com/engine/security/protect-access/

fyi: Execute with root - sudo su mode
Replace $HOST with private host name.
For the following it is fine to give private and public IP and DNS

echo subjectAltName = DNS:$HOST,IP:<IP_ADDRESS>,IP:<IP_ADDRESS> >> extfile.cnf
echo subjectAltName = DNS:<Public DNS>,DNS:<Private DNS>,IP:<Public IP>,IP:<IP_ADDRESS>,IP:<Private IP> >> extfile.cnf

----------------------------------------
#Verify repository client with certificates
	The right way to configure the client with the certificates generated from the server is described here..

	Watch out for https://docs.docker.com/engine/security/certificates/

-------------------------------------------
SSH access from one machine to another
ssh-keygen
Hit enter enter enter. You'll have two files:

.ssh/id_rsa
.ssh/id_rsa.pub
On Server A, cat and copy to clipboard the public key:

cat ~/.ssh/id_rsa.pub
[select and copy to your clipboard]
ssh into Server B, and append the contents of that to the it's authorized_keys file:

cat >> ~/.ssh/authorized_keys
[paste your clipboard contents]
[ctrl+d to exit]
Now ssh from server A:

ssh -i ~/.ssh/id_rsa private.ip.of.other.server

------------------
Reference of SSH: same as above "
SSH may not work due to the bug: https://github.com/docker/compose-cli/issues/811
docker context create \
    --docker<EMAIL_ADDRESS>\
    --description="Remote engine" \
    my-remote-engine

 docker context create test --docker "host=ssh://<IP_ADDRESS>"

##Antivirus software and Docker
	https://docs.docker.com/engine/security/antivirus/

##AppArmor security profiles for Docker
	https://docs.docker.com/engine/security/apparmor/

AppArmor (Application Armor)
	Linux security module
	protects an operating system and its applications from security threats.
	To use it,
		associate an AppArmor security profile with each program.
	Docker expects to find an AppArmor policy loaded and enforced.

Docker automatically generates and loads a default profile for containers named docker-default.
The Docker binary generates this profile in tmpfs and then loads it into the kernel.

Note: This profile is used on containers, not on the Docker Daemon.

A profile for the Docker Engine daemon exists
	but it is not currently installed with the deb packages.
If you are interested in the source for the daemon profile
	it is located in contrib/apparmor in the Docker Engine source repository.

Understand the policies
The docker-default profile is the default for running containers.
It is moderately protective while providing wide application compatibility.
The profile is generated from the following template.

When you run a container,
	it uses the docker-default policy unless you override it with the security-opt option.
	For example, the following explicitly specifies the default policy:

	$ docker run --rm -it --security-opt apparmor=docker-default hello-world

Load and unload profiles
To load a new profile into AppArmor for use with containers:

$ apparmor_parser -r -W /path/to/your_profile
Then, run the custom profile with --security-opt like so:

$ docker run --rm -it --security-opt apparmor=your_profile hello-world
To unload a profile from AppArmor:

# unload the profile
$ apparmor_parser -R /path/to/profile
Resources for writing profiles
The syntax for file globbing in AppArmor is a bit different than some other globbing implementations. It is highly suggested you take a look at some of the below resources with regard to AppArmor profile syntax.

Quick Profile Language
Globbing Syntax


text:
## app-deploy

Thrifty incremental deploys.

Rough algorithm description:

1. Figure out which files were changed since last deploy (through `git diff`).
2. Figure out which tasks should be executed.
3. Execute tasks.

## Installation

```
npm install -g app-deploy
```

## Usage

Deploy app to production:

```
ad deploy production
```

Looks nice but first you need to configure!

## Initial notices

`app-deploy` is dedicated to do incremental deploy of already running app/service, first time you
should setup and run your application manually.

It's not dedicated to deploy "new app instances".

## Triggers deploy config

Triggers config must be located in project root (and must be named `app-deploy.json`).
It consists of simple rules and triggers which are used to figure out how to deploy app.

Sample config describes conditions and triggers for `app-deploy` cli util:

```js
{
	"triggers": {
		// if bower.json was changed since last deploy then execute "bower install"
		"bower.json"   : "bower intall",

		// if bower.json was changed since last deploy then execute "npm install"
		"package.json" : "npm intall",

		// if there are any changed or added fiels matching database/** globa pattern
		// then execute "knex migrate:latest"
		"database/**"  : "knex migrate:latest",

		// if any local dependency which are required by any file under web/**
		// were changed then execute "pm2 restart all"
		"+web": "pm2 restart all"
	}
}
```

Each "trigger" consits of condition (glob or requires matching pattern) and shell command
which will be executed if condition is true (if files diff since last deploy matches condition pattern)

## Add remote server (for remote deploy)

Add remote:

```
ad remote add <remote name> <ssh connection string> [--env]
```

Example adding `my-localhost-server` remote:

```
ad remote add my-localhost-server root@<IP_ADDRESS>:/var/www/application --env="override_some_stuff=123"
```

To work with remote deploys you must configure key-based ssh auth to work from your local machine to remote server.
[How To Configure SSH Key-Based Authentication on a Linux Server](https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server)

Now we are ready to deploy!

```
ad deploy my-localhost-server
```

## License
MIT


text:
# Here lies the detailed description on how to conduct tests for homework 3.

## 1. Get people to sign up for your experiment.
We get around 10 participants for the experiment and give them keys that they will use from here on, as a placeholder for their identity with respect to this task.

For example, they will use these keys on the forms pertaining to this experiment instead of their names or email IDs . This way they are anonymous. This gives them the power to freely participate in the test without any fear or feeling of being judged.

## 2. Ask participants to fill the [pre-debugging survey](https://docs.google.com/forms/d/e/1FAIpQLSdFWBKKwtmoXGe220kCVoX_K859VLqQrK5XGpPASdzAoOuPww/viewform?usp=sf_link) google form.
A `pre-debugging survey` form is a google form that aims to know more about the participants and their initial feelings about the languages used.

We first ask them about their familiarity with the respective languages. The answer for this can be used for understanding the prior knowledge of the participants; which can be used for various inferences. One of them can be that if the language was already famous with the majority of people, it may become the easiest debugged language of all given programming languages in question. Hence, such a result is less indicative of the apparent ease that comes with using that particular language but more with the participants already knowing about the language.

Next, we can show them a famous snippet from the languages in question (for example Fibonacci or matrix multiplication) or a snippet from our `Game of Life` code and ask them their instinct about the apparent ease of debugging the language. This will aim to see what language "seems" easy to debug.

At last, we ask them about the languages they already know. The answer would not be restricted and will include every language in the world. This can be used to find any correlation between the language that the participant may find easy to debug and the languages they already knew.

## 3. The debugging task.
The participants will be invited to a 30-minute zoom call, based on a mutually decided time.

They will be sent the `pre-debugging survey` google form prior to the task and a `post-debugging survey` google form will be sent after the task.

Again, the participants will be asked to conceal their identity, by any means the technology allows. For example, they can change their names before the call, and also they can talk to us via chat only and no audio.

About the task:
1. It will be proctored by one of the group members.
2. The participant will be sent a link with instructions on how to access and debug the code.
3. The audio from the group member conducting the task will be on and they will narrate, communicate, and direct the participants about the technical aspects.
4. The participant will be asked to share the screen. But they can mute their audio and communicate only via chat.
5. The participant will be aware of the number of bugs and can shift between languages however they want.
6. They will be free to use any resource on the internet, except for the GitHub repository of the testing group.

## 4. Ask participants to fill the [post-debugging survey](https://docs.google.com/forms/d/e/1FAIpQLSeaNjVP7B2jWqTIE4jHouHyiM7rJ4r7Y3KSnu1K3DbI8t2Yrw/viewform?usp=sf_link) google form.

This survey will aim to get to know about their performance during the debugging task and their experience.

We first ask them about the number of bugs that they found in each language. The purpose of this is self-explanatory.

Next, we ask them about how their rating for each language based on the difficulty of debugging during the task. This gives us their experience with each of the languages.

We also ask them to rank the languages based on the difficulty of debugging it. This is to get the relative difficulty of the languages with each other. This question will have an open-ended follow-up, asking them for their reasons for the rankings.

At last, we ask them if they felt the code was difficult to understand because of the way the author wrote it. This question will also have an open-ended follow-up, asking them to give some suggestions on how to improve our methods of testing and coding.

>NOTE: The google forms will only allow you to access it if you're logged in with NCSU ID.

gha_language: Go


text:
# City Cker

This demo application pulls a list of all indian cities and shows them to you. You can favorite the cities you like.  This demo application shows the usage of Chopper for flutter, to make http requests, Built Value for data models, Moor for flutter, to enable persistent data and get_it package for dependency injection.
API in use can be found at [Indian Cities REST API](https://indian-cities-api-nocbegfhqg.now.sh)

## Jump to code:

* [chopper - Dart Package](https://pub.dev/packages/chopper) : [Jump to lib/data/cities_api_service.dart](https://github.com/emem365/city_c_ker/blob/master/lib/data/cities_api_service.dart)
* [built_value - Dart Package](https://pub.dev/packages/built_value) : [Jump to lib/models/built_city.dart](https://github.com/emem365/city_c_ker/blob/master/lib/models/built_city.dart)
* [moor - Dart Package](https://pub.dev/packages/moor) : [Jump to lib/data/persistent_database.dart](https://github.com/emem365/city_c_ker/blob/master/lib/data/persistent_database.dart)
* [get_it - Dart Package](https://pub.dev/packages/get_it) : [Jump to lib/data/service_locator.dart](https://github.com/emem365/city_c_ker/blob/master/lib/data/service_locator.dart)

## Getting Started

This is simple flutter project. If you want to mess around with the code, just clone the repo: https://github.com/emem365/city_c_ker.git

### Prerequisites

All you need to get this project running is to set up flutter in your system. To get started with flutter visit [here](https://flutter.dev/docs/get-started/install)

### Installing

Clone the project. Make sure you have an emulator running or a device connected to your pc

Run using:
```
flutter run
```

## Built With

* [Flutter](https://flutter.dev/) - Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.
* [Indian Cities REST API](https://indian-cities-api-nocbegfhqg.now.sh) - API in use

## Authors

* **Madhur Maurya** - *Creator* - [emem365](https://github.com/emem365)

## Acknowledgments

* Again, a huge thanks to [Indian Cities REST API](https://indian-cities-api-nocbegfhqg.now.sh) whose free api we use :)


text:
# Sensorberg SDK for Windows BETA #

# Please note there is a BETA release. There is some issues that still need to be resolved.
Check the list of [issues](https://github.com/sensorberg-dev/windows10-sdk/issues) to see all issues.

## Compatibility ##

Sensorberg SDK for Windows is supported on Windows 10.

Sensorberg SDK has a dependency to SQLite library, which does not support
"Any CPU" configuration. Thus, your Sensorberg application will only support
x86, x64 and ARM builds.

## Taking Sensorberg SDK into use ##

### Prerequisites ###

VSIX package "Universal App Platform development using Visual Studio 2015 CTP"
needs to be installed to Visual Studio 2015. Package is available at
http://www.sqlite.org/download.html

### 1. Add Sensorberg SDK projects into your solution ###

Right click the solution in **Solution Explorer**, select **Add** and
**Existing Project...**

![Adding Sensorberg SDK projects](/Doc/Images/AddingExistingProject.png)

Browse to the folder where you have the two Sensorberg SDK projects
(`SensorbergSDK` and `SensorbergSDKBackground`) and select the `csproj` files of
both projects. Note that you may have to add the projects one by one.

### 2. Add Sensorberg SDK project references ###

Add the two SDK projects to your application project as references. Right click
**References** under your application project and select **Add Reference...**

![Adding reference](/Doc/Images/AddingReference.png)

Locate the two SDK projects and make sure that the check boxes in front of them
are checked and click **OK**.

![Adding SDK projects as references](/Doc/Images/AddingSDKProjectsAsReference.png)

### 3. Declare background tasks in manifest file ###

Add the following `Extensions` into your `Package.appxmanifest` file:

```xml
  <Applications>
    <Application Id="App"
      Executable="$targetnametoken$.exe"
      EntryPoint="MySensorbergApp.App">

      ...

      <Extensions>
        <Extension Category="windows.backgroundTasks" EntryPoint="SensorbergSDKBackground.AdvertisementWatcherBackgroundTask">
          <BackgroundTasks>
            <Task Type="bluetooth" />
          </BackgroundTasks>
        </Extension>
        <Extension Category="windows.backgroundTasks" EntryPoint="SensorbergSDKBackground.TimedBackgroundTask">
          <BackgroundTasks>
            <Task Type="timer" />
          </BackgroundTasks>
        </Extension>
      </Extensions>

      ...

    </Application>
  </Applications>
```

### 4. Declare capabilities in manifest file ###

Make sure that you have at least `internetClient` and `bluetooth` capabilities
declared in your `Package.appxmanifest` file:

```xaml
  ...

  </Applications>

  <Capabilities>
    <Capability Name="internetClient" />
    <DeviceCapability Name="bluetooth" />
  </Capabilities>
</Package>
```

### 5. Take SDKManager into use ###

The following snippet demonstrates how to integrate the Sensorberg SDK
functionality to the main page of your application:

```cs
using SensorbergSDK;
using System;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;

namespace MySensorbergApp
{
    public sealed partial class MainPage : Page
    {
        private SDKManager _sdkManager;

        public MainPage()
        {
            this.InitializeComponent();

            _sdkManager = SDKManager.Instance(0x1234, 0xBEAC); // Manufacturer ID and beacon code

            _sdkManager.BeaconActionResolved += OnBeaconActionResolvedAsync;
            Window.Current.VisibilityChanged += SDKManager.Instance.OnApplicationVisibilityChanged;
        }

        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            BeaconAction pendingBeaconAction = BeaconAction.FromNavigationEventArgs(e);

            if (pendingBeaconAction != null)
            {
                _sdkManager.ClearPendingActions();

                if (await pendingBeaconAction.LaunchWebBrowserAsync())
                {
                    Application.Current.Exit();
                }
                else
                {
                    OnBeaconActionResolvedAsync(this, pendingBeaconAction);
                }
            }

            _sdkManager.InitializeAsync("04a709a208c83e2bc0ec66871c46d35af49efde5151032b3e865768bbf878db8");
            await _sdkManager.RegisterBackgroundTaskAsync();
        }

        private async void OnBeaconActionResolvedAsync(object sender, BeaconAction e)
        {
            await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
                Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
                {
                    MessageDialog messageDialog = e.ToMessageDialog();
                    await messageDialog.ShowAsync();
                });
        }
    }
}
```

In `OnNavigatedTo` method we first check for pending actions. If the background
task has created a notification and the user clicks/taps the notification, your
application is launched with the pending action in `NavigationEventArgs`. It is
recommended to check the pending actions before initializing the SDK. Otherwise,
**all** the pending actions are delivered to `OnBeaconActionResolvedAsync` event
handler. Note that we clear all the pending actions and react only to the action
associated with the notification the user clicked/tapped. All the notifications
"remember" their actions so calling `ClearPendingActions` method will not affect
them.

Sensorberg SDK is initialized with `InitializeAsync` method, which takes your
API key as the only argument. For creating your service and API key, visit
https://manage.sensorberg.com

You must implement the handling of the beacon actions in
`OnBeaconActionResolvedAsync()`. In the example above, we simply display a
message dialog with the action content.

It is also highly recommended to ask the user for the permission to enable the
background task. Notifications are created automatically by the background task.
You can register and unregister the background task using `SDKManager` methods
`RegisterBackgroundTaskAsync` and `UnregisterBackgroundTask`.

## SDKManager public interface ##

### Events ###

| Name | Argument | Description |
| ---- | -------- | ----------- |
| BackgroundFiltersUpdated | - | Fired, when the filters containing beacon IDs for the background task trigger have been updated. |
| BeaconActionResolved | BeaconAction | Fired, when a beacon action has been resolved and the application should react to it. |
| FailedToResolveBeaconAction | string | Fired, when the SDK fails to resolve an action associated with a beacon event. Typically this event can be ignored. |
| LayoutValidityChanged | bool | Fired, when a layout (contains known beacons and actions associated with them) is either invalidated or validated. |
| ScannerStatusChanged | ScannerStatus | Fired, when the status of the scanner changes. Useful for detecting if the bluetooth has been turned off on the device (status will have value `Aborted`). |

### Properties ###

| Name | Type | Description |
| ---- | ---- | ----------- |
| Scanner | Scanner | The scanner instance. Guaranteed to be not null. |
| ApiKey | string | The API key for Sensorberg service. The recommended way to set the API key is to call `SDKManager.InitializeAsync` method. |
| ManufacturerId | UInt16 | The manufacturer ID for filtering the beacons. |
| BeaconCode | UInt16 | The beacon code for filtering the beacons. |
| IsInitialized | bool | True, if the SDK has been initialized. |
| IsBackgroundTaskRegistered | bool | True, if the background tasks have been registered. |
| IsScannerStarted | bool | True, if the scanner is running. |
| IsLayoutValid | bool | True, if the layout (contains known beacons and actions associated with them) is valid. |

### Methods ###

| Name | Arguments | Returns | Description |
| ---- | --------- | ------- | ----------- |
| Instance (static) | UInt16 manufacturerId, UInt16 beaconCode | SDKManager | Returns the singleton instance of SDKManager class. Takes the manufacturer ID and beacon code for filtering the beacons as arguments. |
| LaunchBluetoothSettingsAsync | - | - | Displays the device bluetooth settings. For allowing user to enable bluetooth, if turned off. |
| InitializeAsync | string apiKey | - | Initializes the SDK. Note that the API key is stored in the application settings automatically. |
| Deinitialize | bool stopScanner | - | De-initializes the SDK. |
| RegisterBackgroundTaskAsync | - | BackgroundTaskRegistrationResult | Registers the background tasks. Note that the API key should be set before registering the background tasks. |
| UpdateBackgroundTaskIfNeededAsync | - | BackgroundTaskRegistrationResult | Re-registers the background task. Useful, if there is a need to update the background task trigger filters. Note that in usual scenarios there is no need to call this method since the SDK updates the background trigger automatically. |
| UnregisterBackgroundTask | - | - | Unregisters the background tasks. |
| StartScanner | - | - | Starts the scanner. It is not necessary to use the scanner, if the background task is registered as the background task will receive beacon actions even when the application is on foreground. The resolved actions are delivered to the application by the background task. |
| StopScanner | - | - | Stops the scanner. |
| ClearPendingActions | - | - | Clears all pending actions (resolved by the background task) from the database. |
| InvalidateCacheAsync | - | - | Invalidates the cache including layout. |
| OnApplicationVisibilityChanged | object, VisibilityChangedEventArgs | - | Event handler for `Window.Current.VisibilityChanged`. Sets the SDK state based on the application visibility. |

## Working with the database ##

Sensorberg SDK stores data in SQLite database. Physical database file locates in application's home folder. When working on the desktop, the file locates in following place:
C:\Users\<username>\AppData\Local\Packages\<AppID>\LocalState\sensorberg.db
Tools like DB Browser for SQLite can provide interesting insight on how the SDK works. You can for instance observe incoming beacon events that the background agent stores by looking in DBBackgroundEventsHistory table.

### Database structure ###

| Name | Description |
| ---- | --------- |
| DBBackgroundEventsHistory | Background agent stores all raw beacon events that it receives from the bluetooth device in this table. When new beacon is seen for the first time, it is stored in the table and this will cause beacon enter event. When the same beacon is seen again only EventTime is updated. And finally when beacon is not seen in 9 seconds it will trigger exit event for the beacon and it will be deleted from the database. |
| DBBEaconActionFromBackground | This table is a communication channel between background task and UI application. When the background agent has recognized new action it stores it here and foreground application reads it and processes them. |
| DBDelayedAction |  All delayed actions are stored here. Both background task and foreground UI regularly check if there are delayed actions that should be executed.  |
| DBHistoryAction |  Stores all actions that have been executed. The table data is used to ensure that same action is not shown twice if there are suppression rules that prohibit it. Content is regularly send to the cloud service |
| DBHistoryEvent |  Event history that is regularly send to the cloud service |

DB Browser for SQLite shows an event in DBBackgroundEventsHistory table

![Adding Sensorberg SDK projects](/Doc/Images/DBBrowserforSQLite.png)

## Sample applications ##

### Sensorberg Simple App ###

Sensorberg Simple App demonstrates how to integrate Sensorberg SDK to a
universal Windows app on a fairly basic level. The aim of this sample is to
provide reusable code to enable quick getting started experience while still
utilizing most of what the SDK has to offer.

![Sensorberg Simple App running on Lumia phone](/Doc/Images/SensorbergSimpleAppSmallScreenScaled.png)
![Sensorberg Simple App running on Surface 3](/Doc/Images/SensorbergSimpleAppLargeDisplayScaled.png)

All of the application logic including the Sensorberg SDK specific application
code is located in [MainPage.xaml.cs](/SensorbergSimpleApp/MainPage.xaml.cs)
file.

### Sensorberg Showcase ###

Sensorberg Showcase demonstrates the full capabilities of Sensorberg SDK. Rather
than being a code sample, it is designed for testing of both the SDK itself and
other applications. With Sensorberg Showcase you can verify that your API key is
valid and that you beacons and campaigns are defined correctly.

![Sensorberg Showcase running on Lumia phone](/Doc/Images/SensorbergShowcaseSmallScreenScaled.png)
![Sensorberg Showcase running on Surface 3](/Doc/Images/SensorbergShowcaseLargeDisplayScaled.png)

This showcase application has the following features (amongst others):

* Beacon scanner with extensive user interface displaying the details of scanned beacons
* Advertiser, which allows you to set the desired beacon IDs making your device act as a beacon
* Dynamic API key - if you have more than one applications, you can switch the API key dynamically or reset back to the demo API key


text:
# MovieProject
Udacity Full Stack Developer Course - Project 1: Create a Movie Trailer Website

Steps I took:
1.Created media.py --> Created a class called "Movie", defined the __init__ function, holds: movie title, movie storyline, poster imagek, trailer youtube.
2. Created entertainment_center.py --> In this file I have 6 instances of the Movie class.
        I also imported the media file, form step 1.
3. In Media.py --> Defined the show_trailer function, that takes in the youtube url and uses the webbrowser library to play it. Had to import webbrowser.  Also created a one line documentation between the 3 quotation marks """   """ and the ratings.
4. Dowloaded fresh_tomatoes.py and imported it to entertainment_center.py
5. In entertainment_center.py --> created an array "movies" that held the 6 different instances.
6. In enteratainment_center.py --> used the function "open_movies_page" from the fresh_tomatoes class and passed in the "movies" array.

How to run the program:
1. Unzip the movies.zip folder     //Different instructions if doing so on GitHub
2. Once it is unzipped, open the internal folder (also called movies)
3. Right click entertainment_center.py and choose - Edit with IDLE
4. Clic "run", then click "Run Module"

Note:
- For this program you will need python 2.7
- To install python 2.7 go to this website: https://www.python.org/downloads/

repository: JessDF/MovieProject

repo_name: JessDF/MovieProject


text:
# Contributing Guidelines

The Kubernetes Helm project accepts contributions via GitHub pull requests. This document outlines the process to help get your contribution accepted.

## Reporting a Security Issue

Most of the time, when you find a bug in Helm, it should be reported
using [GitHub issues](github.com/kubernetes/helm/issues). However, if
you are reporting a _security vulnerability_, please email a report to
[helm-security@deis.com](mailto:helm-security@deis.com). This will give
us a chance to try to fix the issue before it is exploited in the wild.

## Contributor License Agreements

We'd love to accept your patches! Before we can take them, we have to jump a couple of legal hurdles.

Please fill out either the individual or corporate Contributor License Agreement (CLA).

  * If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](http://code.google.com/legal/individual-cla-v1.0.html).
  * If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA](http://code.google.com/legal/corporate-cla-v1.0.html).

Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests.

***NOTE***: Only original source code from you and other people that have signed the CLA can be accepted into the main repository.

## How to Contribute A Patch

1. If you haven't already done so, sign a Contributor License Agreement (see details above).
1. Fork the desired repo, develop and test your code changes.
1. Submit a pull request.

Coding conventions and standards are explained in the official
developer docs:
https://github.com/kubernetes/helm/blob/master/docs/developers.md

### Merge Approval

Helm collaborators may add "LGTM" (Looks Good To Me) or an equivalent comment to indicate that a PR is acceptable. Any change requires at least one LGTM.  No pull requests can be merged until at least one Helm collaborator signs off with an LGTM.

If the PR is from a Helm collaborator, then he or she should be the one to merge and close it. This keeps the commit stream clean and gives the collaborator the benefit of revisiting the PR before deciding whether or not to merge the changes.

## Support Channels

Whether you are a user or contributor, official support channels include:

- GitHub issues: https://github.com/kubenetes/helm/issues/new
- Slack: #Helm room in the [Kubernetes Slack](http://slack.kubernetes.io/)

Before opening a new issue or submitting a new pull request, it's helpful to search the project - it's likely that another user has already reported the issue you're facing, or it's a known issue that we're already aware of.

repository: euank/sprigcli

repo_name: euank/sprigcli


text:
[@iota-pico/crypto](../README.md) > [Curl](../classes/curl.md)

# Class: Curl

Implementation of ISponge using Curl algorithm. [https://github.com/iotaledger/iota.lib.js/blob/master/lib/crypto/curl/curl.js](https://github.com/iotaledger/iota.lib.js/blob/master/lib/crypto/curl/curl.js)

## Hierarchy

**Curl**

## Implements

* [ISponge](../interfaces/isponge.md)

## Index

### Constructors

* [constructor](curl.md#constructor)

### Properties

* [HASH_LENGTH](curl.md#hash_length)
* [NUMBER_OF_ROUNDS](curl.md#number_of_rounds)
* [STATE_LENGTH](curl.md#state_length)

### Methods

* [absorb](curl.md#absorb)
* [getConstant](curl.md#getconstant)
* [getState](curl.md#getstate)
* [initialize](curl.md#initialize)
* [reset](curl.md#reset)
* [squeeze](curl.md#squeeze)

---

## Constructors

###  constructor

⊕ **new Curl**(rounds?: *`number`*): [Curl](curl.md)

*Defined in [sponges/curl.ts:21](https://github.com/iota-pico/crypto/tree/master/src/sponges/curl.ts#L21*

Create a new instance of Curl.

**Parameters:**

| Name | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| `Default value` rounds | `number` |  Curl.NUMBER_OF_ROUNDS |  The number of rounds to use. |

**Returns:** [Curl](curl.md)

___

## Properties

### `<Static>` HASH_LENGTH

**● HASH_LENGTH**: *`number`* = 243

*Defined in [sponges/curl.ts:11](https://github.com/iota-pico/crypto/tree/master/src/sponges/curl.ts#L11*

___

### `<Static>` NUMBER_OF_ROUNDS

**● NUMBER_OF_ROUNDS**: *`number`* = 81

*Defined in [sponges/curl.ts:12](https://github.com/iota-pico/crypto/tree/master/src/sponges/curl.ts#L12*

___

### `<Static>` STATE_LENGTH

**● STATE_LENGTH**: *`number`* =  Curl.HASH_LENGTH * 3

*Defined in [sponges/curl.ts:13](https://github.com/iota-pico/crypto/tree/master/src/sponges/curl.ts#L13*

___

## Methods

###  absorb

▸ **absorb**(trits: *`Int8Array`*, offset: *`number`*, length: *`number`*): `void`

*Implementation of [ISponge](../interfaces/isponge.md).[absorb](../interfaces/isponge.md#absorb)*

*Defined in [sponges/curl.ts:82](https://github.com/iota-pico/crypto/tree/master/src/sponges/curl.ts#L82*

Absorb trits into the hash.

**Parameters:**

| Name | Type | Description |
| ------ | ------ | ------ |
| trits | `Int8Array` |  The trits to absorb. |
| offset | `number` |  The offset into the trits to absorb from. |
| length | `number` |  The number of trits to absorb. |

**Returns:** `void`

___

###  getConstant

▸ **getConstant**(name: *`string`*): `number`

*Implementation of [ISponge](../interfaces/isponge.md).[getConstant](../interfaces/isponge.md#getconstant)*

*Defined in [sponges/curl.ts:36](https://github.com/iota-pico/crypto/tree/master/src/sponges/curl.ts#L36*

Get the constant for the spone.

**Parameters:**

| Name | Type | Description |
| ------ | ------ | ------ |
| name | `string` |  The name of the constant to get. |

**Returns:** `number`
The constant.

___

###  getState

▸ **getState**(): `Int8Array`

*Implementation of [ISponge](../interfaces/isponge.md).[getState](../interfaces/isponge.md#getstate)*

*Defined in [sponges/curl.ts:53](https://github.com/iota-pico/crypto/tree/master/src/sponges/curl.ts#L53*

Get the state of the curl hash.

**Returns:** `Int8Array`
The state.

___

###  initialize

▸ **initialize**(state?: *`Int8Array`*): `void`

*Implementation of [ISponge](../interfaces/isponge.md).[initialize](../interfaces/isponge.md#initialize)*

*Defined in [sponges/curl.ts:61](https://github.com/iota-pico/crypto/tree/master/src/sponges/curl.ts#L61*

Initialise the hasher.

**Parameters:**

| Name | Type | Description |
| ------ | ------ | ------ |
| `Optional` state | `Int8Array` |  The initial state for the hasher. |

**Returns:** `void`

___

###  reset

▸ **reset**(): `void`

*Implementation of [ISponge](../interfaces/isponge.md).[reset](../interfaces/isponge.md#reset)*

*Defined in [sponges/curl.ts:72](https://github.com/iota-pico/crypto/tree/master/src/sponges/curl.ts#L72*

Reset the hasher.

**Returns:** `void`

___

###  squeeze

▸ **squeeze**(trits: *`Int8Array`*, offset: *`number`*, length: *`number`*): `void`

*Implementation of [ISponge](../interfaces/isponge.md).[squeeze](../interfaces/isponge.md#squeeze)*

*Defined in [sponges/curl.ts:119](https://github.com/iota-pico/crypto/tree/master/src/sponges/curl.ts#L119*

Squeeze trits into the hash.

**Parameters:**

| Name | Type | Description |
| ------ | ------ | ------ |
| trits | `Int8Array` |  The trits to squeeze. |
| offset | `number` |  The offset into the trits to squeeze from. |
| length | `number` |  The number of trits to squeeze. |

**Returns:** `void`

___

repository: iota-pico/crypto

repo_name: iota-pico/crypto