text:
# GRPC - Installation and Configuration
The [GRPC](https://grpc.io/) protocol provides an extremely efficient way of cross-service communication for distributed applications. The public toolkit includes instruments to generate client and server code-bases for many languages
allowing the developer to use the most optimal language for the task.

The default [GRPC build](https://github.com/spiral/app-grpc) includes pre-installed version of [spiral/php-grpc](https://github.com/spiral/php-grpc)
library.

> You will need to generate an application key and certificate to make GRPC bundle work, see below how to do that.

You can read more about protobuf [here](https://developers.google.com/protocol-buffers/docs/overview).

## Toolkit Installation
It is possible to run a PHP application without any dependencies out of the box. However, to develop, debug, and extend the GRPC project, you will need several instruments.

### Install Protoc
To compile `.proto` files into the target language, you will have to install the `protoc` compiler.

You can download the latest `protoc` binaries from [https://github.com/protocolbuffers/protobuf/releases](https://github.com/protocolbuffers/protobuf/releases).

### PHP Server Plugin
Download and install `protoc-gen-php-grpc` from [spiral/php-grpc releases page](https://github.com/spiral/php-grpc/releases).
This plugin is required to generate a service code for your applications.

> Make sure that the plugin is available in your PATH.

### Install Protobuf extension (optional)
To achieve higher performance on larger messages, make sure to install a `protobuf` extension for PHP.

You can compile the extension manually or install it via [PECL](https://pecl.php.net/package/protobuf).

```bash
$ sudo pecl install protobuf
```

> Note, in case of `Segmentation Fault` error, try to install different `protobuf` library. We recommend using `3.10.0`  at the start.

```bash
$ sudo pecl install protobuf-3.10.0
```

## Component Installation
To install the component in alternative bundles:

```bash
$ composer require spiral/php-grpc
```

Activate the component using bootloader `Spiral\Bootloader\GRPC\GRPCBootloader`:

```php
protected const LOAD = [
    // ...
    \Spiral\Bootloader\GRPC\GRPCBootloader::class,
    // ...
];
```

### Application Server
To enable the component in application server add the following configuration section:

```yaml
grpc:
  listen: tcp://<IP_ADDRESS>:50051
  workers.command: "php app.php"

  # read how to write proto files in the next section
  proto: "proto/service.proto"

  # tls configuration is optional
  tls.key:  "app.key"
  tls.cert: "app.crt"
```

### Watch the Service
You can control the memory consumption of GRPC workers the same way as for other services:

```yaml
limit:
  services:
    grpc.maxMemory: 100
```

## Generate Certificate
It is possible to run GRPC without any encryption layer. However, in other to secure our application, we must issue proper
server key and certificate. You can use any normal SSL certificate (for example issued by [https://letsencrypt.org/](https://letsencrypt.org/)) or
issue it manually via [OpenSSL](https://www.openssl.org/).

To issue server key and certificate:

```bash
$ openssl req -newkey rsa:2048 -nodes -keyout app.key -x509 -days 365 -out app.crt
```

> Make sure to use a proper domain name or `localhost`, it will be required to make your clients connect properly.

## GRPC UI
Use https://github.com/fullstorydev/grpcui to connect to GRPC from the web browser. You will need to install Golang
to compile the application:

```bash
$ go get github.com/fullstorydev/grpcui
$ go install github.com/fullstorydev/grpcui/cmd/grpcui
```

## Example Application
You can install `app-grpc` skeleton application to play with GRPC services:

```bash
$ composer create-project spiral/app-grpc
$ cd app-grpc
$ openssl req -newkey rsa:2048 -nodes -keyout app.key -x509 -days 365 -out app.crt
```

Start the application:

```bash
$ ./spiral serve -v -d
```

To connect to GRPC endpoints from browser use the `` described above:

```bash
$ grpcui -insecure -import-path ./proto/ -proto service.proto localhost:50051
```

repository: mostafaahamidmanon/docs

repo_name: mostafaahamidmanon/docs


text:
# 22. Generate Parentheses

Difficulty: Medium

https://leetcode.com/problems/generate-parentheses/

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

For example, given n = 3, a solution set is:

```
[
  "((()))",
  "(()())",
  "(())()",
  "()(())",
  "()()()"
]
```

license: MIT

repository: jiadaizhao/LeetCode

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: jiadaizhao/LeetCode


text:
# TiDB cluster debug toolkit

TiDB cluster debug toolkit is a docker image contains various troubleshooting tools for TiDB cluster.

# Usage

```shell
$ docker run -it --rm pingcap/tidb-debug:latest
```

repository: dcalvin/tidb-operator

repo_name: dcalvin/tidb-operator


text:
+++

date = "2016-03-06"
title = "Agent Release v0.5.0 - Ubuntu Support"
description = "Changelog - Agent Release v0.5.0"
url = "changelog/agent-release-0-5-0"
section = "changelog"
category = "agent"
weight = "26"

+++

We’ve released a new update to our monitoring Agents - adding greater Ubuntu support and continuing to improve the performance of Agents.

To apply these changes, [update your Agents now](https://docs.barricade.io/using-barricade/#updating-agents).

## Improvements:

* Better feedback and error messaging during installation
* Adds support for the latest versions of Ubuntu (15.04, 15.10)
* Optimized performance for higher bandwidth servers

--

_Example of an installation error message:_

![https://docs.barricade.io/src/img/changelog/26-cli.gif](https://docs.barricade.io/src/img/changelog/26-cli.gif)

repository: flynnduism/barricadedocs

repo_name: flynnduism/barricadedocs


text:
# cf-mongo-sample
Sample CF application working with Mongo service

Check the wiki for detailed [step-by-step guide](https://github.com/hsiliev/cf-mongo-sample/wiki) on how to build and deploy this application from scratch.

repository: hsiliev/cf-mongo-sample

repo_name: hsiliev/cf-mongo-sample


text:
# Nanoscypha orissaensis C.M. Das & D.C. Pant, 1984 SPECIES

#### Status
ACCEPTED

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

#### Published in
Indian Phytopath. 37(2): 295 (1984)

#### Original name
Nanoscypha orissaensis C.M. Das & D.C. Pant, 1984

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
## tmux

---

### Basics

Create a new "window" named "1":

`tmux new -s 1`

Detach:

`Ctrl-b` *pause* `d`

List windows:

`tmux ls`

Reconnect to running window named "1":

`tmux attach -t 1`

Keep a remote interactive job running:

[https://docs.ycrc.yale.edu/clusters-at-yale/guides/tmux/](https://docs.ycrc.yale.edu/clusters-at-yale/guides/tmux/)

1. Start PuTTY
2. Create a new "window" (see above)
3. Start job
4. Close PuTTY or detach + close
5. Reconnect to server
6. Reconnect to running window (see above)

repository: jsta/ProgrammingNotes

repo_name: jsta/ProgrammingNotes


text:
# LineupX Assignment

 Web application using the MERN stack

![1  Home Screen](https://user-images.githubusercontent.com/58509992/118311075-0c454280-b50d-11eb-999f-8292b1285133.png)

 Registration Pages- Different Registration pages for both Employer and candidate.

RECRUITER REGISTER

![image](https://user-images.githubusercontent.com/58509992/118309909-8c6aa880-b50b-11eb-85cc-33153623ed08.png)

APPLICANT REGISTER

![image](https://user-images.githubusercontent.com/58509992/118309945-97253d80-b50b-11eb-8e36-676190d564ce.png)

 Login Pages - login pages for Employers & Candidates.

 APPLICANT LOGIN - HOME

![Applicant Login](https://user-images.githubusercontent.com/58509992/118310915-d56f2c80-b50c-11eb-9a16-4f9decc2723b.png)

 RECRUITER LOGIN- HOME

![3  Recruiter Home](https://user-images.githubusercontent.com/58509992/118309592-18c89b80-b50b-11eb-913b-c8e8d2083957.png)

 OPEN JOBS

This page is restricted to the Employer,renders the jobs which have been posted previously by Employer.

![12  Applicant View available Jobs](https://user-images.githubusercontent.com/58509992/118312451-fd5f8f80-b50e-11eb-9623-017360e97f06.png)

 Received Jobs Page
 This page is restricted to the Candidates consists of the job that has been posted by the Employer.

![17  Recruiter view posted jobs](https://user-images.githubusercontent.com/58509992/118312483-0cded880-b50f-11eb-8e31-61f798577222.png)

 FUNCTIONALITIES

 Recruiters can post the jobs

  ![5  Recruiter Add Job](https://user-images.githubusercontent.com/58509992/118311230-3dbe0e00-b50d-11eb-8d26-3e0d768616af.png)

 Candidates can apply for the jobs

  ![14  Applicant applying for job](https://user-images.githubusercontent.com/58509992/118311248-44e51c00-b50d-11eb-99ba-d415e5a3afa3.png)

 Recruiters can shortlist the candidates from received applications

  ![18  Recruiter shortlist or reject received application](https://user-images.githubusercontent.com/58509992/118311271-4b739380-b50d-11eb-8555-b2ecb94f3efe.png)

 Recruiters can accept(hire) the candidates if shortlisted

  ![19  Recruiter Accept applicant after shortlist](https://user-images.githubusercontent.com/58509992/118311282-50d0de00-b50d-11eb-950f-d30ce3a618c2.png)

 Candidate can accept the offer if interested

  ![16  Applicant Dashboard](https://user-images.githubusercontent.com/58509992/118311294-562e2880-b50d-11eb-8d6f-dd73cd5f8890.png)

 Recruiters can rate the employee based on performance.

  ![20  Recruiter Rate Employee](https://user-images.githubusercontent.com/58509992/118311302-5af2dc80-b50d-11eb-86a6-e1f4377cb0a1.png)


text:
---
layout: page
title:  "They Grow Without Us, Part 2"
year: 2016
categories: projects

homepage: true
image: they-grow-without-us/they-grow-without-us-UBC-0.jpg
width: 400

slideshow:
 - image: they-grow-without-us/they-grow-without-us-UBC-0.jpg
 - image: they-grow-without-us/they-grow-without-us-UBC-1.jpg
 - image: they-grow-without-us/they-grow-without-us-UBC-2.jpg
 - image: they-grow-without-us/they-grow-without-us-UBC-3.jpg

---

*They Grow Without Us* was an installation of biodegradable public furniture on the UBC campus by AFJD that engages innovative interdisciplinary research at the intersection of materials science and design. The pieces consist of honeycomb-shaped public furniture grown from mushrooms. A blend of mushroom spores and sawdust were cultivated in moulds, which are then dried to produce solid objects. The honeycomb design of the seating reflects a fabrication process in which individually moulded hexagonal blocks are grown together to produce larger forms.

Mycologist Paul Stamets proposes that mushrooms may be the Internet of the natural kingdom. The billions of drifting spores produced by decentralized and redundant networks of mushrooms contain unique genetic information, akin to that of the bits and packets that transmit information across virtual networks. Biological mushroom networks are an example of complex dynamic interrelationships of matter and information, pointing toward a future of responsive embodied networks.

The furniture suggests a future in which responsive materials are grown rather than manufactured, adding valuable material to local ecosystems at the end of their life. In contrast to the relentless cycle of consumption characteristic of contemporary society, mycelium biocomposites offer the prospect that conventional carbon-intensive design methods could be replaced one day with silently growing products.

The installation was commissioned by UBC Campus and Community Planning as part of the UBC Centennial Initiative in the area of sustainability. Funding for the project has been provided by UBC SEEDS (Social Ecological Economic Development Studies), UBC Campus and Community Planning, the UBC Alma Mater Society, and the Peter Wall Institute for Advanced Studies.

gha_language: CSS


text:
# Columnophora Bubák & Vleugel GENUS

#### Status
ACCEPTED

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

#### Published in
in Bubák, Annls mycol. 14(5): 349 (1916)

#### Original name
Columnophora Bubák & Vleugel

### Remarks
null


text:
# Load Generator

In one terminal:

```sh
agoric install
  # takes 20s
agoric start local-chain
  # wait for "finalizing commit..", takes ~4min
  # leave that running
```

In a second terminal:

```sh
agoric start local-solo 8000
  # wait for (???), maybe 1min
```

Then in a third terminal:

```sh
yarn loadgen
```

That will launch several (currently just one) load generation tools. Each
will begin with a setup phase if it has not been run before, using the
ag-solo -side `scratch` table to remember the initialized tools.

The load generator listens on localhost port 3352 for generation-rate
instructions. The config object maps gnerator name to rate (seconds between
cycles). To read the current config:

```sh
curl http://<IP_ADDRESS>:3352/config
```

To set the 'faucet' generator to run once per minute:

```sh
curl -X PUT --data '{"faucet":{"interval":60}}' http://<IP_ADDRESS>:3352/config
```

To disable all generators:
```sh
curl -X PUT --data '{}' http://<IP_ADDRESS>:3352/config
```

The load generators defined so far:

* `faucet`: initialize by creating a `dapp-fungible-faucet` -style mint, then each cycle requests an invitation and completes it, adding 1000 Tokens to Bob's Purse. Takes 4 round-trips to complete.
* `amm`: initialize by selling half our BLD to get RUN, then record the balances. Each cycle sells 1% of the recorded BLD to get RUN, then sells 1% of the recorded RUN to get BLD. Because of fees, the total available will drop slowly over time.
* `vault`: initialize by recording our BLD balance and the BLD/RUN price. Each cycle deposits 1% of the recorded BLD balance and borrows half its value in RUN, then pays back the loan and recovers the BLD (less fees).

repository: dsrvlabs/testnet-load-generator

branch_name: refs/heads/main

repo_name: dsrvlabs/testnet-load-generator


text:
`new Shape`
===========
#### Arguments
```
new Shape([API ID], [NAME], [FIELDS])
```
1. API ID (Must be a string): used to fetch documents from the API
2. Name (Optional): used as the name found on dashboard. Should be used if you want the name to be different from the API ID
3. Object representing shape [fields](./fields.md) using valid [Types](../src/types.ts)

### Example
```
new Shape('Author', 'Author', {}) === new Shape('Author', {})
```

repository: briandoll/schema

repo_name: briandoll/schema


text:
# tweet-bot [![Build Status](https://travis-ci.org/kazuhira-r/tweet-bot.svg?branch=master)](https://travis-ci.org/kazuhira-r/tweet-bot)
It is a bot application for Twitter that the author personally uses.

To use it, package it in WAR and deploy it, or run standalone with WildFly Swarm.

## Technology Stack

* [Scala](https://www.scala-lang.org/)
* [Java EE (CDI / JAX-RS)](http://www.oracle.com/technetwork/java/javaee/overview/index.html)
* [Apache DeltaSpike (Configuration / ProjectStage / Scheduler)](https://deltaspike.apache.org/)
* [Twitter4j](http://twitter4j.org/)
* [Infinispan (Persistence / CacheStore)](http://infinispan.org/)
* [Jasypt](http://www.jasypt.org/)
* [WildFly Swarm](http://wildfly-swarm.io/)
* [Maven Git Commit Id Plugin](https://github.com/ktoso/maven-git-commit-id-plugin)

*Note: WildFly Swarm is only used for standalone execution.*

## build or execute

### execute (using WildFly Swarm)
```shellscript
$ ./run-development.sh
```

*Note: applied "-Dorg.apache.deltaspike.ProjectStage=Development"*

### execute (without build)
```shellscript
$ ./no-build-run-development.sh
```

*Note: applied "-Dorg.apache.deltaspike.ProjectStage=Development"*

*Note: It must be created by Fat JAR by WildFly Swarm first.*

### packaging WAR (no WildFly Swarm)
```shellscript
$ ./slim-packaging.sh
```

### packaging Fat JAR (with WildFly Swarm)
```shellscript
$ ./swarm-packaging.sh
```

### Unit-Test
```shellscript
$ mvn test
```

repository: kazuhira-r/tweet-bot

repo_name: kazuhira-r/tweet-bot


text:
# Delimiter logs {#reference_p3p_h55_vdb .reference}

## Log introduction {#section_xbb_yyb_ry .section}

Delimiter logs use line breaks as the boundary. Each line is a log. The fields of each log are delimited by a fixed delimiter. A delimiter can contain a single character or multiple characters, including the tab \(\\t\), space, vertical bar \(|\), comma \(,\), and semicolon \(;\). Fields that contain the delimiter must be enclosed in a quote, which is double quotation marks \(" "\).

Comma-separated values \(CSV\) logs and tab-separated values \(TSV\) logs are common delimiter logs.

Log Service supports a delimiter in **single-character** or **multi-character** mode to delimit fields in each delimiter log.

## Single-character mode {#section_pzr_523_dbb .section}

In single-character mode, you must specify a delimiter. You can also specify a quote as required.

-   **Delimiter**: The fields of each log are delimited by a single-character delimiter, such as the tab \(`\t`\), the vertical bar \(`|`\), the space, the comma \(`,`\), the semicolon \(`;`\), or a non-printable character.

    **Note:** The double quotation mark \(`"`\) cannot be used as a delimiter.

    If a double quotation mark \("\) is included in a log but not used as a quote, it must be escaped and processed as double quotation marks \(`""`\). Log Service automatically restores double quotation marks \(`""`\) to a double quotation mark \(`"`\) when parsing fields. You can use a double quotation mark \(`"`\) on each border of a field as a quote, or use double quotation marks \(`""`\) in the content of a field. If the use of the double quotation mark \("\) does not comply with the format definitions of delimiter logs, you can consider using other methods such as the simple mode or full regex mode to parse fields.

    For example, when the comma \(,\) is used as the delimiter and a log field contains the double quotation mark \("\) and comma \(,\), this field must be enclosed in the quote and the double quotation mark \("\) in the content of this field must be escaped into double quotation marks \(`""`\). The log format after processing is `1999,Chevy,"Venture ""Extended Edition, Very Large""","",5000.00`. The log can be parsed into five fields as follows: `1999`, `Chevy`, `Venture "Extended Edition, Very Large"`, null field, and `5000.00`.

-   **Quote**: When log fields contain the delimiter, you must specify a quote to enclose such fields and ensure that they can be parsed properly. Log Service parses the content enclosed in the quote as a complete field. Only the delimiter can exist between fields.

    **Note:** If any characters other than the delimiter, such as the space or tab \(\\t\), exist between fields, you need to modify the log format.

    The quote can contain a single character, such as the tab \(`\t`\), the vertical bar \(`|`\), the space, the comma \(`,`\), the semicolon \(`;`\), or a non-printable character.

    For example, when the comma \(`,`\) is used as the delimiter and double quotation marks \(" "\) are used as the quote, the log format is `1997,Ford,E350,"ac, abs, moon",3000.00`. The log can be parsed into five fields as follows: `1997`, `Ford`, `E350`, `ac, abs, moon`, and `3000.00`. Among the five fields, `ac, abs, moon` enclosed in the quote is regarded as a complete field.

**Note:** Log Service allows you to use a non-printable character as a delimiter or quote. Non-printable characters are those whose decimal ASCII codes are in the range of 1 to 31 and 127. If you use a non-printable character as the delimiter or quote, you need to find the hexadecimal ASCII code of this character and enter this character in the following format: `0xthe hexadecimal ASCII code of the non-printable character`. For example, to use the non-printable character whose decimal ASCII code is 1 and hexadecimal ASCII code is 01, you need to enter `0x01`.

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

## Multi-character mode {#section_q22_s1z_pfb .section}

In **multi-character mode**, a delimiter can contain two or three characters, such as `||`, `&&&`, or `^_^`. In this mode, Log Service parses logs based on the delimiter only. You do not need to use a quote to enclose log fields.

**Note:** You need to ensure that log fields do not contain the delimiter, otherwise Log Service may incorrectly parse these fields.

For example, if the delimiter is set to `&&`, the log `1997&&Ford&&E350&&ac&abs&moon&&3000.00` can be parsed into five fields as follows: `1997`, `Ford`, `E350`, `ac&abs&moon`, and `3000.00`.

## Sample logs {#section_owv_zyb_ry .section}

-   **Logs whose fields are delimited by a single-character delimiter**

    ``` {#codeblock_3s1_rek_8z3}
    05/May/2016:13:30:28,10.10. *. *,"POST /PutData? Category=YunOsAccountOpLog&AccessKeyId=****************&Date=Fri%2C%2028%20Jun%202013%2006%3A53%3A30%20GMT&Topic=raw&Signature=******************************** HTTP/1.1",200,18204,aliyun-sdk-java
    05/May/2016:13:31:23,10.10. *. *,"POST /PutData? Category=YunOsAccountOpLog&AccessKeyId=****************&Date=Fri%2C%2028%20Jun%202013%2006%3A53%3A30%20GMT&Topic=raw&Signature=******************************** HTTP/1.1",401,23472,aliyun-sdk-java
    ```

-   **Logs whose fields are delimited by a multi-character delimiter**

    ``` {#codeblock_htb_bmc_v92}
    05/May/2016:13:30:28&&10.200. **. **&&POST /PutData? Category=YunOsAccountOpLog&AccessKeyId=****************&Date=Fri%2C%2028%20Jun%202013%2006%3A53%3A30%20GMT&Topic=raw&Signature=pD12XYLmGxKQ%2Bmkd6x7hAgQ7b1c%3D HTTP/1.1&&200&&18204&&aliyun-sdk-java
    05/May/2016:13:31:23&&10.200. **. **&&POST /PutData? Category=YunOsAccountOpLog&AccessKeyId=****************&Date=Fri%2C%2028%20Jun%202013%2006%3A53%3A30%20GMT&Topic=raw&Signature=******************************** HTTP/1.1&&401&&23472&&aliyun-sdk-java
    ```

## Configure Logtail to collect delimiter logs {#section_hth_dzb_ry .section}

For more information about how to configure Logtail to collect delimiter logs, see [Collect text logs](reseller.en-US/User Guide/Logtail collection/Text logs/Collect text logs.md). You can select the corresponding configuration based on your network deployment and actual situation.

1.  On the Logstores page of the target project in the Log Service console, click the **Data Import Wizard** icon of the target Logstore.
2.  Select a data source.

    Select **Text File** and go to the next step****.

3.  Configure the data source.
    1.  Enter the configuration name and log path. Then, select **Delimiter Mode** as the log collection mode.
    2.  Enter the log sample and select the delimiter and quote.

        Select the appropriate delimiter and quote based on the log format. Otherwise, Log Service may fail to parse logs.

        **Note:** If you use a non-printable character as the delimiter or quote, you need to find the hexadecimal ASCII code of this character and enter this character in the following format: `0xthe hexadecimal ASCII code of the non-printable character`. For example, to use the non-printable character whose decimal ASCII code is 1 and hexadecimal ASCII code is 01, you need to enter `0x01`.

         ![](images/2631_en-US.png "Configure the data source")

    3.  Specify the keys in the log extraction results.

        After you enter a log sample and select a delimiter, Log Service extracts log fields according to your selected delimiter, and defines them as values. You must specify the key for each value.

        In the preceding log sample, the non-printable character `0x01` is used as the delimiter and `0x02` is used as the quote. The log is parsed into six fields. Enter time, ip, url, status, latency, and user-agent as the keys of six fields, respectively.

    4.  Determine whether to upload a log with some fields missing.

        Configure whether to upload a log whose number of parsed fields is less than the number of configured keys. If you enable Incomplete Entry Upload, the log is uploaded. If you disable Incomplete Entry Upload, the log is discarded.

        For example, if you set the delimiter to the vertical bar \(`|`\), the log sample `11|22|33|44|55` can be parsed into the following fields: `11`, `22`, `33`, `44`, and `55`. You can set their keys to `A`, `B`, `C`, `D`, and `E`, respectively. If you enable **Incomplete Entry Upload** and Log Service collects the log `11|22|33|55`, the `55` field is uploaded as the value of the `D` key. If you disable **Incomplete Entry Upload**, Log Service discards the log because the fields and keys do not match.

    5.  Specify the log time.

        You can use the system time or a log field \(for example, the time field 05/May/2016:13:30:29\) as the log time. For more information about how to configure the time format, see [Text logs - Configure time format](reseller.en-US/User Guide/Logtail collection/Text logs/Text logs - Configure time format.md).

        ![](images/2632_en-US.png "Specify the log time")

    6.  Preview logs in the console to confirm whether logs are collected.

url: https://raw.githubusercontent.com/xiaojiexu0214/sls/883649a8f2e5e8fbec9634ec81017d7083b65dea/intl.en-US/User Guide/Other collection methods/Common log formats/Delimiter logs.md

filename: Delimiter logs.md


text:
# Applications

Persistence for applications in containers.

---

## Getting Started

This tutorial will serve as a generic guide for taking Docker images found on
[Docker Hub](http://hub.docker.com) and utilizing persistent external storage
via REX-Ray. This should provide guidance for certain applications, but also
generically so you can add persistence properly to other applications.

## Instructions

The following are a set of instructions for investigating an existing container
image to determine how to properly apply persistence.

The first step is to determine which application you are looking to deploy, then
proceed to its [Docker Hub](http://hub.docker.com) page. In this example, we
will be using [PostgreSQL on Docker Hub](https://hub.docker.com/_/postgres/).

Most application vendors will post their Dockerfile on the main page for that
given image. Many of them will also make them available by version minimally via
a download or via Github. Continuing with our PostgreSQL example, we will use
the [Dockerfile for version 9.3](https://github.com/docker-library/postgres/blob/ed23320582f4ec5b0e5e35c99d98966dacbc6ed8/9.3/Dockerfile)
since it happens to be the default version provided with Ubuntu 14.04.

Properly written Dockerfiles will include the proper information that separates
persistent information from the container image and deployed container. This is
visible when the author of the `Dockerfile` includes a ```VOLUME``` statement to
define where stateful information should be held.

Open the `Dockerfile` and do a search for ```VOLUME``` and take note of the
volumes that will be created for this image. Then we can use REX-Ray or
`Docker` to create the external persistent volume for this image. In the
PostgreSQL 9.3 example, there is a single volume in the Dockerfile:

```
VOLUME /var/lib/postgresql/data
```

The single path or paths listed refer to the volumes that should be attached
when running the container. Following this you can create a volume and attach
it to a container with the `-v` flag.

- [PostgreSQL](https://hub.docker.com/_/postgres/)
```
$ docker volume create --driver=rexray --name=postgresql --opt=size=<sizeInGB>
$ docker run -d -e POSTGRES_PASSWORD=mysecretpassword --volume-driver=rexray \
    -v data:/var/lib/postgresql/data postgres
```

## Popular Applications
External persistent storage can be applied to any number of applications
including but not limited the following examples.

 * [Cassandra](https://hub.docker.com/_/cassandra/)
 * [PostgreSQL](https://hub.docker.com/_/postgres/)

        $ docker volume create --driver=rexray --name=postgresql --opt=size=<sizeInGB>
        $ docker run -d -e POSTGRES_PASSWORD=mysecretpassword --volume-driver=rexray \
            -v data:/var/lib/postgresql/data postgres

 * [MariaDB](https://hub.docker.com/_/mariadb/)
 * [MongoDB](https://hub.docker.com/_/mongo/)

        $ docker volume create --driver=rexray --name=mongodb --opt=size=<sizeInGB>
        $ docker run -d --volume-driver=rexray -v mongodb:/data/db mongo

 * [MySQL](https://hub.docker.com/_/mysql/)
 * [Redis](https://hub.docker.com/_/redis/)

        $ docker volume create --driver=rexray --name=redis --opt=size=<sizeInGB>
        $ docker run -d --volume-driver=rexray -v redis:/data redis

repository: AVENTER-UG/rexray

gha_language: Go

repo_name: AVENTER-UG/rexray


text:
# Contributing to Neuraxle

For contributing, read the Community section of the README.

We'd love to see you comment in an issue if you want to do it.

You can as well suggest new features by creating new issues.

For maintainers of the project, deployment instructions can be found [here](https://github.com/Neuraxio/Neuraxle/wiki/How-to-deploy-a-new-package-(or-version-of-package)-to-PyPI) to release new versions.

repository: alexbrillant/Neuraxle

gha_language: Python

repo_name: alexbrillant/Neuraxle


text:
---
title: More Than Half the World-s Population Lives Inside This Circle
author: PipisCrew
date: 2020-02-16
categories: [news]
toc: true
---

In this week's Maphead, Ken Jennings explores Valeriepieris circle, a 2,500-mile radius in Asia that contains half the world's humans. The earth's population is not spread out equally over its service, as you probably know. The population density of Greenland, for example, is just 0.1/sq.

https://www.cntraveler.com/story/more-than-half-the-worlds-population-lives-inside-this-circle

origin - https://www.pipiscrew.com/2020/02/more-than-half-the-worlds-population-lives-inside-this-circle/ more-than-half-the-worlds-population-lives-inside-this-circle


text:
# Swifty
Swifty is a toy web framework built in Elixir that sits on top of [Elli](https://github.com/knutin/elli). This project is a playground for me to learn Elixir. **This could be the worst idea ever.**

## Goals
* Routes near the method being executed.
* Resources discovered via (overridable) conventions.
* A Clean way to shape and validate the data coming in.
* Handlers shouldn't care about the source(s) of data.
* Handlers shouldn't care about the format of outgoing data.

repository: bryanhunter/swifty

repo_name: bryanhunter/swifty


text:
## Version 2.3 2022/07/02

- Remove Python 2 support
- Switch from .rst to .md

## Version 1.2.1 2015/02/18

- Word wrapping
- Handle terminal resizing
- Paste from primary clipboard
- Use editor as a scrolling pop-up window (turn editing off)

## Version 1.1 2015/02/08

- Added python 2.7+ support
- Improve unicode support
- Added several readline style shortcuts
- Added a couple of basic integration tests
- Travis integration

## Version 1.0 2013-02-14

- 1.0 Initial commit


text:
Corticall: A graph-based de novo mutation caller based on traversing (Mc)Cortex de novo assembly graph and link data.
=========

Quick start
-----------

    git clone https://github.com/mcveanlab/Corticall
    cd Corticall
    ant
    java -jar dist/corticall.jar -h

Introduction
------------

Corticall is a Java-based de novo mutation (DNM) caller based on linked multi-color de Bruijn graphs (LdBG) produced by McCortex.  It is able to leverage multiple reference sequences to better characterize DNMs in otherwise inaccessible regions of canonical reference genomes.

Corticall may also be used as a class library for performing efficient, low-memory traversals on LdBGs.  The most important functionalities provided are:

* iterating over records in a Cortex graphs
* random access (by binary search) to Cortex graph records
* performing simple walks (i.e. extracting a contig, optionally using links to disambiguate junction choices)
* performing walks assisted by one or more reference sequences in a manner consistent with link information
* performing depth-first searches with custom stopping rules (useful for finding interesting graph motifs)
* aligning k-mers and contigs back to reference sequences

Corticall handles the heavy lifting when operating with these data structures, permitting developers to concentrate on the genome analysis and variant calling tools that can be written on top of this API.

Availability
------------

Corticall is released under the [Apache 2.0](https://opensource.org/licenses/Apache-2.0) license.  The latest code is [freely available at Github](https://github.com/mcveanlab/Corticall).

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

Corticall has the following dependencies:

* [Java8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html): needed for runtime and development kit
* [Apache Ant](http://ant.apache.org): for dependency fetching and compilation

Additional recommended software:

* [McCortex](https://github.com/mcveanlab/mccortex): for building Cortex graphs and link annotations

Installation
------------

To download and compile:

    git clone https://github.com/mcveanlab/Corticall
    cd Corticall
    ant

To run (and get a listing of available commands):

    java -jar dist/corticall.jar

To get help for a specific command (e.g. "Call"):

    java -jar dist/corticall.jar Call

Support
-------

Please contact Kiran V Garimella<EMAIL_ADDRESS>with any questions/comments/concerns/cake.  Feedback, bug reports, and pull requests are welcome.

Related projects
----------------
For a pythonic take on programmatically accessing McCortex linked multi-color de Bruijn graphs, see Winni Kretzschmar's [cortexpy](https://pypi.org/project/cortexpy/) project.

Citations
---------

The original multi-color de Bruijn graph paper can be found at:

* "De novo assembly and genotyping of variants using colored de Bruijn graphs", Iqbal, Caccamo, Turner, Flicek, McVean (Nature Genetics) (2012) (doi:10.1038/ng.1028) http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3272472

Our manuscript on linked multi-color de Bruijn graphs is now available via Bioinformatics at:

* "Integrating long-range connectivity information into de Bruijn graphs", Turner, Garimella, Iqbal, McVean (Bioinformatics) (2018) (doi:10.1093/bioinformatics/bty157) https://www.ncbi.nlm.nih.gov/pubmed/29554215

A manuscript preprint for Corticall, our de novo assembly approach to de novo mutation detection in pathogens, can be found at:

* "Detection of simple and complex de novo mutations without, with, or with multiple reference sequences", Garimella, Iqbal, Krause, Campino, Kekre, Drury, Kwiatkowski, Sa, Wellems, McVean (2019) (doi:10.1101/698910) https://www.biorxiv.org/content/10.1101/698910v1

repository: mcveanlab/Corticall

gha_language: Java

gha_license_id: NOASSERTION

repo_name: mcveanlab/Corticall


text:
# FIT Negative Split
Did the activity in your Garmin FIT file have a negative split? Try it out at https://fitnegativesplit.mondaymiles.com.

![fit-negative-split-demo](https://user-images.githubusercontent.com/7942714/52526980-2c269580-2c76-11e9-8ab1-1a8a3a8e23dc.gif)

## Installation
```bash
git clone git://github.com/fit-negative-split
cd fit-negative-split
yarn
```

## Getting started
Start this long-running process in a new terminal window:

```bash
yarn start
```

FIT Negative Split should be accessible at http://localhost:8081.

## Testing
```bash
yarn test
```

## Building
```bash
yarn build
```

Production assets should compile to `./dist`.

## Contributing
Contributions are welcome from everyone! Feel free to make a pull request or use GitHub issues for help getting started, to report bugs, or to make feature requests.

## License
This project was created by [Nick Holden](https://www.nickholden.io) and is licensed under the terms of the MIT license.

repository: nholden/fit-negative-split

repo_name: nholden/fit-negative-split


text:
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.8.0](https://github.com/Royal-Navy/design-system/compare/2.6.0...2.8.0) (2020-06-04)

### Bug Fixes

* **range slider:** Publish Range Slider docs ([72f3fcd](https://github.com/Royal-Navy/design-system/commit/72f3fcd200979546dfd970be285f5b601a91cbfa))
* **Security:** Update dependencies to reduce vulnerabilities ([32754b9](https://github.com/Royal-Navy/design-system/commit/32754b95afe6953148913f18f8f76355388e9dae))
* **Security:** Update dependencies to reduce vulnerabilities ([1206637](https://github.com/Royal-Navy/design-system/commit/1206637919e526324f4ecde547f5129fadb4b115))
* **Security:** Update dependencies to reduce vulnerabilities ([73a8a31](https://github.com/Royal-Navy/design-system/commit/73a8a31bec6e29ba51c43e422dbf415eeea79cb9))
* Move link colour ([f26ea47](https://github.com/Royal-Navy/design-system/commit/f26ea47b3a94b75c0e8d78cfe9fc865cec423836))
* Replace references to "Standards" ([bebc5cd](https://github.com/Royal-Navy/design-system/commit/bebc5cd920b0ae959185f4b754ddbf7fa1ad7d4f))
* update email address ([e568d5f](https://github.com/Royal-Navy/design-system/commit/e568d5f0ec77e1cbb1ad77e43ce45859dbb00c0a))

### Features

* **DocsSite:** Add Timeline framework docs ([3194f9d](https://github.com/Royal-Navy/design-system/commit/3194f9d657c1ea2e5e79732501231f355b1b27d5))
* **Sketch:** Update docs site version of Sketch Library ([285149e](https://github.com/Royal-Navy/design-system/commit/285149ef5be494b33a3418d163b148270c586d42))

# [2.7.0](https://github.com/Royal-Navy/design-system/compare/2.6.0...2.7.0) (2020-05-14)

### Bug Fixes

* Move link colour ([f26ea47](https://github.com/Royal-Navy/design-system/commit/f26ea47b3a94b75c0e8d78cfe9fc865cec423836))
* Replace references to "Standards" ([bebc5cd](https://github.com/Royal-Navy/design-system/commit/bebc5cd920b0ae959185f4b754ddbf7fa1ad7d4f))
* **range slider:** Publish Range Slider docs ([72f3fcd](https://github.com/Royal-Navy/design-system/commit/72f3fcd200979546dfd970be285f5b601a91cbfa))
* update email address ([e568d5f](https://github.com/Royal-Navy/design-system/commit/e568d5f0ec77e1cbb1ad77e43ce45859dbb00c0a))

# [2.6.0](https://github.com/Royal-Navy/design-system/compare/2.5.0...2.6.0) (2020-05-05)

**Note:** Version bump only for package royalnavy.io

# [2.5.0](https://github.com/Royal-Navy/design-system/compare/2.4.0...2.5.0) (2020-04-22)

### Bug Fixes

* **docs site:** change footer links hover state. fixes [#796](https://github.com/Royal-Navy/design-system/issues/796) ([a27113b](https://github.com/Royal-Navy/design-system/commit/a27113b670d12ccbd2ac226cc1ccf76059d099e8))

# [2.4.0](https://github.com/Royal-Navy/design-system/compare/2.3.0...2.4.0) (2020-04-14)

### Bug Fixes

* Remove decompress related packages ([409d778](https://github.com/Royal-Navy/design-system/commit/409d7788c12f257e278c51d2b08f9ec134d41850))

### Features

* **component library:** Add ability to place icon to left of button ([b1862d9](https://github.com/Royal-Navy/design-system/commit/b1862d954708efac4fa8f3cc1c4eb2a2982385ef))

# [2.3.0](https://github.com/Royal-Navy/design-system/compare/2.2.1...2.3.0) (2020-03-24)

**Note:** Version bump only for package royalnavy.io

## [2.2.2](https://github.com/Royal-Navy/design-system/compare/2.2.1...2.2.2) (2020-03-12)

**Note:** Version bump only for package royalnavy.io

## [2.2.1](https://github.com/Royal-Navy/design-system/compare/2.2.0...2.2.1) (2020-03-05)

**Note:** Version bump only for package royalnavy.io

gha_language: TypeScript


text:
### Date: July 25, 2019

 ## **Challenges Faced**

Seed Mongo database with 10 million items.
Learn how to use postgreSQL and seed that database as well.
Learn faker for faking data sets.

## **Actions Taken**
Researched the postgres docs and faker.io docs most of the day.
I was able to generate a CSV file containing 10 million items using a script to use faker and fs.writeFile.
My first attempt was to loop 10 million times using fakers node module and fsWrite. My computer was not happy about this.
Ended up having to write 1 million items at time.
From a CSV it only took about 20 seconds to seed the MongoDB with mongo import but I stripped the data pretty bare.
looked something like this.

_id, Name, cat
100000, Silly Fake Name, Hardware

The collection took 387MB of space on the locally hosted Mongo database.
Used the same CSV to seed the PostgreSQl database.
662MB in postgreSQL.

## **Results/Take-aways**
I was surprised that the postgres database required more space even though I only put a single table in.
I assume this has something to do with making it more accessible for look up time.
After speaking with other team members it seems generating the data to a CSV was the optimal way to seed.
Others tried writing to the database WHILE generating the data through a single script and it took 45 minutes or more depending on hardware.

repository: VarCannon/Build-Journals

repo_name: VarCannon/Build-Journals


text:
![reactive-stack-js](https://avatars0.githubusercontent.com/u/72337471?s=75)

# Reactive Stack JS

![codacy](https://img.shields.io/codacy/grade/e0146e29a3134038b4dcf95db9eb5a38.svg)

In **reactive** programming, data is _pushed_, not _pulled_.

Therefore, a **reactive stack** is one where data is _pushed_, not _pulled_, through out the entire stack.
What that means is that instead of the client _requesting_ the data from the server, the server is constantly _pushing_ the data to the client.

Basically, this boils down to a simple description: the client is **observing** the data it cares about, and **reacting** to that data changing.

For more information, please check out:

* [Reactive Design Patterns](https://www.manning.com/books/reactive-design-patterns)
* [ReactiveX](http://reactivex.io/)
* [Learn RxJS](https://www.learnrxjs.io/)

## Observer Pattern through the Chain

Please read up on the Observer Patter if you are unfamiliar with it: [Observer Design Pattern](https://sourcemaking.com/design_patterns/observer).

Also, please read up on the difference between Observer and Pub Sub: [Observer vs Pub-Sub pattern](https://hackernoon.com/observer-vs-pub-sub-pattern-50d3b27f838c).

The Chain here refers to the entire data transport chain, from the source the database, all the way to the rendered UI in the GUI.

This is the list of Observer Pattern pair instances in the chain, from DB to GUI.

__Note__: A <- X means that X _observes_ A. A is then the _observable_ and X is the _observer_.

__Note__: <-WS- indicates that the Observer Pattern goes through a WebSocket connection.

1. Collection/Table <- ObservableModel
2. ObservableModel <- ReactiveStore
3. ReactiveStore <- Client
4. Client <-WS- ClientSocket
5. ClientSocket <- ReactiveStore
6. ReactiveStore <- Dialog

_...todo: describe each listed instance above_

## Goal

My goal was to create a reactive stack solution that would not have a [vendor lock-in](https://en.wikipedia.org/wiki/Vendor_lock-in). In other words, I wanted the end product to
have the flexibility where any part of it could be replaced with an alternative, in as easy as possible manner.

This is the end result:

![reactive-stack-js](https://raw.githubusercontent.com/reactive-stack-js/reactive-stack-js/main/images/reactive-stack-js.png)

## Clarification

I started with [MeteorJS](https://www.meteor.com/) because it allowed me to focus only on the client side for the setup I had in mind. It also allowed me to _see_ the final POC
application working. I was then able to work with that example as a guide. Further more, I was able to reuse the client side code with minimal adjustments.

The second step was to take the created [React](https://reactjs.org/) client side code from the **reactive-stack-js-meteor-react** implementation and work on the alternative
REST [Fastify](https://www.fastify.io/) backend. Once I had the backend working, I was also able to take over the [Svelte](https://svelte.dev/) client side code from **
reactive-stack-js-meteor-svelte**. This was later deleted due to the fact that Svelte started throwing errors that were totally weird, and I simply did not want to deal with them
anymore. These sadly started to occur in **reactive-stack-js-meteor-svelte** repository as well. I also added [Vue](https://vuejs.org/) to the REST setup, for comparison.

Finally, in the third step, I decided to add [GraphQL](https://graphql.org/) to the mix, and replace REST. My main goal there was to add GraphQL without having to also manually
write the GraphQL schemas, as well as also most common mutations for every [Mongoose](https://mongoosejs.com/) model in the app. This worked as I hoped it would. The final goal for
the GraphQL setup is to add [live queries](https://www.graphile.org/postgraphile/live-queries/), and then remove the whole data synchronization setup I created.

ATM, my favorite solution is the section 2, **REST** with **Vue**, which is based on [RxJS](https://rxjs.dev/), [Fastify](https://www.fastify.io/)
, [Mongoose](https://mongoosejs.com/) and [Vue](https://vuejs.org/). Therefore, this is the one that will be the focus for me, in terms of documentation and refactoring. Once
the **GraphQL live queries** become feasible, I will add it to section 3 and then compare with the REST implementation for a final decision.

## This repository

This repository contains data creating script which uses [casual](https://github.com/boo1ean/casual).
Just first do `yarn`, then do `yarn data`, and your [mongodb](https://www.mongodb.com/) will have a new database called `reactivestackjs`, populated with fake data.

It also contains the description and links to various sub-repositories I created as a reactive stack [POC](https://en.wikipedia.org/wiki/Proof_of_concept).

There are 3 sections which are further split into repositories.

### Sections & Repositories

1. **Reactive Stack JS using** [**MeteorJS**](https://www.meteor.com/)
    1. Meteor with React
        1. :heavy\_check\_mark: [reactive-stack-js-meteor-react](https://github.com/reactive-stack-js/reactive-stack-js-meteor-react)
           _based on_ [_Meteor React tutorial_](https://www.meteor.com/tutorials/react/creating-an-app)
    2. Meteor with Svelte
        1. :heavy\_check\_mark: [reactive-stack-js-meteor-svelte](https://github.com/reactive-stack-js/reactive-stack-js-meteor-svelte)
           _based on_ [_Meteor Svelte tutorial_](https://www.meteor.com/tutorials/svelte/creating-an-app)
2. **Reactive Stack JS using** [**REST**](https://restfulapi.net/)
    1. :heavy\_check\_mark: [reactive-stack-js-rest-backend-fastify](https://github.com/reactive-stack-js/reactive-stack-js-rest-backend-fastify)
    2. :heavy\_check\_mark: [reactive-stack-js-rest-frontend-react](https://github.com/reactive-stack-js/reactive-stack-js-rest-frontend-react)
    3. :heavy\_check\_mark: [reactive-stack-js-rest-frontend-vue](https://github.com/reactive-stack-js/reactive-stack-js-rest-frontend-vue)
3. **Reactive Stack JS using** [**GraphQL**](https://graphql.org/)
    1. :heavy\_check\_mark: [reactive-stack-js-graphql-backend-fastify](https://github.com/reactive-stack-js/reactive-stack-js-graphql-backend-fastify)
    2. :heavy\_check\_mark: [reactive-stack-js-graphql-frontend-vue](https://github.com/reactive-stack-js/reactive-stack-js-graphql-frontend-vue)

### Execution

Both Meteor repositories are standalone and can be started on their own.

In section 2, the backend has to be running for any of the 3 frontend repositories to work. Those, however, can be started independent of each other.

Section 3 is similar to section 2, however there is only one frontend solution available.
_I do not plan to repeat react or svelte here, since that would serve no valuable purpose._

### App Description

WIP: [App Description](https://github.com/reactive-stack-js/reactive-stack-js/wiki/App-Description)

## Reactive Stack JS using MeteorJS

Follow instructions in each repository to install and run.
Both meteor implementations can run in parallel.

## Reactive Stack JS using REST

Simply `yarn` in each repository, then `yarn start` in the backend and then the same in any frontend you wish to look at.
The frontends can run in parallel.

## Reactive Stack JS using GraphQL

Simply `yarn` in each repository, then `yarn start` in the backend and then the same in the frontend.

license: Unlicense

repository: reactive-stack-js/reactive-stack-js

repo_name: reactive-stack-js/reactive-stack-js


text:
# Cashier

[![Build Status](https://travis-ci.org/swelham/cashier.svg?branch=master)](https://travis-ci.org/swelham/cashier) [![Deps Status](https://beta.hexfaktor.org/badge/all/github/swelham/cashier.svg?branch=master)](https://beta.hexfaktor.org/github/swelham/cashier) [![Hex Version](https://img.shields.io/hexpm/v/cashier.svg)](https://hex.pm/packages/cashier) [![Join the chat at https://gitter.im/swelham/cashier](https://badges.gitter.im/swelham/cashier.svg)](https://gitter.im/swelham/cashier?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Cashier is an Elixir library that aims to be an easy to use payment gateway, whilst offering the fault tolerance and scalability benefits of being built on top of Erlang/OTP

# Usage

The following are basic usage examples on how to use cashier in it's current state. This library is being activily developed and is likely to
change as we move towards the first release.

### Setup

Add cashier as a dependency
```elixir
defp deps do
  {:cashier, "~> 0.2.0"}
end
```

Make sure the cashier application gets started
```elixir
def application do
  [applications: [:cashier]]
end
```

### Config options
```elixir
use Mix.Config

# cashier options
config :cashier, :cashier,
  defaults: [
    currency: "USD",
    gateway: :paypal,
    timeout: 20_000 # this option is the OTP timeout setting
  ],
  # this option is passed directly into HTTPoison and can contain any
  # of the valid options listed here - https://hexdocs.pm/httpoison/HTTPoison.html#request/5
  http: [
    recv_timeout: 20_000
  ]

# PayPal specific config
config :cashier, :paypal,
  # Please note the PayPal gateway currently only supports the /v1 endpoint
  # and this is automattically added for you
  url: "https://api.sandbox.paypal.com",
  client_id: "<paypal_client_id>",
  client_secret: "<paypal_client_secret>"
```

### Cashier request examples

```elixir
alias Cashier.Address
alias Cashier.PaymentCard

address = %Address{
    line1: "123",
    line2: "Main",
    city: "New York",
    state: "New York",
    country_code: "US",
    postal_code: "10004"
}

card = %PaymentCard{
    holder: {"John", "Smith"},
    brand: "visa",
    number: "4032030901103714",
    expiry: {11, 2021},
    cvv: "123"
}

# Note: The result return type for each request is currently the decoded
#       data returned from the payment provider, this will change in the future.

# Purchase request
# the card parameter can be either a %PaymentCard or stored card id
case Cashier.purchase(9.99, card, [billing_address: address]) do
    {:ok, result}     -> IO.inspect result
    {:error, reason}  -> IO.inspect reason
end

# Authorize request
# the card parameter can be either a %PaymentCard or stored card id
case Cashier.authorize(9.99, card, [billing_address: address]) do
    {:ok, result}     -> IO.inspect result
    {:error, reason}  -> IO.inspect reason
end

# Capture request
case Cashier.capture("<capture_id>", 19.45, [final_capture: true]) do
    {:ok, result}     -> IO.inspect result
    {:error, reason}  -> IO.inspect reason
end

#Void request
case Cashier.void("<void_id>") do
    {:ok, result}     -> IO.inspect result
    {:error, reason}  -> IO.inspect reason
end

#Refund request
case Cashier.refund("<refund_id>", [amount: 9.99]) do
    {:ok, result}     -> IO.inspect result
    {:error, reason}  -> IO.inspect reason
end

#Store request
case Cashier.store(card, [billing_address: address]) do
    {:ok, result}     -> IO.inspect result
    {:error, reason}  -> IO.inspect reason
end

#Unstore request
case Cashier.unstore("<card_id>") do
    :ok               -> IO.puts "card unstored"
    {:error, reason}  -> IO.inspect reason
end
```

# Todo

All current todo items are listed on the [issues page](https://github.com/swelham/cashier/issues).

Please add any issues, suggestions or feature requests to this page.

repository: locrianmode/cashier

repo_name: locrianmode/cashier


text:
# ResponsivePortfolio

Personal portfolio

*This is a personal portfolio which will be edited throughout the course to showcase my work. The live link an technologies used are as follows:

    - ![Deployed Link](https://eschiavoni2.github.io/ResponsivePortfolio/)
    - HTML
    - CSS
    - Bootstrap
    - Google fonts

*This project will evolve over time as I have more projects to put on here for potential employers. It will showcase my work and allow employers or clients to get in touch with me.

*MIT

*Erika Zibelnik
    -email<EMAIL_ADDRESS>
*Screen grabs


text:
---
layout: post
section-type: post
title: Generating Response-Specific Elaborated Feedback Using Long-Form Neural Question Answering
category: Category
tags: ['publications','research','education-research','datawhys','mofacts','ldi','braintrust','conference-regular','discourse', 'nlp']
---

Olney, A. M. (2021). Generating Response-Specific Elaborated Feedback Using Long-Form Neural Question Answering. Proceedings of the Eighth ACM Conference on Learning @ Scale, 27–36. https://doi.org/10.1145/3430895.3460131

[Code for docker image on GitHub](https://github.com/aolney/longform-qa-service).

<object data="https://blogs.memphis.edu/aolney/files/2021/06/olney-feedback-2021-accepted-version.pdf" type="application/pdf" width="100%" height="600px">

It appears you don't have a PDF plugin for this browser.
  No biggie... you can click here to
  download the PDF file.

</object>


text:
---
layout: default
title: How do you use a Design Pattern?
category: info
description: Explanation of how to appropriately apply a Design Pattern.
---

{{ page.title }}
================

First it is very important to understand [what a design pattern is][what].

After understanding what it is and why you would want to use a design pattern,
the steps of using a design pattern can be summarized as below:

1. Identity a Problem
2. Find a Design Pattern
3. Understand the Design Pattern
4. Look at the Example
5. Fit the Pattern
6. Implement the Pattern

## Identity a Problem

It is very easy to design software in an ad-hoc fashion by adding functions and
classes whenever the need arises. The problem with this is that it doesn't work
well for large projects or when multiple develop on the same project.

The way to remedy this is to think about how you want to do something before you
actually do it. By doing this, you can look at the trade-offs and shortcomings
whenever you make a decision about the structure of your code.

A few examples of the things developers do when they come across a problem and
don't design a solution for it:

1. I need code to do X. I'll add it to this object. Oh, this code also needs to
   be in this object? I'll just copy and paste it.
2. I need to reuse code across different objects. I'll just make a dummy object
   that only contains that method.

By designing instead of coding blindly, the following problems might arise
in comparison:

1. If I were to use inheritance here to solve X problem, what side effects would
   it have when this code needs to be extended for Y?
2. If I split up the classes in this way, it will solve X. Will that make it
   easier to understand if problem Y arises?

The second set of questions accurately looks at the side-effects of every action
in a code base.

Out of the six steps, this might be the most difficult one to master. It
requires the ability to examine decisions and being able to see the trade-offs
when designing software.

## Find a Design Pattern

If the problem has been accurately understood, the next thing to do is to find a
Design Pattern that will either solve the problem or lessen the impact of it.

This requires knowing some design patterns or at least knowing the categories
that they fall in. When you know that the problem you are solving deals with
object instances and instantiating them effectively, it would help to look at
Creational design patterns.

For the complete list of design patterns that this website has, view the
[homepage][home].

## Understand the Design Pattern

Once you've selected the design pattern that will help you. It is well worth
your time to understand it fully.

Each design pattern on this site has eight parts:

1. A definition
2. List of alternative names (if any)
3. A diagram showing a [UML][uml] representation of the pattern
4. A common problem the pattern solves
5. A wrong solution
6. A correct solution using the pattern
7. Consequences of using the pattern
8. Example code

After understanding it, if it doesn't actually solve your problem, you may have
to go to the previous step of finding one that might solve it.

Have a look at the [Adapter Design Pattern][adapter] to see what this looks
like.

## Look at the Example

The example will provide a self contained use case of the pattern in action. It
will show how to structure the classes/interfaces and it will show the
functions/methods that will need to interact together.

The example can be also used as a template for what you wish to do. The next
step will look what might happen if your problem requires a lot more effort to
solve. You may wish to just use it as a reference and make further
modifications based on your specific use case.

## Fit the Pattern

The problem that you have might not fit the given problem exactly. For whatever
the reason may be, it may be required to make certain changes to either your
structure or to the design pattern.

It may be the case that you are already using another design pattern as well.
You may have to make them work together and do other things to improve the
design of your software.

## Implement the Pattern

The implementation of a design pattern will vary greatly depending on the
language, package layout, and other factors of the software environment.

However, the core idea does not change. An example of this would be implementing
the Observer pattern in Rust as compared to Java.

In Java, you could use polymorphism or an interface when creating your observer
pattern.

In Rust, this changes a bit. Rust doesn't have inheritance or polymorphism. It
does have traits which is very similar to an interface. A Rust programmer
wouldn't be able to use polymorphism in this case.

## Final Thoughts

By using a design pattern, the quality of your code and software can be greatly
increased. It's important to realize the benefit that they can provide and what
problems they may solve.

[home]: /
[what]: /rust-design-patterns/what/
[observer]: /rust-design-patterns/observer/
[adapter]: /rust-design-patterns/adapter/
[uml]: http://en.wikipedia.org/wiki/Unified_Modeling_Language

repository: jdavis/rust-design-patterns

repo_name: jdavis/rust-design-patterns


text:
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Shade--Melange-green.svg?style=true)](https://android-arsenal.com/details/1/3935)
# Shade-Melange

Shade Melange is a library that contains a colour palette with a wide range of pre-defined colours with their names. The implementation of the grid has been done using RecyclerView for memory efficient performance. The library consists of two main classes:

* ShadeMelangeFragment.java - Fragment that can be used directly by attaching it with your activity.

* ShadeMelangeDialog.java - Dialog that beyond it's basic implementation contains a colour palatte.

## Including in your project

Add JitPack to repositories in your project's root `build.gradle` file:

```
allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}
```

Add the dependency to your module's `build.gradle` file:

```
dependencies {
    ...
    compile 'com.github.devikamehra:Shade-Melange:v2.0'
}
```

## Usage

#### ShadeMelangeFragment

Just like another fragment, this fragment can be attached to your activity by using your default Fragment Manager

``` java

ShadeMelangeFragment fragment = new ShadeMelangeFragment();

        fragment.with(this)
                .columns(2)                                            // gridview columns
                .setTextColor(Color.RED)                               // name of the colour textColor
                .applyDecoration(DecorationEnum.SIMPLE_GRID_DECORATION) // recyclerview item decoration. Can be customized.
                .showRectangularShell(true)                             // Shape of shell (Circular or Rectangular)
                .setSelectionMode(SelectionModeEnum.SINGLE_SELECTION_MODE) // To change selection mode from multi to single
                .setShadeType(ShadeTypeEnum.MATERIAL_SHADES)              // Defines the type of Shades
                .setOnShadeSelectListener(new OnShadeSelectedListener() { // onClickShades Listener
                    @Override
                    public void onShadeSelected(int color, String name) {
                        Toast.makeText(MainActivity.this, "You selected " + name + " shade." , Toast.LENGTH_SHORT).show();
                    }
                });

        getSupportFragmentManager()                                   // easily add it using Fragment Manager
                .beginTransaction()
                .add(R.id.container, fragment, "frag")
                .commit();

```

#### ShadeMelangeDialog

The Dialog contains a colour palatte which can be customized according to your specifications

``` java

ShadeMelangeDialog dialog = new ShadeMelangeDialog(this);
            dialog.title("Shade Melange Dialog")
                    .setOnShadeSelectListener(new OnShadeSelectedListener() {    // onShadeClick Listener
                        @Override
                        public void onShadeSelected(int color, String name) {
                            Toast.makeText(MainActivity.this, "You selected " + name + " shade.", Toast.LENGTH_SHORT).show();
                        }
                    })
                    .setPositiveButton("Select", new OnDialogButtonClickListener() {      // add various buttons
                        @Override
                        public void onButtonClicked(ShadeMelangeDialog shadeMelangeDialog) {

                            Toast.makeText(getBaseContext(), "Shade Selected!!", Toast.LENGTH_SHORT).show();

                        }
                    });

            dialog.showMelange();       // Remember to use showMelange() and not the default show()

```

Refer to the sample to appreciate the simplistic implementation of the library.

## License

Copyright 2016 Devika Mehra

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

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

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

repository: nafisabarlaskar/Shade-Melange

repo_name: nafisabarlaskar/Shade-Melange


text:
# vinci-analysis

This repo is created to share Vinci Venture Capital data analysis files excluding the data files (mostly in csv format).

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install requirements.

```bash
python3 -m venv env
source env/bin/activate
pip3 install -r requirements.txt
```

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

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

repository: gasci/vinci-analysis

repo_name: gasci/vinci-analysis


text:
# sensor-hub [![codecov](https://codecov.io/gh/mvenditto/sensor-hub/branch/master/graph/badge.svg?token=Nj3INWZgrw)](https://codecov.io/gh/mvenditto/sensor-hub)

## Directory structure
```
\<sensor-hub home>
    \bin
      sensor-hub.jar
      sh-prefs.conf
    \ext
      \drivers
        driver-name.jar
        driver-name.json
      \services
        \<service-name>
          service-name.jar
```

## Running
 - *java -jar sensor-hub.jar*
 - running as a OS *daemon*: [see](https://github.com/mvenditto/sensor-hub/wiki/Running)
 - configuration: *sh-prefs.conf*
 - web interface (optional): @ *localhost:8081/sh-admin.html* (default)
    - [REST server](https://github.com/mvenditto/sensor-hub_rest-server)
    - [REST server front-end](https://github.com/mvenditto/sensor-hub_rest-service-frontend)

## TODOs List :ballot_box_with_check:
- [x] global *configuration* management
- [ ] enhance services bootstrap phase **[WIP]**
- [x] rethink *feature of interest* attachment to *observations* (move out from drivers level)
- [ ] add more checks on argument while creating resources (eg. createDevice ecc...)
- [x] introduction of *session* concept and session recovery (separated service?)
- [ ] permissions implementation **[WIP]**
- [x] refactor logging/auditing

### Optimizations :fire:
- [x] fix Observation instanced 2 times (cause .copy call in DataStream)
- [x] change timestamps from java.time.instant to Long (millis since epoch)
- [x] fix performance issues with infinite Observable created from observation procedure
- [x] add a default backpressure strategyy to Observation streams from sensors
- [x] investigate other possible issues with memory/cpu usage (rx threading ecc...)

repository: mvenditto/sensor-hub

repo_name: mvenditto/sensor-hub


text:
# Tutorial

## Prerequisites

One of:

* [Clojure CLI tools](https://clojure.org/guides/getting_started#_clojure_installer_and_cli_tools) (the `clojure` command)
* [Leiningen](https://www.leiningen.org)

## Steps

1. On the command line, start a Clojure [nREPL] server.

   ```bash
   # With tools.deps (the `clojure` command):
   $ clojure -Sdeps '{:deps {nrepl {:mvn/version "0.7.0"}}}' --main nrepl.cmdline --port 1234

   # With Leiningen:
   $ lein repl :headless :port 1234
   ```

   See the [nREPL documentation](https://nrepl.org/nrepl/0.7.0/usage/server.html)
   for more information on starting an nREPL server.

2. In Sublime Text, open the command palette.

3. Run the **Tutkain: Connect** command.

   Enter the host (`localhost`) and port (`1234`) when prompted.

3. Use the **Tutkain: Evaluate …** commands to send forms to the nREPL server
   for evaluation.

   The **Tutkain: Evaluate Form** command works something like this:

   - If your cursor is at a left bracket, send the form it starts.
   - If your cursor is at a right bracket, send the form it closes.
   - Otherwise, send the form your cursor is inside.

If you accidentally close the Tutkain output panel, use the **Tutkain: Toggle
Output Panel** command to bring it up.

[nREPL]: https://nrepl.org


text:
## Budget Tracker

### Introduction
Github Repository
``` text
https://github.com/anitapeppercorn/Budget-Tracker
```
App is Deployed at:
``` text
https://serene-chamber-87874.herokuapp.com/
```

Giving users a fast and easy way to track their money is important, but allowing them to access that information at any time is even more important. Having offline functionality is paramount to the success of an application that handles users’ financial information.

## Contents
- [Description](#Description)
- [App Screenshot](#App)
- [User Story](#User-Story)
- [Acceptance Criteria](#Acceptance-Criteria)
- [Concepts](#Concepts)
- [License](#License)
- [Author](#Author)

## Description

I have updated an existing budget tracker application to allow for offline access and functionality. The user will be able to add expenses and deposits to their budget with or without a connection. If the user enters transactions offline, the total should be updated when they're brought back online. The application is deployed to Heroku.

### App Screenshot
![](public/assets/images/budgettracker.png)

## User Story
AS AN avid traveler
I WANT to be able to track my withdrawals and deposits with or without a data/internet connection
SO THAT my account balance is accurate when I am traveling

## Acceptance Criteria
GIVEN a budget tracker without an internet connection
WHEN the user inputs an expense or deposit
THEN they will receive a notification that they have added an expense or deposit
WHEN the user reestablishes an internet connection
THEN the deposits or expenses added while they were offline are added to their transaction history and their totals are updated

## Concepts

I used IndexedDB to add offline Persistence. I added a service worker to application to make it a Progressive Web Applications (PWA), We provide the functionality:
1. To enter deposits offline.
2. To enter expenses offline.
3. Offline entries are added to the tracker when the application is brought back online.
4. This is mobile-first application, I added a web manifest to application with the app’s metadata, to let users’ devices know what they’re installing and how the app should look on the home screen.

## License
[MIT License](./LICENSE)
![license](https://img.shields.io/badge/License-MIT-blue)

## Author: Anita Ganti

View the authors' portfolio at:
https://anitapeppercorn.github.io/anitaprofileportfolio/
![Badge](https://img.shields.io/badge/Github-anitapeppercorn-4cbbb9)
![Profile Image](https://github.com/anitapeppercorn.png?size=50)

[Table of Content](#Table-of-Content) --- [Back to Top](#Budget-Tracket-API) --- # Budget-Tracker-API

repository: anitapeppercorn/Budget-Tracker

repo_name: anitapeppercorn/Budget-Tracker


text:
# iOS-LabelAnimationOnTextField
This repo is useful for iOS developers who wants to animate label on the text field.

Floating Style Label.

Steps:
- Add UITextField+PBLabel.h and .m files in your project.
- Import .h file where you want to implement animation on text field.
- And use methods in Category using UITextField based on your requirement.

Example:

//Delegate method

-(void)textFieldDidBeginEditing:(UITextField *)textField{

       [self.view addSubview:[UITextField animatePBLabel:textField]];

}

Version 1 - Label animates top/bottom and left/right on the TextField. Implemented using Categories that provides users to configure using various options like font name, font color, font size, position, alignment... .

Version 2 Under Development.

Version 2 - Includes improved first version as well as different floating label patterns.

This repo is useful for iOS developers who wants to animate label on the text field. Development continues further to provide additional features. I will add more notes here in detail.

Usage

Animates label with specified alignment and position.

Alignment  = "left", "right".

Position   = "top", "bottom".

[self.view addSubview:[UITextField animatePBLabel:textField withAlignment:@"left" andPosition:@"top"]];

Animates label with specified alignment, position and color.

[self.view addSubview:[UITextField animatePBLabel:textField withAlignment:@"right" andPosition:@"bottom"            withColorRed:100.0/255.0 andGreen:125.0/255.0 andBlue:100.0/255.0]];

Animates label with specified alignment,position and font name.

[self.view addSubview:[UITextField animatePBLabel:textField withAlignment:@"right" andPosition:@"top" withFontName:@"System"]];

Animates label with specified alignment,position,font name and font color.

[self.view addSubview:[UITextField animatePBLabel:textField withAlignment:@"left" andPosition:@"top" withFontName:@"System" withColorRed:120.0/255.0 andGreen:120.0/255.0 andBlue:125.0/255.0]];

Animates label with specified alignment,position,font name, font size and font color.

[self.view addSubview:[UITextField animatePBLabel:textField withAlignment:@"right" andPosition:@"top" withFontName:@"System" withFontSize:10 withColorRed:150.0/255.0 andGreen:255.0/255.0 andBlue:100.0/255.0]];

LICENSE

The MIT License (MIT)

Copyright (c) 2016 Pradeep

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:
# Fase Android
Android client for a Fase Service.

Official website is [here](http://fase.io).

Article on Medium about Fase is [here](https://medium.com/@igushev/frontend-in-the-cloud-creating-native-mobile-applications-on-python-free-and-open-source-5g-15b34d956036).

How to configurate Android client for a Fase application read [here](http://fase.io/converter_android/).


text:
# discordTelnet
My attempt to give discord.py a telnet interface. It includes threading too!
# Installing
1. Use git clone or download the latest release.
2. Install the requirements
3. Setup eviron varables
4. run the .py file
5. chat away!
# Features
- [x] Exiting using /kill
- [x] Switching Channels in server
- [x] @user processing (inward)
- [ ] @user processing (outward)
- [x] @role processing (inward)
- [ ] @role processing (outward)
- [ ] DMs
- [ ] Message history
# Commands
- [x] /kill to kill the server and shutdown
- [x] /channel (id) to switch channels
- [x] /list-channels (serverid) to list channels and ids in a server
- [x] /list-servers or /list-guilds to list all servers you are in
- [ ] /dm (user id) switch to dming a user
- [x] /isbot Are you a bot? or not?
- [x] /userinfo (id) show info on user with id

repository: webmsgr/discordTelnet

repo_name: webmsgr/discordTelnet


text:
# Getting started

## Installation

NPM:

```bash
npm i honeycomb-grid
```

Yarn:

```bash
yarn add honeycomb-grid
```

Or download the distribution from [jsdelivr](https://cdn.jsdelivr.net/npm/honeycomb-grid) or [unpkg.com](https://unpkg.com/honeycomb-grid).

## Basic example

Create a rectangular grid of 10 by 10 hexes and log each hex:

```javascript
import { defineHex, Grid, rectangle } from 'honeycomb-grid'

// 1. Create a hex class:
const Tile = defineHex({ dimensions: 30 })

// 2. Create a grid by passing the class and a "traverser" for a rectangular-shaped grid:
const grid = new Grid(Tile, rectangle({ width: 10, height: 10 }))

// 3. Iterate over the grid to log each hex:
grid.forEach(console.log)
```

repository: flauwekeul/honeycomb

repo_name: flauwekeul/honeycomb


text:
## Running browser tests on [GitHub Actions](https://github.com/seleniumbase/SeleniumBase/actions) with [SeleniumBase](https://github.com/seleniumbase/SeleniumBase)

![](https://seleniumbase.github.io/cdn/img/gha/github_workflows_7.png "GitHub Actions")

----------

### Step 0. Create a fork of [SeleniumBase](https://github.com/seleniumbase/SeleniumBase) on GitHub to help you get started.

* **(You'll be using your own repo eventually.)**

![](https://seleniumbase.github.io/cdn/img/gha/github_workflows_2.png "Create a fork of SeleniumBase")

----------

### Step 1. From the GitHub Actions tab, choose to set up a Python package Workflow.

![](https://seleniumbase.github.io/cdn/img/gha/github_workflows_1.png "GitHub Actions")

----------

### Step 2. Add your workflow ``.yml`` script.

* **(If using a SeleniumBase fork, the script from https://github.com/seleniumbase/SeleniumBase/blob/master/.github/workflows/python-package.yml already exists to help guide you.)**

![](https://seleniumbase.github.io/cdn/img/gha/github_workflows_9.png "GitHub Actions")

### Step 3. Commit your changes to GitHub.

![](https://seleniumbase.github.io/cdn/img/gha/github_workflows_4.png "GitHub Actions")

----------

### Step 4. Your tests will now run on every pull request and on every commit to the ``master`` branch.

* **(See https://github.com/seleniumbase/SeleniumBase/actions for the SeleniumBase example.)**

![](https://seleniumbase.github.io/cdn/img/gha/github_workflows_5.png "GitHub Actions")

* **(You can click inside each build for more details.)**

![](https://seleniumbase.github.io/cdn/img/gha/github_workflows_6.png "GitHub Actions")

* **(You can also see the specific steps being performed by each command.)**

![](https://seleniumbase.github.io/cdn/img/gha/github_workflows_7.png "GitHub Actions")

* **(You'll notice that web browsers such as Chrome and Firefox get installed for tests to use. SeleniumBase uses pytest for running tests while using Selenium to interact with web browsers.)**

----------

### Congratulations! You now know how to create and run browser tests with GitHub Actions!

### **Study [SeleniumBase](https://github.com/seleniumbase/SeleniumBase) to learn more!**

repository: seleniumbase/SeleniumBase

repo_name: seleniumbase/SeleniumBase


text:
# Changelog
All notable changes to this project will be documented in this file.
## [ 0.1.1 ] - 2019-09-09

### Added
- [🚒 use annotation to store eip](https://github.com/kubesphere/porterlb/pull/57)
- [add Porter intro of English version](https://github.com/kubesphere/porterlb/pull/53)

### Changed
- [🌟 upgrade to kubebuilder 2.0](https://github.com/kubesphere/porterlb/pull/54)
- [⏫upgrade kustomize](https://github.com/kubesphere/porterlb/pull/55)

### Fixed
- [🚒 fix e2e](https://github.com/kubesphere/porterlb/pull/56)

## [ 0.1.0 ] - 2019-03-31

### Added
 - add portforward for nonstandard bgp port <https://github.com/kubesphere/porterlb/pull/37>
 - add doc about setting up in real router <https://github.com/kubesphere/porterlb/pull/36>
 - more tests

## [ 0.0.3 ] - 2019-03-26

### Added
 - new Jenkinsfile <https://github.com/kubesphere/porterlb/pull/29>

### Fixed
 - duplicated externalIPs in `kubectl get svc` <https://github.com/kubesphere/porterlb/pull/27>
 - update docs

## [ 0.0.2 ] - 2019-03-25

### Added
 - auto detect main interface instead of using `eth0` <https://github.com/kubesphere/porterlb/pull/23>
 - add e2e test <https://github.com/kubesphere/porterlb/pull/23>

### Fixed
 - fix the reconcile logic which add route without waiting for all endpoints  <https://github.com/kubesphere/porterlb/pull/24>
 - Update readme


text:
---
layout: post
title: "Adventures in Game Development: Pixel Art"
date: 2020-09-10
tags: [reflections, game-dev]
---

Art is hard. I have a lot of respect for people who can do art in a professional capacity, as my level of drawing has barely evolved past stick figure drawings. I used to tell myself that there was no way that I was an artist and that the skills needed to draw were something that I wouldn't be able to learn.

Well, at this point I still can't draw. But I took a baby step to becoming more comfortable with art, and started to learn about the mechanics of pixel art in particular.

### Why Pixel Art?

I am but one person working on a passion project game. Making a 3D game wasn't on the list of necessities for my grand idea, so I settled on making a 2D game instead. (One less dimension means one less way for things to go wrong, or so my thinking went.) With that choice made out of the box, I had to figure out a tool to create pixel art, and a very popular choice for that is Aseprite.

### Aseprite

[Aseprite](https://www.aseprite.org/) is a dedicated pixel art tool available for artists. I've made this my main tool for editing sprites, and I really enjoy the functionality of it. Animation frames, palette control, and pixel perfect drawing is all included, which makes it very convenient for pixel artwork.

The tool is inexpensive at $20, and can be downloaded for free if you have know-how about compiling from Github. However, other free alternatives for art exist that can also create pixel art, such as GIMP (a Photoshop alternative) and Krita (a free painter's tool).

## What to Avoid with Pixel Art

It doesn't matter what tool you use if you don't manage to avoid the pitfalls of creating pixel art. There a few main things you want to avoid when creating pixel art. (And if you want to know more, I highly recommend checking out [Pixel Logic: A Guide to Pixel Art](https://www.goodreads.com/book/show/43733848-pixel-logic---a-guide-to-pixel-art)).

### Jaggies

When you draw in such a small scale, you need to watch out for how your lines are constructed, or else the line will look clunky. Jaggies occur when the length of lines makes a line you want to appear smooth look jagged instead. An example of what this looks like and how to fix it is below:

![jaggies](/assets/jaggies.jpg)

### Banding

Banding happens when you try and shade an image perfectly around its border. This was something I intuitively did when I first started working with images and it made my art rough around the edges. Again, an example of what this looks like and how to avoid it is below. The biggest thing with banding is to try shading with different colors to avoid things looking blurry when zoomed out.

![banding](/assets/banding.png)

### Anti-Aliasing

The last point I found interesting in my pixel art journey (though there are many things) is anti-aliasing. It's a technique meant to make pixel art easier to decipher by blurring pixels around a color transition. There are pros and cons to using anti-aliasing, so it depends on the specific sprite you're working on whether or not you want to employ the technique.

![antialiasing](/assets/antialiasing.jpg)

## Conclusion

Overall, there's a lot of layers to trying to create pixel art that I haven't even touched on in this post. But much like any skill, the more it's practiced, the easier it gets to do.


text:
### TeleKt

Easy to use, asynchronous wrapper for the [Telegram Bot API](https://core.telegram.org/bots/api") (support [v4.3](https://core.telegram.org/bots/api#may-31-2019)) written in pure Kotlin. Inspired by [aiogram](https://github.com/aiogram/aiogram).

![logo](resources/logo.svg)

Table of content:
  * [Getting started](#getting-started)
  * [Writing your first bot](#writing-your-first-bot)
    * [Prerequisites](#prerequisites)
    * [A simple echo bot](#a-simple-echo-bot)
  * [General API Documentation](#general-api-documentation)
    * [Types](#types)
    * [Methods](#methods)
    * [General use of the API](#general-use-of-the-api)
      * [Message handlers](#message-handlers)
      * [bot.me](#bot.me)
      * [Reply markup](#reply-markup)
      * [Inline Mode](#inline-mode)
  * [Advanced use of the API](#advanced-use-of-the-api)
    * [Sending large text messages](#sending-large-text-messages)
    * [Using web hooks](#using-web-hooks)
    * [Logging](#logging)
  * [The Telegram Chat Group](#the-telegram-chat-groups-and-channel)
  * [Examples](#Examples)
  * [Bots using this API](#bots-using-this-api)
  * [Wrapping Notes](#wrapping-notes)
  * [TODO](#todo)
  * [Special thanks to](#special-thanks-to)

## Getting started.

Install to your project:

* Using Gradle.kts:
```kotlin
implementation("rocks.waffle.telekt:telekt:0.6.7")
```
Also this project uses [kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization), so you need to add kotlinx repository:
```kotlin
repositories {
    maven("https://kotlin.bintray.com/kotlinx")
}
```

_**Note**: While API is ready-to-use, it is still in **beta**. Any new version **can** break backward compatibility, see change logs and be careful._

## Writing your first bot

### Prerequisites

It is presumed that you [have obtained an API token with @BotFather](https://core.telegram.org/bots#botfather). We will call this token `TOKEN`.
Furthermore, you have basic knowledge of the Kotlin programming language and more importantly [the Telegram Bot API](https://core.telegram.org/bots/api).

### A simple echo bot

TeleKt splits **calling tg api methods** and **dispatching incoming updates**.

* For first feature there is class [Bot](telekt/src/main/kotlin/telekt/bot/Bot.kt) that encapsulates all API calls in a single class.
* For second — class [Dispatcher](telekt/src/main/kotlin/telekt/dispatcher/Dispatcher.kt) provide several ways to listen for incoming updates (e.g. messages).

Create a file called `echobot.kt`.
Then, open the file and create an instance of the `Bot` and `Dispatcher` classes.
```kotlin
import rocks.waffle.telekt.bot.*
import rocks.waffle.telekt.dispatcher.*

fun main() {
    val bot = Bot("TOKEN")
    val dp = Dispatcher(bot)
}
```
_Note: Make sure to actually replace TOKEN with your own API token._

After that declaration, we need to register some so-called message handlers. Message handlers define filters which a message must pass. If a message passes the filter, the passed function is called and the incoming message is passed as an argument.

Let's define a message handler which handles incoming `/start` and `/help` commands.
```kotlin
dp.messageHandler(CommandFilter("start", "help")) { message: Message ->
    bot.answerOn(message, "Howdy, how are you doing?")
}
```

Let's add another handler:
```kotlin
dp.messageHandler { message ->
    bot.answerOn(message, message.text ?: "this message has no text")
}
```
This one echoes all incoming text messages back to the sender. We doesn't pass any filters, so **all** messages will income here.
*Note: all handlers are tested in the order in which they were declared*

We now have a basic bot which replies a static message to "/start" and "/help" commands and which echoes the rest of the sent messages. To start the bot, add the following to our source file:
```kotlin
dp.poll()
```

Alright, that's it! Our source file now looks like this:
```kotlin
import rocks.waffle.telekt.bot.*
import rocks.waffle.telekt.dispatcher.*
import rocks.waffle.telekt.types.Message
import rocks.waffle.telekt.contrib.filters.CommandFilter

suspend fun main() {
// ^^^^ NOTE: this lib is async, so you need to run it from suspending funciton
    val bot = Bot("TOKEM")
    val dp = Dispatcher(bot)

    dp.messageHandler(CommandFilter("start", "help")) { message: Message ->
        bot.answerOn(message, "Hi there 0/")
    }

    dp.messageHandler { message ->
        bot.answerOn(message, message.text ?: "this message has no text")
    }

    dp.poll()
}

```
After running bot, test it by sending commands ('/start' and '/help') and arbitrary text messages.
Full example you can see at [there](examples/echobot)

## General API Documentation

### Types

All types are defined in [telekt.types](telekt/src/main/kotlin/telekt/types) package.
They are all completely in line with the [Telegram API's definition of the types](https://core.telegram.org/bots/api#available-types), except that all field renamed from `snake_case` to `camelCase` (like `message.message_id` => `message.messageId`). Thus, attributes such as `messageId` can be accessed directly with `message.messageId`.

The Message class also has a `contentType` attribute, which defines the type of the Message.

### Methods

All [API methods](https://core.telegram.org/bots/api#available-methods) are located in the [Bot](telekt/src/main/kotlin/telekt/bot/Bot.kt) class.

### General use of the API

Outlined below are some general use cases of the API.

#### Message handlers
A message handler is a function that is given to `messageHandler` function of a [Dispatcher](telekt/src/main/kotlin/telekt/dispatcher/Dispatcher.kt) instance.
Message handlers consist of 0, one or multiple filters.
Each filter's `test(...)` function must return `True` for a certain message in order for a message handler to become eligible to handle that message. A message handler is declared in the following way:
```kotlin
dp.messageHandler(*filters) { /* ... */ }

fun functionName(message: Message) { /* ... */ }

dp.messageHandler(*filters, block = ::functionName)
```
`functionName` is not bound to any restrictions. Any function name is permitted with message handlers. The function must accept at most one argument, which will be the message event that the function must handle.
`filters` is a vararg array of [Filter](telekt/src/main/kotlin/telekt/dispatcher/handler.kt)s.
One handler may have multiple filters.

There is also `DSL`-like builder for registration handlers:
```kotlin
dp.dispatch {
    messages {
        handle(/* filters here */) { /* message handler here */ }
    }

    callbackQuerys {
        handle(/* filters here */) { /* callback query handler here */ }
    }

    // and so on
}
```

**Important: all handlers are tested in the order in which they were declared**

All other handlers (callbackQuery, editedMessage, etc) work the same way.

#### Bot.me
[Bot](telekt/src/main/kotlin/telekt/bot/Bot.kt).me is lazy started coroutine builded with `async{}` builder that just calls `bot.getMe()`. Only bot creator can change bot user (via [BotFather](https://t.me/BotFather)) so in most cases it's safe to use it.
```kotlin
bot.me.await()
```
#### Reply markup
All `send<Something>` functions of [Bot](telekt/src/main/kotlin/telekt/bot/Bot.kt) take an optional `replyMarkup` argument.
This argument must be an instance of `ReplyKeyboardMarkup`, `InlineKeyboardMarkup`, `ReplyKeyboardRemove` or `ForceReply`, which are defined in [markup.kt](telekt/src/main/kotlin/telekt/types/replymarkup/markup.kt).

### Inline Mode

More information about [Inline mode](https://core.telegram.org/bots/inline).

Refer [Bot Api](https://core.telegram.org/bots/api#messageentity) for extra details

## Advanced use of the API

// TODO: write about
- dispatch modes (need to be implemented)
- FSM
- HandlerScope, HandlerContext

### Sending large text messages
Sometimes you must send messages that exceed 5000 characters. The Telegram API can not handle that many characters in one request, so we need to split the message in multiples. Here is how to do that using the API:
```kotlin
import rocks.waffle.telekt.util.splitByLenght

val largeText = "Really large text here"

// Split the text each 3000 characters.
// splitByLenght returns a list with the splitted text.
val texts = largeText.splitByLenght() // you can also pass different max lenght
texts.forEach { bot.sendMessage(chat_id, it) }
```

### Using web hooks

// TODO

### Logging

This lib is using [KotlinLogging](https://github/com/MicroUtils/kotlin-logging).
In examples we are using [logback](https://logback.qos.ch).

## F.A.Q.

No questions there yet, ask me something! :)

## The Telegram Chat Group(s) (and channel)

Get help. Discuss. Chat.

* Join the [TeleKt Telegram Chat Group](https://t.me/telektlib)
* Or join [Russian TeleKt Chat Group](https://t.me/telektru)
* Also join our [News Channel](https://t.me/telektnews)

## Examples

All examples are located in [examples](examples) directory
* [Echo bot](examples/echobot)
* [Dsl echo bot](examples/dslechobot)
* [Files](examples/files)
* [FSM](examples/fsm)
* [Inline buttons](examples/inlineButtons)
* [Keyboard](examples/keyboard)
* [Markdown](examples/markdown)

## Bots using this API
No one yet, you can become first!
Send a telegram message to [@wafflelapkin](https://t.me/wafflelapkin),
or send an email to<EMAIL_ADDRESS>or write in our [group](#the-telegram-chat-groups-and-channel),
or open an issue on [github](https://github.com/telekt/telekt/issues).

## Wrapping Notes
Note some things about tg bot api wrapping:

1. All methods that return `True` in tg bot api (like [unbanChatMember](https://core.telegram.org/bots/api#unbanchatmember)), in TeleKt return `Unit`
2. All [`edit*`](https://core.telegram.org/bots/api#updating-messages) methods splited in 2 overloads:
   1. For messages sent by the bot (return [`Message`](telekt/src/main/kotlin/telekt/types/common/Message.kt))
   2. For inline messages (return `Unit`)
3. All names have been changed to match with coding conventions
4. Some methods that accept const strings in tg bot api (like [sendChatAction](https://core.telegram.org/bots/api#sendchataction)), in TeleKt accept enums
5. All `chatId` params is of type [`Recipient`](telekt/src/main/kotlin/telekt/util/Recipient.kt) cause Kotlin haven't algebraic types.

## TODO

Things between 'now' and 'release 1.0'

* [ ] Webhooks
  - [X] Receiving updates
  - [ ] Answer into webhook
  - [ ] Add option to get current webhook state (Running, Stopped, Closed) (?)
* [ ] Middlewares (like in [aiogram](https://github.com/aiogram/aiogram))
  - [ ] Implement middlewares
  - [ ] Write some built-in middlewares
    + [ ] timeit
    + [ ] logging
    + [ ] i18n (?)
* [ ] Add more examples
* [ ] Docs
* [ ] Write more comments in code
  - [ ] Write comments in telegram types
  - [ ] Write comments everywhere else
* [ ] Add more storages
  - [ ] Mongo db
  - [ ] PostrgeSQL
* [ ] Safe update dispatching (with different `Dispatcher`?)
* [ ] Anti-spam and/or api request limits handling

## Special thanks to
* [gt22](https://github.com/gt22) and [mrAppleXZ](https://github.com/mrAppleXZ) from pearx team — for answering my stupid questions
* Russian [Kotlin Community](https://t.me/kotlin_lang) in telegram — also for answering my stupid questions
* [Alex Root Junior](https://github.com/JrooTJunior) — for writing [aiogram](https://github.com/aiogram/aiogram)
* [Dmitriy Shilnikov](https://t.me/dshilnikov) — for fixing jackson deserialization (Actually now TeleKt use kotlinx.serialization instead of jackson, but anyway thanks)
* [afdw](https://github.com/afdw) — for cleaning `logo.svg`
* My parents — for love and support :heart:

repository: telekt/telekt

gha_language: Kotlin

repo_name: telekt/telekt


text:
# [Labellab Components](https://labellab.io/) · [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/kev71187/labellab-components/blob/master/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/kev71187/labellab-components/pulls)

Labellab Components is a JavaScript library for providing a ui to label images, text, video, audio.

 We have open sourced this to facilitate ownship of your data once labeled.

* **Unified UI and labels:** Labellab Components makes it painless to generate labeled datasets.

## Documentation

You can find the Labellab Components documentation [on the website](http://components.labellab.io/index.html).

## Contributing

The main purpose of this repository is to continue to evolve how we label Datasets, making it faster and easier to use.

### Current Feature Set
* Text - document classification
* Image - document classification, box tool, polygon tool

### Install

```
npm install labellab-components --save
```

### Screenshots
* Classify Images

```javascript
  <Labeler
    url="https://www.hakaimagazine.com/wp-content/uploads/header-bald-eagle-nests.jpg"
    fileType="image"
    labelChoices={["bug","whale","bird","dog","cat","human"]}
    onComplete={(labels) => {
      console.log(labels)
    }}
    onReject={() => {
      console.log("rejected")
    }}
  />
```

* Box and Classify Images

```javascript
  <Labeler
    url="http://www.nba.com/media/history/chamberlain_reb_200.jpg"
    fileType="image"
    labelGeometry="box"
    labelChoices={["basketball","head","foot","arm","body"]}
    onComplete={(labels) => {
      console.log(labels)
    }}
    onReject={() => {
      console.log("rejected")
    }}
  />
```

* Polygon and Classify Images

```javascript
  <Labeler
    url="https://images.pond5.com/girl-driving-motorcycles-first-person-footage-084718933_prevstill.jpeg"
    fileType="image"
    labelGeometry="polygon"
    labelChoices={["car","motorcycle","road","person","body","stopped","outbound","inbound"]}
    onComplete={(labels) => {
      console.log(labels)
    }}
    onReject={() => {
      console.log("rejected")
    }}
  />
```

### Roadmap of Features
* Text - word classification
* Audio - time series classification
* Video - time series classification, polygon tool for frames

### Running Locally
```
  docker-compose run label npm install
  docker-compose up
```

### License

Labellab Components is [MIT licensed](./LICENSE).

gha_language: JavaScript


text:
# .NET Verity SDK

This is the .Net SDK for Evernym's Verity application.

Instructions for setting up your .NET development environment to use the Verity SDK.

## Prerequisites

Install the following items:

* `.NET Core 3.1` -- Install .Net Core 3.1. Follow the instructions on the
[Microsoft website](https://docs.microsoft.com/en-us/dotnet/core/install/).

* `libindy` -- Install a stable version. Follow the instructions on the
[indy-sdk Github Project Page](https://github.com/hyperledger/indy-sdk#installing-the-sdk).

* `Mono` -- Install Mono (if you are using Ubuntu or Mac). Follow the instructions on the
[Mono website](https://www.mono-project.com/download/stable/).

## How to build

### Ubuntu based distributions (Ubuntu 18.04)

Open terminal at location "\verity-sdk\sdk\dotnet-sdk"

#Restore nuget-packages for project:

```sh
dotnet restore
```

#Build SDK:

```sh
dotnet build --configuration release
```
or
```sh
dotnet publish --configuration release
```

Compiled files will be placed in "bin\release\netstandart2.0"

#Build nuget-package:

```sh
dotnet pack --configuration release
```

Compiled files will be placed in "bin\release\Evernym.Verity.SDK.{version}.nupkg"

#Run tests:

```sh
dotnet test --logger "console;verbosity=detailed"
```

### Windows

Simply build the VeritySDK.sln file using Visual Studio, msbuild, dotnet or whatever build system your .NET implementation and platform supports.
The unit-tests can be run using the 'dotnet test' command or by using Test Explorer in Visual Studio.
The project also includes a NuGet package definition which can be built using the 'dotnet pack' command or by choosing publish on the project in Visual Studio.

### Using the SDK

The .NET SDK can be used in any .NET project by referencing the NuGet package which can be built using the instructions above or obtained from the
[nuget.org](https://www.nuget.org/packages/Evernym.Verity.SDK) package repository.

repository: Msalous/verity-sdk

repo_name: Msalous/verity-sdk