text:
# ownCloud config sample to AsciiDoc converter

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c5e375e4b4af47238dcb8fc234960da4)](https://www.codacy.com/app/settermjd/ownCloud-config-converter?utm_source=github.com&utm_medium=referral&utm_content=settermjd/ownCloud-config-converter&utm_campaign=Badge_Grade)

Both, `config.sample.php` and `config.apps.sample.php` have their home in core and are written as pure php samples. To use these samples for the owncloud documentation, you need to convert them to an `.adoc` file usable in docs. This repo supports the conversion to an .adoc file by providing an automatism for this  process.

**Note:** It is necessary to run this command always for both files `config.sample.php` and `config.apps.sampe.php`

**Note:** You will find the latest version of the source files to convert in https://github.com/owncloud/core/tree/master/config

## Requirements

Install the dependencies with `composer`:

	composer update

## Rules

Currently this relies on the following rules

 * The main files are always in core. Any changes must be done there. Config sample changes made in docs will be overwritten by the next `config-to-docs` run
 * On any changes made to a config sample file in core, you *MUST* run `make test-php-style-fix` to check if changes made fulfill the php requirements
 * Each config sample file in core must start with `<?php`, a first comment block describing general rules for this file embedded in `/**` ` */` and the main array `$CONFIG = [];`
 * All configs have to be written inside the brackets of `$CONFIG = [];`
 * If not already present in docs, you have to have for each config file one with a predefined header content. This content is reused as descriptive content on each run and is not replaced by the conversion process. The header follows the asciidoc style and is a necessary part of the rendering process
 * All text added by the conversion process will be added *below* the `// header end do not delete or edit this line` line. Existing content will always be replaced.
 * Changes to the header can be part of a `config-to-docs` run, but mast be made manually.
 * Each config section must have exact one descriptive comment block for the config and directly following at minimum one or more comment blocks describing the key/value and a uncommented line with the key/value itself. `key/value` must follow php syntax.
 * If you have multiple keys for the same comment section, separate them with a blank line, which is necessary for the documentation generation process.
 * The first text line in the first comment block of a config section is used as text for the table of contents. Write brief and carefully
 * Use RST syntax in comment lines
 * Use examples of the current config files to add new ones.

## General Command

The command has the following structure.

```
convert.php [options] [arguments]
```

For a detailed list of arguments and options, use `--help`.

## How to use

To ease the conversion process, the following steps / prerequisites should be taken:

 * You have cloned `core`, `docs` and the `config-to-docs` repo locally, into the same base directory
 * `core`: the master branch should be checked out, containing the latest merged sample files
 * `docs`: you have created a new branch based on an updated master, this branch will contain all changes that will be pushed to docs
 * `config-to-docs`: you have changed into the root of this directory and are ready to run the commands

Use the following commands for each sample file, or the prepared script `./ctd.sh` which runs both commands below and reminds you about the prerequisites.

```
php convert.php config:convert-adoc \
  --input-file=../core/config/config.sample.php \
  --output-file=../docs/modules/admin_manual/pages/configuration/server/config_sample_php_parameters.adoc

php convert.php config:convert-adoc \
  --input-file=../core/config/config.apps.sample.php \
  --output-file=../docs/modules/admin_manual/pages/configuration/server/config_apps_sample_php_parameters.adoc
```

## Advice

When doing changes in the core config sample files or when changes have been already made, regulary do a `config-to-docs` run to check the result. Check the result of the converted file in docs via the browser having an asciidoc previewer enabled. When satisfied, mandatory run in core `make test-php-style-fix`, fix any problems that might raise and recheck the result in the browser. Changes made in core must be merged *before* changes are pushed to docs. When final, push the changes to docs and create a PR.

## License

The MIT License (MIT)

Copyright (c) 2014 Morris Jobke<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.

repository: owncloud/config-to-docs

repo_name: owncloud/config-to-docs


text:
# exec-notifier

This is a command line utility to execute commands and get
a feedback notification on the exit status of the notification
of the command.

## Install

In order to install this utility, you need [Node.js][node-homepage].
To install it globally, execute the following command:

	npm install -g exec-notify

## Usage

To use this command, simply time `node-exec command`. If the command
returns with a normal exit code, a success notification will pop-up in
your screen:

	exec-notify echo Success! # -> Success notification

However, if the command fails for some reason, you will receive a failure
notification:

	exec-notify "echo Failure... && false" # -> Failure notification

## Using with your project

Suppose you are developing a Node.js application and you want to get
a notification when your deploy is completed. You can use `exec-notify`
in an `npm script` so that you get a notification of your deploy with
a success or error message.

In order to do this, install `exec-notify` as a development dependency
in your project (so whoever clones the source code can get notifications
as well)

	npm install --save-dev exec-notify

The, include a new entry in the [scripts][scripts-documentation] session of your `package.json`.

	"scripts": {
		"deploy": "exec-notify echo Deploying app",
		// ...

## Supported Systems

This package uses the excellent [Node Notifier][node-notifier-homepage]. So theorically, Windows, GNU-Linux and Mac OS X are supported. In case you have problems, open an issue so I can take a look.

## Credits

Thanks to:
* @mikaelbr for maintaining [Node Notifier][node-notifier-homepage].
* Custom Icon Design for creating the [Success icon][success-icon-homepage].
* Martz90 for creating the [Warning icon][warning-icon-homepage]

[node-homepage]: https://nodejs.org/en/
[scripts-documentation]: https://docs.npmjs.com/misc/scripts
[node-notifier-homepage]: https://github.com/mikaelbr/node-notifier
[success-icon-homepage]: http://www.iconarchive.com/show/flatastic-2-icons-by-custom-icon-design/success-icon.html
[warning-icon-homepage]: http://www.iconarchive.com/show/circle-addon2-icons-by-martz90/warning-icon.html

repository: sujumayas/yawar-fighters-web

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: sujumayas/yawar-fighters-web


text:
sinon-restore
=============

This package simply adds restoreAll() to sinon.

Usage:
```
var sinon = require('sinon-restore');
// use sinon as usual

// restore all fakes when ready...
sinon.restoreAll()
```

sinon also has sandboxing (http://sinonjs.org/docs/#sandbox)
which also solves this problem, but I personally didn't like
the syntax.

repository: Virtureality/wvr

detected_licenses: MIT Apache-2.0 ISC

gha_license_id: NOASSERTION

repo_name: Virtureality/wvr


text:
# Shaders and More

## ...Why?
- Fun
- New developers can learn
- Coping mechanism
- **Goals**
  - Flow vectors

## Shader Descriptions
- (!) : Original shader
- (+) : Shaders I made for people who want to learn shaders
- (k) : [keijiro](https://github.com/keijiro) ports
- (~) : Shaders I modified as what-ifs

Name|Description
----|-----------
cAbberation     (+) | Chromatic abberation using vertex shader offset
cAutoExposure   (+) | 2-pass automatic exposure
cBloom          (!) | Dual-filtering bloom
cBlur           (!) | Blur approximation using vogel disks
cCAS            (~) | SweetFX's CAS but using vertex shader as offset
cColorBlendOp   (+) | Blend to backbuffer without copying textures
cDatamosh       (!) | Simulates video compression artifacts
cDMipmap        (+) | Dumb difference of gaussians using mipmaps
cFilmGrain      (+) | Film grain without copying texture
cFrameBlending  (+) | Frame blending using the previous result
cInterpolate    (!) | Optical flow frame blending
cLetterBox      (+) | LetterBox without copying textures
cLuminance      (+) | Simple greyscale comparison
cMotionBlur     (!) | Optical flow motion blur
cOpticalFlow    (!) | Horn-Schunck optical flow without weighted average
cScale          (+) | Buffer scaling using vertex shaders
cShard          (+) | Simple unmask sharpening filter
cSMAA           (~) | Minimalist version of SMAA, medium setting
cTonemap        (~) | Watch Dog's tonemapping with gamma correction
cWarping        (!) | Optical flow distortion
kContour        (k) | Contour line effect
kDatamosh       (k) | Simulates video compression artifacts
kMirror         (k) | Mirroring and kaleidoscope effect
kVignette       (k) | Natural vignetting effect

license: MIT

repository: Lywrith/reshaders

repo_name: Lywrith/reshaders


text:
# Eusynaptomyces benjaminii Scheloske, 1976 SPECIES

#### Status
ACCEPTED

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

#### Published in
Pl. Syst. Evol. 126(3): 268 (1976)

#### Original name
Eusynaptomyces benjaminii Scheloske, 1976

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
Heading
=======
Sub-heading
-----------
Paragraphs are separated
by a blank line.

> This is a reference section

Text attributes *italic*,
**bold**, `monospace`.

A [link](http://example.com).

---

Shopping list:

  * apples
  * oranges
  * pears

Numbered list:

  1. apples
  1. oranges
  1. pears

repository: xuender/MdText

repo_name: xuender/MdText


text:
# FIE Scraper Documentation

## Introduction
FIE-Scraper is a Web Scraper designed to scrape the data of all International Fencing Federation (FIE) athletes from the [FIE website](https://fie.org/athletes) and stores that data into a .csv file

## Description of Equipment
### Requirements
* Python 3.8
* Firefox version 60 or higher
* FIE-Scraper file
  + Go to the [FIE Scraper GitHub](https://github.com/CMEdwards22/FIE-Scraper)
  + Click Code > download ZIP
   ![downloadImage](https://user-images.githubusercontent.com/69873090/125885155-3006eb00-3413-46cf-a557-a9031765f018.png)
  + Extract FIE-Scraper-main.zip
* An IDE to run a .py file
  + PyCharm Community edition or PyCharm Professional editon are the recommeded IDEs for this program however any IDE will work
  + You can download PyCharm [here](https://www.jetbrains.com/pycharm/download/#section=windows)
  + Alternatively if you are using a linux system, you can run the program by navigating to the FIE-Scraper directory and running the command ```python3 main.py ```

## Directions
* Move into FIE-Scraper-main directory
  + If you are using PyCharm, click Open then select the FIE-Scraper-main folder
  + To run, right click on main.py > Run 'main'
  + ![runMainExampleSelected](https://user-images.githubusercontent.com/69873090/126588277-b01ab5c6-ee3a-4dd8-a18c-bf865b002ac6.png)
* Run main.py
  + This will open a firefox browser That should look similar to the one below. DO NOT CLOSE, TYPE IN, OR CLICK ON ANYTHING IN THIS BROWSER.
  ![BrowserExample](https://user-images.githubusercontent.com/69873090/125885824-7fdb3bb2-da2d-4817-9100-3fb8492dd85c.png)
  + Wait until the program fully runs through all pages on the browser. This process will take around 10+ minutes
  + Once the program is finished running, the browser will automatically close.
* Once the program is finished running there will be a fencer_data.csv found inside the FIE-Scraper-main directory containing the rank, number of points, name, country the fencer is representing (abbreviated down to three letters), if the fencer is left or right handed, age, weapon, and gender of every individual senior fencer registered in the FIE for the current year.

## FAQs
### Can I move/delete the fencer_data.csv?
Yes, the fencer_data.csv file can be moved, deleted, or modified safely once the program is finished running.
### Can I run this program multiple times?
Yes, if there is currently a fencer_data.csv file in the directory then it will be overwritten with the new one but otherwise will create a new fencer_data.csv file.

## Support
If you need support then contact the developer at<EMAIL_ADDRESS>
## Licensing
[MIT](https://choosealicense.com/licenses/mit/)

branch_name: refs/heads/main


text:
# Delegation By Annotations

Ah, the joy of software design. In this tutorial, I will provide a concise guide on how to convert a template or strategy based design into an implementation driven by annotations. Similar and more advanced concepts could be found in an implementation of JEE CDI or any other popular frameworks like Spring. If you are not familiar with design patterns, I encourage you to pick up the catalog of design patterns classic by gang of four.

## Delegation

Delegation as a concept is not exclusive to software. On the contrary, we use delegation as a tool in our daily routines without giving too much thought about it. To better understand delegation as a philosophy or school of though, we first need to understand the context of execution as opposed to the specifics of execution.

## Traveling Task

Let us say, that someone needs to get from point A to B in a timely manner. The answer to this challenge is location and speed. You need to know the location of B and you need to get there relatively fast. So the context of executing the task at hand is distance and velocity. Up to this point we have not mentioned the specifics of execution which is how to locate and travel to point B. You can locate B using a map which leads to proper calculation of distance. After calculating the distance, you can calculate the velocity on which you need to travel to point B and hence determine your selection of transportation.

### Inhertience v Composition

Now let's propose a solution for the above challenge. First, the context of execution is the travel method which consists of two operations calculate distance and calculate time.

```java
	// Delegation by inheritence
	public Long travel(Point a, Point b){

		Double distance = calculateDistance(a, b);

		return calculateTime(distance);

	}

	protected abstract Long calculateTime(Double distance);

	protected abstract  Double calculateDistance(Point a, Point b);
```
Both of calculate time and distance are template methods. Template design pattern is a form of delegation by inhetitence. Delegation by inheritence postpones the implementation until its picked up by one of the subclasses of the execution context. Here is another solution to the same problem, let us create two interfaces each of which corresponds to one of the template methods as follows:

```java
public interface Locator {
	public Double calculateDistance(Point a, Point b);
}

public interface Transportation {
	public Long calculateTime(Double distance);
}
```

and then we could change the travel method to depend on the two interfaces as follows:

```java
	// Delegation by composition
	public Long travel(Point a, Point b){

		Double distance = locator.calculateDistance(a, b);

		return transport.calculateTime(distance);
	}
```

Both locator and vehicle is an application of the strategy design pattern. The startegy design pattern is a form of delegation by composition. As you can see both of calculate distance and time are moved to its respective interfaces.

Delegation by composition is more prefered to delegation by inheritence due to the flexability provided by dependency injection. Dependency injection allwos you to inject different implementations to the same refernce at runtime based on the configurations of the system. We have many options from which we can select a vehicle implemenation like a bicycle, a car or a train. We also have different selections of locating tools like a paper or computer based map.

```java
	public enum Vehicle{
		BICYCLE(), CAR(), TRAIN();
	}

	public enum MAP{
		PAPER(), COMPUTERIZED();
	}
```
We can tweak our execution context to cache the available implementations of the delegate references and allow the caller to decide which implementation to use at runtime.

```java
	public Long travel(Point a, Point b, Vehicle vehicle, MAP map){

		Locator locator = locators.get(map);

		if(locator == null)
			throw new RuntimeException("Unsupported locator");

		Transportation transport = vehicles.get(vehicle);

		if(transport == null)
			throw new RuntimeException("Unsupported transport");

		Double distance = locator.calculateDistance(a, b);

		return transport.calculateTime(distance);
	}
```
Up to this point we have three aspects to consider:
- Execution context where a finer grained tasks is oragnized to solve a problem.
- Delegates that provide an implementation for the finer grained tasks.
- Execution configuration which chooses between delegate implementation alternates.

## Using Annotations
As flexible as the above exmaple is, you have to do different things in order to introduce new functionality inside the system. For exmaple, you have to implement a new Locator or Transportation and add it to the traveling task. It may sound easy for such a trivial system but for more complex systems it may pose some sort of a challenge. It might be easier if we just could find a mechanism to introduce a new functionality without going through all these steps.

We could leverage annotations as a reference point of delegation on any method without resorting to implementing any interfaces.
```java
class AnnotatedEntity {

	 @TransportationVehicle(vehicle=Vehicle.CAR)
	    public Long someMethod(Double distance){
		 	System.out.println("Calculating Time");
	        return 0L;
	    }

	    @MapLocator(map=MAP.COMPUTERIZED)
	    public Double someOtherMethod(Point a, Point b){
	        System.out.println("Calculating Distance");
	        return 0D;
	    }
}
```
And then register whatever entity which is using the delegate annotation with the delegator like this

```java
AnnotatedEntity someAnnotatedEntity = new AnnotatedEntity();
TravelingTask travelingTask = new TravelingTask();
travelingTask.registerDelegate(someAnnotatedEntity);
```
That it! we could leave the heavy lifting to be taken care of by the delegator. Such as registering the delegate and finding the right methods to call at runtime.

The rest of this tutorial, I will explain how to implement delegation by annotation. The proposed solution should be taken as a refernece and not as a fully fledged solution.

## Delegation Principal

A delegation principal applies validation rules on any arbitrary method assigned with a certain annotation, in case of being a good match it registers that particular method with the delgator as a future execution refernce. Taking into account that the delegate interface should at least declare one method with a Delegate annotation. Now, let us look at some sequence diagrams that explains how a delegation principal works.

### Definition

```java
// D -> Any arbitrary delegate, A -> Any annotation type.
abstract class DelegationPrincipal<D, A extends Annotation> {

	private Class<A> annotationClass;

	// Delegation agent should register the delegate with the delegator class
	private DelegationAgent<D, A> delegationAgent;

	// Signature of delegate method.
	private Class<?> returnType;
	private Class<?>[] parameters;
```

### Creation

![create delegation principal](https://cloud.githubusercontent.com/assets/6278849/7410334/1be9d0d0-ef2e-11e4-9652-1a23fae3fd49.jpg)

```java
	public DelegationPrincipal(
			Class<D> delegateClass,
			Class<A> annotationClass,
			DelegationAgent<D, A> delegationAgent) {

		this.annotationClass = annotationClass;
		this.delegationAgent = delegationAgent;

		// Use delegate class to find a method annotated with Delegate annotation
		Method delegateMethod = findDelegateMethod(delegateClass);

		this.returnType = delegateMethod.getReturnType();
		this.parameters = delegateMethod.getParameterTypes();
	}

	private Method findDelegateMethod(Class<D> delegateClass) {

		Method delegateMethod = null;

		for(Method method : delegateClass.getMethods()){
			if(method.getAnnotation(Delegate.class) != null){
				delegateMethod = method;
				break;
			}
		}

		if(delegateMethod == null)
			throw new RuntimeException("Could find any method annotated with delegate");

		return delegateMethod;
	}
```
### Apply
![apply](https://cloud.githubusercontent.com/assets/6278849/7410720/d40f464c-ef31-11e4-96f8-a41b4a54f114.jpg)

```java
	public void apply(Object receiver, Method target){

		// find the if method is assigned with target annotation.
		A annotation = getTargetAnnotation(target);

		if(annotation != null ){

			// checks against method signature to gurantee full match
			// throws runtime exception in case of failure
			isMethodValid(target, annotation);

			// Returns an instance of delegate class,
			// apply is a template method and
			// should be implemented by child classes
			D delegate = apply(receiver, target, annotation);

			// Delegation agent should be aware of how to register with the delegator
			delegationAgent.register(annotation, delegate);
		}

	protected abstract D apply(Object receiver, Method target, A annotation);

	}
```

## Implementing Principals
The following code snippets explain how to extend delegation principal in order to create two new principals one for the Transportation interface and another one for the Locator.

### Locator

Start with the annotation

```java
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface MapLocator {
	MAP map();
}
```
Add @Delegate annotation to calculateDistance as follows
```java
	@Delegate
	public Double calculateDistance(Point a, Point b);
```
Now, create the LocatorPrincipal class

```java

// D -> Locator and A -> MapLocator annotation.
class LocatorPrincipal extends DelegationPrincipal<Locator, MapLocator> {

	public LocatorPrincipal(Class<Locator> delegateClass,
			Class<MapLocator> annotationClass,
			DelegationAgent<Locator, MapLocator> delegationAgent) {

		super(delegateClass, annotationClass, delegationAgent);
	}

	@Override
	protected Locator apply(final Object receiver, final Method target,
			final MapLocator annotation) {

		// Create new locator delegate instance to register with the delgator class.
		return new Locator() {

			public Double calculateDistance(Point a, Point b) {

				try {
					// invoke target method to calculate the distance
					return (Double) target.invoke(receiver, a, b);

				} catch (Exception e) {

					throw new RuntimeException(annotation.map() + " locator failed", e);
				}
			}
		};
	}
}
```

### Transportation

Again, Start with the annotation

```java
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface TransportationVehicle {
	Vehicle vehicle();
}
```

Add @Delegate annotation to calculateTime as follows

```java
	@Delegate
	public Long calculateTime(Double distance);
```

Now, create the TransportationPrincipal class

```java
// D -> Transportation, A -> TransportationVehicle annotation.
class TransportationPrincipal extends DelegationPrincipal<Transportation, TransportationVehicle> {

	public TransportationPrincipal(
			Class<Transportation> delegateClass,
			Class<TransportationVehicle> annotationClass,
			DelegationAgent<Transportation, TransportationVehicle> delegationAgent) {

		super(delegateClass, annotationClass, delegationAgent);
	}

	@Override
	protected Transportation apply(final Object receiver, final Method target,
			final TransportationVehicle annotation) {

		return new Transportation() {

			public Long calculateTime(Double distance) {

				try {

					// invoke time calculation method
					return (Long) target.invoke(receiver, distance);

				} catch (Exception e) {

				throw new RuntimeException(annotation.vehicle() +  " transportation delegate has failed", e);

				}
			}
		};
	}

}
```

## Traveling Task Revisted

Now, let us implement the delegation agents and registerDelegate method inside the TravelingTask. The follwoing code snippet shows selected parts of the TravelingTask.

### Creation

![sequence diagram1](https://cloud.githubusercontent.com/assets/6278849/7411972/cd39fa18-ef3d-11e4-85fa-69cea98c2b01.jpg)

```java
class TravellingTask {

	// Create inner DelegationAgent class to register a transportation delegate
	private DelegationAgent<Transportation, TransportationVehicle> transportationAgent = new DelegationAgent<Transportation, TransportationVehicle>() {

		// This method should be called by TransporationPrincipal class while
		// applying the prinicipal to the traveling task
		public void register(TransportationVehicle annotation,
				Transportation delegate) {

			addVehicle(annotation.vehicle(), delegate);
		}
	};

	// Create inner DelegationAgent class to register a locator delegate
	private DelegationAgent<Locator, MapLocator> locatorAgent = new DelegationAgent<Locator, MapLocator>() {

		// This method should be called by LocatorPrincipal class while
		// applying the prinicipal to the traveling task
		public void register(MapLocator annotation, Locator delegate) {

			addLocator(annotation.map(), delegate);
		}
	};

	private HashMap<Vehicle, Transportation> vehicles;
	private HashMap<MAP, Locator> locators;

	private LocatorPrincipal locatorPrincipal;
	private TransportationPrincipal transportationPrincipal;

	public TravellingTask() {

		locators = new HashMap<TravellingTask.MAP, Locator>();

		vehicles = new HashMap<TravellingTask.Vehicle, Transportation>();

		// Instantiate the locator principal using inner locator agent class
		locatorPrincipal = new LocatorPrincipal(Locator.class, MapLocator.class, locatorAgent);

		// Instantiate the transportation principal using inner transportation agent class
		transportationPrincipal = new TransportationPrincipal(Transportation.class, TransportationVehicle.class, transportationAgent);
	}
}
```
Finally, here is register delegate method which includes the big picture of how the whole thing works.

![sequence diagram2](https://cloud.githubusercontent.com/assets/6278849/7412240/f4b3f5d2-ef40-11e4-9f03-0f45a75b933a.jpg)

```java
	public void registerDelegate(Object receiver){

		for(Method method : receiver.getClass().getMethods()){

			locatorPrincipal.apply(receiver, method);

			transportationPrincipal.apply(receiver, method);

		}

	}
```

Checkout the test suite within the source code to see a working example.

## Conclusion
Delegation by annotations has it own merits, best one yet is the client code simplicity. It might fall short when the delegate is complex to create, manage and/or configure.

repository: webnotgeek/delegationbyannotations

repo_name: webnotgeek/delegationbyannotations


text:
# MapReduce

`python setup.py install --record files.txt` - to install the lib (files.txt for removing it then)

* `mr --start-master host port` - start master
* `mr --start-slave port master-host master-port size-limit` - start slave
* `mr --write cluster_path` - write data
* `mr --read cluster_path` - read table
* `mr --delete cluster_path` - remove table
* `mr --list-dir cluster_path` - get everything inside cluster (just checking common prefix)
* `mr --map path_in path_out run_command file1 … filen` - run mapper -> results in operation id
* `mr --list-operations` - empty
* `mr --table-info cluster_path` - table info: total size (in chars) + how many nodes it is distributed among

# Things to pay attention

- `/free_space/` - this folder is for saving files sent to perform map, can be changed :(in the code): in `mr/slave/file_manager.py`


text:
---
title: "Transitions"
layout: single
excerpt: "UI-Router Transition Guide"

sitemap: true
permalink: /guide/transitions
---

{% include toc icon="columns" title="Transitions" %}

This guide provides a conceptual overview to state transitions in UI-Router.

---

# Transition overview

UI-Router applications behave like a state machine.
Each part of the application (i.e., each route or page) is represented by an application state.
Only one state can be active at a time.
The user changes the active state by following links, clicking on buttons, using the back button, etc.

Switching between "Hello" and "About" states by clicking links.  The state visualizer (right) shows the active state.

The process of changing application states is called a **Transition**.
The state machine _transitions_ from one state to another.
{: .notice--info}

### From state/to state

Each Transition has a _from state_ (the state that was previously active) and a _to state_ (the state being activated).

Clicking the 'About' link starts a transition _from_ the 'hello' state _to_ the 'about' state.

UI-Router provides a `Transition` object which represents a transition.
Access the to and from states using `Transition.to()` and `Transition.from()`.
{: .notice--info}

### Exiting and entering

During the transition from 'Hello' to 'About', the 'Hello' state is _exited_, and the 'About' state is _entered_.

The transition exits 'Hello' and enters 'About'.

Access the entering and exiting states using `Transition.entering()` and `Transition.exiting()`.
{: .notice--info}

Exiting or entering a state is a lifecycle event and will be covered later.

### Param value changes

A transition also occurs when a parameter value changes, _even if the to and from states are the same_.
Each parameter is defined on a specific state.
When a state's parameter value changes, the state is exited and then re-entered.

When the 'jane' link is clicked, the Transition exits the 'person' state
                then re-enters the 'person' state with the `name` parameter value equal to `jane`.

Access the new and previous parameter values using `Transition.params('to')` and `Transition.params('from')`.
{: .notice--info}

### Nested states

Applications aren't limited to a flat list of states.
Instead, they often define child states creating a hierarchy of nested states.

When a parent state is active and the user navigates to a child state, a Transition from the parent state to the child starts.
Because the parent state was already entered, it is not entered a second time.
Instead, the parent state is _retained_ (it was previously entered and is still entered).
The child state then becomes the active state.

When the link is clicked, a Transition from 'people' to the nested 'person' state starts.
                The transition enters the 'person' state.
                The 'people' state is retained.

If the child state is active, and the user navigates to the parent state, a Transition occurs from the child to the parent state.
The child state is exited and the parent state becomes the active state.
Because the parent state was already entered, it is _retained_ (not entered a second time).

The active state moves between 'people' and 'person'.
     The parent state ('people') is retained, while the child state ('person') is entered and exited.

Access the retained states using `Transition.retained()`.
{: .notice--info}

A single Transition may enter (or exit) multiple nested states.
If the "to state" of the Transition is a nested state whose parent is not already active, then:

- The parent is entered
- The child (the to state) is entered
- The child (the to state) becomes the active state

In the same way, when a transition _from_ the nested child state to a sibling of the parent state occurs:

- The child is exited
- The parent is exited
- The sibling of the parent (the to state) is entered
- The sibling of the parent becomes the active state

Multiple states being entered or exited during each Transition

### Transition Triggers

A transition occurs any time the application state changes, or when any parameter values change.
This could be triggered in a variety of ways:

- A `UISref` link was clicked
- `StateService.go()` was called programmatically
- The URL changed
  - The application has just started, and the initial URL is being processed
  - The back or forward button was clicked
  - The user manually changed the URL in the browser location bar
  - (In some cases) an anchor tag with an `href` was clicked

# Transition Lifecycle

A transition can perform asynchronous operations such as fetching data or accessing back-end APIs.
Because of this, a transition should be considered a long running operation.

### Lifecycle events

A transition has lifecycle events, from creation to completion.
Those events are:

- **Create**: The transition is being created
- **Before**: The transition is about to start
- **Start**: The transition has started
- **Exit**: (state events) Any exiting states are exited
- **Retain**: (state events) Any retained states are retained
- **Enter**: (state events) Any entering states are entered
- **Finish**: The transition is about to finish
- **Success**/**Error**: The transition is finished and is either successful or errored.

The lifecycle of a Transition

### Atomicity

Transitions between states should be considered atomic.
A transition will either fully succeed, or fail entirely.

Although transitions may take a long time to process,
the current state remains unchanged _until after the transition succeeds_.

Transition from state 'A' to 'B'

If a transition from state 'A' to state 'B' errors, the current state remains unchanged as state 'A'.

Failed Transition from state 'A' to 'B'

Only one transition can run at a time.
If a previous transition is still running _when a new transition_ starts, the router aborts the previous transition.
The new transition *supersedes* the previous transition.
The previous transition errors with a `Transition Superseded` error.

Transition #2 supersedes Transition #1

If a transition to the *current state and parameters* is attempted, the router ignores the transition attempt.
This might happen, e.g., when the user clicks a link to the currently activated state.

Transition to current state ignored

If a transition is running and another transition to the same target state and parameters is attempted, the router ignores the second attempt.
This might happen, e.g., when the user clicks a link twice, but the first transition has not yet completed.

Duplicate transition ignored

# Transition Hooks

Transition hooks allow you to tap into each of the lifecycle events using callbacks.
Learn more in the [Transition Hooks guide](transitionhooks).

path: /_guide/004. transitions.md

filename: 004. transitions.md

gha_language: HTML

gha_license_id: MIT


text:
# Add Into Existing Project

If you don't have any code yet, please consider checking Angular CLI documentation for help creating your app.
In case you want to start based on our ngx-admin starter kit, please check out [Based on Starter Kit (ngx-admin)](#/docs/guides/install-based-on-starter-kit) article.

ngx-admin custom components

    Please note, this tutorial explains how to install Nebular modules into your project including Theme System, Auth and UI Kit.
    If you want to re-use any of ngx-admin custom components (like Temperature Widget, Dashboard charts, etc) without using ngx-admin itself,
    please follow this guide and in the end just copy any of ngx-admin custom components you need into your project, register them in your modules and that's it.

## Installing dependencies
At this step, we assume you already have Angular modules installed. Now let's install Angular Bootstrap which is the only peer dependency left:

```bash
npm i -S bootstrap
```

## Install Nebular modules

```bash
npm i -S @nebular/theme @nebular/auth @nebular/security
```
You can remove `@nebular/auth` and `@nebular/security` from the command if you don't need authentication/security parts in your project.

## Configure Nebular

At this stage you have everything in place, let's configure Nebular in the app module.

```ts

import { NbThemeModule } from '@nebular/theme';

...

@NgModule({
  imports: [
    ...
    NbThemeModule.forRoot({ name: 'default' }), // this will enable the default theme, you can change this to `cosmic` to enable the dark theme
  ]
})
export class AppModule {

```
Same way you can enable Auth Module (more details under [Auth Module Concepts & Install](#/docs/auth/conceptsinstall) article).

## Install Styles
Now, let's import Nebular styles

Include Bootstrap and default Nebular theme CSS files into your `.angular-cli.json` file:

```scss
"styles": [
  "../node_modules/bootstrap/dist/css/bootstrap.css",
<EMAIL_ADDRESS>// or cosmic.css
],
```

Advanced Theme System configuration

    In this article we describe the very basic styles installation. If you need more advanced features, like theme variables management,
    or even multiple themes switching - check out Enabling Theme System article.

## Create a page

Now, let's create a simple Nebular page (header + sidebar) in your project. We assume that you have a separate module per page, let's open your `some-page.module.ts` and import necessary layout components:

```ts
import { RouterModule } from '@angular/router'; // we also need angular router for Nebular to function properly
import { NbSidebarModule, NbLayoutModule, NbSidebarService } from '@nebular/theme';

...

@NgModule({
  ...
  imports: [
    RouterModule, // RouterModule.forRoot(routes, { useHash: true }), if this is your app.module
    NbLayoutModule,
    NbSidebarModule,
  ],
  providers: [NbSidebarService], // we need this service for the sidebar
  ...
})
export class SomePageModule {

```

Then let's add layout components with a sticky header into your `some-page.component.ts`:
```ts
@Component({
  ...
  template: `

    <nb-layout>
      <nb-layout-header fixed>Company Name</nb-layout-header>

      <nb-sidebar>Sidebar Content</nb-sidebar>

      <nb-layout-column>Page Content</nb-layout-column>
    </nb-layout>
  `
})
export class SomePageComponent {

```

And done! At this step, you should have a page with a simple layout on it looking like this:

![image](assets/images/articles/sample-page.png)

Adding into existing page

    In case you already have some code on your page and want to mix it with Nebular components you would need to place your page code inside of the Nebular layout.
    For Nebular to work it is required to have the `<nb-layout></nb-layout>` component at the top.

## Related Articles

- [Advanced Theme System configuration](#/docs/guides/enable-theme-system)
- [Nebular UI Kit](#/docs/guides/components-overview#advanced-setup)
- [NbLayout, NbLayoutColumn, NbLayoutHeader, NbLayoutFooter](#/docs/components/layout)
- [Deploying to production server](#/docs/guides/server-deployment)

repository: KostyaDanovsky/nebular

repo_name: KostyaDanovsky/nebular


text:
---
layout: post
title: Getting Data
---

horizontal rule

-----

Linking:

* [Hyde](http://hyde.getpoole.com)
* [Lanyon](http://lanyon.getpoole.com)

Lists and page links:

* Complete Jekyll setup included (layouts, config, [404]({{ site.baseurl }}/404.html), [RSS feed]({{ site.baseurl }}/atom.xml), posts, and [example page]({{ site.baseurl }}/about))
* Mobile friendly design and development
* Easily scalable text and component sizing with `rem` units in the CSS
* Support for a wide gamut of HTML elements
* Related posts (time-based, because Jekyll) below each post
* Syntax highlighting, courtesy Pygments (the Python-based code snippet highlighter)


text:
# @datafire/slideroom

Client library for SlideRoom API V2

## Installation and Usage
```bash
npm install --save datafire @datafire/slideroom
```

```js
let datafire = require('datafire');
let slideroom = require('@datafire/slideroom').create();

slideroom.Application_RequestExportV2({}).then(data => {
  console.log(data);
})
```

## Description
SlideRoom provides a RESTful API for exporting data out of your organization's SlideRoom account.

## Actions
### Applicant_DeleteAttributesV2
Deletes a custom attribute for an applicant.

```js
slideroom.Applicant_DeleteAttributesV2({
  "email": "",
  "name": ""
}, context)
```

#### Parameters
* email (string) **required** - The email address of the applicant.
* name (string) **required** - The name of the attribute to be deleted.
* pool (string)
* commonAppYear (integer)

### Applicant_GetAttributesV2
Gets the custom attributes for an applicant.

```js
slideroom.Applicant_GetAttributesV2({
  "email": ""
}, context)
```

#### Parameters
* email (string) **required** - The email address of the applicant.
* pool (string)
* commonAppYear (integer)

### Applicant_PostAttributesV2
This method only adds or updates attributes. Null values will be updated as nulls, but not deleted. API Import is available in the Advanced Plan.

```js
slideroom.Applicant_PostAttributesV2({
  "email": "",
  "data": {}
}, context)
```

#### Parameters
* email (string) **required** - The email address of the applicant.
* data (object) **required**
* pool (string)
* commonAppYear (integer)

### Applicant_GetAttributeNamesV2
Gets the custom applicant attributes used by the organization.

```js
slideroom.Applicant_GetAttributeNamesV2(null, context)
```

#### Parameters
*This action has no parameters*

### Application_GetAttributeNamesV2
Gets the custom application attributes used by the organization.

```js
slideroom.Application_GetAttributeNamesV2(null, context)
```

#### Parameters
*This action has no parameters*

### Application_RequestExportV2
Exports are generated asynchronously within SlideRoom.  To retrieve the export file generated by this request, use the api/v#/export/{token} endpoint to check the progress/result of the generation process.
            PDF and ZIP exports are available in the Advanced Plan.

```js
slideroom.Application_RequestExportV2({}, context)
```

#### Parameters
* format (string)
* roundType (string)
* roundName (string)
* tab.export (string)
* pdf.includeForms (boolean)
* pdf.includeReferences (boolean)
* pdf.includeMedia (boolean)
* pdf.includeApplicantAttachments (boolean)
* pdf.includeOrganizationAttachments (boolean)
* pdf.includeRatings (boolean)
* pdf.includeFullPageMedia (boolean)
* pdf.includeHighlights (boolean)
* pdf.includeComments (boolean)
* pdf.includeCommonApp (boolean)
* zip.originalMedia (boolean)
* zip.includeForms (boolean)
* zip.includeReferences (boolean)
* zip.includeMedia (boolean)
* zip.includeApplicantAttachments (boolean)
* zip.includeOrganizationAttachments (boolean)
* zip.includeRatings (boolean)
* zip.includeComments (boolean)
* zip.includeCommonApp (boolean)
* delivery.account (string)
* delivery.folder (string)
* since (integer)
* pool (string)
* status (string)
* searchName (string)
* email (string)

### Application_DeleteAttributesV2
Deletes a custom attribute for an application.

```js
slideroom.Application_DeleteAttributesV2({
  "applicationId": "",
  "name": ""
}, context)
```

#### Parameters
* applicationId (string) **required** - The ID of the application.
* name (string) **required** - The name of the attribute to be deleted.

### Application_GetAttributesV2
Gets the custom attributes for an application.

```js
slideroom.Application_GetAttributesV2({
  "applicationId": ""
}, context)
```

#### Parameters
* applicationId (string) **required** - The ID of the application.

### Application_PostAttributesV2
This method only adds or updates attributes. Null values will be updated as nulls, but not deleted.

```js
slideroom.Application_PostAttributesV2({
  "applicationId": "",
  "data": {}
}, context)
```

#### Parameters
* applicationId (string) **required** - The ID of the application.
* data (object) **required**

### Application_RequestExportByApplicationIdV2
Exports are generated asynchronously within SlideRoom.  To retrieve the export file generated by this request, use the api/v#/export/{token} endpoint to check the progress/result of the generation process.

```js
slideroom.Application_RequestExportByApplicationIdV2({
  "applicationId": ""
}, context)
```

#### Parameters
* applicationId (string) **required** - The id of the application to export
* format (string)
* roundType (string)
* roundName (string)
* tab.export (string)
* pdf.includeForms (boolean)
* pdf.includeReferences (boolean)
* pdf.includeMedia (boolean)
* pdf.includeApplicantAttachments (boolean)
* pdf.includeOrganizationAttachments (boolean)
* pdf.includeRatings (boolean)
* pdf.includeFullPageMedia (boolean)
* pdf.includeHighlights (boolean)
* pdf.includeComments (boolean)
* pdf.includeCommonApp (boolean)
* zip.originalMedia (boolean)
* zip.includeForms (boolean)
* zip.includeReferences (boolean)
* zip.includeMedia (boolean)
* zip.includeApplicantAttachments (boolean)
* zip.includeOrganizationAttachments (boolean)
* zip.includeRatings (boolean)
* zip.includeComments (boolean)
* zip.includeCommonApp (boolean)
* delivery.account (string)
* delivery.folder (string)

### Export_GetV2
Gets the status/result of a requested export.

```js
slideroom.Export_GetV2({
  "token": 0
}, context)
```

#### Parameters
* token (integer) **required**


text:
# Changelog
All notable changes to this project will be documented in this file.

## [3.7.0]

### Added

- Add new 'branch' subcommands ([#393](https://github.com/crowdin/crowdin-cli/pull/393))
- Add 'custom_segmentation' field support in config ([#389](https://github.com/crowdin/crowdin-cli/pull/389))
- Add '--branch' param for 'string list' command ([#389](https://github.com/crowdin/crowdin-cli/pull/389))

### Updated

- Improve '--delete-obsolete' logic ([#394](https://github.com/crowdin/crowdin-cli/pull/394))
- Remove requirement for 'files' block for some commands ([#393](https://github.com/crowdin/crowdin-cli/pull/393))

### Fixed

- Fix showing New version banner with '--plain' param ([#389](https://github.com/crowdin/crowdin-cli/pull/389))
- Fix message in authorizing via browser ([#389](https://github.com/crowdin/crowdin-cli/pull/389))
- Fix 'dest' ([#396](https://github.com/crowdin/crowdin-cli/pull/396))
- Fix exception handling at uploading file to storage in 'upload source' action ([#389](https://github.com/crowdin/crowdin-cli/pull/389))

## [3.6.5]

### Added

- Add '--branch' option for 'status' commands ([#374](https://github.com/crowdin/crowdin-cli/pull/374))
- Add '--delete-obsolete' option to 'upload sources' command ([#374](https://github.com/crowdin/crowdin-cli/pull/374))
- Add '--label' option to 'string add' and 'string edit' commands ([#384](https://github.com/crowdin/crowdin-cli/pull/384))

### Fixed

- Fix uploading XLSX files ([#377](https://github.com/crowdin/crowdin-cli/pull/377))
- Fix not showing all omitted files and improve building export patterns ([#378](https://github.com/crowdin/crowdin-cli/pull/378))

## [3.6.4]

### Updated

- Update Crowdin API client to 1.3.10 ([#380](https://github.com/crowdin/crowdin-cli/pull/380))

## [3.6.3]

### Updated

- Update subdependencies and code for Gradle 7.1 ([#371](https://github.com/crowdin/crowdin-cli/pull/371))
- Update Crowdin API client to 1.3.9 ([#375](https://github.com/crowdin/crowdin-cli/pull/375))

## [3.6.2]

### Added

- Add lazy initialization for dotenv code and error handling for duplicate environment variables ([#363](https://github.com/crowdin/crowdin-cli/pull/363))

### Updated

- Improve 'dest' parameter - add new placeholders ([#363](https://github.com/crowdin/crowdin-cli/pull/363))

## [3.6.1]

### Updated

- 'crowdin download' command improvements ([#358](https://github.com/crowdin/crowdin-cli/pull/358))
- AUR package: remove gradle dependency usage ([#359](https://github.com/crowdin/crowdin-cli/pull/359))

## [3.6.0]

### Added

- 'crowdin pre-translate' command ([#354](https://github.com/crowdin/crowdin-cli/pull/354))
- 'crowdin list languages' command ([#354](https://github.com/crowdin/crowdin-cli/pull/354))
- '--dest' parameter support as a command config option ([#354](https://github.com/crowdin/crowdin-cli/pull/354))

### Fixed

- Fix error type selection for invalid CSV scheme ([#354](https://github.com/crowdin/crowdin-cli/pull/354))

## [3.5.5]

### Fixed

- Fix for searching files with a plus symbol in a name ([#350](https://github.com/crowdin/crowdin-cli/pull/350))

## [3.5.4]

### Added

- Add '--[no-]translate-hidden' parameter to 'upload translations' command ([#344](https://github.com/crowdin/crowdin-cli/pull/344))
- Add '%file_name%' placeholder for 'dest' parameter ([#344](https://github.com/crowdin/crowdin-cli/pull/344))
- Add support for downloading file groups with 'dest' parameter ([#344](https://github.com/crowdin/crowdin-cli/pull/344))
- Add 'branch exists' message to 'upload' command ([#344](https://github.com/crowdin/crowdin-cli/pull/344))

### Updated

- Upload file as spreadsheet if 'dest' parameter has .csv extension ([#344](https://github.com/crowdin/crowdin-cli/pull/344))

### Fixed

- Fix config file missing message ([#344](https://github.com/crowdin/crowdin-cli/pull/344))
- Fix upload sources for Windows ([#344](https://github.com/crowdin/crowdin-cli/pull/344))

## [3.5.3]

### Added

- Add '--all' option to download translations without local sources ([#338](https://github.com/crowdin/crowdin-cli/pull/338))
- Add '--branch' option for 'download targets' ([#338](https://github.com/crowdin/crowdin-cli/pull/338))

### Updated

- Refactor error handlers and add error handler for 'upload translations' ([#338](https://github.com/crowdin/crowdin-cli/pull/338))
- Upgrade picocli version ([#338](https://github.com/crowdin/crowdin-cli/pull/338))

### Fixed

- Fix Language Mapping for 'download targets' ([#338](https://github.com/crowdin/crowdin-cli/pull/338))
- Fix verbose message for 'glossary list' ([#338](https://github.com/crowdin/crowdin-cli/pull/338))
- Fix 'list translations' - add accounting for excluded languages ([#338](https://github.com/crowdin/crowdin-cli/pull/338))

## [3.5.2]

### Added

- `.env` support ([#337](https://github.com/crowdin/crowdin-cli/pull/337))

## [3.5.1]

### Added

- Ability to exclude target languages for source files ([#331](https://github.com/crowdin/crowdin-cli/pull/331))
- Ability to ignore hidden files during sources upload ([#331](https://github.com/crowdin/crowdin-cli/pull/331))

### Fixed

- Fix 'glossary list --verbose' for non-managers ([#331](https://github.com/crowdin/crowdin-cli/pull/331))
- Fix 'download targets' for enterprise ([#331](https://github.com/crowdin/crowdin-cli/pull/331))
- Fix one message and add handler to 'add source' request ([#331](https://github.com/crowdin/crowdin-cli/pull/331))

## [3.5.0]

### Added

- `crowdin download sources` command ([#327](https://github.com/crowdin/crowdin-cli/pull/327))
- Labels support for `crowdin upload sources` command ([#327](https://github.com/crowdin/crowdin-cli/pull/327))
- Ability to configure export options for each file group ([#327](https://github.com/crowdin/crowdin-cli/pull/327))
- Using 'identifier' property in `crowdin string` commands ([#327](https://github.com/crowdin/crowdin-cli/pull/327))

### Updated

- Delete 'language_mapping' field from default configuration file ([#327](https://github.com/crowdin/crowdin-cli/pull/327))

### Fixed

- Fix messages for 'lint' command ([#327](https://github.com/crowdin/crowdin-cli/pull/327))

## [3.4.1] - 2020-11-16

### Updated

- Do not return exit code 1 if translation files are missing ([#325](https://github.com/crowdin/crowdin-cli/pull/325))

## [3.4.0] - 2020-11-09

### Added

- Ability to download translation from Crowdin to the specified target file (`crowdin download targets`) [Read more](https://github.com/crowdin/crowdin-cli/wiki/Download-translation-from-Crowdin-to-the-specified-target-file) ([#316](https://github.com/crowdin/crowdin-cli/pull/316))
- Pseudo-localization downloading (`crowdin download --pseudo`) [Read more](https://github.com/crowdin/crowdin-cli/wiki/Pseudo-localization-download) ([#316](https://github.com/crowdin/crowdin-cli/pull/316))

## [3.3.0] - 2020-09-28

### Added

- Glossary management. For more details - `crowdin glossary -h` ([#304](https://github.com/crowdin/crowdin-cli/pull/304))
- Translation memory management. For more details - `crowdin tm -h` ([#304](https://github.com/crowdin/crowdin-cli/pull/304))

### Updated

- Return non-zero code when errors presented in `upload` command ([#304](https://github.com/crowdin/crowdin-cli/pull/304/commits/2faae71c0102caa2c8bb6b64c2cc3f6ae405bb99))
- Update how CLI gets a list of project languages and in-context language ([#304](https://github.com/crowdin/crowdin-cli/pull/304/commits/8e3f8d0e6fbb1258ee942d5f81fa9eb4b8e0d86b))

### Fixed

- Fix Proxy ([#304](https://github.com/crowdin/crowdin-cli/pull/304))
- Fix `init` command to accept path formats on Windows ([#305](https://github.com/crowdin/crowdin-cli/pull/305))

## [3.2.2] - 2020-09-01

### Added
- Colors support ([#301](https://github.com/crowdin/crowdin-cli/pull/301))
- Add new 'crowdin list branches' command ([#300](https://github.com/crowdin/crowdin-cli/pull/300))
- Add checking for relative paths in translation patterns ([#296](https://github.com/crowdin/crowdin-cli/pull/296))
- Add autocomplete script to artifacts ([#298](https://github.com/crowdin/crowdin-cli/pull/298))

### Updated
- Improve 'crowdin init' ([#297](https://github.com/crowdin/crowdin-cli/pull/297))
- Improve searching for multilanguage csv translation files ([#299](https://github.com/crowdin/crowdin-cli/pull/299))
- Refactoring ([#301](https://github.com/crowdin/crowdin-cli/pull/301))

### Fixed
- Fix init command to accept path formats on Windows ([#305](https://github.com/crowdin/crowdin-cli/pull/305))

## [3.2.1] - 2020-07-24
- Added: Browser authorization for `init` command
- Added: Static analysis tools Spotbugs, Checkstyle
- Updated: Bump Gradle version
- Updated: Improve `--plain` mode for directories
- Updated: Improve new version message and change borders
- Fixed: Bug with in-Context language in the 'download' command for '-l' option
- Fixed: Bug with language placeholders for fileBeans with scheme

## [3.2.0] - 2020-07-08
- Added: Strings management functionality
- Added: Introduce a plain mode for usage in scripts
- Added: Install script: install an uninstaller
- Updated: Change help messages color scheme
- Updated: Warning emoji to one message and remove the suffix 'v3' from the doc link
- Fixed: Bug with intersecting sources
- Fixed: Translations upload with `dest` parameter
- Fixed: Fix bug with empty sources for `upload translations`

## [3.1.15] - 2020-06-04
- Updated: Update params for building translations request

## [3.1.14] - 2020-06-01
- Added: `status` command
- Added: Restrictions for 'upload translations' and 'download' commands
- Updated: Remove option and parameter for request `--import-duplicates`
- Updated: Installation scripts improvements
- Updated: Use Picocli version 4.3.2
- Updated: Better `project_id` validation
- Updated: Change approving for some options
- Fixed: Fix possible bug with a large project with many files/dirs
- Fixed: `ClassCastException` error

## [3.1.13] - 2020-05-19
- Added: `--skip-untranslated-strings` option for `download` command
- Added: `--skip-untranslated-files` option for `download` command
- Added: `--export-only-approved` option for `download` command
- Fixed: Output fixes

## [3.1.12] - 2020-05-12
- Added: `content_segmentation` option
- Added: Error emoji for exceptions in threads
- Updated: Use new Java API Client
- Updated: Separate logic and picocli ui
- Updated: A lot of refactoring and Unit tests
- Updated: Update picocli version
- Updated: Improve `--debug` (now it works for threads)
- Fixed: Fix for windows
- Fixed: Performance bug: remove ignore duplicates

## [3.1.11] - 2020-04-10
+ Updated: Improve tree output
+ Updated: Refactoring and tests
+ Fixed: Fix uploading problem for a big amount of files
+ Fixed: Help message for 'list'

## [3.1.10] - 2020-04-03
+ Added: Emoji for warnings/errors
+ Added: Handle 'Unauthorized' response
+ Added: Specific language support for `--dryrun`
+ Updated: Huge code refactoring and optimization
+ Updated: Change `--dryrun` output
+ Updated: Check branch existence before `--dryrun`
+ Fixed: Correct message about missing identity file
+ Fixed: Correct error messages about params

## [3.1.9] - 2020-03-19
+ Added: Support language mapping from server
+ Added: Set proxy properties from system environment
+ Updated: Return to old 'language_mapping' with crowdin codes
+ Fixed: Fix config options and write tests for PropertiesBeanBuilder
+ Fixed: Fix 'upload translations' for multilingual files

## [3.1.8] - 2020-03-16
+ Added: Newline for new version message
+ Added: Emojis to some messages
+ Updated: Set `escapeSpecialCharacters` by default to '1' for '*.properties' files
+ Updated: API - fix for 5xx responses
+ Updated: Set defaults for identity file
+ Fixed: Double asterisks with a slash at the start
+ Fixed: Return correct exit code

## [3.1.7] - 2020-03-11
+ Updated: Ignore directories using double-asterisk pattern
+ Updated: Update for --no-auto-update option of 'upload sources'
+ Fixed: CLI hanging trying to process non-existing directory
+ Fixed: Fix options for translations upload
+ Fixed: Fix for nonexistent path and little FileHelper refactoring
+ Fixed: `--identity` parameter processing
+ Fixed: Unexpected NPE while trying to download project

## [3.1.6] - 2020-03-09
+ Updated: texts update after review

## [3.1.5] - 2020-03-04
+ Updated: do not upload in-context language with 'upload translations'
+ Updated: allow base path to be relative to home directory

## [3.1.4] - 2020-03-04
+ Added: `escape_special_characters` option support for .properties file
+ Added: notification about new version
+ Updated: set default value for `escape_quotes` to 3
+ Updated: set default values for the configuration file to a list of `crowdin.yml` and `crowdin.yaml`
+ Updated: better error messages for base path

## [3.1.3] - 2020-02-27
+ Added: Bash/Zsh commands completion
+ Updated: set threads count to 4
+ Updated: improve files list output for `download` command
+ Updated: move descriptions and messages to resource bundle
+ Updated: help screens improvement

## [3.1.2] - 2020-02-19
+ Added: add message about wrong organization
+ Added: add User-Agent header
+ Updated: `escape_quotes` validation
+ Updated: make `--source` and `--translation` optional for params
+ Updated: params now can overwrite config
+ Updated: refactor gathering information about project and add message about wrong organization
+ Fixed: fix reuploading to branches
+ Fixed: fixes to config checking

## [3.1.1] - 2020-02-14
+ Added: add progress to show while building translations
+ Added: add `--dryrun` option to translations upload
+ Updated: improve `init` command
+ Fixed: fix branches - Now files can be in branches root

## [3.1.0] - 2020-02-11
+ Added: use picocli library for commands
+ Added: help messages color highlight
+ Added: 'base_url' validation and default value
+ Updated: texts on help screens
+ Fixed: high CPU usage on translation upload
+ Fixed: a lot of minor fixes and refactoring

## [3.0.7] - 2020-02-05
+ Updated: Change api use for settings

## [3.0.6] - 2020-01-27
+ Fix exportPattern with locale_with_underscore, android_code, osx_code
+ Don't pass escapeQuotes if it is not specified
+ Upload sources refactoring

## [3.0.5] - 2020-01-03
+ Updated: increase Pagination util limit
+ Updated: removed 'force' parameter for the 'Build Project Translation' api method
+ Fixed: in-Context support
+ Updated: refactoring: making Commands a little bit smaller
+ Fixed: directories API
+ Updated: refactored initialize-method
+ Updated: help-text for upload
+ Fixed: general help (drop redundant option, showing the correct message)
+ Updated: refactor run()
+ Fixed: fix escape_quotes
+ Updated: show relative path in messages in upload source
+ Updated: change createRevision to updateFile

## [3.0.4] - 2019-12-18
+ Fixed: language placeholders for ignore pattern
+ Updated: Unit-tests and CI/CD

## [3.0.3] - 2019-12-03
+ update config options (api_key -> api_token, project_identifier -> project_id)
+ fix: fixed list project command with specified branch
+ fix: fixed error message when project id is not specified
+ fix: added missing checkboxes

## [3.0.2] - 2019-11-26
+ Fixed: problem writing to a configuration file
+ Fixed: upload sources/translations on a root dir level
+ Fixed: Fix language codes

## [3.0.1] - 2019-11-21
+ Increased performance in 6-7 times (multithreading)
+ Fixed: translations upload with `translation_replace` option
+ Fixed: sources upload with `preserve_hierarchy` option
+ Fixed: translations upload with `preserve_hierarchy` option
+ Fixed: CLI crash in the absence of source file on the Crowdin side
+ Fixed: Wrong files structure after upload for complex file trees
+ Fixed: Upload sources into branch

## [3.0.0] - 2019-08-16
+ API v2 Support

repository: Andrulko/crowdin-cli

repo_name: Andrulko/crowdin-cli


text:
---
title: "Real-time Streaming Pattern"
author: 'blog.wallaroolabs.com'
date: '2018-08-23'
slug: realtime-streaming-pattern
link: https://blog.wallaroolabs.com/2018/08/real-time-streaming-pattern-analyzing-trends/
categories:
- bloglink
tags:
  - blogwallaroolabscom
---

Introduction This week, we continue to look at data processing patterns used to build event triggered stream processing applications, the use cases that the patterns relate to, and how you would go about implementing within[... <i class="fas fa-external-link-alt"></i>](https://blog.wallaroolabs.com/2018/08/real-time-streaming-pattern-analyzing-trends/)

repository: mkearney/data-scribers

repo_name: mkearney/data-scribers


text:
# Gatsby Site

`npm run build` Builds the site to `/public`

`npm run start` kicks up the development server at port 8000

> Hot-reload doesn't always work perfectly, make sure to refresh occasionally while developing.

Also see:

- [Blog](https://github.com/OrchidProtocol/blog.orchid.com/)
- [Podcast publishing process](podcast.md)
- [Styling best practices](styling.md)
- [Component methodology](components.md)
- [Translations](i18n.md)

gha_language: JavaScript


text:
This directory includes a htpasswd file and an example login page so
you can try out how this might work in practice. (Or just use the form
when you install this in your nginx, that's fine too).

## Usage

Run the `htpasswd-login-form` program with the flags `-loginform
./example/page -htpasswd ./example/htpasswd` and navigate to
http://<IP_ADDRESS>:8000/login/.

The test login is<EMAIL_ADDRESS>and the password is `test`.

To test the logout flow, navigate to
http://<IP_ADDRESS>:8000/logout/

## Inspiration and design

This form uses the fantastic [water.css (light
theme)](https://kognise.github.io/water.css/) classless stylesheet.

I have tried to make this form as accessible as possible - tab indexes
should make sense, autofocusing happens, and the entire form ought to
be screen-readable (although I haven't tested this). Please send me
patches if this isn't working for you!

### Development / updating the stylesheet

To update the vendored `water.css` file, follow the [install
instructions](https://github.com/kognise/water.css#compiling-your-own-theme)
and copy the `light.min.css` and `light.min.css.map` files to the `page/`
subdirectory here.

repository: antifuchs/htpasswd-login

gha_language: Go

repo_name: antifuchs/htpasswd-login


text:
This kid called me wrong on the Internet once. Their claim?

```
Without a good netty implementation for other languages it doesn't make sense to
write (Minecraft) proxies in other languages (compared to Java).
```

Fueled by the desire to prove said individual wrong, I set out to create:

# mcpxy

Its yet another Minecraft proxy, this time written in C++. Because #gottagofast.

I literally have nothing else to say about this for the time being.

## License

Idk, MIT is usually a pretty dope license for open source projects. Lets make it
that!

You can find a copy of the license in [LICENSE](./LICENSE).

repository: Ichbinjoe/mcpxy

repo_name: Ichbinjoe/mcpxy


text:
# PWA Offline Module for Angular

PWA offline feature for Angular clients.

## Description

Registers an interceptor that activates a view indicating that the client system if offline.

Registers a route that serves the view that is activated when the client system goes offline.

## Usage

### Within the development workspace

Import the module

```typescript
...
import { AppPwaOfflineModule } from '@app/client-pwa-offline';

@NgModule({
  imports: [
    ...
    AppPwaOfflineModule,
    ...
  ],
  ...
})
export class AppModule {}
```

### As an external package

Install the package

```bash
yarn add @rfprodz/client-pwa-offline @angular/material
```

Import the module

```typescript
...
import { AppPwaOfflineModule } from '@rfprodz/client-pwa-offline';

@NgModule({
  imports: [
    ...
    AppPwaOfflineModule,
    ...
  ],
  ...
})
export class AppModule {}
```

## Developer commands reference

```bash
npx nx run tools:help --search client-pwa-offline:
```

## References

- [Nx](https://nx.dev)
- [Angular](https://angular.io)
- [Angular Material](https://material.angular.io)

repository: rfprod/nx-ng-starter

gha_language: TypeScript

repo_name: rfprod/nx-ng-starter


text:
![Swift](https://img.shields.io/badge/swift-4.2-brightgreen.svg)

# Developer Friendly Pizza SDK!

There are three projects:
1. `OrderPizzaSDKCore` : Has core code to actually order the pizza. It does not have any platform specific code, so in future we could use this for Mac OS, Watch OS, TV OS, etc. More information in it's own [ReadMe](./OrderPizzaSDKCore/README.md) file.  ![Documentation](./OrderPizzaSDKCore/docs/badge.svg)
 2. `OrderPizzaSDK` : Provides iOS UI interface to `OrderPizzaSDKCore` framework.   More information in its own  [ReadMe](./OrderPizzaSDK/README.md) file. ![Documentation](./OrderPizzaSDK/docs/badge.svg)
 3. `OrderPizzaSDKDemo` : Demonstrates how to use the `OrderPizzaSDK`.

Most of the code is documented. Most of class/structs/enums/methods have comments explaining its purpose. The documentation is generated for `OrderPizzaSDKCore` & `OrderPizzaSDK` and they are in their `docs` directory.

The `OrderPizzaSDKCore` can be installed with Cocoapods & Swift Package Manager. We are planning to support the Carthage as well. The `OrderPizzaSDK` can be installed with Cocoapods. We are planning to support the Carthage as well.


text:
# Installation <!-- omit in toc -->

Intel(R) Extension for Scikit-learn is available at the [Python Package Index](https://pypi.org/project/scikit-learn-intelex/),
on Anaconda Cloud in [Conda-Forge channel](https://anaconda.org/conda-forge/scikit-learn-intelex) and in [Intel channel](https://anaconda.org/intel/scikit-learn-intelex). You can also build the extension from sources.

The extension is also available as a part of [Intel® oneAPI AI Analytics Toolkit](https://software.intel.com/content/www/us/en/develop/tools/oneapi/ai-analytics-toolkit.html) (AI Kit). If you already have AI Kit installed, you do not need to separately install the extension.

## Installation scenarios <!-- omit in toc -->

- [Install via pip or conda](#install-via-pip-or-conda)
  - [Install from PyPI channel (recommended by default)](#install-from-pypi-channel-recommended-by-default)
  - [Install from Anaconda Cloud](#install-from-anaconda-cloud)
    - [Install via Anaconda Cloud from Conda-Forge channel](#install-via-anaconda-cloud-from-conda-forge-channel)
    - [Install via Anaconda Cloud from Intel channel](#install-via-anaconda-cloud-from-intel-channel)
- [Build from sources](#build-from-sources)
  - [Prerequisites](#prerequisites)
  - [Configure the build with environment variables](#configure-the-build-with-environment-variables)
  - [Build Intel(R) Extension for Scikit-learn](#build-intelr-extension-for-scikit-learn)
- [Build documentation for Intel(R) Extension for Scikit-learn](#build-documentation-for-intelr-extension-for-scikit-learn)
  - [Prerequisites for creating documentation](#prerequisites-for-creating-documentation)
  - [Build documentation](#build-documentation)

## Install via pip or conda

### Install from PyPI channel (recommended by default)

```bash
pip install scikit-learn-intelex
```

#### 📦 Supported configurations for PyPI <!-- omit in toc -->

| OS / Python version | **Python 3.6** | **Python 3.7** | **Python 3.8** | **Python 3.9** |
| :------------------ | :------------: | :------------: | :------------: | :------------: |
| **Linux**           |   [CPU, GPU]   |   [CPU, GPU]   |   [CPU, GPU]   |   [CPU, GPU]   |
| **Windows**         |   [CPU, GPU]   |   [CPU, GPU]   |   [CPU, GPU]   |   [CPU, GPU]   |
| **OsX**             |     [CPU]      |     [CPU]      |     [CPU]      |     [CPU]      |

### Install from Anaconda Cloud

#### Install via Anaconda Cloud from Conda-Forge channel

```bash
conda install scikit-learn-intelex -c conda-forge
```

##### 📦 Supported configurations for  Anaconda Cloud from Conda-Forge channel <!-- omit in toc -->

| OS / Python version     | **Python 3.6** | **Python 3.7** | **Python 3.8**| **Python 3.9**|
| :-----------------------| :------------: | :------------: | :------------:| :------------:|
|    **Linux**            |   [CPU]        |   [CPU]        |     [CPU]     |     [CPU]     |
|    **Windows**          |   [CPU]        |   [CPU]        |     [CPU]     |     [CPU]     |
|    **OsX**              |   [CPU]        |   [CPU]        |     [CPU]     |     [CPU]     |

#### Install via Anaconda Cloud from Intel channel

We recommend this installation for the users of Intel® Distribution for Python.

```bash
conda install scikit-learn-intelex -c intel
```

##### 📦 Supported configurations for Anaconda Cloud from Intel channel <!-- omit in toc -->

| OS / Python version | **Python 3.6** | **Python 3.7** | **Python 3.8** | **Python 3.9** |
| :------------------ | :------------: | :------------: | :------------: | :------------: |
| **Linux**           |   [CPU, GPU]   |   [CPU, GPU]   |   [CPU, GPU]   |   [CPU, GPU]   |
| **Windows**         |   [CPU, GPU]   |   [CPU, GPU]   |   [CPU, GPU]   |   [CPU, GPU]   |
| **OsX**             |     [CPU]      |     [CPU]      |     [CPU]      |     [CPU]      |

## Build from sources
Intel(R) Extension for Scikit-learn is easily built from sources with the majority of the necessary prerequisites available on conda or pip. The instructions below detail how to gather the prerequisites and build and install the completed package. The package can be built for all three major platforms (Windows, Linux, macOS).

### Prerequisites
* Python version >= 3.6

### Configure the build with environment variables
* SKLEARNEX_VERSION: sets package version

### Build Intel(R) Extension for Scikit-learn
- To install the package:

   ```bash
   cd <checkout-dir>
   python setup_sklearnex.py install
   ```

- To install the package in the development mode:

   ```bash
   cd <checkout-dir>
   python setup_sklearnex.py develop
   ```

- To install scikit-learn-intelex without downloading daal4py:

   ```bash
   cd <checkout-dir>
   python setup_sklearnex.py install --single-version-externally-managed --record=record.txt
   ```
   ```bash
   cd <checkout-dir>
   python setup_sklearnex.py develop --no-deps
   ```

⚠ Keys `--single-version-externally-managed` and `--no-deps` are required so that daal4py is not downloaded after installation of Intel(R) Extension for Scikit-learn

⚠ The `develop` mode will not install the package but it will create a `.egg-link` in the deployment directory
back to the project source code directory. That way you can edit the source code and see the changes
without having to reinstall package every time you make a small change.

⚠ `--single-version-externally-managed` is an option used for Python packages instructing the setuptools module
to create a Python package that can be easily managed by the package manager on the host.

## Build documentation for Intel(R) Extension for Scikit-learn
### Prerequisites for creating documentation

- [requirements-doc.txt](requirements-doc.txt)
- [pandoc](https://pandoc.org/installing.html)

### Build documentation

Run:

```
cd doc
./build-doc.sh
```

The documentation will be in ```doc/_build/html```.


text:
# Flipkart Web-Scraper using Python

A simple & efficient Web-Scraper implemented using Python libraries like _'requests'_ & _'BeautifulSoup4'_ that easily extracts the desired product details & dumps the scraped data automatically into a _'JSON'_ File.

![alt Calculator](preview.png)

## Installation

The Web-Scraper is coded in Python so ensure whether the following pre-requisites are met, in order to run it on your system.

### Pre-requisites:

[Python](https://www.python.org/downloads/)

```
Python 3.5.7 - Minimum version required to run the scraper is 'Python 3.5.7' or above.
```

[pip](https://pypi.org/project/pip/)

```
pip - Install 'pip' to download and install various Python Libraries directly from the Terminal.
```

'[requests' lib](https://pypi.org/project/requests/)

```
pip install requests - Install the 'requests' Python library using this 'pip' command.
```

'[BeautifulSoup4' lib](https://pypi.org/project/beautifulsoup4/)

```
pip install beautifulsoup4 - Install the 'beautifulsoup4' Python library using this 'pip' command.
```

## Description

- The Web-Scraper is build using Python libraries viz. _'requests'_ & _'bs4'_.
- The Scraper scrapes the product details viz. _title, price, image, url & specifications._
- Automatically converts & stores the scraped data in _JSON_ format with the _.json_ file extension.
- It has a _sleep timer_ implemented to reduce the load by sending limited no. of request at the given time to the remote server.

## Note

- This Web-Scraper project is just for educational/research purposes only!
- Scraping can be helpful in case extracting loads of data for Analysis/Research purpose!
- _'I am not responsible at any cost'_, if anyone uses it intentionally or unintentionally for any kind of other purposes which violates any Rules/Limitations of any corporation or organization!
- Before scraping any website just ensure that you're not voilating any of the Rules/Limitations or Terms & Conditions mentioned in the _/robots.txt_ of that particular website.

## Author

- [**Aditya Ambre**](https://github.com/AdityaAmbre)

## License

This project is licensed under the Apache-2.0 License - see the [LICENSE.md](LICENSE) file for details.

Copyrights © - 2020 Aditya Ambre. │ All Rights Reserved.

repository: AdityaAmbre/python

repo_name: AdityaAmbre/python


text:
# Local Export

Although the main goal for vorteil.io is to publish directly into the cloud or datacentres, there is an option to export the application to different formats. This option is mainly to support existing deployment processes, so nothing needs to be changed to use vorteil.io with e.g. new projects.

Different hypervisors need different formats, so basically vorteil.io is supporting the major formats and all hypervisors should at least accept one fo them. The formats are:

* VMDK
* OVA
* VHD
* GCP (google cloud formatted tar)
* stream-optimized VMDK

!> Stream-optimized VMDKs are read-only disks!

To use the export functionality, simply select a **.vorteil** package or point to an existing binary and execute the **build** command:

**Example (Export package as vmdk)**:
```vcli
vcli build --format=vmdk mypackage.vorteil
```

Additionally the exported artifact can be changed during the build process with flags. E.g. it can be build with a different environment variables or command line arguments.

**Example (Export application with parameters)**:
```vcli
vcli build --format=vmdk --args='arg1' --var="MYENV=HELLO"
```

!> Building from a package does not allow to change the artifact with parameters due to vorteil's emphasis on immutablity.

# VMWare ESXi
To deploy for a VMware environment, a valid account and license is required. Setting up a VMware environment for use with vcli is easy. To create a VMware environment, run the appropriate command. The vcli will prompt you for all required information.

**Example (Create VMware Environment)**
```vcli
vcli cloud new MyEnvironment --platform=vmware
```

This process only has to be executed once to setup the target. After that, it can be used for all future deployments to this target. The deployment can be initialized with a simple cloud upload command. The application to deploy can be either a binary or a .vorteil package.

**Example (Command and output):**
```vcli
vcli cloud upload MyEnvironment myapp

Using config file: hugo.vcfg
Using files: hugo.files
Configuration Summary:
 • Vorteil kernel 0.1.2
 • Automatically sized virtual disk with ext2 partition
 • 1 network card
 • 1 virtual filesystem redirect
Merging 1 directories
 • hugo.files
 8.03 MiB / 8.03 MiB [==============================================] 100.00% 0s
 Upload complete.
 10.00 MiB / 12.70 MiB [=================================>---------]  78.73% 32s
 Template created: af811d2ddbc0438597ba4aee62c1733a
```

# Google Cloud

For deploying to the Google Could Platform (GCP), a valid account is required. Additionally vcli needs credentials with adequate permissions to execute all required deployment commands. For this a so called service account is needed . This can be done in three simple steps after login in to [Google Cloud Platform](https://cloud.google.com/).

#### 1. Go to "Service Accounts"

From the main navigation in the upper left corner, go to *IAM > Service Accounts*

![alt text](/publish/gcp1.png "service account")

#### 2. Create Service Account

In the top navigation bar, select "Create Service Account"

![alt text](/publish/gcp2.png "create service account")

#### 3. Download JSON private key

After selecting the role for the service account and choosing JSON as private key format, the download of hte key should start automatically.
This key is needed later to create a deployment target in vcli.

![alt text](/publish/gcp3.png "get service account json key")

After downloading the key it is required to add it to vcli, to use it for deployments. During this process a bucket and a zone for the newly created images has to be specified. This is needed to upload the the application after converting it to a GCP-compatible format.

**Example:**
```vcli
vcli cloud new gcp /path/to/key.json
```

!> VCLI's built-in editor currently only supports Mac and Linux machines.

This process only has to be executed once to setup the target. After that, it can be used for all future deployments to this target. The deployment can be initialized with a simple **cloud upload** command. The application to deploy can be either a binary or a **.vorteil** package.

**Example (Command and output):**
```vcli
vcli cloud upload gcp myapp

Using config file: hugo.vcfg
Using files: hugo.files
Configuration Summary:
 • Vorteil kernel 0.1.2
 • Automatically sized virtual disk with ext2 partition
 • 1 network card
 • 1 virtual filesystem redirect
Merging 1 directories
 • hugo.files
 8.03 MiB / 8.03 MiB [==============================================] 100.00% 0s
Connecting to Google Cloud Storage...
Accessing bucket: vorteil-demo...
Initializing new object: 862216640.tar.gz...
Uploading image
 10.00 MiB / 12.70 MiB [=================================>---------]  78.73% 32s
```

During those deployment steps, vcli converts the uploaded package to an image, which can be used to spin up new machines. The name of the image is a hash value and it can be seen during the upload process. In the former example, the image name would be "v862216640".

![alt text](/publish/gcp4.png "images list")

After these steps new machines based on this image can be created.

![alt text](/publish/gcp5.png "select custom image")


text:
# Benchmarks

etcd benchmarks will be published regularly and tracked for each release below:

- [etcd v2.1.0-alpha](./etcd-2-1-0-alpha-benchmarks.md)
- [etcd v2.2.0-rc](./etcd-2-2-0-rc-benchmarks.md)
- [etcd v3 demo](./etcd-3-demo-benchmarks.md)

repository: honeyqa/etcd

repo_name: honeyqa/etcd


text:
# ASPLOS 2023 Artifact Evaluation
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7429879.svg)](https://doi.org/10.5281/zenodo.7429879)

This repository contains the artifacts for the paper

"Hidet: Task Mapping Programming Paradigm for Deep Learning Tensor Programs".

**Note**: This repository hosts the old version of Hidet when submitting the paper and is only used to reproducing the experiments. Please checkout the [hidet-org/hidet](https://github.com/hidet-org/hidet) repository for the latest version of Hidet.

## Hardware requirements

We did experiment on the following hardware platform

- CPU: Intel Core i9-12900K
- GPU: NVIDIA GeForce RTX 3090 (one with 420 Watt TDP)
- Memory: 64 GiB

Other workstation equipped with a modern NVIDIA GPU should also be able to run the experiments.

The experiments require a Linux system with NVIDIA GPU driver installed.

## Run experiments via docker

We provide a docker image to run the experiments, with pre-configured environment.

### Install docker and nvidia-docker

Please follow the instructions on the [official website](https://github.com/NVIDIA/nvidia-docker) to install docker and
nvidia-docker.

### Prepare the image

We provide two ways to get the docker image to use. Please choose the one you like.

#### Option 1: use the prebuilt image

```bash
docker pull yyding/hidet-artifact:latest
```

#### Option 2: build docker image from Dockerfile

```bash
git clone --recursive git@github.com:yaoyaoding/hidet-artifacts hidet
cd hidet
docker build -t yyding/hidet-artifact:latest .
```

### Run experiments inside docker container

After above step, you can see a docker image named `yyding/hidet-artifact:latest` in your local docker image list via:

```bash
docker image ls
```

You should be able to see something like this:

```text
REPOSITORY              TAG       IMAGE ID       CREATED          SIZE
yyding/hidet-artifact   latest    1074c09962c0   33 minutes ago   13.7GB
```

To run experiments, you need to start a docker container from the image:

```bash
# the following command will start a container based on the image
# you will enter the container after the command at working directory /root/hidet/artifacts
docker run -it --gpus all --rm yyding/hidet-artifact:latest
# when you are in the container, run
bash run.sh
# to run all experiments
```

You can also run experiments in the container one by one. See [here](#run-the-experiments) for details.

## Build and run experiments from source

You can also build and run experiments from source on your host environment.

### Installation

We require the following software to be installed

- cmake 3.19+
- llvm (required by TVM, we used llvm-10)
- ccache (used to accelerate duplicated compilation)

#### NVIDIA CUDA Toolkit

Please follow https://developer.nvidia.com/cuda-downloads guide to install the CUDA toolkit.

We used NVIDIA Driver 510.73.08 and CUDA 11.6 for our experiments. The newer versions of CUDA should also work.

Please run the following commands to check whether the NVIDIA Driver and CUDA toolkit are installed correctly.

```bash
nvidia-smi
nvcc --version
```

#### Install Hidet and baselines

```bash
# clone hidet repository
git clone --recursive git@github.com:yaoyaoding/hidet-artifacts hidet
cd hidet

# install the dependencies of hidet and the baselines (e.g., TensorRT, PyTorch, Onnx Runtime)
# the versions of baselines are specified in requirements.txt file.
pip3 install -r requirements.txt

# build hidet and tvm
mkdir build
cd build
cmake ..
make -j8
cd ..

# there should be four dynamic libraries in the build/lib directory:
# libtvm.so, libtvm_runtime.so, libhidet.so, libhidet_runtime.so
ls build/lib

# set the environment variables, it is recommended to set them in your .bashrc file
export HIDET_HOME=`pwd`
export PYTHONPATH=$PYTHONPATH:$HIDET_HOME/python:$HIDET_HOME/artifacts
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HIDET_HOME/build/lib

# test whether hidet has been installed successfully
python3 -c "import hidet"
python3 -c "import artifact"
```

### Run the experiments

This artifact contains all the experiments in the evaluation section of the paper:

- Experiment 0 (section 6.1): End to end performance comparison (~50 hours)
- Experiment 1 (section 6.2.1): Schedule space comparison (~1 hour)
- Experiment 2 (section 6.2.2): Performance sensitivity over input sizes (~4 hours)
- Experiment 3 (section 6.2.3): Evaluation on different batch sizes (~40 hours)
- Experiment 4 (section 6.2.4): Post-scheduling fusion evaluation (~10 hours)
- Experiment 5 (section 6.2.5): Comparison with TensorRT (~1.5 hour)

The 6 experiments are organized in the `artifacts` directory. Each experiment corresponds to a directory with a `main.py` script.
Directly run the `main.py` script to launch corresponding experiments. We will automatically cache the optimized operator and models in `.hidet_cache` directory, thus you can stop and restart the experiments at any time. The second run of the experiments will be much faster.

It will take tens of hours to finish all experiments. Most of the time is spent by autotvm and ansor schedulers. If you want to first skip the experiments related to autotvm and ansor, you can comment the line `--exec ansor` and `--exec autotvm` in each `main.py` script.

```bash
cd artifacts

# the following environment variables allow TVM to use all the cores of the machine
# if your machine has a different number of threads other than 24, change the value of TVM_NUM_THREADS accordingly
export TVM_BIND_THREADS=0
export TVM_NUM_THREADS=24

python3 0_end_to_end/main.py
python3 1_latency_distribution/main.py
python3 2_input_sensitivity/main.py
python3 3_batch_size/main.py
python3 4_prolouge_epilogue_fusion/main.py
python3 5_tensorrt/main.py
```
(we store above instructions in `run.sh`, you can run `bash run.sh` to run all experiments).

Each script would have outputs like
```text
 BatchSize                Model     Executor                                   Config      Space    Latency        Std      Error
         1             resnet50        hidet              sp2_simt_f32_f32_pk_default          2      1.184      0.000      0.000

 BatchSize                Model     Executor                                   Config      Space    Latency        Std      Error
         1         inception_v3        hidet              sp2_simt_f32_f32_pk_default          2      1.722      0.005      0.000

 BatchSize                Model     Executor                                   Config      Space    Latency        Std      Error
         1         mobilenet_v2        hidet              sp2_simt_f32_f32_pk_default          2      0.337      0.001      0.000

 BatchSize                Model     Executor                                   Config      Space    Latency        Std      Error
         1                 bert        hidet              sp2_simt_f32_f32_pk_default          2      2.378      0.029      0.000

 BatchSize                Model     Executor                                   Config      Space    Latency        Std      Error
         1                 gpt2        hidet              sp2_simt_f32_f32_pk_default          2      2.608      0.054      0.000
```

You may also see output log like
```text
Compiling task avg_pool2d_rearrange_rearrange_reshape_rearrange...
Compiling task matmul_reshape...
100%|█████████████████████████████████████████████████████████| 177/177 [00:45<00:00,  3.86it/s]
```
This indicates that hidet is compiling the kernel for each operator. The progress bar indicates hidet is tuning a kernel. The compilation and tuning results will be cached in `hidet/.hidet_cache` directory. The subsequent runs will reuse the cached results. Feel free to ignore these logs.

The 8 columns in the output correspond to
- batch size,
- model name,
- executor,
  - PyTorch: torch
  - Onnx Runtime: ort
  - AutoTVM: autotvm
  - Ansor: ansor
  - TensorRT: tensorrt
  - Hidet: hidet
- config for executor,
- search space of hidet (please ignore this column for other executor),
- end to end latency in milliseconds,
- standard deviation of latency,
- and the output error (see `hidet.utils.py.error_tolerance` for the definition) compared with onnx runtime with cpu backend. We compared the output to make sure the inference results are correct for each executor.

repository: yaoyaoding/hidet-artifacts

gha_language: Python

repo_name: yaoyaoding/hidet-artifacts


text:
[TOC]

## Installation

- install the required packages/libraries using this command
  - `pip3 install -r requirements.txt`
  - or
  - `conda install --file requirements.txt`
- i have used `python-3.7` for this project

## Intialize dataset

- unzip the **training.zip** file in the root directory ( `/training` )
- we are creating positive and negative pairs of matches in  `utils.py` script
- To load all the image pairs instead of loading the entire dataset to variables prior to training , we are creating a dataset that has all the pairs of data in `/post_training/dataset.h5` file
- we can create this using this command
  - `python3 utils.py`

## Training Model

- we can start the training using this command
  - `python3 train.py`
- so we are storing the model's state on every epoch `checkpoint/siemese_network_v2`
- and the we are using tensorboard for visualizing our model's performance in `runs/siemese_network_v2`
  - make sure you have installed **tensorboard**
  - run this command `tensorboard --logdir=runs/`

### Notes

- it took 8 hours for me to train the model with my system requirements listed below
  - i7 processor
  - GTX 1050 Graphics Card
  - 8GB Ram

## Testing Model

- Download the trained model files from [here](https://drive.google.com/file/d/1d5HNXDJOT40OnpiLy9Yk9V0Zn7Yf_WJa/view?usp=sharing) and place it in `checkpoint/siemese_network_v2/`

- we can run the `test.py` with our desired input changes

- ```python
  test_obj = {
  'src' :  'tests/jennifer-aniston.jpg',
  'dest' : 'tests/tom-cruise.jpg'
  }
  ```

- images are placed in `/tests` folder

# References

https://stackoverflow.com/questions/13211745/detect-face-then-autocrop-pictures

https://medium.com/@ctrlfizz/automatically-generate-passport-size-pictures-from-a-group-photo-3f9aa1d73f65

[Automatically detects and crops faces from batches of pictures]( https://github.com/leblancfg/autocrop )


text:
# TabGraph

*tabGraph* is a full SceneGraph featuring a flexible Component system, giving a lot of freedome for adding new components to your scene and organizing it.

*tabGraph* Provides a SceneGraph and a complete building system, allowing for the generation of portable executables.

In order to use *tabGraph*, you need to setup your project with a Makefile calling *tabGraph*'s main Makefile.

The application will be built in `$(APP_PATH)/build/` by default

# Exportable Makefile Variables

In order to allow for application building, several variable can be set.

##### APP_SRC (MANDATORY)

- The list of the source files of your project
- Path must be relative to your project's path

##### APP_NAME (MANDATORY)

- The name of the executable to be built

##### APP_PATH (MANDATORY)

- The root of your application, usually set to $(PWD)/

##### APP_INCLUDE_PATH (OPTIONAL)

- The list of include paths relative to the application's path

##### APP_RES_FILES (OPTIONAL)

- The list of the application's resource files, they will be copied to the build folder

##### APP_LDLIBS (OPTIONAL)

- The list of libs to link to (such as -lpng)

##### APP_CXXFLAGS (OPTIONAL)

- The list of options to use with GCC for building the application,
- Will be concanated with *tabGraph*'s default options

##### APP_HEADERS (OPTIONAL)

- The list of header files used by the application
- Allows for rebuild if a header changed

##### APP_SHADERS (OPTIONAL)

- The list of shader files used by the application
- Allows for rebuild if a shader changed

##### DEBUG (OPTIONAL)

- DEFAULT VALUE = 0
- Set it to 1 in order to build the application in debug mod
- When building in debug mod, the `DEBUG_MOD` is defined,
- `DEBUGLOG` will be enabled
- `-g` option will be used for compilation

##### USE_GDAL (OPTIONAL)

- DEFAULT VALUE = 0
- Set it to 1 in order to build using GDAL library
- Set it to 0 to use internal parsing methods (with limited abilities) to parse terrains

# Example

```make
APP_NAME            =   Scop.exe
APP_SRC             =   src/main.cpp        \
                        src/callbacks.cpp
APP_INCLUDE_PATH    =   include
APP_RES_FILES       =   $(shell find ./res -type f)
APP_PATH            =   $(PWD)/

export

all:
    cd $(TABGRAPH_PATH) && $(MAKE) application

debug: APP_NAME = ScopD.exe
debug:
    cd $(TABGRAPH_PATH) && $(MAKE) application DEBUG=1
```

repository: AnTAVR/TabGraph

repo_name: AnTAVR/TabGraph


text:
---
layout: post
title: a robot with a purpose
categories: [bugfree-robot]
tags: [embedded, hardware]
comments: true
footnote: Finally some hardware around here!
---

I've already spent so many sequential articles talking about TDD, Cpputest and codes that can run for applications anywhere. It is time to take a break on that and show up some details about the **hardware** that this firmware is being developed to.

The objective of this firmware is (at first) to run in a line follower robot. This kind of robot is intended run autonomously in a track looking for completing it as fast as possible in competitions. The track is usually drawn with a white tape over a black rubber mat glued to a wood plain surface. It is composed by straight lines and some curves and each competition lists some rules about the minimum straight lengths, curve radius, line width and crossings.

The tracks use to provide indications at start and end of the curves and start/end of the track. These marks can be used to help the robot dividing the track in sections and optimizing its behavior to get faster in each section. A common strategy is accelerating to high speeds in long straight sections and braking before the next curve to avoid losing it. Encoders are recommended to allow distance measurements and the latter strategy.

<!--more-->

Detecting the track's lines is a task almost always executed by reflective object sensors. Each one of those combine an infrared LED emitter and a phototransistor like the [QRE1113](https://www.sparkfun.com/datasheets/Robotics/QR_QRE1113.GR.pdf). The sensor output is connected to a simple passive circuit that makes its information readable by microcontrollers. The two main approaches for this circuit are:

- convert the sensor output to a voltage proportional to object's reflectivity and read it with an ADC
- create a R/C circuit, apply a voltage pulse to the sensor and measure the time it takes to discharge the capacitor

The latter removes the requirement of an ADC pin to read each pin since any digital I/O will get the job done, although the read will require a timer and the voltage that a digital pin goes from logic HIGH to logic LOW is a gray area in the digital world.

I've always preferred dedicating some ADC pins and reading analog values. It is faster and simpler. Some calibration is added to define the threshold between white and black detections and voilà, a robot that can "see" in black and white.

The robot I'm working on will run over a PCB designed by myself specially for this. Its project is not published (at least not yet, maybe I'll do that some time in future) but much of its components will be detailed in around here. The motivation to design a PCB is merging in a single hardware everything required to read the sensors, control the motors and blinking LEDs (this one cannot be left out, alright?). This saves a lot of time soldering cables and debugging bad connections, with a plus of reducing the robot's weight (an important variable to get good results).

This PCB is called Lino v1 and includes these items:

- STM32F302RCT6 ARM Cortex M4 with FPU, 72MHz max freq, 256kB FLASH + 40 kB RAM memory
- SWD debug connector
- TB6612 dual DC motor driver
- micro USB connector
- 2 I/O tactile buttons + 1 for reset
- 4 LEDs
- 4 Mbit flash memory
- buzzer
- 2 quadrature encoders inputs
- 2 full duplex UART headers
- 1 I2C header
- 10 analog inputs

The microcontroller is the main component of course. It was chosen due to its big FLASH and RAM memory sizes, high I/O and interfaces count, timer capable of handling quadrature encoders, floating point unit and integrated USB controller. It has almost any resources that I've ever thought about using while programming a line follower robot. It provides a processing power around the highest ones I've ever seen in competitive robots (and you can be sure that I'm ignoring here anyone who though about embedding a Raspberry Pi, it requires a HUGE battery and has a hardware not intended for this at all).

I'm looking for a picture of the PCB to add here and will update this article with it soon.

The next on will be about creating a basic firmware project and showing the steps to build and test code that interacts with microntroller's peripherals