text:
# Needpedia
Needpedia's goal is to create a community of devs who use it's "Layer System" and other tools to collaborate directly with users to optimize Needpedia, while others use it to optimize countless different things in the world. It can be used to do anything from support a volunteer organization halfway accross the world,  to making public all problems with an evil corporation in your own backyard. Which is why it needs to be an Open Source community instead of a business. (Most sponsors aren't going to like that)

That said, the tools we're making for activists and scientists can also be used for respectable/ethical businesses, so once Needpedia's doing well we plan on creating a separate, worker-owned, for-profit business that specializes in using the tools we've made here to serve businesses, and generate funding for legal defense, (for Needpedia).

 Needpedia has an FAQ section here: https://needpedia.org/faq
 and a 'how to' section on the homepage at Needpedia.org

*Please also remember that Needpedia's dev community is the backbone of this entire operation, so if there is Anything I can do to support you, or that we can add to this project to make it work better, I definitely want to know. My personal email address is<EMAIL_ADDRESS>- Even if I can't answer your question I can probably find someone who can.
      -Anthony Brasher, Needpedia's founder

## Development
Before starting, it is important you have the desired environment, you'll need to install
- Ruby (instructions for your operating system can be found here https://www.ruby-lang.org/en/documentation/installation/)
- PostgresQL (download instructions are here https://www.postgresql.org/)
- Node.js (Find the installation instructions at the Node.js website https://nodejs.org/en/download/)
- Yarn (To install Yarn, follow the installation instructions at the Yarn website https://classic.yarnpkg.com/en/docs/install)

Once you have all these installed on your local machine, you can follow the bellow steps to setup this project locally

- clone the repo
- bundle install
- create DB, run command rails db:create
- run migrations, run command: rails db:migrate

## Environment variables for for development
RECAPTCHA_SECRET_KEY=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI

#### Optional

GENERAL_AREA_ID=1 (where 1 is the DB id of any Area post)

GENERAL_PROBLEM_ID=2 (where 2 is the DB id of any Area post)

*****Additional Documentation

---Milestone 105: Create Curated Posts and Upgrade Search Page
-Milestone description: https://docs.google.com/document/d/1DZJTUHFfsIuhQ6LlNM6HXx6WjZq5jSsQaO7wQseWMs8/edit?usp=sharing
-Milestone documentation: https://docs.google.com/document/d/1lp530HkuAmWH5P2A5-nVEeg66fLvoQtlT7bUJFlxVnQ/edit?usp=sharing

---M106: Create [wiki post] Buttons and Limit Size of Wiki Posts in Lists
-Milestone description: https://docs.google.com/document/d/1JiPESiUPhGrHMQJRTc0LXsB2k9mAp884s_rgzn_J51c/edit?usp=sharing
-Milestone documentation: https://docs.google.com/document/d/1SN7N7ETLNs0nIISQPwhB0E0DrYMbEICVm_adWo8GjSc/edit?usp=sharing


text:
# Symbolic Differentiation of Prefix Expressions

## Instructions

In this kata your task is to differentiate a mathematical expression given as a
string in prefix notation. The result should be the derivative of the
expression returned in prefix notation.

To simplify things we will use a simple list format made up of parenthesis and
spaces.
- The expression format is (func arg1) or (op arg1 arg2) where op means
operator, func means function and arg1, arg2 are arguments to the operator or
function.
  - For example (+ x 1) or (cos x)
- The expressions will always have balanced parenthesis and with spaces between
list items.
- Expression operators, functions and arguments will all be lowercase.
- Expressions are single variable expressions using `x` as the variable.
- Expressions can have nested arguments at any depth for example
`(+ (* 1 x) (* 2 (+ x 1)))`.

Examples of prefix notation in this format:
```
(+ x 2)        // prefix notation version of x+2

(* (+ x 3) 5)  // same as 5 * (x + 3)

(cos (+ x 1))  // same as cos(x+1)

(^ x 2)        // same as x^2 meaning x raised to power of 2
```

The operators and functions you are required to implement are
`+ - * / ^ cos sin tan exp ln` where `^` means raised to power of. `exp` is the
exponential function (same as `e^x`) and `ln` is the natural logarithm (base e).

### Examples

Example of input values and their derivatives:
```
(* 1 x) => 1

(^ x 3) => (* 3 (^ x 2))

(cos x) => (* -1 (sin x))
```

### Notes

In addition to returning the derivative your solution must also do some
simplifications of the result but only what is specified below.
- The returned expression should not have unecessary 0 or 1 factors. For
example it should not return `(* 1 (+ x 1))` but simply the term `(+ x 1)`
similarly it should not return `(* 0 (+ x 1))` instead it should return just
`0`.
- Results with two constant values such as for example `(+ 2 2)` should be
evaluated and returned as a single value `4`.
- Any argument raised to the zero power should return `1` and if raised to 1
should return the same value or variable. For example `(^ x 0)` should return
`1` and `(^ x 1)` should return `x`.
- No simplifications are expected for functions like `cos`, `sin`, `exp`,
`ln`... (but their arguments might require a simplification).

Think recursively and build your answer according to the
[rules of derivation](http://www.rapidtables.com/math/calculus/derivative.htm)
and sample test cases.

If you need to diff_ref_02 any test expressions you can use
[Wolfram Alpha](http://www.wolframalpha.com/) however remember we use prefix
format in this kata.

Best of luck !

license: MIT

path: /Python/2 kyu/Symbolic Differentiationof Prefix Expressions/instructions.md

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Block Farm

A farming game built upon Ethereum platform.

![image](https://github.com/johnhckuo/Block-Farm/blob/master/cover.gif)

## Getting Started

### Prerequisites

#### 1. TestRPC
```
npm install -g ethereumjs-testrpc
```

#### 2. Truffle
```
npm install -g truffle
```

#### 3. Meteor
```
curl https://install.meteor.com/ | sh
```

## Running the DApp

First, you need get your own ethereum client node. And the easiest way to do this is either installing light-weight ethereum wallet or using testrpc. In our case, we use testrpc by typing the following command in to your terminal/command line:
```
testrpc
```
Now, you need to deploy the smart contracts to the local private chain you just set up. We've already wrote a script to get all the trivial things done. For Mac/Linux users, just go to the `Block-Farm` directory and execute the script by typing:
```
sh truffle/Compile.sh
```
For Windows users, please type:
```
truffle/Compile.bat
```
It should take a while for truffle to deploy all the contracts to testrpc. Once it is done, There should be all the address of each contract shown on the console, just copy them and update the default contract address in `app/client/lib/contract.js`.

After finishing all these steps, change your current path to the `app` folder and execute:
```
meteor npm install
```
Then type the following command to start buliding our app
```
meteor
```
Congratulations! Now just type `localhost:3000` in your web browser and you are good to go!

## Contributing

Please read [CONTRIBUTING.md](https://gist.github.com/johnhckuo/a08fc77a28d2addd0082a8bf54178421) for details on our code of conduct, and the process for submitting pull requests to us.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

repository: meanMonk/Block-Farm

repo_name: meanMonk/Block-Farm


text:
# tslint-jasmine-rules

tslint rules for jasmine tests

## Install

`npm install tslint-jasmine-rules --save-dev`

Then reference the rules in your `tslint.json` and enable the rules you want:
```json
{
  "extends": [
    "tslint-jasmine-rules"
  ],
  "rules":{
  }
}
```

## Available rules

```json
{
  "no-focused-tests": true,
  "no-disabled-tests": true,
  "expect-length": true
}
```

## Fixable

The following rules are fixable:
* no-focused-tests
* no-disabled-tests

Fixes are __not__ applied when `"severity": "warning"` is used.

repository: kaiza/tslint-jasmine-rules

gha_language: TypeScript

gha_license_id: MIT

repo_name: kaiza/tslint-jasmine-rules


text:
# Acquia SDK for PHP

[![Build Status](https://travis-ci.org/acquia/acquia-sdk-php.png?branch=master)](https://travis-ci.org/acquia/acquia-sdk-php)
[![Coverage Status](https://coveralls.io/repos/acquia/acquia-sdk-php/badge.png?branch=master)](https://coveralls.io/r/acquia/acquia-sdk-php?branch=master)
[![Latest Stable Version](https://poser.pugx.org/acquia/acquia-sdk-php/v/stable.png)](https://packagist.org/packages/acquia/acquia-sdk-php)

The Acquia SDK for PHP allows developers to [build](https://www.youtube.com/watch?v=8wDSj18sXbg)
applications on top of [Acquia](https://www.acquia.com/) services.

Acquia provides open cloud hosting, developer tools and world-class support for
Drupal, the open source content management platform that unifies content,
community and commerce.

## Installation

The SDK can be installed with [Composer](http://getcomposer.org) by adding this
library as a dependency to your composer.json file.

```json
{
    "repositories": [
        {
            "type": "pear",
            "url": "pear.php.net"
        }
    ],
    "require": {
        "acquia/acquia-sdk-php": "*"
    }
}
```

After running `php composer.phar update` on the command line, include the
autoloader in your PHP scripts so that the SDK classes are made available.

```php
require_once 'vendor/autoload.php';
```

#### Take Only What You Need

Instead of downloading the entire SDK, it is recommended to take only what you
need by requiring the individual components you intend to use. For example, the
following code requires the Acquia Search component and it's dependencies.

```json
{
    "require": {
        "acquia/acquia-sdk-php-search": "*"
    }
}
```

## Usage

Basic usage examples for the SDK.

### Cloud API

The [Cloud API](https://docs.acquia.com/cloud/api) is a web service that that
developers can use to extend, enhance, and customize
[Acquia Cloud](https://www.acquia.com/products-services/acquia-cloud).

```php
use Acquia\Cloud\Api\CloudApiClient;

$cloudapi = CloudApiClient::factory(array(
    'username' => 'xxx...',  // Email address used to log into the Acquia Network
    'password' => 'xxx...',  // Acquia Network password
));

$sites = $cloudapi->sites();
```

### Acquia Cloud Database

The Database component allows developers to connect to the active master
database when running applications on [Acquia Cloud](https://www.acquia.com/products-services/acquia-cloud).

```php
use Acquia\Cloud\Database\Database;

$database = new Database();
$creds = $database->credentials('mydatabase');

$dbh = new PDO($creds, $creds->username(), $creds->password());

```

### Acquia Network

The [Acquia Network](https://www.acquia.com/products-services/drupal-support-and-cloud-services)
is a comprehensive suite of tools to help you create and manage killer web
sites, backed by the best Drupal support team in the world.

```php
use Acquia\Network\AcquiaNetworkClient;
use Acquia\Common\Services;

$network = AcquiaNetworkClient::factory(array(
    'network_id' => 'XXXX-XXXXX',  // Acquia Network identifier
    'network_key' => 'xxxxxx...',  // Acquia Network key
));

// Enable Acquia Search and return index information.
$acquiaServices = Services::ACQUIA_SEARCH;

$subscription = $network->checkSubscription($acquiaServices);
print $subscription->getDashboardUrl();
```

### Acquia Search

[Acquia Search](https://www.acquia.com/products-services/acquia-network/cloud-services/acquia-search)
is a fully managed enterprise site search solution built on Apache Solr and
other open source technologies.

```php
use Acquia\Search\AcquiaSearchService;

// A subscription can have multiple indexes. The Acquia Search service builder
// generates credentials and clients for all of the subscription's indexes.
$search = AcquiaSearchService::factory($subscription);

$index = $search->get('XXXX-XXXXX');
$results = $index->select('my keywords');
```

Refer to the [PSolr](https://github.com/cpliakas/psolr) project's documentation
for more advanced usage examples.

*Recommended*: Use the Service Manager to store credentials so that you don't have
to query the Acquia Network on every search request.

## The Acquia Service Manager

The Acquia Service Manager simplifies credential management and client
instantiation. The credential management system is built using
[Guzzle's service builder](http://docs.guzzlephp.org/en/latest/webservice-client/using-the-service-builder.html)
subsystem, so the documentation and techniques can also apply here.

### Saving Credentials

The following example saves the configurations for the client to JSON files in
the specified directory. Note that the Acquia Search client is a service
builder which is why we use the `setBuilder` method for it.

```php
use Acquia\Common\ServiceManager;

$services = new ServiceManager(array(
    'conf_dir' => '/path/to/conf/dir',
));

$services
    ->setClient('cloudapi', 'mysite', $cloudapi)
    ->setClient('network', 'XXXX-XXXXX', $network)
    ->setBuilder('search', $search)
;

$services->save();
```

### Instantiating Service Clients

Clients can now be instantiated from the service manager by passing the service
group (e.g. "network", "search", etc.) and service name defined in the
`setClient()` method. For Acquia Search, the service builder automatically
names the clients after their index identifiers.

```php

use Acquia\Common\ServiceManager;

$services = new ServiceManager(array(
    'conf_dir' => '/path/to/conf/dir',
));

$cloudapi = $services->getClient('cloudapi', 'mysite');
$network = $services->getClient('network', 'XXXX-XXXXX');
$index = $services->getClient('search', 'XXXX-XXXXX');

```

## For Developers

Refer to [PHP Project Starter's documentation](https://github.com/cpliakas/php-project-starter#using-apache-ant)
for the Apache Ant targets supported by this project.

repository: Zlender/acquia-sdk-php

repo_name: Zlender/acquia-sdk-php


text:
## Contents ##

### jzos-install.txt ###

A sample Maven command to install the ibmjzos.jar in the local repository.

This jar is distributed with the IBM Java installation. Several of the samples have ibmjzos as a Maven dependency. You need to obtain ibmjzos.jar according to your IBM license. This command will install it into the local Maven repository so it will be found when Maven resolves dependencies.

### compress ###
Compress and decompress z/OS sequential datasets using gzip compatible compression.
### show-classpath ###
A simple program to help diagnose classpath programs
### z-mail ###
Send email from a z/OS batch job.


text:
# xmrig-nvidia docker container

[![Docker Stars](https://img.shields.io/docker/stars/patsissons/xmrig-nvidia.svg)](https://hub.docker.com/r/patsissons/xmrig-nvidia/) [![Docker Pulls](https://img.shields.io/docker/pulls/patsissons/xmrig-nvidia.svg)](https://hub.docker.com/r/patsissons/xmrig-nvidia/) [![Docker Build Status](https://img.shields.io/docker/build/patsissons/xmrig-nvidia.svg)](https://hub.docker.com/r/patsissons/xmrig-nvidia/)

This container allows running [xmrig-nvidia](https://github.com/xmrig/xmrig-nvidia) in a docker container. You need to have already installed [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) to enable passthru on the nvidia card(s). You will also need to have the [`cuda-drivers`](https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64) installed. Run the docker container with `--runtime=nvidia` to enable the passthrough.

### Tags

CUDA driver versions correspond to the following tags

- [10.0](https://github.com/patsissons/xmrig-nvidia-docker/tree/10.0) ([latest](https://github.com/patsissons/xmrig-nvidia-docker/tree/master))
- [9.2](https://github.com/patsissons/xmrig-nvidia-docker/tree/9.2)
- [9.1](https://github.com/patsissons/xmrig-nvidia-docker/tree/9.1)
- [9.0](https://github.com/patsissons/xmrig-nvidia-docker/tree/9.1)

### CUDA drivers

Installing cuda drivers on [ubuntu 16.04](https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=debnetwork) is the easiest way to get things going. You can install the drivers with `apt-get install --no-install-recommends cuda-drivers`. Make sure to reboot after installing new drivers.

If you have an NVIDIA graphics card in your docker host, you can leverage this card to provide additional hashing power. `xmrig-nvidia` can be used in parallel with the cpu miner.

## Docker

This docker image in available on [docker hub](https://hub.docker.com/r/patsissons/xmrig-nvidia/).

This image uses the official [`nvidia/cuda:10.0-base`](https://hub.docker.com/r/nvidia/cuda/) image for the base, so we always have the latest nvidia cuda infrastructure in place.

## Example

```bash
# run a dockerized miner
# -o and all following arguments are passed to the xmrig-nvidia miner process
docker run --runtime=nvidia -it -d --name xmrig-nvidia patsissons/xmrig-nvidia -o ca.minexmr.com:5555 --donate-level 1 -u 47NHecs6qjvDcbx3eW6cDGDwdm3gDqbHs7G8hzPYRxf3YRTcDJw8kXhDxfHinsjHUwVwdFusSn76UHkaz68KurUgHvFmPMH.github -p x -k
```

## Compatibility

Currently `nvidia-docker` only works in linux, this may change as `nvidia-docker` evolves. This means that this container works best on a bare metal docker host or a linux based virtual machine docker host (I think `VT-d` is necessary for a virtual machine docker host).

## Building

A [Dockerfile](https://github.com/patsissons/xmrig-nvidia-docker/blob/master/build/Dockerfile) is also included for [building](https://github.com/patsissons/xmrig-nvidia-docker/tree/master/build) the `xmrig-nvidia` app. See the [README](https://github.com/patsissons/xmrig-nvidia-docker/tree/master/build/README.md) for more detailed instructions on how to build the runtime container.

## Donations

If you find this docker image useful, donations for work on dockerizing the build and mining app are appreciated at any of the folllowing addresses:

- BTC: `1LNY9wSPs913Y9jXMTrrVze1E41nhm6Qv7`
- LTC: `LhnwdbrnQaQbjDkqxXFmxXGPcFhMBA9gFu`
- ETH: `a05c67acbec8afc30287704540b215284a7c21a9`
- XMR: `47NHecs6qjvDcbx3eW6cDGDwdm3gDqbHs7G8hzPYRxf3YRTcDJw8kXhDxfHinsjHUwVwdFusSn76UHkaz68KurUgHvFmPMH`
- XRP: `rG9vAB1rbgDW3Ds7HFqJeF9Pi4fGRbEs93`

repository: patsissons/xmrig-nvidia-docker

gha_language: Shell

repo_name: patsissons/xmrig-nvidia-docker


text:
---
sidebar: auto
title: Document Search with Algolia
date: 2020-01-09 19:34:12
excerpt: |
  Overview of how to enable Algolia document search with the VuePress default
  theme and srape your site using the provided Docker image to facilitate a full
  text search experience.
type: post
blog: true
tags:
    - Algolia
    - Docker
    - VuePress
---

# January 9th, 2020

## Document Search with Algolia

[Algolia](https://www.algolia.com/) provides a simple to use, full-text search
API; that lucky for us, is supported by the default VuePress theme.

In order to integrate with that functionality we need to make an account with
Algolia and create an index. Then we need to copy our "Seach-Only API Key",
"Application ID", and chosen index name into our VuePress theme config.

### VuePress config.js
```javascript
themeConfig: {
  algolia: {
    apiKey: '692c04c8f1e443e098cfb2511ab8c99b',
    appId: '2SM2BJA0PV',
    indexName: 'ethanaa'
  }
}
```

Next we need to create a docsearch-scraper config that will instruct the Algolia
scraper on how to index our site.

### docsearch-scraper CONFIG
```json
{
  "index_name": "ethanaa",
  "start_urls": [
    "https://ethanaa.com/"
  ],
  "stop_urls": [],
  "selectors": {
    "lvl0": {
      "selector": "p.sidebar-heading.open",
      "global": true,
      "default_value": "Documentation"
    },
    "lvl1": ".theme-default-content h1",
    "lvl2": ".theme-default-content h2",
    "lvl3": ".theme-default-content h3",
    "lvl4": ".theme-default-content h4",
    "lvl5": ".theme-default-content h5",
    "text": ".theme-default-content p, .theme-default-content li",
    "lang": {
      "selector": "/html/@lang",
      "type": "xpath",
      "global": true,
      "default_value": "en-US"
    }
  },
  "strip_chars": " .,;:#",
  "custom_settings": {
    "attributesForFaceting": [
      "lang"
    ]
  }
}
```

Save the config to a file and then use `jq` to reduce it to a single line:

```bash
cat ethanaa.json | jq -r tostring
```

Create a `.env` file:

```bash
APPLICATION_ID=2SM2BJA0PV
API_KEY=${Admin API Key}
CONFIG={"index_name":"ethanaa","start_urls":["https://ethanaa.com/"],"stop_urls":[],"selectors":{"lvl0":{"selector":"p.sidebar-heading.open","global":true,"default_value":"Documentation"},"lvl1":".theme-default-content h1","lvl2":".theme-default-content h2","lvl3":".theme-default-content h3","lvl4":".theme-default-content h4","lvl5":".theme-default-content h5","text":".theme-default-content p, .theme-default-content li","lang":{"selector":"/html/@lang","type":"xpath","global":true,"default_value":"en-US"}},"strip_chars":" .,;:#","custom_settings":{"attributesForFaceting":["lang"]}}
```

Finally, run the docsearch-scraper docker image against your `.env` file:

```bash
docker run -it --env-file=.env algolia/docsearch-scraper
```

The site will then be scraped and the index updated in Algolia.

```bash
> DocSearch: https://ethanaa.com/ 111 records)
> DocSearch: https://ethanaa.com/blog/ 72 records)

Nb hits: 183
```

![Algolia Index](./img/algolia_index.png)

Give the search bar a try to see the results in action!

<ClientOnly>
  <Disqus shortname="ethanaa" />
</ClientOnly>

repository: lunias/ethanaa-vuepress

repo_name: lunias/ethanaa-vuepress


text:
DohUtil
========

[![Build Status](https://travis-ci.org/atpsoft/dohutil.png)](https://travis-ci.org/atpsoft/dohutil)
[![Code Climate](https://codeclimate.com/github/atpsoft/dohutil.png)](https://codeclimate.com/github/atpsoft/dohutil)

DohUtil is a library designed to help simplify application development (includes location / etc.), and for miscellaneous ruby enhancements.

Sample code exists in the sample directory.  If you run it like so:

``` ruby
sample/sample.rb -b override-arg-2 1 2 3
```

The output will look like:
``` text
importing sample_library_file
argument1 is: defaultvalue
argument2 is: override-arg-2
varargs: ["1", "2", "3"]

```

repository: atpsoft/dohutil

repo_name: atpsoft/dohutil


text:
# Extensions

Extensions mechanism allows creating complex user scenarios, especially in case of customized setups or permissioned networks.

## Extension developer's guide:

- Create new NetCore 3.1 library project in VisualStudio.
- Add references to Centaurus.Domain and Centaurus.Common projects.
- Implement `IExtension` interface from Centaurus.Domain project.
- Subscribe to one or more [events](#extension-points) of `Global.ExtensionsManager` instance.
- Create an extension [configuration file](#config-file)  and place the extension dll file to the same folder.
- Specify the path to the extension config file using `--extensions_config_file_path path-to-config` param while starting Alpha and auditors.

## Config file

### Config is a json file with only one (for now) property:

- **`extensions`** (`Array<ExtensionItem>`) - Array of extension items.

### Each extension item consists of:

- **`name`** (`string`) - This is dll name without `dll` extension. The extension engine will look for a library with this name.
- **`isDisabled`** (`bool`) - You can disable extension by setting this property to `true`. Default value is `false`.
- **`extensionConfig`** (`object`) - Config for the extension – plain string key-value pairs. This object will be deserialized as `Dictionary<string, string>` and passed to `IExtension.Init` method.

## Extension points

All events are executed synchronously within client connection (not blocking other connections or affecting quantum processing), except `OnBeforeQuantumHandle` and `OnAfterQuantumHandle` – these two events are executed synchronously in the context of the entire quantum processing pipeline.

Events                   | Arguments
-------------------------|-----------
`OnNewConnection`        | `WebSocket` webSocket, `string` ip
`OnConnectionValidated`  | `BaseWebSocketConnection` connection
`OnBeforeValidateMessage`| `BaseWebSocketConnection` connection, `MessageEnvelope` message
`OnAfterValidateMessage` | `BaseWebSocketConnection` connection, `MessageEnvelope` message
`OnBeforeHandleMessage`  | `BaseWebSocketConnection` connection, `MessageEnvelope` message
`OnAfterHandleMessage`   | `BaseWebSocketConnection` connection, `MessageEnvelope` message
`OnHandleMessageFailed`  | `BaseWebSocketConnection` connection, `MessageEnvelope` message, `Exception` exception
`OnBeforeSendMessage`    | `BaseWebSocketConnection` connection, `MessageEnvelope` message
`OnAfterSendMessage`     | `BaseWebSocketConnection` connection, `MessageEnvelope` message
`OnSendMessageFailed`    | `BaseWebSocketConnection` connection, `MessageEnvelope` message, `Exception` exception
`OnBeforeConnectionClose`| `BaseWebSocketConnection` connection
`OnBeforeNotify`         | `RawPubKey` pubKey, `MessageEnvelope` envelope
`OnBeforeNotifyAuditors` | `MessageEnvelope` envelope
`OnBeforeQuantumHandle`  | `MessageEnvelope` quantum
`OnAfterQuantumHandle`   | `ResultMessage` resultMessage

repository: centaurus-project/centaurus

gha_language: C#

repo_name: centaurus-project/centaurus


text:
---
id: version-0.67.0-extend-setup
title: Development Setup
sidebar_label: Development Setup
original_id: extend-setup
---

Pipeline elements in StreamPipes are provided as standalone microservices. New pipeline elements can be easily developed using the provided Maven archetypes and can be installed in StreamPipes at runtime.

In this section, we describe our recommended minimum setup for locally setting up a development instance of StreamPipes needed to develop, run and test new pipeline elements.

## IDE & required dev tools
StreamPipes does not have specific requirements on the IDE - so feel free to choose the IDE of your choice.
The only requirements in terms of development tools are that you have Java 8 and Maven installed.

## StreamPipes CLI: Docker-based local StreamPipes instance
In order to quickly test developed pipeline elements without needing to install all services required by StreamPipes, we provide a CLI tool that allows you to selectively start StreamPipes components.
The CLI tool allows to switch to several templates (based on docker-compose) depending on the role.

The documentation on the usage of the CLI tool is available [here](06_extend-cli.md).
## Starter projects

Now, once you've started the development instance, you are ready to develop your very first pipeline element.
Instead of starting from scratch, we recommend using our provided maven archetypes:

### Maven archetypes

Create the Maven archetype as described in the [Getting Started](06_extend-archetypes.md) guide.

### Examples

We provide several examples that explain the usage of some concepts in this [Github repo](https://github.com/apache/incubator-streampipes-examples).

repository: obermeier/incubator-streampipes-website

repo_name: obermeier/incubator-streampipes-website


text:
## TODO

### Priority Engine items.
* Rewrite Mesh2D and move things into a more centralized renderer.
* Add support for merged mounts in the VFS.
* Rewrite the code to actually use the VFS.
* Setup a way to enable optional opengl extensions for potentially better performance.
* Text rendering support using either freetype, or stb_truetype.
* fmtlib would be a useful to add support for along side text rendering.
* Audio playback with libsoundio.
* OGG/Vorbis file loader with either libogg/libvorbis or stb_vorbis.
* A configuration file system
* Basic way of making a UI.

### The want list.
* Maybe add support for midi writing?
* Sound pitchshift/timewarp support with libsoundtouch.
* Advanced UI that could be used to build in-game score meters, and fancy stuff.

repository: fervi/OpenRhythm

repo_name: fervi/OpenRhythm


text:
#Mesos Slave with Java 7 and Hadoop CLI

Mesos slave image based on this [Mesos Slave Image](https://registry.hub.docker.com/u/redjack/mesos-slave/). I've added Java 7 and Hadoop CLI. It allows to download binaries for mesos task from HDFS. I've used this slave together with [Mesos Master Image](https://registry.hub.docker.com/u/redjack/mesos-master/) and [Zookeeper Image](https://registry.hub.docker.com/u/jplock/zookeeper/)

###Execution
Get docker image

    docker pull chalimartines/mesos-slave

Run image with specified port mapping and support for docker containers as mesos task (it requeires running zookeeper image with name zookeeper)

    docker run -d --name slave-mesos -e MESOS_LOG_DIR=/var/log -e MESOS_HOSTNAME=localhost -e MESOS_MASTER=zk://zookeeper:2181/mesos -e MESOS_EXECUTOR_REGISTRATION_TIMEOUT=5mins -e MESOS_ISOLATOR=cgroups/cpu,cgroups/mem -e MESOS_CONTAINERIZERS=docker,mesos -v /var/run/docker.sock:/var/run/docker.sock -v /sys:/sys -v /proc:/proc -p 5051:5051 --link zookeeper:zookeeper chalimartines/mesos-slave

If you are Mac OS user with boot2docker and you would like to get from your local system to a cdh container add these port forwardings

    VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port5050,tcp,,5050,,5050"

repository: chali/mesos-slave-docker

repo_name: chali/mesos-slave-docker


text:
## Prerequisites

- Linux or macOS (Windows is in experimental support)
- Python 3.6+
- PyTorch 1.3+
- CUDA 9.2+ (If you build PyTorch from source, CUDA 9.0 is also compatible)
- GCC 5+
- [MMCV](https://mmcv.readthedocs.io/en/latest/#installation)

The compatible MMSegmentation and MMCV versions are as below. Please install the correct version of MMCV to avoid installation issues.

| MMSegmentation version |        MMCV version        |
|:----------------------:|:--------------------------:|
|         master         |  mmcv-full>=1.4.4, <1.5.0  |
|         0.21.0         |  mmcv-full>=1.4.4, <1.5.0  |
|         0.20.0         | mmcv-full>=1.3.13, <1.5.0  |
|         0.19.0         | mmcv-full>=1.3.13, <1.3.17 |
|         0.18.0         | mmcv-full>=1.3.13, <1.3.17 |
|         0.17.0         | mmcv-full>=1.3.7, <1.3.17  |
|         0.16.0         | mmcv-full>=1.3.7, <1.3.17  |
|         0.15.0         | mmcv-full>=1.3.7, <1.3.17  |
|         0.14.1         | mmcv-full>=1.3.7, <1.3.17  |
|         0.14.0         |  mmcv-full>=1.3.1, <1.3.2  |
|         0.13.0         |  mmcv-full>=1.3.1, <1.3.2  |
|         0.12.0         |  mmcv-full>=1.1.4, <1.3.2  |
|         0.11.0         |  mmcv-full>=1.1.4, <1.3.0  |
|         0.10.0         |  mmcv-full>=1.1.4, <1.3.0  |
|         0.9.0          |  mmcv-full>=1.1.4, <1.3.0  |
|         0.8.0          |  mmcv-full>=1.1.4, <1.2.0  |
|         0.7.0          |  mmcv-full>=1.1.2, <1.2.0  |
|         0.6.0          |  mmcv-full>=1.1.2, <1.2.0  |

:::{note}
You need to run `pip uninstall mmcv` first if you have mmcv installed.
If mmcv and mmcv-full are both installed, there will be `ModuleNotFoundError`.
:::

## Installation

a. Create a conda virtual environment and activate it.

```shell
conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab
```

b. Install PyTorch and torchvision following the [official instructions](https://pytorch.org/).
Here we use PyTorch 1.6.0 and CUDA 10.1.
You may also switch to other version by specifying the version number.

```shell
conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch
```

c. Install [MMCV](https://mmcv.readthedocs.io/en/latest/) following the [official instructions](https://mmcv.readthedocs.io/en/latest/#installation).
Either `mmcv` or `mmcv-full` is compatible with MMSegmentation, but for methods like CCNet and PSANet, CUDA ops in `mmcv-full` is required.

**Install mmcv for Linux:**

The pre-build mmcv-full (with PyTorch 1.6 and CUDA 10.1) can be installed by running: (other available versions could be found [here](https://mmcv.readthedocs.io/en/latest/#install-with-pip))

```shell
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html
```

**Install mmcv for Windows (Experimental):**

For Windows, the installation of MMCV requires native C++ compilers, such as cl.exe. Please add the compiler to %PATH%.

A typical path for cl.exe looks like the following if you have Windows SDK and Visual Studio installed on your computer:

```shell
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.26.28801\bin\Hostx86\x64
```

Or you should download the cl compiler from web and then set up the path.

Then, clone mmcv from github and install mmcv via pip:

```shell
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv
pip install -e .
```

Or simply:

```shell
pip install mmcv
```

Currently, mmcv-full is not supported on Windows.

d. Install MMSegmentation.

```shell
pip install mmsegmentation # install the latest release
```

or

```shell
pip install git+https://github.com/open-mmlab/mmsegmentation.git # install the master branch
```

Instead, if you would like to install MMSegmentation in `dev` mode, run following

```shell
git clone https://github.com/open-mmlab/mmsegmentation.git
cd mmsegmentation
pip install -e .  # or "python setup.py develop"
```

:::{note}

1. When training or testing models on Windows, please ensure that all the '\\' in paths are replaced with '/'. Add .replace('\\', '/') to your python code wherever path strings occur.
2. The `version+git_hash` will also be saved in trained models meta, e.g. 0.5.0+c415a2e.
3. When MMsegmentation is installed on `dev` mode, any local modifications made to the code will take effect without the need to reinstall it.
4. If you would like to use `opencv-python-headless` instead of `opencv-python`,
   you can install it before installing MMCV.
5. Some dependencies are optional. Simply running `pip install -e .` will only install the minimum runtime requirements.
   To use optional dependencies like `cityscapessripts`  either install them manually with `pip install -r requirements/optional.txt` or specify desired extras when calling `pip` (e.g. `pip install -e .[optional]`). Valid keys for the extras field are: `all`, `tests`, `build`, and `optional`.
:::

### A from-scratch setup script

#### Linux

Here is a full script for setting up mmsegmentation with conda and link the dataset path (supposing that your dataset path is $DATA_ROOT).

```shell
conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab

conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html
git clone https://github.com/open-mmlab/mmsegmentation.git
cd mmsegmentation
pip install -e .  # or "python setup.py develop"

mkdir data
ln -s $DATA_ROOT data
```

#### Windows(Experimental)

Here is a full script for setting up mmsegmentation with conda and link the dataset path (supposing that your dataset path is
%DATA_ROOT%. Notice: It must be an absolute path).

```shell
conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab

conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch
set PATH=full\path\to\your\cpp\compiler;%PATH%
pip install mmcv

git clone https://github.com/open-mmlab/mmsegmentation.git
cd mmsegmentation
pip install -e .  # or "python setup.py develop"

mklink /D data %DATA_ROOT%
```

#### Developing with multiple MMSegmentation versions

The train and test scripts already modify the `PYTHONPATH` to ensure the script use the MMSegmentation in the current directory.

To use the default MMSegmentation installed in the environment rather than that you are working with, you can remove the following line in those scripts

```shell
PYTHONPATH="$(dirname $0)/..":$PYTHONPATH
```

## Verification

To verify whether MMSegmentation and the required environment are installed correctly, we can run sample python codes to initialize a segmentor and inference a demo image:

```python
from mmseg.apis import inference_segmentor, init_segmentor
import mmcv

config_file = 'configs/pspnet/pspnet_r50-d8_512x1024_40k_cityscapes.py'
checkpoint_file = 'checkpoints/pspnet_r50-d8_512x1024_40k_cityscapes_20200605_003338-2966598c.pth'

# build the model from a config file and a checkpoint file
model = init_segmentor(config_file, checkpoint_file, device='cuda:0')

# test a single image and show the results
img = 'test.jpg'  # or img = mmcv.imread(img), which will only load it once
result = inference_segmentor(model, img)
# visualize the results in a new window
model.show_result(img, result, show=True)
# or save the visualization results to image files
# you can change the opacity of the painted segmentation map in (0, 1].
model.show_result(img, result, out_file='result.jpg', opacity=0.5)

# test a video and show the results
video = mmcv.VideoReader('video.mp4')
for frame in video:
   result = inference_segmentor(model, frame)
   model.show_result(frame, result, wait_time=1)
```

The above code is supposed to run successfully upon you finish the installation.

We also provide a demo script to test a single image.

```shell
python demo/image_demo.py ${IMAGE_FILE} ${CONFIG_FILE} ${CHECKPOINT_FILE} [--device ${DEVICE_NAME}] [--palette-thr ${PALETTE}]
```

Examples:

```shell
python demo/image_demo.py demo/demo.jpg configs/pspnet/pspnet_r50-d8_512x1024_40k_cityscapes.py \
    checkpoints/pspnet_r50-d8_512x1024_40k_cityscapes_20200605_003338-2966598c.pth --device cuda:0 --palette cityscapes
```

A notebook demo can be found in [demo/inference_demo.ipynb](../demo/inference_demo.ipynb).

Now we also provide a demo script to test a single video.

```shell
wget -O demo/demo.mp4 https://user-images.githubusercontent.com/22089207/144212749-44411ef4-b564-4b37-96d4-04bedec629ab.mp4
python demo/video_demo.py ${VIDEO_FILE} ${CONFIG_FILE} ${CHECKPOINT_FILE} [--device ${DEVICE_NAME}] [--palette-thr ${PALETTE}] \
    [--show] [--show-wait-time {SHOW_WAIT_TIME}] [--output-file {OUTPUT_FILE}] [--output-fps {OUTPUT_FPS}] \
    [--output-height {OUTPUT_HEIGHT}] [--output-width {OUTPUT_WIDTH}] [--opacity {OPACITY}]
```

Examples:

```shell
wget -O demo/demo.mp4 https://user-images.githubusercontent.com/22089207/144212749-44411ef4-b564-4b37-96d4-04bedec629ab.mp4
python demo/video_demo.py demo/demo.mp4 configs/cgnet/cgnet_680x680_60k_cityscapes.py \
    checkpoints/cgnet_680x680_60k_cityscapes_20201101_110253-4c0b2f2d.pth \
    --device cuda:0 --palette cityscapes --show
```

branch_name: refs/heads/main

gha_language: Python


text:
# kitebroker: Automation Assistant for kiteworks.

### WIP
    * Uploads are not yet implemented.

## (v0.0.6a - 07-13-2016)
    * Appliance API configuration is now stored encrypted in database.
    * Database is now locked to system that launced/configured it.
    * Added ability to add users via CSV.
    * Added task handling.
    * Changed threading, added limits for both api calls and file transfers.
    * Resumeable downloads now implemented.

## (v0.0.2a - 06-18-2016)
	* Initial commit to Github.
	* Cleaned up thread handling for downloading files
	* Created rounding for seconds, easier on the eyes.

## (v0.0.1a - 06-15-2016)
	* Initial project for POC.
	* Recursively digs down subfolders from user's My Folder.
	* Creates local folders, download files and deletes them from appliance.
	* Generates a -info metadata file and saves in same directory as downloaded file.

repository: soggycat/kitebroker

repo_name: soggycat/kitebroker


text:
# Hello Network Socket

Learn **Sockets** – the essential part of Java networking 💪

### Pre-conditions ❗

* You're supposed to have a basic understanding of a computer networking

### Objectives

* **create a server socket** based on a given port ✅
* **accept clients** on the server side ✅
* **read data sent by clients** using `InputStream` ✅
* **create a client socket** connected to the server based on the host and port ✅
* **send data to the server** using cline socket `OutputStream` ✅
* **experiment** with MessageBoard application that consists of a client and server apps ✅

### Exercise overview 🇺🇦
[Network Socket – Основа Основ. Огляд Нової Вправи "hello-network-socket"](https://youtu.be/31u5CoVDX5w)

---

#### 🆕 First time here? – [See Introduction](https://github.com/bobocode-projects/java-fundamentals-course/tree/main/0-0-intro#introduction)

repository: Sagittariusdark/java-web-course

repo_name: Sagittariusdark/java-web-course


text:
# Java 101 | Lesson 3:
## Variables:
In computer science, **variable** is a name for a place in memory that can store values. Let's take a look at the diagram below.

![alt text](../images/memory.png)

Above, you can see a portion of memory with a predetermined size storing the number `5`. The variable, or portion of allocated memory, that is capable of storing numbers is called `a` in the diagram above. Appropriately named, `variables` can vary. `a` can just as easily contain any value, as long as it can store it within the size of its allocated memory.
If we wanted to make a variable with name `a` and value `5` in java, all it would require would be:
```Java
int a = 5;
```
If we wanted to read this out, we would say _integer a is assigned 5_. Here's how the above line works:
* `int` is a **data type** (reviewed next section) that lets our program know that we'll be storing a whole number within a.
* `a` is the **variable name**. All this does is **allocate** a portion of memory and name it `a`.
* `=` is the **assignment operator**. The assignment operator assigns the _value_ on the right side of the operator to the variable on the left side of the operator.

## Memory, Bits and Bytes:
This section will solely function as a necessary bit (no pun intended) of background knowledge. Memory in computers is measured with terms like "bits", "bytes", "kilobytes", "gigabytes", etc. A **bit** is the memory required to store a 1 or a 0 in binary code. This is the smallest unit of memory possible. **Bytes** are the next step up in the memory unit hierarchy and are _equal to 8 bits_. There are larger units of memory, but we'll review them later.
## Data Types:
Earlier, we mentioned that `a` had a _predetermined_ size. This means that the program knows how much memory to allocate to variable `a` before trying to store a value. How did the program know how much memory to allocate?
The program knew the necessary memory because we specified `a`'s data type as an `int`. `int` is one of the many data types in Java. Let's learn some data types:
* Data types can be separated as **primitive** or **non-primitive**. Primitive data types are data types that are built into Java. Non-primitive data types are not built into Java. For now, all you need to know is that primitive data types are all lowercase whereas non-primitive data types are capitalized.

**Note:** We'll be taking a look at 9 different data types. At first, their names and their characteristics will blend into each other. We'll also be taking a look at some numbers. Don't let this overwhelm you. I've been studying Computer Science for 4 years and still don't know a lot of these numbers. This information dump is just for future reference. For now, remember to focus on the functions and limitations of the data types.
### Primitive Data Types:
* `byte`: The **byte** data type is a number container that only stores whole numbers from -128 to 127, inclusive.
  * As byte is the smallest primitive data with a set size, it's also used as a measurement for memory. The sizes of the rest of the data types will be measured in bytes.
* `short`: The **short** data type also stores whole numbers.
  * The range of `short` is from	-32,768 to 32,767, inclusive.
  * The size of `short` is 2 bytes.
* `int`: The **integer** data type also stores whole numbers. This is the most popular data type for storing whole numbers.
  * The range of `int` is from -2,147,483,648 and 2,147,483,647, inclusive.
  * Let's say you wanted to make an app that stored a user's grades. If you wanted to store the number of courses the user is taking, you would store it within an `int` object because courses are counted with whole numbers (you can't take 0.23 of a class!).
  * The size of `int` is 4 bytes.
```Java
int courseNumber = 7;
```
* `long`: The **long** data type also stores whole numbers.
  * The range of `long` is from	-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, inclusive.
  * The size of `long` is 8 bytes.
* `float`: The **float** data type can store numbers that contain decimal points. `float` is the most popular data type for storing decimals. `float` is short for [_floating point number_](https://www.youtube.com/watch?v=PZRI1IfStY0).
  * If you wanted to store the numerical grade that the user had in a class, you would use a float.
  * The range of float is approximately ±3.4 * 10^38, with 6-7 significant decimal digits.
  * The size of `float` is 4 bytes.
```Java
float mathAverage = 89.3;
```
* `double`: The **double** data type is similar to `float` but has a much larger capacity. This is because the memory required for `double` is _double_ that of `float`.
  * The capacity of double is approximately ±1.8 * 10^308, with 15 significant decimal digits. That is absurdly precise.
  * The size of `double` is 8 bytes.

* `char`: The **character** data type can store single characters that are within the [Unicode Standard](https://en.wikipedia.org/wiki/Unicode). Unicode is the global standard for text in software.
  * If you wanted to store the letter grade for one of the courses the user is taking you would use a `char`. Because letter grades can only be displayed as `A`, `B`, `C`, `D`, or `F`, it makes sense to store it within a `char` variable.
  * When assigning a character, be sure to encapsulate the specific character in single quotations.
  * Whether a character is capital or not matters! In Java, `'A'` and `'a'` are different `char`s!
  * The size of `char` is 2 bytes.
```Java
char mathLetter = 'A';
```
* `boolean`: The **Boolean** data type can store only two values, `true` or `false`.
  * If you wanted to know if the user is passing all of their classes, you would use a boolean. This is because you can only pass or fail a class. In other words, your passing status can only be `true` or `false`.
  * The size of `boolean` is not defined precisely.
```Java
boolean isPassing = true;
```
### Non-primitive Data Types:
All you need to know for non-primitive data types for now is the `String`.
* `String`: The **string** data type is used to store words and multiple characters together. The data type is named after it literally being a _string_ of `char`s appended together.
  * If you wanted to store the user's name, you'd use a `String`.
  * An empty String uses 40 bytes. The memory usage of the String increases with the number of characters contained within. This is largely unimportant for our purposes.
```Java
String userName = "John Doe";
```
Keep in mind that quotations are not part of the string itself- only what is between the quotation marks.
If we were to display `userName`, we'd get `John Doe`.
## Putting it together:
### Declaration:
Sometimes, you may not know the value of a variable instantly but will later compute it. If this is the case, you must declare a variable. **Declaration** is telling the program to reserve memory under a variable name with a specific data type.
```Java
// The format is [data type] [variable name]
byte a;
short b;
int c;
long d;
float e;
double f;
char g;
boolean h;
String i;
```
#### Default Values of Java Data Types:
If you declare variables but don't assign a value to them, the variables will be left with their default values.
Below is a chart of data types along with the sizes, default values, and ranges:

Data type | Size (bytes) | Default Value | Range
--- | --- | --- | ---
byte | 1 | `0` | -128 to 127
short | 2 | `0` | -32,768 to 32,767
int | 4 | `0` | -2,147,483,648 to 2,147,483, 647
long | 8 | `0` | approx. ±9.223 * 10^18 (whole numbers)
float | 4 | `0.0` | approx. ±3.4 * 10^38 (6-7 decimal digits)
double | 8 | `0.0` | approx. ±1.8 * 10^308 (15 decimal digits)
char | 2 | `'\u0000'` | [See UTF-16](https://unicode.org/faq/utf_bom.html)
boolean | N/A | `false` | true or false
String | N/A | `null` | N/A

**Notes:**
* We'll learn more about `null` later. For now, you can think of it as the _absence_ of data.
* `'\u0000'` is called the _null character_. Do not confuse this with `null`. We'll learn more about both later.
### Assignment:
You can assign a value to a variable as many times as you'd like.
```Java
String i;
i = "Oh man";
i = "--Oh gee man";
i = "I'm really indecisive, what should I name this?";
```
Here's how to declare and instantiate all in the same line:
```Java
String i = "I know what I want this string to be.";
```
### Using Variables:
After you assign a value to a variable, you can use that variable as a placeholder for the value you assigned to it. Here's an example. As we use variables, please recall the [naming conventions](https://github.com/FurkanToprak/Java101/blob/master/lesson2.md#naming-conventions) from earlier courses.
```Java
String greeting = "Hello, World!";
System.out.println(greeting);
```
Produces the same output as
```Java
System.out.println("Hello, World!");
```
## Homework:
Tell me about yourself using code! Here's an example:

**AboutMe.java**
```Java
/*
This program will tell you the following:
Name
Age
If I love coding
The money I have in my wallet (Please don't mug me)
My middle initial
*/
class AboutMe {
    public static void main(String[] args) {
        // Let's declare and instantiate some variables.
        String myName = "Furkan Toprak";
        int myAge = 19; // It's my birthday the day I'm writing this! Don't forget to add comments like this one.
        boolean lovesCoding = true;
        float myWallet = 34.12f;
        char middleInitial = 'C';
        // Now let's print them.
        System.out.println(myAge);
        System.out.println(lovesCoding);
        System.out.println(myWallet);
        System.out.println(middleInitial);
    }
}
```


text:
# VELOC: VEry-Low Overhead Checkpointing System

VeloC is a multi-level checkpoint/restart runtime that delivers
high performance and scalability for complex heterogeneous storage
hierarchies without sacrificing ease of use and flexibility.

It is primarily used as a fault-tolerance tool for tightly coupled
HPC applications running on supercomputing infrastructure but is
essential in many other use cases: suspend-resume, migration,
debugging.

VeloC is a collaboration between Argonne National Laboratory and
Lawrence Livermore National Laboratory as part of the Exascale
Computing Project.

## VELOC-GPU
The VELOC-GPU project is an experimental prototype for enabling checkpoint/restart
support on NVidia GPUs. The parent VELOC source is available at: https://github.com/ECP-VeloC/VELOC
and the VELOC-GPU source is available at: https://github.com/ECP-VeloC/artifacts/SC22-VeloC-GPU.

To run VELOC with GPU support, perform the following steps:
1. cd veloc-gpu
2. ./bootstrap.sh
3. ./auto-install.py <veloc-build-dir>

For checkpointing data residing on the GPU memory, use the following `VELOC_Mem_protect` syntax
`VELOC_Mem_protect(id, &device_var, var_length, sizeof(data_type), flag)`. Here, `flag` can be either of
`DEFAULT` or `READ_ONLY`. In the case of `DEFAULT` flag, VELOC_Checkpoint would relinquish control back
to the application only when a copy of the original device variable is created, either on the GPU or the host,
whereas the `READ_ONLY` flag specifies that the device variable will not change until the checkpoint is completed,
and hence the control to the application is relinquished almost immediately.

To run the [gpu-checkpoint example](./test/gpu-checkpoint.cu),

Compile using:
```
export LD_LIBRARY_PATH=<veloc-build>/lib
export PATH=<veloc-build>/bin:$PATH
nvcc -I /path/to/mpi/ -L /mpi/lib -lmpi -I /<veloc-build>/include/ -L /<veloc-build>/lib -lveloc-client gpu-checkpoint.cu -o gpu-checkpoint
```

Run using `mpirun -np 1 ./gpu-checkpoint ./test/gpu-checkpoint.cfg`

## Documentation

The documentation of VeloC is available here: http://veloc.rtfd.io

It includes a quick start guide as well that covers the basics needed
to use VeloC on your system.

## Contacts

In case of questions and comments or help, please contact the VeloC team at
<EMAIL_ADDRESS>

## Release

Copyright (c) 2018-2020, UChicago Argonne LLC, operator of Argonne National Laboratory <br>
Copyright (c) 2018-2020, Lawrence Livermore National Security, LLC.
Produced at the Lawrence Livermore National Laboratory.

For release details and restrictions, please read the [LICENSE](https://github.com/ECP-VeloC/VELOC/blob/master/LICENSE)
and [NOTICE](https://github.com/ECP-VeloC/VELOC/blob/master/NOTICE) files.

`LLNL-CODE-751725` `OCEC-18-060`

repository: ECP-VeloC/artifacts

repo_name: ECP-VeloC/artifacts


text:
---
layout:     property
title:      "cqs_standardised"
schemas:    [entity, security]
---

# cqs_standardised
The credit quality step for standardised approach, measured as part of a credit quality assessment scale. Represented as a naturally positive integer number between 1 and 6 inclusive.

Useful documents:

Bank of England Standardised Approach: http://www.bankofengland.co.uk/pra/Documents/publications/ss/2013/ss1013.pdf
FCA ECAIs Standardised: https://www.fca.org.uk/publication/archive/fsa-ecais-standardised.pdf
Committee of European Banking Supervisors (CEBS) Standardised Approach: https://www.eba.europa.eu/documents/10180/16166/4+Ausust+2006_Mapping.pdf


text:
# Git Kata: Basic Branching
## The task
You again live in your own branch, this time we will be doing a bit of juggling with branches, to show how lightweight branches are in git.
Hint: `git checkout` will make you switch from one branch to another.

1. Run the script setup.sh: `./setup.sh`
1. `cd exercise`
1. Use `git branch` to see the two branches that are relevant for this exercise
1. What branch are you on?
1. Use `git branch mybranch` to create a new branch called mybranch
1. Use `git branch` again to see the new branch created
1. Use `git checkout mybranch` to switch to your new branch
1. How does the output from `git status` change when you switch between the master and the new branch that you have created?
1. How does the workspace change when you change between the two branches?
1. In the branch you created, create a file called `file1.txt`.
1. Add your name to the file, make a commit with this change.
1. Use `git log --oneline --decorate --graph` to see your branch pointing to the new commit.
1. Switch back to the branch called master
1. Make a new file called file2.txt
1. Add and commit that file
1. Use `git log --oneline --decorate --graph --all` to see your branch pointing to the new commit, and that the two branches now have different commits on them.
1. Checkout mybranch
1. What happened to your working directory? Can you see your file2.txt?
1. Use `git diff mybranch master` to see the difference between the two branches.

## Useful commands
- `git checkout`
- `git checkout -b`
- `git log --oneline --decorate --graph`
- `git branch`
- `git diff`

repository: chopse/gitkatas

repo_name: chopse/gitkatas


text:
# Facebook Messenger channel

Allows to create chatbots for [Facebook Messenger Platform](https://developers.facebook.com/docs/messenger-platform).

_Built on top of [messenger4j library](https://github.com/messenger4j/messenger4j)._

## How to use

Please refer the JAICF [Facebook Messenger channel page](https://help.jaicf.com/Facebook-Messenger)

repository: just-ai/jaicf-kotlin

gha_language: Kotlin

repo_name: just-ai/jaicf-kotlin


text:
# Quick Start

## Clone to your-app-name dir

Clone Angular-Starter-App repository into 'your-app-name':

```bash
git clone https://github.com/matsta25/angular-starter-app.git your-app-name
```

then go to the 'your-app-name' directory:

```bash
cd your-app-name
```

## Rename project files

Next step is to change all 'angular-starter-app' strings to 'your-app-name' and so on...
For that you can use script or do it manually.

### Using script  {docsify-ignore}

Just type:

```bash
./cleanup.sh your-app-name
```

## Install dependencies

Now its time to install dependencies:

```bash
npm install
```

## Run app and mock

next launch the application:

```bash
npm run start
```

and in a new terminal tab launch mock api:

```bash
npm run mock
```

Now the app should be available on http://localhost:4200 and mock api on http://localhost:3000/posts.

After that, you are have fresh and clean app which is ready for developing your features! :rocket:


text:
---
title: "Installation"
description: "There are various ways to install MadelineProto:"
nav_order: 8
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Installation

There are various ways to install MadelineProto:

* [Simple](#simple)
* [Simple (manual)](#simple-manual)
* [Composer from scratch](#composer-from-scratch)
* [Composer from existing project](#composer-from-existing-project)

## Simple

```php
<?php
if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
require_once 'madeline.php';
```

This code will automatically download, auto-update and include MadelineProto.

`madeline.php` is not compatible with pre-existing composer installs, [please install MadelineProto using composer](#simple-manual) if you already have a composer project.
The composer check may be disabled for very special cases like joomla installs by defining `const MADELINE_ALLOW_COMPOSER = true;` before including `madeline.php`.

## Simple (manual)

Download [madeline.php](https://phar.madelineproto.xyz/madeline.php), put it in the same directory as your script, and then put the following code in your PHP file:
```php
<?php
require_once 'madeline.php';
```

## Composer from scratch

composer.json:
```json
{
    "name": "yourname/yourproject",
    "description": "Project description",
    "type": "project",
    "require": {
        "danog/madelineproto": "^7"
    },
    "license": "AGPL-3.0-only",
    "authors": [
        {
            "name": "Daniil Gentili",
            "email"<EMAIL_ADDRESS>        }
    ],
    "autoload": {
        "psr-0": {
            "Your\\Project\\": "src/"
        }
    }
}
```

Then run (composer v2+ is required):
```bash
composer update
```

Put the following code in your PHP file:
```php
<?php
require_once 'vendor/autoload.php';
```

## Composer from existing project

Simply require the package (composer v2+ is required):

```bash
composer require "danog/madelineproto:^7"
```

Next section

repository: NickDemidov/MadelineProtoDocs

repo_name: NickDemidov/MadelineProtoDocs


text:
# Trender Server

This service logs in to Spotify and redirects the user to the Trender frontend application with a valid access token as a parameter in the url.

## Development mode

In development mode, it assumes you are running the frontend on localhost:3000, but the server itself will be running on localhost:8888.

Run `npm install` after first cloning or forking the repo, and include the Spotify Client ID and Spotify Secret ID between sessions

```
export SPOTIFY_CLIENT_ID=XXXX
export SPOTIFY_CLIENT_SECRET=YYYY
npm start
```

# Deploying

## Heroku

This template is indended to be deployed on Heroku. After installing the heroku CLI tools you can run the below commands in the same directory as server.js(replacing abc123, cba456, mybackend and myfrontend with your actual stuff - the below example assume that you already have your frontend running on http://myfrontend.herokuapp.com.

```
heroku create mybackend
heroku config:set SPOTIFY_CLIENT_ID=abc123
heroku config:set SPOTIFY_CLIENT_SECRET=cba456
heroku config:set REDIRECT_URI=https://mybackend.herokuapp.com/callback
heroku config:set FRONTEND_URI=https://myfrontend.herokuapp.com
git push heroku master
```

You should now be able to go to http://mybackend.herokuapp.com/login and it will eventually redirect to http://myfrontend.herokuapp.com?access_token=ZZZZZwhere ZZZZZ is a valid access token that you can use to do operations in the Spotify API.

repository: va-rau-jo/Trender-Server

repo_name: va-rau-jo/Trender-Server


text:
# HTML2PUG

Project for converting html to pug.
* Powered by [xhtml2pug](https://github.com/dimensi/xhtml2pug).
* Build on [parcel](https://parceljs.org/).
* Lives on [vercel](https://vercel.com/).

Subprojects:

* [xhtml2pug](https://github.com/dimensi/xhtml2pug)
* [vscode-xhtml2pug](https://github.com/dimensi/vscode-xhtml2pug)

gha_language: HTML


text:
GeoNet
======

A GeoLocation by IP Address library for .Net written in C#.

This is a very simple, but fast, library allowing querying of IP address location (country only) written in C#. It should work with ipv6 too, but I haven't been able to test properly.

It's MIT licensed, so completely free.

The aim is to keep it very simple, with minimal external dependecies. There are no database files to keep updated, or any reliance on 3rd party modules with the exception of protobuf.

If you find it useful, do please consider linking to our web shop selling children's party supplies at:
http://www.partyark.co.uk

-------------

Full details here: http://www.partyark.co.uk/techblog/

-------------

HOW TO BUILD:

You can compile right out of the box, but if you want to build your own:
* Run the console application. This will generate a binary file 'geonet.bin'
* Put the file in the Resources folder of the GeoNet project
* Compile Geonet.

repository: Dylan-Jang/GeoNet

repo_name: Dylan-Jang/GeoNet


text:
This example shows how to do conditional compilation including requiring modules.

See the comments in `app.ts` and `webpack.config.js` for a quick overview of the process.

Try defining and undefining the `DEBUG` constant in `webpack.config.js` and see out it affects
the outputs (e.g. [`expectedOutput-1.6/bundle.js`](expectedOutput-1.6/bundle.js)).

More information can be found at these sites:
- https://github.com/Microsoft/TypeScript/wiki/Modules#dynamic-module-loading-in-nodejs
- https://github.com/webpack/docs/wiki/list-of-plugins#defineplugin
- https://github.com/webpack/webpack/tree/master/examples/multi-compiler

repository: maxchehab/ts-loader

repo_name: maxchehab/ts-loader


text:
+++
title = "Risky Business with Nicole Johnson, Matt Curry, and Anthony Lee"
Description = "Bridget and Matt chat with Nicole Johnson (Chef), Matt Curry (Allstate), and Anthony Lee (Allstate)."
Date = 2017-06-18T19:59:40-05:00
PublishDate = 2017-06-18T19:59:40-05:00
podcast_file = "arrested-devops-podcast-episode088.mp3"
episode_image = "/episode/img/devops-risk.png"
episode_banner = "/episode/img/devops-risk-banner.png"
guests = ["njohnson","mcurry2","alee",] # The names of your guests, based on the filename without extension.
sponsors = ["10thmagnitude","victorops","datadog",]
episode = "88"
images = ["/img/social/fb/devops-risk.png"]
#hosts = [] # The names of your hosts, based on the filename without extension.
aliases = ["/88",]
explicit = "yes" # values are "yes" or "no"
youtube = "jgXB4b-B_ic"
hosts = ["bkromhout","mstratton"]

+++
Bridget and Matt chat with Nicole Johnson (Chef), Matt Curry (Allstate), and Anthony Lee (Allstate).

* Nicole's GOTO Chicago talk: [Automating Security & Compliance (for Fun & Profit)](https://gotochgo.com/2017/sessions/89)

## Community & Event Stuff

If you have an upcoming conference you would like to see promoted on ADO, you can fill out the handy form at [arresteddevops.com/conf](https://arresteddevops.com/conf)

### Upcoming conferences

- [Velocity San Jose](https://conferences.oreilly.com/velocity/vl-ca) - discount code "ADO2017" gives 20% off for Gold, Silver, and Bronze passes.

### Open CFPs

* [lots of DevOpsDays](https://devopsdays.org/speaking)

repository: arresteddevops/ado-hugo

gha_language: CSS

gha_license_id: NOASSERTION

repo_name: arresteddevops/ado-hugo


text:
# Table of contents
<!-- TOC -->

1. [Table of contents](#table-of-contents)
2. [Gauss - Jekyll Template](#gauss---jekyll-template)
    1. [Acknowledgement](#acknowledgement)
    2. [Intended users](#intended-users)
3. [The _best_ way to use this template](#the-_best_-way-to-use-this-template)
    1. [Preliminaries](#preliminaries)
    2. [How to use](#how-to-use)
        1. [Add a new post](#add-a-new-post)
        2. [Add an image](#add-an-image)
        3. [Math-typesetting](#math-typesetting)
        4. [Math proof](#math-proof)
    3. [Make your website online](#make-your-website-online)
4. [Customize](#customize)
5. [Development](#development)
6. [Copyrighted content](#copyrighted-content)

<!-- /TOC -->

# Gauss - Jekyll Template

It is a website-template designed for people who want to write notes online. It is the convergence of the best three languages: the simplicity of Markdown, the beauty of LaTeX, and the power of HTML.

It is named after the German mathematician, _Carl Friedrich Gauß_, who made significant contribution to many fields of science.

## Acknowledgement

_Gauss template_ originated from the [Leonids template](https://github.com/renyuanz/leonids/tree/gh-pages), which is for some reason terminated by the author, @renyuanz. I am a frequent user of _Leonids_ and I have customized it a lot for my [personal website](https://www.tvhoang.com). I decided to revive this wonderful project with a new name, _Gauss_.

## Intended users

The intended users of this template include **students, scientists, programmers**, who frequently take notes and want to publish them online. It has never been meant for bloggers, hence I eliminated all the web-tracking services like Google Analytics, Google Adsense, Disqus.

I do like the notion of commenting, but you should know that free services like Disqus came at a cost: you and your readers will be tracked. I want _Gauss_ to be somewhat different and truly your personal space to record your thoughts and knowledge. Of course, you can add these services to your website, but I won't assist you.

# The _best_ way to use this template

## Preliminaries

You should be able to install Jekyll on your operating system. Please refer to [this link](https://jekyllrb.com/docs/installation/) if you run into any problems.

You may want to use [Visual Studio Code](https://code.visualstudio.com/) to write blog. You can use any other editors, but this manual only tells you VSC tips.

Open the folder of this template on your VSC editor. In the editor, open the Terminal window (in the View menu). Type the following command:

```
bundle exec jekyll serve
```

And your website should be live at http://localhost:4000

Note that from the second run onwards, you can use this command:

```
jekyll serve --livereload
```

which helps you save time refreshing your browser to view changes.

Please install the extension **Markdown+Math**, by _goessner_, in your VSC editor. It will significantly improve your writing experience. Moreover, open the Settings menu in VSC, search for the item `mdmath.delimiters` and change to `kramdown`.

## How to use

### Add a new post

Navigate to the folder `_posts`, add a file with `.md` extension. At the beginning of this file, you should have what is so called a _header_.

```
---
layout: post
title: "Title"
categories: ["Category 1", "Category 2"]
excerpt_separator: <!--more-->
image:
  feature: grg/overview.png
sticky: true
---
```

The obligatory fields are `layout` and `title`. For `categories`, you can have as many categories as you want, and they will appear several times in the categories page. The `excerpt_separator` should be left as-is, it is an indicator in your Markdown file to let Jekyll know when to trim off your post and display a preview of the content on the front page. You can also have a featured image as above. Note that all images must be put in the folder `img`. The above example, `grg/overview.png` actually refers to an image whose full path is `img/grg/overview.png`. You also have an option called `sticky` where you can choose to "pin" that post at the beginning of your website.

You can also has `js`, `css`, `ext-js`, `ext-css` fields, though they are rarely used. Currently I don't have time to write document about this.

 _Gauss template_ uses Lightbox2 to enhance the experience.

The fastest way to add an image, for example `img/grg/overview.png`, is to use the `img` tag:

```html
<img src="/img/grg/overview.png">
```

You can also use the class `post-image-left` or `post-image-right`, designed specifically for _Gauss template_:

```html
<div class="post-image-left">
    <a href="/img/grg/overview.png" data-lightbox="setname" data-title="title must be the same everywhere">
        <img src="/img/grg/overview.png">
    </a>
    <p class="post-image-caption">title must be the same everywhere</p>
</div>
```

Notice the attribution `data-lightbox="setname"`. The set name must be the same for all images within one post. When you click on an image, you can navigate through other images of the same set name, and often times you may want to see other images in the same post as a "gallery view".

You can create a _snippet_ in VSC for this bunch of code. Learn more about snippet [here](https://code.visualstudio.com/docs/editor/userdefinedsnippets).

```
"Post_Image": {
    "prefix": "post-image",
    "body": [
        "<div class=\"post-image-${1|left,right|}\">",
        "    <a href=\"${2:link}\" data-lightbox=\"${3:set}\" data-title=\"${4:title}\">",
        "        <img src=\"${2:link}\">",
        "    </a>",
        "    <p class=\"post-image-caption\">${4:title}</p>",
        "</div>$0"
    ]
}
```

You can also use `table` tag to insert multiple images:

```
<table>
    <tr>
        <td>
            <div class="post-image">
                <a href="/img/1.jpg" data-lightbox="setname" data-title="Title 1">
                    <img src="/img/1.jpg">
                </a>
                <p class="post-image-caption">Title 1</p>
            </div>
        </td>
        <td>
            <div class="post-image">
                <a href="/img/2.jpg" data-lightbox="setname" data-title="Title 2">
                    <img src="/img/2.jpg">
                </a>
                <p class="post-image-caption">Title 2</p>
            </div>
        </td>
    </tr>
</table>
```

The piece of code above displays two images side by side. When the class `post-image` is used, the image will span 100% width of the parent element, in this case, the `td` tag. When the class `post-image-left` or `post-image-right` is used, the image will span 30% width of the parent element and float left or right respectively.

### Math-typesetting

Unlike many other templates, _Gauss template_ uses KaTeX as the math renderer. It is significantly faster than MathJax, yet preserves the same functionality. Keep your Math formula inside ``$$`` and `$$` for **both** inline and display mode (display mode means the math formula is displayed in a dedicated line).

In order to use display mode, you have to keep the math equation in a separated line in your Markdown file.

```
paragraph 1

$$ a+b = c $$ text here will be ignored

paragraph 2
```

Note that if a line begins with a display-mode math equation, all other texts of the same line after the equation will be ignored

Sometimes you may want to begin a paragraph with an inline math equation. In this case, you can add a non-breakable space at the beginning of the sentence to let MathJax know that it is dealing with inline math mode.

```
paragraph 1

 $$ a+b = c $$ text here will still be shown

paragraph 2
```

It is worth noting how KaTeX works: Jekyll still uses MathJax when it transforms the Markdown file into an HTML file. KaTeX then looks into this file and replace MathJax's parts with its own parts. It may sound redundant, but [reality](https://www.intmath.com/cg5/katex-mathjax-comparison.php) has shown that KaTeX runs at least 10 times faster.

### Math proof

This is a unique feature in _Gauss_ designed specifically for Mathematicians. Whenever you write a theorem and you want to display a proof right after that, you may want it to be hidden for two reasons: the post looks cleaner and the readers can have a moment to think about the proof first. You can add the following snippet to your `markdown.json` file:

```
"Proof": {
    "prefix": "\\proof",
    "body": [
        "<${1|span,h2,h3,h4,h5|} onClick=\"toggleShowHide('$3')\" class=\"toggleButton\" markdown=\"1\"> ▶ Chứng minh$2</$1>",
        "<div id=\"$3\" class=\"toggleContent\" markdown=\"1\">",
        "$4",
        "</div>"
    ]
}
```

A proof will look like this in the Markdown file:

```md
Theorem: blah blah. <span onClick="toggleShowHide('randomidcodejnfkjnk')" class="toggleButton" markdown="1"> ▶ Proof</span>
<div id="randomidcodejnfkjnk" class="toggleContent" markdown="1">

$$\mathbb{R}-S=(-\infty,0)\cup\left(\bigcup_{i\in\mathbb{N}^+}(1/(i+1), 1/i)\right)\cup(1,\infty)$$

is the union of open intervals, hence open. $$\Rightarrow S$$ is closed.

</div>
```

Note that you must leave an empty line after the `div` tag and before the `/div` tag. The users can click on the word "Proof" to show and close the proof. By default, the proof is hidden.

## Make your website online

You can learn how to create a repository on GitHub and deploy a GitHub page [here](https://pages.github.com/). Do remember to change the site name in `_config.yml` and `CNAME`. This is a free service by GitHub and your website will live on `https://username.github.io/`

If you want to use an optional domain, like `https://www.tvhoang.com`. You have to first buy your domain. My experience with [NameCheap](https://www.namecheap.com/) has been fantastic so I would suggest you buy your domain there. You may want to set up HTTPS to get the beautiful green lock in the browser. In that case, you can visit [this blog](https://medium.freecodecamp.org/free-https-c051ca570324) to find out the procedures.

# Customize

The power of HTML/CSS/JS as a whole allows us to customize anything we want. However, my advice is that you should only change the color of the texts. You can look into the file `_variables.scss` and `_typography.scss` if you want to customize. This entirely depends on your creativity and your ability to design.

Of course, you can change your personal information (e.g. your name, email address, etc.) in `_config.yml`.

# Development

There are a lot of features I want to add to this template, but I do not have time to implement.

- Comment section (**not** Disqus): I'm thinking of using some self hosted app on Heroku (which has a free plan). This app plays a role very much like Disqus: record comments from readers and load them into the blog post when requested.
- Page view: Each post should show how many times it has been viewed. Again, I don't want to use commercial or tracking services on the site. If there is an open-source solution, please let me know.
- Documentation: Scientists are usually not familiar with code and commands. They may be able to code in their respected fields, but setting up a website and customizing it without a graphic interface could be very painful and time-wasting. If you can contribute to make this manual clearer even for computer-illiterate, I will be very thankful!

repository: hoangvanthien/gauss

repo_name: hoangvanthien/gauss


text:
*unzipped folder needs to be renamed "zumoTesting" and put in sketch folder.
The IDE finds the main file by the name of the folder exactely.
 Let me know if there are issues -<EMAIL_ADDRESS>
#Testing: Zumo Shield by Pololu#

This sketch is meant to sumo on a white ring with black boarders
as opposed to traditional black to white. This is easily changed by reversing a wakka wakka (<,>) and adjusting "LIGHT_SENSITIVITY" higher in the reflectence tab.

The comments included are geared to people being introduced to programing

##Features: working or in progress(*):##

* Detect Boarders and react and turn around
* drive whilst playing tunes
* Tune -Mario Theme, Nyan cat would be nice if someone could help plot out the sheet music
* Sequence sensor and motor events with time checking instead of delays
* Calibratining compass readings into EEPROM
* Store melody in program memory to avoid RAM overuse
* detect when being picked up
* Calibrated motors with compass heading*
* Map an arena patern for speed awareness*
* Detect collisions with accelerometer*
* use external sensors*
* varify intention fufulment with accelerometer*
* define turn degrees with compass*
* timed button debounce fuction with release detection
* four state user control (4 mode button cycle)

*Without looking I'm going to say this code is licenced as Pololu licenced their library
which I believe is BSD.*

##The zumo shield can be purchased from

adafruit.com- [http://www.adafruit.com/products/1639](http://www.adafruit.com/products/1639)

or directly from pololu.com - [https://www.pololu.com/category/129/zumo-robot-and-accessories](https://www.pololu.com/category/129/zumo-robot-and-accessories)

repository: PaulBeaudet/zumoTesting

repo_name: PaulBeaudet/zumoTesting


text:
[[Research]] [[Neuromorphic]] [[MITACS Project]]

# An Adaptive Spiking Neural Controller for Flapping Insect-scale Robots

Taylor Clawson [[Terrence Stewart]] [[Chris Eliasmith]]

## Introduction
- Insect robot controller - robust to wing asymmetries
- Actuator dynamics variation
- Need to stabilize fast unstable dynamic modes
- Periodic nature -> limit cycles instead of equilibrium points
	- Time-variant systems
- 12 degrees of freedom but only 3/4 control inputs
- RoboBee
	- 20mW power budget, most for actuators
	- Insufficient rotational damping -> open loop hovering is unstable
	- Need controller robust to uncertainties in physical parameters prior to learning
	- Portion of SNN control turned offline to approximate linear controller

## Dynamic Model
- ![Pasted image<PHONE_NUMBER>5618.png](Pasted%20image%2020210608115618.png)
- Only stroke angle can be controlled directly
- Wing pitch cannot be controlled during flight
- ![Pasted image<PHONE_NUMBER>0132.png](Pasted%20image%2020210608120132.png)
	- Roll control -> relative amplitude
	- Pitch control -> mean stroke angle
- Instability -> net drag above CoM
	- pitch and toll
	- yaw neutrally stable so not considered
- Rigid body dynamics + blade element theory -> 6 degrees of freedom
- $q= [\phi_R\;\phi_L\;\psi_R\;\psi_L\;\phi\;\theta\;\psi\;x\;y\;z]^T$
	- Stroke angles, Pitch angles, Body Euler angles, body position
- State: $x(t)=[q(t)\;\dot{q}(t)]^T$
- Control vector: $u=[u_a\;u_p\;u_r]$
	- Amplitude, pitch bias, roll bias
- Equation of motion:
	- $M(q)\ddot{q}+C(q,\dot{q})=B(t)u$
	- $M$ - Inertia matrix
	- $C$ - Nonlinear forces
	- $B$ - Input matrix
- Control affine form:
	- $\dot{x}(t)=f(x)+G(x,t)u(t)$
- Linearization about a periodic trajectory -> good approximation for small deviations from hovering
- Steady state hovering trajectory: $x^*(t)$ with period $T$ = 120Hz
- State deviation: $\tilde{x}(t)=x(t)-x^*(t)$
- Control deviation - similar definition
- $\tilde{x}(t)=A(t)\tilde{x}+B(t)\tilde{u}$
	- Normal linearization of dynamics
	- $A$ and $B$ have period $T$
- Inaccurate for transient response; for all control inputs
- Eg. step change in roll input $u_r$
	- Causes primarily rolling
	- Left amplitude > right amplitude
	- ![Pasted image<PHONE_NUMBER>3318.png](Pasted%20image%2020210608123318.png)
	- $B$ significantly affected due to yaw torque
		- a - linearized transient response calculation
		- b - equilibrium trajectory for body, linearization for wing
	- Yaw remains, but yawing torque cancels if input held constant

## SNN Control Design
- 4 populations for the two terms
	- Approximation of linear controller _ adaptive term for parameter variations
	- 800neurons total
- Linear Proportional Integral Filter (PIF) compensator
	- Augmented state vector $\chi(t)=[\tilde{x}^T(t) \;\tilde{u}^T(t)\; \eta^T(t)]$
	- Constant gain matrix $K$
	- $\eta(t)=\eta(0)+\int_o^ty(\tau)d\tau$: integral of output error
	- Control law: $u_{PIF}(t)=\int_0^t-K_{\chi}(\tau )d\tau$
	- Control input error and integral of output error assumed zero for SNN approximation
	- state error most significant term
- State encoded as spike sequences in population - NEF
	- $r_i=G_i(J_i(x),t)$
	- $J_i(x)=\alpha_ie_i^Tx(t)+J_i^{bias}$
		- $e_i$ - preferred direction vector
- LIF model with Neural Engineering Framework
	- Exponential post-synaptic filter: $h_i(t)=Ke^{-t/\tau}$
	- Activity: $a_i(x,t)=\sum_kh_i(t-t_{ik})$
	- Linear decoders to obtain control signal - $u_0(t)=\sum_ia_i(x,t)d_i$
	- Decoders obtained from least-squares over sampled data-set - $d_i = argmin_{m_i}\int_x||g(x)-\sum_i\bar{a}_i(x)m_i||^2dx$
		- $g$ - output of PIF for given point in state space
		- $\bar{a}$ - time averaged neuron activity in steady state for same point
	- $u_0(t)$ closely approximates PIF compensator signal
	- Not sufficient, need a $u_{adapt}(t)$ signal to help out
- $u_{adapt}(t)=[u_a(t)\;u_p(t)\;u_r(t)]$
- Each from separate population of neurons
- ![[Pasted image<PHONE_NUMBER>0708.png]]
- Each population trained online to zero the error signal:
	- $E(t)=\Lambda^T(\Delta x(t)+\alpha\Delta\dot{x}(t))$
	- Inner product between state error and constant vector
- Assumption: Actuator performance dominates variations in body dynamics in z direction so $u_a(t)$ not computed from state; rather from activity
	- $u_a(t)=\sum_ia_{a,i}(t)d_{a,i}(t)$
	- $a_{a,i}=h_i(t)*G_i(J_i^{bias},t)$
	- Decoders updated based on adaptation rate $\gamma$:
		- $\dot{d}_a(t)=\gamma a_a(t)E(t)$
		- $a_a(t)= [a_{a,1},a_{a,2}...a_{a,N}]^T$
	- $\Lambda$ chosen so that error depends on only z velocity and its derivative
- $u_p(t)$,$u_r(t)$: depend on state
	- $u_p(t)=a_p^T(x,t)d_p(t)$
	- $\dot{d}_p(t)=\gamma a_p(x,t)E(t)$
		- $\Lambda$ chosen so that error only depends on x velocity and its derivative
	- $u_r(t)=a_r^T(x,t)d_r(t)$
	- $\dot{d}_r(t)=\gamma a_r(x,t)E(t)$
		- $\Lambda$ chosen so that error only depends on y velocity and its derivative
- Adaptive amplitude -> zero out any error in body z velocity; the pitch input -> zero out error in the body x velocity; roll input -> zero out the error in body y velocity
- $u(t)=u_0(t)+u_{adapt}(t)$
	- $u_0(t)$ - offline training
	- $u_{adapt}(t)$ - online training

## Results
- Wing asymmetry
	- Static amplitude bias between L,R for roll
	- Stroke angle offset for pitch
- PIF Compensator
	- ![Pasted image<PHONE_NUMBER>2434.png](Pasted%20image%2020210608132434.png)
	- ![Pasted image<PHONE_NUMBER>2511.png](Pasted%20image%2020210608132511.png)
	- Yaw unstabilized, x,y velocities slow stabilization
	- In-plane rotation + position drift
- SNN Controller
	- Adaptive term tuned using grid parameter search
	- RoboBee remains within 10cm of starting position
	- ![Pasted image<PHONE_NUMBER>2856.png](Pasted%20image%2020210608132856.png)
	- ![Pasted image<PHONE_NUMBER>2905.png](Pasted%20image%2020210608132905.png)
	- No yaw control authority still, so no stabilization

url: https://raw.githubusercontent.com/karthisrinivasan/DigitalGarden/b07ca5d6cdbd187d2ea6ebe5ba37ea0668ffbb24/_notes/Research/SNN Controller - Insect Robots.md

repository: karthisrinivasan/DigitalGarden

filename: SNN Controller - Insect Robots.md

repo_name: karthisrinivasan/DigitalGarden


text:
mysqludf_transliterate
======================

A MySQL UDF for transliteration of strings

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

This is a very naïve solution to a very hard problem: transliteration of strings. The hard problem is dealing
with different encodings on the programming side. As of today,
I mostly deal with strings that are either encoded with
UTF-8 or ISO-8859-1 (latin1), since values of entities in my dbs are represented using Brazilian Portuguese. So the mapping I do in the code works fine for all cases in my domain.

Installation instructions
------------------------

  The compilation step works on my Mac OS X (Mountain Lion), it should work on yours too, provided you have all it takes to compile MySQL UDFs. You may have to fiddle with the pre-processing directives to make it work on other platforms.

  To compile:

      $ gcc $(mysql_config --cflags) -shared -fPIC -o transliterate.so transliterate.c

  This will create a .so file. Now copy this file into the MySQL plugins folder:

      $ cp transliterate.so /usr/local/mysql/lib/plugin

  This folder differs from host to host, to know where yours live,
  you can execute this query:

      SHOW VARIABLES LIKE 'plugin_dir';

  Finally, run these two queries to install the UDF:

      DROP FUNCTION IF EXISTS transliterate;
      CREATE FUNCTION transliterate RETURNS STRING SONAME "transliterate.so";

Using the function
------------------

  The transliterate function takes one, and only one argument, of type string (either constant or non-constant).

  Example:

      SELECT name, transliterate(name) AS trans_name FROM courses;

  Should return something like this:

      +--------------------------+--------------------------+
      | name                     | trans_name               |
      +--------------------------+--------------------------+
      | Turismo                  | Turismo                  |
      | Teatro                   | Teatro                   |
      | Sistemas para Internet   | Sistemas para Internet   |
      | Sistemas de Internet     | Sistemas de Internet     |
      | Sistemas de Informação   | Sistemas de Informacao   |
      | Serviço Social           | Servico Social           |
      | Segurança do Trabalho    | Seguranca do Trabalho    |
      | Redes de Computadores    | Redes de Computadores    |
      | Publicidade e Propaganda | Publicidade e Propaganda |
      | Psicologia               | Psicologia               |
      +--------------------------+--------------------------+

License
-------

The MIT License (MIT)

Copyright (c) 2013 Thiago Brandão Damasceno

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:
## Software Architecture

Here is some information about the software architecture of the Internet Banking System...

![](embed:Containers)

### Web Application
...

### Database
...

Here is some information about the API Application...

![](embed:Components)

### Sign in process

Here is some information about the Sign In Controller, including how the sign in process works...

![](embed:SignIn)

repository: dorupirvu-ayla/dsl

repo_name: dorupirvu-ayla/dsl


text:
# show-net-devices-tree
A simple bash script showing hierarchy of networking devices.

The script is inspired by the question at stackexchange
http://unix.stackexchange.com/questions/328754.

The goal is to show network adapters in a tree to where the dependecy
between particular adapters are clearly visible. The script just calls
'ip link', parse the result and adapters with a link to a master shows
in tree under the master.

The hierarchy tree can be show from bottom up or from top to bottom.

Example:

```
$ ./nettree.sh -u
eth3
    bond1
       bond0
eth2
    bond0
eth1
    bond0
eth0
lupen3
    bond1
       bond0
lo
lxcbr0
virbr0
veth6404e35
    docker0

$ ./nettree.sh -d
docker0
    veth6404e35
eth0
lo
bond0
    eth1
    eth2
    bond1
       eth3
       lupen3
lxcbr0
virbr0
```

repository: jaimet/show-net-devices-tree

repo_name: jaimet/show-net-devices-tree


text:
**Due to the LLVM community's planes to add the Bazel build files in the project's monorepo
[[1]](https://lists.llvm.org/pipermail/llvm-dev/2021-March/149220.html), I see no intent for
the project.**

# Bazel to the LLVM Compiler Infrastructure bridge

[Bazel](https://docs.bazel.build/versions/master/bazel-overview.html) is an open-source
build and test tool similar to Make, Maven, and Gradle. It uses a human-readable,
high-level build language. Bazel supports projects in multiple languages and builds outputs
for multiple platforms. For example, Tensorflow - end-to-end open-source platform for
machine learning - uses Bazel as the build system.

[LLVM](https://llvm.org/) is a collection of modular and reusable compiler and toolchain
technologies. The LLVM Core libraries provide a modern source- and target-independent
optimizer and code generator that makes it easy to invent a new programming language or
port an existing compiler. Also LLVM provides its own native C/C++ compiler - Clang,
debugger - LLDB, an implementation of the C++ Standard Library, and many other interesting
things. The full list of LLVM's primary sub-projects is available on the official web-site.

**bazel-llvm-bridge** provides a bridge that let you use static libraries from a local
installation or kindly downloaded archive of LLVM in your projects when Bazel is used
as a building tool. Each library from LLVM/Clang (including the special 'headers' library
that provides LLVM's and Clang's headers) is available as a `@local_llvm//:llvm_<library_name>`
dependency (`@local_llvm//:llvm_headers` for the headers library), where `@local_llvm` is
the name of the used `llvm_configure`
[repository rule](https://docs.bazel.build/versions/master/skylark/repository_rules.html)
while `llvm_`, `clang_` and `mlir_` are the default prefixes for LLVM, Clang and MLIR specific
rules, all these parameters can be configured in your `WORKSPACE`. Notice that a library will
bring also its dependencies exactly how the *CMake* build works.

Platform-provided libraries such as "ncurses", "tinfo", "pthreads", "Z3" will be detected
automatically using the `*.cmake` files generated by CMake during the LLVM build process.

Notice: The minimum supported version of Bazel is
[**0.25.0**](https://github.com/bazelbuild/bazel/releases/tag/0.25.0).

### How to leverage the bridge in your project

In order to use any LLVM libraries in your targets, add the following to your
`WORKSPACE` file:

```bzl
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "bazel_llvm_bridge",
    sha256 = "0e0971ec02d5e061c2c472d185e390597a4d7842e3e457cfcda2f04c1839c05e",
    strip_prefix = "bazel-llvm-bridge-release-11-05",
    url = "https://github.com/samolisov/bazel-llvm-bridge/archive/release/11-05.zip",
)

load("@bazel_llvm_bridge//llvm:llvm_configure.bzl", "llvm_configure")

llvm_configure(
    name = "local_llvm",
    llvm_prefix = "llvm_",
    clang_prefix = "clang_",
    libcxx_prefix = "libcxx_",
    mlir_prefix = "mlir_",
    add_headers_to_deps = False,
)
```

Where `name` is whatever you want, default values for `llvm_prefix`, `clang_prefix`,
`libcxx_prefix` and `mlir_prefix` may be omitted. By default, the header libraries will be
automatically included as dependency to the generated targets (the LLVM header library to
LLVM's, Clang's and other project's targets, the Clang header library to Clang's targets, etc.)
If you would like to manually put the header libraries to dependencies, set up the
`add_headers_to_deps` attribute of the reporitory rule to `False`.

The LLVM libraries are fetched from a local installation so the `LLVM_INSTALL_PREFIX`
environment variable **must** point to the local installation.

The library's version number is matched to the version of LLVM and can be found in the
`release/<version>-<build>` tag or `release/<version>.x` branch. For example:

```bash
$ git clone https://github.com/samolisov/bazel-llvm-bridge.git
$ git checkout release/9.x
$ git log --oneline -1
```

shows you the latest commit in the release branch. The commit can be used as a value of the `commit`
attribute of the `git_repository` rule to checkout the compatible version of **bazel-llvm-bridge** for
the used version of **LLVM**:

```bzl
git_repository(
    name = "bazel_llvm_bridge",
    commit = "<THE LATEST COMMIT HERE>",
    remote = "https://github.com/samolisov/bazel-llvm-bridge.git",
)
```

Now the desired libraries can be added as dependencies (the `deps` attribute) to targets for
your libraries and binaries (through the `@local_llvm` repository):

```bzl
cc_binary(
    name = 'llvm_bb_counter',
    srcs = [
        "llvm/llvm_bb_counter.cc",
    ],
    deps = [
        "@local_llvm//:llvm_headers",
        "@local_llvm//:llvm_bit_reader",
    ] + if_cxx_linked([
        "@local_llvm//:libcxx_shared",
        "@local_llvm//:libcxx_abi_shared",
    ]),
    visibility = ["//visibility:private"],
)
```

### How to build the project

To build your targets, do the following:

 0. Build from sources or download from http://releases.llvm.org/download.html an
    archive with an LLVM package for your platform. The package must be unarchived
    into a local directory.

 1. Set up the `LLVM_INSTALL_PREFIX` environment variable. The variable must
    contain a path to a local LLVM installation:

    ```bash
    $ export LLVM_INSTALL_PREFIX=~/dev/llvm_master
    ```

    or, on Windows:

    ```bash
    $ set LLVM_INSTALL_PREFIX=C:\Dev\llvm_master
    ```

 2. Run the build:

    ```bash
    $ bazel build //:llvm_bb_counter
    ```

    alternatively, the environment variables may be passed directly to the build
    command:

    ```bash
    $ bazel build --action_env LLVM_INSTALL_PREFIX=C:\Dev\llvm_master //:clang_list_methods
    ```

### How to deal with targets

The **bazel-llvm-bridge** supports all out-of-the-box provided LLVM targets:
 * AArch64
 * AMDGPU
 * ARM
 * AVR
 * BPF
 * Hexagon
 * Lanai
 * Mips
 * MSP430
 * NVPTX
 * PowerPC
 * RISCV
 * Sparc
 * SystemZ
 * WebAssembly
 * X86
 * XCore

To link against a target, the user should to check whether the target is supported by the used
local installation of LLVM. A set of `if_has_<TARGET>` functions are provided by
`@local_llvm//:llvm_config.bzl` generated skylark file. Every function returns its first argument
when the target `<TARGET>` is supported, otherwise it returns the second argument. The function
is usable through the following way (see the `//:llvm_print_supported_targets` target in
the `examples/BUILD` file):

```bzl
load("@local_llvm//:llvm_config.bzl",
    "llvm_copts",
    "if_has_aarch64",
    ...
    "if_has_x86")

cc_binary(
    name = "llvm_print_supported_targets",
    srcs = [
        ...
    ],
    copts = llvm_copts()
        + if_has_aarch64(["-DLLVM_SUPPORTS_TARGET_AARCH64"])
        ...
        + if_has_x86(["-DLLVM_SUPPORTS_TARGET_X86"]),
    deps = if_has_aarch64([
        "@local_llvm//:llvm_aarch64_asm_parser",
        "@local_llvm//:llvm_aarch64_code_gen",
        "@local_llvm//:llvm_aarch64_disassembler",
    ]) +
    ...
       + if_has_x86([
        "@local_llvm//:llvm_x86_asm_parser",
        "@local_llvm//:llvm_x86_code_gen",
        "@local_llvm//:llvm_x86_disassembler",
    ])
)
```

### How to deal with tablegen

LLVM, Clang and MLIR are very intensive users of the [tablegen](https://llvm.org/docs/TableGen/) tool.
For example, MLIR's Table-driven
[Declarative Rewrite Rule](https://github.com/llvm/llvm-project/blob/master/mlir/docs/DeclarativeRewrites.md)
is based upon tablegen. Fortunately, **bazel-llvm-bridge** provides a rule to run the tablegen
tools for LLVM as well as for MLIR (`llvm-tblgen` and `mlir-tblgen` respectively). The rules are defined
in the `llvm_tablegen.bzl` and `mlir_tablegen.bzl` files.

To run the tablegen tool, the user should define one or more targets based on the `<prefix>_tablegen`
rule in a BUILD file. The targets can be used by any other `cc_` ones as dependencies and also
can depend on any `cc_library` (the tablegen tool will use includes and headers provided by such
libraries). For example:

```bzl
load("@local_llvm//:llvm_tablegen.bzl", "tablegen")

cc_binary(
    name = 'llvm_print_physical_registers',
    ...
    deps = [
        ...
        ":tablegen_registers",
    ],
    visibility = ["//visibility:private"],
)

tablegen(
    name = "tablegen_registers",
    srcs = [
        "llvm/target/custom_register_class.td",
    ],
    src = "llvm/target/custom_register_info.td",
    out = "target/custom_register_info.inc",
    opts = ["-gen-register-info"],
    deps = ["@local_llvm//:headers"],
    visibility = ["//visibility:private"],
)
```

Notice: a target should be defined for every tablegen invocation.

The `<prefix>_tablegen` rule has the following attributes:
 * name - the target's name.
 * src - the tablegen (.td) file to be the input of the tablegen tool.
 * srcs - the tablegen and other files used by the 'src' file. This attribute may be
   required for sandboxing.
 * out - the generated file's name. Can be prefixed with any number of folders
   (for example, `toy/Ops.h.inc`).
 * opts - command line options for the tablegen tool.
 * deps - the list of libraries that provide includes for the .td file.
 * includes - the list of include dirs to be added to the command line.

### How to deal with Clang/LLVM/MLIR shared libraries

Important note for users of the `libclang`, `libclang-cpp` and `LLVM-C` shared
libraries. There are three rules to bring these libraries from the LLVM
installation into the `bazel-bin`: `clang_copy_libclang`, `clang_copy_libclang_cpp`
and `llvm_copy_c`. Just add the targets into the `data` attribute of a rule and
they will appear in a `bazel-bin/external/<name of llvm_configure repository rule>`
directory. Then the libraries can be copied into the `bazel-bin` (see genrules
in the `examples/BUILD` file) and be used for running your applications.

### Linking against the libc++ standard library

Archives hosted on the http://releases.llvm.org/download.html official website
are usually built against the libc++ standard library. A configuration has been
added to the `examples/.bazelrc` file to make Bazel link the targets against
libc++. To enable the configuration, an `examples/libcxx.bazelrc` file must
be generated, the file contains a set of `BAZEL_...` repository environment
variable to let Bazel know where to look for libc++'s headers and the shared
library file.

To generate the file, a python script, `generate_libcxx_bazelrc.py`, was
developed and placed into the `examples` directory. The script accepts two
parameters: `-I<path to libc++ headers such as iostream or string>` and
`-L<path to libc++ shared library, libc++.so.1>`. For example:

```bash
$ python3 generate_libcxx_bazelrc.py -L/home/user/llvm/lib -I/home/user/llvm/include/c++/v1
```

Once a `libcxx.bazelrc` file has been generated, a build can be started with `--config=libc++`
option:

```bash
$ bazel build --repo_env LLVM_INSTALL_PREFIX=/home/user/llvm --config=libc++ //:clang_list_methods
```

repository: samolisov/bazel-llvm-bridge

repo_name: samolisov/bazel-llvm-bridge