text:
# TypeScript typings for Cloud Monitoring API v2beta2
Accesses Google Cloud Monitoring data.
For detailed description please check [documentation](https://cloud.google.com/monitoring/v2beta2/).

## Installing

Install typings for Cloud Monitoring API:
```
npm install @types/gapi.client.cloudmonitoring@v2beta2 --save-dev
```

## Usage

You need to initialize Google API client in your code:
```typescript
gapi.load("client", () => {
    // now we can use gapi.client
    // ...
});
```

Then load api client wrapper:
```typescript
gapi.client.load('cloudmonitoring', 'v2beta2', () => {
    // now we can use gapi.client.cloudmonitoring
    // ...
});
```

Don't forget to authenticate your client before sending any request to resources:
```typescript

// declare client_id registered in Google Developers Console
var client_id = '',
    scope = [
        // View and manage your data across Google Cloud Platform services
        'https://www.googleapis.com/auth/cloud-platform',

        // View and write monitoring data for all of your Google and third-party Cloud and API projects
        'https://www.googleapis.com/auth/monitoring',
    ],
    immediate = true;
// ...

gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
    if (authResult && !authResult.error) {
        /* handle succesfull authorization */
    } else {
        /* handle authorization error */
    }
});
```

After that you can use Cloud Monitoring API resources:

```typescript

/*
Create a new metric.
*/
await gapi.client.metricDescriptors.create({ project: "project",  });

/*
Delete an existing metric.
*/
await gapi.client.metricDescriptors.delete({ metric: "metric", project: "project",  });

/*
List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.
*/
await gapi.client.metricDescriptors.list({ project: "project",  });

/*
List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.
*/
await gapi.client.timeseries.list({ metric: "metric", project: "project", youngest: "youngest",  });

/*
Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially in the order of their end time.
*/
await gapi.client.timeseries.write({ project: "project",  });

/*
List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.
*/
await gapi.client.timeseriesDescriptors.list({ metric: "metric", project: "project", youngest: "youngest",  });
```


text:
## okta-admin idps publishcert

Update the Certificate Signing Request with a signed X.509 certificate and add it into the signing key credentials for the IdP.

### Synopsis

Update the Certificate Signing Request with a signed X.509 certificate and add it into the signing key credentials for the IdP.

```
okta-admin idps publishcert <idpId> <csrId> <body> <type: cer|der|pem> [flags]
```

### Options

```
  -h, --help   help for publishcert
```

### SEE ALSO

* [okta-admin idps](okta-admin_idps.md)	 - Provides operations to manage federations with external Identity Providers (IdP).

###### Auto generated by spf13/cobra on 29-May-2021

repository: gammastudios/okta-admin

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: gammastudios/okta-admin


text:
---
title: "This Month in Mun - January 2021"
author: "The Mun Team"
excerpt: "Revitalized from the holiday break, the core team got cracking, resulting in half a dozen completed pull requests and even more in review. What's more, some fresh blood is dipping their toe in the Mun pond, as we kick off the new year."
---

Revitalized from the holiday break, the core team got cracking, resulting in half a dozen completed pull requests and even more in review. What's more, some fresh blood is dipping their toe in the Mun pond, as we kick off the new year.

#### Mun v0.3 progress

It's been a while since we had as much progress as in January, so to refresh your memory: Mun v0.3 is a *tock* release.
This means that we focused on improvements to the user experience - for people writing and embedding Mun - and enhancements to the developer experience - for people contributing to Mun.
In particular, a lot of work went into providing a better editing experience with more additions to the language server.

* **feat(language server): integrated new vfs** [[PR#294]](https://github.com/mun-lang/mun/pull/294)

  Previously we used `ra_vfs` from Rust Analyzer to manage all file handling in our language server.
  Rust Analyzer moved away from that crate and implemented a custom solution.
  With the introduction of Rust 1.49 we encountered some clippy errors in our use of `ra_vfs`.
  We followed suite and implemented a (much simpler) custom solution.
  This PR introduces a virtual filesystem that keeps a consistent state of all files currently used in our analysis in memory.
  It also provides a way to monitor the filesystem for changes and atomically applies these changes to the in-memory state.
  In the future the goal is to use this same functionality for our `watch` mode, when building the source.

* **feat(language server): removed async code and switched to lsp_server** [[PR#295]](https://github.com/mun-lang/mun/pull/295)

  `async` is a great feature of Rust.
  We've used it a lot in our implementation of the language server.
  However, this was also really the only place that actually benefited from async IO.
  A lot of our asynchronous code consists of fire-and-forget computations, which don't really benefit from Rust's async approach and instead work very well in a simple thread-pool.
  Besides that, our async implementation required a lot of boilerplate code because most of our dependencies are not async compatible (e.g. `salsa`).

  Therefore, we decided to remove our async code and instead use a simple thread pool.
  This also allowed us to switch to an existing crate for our Language Server Protocol implementation, consequently making the code more readable.

* **feat(cli): add option to emit IR** [[PR#296]](https://github.com/mun-lang/mun/pull/296)

  Mun always emits platform-dependant shared objects.
  These are hard to debug if our code generation behaves incorrectly.
  This PR adds the ability to output Mun assemblies as LLVM IR files, which are much easier to debug since we can easily translate them to a human-readable format.

* **feature(lsp): adds document symbol provider** [[PR#297]](https://github.com/mun-lang/mun/pull/297)

  More work on the language server implementation. This PR adds the ability to visualize the symbols inside a document by inspecting the Abstract Syntax Tree of the file.

  <img src="../images/vscode-document-symbol-provider.png" alt="Mun document symbols" />

* **feat(book): describe how to install/build LLVM** [[PR#304]](https://github.com/mun-lang/mun/pull/304)

  The Mun compiler source code makes heavy use of LLVM.
  We install most of our dependencies through cargo but - as LLVM is a system dependency - it as to be installed manually.
  Installing LLVM is a tedious task, not made easier by the fact that we also require a specific version.
  We receive a lot of questions about how to install this dependency.
  This PR adds an explanation on how to install LLVM for different operating systems.

* **fix: manually extract llvm release to get more output** [[PR#302]](https://github.com/mun-lang/mun/pull/302) and  **misc: adds logging to windows llvm install** [[PR#301]](https://github.com/mun-lang/mun/pull/301)

  We've had some annoying issues with our Windows CI pipeline for a while.
  For unknown reasons it kept failing sporadically.
  When we thought we had fixed the issue, it would pop back up a few days later.
  With these PRs we tried to investigate why this failure occurred.
  It helped us find the issue and implement a fix, which will hopefully nip the problem in the bud.

There are currently also a number of open Pull Requests in review that we hope to integrate soon.
Part of those focus on enabling the use of multiple source files in the form of a Mun project.
Specifically, we worked on runtime linking of multiple assemblies, which brings all of the features of the past few months together.

For more details, please check out our [high-level roadmap](https://github.com/mun-lang/mun/projects/2) on Github that details new features for the upcoming three releases - Mun v0.3, v0.4, and v0.5 - as well as a backlog of features that are still to come.

#### Community

Our requests for new contributors were answered this month. Only just getting up to speed, they were already able to create their [first PR](https://github.com/mun-lang/mun/pull/305) - that is still in review.

If you are also interested in helping develop Mun - but are not sure where to start - feel free to take a look at our [*good first issues*][gfi] or reach out to us on [Discord](https://discord.gg/SfvvcCU) or [Twitter][twi]. To support our cause, please consider donating to our [Open Collective][oc] or [Github Sponsors][gs].

Exciting times! Stay tuned for more!

[doh]: https://hacktoberfest.digitalocean.com
[gfi]: https://github.com/mun-lang/mun/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[oc]: https://opencollective.com/mun
[gs]: https://github.com/sponsors/mun-lang
[twi]: https://twitter.com/munlangorg

license: MIT

repository: mun-lang/website

gha_language: JavaScript

gha_license_id: MIT

repo_name: mun-lang/website


text:
# Anglular 2

![angular2](Angular2.jpg)

## CONTENTS

1. [OVERVIEW](#OVERVIEW)
2. [SETTING UP BASE COMPONENTS](#SETTING-UP-BASE-COMPONENTS)
3. [Understanding Packages](#PACKAGE)
3. [Test ](#Test-Server)
4. [Making your first change](#Making-your-first-change)
5. [BREAKDOWN OF ANGULAR FILE STRUCTURE](BREAKDOWN-OF-ANGULAR-FILE-STRUCTURE)
6. [WHAT ARE ANGULAR COMPONENTS?](#COMPONENTS)

## OVERVIEW

Angular 2 is an open source JavaScript framework to build web applications in HTML and JavaScript. This tutorial looks at the various aspects of Angular 2 framework which includes the basics of the framework, the setup of Angular and how to work with the various aspects of the framework. Other topics discussed in the tutorial are advanced chapters such as interfaces, nested components and services within Angular. Topics such as routing, modules, and arrays are also dealt with in this tutorial.

# SETTING UP BASE COMPONENTS

## Resources to clone

There are a lot of resources required to download even for a base project, I have used bare minimum from BuckyRoberts example which can be found [here](https://github.com/buckyroberts/angular-2-template) .

What to do is, take that link, and in the directory you want to work in just run

`git clone https://github.com/buckyroberts/angular-2-template`

This will give you all the pieces you need to get started, the base files and a simple bit of Angular displying a html heading.

## Installing NPM and Node.js

Download the latest version of Node.js if you do not already have it installed on your machine. This download will also include the latest version of npm.

[Download Link](https://nodejs.org/en/download/)

## Run the Project

You can kick off the base project from Bucky's repo simply by running the command below. The program is executed with a TypeScript compiler in watch mode and run lite-server with automatic refreshing.

`npm install`

then

`npm start`

## PACKAGE

Each package.json is a list of dependencies like below - we don't have these downloaded yet, this is why we have Node.js which comes with npm that does it automatically.

```
{
  "name": "angular-2",
  "version": "1.0.0",
  "scripts": {
    "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "lite": "lite-server",
    "typings": "typings",
    "postinstall": "typings install"
  },
  "license": "ISC",
  "dependencies": {
    "angular2": "2.0.0-beta.13",
    "systemjs": "0.19.25",
    "es6-shim": "^0.35.0",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.2",
    "zone.js": "0.6.6"
  },
  "devDependencies": {
    "concurrently": "^2.0.0",
    "lite-server": "^2.1.0",
    "typescript": "^1.8.9",
    "typings":"^0.7.11"
  }
}

```

If you haven't already - you should run 'npm install' to download dependencies.

## Test Server

Note the test server in the package `npm run lite\` instead of having to refresh browser each time, code changes are updated automatically.

# Making your first change

Once you start the server with `npm start` assuming you already ran `npm install` you should see the browser load up with the text `Angular 2 Template` we can amend this in the following location

`app/ts/app.component.ts`

# BREAKDOWN OF ANGULAR FILE STRUCTURE

## APP

This is our main directory inside we have ts for typescript and js for javascript. 95% of time we are going to be working in ts folder.

**NOTE** don't mess with the js files they are generated automatically

# TypeScript

**Note** Type script will need to be translated into javascript for browser (you can translate online using transpilers) but in our case we can add script tags in the html like

`script src="node_modules/angular2/bundles/angular2.dev.js"></script>`

 It gets translated into javascript automatically and dumped in a js folder. Remember its the js files the browser actually uses.

## Map files

These are extra files that help you debug your code - because it maps the error in js to where it actually is in your ts

## NODE MODULES

**DONT** mess with node modules, these are imported when you run `npm install` from specified dependencies in package.json

## TYPINGS

Whenever we use new libraries javascript doesn't understand some of the syntax we use by default, so we use these typings files to provide the new rules which lets our transpiler do the conversion.  Also **DONT** touch.

## tsconfig.json

These are details about how we wan't to convert typescript to javascript such as below :

```

{
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "outDir": "app/js",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules",
    "typings/main",
    "typings/main.d.ts"
  ]
}

```

**outDir** - where to dump JS files

## index.html

Your main page, home page

# COMPONENTS

license: ISC

branch_name: refs/heads/master


text:
# Markdown plugin for Shower

Required [Markdown-it](https://github.com/markdown-it/markdown-it) library.

Follow [@shower_me](https://twitter.com/shower_me) for support and updates, [file an issue](https://github.com/shower/shower/issues) in case of any problem. Part of the [Shower](https://github.com/shower/shower/) presentation template, [see wiki](https://github.com/shower/shower/wiki) for more information.

repository: zloylos/shower-markdown

repo_name: zloylos/shower-markdown


text:
# Slot: biomarker for

holds between a measurable molecular entity and a disease or phenotypic feature, where the entity is used as an indicator of the presence or state of the disease or feature.

URI: [biolink:biomarker_for](https://w3id.org/biolink/vocab/biomarker_for)

## Domain and Range

[MolecularEntity](MolecularEntity.md) →  0..\* [DiseaseOrPhenotypicFeature](DiseaseOrPhenotypicFeature.md)

## Parents

 *  is_a: [correlated with](correlated_with.md)

## Children

## Used by

## Other properties

|  |  |  |
| --- | --- | --- |
| **In Subsets:** | | translator_minimal |
| **Exact Mappings:** | | NCIT:R39 |
| **Narrow Mappings:** | | NCIT:R47 |
|  | | NCIT:genetic_biomarker_related_to |
|  | | NCIT:is_molecular_abnormality_of_disease |
|  | | ORPHA:465410 |
|  | | SEMMEDDB:diagnoses |
| **Broad Mappings:** | | RO:0002607 |

repository: linkml/linkml

gha_language: Python

repo_name: linkml/linkml


text:
---
layout: post
title: SQL approximate lookup
category: SQL
tags: [SQL, Lookup]
---

Assume we have two tables as below: tblStudents and tblGroup.

### tblStudents

| Name | Age |
| --- | --- |
| Adam | 3 |
| Bob | 5 |
| Chris | 8 |
| David | 12 |
| Eric | 18 |

### tblGroup

|Age|AgeGroup|
|---|---|
|0|A|
|5|B|
|10|C|
|15|D|

Now we want to add a column of AgeGroup in tblStudents showing which age group each student is in. What we need here is basically an Excel true vlookup. Via using `OUTER APPLY` the age group can be calculated and added in tblStudents. The full query is like this:
```sql
DECLARE @tblStudents table
(
    Name NVARCHAR(50),
    Age int
)

Insert Into @tblStudents
VALUES
('Adam',3),
('Bob',5),
('Chris',8),
('David',12),
('Eric',18)

DECLARE @tblGroup table
(
    Age INT,
    AgeGroup NVARCHAR(50)
)

Insert Into @tblGroup
VALUES
(0,'A'),
(5,'B'),
(10,'C'),
(15,'D')

SELECT *
FROM @tblStudents AS s
OUTER APPLY (SELECT TOP 1 AgeGroup
				 FROM @tblGroup AS g
				 WHERE s.Age >= g.Age
				 ORDER BY AgeGroup DESC
				 ) AS g
```

And the output is:

| Name | Age | AgeGroup |
| --- | --- | --- |
| Adam | 3 | A |
| Bob | 5 | B |
| Chris | 8 | B |
| David | 12 | C |
| Eric | 18 | D |


text:
# COEP: credentialless. Isolation w/o Opt-In?

Credentialless is a Cross-Origin-Embedder-Policy (COEP) variant. Similarly
to
[require-corp](https://html.spec.whatwg.org/multipage/origin.html#embedder-policy-value),
it can be used to enable [cross-origin-isolation](#cross-origin-isolation).
Contrary to require-corp, it is easier to deploy, instead of requiring a
Cross-Origin-Resource-Policy (CORP) header for every no-cors subresources,
COEP:credentialless is requesting them without credentials.

- [Explainer](./explainer.md)
- [Specification](https://wicg.github.io/credentiallessness/)
- [Experimenting instructions](./experimenting.md)


text:
# re:Inforce 2019 - GRC302 - Audibility in Kubernetes with Amazon EKS

Talk given 6/25/2019

> Amazon Elastic Container Service for Kubernetes (Amazon EKS) is an AWS service
offering a managed Kubernetes control plane for customers to orchestrate their
containerized applications on Amazon EC2. In this chalk talk, Micah Hausler, AWS
system development engineer, explains how customers can ensure the integrity and
auditability of their applications on Amazon EKS. He demonstrates the
exploitation of a misconfigured web application container, and he conducts a
forensic analysis of what happened in the system.

## Slides

[View on SlideShare](https://www.slideshare.net/AmazonWebServices/audibility-in-kubernetes-with-amazon-eks-grc302-aws-reinforce-2019)

## Overview

* Overview of Amazon Elastic Kubernetes Service
* Create your cluster
* Authentication and Authorization
* Install a web application
* Exploit your web application
* Deep dive into the audit

## License
MIT License - [License](LICENSE)


text:
# ei

Automatically embed IPython into arbitrary stack frames in traceback.

[![asciicast](https://asciinema.org/a/jWSj75lwjHfxUmtkSyWRGN2Tx.svg)](https://asciinema.org/a/jWSj75lwjHfxUmtkSyWRGN2Tx)

## Install

```bash
# PyPI
pip3 install ei

# GitHub
pip3 install git+https://github.com.djosix/ei.git
```

## Usage

Basic usage:

```python
def main():
    a = 123
    b = 0
    return a / b

if __name__ == '__main__':
    import ei
    ei.patch() # overwrites sys.excepthook

    main()
```

Unpatch to recover `sys.excepthook`:

```python
ei.unpatch()
```

Context manager:

```python
with ei.capture():
    main()

# The exception hook is recovered here
```

Lazy patch:

```python
import ei.patched
```

repository: djosix/ei

repo_name: djosix/ei


text:
# Quick Start

## Installation from npm

You can use either the npm cli tool or yarn to install pipcook:

```bash
yarn add @pipcook/cli -g
```

or

```bash
npm install @pipcook/cli -g
```

## Run your first pipeline task

In the following steps, we will demonstrate how to start a machine learning pipeline task in pipcook taking an image classification task as example.

## Setup Pipeline File

In pipcook framework, a typical machine learning process can be split into three steps: `data access`, `data processing` and `model training`. the output of each step will be the input of the next step. All these steps are described by script files and combined in one pipeline config file.

In our case, the pipeline config file is as following. Here you don't need to go deep into detail since we have already prepared the related scripts for you. Roughly speaking:

In dataScource part, we specified the image data source for the classification task; In dataflow part, we specified the data process code which converts the original image input into a data format usable by the pipcook model;In model part, we sepecied the mode code which uses [mobileNet][1] to classify image data.

If you want to know how to write scripts please [Click Here][2].

More detailed information about pipeline config file can be find here.

```
{
  "specVersion": "2.0",
  "dataSource": "https://cdn.jsdelivr.net/gh/imgcook/pipcook-plugin-image-classification-collector@d00337c/build/script.js?url=http://ai-sample.oss-cn-hangzhou.aliyuncs.com/image_classification/datasets/imageclass-test.zip",
  "dataflow": [
    "https://cdn.jsdelivr.net/gh/imgcook/pipcook-plugin-process-tfjs-image-classification@db14a1a/build/script.js?size=224&size=224"
  ],
  "model"<EMAIL_ADDRESS>  "options": {
    "framework"<EMAIL_ADDRESS>    "train": {
      "epochs": 100,
      "validationRequired": true
    }
  }
}
```

## Run Pipeline Task

After settting up the pipeline config file, you can run the pipeline task through pipcook command.

```bash
pipcook run ${your pipeline path}/pipeline.json
```

Model output will be saved in `${YOUR_CURRENT_PATH}/${TIME_STAMP}/model/model.json`

  [1]: https://arxiv.org/abs/1704.04861
  [2]: click

repository: jan-www/pipcook

repo_name: jan-www/pipcook


text:
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.1.1](https://github.com/LeDDGroup/typescript-transform-macros/compare/v1.1.0...v1.1.1) (2019-05-20)

### Bug Fixes

* not working when macros didn't return value ([992a306](https://github.com/LeDDGroup/typescript-transform-macros/commit/992a306))

# [1.1.0](https://github.com/LeDDGroup/typescript-transform-macros/compare/v1.0.0...v1.1.0) (2019-03-18)

### Bug Fixes

* not replacing macros inside macros ([4afb6d2](https://github.com/LeDDGroup/typescript-transform-macros/commit/4afb6d2))

### Features

* hygienic macros ([2268d05](https://github.com/LeDDGroup/typescript-transform-macros/commit/2268d05))
* support macros property access like calls ([d7b42d6](https://github.com/LeDDGroup/typescript-transform-macros/commit/d7b42d6))

# 1.0.0 (2019-03-16)

repository: LeDDGroup/typescript-transform-macros

repo_name: LeDDGroup/typescript-transform-macros


text:
# headscale

This role deploys a headscale server into the control plane. It is an optional component for deployment and can be used to access firewalls through a VPN mesh such that there is no need for open SSH ports anymore.

This role just wraps the [postgres-backup-restore](/control-plane/roles/postgres-backup-restore) role. Refer to this role for further documentation.

If you want to rotate the API key, you need to delete the `headscale-api-key` secret and re-run the deployment.

## Variables

The role should take the same variables as the wrapped role, but prefixed with `headscale_db_` instead of `postgres_`.

| Name                                           | Mandatory | Description                                                 |
|------------------------------------------------|-----------|-------------------------------------------------------------|
| headscale_image_name                           | yes       | Image name of headscale                                     |
| headscale_image_tag                            | yes       | Image version of headscale                                  |
| headscale_db_image_name                        | yes       | Image name of headscale DB                                  |
| headscale_db_image_tag                         | yes       | Image version of headscale DB                               |
| headscale_db_backup_restore_sidecar_image_name | yes       | Image name of init container for headscale DB               |
| headscale_db_backup_restore_sidecar_image_tag  | yes       | Image version of init container for headscale DB            |
| headscale_private_key                          | yes       | Private key                                                 |
| headscale_noise_private_key                    | yes       | Noise Protocol Private key for TS2021 compatibility         |
| headscale_ingress_dns                          |           | Domain name                                                 |
| headscale_namespace                            |           | The deployment's target namespace                           |
| headscale_tls                                  |           | Enables TLS for headscale                                   |
| headscale_ingress_annotations                  |           | Annotations that will be attached to the ingress resource   |
| headscale_resources                            |           | The kubernetes resources for the actual headscale container |
| headscale_api_key_expiration                   |           | The time how long the generated api key will be valid       |
| headscale_ip_prefixes                          |           | Slice of IP Prefixes where the tunnel endpoints are created |

repository: metal-stack/metal-roles

gha_language: Jinja

repo_name: metal-stack/metal-roles


text:
# ms-tests module

System integration testing (SIT) involves the overall testing of a complete system of many subsystem components or elements.

## What should be in THIS module:

* This module is the space for placing system integration tests only!

## What should NOT be in THIS module:

* Unit Tests should go in the same module as the classes which should be tested.
* Integration Tests should be located in the ms-ws for the REST web services and depended on the purpose also in the corresponding package.

repository: wscale/mountains

repo_name: wscale/mountains


text:
---
layout:     post
title:      "Problem: Climbing Stairs"
date:       2015-02-18 00:00:00
author:     "Marcy"
header-img: "img/post-bg-2015.jpg"
catalog: true
category: algnote
algnote-tags:
    - Coding Interview
    - Coding Practice
    - Algorithms and Data Structures
    - Dynamic Programming
    - Easy
---

## Question

You are climbing a stair case. It takes n steps to reach to the top.

Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

Note: Given n will be a positive integer.

**Example 1:**
```
Input: 2
Output: 2
Explanation: There are two ways to climb to the top.
1. 1 step + 1 step
2. 2 steps
```
**Example 2:**
```
Input: 3
Output: 3
Explanation: There are three ways to climb to the top.
1. 1 step + 1 step + 1 step
2. 1 step + 2 steps
3. 2 steps + 1 step
```
## Solution
TODO

#### Code
```java
class Solution {
    public int climbStairs(int n) {
        if(n==1) return 1;

        int first = 1;
        int second = 2;

        for(int i=2; i<n; i++) {
            int third = first + second;
            first = second;
            second = third;
        }

        return second;
    }
}
```

## Performance
TODO

path: /_posts/Algorithms and Data Structures/problems/2015-11-01-Dynamic-Programming/2015-11-02-climbing-stairs.markdown

extension: markdown


text:
# AutoMapper.Verifier

Quickly and simply make sure you have all the AutoMapper mappings you need, and none of the mappings that you do not need.

With AutoMapper, it is often difficult to tell when you are calling .Map(...) in a new context if that mapping already exists or if you need to create a new one. Or, when you remove a feature that is no longer needed, it is easy to accidentally leave unnecessary .CreateMap(...)s in, cluttering the code and making it difficult to tell if you can remove some classes because they appear to still be referenced somewhere.

AutoMapper.Verifier takes the guesswork out of figuring out which mappings you are using, which ones you are missing, and which ones you can finally get rid of.

## Getting Started

Reference the [NuGet package](https://www.nuget.org/packages/AutoMapperVerifier/) `Install-Package AutoMapperVerifier`

Then call `.Verifier.VerifyMappings(...)` in your project startup code.

```
using AutoMapper.Verifier;
...
Verifier.VerifyMappings();
```

### “Advanced” Usage

Throwing an error when there is a mapping issue.

```
try
{
    Verifier.VerifyMappings(ErrorActions.ThrowException);
}
catch(AutoMapperVerificationException ex)
{
    ...
}
```

Configuring different behaviors for different error types.

```
Verifier.VerifyMappings(x =>
    {
        x.OnUndeclaredMapping = ErrorActions.ThrowException;
        x.OnMultiplyDeclaredMapping = ErrorActions.ThrowException;
        x.OnUnusedMapping = ErrorActions.Ignore;
        x.OnIndeterminantMapping = ErrorActions.ThrowException;
    });
```

Manually handling mapping errors

```
var mappings = Verifier.VerifyMappings();

foreach(var mapping in mappings)
{
    if(mapping.HasErrors)
    {
        // do something
    }
}
```

## Known Issues

- Can only handle mappings where generic types are declared (ex: `.CreateMap<T1,T2>(...)` `.Map<T1,T2>(...)`). Mappings that pass in object or Type arguments cannot be determined via reflection.
	- CreateMap(...) could be resolved if this library were more deeply integrated with AutoMapper, but because it reflects over the code and cannot actually run it I am unable to ask for the type of the object at runtime.
	- Map(...) using object parameters would not work even if more deeply integrated because there is no way to know what the type will be for sure until it is actually passed in while the app is running, and a different type could actually be passed in each time it is called.
- Does not handle mappings to enumerables (ex: `.CreateMap<ICollection<T1>,ICollection<T2>>(...)`).
	- This should be fixable as is, I just have not had the time to fix it yet (Maybe you can? :D)

## Contributing

Open to any and all contributions.

## Authors

[Kevin Ackerman](https://www.linkedin.com/in/kevin-arthur-ackerman/)

## License

This project is licensed under the MIT License.


text:
# Partitioning and composing intermediate results of aggregations

Suppose that you want to calculate the count of distinct users over the last seven days, every day. One way to do it would be to run `summarize dcount(user)` once a day with a span filtered to the last seven days. This is inefficient because each time the calculation is run there's a six-day overlap with the previous calculation. Another option is to calculate some aggregate for each day, and then combine these aggregates in an efficient way. This option requires you to "remember" the last six results, but it is much more efficient.

Partitioning queries like that would be easy for simple aggregates, such as count() and sum(). It's possible, however, to also perform them for more complex aggregates, such as dcount() and percentiles(). This topic explains how Kusto supports such calculations.

The following examples show how to use hll/tdigest and demonstrates that using these in some scenarios may be much more performant than in other ways:

> [!NOTE]
> In some cases, the dynamic objects generated by the `hll` or the `tdigest` aggregate functions may be big and exceed the default MaxValueSize property in the encoding policy. If so, the object will be ingested as null.
For example, when persisting the output of `hll` function with accuracy level 4, the size of the hll object exceeds the default MaxValueSize which is 1MB.

```
range x from 1 to 1000000 step 1
| summarize hll(x,4)
| project sizeInMb = estimate_data_size(hll_x) / pow(1024,2)
```

|sizeInMb|
|---|
|1.0000524520874|

Ingesting this into a table before applying this kind of policy will ingest null:

```
.set-or-append MyTable <| range x from 1 to 1000000 step 1
| summarize hll(x,4)
```

```
MyTable
| project isempty(hll_x)
```

| Column1 |
|---------|
| 1       |

To avoid this, use the special encoding policy type `bigobject`, which overrides the MaxValueSize to 2MB like this:

```
.alter column MyTable.hll_x policy encoding type='bigobject'
```

So ingesting a value now to the same table above:

```
.set-or-append MyTable <| range x from 1 to 1000000 step 1
| summarize hll(x,4)
```
ingests the second value successfully :

```
MyTable
| project isempty(hll_x)
```

|Column1|
|---|
|1|
|0|

**Example**

Assume there is a table, PageViewsHllTDigest, which has the hll values over Pages viewed in each hour. The aim is to get these values, but binned to `12h`, to merge the hll values using the hll_merge() aggregate function by timestamp binned to `12h`. Then, call the function dcount_hll to get the final dcount value:

```
PageViewsHllTDigest
| summarize merged_hll = hll_merge(hllPage) by bin(Timestamp, 12h)
| project Timestamp , dcount_hll(merged_hll)
```

|Timestamp|dcount_hll_merged_hll|
|---|---|
|2016-05-01 12:00:00.0000000|20056275|
|2016-05-02 00:00:00.0000000|38797623|
|2016-05-02 12:00:00.0000000|39316056|
|2016-05-03 00:00:00.0000000|13685621|

Or even for binned timestamp for `1d`:

```
PageViewsHllTDigest
| summarize merged_hll = hll_merge(hllPage) by bin(Timestamp, 1d)
| project Timestamp , dcount_hll(merged_hll)
```

|Timestamp|dcount_hll_merged_hll|
|---|---|
|2016-05-01 00:00:00.0000000|20056275|
|2016-05-02 00:00:00.0000000|64135183|
|2016-05-03 00:00:00.0000000|13685621|

 The same thing may be done over the values of tdigest, which represent the BytesDelivered in each hour:

```
PageViewsHllTDigest
| summarize merged_tdigests = merge_tdigests(tdigestBytesDel) by bin(Timestamp, 12h)
| project Timestamp , percentile_tdigest(merged_tdigests, 95, typeof(long))
```

|Timestamp|percentile_tdigest_merged_tdigests|
|---|---|
|2016-05-01 12:00:00.0000000|170200|
|2016-05-02 00:00:00.0000000|152975|
|2016-05-02 12:00:00.0000000|181315|
|2016-05-03 00:00:00.0000000|146817|

**Example**

Kusto limits are reached with datasets that are too large, where you need to run periodic queries over the dataset, but run the regular queries to calculate [`percentile()`](percentiles-aggfunction.md) or [`dcount()`](dcount-aggfunction.md) over these big datasets.

::: zone pivot="azuredataexplorer"

To solve this problem, newly added data may be added to a temp table as hll or tdigest values using [`hll()`](hll-aggfunction.md) when the required operation is dcount or [`tdigest()`](tdigest-aggfunction.md) when the required operation is percentile using [`set/append`](../management/data-ingestion/index.md) or [`update policy`](../management/updatepolicy.md), In this case, the intermediate results of dcount or tdigest are saved into another dataset, which should be smaller than the target big one.

::: zone-end

::: zone pivot="azuremonitor"

To solve this problem, newly added data may be added to a temp table as hll or tdigest values using [`hll()`](hll-aggfunction.md) when the required operation is dcount, In this case, the intermediate results of dcount are saved into another dataset, which should be smaller than the target big one.

::: zone-end

When you need to get the final results of these values, the queries may use hll/tdigest mergers: [`hll-merge()`](hll-merge-aggfunction.md)/[`tdigest_merge()`](tdigest-merge-aggfunction.md), Then, after getting the merged values, [`percentile_tdigest()`](percentile-tdigestfunction.md) / [`dcount_hll()`](dcount-hllfunction.md) may be invoked on these merged values to get the final result of dcount or percentiles.

Assuming there's a table, PageViews, into which data is ingested daily, every day on which you want to calculate the distinct count of pages viewed per minuite later than date = datetime(2016-05-01 18:00:00.0000000).

Run the following query :

```
PageViews
| where Timestamp > datetime(2016-05-01 18:00:00.0000000)
| summarize percentile(BytesDelivered, 90), dcount(Page,2) by bin(Timestamp, 1d)
```

|Timestamp|percentile_BytesDelivered_90|dcount_Page|
|---|---|---|
|2016-05-01 00:00:00.0000000|83634|20056275|
|2016-05-02 00:00:00.0000000|82770|64135183|
|2016-05-03 00:00:00.0000000|72920|13685621|

This query will aggregate all the values every time you run this query (for example, if you are want to run it many times a day).

If you save the hll and tdigest values (which are the intermediate results of dcount and percentile) into a temp table, PageViewsHllTDigest, using an update policy or set/append commands, you may only merge the values and then use dcount_hll/percentile_tdigest using the following query:

```
PageViewsHllTDigest
| summarize  percentile_tdigest(merge_tdigests(tdigestBytesDel), 90), dcount_hll(hll_merge(hllPage)) by bin(Timestamp, 1d)
```

|Timestamp|percentile_tdigest_merge_tdigests_tdigestBytesDel|dcount_hll_hll_merge_hllPage|
|---|---|---|
|2016-05-01 00:00:00.0000000|84224|20056275|
|2016-05-02 00:00:00.0000000|83486|64135183|
|2016-05-03 00:00:00.0000000|72247|13685621|

This should be more performant and the query runs over a smaller table (in this example, the first query runs over ~215M records while the second one runs over 32 records only).

**Example**

The Retention Query.
Assuming you have a table which summarizes when each Wikipedia page was viewed (sample size is 10M), and you want to find for each date1 date2
the percentage of pages reviewed in both date1 and date2 relative to the pages viewed on date1 (date1 < date2).

The trivial way uses join and summarize operators :

```
// Get the total pages viewed each day
let totalPagesPerDay = PageViewsSample
| summarize by Page, Day = startofday(Timestamp)
| summarize count() by Day;
// Join the table to itself to get a grid where
// each row shows foreach page1, in which two dates
// it was viewed.
// Then count the pages between each two dates to
// get how many pages were viewed between date1 and date2.
PageViewsSample
| summarize by Page, Day1 = startofday(Timestamp)
| join kind = inner
(
    PageViewsSample
    | summarize by Page, Day2 = startofday(Timestamp)
)
on Page
| where Day2 > Day1
| summarize count() by Day1, Day2
| join kind = inner
    totalPagesPerDay
on $left.Day1 == $right.Day
| project Day1, Day2, Percentage = count_*100.0/count_1
```

|Day1|Day2|Percentage|
|---|---|---|
|2016-05-01 00:00:00.0000000|2016-05-02 00:00:00.0000000|34.0645725975255|
|2016-05-01 00:00:00.0000000|2016-05-03 00:00:00.0000000|16.618368960101|
|2016-05-02 00:00:00.0000000|2016-05-03 00:00:00.0000000|14.6291376489636|

The query above took ~18 seconds.

When using the functions of [`hll()`](hll-aggfunction.md), [`hll_merge()`](hll-merge-aggfunction.md) and [`dcount_hll()`](dcount-hllfunction.md), the equivalent query will end after ~1.3 seconds and shows that hll functions speeds up the query above by ~14 times:

```
let Stats=PageViewsSample | summarize pagehll=hll(Page, 2) by day=startofday(Timestamp); // saving the hll values (intermediate results of the dcount values)
let day0=toscalar(Stats | summarize min(day)); // finding the min date over all dates.
let dayn=toscalar(Stats | summarize max(day)); // finding the max date over all dates.
let daycount=tolong((dayn-day0)/1d); // finding the range between max and min
Stats
| project idx=tolong((day-day0)/1d), day, pagehll
| mv-expand pidx=range(0, daycount) to typeof(long)
// Extend the column to get the dcount value from hll'ed values for each date (same as totalPagesPerDay from the above query)
| extend key1=iff(idx < pidx, idx, pidx), key2=iff(idx < pidx, pidx, idx), pages=dcount_hll(pagehll)
// For each two dates, merge the hll'ed values to get the total dcount over each two dates,
// This helps to get the pages viewed in both date1 and date2 (see the description below about the intersection_size)
| summarize (day1, pages1)=arg_min(day, pages), (day2, pages2)=arg_max(day, pages), union_size=dcount_hll(hll_merge(pagehll)) by key1, key2
| where day2 > day1
// To get pages viewed in date1 and also date2, look at the merged dcount of date1 and date2, subtract it from pages of date1 + pages on date2.
| project pages1, day1,day2, intersection_size=(pages1 + pages2 - union_size)
| project day1, day2, Percentage = intersection_size*100.0 / pages1
```

|day1|day2|Percentage|
|---|---|---|
|2016-05-01 00:00:00.0000000|2016-05-02 00:00:00.0000000|33.2298494510578|
|2016-05-01 00:00:00.0000000|2016-05-03 00:00:00.0000000|16.9773830213667|
|2016-05-02 00:00:00.0000000|2016-05-03 00:00:00.0000000|14.5160020350006|

> [!NOTE]
> The results of the queries are not 100% accurate due to the error of the hll functions.(see [`dcount()`](dcount-aggfunction.md) for further information about the errors).


text:
# PostCSS Reference [![Build Status][ci-img]][ci]

[PostCSS](https://github.com/postcss/postcss) plugin for referencing selectors' rules from CSS files and defined rulesets.  Will not output rules unless directly referenced in your stylesheet.  Concept follows LESS's [@import (reference) 'filename'](http://lesscss.org/features/#import-options-reference) functionality but with slightly different syntax and usage.  The goal for the plugin is to allow for the kinds of advanced usage of LESS's `@extend` and `@import(reference)` methods as outlined in [this article on Semantic Remapping](https://medium.com/@dehuszar/semantic-remapping-with-css-pre-processors-906ba1a9910c) for PostCSS.  The Plugin can currently replicate [most examples for this article](http://codepen.io/collection/DoEGWB/).

[PostCSS]: https://github.com/postcss/postcss
[ci-img]:  https://travis-ci.org/dehuszar/postcss-reference.svg
[ci]:      https://travis-ci.org/dehuszar/postcss-reference

## Basic syntax:

Rules placed in the `@reference` block are mapped to a comparison array and discarded from the AST.  Rules from your style sheet which then use an `@references selectorName;` declaration will have their requested selector compared against the rules in your comparison array.  All instances of `@references` *have* to be declarations.  A `selector:reference(.reference-target) { /* declarations */ }` syntax similar to LESS's extend pseudo-class is forthcoming.  Matching rules from the `@reference` block will then have their declarations merged into your requesting rules' declarations where the originating `@references selectorName;` request was made.

```css
/* Input */
@reference {
    header {
        display: block;
    }
}

header {
    @references header;
    margin: 0;
}
```

```css
/* Output */
header {
    display: block;
    margin: 0;
}
```

## Using the `all` flag:

When a `@references selectorName` declaration uses the 'all' flag, [PostCSS Reference] will look for all selectors in the `@reference` block which begin with the requested selector.

```css
/* Input */
@reference {
    header {
        display: block;
    }

    header h1 {
        font-family: Arial;
    }

    header-alt {
        color: blue;
        font-family: "Times New Roman";
    }

    .widget header {
        padding-left: 1em;
    }
}

header {
    @references header all;
    margin: 0;
}
```

```css
/* Output */
header {
    display: block;
    margin: 0;
}

header h1 {
    font-family: Arial;
}
```

Note that `header-alt` and `.widget header` are ignored as those rules are not an exact match, pseudo-class, sibling, or descendant of the requesting rule.

## Using `@import`:

(example assumes you have [postcss-import](https://github.com/postcss/postcss-import) installed and configured properly)
In this example we import the entirety of [Yahoo's PureCSS core library](http://purecss.io/) so that we can reference the `.pure-button` and `.pure-button-primary` rules.  The unreferenced rules in pure.css are discarded.

```css
/* Input */
@reference {
    @import 'pure.css';
}

button {
    @references .pure-button, .pure-button-primary;
}
```

```css
/* Output */
button {
    display: inline-block;
    zoom: 1;
    line-height: normal;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
    cursor: pointer;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 100%;
    padding: 0.5em 1em;
    color: #444;
    border: 1px solid #999;
    background-color: #E6E6E6;
    text-decoration: none;
    border-radius: 2px;
}
```
## Media Queries

Additionally, [Postcss Reference] can read rules from inside media queries.  Items can be referenced across matching media queries, or if a non-media-query wrapped rule references a selector with the 'all' flag, and the requested reference rules have matches wrapped in any media queries.  For example:

```css
/* Input */
@reference {
    article {
        width: 100%;
    }

    @media (min-width: 900px) {
        article {
            width: 75%;
        }
    }
}

@media (min-width: 900px) {
    article {
        display: block;
        @references article;
    }
}

/* Output */
@media (min-width: 900px) {
    article {
        display: block;
        width: 75%;
    }
}
```

...or...

```css
/* Input */
@reference {
    article {
        width: 100%;
    }

    @media (min-width: 900px) {
        article {
            width: 75%;
        }
    }
}

article {
    display: block;
    @references article all;
}

/* Output */
article {
    display: block;
    width: 100%;
}

@media (min-width: 900px) {
    article {
        width: 75%;
    }
}
```

comma separated `@references` requests will return declarations from any matched selectors.  So...

```css
    header {
        @references header, footer;
    }

```

...would match any header or footer selectors.  It would also match selectors that have the same comma separated combination in any order.  So a reference rule with a selector like `footer, header` would return the same declarations as just `header`.  Superfluous or unmatched selectors are ignored.  So `footer, header, section {}` would still return a match, and `section` would be ignored.

Comma separated reference requests can have their own parameters.  So a declaration like `@references header all, footer` would return all exact _and_ related matches for header, but only exact matches for footer.

## Cross media-query references

PostCSS Reference has the unique ability to reference selectors across disparate media queries.

Referencing a selector that has _no media query_, when the requesting selector _is in a media query_ will yield a match if the `@references` request is wrapped with an `@references-media` atRule with no params

```css
  /* Input */
  @reference {
    .my-glorious-selector {
      color: blue;
      display: block;
    }
  }

  @media (min-width: 768px) {
    button {
      color: black;
      display: inline-block;

      @references-media {
        @references .my-glorious-selector all;
      }
    }
  }

  /* Output */
  @media (min-width: 768px) {
    button {
      color: blue;
      display: block
    }
  }
```

Referencing a selector that has a media query, when the requesting selector is in a _different_ media query will yield a match if the `@references` request is wrapped with an `@references-media` atRule and has the target media query as a parameter
```css
  /* Input */
  @reference {
    @media (max-width: 479px) {
      .my-glorious-selector {
        color: blue;
        display: block;
      }
    }
  }

  @media (min-width: 768px) {
    button {
      color: black;
      display: inline-block;

      @references-media (max-width: 479px) {
        @references .my-glorious-selector all;
      }
    }
  }

  /* Output */
  @media (min-width: 768px) {
    button {
      color: blue;
      display: block
    }
  }
```

[PostCSS Reference] has also been tested for use with [PostCSS Nested](https://github.com/postcss/postcss-nested) to allow for referencing nested rules like so:

```css
@references {
    @import "pure.css";
    @import "grids-responsive.css"; /* also part of the PureCSS library */

    .layout-article-full {
        @references .pure-g all;

        /* mobile-first layout*/
        [role="main"],
        [role="main"] > article,
        [role="complementary"] > section {
            @references .pure-u-1-1 all;

            + * {
                margin: 2.2vh 0 0 0;
            }
        }

        /* tablet/portrait layout */
        [role="complementary"] > section {
            @references .pure-u-sm-1-2 all;
        }

        /* desktop layout*/
        [role="main"] {
            @references .pure-u-xl-3-4 all;
        }

        [role="complementary"] {
            @references .pure-u-xl-1-4 all;
        }
    }
}

.content-wrapper {
    @references .layout-article-full all;
}
```

would yield output like the following:

```css
    .content-wrapper {
        /* .pure-g declarations and rules would go here -- ignoring for brevity */
    }

    .content-wrapper [role="main"],
    .content-wrapper [role="main"] > article,
    .content-wrapper [role="complementary"] > section {
        display: inline-block;
        *display: inline;
        zoom: 1;
        letter-spacing: normal;
        word-spacing: normal;
        vertical-align: top;
        text-rendering: auto;
        width: 50%;
        *width: 49.9690%;
    }

    /*...etc...*/
```

Note that the `.layout-article-full` class has been remapped to .content-wrapper, and all related matches use the selector of the requesting rule.  Also note, that the `@reference` block itself has `@references` declarations which also get resolved.  The above abstraction would work the same if the `.layout-article-full` nested rule set was moved to an external style sheet and imported like so:

```css
@references {
    @import "pure.css";
    @import "grids-responsive.css";
    @import "layout-article-full.css"
}
```

So long as the rules being referenced come before the rule whose `@references` declaration is making the request; i.e. put your dependencies first.  This allows for very powerful CSS component abstractions.

## Usage

At present, [Postcss Reference] does not take any options.  That may be subject to change.
```js
postcss([ require('postcss-reference') ])
```

See [PostCSS](https://github.com/postcss/postcss) docs for examples for your environment.

To get the best results out [PostCSS Reference], I recommend the following plugin combination:

```js
postcss()
    .use(atImport()) // postcss-import
    .use(nested()) // postcss-nested
    .use(reference()) // this esteemed plugin
    .use(mqPacker()) // css-mqpacker
    .use(removePrefixes()) // postcss-remove-prefixes
    .use(cssnano()) // cssnano
    .process(/* do your business */);
```

[postcss-import](https://github.com/postcss/postcss-import) (Versions greater than 7.x are not currently working.  A fix is in the works) and [PostCSS Nested](https://github.com/postcss/postcss-nested) are well covered above, so I won't go into further detail here.

The inclusion of [CSS MQPacker](https://github.com/hail2u/node-css-mqpacker) is largely because [PostCSS Reference] does not attempt to optimize media-query matches and will return them as they are referenced.  Having too many media-queries in your CSS can increase the parse time of your style sheet by the browser.  On the other hand, writing your CSS so that there's only a single media-query for each breakpoint, screen type, or orientation combo, severely limits the ability to make composable component abstractions.  This plugin gives you the best of both.

If you are importing libraries such as Bootstrap, Pure, or Foundation, you will already have a _lot_ of vendor prefixes, and those libraries get updated less frequently than the caniuse database.  Stripping them all out and letting autoprefixer or cssnano inject only what constitutes the latest best practices, or your preferred configuration will give you more precise control over the output.  For this I've been using [postcss-remove-prefixes](https://github.com/johnotander/postcss-remove-prefixes) to great effect.

[cssnano](http://cssnano.co/) provides a very thorough optimization pass over your CSS output.  [PostCSS Reference] doesn't try too hard to figure out intent when there are duplicate declarations coming from different referenced rules.  Also when a nested rule's parent has no declarations, you will often see empty rules in your output.  cssnano is a great way to clean up the cruft.  If cssnano is too heavy for your tastes, I would recommend at least using the following plugins for cleanup that you might need for CSS output by [PostCSS Reference]:

- [postcss-discard-duplicates](https://github.com/ben-eb/postcss-discard-duplicates)
- [postcss-discard-empty](https://github.com/ben-eb/postcss-discard-empty)
- [postcss-discard-unused](https://github.com/ben-eb/postcss-discard-unused)
- [postcss-merge-rules](https://github.com/ben-eb/postcss-merge-rules)
- [postcss-unique-selectors](https://github.com/ben-eb/postcss-unique-selectors)

cssnano might be easier.  ;-)

## TODO's for the next release:

 - Updating to work with latest version of postcss-import (currently only works up to v7.x)
 - Source-mapping references

repository: mrblanchard/postcss-reference

repo_name: mrblanchard/postcss-reference


text:
**Send on kindle**
Implemented with socket in python

This simple script is just a client implementation with socket of a gmail client used to send your pdf (or any other fole supported by Amazon) to your kindle.

It considers two options:
- *amazon don't send a verification mail*
- *amazon sends you a verification mail*

In the first case the code is tested and correctely working while in the second scenario gmail's pop3 protocol seems not to follow the RFC and keep sending the same chunk of mail every time, so it doesn't work yet.

The code is splitted in two sockets modules, one for the smtp socket and the other for the pop3.

The main is just a call to the two functions in the modules, to use it fill the variables and then run it.

**NB**: to use it you should disable in your google Account the option of let you access only by official gmail application

The project was mainly made for educational purpose but feel free to use it as you prefer.

repository: Galbuandco/Send-on-Kindle

repo_name: Galbuandco/Send-on-Kindle


text:
## Convolutional Variational Auto-Encoder (CVAE)

Here we have summarized documentation regarding the `train_CVAE.py` function. Note that this script has been adapted and modified from the TensorFlow2 tutorial [here](https://www.tensorflow.org/alpha/tutorials/generative/cvae), which is distributed under the Apache 2.0 [License](../../THIRD_PARTY_NOTICES.txt).

```
usage: train_CVAE.py [-h] [--data DATA] [--learning-rate LEARNING_RATE]
                     [--epochs EPOCHS] [--batch-size BATCH_SIZE]
                     [--im-dim IM_DIM] [--num-filters NUM_FILTERS] -l
                     LATENT_DIMENSIONS

optional arguments:
  -h, --help            show this help message and exit
  --data DATA           data source to train CVAE, possibilities are 'mnist',
                        'fashion_mnist' and 'faces' <default: 'mnist'>
  --learning-rate LEARNING_RATE
                        learning rate, <default: 0.001>
  --epochs EPOCHS       number of epochs for training <default: 5>
  --batch-size BATCH_SIZE
                        size of training data batches <default: 50>
  --im-dim IM_DIM       square dimensionality of input images <default: 28>
  --num-filters NUM_FILTERS
                        number of filters to be used in convolutional layers
                        <default: 32>

required named arguments:
  -l LATENT_DIMENSIONS, --latent-dimensions LATENT_DIMENSIONS
                        number of central latent dimensions in CVAE, 2
                        dimensions are recommended for quick manifold
                        visualization
```

This script currently supports TensorFlow eager execution for easy debugging. For conversion to AutoGraph, minor modifications such as additions of<EMAIL_ADDRESS>calls would need to be made. The script in `train_CVAE.py` will train a corresponding CVAE and save its weights to `/src/pickles`. An example of running `train_CVAE.py` is given below:

```shell
$ python3 train_CVAE.py --epochs 10 --latent-dimensions 2
```

### CVAE Latent Manifold Visualization

Using a pre-trained CVAE, we generated 1600 MNIST images derived from the CVAE latent manifold:

Similarly, we generated 1600 manifold samples of fashion-MNIST images:

The same process was done for 1600 samples of LFW cropped-face images. The image below shows variation on a 2-dimensional latent space.

The image below shows 2-dimensional projected variation on a 6-dimensional latent space.

The image below shows 2-dimensional projected variation on a 10-dimensional latent space.

### CVAE Latent Manifold Animation

To visualize the smoothness of changes in the latent manifold, we animated the above plots in a spiral sequence.

**MNIST:**

**Fashion-MNIST:**

**LFW Faces, 2-d latent space:**

**LFW Faces, 6-d latent space:**

**LFW Faces, 10-d latent space:**

repository: atreyasha/deep-generative-models

repo_name: atreyasha/deep-generative-models


text:
# SDWebImageWebPCoder

[![CI Status](http://img.shields.io/travis/SDWebImage/SDWebImageWebPCoder.svg?style=flat)](https://travis-ci.org/SDWebImage/SDWebImageWebPCoder)
[![Version](https://img.shields.io/cocoapods/v/SDWebImageWebPCoder.svg?style=flat)](http://cocoapods.org/pods/SDWebImageWebPCoder)
[![License](https://img.shields.io/cocoapods/l/SDWebImageWebPCoder.svg?style=flat)](http://cocoapods.org/pods/SDWebImageWebPCoder)
[![Platform](https://img.shields.io/cocoapods/p/SDWebImageWebPCoder.svg?style=flat)](http://cocoapods.org/pods/SDWebImageWebPCoder)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager/)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/SDWebImage/SDWebImageWebPCoder)
[![codecov](https://codecov.io/gh/SDWebImage/SDWebImageWebPCoder/branch/master/graph/badge.svg)](https://codecov.io/gh/SDWebImage/SDWebImageWebPCoder)

Starting with the SDWebImage 5.0 version, we moved the WebP support code and [libwebp](https://github.com/webmproject/libwebp) from the Core Repo to this stand-alone repo.

SDWebImageWebPCoder supports both WebP decoding and encoding, for Static WebP or Animated WebP as well.

## Requirements

+ iOS 9.0
+ macOS 10.11
+ tvOS 9.0
+ watchOS 2.0
+ Xcode 11.0

## Installation

#### CocoaPods

SDWebImageWebPCoder is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:

```ruby
pod 'SDWebImageWebPCoder'
```

#### Carthage

SDWebImageWebPCoder is available through [Carthage](https://github.com/Carthage/Carthage).

```
github "SDWebImage/SDWebImageWebPCoder"
```

#### Swift Package Manager (Xcode 11+)

SDWebImageWebPCoder is available through [Swift Package Manager](https://swift.org/package-manager).

```swift
let package = Package(
    dependencies: [
        .package(url: "https://github.com/SDWebImage/SDWebImageWebPCoder.git", from: "0.3.0")
    ]
)
```

## Usage

### Add Coder

Before using SDWebImage to load WebP images, you need to register the WebP Coder to your coders manager. This step is recommended to be done after your App launch (like AppDelegate method).

+ Objective-C

```objective-c
// Add coder
SDImageWebPCoder *webPCoder = [SDImageWebPCoder sharedCoder];
[[SDImageCodersManager sharedManager] addCoder:webPCoder];
```

+ Swift

```swift
// Add coder
let WebPCoder = SDImageWebPCoder.shared
SDImageCodersManager.shared.addCoder(WebPCoder)
```

### Modify HTTP Accept Header

Some of image server provider may try to detect the client supported format, by default, SDWebImage use `image/*,*/*;q=0.8` for [Accept](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept). You can modify it with the `image/webp` as well.

+ Objective-C

```objective-c
[[SDWebImageDownloader sharedDownloader] setValue:@"image/webp,image/*,*/*;q=0.8" forHTTPHeaderField:@"Accept"];
```

+ Swift

```swift
SDWebImageDownloader.shared.setValue("image/webp,image/*,*/*;q=0.8", forHTTPHeaderField:"Accept")
```

### Loading

+ Objective-C

```objective-c
// WebP online image loading
NSURL *webpURL;
UIImageView *imageView;
[imageView sd_setImageWithURL:webpURL];
```

+ Swift

```swift
// WebP online image loading
let webpURL: URL
let imageView: UIImageView
imageView.sd_setImage(with: webpURL)
```

### Progressive Animation Loading (0.5.0+)

+ Objective-C

```objective-c
// WebP progressive loading for animated image
NSURL *webpURL;
SDAnimatedImageView *imageView;
imageView.shouldIncrementalLoad = YES;
[imageView sd_setImageWithURL:webpURL placeholderImage:nil options:SDWebImageProgressiveLoad];
```

+ Swift

```swift
// WebP progressive loading for animated image
let webpURL: URL
let imageView: SDAnimatedImageView
imageView.shouldIncrementalLoad = true
imageView.sd_setImage(with: webpURL, placeholderImage: nil, options: [.progressiveLoad])
```

### Decoding

+ Objective-C

```objective-c
// WebP image decoding
NSData *webpData;
UIImage *image = [[SDImageWebPCoder sharedCoder] decodedImageWithData:webpData options:nil];
```

+ Swift

```swift
// WebP image decoding
let webpData: Data
let image = SDImageWebPCoder.shared.decodedImage(with: data, options: nil)
```

### Thumbnail Decoding (0.4.0+)

+ Objective-C

```objective-c
// WebP thumbnail image decoding
NSData *webpData;
CGSize thumbnailSize = CGSizeMake(300, 300);
UIImage *thumbnailImage = [[SDImageWebPCoder sharedCoder] decodedImageWithData:webpData options:@{SDImageCoderDecodeThumbnailPixelSize : @(thumbnailSize)}];
```

+ Swift

```swift
// WebP thumbnail image decoding
let webpData: Data
let thumbnailSize = CGSize(width: 300, height: 300)
let image = SDImageWebPCoder.shared.decodedImage(with: data, options: [.decodeThumbnailPixelSize: thumbnailSize])
```

### Encoding

+ Objective-c

```objective-c
// WebP image encoding
UIImage *image;
NSData *webpData = [[SDImageWebPCoder sharedCoder] encodedDataWithImage:image format:SDImageFormatWebP options:nil];
// Animated encoding
NSArray<SDImageFrames *> *frames;
NSData *awebpData = [[SDImageWebPCoder sharedCoder] encodedDataWithFrames:frames loopCount:0 format:SDImageFormatWebP options:nil];
// Encode Quality
NSData *lossyWebpData = [[SDImageWebPCoder sharedCoder] encodedDataWithImage:image format:SDImageFormatWebP options:@{SDImageCoderEncodeCompressionQuality : @(0.1)}]; // [0, 1] compression quality
NSData *limitedWebpData = [[SDImageWebPCoder sharedCoder] encodedDataWithImage:image format:SDImageFormatWebP options:@{SDImageCoderEncodeMaxFileSize : @(1024 * 10)}]; // v0.6.0 feature, limit output file size <= 10KB
```

+ Swift

```swift
// WebP image encoding
let image: UIImage
let webpData = SDImageWebPCoder.shared.encodedData(with: image, format: .webP, options: nil)
// Animated encoding
let frames: [SDImageFrame]
let awebpData = SDImageWebPCoder.shared.encodedData(with: frames, loopCount: 0, format: .webP, options: nil)
// Encode Quality
let lossyWebpData = SDImageWebPCoder.shared.encodedData(with: image, format: .webP, options: [.encodeCompressionQuality: 0.1]) // [0, 1] compression quality
let limitedWebpData = SDImageWebPCoder.shared.encodedData(with: image, format: .webP, options: [.encodeMaxFileSize: 1024 * 10]) // v0.6.0 feature, limit output file size <= 10KB
```

### Thumbnail Encoding (0.6.1+)

+ Objective-C

```objective-c
// WebP image thumbnail encoding
UIImage *image;
NSData *thumbnailWebpData = [[SDImageWebPCoder sharedCoder] encodedDataWithImage:image format:SDImageFormatWebP options:@{SDImageCoderEncodeMaxPixelSize : @(CGSizeMake(200, 200))}]; // v0.6.1 feature, encoding max pixel size
```

+ Swift

```swift
// WebP image thumbnail encoding
let image: UIImage
let thumbnailWebpData = SDImageWebPCoder.shared.encodedData(with: image, format: .webP, options: [.encodeMaxPixelSize: CGSize(width: 200, height: 200)]) // v0.6.1 feature, encoding max pixel size
```

See more documentation in [SDWebImage Wiki - Coders](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#custom-coder-420)

### Animated WebP Encoding (0.10+)

+ Objective-c

```objective-c
// Animated encoding
NSMutableArray<SDImageFrames *> *frames = [NSMutableArray array];
for (size_t i = 0; i < images.count; i++) {
    SDImageFrame *frame = [SDImageFrame frameWithImage:images[i] duration:0.1];
    [frames appendObject:frame];
}
NSData *awebpData = [[SDImageWebPCoder sharedCoder] encodedDataWithFrames:frames loopCount:0 format:SDImageFormatWebP options:nil];
```

+ Swift

```swift
// Animated encoding
var frames: [SDImageFrame] = []
for i in 0..<images.count {
    let frame = SDImageFrame(image: images[i], duration: 0.1)
    frames.append(frame)
}
let awebpData = SDImageWebPCoder.shared.encodedData(with: frames, loopCount: 0, format: .webP, options: nil)
```

### Advanced WebP codec options (0.8+)

The WebP codec [libwebp](https://developers.google.com/speed/webp/docs/api) we use, supports some advanced control options for encoding/decoding. You can pass them to libwebp by using the wrapper top level API:

+ Objective-C

```objective-c
UIImage *image;
SDImageCoderOptions *options = @{SDImageCoderEncodeWebPMethod: @(0), SDImageCoderEncodeWebPAlphaCompression: @(100)};
NSData *data = [SDImageWebPCoder.sharedCoder encodedDataWithImage:image format:SDImageFormatWebP options:options];
// Will translate into:
// config->method = 0;
// config->alpha_quality = 100;
```

+ Swift

```swift
let image: UIImage
let options = [.encodeWebPMethod: 0, .encodeWebPAlphaCompression: 100]
let data = SDImageWebPCoder.shared.encodedData(with: image, format: .webP, options: options)
// Will translate into:
// config->method = 0;
// config->alpha_quality = 100;
```

## Example

To run the example project, clone the repo, and run `pod install` from the root directory first. Then open `SDWebImageWebPCoder.xcworkspace`.

This is a demo to show how to use `WebP` and animated `WebP` images via `SDWebImageWebPCoderExample` target.

## Screenshot

<img src="https://raw.githubusercontent.com/SDWebImage/SDWebImageWebPCoder/master/Example/Screenshot/WebPDemo.png" width="300" />

These WebP images are from [WebP Gallery](https://developers.google.com/speed/webp/gallery1) and [GIF vs APNG vs WebP](http://littlesvr.ca/apng/gif_apng_webp.html)

## Author

[Bogdan Poplauschi](https://github.com/bpoplauschi)
[DreamPiggy](https://github.com/dreampiggy)

## License

SDWebImageWebPCoder is available under the MIT license. See [the LICENSE file](https://github.com/SDWebImage/SDWebImageWebPCoder/blob/master/LICENSE) for more info.

repository: JmoVxia/CLDemo

repo_name: JmoVxia/CLDemo


text:
VueScan is here to help. We reverse engineered over 6000 scanners so you can keep using the scanner you already have.

## What is VueScan?
VueScan is an application for scanning documents, photos, film, and slides on Windows, macOS, and Linux. VueScan supports over 6000 scanners from 42 manufacturers - even when there isn’t a driver available from the manufacturer.

Whether you’re having trouble getting your scanner connected to your computer, or you want to use the scanner software with the most features, VueScan is the tool for you.

## Overview
![screenshot](https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/vuescan/screenshot1.png) Works on 6000+ scanners

![screenshot](https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/vuescan/screenshot2.png) Works on Windows, Mac OS X, and Linux

![screenshot](https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/vuescan/screenshot3.png) Try for free

![screenshot](https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/vuescan/screenshot4.png) Updated every week or two

![screenshot](https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/vuescan/screenshot5.png) Advanced Scanning Control

![screenshot](https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/vuescan/screenshot6.png) Basic Mode

![screenshot](https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/vuescan/screenshot7.png) Works on Flatbed, Document, and Film/Slide Scanner

![screenshot](https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/vuescan/screenshot8.png) Translated in to 28+ languages

**The Tool For All Your Scanning Needs**
VueScan has the features you need no matter what you need to scan

### SCAN DOCUMENTS
Whether you need to scan a single page or a hundred page book, VueScan has the tools to help yo Scan with Flatbed and Automatic Document Feeders (ADF)

- Scan to PDF (Single and Multipage)

- Optical Character Recognition (OCR)

- Automatic Color Detection

- Small document file sizes

- Automatic document deskewing

![screenshot](https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/vuescan/screenshotA.png)

### SCAN PHOTOS
Do you have boxes full of photos in a drawer? Use VueScan to get them on your computer, and off your to-do list.

- Scan with Flatbed and Automatic Document Feeders (ADF)

- Scan to JPEG or TIFF

- Preset photo sizes

- Scan multiple photos on the flatbed

- Automatic file naming

[Learn more about scanning photos with VueScan »](https://www.hamrick.com/photo-scanning-software.html#features)

![screenshot](https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/vuescan/screenshotB.png)

### SCAN FILM AND SLIDES
VueScan is the ultimate tool for all your film and slide scanning needs.

- Works with almost all film/slide scanners

- Scan to JPEG/TIFF/RAW

- Infrared Dust Removal

- Color correction

- IT8 Calibration

- Photoshop Integration

![screenshot](https://cdn.jsdelivr.net/gh/chtof/chocolatey-packages/automatic/vuescan/screenshotC.png)

**Trusted by over 600,000 customers across the globe**
Since 1998, VueScan has saved hundreds of thousands scanners from ending up in the landfill.

repository: chtof/chocolatey-packages

gha_language: PowerShell

repo_name: chtof/chocolatey-packages


text:
Lister
==============

Lister is a productivity sample code project for iOS. In this sample, the user can create lists, add items to lists, and track the progress of items in the lists.
The solution includes iOS app and iOS Today extensions app (Widget).

In sample, the user manages multiple lists using a table view implemented in the `DocumentsViewController` class. In addition to vending rows in the table view, the list documents controller observes changes to the lists, as well as the status of `iCloud`. Tapping on a list brings the user to the `ListViewController`. This class displays and manages a single document. The `NewListDocumentController` class allows a user to create a new list.

The `ListCoordinator` class tracks the user's storage choice — local or `iCloud` and moves the user's documents between the two storage locations. The `ListDocument` class, a subclass of `UIDocument`, represents an individual list document that is responsible for serialization and deserialization.

`List` and `ListItem` are the two main model objects. The `ListItem` class represents a single item in a list. It contains only three stored properties: the text of the item, a Boolean indicating whether the user has completed it, and a unique identifier. Along with these properties, the `ListItem` class also implements the functionality required to compare, archive, and unarchive a `ListItem` object. The `List` class holds an array of these `ListItem` objects, as well as the color the desired list color. The `List` class also supports indexer, archiving and unarchiving.

In addition to model code, by subclassing `CALayer`, Lister shares checkbox drawing code with both app and it's extension.

References
----------
For understanding Widgets (Today extension) read [Apple's documentation](https://developer.apple.com/library/prerelease/mac/documentation/General/Conceptual/ExtensibilityPG/NotificationCenter.html#//apple_ref/doc/uid/TP40014214-CH11-SW1)

Setup
-----
For this sample you need create ApplicationID and setup iCloudContainer for it. For complete instructions read `Enabling iCloud in Xamarin` section from [tutorial](http://developer.xamarin.com/guides/ios/platform_features/introduction_to_the_document_picker/).

Instructions
------------
Before running the app you shoud signin to your `iCloud` account via `Settings` application. Also enable `iCloud Drive`.  After that run the app.
During launching process application will copy resource files (which represents serialized `List` objects) to `Documents` folder within sandbox.
You will be promted about storage choice (`iCloud` or local). You will not be able to change you choice in future, so please choose `iCloud`. You need `iCloud` storage, because this is a way to share data between application and it's extension.

When you choose `iCloud` app will move resource files (`*.lister`) from `Documents` folder to `iCloud` container. After that these files will available to `ListerToday` extension app (`Widget`).
`ListerToady` (Widget) displays only items from `Today` list, because of this add some items to this list. Now you are ready to run your widget.

Go to `Today view` (`Notification center`). Here you will see built in widgets like `Calendar`, `Remainders`, etc. Now we need to enable `ListerLoday` Widget (add it to `Today view`). At the button you will see `Edit` button. Tap on it, then enable `ListerToday` widget and press `Done`. At this point you will see `Today view` with `ListerToday` widget, also you will see your Today items.

When you change your `Today list` within Lister app these changes will be displayed inside ListerToday Widget and vice versa.

Build Requirements
------------------

Building this sample requires Xcode 6.0 and iOS 8.0 SDK

Target
------
This sample runnable on iPhone/iPad

Author
------
IOS:
Copyright (C) 2014 Apple Inc. All rights reserved.

Ported to Xamarin.iOS by Rustam Zaitov

repository: ChristopherRamos/monotouch-samples

repo_name: ChristopherRamos/monotouch-samples


text:
# Project 3 - Twitter
Twitter is a basic twitter app to read your tweets.

## Overview
In Unit's 1 & 2, you fetched movie data from the Movie Database API and rendered it in a scrolling list that allowed users to tap a movie to get more details.
One thing to note is that your user did not have to sign in because they were not accessing any personal data.
In this unit, we'll be building the first part of a Twitter app that allows users to log in to their actual Twitter accounts to view their timeline tweets.
We'll use many of the same concepts you learned in Flix, making network requests and rendering data in table views.
But as you can imagine, we wouldn't want just anyone to log into our Twitter account, so this time we'll need to add a login flow that authenticates with Twitter to prove we are indeed the user we say we are.

# Twitter - Part II

This is a basic twitter app to view, compose, favorite, and retweet tweets.

Time spent: **8** hours spent in total

## User Stories

The following **required** functionality is completed:

- [x] User can compose a tweet. (4pts)
- [x] User can favorite a tweet. (4pts)
- [x] User can retweet a tweet. (2pts)

The following **bonus** features are implemented:

- [ ] When composing a tweet, user sees a countdown for the number of characters remaining for the tweet (out of 140) (2pts)
- [ ] User can view their profile in a profile tab. (3pts)
- [ ] User sees embedded images in tweet if available. (3pts)

## Video Walkthrough

Here's a walkthrough of implemented user stories:

## Twitter - Part 1

**Twitter**
Time spent: **8** hours spent in total

### User Stories

The following **required** functionality is completed:

- [x] User sees app icon in home screen and styled launch screen. (1pt)
- [x] User can log in. (1pt)
- [x] User can log out. (1pt)
- [x] User stays logged in across restarts. (1pt)
- [x] User can view tweets with the user profile picture, username, and tweet text. (6pts)

The following **bonus** features are implemented:

- [x] User can pull to refresh. (1pt)
- [x] User can load past tweets infinitely. (2pts)

## Video Walkthrough

Here's a walkthrough of implemented user stories:

## Notes

Describe any challenges encountered while building the app.

## License

    Copyright [yyyy] [name of copyright owner]

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

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

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


text:
Apply loads   (demo_FEA_loads_static.cpp)  {#tutorial_demo_FEA_loads}
==================================

Tutorial that teaches how to use the
[FEA module](group__chrono__fea.html)
to add loads to finite element models.

Loads are added via ChLoad objects.

There are various ready-to-use ChLoad objects, but here you can also learn how to define new ChLoad classes for custom loads.

Optionally the ChLoader classes can be used to automate some tasks, most noticeably the Gauss integration of distributed loads.

\include demo_FEA_loads_statics.cpp

repository: projectchrono/chrono

repo_name: projectchrono/chrono


text:
# Stereo

An example of a `monorepo` structure with nextjs, lerna and yarn monorepo.

## Getting started

This project shows a simple use case with `monorepo` structure. It has a `home` page made with `ssr` and a shareable components package inside project `core`.

### Prerequisites

You need to have the last version of `node` in yor machine

### Avaiable Scripts

In the project directory, you can see the follow structure:

**`stereo/`**

- In the root folder you can run one of these scripts:
  - `yarn` - installs all the dependencies
  - `yarn build` - build every package
  - `yarn bootstrap` - bootstrap the packages, Installs all of their dependencies and links any cross-dependencies.
  - `yarn storybook:start` - start the storybook to view all components locally [locahost:5555](http://localhost:5555)
  - `yarn test` - Launches the test runner through all packages.
  - `yarn coverage` - run coverage through all packages

**`stereo/packages/core`**

- Inside the `design` package you can run:
  - `yarn build` - will build this currently package and create the `/lib` folder

**`stereo/packages/home`**

- Inside the `home` ssr app, you can run one of the [nextjs](https://nextjs.org/docs) methods:
  - `yarn dev` - start a dev-server with hot-reloading

## Tips and Tricks

- `yarn add --dev -W package` - Use this command inside `/stereo` to install package in workspace. After that you only need to add it in your `package` dependency.

## Built With

- 🐉 [Lerna](https://lernajs.io/)  - The Monorepo manager
- 📦 [Yarn Workspaces](https://yarnpkg.com/lang/en/docs/workspaces/)  -  Sane multi-package management
- 🚀 [React](https://reactjs.org/)  -  JavaScript library for user interfaces
- 💅 [styled-components](https://www.styled-components.com/)  -  CSS in JS elegance
- 🛠 [Babel](https://babeljs.io/)  -  Compiles next-gen JavaScript
- 📖 [Storybook](https://storybook.js.org/) - UI Component Environment
- 🃏 [Jest](https://jestjs.io/)  -  Unit/Snapshot Testing
- 📦 [NextJS](https://nextjs.org/) - The React Framework

## Author

- **Marcio Mendes** - [mmendesas](https://github.com/mmendesas)

## License

This project is licensed under the MIT License

repository: mmendesas/stereo

repo_name: mmendesas/stereo


text:
# SoftwarePark Exercises

SoftwarePark exercises and dojos:

- [Transport Tycoon and DDD/ES](transport-tycoon.md)

You can subscribe to the [mailing list](https://tinyletter.com/softwarepark) for the new exercises or just keep an eye on this repository. Updates are planned **once per week, at most**.

## Reason

Domain-Driven Design (and the attention to the software design in general) is one of the essential things that make up the *ethos of SoftwarePark*.

We want to **spread the DDD ideas, experience and insights within the company**. To help with that, we are starting a short series of exercises, accompanied with a mini podcast.

While doing that we will keep exercises public and transparent. Perhaps, somebody else would find them helpful or entertaining.

repository: danielmahadi/exercises

repo_name: danielmahadi/exercises


text:
XKCDBlueEyes
============

Implementation of https://xkcd.com/blue_eyes.html

Solution: https://xkcd.com/solution.html

This simulates the logic puzzle. We create an island with a guru and random
colors then add logicians to it. Each day is simulated by the logicians
thinking logically and attempting to leave on the ferry. All messages are
printed to the console. Lots of error checking to make sure everything works
correctly.

repository: kovertopz/XKCDBlueEyes

repo_name: kovertopz/XKCDBlueEyes


text:
# First Programming Exercises

 [![License](http://img.shields.io/badge/license-MIT-blue.svg)](http://en.wikipedia.org/wiki/MIT_License)

**Author:** Grayden Blanchard

**Due date:** March 11, 2016 8:00AM

## Description

Book Exercises & Turtle Exercises

## What I Learned from This

Learned "Boolean" statements and performed exercises out of the book, learned how to create a polygon and stars with Turtle.

## Honor Pledge

I pledge that all the work in this repository is my own with only the following exceptions:

* Content of starter files supplied by the instructor;
* Code borrowed from another source, documented with correct attribution in the code and summarized here.

Signed,

Grayden Blanchard


text:
# Tornado+MongoDB-WAS

Template server based python tornado using mongo database.
This template has been implemented below features.

 1. Asynchronous connections on mongoDB and use it on operation.
 2. Perform asynchronous authentications using decorator (@authenticated_api)
 3. ORM designed models that supports CRUD functions. (mongoDB only. If you want to use other database platform, inherit HDORMObject with driver)
 4. Config server environment with configuration file (default.yaml)
 5. Supports some kinds of utilities (utils)

## Environments

Python 2.7

## Dependent modules

There are some modules to run this templates.
Run below shell script to install python modules

```
    pip install tornado
    pip install pymongo
    pip install motor
    pip install pyyaml
    pip install pycrypto
    pip install apscheduler
    pip install python-dateutil
```

## Run templates

Set **$PYTHONPATH** to add src folder absolute path and run **src/server/main.py**

## Usage

### Config

Set your customized config values on config/default.yaml

```
    port: 8080

        session_expire_days: 1

        template_dir: templates/
        static_dir: statics/
        favicon_path: favicon/

        cookie_secret: cookie_secret_here

        database:
            host: <IP_ADDRESS>
            port: 5000

            db_name: db_name

        debug: 1
```

### Authentications

You can support authenticated handler easily by placing some decorators to support authenticated API or some script.

``` python
    @tornado.web.asynchronous
    @authenticated_api
    @tornado.gen.coroutine
    class AuthenticatedAPIHandler(CommonHandler):

    	print self.current_user # returns HDUser instance
    	self.finish_and_return()

    @tornado.web.asynchronous
    @tornado.gen.coroutine
    class UnDecoratedAuthenticatedAPIHandler(CommonHandler):

    	yield self.get_current_user()
    	if self.current_user is not None:
    		# authenticated
    		# do something
    		pass
    	else:
    		raise tornado.web.HTTPError(403)
```

### CRUD

Inherit **HDMongoSyncObject** or **HDMongoAsyncObject** to support CRUD.
Use **HDMongoAsyncObject** on tornado server IOLoop to support asynchronous database connections.
If you want to use other database platform, inherit **HDORMObject** and implement CRUD functions.

## Author

[shkimturf](https://github.com/shkimturf)

## License

Tornado+MongoDB-WAS is under MIT License.

repository: shkimturf/Tornado-MongoDB-WAS

repo_name: shkimturf/Tornado-MongoDB-WAS


text:
# Design System

> You should be barely writing CSS to make a web-page.
> Also, what if you dont have to write the markup itself?

A Design System is a set of interconnected patterns and shared practices coherently organized.[1] Design Systems aid in digital product design and development of products such as apps or websites. They may contain, but are not limited to, pattern libraries, design languages, style guides, coded components, brand languages, and documentation.

| what is DS  | examples                                                   |
| ----------- | ---------------------------------------------------------- |
| rules       | must pass minimum color contrast ration of `4:5:1`         |
| constraints | number of colors in palette                                |
| principles  | color should be used in meaningful way, red, yellow, green |

Component -> Page Layout -> Interaction Model

1. [ ] color system | palette
2. [ ] Semantic html
3. [ ] accessibility, color contrast, sizing
4. [ ] responsiveness
5. [ ] Material UI specification
6. [ ] rich SEO text structure
7. [ ] prototyping
8. [ ] tracking enabled, forms, button-clicks
9. [ ] work on design programs, like invision, figma

### What are they?

> All systems are build using some micro-systems which works behind them

- [NASA standard manuals](https://standardsmanual.com/)
- Parts of a DS
  - Typography
  - Color Palettes
  - Spacing scale, like 4,5 or 8px
  - Components
  - Page Layouts
  - Interaction models
  - voice, tone and words

![components lexicon](./art/component.png)

## Features

- system theme, dark and light mode
- Adjust padding based on screen resolution size

### 1. [primer/css - github's css system](https://github.com/primer/css)

- uses [SCSS](https://sass-lang.com/documentation/syntax#scss) css pre-processor

| structure  | description                                  |
| ---------- | -------------------------------------------- |
| core       | basic HTML blocks like table, links          |
| product    | alerts, modals, dialogues, cards, navigation |
| marketting | usp, cta button, highlight, special offer    |

- https://youtu.be/Hx02SaL_IH0

### 2. [IBM carbon design system](https://www.carbondesignsystem.com/)

### Resources

- https://github.com/topics/component-library
- https://github.com/topics/design-systems
- https://github.com/alexpate/awesome-design-systems

repository: avimehenwal/design-system

repo_name: avimehenwal/design-system


text:
---
name: Bug report
about: Create a report to help us improve
title: ""
labels: bug
assignees: ""

---
**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**How are you deploying this?**
E.g. clicked on the "Deploy to Heroku" button (if so, which one?) from this repo/your fork, cloned this repository and set heroku remote and pushed to it.

Note that we don't support the "download the source code and try to deploy to heroku" and "git clone and copy the folder" deployment strategies. If these sound like what you're doing, try one of the officially supported deployment methods (see the `Deploy` section in the README). Otherwise, we can't help you!

**Additional context**
Add any other context about the problem here.

repository: nickolson/ghost-on-heroku

repo_name: nickolson/ghost-on-heroku


text:
gophish
=======

gophish is a native gopher client for SailfishOS.

Supported item types
--------------------

* `0` - text files
* `1` - gopher directories
* `7` - search queries
* `h` - HTML documents
  * traditional `GET` requests
  * `URL:` links

Encoding
--------

[RFC 1436](https://www.ietf.org/rfc/rfc1436.txt) defines ASCII as the encoding
used by the gopher protocol, but this seems to be outdated by now. Being a
modern client, gophish supports two supersets of the ASCII encoding:

* UTF-8 (preferred)
* Latin-1

When first contacting a server, gophish will send a UTF-8 encoded selector.
This should be no problem, as long as the server is not using non-ASCII
characters in selectors (which is a bad idea anyway).

gophish tries to decode the data retrieved from the server using UTF-8 and if
that fails, it falls back to Latin-1. Once gophish had to fall back to Latin-1,
the server is marked as being Latin-1 encoded internally and all following
communication, including the selectors, will be encoded in Latin-1.

repository: blabber/harbour-gophish

repo_name: blabber/harbour-gophish


text:
---
id: 232
title: 'JWT: Part 1 – Introduction'
date: 2019-03-25T22:03:28+01:00

guid: https://svrooij.nl/?p=232
old_permalink: /2019/03/jwt-introduction/
categories:
  - Security
tags:
  - api
  - authentication
  - jwt
---
What exactly is a **Json Web Token?** I like to describe them as an easy way to digitally sign some json data about a user, that can then be used as an access token for some kind of api. Check out JSON Web Token on wikepedia for an exact description.

I really like JWTs because they are verifiable without an additional call to some identity server. They are short-lived by default (at least should be). And it is the best option for access tokens at the moment.

## Sample token

This is a sample token (whitespace added for readability), it consists out of three parts, separated by a dot. Each part is base64 encoded.
The first part is the header, this describes the token type (JWT) and the algorithm (HS256) used for signing.
The second part (or the payload) holds all the data of the user in key-value pairs. Some keys are required some are optional (but recommended).
The thirth part is de signature of both the header and body in combination with some kind of secret.

```text
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
.
eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IlN0ZXBoYW4gdmFuIFJvb2lqIiwiZW1haWwiOiJzdGVwaGFuQHN2cm9vaWoubmwiLCJpc3MiOiJodHRwczovL2p3dC5pbyIsImF1ZCI6Imh0dHBzOi8vc3Zyb29pai5ubCIsImlhdCI6MTUxNjIzOTAyMn0
.
2AKMJtgllysoQkSi5b4jE8VuPpuKZ4cJSi5U0ClM74I
```

```jsonc
// The header
{
  "alg": "HS256", // Shared secret, sha256 hash
  "typ": "JWT" // This is in fact a JWT
}

// The payload
{
  "sub": "1234567890",
  "name": "Stephan van Rooij",
<EMAIL_ADDRESS>  "iss":"https://jwt.io",
  "aud":"https://svrooij.nl",
  "iat":<PHONE_NUMBER>
}
```

## Claims

Each JSON Web Token consists of some claims (key-value pairs) that describe the user, the application that created the token or the expected audience. For a complete list of pre-registered claims check this list.

You can add other data to the payload as long as you follow the rules. If the data you're sending is representing data as specified in the registered list please use the same claim. You can also add other claims, make sure they don't collide by adding a prefix or something like that.

| Claim | Name | Description |
|-------|------|-------------|
| aud | Audience | The application this token is for. |
| iss | Issuer | The application that created the token. |
| sub | Subject | An unique identifier for that specific user. It should always be the same for the same user. |
| name | Full name | The fullname of the user. |
| jti | JWT Id | An ID to identify that specific token. (use a guid). Can be used to prevent replay attacks. |
| email | Email | The email address of that specific user |
| preferred_username | Preferred username|The username the user preferres |
| iat | Issued at|The json timestamp when this token was created. |
| exp | Expiration time | The json timestamp until this token is valid.If present it should be checked. |
| nbf | Not before | The json timestamp the states from when this token is valid. Should be checked if present |

## Signature

The JWT specification describes three different algorithms to use for the signature of the token (and the plain algorithm, which should never be used).

HMAC-SHA256 (alg parameter, `HS256`), this means there is a shared secret that is used to compute the signature with the SHA256 algorithm. The application that wants to verify the signature will need the same secret. This algorithm is very usefull for testing, but it isn't the most secure way, because the application using the token can also issue new tokens because it knows the secret.

**RSASSA-PKCS1-v1_5** (alg parameter, `RS256`), this means the tokens is signed with the private key of a certificate using the SHA256 hashing algorithm. The application that wants to verify the signature will only need the public key of the certificate. And this is for that reason a secure algorithm to use in production. The public key can easily be shared and the applications using the token cannot create new tokens because they don't have the private key of the certificate.

ESDSA (Elliptic Curve Digital Signature Algorithm, alg parameter `ES256`), this means the token is signed with the ESDSA private key using the SHA256 algorithm. It gives you a smaller signature compared to RS256 (and should be faster to compute), but isn't supported by a lot of providers/clients.

No signature (alg parameter, none) means no signature (e.g. no security at all) you should never use this in any way!

gha_language: HTML


text:
# Graphical Calendar Dashlet
Graphical Calendar Dashlet for Sugar 7.6+, based off of Fullcalendar jQuery Plug-in (http://fullcalendar.io).

# Designed for Sugar 7.6+ (Pro/Ent/Ult)
# Install instructions:

1. Download files and place in matching paths on your Sugar instance file system.
2. Access Sugar as an Admin level user.
3. Execute a Quick Repair and Rebuild operation via Admin > Repair.

A dashlet named "My Graphical Calendar" should now be present in the list of available dashlets throughout the application.

# Features:
1. Automatically displays scheduled calls and/or meetings for currently logged in user.
2. Dashlet settings allow user to choose activity types to display.
3. Can be displayed in Home page, ListView or RecordView Intelligence Panel (all modules).

# In progress:
1. Allow scheduling via click on Calendar time slot.
2. Loading of corresponding data as user navigates from day to day.

repository: elchele/GraphicalCalendar

repo_name: elchele/GraphicalCalendar


text:
Set AWS credentials

    export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXX
    export AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXX

### Run within docker container

If you are familiar with Docker, you can run `aws-es-kibana` within a Docker container

Build the image

	docker build -t aws-es-kibana .

Run the container (do not forget to pass the required environment variables)

	docker run -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -p <IP_ADDRESS>:9200:9200 aws-es-kibana -b <IP_ADDRESS> <cluster-endpoint>

repository: cannalogue/aws-es-kibana

repo_name: cannalogue/aws-es-kibana


text:
# Husky Sleeps in Weird Position

Published at: **2019-11-04T19:00:00+00:00**

Author: ****

Original: [Sputniknews](https://sputniknews.com/videoclub/201911041077221234-husky-sleeps-in-weird-position/)

        Most dog owners know their pet’s habits and easily understand when their dog is happy, alarmed, surprised or afraid. But what does its sleeping pose means? Like humans, dogs have their own preferences, and they can tell us a lot about them.

The most relaxed posture of a dog is when its throat and stomach are open, as these are the most vulnerable parts of the body. If a dog sleeps on its back, this indicates complete trust and comfort.
In this video a husky is sleeping in quite a strange position, but it seems that the dog feels totally comfortable.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported