text:
# Software packaging (aka "snake charming")

InterARTIC development involved the use of the Python programming language and depends on several third-party Python modules and software written predominantly in Python (e.g., *Flash*, *Celery*, *ARTIC* tools, etc). The Python ecosystem (including the language itself, in addition to Python libraries) has limited backward compatibility. As a result, Python software is often compatible only with the exact version of the Python interpreter and library versions it was developed with (sometimes specific even to the minor version level).

Python virtual environments and Anaconda are designed to resolve issues related to version compatibility but - at least in our experience - software installation via these methods can be complicated, especially for novice users. To experience the headache yourself, try to install InterARTIC and its dependencies from the scratch by following the instructions [here](https://psy-fer.github.io/interARTIC/installation).

Fortunately, the Python interpreter is predominantly written in C. Generally speaking, both the C language and system libraries have good backward compatibility. For instance, GLIBC is fully backward compatible. Thus, if you compile a C program on an older Linux system (e.g., Ubuntu 14) with an older compiler (e.g., gcc 4.8) and statically link third party libraries with limited backward compatibility, while dynamically linking the basic backward compatible libraries, the compiled binary would be portable on most (if not all) modern Linux systems. Of course, x86_64 binaries will not work on ARM processors, but if you compile for an older x86_64 instruction-set, it will work on all modern x86_64 processors, thanks to the backward compatibility in processor instruction sets. ARM also benefits from a similar level of backward compatibility.

In summary, if the relevant Python interpreter, all the modules and third party software are compiled and packaged with your Python code, it will be "portable". We call this process “snake charming", since it prevents Python modules from biting one another. For interested developers, we provide detailed instructions below on how snake charming was used in the development of InterARTIC, and how to use this technique to improve their own tools.

1. Setup a virtual machine with a fresh minimal installation of Ubuntu 14. Do everything below inside that virtual machine.

2. Obtain Python binaries compiled in the aforementioned fashion from https://github.com/indygreg/python-build-standalone. Refer to https://python-build-standalone.readthedocs.io/en/latest/ for more information.

    ```bash
    wget https://github.com/indygreg/python-build-standalone/releases/download/20200408/cpython-3.7.7-linux64-20200409T0045.tar.zst #python 3.7 needed for interARTIC
    zstd -d cpython-3.7.7-linux64-20200409T0045.tar.zst #extract zstd archive
    tar xvf cpython-3.7.7-linux64-20200409T0045.tar
    mkdir interartic_bin && mv python/install/* interartic_bin/
    ```

3. Now clone the interARTIC repository and copy the relevant scripts and data.

    ```bash
    git clone https://github.com/Psy-Fer/interARTIC.git
    mv interARTIC/templates interARTIC/scripts interARTIC/static interARTIC/src interARTIC/primer-schemes interARTIC/run.sh interARTIC/main.py interARTIC/config.init interartic_bin/
    ```

4. Now install the required dependencies using *pypi* in a virtual environment and move those to our snakeball directory.

    ```bash
    cd interartic_bin/
    bin/python3.7m -m venv interartic-venv
    source interartic-venv/bin/activate
    pip install pip --upgrade
    pip install celery==4.4.6 redis==3.5.3 flask==1.1.2 redis-server==6.0.9 pandas==1.2.4
    REDIS=$(python -c 'import redis_server
    print(redis_server.REDIS_SERVER_PATH)
    ')
    deactivate
    ```

    ```bash
    mv interartic-venv/bin/celery interartic-venv/bin/flask $REDIS bin/
    mv interartic-venv/lib/python3.7/site-packages/* lib/python3.7/site-packages/
    rm -rf interartic-venv/
    ```

5. Now the interARTIC environment is done, but the hard part is the artic pipeline which needs a different python environment. Now let us grab compiled binaries for artic and its dependencies through conda repositories.

    i. In the same virtual machine install an older miniconda.

    ```bash
    rm -rf ~/miniconda3/
    wget https://repo.anaconda.com/miniconda/Miniconda3-4.3.11-Linux-x86_64.sh
    ./Miniconda3-4.3.11-Linux-x86_64.sh -b -p $HOME/miniconda3
    rm Miniconda3-4.3.11-Linux-x86_64.sh
    ```

    ii. Now clone the artic repository.

    ```bash
    cd ..
    git clone https://github.com/artic-network/artic-ncov2019.git
    cd artic-ncov2019 && git checkout 7e359dae37d894b40ae7e35c3582f14244ef4d36
    cd ..
    ```

    iii. Grab the dependencies for artic through conda. This will take ages.

    ```bash
    ~/miniconda3/bin/conda env create -f artic-ncov2019/environment.yml
    ```

    iv. Move the relavent binaries and library modules.

    ```bash
    cd interartic_bin
    mkdir artic_bin
    mv ~/miniconda3/envs/artic-ncov2019/bin artic_bin/
    mv ~/miniconda3/envs/artic-ncov2019/lib artic_bin/
    rm -rf artic_bin/lib/node_modules
    ```

    v. Cleanup pycaches.

    ```bash
    find ./ -name __pycache__ -type d | xargs rm -r
    ```

    vi. Hard coded paths such as `/home/user/miniconda3/envs/artic-ncov2019/bin/python3.6` must be replaced with `/usr/bin/env python3.6`. Some ugly and lazy example grep commands to patch these:

    ```bash
    cd artic_bin/bin
    grep -l "#\!/home\/hasindu\/miniconda3\/envs\/artic\-ncov2019\/bin/python3.6" * | while read p; do
      echo $p;
      sed -i "s/\/home\/hasindu\/miniconda3\/envs\/artic\-ncov2019\/bin\/python3.6/\/usr\/bin\/env python3.6/g" $p;
    done

    grep -l "#\!/home\/hasindu\/miniconda3\/envs\/artic\-ncov2019\/bin/python" * | while read p; do
      echo $p;
      sed -i "s/\/home\/hasindu\/miniconda3\/envs\/artic\-ncov2019\/bin\/python/\/usr\/bin\/env python/g" $p;
    done

    grep -l "#\!/home\/hasindu\/miniconda3\/envs\/artic\-ncov2019\/bin/perl" * | while read p; do
      echo $p;
      sed -i "s/\/home\/hasindu\/miniconda3\/envs\/artic\-ncov2019\/bin\/perl/\/usr\/bin\/env perl/g" $p;
    done
    ```

    vii. Hard coded paths such as `exec' /home/user/miniconda3/envs/artic-ncov2019/bin/python/` must be replaced with  `exec' /usr/bin/env python`.

    ```bash
    grep -l "exec' \/home\/hasindu\/miniconda3\/envs\/artic\-ncov2019\/bin/python" * | while read p; do
    echo $p;
    sed -i  "s/exec' \/home\/hasindu\/miniconda3\/envs\/artic\-ncov2019\/bin\/python/exec' \/usr\/bin\/env python/g" $p;
    done
    ```

6. Now tarball everything. That is create the snakeball!

    ```bash
    cd ../../../
    tar zcvf interartic_bin.tar.gz interartic_bin
    ```

7. Extract on another Linux computer and thoroughly test.

    Look at the [run.sh](https://github.com/Psy-Fer/interARTIC/blob/master/run.sh) to see how this is run. Important points from the _run.sh_ script are briefly explained below:

    Following are some important environmental variables in the _run.sh_ that are used to isolate the Pythons inside interARTIC from loading wrong modules from user local directories (prevention of snake entagnglements!).

    ```bash
    export PYTHONNOUSERSITE=1
    unset PYTHONHOME
    unset PYTHONPATH
    ```

    Run *main.py* from the extracted directory inside a subshell as a background process:

    ```bash
    ( bin/python3.7 main.py ... )&
    ```

    Run *celery* from the extracted directory inside a subshell by exporting *artic_bin/bin* to *PATH* and *artic_bin/lib/* to *LD_LIBRARY_PATH*

    ```bash
    ( export PATH=`pwd`/artic_bin/bin:`pwd`/scripts:$PATH; export LD_LIBRARY_PATH=`pwd`/artic_bin/lib/:$LD_LIBRARY_PATH; bin/python3.7m bin/celery worker -A main.celery )&
    ```


text:
# Parapteroceras erosulum (J.J.Sm.) J.J.Wood SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Saccolabium erosulum J.J.Sm.

### Remarks
null

repository: mdoering/backbone

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: mdoering/backbone


text:
# gdal2tiles-leaflet

> Generate raster image tiles for use with leaflet.

[Example][example] in action.

This is a modified version of [gdal2tiles.py][] which adds support for raster images as plain 2D maps in [leafletjs][].

It adds the option `-l` or `--leaflet` to generate the resulting images with the reference point `[0,0]` in the upper-left (North-West) corner, opposed to the standard behaviour for TMS tiles using the lower-left (South-East) corner.

Together with the small [leafletjs][] plugin [leaflet-rastercoords][] you'll be able to add markers at the correct position using the (x, y) coordinates of the full-size image.

## Prerequisites

On Debian style OS:

    sudo apt install python-gdal

for python3

    sudo apt install python3-gdal

for others give your search-engine a try...

## Basic usage

````
$ gdal2tiles.py -l -p raster -z 0-5 -w none <image> <tilesdir>
````

Check [test/createtiles.sh](test/createtiles.sh) for usage.

If the `-z` option is omitted then the tool considers the min. zoom level otherwise note...

**Note:** The min zoom level for tile generation must be greater or
equal to `log2(max(width, height)/tilesize)`

Assuming an image with 2000x3000 pixels:

````
# take the larger dimension -> here height = 3000px
$ echo "l(3000/256)/l(2)" | bc -l
# 3.55 --> min zoomlevel for tile generation is 4
# means: `gdal2tiles.py -l -p raster -z 0-2 ...`
#                                          \__ is not allowed
# correct usage
$ gdal2tiles -l -p raster -z 0-4 ...
````

## Multicore usage

The same works with multicore support, thanks to [gdal2tiles-Ticket-4379][].

````
$ gdal2tiles-multiprocess.py -l -p raster -z 0-5 -w none <image> <tilesdir>
````

## Usage with Leaflet

To use the generated tiles with Leaflet there is a small plugin to correctly set the required projection for raster images.
Please refer to the documention at [leaflet-rastercoords][].

## Example

To run the example you'll need to generate the tiles for the large image first.

````
$ cd test
$ ./createtiles.sh
$ open index.html
````

Then open `index.html` in a browser.

[![The sample in test](test.png)][example]

Or see it [here][example] in action.

## Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your
code to be distributed under the respective license. You are also implicitly
verifying that all code is your original work or correctly attributed
with the source of its origin and licence.

## License

Modifications and samples are [MIT licensed][LICENSE].

[gdal2tiles.py][]: (MIT licensed)
* Copyright (c) 2008, Klokan Petr Pridal
* Copyright (c) 2010-2013, Even Rouault

## References

<!-- !ref -->

* [/gdal-1.11.1/swig/python/scripts/gdal2tiles.py][gdal2tiles.py]
* [example][example]
* [gdal2tiles-Ticket-4379][gdal2tiles-Ticket-4379]
* [leaflet-rastercoords][leaflet-rastercoords]
* [leafletjs][leafletjs]
* [LICENSE][LICENSE]

<!-- ref! -->

[LICENSE]: ./LICENSE
[leafletjs]: http://leafletjs.com
[leaflet-rastercoords]: https://github.com/commenthol/leaflet-rastercoords
[gdal2tiles.py]: http://download.osgeo.org/gdal/1.11.1/gdal-1.11.1.tar.gz "/gdal-1.11.1/swig/python/scripts/gdal2tiles.py"
[gdal2tiles-Ticket-4379]: http://trac.osgeo.org/gdal/ticket/4379
[example]: https://commenthol.github.io/leaflet-rastercoords/

license: MIT

repository: orhangazi/dayzharitasi

repo_name: orhangazi/dayzharitasi


text:
# Migrating from Koa v1.x to v2.x

## New middleware signature

Koa v2 introduces a new signature for middleware.

**Old signature middleware (v1.x) support will be removed in v3**

The new middleware signature is:

```js
// uses async arrow functions
app.use(async (ctx, next) => {
  try {
    await next() // next is now a function
  } catch (err) {
    ctx.body = { message: err.message }
    ctx.status = err.status || 500
  }
})

app.use(async ctx => {
  const user = await User.getById(this.session.userid) // await instead of yield
  ctx.body = user // ctx instead of this
})
```

You don't have to use asynchronous functions - you just have to pass a function that returns a promise.
A regular function that returns a promise works too!

The signature has changed to pass `Context` via an explicit parameter, `ctx` above, instead of via
`this`.  The context passing change makes koa more compatible with es6 arrow functions, which capture `this`.

## Using v1.x Middleware in v2.x

Koa v2.x will try to convert legacy signature, generator middleware on `app.use`, using [koa-convert](https://github.com/koajs/convert).
It is however recommended that you choose to migrate all v1.x middleware as soon as possible.

```js
// Koa will convert
app.use(function *(next) {
  const start = new Date();
  yield next;
  const ms = new Date() - start;
  console.log(`${this.method} ${this.url} - ${ms}ms`);
});
```

You could do it manually as well, in which case Koa will not convert.

```js
const convert = require('koa-convert');

app.use(convert(function *(next) {
  const start = new Date();
  yield next;
  const ms = new Date() - start;
  console.log(`${this.method} ${this.url} - ${ms}ms`);
}));
```

## Upgrading middleware

You will have to convert your generators to async functions with the new middleware signature:

```js
app.use(async (ctx, next) => {
  const user = await Users.getById(this.session.user_id);
  await next();
  ctx.body = { message: 'some message' };
})
```

Upgrading your middleware may require some work. One migration path is to update them one-by-one.

1. Wrap all your current middleware in `koa-convert`
2. Test
3. `npm outdated` to see which koa middleware is outdated
4. Update one outdated middleware, remove using `koa-convert`
5. Test
6. Repeat steps 3-5 until you're done

## Updating your code

You should start refactoring your code now to ease migrating to Koa v2:

- Return promises everywhere!
- Do not use `yield*`
- Do not use `yield {}` or `yield []`.
  - Convert `yield []` into `yield Promise.all([])`
  - Convert `yield {}` into `yield Bluebird.props({})`

You could also refactor your logic outside of Koa middleware functions. Create functions like
`function* someLogic(ctx) {}` and call it in your middleware as
`const result = yield someLogic(this)`.
Not using `this` will help migrations to the new middleware signature, which does not use `this`.

## Application object constructor requires new

In v1.x, the Application constructor function could be called directly, without `new` to
instantiate an instance of an application.  For example:

```js
var koa = require('koa');
var app = module.exports = koa();
```

v2.x uses es6 classes which require the `new` keyword to be used.

```js
var koa = require('koa');
var app = module.exports = new koa();
```

## ENV specific logging behavior removed

An explicit check for the `test` environment was removed from error handling.

## Dependency changes

- [co](https://github.com/tj/co) is no longer bundled with Koa.  Require or import it directly.
- [composition](https://github.com/thenables/composition) is no longer used and deprecated.

## v1.x support

The v1.x branch is still supported but should not receive feature updates.  Except for this migration
guide, documentation will target the latest version.

## Help out

If you encounter migration related issues not covered by this migration guide, please consider
submitting a documentation pull request.

repository: ivan-kleshnin/koa

repo_name: ivan-kleshnin/koa


text:
## JDrucker
Do what you do best, and outsource the rest. Make the Java do business logic only, make the SQL do data query and update. Don't let SQL statements get mixed up in Java code.

### XSQL
The 'xsql' file is a grammatical structure. Let SQL statements, like Java code, has methods, comments, structures, and support dynamic parameter replaced.

`Example In IntelliJ IDEA:`

![](https://raw.githubusercontent.com/braisdom/JDrucker/master/JDrucker/images/1.png)

`Maven:`
```xml
<dependency>
    <groupId>com.github.braisdom</groupId>
    <artifactId>JDrucker</artifactId>
    <version>1.2.0</version>
</dependency>
```

`Usage:`
```java
// Loading and caching all XSQL file at system beginning. The xsqlPath is resources path of application
JDrucker.loadXsqlFile(xsqlPath);
// Retrieving the xsql declaration from cache, and formatting the sql statment
XSQLDeclaration xsqlDeclaration = JDrucker.getXSQLDeclaration(xsqlFileName)
```

### ORM with XSQL
Coming soon

repository: braisdom/JDrucker

repo_name: braisdom/JDrucker


text:
---
layout: default
title: 'Practical Object-Oriented Design in Ruby: An Agile Primer'
authors: ['Sandi Metz']
published_date: 2012-09-5
pages: 272
isbn: '978-0321721334'
tags: ['Ruby', 'Object-Oriented Design']

owner: 'Kevin Jalbert'
location: 'Kevin Jalbert'
last_seen: 2015-02-24
---
The Complete Guide to Writing More Maintainable, Manageable, Pleasing, and Powerful Ruby Applications

Ruby's widely admired ease of use has a downside: Too many Ruby and Rails applications have been created without concern for their long-term maintenance or evolution. The Web is awash in Ruby code that is now virtually impossible to change or extend. This text helps you solve that problem by using powerful real-world object-oriented design techniques, which it thoroughly explains using simple and practical Ruby examples.

Sandi Metz has distilled a lifetime of conversations and presentations about object-oriented design into a set of Ruby-focused practices for crafting manageable, extensible, and pleasing code. She shows you how to build new applications that can survive success and repair existing applications that have become impossible to change. Each technique is illustrated with extended examples, all downloadable from the companion Web site, poodr.info.

The first title to focus squarely on object-oriented Ruby application design, Practical Object-Oriented Design in Ruby will guide you to superior outcomes, whatever your previous Ruby experience. Novice Ruby programmers will find specific rules to live by; intermediate Ruby programmers will find valuable principles they can flexibly interpret and apply; and advanced Ruby programmers will find a common language they can use to lead development and guide their colleagues.

- This guide will help you
- Understand how object-oriented programming can help you craft Ruby code that is easier to maintain and upgrade
- Decide what belongs in a single Ruby class
- Avoid entangling objects that should be kept separate
- Define flexible interfaces among objects
- Reduce programming overhead costs with duck typing
- Successfully apply inheritance
- Build objects via composition
- Design cost-effective tests
- Solve common problems associated with poorly designed Ruby code

repository: kevinjalbert/bookcase

repo_name: kevinjalbert/bookcase


text:
Overview
--------

This directory contains all of the files needed to build under Windows.
Currently we build using cmake and MSVC 2015 and above.

Prerequisites
-------------

1. Boost C++ library installed to a default location on the machine

Basic Build
-----------

To build the client library

1. Open a new Visual Studio Command Prompt.
2. Navigate to the ds3_c_sdk directory.
3. Run the following command: `cmake -G "Visual Studio 14 2015"`
4. Either open the resulting 'libds3.sln' in Visual Studio and build it from
  there, or run the command 'msbuild libds3.sln' from the command prompt.
  This should build the libds3 library, which is placed in the directory '<root of repo>/win32/output/bin'

Unit Tests
----------

1. Open a new Visual Studio Command Prompt.
2. Navigate to the ds3_c_sdk/test directory.
3. Run the following command: `cmake -G "Visual Studio 14 2015"`
4. Either open the resulting 'libds3_tests.sln' in Visual Studio and build it
  from there, or run the command 'msbuild libds3_tests.sln' from the command
  prompt. This should build the libds3 library, which is placed in the directory
  '<root of repo>/tests/bin'

Dependencies
------------

The SDK depends upon several open source libraries. For convenience we
redistribute these dependencies in the `/win32/deps/install` directory,
except for the Boost library headers.

To re-build the dependencies, follow the following procedure:

1. Delete the built dependency directory at `/win32/deps/install`.
2. Download and extract the dependency library packages.
   * The Unix shell script at `/win32/deps/build/download_and_unzip.sh` can do
     this for you, but you don't strictly need to use it. You can also manually
     download the URLs and extract using whatever utility you like. Note that
     the glib package must be extracted to `/win32/deps/build/prebuilt`.
3. The Windows batch file `/win32/deps/install.bat` compiles and installs the
   dependencies into the `/win32/deps/install` directory. It executes the
   Visual Studio 2012 Command Prompt environment script, so if you're using a
   different version you'll have to modify the Visual Studio install path inside
   of `install.bat`.


text:
# Rating

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** |  | [default to null]
**aggregate** | [**RatingAggregate**](RatingAggregate.md) |  | [optional] [default to null]
**ratedAt** | [**Date**](Date.md) |  | [optional] [default to null]
**myRating** | **string** | The rating. The type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar. | [optional] [default to null]

repository: Alfresco/alfresco-js-api

branch_name: refs/heads/develop

gha_language: TypeScript

repo_name: Alfresco/alfresco-js-api


text:
# 🎥 Anicoto documentation

Anicoto (**Ani**mation**Con**troller **to**olkit) enriches your developing expierience with Flutter's AnimationController.

## Basic usage pattern

With Anicoto you can simply add an `AnimationController` just by adding `AnimationMixin` to your stateful widget.

@code tool/templates/code/anicoto/basic.dart

💪 The `AnimationMixin` generates a preconfigured AnimationController as  `controller`. You can just use it. No need to worry about initialization or disposing.

## Shortcuts for AnimationController

Anicoto enriches the `AnimationController` with four convenience functions:

- `controller.play()` plays animation and stops at the end.

- `controller.playReverse()` plays animation reversed and stops at the start.

- `controller.loop()` repeatly plays the animation from start to the end.

- `controller.mirror()` repeatly plays the animation forward, then backwards, then forward and so on.

Each of these methods take an optional `duration` named parameter to configure your animation action within one line of code.

@code tool/templates/code/anicoto/shortcuts.dart

You can use these methods nicely along the already existing `controller.stop()` and `controller.reset()` methods.

## Create multiple AnimationController

With multiple AnimationController you can have many parallel animations at the same time.

Anicoto's `AnimationMixin` enhances your **state class** with a method `createController()` to create multiple **managed\*** AnimationController. *("Managed" means that you don't need to care about initialization and disposing.)*

### Create a managed AnimationController

First create a class variable of type `AnimationController`. Then inside the `initState() {...}` method call `createController()`. That's all.

@code tool/templates/code/anicoto/managed1.dart

### Create many managed AnimationController

Anicoto allows you to have as many AnimationController you want. Behind the scenes it keeps track of them.

@code tool/templates/code/anicoto/managed2.dart

branch_name: refs/heads/main


text:
# Internal Implementation

Okay, let's talk about something of internal implementation.

Mainly methods are `set` and `wait`, they export from `AsyncStore` object, and `AsyncStore` object created by a factory function `createAsyncStore`.

Types seems like:

```ts
interface AsyncStore<K, V> {
  set: (sign: K, payload?: V) => void;
  wait: (...signs: K[]) => Promise<void>;
  // ...
}

function createAsyncStore(): AsyncStore<any, any>;
```

Then, there are two important storage inside the `createAsyncStore` function.

- `storeMap` - `Map<any, any>` - used to save the sign which express the completion of the async.
- `deps` - `Set<Function>` - used to save the function for check whether the `storeMap` have enough async sign.

When `set` invoked:

1. Set async sign as the key to the `storeMap`.
2. Invoke every function in the `deps`.

When `wait` invoked:

1. New a `Promise`.
2. Set a function into `deps`, which check `storeMap` whether has all of the supplied keys,
3. Once the function checked successfully, remove itself from the `deps` and resolve the `Promise`.

That's a simple `publish-subscribe`, isn't it?

See also [Main Code](../src/core.ts).

gha_license_id: MIT


text:
---
title: Storing Spinnaker Secrets in HashiCorp Vault
linkTitle: Secrets with Vault
weight: 10
aliases:
  - /docs/spinnaker-install-admin-guides/secrets-vault/
  - /docs/spinnaker-install-admin-guides/secrets/secrets-vault/
description: >
  Learn how to set up Spinnaker secrets in HashiCorp Vault.
---

>In this example, you use the default KV secret engine called `secret` and store GitHub credentials, a kubeconfig file, and a Java keystore for SAML SSO.

## Authentication with Vault servers

We currently support two methods of authentication with Vault servers.

### 1. Kubernetes service account (recommended)

You'll need to configure Vault to authenticate with Kubernetes per our [Vault Configuration Guide]({{< ref "vault-k8s-configuration" >}}) or HashiCorp's [documentation](https://www.vaultproject.io/docs/auth/kubernetes.html#configuration).

Note: If multiple clusters need to access the same Vault server, you'll need to use the [-path flag](https://www.vaultproject.io/docs/commands/auth/enable.html#usage) and give each cluster a different path name. This becomes `<cluster auth path>` in the example below. If using just one cluster, you can use the default `vault auth enable kubernetes` command, in which case your path will be `kubernetes`.

After configuring authentication on the Vault side, use the following configuration to enable Vault secrets in Spinnaker:

{{< tabs name="serviceAccount" >}}
{{% tab name="Operator" %}}

Add the following snippet to the `SpinnakerService` manifest:

```yaml
apiVersion: spinnaker.armory.io/{{< param operator-extended-crd-version >}}
kind: SpinnakerService
metadata:
  name: spinnaker
spec:
  spinnakerConfig:
    config:
      armory:
        secrets:
          vault:
            enabled: true
            authMethod: KUBERNETES   # Method used to authenticate with the Vault endpoint. Must be either KUBERNETES for Kubernetes service account auth or TOKEN for Vault token auth. The TOKEN method will require a VAULT_TOKEN environment variable set for Operator and the services.
            url: <Vault server URL>:<port, if required> # URL of the Vault endpoint from Spinnaker services.
            role: <Vault role> # (Applies to KUBERNETES authentication method) Name of the role against which the login is being attempted.
            # path: <k8s cluster path> (Optional; default: kubernetes) Applies to KUBERNETES authentication method) Path of the kubernetes authentication backend mount. Default is "kubernetes"
```
{{% /tab %}}
{{% tab name="Halyard" %}}

```bash
hal armory secrets vault enable
hal armory secrets vault edit \
    --auth-method KUBERNETES \
    --url <Vault server URL>:<port if required> \
    --role <Role in Vault> \
    --path <k8s cluster path> # Optional.default is kubernetes
```

{{% /tab %}}
{{< /tabs >}}

### 2. Token authentication

This method is not recommended, but it is supported if you choose to use it. We recommend this for testing and development purposes only. For token authentication, you need to have a `VAULT_TOKEN` environment variable set in the Halyard container of the Operator pod (or in the Halyard machine if using plain Halyard) as well as each of the services.

Use the following configuration to enable Vault secrets using token auth:

{{< tabs name="token" >}}
{{% tab name="Operator" %}}

Add the following snippet to the `SpinnakerService` manifest:

```yaml
apiVersion: spinnaker.armory.io/{{< param operator-extended-crd-version >}}
kind: SpinnakerService
metadata:
  name: spinnaker
spec:
  spinnakerConfig:
    config:
      armory:
        secrets:
          vault:
            enabled: true
            authMethod: TOKEN                           # Method used to authenticate with the Vault endpoint. Must be either KUBERNETES for Kubernetes service account auth or TOKEN for Vault token auth. The TOKEN method will require a VAULT_TOKEN environment variable set for Operator and the services.
            url: <Vault server URL>:<port if required> # URL of the Vault endpoint from Spinnaker services.
```

{{% /tab %}}
{{% tab name="Halyard" %}}

```bash
hal armory secrets vault enable
hal armory secrets vault edit \
    --auth-method TOKEN \
    --url <Vault server URL>:<port if required>
```
{{% /tab %}}
{{< /tabs >}}

## Configuring the Operator to use Vault secrets

If you are using the Spinnaker Operator, set up a custom Halyard configuration per [this section]({{< ref "operator#custom-halyard-configuration" >}}) with this content:

```yaml
secrets:
  vault:
    enabled: true
    url: <Vault server URL>
    authMethod: KUBERNETES
    role: <Vault role>
    path: <k8s cluster path>
```

Once you've mounted your `ConfigMap` to the `spinnaker-operator` deployment, it will restart the Halyard container with your Vault config.

## Configuring Halyard to use Vault secrets

Halyard will need access to the Vault server in order to decrypt secrets for validation and deployment. While the Spinnaker services are configured through `~/.hal/config`, the Halyard daemon has its own configuration file found at `/opt/spinnaker/config/halyard.yml`. The contents of your file may look different than this example, but just make sure to add the secrets block somewhere at the root level.

### Halyard locally or in Docker
If you're running Halyard locally, you can use Token auth method. Set your `VAULT_TOKEN` environment variable and add the secrets block to `halyard.yml` like so:

```yaml
halyard:
  halconfig:
    ...

spinnaker:
  artifacts:
    ...

secrets:
  vault:
    enabled: true
    url: <Vault server URL>
    authMethod: TOKEN
```

Then, restart the daemon if this is the first time you are configuring the Token auth method:

```bash
hal shutdown
```
Your next hal command automatically starts the daemon if you're running Halyard locally. If it's running within a Docker container, mount the volume containing the updated `halyard.yml` and restart the container.

### Halyard in Kubernetes
Or if you're running Halyard in Kubernetes, you can have Halyard use Kubernetes auth:
```yaml
halyard:
  halconfig:
    ...

spinnaker:
  artifacts:
    ...

secrets:
  vault:
    enabled: true
    url: <Vault server URL>
    authMethod: KUBERNETES
    role: <Vault role>
    path: <k8s cluster path>
```
Restart the pod so that Halyard restarts with your new config.

## Storing secrets
To store a file, simply prepend the file path with `@`. It accepts relative paths but cannot resolve `~`:

```bash
vault kv put secret/spinnaker/kubernetes config=@path/to/kube/config
```
The command above stores a single key-value pair at the `secret/spinnaker/kubernetes` path. **Any updates to that path will replace the existing values even if using a different key!** In order to store multiple secrets at the same path, it must be done in a single command, like so:
```bash
vault kv put secret/spinnaker/github password=<password> token=<token>
```
Otherwise, just store different secrets at different paths, like we're doing in these examples.

Make sure to base64 encode any binary files:
```bash
base64 -i saml.jks -o saml.b64
vault kv put secret/spinnaker/saml<EMAIL_ADDRESS>```

## Referencing secrets

Now that secrets are safely stored in Vault, reference them in config files with the following syntax:

```yaml
encrypted:vault!e:<secret engine>!p:<path to secret>!k:<key>!b:<is base64 encoded?>
```

### Parameters
Parameters can be provided in any order.

- `!`: **required** is used as a delimiter between parameters
- `e`: **required** Vault's Secret Engine.
- `p`: **required** Path to your secret, ex: `spinnaker/github`
- `k`: **required** Key of the secret.
- `b`: **optional** If the value is a base64 encoded value or file, set this to `true`

Example of how it's used in your YAML configs
```yml
github:
  password: encrypted:vault!e:secret!p:spinnaker/github!k:password

kubernetes:
  kubeconfigFile: encrypted:vault!e:secret!p:spinnaker/kubernetes!k:config

gate:
  javaKeyStoreBinary: encrypted:vault!e:secret!p:spinnaker/saml!k:base64keystore!b:true
```

repository: dev-chulbuji/docs

repo_name: dev-chulbuji/docs


text:
These documents are in an extremely rough state, not suitable for inclusion in the main guide yet.

<!-- MarkdownTOC depth=4 autolink=true bracket=round -->

- [More Formatting Rules?](#more-formatting-rules)
    - [Open braces on the same line](#open-braces-on-the-same-line)
    - [Closing braces always on their own line](#closing-braces-always-on-their-own-line)
    - [Prefer: param() begin, process, end](#prefer-param-begin-process-end)
- [Formatting](#formatting)
    - [Never use format cmdlets in functions and scripts](#never-use-format-cmdlets-in-functions-and-scripts)
    - [Ship Format Files When Outputting Custom Objects](#ship-format-files-when-outputting-custom-objects)
- [Using The .Net Framework](#using-the-net-framework)
    - [Use RequiredAssemblies rather than Add-Type](#use-requiredassemblies-rather-than-add-type)
    - [Use Add-Type rather than Reflection](#use-add-type-rather-than-reflection)
    - [Use Add-Type for small classes or PInvoke calls](#use-add-type-for-small-classes-or-pinvoke-calls)
    - [Prefer shipping binaries over large compilations](#prefer-shipping-binaries-over-large-compilations)
- [Comment Based Help](#comment-based-help)
    - [Always ship a about_ModuleName with modules](#always-ship-a-about_modulename-with-modules)
- [Performance](#performance)
    - [Prefer language features over cmdlets](#prefer-language-features-over-cmdlets)
    - [Know when to use .Net](#know-when-to-use-net)
- [Error Handling](#error-handling)
- [General Design Principles](#general-design-principles)
    - [Use custom objects](#use-custom-objects)
    - [Scripts vs Functions](#scripts-vs-functions)
    - [Always write CmdletBinding](#always-write-cmdletbinding)
    - [Prefer PipelineByPropertyName parameters.](#prefer-pipelinebypropertyname-parameters)
    - [Specify aliases for pipeline binding](#specify-aliases-for-pipeline-binding)
    - [Never forget the Common Parameters](#never-forget-the-common-parameters)
    - [Specify positional parameters, but don't use them](#specify-positional-parameters-but-dont-use-them)
    - [Specify short aliases, but don't use them](#specify-short-aliases-but-dont-use-them)
    - [Never specify Default values for mandatory parameters](#never-specify-default-values-for-mandatory-parameters)
    - [Always specify HelpText for mandatory parameters](#always-specify-helptext-for-mandatory-parameters)
    - [Use PsCmdlet.ThrowTerminatingError rather than throw](#use-pscmdletthrowterminatingerror-rather-than-throw)
    - [Use PsCmdlet.WriteError rather than Write-Error](#use-pscmdletwriteerror-rather-than-write-error)
    - [Use SupportsShouldProcess when appropriate](#use-supportsshouldprocess-when-appropriate)
    - [Modules ARE the Best Practice](#modules-are-the-best-practice)
    - [Use RequiredModules](#use-requiredmodules)
    - [Persisting Configuration](#persisting-configuration)
    - [Provide aliases in your modules](#provide-aliases-in-your-modules)
- [GOTCHAS](#gotchas)
    - [Beware string concatenation with +](#beware-string-concatenation-with-)
    - [Beware -match and -like](#beware--match-and--like)
    - [Beware -contains and -in](#beware--contains-and--in)

<!-- /MarkdownTOC -->

### More Formatting Rules?

#### Open braces on the same line
Code folding is nicer in many editors.

#### Closing braces always on their own line
Because that's how they're supposed to be!

#### Prefer: param() begin, process, end
That's the order PowerShell will execute it in

### Formatting

#### Never use format cmdlets in functions and scripts
#### Ship Format Files When Outputting Custom Objects

### Using The .Net Framework

#### Use RequiredAssemblies rather than Add-Type
#### Use Add-Type rather than Reflection
Avoid using `[System.Reflection]` to load assemblies when possible. Particularly avoid `LoadWithPartialName` (specify the full name instead).

#### Use Add-Type for small classes or PInvoke calls
TODO: Is this better than PowerShell Classes, for compatibility?

#### Prefer shipping binaries over large compilations
With PowerShell 5, security is tighter, and compiling code in memory will be frowned upon. Now that we have PowerShellGet and the PowerShell Gallery, there are few reasons 's no reason to avoid binaries.

TODO: Discuss: when does embedding C# code makes sense more sense than just compiling it every time?

### Comment Based Help

#### Always ship a about_ModuleName with modules

TODO
Discuss: Add a blank line between comment based help and function declaration?
Discuss: Minimum acceptable comment based help: Synopsis, Parameters, and an example for each parameter set (plus pipeline examples if you can contrive one)
Discuss: Benefits of MAML help files
Discuss: Other reasons to write about_topics

### Performance

#### Prefer language features over cmdlets
Prefer foreach(){} over ForEach-Object
Prefer .foreach and .where over cmdlets
Prefer functions with process blocks over ForEach-Object

#### Know when to use .Net
Prefer writing wrapper functions to just calling .Net APIs
Discuss: System.IO file loading vs Get-Content (large files)
Discuss: Other examples of .Net API calls that are clearly faster?
Discuss: Casting for creating objects

### Error Handling

TODO
Discuss: Avoid depending on `$?` -- why?
Discuss: Never use `$Error` in scripts (always use -ErrorVariable)
Discuss: Interactively, always copy $Error[0] to $e or something

### General Design Principles

#### Use custom objects
Discuss: Add-Type vs PowerShell classes vs creating PSCustomObjects
Discuss: Casting for creating objects
Discuss: PSTypeNames and formatting rules

#### Scripts vs Functions
Discuss: In PowerShell 3+, performance is such that there's very little penalty for using scripts.
Discuss: In PowerShell 3+, module autoloading means there's no discoverability penalty for writing functions (if you put them in a module) instead (except loading sets of them at a time).
Discuss: During development, always write scripts, which are automatically re-parsed if you edit the file.

#### Always write CmdletBinding

Let's just get this out of the way: all of your scripts should start life as this snippet:

```
[CmdletBinding()]param()
process{}
end{}
```

You can always ignore one of the blocks, and add parameters and such, but you should never write a script without CmdletBinding, and you should never write one without at least considering making it take pipeline input

#### Prefer PipelineByPropertyName parameters.
Discuss: This allows the most flexibility: piping objects and using scriptblocks to shape it for parameters. Unless you absolutely need to write a `begin` block and use this parameter in it, you probably should accept it on the pipeline.

Discuss: There is some testing overhead involved in that decision.

Discuss: You MUST do all your work in the process block if you do this.

#### Specify aliases for pipeline binding
You can use aliases to map parameters to property names of objects which might be piped to you while still keeping your parameter names clear and meaningful.

#### Never forget the Common Parameters
Particularly when splatting PSBoundParameters to the next function, if that function isn't `[CmdletBinding()]` you must remember to strip the common parameters if they're present.

#### Specify positional parameters, but don't use them
When writing at the command line, positional parameters are a blessing, but they can be confusing for future readers. You should always expose your parameters positionally when it makes sense, but you should rarely share a script that pases parameters positionally.

#### Specify short aliases, but don't use them
Again, for the sake of typing, it's particularly useful if you can provide two-letter aliases for each of your parameters such that every parameter has a two-letter or less name which is unique.

#### Never specify Default values for mandatory parameters
It doesn't do anything, and it confuses future readers.

#### Always specify HelpText for mandatory parameters
When prompted for a mandatory parameter, a user can request HelpText, but can't look at the documentation. It's frequently useful to duplicate at least the first sentence or two of the parameter help.

```
[Parameter(Position=1, Mandatory=$true, ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true, HelpText='The name of the file to read')]
[Alias('PSPath','FullName','Path')]
[String]$File
```

#### Use PsCmdlet.ThrowTerminatingError rather than throw
#### Use PsCmdlet.WriteError rather than Write-Error
Discuss: These need example output to explain why they're better
Discuss: a common template (from the Microsoft team) for throwing errors

```
# Utility to throw an errorrecord
function ThrowError
{
    param
    (
        [parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [System.Management.Automation.PSCmdlet]
        $CallerPSCmdlet,

        [parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [System.String]
        $ExceptionName,

        [parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [System.String]
        $ExceptionMessage,

        [System.Object]
        $ExceptionObject,

        [parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [System.String]
        $ErrorId,

        [parameter(Mandatory = $true)]
        [ValidateNotNull()]
        [System.Management.Automation.ErrorCategory]
        $ErrorCategory
    )

    $exception = New-Object $ExceptionName $ExceptionMessage;
    $errorRecord = New-Object System.Management.Automation.ErrorRecord $exception, $ErrorId, $ErrorCategory, $ExceptionObject
    $CallerPSCmdlet.ThrowTerminatingError($errorRecord)
}
```

#### Use SupportsShouldProcess when appropriate
Discuss: when is this critical (-whatif) and optional (-confirm_
Discuss: when should you call PSCmdlet.ShouldProcess vs PSCmdlet.ShouldContinue (-Force)

```
[CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact="Medium")]
param([Switch]$Force)

$RejectAll = $false;
$ConfirmAll = $false;

foreach($file in ls) {

   if($PSCmdlet.ShouldProcess( "Removed the file '$($file.Name)'",
                               "Remove the file '$($file.Name)'?",
                               "Removing Files" )) {

      if($Force -Or $PSCmdlet.ShouldContinue("Are you REALLY sure you want to remove '$($file.Name)'?", "Removing '$($file.Name)'", [ref]$ConfirmAll, [ref]$RejectAll)) {
         "Removing $File"

      }
   }
}
```

#### Modules ARE the Best Practice
Discuss: Scope isolation, hiding helper functions, sharing state between functions
Discuss: Organizing related functions
Discuss: Discoverability, Packaging, Sharing
Discuss: Dependency Management, Versioning
Discuss: Internationalization

#### Use RequiredModules
The problems with this have gone away with autoloading, and this is the only way to let PowerShellGet manage dependencies for you.

#### Persisting Configuration
My choice: Configuration module. Otherwise, use clixml (or XAML) to persist to AppData (TEST: you shouldn't store configuration in your module folder, as it may not survive upgrades (in PowerShell 3 & 4 there was no side-by-side loading))

#### Provide aliases in your modules
You should feel free to create and use aliases within your modules. In some cases, you can even improve readability by using an alias without the verb, or shortening command names.

For exported aliases, follow the guidance of Microsoft ("ip" for import, "s" for set, "g" for get, "r" for remove, etc.), make up somethign for your nouns.

Use `New-Alias ... -ErrorAction SilentlyContinue` to avoid overwriting existing aliases.

### GOTCHAS

#### Beware string concatenation with +
You should always wrap this with parentheses, because otherwise it can break (e.g. when passing a string as a parameter.

#### Beware -match and -like
They quietly cast objects to strings (or arrays of strings)

#### Beware -contains and -in
They work on ARRAYS not strings

   Add-TextSlide "Use Language Features" @(     # Choose Language over Cmdlets
      ,"DO NOT pass collections to ForEach-Object"
      ,"INSTEAD use the language foreach(){}"
      ,"EXCEPTIONS:"
      ,"`tYou're generating output"
      ,"`tYou're modifying the collection"
      ,"RATIONALE:"
      ,"`tNamed variables are easier"           # Easier to edit + harder to forget
      ,"`tIt's much faster"                     # Up to 2x faster
   )
   Add-TextSlide "Understand .Net"        @(    # You should understand the .Net underpinings
      ,"AVOID appending to arrays in a loop"
      ,"INSTEAD assign output from the loop"
      ,"EXCEPTIONS:"
      ,"`tAppending to multiple collections"
      ,"`tUsing Lists instead of arrays"
      ,"RATIONALE:"
      ,"`tCopying is slow"
      ,"`tPipeline output uses ArrayList"
      ,"`nEasier to read and understand"
   )
   Add-TextSlide "Understand .Net"        @(    # You should understand the .Net underpinings
      ,"AVOID appending to strings"
      ,"INSTEAD assign output from the loop"    # Use $OFS
      ,"EXCEPTIONS:"
      ,"`tWhen it's really short"
      ,"`tWhen it's a short loop"
      ,"RATIONALE:"
      ,"`tCopying is slow!"                     # Remember:
      ,"`tJoin strings with $OFS"
      ,"`nEasier to read and understand"
   )
   Add-TextSlide "Single Output Types" @(       # Comprehension
      ,"AVOID mixing output types"
      ,"INSTEAD Write-Host or Write-Warning"    # I've been seeing code using 'echo' to print text and THEN having the output.
      ,"You can also use -Verbose or -Quiet"    # Use Write-Verbose, since you're CmdletBinding, that way you can turn it off!
      ,"RATIONALE:"
      ,"Pipelines and assignments"              # Obviously you shouldn't if you echo or output text along with your objects
      ,"This should go without saying"
   )
   Add-TextSlide "Strongly Type Parameters" @(  # Be strongly typed on your inputs when you should be.
      ,"Prefer strongly typed inputs"           # Stops errors before they start (literally)
      ,"Avoid String with ParameterSets"        # Avoid String because PowerShell will cast anything to it.
      ,"Always be checking"                     # Strong Types on parameters keep you safe :)
      ,"When Passing on Parameters"             # If you're accepting a parameter which you will pass directly to another command, you should be at least as strongly typed as the command you're calling. If you're going to Test-Collection -ComputerName $InputObject ... make sure that your Param block says: [String[]]$InputObject ...
      ,"EXCEPTIONS:"
      ,"`tMultiple types are acceptable"        # When a parameter could be passed as either of two different types and you don't want to overload the function with a different parameter NAME to create a new parameterset.
      ,"RATIONALE:"
      ,"`tUsers don't have to guess"            # This stuff shows up in the man pages
      ,"`tScripts will fail early!"             # Better early than often
   )
   Add-TextSlide "Output Formatting" @(
      ,"Don't format function output. Ever"
      ,"INSTEAD:"
      ,"`tOffer a -Formatted parameter"
      ,"`tInclude formats.ps1xml in module"
      ,"`tPSTypeNames works!"
   )
   Add-TextSlide "Output Formatting 2" @(
      , "Only output one kind of thing"         # PowerShell buffers output and results are weird otherwise
      , "Otherwise, Name Appropriately"         # When you have a really good reason, make it clear in your function name that you're output is mixed
      , "RATIONALE:"
      , '&{ $MyInvocation | gm' +               # The output of this (and many variations) will convince you of the buffering
        'write-host "----------"' +
        '$MyInvocation | gm | fl }'
      , '&{ ls | gm' +                          # The output of this (and any variations) will convince you not to mix output types
        'write-host "----------"' +
        'ls }'
   )

   Add-TextSlide "Don't Duplicate Work"         # Don't sort things that are already sorted
   Add-TextSlide "Logging from Scripts"         # Logging from scripts (best and worst ways to do it)
   Add-TextSlide "Code-Signing"                 # Code-signing, security, and multiple developers
   Set-Slide 0

repository: eedrah/PSStyleGuide

repo_name: eedrah/PSStyleGuide


text:
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]

COVID 19 India Data Analysis using Python

## Table of Contents

  Contents

      Background

Summery

Project Objective

Project Data Source

      Findings

Reference

License

## Background

![product-screenshot]

The first case of COVID-19 in India, which originated from China, was reported on 30 January 2020. India currently has the largest number of confirmed cases in Asia, and has the second-highest number of confirmed cases in the world after the United States with more than 10.3 million reported cases of COVID-19 infection and more than 154,000 deaths as of February 2, 2021. The per day cases peaked mid-September in India with over 90,000 cases reported per day and have since come down to below 15,000 as of 2021 January.
### Summery

The COVID-19 pandemic is the defining global health crisis of our time and the greatest global humanitarian challenge the world has faced since World War II. The virus has spread widely, and the number of cases is rising daily as governments work to slow its spread. India has moved quickly, implementing a proactive, nationwide, lockdown, with the goal of flattening the curve and using the time to plan and resource responses adequately.

### Project Objective
The goal of this project is to use techniques of statistical analysis to visualize and estimate impact of COVID-19 in India from different aspects i.e
how the virus has affected people from different regions, age groups etc. In a nutshell the visualizations will help to understand COVID-19 situation in India in a detailed manner.
### Project Data Source
* Raw data about COVID-19 cases at daily level is collected from [covid19india.org's API.](https://api.covid19india.org/)
* Statewise data as well as district-wise data has also been collected from [covid19india.org's API.](https://api.covid19india.org/)
* population data is collected from [Wikipedia.](https://en.wikipedia.org/wiki/Demographics_of_India)
* Coordinates of indian States obtained from [Geohacker's Github repository.](https://github.com/geohacker/india)

### Findings
![Figure-1]
**Figure1** shows cumulative sum of all confrimed, recovered, deceased and active cases through line chart which to a good approximation, are distributed over the days since origination.

![Figure-2]

**Figure2** we see the current situation in India. It shows that more than 95% patients who contracted COVID-19 has recovered already.

![Figure-3]

**Figure3** shows through histogram that which age group has most number of COVID-19 cases. As we can see aapeople between 20-40 has contracted the disease most.

![Figure-4]

**Figure4** indicate that state with the darkest color i.e Maharashtra and other southern states has had chunk number of confirmed cases.

![Figure-5]

**Figure5**, we can see that now  Kerala, floowed by maharashtra has most number of active cases.

## Reference

1. https://www.kaggle.com/sudalairajkumar/covid19-in-india
2. https://www.covid19india.org/

[contributors-shield]: https://img.shields.io/github/contributors/an-chowdhury/COVID-19-India-Case-Study?style=for-the-badge
[contributors-url]: https://github.com/an-chowdhury/COVID-19-India-Case-Study/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/an-chowdhury/COVID-19-India-Case-Study?style=for-the-badge
[forks-url]: https://github.com/an-chowdhury/COVID-19-India-Case-Study/network/members
[stars-shield]: https://img.shields.io/github/stars/an-chowdhury/COVID-19-India-Case-Study?style=for-the-badge
[stars-url]: https://github.com/an-chowdhury/COVID-19-India-Case-Study/stargazers
[issues-shield]: https://img.shields.io/github/issues/an-chowdhury/COVID-19-India-Case-Study?style=for-the-badge
[issues-url]: https://github.com/an-chowdhury/COVID-19-India-Case-Study/issues
[license-shield]: https://img.shields.io/github/license/an-chowdhury/COVID-19-India-Case-Study?style=for-the-badge
[license-url]: https://github.com/an-chowdhury/COVID-19-India-Case-Study/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://www.linkedin.com/in/ankan-chowdhury-00bb3b141/
[product-screenshot]: https://i.imgur.com/HdKy1CA.png
[Figure-1]: Insights/India%20Cumulative%20Curve.png
[Figure-2]: Insights/Current%20Situation.jpg
[Figure-3]: Insights/Age%20Group%20Analysis.jpg
[Figure-4]: Insights/Heatmap-India.png
[Figure-5]: Insights/Active%20Cases.png


text:
# Indexing the transcritpome

## Introduction

The bash script ``mkref.sh`` indexes the transcriptome of reference for the analysis with CellRanger's mkref. The arguments are :

1. Name you want to give to the transcritpome of reference
2. Path to the concatenated fasta
3. Path to the concatenated gtf
4. Output directory

## Usage

You can execute it through the bash script inside or outside the container :

``bash mkref.sh GRCh38_MVA_mcherry_merged /path/to/GRCh38_MVA_mcherry_merged.fa /path/to/GRCh38_MVA_mcherry_merged.gtf /path/to/output``

Or using the bash script provided to run it from outside the container. For this to work the results of the genome concatenation must be in ``/abolute/path/to/project/results`` :

``bash mkref_singularity.sh /abolute/path/to/project``


text:
# selenium-python-automation
Object: Perform web automation using selenium-python

## Requisites
```bash
pip install selenium

pip install unittest2

pip install html-testRunner
```

## Reference links
https://selenium-python.readthedocs.io/

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: lhoangphuong/selenium-python-automation

repo_name: lhoangphuong/selenium-python-automation


text:
# Image-Classifier-MobileNet-V2

## Project Description
MobileNet CNN Image classifier build on TensorFlow. Developed as a project as partial fulfillment of Udacity Nanodegree "Introduction into Machine Learning with TensorFlow".

1) train.py defines a CNN based on MobileNet-V2 in TensorFlow, trained and results in a model with about 80% accuracy.
2) predict.py rebuilds the model and predict the class of an input image

## Conclusions
- Implementing Tensorflow felt very straight forward.
- Training the MobileNet-V2 for this application was surprisingly quick (only classifier trainied).
- Performance of the model is surprisingly good.

## Project Files
- README.md: Project README
- train.py: Define and train the CNN
- label_map.json: json file containing the categories (predicted classes)
- predict.py: Rebuild the model and predict the class of an input image
- utility_functions: Utility functions for train.py and predict.py

## Data Set
https://www.tensorflow.org/datasets/catalog/overview

https://www.tensorflow.org/datasets/catalog/oxford_flowers102

## Model
The model is based on MobileNet-V2. The pretrained feature extractor is used without modifications.

The custom classifier is used instead of the pretrained classifier. The classifier has following structure:
- The hidden layers have 512 and 256 nodes respectively and use ReLU activation function
- There are dropout layers with 20% dropout rate between the hidden layers.
- The output layer has 102 nodes, as there are 102 classes, and uses Softmax activation function.

## Python Version & IDE
- Python Version: 3.7
- IDE: PyCharm

## Python Modules
- warnings
- numpy
- matplotlib.pyplot
- tensorflow
- tensorflow_datasets
- os
- tensorflow.keras.preprocessing.image import ImageDataGenerator
- tensorflow_hub
- logging
- json
- datetime
- pytz
- PIL

## Bugs
No known bugs

## Pending Tasks
Create an image pipeline using ImageDataGenerator. This will help reduce overfitting of the model, i.e., the validation accuracy will better follow the training accuracy.

## MIT License

Copyright (c) 2018 Udacity

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.


text:
# chordstransposer

**chordstransposer** helps musicians by transposing the chords in song charts.

## Basic usage example

If you know the original tone of the song you can choose a destination tone:

```python
# Transpose a song from C to Eb:
chordstransposer.transpose('C   Am   Dm  G  Gsus4/A G/B\nGod save our gracious Queen', 'C', 'Eb')

# Result:
# 'Eb   Cm   Fm  Bb  Bbsus4/C Bb/D\nGod save our gracious Queen'
```

Alternatively you can specify a number of semitones to transpose by:

```python
# Transpose the song 3 semitones below (a minor third):
chordstransposer.transpose_by('C   Am   Dm  G  Gsus4/A G/B\nGod save our gracious Queen', -3)

# Result:
# 'A   F#m   Bm  E  Esus4/F# E/G#\nGod save our gracious Queen'
```

## Song file format

The song files are just plaintext, and contain a mix of lyrics lines and chord lines, as they can be found anywhere on the internet.

For instance, this is a valid song file:

```
LOST IN THE STARS
-------------

Before Lord God made the sea and the land,
  G         G°           A-7sus      D  D+
He held all the stars in the palm of his hand
   G6/B         E7b9         A-7         A-7b5
```

_These are the first bars of Kurt Weill's [Lost in the Stars](https://www.youtube.com/watch?v=6xJ1u920c2o)_

## Installation

Using pip:

```bash
pip install chordstransposer
```

## About the harmony

**transposer** tries to follow as much as possible harmonic rules (eg. Cb instead of B when necessary). These are defined in the destination scale : for instance, if you want to transpose a song to Db, then the 3rd note of the minor scale is Fb and not E. You don't need your original file to follow these rules for this to work.

However, in [traditional notation of the chords in popular music](<https://en.wikipedia.org/wiki/Chord_names_and_symbols_(popular_music)>), we avoid writing double-flat (bb) and double-sharp (x) for the sake of readability. Here, when they should appear to be perfectly correct in terms of harmony, the double-flat and double-sharp are transposed to their most simple equivalent.

repository: benterris/chordstransposer

repo_name: benterris/chordstransposer


text:
---
childof: student-researcher-bios
title: Gillian Slee
abbrev: gslee
position: Graduate Research Assistant
date: 2017-11-26T03:46:25.603Z
image: /images/bios/gslee_full.jpg
thumb: /images/bios/gslee_thumb.jpg
weight: 25
---
Gillian Slee is a first-year doctoral student in Sociology and Social Policy at Princeton University. She graduated from Harvard College in 2016 with a degree in Social Studies and a minor in Psychology. In 2017, Gillian earned her M.Phil. degree in Criminology at the University of Cambridge where she was a Herchel Smith Harvard Scholar. For her undergraduate thesis, she conducted an ethnographic study of public defenders and their clients in New York City’s criminal courts. Her master’s thesis explored legitimacy and legitimation in the British context and investigated how power-holders justified their authority in magistrates’ court. Gillian’s current research focuses on urban poverty, criminal justice, policy, and ethnography. At the Eviction Lab, Gillian is exploring the consequences of eviction on various neighborhood-level outcomes, including voting.


text:
---
layout: post
title: Post-mortem on downtime experienced by BLAST-related tools
subtitle:
categories: announcement
tags:
- site
- postmortem
author: Terry Mun
---
Over the course of the weekend of November 17–18 of 2018 and the subsequent working week that follows, all BLAST-related tools on *Lotus* Base became inaccessible. The affected modules were:

- *Lotus* BLAST, which runs SequenceServer v1.0.9 as a Passenger app
- The Sequence Retrieval tool (SeqRet), which relies on being able to sniff out BLAST database metadata by executing the `blastdbcmd` binary

### Diagnosing the issue

The issue was two-fold:

1. SequenceServer was running as a Phusion Passenger app initialized by an arbitrarily named user via the `PassengerUser` option in the `httpd.conf` file. The user should have been `apache`, so that the processes spawned by Apache will have the correct read permissions to access all app binaries.
2. The Sequence Retrieval tool calls an internal API endpoint which relies on being able to execute the `blastdbcmd` binary. However, since the binary belongs to a different user group, the API wil fail and return an empty array: this causes PHP to throw an error when attempting to display BLAST database-related metadata.

### What was done to fix it?

By updating the read permissions for the BLAST binaries and changing the `PassengerUser` for Sequence Server fixes the issue.

branch_name: refs/heads/dev

gha_language: JavaScript


text:
# Humidicutis helicoides (A.M. Young) A.M. Young SPECIES

#### Status
ACCEPTED

#### According to
Index Fungorum

#### Published in
Fungi of Australia 159 (2005)

#### Original name
Hygrocybe helicoides A.M. Young

### Remarks
null


text:
# Contribution Guidelines

## Table of Contents

  - [Contribution Guidelines](#contribution-guidelines)
  - [Introduction](#introduction)
  - [Bug reports](#bug-reports)
  - [Discuss your design](#discuss-your-design)
  - [Code review](#code-review)
  - [Styleguide](#styleguide)
  - [Design guideline](#design-guideline)
  - [API v1](#api-v1)
  - [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco)
  - [Release Cycle](#release-cycle)

## Introduction

This document explains how to contribute changes to the Kudoo project.
It assumes you have followed the
installation instructions.
Sensitive security-related issues should be reported to
[jtrollip@kudoo.io](mailto:jtrollip@kudoo.io).

## Bug reports

Please search the issues on the issue tracker with a variety of keywords
to ensure your bug is not already reported.

If unique, [open an issue](https://github.com/kudoo-cloud/kudoo/issues/new)
and answer the questions so we can understand and reproduce the
problematic behavior.

To show us that the issue you are having is in Kudoo itself, please
write clear, concise instructions so we can reproduce the behavior—
even if it seems obvious. The more detailed and specific you are,
the faster we can fix the issue. Check out [How to Report Bugs
Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html).

Please be kind, remember that Kudoo comes at no cost to you, and you're
getting free help.

## Discuss your design

The project welcomes submissions. If you want to change or add something,
please let everyone know what you're working on—[file an issue](https://github.com/kudoo-cloud/kudoo/issues/new)!
Significant changes must go through the change proposal process
before they can be accepted. To create a proposal, file an issue with
your proposed changes documented, and make sure to note in the title
of the issue that it is a proposal.

This process gives everyone a chance to validate the design, helps
prevent duplication of effort, and ensures that the idea fits inside
the goals for the project and tools. It also checks that the design is
sound before code is written; the code review tool is not the place for
high-level discussions.

## Code review

Changes to Kudoo must be reviewed before they are accepted—no matter who
makes the change, even if they are an owner or a maintainer. We use GitHub's
pull request workflow to do that. And, we also use [LGTM](http://lgtm.co)
to ensure every PR is reviewed by at least 2 maintainers.

Please try to make your pull request easy to review for us. And, please read
the *[How to get faster PR reviews](https://github.com/kubernetes/community/blob/261cb0fd089b64002c91e8eddceebf032462ccd6/contributors/guide/pull-requests.md#best-practices-for-faster-reviews)* guide;
it has lots of useful tips for any project you may want to contribute.
Some of the key points:

* Make small pull requests. The smaller, the faster to review and the
  more likely it will be merged soon.
* Don't make changes unrelated to your PR. Maybe there are typos on
  some comments, maybe refactoring would be welcome on a function... but
  if that is not related to your PR, please make *another* PR for that.
* Split big pull requests into multiple small ones. An incremental change
  will be faster to review than a huge PR.

## Styleguide
TODO:

## Developer Certificate of Origin (DCO)

We consider the act of contributing to the code by submitting a Pull
Request as the "Sign off" or agreement to the certifications and terms
of the [DCO](DCO) and [MIT license](LICENSE). No further action is required.
Additionally you could add a line at the end of your commit message.

```
Signed-off-by: Joe Smith<EMAIL_ADDRESS>```

If you set your `user.name` and `user.email` git configs, you can add the
line to the end of your commit automatically with `git commit -s`.

We assume in good faith that the information you provide is legally binding.

## Release Cycle

We adopted a release schedule to streamline the process of working
on, finishing, and issuing releases. The overall goal is to make a
minor release every two months, which breaks down into one month of
general development followed by one month of testing and polishing
known as the release freeze. All the feature pull requests should be
merged in the first month of one release period. And, during the frozen
period, a corresponding release branch is open for fixes backported from
master. Release candidates are made during this period for user testing to
obtain a final version that is maintained in this branch. A release is
maintained by issuing patch releases to only correct critical problems
such as crashes or security issues.

Major release cycles are bimonthly. They always begin on the 25th and end on
the 24th (i.e., the 25th of December to February 24th).

During a development cycle, we may also publish any necessary minor releases
for the previous version. For example, if the latest, published release is
v1.2, then minor changes for the previous release—e.g., v1.1.0 -> v1.1.1—are
still possible.

repository: kudoo-cloud/kudoo

repo_name: kudoo-cloud/kudoo


text:
# An apparent paradox

A work in progress in semi-supervised generative classification.

Based on the paper [An Apparent Paradox: A Classifier Trained from a Partially Classified Sample May Have Smaller Expected Error Rate Than That If the Sample Were Completely Classified](https://arxiv.org/abs/1910.09189), by Daniel Ahfock and Geoff Mclachlan.

### About the Synthetic Aperture Radar (SAR) Data

The SAR data products used as input in the script [SAR_fit.R](SAR_fit.R) are [cov_chol_d10_m1_cc.Rds](cov_chol_d10_m1_cc.Rds) and [labsp_d10.Rds](labsp_d10.Rds).

Original SAR Data is available on [this Zenodo archive](https://zenodo.org/record/4008883). From there, the 2x2 log-Cholesky transformed 1-lag autocovariance matrix of each pixel (over time) in the sequence of SAR images was obtained, after down-sampling using mean aggregation within 10x10 patches of pixels. Each 2x2 log-Chol matrix was then transformed to a 3-tuple, using equation (6) from the paper [here]( https://arxiv.org/pdf/2008.03454.pdf). This processing was done within the script [R/SAR_application.R](https://github.com/frycast/kmspd/blob/master/R/SAR_application.R) in the repo [frycast/kmspd](https://github.com/frycast/kmspd).

### Tools

[`{rsar}`](https://github.com/frycast/rsar) :package: provides tools for working with radar images in `SAR_matrix` format.

[`{EMMIX}`](https://github.com/suren-rathnayake/EMMIXmfa) :package: provides tools for fitting finite mixture models via the EM algorithm.

repository: frycast/paradox

repo_name: frycast/paradox


text:
## Anope API

Each endpoint takes form encoded data and returns a JSON response.

Each endpoint requires an API key from Snoonet Staff to access.

Every endpoint accepts an optional `user_ip` parameter to specify the IP address of the user the action is being done on behalf of. Some endpoints require this parameter.

### Generic Errors

`{"error":{"id":"missing_parameters","message":"Missing required request parameters","parameters":[<MISSING_PARAMS>]},"status":"error"}` - Occurs when a required parameter is not supplied for this request

### `/register` - Register an account
#### Params (required unless specified otherwise)
- `username` - Username of the account to register
- `password` - Password to register the accouht with
- `email` _optional if forceemail=false in anope_ - The email address to associate with this account
- `source` -  A string identifying where the user is registering from, for `m_store_server`
- `user_ip` - The IP address of the user creating this account
- `ident` _optional_ - If specified, is used to populate the default access list for the new account
- `oauth` _optional_ - If set to `1`, requires that the API wrapper verify the email address against the IRC.com API. This parameter only applies to the IRC.com implementation of this API.

#### Responses
##### Success

`{"session":"<SESSION_ID>","status":"ok","verify":"<VERIFY_TYPE>","need_verify": true|false}`
- `VERIFY_TYPE` may be `mail`, `admin`, or `none`. This indicates the account verification method that is configured.

##### Errors
_Note: The `message` field is meant only to describe the error to a user, this text may change unexpectedly_

`{"error":{"id":"name_in_use","message":"This username is in use by another user and can not be registered"},"status":"error"}`

`{"error":{"id":"user_exists","message":"A user with that name is already registered"},"status":"error"}`

`{"error":{"id":"no_guest","message":"Guest nicknames may not be registered"},"status":"error"}`

`{"error":{"id":"invalid_name","message":"Username is invalid"},"status":"error"}`

`{"error":{"id":"forbidden_user","message":"This nickname is forbidden from registration"},"status":"error"}`

`{"error":{"id":"missing_email","message":"An email address is required for registration"},"status":"error"}`

`{"error":{"id":"invalid_email","message":"A valid email address is required for registration"},"status":"error"}`

`{"error":{"id":"forbidden_email","message":"This email address is forbidden"},"status":"error"}`

`{"error":{"id":"max_email","message":"This email address has reached its account limit"},"status":"error"}`

`{"error":{"id":"invalid_password","message":"That password is invalid"},"status":"error"}`

### `/confirm` - Confirm an account registration
#### Params (required unless otherwise specified)
- `session` - The `session` ID returned from the `/api/register` call
- `code` - The user's verification code for their account
- `user_ip` - The IP address of the user confirming this account

#### Responses
##### Success

`{"status":"ok"}`

##### Errors

`{"error":{"id":"no_login","message":"You are not logged in to an account"},"status":"error"}`

`{"error":{"id":"already_confirmed","message":"This account is already confirmed"},"status":"error"}`

`{"error":{"id":"wrong_code","message":"Incorrect confirmation code supplied"},"status":"error"}`

### `/login` - Begin a session for a user
#### Params (required unless otherwise specified)
- `username` - The user's username
- `password` - The user's password
- `user_ip` - The IP address of the user logging in

#### Responses
##### Success

`{"session":"<SESSION_ID>","account":"<ACCOUNT_NAME>","status":"ok","verified":true|false,"expires":3133657200}`

##### Errors

`{"error":{"id":"failed_login","message":"Invalid login credentials"},"status":"error"}`

### `/logout` - Terminate a session
#### Params
- `session` - The session to terminate

#### Responses
##### Success

`{"status":"ok"}`

#### Errors

`{"error":{"id":"no_login","message":"You are not logged in to an account"},"status":"error"}`

### `/resetpass` - Reset a password for a user
#### Params
- `account`
- `email`

#### Responses
##### Success

`{"status":"ok"}` - Returned if the password reset email was sent or the account/email don't match a valid account, meaning it will "silently" (logged internally) ignore invalid account details

#### Errors

`{"error":{"id":"mail_failed","message":"Unable to send reset email"},"status":"error"}`

### `/resetpass/confirm` - Confirm a password reset
#### Params
- `account` - Account name to reset the password for
- `code` - Confirmation code from the user
- `newpass` - Sets the new password

#### Responses
##### Success

`{"status":"ok"}`

##### Errors

`{"error":{"id":"wrong_code","message":"Invalid reset token"},"status":"error"}`

`{"error":{"id":"expired_code","message":"Expired reset token"},"status":"error"}`

`{"error":{"id":"invalid_password","message":"That password is invalid"},"status":"error"}`

### `/user/set/password` - Set the user's password
#### Params
- `session`
- `newpass`

#### Responses
##### Success

`{"status":"ok"}`

##### Errors

`{"error":{"id":"no_login","message":"You are not logged in to an account"},"status":"error"}`

`{"error":{"id":"invalid_password","message":"That password is invalid"},"status":"error"}`

### `/user/token/add` - Add an authentication token to the user's account

Authentication tokens can be used in place of passwords anywhere a password is needed

#### Params
- `session`
- `name`

#### Responses
##### Success

`{"status":"ok","token":{"token":"<AUTH_TOKEN>","name":"<TOKEN_NAME>"}}`

##### Errors

`{"error":{"id":"token_add_failed","message":"Unable to add token"},"status":"error"}`

`{"error":{"id":"tokens_disabled","message":"Token authentication appears to be disabled"},"status":"error"}`

### `/user/token/list` - List current authentication tokens on the account
#### Params
- `session`

#### Responses
##### Success

`{"status":"ok","tokens":[{"token":"<AUTH_TOKEN>","name":"<TOKEN_NAME>","id":1}]}`

##### Errors

`{"error":{"id":"tokens_disabled","message":"Token authentication appears to be disabled"},"status":"error"}`

### `/user/token/delete` - Remove an authentication token
#### Params
- `id` - Either the numeric ID or the token itself to be removed

#### Responses
##### Success

`{"status":"ok"}`

##### Errors

`{"error":{"id":"tokens_disabled","message":"Token authentication appears to be disabled"},"status":"error"}`

`{"error":{"id":"no_token","message":"No matching token found."},"status":"error"}`

### `/user/token/ping` - Prevents an authentication token from expiring
#### Params
- `session`

#### Responses
##### Success

`{"status":"ok","expires":3133657200}`

##### Errors

`{"error":{"id":"tokens_disabled","message":"Token authentication appears to be disabled"},"status":"error"}`

### `/user/tags/add` - Associates a message tag with a user's account

Authentication tags can be used in place of passwords anywhere a password is needed

#### Params
- `session`
- `name` -  Tag name.
- `value` - Tag value.

#### Responses
##### Success

`{"session":"<AUTH_TOKEN>","status":"ok"}`

##### Errors

`{"error":{"id":"no_login","message":"Login required"},"status":"error"}`

`{"error":{"id":"invalid_tag_key","message":"Tag key contains an invalid character."},"status":"error"}`

### `/user/tags/delete` - Disassociates a message tag from a user's account
#### Params
- `session`
- `name` -  Tag name.

#### Responses
##### Success

`{"session":"<AUTH_TOKEN>","status":"ok"}`

##### Errors

`{"error":{"id":"no_login","message":"Login required"},"status":"error"}`

`{"error":{"id":"no_tag","message":"No matching tag found."},"status":"error"}`

### `/user/tags/list` - Lists message tags associated with a user's account
#### Params
- `session`

#### Responses
##### Success

`{"session":"<AUTH_TOKEN>","status":"ok","tags":{"tagname":"tag value"}}`

##### Errors

`{"error":{"id":"no_login","message":"Login required"},"status":"error"}`

repository: trobotham/anope-modules

repo_name: trobotham/anope-modules


text:
# iidy (Is it done yet?) -- a CloudFormation CLI tool

(Note: this is written assuming an Unbounce developer is the reader and we
previously used Ansible for orchestrating CloudFormation.)

`iidy` improves the developer experience with CloudFormation.

* It provides immediate, readable feedback about what CloudFormation
  is doing and any errors it encounters.
* Its single binary is simpler to install than Ansible's Python
  dependencies.
* It is far simpler to learn, understand, and use. There are fewer
  moving parts and its commands map directly to CloudFormation's.
* It requires less boilerplate files and directories. 2 or 3 files vs
  5+ directories with 7+ files.
* It has simple, reliable support for AWS profiles.
* It supports the full range of CloudFormation operations, including
  _changesets_ without requiring any code beyond what is required to
  create a stack. Ansible requires additional code/configuration for
  this.
* It does some template validation, guards against common issues, and
  will be extended over time to validate our best practices and
  security policies.
* It provides seemless integration with AWS ParameterStore, our choice
  for secret management going forward and our replacement for Ansible
  Vault.
* It has bash command completion support.

`iidy` also improves the developer experience working with CloudFormation
Yaml templates. It includes an optional yaml pre-processor that:

* allows values to be imported from a range of sources, including
  local files, s3, https, ParameterStore, and environment variables.
  It parses json or yaml imports. The imported data can be stitched
  into the target template as yaml subtrees, as literal strings, or as
  single values.
* can be used to define custom resource templates that expand out
  to a set of real AWS resources. These templates can be parameterized
  and can even do input validation on the parameters. The template
  expansion and validation happens as a pre-process step prior to
  invoking CloudFormation on the rendered output.

## Pronunciation

iidy is pronounced "eye-dee", like the audience's response to Cab Calloway in Minnie the
Moocher: https://www.youtube.com/watch?v=8mq4UT4VnbE&feature=youtu.be&t=50s

## Demo
[![asciicast](https://asciinema.org/a/8rzW1WyoDxMdVJpvpYf2mHm8E.png)](https://asciinema.org/a/8rzW1WyoDxMdVJpvpYf2mHm8E)

Here's a comparison between developer experience of `iidy` and `Ansible`
when you run into errors with a CloudFormation stack:
[![asciicast](https://asciinema.org/a/jExZ5S8Pk4KzlJiufGoll0rXs.png)](https://asciinema.org/a/jExZ5S8Pk4KzlJiufGoll0rXs?t=45)

## Installation

### MacOS: Binary Install via Homebrew

Use Unbounce's custom Homebrew Tap to install iidy.  This is the preferred method for macos.

```
brew tap unbounce/homebrew-taps
brew update
brew install iidy
```

### Binary Installation on Other Platforms
```
# Grab the appropriate binary from the releases page.
wget https://github.com/unbounce/iidy/releases/download/v1.6.0-rc3/iidy-linux-amd64.zip
# or wget https://github.com/unbounce/iidy/releases/download/v1.6.0-rc3/iidy-macos-amd64.zip
unzip iidy*.zip
chmod +x iidy
mv iidy /usr/local/bin/   # or somewhere more appropriate
```

### Installation from Source

Counter-intuitively, this requires more disk space than the binary
install. You need Node 7+ and npm 4+ installed.

```
git clone git@github.com:unbounce/iidy.git
cd iidy
npm install . && npm run build # to compile our source first
ln -s $(pwd)/bin/iidy /usr/local/bin/
# or npm install -g .
```

## Usage

### Help
```
$ iidy help
iidy - CloudFormation with Confidence                    An acronym for "Is it done yet?"

Commands:

  create-stack  <argsfile>                               create a cfn stack based on stack-args.yaml
  update-stack  <argsfile>                               update a cfn stack based on stack-args.yaml
  estimate-cost <argsfile>                               estimate aws costs based on stack-args.yaml

  create-changeset           <argsfile> [changesetName]  create a cfn changeset based on stack-args.yaml
  exec-changeset             <argsfile> <changesetName>  execute a cfn changeset based on stack-args.yaml

  describe-stack      <stackname>                        describe a stack
  watch-stack         <stackname>                        watch a stack that is already being created or updated
  delete-stack        <stackname>                        delete a stack (after confirmation)
  get-stack-template  <stackname>                        download the template of a live stack
  get-stack-instances <stackname>                        list the ec2 instances of a live stack
  list-stacks                                            list all stacks within a region

  param                                                  sub commands for working with AWS SSM Parameter Store

Additional Commands:
  render <template>                                      pre-process and render cloudformation yaml template
  demo <demoscript>                                      run a demo script
  completion                                             generate bash completion script. To use: "source <(iidy completion)"

AWS Options
  --region   AWS region. Can also be set via --environment & stack-args.yaml:Region
  --profile  AWS profile.  Can also be set via --environment & stack-args.yaml:Profile
  --client-request-token  a unique, case-sensitive string of up to 64 ASCII characters used to ensure idempotent retries

Options:
  --environment, -e  used to load environment based settings: AWS Profile, Region, etc.
  --debug            log debug information to stderr
  -v, --version  show version number
  -h, --help     show help

```

### The `argsfile` (aka `stack-args.yaml`)

```
####################
# Required settings:

StackName: <string>

Template: <local file path or s3 path>

# optionally you can use the yaml pre-processor by prepending 'render:' to the filename
#Template: render:<local file path or s3 path>

####################
# Optional settings:

Region: <aws region name>

Profile: <aws profile name>

Tags: # aws tags to apply to the stack
  owner: Tavis
  environment: development
  project: iidy-docs
  lifetime: short

Parameters: # stack parameters
  key1: value
  key2: value

Capabilities: # optional list. *Preferably empty*
  - CAPABILITY_IAM
  - CAPABILITY_NAMED_IAM

NotificationARNs:
  - <sns arn>

# CloudFormation ServiceRole
RoleARN: arn:aws:iam::<acount>:role/<rolename>

TimeoutInMinutes: <number>

# OnFailure defaults to ROLLBACK
OnFailure: 'ROLLBACK' | 'DELETE' | 'DO_NOTHING'

StackPolicy: <local file path or s3 path>

ResourceTypes: <list of aws resource types allowed in the template>
  # see http://docs.aws.amazon.com/cli/latest/reference/cloudformation/create-stack.html#options

CommandsBefore: # shell commands to run prior the cfn stack operation
  - make build # for example

```

### AWS IAM Settings

`iidy` supports loading AWS IAM credentials/profiles from a) the cli
    options shown above, b) `Region` or `Profile` settings in
    `stack-args.yaml`, or c) the standard environment variables.

### Listing and Describing Live Stacks

[![asciicast](https://asciinema.org/a/l4vDhmKiTLr10oKypXRG7y1eW.png)](https://asciinema.org/a/l4vDhmKiTLr10oKypXRG7y1eW)

### Creating or Updating CloudFormation Stacks

[![asciicast](https://asciinema.org/a/8rzW1WyoDxMdVJpvpYf2mHm8E.png)](https://asciinema.org/a/8rzW1WyoDxMdVJpvpYf2mHm8E)

```
$ tree examples/hello-world
examples/hello-world
├── stack-args.yaml         # see above
├── cfn-template.yaml # a vanilla cloudformation template

$ cd examples/hello-world/

$ cat stack-args.yaml
StackName: iidy-demo
Template: ./cfn-template.yaml # details are irrelevant for the demo
Tags:
  owner: your-name
  project: iidy-demo
  environment: development
  lifetime: short

$ iidy create-stack stack-args.yaml
# ... lots of useful output about what iidy and CloudFormation are doing ...

$ iidy list-stacks | grep iidy-demo
Wed Aug 02 2017 00:41:49 CREATE_COMPLETE          iidy-demo owner=tavis, environment=development, lifetime=short, project=iidy-demo

# edit something in stack-args to demo a simple update-stack
sed s/your-name/Tavis/ stack-args.yaml > stack-args2.yaml

$ iidy update-stack stack-args2.yaml
# ... lots of useful output about what iidy and CloudFormation are doing ...

$ iidy list-stacks | grep iidy-demo
Wed Aug 02 2017 00:45:49 UPDATE_COMPLETE          iidy-demo owner=Tavis, environment=development, lifetime=short, project=iidy-demo

$ iidy describe-stack iidy-demo
# ... more details ...

$ iidy delete-stack iidy-demo
# ... confirm Yes ...

```

### Creating or Executing CloudFormation Changesets

[![asciicast](https://asciinema.org/a/fl9ss0EYyPbDtFmSCaERC2YBU.png)](https://asciinema.org/a/fl9ss0EYyPbDtFmSCaERC2YBU)

### Using Parameter Store for secrets and ARNs

Here's an example of importing a single secret from Parameter Store.
```
# example stack-args.yaml
$imports:
  dbPasswd: ssm:/staging/lp-webapp/dbPasswd
  # the ssm: prefix ^ is used to ask for a ssm:parameterstore import

StackName: iidy-demo
Template: ./cfn-template.yaml
Parameters:
  DbPasswd: !$ dbPasswd
  ...
```
See below for more on `$imports` and `includes` (i.e. the `!$` yaml tag).

You can also import the full set of parameters under a path prefix:
```
# example stack-args.yaml
$imports:
  secrets: ssm-path:/staging/lp-webapp/
  # ssm-path: prefix ^ grabs all parameters under that path
  # and makes them accessible as a key-value map.

StackName: iidy-demo
Template: ./cfn-template.yaml
Parameters:
  DbPasswd: !$ secrets.dbPasswd
  SomeOtherPasswd: !$ secrets.otherPasswd
  ...
```

## Yaml Pre-Processing
...

### Imports and Includes

```
# Example of stitching in values from another yaml file
$imports:
  # <importName>: <importSource>
  mappings: ./mappings.yaml

Mappings: !$ mappings
```

#### Import Source Options

* file
* filehash
* s3
* https
* git
* random
* environment variables
* CloudFormation stacks
* AWS SSM ParameterStore

### Working With CloudFormation Yaml

#### Custom CloudFormation Resource Types
...

### Working with *Non*-CloudFormation Yaml
`iidy` autodetects whether a Yaml document is a CloudFormation
template or not. If it's not, the CloudFormation custom resource
templates described above and some validation/normalization features
are disabled. Everything else should work as described above.

## Examples
See the examples/ directory.

## Development

iidy is coded in Typescript and compiles to es2015 Javascript using
commonjs modules (what Node uses). See the `Makefile` and the script
commands in `package.json` for details about the build process.

...

## License
MIT.

## Changelog
* [v1.6.0-rce](https://github.com/unbounce/iidy/releases/tag/v1.6.0-rc3)
  New features & a bug fix -- November 7, 2017

* [v1.6.0-rc2](https://github.com/unbounce/iidy/releases/tag/v1.6.0-rc2)
  A few tweaks / enhancements on rc1 -- November 6, 2017

* [v1.6.0-rc1](https://github.com/unbounce/iidy/releases/tag/v1.6.0-rc1)
  Getting ready for the biggest release yet -- November 5, 2017

* [v1.5.0](https://github.com/unbounce/iidy/releases/tag/v1.5.0) A bit
  of polish plus dependency updates -- September 1, 2017

* [v1.4.0](https://github.com/unbounce/iidy/releases/tag/v1.4.0)
  get-stack-instances command, improved error reporting -- August 24,
  2017

* [v1.3.3](https://github.com/unbounce/iidy/releases/tag/v1.3.3) Bug
  fixes and input validation -- August 22, 2017

* [v1.3.2](https://github.com/unbounce/iidy/releases/tag/v1.3.2)
  Internal refactoring -- August 15, 2017

* [v1.3.1](https://github.com/unbounce/iidy/releases/tag/v1.3.1) Added
  time since last event to the event polling output. -- August 11,
  2017

* [v1.3.0](https://github.com/unbounce/iidy/releases/tag/v1.3.0) More
  robust time handling / event filtering to protect against local
  clock drift. Also there's now a Dockerfile for creating a small
  Alpine based container image. -- August 10, 2017

* [v1.2.0](https://github.com/unbounce/iidy/releases/tag/v1.2.0) CLI
  output is prettier, new `demo` command, `--role-arn` option for
  `delete-stack`, add missing `prepublish` entry to `package.json`,
  improved handling of aws region in cli output. -- August 8, 2017

* [v1.1.0](https://github.com/unbounce/iidy/releases/tag/v1.1.0) Docs,
  examples, and improvements -- August 3, 2017

* [v1.0.0](https://github.com/unbounce/iidy/releases/tag/v1.0.0)
  Initial Release -- August 1, 2017

## Roadmap

In priority order:

* More examples and documentation.

* Unit tests of the pre-processor code. I've been relying on types and
  functional tests to date.

repository: pauloancheta/iidy

repo_name: pauloancheta/iidy


text:
# Handling errors in the OneDrive SDK for Android

Errors in the OneDrive SDK for Android behave just like errors returned from the service. You can read more about them [here](https://github.com/OneDrive/onedrive-api-docs/blob/master/misc/errors.md).

Anytime you make a request against the service there is the potential for an error. You will see that all requests to the service can return an error. The errors are returned as `ClientException`, with possible subclasses `ClientAuthenticationException` and `OneDriveServiceException` which your application will want to handle.

## Checking the error

There are a few different types of errors that can occur during a network call. We have provided some helper methods to make it easy to check what kind of error occurred. These error types are defined in [OneDriveErrorCodes.java](../OneDriveSDK/src/main/java/com/onedrive/sdk/core/OneDriveErrorCodes.java).

```java
try {
    // ...
} catch (final ClientExcepion ex) {
    if (ex.isError(OneDriveErrorCodes.AuthenticationCancelled)) {
        // Handle the specific authentication cancelled case
    }
    // Handle the authentication exception
}
```

### Client authentication exceptions

These exceptions represent errors during the authentication flow. The two exceptions are `AuthenticationCancelled` for interactive user cancelation and `AuthenticationFailure` for a problem with the underlying authentication system.

### OneDrive service exceptions

These are exceptions from the OneDrive service, that contain extra error diagnostic information. The standard error codes should give your application more than enough detail to message users. However, there is useful debug information contained in the response.

__Note__: Sometimes you might see a `OneDriveFatalServiceException`. If you do, please open a [new issue](https://github.com/OneDrive/onedrive-sdk-android/issues/new) so that we can fix it.

repository: spudi/onedrive-sdk-android

repo_name: spudi/onedrive-sdk-android


text:
---
eleventyNavigation:
  key: News
  order: 9
excludeFromSidebar: false
layout: "layouts/docs.njk"
permalink: "/news/"
override:tags:
---
# News

📢 [Subscribe to the **Eleventy News Feed**](/news/feed.xml)

You can find a bunch of other [blog posts about Eleventy on Zach’s blog](https://www.zachleat.com/web/eleventy/).

{%- for news in collections.news | reverse %}
* {{ news.date | newsDate }}—[{{ news.data.newstitle }}]({{ news.data.page.url }})
{%- endfor %}
* 2019 April 26—[Eleventy wins second Google Open Source Award](https://opensource.googleblog.com/2019/04/google-open-source-peer-bonus-winners.html)
* 2019 March—[CERN 2019 WorldWideWeb Rebuild](https://twitter.com/eleven_ty/status/1106589569238085637) site rebuilt using Eleventy!
* 2018 December 11—[Turn Jekyll up to Eleventy—a lovely tutorial by {% avatarlocalcache "twitter", "paulrobertlloyd" %}Paul Robert Lloyd](https://24ways.org/2018/turn-jekyll-up-to-eleventy/)
* 2018 November 26—[Happy First Birthday, Eleventy! 🎉](https://www.zachleat.com/web/eleventy-birthday/)
* 2018 September—[Google’s {% avatarlocalcache "twitter", "v8js" %}V8 web site launches using Eleventy](https://twitter.com/v8js/status/1044202940494475265)
* 2018 May 23—James Williamson delivers [Eleventy’s mascot](https://twitter.com/jameswillweb/status/999052022497316865), named [Edison the Static-Generating Possum](https://twitter.com/jameswillweb/status/1131956888332058624).
* 2018 March—[Eleventy wins Google Open Source Award](https://www.zachleat.com/web/google-award/)
* 2018 February 12—[Introducing Eleventy, a new Static Site Generator](https://www.zachleat.com/web/introducing-eleventy/)
* 2017 December 20—[Eleventy’s very first (and second and third) release](https://github.com/11ty/eleventy/releases?after=v0.1.3)
* 2017 November 26—Eleventy’s [first commit](https://github.com/11ty/eleventy/commit/00ad9192605d5d501de6aae193701c5a2297ef2c) makes the auspicious claim: “It’s doing what it’s supposed to do”


text:
# MCResource

Abstracted way to access ODR and HTTP resources

## Motivation

I have this very peculiar problem: using On-Demand Resource is very compelling but, sometimes, it just doesn't work for *some* people (occasionally myself). For that, hopefully, minority, I would like to offer an alternative.

## Setup

Add files from the __Classes__ folder to your project.

## Usage

```Swift
// 1. Create a resource (make sure it is retained by, say, assigning it to an instance variable)
var resource = MCResource()

// 2. Add sources
resource.add(
    source: MCResource.ODRSource(
        url: URL(string: "odr://odr/odr.png")!,
        priority: 10
    )
)

resource.add(
    source: MCResource.HTTPSource(
        remoteUrl: URL(string: "https://github.com/Baglan/MCResource/raw/master/web.png")!,
        pathInCache: "cachedWebImage",
        priority: 0
    )
)

// 3. Request the resource and process the result
resource.beginAccessing { [unowned self] (url, error) in
  if let error = error {
    // All sources failed
  } else {
    // One of the sources succeeded
  }
}

// 4. Inform the resource that it is no longer needed (will be done automatically if the resource is released)
resource.endAccessing()
```

## Notes

- MCResource API is influenced by (more like copied from) the NSBundleResourceRequest API, however, MCResource is currently limited to accessing a single file;
- Progress API is not currently supported;
- Error handling is somewhat limited;
- HTTPSource will cache the file in the app's "Caches" folder;
- Fetching will be attempted for sources in the order they were added (thus, add sources in the order of preference);
- On-Demand Resource URLs follow this format: odr://odr_tag/file_path.

repository: Baglan/MCResource

repo_name: Baglan/MCResource