text:
# STRATEGIES

## components.ts

- This file defines the constructor function for instantiating each individual component.

#### RunData Method

- When we create a new component, this is run immediately and collects the whole file as a string, and breaks up the file into an array on every new line.
- Each of these components is saved on the global storage

## sibling.ts

- Defines the data structure for the relationship between chidren of the same parent component

#### Add Method

- Establish the location of the current component in the sibling list

#### Scrub Method

- Removes repeat instances of components from the bottom to the top until the final instance of the component is written.

## INITIALIZE

Base is the constructor function

Initialize is a collection of all the methods that do cool stuff

## Initialize.config
- The argument is an object that has 2 required properties
  - Entry
  - Root
- Third optional argument
  - CDN
- Config calls walk
- Config instantiates parser and constructs it with a possible vue argument. If there is no vue argument, it defaults to null, which our parser will default to the default cdn defined in parser.

## Initialize.walk
- Makes use of the Deno walk method
- Looks for every file component with a .vue extension and we save the name of the file in a constant <label> we create a new component for each vue file.
- After we instantiate these components, they are saved into global object called storage.

# PARSER

- Has one required argument (this.root), and one optional argument (this.vue) which defines the CDN.

## The Utils Folder

- Each function called in the parser.parse method has been defined in it's own file in the utils folder.

## Parser.parse

- Enters a loop (comparable to a BST breadth-first-search) that while the queue (imported from the utils.ts file) has length, we parse through the first index of our queue to seperate the HTML, Javascript, and CSS from each Vue component.

#### Parse Template

- Iterates through the split property on the current component which is the array of data that has been broken up by each "\n". It looks for the <template> tag, saves the date in between the two tags a string onto the current component object's template property.
- We replace the value of the split to remove the data that has already been parsed

#### Parse Script

- Iterates through the new, more concised split property on the current component. This time looking for the <script> tags.
- Inside the script, we isolate the 'name' property, if found, we save it to the name property on the current component. If not, we define the name using the Utils.toKebab() method to traslate any multi-word names into kebab case (e.g. name: 'this-example-name').
- We then find everything inside our export default statement, this value is then saved onto the script property of the current component.
- It then locates the 'components:' property, and uses this portion of the script to find any children relational components and then populate the queue in the correct order and assign the relationships in our data structure.
  - We account for irregularities in construction of the components: property by stringifying the values before attempting to parse.
- If the current component does have children, we instatiate a new SiblingList to track each child relationship
- It then iterates through foundChildren and invokes the SiblingList.add() method to add each child to the previous child as a sibling.

#### Parse Style

- Iterates through the split property on the current component. This time looking for the <style> tags.
- Save the data between the style tags to a string on the current component object's style property.
- REMINDER: Scoped styling currently not supported. Please use unique id tags to style your components.

#### Component Stringify

- Takes the strings from each property on the current object, to assemble the components in the correct order to prepare for the final build.
- Looks to see if the current component is the root. If so, in creates the string as a new Vue instance. If not, it creates the string as a Vue.component.

# COMPILER

## Base

- This is the constructor for the compiler object.
- Establishes the Vue import as defined earlier in initialize.
- Dynamically creates the App.\$mount statment to be written at the bottom of the file.

## Compiler

#### Build Method

- Prepares the file structure to write our bundle
- This includes a build.js file and a style.css file
- Checks if the vno-build directory exists. If so, it overwrites to prevent appending onto old builds. If not, it creates the directory
- Checks to see if the build.js and style.css files exist. If so, they are overwritten. If not, they are created and populated.

#### Traverse Method

- Starting at the root, recursively moves down the component tree until it finds a node without a child or sibling.
- It then calls the write method on the node and pops off the stack, until we reach the root component.
- Ensures that the individual files are written in the correct order so the children are always written before the parents.

#### Write Method

- Checks to see if the current component has an instance. It then writes the value of instance into the build.js file.
- Checks to see if the current component has style. It then writes the value of style into the style.css file.

# RENDERER

- This is where we have built the logic to use the built parser to easily boost SEO with Server Side Rendering

# Methods

## Create Renderer

- [ ] Takes two arguments
  - 1. An object of options the user would like to change from the defaults provided in the HTML object defined in the defaults.ts file.
  - 2. A component object defining which file the user would like to create a serveable HTML file(this feature is not yet complete)

## HTML Stringify

- Creates the stringified version of the HTML file to be rendered from the server.

repository: sportelance/vno

repo_name: sportelance/vno


text:
# fpga-serial-acl-tester-2

FPGA Serial ACL Tester Version 2
by Timothy Stotts

Note that this project is deprecated. The most recent project, with wider
hardware support and occasional updates, is Version 3 and is located at:
[fpga-serial-acl-tester-3](https://github.com/timothystotts/fpga-serial-acl-tester-3)

## Description
A small AP SoC project of Zynq-7000 implementation for testing Measurement and Activity Events of a SPI accelerometer.
The design targets the Digilent Inc. Zybo-Z7-20 FPGA development board
containing a Xilinx Zynq-7000 AP SoC.
Three peripherals are used: Digilent Inc. Pmod ACL2, Digilent Inc. Pmod CLS.,
Digilent Inc. Pmod SSD.

The folder ACL-Tester-Design-Zynq contains a Xilinx Vivado IP Integrator plus
Xilinx SDK design. The Zynq hard ARM CPU #0 is configured to talk with board
components,
a SPI MEMS accelerometer peripheral,
a 16x2 character LCD peripheral,
and a 7-segment display.

Sources to be imported into a Xilinx SDK workspace contain
a very small FreeRTOS program in C; drivers for the peripherals,
a real-time task to operate the accelerometer chip,
two real-time tasks to display data, and a real-time task to color-miix RGB LEDs.

### Project information document:

./Serial ACL Readings Tester - Zynq.pdf

[Serial ACL Readings Tester - Zynq info](https://github.com/timothystotts/fpga-serial-acl-tester-2/blob/main/Serial%20ACL%20Readings%20Tester%20-%20Zynq.pdf)

#### Target device assembly: Zybo-Z7-20 with Pmod ACL2, Pmod CLS, Pmod SSD, on extension cables

![Target device assembly](https://github.com/timothystotts/fpga-serial-acl-tester-2/blob/main/img_serial-acl-tester-assembled-20200731.jpg)

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# windows-bootstrap
Some Powershell crap to bootstrap a Windows game server

# Install
Open Powershell and set your current Powershell session to allow scripts to run:

`PowerShell.exe -ExecutionPolicy Unrestricted`

Then you can download the bootstrap script by running:

```
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/JonathanPorta/windows-bootstrap/master/bootstrap.ps1'))
```

This will download a copy of this repository, unzip it, and then run `install.ps1`.

Or, better yet, one command:

```
PowerShell.exe -ExecutionPolicy Unrestricted "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/JonathanPorta/windows-bootstrap/master/bootstrap.ps1'))"
```

repository: JonathanPorta/windows-bootstrap

branch_name: refs/heads/master

repo_name: JonathanPorta/windows-bootstrap


text:
# Blade Filters

Use string filters easily in Laravel Blade.

If you have any question how the package works, we suggest to read this post:
[Laravel Blade Filters](https://pineco.de/laravel-blade-filters/).

## Getting started

You can install the package with composer, running the `composer require conedevelopment/blade-filters` command.

## Using the filters

You can use the filters in any of your blade templates.

#### Regular usage:

```php
{{ 'john' | ucfirst }} // John
```

#### Chained usage:

```php
{{ 'john' | ucfirst | substr:0,1 }} // J

{{ '1999-12-31' | date:'Y/m/d' }} // 1999/12/31
```

#### Passing non-static values:

```php
{{ $name | ucfirst | substr:0,1 }}

{{ $user['name'] | ucfirst | substr:0,1 }}

{{ $currentUser->name | ucfirst | substr:0,1 }}

{{ getName() | ucfirst | substr:0,1 }}
```

#### Passing variables as filter parameters:

```php
$currency = 'HUF'

{{ '12.75' | currency:$currency }} // HUF 12.75
```

#### Built-in Laravel functionality:

```php
{{ 'This is a title' | slug }} // this-is-a-title

{{ 'This is a title' | title }} // This Is A Title

{{ 'foo_bar' | studly }} // FooBar
```

### Limitations

#### Echos

Laravel supports three types of echos. Raw – `{!!  !!}`, regular – `{{ }}` and escaped (legacy) – `{{{ }}}`.
Filters can be used **only with regular** echos. Also, filters **cannot be used in blade directives directly**.

> Why? Raw should be as it is. Forced escaping should be escaped only, without modification.

#### Bitwise operators

Bitwise operators are allowed, but they must be wrapped in parentheses,
since they are using the same "pipe operator".

```php
{{ ('a' | 'b') | upper }} // C
```

## The Filters

### About the filters

Filters are string functions, that are defined in the `Pine\BladeFilters\BladeFilters` facade.
It has several reasons, that are discussed in the [Create custom filters](#create-custom-filters) section.

### The available filters

The package comes with a few built-in filters, also the default Laravel string methods can be used.

#### Currency

```php
{{ '17.99' | currency:'CHF' }} // CHF 17.99

{{ '17.99' | currency:'€',false }} // 17.99 €
```

> Passing `false` as the second parameter will align the symbol to the right.

#### Date

```php
{{ '1999/12/31' | date }} // 1999-12-31

{{ '1999/12/31' | date:'F j, Y' }} // December 31, 1999
```

#### Lcfirst

```php
{{ 'Árpamaláta' | lcfirst }} // árpamaláta
```

> Unlike PHP's default `lcfirst()`, this filter works with multi-byte strings as well.

#### Reverse

```php
{{ 'ABCDEF' | reverse }} //FEDCBA
```

#### Substr

```php
{{ 'My name is' | substr:0,2 }} // My

{{ 'My name is' | substr:3 }} // name is
```

#### Trim

```php
{{ '   trim me    ' | trim }} // trim me
```

#### Ucfirst

```php
{{ 'árpamaláta' | ucfirst }} // Árpamaláta
```

> Unlike PHP's default `ucfirst()`, this filter works with multi-byte strings as well.

### Supported built-in Str functions

- [Str::after()](https://laravel.com/docs/5.8/helpers#method-str-after)
- [Str::before()](https://laravel.com/docs/5.8/helpers#method-str-before)
- [Str::camel()](https://laravel.com/docs/5.8/helpers#method-str-camel)
- [Str::finish()](https://laravel.com/docs/5.8/helpers#method-str-finish)
- [Str::kebab()](https://laravel.com/docs/5.8/helpers#method-str-kebab)
- [Str::limit()](https://laravel.com/docs/5.8/helpers#method-str-limit)
- [Str::plural()](https://laravel.com/docs/5.8/helpers#method-str-plural)
- [Str::singular()](https://laravel.com/docs/5.8/helpers#method-str-singular)
- [Str::slug()](https://laravel.com/docs/5.8/helpers#method-str-slug)
- [Str::snake()](https://laravel.com/docs/5.8/helpers#method-str-snake)
- [Str::start()](https://laravel.com/docs/5.8/helpers#method-str-start)
- [Str::studly()](https://laravel.com/docs/5.8/helpers#method-str-studly)
- [Str::title()](https://laravel.com/docs/5.8/helpers#method-str-title)

## Create custom filters

As it was mentioned before, every filter is a method that can be called through the `Pine\BladeFilters\BladeFilters` facade.
It has several reasons why is this approach better, but let's take the most important ones:

- It's easy to define custom filters by extending the facade with the `BladeFilters::macro()`,
- No extra files, autoloading or class mapping, it's enough to use any service provider to define filters,
- By default Laravel provides a bunch of handy methods that we can use as filters.

### Parameter ordering

PHP is not very strict regarding to function's parameter ordering and this way it's easier to coordiante or override them.
Also, sometimes it happens with Laravel's string functions. It's important that only those functions can be used, that accept the parameters in the following order:

1. The value to be transformed
2. Any other parameter if needed

For example:

```php
BladeFilters::macro('filterName', function ($value, $param1 = 'default', $param2 = null) {
    return ...;
});

{{ 'string' | filterName:1,2 }}
```

### Defining custom filters

Since the filters are only methods that are defined in the `Str` facade and the `BladeFilters` class, to create filters,
you need to create a macro in a service provider's `boot()` method.

```php
class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        BladeFilters::macro('substr', function ($value, $start, $length = null) {
            return mb_substr($value, $start, $length);
        });
    }
}
```

## Contribute

If you found a bug or you have an idea connecting the package, feel free to open an issue.

repository: conedevelopment/blade-filters

gha_language: PHP

gha_license_id: MIT

repo_name: conedevelopment/blade-filters


text:
# `git machete` strikes again! Traverse the git (rebase) jungle even faster with v2.0+

## Intro

For those of you not familiar with this nifty tool, I recommend having a quick look at the [previous part of this series (link)](https://medium.com/virtuslab/make-your-way-through-the-git-rebase-jungle-with-git-machete-e2ed4dbacd02)
or at least scrolling through the screenshots in that blog post to get a TL;DR kind of understanding of what git machete actually does.

In general, git machete is a tool that helps manage multiple branches within a git repository and thus promotes the creation of smaller pull requests that are (usually) easier to review.
Just recall the last time you had to review a giant like this (diff stats shown of course only for a few first files):

To get through installation process, please visit [Installation page](https://github.com/VirtusLab/git-machete/tree/master#install)

## Demo repository setup

As in the first part of the series, there is a dedicated script that sets up a demo repository with a couple of branches -
you can download it [directly from GitHub (link)](https://raw.githubusercontent.com/VirtusLab/git-machete/master/blogs/git-machete-2/sandbox-setup-2.sh).
A tricky thing about the script is that it actually sets up two repos: one at `~/machete-sandbox` and another one at `~/machete-sandbox-remote`.
The latter is a _bare_ repository that is created with `git init --bare` and hence doesn't have working tree, just a `.git` folder.
This will serve as a dummy remote for the repo under `~/machete-sandbox`.
More specifically, the script runs `git remote add origin ~/machete-sandbox-remote` from `~/machete-sandbox` directory
so as to establish an actual local/remote relation between the repos, with similar push/pull capabilities that are available over HTTPS or SSH.

The initial structure of branches in the demo (i.e., the contents of the `.git/machete` branch layout file, excluding custom annotations that will be covered soon) is as follows:

```
develop
    allow-ownership-link
        build-chain
    call-ws
master
    hotfix/add-trigger
```

There is also a `drop-constraint` branch; this isn't yet included in `.git/machete` for a good reason that is explained later.

## What PR was for what branch? Custom annotations and improved remote sync-ness status

For most local branches (possibly other than dependency tree roots, like `develop` or `master`), at some point you'll create a pull request on e.g. GitHub or Bitbucket.
It can get pretty inconvenient to "optically" match branch names as displayed by `git branch` or `git machete status` to PRs,
especially in case of Bitbucket, which by default doesn't display source branch names in the PR list, only the destination branch.

To make dealing with auxiliary information such as PR numbers easier, `git machete status` got a simple tweak recently: custom annotations.
Just put any phrase after the branch name, separated with a single space (there's an implicit assumption that you never put spaces in git branch names... if you do, think it over twice!),
and it will be displayed in the output of the `status` subcommand.
To be precise, anything can be placed as annotation, not only a PR number specifically - but PR numbers seem the most natural use case.

The annotations were already set up by the `sandbox-setup-2` script.
Let's run `git machete status`:

![git machete status](status.png)

The PR numbers are completely arbitrary here since the script obviously didn't create any actual PRs on any external service.

You might also notice that the output slightly changed in terms of the remote sync-ness message.
In earlier versions of git machete it was pretty cumbersome that you couldn't really distinguish between a remotely untracked branch and one that is remotely tracked but not in sync with its remote.
As of v2.0 of git machete, `status` distinguishes between (roughly) the following cases:

* untracked
* in sync with remote
* ahead of origin
* behind origin
* diverged from origin

pretty much just like `git status` does.

Now it's also more consistent with `git status` in that it uses the remote tracking branch information (as set up by `git branch --set-upstream` or `git push --set-upstream`)
to determine the remote counterpart branch, rather than simply prefixing branch names with remote name (like `origin/<branch-name>`).

 Traversal of the branch dependency tree

The sequence of steps suggested in the first blog post:

* check out a branch X
* rebase it on the top of its upstream if needed
* push to remote (possibly with `--force`) if needed
* check out another branch — e.g. a child of X

actually repeats pretty often in a daily work with `git machete`, especially when you receive a lot of remarks from reviewers and push fixes in rounds that follow one another.

To free yourself from thinking about what to check out/rebase/push next, you can turn to `git machete traverse` —
a wizard that walks (or rather, traverses) the branch dependency tree and suggests what needs to be done to restore sync of branches with their parent branches and remotes.

Let's check out the `develop` branch (which is listed first in the branch layout file) and then iterate through the branches.

![git machete traverse](traverse.png)

After starting from `develop` the wizard instantly moved to `allow-ownership-link`.
`allow-ownership-link` wasn't originally in sync with `develop` so `traverse` asked whether to rebase `allow-ownership-link` onto `develop`.
Note that if there were any conflicts during the rebase (or for that matter, any other failure during the traversal), `traverse` would stop and let you sort out the mess,
after which it could be simply re-run and would pick up from where it finished.

After a successful rebase, `allow-ownership-link` was pushed to the remote (or more precisely, the _local remote_ since it resides on the local machine) and similar process happened again for `build-chain`.
For the sake of brevity it isn't included in the above screenshot, but if you were to continue the traversal,
then you'd encounter the branch `call-ws`, which is aligned with `develop`, so rebase wouldn't even be proposed.
It isn't in sync with its remote counterpart, though, so `traverse` would ask whether to push `call-ws` to `origin`.
`traverse` would later switch to `master` but wouldn't suggest that you push or pull `master` since it was already in sync with `origin/master`.
The journey would end with a chance to push `hotfix/add-trigger` (with force, since it diverged from `origin/hotfix/add-trigger`).

Generally, the traversal is performed by moving to the `next` of each branch (so, pretty much by running `git machete go next`).
For the more graph-theory-savvy of you... this is equivalent to a pre-order depth-first search of the branch dependency tree.
Each node of the tree (i.e. each git branch) is visited and possibly synced with its parent branch and/or remote counterpart before any of its children (downstream) branches are visited.
This way of traversal makes more sense than, say, post-order since you definitely want to put each branch X in sync with its parent branch first before syncing X's children to X itself.

## Don't remember what depended on what? Inference of upstream branch

Another new shiny feature that has been recently added to git machete is the ability to automatically infer the upstream (parent) branch for a given branch.
There's a couple of contexts in which `git machete` can do this kind of guesswork.

### `show up`, `go up`

As mentioned before, the `sandbox-setup-2.sh` script added, among others, a branch `drop-constraint` that is not listed in `.git/machete`.
Let's assume for a moment that you're in the awkward situation of not remembering what branch it originally depended on and it's hard to find that out from `git log`.

So... as always, `git machete` to the rescue!
Since v2.0 the tool has had the ability to infer the upstream for a given branch X.
I won't delve into the details of the algorithm, but in general the heuristic takes into account reflogs of all local branches and their remote counterparts, specifically the reflog of X itself.
In a way, this is a similar approach to how the fork point (covered in more detail in the first part of the series) is determined.

Back to `drop-constraint`... the easiest way to trigger upstream inference is to check out the branch in question and run `git machete show up`:

![git machete show up, git machete go up](show-up-go-up.png)

The stderr output warns that `drop-constraint` isn't present in `.git/machete` and suggests an inferred fallback (that's also printed to stdout to facilitate use in scripts, for example).
If you take a look at the `sandbox-setup-2.sh`, `drop-constraint` was indeed originally checked out from `call-ws`, even though the branches are no longer in commit-wise sync.
Analogically, the `go up` subcommand checked out the inferred upstream.

Note that if `drop-constraint` was tracked in `.git/machete`, then the whole inference wouldn't happen since git machete would instead simply go for the upstream explicitly provided by the user in the branch layout file.
Also, the inference doesn't happen for any other `show`/`go` direction (like `down` or `next`) since that behavior could be pretty confusing and generally of little practical use.

### `update`

Let's check out `drop-constraint` back again and, without changing anything in `.git/machete`, fire `git machete update`:

![git machete update](update-3.png)

`update` couldn't find an entry for `drop-constraint` in the branch layout file, so it fell back to automatic inference.

### `add`

Now let's try and do `git machete add`:

![git machete add](add.png)

Since the desired upstream branch wasn't specified (no `--onto` option was provided), the `add` subcommand inferred the `drop-constraint`'s upstream.
Note that in the case of both `update` and `add` the user has been explicitly asked whether git machete's guess is acceptable.

### `discover`

What's more, the inference is not just limited to a single branch - it can even be performed on a repository where there is not yet a `.git/machete` file to discover the entire dependency tree with a single command!

For demonstration purposes, let's now remove the `.git/machete` file (so as to make sure `git machete` isn't provided with any hint) and run `git machete discover`:

![git machete discover](discover.png)

`discover` gives the choice to either accept the discovered tree right away with `y[es]`, `e[dit]` it first, or reject it with `n[o]`.
In the case of `yes`/`edit`, the old branch layout file (if it already exists) will be saved under `.git/machete~` (note the added tilde).

Under the hood, `discover` simply performed upstream inference (just as for `show up` etc.) for every single local branch independently,
while applying some tricks (inspired by the [disjoint-set data structure](https://en.wikipedia.org/wiki/Disjoint-set_data_structure)) to make sure no cycles appear in the created graph.

The only thing that obviously could not be inferred were custom annotations.
Also, if the tree structure has been changed in the meantime (so that e.g. `develop` became a child of `call-ws` instead of the inverse), `discover` can't be expected to exactly guess the changed structure.
The inference is based on git reflogs and doesn't know anything about the current or previous state of the `.git/machete` file.

At this point one can ask a question: why then is the branch layout file even needed since the upstreams could be always inferred on the fly?
The argument against such an approach is that it wouldn't be desirable if everything in the tool happened automagically/behind the scenes.
The developer should keep a sensible amount of control while still being provided with some hints when they're in doubt.
It seems much more reasonable than the inverse — inferring everything that's possible and only asking the human when the tool is in doubt.

## `discover` + `traverse` combo

So to recap... let's combine all that goodies into a single one-size-fits-all recipe:

```bash
$ cd your-repo/
$ git machete discover
  # (see and possibly edit the suggested layout of branches)
$ git machete go root
$ git machete traverse
  # (put each branch one by one in sync with its parent and remote counterpart)
```

Assuming you're sticking to rebase flow (in particular, you never merge upstream branch like `master` into your topic branches but instead rebase topic branches onto `master`),
those few git-machete cuts should magically sort out your repository... whatever kind of jungle you might have had before.

repository: VirtusLab/git-machete

gha_language: Python

repo_name: VirtusLab/git-machete


text:
# Presentation CMS
Very basic CMS system write to share **code snippets**, **useful links** which was showed during training.
This CMS contain user registration, user authentication.

![Presentation CMS Authentication](img/sign-in.png?raw=true "Presentation CMS Authentication")

## Table of content
- [Getting started](#getting-started)
    - [Prerequisites](#prerequisites)
    - [Installing](#installing)
- [Running](#running)
- [Technologies](#technologies)
- [License](#license)

## Getting started
These instructions will get you a copy of the project up and running on your local machine for development purposes

### Prerequisites
You will need to add `firebase.js` file in the `src/` directory to run that project which should be like this below:
```javascript
export const config = {
  apiKey: "YOUR_FIREBASE_API_KEY",
  authDomain: "YOUR_FIREBASE_AUTH_DOMAIN",
  databaseURL: "YOUR_FIREBASE_BASE_URL",
  projectId: "YOUR_FIREBASE_PROJECT_ID",
  storageBucket: "YOUR_FIREBASE_STORAGE_BUCKET",
  messagingSenderId: "YOUR_FIREBASE_MESSAGING_SENDER_ID"
};
```

In your firebase console, you will need to active authentication via `e-mail/password` and set up Realtime Database.
Simple rules for your Realtime Database:

```json
{
  "rules": {
    "activePresentation": {
      ".read": true,
      ".write": "auth != null"
    },
    "presentations": {
      ".read": "auth != null",
      ".write": "auth != null"
    }
  }
}
```

### Installing
To install this project, type in the main project directory:
```
npm install
```
or
```
yarn
```

## Running
To run this project on your local machine type:
```javascript
yarn serve
```
For build production version type:
```javascript
yarn build
```

If you want check this project with lint:
```javascript
yarn lint
```

## Technologies
- Vue: 2.5.16,
- Vue Router: 3.0.1,
- Vuex: 3.0.1,
- Vue Highlightjs: 1.3.3,
- Vue Test Utils: 1.0.0-beta.16,
- JEST: 3.0.0-rc.2,
- Firebase: 5.0.4,

## License [![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org)
See the [LICENSE](LICENSE.MD) file for license rights and limitations (MIT).


text:
# GravityHR - Human Resource Management System

[![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework)
[![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.svg)](https://packagist.org/packages/laravel/framework)
[![Latest Stable Version](https://poser.pugx.org/laravel/framework/v/stable.svg)](https://packagist.org/packages/laravel/framework)
[![Latest Unstable Version](https://poser.pugx.org/laravel/framework/v/unstable.svg)](https://packagist.org/packages/laravel/framework)
[![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework)

GravityHR is a combination of systems and processes that connect human resource management and information technology through HRMS software.

Each module performs a separate function within the HRMS that helps with information gathering or tracking. HRMS modules can assist with:
1. Employee Management
2. Leave Management
3. Attendance Management
4. Team Management
5. Asset/Resource Management

## Official Documentation of Framework

Documentation for the framework can be found on the [Laravel website](http://laravel.com/docs).

## Project License

The project is available to be used freely for personal and educational purposes, cloning the project does not gives you any rights to sell it online/offline.

## License

The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

## Requirement

1. PHP version 5.6+
2. [PHP Mcrypt](http://php.net/manual/en/book.mcrypt.php)
3. [PHP Mysql](http://php.net/manual/en/ref.pdo-mysql.php)
4. [Composer](https://getcomposer.org/)
5. [mbstring](http://php.net/manual/en/mbstring.installation.php)
6. [dom extention](http://php.net/manual/en/dom.setup.php)

## Installation

It is preferred to have git setup installed on your local system.

Once downloaded/cloned go to the project directory on terminal/command line and install composer:

    composer install

Once composer is installed, run migration:

    php artisan migrate

After migration, run the database seeder:

    php artisan db:seed

Once done migrating and seeding you will have default user:

    email<EMAIL_ADDRESS>    password: GravityBPO123

### Credit to the original developer, kmanjari - https://github.com/kmanjari/hrms

repository: malvernbright/GravityHR

repo_name: malvernbright/GravityHR


text:
# Today I learned / 26-June, 2018
## The reason we have to use git / github when working
   - It has a ledger (history) about what we have done before
   - Automatic-update-functions
## Git & github
   - Github : A web-based hosting service for version control using Git
   - Git : A version control system for tracking changes in computer files
           and coordinating work on those files among multiple people
## Functions that I should get used to
   - pull request
     Pull requests let you tell others about changes you've pushed to a repository on GitHub.
     Once a pull request is opened, you can discuss and review the potential changes
     with collaborators and add follow-up commits before the changes are merged into the repository.
   - merge
   - commit

gha_language: Jupyter Notebook


text:
---
title: ContractMethodCaller
section: API
order: 6
---

The `ContractMethodCaller` (short `Caller`) class is a part of the `ContractClient` to passively interact with objects on the blockchain and doesn't produce transactions. They are usually created for a `ContractClient` class on its initialization (e.g. the [ColonyClient](/colonyjs/api-colonyclient)) and are associated with one single method on the smart contract.

For more info see the [ContractClient](/colonyjs/docs-contractclient/) docs.

==TOC==

## Instance methods

### `call(inputValues)`

Given named input values, perform a call on the method's contract function, and get named output values from the result.

**Arguments**

**`inputValues`** `{ [string]: any }` - Any key value pair of contract input parameters

**Returns**

`Promise<{ [string]: any }>` - Promise that resolves to key value pairs of the called contract methods output

repository: felixniemeyer/colonyJS

repo_name: felixniemeyer/colonyJS


text:
INSTALLATION

Extract the program (ElvUI Downloader.exe) somewhere you can easily access it. I personally keep it on my desktop.

=========================================

SET UP & USAGE

The first time you run the program (or if you've deleted the config file) the program will attempt to autodetect your WoW installation directory.
If the program cannot find your WoW installation it will ask you to input the directory yourself (You can find by going to Battle.net > WoW > Options > Show in Explorer)

After it has your WoW installation directory, it will ask you if you want it to download ElvUI for Retail, to which you answer by pressing (Y/N) on your keyboard. The program will then ask the same for Classic.

After first time setup, it will save a config file in %APPDATA%/Roaming/ElvUIDownloader with the information it has gathered. This info is stored locally on your machine and nowhere else. Nothing is uploaded anywhere, your super secret WoW installation directory is kept private. ;)

Once the config file has been saved, the program will download ElvUI for whichever versions of WoW you've instructed it to, as well as automatically install them to the relevant folders. Super simple and lightweight!

If the program detects the config file, it will wait 3 seconds before starting the download. Pressing SHIFT during this period will allow you to change where to install the addons and/or change which versions of WoW to download for.

=========================================

UNINSTALLATION

Run the program and hit SHIFT before it starts the download to enter configuration mode. Set both Retail and Classic to NOT download (just hit N both times when asked) and it will delete the configuration file so you can easily remove all trace of the program.

repository: VladiMatt/ElvUI-Downloader

repo_name: VladiMatt/ElvUI-Downloader


text:
PickleDB
========

[![Build Status](https://api.travis-ci.org/seladb/pickledb-rs.svg?branch=master)](https://travis-ci.org/seladb/pickledb-rs)
[![Crate](https://img.shields.io/crates/v/pickledb.svg)](https://crates.io/crates/pickledb)
[![API](https://docs.rs/pickledb/badge.svg)](https://docs.rs/pickledb)

PickleDB is a lightweight and simple key-value store written in Rust, heavily inspired by [Python's PickleDB](https://pythonhosted.org/pickleDB/)

## PickleDB is fun and easy to use

```rust
use pickledb::PickleDb;

fn main() {

    // create a new DB with AutoDum, meaning every change is written to the file
    let mut db = PickleDb::new("example.db", PickleDbDumpPolicy::AutoDump);

    // set the value 100 to the key 'key1'
    db.set("key1", &100);

    // print the value of key1
    println!("The value of key1 is: {}", db.get::<i32>("key1").unwrap());

    // load the DB from the same file
    let db2 = PickleDb::load("example.db", PickleDbDumpPolicy::DumpUponRequest).unwrap();

    // print the value of key1
    println!("The value of key1 as loaded from file is: {}", db2.get::<i32>("key1").unwrap());
}
```

## Installation

This crate works with Cargo and can be found in [crates.io](https://crates.io/crates/pickledb)
Add this to your `Cargo.toml`:

```toml
[dependencies]
pickledb = "0.2.0"
```

## Documentation

All documentation for this crate can be found in [docs.rs](https://docs.rs/pickledb)

## Examples

There are currently two examples shipped with PickleDB:

* [Hello World](https://github.com/seladb/pickledb-rs/tree/master/examples/hello_world) which shows the basic usage of PickleDB:
  create a new DB, load a DB from file, get/set key-value pairs of different types, and more
* [Lists](https://github.com/seladb/pickledb-rs/tree/master/examples/lists) which shows how to use lists in PickleDB:
  create new lists, add/remove items from lists, retrieve items from lists, remove lists, and more

## Changelog

__Version 0.2.0__

* Dump the DB to file in a crash-safe manner using a temp file (Thanks jamwt from Reddit
  for the tip: https://www.reddit.com/r/rust/comments/agumun/check_out_pickledb_a_lightweight_and_simple/ee987j0)
* Extend lists became easier and multiple calls to lcreate(), ladd() and lextend() can be chained
* Added an iterator over keys and values in the DB
* Added an iterator over items in a list

repository: songzhi/pickledb-rs

repo_name: songzhi/pickledb-rs


text:
---
title: "Fuseki: Configuring Fuseki"
---

Configuration consists of defining the data services (data and actions available on the data) together with configuring the server.  Explicitly configuring the server is often unnecessary.

The data services configuration can come from:

1. The directory `FUSEKI_BASE/configuration/` with one data service assembler per file (includes endpoint details and the dataset description.)
2. The system database. This includes uploaded assembler files.  It also keeps the state of each data service (whether it's active or offline).
3. The service configuration file.  For compatibility, the service configuration file can also have data services. [See below](#relationship-to-fuseki-1-configuration).
4. The command line, if not running as a web application from a .war file.

`FUSEKI_BASE` is the location of the [Fuseki run area](./fuseki-layout.html).

## Data Service assembler

See [Fuseki Data Services](fuseki-data-services.html) for the architecture of data services.

See [Fuseki Security](fuseki-security.html) for more information on security.

## Fuseki Configuration File

A Fuseki server can be set up using a configuration file. The
command-line arguments for publishing a single dataset are a short
cut that, internally, builds a default configuration based on the
dataset name given.

The configuration is an RDF graph. One graph consists of one server
description, with a number of services, and each service offers a
number of endpoints over a dataset.

The example below is all one file (RDF graph in Turtle syntax)
split to allow for commentary.

### Prefix declarations

Some useful prefix declarations:

    @prefix fuseki:  <http://jena.apache.org/fuseki#> .
    @prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
    @prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
    @prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
    @prefix :        <#> .

### Assembler Initialization

All datasets are described by
[assembler descriptions](../assembler/index.html).
Assemblers provide an extensible way of describing many kinds of
objects.

### Defining the service name and endpoints available

Each data service assembler defines:

* The base name
* The operations and endpoint names
* The dataset for the RDF data.

This example offers SPARQL Query, SPARQL Update and SPARQL Graph
Store protocol, as well as file upload.

Note: As of Jena 3.13.0,
[an additional, more expressive configuration for endpoints](fuseki-config-endpoint.html)
is available.

The base name is `/ds`.

    ## Updateable in-memory dataset.

    <#service1> rdf:type fuseki:Service ;
        fuseki:name                       "ds" ;       # http://host:port/ds
        fuseki:serviceQuery               "sparql" ;   # SPARQL query service
        fuseki:serviceQuery               "query" ;    # SPARQL query service (alt name)
        fuseki:serviceUpdate              "update" ;   # SPARQL update service
        fuseki:serviceUpload              "upload" ;   # Non-SPARQL upload service
        fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph store protocol (read and write)
        # A separate read-only graph store endpoint:
        fuseki:serviceReadGraphStore      "get" ;      # SPARQL Graph store protocol (read only)
        fuseki:dataset                   <#dataset> ;
        .

`<#dataset>` refers to a dataset description in the same file.

### Read-only service

This example offers only read-only endpoints (SPARQL Query and HTTP GET
SPARQl Graph Store protocol).

This service offers read-only access to a dataset with a single
graph of data.

    <#service2> rdf:type fuseki:Service ;
        fuseki:name                     "/ds-ro" ;   # http://host:port/ds-ro
        fuseki:serviceQuery             "query" ;    # SPARQL query service
        fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol (read only)
        fuseki:dataset           <#dataset> ;
        .

### Dataset

#### In-memory

An in-memory dataset, with data in the default graph taken from a local file.

    <#books>    rdf:type ja:RDFDataset ;
        rdfs:label "Books" ;
        ja:defaultGraph
          [ rdfs:label "books.ttl" ;
            a ja:MemoryModel ;
            ja:content [ja:externalContent <file:Data/books.ttl> ] ;
          ] ;
        .

#### TDB

    <#dataset> rdf:type      tdb:DatasetTDB ;
        tdb:location "DB" ;
        # Query timeout on this dataset (1s, 1000 milliseconds)
        ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "1000" ] ;
        # Make the default graph be the union of all named graphs.
        ## tdb:unionDefaultGraph true ;
         .

#### TDB2

    <#dataset> rdf:type      tdb:DatasetTDB2 ;
        tdb:location "DB2" ;
        # Query timeout on this dataset (1s, 1000 milliseconds)
        ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "1000" ] ;
        # Make the default graph be the union of all named graphs.
        ## tdb:unionDefaultGraph true ;
         .

#### Inference

An inference reasoner can be layered on top of a dataset as defined above. The type of reasoner must be selected carefully and should not include more reasoning than is required by the application, as extensive reasoning can be detrimental to performance.

You have to build up layers of dataset, inference model, and graph.

    <#dataset> rdf:type ja:RDFDataset;
         ja:defaultGraph <#inferenceModel>
         .

    <#inferenceModel> rdf:type      ja:InfModel;
         ja:reasoner [ ja:reasonerURL <http://example/someReasonerURLHere> ];
         ja:baseModel <#baseModel>;
         .
    <#baseModel> rdf:type tdb:GraphTDB2;  # for example.
         tdb2:location "/some/path/to/store/data/to";
         # etc
         .

where `http://example/someReasonerURLHere` is one of the URLs below.

##### Possible reasoners:

Details are in [the main documentation for inference](/documentation/inference/).

* **Generic Rule Reasoner**: `http://jena.hpl.hp.com/2003/GenericRuleReasoner`

  The specific rule set and mode configuration can be set through parameters in the configuration Model.

* **Transitive Reasoner**: `http://jena.hpl.hp.com/2003/TransitiveReasoner`

  A simple "reasoner" used to help with API development.

  This reasoner caches a transitive closure of the subClass and subProperty graphs. The generated infGraph allows both the direct and closed versions of these properties to be retrieved. The cache is built when the tbox is bound in but if the final data graph contains additional subProperty/subClass declarations then the cache has to be rebuilt.

  The triples in the tbox (if present) will also be included in any query. Any of tbox or data graph are allowed to be null.

 * **RDFS Rule Reasoner**: `http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner`

   A full implementation of RDFS reasoning using a hybrid rule system, together with optimized subclass/subproperty closure using the transitive graph caches. Implements the container membership property rules using an optional data scanning hook. Implements datatype range validation.

 * **Full OWL Reasoner**: `http://jena.hpl.hp.com/2003/OWLFBRuleReasoner`

   A hybrid forward/backward implementation of the OWL closure rules.

 * **Mini OWL Reasoner**: `http://jena.hpl.hp.com/2003/OWLMiniFBRuleReasoner`

   Key limitations over the normal OWL configuration are:
   * omits the someValuesFrom => bNode entailments
   * avoids any guard clauses which would break the find() contract
   * omits inheritance of range implications for XSD datatype ranges

 * **Micro OWL Reasoner**: `http://jena.hpl.hp.com/2003/OWLMicroFBRuleReasoner`

   This only supports:
   * RDFS entailments
   * basic OWL axioms like ObjectProperty subClassOf Property
   * intersectionOf, equivalentClass and forward implication of unionOf sufficient for traversal of explicit class hierarchies
   * Property axioms (inverseOf, SymmetricProperty, TransitiveProperty, equivalentProperty)

   There is some experimental support for the cheaper class restriction handlingly which should not be relied on at this point.

## Server Configuration

If you need to load additional classes, or set global parameters, then these go in
`FUSEKI_BASE/config.ttl`.

Additional classes can not be loaded if running as a `.war` file.  You will
need to create a custom `.war` file consisting of the contents of the Fuseki
web application and the additional classes

### Server Section

    [] rdf:type fuseki:Server ;
       # Server-wide context parameters can be given here.
       # For example, to set query timeouts: on a server-wide basis:
       # Format 1: "1000" -- 1 second timeout
       # Format 2: "10000,60000" -- 10s timeout to first result, then 60s timeout to for rest of query.
       # See java doc for ARQ.queryTimeout
       # ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "10000" ] ;

       # Load custom code (rarely needed)
       # ja:loadClass "your.code.Class" ;
       .

## Compatibility with Fuseki 1 configuration

Configurations from Fuseki 1, where all dataset and server setup is in a
single configuration file, will still work.  It is less flexible
(you can't restart these services after stopping them in a running server)
and user should plan to migrate to the [new layout](./fuseki-layout.html).

To convert a Fuseki 1 configuration setup to Fuseki 2 style, move each data service assembler and put in its own file under `FUSEKI_BASE/configuration/`

repository: crookstonmet/jena-site

repo_name: crookstonmet/jena-site


text:
# wai-bindgen-wasmer

Runtime utility crate for Wasmer host WAI bindings generated by wai-bindgen-gen-wasmer.

This crate was moved from the https://github.com/wasmerio/wai repository.

wai-bindgen-wasmer needs Wasmer as a dependency, which makes it extremely awkard to use if the
crate is not in the same repo.
This is necessary because wai is now used for wasix_http_client bindings, and will also be used
for all WASI and WASIX syscalls in the future.

The medium-term plan is to rewrite wai-bindgen-gen-wasmer to make this create redundant.

See https://github.com/wasmerio/wai/issues/31 .

repository: wasmerio/wasmer

gha_language: Rust

repo_name: wasmerio/wasmer


text:
# ASP.NET Core Controller example

This sample shows using Dapr with ASP.NET Core controllers. This application is a simple and not-so-secure banking application. The application uses the Dapr state-store for its data storage. The sample is a copy of the [Dapr .NET SDK Controller example](https://github.com/dapr/dotnet-sdk/tree/master/examples/AspNetCore/ControllerSample), but modified to include Dapr Sidekick integration for launching a Dapr sidecar.

> See the [original source](https://github.com/dapr/dotnet-sdk/tree/master/examples/AspNetCore/ControllerSample) for more information on how to use the sample.

## How Dapr Sidekick was added

The main change to the template code to add Dapr support can be found in the `ConfigureServices` method in `Startup.cs`:

```csharp
public void ConfigureServices(IServiceCollection services)
{
    ...
    // Add Dapr Sidekick
    services.AddDaprSidekick(Configuration);
}
```

## Running the sample

 To run the sample simply set `ControllerSample` as the startup project and run it in Visual Studio, it will launch the Dapr sidecar and connect to it.

 For all further instructions, including prerequisites and testing, please refer to the [original source](https://github.com/dapr/dotnet-sdk/tree/master/examples/AspNetCore/ControllerSample).

repository: fbridger/dapr-sidekick-dotnet

repo_name: fbridger/dapr-sidekick-dotnet


text:
# Cloud Platform - EKS Cluster

This README describes the main infrastructure components required to deliver a production-ready EKS cluster. Terraform is used as a main tool to bootstrap the infrastructure layer and EKS clusters. This terraform code requires you already have a VPC provisioned. If no VPC is provided it'll look for a VPC named as your terraform workspace

## Contents

  - [Requirements](#Requirements)
  - [Cluster Dependences](#cluster-dependences)
  - [EKS](#eks)
  - [How do I run this?](#terraform-modules)

## Requirements

- Terraform >= 12
- [aws-iam-authenticator](https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html)
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [Helm <= 2.14.3](https://github.com/helm/helm/releases/tag/v2.14.3)
- Ensure you have `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` exported

## What it contains?

### Cluster Dependences (`main.tf`)

Within `main.tf` you'll find creation of:

- Auth0 registration
- Route53 hostzones that your cluster will use
- AWS Key pairs
- Bastion: It calls the bastion module which creates a bastion instance inside a VPC that will grant access to internal subnets to the members of the team. You can use this host to ssh onto your worker nodes.
- etc

### EKS (`eks.tf`)

`eks.tf` holds the EKS definition, it is being used the official EKS module. Inside this file you'll specify workers, IAM permissions, etc.

**NOTE**: Default cluster size is **21** nodes and default worker node types are **r5.2xlarge**. If you are just playing around or testing a feature it doesn't make sense to have these specs, please change them.

## How do I use this?

```bash
terraform init
terraform workspace select/new <clusterName>
terraform apply -var-file="vars/$(terraform workspace show).tfvars"
```


text:
# Discrete Probability

In the analysis of randomized algorithms, the concepts of [discrete probability][discrete-prob] help devise the mathematical models catering the needs to perform [asymptotic analysis](../asymptotic-analysis.md).

_Note: despite that continuous probability is also pivotal in various scientific worlds, [**discrete probability**][discrete-prob] is mostly used in the computing subjects and hence the major topic in this chapter._

The following definitions are essential to know for applications in randomized algorithm analysis.

## Indicator Random Variable

To analyze the various randomized algorithms, the definition of [Indicator Random Variable][indicator] is adopted:

Figure 1. Indicator Random Variable

_Note: where Α denotes the [**event**][event] within the [sample space][sample space]_

## Conditional Probability

Given the sample space and its subsets event Α, Β, etc. the [Conditional Probability](http://www.stat.yale.edu/Courses/1997-98/101/condprob.htm) denotes the concept that "event Β's probability to occur given the event Α happens as well":

Р(Β | Α) = Р(Α ∩ Β) / Р(Α)

Figure 2. Venn Diagram of Intersection of Event Α and Β

if [event][event] Α and Β are independent (_which means the events have no intersections graphically represented above._), Р(Α ∩ Β) = Р(Α) ⋅ Р(Β), Р(Β | Α) = Р(Β)

## Linearity of Expectation

Formal Def: let 𝒳1, 𝒳2, ..., 𝒳n be random variables defined on [sample space][sample space]. Then:

Figure 3. Linearity of Expectation

## Example Problems

To take advantage of the definitions above, there are several related probabilistic problems to cover.

### Birthday Paradox

How many people is needed at least in order that two of them having a 50-50 chance to born on the same day? The answer is an astonishing 23, which is far smaller than the total number of days in a year.

It is a _paradox_ given that only 70 people will have 99.9% possibility to discover two of them sharing the same birthday, much more efficient than finding such a pair in more than 366 people.

_**Proof**_:

Assume that leap year is not considered and all 365 days are equally likely to be chosen as one's birthday. (the differences of birth year is neglected)

To compute the probability of two people in a group sharing the same birthday, which can be seen as event A, a complementary event A' that no two individuals having the same birthday is introduced.

If a guy _a_ chooses day _d(a)_, then a guy _b_ must chooses day _d(b)_ ≠ _d(a)_ in order that event A' still holds. Then, a guy _c_ must not choose either of _d(a)_ or _d(b)_ as well.

By [conditional probability](#conditional-probability), _P(A')_ = 1 ⋅ (1 - 1/365) ⋅ (1 - 2/365) ... (1 - (n-1)/365), where _n_ is the total number of people.

According to [Taylor Series](https://en.wikipedia.org/wiki/Taylor_series) of the exponential function,

еx = 1 + x + x2/2! + .. ≈ 1 + x

Then, replace x with numbers in the _P(A')_ equation,

_P(A')_ = е-1/365 ⋅ е-2/365 .. ⋅ е-(n-1)/365 = е-(n(n-1)/2)/365

_P(A)_ = 1 - _P(A')_ ≈ 1 - е-n2/2*365, and its curve shown below:

Figure 4. The computed probability of at least two sharing the same birthday against the total number of people

Obviously, when the total number of people is 23, there is 50% chance to have at least two people ended up with same birthday; when it reaches 70, the probability is almost 100%. Then, proof ends.

[event]: https://www.mathsisfun.com/data/probability-events-types.html
[sample space]: https://en.wikipedia.org/wiki/Sample_space
[discrete-prob]: https://en.wikibooks.org/wiki/High_School_Mathematics_Extensions/Discrete_Probability
[indicator]: #indicator-random-variable

repository: biswapanda/algorithm-notes

repo_name: biswapanda/algorithm-notes


text:
# Righthand.BlazorReduxDevToolsExtension

[![NuGet](https://img.shields.io/nuget/v/Righthand.BlazorReduxDevToolsExtension.svg)](https://www.nuget.org/packages/Righthand.BlazorReduxDevToolsExtension)

This is a library that implements the interop between [Blazor](https://github.com/aspnet/Blazor) and [Redux DevTools extension](https://github.com/zalmoxisus/redux-devtools-extension). Which allows you communicating with it and use it's capabilities including time travel debugging.

Core methods are implemented. Options class is not yet implemented.

Built against Blazor 0.2.1.

Check the running application at [https://misc.rthand.com/samples/blazor-redux-devtools-extension](https://misc.rthand.com/samples/blazor-redux-devtools-extension)

## Sample usage

You find sample usage in BlazorReduxDevToolsExtensionApp application.

```csharp
@using BlazorReduxDevToolsExtension
@page "/"

<h1>ReduxDevTools Extension interop</h1>

<div>Present <b>@IsAvailable</b></div>
<div>Last Message</div>
<div>@LastMessage</div>

@functions {
    public bool IsAvailable => ReduxDevToolsExtension.IsAvailable();
    public string LastMessage { get; private set; } = "Nothing yet";

    protected override void OnInit()
    {
        if (IsAvailable)
        {
            ReduxDevToolsExtension.Connect();
            ReduxDevToolsExtension.Init(new { Tubo = 88 });
            ReduxDevToolsExtension.MessageReceived += (s, e) =>
            {
                LastMessage = e.Message;
                StateHasChanged();
            };
            ReduxDevToolsExtension.Subscribe();
            ReduxDevToolsExtension.Send(new { type = "AnAction" }, new { Tubo = 109 });
            ReduxDevToolsExtension.Send(new { type = "Another" }, new { Tubo = 504 });
            // uncomment it but put a bit of delay in between, otherwise it unsubscribes too early
            //ReduxDevToolsExtension.UnSubscribe();
            //ReduxDevToolsExtension.Disconnect();
        }
    }
}
```

repository: MihaMarkic/BlazorReduxDevToolsExtension

repo_name: MihaMarkic/BlazorReduxDevToolsExtension


text:
---
layout: post
title: "SoK conclusion"
categories: kde sok
---
My SoK journey has come to an end. It was the best learning experience ever. As the say no better way to learn than to get your hands dirty. My project, even though it was more oriented towards research, gave me hands on experience with Baloo's codebase. Looking for a better alternative to Xapian, which is after all a core part of Baloo, is no small task.

What I acomplished:
-------------------

1. Read the code for current implementation which uses the Xapian backend and figured out why it falls short for our use case. Compiled a list with Vishesh Handa [Xapaian Problems](http://community.kde.org/Baloo/XapianProblems).
2. Read Lucene's documentation and and implemented a proof of concept port of Baloo using Lucene. The code can be found [here](http://quickgit.kde.org/?p=baloo.git&a=shortlog&h=872931312156a49bcf8da76d702cefc754607952).

Outcome:
--------

We will be benchmarking the various backends (Xapian, Lucene++, custom backend - more on that later) once I iron out some minor kinks with the lucene port. While working with Lucene I realized it is plagued with some of the same problems as Xapian, namely relies on exceptions, concurrency etc. Also one of the main reason that prevents us from using Lucene is that there is no properly maintained C++ port. For my project I worked with Lucene++ which lags behind the JAVA Lucene by a major Version.(Lucene++ is 3.0.x and JAVA lucene is at 4.10.x) and the developer has no plans in catching up. So it is very unlikely we will use Lucene++ in Baloo.

What Lies Ahead:
----------------

Vishesh Handa is working on a custom solution for replacing Xapian and it is looking very promising. Now that I have gotten really familiar with Baloo's architecture maybe I can help around with that. Also I will continue contributing to KDE projects. A shout out to the wonderful KDE community which has, along with giving me an awesome Desktop Environment, has given me the power and knowledge to contribute back and help in shaping its future. Also a big thanks to my mentor Vishesh Handa who was always there to help me when I got stuck.

extension: markdown


text:
This is the GitHub repository containing the 3D models and source code for the LEET Control: https://vonkonow.com/wordpress/leet-control/

Description:

The LEET Control is a miniature MIDI accessory suitable for controlling settings in your DAW, like volume, decay or filters.
It is low cost, easy to build and compact in size. With a different firmware it can also work as an arpeggiator.

![image](/Control/leet_control.png)

The [parent project (LEET Synthesizer)](https://vonkonow.com/wordpress/leet-synthesizer/) also contains; a drum pad, chord keyboard, arpeggiator and a step sequencer, all with RGB LEDs for playback visualization.
They are easy to build and anyone with a 3D printer and basic soldering skills should be able to replicate them. Everything is open source and hacking is encouraged!

For detailed building instructions visit: https://vonkonow.com/wordpress/leet-control/

repository: jbubriski/LEET-Synthesizer

repo_name: jbubriski/LEET-Synthesizer


text:
# GitHub Trending (2022-06-28)

![](https://img.shields.io/badge/Python-New%20651-green?style=flat-square&logo=appveyor)
- [meituan/YOLOv6](https://github.com/meituan/YOLOv6): YOLOv6: a single-stage object detection framework dedicated to industrial applications.

![](https://img.shields.io/badge/Swift-New%20209-green?style=flat-square&logo=appveyor)
- [insidegui/VirtualBuddy](https://github.com/insidegui/VirtualBuddy): Virtualize macOS 12 and later on Apple Silicon

![](https://img.shields.io/badge/Python-New%20216-green?style=flat-square&logo=appveyor)
- [bregman-arie/devops-exercises](https://github.com/bregman-arie/devops-exercises): Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions

![](https://img.shields.io/badge/TypeScript-New%2043-green?style=flat-square&logo=appveyor)
- [opensumi/core](https://github.com/opensumi/core): 🚀 A framework helps you quickly build Cloud or Desktop IDE products.

![](https://img.shields.io/badge/Rust-New%20161-green?style=flat-square&logo=appveyor)
- [TheAlgorithms/Rust](https://github.com/TheAlgorithms/Rust): All Algorithms implemented in Rust

![](https://img.shields.io/badge/Java-New%20166-green?style=flat-square&logo=appveyor)
- [CatVodTVOfficial/TVBoxOSC](https://github.com/CatVodTVOfficial/TVBoxOSC): 开发阶段请不要提没有意义的PR，也不要用PR来提意见！

![](https://img.shields.io/badge/none-New%20282-green?style=flat-square&logo=appveyor)
- [edoardottt/awesome-hacker-search-engines](https://github.com/edoardottt/awesome-hacker-search-engines): A list of search engines useful during Penetration testing, vulnerability assessments, red team operations, bug bounty and more

![](https://img.shields.io/badge/Python-New%20349-green?style=flat-square&logo=appveyor)
- [Z4nzu/hackingtool](https://github.com/Z4nzu/hackingtool): ALL IN ONE Hacking Tool For Hackers

![](https://img.shields.io/badge/none-New%2036-green?style=flat-square&logo=appveyor)
- [o0HalfLife0o/TVBoxOSC](https://github.com/o0HalfLife0o/TVBoxOSC):

![](https://img.shields.io/badge/Python-New%2081-green?style=flat-square&logo=appveyor)
- [faif/python-patterns](https://github.com/faif/python-patterns): A collection of design patterns/idioms in Python

![](https://img.shields.io/badge/none-New%20187-green?style=flat-square&logo=appveyor)
- [EbookFoundation/free-programming-books](https://github.com/EbookFoundation/free-programming-books): 📚 Freely available programming books

![](https://img.shields.io/badge/Python-New%20199-green?style=flat-square&logo=appveyor)
- [public-apis/public-apis](https://github.com/public-apis/public-apis): A collective list of free APIs

![](https://img.shields.io/badge/none-New%2065-green?style=flat-square&logo=appveyor)
- [coderQuad/New-Grad-Positions-2023](https://github.com/coderQuad/New-Grad-Positions-2023): A collection of New Grad full time roles in SWE, Quant, and PM.

![](https://img.shields.io/badge/none-New%20147-green?style=flat-square&logo=appveyor)
- [practical-tutorials/project-based-learning](https://github.com/practical-tutorials/project-based-learning): Curated list of project-based tutorials

![](https://img.shields.io/badge/JavaScript-New%2043-green?style=flat-square&logo=appveyor)
- [haizlin/fe-interview](https://github.com/haizlin/fe-interview): 前端面试每日 3+1，以面试题来驱动学习，提倡每日学习与思考，每天进步一点！每天早上5点纯手工发布面试题（死磕自己，愉悦大家），5000+道前端面试题全面覆盖，HTML/CSS/JavaScript/Vue/React/Nodejs/TypeScript/ECMAScritpt/Webpack/Jquery/小程序/软技能……

![](https://img.shields.io/badge/JavaScript-New%2075-green?style=flat-square&logo=appveyor)
- [digitalocean/nginxconfig.io](https://github.com/digitalocean/nginxconfig.io): ⚙ NGINX config generator on steroids 💉

![](https://img.shields.io/badge/JavaScript-New%20100-green?style=flat-square&logo=appveyor)
- [trekhleb/javascript-algorithms](https://github.com/trekhleb/javascript-algorithms): 📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

![](https://img.shields.io/badge/JavaScript-New%2087-green?style=flat-square&logo=appveyor)
- [ascoders/weekly](https://github.com/ascoders/weekly): 前端精读周刊。帮你理解最前沿、实用的技术。

![](https://img.shields.io/badge/TypeScript-New%2031-green?style=flat-square&logo=appveyor)
- [angular/angular](https://github.com/angular/angular): The modern web developer’s platform

![](https://img.shields.io/badge/Java-New%2089-green?style=flat-square&logo=appveyor)
- [Tencent/spring-cloud-tencent](https://github.com/Tencent/spring-cloud-tencent): Spring Cloud Tencent is a Spring Boot based Service Governance Framework provided by Tencent, including service discovery, traffic control, circuitbreak, ratelimit, config and so on.

![](https://img.shields.io/badge/none-New%2065-green?style=flat-square&logo=appveyor)
- [getify/You-Dont-Know-JS](https://github.com/getify/You-Dont-Know-JS): A book series on JavaScript. @YDKJS on twitter.

![](https://img.shields.io/badge/none-New%2022-green?style=flat-square&logo=appveyor)
- [KathanP19/HowToHunt](https://github.com/KathanP19/HowToHunt): Tutorials and Things to Do while Hunting Vulnerability.

![](https://img.shields.io/badge/Go-New%2021-green?style=flat-square&logo=appveyor)
- [zinclabs/zinc](https://github.com/zinclabs/zinc): ZincSearch. A lightweight alternative to elasticsearch that requires minimal resources, written in Go.

![](https://img.shields.io/badge/Jupyter%20Notebook-New%202-green?style=flat-square&logo=appveyor)
- [Azure/azureml-examples](https://github.com/Azure/azureml-examples): Official community-driven Azure Machine Learning examples, tested with GitHub Actions.

![](https://img.shields.io/badge/none-New%2043-green?style=flat-square&logo=appveyor)
- [lydiahallie/javascript-questions](https://github.com/lydiahallie/javascript-questions): A long list of (advanced) JavaScript questions, and their explanations ✨

repository: Hsins/Daily-GitHub-Trending

gha_language: JavaScript

repo_name: Hsins/Daily-GitHub-Trending


text:
# jprefetch #

A jquery plugin for easier and more dynamic implementation of the new HTML5 prefetch attribute. For more details regarding the HTML5 prefetch I strongly recommend to read my article [HTML5 prefetching](http://phrappe.com/markup/html5-prefetching/)

## How to use it ##
Just include the plugin `<script src="js/jquery.jprefetch.js"></script>` and activate it in the document ready.

`$.jPrefetch('http://phrappe.com');`

The above code will create all the necessary code to prefetch the `http://phrappe.com` url from the supported browsers (see Browser Support section). To make the above process even more dynamic you can put the `data-prefetch="true"` attribute on any link tag for example `<a href="http://phrappe.com" data-prefetch="true">Phrappe.com</a>` and then activate the plugin **without** any parameters.

`$.jPrefetch();`

Keep in mind that the plugin will prefetch **only** the first link element that will find. This is because the overuse of prefetching can cause delays in bandwidth and it's a bad practise to have multiple pages prefetched.

## Prefetching Notes ##

The below notes on how prefetcing works are written from   [David Walsh](http://davidwalsh.name/), and more specifically at his excellent article [HTML5 Link Prefetching](http://davidwalsh.name/html5-prefetch)

- Prefetching does work across domains, including pulling cookies from those sites.
- Prefetching can throw off website statistics as the user doesn't technically visit a given page.

## Browser Support ##

Firefox and Chrome are the browsers that currently support prefetching. Chrome doesn't use the web standard way, (prefetch attribute `<link rel="prefetch" href="http://phrappe.com">`) but you can make use the non-standard prerender prerender attribute (`<link rel="prerender" href="http://phrappe.com">`). The plugin supports both versions.

## Credits ##
This jQuery plugin was inspired by these articles:

- [Mastering HTML5 Prefetching](http://www.catswhocode.com/blog/mastering-html5-prefetching)
- [Link Prefetching with HTML 5 and jQuery](http://gavinmorrice.com/blog/posts/tagged/optimization)

## License ##

MIT

repository: tsevdos/jPrefetch

repo_name: tsevdos/jPrefetch


text:
# Contributing to theinfinitytimes API

Any contribution is welcome. To contribute

1.  Fork the project
2.  Clone it
3.  Code and submit a merge request with your changes
4.  Make sure you follow the style guidelines
5.  We will review the Merge Request, leave comments, and merge it when ready

## Coding

* Run `npm run build` to build the project.

The build artifacts will be stored in the `dist/server` directory.

## Tests

### Running unit tests

Run `npm run test` to execute the unit tests via [Mocha](https://mochajs.org/).

## Style

1. Only English words allowed within the code

2. Make sure tests run successfully prior to opening a new Merge Request (MR) (If the tests in your MR are failing, the MR will not be accepted)

3. Make sure your commit message summarizes your change in 50 characters or less

4. In your Merge Request make sure you have a detailed explation of your changes. Also try wrapping all lines at 72 characters or less.

5. f the change fixes an issue, leave another blank line after the final paragraph and indicate which issue is fixed in the specific format below.

```
Fix #52
```
6. Also do your best to factor commits appropriately, i.e not too large with unrelated things in the same commit, and not too small with the same small
change applied N times in N different commits. If there was some accidental reformatting or whitespace changes during the course of your commits,
please rebase them away before submitting the MR.

repository: theinfinitytimes/theinfinitytimes-api

repo_name: theinfinitytimes/theinfinitytimes-api


text:
# MALTrends

This is a web scraper for MyAnimeList score progressions on the Wayback Machine internet archive.

The data gathered from this repo is used in another project [MALTrendsWeb](https://github.com/danielzhaotongliu/MALTrendsWeb/)

## Installation

### Prerequisites

- Make sure you have a version of `python3` and `virtualenv` installed.
See `https://virtualenv.pypa.io/en/latest/installation/` for installation instructions.

### Clone

- Clone this repo to your local machine using `https://github.com/danielzhaotongliu/MALTrends`

### First Time Setup

- Navigate to the MALTrends root directory, then run the following commands to setup virtualenv and install libraries

```shell
$ virtualenv -p python3 venv/
$ source venv/bin/activate
$ pip install -r requirements.txt
```

## Usage

### Running the Project

```shell
$ source venv/bin/activate
```

### Scrape Anime Statistics

- Before running the spiders you need the MyAnimeList anime ID for the anime that you would like to scrape for

> For example: the anime ID for Sword Art Online is 11757

- Run the following command in the MALTrends root directory

```shell
$ scrapy crawl score_spider -a id=mal_id -o snapshots_mal_id.jl
```

### Generate Interactive Time Series Graph

```shell
$ python plot.py
```

repository: danielzhaotongliu/MALTrends

repo_name: danielzhaotongliu/MALTrends


text:
# EventStore

CQRS Event Store implemented in Elixir. Uses [PostgreSQL](http://www.postgresql.org/) as the underlying storage engine.

MIT License

[![Build Status](https://travis-ci.org/slashdotdash/eventstore.svg?branch=master)](https://travis-ci.org/slashdotdash/eventstore)

## Getting started

EventStore is [available in Hex](https://hex.pm/packages/eventstore), the package can be installed as follows:

  1. Add eventstore to your list of dependencies in `mix.exs`:

    ```elixir
    def deps do
      [{:eventstore, "~> 0.0.1"}]
    end
    ```

  2. Ensure `eventstore` is started before your application:

    ```elixir
    def application do
      [applications: [:eventstore]]
    end
    ```

  3. Add an `eventstore` config entry containing the PostgreSQL connection details to each environment's mix config file (e.g. `config/dev.exs`).

    ```elixir
    config :eventstore, EventStore.Storage,
      username: "postgres",
      password: "postgres",
      database: "eventstore_dev",
      hostname: "localhost"
    ```

  4. Create the EventStore database and tables using the `mix` task

    ```
    mix event_store.create
    ```

## Sample usage

Including the `eventstore` in the applications section of `mix.exs` will ensure it is started.

```elixir
# manually start the EventStore supervisor
EventStore.Supervisor.start_link

# ... or ensure EventStore application is started
Application.ensure_all_started(:eventstore)
```

### Writing to a stream

```elixir
# create a unique identity for the stream (using the `uuid` package)
stream_uuid = UUID.uuid4()

# a new stream will be created when the expected version is zero
expected_version = 0

# list of events to persist
# - headers and payload must already be serialized to binary data (e.g. using a JSON encoder)
events = [
  %EventStore.EventData{
    event_type: "example_event",
  	headers: serialize_to_json(%{user: "someuser@example.com"}),
    payload: serialize_to_json(%ExampleEvent{key: "value"})
  }
]

# append events to stream
{:ok, events} = EventStore.append_to_stream(stream_uuid, expected_version, events)
```

### Reading from a stream

```elixir
# read all events from the stream, starting at the beginning
{:ok, recorded_events} = EventStore.read_stream_forward(stream_uuid)
```

### Subscribe to all streams

Subscriptions to a stream will guarantee at least once delivery of every persisted event. Each subscription may be independently paused, then later resumed from where it stopped.

Events are received in batches after being persisted to storage. Each batch will contain events from a single stream only.

Receipt of each event, or batch, by the subscriber is acknowledged. This allows the subscription to resume on failure without missing an event.

Subscriptions must be uniquely named and support a single subscriber. Attempting to connect two subscribers to the same subscription will return an error.

```elixir
# using an example subscriber
defmodule Subscriber do
  use GenServer

  def start_link do
    GenServer.start_link(__MODULE__, [])
  end

  def received_events(server) do
    GenServer.call(server, :received_events)
  end

  def init(events) do
    {:ok, %{events: events}}
  end

  def handle_info({:events, stream_uuid, stream_version, events}, state) do
    {:noreply, %{state | events: events ++ state.events}}
  end

  def handle_call(:received_events, _from, %{events: events} = state) do
    {:reply, events, state}
  end
end
```

```elixir
# create your subscriber
{:ok, subscriber} = Subscriber.start_link

# subscribe to events appended to all streams
{:ok, subscription} = EventStore.subscribe_to_all_streams("example_subscription", subscriber)
```

```elixir
# unsubscribe from a stream
:ok = EventStore.unsubscribe_from_all_streams("example_subscription")
```

## Benchmarking performance

Run the benchmark suite using mix with the `bench` environment, as configured in `config/bench.exs`. Logging is disabled for benchmarking.

```
MIX_ENV=bench mix do es.reset, app.start, bench
```

Example output:

```
## AppendEventsBench
append events, single writer                  100   10245.07 µs/op
append events, 10 concurrent writers           50   43855.48 µs/op
append events, 100 concurrent writers           5   444660.20 µs/op
## ReadEventsBench
read events, single reader                   1000   1983.15 µs/op
read events, 10 concurrent readers            100   12240.09 µs/op
read events, 100 concurrent readers            10   149871.40 µs/op
```

repository: stuartc/eventstore

repo_name: stuartc/eventstore


text:
-------------------------------------------------------------------------------
How to update robot software

1. Plug in Raspberry Pi.

2. Connect via FileZilla:

  Host:        <IP_ADDRESS>#  ...where # is robot number (1-4)

               <IP_ADDRESS>  ...robot 1
               <IP_ADDRESS>  ...robot 2
               <IP_ADDRESS>  ...robot 3
               <IP_ADDRESS>  ...robot 4

  Protocol:    SFTP

  Logon Type:  Normal
  User:        pi
  Pass:        cares

3. Copy one or both of the following to target, where # is robot number:

  launch-robot-#.sh
  robot-client-#.py

4. If updating the launcher script, you may have to make it executable:

  ~ $ chmod 755 launch-robot-1.sh

1.4  Shut down or reboot:

  (Use PuTTY if connecting remoting)

  ~ $ sudo shutdown -h now
  ~ $ sudo shutdown -r now

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


text:
# CSC 415 - My Shell

## Author: Piero Calenzani

    This is my shell bash coded in C for CSC415 at SFSU

## Build Instructions
    Built with 'make' command through makefile

## Run Instructions
    Run as './myshell'

repository: pcalenzani/Simple-Shell

repo_name: pcalenzani/Simple-Shell


text:
# Geo-alignment

Contacts:

* [Jan-Erik Vinje](https://github.com/janerivi)
* [Rob Smith](https://github.com/rjksmith)

The goal of this repository is to try to discuss one approach to facilitating geo-spatial AR in the context of immersive web, specifically the feasibility and utility of adding a "geoalignment" feature to the WebXR spec.

For more information about the state of this discussion, please, start with the [explainer](https://github.com/immersive-web/geo-alignment/blob/master/explainer.md) and then the issues and pull requests.

repository: immersive-web/geo-alignment

gha_language: HTML

gha_license_id: NOASSERTION

repo_name: immersive-web/geo-alignment


text:
# ci_utils

A _ git pull-request
================

Automatically check out github pull requests into their own branch.

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

Copy the script to somewhere in your ``PATH`` and make it executable.

Set github.token to your github OAUTH token
    i.e. git config --global github.token OAUTH-TOKEN

If you need Python 3 support be sure to use the ``python3`` branch.

Usage
-----

    python git-pull-request <OPTIONS> [<pull request number>]

Options
-------

    -h, --help
        Display this message and exit

    -r <repo>, --repo <repo>
        Use this github repo instead of the 'remote origin' or 'github.repo'
        git config settings. Needs to be in "user/repository" form

    -b, --base
        Use this for testing the base repository win the pull request to validate.

    -t, --token
        Use this token if you use an acces token for github.

License
=======

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

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

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

B _ Truffle Hog
================

Searches through git repositories for high entropy strings, digging deep into commit history and branches. This is effective at finding secrets accidentally committed that contain high entropy.

Example
-----
    python truffleHog.py https://github.com/dxa4481/truffleHog.git

Setup
-----

The only requirement is GitPython, which can be installed with the following

    pip install -r requirements.txt

How it works
------------

This module will go through the entire commit history of each branch, and check each diff from each commit, and evaluate the shannon entropy for both the base64 char set and hexidecimal char set for every blob of text greater than 20 characters comprised of those character sets in each diff. If at any point a high entropy string >20 characters is detected, it will print to the screen.


text:
# SESA slides

--

## Usage

*Create a slide deck*
```
touch _slides/new-slideshow.md
$EDITOR _slides/new-slideshow.md
```

## Markdown in reveal.js

Example:

``` text
# Title

* Point 1
* Point 2

> This is a quote

Note: this is a hidden speaker note

---

## Third Slide

==

## Vertical Slide 1

==

## Vertical Slide 2

```

--

## Resource

[https://github.com/hakimel/reveal.js](https://github.com/hakimel/reveal.js)

repository: SESA/slides

branch_name: refs/heads/gh-pages

gha_language: CSS

repo_name: SESA/slides


text:
# Best Practices for Making a Kubernetes Resource Bindable

## Introduction

The goals of the Service Binding Operator is to make it easier for
applications developers to bind applications with needed backing
services, without having to perform manual configuration of `secrets`,
`configmaps`, etc. and to assist operator providers in promoting and
expanding the adoption of their operators.

When a `ServiceBinding` is created the Service Binding Operator
collects binding information and shares it with application. The
Binding Service Operator's controller injects the binding information
into the application's `DeploymentConfig`, `Deployment` or `Replicaset`
as environment variables via an intermediate Secret.
The binding also works with Knative `Services` as it works with any API which has the podspec defined in the its jsonpath as
"spec.template.spec.containers".

This document provides "best practices" guidelines for the development of
Operators that manage backing services to be bound together with applications
by the Service Binding Operator.

## Making a Kubernetes Resource Bindable

In order to make backing service bindable, the Kubernetes resource representing the same needs to be annotated as a means to express what is "interesting" for applications.

Example, in an `Ingress` or `Route` resource representing a backing service, the `host` and `port` among other things would be "interesting" for applications for connecting to the backing service.

To do so, the Kubernetes resource may be annotated to meaningfully convey what is "interesting" for binding.

``` yaml
kind: Route
apiVersion: route.openshift.io/v1
metadata:
  name: example
  namespace: service-binding-demo
  annotations:
    openshift.io/host.generated: 'true'
    servicebindingoperator.redhat.io/spec.host: 'binding:env:attribute' #annotate here.
spec:
  host: example-sbo.apps.ci-ln-smyggvb-d5d6b.origin-ci-int-aws.dev.rhcloud.com
  path: /
  to:
    kind: Service
    name: example
    weight: 100
  port:
    targetPort: 80
  wildcardPolicy: None
```

## Making a Helm-Chart managed Backing Service Bindable

Resources created from a Helm Chart are treated the same way as any other Kubernetes resource. The Kubernetes resource may be annotated the way in the chart templates to denote what is "interesting" for binding.

## Making an Operator Managed Backing Service Bindable

In order to make a service bindable, the operator provider needs to express
the information needed by applications to bind with the services provided by
the operator. In other words, the operator provider must express the
information that is “interesting” to applications.

There are three methods for making Operator Managed Backing Service Bindable:

* [Operator Providing Metadata in CRD Annotations](#operator-providing-metadata-in-crd-annotations)
* [Operator Providing Metadata in OLM](#operator-providing-metadata-in-olm)
* [Operator Not Providing Metadata](#operator-not-providing-metadata)

### Operator Providing Metadata in CRD Annotations

This feature enables operator providers who do not use OLM (Operator Lifecycle
Manager) to provide metadata outside of an OLM descriptor. In this method,
the binding information is provided as annotations in the CRD of the operator
that manages the backing service. The Service Binding Operator extracts the
annotations to bind the application together with the backing service.

For example, this is a *bind-able* operator's annotations in its CRD for a
PostgreSQL database backing operator.
``` yaml
---
[...]
kind: CustomResourceDefinition
apiVersion: apiextensions.k8s.io/v1beta1
metadata:
  name: databases.postgresql.baiju.dev
  annotations:
    servicebindingoperator.redhat.io/status.dbConfigMap-host: 'binding:env:object:configmap'
    servicebindingoperator.redhat.io/status.dbCredentials-password: 'binding:env:object:secret'
    servicebindingoperator.redhat.io/status.dbCredentials-username: 'binding:env:object:secret'
    servicebindingoperator.redhat.io/status.dbName: 'binding:env:attribute'
    servicebindingoperator.redhat.io/spec.Token.private: 'binding:volumemount:secret'
spec:
  group: postgresql.baiju.dev
  version: v1alpha1
```

The following annotation indicates that the key `host` in the `configmap` referenced in `status.dbConfigMap`
is "interesting" for binding.

```
servicebindingoperator.redhat.io/status.dbConfigMap-host: 'binding:env:object:configmap'
```

Similarly, the following annotation indicates that the key `password` in the `secret` referenced in `status.dbCredentials`
is "interesting" for binding.

```
servicebindingoperator.redhat.io/status.dbCredentials-password: 'binding:env:object:secret'
```

### Operator Providing Metadata in OLM

This feature enables operator providers to specify binding information an
operator's OLM (Operator Lifecycle Manager) descriptor. The Service Binding
Operator extracts to bind the application together with the backing service.
The information may be specified in the "status" and/or "spec" section of the
OLM in plaintext or as a reference to a secret.

For example, this is a *bind-able* operator OLM Descriptor for a
PostgreSQL database backing operator.
``` yaml
---
[...]
statusDescriptors:
  description: Name of the Secret to hold the DB user and password
    displayName: DB Password Credentials
    path: dbCredentials
    x-descriptors:
      - urn:alm:descriptor:io.kubernetes:Secret
      - binding:env:object:secret:user
      - binding:env:object:secret:password
  description: Database connection IP address
    displayName: DB IP address
    path: dbConnectionIP
    x-descriptors:
      - binding:env:attribute
```

### Operator Not Providing Metadata

This feature enables operators that manage backing services but which don't
have any metadata in their CSV to use the Service Binding Operator to bind
together the service and applications. The Service Binding Operator binds all
sub-resources defined in the backing service CR by populating the binding
secret with information from Routes, Services, ConfigMaps, and Secrets owned
by the backing service CR.

[This is how resource and sub-resource relationships are set in
Kubernetes.](https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/#owners-and-dependents)

The binding is initiated by the introduction of this API option in the backing service CR:
``` yaml
detectBindingResources : true
```
When this API option is set to true, the Service Binding Operator
automatically detects Routes, Services, ConfigMaps, and Secrets owned by
the backing service CR.

## Reference Operators

Reference backing service operators are available [here.](https://github.com/operator-backing-service-samples)

A set of examples, each of which illustrates a usage scenario for the
Service Binding Operator, is being developed in parallel with the Operator.
Each example makes use of one of the reference operators and includes
instructions for deploying the reference operators to a cluster, either
through the command line or client web console UI. The examples are
available [here.](https://github.com/redhat-developer/service-binding-operator/blob/master/README.md#example-scenarios)

repository: dgpatelgit/service-binding-operator

repo_name: dgpatelgit/service-binding-operator


text:
Automating mobile gestures
==========================

While the Selenium WebDriver spec has support for certain kinds of mobile interaction, its parameters are not always easily mappable to the functionality that the underlying device automation (like UIAutomation in the case of iOS) provides. To that end, Appium augments the WebDriver spec with extra commands and parameters for mobile gestures:

* **tap** (on screen or on element) with options:
  * how many fingers
  * how long to tap
  * how many taps
  * where precisely to tap on the screen or element
* **flick** (on screen or on element) with options:
  * how many fingers
  * where to start the flick on screen or element
  * where to end the flick on screen or element
* **swipe/drag** (on screen or on element) with options:
  * how many fingers
  * how long the swipe/drag takes in seconds
  * where to start the swipe on screen or element
  * where to end the swipe on screen or element
* **scroll to** (element)
* **slider**
* **shake**
* **longTap** (element)
* set the **orientation** with option:
  * new orientation (landscape or portrait)

## JSON Wire Protocol server extensions
Here are the endpoints with which we have implemented these additions to the spec.

**Note on coordinates:** All the X and Y parameters listed below can be used in two ways. If they are between 0 and 1 (e.g., 0.5), they are taken to be percentage of screen or element size. In other words, `{x: 0.5, y: 0.25}` means a coordinate that is 50% from the left side of the screen/element, and 25% from the top of the screen/element. If the values are greater than 1, they are taken as pixels. So, `{x: 100, y: 300}` means a coordinate that is 100 pixels from the left and 300 from the top of the screen/element.

**Note on performing actions on screen vs elements:** These methods all take an optional `element` parameter. If present, this is taken to be the ID of an element which has already been retrieved. So in this case, the coordinates will be taken to refer to the rectangle of that element only. So `{x: 0.5, y: 0.5, element: '3'}` means "the exact middle point of the element with ID '3'".

* `POST session/:sessionId/touch/tap` - perform a tap on the screen or an element
    * URL Parameter: sessionId of session to route to
    * JSON parameters:
        * `tapCount` (optional, default `1`): how many times to tap
        * `touchCount` (optional, default `1`): how many fingers to tap with
        * `duration` (optional, default `0.1`): how long (in seconds) to tap
        * `x` (optional, default `0.5`): x coordinate to tap (in pixels or relative units)
        * `y` (optional, default `0.5`): y coordinate to tap (in pixels or relative units)
        * `element` (optional): ID of element to scope this command to
* `POST session:/sessionId/touch/flick_precise` - perform a flick on the screen or an element
    * URL Parameter: sessionId of session to route to
    * JSON parameters:
        * `touchCount` (optional, default `1`): how many fingers to flick with
        * `startX` (optional, default `0.5`): x coordinate where flick begins (in pixels or relative units)
        * `startY` (optional, default `0.5`): y coordinate where flick begins (in pixels or relative units)
        * `endX` (required): x coordinate where flick ends (in pixels or relative units)
        * `endY` (required): y coordinate where flick ends (in pixels or relative units)
        * `element` (optional): ID of element to scope this command to
* `POST session:/sessionId/touch/swipe` - perform a swipe/drag on the screen or an element
    * URL Parameter: sessionId of session to route to
    * JSON parameters:
        * `touchCount` (optional, default `1`): how many fingers to flick with
        * `startX` (optional, default `0.5`): x coordinate where swipe begins (in pixels or relative units)
        * `startY` (optional, default `0.5`): y coordinate where swipe begins (in pixels or relative units)
        * `endX` (required): x coordinate where swipe ends (in pixels or relative units)
        * `endY` (required): y coordinate where swipe ends (in pixels or relative units)
        * `duration` (optional, default `0.8`): time (in seconds) to spend performing the swipe/drag
        * `element` (optional): ID of element to scope this command to

**Note on setting orientation:** Setting the orientation takes different parameters than the tap, flick, and swipe methods. This action is performed by setting the orientation of the browser to "LANDSCAPE" or "PORTRAIT". The alternative access method below does not apply to setting orientation.

* `POST /session/:sessionId/orientation` - set the orientation of the browser
    * URL Parameter: sessionId of session to route to
    * JSON parameters:
        * `orientation` (required): new orientation, either "LANDSCAPE" or "PORTRAIT"

## Alternative access method
Extending the JSON Wire Protocol is great, but it means that the various WebDriver language bindings will have to implement access to these endpoints in their own way. Naturally, this will take different amounts of time depending on the project. We have instituted a way to get around this delay, by using `driver.execute()` with special parameters.

`POST session/:sessionId/execute` takes two JSON parameters:
  * `script` (usually a snippet of javascript)
  * `args` (usually an array of arguments passed to that snippet in the javascript engine)

In the case of these new mobile methods, `script` must be one of:
  * `mobile: tap`
  * `mobile: flick`
  * `mobile: swipe`
  * `mobile: scrollTo`
  * `mobile: shake`
(The `mobile:` prefix allows us to route these requests to the appropriate endpoint).

And `args` will be an array with one element: a Javascript object defining the parameters for the corresponding function. So, let's say I want to call `tap` on a certain screen position. I can do so by calling `driver.execute` with these JSON parameters:

```json
{
  "script": "mobile: tap",
  "args": [{
    "x": 0.8,
    "y": 0.4
  }]
}
```
In this example, our new `tap` method will be called with the `x` and `y` params as described above.

## Code examples
In these examples, note that the element parameter is always optional.

### Tap
* **WD.js:**

  ```js
  driver.elementsByTagName('tableCell', function(err, els) {
    var tapOpts = {
      x: 150 // in pixels from left
      , y: 30 // in pixels from top
      , element: els[4].value // the id of the element we want to tap
    };
    driver.execute("mobile: tap", [tapOpts], function(err) {
      // continue testing
    });
  });
  ```

* **Java:**

  ```java
  WebElement row = driver.findElements(By.tagName("tableCell")).get(4);
  JavascriptExecutor js = (JavascriptExecutor) driver;
  HashMap<String, Double> tapObject = new HashMap<String, Double>();
  tapObject.put("x", 150); // in pixels from left
  tapObject.put("y", 30); // in pixels from top
  tapObject.put("element", ((RemoteWebElement) row).getId()); // the id of the element we want to tap
  js.executeScript("mobile: tap", tapObject);
  ```
  ```java
  //In iOS app, if UI element visbile property is "false".
  //Using element location tap on it.
  WebElement element = wd.findElement(By.xpath("//window[1]/scrollview[1]/image[1]"));
  JavascriptExecutor js = (JavascriptExecutor) wd;
  HashMap<String, Double> tapObject = new HashMap<String, Double>();
  tapObject.put("x", (double) element.getLocation().getX());
  tapObject.put("y", (double) element.getLocation().getY());
  tapObject.put("duration", 0.1);
  js.executeScript("mobile: tap", tapObject);
  ```
* **Python:**

  ```python
  driver.execute_script("mobile: tap", {"touchCount":"1", "x":"0.9", "y":"0.8", "element":element.id})
  ```

* **Ruby:**

  ```ruby
  @driver.execute_script 'mobile: tap', :x => 150, :y => 30
  ```

* **Ruby:**

  ```ruby
  b = @driver.find_element :name, 'Sign In'
  @driver.execute_script 'mobile: tap', :element => b.ref
  ```

* **C#:**

  ```C#
  Dictionary<String, Double> coords = new Dictionary<string, double>();
  coords.Add("x", 12);
  coords.Add("y", 12);
  driver.ExecuteScript("mobile: tap", coords);
  ```

### Flick

* **WD.js:**

  ```js
  // options for a 2-finger flick from the center of the screen to the top left
  var flickOpts = {
    endX: 0
    , endY: 0
    , touchCount: 2
  };
  driver.execute("mobile: flick", [flickOpts], function(err) {
    // continue testing
  });
  ```

* **Java:**

  ```java
  JavascriptExecutor js = (JavascriptExecutor) driver;
  HashMap<String, Double> flickObject = new HashMap<String, Double>();
  flickObject.put("endX", 0);
  flickObject.put("endY", 0);
  flickObject.put("touchCount", 2);
  js.executeScript("mobile: flick", flickObject);
  ```

### Swipe

* **WD.js:**

  ```js
  // options for a slow swipe from the right edge of the screen to the left
  var swipeOpts = {
    startX: 0.95
    , startY: 0.5
    , endX: 0.05
    , endY: 0.5
    , duration: 1.8
  };
  driver.execute("mobile: swipe", [swipeOpts], function(err) {
    // continue testing
  });
  ```

* **Java:**

  ```java
  JavascriptExecutor js = (JavascriptExecutor) driver;
  HashMap<String, Double> swipeObject = new HashMap<String, Double>();
  swipeObject.put("startX", 0.95);
  swipeObject.put("startY", 0.5);
  swipeObject.put("endX", 0.05);
  swipeObject.put("endY", 0.5);
  swipeObject.put("duration", 1.8);
  js.executeScript("mobile: swipe", swipeObject);
  ```

### Slider

 * **Java**

  ```java
  // slider values can be string representations of numbers between 0 and 1
  // e.g., "0.1" is 10%, "1.0" is 100%
  WebElement slider =  wd.findElement(By.xpath("//window[1]/slider[1]"));
  slider.sendKeys("0.1");
  ```

### Set orientation

* **WD.js:**
  ```js
  driver.setOrientation("LANDSCAPE", function(err) {
    // continue testing
  });
  ```

* **Python:**
  ```python
  driver.orientation = "LANDSCAPE"
  ```

### Scroll To

```ruby
  b = @driver.find_element :name, 'Sign In'
  @driver.execute_script 'mobile: scrollTo', :element => b.ref
```

### longTap

 * **c#**

  ```c#
  // long tap an element
  //
  Dictionary<string, object> parameters = new Dictionary<string, object>();
  parameters.Add("using", _attributeType);
  parameters.Add("value", _attribute);
  Response response = rm.executescript(DriverCommand.FindElement, parameters);
  Dictionary<string, object> elementDictionary = response.Value as Dictionary<string, object>;
  string id = null;
  if (elementDictionary != null)
  {
     id = (string)elementDictionary["ELEMENT"];
  }
  IJavaScriptExecutor js = (IJavaScriptExecutor)remoteDriver;
  Dictionary<String, String> longTapObject = new Dictionary<String, String>();
  longTapObject.Add("element", id);
  js.ExecuteScript("mobile: longClick", longTapObject);
  ```

repository: rectalogic/appium

repo_name: rectalogic/appium