text:
# BabySync API

 Productivity app and web service to help parents synchronize responsibilities.

## Workspace Setup Instructions

Install node (min version 0.12.0) from https://nodejs.org/

__gulp__ handles live-reloading of the development server and re-runs test cases to ensure functionality is preserved.  Gulp is a task manager that also handles running scripts for cleanup and baselining.

For example, the following task, defined in gulpfile.js, will execute a shell script which stops the local neo4j database server, wipes out the database, restarts the database, and repopulates with baseline data defined in CSV files.  This is useful if your database has gotten out of sync (has zombie nodes) during development.

```
$ gulp clean
```

__n__ is a node version manager which allows you to easily switch between node versions.  Because this project utilizes the Koa framework which utilizes javascript generator functions, the latest node version (at least 0.12.0) will be needed.

```
$ npm install -g n
```

Installing a version is as simple as typing "n" followed by the version.

```
$ n 0.12.0
```
Changing the active version is as simple as typing "n" and using the arrow keys to select one of the installed versions of node.

```
$ n
```

The package.json file contains a list of the fundamental NPM dependencies.  Among other options, this file describes the entry-point javascript file into the app "server.js" and the script used to start it.  Gulp is delegated to kick off the appropriate tasks.

## BabySync REST API

The API is designed to be simple and pragmatic.

The authentication mechanism relies on the Facebook SDK.

There are two primary operations to the service:

GET:

Take the unique Facebook login ID to extract the family information, from other
parents to keep in sync, children in the family, and the timers associated with
each of the children.

UPDATE timer:

Every time a timer is reset/activated/deactivated.

UPDATE child:

UPDATE parent:

POST child:

POST parent:

DELETE child:

DELETE parent:

For example, "Friend" is not a node in the Neo4j database, but is a relationship between nodes such as ":FRIENDS_WITH".  Using these relationships, a query can produce the list of mutual friends between two or more users.

```js
// Example Javascript
function hola() {
	// This is a test for README.md formatting
}
```

### REST API V1

#### [Authentication](docs/authentication.md)
| Endpoint | Description |
| ---- | --------------- |
| [POST /api/v1/auth/admin/](docs/admin.md#post-admin-login) | Request new admin
| [POST /api/v1/auth/user/](docs/admin.md#post-user-login) | Request admin list |
| [GET /api/v1/auth/logout/](docs/admin.md#get-logout) | Request bulk admin update  |

#### [Admin](docs/admin.md)

| Endpoint | Description |
| ---- | --------------- |
| [POST /api/v1/admin/](docs/admin.md#post-admin) | Request new admin
| [GET /api/v1/admin/](docs/admin.md#get-admin-list) | Request admin list |
| [GET /api/v1/admin/:id](docs/admin.md#get-admin-by-id) | Request admin with id |
| [PUT /api/v1/admin/](docs/admin.md#put-admin-batch) | Request bulk admin update  |
| [PUT /api/v1/admin/:id](docs/admin.md#put-admin-by-id) | Request admin edit with id |
| [DELETE /api/v1/admin/](docs/admin.md#delete-admin-batch) | Request bulk admin delete |
| [DELETE /api/v1/admin/:id](docs/admin.md#delete-admin-by-id) | Request admin delete with id |

#### [User](docs/user.md)

| Endpoint | Description |
| ---- | --------------- |
| [POST /api/v1/user/](docs/user.md#post-user) | Request new user
| [GET /api/v1/user/](docs/user.md#get-user-list) | Request user list |
| [GET /api/v1/user/:id](docs/user.md#get-user-by-id) | Request user with id |
| [PUT /api/v1/user/](docs/user.md#put-user-batch) | Request bulk user update  |
| [PUT /api/v1/user/:id](docs/user.md#put-user-by-id) | Request user edit with id |
| [DELETE /api/v1/user/](docs/user.md#delete-user-batch) | Request bulk user delete |
| [DELETE /api/v1/user/:id](docs/user.md#delete-user-by-id) | Request user delete with id |

#### Geocache

| Endpoint | Description |
| ---- | --------------- |
| [POST /api/v1/geocaches/](#post-geocaches) | Request new geocache
| [GET /api/v1/geocaches/](#get-geocaches) | Request geocache list |
| [PUT /api/v1/geocaches/](#put-geocaches) | Request bulk geocache update  |
| [DELETE /api/v1/geocaches/](#delete-geocaches) | Request bulk geocache delete |
| [GET /api/v1/geocaches/:id](#get-geocaches-id) | Request geocache with id |
| [PUT /api/v1/geocaches/:id](#put-geocaches-id) | Request geocache edit with id |
| [DELETE /api/v1/geocaches/:id](#delete-geocaches-id) | Request geocache delete with id |

### Derived Relationship Queries

#### Mutual Friends

#### Recent Activity (Feed)

repository: forgo/BabySync

repo_name: forgo/BabySync


text:
---
title: " "
feature_row1:
  - image_path: /assets/images/pvsa/2020_jason_fu.jpg
  - image_path: /assets/images/activities/year_2020.jpg
---

{% include feature_row id="feature_row1"%}

# Jason Fu - Gold Award

**School: Sunset High School**
**Category: Teens (11-15)**
**Hours: 211**

Jason Fu is a sophomore at Sunset High School. He participates in competitive badminton and is interested in software development. When the pandemic first arose, he grew increasingly concerned about the quality of the education the students were now receiving. After looking into it, he realized that students were beginning to fall behind due to the flaws of distance learning, so he began teaching numerous classes to resolve that. Under the YouthLink program, he taught Japanese, Python programming, and ELA, and is continuing to teach to this day. Additionally, after witnessing the misfortune of lower income communities, he realized that libraries are an effective way to treat this problem, so he began volunteering at his local library. To this day, Jason strives to aid those in need and improve the community for all.

Oregon Chinese Coalition is proud to join the President of the United States in recognizing the volunteers who consistently take the time to make a difference in the lives of others. Therefore, it is a great honor to present the President's Volunteer Service Award (PVSA) to Jason Fu.

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# ARainbowTags
EXILED port of RainbowTags, [originally](https://github.com/sirmeepington/RainbowTag/) created by [@SirMeepington](https://github.com/sirmeepington). Makes server badges go through a spectrum of colours in SCP:SL.

This mod makes use of [EXILED](https://github.com/galaxy119/EXILED/) for [SCP:SL](https://scpslgame.com/)

## Configuration

```yaml
rainbow_tags:
  is_enabled: true
  use_custom_sequence: false
  tag_interval: 0.5
  active_groups:
  - owner
  - admin
  - moderator
  custom_sequence:
  - red
  - orange
  - yellow
  - green
  - blue_green
  - magenta
```

**Valid Colours**:
* pink
* red
* brown
* silver
* light_green
* crimson
* cyan
* aqua
* deep_pink
* tomato
* yellow
* magenta
* blue_green
* orange
* lime
* green
* emerald
* carmine
* nickel
* mint
* army_green
* pumpkin

#### FAQ

If you get issues about `TAG FAIL`, you've either used a invalid / prohibited color. If you're certain you're not using a prohibited color, restart the server.

repository: FruitBoi/RainbowTags

branch_name: refs/heads/master

gha_language: C#

gha_license_id: MIT

repo_name: FruitBoi/RainbowTags


text:
# Schedule

### Week 01
-String
-Number
-Boolean

Ways to declare variables  the types of variable that can be used within JavaScript language

### Week 02

### Week 03
Function
For loop

### Week 04
Creating an Array
Using method to manipulate array such as:
Push array,
mixemup array
Array Of

### Week 05

### Week 06

Maths.min
Refactoring
Objects literal notation
Refactoring simple fuctiion that interweaves two arrays.

### Week 07

looking into JavaScript objects

### Week 08

### Week 09
Fibinacci Squence


text:
SublimeLinter-phpmd
=========================

This linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) provides an interface to [phpmd](http://phpmd.org/documentation/index.html).
It will be used with files that have the "PHP", "HTML" and "HTML5" syntax.

## Installation

### Install `SublimeLinter` and `SublimeLinter-phpmd`

Make sure [Package Control](https://packagecontrol.io) is installed.

1. Open the command palette (Ctrl + Shift + P)
2. Type **Package Control: Install Package** and select it.
3. Type **SublimeLinter** and select it.
4. Repeat steps 1-3 typing **SublimeLinter-phpmd** in step 3.

### Install `phpmd`

Choose one of the installation methods below.

A local install allows you to fine-tune `phpmd` on a per-project basis. A global install is available system-wide.

#### Local install with [Composer](https://getcomposer.org/)

On a command line inside your project:
```bash
composer require phpmd/phpmd
```

Inside Sublime, go to **Preferences -> Package Settings -> SublimeLinter -> Settings**.

Set the `phpmd` executable by adding/editing:
```json
  "linters": {
    "phpmd": {
      "executable": "${folder}/vendor/bin/phpmd"
    }
  }
```

#### Global install with [Composer](https://getcomposer.org/)

```bash
composer global require phpmd/phpmd
```

Make sure the composer global bin directory is available in $PATH:

```bash
export PATH=~/.composer/vendor/bin:$PATH
```

#### Global install with [PEAR](https://pear.php.net)

```bash
pear channel-discover pear.phpmd.org
pear channel-discover pear.pdepend.org
pear install --alldeps phpmd/PHP_PMD
```

## Settings

- SublimeLinter settings: http://sublimelinter.com/en/latest/settings.html
- Linter settings: http://sublimelinter.com/en/latest/linter_settings.html

### Additional settings

If you want to use a baseline file, the linter needs to run on the actual files instead of the temporary files we need for real-time "background" linting.
Therefore, set the "real_file_mode" setting to true.

```json
"linters": {
  "phpmd": {
    "real_file_mode": true
  }
}
```

### Rulesets

You can configure rules via the `rulesets` setting. This can be a list of rules, or a path to a custom ruleset file.

```json
  "linters": {
    "phpmd": {
      "rulesets": "codesize,unusedcode,naming"
    }
  }
```

```json
  "linters": {
    "phpmd": {
      "rulesets": "${folder}/phpmd.xml"
    }
  }
```

repository: SublimeLinter/SublimeLinter-phpmd

gha_language: Python

repo_name: SublimeLinter/SublimeLinter-phpmd


text:
SixLabors.Fonts

[![Build Status](https://img.shields.io/github/actions/workflow/status/SixLabors/Fonts/build-and-test.yml?branch=main)](https://github.com/SixLabors/Fonts/actions)
[![codecov](https://codecov.io/gh/SixLabors/Fonts/branch/main/graph/badge.svg)](https://codecov.io/gh/SixLabors/Fonts)
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

[![GitHub issues](https://img.shields.io/github/issues/SixLabors/Fonts.svg)](https://github.com/SixLabors/Fonts/issues)
[![GitHub stars](https://img.shields.io/github/stars/SixLabors/Fonts.svg)](https://github.com/SixLabors/Fonts/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/SixLabors/Fonts.svg)](https://github.com/SixLabors/Fonts/network)

**SixLabors.Fonts** is a new cross-platform font loading and drawing library.

## License

- Fonts is licensed under the [Apache License, Version 2.0](https://opensource.org/licenses/Apache-2.0)
- An alternative Commercial Support License can be purchased **for projects and applications requiring support**.
Please visit https://sixlabors.com/pricing for details.

## Support Six Labors

Support the efforts of the development of the Six Labors projects.
 - [Purchase a Commercial Support License :heart:](https://sixlabors.com/pricing/)
 - [Become a sponsor via GitHub Sponsors :heart:]( https://github.com/sponsors/SixLabors)
 - [Become a sponsor via Open Collective :heart:](https://opencollective.com/sixlabors)

## Documentation

- [Detailed documentation](https://sixlabors.github.io/docs/) for the Fonts API is available. This includes additional conceptual documentation to help you get started.
- Our [Samples Repository](https://github.com/SixLabors/Samples/tree/main/ImageSharp) is also available containing buildable code samples demonstrating common activities.

## Questions

- Do you have questions? We are happy to help! Please [join our Discussions Forum](https://github.com/SixLabors/Fonts/discussions/category_choices).
- Please read our [Contribution Guide](https://github.com/SixLabors/Fonts/blob/main/.github/CONTRIBUTING.md) before opening issues or pull requests!

## Code of Conduct
This project has adopted the code of conduct defined by the [Contributor Covenant](https://contributor-covenant.org/) to clarify expected behavior in our community.
For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).

## Installation

Install stable releases via Nuget; development releases are available via Feedz.io.

| Package Name                   | Release (NuGet) | Nightly (Feedz.io) |
|--------------------------------|-----------------|-----------------|
| `SixLabors.Fonts`         | [![NuGet](https://img.shields.io/nuget/v/SixLabors.Fonts.svg)](https://www.nuget.org/packages/SixLabors.Fonts/) | [![feedz.io](https://img.shields.io/badge/endpoint.svg?url=https%3A%2F%2Ff.feedz.io%2Fsixlabors%2Fsixlabors%2Fshield%2FSixLabors.Fonts%2Flatest)](https://f.feedz.io/sixlabors/sixlabors/nuget/index.json) |

## Manual build

If you prefer, you can compile Fonts yourself (please do and help!)

- Using [Visual Studio 2019](https://visualstudio.microsoft.com/vs/)
  - Make sure you have the latest version installed
  - Make sure you have [the .NET Core 3.1 SDK](https://www.microsoft.com/net/core#windows) installed

Alternatively, you can work from command line and/or with a lightweight editor on **both Linux/Unix and Windows**:

- [Visual Studio Code](https://code.visualstudio.com/) with [C# Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp)
- [.NET Core](https://www.microsoft.com/net/core#linuxubuntu)

To clone Fonts locally, click the "Clone in [YOUR_OS]" button above or run the following git commands:

```bash
git clone https://github.com/SixLabors/Fonts
```

If working with Windows please ensure that you have enabled log file paths in git (run as Administrator).

```bash
git config --system core.longpaths true
```

### Submodules

This repository contains [git submodules](https://blog.github.com/2016-02-01-working-with-submodules/). To add the submodules to the project, navigate to the repository root and type:

``` bash
git submodule update --init --recursive
```

### Features
- Reading font description (name, family, subname etc plus other string metadata).
- Loading OpenType fonts with with CFF1 and True Type outlines.
- Loading True Type fonts.
- Loading [WOFF fonts](https://www.w3.org/Submission/WOFF/).
- Loading [WOFF2 fonts](https://www.w3.org/TR/WOFF2).
- Load all compatible fonts from local machine store.
- Suppord for line breaking based on [UAX 14](https://www.unicode.org/reports/tr14/)
- Support for rendering left to right, right to left and bidirectional text.
- Support for ligatures.
- Support for advanced OpenType features glyph substitution ([GSUB](https://docs.microsoft.com/en-us/typography/opentype/spec/gsub)) and glyph positioning ([GPOS](https://docs.microsoft.com/en-us/typography/opentype/spec/gpos))

## API Examples

### Read font description

```c#
FontDescription description = null;
using(var fs = File.OpenRead("Font.ttf")){
    description = FontDescription.Load(fs); // once it has loaded the data the stream is no longer required and can be disposed of
}

string name = description.FontName(CultureInfo.InvariantCulture);

```

### Populating a font collection

```c#
FontCollection fonts = new FontCollection();
FontFamily font1 = fonts.Add("./path/to/font1.ttf");
FontFamily font2 = fonts.Add("./path/to/font2.woff");

```

### How can you help?

Please... Spread the word, contribute algorithms, submit performance improvements, unit tests.

### Projects using SixLabors.Fonts

* [SixLabors.ImageSharp](https://github.com/jimBobSquarePants/ImageSharp) - cross platform, fully managed, image manipulation and drawing library.

### The SixLabors.Fonts Team

- [Scott Williams](https://github.com/tocsoft)
- [Dirk Lemstra](https://github.com/dlemstra)
- [Anton Firsov](https://github.com/antonfirsov)
- [James Jackson-South](https://github.com/jimbobsquarepants)
- [Brian Popow](https://github.com/brianpopow)

repository: SixLabors/Fonts

gha_license_id: NOASSERTION

repo_name: SixLabors/Fonts


text:
# Versions

## Version 3.1.0

- `market`: added to show market price history

## Version 3.0.0

- `chain-receive`: added to create address to receive on-chain funds via submarine swap
- `closed`: added compatibility with btctestnet
- `inbound-liquidity`: added argument --with to limit liquidity measure to a single peer
- `increase-inbound-liquidity`: Added arg --max-fee to limit the estimated fee paid
- `pay`: added to pay a payment request
- `peers`: added to show connected peers with liquidity information

### Breaking Changes

Arguments have been standardized on `kebab-case`, `snake_case` is no longer used.

- `accounting`: --rate-provider replaces --rate_provider
-  `utxos`: --count-below replaces --count_below

repository: wbobeirne/balanceofsatoshis

repo_name: wbobeirne/balanceofsatoshis


text:
Checks for extra/unnecessary whitespace.

# Examples

```ruby

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/rubocop/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/rubocop/rubocop"

# good only if AllowBeforeTrailingComments is true
object.method(arg)  # this is a comment

# good even if AllowBeforeTrailingComments is false or not set
object.method(arg) # this is a comment

# good with either AllowBeforeTrailingComments or AllowForAlignment
object.method(arg)         # this is a comment
another_object.method(arg) # this is another comment
some_object.method(arg)    # this is some comment
```

[Source](http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Layout/ExtraSpacing)

repository: codacy/codacy-rubocop

gha_language: Ruby

repo_name: codacy/codacy-rubocop


text:
# postgres-pgadmin-docker
Setup to deploy the `postgres` database system https://hub.docker.com/_/postgres and as the web-based administration interface `pgAdmin4` https://hub.docker.com/r/dpage/pgadmin4 in a `Docker` environment.

## Prerequisites
`Docker` https://www.docker.com/ and `Docker Compose` https://docs.docker.com/compose/ are up and running.

Create an `.env` file in the project directory and add your custom values to build the image and run the stack.

Example:

```bash

# General environment settings for containers

USER=postgres
PROJECT=postgres-pgadmin-docker
REPO="$USER/$PROJECT:latest"
IMAGE="$PROJECT-image"
CONTAINER="$PROJECT-container"
HOST="localhost"
INTERNAL_PORT=80
EXTERNAL_PORT=8080

# Environment settings for stack.yml

# Postgres Password:
POSTGRES_PASSWORD=your-postgres-password

# pgadmin4 Email:
PGADMIN_EMAIL=your-email

# pgadmin4Password:
PGADMIN_PASSWORD=your-pgadmin-password

```

## Build and run the containers
The script `app.sh` facilitates the build and run process.

```bash

# Make script executable
chmod +x app.sh

# Run script to use docker-compose
# Options:  stackup, stackdown, stackstop, stackstart
bash ./app.sh

# or just if it works in your terminal:
./app.sh

# Examples:
# Build and run the containers
./app.sh stackup

```

## Configuration of postgres and pgadmin
- Open http://localhost:8080 in your browser.
- Sign in with your pgadmin email and password as defined in `.env`.
- Navigate to "Servers" on the left side, then right-click an select "Create -> Server".
- Set user to `postgres` and use the password as defined in `.env.`
- In the connection tab use `db` as "Host name/address" and `5423` as a port.
- See an example sql script here: `sql/parametric-elements.sql`.
- This database is being imported as a volumne in `stack.yml`.

repository: mkuegeler/postgres-pgadmin-docker

repo_name: mkuegeler/postgres-pgadmin-docker


text:
---
layout: post
title: Gameplay Programming, Collectables
date: 2018-02-19
excerpt: The second task in Unity for Gameplay Programming involving collectables.
GPPproject: true
tags: [GPP, GPPproject]
category: post
published: true
comments: true
---

The task requires the implementation of two power ups, one for a double jump and one for a temporary speed boost, both of which including particle effects.

In order to progress any further with the overarching assignment, I have fixed the avatar's movement to make it fully comply with the player's input. This uses the same code from before but is written in a more polished fashion. Jumping is now also implemented fully, and the temporary camera has been atuned further to observe the avatar's actions.

The power ups implemented work as intended and leave particle effects behind when picked up, with the double jump giving the player another jump if they press space during the descent of their first jump and the speed boost power up giving the player a 4 second boost in speed when holding shift. The effects are also able to stack, giving the player an elongated jump when running with the speed boost.

There is notable room for improvement, most notably select animations transitioning to any aerial movement. When normally moving around, the avatar jumps properly however when the avatar lands, they will move around in the idle animation for a number of seconds as if stuck in exit time, after which animations will begin to function normally again. As well as this, the flip animation used for the double jump seems to not function and instead has the avatar squat during and before an idle animation which will be applied until landing. Both of these problems seem fixable by tinkering with animation booleans in the animator and inside of the code. To add, other alterations could include adding particle trails for the speed boost and particle effects onto the items themselves while they are in the world.

[https://www.youtube.com/watch?v=k5QpSrsSK-s](https://www.youtube.com/watch?v=k5QpSrsSK-s)

The avatar approaching the double jump power up:

The avatar jumping successfully (left) and the avatar jumping instantly after landing(right):

Collecting the double jump, which explodes into a flurry of red petals:

Collecting the speed boost, which erupts into a pillar of fire:


text:
---
layout: default
title: '[bitcoin-list] Bitcoin v0.1.2 now available'
grand_parent: Emails
parent: '[bitcoin-list]'
nav_order: 2
date: 2009-01-11 22:32:18 UTC
original: https://sourceforge.net/p/bitcoin/mailman/message/21303153/
---

# [bitcoin-list] Bitcoin v0.1.2 now available

---

```
Bitcoin v0.1.2 is now available for download.

See http://www.bitcoin.org for the download link.

All the problems I've been finding are in the code that
automatically finds and connects to other nodes, since I wasn't
able to test it in the wild until now. There are many more ways
for connections to get screwed up on the real Internet.

Bugs fixed:
- Fixed various problems that were making it hard for new nodes to
see other nodes to connect to.
- If you're behind a firewall, it could only receive one
connection, and the second connection would constantly disconnect
and reconnect.

These problems are kind of screwing up the network and will get
worse as more users arrive, so please make sure to upgrade.

Satoshi Nakamoto
```


text:
## Features

* Adapts to any backend (REST, GraphQL, SOAP, etc.)
* Powered by [material-ui](https://material-ui.com/), [redux](https://redux.js.org/), [redux-form](https://redux-form.com/7.3.0/), [redux-saga](https://redux-saga.js.org/), [react-router](https://reacttraining.com/react-router/), [recompose](https://github.com/acdlite/recompose), [reselect](https://github.com/reduxjs/reselect) and a few more
* Super-fast UI thanks to optimistic rendering (renders before the server returns)
* Undo updates and deletes for a few seconds
* Complete documentation
* Relationships (many to one, one to many)
* Data Validation
* Internationalization (i18n)
* Conditional formatting
* Themeable
* Supports any authentication provider (REST API, OAuth, Basic Auth, ...)
* Full-featured datagrid (sort, pagination, filters)
* Filter-as-you-type
* Supports any form layout (simple, tabbed, etc.)
* Custom actions
* Large library of components for various data types: boolean, number, rich text, etc.
* WYSIWYG editor
* Customize dashboard, menu, layout
* Super easy to extend and override (it's just React components)
* Highly customizable interface
* Can connect to multiple backends
* Can be included in another React app
* Inspired by the popular [ng-admin](https://github.com/marmelab/ng-admin) library (also by marmelab)

## Installation

React-admin is available from npm. You can install it (and its required dependencies)
using:

```sh
npm install react-admin

#or
yarn add react-admin
```

## At a Glance

```jsx
// in app.js
import React from 'react';
import { render } from 'react-dom';
import { Admin, Resource } from 'react-admin';
import restProvider from 'ra-data-simple-rest';

import { PostList, PostEdit, PostCreate, PostIcon } from './posts';

render(
    <Admin dataProvider={restProvider('http://localhost:3000')}>
        <Resource name="posts" list={PostList} edit={PostEdit} create={PostCreate} icon={PostIcon}/>
    </Admin>,
    document.getElementById('root')
);
```

The `<Resource>` component is a configuration component that allows to define sub components for each of the admin view: `list`, `edit`, and `create`. These components use Material UI and custom components from react-admin:

```jsx
// in posts.js
import React from 'react';
import { List, Datagrid, Edit, Create, SimpleForm, DateField, TextField, EditButton, TextInput, DateInput } from 'react-admin';
import BookIcon from '@material-ui/core/svg-icons/action/book';
export const PostIcon = BookIcon;

export const PostList = (props) => (
    <List {...props}>
        <Datagrid>
            <TextField source="id" />
            <TextField source="title" />
            <DateField source="published_at" />
            <TextField source="average_note" />
            <TextField source="views" />
            <EditButton basePath="/posts" />
        </Datagrid>
    </List>
);

const PostTitle = ({ record }) => {
    return <span>Post {record ? `"${record.title}"` : ''}</span>;
};

export const PostEdit = (props) => (
    <Edit title={<PostTitle />} {...props}>
        <SimpleForm>
            <TextInput disabled source="id" />
            <TextInput source="title" />
            <TextInput source="teaser" options={{ multiLine: true }} />
            <TextInput multiline source="body" />
            <DateInput label="Publication date" source="published_at" />
            <TextInput source="average_note" />
            <TextInput disabled label="Nb views" source="views" />
        </SimpleForm>
    </Edit>
);

export const PostCreate = (props) => (
    <Create title="Create a Post" {...props}>
        <SimpleForm>
            <TextInput source="title" />
            <TextInput source="teaser" options={{ multiLine: true }} />
            <TextInput multiline source="body" />
            <TextInput label="Publication date" source="published_at" />
            <TextInput source="average_note" />
        </SimpleForm>
    </Create>
);
```

## Does It Work With My API?

Yes.

React-admin uses an adapter approach, with a concept called *Data Providers*. Existing providers can be used as a blueprint to design your API, or you can write your own Data Provider to query an existing API. Writing a custom Data Provider is a matter of hours.

![Data Provider architecture](https://marmelab.com/react-admin/img/data-provider.png)

See the [Data Providers documentation](https://marmelab.com/react-admin/DataProviders.html) for details.

## Batteries Included But Removable

React-admin is designed as a library of loosely coupled React components built on top of [material-ui](https://material-ui.com/), in addition to controller functions implemented the Redux way. It is very easy to replace one part of react-admin with your own, e.g. to use a custom datagrid, GraphQL instead of REST, or bootstrap instead of Material Design.

# At the react-admin project root
make install

# or
yarn install

# Run the simple application
make run-simple
# Run the tutorial application
make build
make run-tutorial
# Run the demo application
make build
make run-demo
```

And then browse to the URL displayed in your console.

gha_language: TypeScript


text:
# Disallows arrow functions in templates (no-template-arrow)

Passing inline functions into templates will result in them
being created every time a render occurs, resulting in performance
loss.

Instead, you should do something like so:

```ts
_render() {
  return html`<x-foo @event=${this._onClick}>`;
}

_onClick() { ... }
```

As lit will automatically bind it to the correct context.

## Rule Details

This rule disallows using inline functions in templates.

The following patterns are considered warnings:

```ts
html`<x-foo @event=${() => {}}>`;
html`<x-foo @event=${function() { }}>`;
```

The following patterns are not warnings:

```ts
html`foo ${someVar}`;
```

## When Not To Use It

If you don't care about rendering performance, then you will not need this rule.

repository: ChromeDevTools/devtools-frontend

repo_name: ChromeDevTools/devtools-frontend


text:
BlindLove
====================

To run/test the app
--------------------

* On windows use activator.bat from command line. On *nix just use ./activator
* Once in the activator console, enter "run" to run the app. Check it out in your browser at localhost:9000
* To run tests, press Ctrl+D (when the app is running) to end the app execution. Then from the activator console, enter "test"

Important notes
-----------------
* Sources are primarily located in the app/ directory. There is some relevant configuration in conf/
* The database is automatically constructed in the db directory. During development you may need to delete this directory and re-run the application to repopulate the test database
* app/Global.java contains the code that creates test data
* app/views has the html views
* Static files can be placed in the /public/* directory and will be accessible at the /assets/* URL

Play2 Documentation
--------------------
* [Anatomy of a Play app](http://www.playframework.com/documentation/2.2.x/Anatomy)
* [Using the Play console](http://www.playframework.com/documentation/2.2.x/PlayConsole)
* [Play! for Java developers](http://www.playframework.com/documentation/2.2.x/JavaHome) is the general reference you will use regularly
* [eBeans](http://www.playframework.com/documentation/2.2.x/JavaForms), the database system
* [Info on the templating system](http://www.playframework.com/documentation/2.2.x/JavaTemplates)
* [Info on building web forms](http://www.playframework.com/documentation/2.2.x/JavaForms)
* Take a look at the "Computer Database" sample application. Look in your play distribution folder in the samples\java\computer-database directory.

repository: kylewetherald/blindlove

repo_name: kylewetherald/blindlove


text:
# Remediate non-compliant resources by using MNS topics

This topic describes how to push alert notifications to specified Message Service \(MNS\) topics if Cloud Config detects non-compliant configuration changes of resources. If you receive a non-compliance alert, Cloud Config uses the relevant functions of Alibaba Cloud Function Compute to automatically remediate these resources.

-   Cloud Config is authorized to access your resources and a rule is created based on a managed rule. For more information, see [Authorize Cloud Config to access your resources](/intl.en-US/Quick Start/Authorize Cloud Config to access your resources.md) and [Create a rule by using a managed rule](/intl.en-US/Resource Compliance Audit/Manage rules/Create a rule.md).
-   MNS is activated. For more information, see [Activate Message Service]().
-   Object Storage Service \(OSS\) is activated and an OSS bucket is created. For more information, see [Activate OSS](/intl.en-US/Console User Guide/Sign up for OSS.md) and [Create buckets](/intl.en-US/Quick Start/OSS console/Create buckets.md).
-   Function Compute is activated. For more information, see [Activate the Function Compute service]().

## Scenarios

You create a rule function and link it to a resource type named ACS::OSS::Bucket based on the managed rule named oss-bucket-public-read-prohibited. Cloud Config evaluates all resources of this type. One of the resources is evaluated as **Non-compliant**, as shown in the following figure.

![Bucket non-compliance](https://static-aliyun-doc.oss-accelerate.aliyuncs.com/assets/img/en-US/8747290061/p147935.png)

## Parameters

In this example, the read and write permissions of an OSS bucket are remediated. The following table describes the parameters that you can specify.

|Cloud service|Parameter|Example|
|-------------|---------|-------|
|Cloud Config|Managed Rule|oss-bucket-public-read-prohibited|
|Rule Name|test-oss-bucket-public-read-prohibited|
|MNS|Topic|MNSTestConfig|
|MNS Topic Region|Singapore \(Singapore\)|
|OSS|OSS Bucket|config-snapshot|
|Bucket ACL|Public-read|
|Function Compute|Service Name|resource\_repair|
|System Policies|AliyunOSSFullAccess|
|Function Name|oss\_repair\_acl\_trigger|
|Trigger Name|ConfigRuleNonComplianceMNSTrigger|

**Note:**

Cloud Config is deployed in the Singapore \(Singapore\) region. To reduce packet loss, we recommend that you select **Singapore \(Singapore\)** for the MNS Topic Region parameter.

## Workflow

The following figure shows how non-compliant resources are to automatically remediated.

![Remediation process](https://static-aliyun-doc.oss-accelerate.aliyuncs.com/assets/img/en-US/8747290061/p148001.png)

## Procedure

1.  Subscribe to resource events.

    For more information, see [Send notifications of resource events to an MNS topic](/intl.en-US/Events/Send notifications of resource events to an MNS topic.md).

2.  Create a service.

    1.  Log on to the [Function Compute console](https://fc.console.aliyun.com).

    2.  In the top navigation bar, select a region, for example, Singapore \(Singapore\)

    3.  In the left-side navigation pane, click **Service/Function**.

    4.  On the Service/Function page, select **Create Service** from the drop-down list.

    5.  On the **Create Service** page, specify **Service Name** and **Description**.

        ![Create a service](https://static-aliyun-doc.oss-accelerate.aliyuncs.com/assets/img/en-US/8747290061/p161827.png)

    6.  Click **Create**.

3.  Authorize the created service to access OSS buckets.

    1.  On the **Service Configurations** tab, click **Update**.

    2.  In the **Role Config** section, select **AliyunOSSFullAccess** from the **System Policies** drop-down list.

        ![Authorize the service to access OSS buckets](https://static-aliyun-doc.oss-accelerate.aliyuncs.com/assets/img/en-US/8747290061/p143868.png)

    3.  Click **Authorize**.

    4.  On the **Role Templates** page, specify **Policy Name**.

        ![Create a role](https://static-aliyun-doc.oss-accelerate.aliyuncs.com/assets/img/en-US/8747290061/p143881.png)

    5.  Click **Confirm Authorization Policy**.

4.  Create a function.

    1.  On the **Service/Function** page, click **Create Function**.

    2.  In the **Create Function** step, specify **Event Function** for the **Function Type** parameter, and then click **Next**.

    3.  In the **Configure Function** step, select **resource\_repair** from the **Service Name** drop-down list, and **python3** from the **Runtime** drop-down list. Keep the default values of other parameters.

        ![Configure the function](https://static-aliyun-doc.oss-accelerate.aliyuncs.com/assets/img/en-US/8747290061/p143857.png)

    4.  Click **Create**.

5.  Set the environment variables of the function.

    1.  In the left-side navigation pane, click **Service/Function**.

    2.  Click the created service. On the **Functions** tab, click the function name.

    3.  In the **Function Properties** section of the **Overview** tab, click **Configure**.

    4.  On the **Configure Function** page, set the required parameters.

        -   Enter **prepareRuleName** in the **Key** field.

            The values of the **prepareRuleName** parameter and **ENV\_RULE\_NAME** parameter must be the same.

        -   Enter **test-oss-bucket-public-read-prohibited** in the **Value** field.

            The value of the **test-oss-bucket-public-read-prohibited** parameter is the rule name.

    5.  Click **Submit**.

6.  Create a trigger.

    1.  Click the created service. On the **Functions** tab, click the function name.

    2.  On the **details** page, click the **Triggers** tab.

    3.  On the **Triggers** tab, click **Create Trigger**.

    4.  In the **Create Trigger** dialog box, set the required parameters.

        ![Create a trigger](https://static-aliyun-doc.oss-accelerate.aliyuncs.com/assets/img/en-US/9747290061/p161831.png)

        Set the following parameters:

        -   Select **MNS Topic Trigger** from the **Trigger Type** drop-down list.
        -   Enter **ConfigRuleNonComplianceMNSTrigger** in the **Trigger Name** field.
        -   Select **China \(Shanghai\)** from the **MNS Topic Region** drop-down list.
        -   Select **MNSTestConfig** from the **Topic** drop-down list.
        -   Select **JSON** from the **Event Format** drop-down list.
        **Note:** When you use the MNS topic trigger for the first time, you can specify **Quick Authorize** for the **Role Operation** parameter. You can authorize MNS to use the role AliyunMNSNotificationRjole to access your cloud resources as prompted. Then you can close and reopen the **Create Trigger** page. The role is displayed on the page.

    5.  Click **OK**.

        After the trigger is created, you will receive notifications of non-compliant events when Cloud Config evaluates resource compliance.

7.  Configure the automatic remediation code.

    1.  In the left-side navigation pane, click **Service/Function**.

    2.  Click the created service. On the **Functions** tab, click the function name.

    3.  On the details page, click the **Code** tab.

    4.  On the **Code** tab, select **In-line Edit**, copy and paste the following code.

        ```
        # -*- coding: utf-8 -*-
        import logging
        import json
        import os
        import base64
        import binascii
        from aliyunsdkcore.acs_exception.exceptions import ClientException, ServerException

        IDENTIFIER = 'evaluationResultIdentifier'
        QUALIFIER = 'evaluationResultQualifier'
        RULE_NAME = 'configRuleName'
        ENV_RULE_NAME = 'prepareRuleName'
        RESOURCE_ID = 'resourceId'
        REGION_ID = 'regionId'
        FAIL = 'fail'
        SUCC = 'success'

        logger = logging.getLogger()

        def handler(event, context):
            logger.info("mns_topic trigger event = {}".format(event))
            decoded = None
            if event:
                try:
                    decoded = base64.b64decode(event)
                except binascii.Error as ex:
                    logger.exception('mns_topic trigger event malformed!')
                    return FAIL
            if not decoded:
                return FAIL
            notify_json = json.loads(decoded)
            if notify_json and IDENTIFIER in notify_json:
                evaluationResultIdentifier = notify_json.get(IDENTIFIER)
                if QUALIFIER in evaluationResultIdentifier and RULE_NAME in evaluationResultIdentifier.get(QUALIFIER):
                    evaluationResultQualifier = evaluationResultIdentifier.get(QUALIFIER)
                    configRuleName = evaluationResultQualifier.get(RULE_NAME)
                    # os.environ.get(ENV_RULE_NAME) // Obtain the rule name, for example, test-oss-bucket-public-read-prohibited.
                    if configRuleName == os.environ.get(ENV_RULE_NAME):
                        if RESOURCE_ID in evaluationResultQualifier and REGION_ID in evaluationResultQualifier:
                            bucket_name = evaluationResultQualifier.get(RESOURCE_ID)
                            region = evaluationResultQualifier.get(REGION_ID)
                            if region and bucket_name:
                                try:
                                    remedy_by_fc_assume(context, region, bucket_name)
                                except Exception as ex:
                                    logger.exception('remedy fail!')
            return FAIL

        def remedy_by_fc_assume(context, region, bucket_name):
            creds = context.credentials
            auth = oss2.StsAuth(creds.access_key_id, creds.access_key_secret, creds.security_token)
            bucket = oss2.Bucket(auth, 'http://oss-' + region + '.aliyuncs.com', bucket_name)
            bucket.put_bucket_acl(oss2.BUCKET_ACL_PRIVATE)
            logger.info('bucket {bucket_name} in {region} acl remedy succ.'.format(bucket_name=bucket_name, region=region))

        ```

        **Note:** prepareRuleName is used as an example rule name in this code to describe the automatic remediation method of non-compliant resources. For information about how to remediate non-compliant resources by using other parameters, see [Resource non-compliance events](/intl.en-US/Events/Event types/Resource non-compliance events.md).

    5.  Click **Save**.

        **Note:** Do not click **Save and Invoke**. Otherwise, the code cannot be executed.

8.  After 10 minutes, you can check the remediation result.

    **Note:** If a resource is evaluated by the rule as non-compliant and no configurations are changed, you must re-evaluate resources before you perform this step. For more information, see [Manually re-evaluate resources](/intl.en-US/Resource Compliance Audit/Manage rules/Manually re-evaluate resources.md).

    -   View the remediation result in the Cloud Config console.

        ![OSS bucket compliance](https://static-aliyun-doc.oss-accelerate.aliyuncs.com/assets/img/en-US/9747290061/p144367.png)

    -   View the remediation result in the OSS console.

        ![OSS bucket compliance](https://static-aliyun-doc.oss-accelerate.aliyuncs.com/assets/img/en-US/9747290061/p146232.png)

url: https://raw.githubusercontent.com/hglakfs/config/e4b669aca73cab7bdc5cbf85748e2a6b70034b8c/intl.en-US/Best practices/Remediate non-compliant resources by using MNS topics.md

repository: hglakfs/config

repo_name: hglakfs/config


text:
# TurkishRegexps

[![Gem Version](https://badge.fury.io/rb/turkish_regexps.svg)](https://badge.fury.io/rb/turkish_regexps)
[![Build Status](https://travis-ci.org/sbagdat/turkish_regexps.svg?branch=main)](https://travis-ci.org/sbagdat/turkish_regexps)
[![Code Climate](https://codeclimate.com/github/sbagdat/turkish_regexps/badges/gpa.svg)](https://codeclimate.com/github/sbagdat/turkish_regexps)

Regular expressions meet Turkish language.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'turkish_regexps'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install turkish_regexps

## Usage

```ruby
require 'turkish_regexps'

include TurkishRegexps

# Creating new regexps
TrRegexp.new(/[ç-ş]/i)

# Translating character classes
TrRegexp.new(/[ç-ö]/).translate        # /[çdefgğhıijklmnoö]/
TrRegexp.new(/[A-Z]/).translate        # /[ABCÇDEFGĞHIİJKLMNOÖPQRSŞTUÜVWXYZ]/
TrRegexp.new(/[Ç-Ş#!$ç-ş]/).translate  # /[ÇDEFGĞHIİJKLMNOÖPQRSŞ#!$çdefgğhıijklmnoöpqrsş]/

# Translating meta characters
re = TrRegexp.new(/\w+/).translate
Regexp.compile(re).match('ABCÇDEFGĞHIİJKLMNOÖPQRSabcçdeğiş')[0]  # 'ABCÇDEFGĞHIİJKLMNOÖPQRSabcçdeğiş'

re = TrRegexp.new(/\W+/).translate
Regexp.compile(re).match('ABCÇDEFGĞHIİJKLMNOÖPQRSŞTUÜVWXYZ.+%')[0]  # '.+%'
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/sbagdat/turkish_regexps. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/turkish_regexps/blob/master/CODE_OF_CONDUCT.md).

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the TurkishRegexps project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/turkish_regexps/blob/master/CODE_OF_CONDUCT.md).


text:
---
title: split
tags:
  - split
date created: 2022-11-17
---

# split

## split text file into multiple (smaller) files

```shell
split -l 5000 -d --additional-suffix=.sql original.sql splitted-file
```

[source](https://stackoverflow.com/a/45761990)

repository: pew/hitchhikers-guide

repo_name: pew/hitchhikers-guide


text:
# nuchal [![Go Report Card][5]][4] [![PkgGoDev][7]][6]

Evaluates & executes high frequency cryptocurrency trades from configurable trend alignment patterns.

## Installation
A [Coinbase Pro][1] account, a working installation of [GO][2], and a running instance of [Docker][3] **are required**.
```shell
# Download and install the latest version of nuchal
go install github.com/nelsw/nuchal@latest

# Add the go bin directory to your path
export PATH=${PATH}:/Users/${USER}/go/bin

# Confirm successful installation
nuchal
```

## Configuration

### Currency
**nuchal** supports Fiat (USD) -> Crypto and Crypto -> Fiat (USD) trading only.

### Products
**nuchal** caches all available USD cryptocurrency products from Coinbase on startup.
```json
{
  "id": "BTC-USD",
  "base_currency": "BTC",
  "quote_currency": "USD",
  "base_min_size": "0.0001",
  "base_max_size": "280",
  "quote_increment": "0.01"
}
```

### Patterns
**nuchal** supports a single "Tweezer Bottom" trend alignment pattern to recognize and define opportunities.
```json
{
 "id": "BTC-USD",
 "gain": 0.0195,
 "loss": 0.495,
 "size": 1,
 "delta": 0.001
}
```

### Sources
Not all commands work in *Sandbox* mode, *Production* mode requires configuration at least one **source**.

#### env
Execute the following if you're not interested in pattern configuration on a product level.
```shell
# Minimum requirement for running in Production mode: key, pass, secret.
export COINBASE_PRO_KEY="your_coinbase_pro_api_key"
export COINBASE_PRO_PASSPHRASE="your_coinbase_pro_api_passphrase"
export COINBASE_PRO_SECRET="your_coinbase_pro_api_secret"

# Coinbase Pro trading information for precise trade results.
export COINBASE_PRO_MAKER_FEE="your_coinbase_pro_api_maker_fee"
export COINBASE_PRO_TAKER_FEE="your_coinbase_pro_api_taker_fee"

# A time frame for the command or command data.
export PERIOD_ALPHA="2021-06-02T08:00:00+00:00"
export PERIOD_OMEGA="2021-06-03T22:00:00+00:00"
export PERIOD_DURATION="24h00m00s"
```

#### yml
To support product based pattern definitions, create a `nuchal.yml` configuration file like the following.
**nuchal** will look in the home and desktop directories for this file. You may also define config location on the cli.
```yaml
# Minimum requirement for running in Production mode: key, pass, secret.
cbp:
  key:
  pass:
  secret:
  # Coinbase Pro trading information for precise trade results.
  fees:
    maker:
    taker:

# Product selection and pattern criteria.
patterns:
  - id: SKL-USD
    delta: .01
  - id: NU-USD
    gain: .0273
  - id: OMG-USD
    loss: .0473
  - id: TRB-USD
    size: 1.25

# A time frame for the command or command data.
period:
  alpha: 2021-06-02T00:00:00+00:00
  omega: 2021-06-03T23:59:59+00:00
  duration: 24h0m0s
```

#### cli
```shell
# Displays options for configuring global pattern criteria, USD selections, and configuration file location.
nuchal --help
```

## Commands
**nuchal** has three (3) main functions:
1. report
2. trade
3. simulate

### report
Provides a summary of your available currencies, balances, holds, and status of open trading positions.
```shell
# Prints USD, Cryptocurrency, and total value of the configured Coinbase Pro account.
# Also prints position and trading information, namely size, value, balance and holds.
nuchal report -c /Users/${USER}/config.yml
```
![report example][10]

### sim
Evaluates product & pattern configuration through a mock trading session and interactive chart results.
```shell
# Prints a simulation result report and serves a local website to host graphical report analysis.
nuchal sim

# Prints a simulation result report with a positive net gain.
nuchal sim -t --no-losers

# Prints a simulation result report with a positive net gain and zero trading positions.
nuchal sim -w --winners-only
```
![sim example][12]
![chart example][14]

### trade
Polls ticker data and executes buy & sell orders when conditions match product & pattern configuration.
```shell
# Trade buys & sells products at prices or at times that meet or exceed pattern criteria, for a specified duration.
nuchal trade  --usd XLM,TRB,SKL,STORJ

# Hold creates a limit entry order at the goal price for every active trading position in your available balance.
nuchal trade --hold

# Sell all available positions (active trades) at prices or at times that meet or exceed pattern criteria.
nuchal trade --sell

# Sell all available positions (active trades) at the current market price. Will not sell holds.
nuchal trade --exit

# Drop will cancel every hold order, allowing the resulting products to be sold or converted.
nuchal trade --drop

# Sells everything at market price.
nuchal trade --eject
```
![trade example][11]

# Thanks
**nuchal** is built largely on [a Go client for CoinBase Pro][8] formerly known as gdax, thank you [preichenberger][9].

**nuchal** charts made possible by [go-echarts][16]

# Questions

> "How do I exit nuchal?"
```shell
exit
```

> "How do stop the docker composition?"
```shell
# To stop container orchestration
docker compose -f /Users/${USER}/go/src/github.com/nelsw/nuchal/build/docker-compose.yml down
```

> "What does nuchal mean?"

In marine biology, **nuchal**, *new⋅cull, nu⋅chal, /ˈn(y)o͞ok(ə)l/,* is defined as *"an exaggerated (craniofacial) trait,
responsible for defining the natural order among a species."*

# License
This code is Copyright Connor Ross Van Elswyk and licensed under Apache License 2.0

[1]: https://pro.coinbase.com
[2]: https://golang.org/
[3]: https://www.docker.com/
[4]: https://goreportcard.com/report/github.com/nelsw/nuchal
[5]: https://goreportcard.com/badge/github.com/nelsw/nuchal
[6]: https://pkg.go.dev/mod/github.com/nelsw/nuchal
[7]: https://pkg.go.dev/badge/mod/github.com/nelsw/nuchal
[8]: https://github.com/preichenberger/go-coinbasepro
[9]: https://github.com/preichenberger
[10]: .github/report.png?raw=true
[11]: .github/trade.png?raw=true
[12]: .github/sim.png?raw=true
[13]: https://www.investopedia.com/articles/active-trading/040714/tweezers-provide-precision-trend-traders.asp
[14]: .github/charts.png?raw=true
[16]: https://github.com/go-echarts/go-echarts

repository: nelsw/nuchal

gha_language: Go

repo_name: nelsw/nuchal


text:
# NeonIntrinsics-Android
This repository represents an Android app with native (C++) code which shows usage and some experiments on Neon intrinsics.

## Description
The app generates two arrays `ramp1` and `ramp2` of short int (length set at 1027), and then calculates the dot product as follows:
```
result = ramp1[0] * ramp2[0] + ramp1[1] * ramp2[1] + ramp1[2] * ramp2[2] + ... + ramp1[1026] * ramp2[1026];
```
The dot product is calculated in the following ways:
- scalar: most obvious way, just a cycle which accumulates the result using normal arithmetic operations iterating over the array
- using Neon intrinsics: load 4x the array elements into a vector variable, then issue SMLAL Neon instruction which does multiply and accumulate; iterate over the array in 4x chunks, in the end process the tail (remainder of size divided by 4) using normal arithmentic operations
- using same Neon intrinsics, but manually unroll the loop 2x, 3x, 4x and 6x
- using SMLAL + SMLAL2 Neon intrinsics, so that you can load 128-bit vectors and then do multiply-accumulate on low and high halves of the vector, unrolled 2x (SMLAL+SMLAL2) and 4x (2xSMLAL+2xSMLAL2)

Then, the every calculation is being repeated 1,000,000 times, and the duration is measured. The result is presented on the screen.

Few more notes on the implementation that are system-specific:
- The app targets 64-bit Arm only (ArmV8). ArmV7 is an obsolete architecture, and I don't feel like you should be optimizing for it in 2021.
- The thread running calculations has its affinity set to the last CPU core available, which is big (or the biggest one) in all SoCs available at the moment. You can manually modify the code to set the affinity to a little core (mask 0x1) for experiments.
- First round of calculations is used as a warm-up, its duration is not being measured. This is done to allow the CPU governor to bump up the clock speed of the core running the test; without it, on some devices, the results may be inconsistent as there is some latency before the governor recognizes that the load is high on this thread.

## Interpreting the results
To understand the outcome, it's best to dive directly into assembly and match the output to the results measured. I used the following command to dump the assembly (insert your path to the NDK, unpack libnative-lib.so from your APK):
```
c:\android-ndk-r21d\toolchains\llvm\prebuilt\windows-x86_64\aarch64-linux-android\bin\objdump.exe -D libnative-lib.so > libnative-lib.txt
```

For test purpose, the APK has been run on a Pixel 3XL. Here is the result screenshot:

![Results screenshot](results.png)

Now let's analyze the results and the assembly:
1.	"No Neon" is significantly faster than "Neon, no unrolling" and matches "Neon, 2x unrolling" results. Checking the assembly for scalar version, it's clear that the compiler has vectorized the loop, unrolled it 2wide and used SMLAL instruction instead of MUL + ADD:
```
    d5c8:	6d7f8d02 	ldp	d2, d3, [x8,#-8]
    d5cc:	6d7f9564 	ldp	d4, d5, [x11,#-8]
    d5d0:	91004108 	add	x8, x8, #0x10
    d5d4:	f100218c 	subs	x12, x12, #0x8
    d5d8:	9100416b 	add	x11, x11, #0x10
    d5dc:	0e628080 	smlal	v0.4s, v4.4h, v2.4h
    d5e0:	0e6380a1 	smlal	v1.4s, v5.4h, v3.4h
    d5e4:	54ffff21 	b.ne	d5c8 <_Z16dotProductScalarPsS_s@@Base+0x48>
```
That's actually a great job by LLVM/clang from the NDK!

2. "Neon, no unrolling" produces the following assembly:
```
    d650:	fc408401 	ldr	d1, [x0],#8
    d654:	fc408422 	ldr	d2, [x1],#8
    d658:	1100054a 	add	w10, w10, #0x1
    d65c:	6b09015f 	cmp	w10, w9
    d660:	0e628020 	smlal	v0.4s, v1.4h, v2.4h
    d664:	54ffff6b 	b.lt	d650 <_Z14dotProductNeonPsS_s@@Base+0x28>
```
It looks great on its own, but one SMLAL appears to be not enough to load the vector units in the CPU. So, **hand-writing straightforward Neon code, even using efficient instructions, yields worse performance than the compiler auto-vectorizing completely scalar loop**. Depending on the target CPU, you'd need to write more specific code than this plain Neon calculation.

3. "Neon, 2x unrolling" produces the same assembly and performance as "No Neon". So, the compiler is defaulting to 2-wide unrolling of the loop. Looking at the "Cortex A-76 software optimization guide", I cannot find any evidence that the CPU is capable of executing two SMLALs at the same time, but it allows forwarding of accumulate operands so two instructions will "overlap" and result in less cycles than 2 pure instructions (4 cycles per SMLAL, 1 cycle accumulate latency, so looks like it's 7 cycles instead of 8)
```
    d738:	6cc10c02 	ldp	d2, d3, [x0],#16
    d73c:	6cc11424 	ldp	d4, d5, [x1],#16
    d740:	1100054a 	add	w10, w10, #0x1
    d744:	6b09015f 	cmp	w10, w9
    d748:	0e648040 	smlal	v0.4s, v2.4h, v4.4h
    d74c:	0e658061 	smlal	v1.4s, v3.4h, v5.4h
    d750:	54ffff4b 	b.lt	d738 <_Z15dotProductNeon2PsS_s@@Base+0x2c>
```

4. "Neon, 3x unrolling" is another tiny bit faster than 2x unrolling. Let's look at the assembly:
```
    d840:	6d401003 	ldp	d3, d4, [x0]
    d844:	fd400805 	ldr	d5, [x0,#16]
    d848:	6d401c26 	ldp	d6, d7, [x1]
    d84c:	fd400830 	ldr	d16, [x1,#16]
    d850:	1100054a 	add	w10, w10, #0x1
    d854:	91006000 	add	x0, x0, #0x18
    d858:	6b09015f 	cmp	w10, w9
    d85c:	0e668060 	smlal	v0.4s, v3.4h, v6.4h
    d860:	0e678082 	smlal	v2.4s, v4.4h, v7.4h
    d864:	0e7080a1 	smlal	v1.4s, v5.4h, v16.4h
    d868:	91006021 	add	x1, x1, #0x18
    d86c:	54fffeab 	b.lt	d840 <_Z15dotProductNeon3PsS_s@@Base+0x3c>
```
Nothing extraordinary happening here, LDP and LDR in the beginning to load 3 64-bit vectors. I would imagine 3x unrolling made sense if there were 3 vector units, but here it was added just for pure science.

5. "Neon, 4x unrolling" is the fastest configuration so far. What is in the assembly?
```
    d960:	6d401404 	ldp	d4, d5, [x0]
    d964:	6d411c06 	ldp	d6, d7, [x0,#16]
    d968:	6d404430 	ldp	d16, d17, [x1]
    d96c:	6d414c32 	ldp	d18, d19, [x1,#16]
    d970:	1100054a 	add	w10, w10, #0x1
    d974:	91008000 	add	x0, x0, #0x20
    d978:	6b09015f 	cmp	w10, w9
    d97c:	0e708080 	smlal	v0.4s, v4.4h, v16.4h
    d980:	0e7180a2 	smlal	v2.4s, v5.4h, v17.4h
    d984:	0e7280c3 	smlal	v3.4s, v6.4h, v18.4h
    d988:	0e7380e1 	smlal	v1.4s, v7.4h, v19.4h
    d98c:	91008021 	add	x1, x1, #0x20
    d990:	54fffe8b 	b.lt	d960 <_Z15dotProductNeon4PsS_s@@Base+0x34>
```
Four LDPs (5 cycles latency each) to load 4x 64bit vectors is more efficient than LDP+LDR (5 cycles, 2 throughput for LDR) to load 3x 64bit. The assembly looks good, and beats the default output of the compiler on scalar loop by some 23%. Nice!

6. "Neon, 6x unrolling" is suddenly slower than 4x. Let's look inside:
```
    dcac:	6d401c06 	ldp	d6, d7, [x0]
    dcb0:	6d414410 	ldp	d16, d17, [x0,#16]
    dcb4:	6d424c12 	ldp	d18, d19, [x0,#32]
    dcb8:	6d405434 	ldp	d20, d21, [x1]
    dcbc:	6d415c36 	ldp	d22, d23, [x1,#16]
    dcc0:	6d426438 	ldp	d24, d25, [x1,#32]
    dcc4:	1100054a 	add	w10, w10, #0x1
    dcc8:	9100c000 	add	x0, x0, #0x30
    dccc:	6b09015f 	cmp	w10, w9
    dcd0:	0e7480c0 	smlal	v0.4s, v6.4h, v20.4h
    dcd4:	0e7580e1 	smlal	v1.4s, v7.4h, v21.4h
    dcd8:	0e768202 	smlal	v2.4s, v16.4h, v22.4h
    dcdc:	0e778223 	smlal	v3.4s, v17.4h, v23.4h
    dce0:	0e788245 	smlal	v5.4s, v18.4h, v24.4h
    dce4:	0e798264 	smlal	v4.4s, v19.4h, v25.4h
    dce8:	9100c021 	add	x1, x1, #0x30
    dcec:	54fffe0b 	b.lt	dcac <_Z15dotProductNeon6PsS_s@@Base+0x48>
```
To be honest, I don't see a clear reason why this would be significantly slower than the 4x version.

7. Now onto the interesting parts. "SMLAL + SMLAL2 version, 2x unrolled loop" (one SMLAL and one SMLAL2 instruction) is 15% faster than regular 2x unrolled loop (and so, the default compiler output on scalar loop).  There are two LDRs (Q form, 6 cycles, 2 throughput), and SMLAL and SMLAL2 uses the same input registers. Since the accumulation is happening in different registers v0 and v1 (meaning no dependency between the instructions are present), it becomes an efficient piece of code with much less loads than in the regular 2x loop.

8. "SMLAL + SMLAL2, 4-wide" unrolled loop (2 SMLAL and SMLAL2 instructions per iteration) has results matching 4x unrolled loop - so it's one of the two fastest options. Actually, I saw it being faster by a mere millisecond, but it's less than 1% so likely within the margin of error. What is in the assembly?
```
    db80:	acc11404 	ldp	q4, q5, [x0],#32
    db84:	acc11c26 	ldp	q6, q7, [x1],#32
    db88:	1100054a 	add	w10, w10, #0x1
    db8c:	6b09015f 	cmp	w10, w9
    db90:	0e668080 	smlal	v0.4s, v4.4h, v6.4h
    db94:	4e668082 	smlal2	v2.4s, v4.8h, v6.8h
    db98:	0e6780a3 	smlal	v3.4s, v5.4h, v7.4h
    db9c:	4e6780a1 	smlal2	v1.4s, v5.8h, v7.8h
    dba0:	54ffff0b 	b.lt	db80 <_Z32dotProductNeon_with_SMLAL2_4widePsS_s@@Base+0x34>
```
It looks like the nicest piece of assembly to me, with two LDPs (Q form, 7 cycles) and then four calculation instructions accumulating in different registers (v0-v3). Short and efficient.

**To summarize**, the compiler is capable of auto-vectorizing the loop and delivering results better than if you hand-write the assembly in a straightforward way. However, 4-wide manually unrolled loop with SMLALs or SMLAL+SMLAL2 are most efficient versions, delivering some 23% performance improvement. However, it's important to understand target CPU capabilities to get best results. If you're targeting the whole android universe, it may be even better to trust the compiler to do the job for you, but in specific cases you can be significantly faster.

## Prerequisites
You need Android SDK and NDK paths configured in `local.properties` file in order to build this project. Using a newer NDK is always a good idea, although different NDKs (hence different clangs) will produce different assembly and can cause inconsistent results. Please compare the results only produced by the same NDK version. I used r21d for my tests.

## Building
`gradlew assembleRelease` and then install the APK to the device manually.

## Credits
This repository was originally a mirror of https://github.com/dawidborycki/NeonIntrinsics-Android.

## License
Licensed under MIT license.


text:
/*
Title: @spaceb07
Description: Images from astronauts curently in space and random space GIFs.
Thumbnail: /content/bots/twitterbots/images/spaceb07.png
Link: http://twitter.com/spaceb07
Author: botsheeter.py
Date: November 22, 2015
Tags: twitter,bot,twitterbot,active,space,images,gif,retweet,open source,opensource,python,dnlcrl
Nav: hidden
Robots: index,follow
*/

[@spaceb07](https://twitter.com/spaceb07) is an [open source](https://github.com/dnlcrl/spaceb07) Twitter bot created by [Daniele Ciriello](https://twitter.com/dnlcrl) that retweets pictures from [astronauts currently in space](http://www.howmanypeopleareinspacerightnow.com/) and occasionally also a random [#space](/tag/space) GIF from [Giphy.com](http://giphy.com/).


text:
# @tokks/strava-tester

This package provides fixtures and helper functions to test your usage of [@tokks/strava](https://github.com/marcelotokarnia/strava-maps/blob/master/packages/strava/README.md) package.

## Installation

```bash
npm install -D @tokks/strava
```

or

```bash
yarn add -D @tokks/strava
```

## Getting started

#### Client mocking for unit tests

```js
...
```

#### Request mocking for e2e

```js
...
```

# Author

[Marcelo Tokarnia](https://marcelo.tokarnia.tech<EMAIL_ADDRESS>

repository: marcelotokarnia/strava-maps

repo_name: marcelotokarnia/strava-maps


text:
# Chapter 10 : Maps

<dialog character="pilot">Ok it's now time to open our star map and decide where we want to go.</dialog>

Maps are a data structure which associate values of the same type to values of the same type. The former are called key and the latter values. Together they make up a binding. An additional requirement is that the type of the keys must be comparable, in the Michelson sense.

## Declaration

Maps are declared as

```
type register = map (address, nat);
```

## Instantiation

To create an empty map :

```
let empty : register = Map.empty
```

To create an non-empty map :

```
let moves : register =
  Map.literal ([
    ("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address, 3n),
    ("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address, 45n)]);
```

The _Map.literal_ predefined function builds a map from a list of key-value pair tuples, _(<key>, <value>)_ separated by _,_.

⚠ Notice ("<string value>": address) means that we type-cast a string into an address

## Access

Use the _Map.find\_opt_ predefined function to read a value associated to a key in the map :

```
let my_balance : option (nat) =
  Map.find_opt (("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address), moves);
```

ℹ The keyword option shows that this value is optional. More on this later (Chapter Optional).

## Update

We can update a binding in a map in ReasonLIGO by means of the _Map.update_ built-in function :

```
let assign = (m : register) : register =>
  Map.update
    (("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address), Some (8n), m);
```

⚠ Notice the optional value *Some (8n)* instead of *8n*. If we had use *None* instead, that would have meant that the binding is removed.  More on this later (Chapter Optional).

## Insertion

To add add a key and its associated value in the map, use the _Map.add_ built-in function :

```
let add = (m : register) : register =>
  Map.add
    (("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address), 8n, m);
```

## Removal

To remove a binding (key-value) from a map, we need its key.

In ReasonLIGO, we use the predefined function _Map.remove_ as follows:

```
let delete = ((key, moves) : (address, register)) : register =>
  Map.remove (key, moves);
```

## Functional Iteration over Maps

A functional iterator is a function that traverses a data structure and calls in turn a given function over the elements of that structure to compute some value.

There are three kinds of functional iterations over LIGO maps: the *iterated operation*, the *map operation* (not to be confused with the map data structure) and the *fold operation*.

### Iterated Operation over Maps

The first, the *iterated operation*, is an iteration over the map with no return value. This can be useful if for example you would like to check that each value inside of a map is within a certain range, and fail with an error otherwise.

The predefined functional iterator implementing the *iterated operation* over maps is called *Map.iter*.
In the following example, the balances are iterated to check that the value is above *3*.

```
let iter_op = (m : register) : unit => {
  let predicate = ((i,j) : (address, nat)) => assert (j > 3n);
  Map.iter (predicate, m);
};
```

### Map Operations over Maps

We may want to change all the bindings of a map by applying to them a function. This is called a *map operation*, not to be confused with the map data structure. The predefined functional iterator implementing the *map operation* over maps is called _Map.map_. In the following example, we add *1* to the value in the balances.

```
let map_op = (m : register) : register => {
  let increment = ((i,j): (address, nat)) => (j + 1n);
  Map.map (increment, m);
};
```

### Folded Operations over Maps

A folded operation is the most general of iterations. The folded function takes two arguments: an *accumulator* and the *structure element* at hand, with which it then produces a new accumulator. This enables having a partial result that becomes complete when the traversal of the data structure is over.

The predefined functional iterator implementing the folded operation over maps is called _Map.fold_ and is used as follows.

```
let fold_op = (m : register) : int => {
  let folded = ((i,j): (int, (address, nat))) => i + j[1];
  Map.fold (folded, m, 0);
};
```

## Big Maps

<!-- prettier-ignore -->Maps load their entries into the environment, which is fine for small maps, but for maps holding millions of entries, the cost of loading such map would be too expensive. For this we use *big\_maps*. Their syntax is the same as for regular maps.

## Your mission

<!-- prettier-ignore -->1- Notice we defined _coordinates_ as a 3D tuple.

<!-- prettier-ignore -->2- Define the type *name\_to\_coordinates* as a mapping from the celestial body name to its coordinates.

<!-- prettier-ignore -->3- Create a new map called *star\_map* and add values for _earth_ at 2,7,1 , the _sun_ at 0,0,0 and _alpha-centauri_ at 2232,7423,12342 .

repository: octo-technology/tezos-academy

repo_name: octo-technology/tezos-academy


text:
---
title: Curl !
theme: 'solarized'
revealOptions:
    transition: 'fade'
---

## About

Yoann "`fuzzy`" Lamouroux

* Sysadmin/Technical Leader at @nbs-system
* Security enthusiast
* Suze advocate (not the Linux RedHat-ish distro)
* Likes: `python` and `vim`

trolls : @xoxopowo (twitter), legreffier (freenode)

<EMAIL_ADDRESS>
---

## trivia
Started in 1996, by Daniel Stenberg ... for an IRC bot project

* Available almost everywhere
* \>20 years old, still getting updates
* Integrated with many tools
* MIT/X License (quite close to BSD)

**means** : "`Client URL Request Library`"

---

###  Ready ?

![30%](pyong2018.jpg)

> silly one and only `curl`-ing pun in this presentation

---

### Quite a lot of use-case

---

**it is misused a lot too**

---

You usually need it for a quick check.

Manpage = 2700 lines

> Therefore : this mini-talk

---

## HTTP

* What the web is built upon (but you probably knew that)
* It's (usually) how your apps will talk
	* API !
	* REST !
	* IoT !
* It's a TCP protocol (it's reliable, it needs an IP)

---

## Censorship

I won't say anything about :

---

### DNS
  > how a domain is matched to one or more IPs

Just don't mix up the:

---
- domain name:
> the mechanism to get an IP from a domain name
- and the "`Host`" header
> the actual site you'll request to an IP

(more on "`Host`" later)

---

### HTTPS
  > how the http gets wrapped in a ssl-encrypted tunnel

Just patch your things

`(╯°□°)╯︵ ┻━┻`

---

## Your computer says to that IP :

1. I want `'/'`
2. on the site **named** : `example.com`
3. Some more info (about your browser and what it can do)
4. Even more info (if you were already there) 🍪
5. [nothing] (it will actually send an empty line)

> Only 1st, 2nd and 5th steps are mandatory in an **HTTP** request

---

## Client ➡  Server

```
* Connected to example.com (<IP_ADDRESS>) port 80 (#0)
* > GET / HTTP/1.1
* > Host: example.com
* > User-Agent: curl/7.58.0
* > Accept: */*
* >
```

---

## The server answers :

1. HTTP Return code (200, 404, 50x (oh sh...))
2. Some infos about the datas (size, type, taste)
3. Some infos for you (your browser) in case you come back 🍪
4.  OMG!, /dev pseudo-file and stream redirection 😻`

---

> Despite you can use "**`-o [FILE]`**" to output to any file instead of `stdin`, there's no direct option to disable output.

---

You're testing (locally?) some website, you need to have a resolution to an IP you and trick DNS for whatever reason.

**you usually don't need to edit `/etc/hosts`**

---

### Do you even resolve ?

```
curl -v --resolve www.example.com:80:<IP_ADDRESS> http://www.example.com/
```

> See mom ? No sudo vim in /etc !

---

### Do you even .curlrc ?

You don't want to type this long command every time !

Edit `~/.curlrc`, add those options :

```
--resolve www.example.com:80:<IP_ADDRESS>
```

(you can add many off these "`--resolve`" or whatever curl option)

---

### Do you script ?

I saw this, once :

```
curl -v https://anothercoolsite.com/ 2>&1 | grep -v "HTTP/1.1 200" && \
echo "Something was wrong"
```

- curl has many exit codes.
- just echo that "**`$?`**" bad boy !
- to long to list, read the man.

---

## ⚠

A bad HTTP code (404, 504, ...) is not considered as an error by curl by default (it succeeded at making a request, which failed).

> Use "**`-f`**", so curl actually crashes.

```bash
curl -vf https://anothercoolsite.com/
[ $? -eq 22 ] && echo "something was wrong"
```
---

Or even :

```bash
curl -f https://anothercoolsite.com/ || echo "something was wrong"
```

---

## Headers

* X-Forwarded-*, Host, User-Agent, know the basics
* No matter what, **`-H`** got you covered. (= "`--header`")
* "`-A 'Opera 4.0'`" = "`-H 'User-Agent: Opera 4.0'`"

---

> "That's cool for the trivial work, but I live in a real world. With real things."
> (Twilight Sparkle, in *My Little Pony*, S4E08)

---

## Verbs

Know about -X (specify the HTTP verb you need)

Now you can POST, PUT (and MORE) !

> You can now auth to some services and post your useful original opinion on a blog

---

## Really

![](doge.jpeg)

> You'll need the `--data` option for those to be useful.

---

## You can record Cookies !

---

Usually goes something like :

- `curl -X POST --data "login=admin;password=wowmuchsecure" --cookie-jar myjar.txt https://website.com`
- get the auth cookie in `myjar.txt`
- `curl --cookie "auth=1234567890abcdef https://website.com/`

---

# Timings !

… and several other nice infos

- option is : --write-out "FMT_STRING"
- FMT_STRING: "foo bar %{var-name}"
- var-name:
    - time_total, time_connect, …
    - size_download, …
    - So many moar 😄

---

## Firefox

You can have this automagically from Firefox :

- Developer Tools > Network > GET /
- Right click : Copy as Curl command !
- And work from there

---

## BurpSuite

You have a similar feature in BurpSuite which is a nice tool.

---

Shouldn't have talked about it… it ain't FOSS.

---

There's a **ton** more features :

- FTP
- HTTPS
- http/2 (if it's recent enough)
- SMTP/POP

---

## SMTP, really

---

## it writes your C code !

Introducing : **`--libcurl`**

---

I barely scratched the surface. Use the talk as-is, or go check the manpage.

📚

---

Thank you.

❤


text:
# Design

This is the working draft of the system design.

## Components

*profefe* consists of the following components

### Collector

(a.k.a. `cmd/profefe`)

A service that receives profiling data ([pprof-formatted](https://github.com/google/pprof/tree/6ce02741cba3adff4f8d4de07dc7a2379334cae4/doc),
i.e. `pb.gz`, or [Go runtime traces](https://golang.org/pkg/runtime/trace/)).
Collector persists the data in a plugable storage.
It also provides an API for querying and retrieving stored profiles.

Currently implemented storages:
- `storage/badger`, keeps data in [Badger DB](https://github.com/dgraph-io/badger);
- `storage/s3`, stores data in s3-compatible object storage service;
- `storage/gcs`, stores data on Google Cloud Storage (GCS);
- `storage/clickhouse` (_experimental_), stores parsed profiling data in [ClickHouse DB](https://clickhouse.tech/).

### Agent

An optional library, that can be integrated into an application instead of `net/http/prof`. The goal of agent is
to periodically scrap pprof data from the running application and to send the data to collector.

## Interaction

Below is the schema of profefe's components interaction:

If integrating the agent into the application is impossible or undesirable, but the application already exposes
`net/http/pprof` server, the pprof data can be scrapped using an external mechanism, that will send the data to
collector using its HTTP API.

In the following example, the agent was replaced with an external script that is running inside a cronjob. It
periodically requests profiling data from application's pprof server and sends it to collector:

repository: profefe/profefe

repo_name: profefe/profefe


text:
#FactoryInterface

#How to run

- Run application: **node Server.js** and browse to **localhost:30025**
- Run Tests: **node TestRunner**  and browse to **localhost:30025**
- Launch **index.html** in a browser
- Run grunt jasmine_node

## Support jasmine-node

To run the tests and coverage, try running this from the command line:

    grunt jasmine_node

repository: charliecalvert/JsObjects

gha_language: JavaScript

repo_name: charliecalvert/JsObjects


text:
# person-reid-lib

The pytorch-based lightweight library of person re-identification.

#### Config

---

Install

```
pip install numpy h5py lmdb
pip install visdom  # Optional. If you don't need a web presentation, don't install it.
```
Install [pytorch and torchvision](https://pytorch.org/)

Indicates the folder of the original files and where the unzipped file is placed
```
# person-reid-lib/lib/utils/manager.py
self._device_dict = xxxx
```

#### Optical Flow

---

Install opencv
```
pip install opencv-contrib-python
```

Config
```
# person-reid-lib/lib/dataset/utils.py
DataStoreManager.store_optical_flow = True  # if you want to use optical flow, enable it.

# person-reid-lib/tasks/taskname/solver.py
Solver.use_flow = True
```

#### How to run:

---

```
cd person-reid-lib_folder
sh script/server_0.sh
```

#### Dataset

---

Image: VIPeR, Market1501, CUHK03, CUHK01, DukeMTMCreID, GRID,

Video : iLIDS-VID, PRID-2011, LPW, MARS, DukeMTMC-VideoReID

#### Updates

---
**2018.12.29**  The code of [Spatial and Temporal Mutual Promotion for Video-based Person Re-identification](https://arxiv.org/abs/1812.10305) is available.

**2018.12.26**  The initial version is available.

**2018.11.19**  The code for *lib* has been released.

#### Related person ReID projects:

---

[deep person reid](https://github.com/KaiyangZhou/deep-person-reid)

[MARS-evaluation](https://github.com/liangzheng06/MARS-evaluation)

repository: chenyanghungry/person-reid-lib

repo_name: chenyanghungry/person-reid-lib


text:
# PROG1781.Assignment5
## Goal
Create a C# console application that creates and records information about a book.

## Menu Display
1. Create a new book:
    - Provide the title of the book:
	- Provide the author of the book:
	- Provide the copyright year of the book:
	- Provide the number of pages of the book:
1. Display the details of an existing book:
	- Provide a book title to search:
	- Provide an author to search:
1. Edit an existing book:
	- Provide a book title to search:
	- Provide an author to search:
1. Exit the program:

### Validation
* All inputs must be validated.
    * In case of an invalid input, the user is prompted to re-enter the value until a valid value has been entered.
* "A" New book creation rules
	* Search if the book already exists in the record.
		* If a book has previously been created, the program displays "Book record already exists"
	* Store book in the library.
* "B" Book lookup rules
	* Search if the book already exists in the record.
		* No book found: "No book record exists".
		* Book found: Displays the book details.
* "C" Book lookup rules
	* Search if the book already exists in the record.
		* No book found: "No book record exists".
		* Book found:
			* Displays the book details.
			* Prompt the user to enter new values for each field.

## Book Class Requirements
Create a class that represents the Book using appropriate fields and methods.

* [x] Be defined in a separate file
* [x] Not have any public fields
* [x] Contain, at a minimum, two public methods with the following names:
    * [x] Display
    * [ ] Edit
* [x] Contain a non-default constructor that is used to initialize the book record information
* [x] Contain a default constructor (even if it is not used by your program)

## The Book Fields
1.	Title - required, non-empty string
1.	Author - required, non-empty string
1.	Copyright Year - required, integer between 1924 and 2019, inclusive
1.	Number of pages - required, positive integer


text:
<!--- Top of README Badges (automated) --->
[![PyPI](https://img.shields.io/pypi/v/wipac-rest-tools)](https://pypi.org/project/wipac-rest-tools/) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/WIPACrepo/rest-tools?include_prereleases)](https://github.com/WIPACrepo/rest-tools/) [![PyPI - License](https://img.shields.io/pypi/l/wipac-rest-tools)](https://github.com/WIPACrepo/rest-tools/blob/master/LICENSE) [![Lines of code](https://img.shields.io/tokei/lines/github/WIPACrepo/rest-tools)](https://github.com/WIPACrepo/rest-tools/) [![GitHub issues](https://img.shields.io/github/issues/WIPACrepo/rest-tools)](https://github.com/WIPACrepo/rest-tools/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aopen) [![GitHub pull requests](https://img.shields.io/github/issues-pr/WIPACrepo/rest-tools)](https://github.com/WIPACrepo/rest-tools/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Aopen)
<!--- End of README Badges (automated) --->
# rest-tools

This project contains REST tools in python, as common code for multiple other
projects under https://github.com/WIPACrepo.

All code uses python [asyncio](https://docs.python.org/3/library/asyncio.html),
so is fully asyncronous.

Note that both the client and server assume starting the asyncio loop
happens elsewhere - they do not start the loop themselves.

## Client

A REST API client exists under `rest_tools.client`.  Use as:

```python
from rest_tools.client import RestClient

api = RestClient('http://my.site.here/api', token='XXXX')
ret = await api.request('GET', '/fruits/apple')
ret = await api.request('POST', '/fruits', {'name': 'banana'})
```

There are several variations of the client for OAuth2/OpenID support:

* [`OpenIDRestClient`](rest_tools/client/openid_client.py#L19) : A child of
  `RestClient` that supports OAuth2 token refresh using the OpenID Connect
  Discovery protocol for an authentication server.

* [`ClientCredentialsAuth`](rest_tools/client/client_credentials.py#L11) : Uses
  `OpenIDRestClient` in combination with OAuth2 client credentials (client ID
  and secret) for service-based auth. Use this for long-lived services that
  need to perform REST API calls.

* [`DeviceGrantAuth`](rest_tools/client/device_client.py#L125) /
  [`SavedDeviceGrantAuth`](rest_tools/client/device_client.py#L162) : Uses
  `OpenIDRestClient` to perform a "device" login for a user. Use this for
  user-based terminal applications that need to perform REST API calls.
  The `SavedDeviceGrantAuth` can save the refresh token to disk, allowing
  repeated application sessions without having to log in again.

## Server

A REST API server exists under `rest_tools.server`. Use as:

```python
import asyncio
from rest_tools.server import RestServer, RestHandler

class Fruits(RestHandler):
    def post(self):
        # handle a new fruit
        self.write({})

server = RestServer()
server.add_route('/fruits', Fruits)
server.startup(address='my.site.here', port=8080)
asyncio.get_event_loop().run_forever()
```

The server uses [Tornado](https://tornado.readthedocs.io) to handle HTTP
connections. It is recommended to use Apache or Nginx as a front-facing proxy,
to handle TLS sessions and non-standard HTTP requests in production.

repository: WIPACrepo/rest-tools

repo_name: WIPACrepo/rest-tools


text:
---
layout: post
title: "Ansible Run Analysis"
date: 2017-10-14 12:26:40
initpath: 'assets/img/Post_Images/2017-09-14-Ansible-Run-Analysis/ara-with-icon.png'
image: '../assets/img/Post_Images/2017-09-14-Ansible-Run-Analysis/ara-with-icon.png'
description: Analysing Ansible Runs with ARA tool.
category: 'devops'
tags:
- Ansible
- ConfigMgmt
twitter_text: Analysing Ansible Runs with ARA tool.
introduction: Analysing Ansible Runs with ARA tool.
---

Ansible can be used for a lot of things and it’s grown pretty popular for managing servers and their configuration. Today, Ansible is heavily used to deploy or test through Continuous Integration (CI).

In the world of automated continuous integration, it’s not uncommon to have hundreds, if not thousands of jobs running every day for testing, building, compiling, deploying and so on.

### Problem

Well, you cannot call it as a "Problem!",  but Ansible runs generate quite a large amount of console data. And yes, it continues to grow with each flag (Remember -v & -vvv?) that you add to the run!

Keeping up with such a large amount of Ansible runs and their outcome, not just in the context of CI, is challenging.

Due to this mess, one tends to feel the need of something, that will present this verbose output in a way which is easily readable, graphical, tabular & more representative of the job status and debug information.

> That `something` is ARA.

### Ansible Run Analysis (ARA) Tool

ARA records Ansible playbook runs and makes the recorded data available and intuitive for users and systems. ARA organizes recorded playbook data in a way to make it intuitive for you to search and find what you’re interested in as fast and as easily as possible.

![placeholder](../assets/img/Post_Images/2017-09-14-Ansible-Run-Analysis/ara1.png "ARA Tool UI")

It provides summaries of task results per host or per playbook.

![placeholder](../assets/img/Post_Images/2017-09-14-Ansible-Run-Analysis/ara2.png "ARA Tool UI")

It allows you to filter task results by playbook, play, host, task or by the status of the task.

![placeholder](../assets/img/Post_Images/2017-09-14-Ansible-Run-Analysis/ara3.png "ARA Tool UI")

With ARA, you’re able to easily drill down from the summary view for the results you’re interested in, whether it’s a particular host or a specific task.

![placeholder](../assets/img/Post_Images/2017-09-14-Ansible-Run-Analysis/ara4.png "ARA Tool UI")

Beyond browsing a single ansible-playbook run, ARA supports recording and viewing multiple runs in the same database.

![placeholder](../assets/img/Post_Images/2017-09-14-Ansible-Run-Analysis/ara5.png "ARA Tool UI")

### Installation

There are 2 ways in which you can install ARA in your system.

* Using Ansible Role hosted on my GitHub Account

Clone the repo & do:

````yaml
  ansible-playbook Playbook.yml
````

If Playbook run is successful, you will get:

````yaml
  TASK [ara : Display ara UI URL] ************************
  ok: [localhost] => {}
    "msg": "Access playbook records at http://YOUR_IP:9191"
````

Note: It picks the IP address from ansible_default_ipv4 fact gathered by Ansible. If there is no such fact gathered, replace it with your IP in main.yml file present in roles/ara/tasks/ folder.

* ARA is an open source project available on Github under the Apache v2 license. Installation instructions are present under Quickstart chapter.

The Documentation and frequently asked questions are available on readthedocs.io.

-----
### Conclusion

Ever since I came across this tool, it's been a useful resource for me to get more out of Ansible run logs and outputs. I would highly recommend it for all Ansible Ninjas! out there.

Feel free to share this with others and do let me know your experience of using ARA.

repository: ajinkya-devops/techwisdombyajinkya

repo_name: ajinkya-devops/techwisdombyajinkya


text:
dribbble-popular-shots
======================

List all the popular shots from dibbble.com.
This POC uses AngularJS, Semantic-UI and Django.

[![Demo](https://github.com/gustavohenrique/dribbble-popular-shots/raw/master/screenshot.png)](http://github.com/gustavohenrique/dribbble-popular-shots)

## Running

```python
make database
make run
open http://localhost:8000/shot
```

## Testing

```
make test
```

## License

MIT

repository: gustavohenrique/dribbble-popular-shots

repo_name: gustavohenrique/dribbble-popular-shots


text:
# Trametes multicolor (Schaeff.) Jülich, 1982 SPECIES

#### Status
SYNONYM

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

#### Published in
Persoonia 11(4): 427 (1982)

#### Original name
Boletus multicolor Schaeff., 1774

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Polyporaceae/Trametes/Trametes ochracea/ Syn. Trametes multicolor/README.md

repo_name: mdoering/backbone


text:
# Change Log

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

## 2.2.3 (2020-09-27)

**Note:** Version bump only for package @pragmatics/stylelint-config-order

## 2.2.2 (2020-09-27)

**Note:** Version bump only for package @pragmatics/stylelint-config-order

## 2.2.1 (2020-09-27)

**Note:** Version bump only for package @pragmatics/stylelint-config-order

> Versions released before this package was part of this monorepo
> can be found at https://github.com/pvds/stylelint-config-order/blob/master/CHANGELOG.md

license: ISC

repository: pvds/pragmatics

gha_language: SCSS

repo_name: pvds/pragmatics


text:
---
title: About Hatch
date: 2018-06-03
---

### Origins

Hatch germinated from the personal experience of one person, and grew through its resonance with more of us, drawing us to heed its call. It was a heart-stirring story from Victor, which eventually drove him to start Hatch.

Here's Victor's story:
> I served in a fire station during national service, where I was placed in charge of 30 firefighters. Day in and out, my team responded to numerous time-sensitive and often life-threatening fire and rescue emergencies. Everyone saw a meaning in what they are doing, and a couple of my teammates were certain that they wanted to pursue a full-time career with the force. I saw the passion and drive that my men had for the line of work.
>
>Yet, passion was never enough. The overemphasis on paper qualifications downplayed the years of experience they had with the force. My superiors and I wrote letters of recommendations for these firefighters but none of them secured positions with the force.
>
> The education landscape has changed drastically, but our perception hasn’t. We continue to rank qualifications on a vertical hierarchy, and we continue to adopt them even when it is absurd. So while the HR officers were busy recruiting at road shows, we had proven firefighters who could not stay on because of what society had perceived their qualifications to mean.

Meritocracy lies at the core of Singapore. Yet, within a key public agency, Victor ran up against an overly rigid system that seemed to fly in the face of this principle.

This experience was more than a contradiction; it was an injustice.

### The scale of it

Looking outward, we saw that this was not confined to one organization. No, indeed not; for in the process of growing into the country we are today, we have baked it into our very society — our perceptions, and the structures we have built.

The paper chase. Grade inflation. Graduate underemployment. The stigma of ITEs. Difficulty facing foreign competition. These are symptomatic of a fundamental problem: a society gripped by a misshapen meritocracy. In some ways, we are not doing nearly that badly; graduate underemployment is a lot lower than in countries like Taiwan, for example. But, slowly, surely, the problem is growing.

Given more time, meritocracy will turn into monstrosity.

If it hasn't already.

### Left in the wake

This problem belongs to the whole of society. But while each person fends for himself, have we paused to consider who's being left behind?

Among those who lack the paper qualifications that gets them past HR officers, the most vulnerable youths of our society, the youths-at-risk, are disproportionately affected. Faced with family and financial issues that they have little power to change, their circumstances hinder them from doing "well" by our society's yardstick.

Coupled with growing inequality and an ever-widening opportunity gap, it is becoming increasingly impossible for these youths to pursue a meaningful career and achieve financial security, regardless of how motivated and driven they are.

### Isn't something being done?
Existing outreach programs provide support through a social-work intervention approach, which engages youths to help them stay crime-free and develop as resilient individuals. However, a large group of them are still unable to pursue a meaningful career and achieve financial security after going through these programs.

In addition, within current work placement programmes, job options are predominantly vocational. It is difficult to achieve financial security through these jobs and many youths desire and deserve an opportunity for a more meaningful career.

### Setting up the problem
From this, we see that:
1. Youth-at-risk are disadvantaged by the lack of formal qualifications. They lack career guidance and the opportunity to enrol into training programs that address their lack of formal education or qualifications.
2. Opportunities in other aspects of career preparation, such as internships and career advice, are not readily accessible to these youths. In turn, these youths face limited career choices and lack the practical knowledge to pursue personal growth.

This is the gap which Hatch aims to address.

<!--
### Our work's cut out for us

Final questions:

What should be done...

How can we help...
-->


text:
yum -y groups install "GNOME Desktop"

systemctl set-default graphical.target

> $ sudo systemctl get-default

> multi-user.target

And then change it to graphical:

$ sudo systemctl set-default
graphical.target

Targets

In Systemd the targets runlevel5.target and graphical.target are identical. So too are runlevel2.target and multi-user.target.

repository: daemonna/centos-cheatsheet

repo_name: daemonna/centos-cheatsheet