text:
---
title: Config-Management-Plugin-Enhancement
authors:
  - "@kshamajain99" # Authors' github accounts here.
sponsors:
  - TBD        # List all intereste parties here.
reviewers:
  - TBD
approvers:
  - TBD

creation-date: 2021-03-29
last-updated: 2021-03-29
---

# Config Management Plugin Enhancement

We want to enhance config management plugin in order to improve Argo CD operator and end-user experience
for using additional tools such as cdk8s, Tanka, jkcfg, QBEC, Dhall, pulumi, etc.

## Summary

Currently, Argo CD provides first-class support for Helm, Kustomize and Jsonnet/YAML. The support includes:
- Bundled binaries (maintainers periodically upgrade binaries)
- An ability to override parameters using UI/CLI
- The applications are discovered in Git repository and auto-suggested during application creation in UI
- Performance optimizations. Argo CD "knows" when it is safe to generate manifests concurrently and takes advantage of it.

We want to enhance the configuration management plugin so that it can provide similar first-class support for additional
tools such as cdk8s, Tanka, jkcfg, QBEC, Dhall, pulumi, etc.

## Motivation

The config management plugin feature should be improved to provide the same level of user experience as
for the natively supported tools to the additional tools such as  cdk8s, Tanka, jkcfg, QBEC, Dhall, pulumi, etc.,
including Argo CD operators as well as end-user experience.

### Goals

The goals for config management plugin enhancement are,

#### Improve Installation Experience
The current Config Management plugin installation experience requires two changes:
- An entry in configManagementPlugins in the Argo CD configmap (i.e.  argocd-cm)
- Either an init container with a volume mount that adds a new binary into Argo CD repo server pod, or a rebuild of the argocd image, which contains the necessary tooling

The problem with this approach is that the process is error-prone, manual, and requires learning from each and every Argo CD administrator.

The goal is to make additional tools easily accessible for installation to Argo CD operators.

#### Provide Discovery (Auto-selection of Tool)
For Argo CD’s natively supported config management plugins (Helm, Kustomize, Jsonnet), Argo CD auto-detects
and selects the appropriate tool given only the path in the Git repository.
This selection is based on the recognition of well-known files in the directory (e.g. Chart.yaml, kustomization.yaml, etc...).

Currently, unlike natively supported tools, when a plugin is used, a user needs to explicitly specify the plugin
that should be used to render the manifests. As part of the improvements to config management plugins,

We want to provide the same ability to auto-select the plugin based on recognized files in the path of the git repository.

#### Parameters support in UI/CLI
Currently, configuration management plugins allow specifying only a list of environment variables via UI/CLI.

We want to extend its functionality to provide a similar experience as for existing natively supported tools
to additional config management tools.

### Non-Goals

* We aren't planning on changing the existing support for native plugins as of now.

## Proposal

We have drafted the solution to the problem statement as **running configuration management plugin tools as sidecar in the argocd-repo-server**.

All it means that Argo CD Config Management Plugin 2.0 will be,
- A user-supplied container image with all the necessary tooling installed in it.
- It will run as a sidecar in the repo server deployment and will have shared access to the git repositories.
- It will contain a CMP YAML specification file describing how to render manifests.
- Its entrypoint will be a lightweight CMP API server that receives requests by the main repo-server to render manifests,
based on the CMP specification file.

This mechanism will provide the following benefits over the existing solution,
- Plugin owners control their execution environment, packaging whatever dependent binaries required.
- An  Argo CD user who wants to use additional config management tools does not have to go through the hassle of building
a customized argocd-repo-server in order to install required dependencies.
- The plugin image will be running in a container separate from the main repo-server.

### Use cases

* UC1: As an Argo CD user, I would like to use first-class support provided for additional tools to generate and manage deployable kubernetes manifests
* UC2: As an Argo CD operator, I want to have smooth experience while installing additional tools such as  cdk8s, Tanka, jkcfg, QBEC, Dhall, pulumi, etc.
* UC3: As a plugin owner, I want to have some control over the execution environment as I want to package whatever dependent binaries required.

### Implementation Details

Config Management Plugin v2.0 implementation and experience will be as,

#### Installation

To install a plugin, an operator will simply patch argocd-repo-server to run config management plugin container as a sidecar,
with argocd-cmp-server as it’s entrypoint. Operator can use either off-the-shelf or custom built plugin image as sidecar image.

```bash
# A plugin is a container image which runs as a sidecar, with the execution environment
# necessary to render manifests. To install a plugin,
containers:
- name: cdk8s
  command: [/var/run/argocd/argocd-cmp-server]
  image: docker.ui/cdk8s/cdk8s:latest
  volumeMounts:
  - mountPath: /var/run/argocd
    name: var-files
```

The argocd-cmp-server binary will be populated inside the plugin container via an init container in the argocd-repo-server,
which will pre-populate a volume shared between plugins and the repo-server.

```bash
# An init container will copy the argocd static binary into the shared volume
# so that the CMP server can become the entrypoint
initContainers:
- command:
  - cp
  - -n
  - /usr/local/bin/argocd
  - /var/run/argocd/argocd-cmp-server
  image: quay.io/argoproj/argocd:latest
  name: copyutil
  volumeMounts:
  - mountPath: /var/run/argocd
    name: var-files

# var-files is a shared volume between repo-server and cmp-server which holds:
# 1) socket files that repo-server uses to communicate to each plugin
# 2) git repositories cloned by repo-server
volumes:
- emptyDir: {}
  name: var-files
```

#### Configuration

Plugins will be configured via a ConfigManagementPlugin manifest located inside the plugin container, placed at a
well-known location (e.g. /home/argocd/plugins/plugin.yaml). Argo CD is agnostic to the mechanism of how the plugin.yaml would be placed,
but various options can be used on how to place this file, including:
- Baking the file into the plugin image as part of docker build
- Volume mapping the file through a configmap.

Note that, while the ConfigManagementPlugin looks like a Kubernetes object, it is not actually a custom resource.
It only follows kubernetes-style spec conventions.

```bash
# metadata file is in the root and shell executor knows about it
apiVersion: argoproj.io/v1alpha1
kind: ConfigManagementPlugin
metadata:
  name: cdk8s
spec:
  version: v1.0
  init:
    command: [cdk8s, init]
  generate:
    command: [sh, -c, "cdk8s synth && cat dist/*.yaml"]
  discovery:
    find:
    - command: [find . -name main.ts]
      glob: "**/*/main.ts"
    check:
    - command: [-f ./main.ts]
      glob: "main.ts"
```

#### Config Management Plugin API Server (cmp-server)
The Config Management Plugin API Server (cmp-server) will be a new Argo CD component whose sole responsibility will be
to execute `generate` commands inside the plugin environment (the sidecar container), at the request of the repo-server.

The cmp-server will expose the following APIs to the repo-server,

- GenerateManifests(path) - returns YAML output using plugin tooling
- IsSupported(path) - returns whether or not the given path is supported by the plugin

At startup, cmp-server looks at the /home/argocd/cmp-server/plugin.yaml ConfigManagementPlugin specification file to understand how to perform the requests.

#### Registration & Communication
The repo-server needs to understand what all plugins are available to render manifests. To do this, the cmp-server
sidecars will register themselves as available plugins to the argocd-repo-server by populating named socket files in the
shared volume between repo-server and cmp-server. e.g.:

```bash
/home/argocd/plugins/
                        cdk8s.sock
                        jkcfg.sock
                        pulumi.sock
```

The name of the socket file will indicate the plugin name. To discover the available plugins, the repo-server will list
the shared plugins directory to discover the available plugins.

To communicate with a plugin, the repo-server will simply need to connect to the socket and make gRPC calls against the
cmp-server listening on the other side.

#### Discovery (Auto-selection of Tool)

- The plugin discovery will run in the main repo-server container.
- Argo CD repo-server lists the shared plugins directory and runs `discover` command from the specification file,
whichever plugin provides a positive response first will be selected.

#### Versioning
There will be one sidecar container per version. Hence, for two different versions users will have to configure two different sidecars.

### Security Considerations

The use of the plugin as sidecars separate from the repo-server is already a security improvement over the current v1.8
config management plugin mechanism, since the plugin tooling will no longer have access to the files of the argocd-repo-server image.
However additional improvements can be made to increase security.

### Risks and Mitigations

One issue is that currently when repositories are cloned, the repo is cloned using the same UID of the repo-server user,
and so all repository files are created using that UID. This means that a command which executes in the git repository path,
could traverse upwards and see/write files which are outside of the repository tree.

One proposal to prevent out-of-tree access to files, is that each git repository could be cloned with unique UIDs,
different from the repo-server’s UID. When the cmp-server executes the tooling command to generate manifests,
the command could be executed using the UID of the git repository files. e.g.:

```
cmd := exec.Command(command, args...)
cmd.SysProcAttr = &syscall.SysProcAttr{}
cmd.SysProcAttr.Credential = &syscall.Credential{Uid: uid, Gid: gid}
```

This would ensure that the command could not read or write anything out-of-tree from the repository directory.

### Upgrade / Downgrade Strategy

The argocd-repo-server manifest will change in order to populate the argocd-cmp-server binary inside the plugin container
via an init container.

```bash
# An init container will copy the argocd static binary into the shared volume
# so that the CMP server can become the entrypoint
initContainers:
- command:
  - cp
  - -n
  - /usr/local/bin/argocd
  - /var/run/argocd/argocd-cmp-server
  image: quay.io/argoproj/argocd:latest
  name: copyutil
  volumeMounts:
  - mountPath: /var/run/argocd
    name: var-files

# var-files is a shared volume between repo-server and cmp-server which holds:
# 1) socket files that repo-server uses to communicate to each plugin
# 2) git repositories cloned by repo-server
volumes:
- emptyDir: {}
  name: var-files
```

After upgrading to CMP v2, an Argo CD operator will have to make following changes,

* In order to install a plugin, an Argo CD operator will simply have to patch argocd-repo-server
to run config management plugin container as a sidecar, with argocd-cmp-server as it’s entrypoint:

```bash
# A plugin is a container image which runs as a sidecar, with the execution environment
# necessary to render manifests. To install a plugin,
containers:
- name: cdk8s
  command: [/var/run/argocd/argocd-cmp-server]
  image: docker.ui/cdk8s/cdk8s:latest
  volumeMounts:
  - mountPath: /var/run/argocd
    name: var-files
```

* Plugins will be configured via a ConfigManagementPlugin manifest located inside the plugin container, placed at a
well-known location (e.g. /plugin.yaml). Argo CD is agnostic to the mechanism of how the plugin.yaml would be placed,
but various options can be used on how to place this file, including:
    - Baking the file into the plugin image as part of docker build
    - Volume mapping the file through a configmap.
(For more details please refer to [implementation details](#configuration))

## Drawbacks

There aren't any major drawbacks to this proposal. Also, the advantages supersede the minor learning curve of the new way of managing plugins.

However following are few minor drawbacks,

* With addition of plugin.yaml, there will be more yamls to manage
* Operators need to be aware of the modified kubernetes manifests in the subsequent version.
* The format of the CMP manifest is a new "contract" that would need to adhere the usual Argo CD compatibility promises in future.

## Alternatives

1. ConfigManagementPlugin as CRD. Have a CR which the human operator creates:

```bash
apiVersion: argoproj.io/v1alpha1
kind: ConfigManagementPlugin
metadata:
  name: cdk8s
spec:
  name: cdk8s
  image: docker.ui/cdk8s/cdk8s:latest
  version: v1.0
  init:
    command: [cdk8s, init]
  generate:
    command: [sh, -c, "cdk8s synth && cat dist/*.yaml"]
  discovery:
    find:
    - command: [find . -name main.ts]
      glob: "**/*/main.ts"
    check:
    - command: [-f ./main.ts]
      glob: "main.ts"
```
2. Something magically patches the relevant manifest to add the sidecar.

repository: argoproj/argo-cd

gha_language: Go

repo_name: argoproj/argo-cd


text:
Babi
===

Usage: babi `<filename>`

Keys:

    CTRL-X: Quit (asks to save) (also CTRL-Q)
    CTRL-S: Save (also CTRL-O)
    CTRL-F: Find string in file (ESC to exit search, arrows to navigate) (also CTRL-W)
    CTRL-K: Cut line(s) to cutbuffer
    CTRL-U: Uncut
    CTRL-E: Erase line
    CTRL-L: Redraw screen

Babi does not depend on any library (not even curses). It uses fairly standard
VT100 (and similar terminals) escape sequences.

Babi was originally written as kilo by Salvatore Sanfilippo aka antirez and is released
under the BSD 2 clause license.

## This fork

This fork was heavily modified by Urja Rannikko. The name is because that's
what i often typo nano as, and it sounds kinda cute and small.

My point is to make babi into a very small nano-like editor, for small embedded
device usage (maybe get it embedded into busybox at some point?)

DONE:
- (atleast slightly) optimized drawing and memory operations
  (did i read it draws the whole screen always with a buffer that is realloc'd on every
   append to it...)
- line cutting and pasting (CTRL-K and U from nano)
- CTRL-W to find
- nano-compatible keybindings (CTRL-X to save and quit, CTRL-O to save)
- improved save routine (doesnt need heap)
- attempt to save on crashy exits (into <filename>.babi_save)
- improved out of memory handling
- shell script syntax highlighting (shell scripts are what you're mostly editing on BusyBox systems anyways)

TODO:
- BusyBoxy feature configuration:
  - syntax highlighting
    - C
    - shell
  - line cut and paste
  - search

repository: urjaman/babi

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: urjaman/babi


text:
# Cast Helper

Download: https://github.com/IsaacSchemm/casthelper.exe/releases

Cast Helper is a small portable Windows application that lets you cast video
from the Internet to a Roku or Apple TV on your local area network. It also
supports sending .mp3 and .m4a audio to Roku devices.

## How to use

1. Download casthelper.exe from the [releases page](https://github.com/IsaacSchemm/casthelper.exe/releases) and run it.

2. Cast Helper will search for available Apple TV and Roku devices on your
   network. Choose the device you want to cast to from the drop-down list. (If
   your Roku does not appear in the list, you can also enter its IP address
   manually from a menu in the toolbar.)

3. Paste the media URL into the URL text box.

4. Click the Play button.

## For developers

When the user clicks Play, Cast Helper will make an HTTP HEAD request to the
given URL to determine the type of the data.

HTTP errors will result in an error message. There are unique error messages
for HTTP 404 Not Found, HTTP 406 Not Acceptable, and HTTP 410 Gone. The user
will also get an error when the content type does not begin with `audio/` or
`video/` (and is not a recognized HLS content type, either).

The request headers sent by Cast Helper are:

    User-Agent: CastHelper/3.0 (https://github.com/IsaacSchemm/casthelper.exe)
	Accept: application/vnd.apple.mpegurl,video/*,audio/*

If you are developing a web application and you want your users to be able to
use Cast Helper, I would suggest looking at the Accept header and checking if
the client accepts the video type you're using, but not text/html.

license: MIT

branch_name: refs/heads/main

gha_language: C#

gha_license_id: NOASSERTION


text:
# ISARA Radiate™ Quantum-Safe Library 2.0 SIKE KEM Samples

## Introduction Key Encapsulation Mechanisms (KEM)

In general, all KEM schemes follow a similar pattern.

1.  The receiver generates a public and private key pair.
2.  The receiver publishes the public key but keeps the private key secret.
3.  A sender obtains the public key.
4.  That sender uses encapsulate to obtain a ciphertext and shared key.
5.  That sender sends the ciphertext to the receiver.
6.  The receiver obtains the ciphertext.
7.  The receiver uses decapsulate on the ciphertext to obtain the shared key.

The shared key can now be used for symmetric encryption. Note that the key has
already been passed through a Key Derivation Function (KDF) so it is not
necessary to do so again.

Generally speaking, public/private keys only need to be generated once and can
be re-used to create multiple shared secrets. The SIKE cryptosystem follows
this pattern.

## Getting Started

We have created 3 small sample applications that demonstrate how to use the
toolkit's SIKE KEM implementation:

* `sike_generate_keys` takes care of step 1.
* `sike_encapsulate` takes care of step 4.
* `sike_decapsulate` takes care of step 7.

As per SIKE NIST submission.

**NOTE**
Before building the samples, copy one of the CPU-specific versions of the
toolkit libraries into a `lib` directory. For example, to build the samples
for Intel Core 2 or better CPUs, copy the contents of `lib_core2` into `lib`.

The samples use the `IQR_TOOLKIT_ROOT` CMake or environment variable to
determine the location of the toolkit to build against. CMake requires that
environment variables are set on the same line as the CMake command, or are
exported environment variables in order to be read properly. If
`IQR_TOOLKIT_ROOT` is a relative path, it must be relative to the directory
where you're running the `cmake` command.

Assuming you've got the Toolkit installed in `/path/to/toolkit`, build the
sample application in a `build` directory:

```
$ mkdir build
$ cd build
$ cmake -DIQR_TOOLKIT_ROOT=/path/to/toolkit/ ..
$ make
```

Execute the samples with no arguments to use the default parameters, or use
`--help` to list the available options.

## Further Reading

* See `iqr_sike.h` in the toolkit's `include` directory.

## License

See the `LICENSE` file for details:

> Copyright © 2016-2019, ISARA Corporation
>
> Licensed under the Apache License, Version 2.0 (the "License");
> you may not use this file except in compliance with the License.
> You may obtain a copy of the License at
>
> http://www.apache.org/licenses/LICENSE-2.0
>
> Unless required by applicable law or agreed to in writing, software
> distributed under the License is distributed on an "AS IS" BASIS,
> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> See the License for the specific language governing permissions and
> limitations under the License.

### Trademarks

ISARA Radiate™ is a trademark of ISARA Corporation.


text:
# HRTB.US

A server side render (SSR) rewrite of the HRTB.us app in [Trails.js](https://github.com/trailsjs/trails). The original repo and app can be found [https://github.com/Code4HR/hrt-bus-finder](https://github.com/Code4HR/hrt-bus-finder) and [https://hrtb.us](https://hrtb.us) respectively.

### Setup

Tested on `node v6.9.1` with `npm 3.10.9`

```
npm install
npm start
# http://localhost:3000
```

gha_language: JavaScript

gha_license_id: MIT


text:
# Lagom 1.2 Migration Guide

This guide explains how to migrate from a Lagom 1.1 application to Lagom 1.2.

## Build changes

### Maven

If you're using a `lagom.version` property in the `properties` section of your root `pom.xml`, then simply update that to `1.2.0`. Otherwise, you'll need to go through every place that a Lagom dependency, including plugins, is used, and set the version there.

If you were using Lagom persistence, the Cassandra support has been split out into its own module. You'll need to update your dependencies to point to `lagom-javadsl-persistence-cassandra`, instead of `lagom-javadsl-persistence`.

### sbt

The version of Lagom can be updated by editing the `project/plugins.sbt` file, and updating the version of the Lagom sbt plugin. For example:

```scala
addSbtPlugin("com.lightbend.lagom" % "lagom-sbt-plugin" % "1.2.0")
```

If you were using Lagom persistence, the Cassandra support has been split out into its own module. You'll need to update your dependencies to point to `lagomJavadslPersistenceCassandra`, instead of `lagomJavadslPersistence`.

## Migrate read-sides to the new API

Lagom now provides a new API for writing read-sides. The features this API provides includes:

* Automatic offset handling - it is no longer necessary to manually manage your offset table yourself.
* Sharded read-sides

The old `CassandraReadSideProcessor` API is still available, but is deprecated. There is no immediate need to switch to the new API when you migrate to Lagom 1.2, however, it is advisable to make the switch as the old API may be removed in a future version of Lagom.

Before migrating, we recommend that you read the documentation. You should read both [[Persistent Read-Side|ReadSide]], as well as [[Cassandra Read-Side support|ReadSideCassandra]].  Once you have done that, the following tasks need to be done to the processor class itself:

* Modify your read side processor to implement [`ReadSideProcessor`](api/index.html?com/lightbend/lagom/javadsl/persistence/ReadSideProcessor.html) instead of `CassandraReadSideProcessor`.
* Ensure your read side processor has both [`CassandraReadSide`](api/index.html?com/lightbend/lagom/javadsl/persistence/cassandra/CassandraReadSide.html) and [`CassandraSession`](api/index.html?com/lightbend/lagom/javadsl/persistence/cassandra/CassandraSession.html) injected into its constructor.
* Replace the `aggregateTag` method with the new `aggregateTags` method, and instead of returning your single tag, wrap it in a singleton list using `TreePVector.singleton()`.
* Implement the `buildHandler` method by invoking the `CassandraReadSide.builder` method, passing an ID for this read-side.
* Remove all code that handles offsets.
* Split the `prepare` method into parts that should be done once globally across all nodes (such as creating tables), and parts that should be done once per processor (such as preparing statements), and pass these to the `setGlobalPrepare` and `setPrepare` callbacks on the read side builder in `buildHandler`.
* Replace the defineEventHandlers method with defining event handlers in the `buildHandler` method.

When you register the read-side, instead of invoking `CassandraReadSide.register`, you should invoke `ReadSide.register`. This will typically mean having [`ReadSide`](api/index.html?com/lightbend/lagom/javadsl/persistence/ReadSide.html) instead of [`CassandraReadSide`](api/index.html?com/lightbend/lagom/javadsl/persistence/cassandra/CassandraReadSide.html) injected into the component that registers the read-side processor.

Finally, you'll need to bootstrap the new Cassandra offset table with the old offset before you deploy, otherwise your read-side processor will re-process all the events for the entire history when you deploy your upgraded service. To do this, create the table:

```sql
CREATE TABLE IF NOT EXISTS offsetStore (
    eventProcessorId text,
    tag text,
    timeUuidOffset timeuuid,
    sequenceOffset bigint,
    PRIMARY KEY (eventProcessorId, tag)
)
```

Then, run the following statement to update it:

```sql
INSERT INTO offsetStore (eventProcessorId, tag, timeUuidOffset, sequencOffset)
VALUES ('<your-event-processor-id>', '<your-tag>', '<uuid>', null)
```

Where `<your-event-processor-id>` is the ID that you passed to `CassandraReadSide.builder()` in your read side processor, `<your-tag>` is the name of your aggregate tag (by default, if not explicitly specified, this is the fully qualify class name of your event interface), and `<uuid>` is the UUID in your manual offset store.

If the updates on your read-side are idempotent, then this task can be done at any time before deployment - reprocessing a few events shouldn't be a problem. Otherwise, you will need to ensure that you do this while your service is not running, to prevent any events from being reprocessed. An alternative to this would be to drop your read-side tables before upgrading, and so start processing events from the start.

## Testkit changes

The testkit has been modified such that Cassandra and clustering are disabled by default, whereas previously they were enabled by default. This is to accommodate for the fact that Lagom now has multiple persistence backends, not just Cassandra.

If you have tests that depend on Cassandra, you will need to update them to enable Cassandra, using:

```java
defaultSetup().withCassandra(true)
```

repository: lagom/lagom

gha_language: Scala

repo_name: lagom/lagom


text:
# trail

![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/skit-ai/trail?style=flat-square)
![Binary release](https://github.com/skit-ai/trail/actions/workflows/release.yml/badge.svg)

CLI to run your [dataframes][dataframes] against different services (currently, [SLU service][slu-service]).

See documentation [here](https://skit-ai.github.io/trail).

[slu-service]: https://github.com/skit-ai/slu-service/
[dataframes]: https://github.com/skit-ai/dataframes

repository: skit-ai/trail

repo_name: skit-ai/trail


text:
# Lorie Pocket
LoriePocket helps you keep count of the calories ingest daily.

Lorie Pocket is a sample project implementing below technologies:
 - Spring Boot
 - Spring Security
 - Spring JWT
 - Spring HATEOAS
 - React
 - Webpack
 - Docker

## Projects

Project is build using docker in order to provide an environment for each architecture component. Back end(service/portal) is an API developed using Spring Boot 1.5.7 and Spring Security. Front end(service/cdn) is a series of react components served by nginx server.

## Installation

In order to run the project you need to [install docker](https://docs.docker.com/engine/installation/), then download the repository and generate the components for back and front end.

### Components generation

#### Front End Service
You have to generate the distribution file for front end by running below commands:

```
cd service/cdn
npm install
gulp build
webpack
```
These commands will generate a dist folder with needed javascript, stylesheets and templates to render front end.

#### API
You have to generate the API war file for front end by running below commands:

```
cd service/portal
mvn clean install -DskipTests
```
This command will generate the jar tomcat need to serve backend.

### Docker container
You have to create all container images needed to bring up environment
```
docker-compose build
```
then you can bring up your environment with below command:
```
docker-compose up
```

## MIT License

Copyright (c) 2017 Cristian Colorado

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: ccoloradoc/loriepocket

gha_language: Java

repo_name: ccoloradoc/loriepocket


text:
# colorschemer

A fork of the [@colorschemez Twitter bot](https://twitter.com/colorschemez) as a webpage. Generate all the colors you want!

To build this:

- clone this repo and `cd` inside
- run `build.rb`
- open `src/index.html`

repository: EvanHahn/colorschemer

repo_name: EvanHahn/colorschemer


text:
---
sidebar_label: Module
---

# Creating the Wordle Module

For the Wordle module, we can add dependencies offered by Cosmos-SDK.

From the Cosmos-SDK docs, a [module](https://docs.ignite.com/guide/nameservice#cosmos-sdk-modules)
is defined as the following:

> In a Cosmos SDK blockchain, application-specific logic
  is implemented in separate modules. Modules keep code easy
  to understand and reuse. Each module contains its own message
  and transaction processor, while the Cosmos SDK is responsible
  for routing each message to its respective module.

Many modules exist for slashing, validating, auth.

## Scaffolding A Module

We will be using the `bank` module dependency for transactions.

From the Cosmos-SDK docs, the [`bank`](https://docs.cosmos.network/main/modules/bank/)
module is defined as the following:

> The bank module is responsible for handling multi-asset coin
  transfers between accounts and tracking special-case pseudo-transfers
  which must work differently with particular kinds of accounts
  (notably delegating/undelegating for vesting accounts). It exposes
  several interfaces with varying capabilities for secure interaction
  with other modules which must alter user balances.

We build the module with the `bank` dependency with the following command:

```sh
ignite scaffold module wordle --dep bank
```

This will scaffold the Wordle module to our Wordle Chain project.

repository: pynchmeister/docs

repo_name: pynchmeister/docs


text:
# Motion Detector Plug-in Sample for RICOH THETA

This sample plug-in detects moving objects using OpenCV library from the preview frame of RICOH THETA and shoots pictures.

## Set up
* Download this project using git close.
```
$ git clone https://github.com/theta-skunkworks/theta-plugin-opencv-detection-sample
```
* Import this project by Android Studio.
* Build the plug-in and install to the THETA.
* Set up app permissions manually after the installation using by [Vysor](https://www.vysor.io/).

Enable the permission of "Camera" and "Storage".

![Permissions](./images/permissions.jpg)

## Development Environment
### Camera
* RICOH THETA V Firmware ver.3.00.1
* RICOH THETA Z1 Firmware ver.1.03.5

### SDK/Library
* [RICOH THETA Plug-in SDK (ver.2.0.0)](https://github.com/ricohapi/theta-plugin-sdk)
* [OpenCV Android pack (ver.3.4.5)](https://opencv.org/releases.html)

### Development Software
* Android Studio ver.3.3+
* gradle ver.5.1.1

## For RICOH THETA Z1
In case of using RICOH THETA Z1, you need to modify some code.

At the line 16-17 in `Constants.java`, you should modify the defines of still picture size to `6720x3360`.

```java:Constants.java
// still picture size
public static final int STILL_SIZE_WIDTH = 6720;
public static final int STILL_SIZE_HEIGHT = 3360;
```

## How to Use Plug-in
### How to start
* Set THETA on a stable position; ex) use tripod
* Press and hold "Mode" button several seconds until turn the LED white.

### During running
* THETA detects moving objects and shoots pictures.

### How to end
* Press and hold "Mode" button several seconds until turn the LED blue.
* "MotionDetector" directory is created at DCIM, and you can see taken pictures and detection window images in this directory.

## License
```
Copyright 2018 Ricoh Company, Ltd.

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

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

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


text:
## mqtt-plotter
* `streamlit run streamlit-mqtt-plotter.py`
* Discussion on forums -> https://discuss.streamlit.io/t/live-plot-from-a-thread/247

## mqtt-camera-streamer
* https://github.com/robmarkcole/mqtt-camera-streamer
* Demos displaying a camera feed

repository: robmarkcole/Useful-python

gha_language: Jupyter Notebook

repo_name: robmarkcole/Useful-python


text:
---
layout: default
---

# 1996-03-06 - Re: NYT login

## Header Data

From: Just Rich<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 5910d2984abe86819666fc2eb9e046552137c1acbc8804aa2a600e171b67ae38

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-03-06 05:38:43 UTC

Raw Date: Wed, 6 Mar 1996 13:38:43 +0800

## Raw message

```
{% raw  %}From: Just Rich<EMAIL_ADDRESS>Date: Wed, 6 Mar 1996 13:38:43 +0800
To<EMAIL_ADDRESS>Subject: Re: NYT login
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

On Sun, 3 Mar 1996<EMAIL_ADDRESS>wrote:

> >The tobacco companies need a forum. And they are used to spending big
> >bucks on sponsoring things.
>
> That misses the point. There is no shortage of potential sponsors.
> What these people are asking me is "how much business will Web
> advertising create for me".

This misses another point. The question was, how do *we* pay for this
stuff (emphasis mine).

If someone develops a reasonably easy-to-use and reasonably secure digital
cash micropayment system, then I would be happy to pay to read the New
York Times on the Web. I would rather they were dependent on my money than
R.J. Reynold's.

-rich

{% endraw %}
```

## Thread

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

+ Return to "[Alan Horowitz <alanh@infi.net>](/authors/alan_horowitz_alanh_at_infi_net_)"
+ Return to "[hallam@w3.org](/authors/hallam_at_w3_org)"
+ Return to "[Just Rich <rich@c2.org>](/authors/just_rich_rich_at_c2_org_)"
+ Return to "["Phillip M. Hallam-Baker" <hallam@w3.org>](/authors/phillip_m_hallambaker_hallam_at_w3_org_)"

+ 1996-03-03 (Mon, 4 Mar 1996 06:08:08 +0800) - [Re: NYT login](/archive/1996/03/1cc4ace7d76b45dc6665a54b667243ac118dbad7a78f578b22a404ca5e68798b) - _"Phillip M. Hallam-Baker"<EMAIL_ADDRESS>  + 1996-03-04 (Mon, 4 Mar 1996 10:25:43 +0800) - [Re: NYT login](/archive/1996/03/2d4dabc3371e97e8f7362581b0769ad61d684c0d2786533645f79de70e30c5e0) - _Alan Horowitz<EMAIL_ADDRESS>    + 1996-03-05 (Tue, 5 Mar 1996 16:43:24 +0800) - [Re: NYT login](/archive/1996/03/2484b0437e91fec62d7f925a21146a0d7e2cd1fb4a1cff686212371a0e924bb8) -<EMAIL_ADDRESS>      + 1996-03-06 (Wed, 6 Mar 1996 13:38:43 +0800) - Re: NYT login - _Just Rich<EMAIL_ADDRESS>


text:
# Design

## Learning objectives

- Know what a variable is.
- Know how to define a variable.
- Know how to update a variable.
- Know that variable type is dynamic.
- Know how to define a multi-line function.
- Know how to return a value from a function (implicit return).
- Know how to call a function.
- Know that functions must be defined in classes.
- Know about the `def` access modifier.
- Know how to define an integer.
- Know how to define a string.
- Know how to use mathematical operators on integers.
- Know how to define single-line comments.

## Out of scope

- Naming rules for identifiers.
- Generic values.
- Memory and performance characteristics.
- Function overloads.
- Anonymous functions.
- Default arguments.
- Organizing functions in namespaces.
- `@moduledoc` and `@doc` multi-line comments

## Concepts

- `basics`: know what a variable is; know how to define a variable; know how to update a variable; know how to use type inference for variables; know how to define a function; know how to return a value from a function; know how to call a function; know that functions must be defined in modules; know how to define an integer; know how to define a string; know how to use mathematical operators on integers; know how to define single-line comments.

## Prerequisites

There are no prerequisites.

## Analyzer

This exercise could benefit from the following rules added to the [analyzer][analyzer]:

- Verify that the `remaining_minutes_in_oven/1` function calls the `expected_minutes_in_oven/0` function.
- Verify that the `total_time_in_minutes/2` function calls the `preparation_time_in_minutes/1` function.

[analyzer]: https://github.com/exercism/elixir-analyzer

repository: exercism/elixir

gha_language: Elixir

repo_name: exercism/elixir


text:
## DC/OS Spinnaker service 0.2.0-1.4.2

- Spinnaker Framework now comes with the default configuration which uses:
	- Minio as the default backend store.
	- DC/OS that spinnaker runs in as delivery target.
- Port definitions and VIPs are added.
- Ports get auto-assigned.
- All services except Redis, Echo and Igor can now be scaled
- All services now deploy in parallel.
- Spinnaker config yml can now be edited from the DC/OS console.

repository: portworx/dcos-examples

gha_language: Shell

repo_name: portworx/dcos-examples


text:
# Graylog Output Plugin

This plugin writes to a Graylog instance using the "[GELF][]" format.

[GELF]: https://docs.graylog.org/en/3.1/pages/gelf.html#gelf-payload-specification

### Configuration:

```toml
[[outputs.graylog]]
  ## UDP endpoint for your graylog instances.
  servers = ["<IP_ADDRESS>:12201"]

  ## The field to use as the GELF short_message, if unset the static string
  ## "telegraf" will be used.
  ##   example: short_message_field = "message"
  # short_message_field = ""
```

repository: garciaolais/telegraf

repo_name: garciaolais/telegraf


text:
---
published: false
title: i02
layout: post
author: Yu
categories: v53
hidden: true
---

| Item | Detail | Link |
|---:|---|---|
| Authors | Edith Gabriel, Barry S. Rowlingson, Peter J. Diggle| |
| Title |stpp: An R Package for Plotting, Simulating and Analyzing Spatio-Temporal Point Patterns | [download](http://www.jstatsoft.org/v53/i02/paper) |
| Reference |Vol. 53, Issue 2, Apr 2013 | |
| | Submitted 2012-04-29, Accepted 2012-11-30| |
| Type | Article| |
| Abstract | stpp is an R package for analyzing, simulating and displaying space-time point patterns. It covers many of the models encountered in applications of point process methods to the study of spatio-temporal phenomena. The package also includes estimators of the space-time inhomogeneous K-function and pair correlation function. stpp is the first dedicated unified computational environment in the area of spatio-temporal point processes. In this paper we describe space-time point processes and introduce the package stpp to new users.| |
| Paper | stpp: An R Package for Plotting, Simulating and Analyzing Spatio-Temporal Point Patterns  (application/pdf, 878.5 KB)| [download](http://www.jstatsoft.org/v53/i02/paper) |
| Supplements | | |
| |stpp_1.0-3.tar.gz: R source package  (application/x-gzip, 730.1 KB)|  [download](http://www.jstatsoft.org/v53/i02/supp/1) |
| |v53i02.R:R example code from the paper  (application/octet-stream, 8.4 KB)|  [download](http://www.jstatsoft.org/v53/i02/supp/2) |
| Resources | [BibTeX](http://www.jstatsoft.org/v53/i02/bibtex) [OAI](http://www.jstatsoft.org/oai?verb=GetRecord&identifier=oai.jstatsoft/v53/i02&prefix=oai_dc)| |
| |  | [返回卷目录]({{site.baseurl}}/volume/v53.html) |

repository: yulijia/jstatsoft

repo_name: yulijia/jstatsoft


text:
WAITT maven plugin
==================
The Web Application Integration Test Tool.
This plugin starts tomcat and measures test coverages automatically.

## Usage

Add plugin to your pom.xml.

```xml
<plugin>
    <groupId>net.unit8.maven.plugins</groupId>
    <artifactId>waitt-maven-plugin</artifactId>
    <version>0.2.0</version>
    <configuration>
        <path>/action/welcome.do</path>
    </configuration>
</plugin>
```

And execute following command to start tomcat.

```shell
% mvn waitt:run
```

Then web browser will be started automatically.


text:
# smesh
ad hoc self-contained mesh network simulator

### Usage
Use `smesh-conf.yml` to configure the properties of your mesh network. You can specify different types of nodes each one with his signal range and other properties. E.g.:

```yml
define:
  common_node:
    range: 50,
    speed: 2

  backhaul_node:
    range: 100,
    speed: 5
````

You can make your own topology by declaring all nodes with his connections. E.g.:

```yml
define:
  - common_node:
      range: 50,
      speed: 2

  - backhaul_node:
      range: 100,
      speed: 5

topology:
  node1:
    type: common_node
    connections:
      - node2, node4, node7

    node2:
    type: common_node
    connections:
      - node1,

     ...
````

Or you can let `smesh` generate a random topology for you. E.g.:

```yml
define:
  - common_node:
      range: 50,
      speed: 2

  - backhaul_node:
      range: 100,
      speed: 5

random_topology:
  nodes: 25,
  types:
    - common_nodes
```

After configuring your network, you can run `smesh`. There are commands to send package from one node to another, list nodes, show topology, make various nodes send messages to another nodes.

repository: rodrigocam/smesh

repo_name: rodrigocam/smesh


text:
# ngTable ES5 Demo App

## Overview

* Loads `ng-table` on to the page using a global script tag
* Application code written in ECMAScript 5

## Running sample App

1. cd demo-apps/es5
2. `npm install`
3. `npm run setup:local`
    * runs the ng-table build to create the library distibutable code (including `ng-table.js`)
    * in this app's node_modules, creates a symlink reference to the library distibutable code
4. `npm start`
    * runs http-server to serve this app's index.html

repository: SumTotalSystems/ng-table

branch_name: refs/heads/sumt-master

gha_language: TypeScript

repo_name: SumTotalSystems/ng-table


text:
# Yubico Mobile iOS SDK (YubiKit)

**YubiKit** is an iOS library provided by Yubico to interact with YubiKeys on iOS devices.

The library is provided with a [demo application](./YubiKitDemo/README.md) which shows complete examples of how the library can be integrated and demonstrates all the features of this library in an iOS project.

Changes to this library are documented in this [Changelog](Changelog.md).

## **About**

**YubiKit** requires a physical key to test its features. Before running the included [demo application](./YubiKitDemo/README.md) or integrating YubiKit into your own app, you need an NFC-Enabled YubiKey or a YubiKey 5Ci to test functionality.

The host application can build the library as a dependency of the application target when used inside a Xcode workspace. In addition, the  library can be packed using the `build.sh` script, which is provided in the root folder of this project.

## **Transitioning to version 4 of the SDK**

Read the [transitioning document](./docs/transitioning-sdk-4.md) if you already have integrated the previous version of the SDK.

## **Getting Started**

To get started, you can try the [demo](./YubiKitDemo/README.md) as part of this library or start integrating the library into your own application.

## Try the Demo
The library is provided with a demo application, [**YubiKitDemo**](./YubiKitDemo). The application is implemented in Swift and it shows several examples of how to use YubiKit, including WebAuthn/FIDO2 over the accessory or NFC YubiKeys.

The YubiKit Demo application shows how the library is linked with a project so it can be used for a side-by-side comparison when adding the library to your own project.

## Integrate the library

YubiKit SDK is available as a library and can be added to any new or existing iOS Xcode project through SPM, Cocoapods, or manual setup.

**[SPM Setup]**

The YubiKit SDK for iOS is availble Swift Package Manger (SPM). SPM is a dependency manager built into recent versions of Xcode. Go [here](https://swift.org/package-manager/) to learn more.

1. Open Xcode and click "File" -> "Swift Packages" -> "Add Package Dependency..."

2. Paste the following URL: https://github.com/Yubico/yubikit-ios

3. Click "Next" -> "Next" -> "Finish"

4. If your target project is written in Swift, you need to provide a bridge to the YubiKit library by adding ``#import <YubiKit.h>`` to your bridging header. If a bridging header does not exist within your project, you can add one by following this [documentation](https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html).

**[Cocoapods Setup]**

The YubiKit SDK for iOS is available through CocoaPods. CocoaPods is a centralized dependency manager for Objective-C and Swift. Go [here](https://guides.cocoapods.org/using/index.html) to learn more.

Add YubiKit to your [Podfile](https://guides.cocoapods.org/using/the-podfile.html).

```ruby
use_frameworks!

pod 'YubiKit', '~> 4.4.0'

```
If you want to have latest changes, replace the last line with:

```ruby

pod 'YubiKit', :git => 'https://github.com/Yubico/yubikit-ios.git'

```

Once YubiKit is added to your `Podfile`, run `pod install` and open the `*.xcworkspace` with Xcode.

Then import the YubiKit module and you can use its classes and methods.
```
import YubiKit
```

Continue SDK setup by skipping over `Manual Setup` to `Enable Custom Lightning Protocol`.

Manual Setup

Download or Clone YubiKit SDK source
1.  [Download](https://github.com/Yubico/yubikit-ios/releases/) the latest YubiKit SDK (.zip) to your desktop `or`

    `git clone https://github.com/Yubico/yubikit-ios.git`

**Add YubiKit folder to your Xcode project**

2. Drag the entire `/YubiKit[version]/YubiKit` folder to your Xcode project. Check the option *Copy items if needed*.
Or add exisiting Yubikit project to your workspace

**Linked Frameworks and Libraries**

3. `Project Settings` > `General` > `Linked Frameworks and Libraries`.
Click + and add the ``libYubiKit.a``

**Header Search Paths**

4. ``Build Settings`` > Filter by 'Header Search Path'. Set both Debug & Release to ``./YubiKit/**`` (recursive)

**-ObjC flag**

5. Add -ObjC flag
``Build Settings`` > Filter by 'Other Linker Flags'. Add the ``-ObjC`` flag to Debug and Release.

**Bridging-Header**

6. If your target project is written in Swift, you need to provide a bridge to the YubiKit library by adding ``#import <YubiKit/YubiKit.h>`` to your bridging header. If a bridging header does not exist within your project, you can add one by following this [documentation](https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html).

---

**Enable Custom Lightning Protocol**

`REQUIRED` if you are supporting the YubiKey 5Ci over the Lightning connector.

> The YubiKey 5Ci is an Apple MFi external accessory and communicates over iAP2. You are telling your app that all communication with the 5Ci as a supported external accessory is via `com.yubico.ylp`.

Open info.plist and add `com.yubico.ylp` as a new item under `Supported external accessory protocols`

**Enable TKSmartCard support**

To support YubiKeys connected via the USB-C port on a device running iOS 16 or higher, you need to add the `com.apple.security.smartcard` entitlement to your application. Note that this connection only support the Smart card based applications on the YubiKey and does not support U2F, FIDO2 or OTP.

**Grant accesss to NFC**

To add support for NFC YubiKeys in your application, follow these steps:

- Add a `NEW` entitlement for reading NFC specific tags, available since iOS 13. This new entitlement is added automatically by Xcode when enabling the **Near Field Communication Tag Reading** capability in the target **Signing & Capabilities**. After enabling the capability the *.entitlements* file needs to contain the `com.apple.developer.nfc.readersession.formats` entitlement:

```xml
...
<dict>
    <key>com.apple.developer.nfc.readersession.formats</key>
    <array>
        <string>TAG</string>  // Application specific tag, including ISO 7816 Tags
    </array>
</dict>
...
```

- The application needs to define the list of `application IDs` or `AIDs` it can connect to, in the *Info.plist* file. The `AID` is a way of uniquely identifying an application on a ISO 7816 tag, which is usually defined by a standard. FIDO2 and U2F use the AID `A0000006472F0001` on most FIDO compliant NFC keys, including the YubiKey. After adding the list of supported AIDs, the *Info.plist* entry should look like this:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
    <string>A000000527471117</string> // YubiKey Management Application AID
    <string>A0000006472F0001</string> // FIDO/U2F AID
    <string>A0000005272101</string>   // OATH AID
    <string>A000000308</string>       // PIV AID
    <string>A000000527200101</string> // YubiKey application/OTP AID (for HMAC SHA1 challenge-response)
</array>
</plist>
```

- The *Info.plist* also needs to include a privacy description for NFC usage, using the **NFCReaderUsageDescription** key:

```xml
<key>NFCReaderUsageDescription</key>
<string>The application needs access to NFC reading to communicate with your YubiKey.</string>
```

**Grant accesss to CAMERA**

Optional: if you are planning to use the camera to read QR codes for OTP
Open info.plist and add the following usage:
'Privacy - Camera Usage Description' - "This application needs access to Camera for reading QR codes."

## Documentation
YubiKit headers are documented and the documentation is available either by reading the header file or by using the QuickHelp from Xcode (Option + Click symbol). Use this documentation for a more detailed explanation of all the methods, properties, and parameters from the API. If you are interested in implementation details for a specific category like U2F, FIDO2, or OATH, check out the [./docs](./docs/) section.

## Using the Library

YubiKit is exposing a simple and easy to use API for executing operations on the YubiKey. The API is divided into `Connections` and `Sessions`. The supported connections are `YKFAccessoryConnection`, `YKFSmartCardConnection` and `YKFNFCConnection`. Each session is started by calling `YubiKitManager.shared.startAccessoryConnection()`, `YubikitManager.shared.startSmartCardConnection()` or `YubiKitManager.shared.startNFCConnection()`. Once a YubiKey connects the SDK delivers the new connection via the `YKFManagerDelegate` protocol. Disconnects are also signaled through the protocol. For an easier and a more Swift-like experience you can implement something similar to this example: [YKFManagerDelegate wrapper](./docs/easy-handling-connections.md).

From a connection you can retrieve any of the sessions currently supported in the SDK. The connections are fetched by calling a method with a callback block. Once the session has been established and the corresponding application on the YubiKey has been selected the callback will return the new session. For e.g a FIDO2 session it would look like this:

##### Swift

```swift
connection.fido2Session { session, error in
    guard let session = session else { /* handle error and return */ }
    session.verifyPin(pin) { error in
        ...
    }
}
```

##### Objective-C

```objective-c
#import <YubiKit/YubiKit.h>

[self.connection fido2Session:^(YKFFIDO2Session * _Nullable session, NSError * _Nullable error) {
    if (error) { /* handle error and return */ }
    [session verifyPin:pin completion:^(NSError * _Nullable error) {
        ...
    }];
}];
```

Before initiating the accessory connection, the application should verify that the device running the app supports connecting to the YubiKey over the Lightning port. This can be done by looking at the `supportsMFIAccessoryKey` property on `YubiKitDeviceCapabilities`.

The same goes for the NFC connection and similar to the accessory connection the  `YubiKitDeviceCapabilities` has a property `supportsISO7816NFCTags` that indicates wether the device supports connecting to the YubiKey over NFC.

##### Swift

```swift
if YubiKitDeviceCapabilities.supportsISO7816NFCTags {
    // Provide additional setup when NFC is available
    // example
    YubiKitManager.shared.startNFCConnection()
} else {
    // Handle the missing NFC support
}
```

##### Objective-C

```objective-c
#import <YubiKit/YubiKit.h>
...
// NFC scanning is available
if (YubiKitDeviceCapabilities.supportsISO7816NFCTags) {
    // Provide additional setup when NFC is available
} else {
    // Handle the missing NFC support
}
```

List of sessions is documented below with it's own specifics and samples:

- [FIDO](./docs/fido2.md) - Provides FIDO2 operations accessible via the *YKFFIDO2Session*.

- [U2F](./docs/u2f.md) - Provides U2F operations accessible via the *YKFU2FSession*.

- [OATH](./docs/oath.md) - Allows applications, such as an authenticator app to store OATH TOTP and HOTP secrets on a YubiKey and generate one-time passwords.

- [OTP](./docs/otp.md) - Provides implementation classes to obtain YubiKey OTP via accessory (5Ci) or NFC.

- [PIV](./docs/piv.md) - Provides PIV operations accessible via the *YKFPIVSession*.

- [Challenge-response](./docs/chr.md) - Provides a method to use HMAC-SHA1 challenge-response.

- [Management](./docs/mgmt.md) - Provides ability to enable or disable available application on YubiKey

- [SmartCardInterface](./docs/smartcard-interface.md) - Provides low level access to the Yubikey with which you can send custom APDUs to the key

## Customize the Library
YubiKit allows customizing some of its behavior by using `YubiKitConfiguration` and `YubiKitExternalLocalization`.
Customizing YubiKit Behavior

For providing localized strings for the user facing messages shown by the library, YubiKit provides a collection of properties in `YubiKitExternalLocalization`.

One example of a localized string is the message shown in the NFC scanning UI while the device waits for a YubiKey to be scanned. This message can be localized by setting the value of `nfcScanAlertMessage`:

##### Swift

```swift
let localizedAlertMessage = NSLocalizedString("NFC_SCAN_MESSAGE", comment: "Scan your YubiKey.")
YubiKitExternalLocalization.nfcScanAlertMessage = localizedAlertMessage
```

##### Objective-C

```objective-c
#import <YubiKit/YubiKit.h>
...
NSString *localizedAlertMessage = NSLocalizedString(@"NFC_SCAN_MESSAGE", @"Scan your YubiKey.");
YubiKitExternalLocalization.nfcScanAlertMessage = localizedNfcScanAlertMessage;
```

For all the available properties and their use look at the code documentation for `YubiKitExternalLocalization`.

---

**Note:**
`YubiKitExternalLocalization` provides default values in English (en-US), which are useful only for debugging and prototyping. For production code always provide localized values.

---

## **YubiKit FAQ**

#### Q1. Does YubiKit store any data on the device?

Yubikit doesn't store any data locally on the device. This includes NSUserDefaults, application sandbox folders and Keychain. All the data required to perform an operation is stored in memory for the duration of the operation and then discarded.

#### Q2. Does YubiKit communicate with any services?

Yubikit doesn't communicate with any services, like web services or other type of network communication. YubiKit is a library for sending, receiving and processing the data from a YubiKey.

#### Q3. Can I use YubiKit with other devices which are not from Yubico?

YubiKit is a library which should be used only to interact with a device manufactured by Yubico. While some parts of it may work with other devices, the library was developed and tested to work with YubiKeys. When attaching a MFI accessory, YubiKit will always check if the manufacturer of the device is Yubico before connecting to it.

#### Q4. Is YubiKit compiled with support for Bitcode and Position Independent code?

Yes, YubiKit is compiled to accommodate any modern iOS project. The supplied library is compiled with Position Independent code and Bitcode. The release version of the library is optimized (Fastest, smallest).

#### Q5. Is YubiKit logging or asserting in release mode?

No, YubiKit is not logging in release mode. The logs from YubiKit will show only in debug builds to help the developer to see what YubiKit does. The same stands for assertions. YubiKit will assert in debug mode to warn the developer when invalid parameters are passed to the library or when something unexpected happened with the key. In release, the library will handle invalid states in different ways (e.g. returning nil if the object was not properly initialized, returning errors, etc.).

#### Q6. Are there any versions of iOS where YubiKit does not work?

YubiKit should work on any modern version of iOS (10+) with a few exceptions\*. It's recommended to always ask the users to upgrade to the latest version of iOS to protect them from known, old iOS issues. Supporting the last 2 version of iOS (n and n-1) is usually a good practice to keep the old versions of iOS out. According to [Apple statistics](https://developer.apple.com/support/app-store/), ~90-95% of all iOS devices run the latest 2 versions of iOS because upgrading the OS is free and Apple usually provides a device with upgrades for 5 years.

\* Some versions of iOS had bugs affecting all external accessories. iOS 11.2 was one of them where the applications could not communicate with accessories due to some bugs in the XPC communication. The bug was fixed by Apple in iOS 11.2.6. For these reasons it's recommended to take in consideration rare but possible iOS bugs when designing the application.

#### Q7. How can I debug the application while using a MFi accessory YubiKey?

Starting from Xcode 9, the IDE provides the ability to debug the application wirelessly. In this way the physical connector is not used for connecting the device to the computer, for debugging the application. This [WWDC session](https://developer.apple.com/videos/play/wwdc2017/404/) explains the wireless debugging functionality in Xcode.

#### Q8. Are the USB-C type iOS devices supported by the YubiKey 5Ci?

The USB-C type iOS devices, such as the iPad Pro 3rd generation, have limited support when using the YubiKey 5Ci or another type of YubiKey with USB-C connector. The OS is not officially supporting external accessories on these devices. However these devices support external USB keyboards, so the OTP functionality of the key will work and the key can be used to generate Yubico OTPs and HOTPs.

## **Additional resources**

1. Xcode Help - [Add a capability to a target](http://help.apple.com/xcode/mac/current/#/dev88ff319e7)
2. Xcode Help - [Build settings reference](http://help.apple.com/xcode/mac/current/#/itcaec37c2a6)
3. Technical Q&A QA1490 -
[Building Objective-C static libraries with categories](https://developer.apple.com/library/content/qa/qa1490/_index.html)
4. Apple Developer - [Swift and Objective-C in the Same Project](https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html)
5. Yubico - [Developers website](https://developers.yubico.com)
6. Yubico - [Online Demo](https://demo.yubico.com) for OTP and U2F
7. Yubico - [OTP documentation](https://developers.yubico.com/OTP)
8. Yubico - [What is U2F?](https://developers.yubico.com/U2F)
9. Yubico - [YKOATH Protocol Specifications](https://developers.yubico.com/OATH/YKOATH_Protocol.html)
10. FIDO Alliance - [CTAP2 specifications](https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html)
11. W3.org - [Web Authentication:
An API for accessing Public Key Credentials](https://www.w3.org/TR/webauthn/)

repository: Yubico/yubikit-ios

gha_language: Objective-C

repo_name: Yubico/yubikit-ios


text:
---
tags: [2019/12/22, data structure/monoqueue, leetcode/239]
title: Sliding Window Maximum
created: '2019-10-22T04:47:02.715Z'
modified: '2020-01-07T13:44:21.392Z'
---

# Sliding Window Maximum

Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return the max sliding window.

Example:

Input: nums = [1,3,-1,-3,5,3,6,7], and k = 3
Output: [3,3,5,5,6,7]
Explanation:

Window position                Max
---------------               -----
[1  3  -1] -3  5  3  6  7       3
 1 [3  -1  -3] 5  3  6  7       3
 1  3 [-1  -3  5] 3  6  7       5
 1  3  -1 [-3  5  3] 6  7       5
 1  3  -1  -3 [5  3  6] 7       6
 1  3  -1  -3  5 [3  6  7]      7
Note:
You may assume k is always valid, 1 ≤ k ≤ input array's size for non-empty array.

Follow up:
Could you solve it in linear time?

## Solution

```python
from collections import deque

class Monoqueue(object):

    def __init__(self):
        self.queue = deque()

    def push(self, val):
        cnt = 0
        while len(self.queue) > 0 and self.queue[-1][0] < val:
            cnt += self.queue.pop()[1] + 1
        self.queue.append([val, cnt])

    def pop(self):
        if self.queue[0][1] > 0:
            self.queue[0][1] -= 1
            return
        return self.queue.popleft()[0]

    @property
    def max(self):
        return self.queue[0][0]

class Solution(object):
    def maxSlidingWindow(self, nums, k):
        """
        :type nums: List[int]
        :type k: int
        :rtype: List[int]
        """
        if not nums:
            return []
        q = Monoqueue()
        n = len(nums)
        for i in range(k-1):
            q.push(nums[i])
            print q.queue

        res = []
        for i in range(k-1, n):
            q.push(nums[i])
            res.append(q.max)
            print q.queue
            q.pop()

        return res

```

### deque

```python
from collections import deque

class Solution(object):
    def maxSlidingWindow(self, nums, k):
        """
        :type nums: List[int]
        :type k: int
        :rtype: List[int]
        """
        if not nums:
            return []

        stack = deque()

        for i in range(k-1):
            num = nums[i]
            count = 1
            while stack and stack[-1][1] < num:
                cnt, _ = stack.pop()
                count += cnt
            stack.append([count, num])

        res = []
        for i in range(k-1, len(nums)):
            num = nums[i]
            count = 1
            while stack and stack[-1][1] < num:
                cnt, _ = stack.pop()
                count += cnt
            stack.append([count, num])

            res.append(stack[0][1])
            stack[0][0] -= 1
            if stack[0][0] == 0:
                stack.popleft()

        return res
```

## refs

* [leetcode](https://leetcode.com/problems/sliding-window-maximum/discuss/65885/This-is-a-typical-monotonic-queue-problem)
* [article](https://medium.com/algorithms-and-leetcode/monotonic-queue-explained-with-leetcode-problems-7db7c530c1d6)

## schedule

* [x] 2019/10/22
* [x] 2019/10/23
* [x] 2019/12/21
* [x] 2020/01/07
* [ ] 2020/01/08

path: /notes/Sliding Window Maximum.md

filename: Sliding Window Maximum.md


text:
---
layout: post
title: "My newest interesting Powershell script"
comments: false
date: 2006-07-25 12:20:00
updated: 2008-07-06 10:51:27
categories:
 - Technology
tags:
 - powershell
 - warcraft
 - subversion
subtext-id: 041b873e-bb90-4fa1-a8bb-29ed25750580
alias: /blog/post/My-newest-interesting-Powershell-script.aspx
---

I've started running a bunch of [Ace Addons](http://www.wowace.com/) for [World of Warcraft](http://www.worldofwarcraft.com/) and I love the fact that they have them all up on their [Subversion](http://svn.tigris.org/) server. But it was getting annoying having to do "svn update" on each and every folder (using [TortoiseSVN](http://tortoisesvn.tigris.org/) wasn't any betterΓÇª I then had to right-click each oneΓÇª not better).

But of course, being the [Powershell ](http://www.microsoft.com/powershell)junkie that I am, I had to automate this, so here's what I just ran. I know it can be simplified a bit, but this works for now:

`PS >&nbsp_place_holder;gci | where { $_.GetType().FullName -eq "System.IO.DirectoryInfo" } | foreach { cd $_; svn update }`

Woo hoo!

Update: I suppose I should have just tried using SVN for this first, eh? It turns out "svn update *" works just fine.


text:
# Extension Layout

Though this may extend to Base Layout in general, a core part of the early game is layingout and refilling your spawn extensions as your controller level increases.

--
One idea is to completely hapazardly lay them out, looking in all directions around the spawn. This will work eventually but it isn't particularly CPU efficient and will likely result in messy bases. (Messy bases aren't necessarily a bad thing).

--
Another idea is to break up the map in to Extension blocks. Basically 5 Extensions in an X shape with roads between. This would reduce the total number of units to place from 60 at RC8 to 12. We always gain extensions in blocks of 5 or 10, so we would always be able to fully place them.

This would be nice because it would automatically cluster them into 'refillable' units. And it means that any node in the cluster is accessible from any cell adjacent to the square, because of diagonal roads.

-- I often see people laying out their extensions in a checker grid. This makes sense as it ensure that each extension is accessible, but I believe they are laid out by hand. I can't imagine an algorithm which would nicely do this.

-- Update: An improvement on the Extension Block idea above is to layout each group as 6 instead of 5. In either of these configurations: `o`: Extension, `x`: Road

```
A: o o x      B: x o o
   o x o         o x o
   x o o         o o x
```

These fit 6 Extensions in a 3x3 instead of only 5, and if they are tiled alternating, all roads will be accessible.

They can be filled in a CPU efficient manner as the center Road cell is in range of all 6 Extensions. Meaning we can fill it in 2 Moves and 6 Transfers (which each have flat CPU cost).

With the Space Saving, cumulatively this layout can fit 60 extensions into 90 Cells (33% less than the 120 required for a checker board).

## Mission Structure

-- DistributionMission
I am imagining a Distributor Mission, which is attached to an Energy Node.

This mission will request Hauler Creeps, who will transport Energy from the energy node, to an Extension Group.

Each Creep will be asigned one group at a time, and it will keep fetching energy for it until it is done.

Then the Distributor Mission will look at the next lowest Extension Group and reassign the Distributor.

-- Distribution Operation
This Operation will take a Spawn, and it will decide where each of the Extension Groups will go.

repository: brisberg/amber

repo_name: brisberg/amber


text:
# Quiz-service #

 ### Description ###

 The quiz module is a rest-service for handling quizzes. It contains 3 rest-controllers one for
 each model entity: Quiz, Question, Category.

  The reason why there is so many endpoints(in 3 different controllers is because it is
  meant to be handled with a GUI. Where an administrator can create categories add question
  to it and then compose quizzes out of those questions. It would make sense to be able to have
  multiple ways of sorting the questions, categories and quizzes and thats why it is implemented
  with three seperate controllers.

 ###  RESTful  ###

 The controllers has been implemented according to REST lvl 2. They follow the specifications
 for HTTP and the URL is defined to follow the principals of RESTful API implementation standards.
 Level 2 since we did not find it necassary with HATEOS as it would only add complexity and increase
 the traffic between our services without actually adding any value.

 ###  Swagger  ###

 Swagger is implemented and can be viewed at the path below when the system is running with
  docker-compose.

   /quiz/api/swagger-ui.html

 ![alt text](doc/swagger-screen.png "swagger representation of the endpoints described
 in the text above")

 ### Clarifications about the endpoints ###

    category-controller:
 Is selfexplanatory GET, POST and DELETE to perform what the
    HTTP-verbs describes.

    question-controller:

    Contains one endpoint for every common HTTP-verb GET, POST, PUT, PATCH and DELETE.

    quiz-controller:

     GET /quizzes

     can take an extra param(not required) using
     /quizzes?category={category}

    will get all quizzes from a given category.

     POST /quizzes/{id}/check

    This endpoint is used to submit answers to the quiz given by the id. It will
    calculate the score based on the nr of correct answers given multiplied with
    the difficulty of the quiz(1-3).

    This one is a bit tricky since it will technically lead to a patch in the highscore
    but is from the perspective of the quiz-module itself creating a message that is
    returned as a response and published to the queue.

    I choose to implement it with the POST verb I am however not certain that which verb
    to choose in this scenario.

    This endpoint will publish the calculated score along with the username of
    the playing user to rabbitmq. It will then eventually end up in the highscore
    service. See root docs for more info on this feature.

   [root docs](../README.md)

 Besides the features described above the rest is self-explanatory. For more information
 about the endpoints swagger is as mentioned available as well.

 ### DB ###
 Postgres is used when running in production, an image dedicated to this module is started
 with docker-compose.

 The tests(the local ones) however is running with h2.

 For the purpose of the e2e tests, to make it easier to test, the instance will get pre-loaded
 with 2 quizzes.

 ### Tests ###
 ##### rest assured #####
 For each endpoint in the quiz-modul there is a corresponding rest assured test.
 All the tests can be found
 [here](/src/test/kotlin/no/group3/springQuiz/quiz/api/QuizApiTest.kt).
 To run the tests use
  mvn package

 ##### e2e #####
 The endpoint POST /quizzes/{id}/check  is tested in the
 [e2e modul](../e2e/src/test/kotlin/no.group3.SpringQuiz.e2e/HighscoreQuizAmqpIT.kt)

 Quiz is also tested in this [e2e](../e2e/src/test/kotlin/no.group3.SpringQuiz.e2e/Quize2eIT.kt)
 which is a form om production test that simulates a game with the whole system
 running.

 To run the e2e tests use the following in the e2e module:

 mvn verify

 or
 mvn clean install in root folder.


text:
# LightWave ACME Card Manager
ACME Card Manager simulates how a traditional NonStop payment application (such as BASE24 or Connex) might be REST-enabled using LightWave Server. Typical account and card functions are supported from the relevant menu items. Transactions can be initiated from the Terminal view with the results viewed on the Transactions view. A small range of relevant response codes are simulated, and the result of the transaction (success or failure) can be seen in real-time in the Terminal view, and historically in the Transactions view.

All of these services are provided as REST APIs by LightWave Server working in conjunction with simple demo Pathway Servers on the NonStop. The details of all data exchanged with the REST services can be viewed in the API Request Log view - this shows all requests sent to the NonStop, and all responses returned.

When enabled, the application Pathway servers use LightWave Client to send SMS notifications to simulated cardholders using the [AWS Simple Notification Service](https://aws.amazon.com/sns) REST API. Notifications are sent for sale and void transactions, and card lock status changes.

![](acme_card_diagram.png?raw=true)

The sample consists of the Pathway application and a browser based client application. These components may be installed using these instructions:

| Installation Instructions |
| -- |
| [NonStop Pathway Application](service) |
| [Browser based client application](web-app) |

Assistance is available through the [NuWave Technologies Support Center](http://support.nuwavetech.com).

repository: nuwavetech/acme-card-manager

gha_language: C

repo_name: nuwavetech/acme-card-manager


text:
# Jasmine Core 2.0.1 Release Notes

## Summary

This release is for small bug fixes and enhancements ahead of a real-soon-now 2.1.

## Changes

### Features

* NodeJS is now supported with a jasmine-core npm
* [Support browsers that don't supply a `Date.now()` by having a `mockDate` object](http://www.pivotaltracker.com/story/66606132) - Closes #361
* [Show message if no specs where loaded](http://www.pivotaltracker.com/story/12784235)
* When using `jasmine.any`, the `class` will now be included in the error message
* Reporters now receive the number of passed expectations in a spec
* Use default failure message for `toBeNaN`
* Use the latest `jasmine_selenium_runner` so we use the fix for printing objects with cycles
* Add jasmine logo image to HTML runner
* Stop Jasmine's CSS affecting the style of the body tag - Closes #600
* Standardized location of the standalone distributions - they now live in the repo in `/dist` as well as on the Releases page

### Bugs

* Don't allow calling the same done callback multiple times - Fixes #523
* [Remove 'empty' as an option as a spec result](http://www.pivotaltracker.com/story/73741032) as this was a breaking change
    * Instead, we determine if a spec has no expectations using the added
key of `passedExpectations` in combination of the `failedExpectations`
to determine that there a spec is 'empty'
* Fix build in IE8 (IE8 doesn't support `Object.freeze`)
* Fix `ObjectContaining` to match recursively

### Documentation

* Update release doc to use GitHub releases
* Add installation instructions to README - Merges #621
* Add Ruby Gem and Python Egg to docs
* Add detailed steps on how to contribute - Merges #580 from @pablofiu

## Pull Requests and Issues

* Contains is explicitly false if actual is `undefined` or `null` - Fixes #627
* namespace `html-reporter` -> `jasmine_html-reporter` - Fixes #600
* Throw a more specific error when `expect` is used without a `currentSpec` - Fixes #602
* Reduced size of logo with PNG Gauntlet - Merges #588
* HTML Reporter resets previous DOM when re-initialized -  Merges #594 from @plukevdh
* Narrow down raise exceptions query selector; Finding by any input tag is a little bit broad - Closes #605
* Pass through custom equality testers in toHaveBeenCalledWith - Fixes #536
* Fix outdated copyright year (update to 2014) - Merges #550 from @slothmonster
* [Add package.json to Python egg to get correct version number](http://www.pivotaltracker.com/story/67556148) - Fixes #551
* Allow users to set the maximum length of array that the pretty-printer
will print out - Fixes #323 @mikemoraned and #374 @futuraprime
* `matchersUtil.equals()`` does not expect a matcher as its first argument,
so send the "actual" value first and the "expected" value second. - Merges #538 from @cbandy
* Add single quote check to `jshint` and fix src files for that - Closes #522
* Remove an `eval` in order to support running jasmine within CSP - Closes #503
* Allow matcher custom failure messages to be a function - Closes #520
* More color blind friendly CSS from @dleppik - Closes #463 & #509
* Use `load-grunt-tasks` Merges #521 from @robinboehm
* Special case printing `-0` - Closes #496
* Allow stub or spy Date object safely using a closure to get a clean copy - Closes #506
* [Use `\d7` instead of plain 'x' for more square appearance](http://www.pivotaltracker.com/story/48434179)
* Better support in pretty printer when an object has null prototype - Fixes #500
* Update link at top of README to improve access to Jasmine 2.0 docs - Merges #486 from @nextmat
* Force query selector to seek within the html-reporter element - Merges #479 from @shprink
* Netbeans files are in gitignore - Merges #478 from @shprink

------

_Release Notes generated with [Anchorman](http://github.com/infews/anchorman)_

repository: ymizushi/EmotionalHub

repo_name: ymizushi/EmotionalHub


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

### Description

The pswd.js script relies on the client to calculate whether a username and password match hard-coded hashed values for a server, and uses a hashing scheme that creates a large number of collisions, which makes it easier for remote attackers to conduct offline brute force attacks.  NOTE: this script might also allow attackers to generate the server-side "secret" URL without determining the original password, but this possibility was not discussed by the original researcher.

### POC

#### Reference
- http://securityreason.com/securityalert/1362

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

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# COVID-19 Testing Locations Website
This is a website built by the Postman team to help crowd-source COVID-19 testing sites and locations. We do our best to verify all information, but standard indemnifications apply.

The website for this project can be found at: https://covid-19-apis.postman.com/covid-19-testing-locations/

## Contribution guidelines

We would love for you to contribute to the COVID-19 Testing Locations Website! To contribute to this project, please read:

* The [Code of Conduct](https://www.postman.com/code-of-conduct)
* The [Contribution Guidelines](CONTRIBUTING.md)

**NOTE:** We have added a new Markdown linter with GitHub Actions. When making a pull request, it will run against this linter. Your changed files are required to pass linting before they will be merged. More information on this can be found in the [contribution guidelines](CONTRIBUTING.md).

## Build locally
This assumes you have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [npm](https://www.npmjs.com/get-npm) installed.
```
   $ git clone https://github.com/postmanlabs/covid-19-apis.git
   $ cd covid-19-apis
   $ npm install
   $ npm install -g gatsby-cli
   $ npm run dev
```

## COVID-19 Testing Location Information
This crowdsourced, regularly-updated listing of COVID-19 testing locations leverages two common services to make data more manageable and accessible:
* Postman Collections: Using a Postman collection, data is pulled from Google using the Google Sheets API and then updates an API, documentation, and publishes data to GitHub for display to end users. (New to Postman Collections? See our [Introduction to Postman Collections](https://learning.postman.com/docs/postman/collections/intro-to-collections/) documentation.)
* GitHub: used to publish machine-readable open data for wider consumption, and is also used for the hosting of web and mobile applications. See [parent folder](https://github.com/postmanlabs/covid-19-apis/) in this project repo for more information.

branch_name: refs/heads/develop


text:
# Sporidesmium induratum Cooke SPECIES

#### Status
ACCEPTED

#### According to
Index Fungorum

#### Published in
Grevillea 7(no. 41): 11 (1878)

#### Original name
Sporidesmium induratum Cooke

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
---
title: I want to develop a discord bot.
position: 0
---

If you are just beginning in JS, only some parts of [The Modern JavaScript tutorial](<https://javascript.info/>) are required:
- The whole of [Part 1](<https://javascript.info/js>)
- (Part 3: Network requests) [Fetch basics](<https://javascript.info/fetch-basics>), [the URL object](<https://javascript.info/url>)
- (Part 3) [Regular Expressions](<https://javascript.info/regular-expressions>)

As well as 2 [primers](<https://nodejs.dev/en/learn/the-nodejs-event-emitter/>) on [events](<https://web.archive.org/web/20220318113645/https://nodejs.dev/learn/the-nodejs-events-module>), and [Websocket](<https://javascript.info/websocket>)

Why fetch if you're going to use node.js? Because if you want to make requests to remote URLs, you will be using [node-fetch](<https://www.npmjs.com/package/node-fetch>) (native in node version => 18).

Now you're ready to learn using [the only valid discord.js bot tutorial](<https://discordjs.guide/>), you're welcome.

branch_name: refs/heads/gh-pages


text:
---
# Documentation: https://wowchemy.com/docs/managing-content/

title: A Capacity Planning Process for Performance Assurance of Component-based Distributed
  Systems
subtitle: ''
summary: ''
authors:
- Nilabja Roy
- Abhishek Dubey
- Aniruddha S. Gokhale
- Larry W. Dowdy
tags:
- ''
categories: []
date: '2011-01-01'
lastmod: 2023-01-30T20:00:08-06:00
featured: false
draft: false

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.
# Focal points: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight.
image:
  caption: ''
  focal_point: ''
  preview_only: false

# Projects (optional).
#   Associate this post with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `projects = ["internal-project"]` references `content/project/deep-learning/index.md`.
#   Otherwise, set `projects = []`.
projects: []
publishDate: '2023-01-31T02:00:08.119772Z'
publication_types:
- '1'
abstract: For service providers of multi-tiered component-based applications, such
  as web portals, assuring high performance and availability to their customers without
  impacting revenue requires effective and careful capacity planning that aims at
  minimizing the number of resources, and utilizing them efficiently while simultaneously
  supporting a large customer base and meeting their service level agreements. This
  paper presents a novel, hybrid capacity planning process that results from a systematic
  blending of 1) analytical modeling, where traditional modeling techniques are enhanced
  to overcome their limitations in providing accurate performance estimates; 2) profile-based
  techniques, which determine performance profiles of individual software components
  for use in resource allocation and balancing resource usage; and 3) allocation heuristics
  that determine minimum number of resources to allocate software components. Our
  results illustrate that using our technique, performance (i.e., bounded response
  time) can be assured while reducing operating costs by using 25% less resources
  and increasing revenues by handling 20% more clients compared to traditional approaches.
publication: "*ICPE'11 - Second Joint WOSP/SIPEW International Conference on Performance\
  \ Engineering, Karlsruhe, Germany, March 14-16, 2011*"
doi: 10.1145/1958746.1958784
links:
- name: URL
  url: https://doi.org/10.1145/1958746.1958784
---


text:
<!-- If your PR fixes an open issue, use `Closes #101` to link your PR with the issue. #101 stands for the issue number you are fixing -->

## 🛠 Fixes Issue

<!-- Remove this section if not applicable -->

<!-- Example: Closes #31 -->

## 👨💻 Changes proposed

<!-- List all the proposed changes in your PR -->

## 📄 Note to reviewers

<!-- Add notes to reviewers if applicable -->

## 📷 Screenshots

<!-- Add any relevant screenshots if applicable -->

repository: gis-ops/valhalla-app

repo_name: gis-ops/valhalla-app


text:
# Manage log storage space {#concept_l31_543_1gb .concept}

After you enable the Anti-DDoS Pro log collection function, log data is pushed to the specified Logstore in real time. You can view the usage of the log storage space in the Anti-DDoS Pro console.

## View log storage usage {#section_obl_hnz_qfb .section}

You can view the usage of the log storage for Anti-DDoS Pro Log Service at any time.

**Note:** The log storage information in the console is not updated in real time. It takes up to two hours to synchronize the actual storage information to the console. Therefore, we recommend that you expand the log storage space before it is exhausted.

1.  Log on to the Anti-DDoS Pro console.
2.  In the left-side navigation pane, choose **Statistics** \> **Full Log**.
3.  In the upper-right corner of the page, view the log storage usage.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/77349/156203523933774_en-US.png)

url: https://raw.githubusercontent.com/xiaojiexu0214/sls/883649a8f2e5e8fbec9634ec81017d7083b65dea/intl.en-US/User Guide/Cloud product collection/Logs of BGP-line Anti-DDoS Pro/Manage log storage space.md

filename: Manage log storage space.md


text:
# Running the test script

# Getting set up

Download your favorite python version [here](https://www.python.org/downloads/)
follow the instructions to get python added to the PATH on your system.

after downloading python, install the following packages:
1) [selenium](https://selenium-python.readthedocs.io/installation.html)
2) [seleniumwire](https://pypi.org/project/selenium-wire/)
3) [webdriver manager](https://pypi.org/project/webdriver-manager/)

# Running the script

After downloading the packages, you're all set to run the script!
Go ahead and start running a local version of royalflush, instructions found [here](https://github.com/justinchen673/royal-flush/tree/master#readme)
The script is equiped with 2 classes, User and Poker, these classes are capable of most actions within royal flush.

In the current version of the script (v1.0) the script will do the following:
1) create 4 new accounts
2) login with those accounts
3) create a game and join the game
4) play 5 rounds of the game
5) logout of the game, and print the player info

you can view this interaction live by commenting out line 43, if you want to just run a lighter weight version of the tests, uncomment line 43 for a headless (no visible browse) mode.

# Reporting errors

If there are any issues or bugs you found while testing, please let us know!

1) go to the issues tab located [here](https://github.com/justinchen673/royal-flush/issues)
2) click on "New Issue", please submit a screenshot of the error message, alongside with any thoughts you might have on what might be causing the issue.

## Thats it, Happy testing!


text:
# Veritatem Dies Aperit - Temporally Consistent Depth Prediction Enabled by a Multi-Task Geometric and Semantic Scene Understanding Approach

Requires an NVIDIA GPU, Python 3, [CUDA CuDNN](https://developer.nvidia.com/cudnn), [PyTorch 1.0](http://pytorch.org), and [OpenCV](http://www.opencv.org).
<br>
Other libraries such as [visdom](https://github.com/facebookresearch/visdom) are also optionally used in the code. If you wish to use visdom to plot curves and display results, this needs to be set in the arguments via `--display`.

![General Pipeline](https://raw.githubusercontent.com/atapour/temporal-depth-segmentation/master/imgs/architecture_pipeline.png)

                Network Architecture

## Method:

_"Robust geometric and semantic scene understanding is ever more important in many real-world applications such as autonomous driving and robotic navigation. In this work, we propose a multi-task learning-based approach capable of jointly performing geometric and semantic scene understanding, namely depth prediction (monocular depth estimation and depth completion) and semantic scene segmentation. Within a single temporally constrained recurrent network, our approach uniquely takes advantage of a complex series of skip connections, adversarial training and the temporal constraint of sequential frame recurrence to produce consistent depth and semantic class labels simultaneously. Extensive experimental evaluation demonstrates the efficacy of our approach compared to other contemporary state-of-the-art techniques."_

[[Atapour-Abarghouei and Breckon, CVPR, 2019](https://arxiv.org/pdf/1903.10764.pdf)]

---

![](https://raw.githubusercontent.com/atapour/temporal-depth-segmentation/master/imgs/results.png)

      Example of the results of the approach

---
## Instructions to train the model:

* First and foremost, this repository needs to be cloned:

```
$ git clone https://github.com/atapour/temporal-depth-segmentation.git
$ cd temporal-depth-segmentation
```

* A dataset needs to be prepared to be used for training. In our experiments, we use the [SYNTHIA](http://synthia-dataset.net/) dataset. However, any other dataset containing correponding RGB, depth and class label images is suitable for training this model. We have provided a simple, albeit inefficient, python script (`data_processing/prepare_data.py`) that processes the SYNTHIA data and generates a data root in accordance with our custom training dataset class (`data/train_dataset.py`). However, feel free to modify the script or the dataset class to fit your own data structure. Our custom dataset follows the following directory structure:

```
Custom Dataset
├── train
│   ├── 0
│   │   ├── Depth
│   │   │   ├── 000000.png
│   │   │   ├── 000001.png
│   │   │   ├──   ...
│   │   ├── GT
│   │   │   ├── 000000.png
│   │   │   ├── 000001.png
│   │   │   ├──   ...
│   │   ├── RGB
│   │   │   ├── 000000.png
│   │   │   ├── 000001.png
│   │   │   ├──   ...
│   ├── 1
│   │   ├── Depth
│   │   │   ├── 000000.png
│   │   │   ├── 000001.png
│   │   │   ├──   ...
│   │   ├── GT
│   │   │   ├── 000000.png
│   │   │   ├── 000001.png
│   │   │   ├──   ...
│   │   ├── RGB
│   │   │   ├── 000000.png
│   │   │   ├── 000001.png
│   │   │   ├──   ...
    ...

```
* The training code can utilizes [visdom](https://github.com/facebookresearch/visdom) to display training results and plots, in order to do which simply run `visdom` and then navigate to the URL http://localhost:8097. If you intend to use this, the argument `--display` needs to be added to the command line.

* To train the model, run the following command:

```
$ python train.py --name=name --data_root=path/to/data
```

* All the arguments for the training are passed from the file `train_arguments.py`. Please refer to this file to see what options are available to be passed in as arguments.

---
## Instructions to test the model:

* In order to easily test the model, we provide a set of pre-trained weights. The pre-trained are stored separately due to their large size.

* The script entitled "download_pretrained_weights.sh" will download the required pre-trained model and automatically checks the downloaded file integrity using MD5 checksum.

* Additionally, a sequence of example image frames is provided in the `examples` directory for testing.

* To test the model, run the following commands:

```
$ chmod +x ./download_pretrained_weights.sh
$ ./download_pretrained_weights.sh
$ python test.py --data_root=./examples --test_checkpoint_path=./pre_trained_weights/pre_trained_weights.pth --results_path=./results
```
---

The output results are written in a directory taken as an argument to the test harness ('./results' by default):
* Three separate directories are created to store the RGB, depth, and segmented images.

---

## Example:
[![Video Example](https://raw.githubusercontent.com/atapour/temporal-depth-segmentation/master/imgs/thumbnail.jpg)](https://vimeo.com/325161805 "Video - Click to Play")

      Supplementary Video - click image above to play.

---

This work is created as part of the project published in the following. The model has been re-trained to provide better quality visual results.
## Reference:

[Veritatem Dies Aperit - Temporally Consistent Depth Prediction Enabled by a Multi-Task Geometric and Semantic Scene Understanding Approach](https://arxiv.org/pdf/1903.10764.pdf)
(A. Atapour-Abarghouei, T.P. Breckon), In Proc. IEEE Conf. Computer Vision and Pattern Recognition, 2019. [[pdf](https://arxiv.org/pdf/1903.10764.pdf)]

```
@InProceedings{abarghouei19depth,
  author = {Atapour-Abarghouei, A. and Breckon, T.P.},
  title = {Veritatem Dies Aperit - Temporally Consistent Depth Prediction Enabled by a Multi-Task Geometric and Semantic Scene Understanding Approach},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  pages={3373--3384},
  year = {2019},
  publisher = {IEEE}
}

```
---

repository: atapour/temporal-depth-segmentation

repo_name: atapour/temporal-depth-segmentation


text:
# Reduce Array Size to The Half

LeetCode [source](https://leetcode.com/problems/reduce-array-size-to-the-half/)

## Solution

### Intuition

Build a frequency hash map, then sort using counting sort. Keep adding the integer with the max frequency until you remove at least half of the integers.

### Algorithm

1. Count the frequency of each integer in the array using a hash map.

2. Sort the frequencies by counting sort.

3. Keep remove the maximum frequency from the sorted frequencies until **removed >= half**.

### Complexity Analysis

In worst case, the maximum value in frequencies array is **1**, this happens when all numbers in array are the uniq.

- Time Complexity: preprocessing **O(n)**, where build frequency map need **O(n)** and counting sort need **O(n)**.

- Space Complexity: **O(n)**. We only used additional **n** extra space for the hash map and counting vector.

## AC Result

| Status   | Runtime | Memory  | Language                                                     |
| -------- | ------- | ------- | ------------------------------------------------------------ |
| Accepted | 278 ms  | 77.7 MB | [cpp](../src/cpp/ReduceArraySizeToTheHalf/Solution.cpp)      |
| Accepted | 19 ms   | 5 MB    | [rust](../src/rust/reduce-array-size-to-the-half/src/lib.rs) |

repository: XFreeCoder/LeetCode

repo_name: XFreeCoder/LeetCode