text:
---
title: Using Workspaces (Beta)
layout: en
---

# Workspaces (Beta)

> Workspaces are currently in beta testing, and may change without a prior
> notice.
{: .beta}

Workspaces allow jobs _within_ a build to share files.
They are useful when you want to use build artifacts from a previous job;
for example, you create a cache that can be used in multiple jobs later.

So you can clearly see when a workspace is created and used, we recommend using workspaces with [build stages](/user/build-stages), as shown in the following [examples](#workspace-examples).

> Note that it is best to create a workspace in one stage and then use it in
subsequent stages.

## Configuration

A minimal workspace configuration looks like this:

```yaml
jobs:
  include:
    - stage: warm_cache
      script:
        - echo "foo" > foo.txt
      workspaces:
        create:
          name: ws1
          paths:
            - foo.txt
    - stage: use_cache
      workspaces:
        use: ws1
      script:
        - cat foo.txt || true
```
{: data-file=".travis.yml"}

Each workspace has a unique name within a build.
It is specified by the `name` key when it is created with
`workspaces.create`, and by the value when it is used with
`workspaces.use`.

In the example above, the workspace named `ws1` is created by the only
job in the `warm_cache` stage.
The workspace is subsequently consumed in the `use_cache` stage.

## Workspace examples

### Multiple workspaces example

You can use multiple workspaces in a build.

```yaml
script:
  - ./build $TRAVIS_OS_NAME
jobs:
  include:
    - stage: Build binaries
      os: linux
      workspaces:
        create:
          name: linux-binaries
    - os: osx
      workspaces:
        create:
          name: osx-binaries
    - stage: Deploy
      language: minimal
      workspaces:
        use:
          - linux-binaries
          - osx-binaries
      git:
        clone: false
      script:
        - ./create_archive.sh
      deploy:
        provider: script
        script: ./upload.sh
```
{: data-file=".travis.yml"}

In this example:
  1. we run two jobs in the "Build binaries" stage,
     each producing uploading binaries.
  1. in the subsequent "Deploy" stage, we fetch the workspaces
     produced by the jobs in the previous stage, and deploy it
     using a custom script.

## Workspaces and concurrency
Note that workspaces work best if there is no race condition set while
uploading them.
Since there is no guarantee in the execution order of jobs within a build
stage, it is a good idea to assign different workspace names to jobs within
a build stage.

## Workspace names must be pre-determined
Due to technical reasons, workspace names will be escaped for shell.
In other words, given:

```yaml
workspaces:
  create:
    name: $TRAVIS_OS_NAME
    paths: …
```
{: data-file=".travis.yml"}

it will have to be consumed by

```yaml
workspaces:
  use: $TRAVIS_OS_NAME
```
{: data-file=".travis.yml"}

and not by

```yaml
workspaces:
  use: linux
```
{: data-file=".travis.yml"}

even if the consumer is running on a Linux VM.

## How workspaces differ from caches

It is worth reiterating that the workspaces are meant for sharing files
within the same build.
For files you want to share across builds, use
[caches](/user/caching).

### Workspaces and caches are considered independently

It is possible to include a single file in the cache and workspaces.

> If you restart some builds within a job, and your workspace isn't working like you expect it to, try restarting the the entire build.

gha_language: CSS


text:
# GetCoursesRequest

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**LocationIDs** | **int[]** | (optional) The requested locations. | [optional]
**CourseIDs** | **int[]** | (optional) The requested course IDs. | [optional]
**StaffIDs** | **int[]** | (optional) The requested StaffIDs. | [optional]
**ProgramIDs** | **int[]** | (optional) The requested program IDs. | [optional]
**StartDate** | [**\DateTime**](\DateTime.md) | The start date range. Any active courses that are on or after this day.
(optional) Defaults to today. | [optional]
**EndDate** | [**\DateTime**](\DateTime.md) | The end date range. Any active courses that are on or before this day.
(optional) Defaults to StartDate. | [optional]
**SemesterIDs** | **int[]** | (optional) The requested semester IDs. | [optional]
**Limit** | **int** | Number of results to include, defaults to 100 | [optional]
**Offset** | **int** | Page offset, defaults to 0. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

license: MIT

repository: ranitham/mindbody-laravel

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: ranitham/mindbody-laravel


text:
# Watch out for Safety Bandits!
## Tennessee Leeuwenburg

* Safety
    * For problems other people made
    * Testing:
        * `pip install insecure-package`
        * `safety check`
    * `pyup.io`
* Bandit
    * For problems you made
    * Introspects program
        * Follows the AST and follows calls
        * Rather than analyse syntax
    * Examples
        * Known broken SSL


text:
---
date: 2000-01-01T00:00:00+00:00
title: Create a Webhook Receiver
title_in_sidebar: Starter Project
author: bradrydzewski
steps: true
weight: 10
separator: true
---

The goal of this tutorial is to build a custom webhook receiver using our starter project template as the base. A webhook receiver is a small http server that receives and processes webhooks.

This tutorial assumes you have a working knowledge of the Go programming language. You will also need to install [boilr](https://github.com/tmrts/boilr), a scaffolding system used to generate new code projects from templates.

# Create the Project

Drone provides scaffolding for creating a new webhook receiver from a project template. We will bootstrap our project using this template.

1. Install the webhook template.
   ```
   $ boilr template download drone/boilr-webhook drone-webhook
   ```

2. Create a new webhook project.
   ```
   $ boilr template use drone-webhook my-webhook-receiver
   ```

# Customize the Code

The generated project creates a simple server capable of receiving, authenticating and parsing requests. You only need to modify the `plugin.Deliver` function to include your custom processing logic.

```Go  {linenos=table}
package plugin

import (
	"context"

	"github.com/drone/drone-go/plugin/webhook"
)

// New returns a new webhook extension.
func New() webhook.Plugin {
	return &plugin{}
}

type plugin struct {
}

func (p *plugin) Deliver(ctx context.Context, req *webhook.Request) error {
	// insert your custom logic here
	return nil
}
```

# Build Your Docker Image

The generated project includes a `Dockefile` that you can use to build and publish images. _You will need to update the Dockerfile entrypoint._

1. Build your binary file:
   ```
   $ GOOS=linux CGO_ENABLED=0 go build
   ```

2. Build and publish your Docker image:
   ```
   $ docker build -t my-webhook-receiver .
   $ docker push my-webhook-receiver
   ```

# Start the Webhook Receiver

1. Create a shared secret used to sign the http request:
   ```
   $ openssl rand -hex 16
   bea26a2221fd8090ea38720fc445eca6
   ```

2. Start the webhook receiver.
   ```
   $ docker run \
   -p 3000:3000 \
   -e DRONE_SECRET=bea26a2221fd8090ea38720fc445eca6 \
   my-webhook-receiver
   ```

# Enable Webhooks

Once the webhook receiver is running you will need to provide your Drone server with the webhook endpoint and secret:

```
DRONE_WEBHOOK_ENDPOINT=http://...
DRONE_WEBHOOK_SECRET=bea26a2221fd8090ea38720fc445eca6
```

repository: drone/docs

gha_language: SCSS

gha_license_id: NOASSERTION

repo_name: drone/docs


text:
# https://us-west-2.console.aws.amazon.com/codesuite/codecommit/repositories/aws-digito-artifacts-spec/browse/refs/heads/master/--/components/compute/stateless/ec2_and_asg/compute-stateless-gameday.adoc?region=us-west-2&lines=185-185
## Id
compute:test:ec2-inject_cpu_load:2020-07-28

## Intent
Test app monitor under load. (see note below)

## Type
HW Instance Failure Test

## Risk
Small

## Requirements
* EC2 instance with Linux OS
* There is a synthetic alarm setup for application

## Permission required for AutomationAssumeRole
* ssm:SendCommand
* ssm:ListCommands
* ssm:ListCommandInvocations
* ssm:DescribeInstanceInformation
* ssm:GetAutomationExecution
* ssm:CancelCommand
* cloudwatch:DescribeAlarms
* cloudwatch:GetMetricStatistics
* iam:PassRole

## Supports Rollback
Yes. If executed in rollback mode, any previous EC2 instance CPU injection will be terminated.

## Inputs
### CpuUtilizationAlarmName:
   * type: String
   * description: (Required) EC2 CPUUtilization alarm which should be triggerred
### InstanceId:
   * type: String
   * description: (Required) EC2 instance id (no need in case of rollback)
### Duration:
   * type: String
   * description: (Optional) The duration of the attack in seconds (default/recommended 300)
   * default: '300'
### NumCpuCores:
   * type: String
   * description: (Optional) Number of CPU cores to be impacted (default 0 - all)
   * default: '0'
### CpuLoadPercentage:
   * type: String
   * description: (Optional) The ASG EC2 instance CPU load percentage (default 1%)
   * default: '1'
### IsRollback:
   * type: String
   * description: (Optional) Provide true to terminate stress testing
   * default: 'false'
### PreviousExecutionId:
   * type: String
   * description: (Optional) Previous execution id for which resources stress testing should be terminated (need in case of rollback)
   * default: ''

## Details
  * Start a CPU hog on instance for X minutes
  * Verify alarm (a) is triggered

    Note: this may or may not be a relevant use-case for customers.
    high CPU load may be expected on some systems and may not be an issue on other EC2 instances.. depends on the type of work they are running.

    If it is expected, the customer either has a custom way to deal with it, or needs to be alerted to it. Either way he needs a low level monitor and to test this monitor.

## Outputs
The automation execution has no outputs

repository: esabitova/aws-digito-artifacts-gameday

repo_name: esabitova/aws-digito-artifacts-gameday


text:
---
title: gcloud mixin
description: Run a Google command with the gcloud CLI
---

<img src="/images/mixins/google.png" class="mixin-logo" />

Run a Google command using the [gcloud CLI](https://cloud.google.com/sdk/gcloud/reference/).

Source: https://github.com/getporter/gcloud-mixin

### Install or Upgrade
```
porter mixin install gcloud
```

## Mixin Syntax

See the [gcloud CLI Command Reference](https://cloud.google.com/sdk/gcloud/reference/) for the supported commands

```yaml
gcloud:
  description: "Description of the command"
  groups: GROUP
  command: COMMAND
  arguments:
  - arg1
  - arg2
  flags:
    FLAGNAME: FLAGVALUE
    REPEATED_FLAG:
    - FLAGVALUE1
    - FLAGVALUE2
  suppress-output: false
  outputs:
    - name: NAME
      jsonPath: JSONPATH
```

You can also specify a list of `groups`:

```yaml
gcloud:
  description: "Description of the command"
  groups:
  - GROUP 1
  - GROUP 2
  command: COMMAND
```

### Suppress Output

The `suppress-output` field controls whether output from the mixin should be
prevented from printing to the console. By default this value is false, using
Porter's default behavior of hiding known sensitive values. When
`suppress-output: true` all output from the mixin (stderr and stdout) are hidden.

Step outputs (below) are still collected when output is suppressed. This allows
you to prevent sensitive data from being exposed while still collecting it from
a command and using it in your bundle.

### Outputs

The mixin supports `jsonpath` outputs.

#### JSON Path

The `jsonPath` output treats stdout like a json document and applies the expression, saving the result to the output.

```yaml
outputs:
- name: NAME
  jsonPath: JSONPATH
```

For example, if the `jsonPath` expression was `$[*].id` and the command sent the following to stdout:

```json
[
  {
    "id": "1085517466897181794",
    "name": "my-vm"
  }
]
```

Then then output would have the following contents:

```json
["1085517466897181794"]
```

---

## Examples

The [Compute Example](https://github.com/getporter/gcloud-mixin/tree/master/examples/compute) provides a full working bundle demonstrating how to use this mixin.

### Authenticate

```yaml
gcloud:
  description: "Authenticate"
  groups:
    - auth
  command: activate-service-account
  flags:
    key-file: gcloud.json
```

### Provision a VM

```yaml
gcloud:
  description: "Create VM"
  groups:
    - compute
    - instances
  command: create
  arguments:
    - porter-test
  flags:
    project: porterci
    zone: us-central1-a
    machine-type: f1-micro
    image: debian-9-stretch-v20190729
    image-project: debian-cloud
    boot-disk-size: 10GB
    boot-disk-type: pd-standard
    boot-disk-device-name: porter-test
  outputs:
    - name: vms
      jsonPath: "$[*].id"
```

repository: getporter/porter

branch_name: refs/heads/main

gha_language: Go

repo_name: getporter/porter


text:
---
layout: index
title: while
---

    while (expression) { script }

Run a script while the given expression returns true.

This command was added in Quest 5.1.

repository: textadventures/quest

gha_language: C#

gha_license_id: MIT

repo_name: textadventures/quest


text:
Scott Davis Transcript

Open Source Data Science Masters

I'm going to have some time for indepedent study this year so I plan to work through as much as possible.  I work in the real estate industry and we have so much data that isn't used for meaningful analysis and the tools, though readily available, haven't caught up for the needs of real estate users.  That's what I'm interested in working on.  I use a lot of GIS and R, so my curriculum is tailored to follow [R](https://www.r-project.org/)/[Python](www.python.org) and [QGIS](www.qgis.org).  I'm a bit of an open-source nut so I like learning much better this way.  I'm looking for people to connect with, and possibly to work on projects.

Want to collaborate? Get in touch:
 * [linkedin](http://www.linkedin.com/in/scottcdavis);
 * [twitter](http://www.twitter.com/scottdavisCRE); or
 *<EMAIL_ADDRESS>

Open Source Curriculum

Base Introduction

Data Science Introductions
 - [ ] Intro to Data Science by UW / Coursera, online course
 - [ ] Data Science Specialization by Johns Hopkins / Coursera
 -  [X] [Data Scientists Toolbox](https://www.coursera.org/account/accomplishments/certificate/UY4EBM46HL)
 -  [X] [R Programming](https://www.coursera.org/account/accomplishments/records/Va5vuEvGKyr7UyHEL)
 -  [X] [Getting and Cleaning Data](https://www.coursera.org/account/accomplishments/records/ENSGmvNfx24sANRW)
 -  [X] [Exploratory Data Analysis](https://www.coursera.org/account/accomplishments/records/2PPsRu2Us3sUehBQ)
 -  [X] [Reproducible Research]
 -  [ ] [Statistical Inference] (in progress)
 -  [ ] [Regression Models] (in progress)
 -  [X] [Practical Machine Learning]
 -  [ ] [Developing Data Products]
 -  [ ] [Data Science Capstone]
- [ ] [Data Science by Harvard](http://cs109.github.io/2015/) (online course)
- [ ] [Data Science with Open Source Tools](http://shop.oreilly.com/product/9780596802363.do)
- [50 Years of Data Science](http://pages.cs.wisc.edu/~anhai/courses/784-fall15/50YearsDataScience.pdf)
- [ ] [Datasmart](http://www.amazon.com/Data-Smart-Science-Transform-Information/dp/111866146X/ref=sr_1_1?s=books&ie=UTF8&qid=1458768727&sr=1-1&keywords=datasmart) - in Excel, but also works in LibreOffice and so much of business analytics is still in Excel.

Mathematics/Statistics

 - [ ] [Statistics for Spatial Data, Revised Edition](http://www.wiley.com/WileyCDA/WileyTitle/productCd-1119114616.html)
 - [ ] [Statistics for Spatio-Temporal Data](http://www.wiley.com/WileyCDA/WileyTitle/productCd-EHEP002348.html)
 - [ ] [Linear Algebra](http://www.amazon.com/Linear-Algebra-Dover-Books-Mathematics/dp/048663518X)
 - [ ] Problem-Solving Heuristics: [How to Solve It](http://www.amazon.com/How-Solve-It-Mathematical-Princeton/dp/069111966X)

Computing

R:
 - [ ] [R in Action](https://www.manning.com/books/r-in-action-second-edition?a_bid=5c2b1e1d&a_aid=RiA2ed)
 - [ ] [R Cookbook](http://shop.oreilly.com/product/9780596809164.do)
 - [ ] [Forecasting: Principles and Practice](http://otexts.com/fpp/)

R Libraries/Task Views
 * [ProjectTemplate](http://projecttemplate.net/index.html)
 * Spatial Data [CRAN Task View: Analysis of Spatial Data](https://cran.r-project.org/web/views/Spatial.html)
 * Spatio-Temporal Data [CRAN Task View: Handling and Analyzing Spatio-Temporal Data](https://cran.r-project.org/web/views/SpatioTemporal.html)
 * Optimization [CRAN Task View: Optimization and Mathematical Programming](https://cran.r-project.org/web/views/Optimization.html)
 * Finance [CRAN Task View: Empirical Finance](https://cran.r-project.org/web/views/Finance.html)

Python:
 - [ ] [Dive Into Python](http://www.diveintopython.net/)
 - [ ] [Google's Python Class](code.google.com/edu/languages/google-python-class/)
 - [ ] [Python for Data Analysis](http://shop.oreilly.com/product/0636920023784.do)
 - [ ] [Webscraping with Python](https://www.packtpub.com/big-data-and-business-intelligence/web-scraping-python)

QGIS:
 - [X] [QGIS Tutorials and Tips](http://www.qgistutorials.com/en/)
 - [X] [Mastering QGIS](https://www.packtpub.com/application-development/mastering-qgis)
 - [ ] [Building Mapping Applications with QGIS](https://www.packtpub.com/application-development/building-mapping-applications-qgis)
 - [ ] [GIS Tutorial Workbook 1](https://esripress.esri.com/display/index.cfm?fuseaction=display&websiteID=232&moduleID=1) This is for ArcView, but you can work the examples in QGIS too
 - [ ] [GIS Tutorial Workbook 2: Spatial Analysis](https://esripress.esri.com/display/index.cfm?fuseaction=display&websiteID=230&moduleID=0) This is for ArcView, but you can work the examples in QGIS too
 - [ ] [QGIS Map Design](https://locatepress.com/qmd) I've just thumbed through this, but it's beautiful and belongs on any list of GIS books.

MySQL:
 - [ ] [Learn MySQL in One Video](https://www.youtube.com/watch?v=yPu6qV5byu4)
 - [ ] [MySQL Workbench Starter](code.google.com/edu/languages/google-python-class/)

Octave:
 - [ ] [GNU Octave Beginners Guide](https://www.packtpub.com/big-data-and-business-intelligence/gnu-octave-beginners-guide)
 -
PostGIS/PostGRESQL:
 - [ ] [PostGIS Essentials](https://www.packtpub.com/big-data-and-business-intelligence/postgis-essentials)
 - [ ] [PostGRESQL Tutorial](http://www.postgresqltutorial.com/)
 - [ ] [PostgreSQL: Up and Running: A Practical Introduction to the Advanced Open Source Database](http://shop.oreilly.com/product/0636920032144.do)

Algorithms

 - [ ] [Algorithms Design & Analysis](http://openclassroom.stanford.edu/MainFolder/CoursePage.php?course=IntroToAlgorithms) Stanford openclassroom

Distributed Computing Paradigms

 - [ ] Intro to Hadoop and MapReduce by Cloudera and Udacity
*Note: I might swap the above course with an EdX course on Apache Spark and distributed computing*

Data Mining

 - [ ] Mining Massive Data Sets, by Stanford and Coursera
 - [ ] [Clean Data](https://www.packtpub.com/big-data-and-business-intelligence/clean-data)

Machine Learning/Predictive Analytics - Foundational/Theoretical/Practical

 - [ ] Machine Learning, by Ng Stanford and Coursera (NB this class requires a lot of higher level math)
 - [ ]  [An Introduction to Statistical Learning with Applications in R](http://www.r-bloggers.com/in-depth-introduction-to-machine-learning-in-15-hours-of-expert-videos/) (by the authors of The Elements of Statistical Learning at Stanford.)
 -  [ ] [Machine Learning with R](https://www.packtpub.com/big-data-and-business-intelligence/machine-learning-r-second-edition)
 -  [ ] [Building a Recommendation System in R](https://www.packtpub.com/big-data-and-business-intelligence/building-recommendation-system-r)
 -  [ ] [Mastering Predictive Analytics in R](https://www.packtpub.com/application-development/mastering-predictive-analytics-r)
 -  [ ] [Bootstrapping Machine Learning](http://www.louisdorard.com/machine-learning-book/)
 -  [ ] [Applied Predictive Modeling](http://www.amazon.com/gp/product/1461468485?psc=1&redirect=true&ref_=oh_aui_detailpage_o08_s00)

Analysis

 - [ ] [Practical Data Science Cookbook](http://www.diveintopython.net/)
 - [ ] [R Data Analysis Cookbook](code.google.com/edu/languages/google-python-class/)

Spatial Analysis

 - [ ] [An Introduction to R for Spatial Analysis and Mapping](https://us.sagepub.com/en-us/nam/an-introduction-to-r-for-spatial-analysis-and-mapping/book241031)
 - [ ] [Applied Spatial Data Analysis with R](http://www.springer.com/us/book/9781461476177)

Land Use/Transport/Gravity Modeling

 - [ ] [Integrated Land Use and Transport Modelling: Decision Chains and Hierarchies](http://www.amazon.com/gp/product/0521022177?psc=1&redirect=true&ref_=oh_aui_detailpage_o03_s00)
 - [ ] [Gravity and Spatial Interaction Models (Scientific Geography Series)](http://www.amazon.com/gp/product/0803925441?psc=1&redirect=true&ref_=oh_aui_detailpage_o06_s00)
 - [ ] [TRANUS Model](http://www.tranus.com/tranus-english)
 - [ ] [Urban Sim](https://pypi.python.org/pypi/urbansim)
 - [ ] [Huff-tools Package in R](http://rstudio-pubs-static.s3.amazonaws.com/42357_1e6fcc5bcfec439096eb86a106ebf22e.html)
 -

Data Design/Data Viz

 - [ ] [Beautiful Evidence](http://www.edwardtufte.com/tufte/books_be)
 - [ ] [Semiology of Graphics](http://www.amazon.com/Semiology-Graphics-Diagrams-Networks-Maps/dp/1589482611)
 - [ ] [Visual Complexity Mapping Patterns of Information](hhttp://www.visualcomplexity.com/vc/book/)
 - [ ] [The Visual Display of Quantitative Information](http://www.edwardtufte.com/tufte/books_vdqi)
 - [ ] [Design for Information](http://isabelmeirelles.com/book-design-for-information/)
 - [ ] [Design Elements: A Graphical Style Manual](http://www.amazon.com/Design-Elements-Graphic-Style-Manual/dp/1592532616)
 - [ ] [Storytelling with Data](http://www.amazon.com/gp/product/1119002257?psc=1&redirect=true&ref_=oh_aui_detailpage_o09_s00)
 - [ ] [Mastering Python Data Visualization](https://www.packtpub.com/big-data-and-business-intelligence/mastering-python-data-visualization)
 - [ ] [The Grammar of Graphics](https://www.packtpub.com/big-data-and-business-intelligence/mastering-python-data-visualization)
 - [ ] [R Graphics Cookbook](http://shop.oreilly.com/product/9780596809164.do)

Relevant prior studies

 - [X] MS in Community and Regional Planning, UT-Austin
 - [X] BA in Liberal Arts, concentration in geography, UT-Austin

OpenSource Data Science Masters Capstone Project

I'm interesting in using data science approaches for better intelligence behind real estate decisions, specifically evaluating population growth, transactions and location decisions.  I'd also like to evaluate statistical learning technqiues to make better pricing decisions.  Finally, I'd like to develop a model to optimize real estate portfolios.

If you'd like to pair up for the capstone, [let me know](http://www.twitter.com/scottdavisCRE)

license: Unlicense

gha_license_id: Unlicense


text:
# Contextual logger injection for Autofac [![Build status](https://ci.appveyor.com/api/projects/status/8lhjil6fkjlouda8/branch/dev?svg=true)](https://ci.appveyor.com/project/NicholasBlumhardt/autofac-serilog-integration/branch/dev) [![NuGet Pre Release](https://img.shields.io/nuget/vpre/AutofacSerilogIntegration.svg)](https://nuget.org/packages/AutofacSerilogIntegration)

When using [Serilog](http://serilog.net), _contextual_ loggers attach the logging type's name to log events so they can later be found and filtered:

```csharp
var log = Log.ForContext<SomeClass>();
log.Information("This event is tagged with 'SomeClass'");
```

Applications that use IoC often accept dependencies as constructor parameters:

```csharp
public class SomeClass
{
  readonly ILogger _log;

  public SomeClass(ILogger log)
  {
    _log = log;
  }

  public void Show()
  {
    _log.Information("This is also an event from 'SomeClass'");
  }
}
```

This library configures [Autofac](http://autofac.org) to automatically configure the correct contextual logger for each class into which an `ILogger` is injected.

### Usage

First install from NuGet:

```powershell
Install-Package AutofacSerilogIntegration
```

Next, create the _root logger_:

```csharp
Log.Logger = new LoggerConfiguration()
    .WriteTo.Console()
    .CreateLogger();
```

Then when configuring the Autofac container, call `RegisterLogger()`:

```csharp
var builder = new ContainerBuilder();

builder.RegisterLogger();
```

If no logger is explicitly passed to this function, the default `Log.Logger` will be used.

repository: Driedas/autofac-serilog-integration

branch_name: refs/heads/dev

repo_name: Driedas/autofac-serilog-integration


text:
# Staking Transactions

## Delegating to a Validator

You can delegate tokens to a validator using the following command:

```bash
./hmy --node="https://api.s0.t.hmny.io" staking delegate \
    --delegator-addr [ONE ADDRESS] --validator-addr [ONE ADDRESS] \
    --amount [AMOUNT] --passphrase
```

The CLI will ask for the passphrase for the `delegator-addr` keystore file.

`--delegator-addr` is the ONE address of the delegator **\(string\)**

`--validator-addr` is the ONE address of the validator **\(string\)**

`--amount` is the number of ONE tokens to delegate to the validator **\(float\)**

{% hint style="info" %}
As a validator, if you want to increase your stake, you will have to delegate to yourself. For delegating to your own validator, `delegator-addr` and `validator-addr` will be the same.
{% endhint %}

## Undelegating from a Validator

You can un-delegate tokens from a validator using the following command:

```bash
./hmy --node="https://api.s0.t.hmny.io" staking undelegate \
    --delegator-addr [ONE ADDRESS] --validator-addr [ONE ADDRESS] \
    --amount [AMOUNT] --passphrase
```

The CLI will ask for the passphrase for the `delegator-addr` keystore file.

`--delegator-addr` is the ONE address of the delegator **\(string\)**

`--validator-addr` is the ONE address of the validator **\(string\)**

`--amount` is the number of ONE tokens to un-delegate **\(float\)**

{% hint style="info" %}
As a validator, for un-delegating from your own validator, `delegator-addr` and `validator-addr` will be the same.
{% endhint %}

## Collecting Rewards

You can collect your block rewards with the following command:

```bash
./hmy --node="https://api.s0.t.hmny.io" staking collect-rewards \
--delegator-addr [ONE ADDRESS] --passphrase
```

The CLI will prompt your for the passphrase of the delegation account.

`--delegator-addr` is the account to collect rewards for

{% hint style="warning" %}
You can only collect ALL of your block rewards at once, not partially.
{% endhint %}

repository: harmony-one/docs-home

repo_name: harmony-one/docs-home


text:
# LTS BOM Release

## Prerequisites

For the prerequisites, see [Libraries BOM release's Prerequisites section](
../cloud-oss-bom/RELEASING.md).

## Steps

All on your corp desktop:

### 1. Decide the release version.

The release is either a patch release for an existing major version or a new major
version release.
Determine the version you're going to release by the following steps:

If this is a patch release for a major version release, then

- Checkout "_N_.0.x-lts" branch where _N_ is a major version you're releasing (for example
  [`1.0.x-lts`](https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/1.0.x-lts)).
- Read the `<version>` element of [boms/cloud-lts-bom/pom.xml](./pom.xml) in the branch.
  For example if it has version "1.0.5-SNAPSHOT", then next release version is "1.0.5".

If this is a major version release, then

- Checkout the master branch
- Read the `<version>` element of [boms/cloud-lts-bom/pom.xml](./pom.xml).
  For example, if the `boms/cloud-lts-bom/pom.xml` of the master branch has "3.0.0-SNAPSHOT", then
  next release verson is "3.0.0".

You can also check the previously released versions in [Maven Central: com.google.cloud:gcp-lts-bom](
https://repo1.maven.org/maven2/com/google/cloud/gcp-lts-bom/).

### 2. Run gcert

Run gcert if you have not done so in the last twelve hours or so.

### 3. If this is a major version release, create an LTS release branch

(If this is a patch version release, the LTS release branch already exists.
No action required for this step.)

If this is a major version release, create an LTS release branch `N.0.x-lts`, where
N is the release number.

For example:

```
$ git checkout -b 2.0.x-lts origin/master
$ git push --set-upstream origin 2.0.x-lts
```

### 4. Run `release.sh` with `lts` argument

Checkout the **master** branch of this repository.

In the `cloud-opensource-java` directory, run `release.sh`:

```
$ ./scripts/release.sh lts <release version>
```

with the `lts` argument. For example: `./scripts/release.sh lts 1.0.5`

This script creates a pull request that bumps the patch version of
the LTS release branch (not the master branch).
Ask a teammate to review and approve the PR.

Behind the scenes, the release script creates a release branch based on the
corresponding LTS release branch.
For example, when you run the release script with argument `./scripts/release.sh lts 5.0.3`,
it creates a release branch `5.0.3-lts` based on the LTS release branch `5.0.x-lts`.

The script also initiates the Rapid release workflow, which usually finishes in 20
minutes.

### 5. Release the artifact via OSSRH staging repository

Once the Rapid workflow uploads the artifact to OSSRH staging repository, release the artifact
via its website.

[Instructions for releasing from OSSRH are on the internal team
site](https://g3doc.corp.google.com/company/teams/cloud-java/tools/developers/releasing.md#verify-and-release).

### 6. If this is a major version release, bump the major version in master branch

After you finish the release, if this is a major version release, bump the major version of the
BOM (`boms/cloud-lts-bom/pom.xml`) in the master branch.

### 7. Confirm the artifact in Maven Central

In 30 minutes, the new version appears in  [Maven Central: com.google.cloud:gcp-lts-bom](
https://repo1.maven.org/maven2/com/google/cloud/gcp-lts-bom/).

## Making changes for a patch release

Changes for a patch release should be committed to LTS release branches (not to the master branch).

We maintain multiple branches for the LTS BOM releases.
Let's call the branches _LTS release branches_.
An LTS release branch has a name "N.0.x-lts", where N is the major release version number,
such as `1.0.x-lts` and `2.0.x-lts`.
In this GitHub repository, the branches are [configured as protected](
https://github.com/GoogleCloudPlatform/cloud-opensource-java/settings/branches),
so that we do not accidentally push changes into them.

Any changes for a patch release to the LTS BOM should be merged to one of the LTS release branches.
This practice enables us to release a patch version of one of the old versions of the BOM,
without using the master branch (or _HEAD_).

## Deleting a release

In case you have to clean up the releases, such as when you need to retry the release upon a
failure, please refer to [Libraries BOM release's Deleting a release section](
../cloud-oss-bom/RELEASING.md).

repository: clairesg/cloud-opensource-java

repo_name: clairesg/cloud-opensource-java


text:
# FAQ

## Introduction

- We will sort out and collect the common questions of issues and user feedback in this document, and give relevant solutions, in order to provide reference for OCR researchers and improve work efficiency.

- There are many experts in OCR field. The answers in this document mainly rely on existing research projects. If there are any omissions or deficiencies, we hope relevant knowledgeable persons to help us to make supplement and revise them. Thank you.

## Summary of common problems in DavarOCR(Updating)

* [Installation  (2021.07.20)](Installation (2021.07.20))

## Installation (2021.07.20)

#### Q1.1: Davarocr installation error
<img src="./figures/warp_ctc_error.png" width = "140%" alt="visualization"/>

The reason for this error is that the existing Warp_CTC does not support the GPU computing architecture (compute_30/35) when compiling based on CUDA-11.x, so the description of the corresponding part needs to be commented out during the compilation process.

```
Solutions:
    DAVAROCR_PATH= the filepath of the DavarOCR
    cd $DAVAROCR_PATH/davarocr/davar_rcg/third_party/warp-ctc-pytorch_bindings
    open the "CMakeLists.txt"

Comment the line 35~38
Line 35: # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_30,code=sm_30 -O2")
Line 36: # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_35,code=sm_35")
Line 37:
Line 38: # set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -gencode arch=compute_50,code=sm_50")
```

repository: OCRWorld/DAVAR-Lab-OCR

repo_name: OCRWorld/DAVAR-Lab-OCR


text:
![sitemap](/week-2/imgs/site-map.png "This is my sitemap")

**1. What are the 6 Phases of Web Design?**

1) Information Gathering
2) Planning
3) Design
4) Development
5) Testing and Delivery
6) Maintenance

**2. What is you site's primary goal or purpose? What kind of content will your site feature?**

My site's primary purpose is to function as a basic introduction to me in the context of my experience at DBC. The site will house basic information about myself, my projects, a blog, and other personal interests.

**3. What is your target audience's interests and how do you see your site addressing them?**

My target audience's interest would be to learn about my DBC experience and check out what projects I've worked on. They can also learn a little more about my personal interests. My site will have all this information readily available.

**4. What is the primary "action" the user should take when coming to your site? Do you want them to search for information, contact you, or see your portfolio? It's ok to have several actions at once, or different actions for different kinds of visitors.**

The user should search for the subject that they're most interested in and delve into it.

**5. What are the main things someone should know about design and user experience?**

It's always important to keep user experience in mind while designing a webpage. Making interaction with your webpage the most positive experience possible will obviously improve all aspects of the webpages performance.

**6. What is user experience design and why is it valuable?**

"User experience is how a person feels when interfacing with a system." Obviously designing a system that creates the most positive user reaction possible will increase the success of the product.

**7. Which parts of the challenge did you find tedious?**

The article on UX felt pretty tedious. It's obviously an important concept but also seems pretty common sense that your site should provide a good experience.

gha_language: Ruby


text:
# Date Range Picker (jQuery Plugin)

![Main image](https://raw.githubusercontent.com/frankfajardo/bootstrap-daterangepicker/master/drp1.png)

This jQuery date range picker plugin is a *fork* of the [original Date Range Picker for Bootstrap] by [Dan Grossman]. This version however does not require Bootstrap. Only the demo page uses it for presentation of the options. This plugin, like the [original Date Range Picker for Bootstrap], uses [Moment.js] v.2.10.3, which is included in this repository.

## Variations

This version has a few variations:

- It allows the user to select either the *From* or *To* date first. When the user selects another date, it then decides which is the *From* date, and which is the *To* date.

- It hides the `Apply` and `Cancel` buttons until the user selects `Custom Range`. It makes the UI cleaner IMHO.

  These buttons appear to only be relevant to the custom range option, based on the behaviour of the [original Date Range Picker for Bootstrap], I have hidden them by default.

- It allows the user to delete entry in the bound input field. This is useful for input where you want to allow the user to not specify a date or date range.

  *Note:* If you are using the callback function, this will return ***null*** on both the `start` and `end` parameters. Also, the callback function now receives a 4th parameter, which is a boolean value indicating if the date range is cleared. So you can check this 4th parameter before using the `start` and `end` parameters:
  ```
  $('#config-demo').daterangepicker(
     options,
     function(start, end, label, cleared) {
        if (cleared)
           console.log('Date range is cleared.');
        else
           console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
     });
  ```

- You can allow your users to clear the date range field via the UI, in two ways:

   - You can add an entry to the date range custom ranges like this:

   ```
   options.ranges = {
      'Clear Date Range': [null, null],
      ...
   };
   ```
   ![First Option](https://github.com/frankfajardo/bootstrap-daterangepicker/blob/master/drp2.png)

   *Or*

   - You can show the new `Clear` button like this:

   ```
   options.showClearBtn = true;
   options.clearClass = 'btn-warning';
   ```
   ![Second Option](https://github.com/frankfajardo/bootstrap-daterangepicker/blob/master/drp3.png)

   The difference between the two is that the first option *auto-applies*, much like when you click a pre-defined date range. The second option can work with `autoApply` either being `true` or `false`.

   You can try either of these options using the demo page. To use the demo page, you need to download this repo.

## License

This code is made available under the same license as Bootstrap. Moment.js is included in this repository
for convenience. It is available under the [MIT license](http://www.opensource.org/licenses/mit-license.php).

Please also refer to the license for the [original Date Range Picker for Bootstrap].

[original Date Range Picker for Bootstrap]:(http://www.daterangepicker.com/)
[Dan Grossman]:(http://www.dangrossman.info/)
[Moment.js]:(http://momentjs.com)

repository: frankfajardo/bootstrap-daterangepicker

repo_name: frankfajardo/bootstrap-daterangepicker


text:
# Java Client for Hyphenate Services

The Java Client for Hyphenate Services is for use in server applications on a proxy server, aka, your developer server. Client library serves as a wrapper layer on top of raw REST APIs that allows you to deploy on your server and make APIs requests. [See Hyphenate APIs](http://docs.hyphenate.io/docs/server-overview).

## Support

This library is open source. We encourage you to contribute to make the code base better! If you encountered any bug or feature suggestion, please [submit an issue](https://github.io.hyphenateInc/hyphenate-server-client-java/issues) or email<EMAIL_ADDRESS>for urgent fixes.

## Requirement

- Hyphenate API key. [learn more](https://docs.hyphenate.io/docs/getting-started) or [create one](https://console.hyphenate.io).
- Java 1.7 or later. Latest version of the [Java](http://java.sun.com/javase/downloads/index.jsp).

## Installation

You can add the library via Gradle or Maven, which we recommended, or compile it from command line.

### Configuration

Update Hyphenate app configurations in `config.properties`.

```java
API_ORG = hyphenatedemo
API_APP = demo
APP_CLIENT_ID = YXA68E7DkM4uEeaPwTPbScypMA
APP_CLIENT_SECRET = YXA63_RZdbtXQB9QZsizSCgMC70_4Rs
```

## Dependencies

 - package io.hyphenate.server.jersey is using Jersey 2.15. Java 7 or later is required.
 - package io.hyphenate.server.httpclient is using Httpclient 4.3.3. Java 1.5 or later is required.

 - Install JUnit library (ex. junit:junit:4.12)

### Get all the dependencies

We recommend using [maven](http://maven.apache.org) or [gradle](http://gradle.org) to build server components.

### Generate keystore

[Keystore Generation with public site certificate](https://docs.hyphenate.io/docs/keystore-generation-with-public-cer)

## REST APIs Documentation

[Usage](https://api-docs.hyphenate.io)

### Rate Limiting

By default, requests are sent at the expected rate limits for each web service, typically 30 queries per second for free users.
Each IP address is limited to 30 requests per second. Requests beyond this limit will receive a 429 or 503 error. If you received this error, please reduce the request frequency and try again.
Please contact Hyphenate<EMAIL_ADDRESS>if you need higher request rate.

## Install Java IDE

You can use IntelliJ, Eclipse, NetBeans or any Java IDE you prefer to the run the project.

### Eclipse

#### Unix or Mac

    $ gradle eclipse

#### Windows

Run the following command, it'll generate necessary Eclipse files, then import via Eclipse

    > gradlew.bat eclipse

### Intellij IDEA

#### Unix or Mac

- "Import Project" -> select project root folder -> select "Import project from external model" -> select "Gradle" -> select "Use auto-import" and "Create separate module per source set" -> select "Use default gradle wrapper" -> Select "1.7" for Gradle JVM -> ".idea" for project format -> click "Finish"

- [Setup unit testing](https://docs.hyphenate.io/docs/keystore-generation-with-public-cer#section-note-here-s-the-setup-to-run-unit-testing-for-intellij-idea)

#### Windows

Run the following command and open the project from Intellij IDEA

    > gradlew.bat idea

## Build from Command line

#### Unix or Mac

Compile and package the project

```bash
$ ./gradlew jar
```

see all Gradle commands
```bash
$ ./gradlew tasks
```

#### Windows

	> gradlew.bat clean compile

#### Windows

If you're not using the tools listed above, you can manual manage the .jar package by running the following command.

    > gradlew.bat distZip

That will create a zip file, hyphenate-server-example.zip, under the folder _build/distributions_, which includes all the dependency


text:
### [CVE-2018-1322](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1322)
![](https://img.shields.io/static/v1?label=Product&message=Apache%20Syncope&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=Information%20disclosure&color=brighgreen)

### Description

An administrator with user search entitlements in Apache Syncope 1.2.x before 1.2.11, 2.0.x before 2.0.8, and unsupported releases 1.0.x and 1.1.x which may be also affected, can recover sensitive security values using the fiql and orderby parameters.

### POC

#### Reference
- https://www.exploit-db.com/exploits/45400/

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# Contributing Guidelines

- Work with either **Java/Kotlin** whichever language you are comfortable with
- Create issues first, start working only after getting it assigned
- Add a screenshot if appropriate (_say for the UI_), also mention the ```issue number```, while making the PR
- Once you complete your part, create a pull request
- ```Happy Contributing :) ```

<br>

## How to make a PR?

- Fork the repository
- Clone the repository to your local device
- ```Fetch Upstream -> Fetch and merge```
- Add the files you worked on / make changes you wanted to
- ```Contribute -> Open Pull Request```
- Fix any merge conflicts
- ```Create pull request```
- Add a title and a screenshot of the part you worked on (_if applicable_)
- ```Create pull request```


text:
---
title: 'Optimizing price, maximizing revenue'
date: 2019-04-19
#permalink: /posts/2013/08/blog-post-2/
tags:
  - econommics
  - retail
  - ecommerce
---

Setting a right price of products/services is one of the most important decisions a business can make. Under-pricing (and over-pricing) can hurt a company’s bottom line. Two determinants/indicators of business revenue are product prices and quantity sold. At higher price revenue is expected to be higher, if quantity sold is constant. However we know from our everyday experience that price and quantity are inversely related – as the price of something goes up, people show less intent to buy it.

The opposite is also true, that is, as price goes down, sales go up (that’s why we big “sale” events in shopping malls round the year). But that doesn’t mean that the revenue will always go up.

So an important question to ask is: if higher price means sales down and at lower price revenue goes down then where is the sweet spot, the right price, that maximizes revenue? With a simple example we'll examine how to optimization price to maximize revenue and profit.

### Import libraries

```python
from __future__ import print_function
import numpy as np
import pandas as pd
from pandas import DataFrame
import matplotlib.pyplot as plt
import seaborn as sns
import statsmodels.api as sm
from statsmodels.compat import lzip
from statsmodels.formula.api import ols
%matplotlib inline
```

### Data
Data in this analysis comes from [here](susanli2016/Machine-Learning-with-Python/master/beef.csv) [Susan Li has a nice [blog post](https://towardsdatascience.com/calculating-price-elasticity-of-demand-statistical-modeling-with-python-6adb2fa7824d) about price elasticity of demand (i.e. sensitivity of demand to change in price) explained using the same dataset]. This is a time series, quarterly dataset of beef sales (quantity) and corresponding price.

This dataset will be used first to find price elasticity of demand and then to find at what price the profit is maximized.

```python
# Load data
beef = pd.read_csv('https://raw.githubusercontent.com/susanli2016/Machine-Learning-with-Python/master/beef.csv')
```

```python
# View first few rows
beef.tail(5)
```

      Year
      Quarter
      Quantity
      Price

      86
      1998
      3
      17.5085
      277.3667

      87
      1998
      4
      16.6475
      279.5333

      88
      1999
      1
      16.6785
      278.0000

      89
      1999
      2
      17.7635
      284.7667

      90
      1999
      3
      17.6689
      289.2333

### Step 1: Define the profit function

We know,

        profit = revenue - cost (1)

We also know,

        revenue = qt_demanded * price (2)

Therefore,

        profit = qt_demanded * price - cost (3)

### Step 2: Define the demand function
Assuming that the cost is constant, we first need to estblish the relationship between qt_demanded and price:

        qt_demanded = f(price) (4)

This demand function can be estimated based on hitorical price and corresponding sales data.

```python
# demand curve estimation
sns.lmplot( x="Price", y="Quantity", data=beef, fit_reg=True, size=4)
```

    <seaborn.axisgrid.FacetGrid at 0x195b918df60>

![](/images/2019-04-19-price-optimization/output_8_1.png)

```python
# fit OLS model
model = ols("Quantity ~ Price", data=beef).fit()
# print model summary
print(model.summary())
```

                                OLS Regression Results
    ==============================================================================
    Dep. Variable:               Quantity   R-squared:                       0.901
    Model:                            OLS   Adj. R-squared:                  0.900
    Method:                 Least Squares   F-statistic:                     811.2
    Date:                Thu, 18 Apr 2019   Prob (F-statistic):           1.69e-46
    Time:                        15:51:26   Log-Likelihood:                -77.493
    No. Observations:                  91   AIC:                             159.0
    Df Residuals:                      89   BIC:                             164.0
    Df Model:                           1
    Covariance Type:            nonrobust
    ==============================================================================
                     coef    std err          t      P>|t|      [0.025      0.975]
    ------------------------------------------------------------------------------
    Intercept     30.0515      0.413     72.701      0.000      29.230      30.873
    Price         -0.0465      0.002    -28.482      0.000      -0.050      -0.043
    ==============================================================================
    Omnibus:                        3.453   Durbin-Watson:                   1.533
    Prob(Omnibus):                  0.178   Jarque-Bera (JB):                2.460
    Skew:                           0.237   Prob(JB):                        0.292
    Kurtosis:                       2.349   Cond. No.                     1.74e+03
    ==============================================================================

    Warnings:
    [1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
    [2] The condition number is large, 1.74e+03. This might indicate that there are
    strong multicollinearity or other numerical problems.

### Step 3: Parameterize the profit function in step 1
The demand function with parameter values coming from the above regression:

        qt_demanded=30.05-0.0465*price (5)
Therefore, the profit function in equation (3) becomes

        profit = (30.05-0.0465*price)*price - cost (6)

### Step 4: Finding the price that maximizes profit

```python
Price = [320, 330,340,350, 360, 370, 380, 390] # a range of diffferent prices to find the optimum one
Cost = 80 # a fixed cost in this case
Revenue = []
for i in Price:
    quantity_demanded=30.05-0.0465*i
    Revenue.append((i-cost)*quantity_demanded) # profit function

# create data frame of price and revenue
profit=pd.DataFrame({"Price": Price, "Revenue": Revenue})
#plot revenue against price
plt.plot(profit["Price"], profit["Revenue"])
```

    [<matplotlib.lines.Line2D at 0x195ba1cf9b0>]

![](/images/2019-04-19-price-optimization/output_12_1.png)

```python
# price at which the revenue is maximum
profit[profit['Revenue'] == profit['Revenue'].max()]

#profit.loc[profit['Revenue'].idxmax()]
```

      Price
      Revenue

      4
      360
      3726.8

So USD 360 is the price, from a lis tof  prices, at which the profit is maximized. We used a price interval of USD 10, this could  be any number that gives the right outcome.


text:
# DashedSlider

[![CI Status](http://img.shields.io/travis/ayalcinkaya/DashedSlider.svg?style=flat)](https://travis-ci.org/ayalcinkaya/DashedSlider)
[![Version](https://img.shields.io/cocoapods/v/DashedSlider.svg?style=flat)](http://cocoapods.org/pods/DashedSlider)
[![License](https://img.shields.io/cocoapods/l/DashedSlider.svg?style=flat)](http://cocoapods.org/pods/DashedSlider)
[![Platform](https://img.shields.io/cocoapods/p/DashedSlider.svg?style=flat)](http://cocoapods.org/pods/DashedSlider)

This library inspired by [JMMarkSlider](https://github.com/joamafer/JMMarkSlider)

![demo](images/ss.png)

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

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

```ruby
pod "DashedSlider"
```

## Author

ayalcinkaya
twitter [@ayalcinkaya_](https://twitter.com/ayalcinkaya_)

## License

DashedSlider is available under the MIT license. See the LICENSE file for more info.

repository: ulaserdegor/DashedSlider

gha_language: Shell

repo_name: ulaserdegor/DashedSlider


text:
# 76. Minimum Window Substring

> Hard

------

Given two strings `s` and `t` of lengths `m` and `n` respectively, return the minimum window substring of `s` such that every character in `t` (including duplicates) is included in the window. If there is no such substring, return the empty string.

The testcases will be generated such that the answer is unique.

A substring is a contiguous sequence of characters within the string.

**Example 1:**

```
Input: s = "ADOBECODEBANC", t = "ABC"
Output: "BANC"
Explanation: The minimum window substring "BANC" includes 'A', 'B', and 'C' from string t.
```

**Example 2:**

```
Input: s = "a", t = "a"
Output: "a"
Explanation: The entire string s is the minimum window.
```

**Example 3:**

```
Input: s = "a", t = "aa"
Output: ""
Explanation: Both 'a's from t must be included in the window.
Since the largest window of s only has one 'a', return empty string.
```

**Constraints:**

- `s` and `t` consist of uppercase and lowercase English letters.

path: /Hard/76. Minimum Window Substring/README.md


text:
# Dynamic CSS Grid
Dynamically split row and column with CSS Grid. [The demo is here.](https://schifzt.github.io/dynamic-css-grid/)

![screenshot](./asset/screenshot.gif)

## key-binding
+ `:v`      : split window vertically
+ `:h`      : split window horizontally
+ `:r`      : split window at random
+ `Ctrl`+`w`: move to the next window

## LICENSE
MIT

repository: schifzt/dynamic-css-grid

repo_name: schifzt/dynamic-css-grid


text:
---
title: Overview
page_title: Overview
description: Check our "Overview" documentation article for the RadPivotGrid {{ site.framework_name }} control.
slug: radpivotgrid-fieldlist
tags: radpivotfieldlist
published: True
position: 0
---

# RadPivotFieldList

![Rad Pivot Field List Getting Started 01](images/RadPivotFieldList_GettingStarted_01.png)

__RadPivotFieldList__ is an integral part of __RadPivotGrid__. It gives the users the power to modify __RadPivotGrid__ and generate many different reports with the current data.

__Key Features:__

* Automatically change __RadPivotGrid__ generated report when the "Defer Layout Update" is unchecked.

* Using CheckBoxes to mark the data you want to include in the __RadPivotGrid__.

* Using __RadContextMenu__ to apply modifications on __RadPivotGrid__ runtime:

	* Sorting ascending and descending

	* Apply Number Format from the predefined formats or create your own

	* Change currently used Aggregate function

	* Applying different filters - Label, Value, Top10 filter

	* Using different Calculations for GrandTotals

	* Using percent of GrandTotal instead showing the whole number.

## See Also

 * [Adding RadPivotFieldList to your project]({%slug radpivotgrid-fieldlist-started%})

 * [RadPivotGrid Getting Started]({%slug radpivotgrid-getting-started%})

 * [Populating with Data]({%slug radpivotgrid-populating-with-data%})

repository: Eldoir/xaml-docs

repo_name: Eldoir/xaml-docs


text:
# NSO-CheatSheet
NSO cheat sheet

## pre-Installation

Make sure your linux has : make, java-jdk 1.8 ,ant,xsltproc
On debian families operating systems (Ubuntu,kubuntu,xubuntu,…)  :

```
apt-get update | apt-get upgrade | apt-get install make ant openjdk-8-jdk xsltproc -y
```

### Environement variable

export ncsrc

```
echo "source /home/cisco/nso-4.4/ncsrc" >> .profile
$NCS_DIR //NSO's installation directory
```

## NSO CLI

### Add a device

Instanciate from another

```
devices device <dev1> instantiate-from-other-device device-name <dev2>
```

Add device from cli

```
#configure //Go to conf mode
	/*Add a device*/
	#device device <DEVICE_NAME> //Add a device
	#address <ip_addr> port <port_num> //Configure the port and addr
	#device-type <[cli-generic-netconf-snmp]> <[ned-id-protocol-..]> <package> <protocol> <[ssh-telnet]>
	#authgroup <group_name>
	#state admin-state <state>
	//Get out of conf mode
	devices fetch-ssh-host-keys device [ <device_names> ]
devices sync-from //Sync the devices as a source.(In the WebUI, this will change the oper state to "enabled"
```

### Groups

authentification groups

```
devices authgroups group <grp_name> default-map remote-name <username> remote-password <password>
```

Device groups

```
$set devices device-group <name> device-name [ <list_of_name> ] //add devices to a group
$set devices device-group <name> device-group [ <list_of_group_name> ]//Add group to a group
$show devices device-group//Show list of group
#show devices device-group member//Show list of group (not available in conf mode)

```

Customers

```
#show running-config customers// Show customers
$set customers customer (Name,id,rank,etc) //Set a new customer or modify one
```

### Templates

```
$set devices template <Template_Name> config <package:conf> <option> <...>
```

### Utilities

Divers

```
$switch cli //Change style between Cisco and Juniper CLI Style
$[request] packages reload //Reload the packages
$show packages //Show used packages.
revert OR abord //Trow away the changes in configuration mode.
```

Copy past long files

```
autowizard false
ignore-leading-space true
complete-on-space false
```

## Version

```
show status ncs-state version
```

## Devices actions

sync

```
devices check-sync//Check sync of devices
devices device ce0..3 check-sync //Check for multiple devices
devices device ce0 compare-config //Compare de configuration
```

live status

```
#devices device <name> lives-status exec <command >
OR
#devices device <name> lives-status <device_type>-stats:exec <command >
```

## Logs

```
file show logs/rollback<TAB> //Show rollbacks files
show devices device-module //Show devices compatible modules
```

## NCS

```
ncs [-c ncs.conf] [--with-package-reload] //Start ncs (ask for package reload must be done at every upgrade)
```

```
ncs --status //Gives the NCS server status
```

```
ncs-setup [--dest <destination>] //Create a running environnement
```

```
ncs-setup --reset //Reset the logs
```

### make packages

```
ncs-make-package <Option> <package-name>//Make a package
```

(Alway make the package (src/ make all)

## Netsim

```
ncs_load -l -m devices.xml //Load device (can be made using CLI)
```

```
ncs-netsim : //NCS network simulator
```

```
ncs-netsim create-network <package_dir> <number_devices> <Prefix>
ncs-netsim add-to-network <package_dir> <number_devices> <Prefix>
ncs-netsim add-device <package_dir> <Device_name>
```

```
ncs-netsim start //Start the device
ncs-netsim delete-network //Stop and delete
ncs-netsim -a start <device_name>//Start a device async
ncs-netsim list //gives the list of devices
ncs-netsim cli-i <DEVICE_NAME> //open a connection to the device
```

```
ncs-setup --netsim-dir <netsim_dir> --dest <ncs_running_directory> //Start ncs configuration using netsim devices.
```

```
% ncsc --ncs-compile-module yang/interfaces.yang --ncs-device-dir ncsc-out --ncs-device-type netconf// import device data models is the ncsc
```

### Load config

```
$ ncs-netsim ncs-xml-init > devices.xml
$ ncs_load -l -m devices.xml
```


text:
---
layout: post
title: Mutation Testing in Ruby
date: 2017-03-20T15:30:00.000Z
description: How to perform mutation testing in Ruby
eye_catch: /assets/mutation.jpeg
categories:
  - professional
tags:
  - code
  - mutant
  - mutation
  - rspec
  - ruby
  - testing
  - tests
---

The value of automated testing is predicated on trust. It begins innocently with a test suite that reports incorrectly. Maybe the test suite reports a lot of false positives, or maybe the test suite does catch enough failures. In either case, people stop running the tests. They stop maintaining the tests, and eventually the tests no longer function and are discarded.

For tests to remain relevant, this pervasive question runs throughout software testing: how can I trust that a unit test is actually exercising the code in question? This post talks about how mutation testing can provide a definitive answer.

<!--more-->

In my days as a developer, I relied on code inspection to answer this question. I would go through the red-green-refactor loop as I developed: writing a failing test, modifying my code, re-running the test, and ensuring it passes. I would visually inspect my code, looking for code paths that were not under test. And so on.

Despite my best efforts, sometimes we would discover bugs. A method would have an unindented side effect. Some framework method would have a surprising outcome in edge cases. Or, I would make a mistake in a complicated Boolean statement that only occurred seldomly. These failures by my unit tests to uncover bugs would shake my faith in their veracity.

{% include pullquote.html text="The value of automated testing is predicated on trust" %}

I don't write code for a living any more, but I still code. A program I use everyday is a set of Ruby scripts that help me log my management notes about my direct reports. These scripts provide a template to input data, then append it to a log file.

Last week, I discovered that Ruby has a mutation tester, and it helped me discover a bug in my code. Here's a portion of my `Team` class:

```ruby
class Team
  def initialize(**params)
      @team = params[:team].capitalize
  end

  def members_by_folder
      Dir.glob("#{EmployeeFolder.root}/#{team}/*")
  end
end
```

And I expected the following to hold true:

```ruby
@avengers = Team.new('Avengers')
# ... some additional setup
expect(@avengers.members_by_folder).to contain_exactly(
        'data/avengers/hank-mccoy',
        'data/avengers/hank-pym' # , ...
      )
```

This script has been functioning this way for months. My tests hard-coded the member folders to isolate the Team tests from the Employee tests, so they didn't uncover this issue either.

With just these few lines, it's not hard to see the issue. Instead of a lowercase folder name, what was actually happening was:

```ruby
@avengers = Team.new('Avengers')
# ... some additional setup
expect(@avengers.members_by_folder).to contain_exactly(
        'data/Avengers/hank-mccoy',
        'data/Avengers/hank-pym' # , ...
      )
```

I discovered this bug during my mutation testing. The idea behind mutation testing is that if source code changes are made, tests should fail. If a mutant method returns the same results as the original, there's a good chance that the behavior of the method isn't being testing as thoroughly as it should. To do this, I used Mutant, which is a Ruby library, which automates the mutation testing process. Mutant achieves this through source code manipulation.

Mutant is a Ruby gem, and can simply be installed with `gem install mutant-rspec`. I must say, it did take a number of attempts to hit upon the right combination of libraries. Here's an excerpt from my Gemfile:

```ruby
gem 'rspec', '~> 3.5', require: false, group: :test
gem 'simplecov', '~> 0.14', require: false, group: :test
gem 'mutant-rspec', '0.8.11', require: false, group: :test
```

`simplecov` provides code coverage metrics in conjunction with RSpec, but I believe it is optional and can be ignored if you are setting this up on your machine. Enough preamble, here's the result of running Mutant:

```bash
$ bundle exec mutant --use rspec -I lib/ -r team Team

# ... bunch of results ...

-----------------------
Mutant configuration:
Matcher:         #<Mutant::Matcher::Config match_expressions: [Team]>
Integration:     Mutant::Integration::Rspec
Jobs:            8
Includes:        ["lib/"]
Requires:        ["team"]
Subjects:        10
Mutations:       317
Results:         317
Kills:           295
Alive:           22
Runtime:         5.30s
Killtime:        26.00s
Overhead:        -79.62%
Mutations/s:     59.82
Coverage:        93.06%
```

In this case, Mutant made 317 modifications to my Team class source code. In each case, it ran my RSpec tests against that mutation, looking for situations where all the tests still pass.

Subjects refers to the number of methods being mutated. A mutation is 'killed' if the tests report a failure, and 'alive' if it does not. As you can see, in 22 cases, the changes Mutant made are not caught by my tests.

Mutant also looks at the number of source code lines that survived mutation, and reports that as the coverage percentage. In other words, my tests caught modifications to 93% of the source code lines.

Here's an example of a problem report:

```diff
evil:Team#eql?:/Users/i848350/git/github/neontapir/managertools-logging/lib/team.rb:59:e1a55
@@ -1,6 +1,6 @@
 def eql?(other)
   if other.respond_to?(:team)
-    team == other.team
+    team
   end
 end
```

It turns out that if you replace the equality comparison, my tests still pass! I looked at my test suite, and indeed, I wasn't testing the `eql?` operator at all.

In more complicated situations where it isn't obvious from code inspection what the issue is, manually make the code substitution that Mutant made and re-run the tests. When you do so, you'll see the error Mutant found, and then you can track it down using the normal troubleshooting process.

The issue became obvious when I tried to use my script with a multi-word team name:

```ruby
@justice_league = Team.new('Justice League')
```

That space uncovered a number of subtle bugs, which I squashed by changed spaces to dashes. Tests like this now pass:

```ruby
expect(@justice_league.members_by_folder).to contain_exactly(
        'data/justice-league/bruce-wayne',
        'data/justice-league/clark-kent'
      )
```

I also found cases where Mutant replaced my `to_s` implementation with something that gave the same result. In those cases, I simply tested that the two methods returned the same value. Here's an example from the current code base:

```ruby
def self.to_name(input)
  input = input.tr('-',' ') if input.include? '-'
  input.titlecase
end

def to_s
  Team.to_name(self.team)
end
```

Mutation testing can be a powerful technique for exposing assumptions in your code base and your unit tests. While I did not address every issue it reported, I found it to be educational and worthwhile!


text:
Create a custom hydrator
------------------------

customize hydratation mode :
supposed you want to store detailed address informations in your domain model

You should write your own Hydrator method for each used Providers. For example :

```php
namespace Acme\Bundle\AcmeBundle\Hydrator;

use Meup\Bundle\GeoLocationBundle\Hydrator\Hydrator as BaseHydrator;

class GoogleHydrator extends BaseHydrator
{
    public function populateAddress(AddressInterface $address, Array $data)
    {
        foreach ($data[0]['address_components'] as $element) {
            switch($element['types'][0]) {
                case 'street_number':
                    $address->setStreetNumber($element['long_name']);
                    break;
                case 'route':
                    $address->setRoute($element['long_name']);
                    break;
                case 'postal_code':
                    $address->setPostalCode($element['long_name']);
                    break;
                case: 'locality':
                    $address->setLocality($element['long_name']);
                    break;
            }
        }
        return $address;
    }
}
```

gha_language: PHP


text:
# C++ API
---

The Heavy C++ API is equivalent to the [C API](#12.c). Its usage is a matter of preference, but may make the organisation of systems with multiple context types and instances easier.

The pure virtual interface class to all Heavy contexts is called `HeavyContextInterface` and is defined in [HeavyContextInterface.hpp](https://github.com/enzienaudio/heavy/blob/master/src/HeavyContextInterface.hpp). The patch-specific header is `Heavy_example.hpp`.

## Heavy C++ API

```
/** Returns the read-only user-assigned name of this patch. */
const char *getName();

/** Returns the number of input channels with which this context has been configured. */
int getNumInputChannels();

/** Returns the number of output channels with which this context has been configured. */
int getNumOutputChannels();

/**
 * Returns the total size in bytes of the context.
 * This value may change if tables are resized.
 */
int getSize();

/** Returns the sample rate with which this context has been configured. */
double getSampleRate();

/** Returns the current patch time in samples. This value is always exact. */
unsigned int getCurrentSample();

/** Sets a user-definable value. This value is never manipulated by Heavy. */
void setUserData(void *x);

/** Returns the user-defined data. */
void *getUserData();

/**
 * Set the send hook. The function is called whenever a message is sent to any send object.
 * Messages returned by this function should NEVER be freed. If the message must persist, call
 * hv_msg_copy() first.
 */
void setSendHook(
    void (*f)(HeavyContextInterface *, const char *sendName, unsigned int sendHash, const HvMessage *));

/** Returns the send hook, or NULL if unset. */
void (*getSendHook())(HeavyContextInterface *, const char *, unsigned int, const HvMessage *);

/** Set the print hook. The function is called whenever a message is sent to a print object. */
void setPrintHook(
    void (*f)(HeavyContextInterface *, const char *printName, const char *str, const HvMessage *));

/** Returns the print hook, or NULL if unset. */
void (*getPrintHook())(HeavyContextInterface *, const char *, const char *, const HvMessage *);

/**
 * Processes one block of samples for a patch instance. The buffer format is an array of float channel arrays.
 * If the context has not input or output channels, the respective argument may be NULL.
 * The number of samples to to tbe processed should be a multiple of 1, 4, or 8, depending on if
 * no, SSE or NEON, or AVX optimisation is being used, respectively.
 * e.g. [[LLLL][RRRR]]
 *
 * @return  The number of samples processed.
 *
 * This function is NOT thread-safe. It is assumed that only the audio thread will execute this function.
 */
int process(float **inputBuffers, float **outputBuffer, int n);

/**
 * Processes one block of samples for a patch instance. The buffer format is an uninterleaved float array of channels.
 * If the context has not input or output channels, the respective argument may be NULL.
 * The number of samples to to tbe processed should be a multiple of 1, 4, or 8, depending on if
 * no, SSE or NEON, or AVX optimisation is being used, respectively.
 * e.g. [LLLLRRRR]
 *
 * @return  The number of samples processed.
 *
 * This function is NOT thread-safe. It is assumed that only the audio thread will execute this function.
 */
int processInline(float *inputBuffers, float *outputBuffer, int n);

/**
 * Processes one block of samples for a patch instance. The buffer format is an interleaved float array of channels.
 * If the context has not input or output channels, the respective argument may be NULL.
 * The number of samples to to tbe processed should be a multiple of 1, 4, or 8, depending on if
 * no, SSE or NEON, or AVX optimisation is being used, respectively.
 * e.g. [LRLRLRLR]
 *
 * @return  The number of samples processed.
 *
 * This function is NOT thread-safe. It is assumed that only the audio thread will execute this function.
 */
int processInlineInterleaved(float *inputBuffers, float *outputBuffer, int n);

/**
 * Processes one block of samples for a patch instance. The buffer format is an interleaved short array of channels.
 * If the context has not input or output channels, the respective argument may be NULL.
 * The number of samples to to tbe processed should be a multiple of 1, 4, or 8, depending on if
 * no, SSE or NEON, or AVX optimisation is being used, respectively.
 * e.g. [LRLRLRLR]
 *
 * @return  The number of samples processed.
 *
 * This function is NOT thread-safe. It is assumed that only the audio thread will execute this function.
 */
int processInlineInterleavedShort(short *inputBuffers, short *outputBuffer, int n);

/**
 * Sends a formatted message to a receiver that can be scheduled for the future.
 * The receiver is addressed with its hash, which can also be determined using hv_stringToHash().
 * This function is thread-safe.
 *
 * @return  True if the message was accepted. False if the message could not fit onto
 *          the message queue to be processed this block.
 */
bool sendMessageToReceiver(unsigned int receiverHash, double delayMs, HvMessage *m);

/**
 * Sends a formatted message to a receiver that can be scheduled for the future.
 * The receiver is addressed with its hash, which can also be determined using hv_stringToHash().
 * This function is thread-safe.
 *
 * @return  True if the message was accepted. False if the message could not fit onto
 *          the message queue to be processed this block.
 */
bool sendMessageToReceiverV(unsigned int receiverHash, double delayMs, const char *fmt, ...);

/**
 * A convenience function to send a float to a receiver to be processed immediately.
 * The receiver is addressed with its hash, which can also be determined using hv_stringToHash().
 * This function is thread-safe.
 *
 * @return  True if the message was accepted. False if the message could not fit onto
 *          the message queue to be processed this block.
 */
bool sendFloatToReceiver(unsigned int receiverHash, float f);

/**
 * A convenience function to send a bang to a receiver to be processed immediately.
 * The receiver is addressed with its hash, which can also be determined using hv_stringToHash().
 * This function is thread-safe.
 *
 * @return  True if the message was accepted. False if the message could not fit onto
 *          the message queue to be processed this block.
 */
bool sendBangToReceiver(unsigned int receiverHash);

/**
 * A convenience function to send a symbol to a receiver to be processed immediately.
 * The receiver is addressed with its hash, which can also be determined using hv_stringToHash().
 * This function is thread-safe.
 *
 * @return  True if the message was accepted. False if the message could not fit onto
 *          the message queue to be processed this block.
 */
bool sendSymbolToReceiver(unsigned int receiverHash, const char *symbol) ;

/**
 * Cancels a previously scheduled message.
 *
 * @param sendMessage  May be NULL.
 */
bool cancelMessage(
    HvMessage *m, void (*sendMessage)(HeavyContextInterface *, int, const HvMessage *)=nullptr);

/**
 * Returns information about each parameter such as name, hash, and range.
 *
 * If info is null then the total number of parameters is returned.
 * If info is not null, then the structure is filled in for the given parameter index.
 *
 * @param index  The parameter index.
 * @param info  A pointer to a HvParameterInfo struct. May be null.
 *
 * @return  The total number of parameters, if info is null. 0 otherwise.
 */
int getParameterInfo(int index, HvParameterInfo *info);

/** Returns a pointer to the raw buffer backing this table. DO NOT free it. */
float *getBufferForTable(unsigned int tableHash);

/** Returns the length of this table in samples. */
int getLengthForTable(unsigned int tableHash);

/**
 * Resizes the table to the given length.
 *
 * Existing contents are copied to the new table. Remaining space is cleared
 * if the table is longer than the original, truncated otherwise.
 *
 * @param tableHash  The table identifier.
 * @param newSampleLength  The new length of the table, in samples.
 *
 * @return  False if the table could not be found. True otherwise.
 */
bool setLengthForTable(unsigned int tableHash, unsigned int newSampleLength);

/**
 * Acquire the message lock.
 *
 * This function will block until the message lock as been acquired.
 * Typical applications will not require the use of this function.
 */
void lockAcquire();

/**
 * Try to acquire the message lock.
 *
 * If the lock has been acquired, lockRelease() must be called to release it.
 * Typical applications will not require the use of this function.
 *
 * @return Returns true if the lock has been acquired, false otherwise.
 */
bool lockTry();

/**
 * Release the message lock.
 *
 * Typical applications will not require the use of this function.
 */
void lockRelease();

/** Returns a 32-bit hash of any string. Returns 0 if string is NULL. */
static unsigned int getHashForString(const char *str);
```

license: ISC

repository: abhagsain/docs

repo_name: abhagsain/docs


text:
# `ts-node` with Babel.

Let's use `babel-node` for TypeScript as easy as `ts-node`.

NOTE: this is just a small wrapper for `babel-node` and only resolves verbose arguments passed to `babel-node`. See the core [`/ts-node.sh`](https://github.com/shqld/ts-node/blob/master/ts-node.sh).

### Install

```sh
npm i -D @shqld/ts-node
yarn add -D @shqld/ts-node
```

### Usage

```json
{
  "scripts": {
    "do-task": "ts-node tasks/some-task.ts"
  },
  "devDepedencies": {
    "@babel/core": "7.x",
    "@babel/preset-typescript": "7.x",
    "@shqld/ts-node": "1.x"
  }
}
```

```sh
npx do-task
yarn do-task
```

repository: shqld/ts-node

repo_name: shqld/ts-node


text:
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.0] - Unreleased

[0.10.0]: https://github.com/streem/pbandk/compare/v0.9.1...HEAD

### Added

* Support for protobuf [custom options](https://developers.google.com/protocol-buffers/docs/proto#customoptions) on fields. Remaining work is tracked in [#65]. (PR [#103])
    * Protobuf messages that declare an extension range now extend from `ExtendableMessage` rather than `Message`. `ExtendableMessage` defines a `getExtension(FieldDescriptor)` method that can be used to read an extension field (described by the provided `FieldDescriptor`) from a message.
    * Protobuf extension fields are defined as Kotlin extension properties on the extended class and can be accessed like any other Kotlin property.
* `MessageDescriptor` (available via `Message.descriptor` or `Message.Companion.descriptor`) is now part of the public API. Initially only `MessageDescriptor.fields` is public, which provides access to descriptors for all of the message's fields. Additional properties of the message descriptor will be exposed in future versions. Please file an issue on GitHub if there are specific properties you would like to have access to. (PR [#103])
* `FieldDescriptor` (available via `MessageDescriptor.fields`) is now part of the public API. Initially, the field's `name` and `options` are public, allowing access to custom options defined on the field in the `.proto` file. The field's `value` accessor is also public, though this API will probably change before the final 0.10.0 release. (PR [#103])
* Add the ability to unit test the output of `CodeGenerator` (PR [#117], fixes [#48]) (thanks @nbaztec)

### Changed

* Updated to Kotlin 1.4. Projects that are still on Kotlin 1.3 should be able to continue using pbandk, but this configuration is only supported on a best-effort basis (please file a GitHub issue with any problems). Projects are encouraged to update to Kotlin 1.4. (PR [#114], fixes [#86])
* **[BREAKING CHANGE]** The API and implementation of `UnknownField` changed significantly. If you access the contents of unknown fields in your code, you will need to update to the new API. The unknown field no longer provides access to a decoded version of the field's wire type. Instead it only provides access to the raw binary encoding of the field. (PR [#103])

### Fixed

* Added workaround for an error in the Kotlin/JS implementation of `protoMergeImpl()` caused by a Kotlin compiler bug (PR [#103])
* Improved the code generated for messages with a large number of fields to handle even more fields (PR [#103])
* Binary decoding of 64-bit numbers under Kotlin/JS with certain inputs that would previously cause a crash. (PR [#103])

[#48]: https://github.com/streem/pbandk/issues/48
[#65]: https://github.com/streem/pbandk/issues/65
[#86]: https://github.com/streem/pbandk/issues/86
[#103]: https://github.com/streem/pbandk/pull/103
[#114]: https://github.com/streem/pbandk/pull/114
[#117]: https://github.com/streem/pbandk/pull/117

## [0.9.1] - 2021-01-07

[0.9.1]: https://github.com/streem/pbandk/compare/v0.9.0...v0.9.1

### Fixed

* Compile error when proto contains a oneof field with same name as the enclosing message (PR [#104], fixes [#47]) (thanks @nbaztec)
* All remaining JSON conformance test failures for numeric values (PR [#105], partially fixes [#72]) (thanks @nbaztec)

[#47]: https://github.com/streem/pbandk/issues/47
[#72]: https://github.com/streem/pbandk/issues/72
[#104]: https://github.com/streem/pbandk/pull/104
[#105]: https://github.com/streem/pbandk/pull/105

## [0.9.0] - 2020-12-23

[0.9.0]: https://github.com/streem/pbandk/compare/v0.8.1...v0.9.0

### Added

* Support for Kotlin/Native (PR [#76], fixes [#19]) (thanks @sebleclerc)
* JSON encoding/decoding improvements:
    * Support for the `json_name` protobuf field option
    * Custom encoding/decoding for most of the protobuf well-known types: `Duration`, `Timestamp`, `Empty`,  `Struct`, `Value`, `NullValue`, `ListValue`, and all wrapper types
    * Added `JsonConfig` class for configuring JSON encoding/decoding at runtime. Currently supported options include `ignoreUnknownFieldsInInput`, `outputDefaultValues`, and `outputProtoFieldNames` (which match the options documented at https://developers.google.com/protocol-buffers/docs/proto3#json_options), and also `compactOutput`.
* New binary encoding and decoding overloads on Kotlin/JVM:
    * `Message.encodeToStream(java.io.OutputStream)`
    * `Message.Companion.decodeFromStream(java.io.InputStream)`
    * `Message.Companion.decodeFromByteBuffer(java.nio.ByteBuffer)`

### Changed

* **[BREAKING CHANGE]** Artifacts are now published to JCenter under new maven coordinates
    * Runtime library: `pro.streem.pbandk:pbandk-runtime-common:0.9.0`, `pro.streem.pbandk:pbandk-runtime-jvm:0.9.0`, `pro.streem.pbandk:pbandk-runtime-js:0.9.0`, `pro.streem.pbandk:pbandk-runtime-native:0.9.0`
    * Code generation plugin for the protobuf compiler: `pro.streem.pbandk:protoc-gen-kotlin-jvm:0.9.0:jvm8@jar`
    * `ServiceGenerator` library: `pro.streem.pbandk:protoc-gen-kotlin-lib-jvm:0.9.0`
* Projects that use `pbandk` can remove the `kotlinx-serialization` gradle plugin and library dependency if they don't use `kotlinx-serialization` themselves. The library is now an internal implementation detail of `pbandk`. (PR [#69], fixes [#61])
* Completely rewritten implementation of JSON encoding/decoding, fixing numerous bugs in the old version. The new implementation is much more compliant with the [official proto3 JSON spec](https://developers.google.com/protocol-buffers/docs/proto3#json). Remaining incompatibilities are tracked in [#72].
* **[BREAKING CHANGE]** Moved all of the binary and JSON encoding functionality, and most of the decoding functionality, from the generated code to the runtime library. Code generated by old versions of pbandk will not run with this new pbandk version.
* **[BREAKING CHANGE]** Changed `Message` so that it no longer extends from itself. Uses of `Message<T>` should be changed to just `Message`. (PR [#69])
* **[BREAKING CHANGE]** Added `@PbandkInternal` and `@PublicForGeneratedCode` annotations on portions of the public API that are only public for pbandk's internal use or for use from pbandk-generated code. Using these APIs outside of pbandk will generate compiler warnings and errors. If you have a need for using any of these APIs from your project, please file an issue on GitHub describing your use case.
* **[BREAKING CHANGE]** Code that calls any of pbandk's JSON encoding/decoding APIs must now opt-in to the `@ExperimentalProtoJson` annotation. See https://kotlinlang.org/docs/reference/opt-in-requirements.html#opting-in-to-using-api for detailed instructions. Once pbandk's JSON APIs are no longer considered experimental, this annotation will be removed.
* **[BREAKING CHANGE]** Update the public API to follow recent naming conventions from the Kotlin standard library: "marshal"/"unmarshal" is replaced with "encode"/"decode", encoding methods are named `encodeTo*`, and decoding methods are named `decodeFrom*`. (PRs [#69], [#90], fixes [#89])
    * The below methods have been renamed and are now defined as extension methods rather than being part of the `Message` or `Message.Companion` interface. Code that calls these methods will now need to import them first.
        * `Message.protoMarshal()` -> `Message.encodeToByteArray()`
        * `Message.Companion.protoUnmarshal(ByteArray)` -> `Message.Companion.decodeFromByteArray(ByteArray)`
        * `Message.jsonMarshal()` -> `Message.encodeToJsonString()`
        * `Message.Companion.jsonUnmarshal(String)` -> `Message.Companion.decodeFromJsonString(String)`
        * `Message.protoMarshal(pbandk.Marshaller)` -> `Message.encodeWith(pbandk.MessageEncoder)`
    * The below methods have been renamed. They will become extension methods in a future pbandk release.
        * `Message.Companion.protoUnmarshal(pbandk.Unmarshaller)` -> `Message.Companion.decodeWith(pbandk.MessageDecoder)`
    * The below methods have been renamed and are now defined as extension methods rather than being part of the `Message` or `Message.Companion` interface. Code that calls these methods will now need to import them first. The `Json` parameter from `kotlinx-serialization` has been replaced with the new `JsonConfig` type from `pbandk`.
        * `Message.jsonMarshal(kotlinx.serialization.json.Json)` -> `Message.encodeToJsonString(pbandk.json.JsonConfig)`
        * `Message.Companion.jsonUnmarshal(kotlinx.serialization.json.Json, String)` -> `Message.Companion.decodeFromJsonString(String, pbandk.json.JsonConfig)`
    * Replaced `Marshaller` and `Unmarshaller` interfaces with `MessageEncoder` and `MessageDecoder` interfaces, which are much simpler and function differently from the previous interfaces
* **[BREAKING CHANGE]** `MessageMap.entries` is now a `Set` instead of a `List`

### Removed

* **[BREAKING CHANGE]** Removed `Sizer` and `Util` from the public API
* **[BREAKING CHANGE]** Removed `UnknownField` constructors and the `UnknownField.size()` method from the public API

### Fixed

* Crash on Android when encoding `google.protobuf.Timestamp` fields to JSON (PR [#82], fixes [#46])
* `StackOverflowError` when generating code for really large `oneof` objects (PR [#52]) (thanks @tinder-aminghadersohi)
* Performance problems when compiling generated code with Kotlin 1.4 (PR [#101], fixes [#94])
* JSON decoding of unknown enum values (PR [#100])
* Map entry size computation for non-MessageMap maps (PR [#99])
* Some bugs with the handling of `packed` fields, binary encoding of enums in Kotlin/JS, and base64 encoding/decoding in Kotlin/JS (PR [#69], fixes [#23])
* Various conformance test failures (PRs [#80], [#82])

[#19]: https://github.com/streem/pbandk/issues/19
[#23]: https://github.com/streem/pbandk/issues/23
[#46]: https://github.com/streem/pbandk/issues/46
[#52]: https://github.com/streem/pbandk/pull/52
[#61]: https://github.com/streem/pbandk/issues/61
[#69]: https://github.com/streem/pbandk/pull/69
[#72]: https://github.com/streem/pbandk/issues/72
[#76]: https://github.com/streem/pbandk/pull/76
[#80]: https://github.com/streem/pbandk/pull/80
[#82]: https://github.com/streem/pbandk/pull/82
[#89]: https://github.com/streem/pbandk/issues/89
[#90]: https://github.com/streem/pbandk/pull/90
[#94]: https://github.com/streem/pbandk/issues/94
[#99]: https://github.com/streem/pbandk/pull/99
[#100]: https://github.com/streem/pbandk/pull/100
[#101]: https://github.com/streem/pbandk/pull/101

## [0.8.1] - 2020-05-22

[0.8.1]: https://github.com/streem/pbandk/compare/v0.8.0...v0.8.1

### Added

* Enable conformance tests for Kotlin/JS

### Changed

* **[BREAKING CHANGE]** Update to kotlin 1.3.72 and kotlinx.serialization 0.20.0. Projects that depend on `pbandk` must be using the same versions of kotlin and kotlinx.serialization. (fixes [#35])
* **[BREAKING CHANGE]** The `pbandk-runtime-common` maven package is now just called `pbandk-runtime`. The `protoc-gen-kotlin-jvm` maven package is now called `protoc-gen-kotlin-lib-jvm`. The `pbandk-runtime-jvm` and `pbandk-runtime-js` packages have not changed names.
* Use the new Kotlin multiplatform gradle plugin instead of the deprecated plugin (thanks @sebleclerc)
* Switch from Groovy to Kotlin for build.gradle files (thanks @sebleclerc)
* Update to gradle 6.2.2 (thanks @sebleclerc)
* Use the `maven-publish` gradle plugin instead of the `maven` plugin (thanks @sebleclerc)

### Fixed

* Name collision with nested types (fixes [#24]) (thanks @sebleclerc)
* Fix gradle configs for all examples and build them in CI so they don't break in the future (fixes [#37] and [#41])

[#24]: https://github.com/streem/pbandk/issues/24
[#35]: https://github.com/streem/pbandk/issues/35
[#37]: https://github.com/streem/pbandk/issues/37
[#41]: https://github.com/streem/pbandk/issues/41

repository: JeroenMols/pbandk

repo_name: JeroenMols/pbandk


text:
# hcotf-cli

CLI that syncs a Peloton Cycle stack with the "hardCORE On The Floor" google sheet

# How do I use it

- Download the latest program for either
  [Windows](https://github.com/caesarshift/hcotf-cli/releases/download/v0.2/windows.zip), [Linux](https://github.com/caesarshift/hcotf-cli/releases/download/v0.2/linux.zip), or [Mac OS](https://github.com/caesarshift/hcotf-cli/releases/download/v0.2/darwin.zip)
- Extract the hcotf-cli program from the zipped folder
- Run the program from the command line (see below if you've never done this before) using the following format:

`hcotf-cli -username YOURUSERNAME -password YOURPASSWORD`

Where `YOURUSERNAME` is your Peloton username or email address, and `YOURPASSWORD` is your Peloton
password.

# Windows - How to install/run a program from the "command line"

- If you've never used a command program before, install it on your Desktop, so you can easily find
  it.
- To open cmd.exe ("command line), open File Explorer and navigate to the Desktop
- Type "cmd" into the File Explorer navigator and hit enter
- A cmd.exe window opens with the Desktop as the current working directory

![](hcotf-cli-windows-install.gif)

# MacOS - How to run a program from the "command line"

- Open the app named "Terminal" which will open a command window
- Navigate to the folder that contains hcotfl-cli by using `cd` (e.g., `cd ~/Downloads/darwin`)

# Linux - How to run a program from the "command line"

- You installed your OS from the command line. You got this down already.

# Load a specific date

If you want to load an alternate date's classes, use the `date` parameter. Example:

`hcotf-cli -username YOURUSERNAME -password YOURPASSWORD -date 3/23/2021`

NOTE: the specified date must match the sheet date _exactly_. For example, `-date 3/23/2021` will
work. `-date 03/23/2021` will not (because the google sheet has the date listed as `3/23/2021`).

# What it does

The program will login to Peloton with the provided username and password.

Assuming successful authentication to Peloton, the program will then attempt to pull today's
schedule from the public "hardCORE On The Floor" google sheet. If it can find today's schedule, it
will then CLEAR your existing Peloton stack and load today's schedule into your Peloton stack.

# What it can't do

- Determine which class to take. If the "hardCORE On The Floor" google sheet has two classes that
are listed as OR, it will load both classes into your stack.

# Why did you make this?

My wife initially joined the hcotf facebook group, and I saw her having to daily locate the classes.
When I asked her if everyone was having to do this, she said "yes", and then showed me the long list
of people asking for a better way. This is my attempt at "a better way."

# Can this automatically load my classes every day?

Yes - if you're using a computer such as a desktop that you never put to sleep. You would use
Scheduled Tasks (Windows), launchd (Mac OS), or cron (Linux), and set the program to automatically
run every day. This is what I have done for my wife and I. Note that this typically won't work on a
laptop because, by default, a scheduled task won't wake a computer.

# Is there even an easier way than this?

Possibly. I could create a website which allows a user to sign up and have it automatically update
the stack. However, since Peloton's API is limited, I would need to store your Peloton
username/password. While a subset of users may be ok with that, I wanted to provide a solution that
allowed a user complete control without sharing your username/password. If there's enough interest
for a website, I may explore that solution as well.

repository: caesarshift/hcotf-cli

repo_name: caesarshift/hcotf-cli


text:
---
title: Components
desc: How to contribute to components
keys: Contributing
related:
  - /contributing/overview
  - /contributing/sponsor
---

## Design

You do not have to be a developer to contribute to a new QIconPicker component. You can also design one and either core developers will work on it or the community will get involved.
## Parts of a component contribution

Component contributions ideally include all of the following parts.

1. **A rationale**
Explain how your component will add value to the system. QIconPicker serves the widest possible range of products, and contributions that increase the scope of the system are more likely to be accepted. Be sure to include any user experience and interaction descriptions.

2. **A design spec**
Create sizing and styling annotations for all aspects of the component. This spec should provide a developer with everything they need to create the design in code.

3. **Code documentation**
We recommend reading through existing code documentation on this site for inspiration.

## First steps to contributing

To contribute a component to QIconPicker, start by opening a [GitHub Issue](https://github.com/quasarframework/quasar-ui-qiconpicker/issues). Include a detailed description in which you:

- Explain the rationale
- Detail the intended behavior
- Clarify whether it’s a variation of an existing component, or a new asset
- Include mockups of any fidelity (optional)
- Include any inspirations from other products (optional)

This issue will be the staging ground for the contribution and an opportunity for the community to weigh in with any suggestions. We encourage you to surface work in progress. Someone in the community may be working on the same component and interested in collaborating with you.

repository: quasarframework/quasar-ui-qiconpicker

gha_language: JavaScript

repo_name: quasarframework/quasar-ui-qiconpicker


text:
# relay.py

The relay class provides the network interface for any EDGE client.

#### Relay

    Relay(
        ip,
        verbose=False
    )

Creates a new Relay object using the specified `ip`. The `ip` should contain both the ip and the port (`ip:port`), default
port is 8080.  If `verbose` is true, the Relay will log information to `stdout`. The Relay class continuously accepts
images from the host and stores them in a buffer until the connection is closed.
#### get_image

    get_image(self)

If there is an image in the Relay buffer, retrieves it and removes it from the buffer. If there are not any images to be
retrieved, this call blocks until an image is received.

#### send_results

    get_infer_result(
        self,
        results
    )

Sends a set of inference results back to the host. The results should be in the format `[bbox, class, confidence]`,
where `bbox` is a list of four integers representing the bounding box, class is an integer, and confidence is a floating
point number.

#### close

    close(self)

Closes the connection.

## Usage of unit test (main())

The unit test accepts an IP (using argument `-ip`) and writes a received image to `out.jpg`.

repository: melhabr/distributed-inference

repo_name: melhabr/distributed-inference


text:
# About this guide

**Status:** Stub

This guide is for contributors and reviewers to Rust's standard library.

## Other places to find information

You might also find the following sites useful:

- [std API docs] -- rustdoc documentation for the standard library itself
- [Forge] -- contains documentation about rust infrastructure, team procedures, and more
- [libs-team] -- the home-base for the rust Library Team, with description
  of the team procedures, active working groups, and the team calendar.

[GitHub repository]: https://github.com/rust-lang/std-dev-guide/
[std API docs]: https://doc.rust-lang.org/nightly/std/
[Forge]: https://forge.rust-lang.org/
[libs-team]: https://github.com/rust-lang/libs-team/

repository: cxping/std-dev-guide

repo_name: cxping/std-dev-guide