text:
# WPF Command Aggregator.Core
The WpfCommandAggregator.Core is an MVVM package for an easier, faster and more comfortable use of MVVM and especially of commands in the environment of WPF.Core (WPF.NET).
This solution is very similar to the implementation known from the .net classic environment. However, the solution was extended by the concept of the ICommandContainer, so that a logical grouping of ICommand and related information such as label texts, colors, etc. is possible.

Latest stable version is available as a nuGet package (up from November 9th, 2019):

[nuGet](https://www.nuget.org/packages/WPFCommandAggregator.Core/)

See also other versions on nuget:

* [nuGet: UWP Command Aggregator](https://www.nuget.org/packages/UwpCommandAggregator/)
* [nuGet: WPF Command Aggregator](https://www.nuget.org/packages/WPFCommandAggregator/)

## Versions
- <IP_ADDRESS>
  - Upgrade to .net Core 3.1 (LTS version)
  - new: ObservableCollectionExt extends ObservableCollection with fast
    AddRange, RemoveItems methods and also a Replace method
    The class is placed in the namespace System.Collections.ObjectModel.
  - new: Attached properties for managing focus and closing windows via view model properties.
- 1.0.1 :
  - non-used public flag removed: 'AutoTriggerCommandNotification'
- 1.0.0 :
  - WPF Command Aggregator.Core

## List of features

### CommandAggregator

Feature           |Since version
------------------|----------
CommandAggregator|1.0.0
Factory/Custom Aggregator|1.0.0
CommandContainer|1.0.0
RelayCommand|1.0.0
HierarchyCommands|1.0.0
DependsOn Attribute|1.0.0
Pre- and post action delegates|1.0.0

### Base ViewModel (BaseVm)
Feature           |Since version
------------------|----------
Included CommandAggregator instance|1.0.0
Notification supression (SuppressNotifications flag)|1.0.0
SetPropertyValue for backing fields|1.0.0
SetPropertyValue<> and GetPropertyValue<> for automatic value storage|1.0.0
DependsOn Attribute|1.0.0

### Additional Features
Feature           |Since version
------------------|----------
ObservableCollectionExt|1.1.0
AttachedProperty Focused|1.1.0
AttachedProperty WindowResult|1.1.0

# How it works
## The idea
Many years I worked on many WPF projects (MVVM) with many views and thereof with many command objects.
It was quite boring to write similar code for every command definition.
The well known RelayCommand (Josh Smith) helps a lot but there is still similar code for every command definition.
* private ICommand member
* public ICommand getter incl. creation logic

If you have to create views with a lot of functionality (many customers still like screens full of data and functionalities),
for example ToolBars and ContextMenus also a lot of commands has to be defined.

This leads to a great amount of code lines with very similar structure.

**Example (WITHOUT Command Aggregator):**
```C#
private ICommand printCommand;
public ICommand PrintCommand
{
     get
     {
          if (this.printCommand == null)
          {
              this.printCommand = new RelayCommand(p1 => Print(p1), p2 => CanPrint);
          }
          return this.printCommand;
      }
}
```

All we want to tell is: _PrintCommand_ executes the _Print_ method if it is allowed (_CanPrint_ property).

## The aggregator and the base view model
The WPFCommandAggregator.Core is a solution to reduce the command definitions to a very short and easy to read line of code within a view model class.

**Example (WITH Command Aggregator):**
```C#
this.CmdAgg.AddOrSetCommand("Print", new RelayCommand(p1 => Print(p1), p2 => CanPrint));
```
OR (including settings)
```C#
this.CmdAgg.AddOrSetCommand("Print", new RelayCommand(p1 => Print(p1), p2 => CanPrint), new Dictionary<string, object> { { "ButtonContent", "Print me!" }});
```
(many more overloads exists)

This is a reduction of about 10 lines (!!!!) and (in my opinion) a very well readable command definition.
How can this be achieved and how can we use it for bindings (XAML)?

So we have a functionality to collect commands within a CommandAggregator instance, but how can we use it - especially in bindings?

First, the BaseVm class provides a command aggregator instance and an abstract method called _InitCommands_. The CommandAggregator instance is created by a factory class.
Thus we get in ViewModels (which inherit from BaseVm) the possibility to store all command definitions in the overloaded method _InitCommands_. Thus they are concentrated in one place in the class and can be easily maintained and extended.

The mentioned factory class for the CommandAggregator instance also offers the possibility to register an own and individual implementation of the ICommandAggregator interface - if required.

```C#
public abstract class BaseVm : INotifyPropertyChanged
{
   public ICommandAggregator CmdAgg { get; }
     = CommandAggregatorFactory.GetNewCommandAggregator();

   protected abstract void InitCommands();

   protected BaseVm()
   {
        this.InitCommands();
   }

   // ... further elements of the base view model
}
```

The abstract _InitCommands_ method is the place where the commands will be registered/defined within each view model.
```C#
public class MainVm : BaseVm
{
   protected sealed override void InitCommands()
   {
      this.CmdAgg.AddOrSetCommand("Print", new RelayCommand(p1 => Print(p1), p2 => CanPrint));
   }

   // ... more view model code ...
}
```

**But there is still one problem left: How do we bind the commands?**

At this point an indexer can help us. Indexers can be used also in Bindings.
Commands do not require TwoWay bindings, so a readonly indexer within the CommandAggregator class enables us to establish a command binding in XAML.

```C#
    // The indexer of the BaseVm class
    public ICommand this[string key] => this.GetCommandContainer(key);

    public ICommandContainer GetCommandContainer(string key)
    {
        if (this.commandContainers.Any(k => k.Key == key))
        {
            return this.commandContainers[key];
        }
        else
        {
            // Empty command (to avoid null reference exceptions)
            return new CommandContainer(key, new RelayCommand(p1 => { }));
        }
    }
```

## Easy usage

In XAML we can use the CommandAggregator instance of the view model like this:

```XAML
<Button Content="Print"
        Command="{Binding CmdAgg[Print].Command}" />
```

Indexer binding works with square brackets and the name of the registered command - you do not need any quotation marks!

The commands are wrapped into an ICommandContainer.
This container provides the possibility to add meta data, e.g. The caption to display on a WPF-Button.

Example (InitCommands method)
```C#
this.CmdAgg.AddOrSetCommand(
            "Print",
            new RelayCommand(p1 => Print(p1), p2 => CanPrint),
            new Dictionary<string, object>{ { "ControlCaption", "Print me" } });
```

Example (Usage in XAML)
```XAML
<Button
    Command="{Binding CmdAgg[Print].Command}"
    Content="{Binding CmdAgg[Print][ControlCaption]}" />
<Button
```

By this approach I was able to reduce the lines of code for command definitions
many thousand lines in larger projects - without loosing any functionality!
Each command definition/registration is reduced to exact one C# statement.

# Further ICommand features

## Hierarchy command

This HierarchyCommand also implements the ICommand interface and derives from the RelayCommand class.
A HierarchyCommand can have child commands. Therefore the HierarchyCommand depends on the child commands. Fore example: a SaveAll command depends on the save commands of all child commands.
To configure the dependency of the HierarchyCommand startegies can be used for Execute and CanExecute:

**HierarchyCanExecuteStrategy**
* DependsOnMasterCommandOnly
* DependsOnAllChilds
* DependsOnAtLeastOneChild

**HierarchyExecuteStrategy**
* MasterCommandOnly
* AllChildsOnly
* MasterAndAllChilds

With these values many business cases can be realized.

**A short example:**
```C#
   // Adding a hierarchy command
   ICommand save1Cmd = new RelayCommand(p1 => Save1(), p2 => this.CanSave1);
   ICommand save2Cmd = new RelayCommand(p1 => Save2(), p2 => this.CanSave2);

   this.CmdAgg.AddOrSetCommand("SaveCmd1", save1Cmd);
   this.CmdAgg.AddOrSetCommand("SaveCmd2", save2Cmd);

   HierarchyCommand saveAllCmd = new HierarchyCommand(
                p1 => {  },  -- no Execute required due to HierarchyExecuteStrategy
                p2 => null,  -- CanExecute not required due to HierarchyCanExecuteStrategy
                HierarchyExecuteStrategy.AllChildsOnly,
                HierarchyCanExecuteStrategy.DependsOnAllChilds);

   saveAllCmd.AddChildsCommand(new List<ICommand> { save1Cmd, save2Cmd });
   this.CmdAgg.AddOrSetCommand("SaveAll", saveAllCmd);
```

## Pre- and post action delegates

The RelayCommand was extended by two delegates "PreActionDelegate" and "PostActionDelegate".
This enables you to add logic to run before and after the command execution delegate runs.
Therefore these delegates enables you to "inject" cross cutting concerns without the need to change your execution delegate logic.

+A short example (performance messurement):+
```C#
            this.CmdAgg.AddOrSetCommand(
                                        "Print",
                                        new RelayCommand(
                                            p1 => MessageBox.Show("Print called"),
                                            p2 => true,
                                            this.performanceChecker.Start,
                                            this.performanceChecker.Stop));
```

The performanceChecker instance is only a wrapper class to start and stop a stopwatch instance and writes the ellapsed time to the debug window. You can use any Action delegate.

When you like to set/change/remove these actions dynamically you can use the corresponding methods of the RelayCommand class.
```C#
            RelayCommand cmd = this.CmdAgg["Print"].Command as RelayCommand;
            if (cmd != null)
            {
                 cmd.OverridePostActionDelegate(null);
                 cmd.OverridePreActionDelegate(null);
            }
```
# Further features of the ViewModel base class BaseVm

## The 'DependsOn' attribute

Sometimes properties of a view model class depends on others. A simlpe example is the calculation of the sum of two input values.
In a classic way the code of the view model for this purpose could look like that:
```C#
        public decimal? FirstInput
        {
            get => this.firstInput;
            set
            {
                this.firstInput = value;
                this.NotifyPropertyChanged(nameof(FirstInput));
                this.NotifyPropertyChanged(nameof(Result));
            }
        }

        public decimal? SecondInput
        {
            get => this.secondInput;
            set
            {
                this.secondInput = value;
                this.NotifyPropertyChanged(nameof(SecondInput));
                this.NotifyPropertyChanged(nameof(Result));
            }
        }

        public decimal? Result
        {
            get => this.firstInput + this.secondInput;
        }

```

Wouldn't it be better to define/see the dependencies between the properties at one place: in my opinion the Result property would be a very good place.
Therefore, with the DependsOn attribute and the optimzed BaseVM class this can be achieved easier and better to read:
```C#
        public decimal? FirstInput
        {
            get => this.firstInput;
            set => this.SetPropertyValue(ref this.firstInput, value);
        }

        public decimal? SecondInput
        {
            get => this.secondInput;
            set => this.SetPropertyValue(ref this.secondInput, value);
        }

        [DependsOn(nameof(FirstInput), nameof(SecondInput))]
        public decimal?

## 'SetPropertyValue'

In some cases in could be helpful to additionally execute some
code lines before or - normally - after the set and notification is done.
Therefore the possibility to additionally define two action delegates is implemented.
The following example shows it based on two simple methods of a performance checker instance.

```C#
        public bool ExampleProperty
        {
            get => this.exampleProperty;
            set => this.SetPropertyValue(
                ref this.exampleProperty,
                value,
                () => this.performanceChecker.Start(),
                () => this.performanceChecker.Stop());
        }
```

Furthermore the BaseVm class has a new protected property called SuppressNotifications.
By default this ist set to false. If you want to suppress notifications (e.g. to temporarily improve performance by decoupling from UI)

```C#
    this.SuppressNotifications = true;
```

The command aggregator interface itself was also extended by a new overload for the AddOrSetCommand method.
The definition for always executable commands  can shortly defined by omitting the can execute delegate.

The definition
```C#
    this.CmdAgg.AddOrSetCommand("Exit", new RelayCommand(p1 => MessageBox.Show("Exit called"), p2 => true));
```
can now be simplified with the following one:

```C#
    this.CmdAgg.AddOrSetCommand("Exit", new RelayCommand(p1 => MessageBox.Show("Exit called")));
```

## Automatic values storage, custom aggregators and notification optimization

1. An optimization: Normally, a **notification** is always triggered for value assignments to a (bindable) property. With this implementation this only happens if the value has effectively changed - in other words, if the content has changed.
2. A further feature: automatic values storage<br/>
The base ViewModel now has a **value storage** in which the values for the (bindable) properties are stored. This means that no more private fields have to be declared in the ViewModels. This advantage brings with it a small disadvantage: when reading the values a 'cast' is necessary. For properties that are read very frequently, you should therefore use this with caution to avoid performance disadvantages. Of course, you can continue to work with private fields in the future. A mixture of both concepts within a ViewModel is not recommended with regard to the readability of the code (but is possible without problems).<br/>
    ```C#
    public bool CanSave
    {
        // using NO private field -> using automatic values storage (from base class).
        get => this.GetPropertyValue<bool>();
        set => this.SetPropertyValue<bool>(value);
    }
    ```
3.  Another feature: **custom command aggregator** implmentations<br/>
It is possible to use - if required - your own implementation of the Command Aggregator. For this purpose this implementation can be registered at the factory class. Until a possible deregistration the own implementation will be used by the factory. The condition is that the implementation has a parameterless constructor.<br/>
**register:** (to use an own/custom implementation)
    ```C#
    CommandAggregatorFactory.RegisterAggreagtorImplementation<OwnAggregator>();
    // now the own/custom aggregator will be used!
    ```
    **unregister** (to change the factory behavior during runtime - otherwise not necessary):
    ```C#
    CommandAggregatorFactory.UnregisterAggreagtorImplementation<OwnAggregator>();
    // now the default aggregator will be used again!
    ```

## Version <IP_ADDRESS>: ObservableCollectionExt, attached properties Focus and WindowCloser

The version <IP_ADDRESS> contains three new features.

1. The class ObservableCollectionExt extends the well-known framework class ObservableCollection with fast methods to add and reduce multiple elements. A replace method has also been created that exchanges elements in the collection.<br/>
    ```C#
    public ObservableCollectionExt<Person> Persons
    {
        get { return this.GetPropertyValue<ObservableCollectionExt<Person>>(); }
        private set { this.SetPropertyValue<ObservableCollectionExt<Person>>(value); }
    }

    private void Test()
    {
        this.Persons.AddRange(this.allPersons);
        this.Persons.RemoveItems(this.allPersons);
        this.Persons.Replace(allPersons.First(), new Person { Name = "Gerhard", Age = 27 });
    }
    ```
2. Attached property to set/remove focus from a Control.<br/>

    ```XAML
     <TextBox
                ap:Focused.Focused="{Binding Path=FirstValueHasFocus, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                Grid.Row="1"
                Grid.Column="0">
     </TextBox>
    ```
3.  The third new feature: is an attached property to close views from the view model.<br/>

    ```C#
    private void CloseWindow()
    {
        // setting the value to true (or false) will close the window using this instance as its DataContext
        // and uses the attached property.
        // The property itself is defined in class BaseVm.
        this.WindowResult = true;
    }
    ```

    ```XAML
    <Window
    x:Class="CommandAggregatorExample.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ap="clr-namespace:WPFCommandAggregator.AttachedProperties;assembly=WPFCommandAggregator"
    ap:WindowCloser.WindowResult="{Binding WindowResult, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
    Title="Command Aggregator Example"
    Width="600"
    Height="600"
    WindowStartupLocation="CenterScreen"/>
    ```

(see also the example solution (source code))


text:
# Attendees app

Created using Slim PHP micro-framework for the API part and Materialize CSS UI library for the API-consuming page.

### Quick install
Grab the .zip or clone repository in your web server root.
You can put it alongside your other projects - this is what I did, accessing the app UI with `localhost/attendees/index.html`, where `/attendees` part of the URL path corresponds to the name of your folder in server root.
Development has been done on Windows machine with IIS but there is `.htaccess` set up for Apache too.
Hopefully line endings will not be a problem.

## Features
* The API is RESTful and returns results in JSON format
* The API has an endpoint to return a list of all conference attendees, using `localhost/attendees/attendees`
* It also returns details for each attendee, e.g `localhost/attendees/attendees/9649`
* Pagination implemented
* BONUS: Interleaving results by interest implemented, they get highlighted at the top of results listing. There is an API endpoint `localhost/attendees/interests/` to return list of interests to populated dropdown of a UI control

## A few screen grabs
* http://screencast.com/t/zlCsRmIArNB
* http://screencast.com/t/K8s1u0ofdHp
* http://screencast.com/t/bxTb9Knf0f2
* http://screencast.com/t/8oaC3DMxH

### System requirements

You need **PHP >= 5.3.0**.
New, standards-supporting browser such as Chrome or Opera.

### Setup your web server
If you are using Wordpress then I presume your Apache has `mod_rewrite` module enabled or your IIS has `url_rewrite` module installed.
Necessary respective `.htaccess` or `Web.config` files are already present in the project folder.

license: MIT

repository: emkorybski/attendees

branch_name: refs/heads/master

extension: markdown

license_type: permissive

repo_name: emkorybski/attendees


text:
# ESP8266 Software Serial Beacon

## TL;DR
Send's predefined data via software defined 2nd serial device at
configurable speed and every configurable x seconds. Useful as
simulator when working on projects which are reading from serial.

## Introduction
When working on an ESP32 based project to read sml data from a
smartmeter, I couldn't find out why the ... the ESP32 didn't read
any bytes from serial input. To check my code, I took a spare
ESP8266 and built this simulator which sends out the same sml data
every five seconds. This way I found out that my code was OK but
the cable eventually got broken...

## Configuration
You may reconfigure the code to send out whatever data you need.
Please make sure you define it in the variable ser_data as hexadecimal
values, all in UPPERcase letters.

These are the main parameters to fiddle with:
* SLEEP - time in microseconds between the beacons
* BAUD1 - baud rate for default serial (means debug via USB)
* BAUD2 - baud rate for addtl. software serial device
* RXPIN - GPIO pin for reading data on softserial device
* TXPIN - GPIO pin for sending data on softserial device

## Caution with software serial
Many people report software serial to be unstable when used together
with wifi or bluetooth which I can confirm. Recently I tried to use
an ESP8266 for reading data via software serial and sending it to
a database by wifi. The ESP8266 restarted now and then, in time spans
of a few minutes up to an hour. Sometimes it mixed up up the incoming
bits, delivering wrong values. So I don't recommend using ESP8266
with software serial in production. Use ESP32 instead which has three
hardware serial devices.

extension: md


text:
---
title: Reduce
date: 2020-10-05
description: The savvy programmer's higher order function
tags: ["javascript", "functional"]
---

## Frequencies

```javascript
;["hello world"].reduce((letters, letter) => {}, {})
```

## Bucket Sort

```javascript
;[1, 2, 3, 4].reduce((results, number) => {}, { even: [], odd: [] })
```

## Map + Setting a boolean

```javascript
;[].reduce((accumulator, current) => {}, { mapped: [], isTrue: false })
```


text:
# Code Radio (vscode-extension)

[![Visual Studio Marketplace](https://vsmarketplacebadge.apphb.com/version/lakuapik.coderadio.svg?tyle=flat-square)](https://marketplace.visualstudio.com/items?itemName=lakuapik.coderadio)
[![Installs](https://vsmarketplacebadge.apphb.com/installs-short/lakuapik.coderadio.svg?tyle=flat-square)](https://marketplace.visualstudio.com/items?itemName=lakuapik.coderadio)

Listen 24/7 music designed for coding, in your favorite editor: vscode.

## Why

I love this https://coderadio.freecodecamp.org, but i want to listen it
directly in vscode, so i created this.

## Requirements

You need to have `vlc` installed in order to play the stream.

Also don't forget to check `vlc_path` setting and suits your need.


text:
  [![CRAN status](https://www.r-pkg.org/badges/version/rUM)](https://CRAN.R-project.org/package=rUM)
  [![Lifecycle: stable](https://lifecycle.r-lib.org/articles/figures/lifecycle-stable.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
  [![CRAN downloads](https://cranlogs.r-pkg.org/badges/rUM)](https://www.r-pkg.org/pkg/rUM)

# rUM
This is a collection of R things from your friends at UM (The University of Miami).

rUM includes:

+ A research project template.  It creates a new RStudio project that has your choice of an `analysis.qmd` Quarto file or `analysis.Rmd` R markdown file with tidyverse and conflicted.
+ Quarto and R Markdown templates which include they YAML header and start up blocks that load the tidyverse and conflicted packages.

* 💥 NEW in Version 1.0.2 💥 We cleaned (i.e., linted and styled) the code and fixed a couple small formatting issues in the paper templates.  The automatically produced paper code should pass checks based on the [tidyverse style guide](https://style.tidyverse.org/).

## How to I add rUM?

Modern versions of the RStudio interface (v2022.07 or later) ships with Quarto; update to the most recent version of RStudio [here](https://posit.co/download/rstudio-desktop/). If you know what you are doing, you can install the latest version of Quarto directly from [here](https://quarto.org/docs/get-started/).

Then you should run this in the console of RStudio:

```r
if (!requireNamespace("remotes")) install.packages("remotes")
remotes::install_cran("rUM")
```

If you would like the (unstable) development version, use the following code instead:
```r
if (!requireNamespace("remotes")) install.packages("remotes")
remotes::install_github("RaymondBalise/rUM")
```

## Where can I get rUM?
https://raymondbalise.github.io/rUM/

https://github.com/RaymondBalise/rUM

## How do I make rUM research project?

1. Use File > New Project > New Directory
1. Scroll down and then click **rUM Research Project Template**
1. Specify where you want your research project to be saved.

#### How do change the reference style for my paper?
The default reference style is the New England Journal of Medicine.  The style is set by the [Citation Style Language](https://citationstyles.org/) (`csl:`) option near the top of the file.  To use a different style, download a csl file from [https://www.zotero.org/styles/](https://www.zotero.org/styles/) into the folder with your analysis file.  Then change *the-new-england-journal-of-medicine.csl* to the name of the file you downloaded.

#### How do I control what files appear in my reference section?
The analysis file includes this code near the bottom:

```
  c(
    .packages(),
    "rUM",
    "table1"
  ),
```

If you want to acknowledge a package that is not used directly in your analysis file, add its name inside of the `c()` function.  The authors of the packages that you used for exploratory data analysis will thank you.

After you knit/render the analysis file once the packages will appear in the "packages.bib" file in the same directory/folder as your analysis file. If you are using the RStudio **Visual Editor**, put the cursor when you want to add the citation, then use the Insert Menu and choose *@ Citation...* and pick the article.  If you are using the Visual Studio **Source Editor**, open the "packages.bib" file, find the manual reference for the package that you want to add and copy it.  For example, if you needed to add a reference to the `rUM` package you would find this line:

```
@Manual{R-rUM
```

and copy the reference name.  Here the name is `R-rUM`. Paste that where you want the citation like this `[@R-rUM]`.

## How do I use rUM for `R Markdown` headers?

1. Use File > New File > RMarkdown...
1. Click **From Template**
1. Choose a template
  + html2 with rUM
  + html2 Details with rUM
  + pdf2 showing LaTeX with rUM
  + bookdown_site with rUM

This will create a new subdirectory in your current working directory with the same name as the name of the `.Rmd` file you specified. Within this directory, you will find the analysis R Markdown file. For example, if you created an R Markdown file called `wrangle_cytometry_data.Rmd` with the steps above, then your current directory will now have a subdirectory called `wrangle_cytometry_data/` which will contain the file `wrangle_cytometry_data.Rmd` and any subsequent files from the knitting process (such as `.PDF`, `.html`, or `.docx` files created by knitting the RMarkdown document).

### What are the headers?

#### html2 with rUM
This is a basic web page

#### html2 Details with rUM
This shows a table of contents

#### pdf2 showing LaTeX with rUM
PDF report where table and figures don't float to other pages.  Many thanks to https://stackoverflow.com/questions/16626462/figure-position-in-markdown-when-converting-to-pdf-with-knitr-and-pandoc

#### bookdown_site with rUM
A bookdown website with a good table of contents for a book

repository: RaymondBalise/rUM

gha_language: R

gha_license_id: NOASSERTION

repo_name: RaymondBalise/rUM


text:
# Two-factor-authentication for Voyager II

This plugin for Voyager II uses [pragmarx/google2fa-laravel](https://github.com/antonioribeiro/google2fa-laravel) for two-factor-authentication.

## Installation

First, run `composer require emptynick/voyager-2fa`.
After that run `php artisan 2fa:install`.

This will:

1. Publish `pragmarx/google2fa-laravel` config file
2. Publish a migration to add a field named `google2fa_secret` to your `users` table
3. Migrate

You can skip publishing the config file and migrating.
This is helpful when you want to modify the migration file.

## Usage

By default, this plugin does not force you to use 2FA.
Whenever a 2FA code is assigned to a user, it will ask for it when logging-in.

### Activating 2FA for your account

Open the top-right user dropdown and click `Manage 2FA`.
There you will see a QR code and an input box.
Scan the QR code with your phone or enter the code manually and enter the generated OTP into the input.
Click `Enable` and the code will be stored.
Now, whenever you log-in, you'll be asked for a one-time-password.

![Warning](./.github/assets/manage.png)

### Disable 2FA

Clicking the `Disable` button will remove the OTP code from the database.
You are **not** required to enter an OTP when logging-in.
**This requires the setting `2FA.allow_disabling` to be `on`!**

### Renew 2FA code

When 2FA is active, you can simply renew the code. Proceed like described in `Activating 2FA for your account` and click on `Renew` instead of `Enable`!

## Settings

This plugin publishes some settings.

### 2FA.force_2fa

When active, this setting will prevent the user to open **any** page before setting-up 2FA. Defaults to false.

### 2FA.show_warning

Shows a warning whenever a page is opened and 2FA is **not** activated for the current user. Defaults to true.

![Warning](./.github/assets/warning.png)

### 2FA.allow_disabling

Allow users to disable two-factor-auth. Defaults to true.

branch_name: refs/heads/main


text:
---
title: Aspose.BarCode for Cpp 18.12 Release Notes
type: docs
weight: 10
url: /cpp/aspose-barcode-for-cpp-18-12-release-notes/
---

{{% alert color="primary" %}}

This page contains release notes information for Aspose.BarCode for C++ 18.12.

{{% /alert %}}
## **All Changes**

|**Key**|**Summary**|**Category**|
| :- | :- | :- |
|BARCODENET-37024|Not able to read dotted barcodes from TIFF images|Bug|
## **Public API and Backward Incompatible Changes**
None

gha_license_id: MIT


text:
# Simple string reversal
[*View on Codewars*](https://www.codewars.com/kata/simple-string-reversal)

In this Kata, we are going to reverse a string while maintaining spaces.

For example:
```Haskell
solve("our code") = "edo cruo"
-- Normal reversal without spaces is "edocruo".
-- However, there is a space after the first three characters, hence "edo cruo"

solve("your code rocks") = "skco redo cruoy"
solve("codewars") = "srawedoc"
```
More examples in the test cases. All input will be lower case letters and in some cases spaces.

Good luck!

Please also try:

[Simple time difference](https://www.codewars.com/kata/5b76a34ff71e5de9db0000f2)

[Simple remove duplicates](https://www.codewars.com/kata/5ba38ba180824a86850000f7)

## Timeline
- Created: 2018-01-31
- Published: 2018-01-31
- Approved: 2018-01-31
- Completed: 2018-02-06

repository: prayatma/codewars

repo_name: prayatma/codewars


text:
TutorialKit
===========

TutorialKit is a client/server solution which uses unit tests to create checkpoints, milestones and interactive quizzes in your Xcode Tutorial projects.

##How It Works

Subclass TutorialKitTest and write unit tests as you normally would using the XCTest framework

In the AppDelegate of your Tutorial project (the Xcode project your students/readers will download), add two lines to register you'd Tutorial Project's UUID and the web address of your TutorialKit server.

Build and Run your TutorialKit target, this will compile a static library with your tests and the necessary networking code to check-in with your server when a milestone is passed.

The build and run step also creates a ruby file containing the server-side portion of your tests.

Login to the admin panel of your TutorialKit server and create a new Tutorial.

Paste in the same UUID used in your AppDelegate code, then upload the generated TutorialKitTests.rb file and finally, upload the completed Xcode project folder (compress the entire project folder to .zip first).

When a user downloads the Xcode Tutorial Project, the TutorialKit server will inject a unique ID for that user into the .xcodeproj file, so that milestones and checkpoints are reported with the unique user ID of the student, to your TutorialKit server.

##Getting Started

Clone this repo, and the corresponding server app repo.

Deploy the TutorialKit server app to Heroku, Digital Ocean, or your preferred PaaS/IaaS.

Create your xcode project for your tutorial

create a new target which imports the TutorialKit framework (see the bundled demo app for a good example)

Write your unit tests

Build/Run, then upload your project and ruby file to your TutorialKit server by logging in to https://yourserver.com/admin (default u/p is admin/admin)

repository: johnnyclem/TutorialKit

repo_name: johnnyclem/TutorialKit


text:
# PostPagesPageIdSubscribersSubscriber

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**email** | **str** | The email address for creating Email and Webhook subscribers. | [optional]
**endpoint** | **str** | The endpoint URI for creating Webhook subscribers. | [optional]
**phone_country** | **str** | The two-character country where the phone number is located to use for the new SMS subscriber. | [optional]
**phone_number** | **str** | The phone number (as you would dial from the phone_country) to use for the new SMS subscriber. | [optional]
**skip_confirmation_notification** | **bool** | If skip_confirmation_notification is true, the subscriber does not receive any notifications when their subscription changes.  Email subscribers will be automatically opted in. This option is only available for paying customers. This option has no effect for trial customers. | [optional]
**page_access_user** | **str** | The code of the page access user to which the subscriber belongs. | [optional]
**component_ids** | **list[str]** | A list of component ids for which the subscriber should recieve updates for. Components must be an array with at least one element if it is passed at all. Each component must belong to the page indicated in the path. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

repository: bsneade/statuspageio-python

repo_name: bsneade/statuspageio-python


text:
# Compressed list of IPv4

In this example we use SlimArray to store a list of IPv4, which is obtained from
a real IP database.

It shows that SlimArray memory cost is quite close to size of gzip-ed data.
But it provides instant access to the data without the need to decompress!

SlimArray consumes 2.1 MB while the gzip-ed iplist(`./iplist.go.gz`) consumes 2.0 MB:

```
map[bits/elt:18 elt_width:16 mem_elts:1678448 mem_total:2111640 n:902190 seg_cnt:882 span_cnt:13092 spans/seg:14]
```

# Usage

It loads the ip list into SlimArray and print the stat:

```sh
make
```

repository: forkkit/slimarray

repo_name: forkkit/slimarray


text:
Jedi
====
Level: Beginner
Technologies: Swift, iOS
Summary: A basic example of [aerogear-ios-sync](https://github.com/aerogear/aerogear-ios-sync), [aerogear-ios-sync-client](https://github.com/aerogear/aerogear-ios-sync-client)

What is it?
-----------
This project is a simple demo for the work around [AeroGear Differential Synchronization](https://github.com/aerogear/aerogear-sync-server).

There are two versions of the demo, ```JsonPatchSync``` to run the sync demo using [JsonPatch](https://tools.ietf.org/html/rfc6902) protocol or ```DiffMatchPatchSync``` that uses DiffMatchPatch [Google initial implementation](https://github.com/JanX2/google-diff-match-patch).

Both demos uses the [iOS SyncClient](https://github.com/aerogear/aerogear-ios-sync-client) which handles the communication with the sync server.
The [iOS SyncEngine](https://github.com/aerogear/aerogear-ios-sync) performs the actual work of the DiffSync protocol for the SyncClient.

System requirements
-------------------
- iOS8, iOS9
- Xcode version 7

Configure
---------

This project requires that the [AeroGear Differential Synchronization Server](https://github.com/aerogear/aerogear-sync-server/tree/master/server/server-netty) be running. Please refer to that project for instructions for starting the server.

To run on actual device, select the version you want to use,  modify ```<Demo>/AeroGearSyncDemo/Info.plist``` and change the SyncServerHost to match your IP address and make sure it matches the one on [AeroGear Differential Synchronization Server](https://github.com/aerogear/aerogear-sync-server/tree/master/server/server-netty).

Build and Deploy Jedi
---------------------

### Run it in Xcode

The project uses [cocoapods](http://cocoapods.org) 0.37.1 release for handling its dependencies. As a pre-requisite, install [cocoapods](http://blog.cocoapods.org/CocoaPods-0.36/) and then install the pod.

Choose the variant of the demo you want to use, enter the directory and run:

```bash
pod install
```

and then double click on the generated .xcworkspace to open in Xcode.

Application Flow
----------------

To test the application, you will need two Jedi demos running. For exemple:
- launch the application on your device
- launch the application on you simulator
- modify one field on simulator and see it instantly synchronized on device!

![import](Jedi.png)

repository: gauravmb/aerogear

repo_name: gauravmb/aerogear


text:
# RetrofitKotlinExample
Implementation of retrofit by using kotlin for understading

In order to understand retrofit, first you have to check the API response thoroughly, there are several way response may come. For example,

  {  }  which means object

  [  ] which means list

  [ { },  { } , { },  { } , { },  { } ] which means list of objects

[ { “data”  :  [ { }, { },  { } ]  } ] which means list of objects inside “data” object

{

    "page": 2,

    "data": [

        {

            "id": 4,

            "first_name": "Eve",

            "last_name": "Holt",

            },

        {

            "id": 5,

            "first_name": "Charles",

            "last_name": "Morris",

          }
    ]
    } which means object contains list of objects

  Identify the structure. Json strings will either have a Map (key-value pairs) or a List of Maps.
  Begins with curly braces? It’s a map.
Begins with a Square bracket? That’s a List of maps.

Generally it will be either @GET or @Post HTTP request method

@GET : you can see both key & value in the URL

@Post : you cant see key or value, it will be send as body

In the @GET or @Post HTTP request method there can be different kind of parameters pass inside the method

@Body – Sends Java objects as request body.

@PATH – https://restcountries.eu/rest/v2/capital/{cairo}

@Url – use dynamic URLs.

@Query – We can simply add a method parameter with @Query() and a query parameter name, describing the type. To URL encode a query use the form: @Query(value = "auth_token",encoded = true) String auth_token – http://jobs.bdjobs.com/apps/api/v1/joblist.asp?

@Field – send data as form-urlencoded. This requires a @FormUrlEncoded annotation attached with the method. The @Field parameter works only with a POST

@GET(Constant.CAPITAL)
    fun getCountry(@Path("capital") capitalOfCountry: String): Call<List<Country>>
Which means when getKountry is called then it gonna return <<list of country : it should be a pojo class >> the json objects gonna serialized in the POJO/model class.

Retrofit automatically serialises the JSON response using a POJO(Plain Old Java Object) which must be defined in advanced for the JSON Structure. To serialise JSON we need a converter to convert it into Gson first.

Gson :

Json is a FORMAT.

We need convert our data when it comes through Api so
Object ---> Json OR Json ---> object(POJO) so thats why we need Gson.

  /* --------------------------------HOW MVP WORKS-----------------------------------------
   * MODEL :
   * In Android, the role of a model is usually played by a data access layer
   * such as database API or REST API.
   *
   * VIEW :
   * View is basically a passive interface cum UI which is
   * responsible for routing user’s action to the presenter.
   * In Android, View can be your Activity, fragment or RecyclerView Adapters.
   * In general, View is not visible to your Model except
   * for the POJOS and entities of your application.
   * To put in more simpler terms, Views do not communicate directly to Models.
   * However, they talk to presenters.
   *
   PRESENTER :
   *  0. In MVP the presenter assumes the functionality of the "middle-man".
   * All presentation logic is pushed to the presenter.
   * 1. Listens to user action and model updates
   * 2. Updates model and view
   * 3. Presenter is the middleman or mediator between View and Model
   * which hold responsibilities of everything which has to deal
   * with presentation logic in your application.
   * In general terms, Presenter does the job of
   * querying your Model, updating the View while responding to the user’s interactions.
   * It monitors Model and talks to View so that
   * they can handle when a particular View needs to be updated and when to not.
   *
   Business logic should be part of presenter
    * Presenter: This is the brain of the app. All the business logic is kept here. It is responsible for keeping the view and model away from each other. View and Model can only talk through the Presenter. The view-model interaction can be:
       The view is requesting data from the model to show to the user.
       The model is updated in the background and now the view needs to be updated to show the latest information
       The view needs to update the model according to the user interaction.
       Presenter prides itself to handle all of this!!

repository: Firoz-Hasan/Retrofit-MVP-Kotlin-Example

repo_name: Firoz-Hasan/Retrofit-MVP-Kotlin-Example


text:
# Vault Demo

Repository to go with my talk on [How to Secure Your Microservices](https://andydote.co.uk/presentations/index.html?vault).

## Required Tools:

* Vagrant
* Vault client
* dotnet, if you want to run the sample apps
* Nomad client, if you want to try the ExternalConfigured app

## Setup:

1. `vagrant up`
1. `source .machine/env` - sets environment variables for Nomad, Vault etc.
1. `./postgres.sh` - sets up the database secrets engine
1. `./approles.sh` - creates the `demo_service` approle

## Apps

All apps just connect to postgres, and list all users/roles and their expiry times.

1. `DirectAccess`
    * uses vault master token
1. `AppRoleAccess`
    * uses a RoleID and SecretID.
    * Set `VaultRoleID` environment variable
    * Set `VaultSecretID` in the `appsettings.json`
1. `ExternalConfiguration`
    * Deploy with nomad (`nomad job run apps/external.nomad`)
    * Uses Nomad's Vault integration to prepopulate environment variables

repository: Pondidum/vault-demo

repo_name: Pondidum/vault-demo


text:
Redis Workload
==============

## Overview

Redis is an in-memory data structure store, used as database, cache and message broker.
It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.
Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

The benchmark implements the core functionality of a data store: setting, getting, and deleting keys.

Redis is an open source (BSD licensed) software available at the [Redis](http://redis.io/) web site.

## Implementation in RAIN

The current implementation of the Redis workload in RAIN only supports a limited set of Redis operations and data structures.
For instance, lists and hashes are not supported yet.

### Type of Operations

Currently, this implementation supports the following Redis operations:
- **DEL**: delete a key.
- **GET**: retrieve the value of a key.
- **SET**: set the value of a key.

### Configuration Properties

The Redis workload can be customized by means of a set of properties.
Of particular interest are properties for the *generatorParameters* and *loadProfile* keys of the *profiles.config.redis.json*.

For the *generatorParameters* key, the supported configuration properties are the following:
- **debug**: a boolean value (i.e., either as *"true"* or *"false"* string) indicating whether debugging messages must be displayed or not.
  Default value is: *"false"*.
- **rngSeed**: an integer number representing the seed used to initialize the random number generator used by the Redis generator; if set to `-1`, the random number generator will be initialized with the Java's default (i.e., to a value very likely to be distinct from any other invocation of the `java.util.Random` default constructor).
  Default value is: *-1*.
- **usePooling**: a boolean value (i.e., either as *"true"* or *"false"* string) indicating whether object pooling must be enabled or not.
  Default value is: *"true"*.

For the *loadProfile* key, there can be one or more *load profile* section (i.e., a piece of JSON code delimited by a pair of braces), each of which represents a specific workload to run against the Redis application.
The configuration properties supported by each load profile section are the ones defined by the load profile class (see property *loadProfileClass*), which in this case are inherited from both the `radlab.rain.util.storage.StorageLoadProfile` and `radlab.rain.LoadProfile` classes.
Those of particular interest are the following:
- **deletePct**: a non-negative real number representing the percentage of DEL operations.
  Default value is: *0*.
- **hotSet**: an array of non-negative integer numbers each of which representing the key of a hotspot object. This property takes precedence over the *numHotObjects* property.
  Default value is: *[]*.
- **hotTrafficFraction**: a non-negative real number representing the fraction of traffic to be destined to hotspots.
  Default value is: *0*.
- **interval**: a non-negative integer number representing the duration (in seconds) of this profile.
  Default value is: *0*.
- **keyGenerator**: a string representing the key generator class used in this profile (e.g., `radlab.rain.util.storage.UniformKeyGenerator`).
  Default value is: *""*.
- **keyGeneratorConfig**: an associative array containing properties for key generation.
  The supported properties are at least those defined by the `radlab.rain.util.storage.KeyGenerator` and possibly other ones provided by the key generator class (see property *keyGenerator*):
  - **a**: a positive real number greater than 1 representing the shape parameter (i.e., the exponent) of the Zipf probability distribution.
    Larger value implies taller peaks.
    This properties is used by the `radlab.rain.util.storage.ZipfKeyGenerator` key generator class.
  - **maxKey**: a non-negative integer number representing the minimum value a key can take.
    Default value is: *0*.
  - **minKey**: a non-negative integer number representing the maximum value a key can take.
    Default value is: *0*.
  - **r**: a positive real number greater than 0, used to shuffle keys around.
    This properties is used by the `radlab.rain.util.storage.ZipfKeyGenerator` key generator class.
  - **rngSeed**: an integer number representing the seed used to initialize the random number generator used by the key generator; if set to `-1`, the random number generator will be initialized with the Java's default (i.e., to a value very likely to be distinct from any other invocation of the `java.util.Random` default constructor).
    Default value is: *1*.

- **numHotObjects**: a non-negative integer number representing the number of hotspots to pick.
  Default value is: *0*.
- **readPct**: a non-negative real number representing the percentage of GET operations.
  Default value is: *0*.
- **size**: a non-negative integer number representing the size (in bytes) of each object.
  Default value is: *0*.
- **users**: a non-negative integer number representing the number of users to generate in this profile.
  Default value is: *0*.
- **writePct**: a non-negative real number representing the percentage of SET operations.
  Default value is: *0*.

### Compilation and Execution

#### Compilation

To compile the Redis workload, simply enter the following command:

    $ ant package-redis

#### Initialization

Initialization is not usually necessary unless your workload is primarily made of GET or DEL operations.
In such cases, you may want to preload some keys in the Redis data store.
To this end, you can either load them by means of either a [Redis client](http://redis.io/clients) or the `radlab.rain.workload.redis.RedisUtil` class:

    $ java -Xmx1g -Xms256m -cp rain.jar:workloads/redis.jar radlab.rain.workload.redis.RedisUtil <redis host> <redis port> <min key> <max key> <size>

#### Workload Driver Execution

To run the Redis workload, simply enter the following command:

    $ java -Xmx1g -Xms256m -cp rain.jar:workloads/redis.jar radlab.rain.Benchmark config/rain.config.redis.json

### Assumptions

None.

repository: rean/rain-workload-toolkit

gha_language: Java

repo_name: rean/rain-workload-toolkit


text:
# Go HMAC Validator

[![Go Report Card](https://goreportcard.com/badge/go.fraixed.es/hmacval)](https://goreportcard.com/report/go.fraixed.es/hmacval)
[![GoDoc](https://godoc.org/go.fraixed.es/hmacval?status.svg)](https://godoc.org/go.fraixed.es/hmacval)

A generic tiny Golang package to check HMAC signatures generated by Internet Services to guarantee the HTTP request origin.

## Usage

## Documentation

Package is documented following [Golang conventions](http://blog.golang.org/godoc-documenting-go-code) so you can generate them with [godoc command](https://godoc.org/golang.org/x/tools/cmd/godoc) or read them online on [godoc.org](https://godoc.org/go.fraixed.es/hmacval).

The package is served under a custom domain and a canonical import path is set in order to restrict to import this package through the _github.com_ domain, hence for getting it you have to

`go get go.fraixed.es/hmacval`

## Golang Version & dependencies

The library may work with a few previous Golang releases, however I haven't tested in any than 1.6.

The current dependencies are only used in the tests, which are [testify](https://godoc.org/github.com/stretchr/testify) [assert](https://godoc.org/github.com/stretchr/testify/assert) and [require](https://godoc.org/github.com/stretchr/testify/require)

## Roadmap

Write some benchmarks and do an implementation of using key/value byte slice as payload than a map to compare how map type probably penalize and it may be avoided.

## Why

After I implemented this concept in a node module, I thought that would be great to have this generic HMAC validation functionality for Golang, so I took the concept and I developed it in the Go way (this is not a the NodeJS implementation translated to Go).

## Related works

The same concept and similar functionality for [NodeJS](https://github.com/ifraixedes/node-hmac-validator)

## License

MIT, read [LICENSE](https://github.com/ifraixedes/go-hmac-validator/blob/master/LICENSE) file for more information.

repository: ifraixedes/go-hmac-validator

gha_language: Go

repo_name: ifraixedes/go-hmac-validator


text:
# Phrase Matcher Demo

This is a simple demo of the new lookup table feature in [rasa_nlu](https://rasa.com/docs/nlu/).  See the blog post accompanying this repository [here](https://medium.com/rasa-blog/entity-extraction-with-the-new-lookup-table-feature-in-rasa-nlu-94c6c30876a3)

The goal is to show how lookup tables may improve entity extraction under certain conditions and also give some advice on using this feature effectively.

This repo contains two demos:

1.  A simple restaurant example with very few training examples and only one entity.
2.  A medium-sized company name extraction example with a few thousand examples and several entities.

## Running the demo.

No installation is necessary although you must have [rasa_nlu](https://rasa.com/docs/nlu/) installed and version > 0.13.3 or above.

To run one or both of the demos:

	python run_lookup.py <demo_key>

where `<demo_key>` is one of `{food, company}`.  If `<demo_key>` is ommitted, it will run both of the demos.

### Code Structure

`data/` holds the training data and lookup tables for each of the demos.

`models/` is where the models are persisted.

`configs/` holds the rasa_nlu configs to do the baseline evaluation and the lookup table evaluation.

`img/` stores plots and outputs from the runs.

## Cleaning lookup tables

The script `filter_lookup.py` may be used to clean up lookup tables by removing any elements that match with a cross-list.

You can call this scripy by running

	python filter_lookup.py <lookup_in> <cross_list> <lookup_out>

`<lookup_in>` is a lookup table with newline-separated elements.

`<cross_list>` is either a comma or newline-separated list of elements that you'd like to remove from `<lookup_in>`

`<lookup_out>` is the name of the file that you'd like to write the filtered list to.

## Speed Testing

We include the directory `speed_test/` for testing the speed of training as a function of the lookup table size.

This generates random lookup tables and times each component of the training and evaluation process.  We use the company dataset `data/company/company_train_lookup.py`.

	cd speed_test
	python time_lookups.py

See `speed_test/README.md` for more details.

## Ngrams

A simple ngrams tester is included and can be run by

	python run_ngrams.py

This loads two lookup tables, `data/company/pos_ngrams.txt` & `data/company/neg_ngrams.txt`, each containing ngrams that were found to be influential to classifying phrases as company names.  We then compute the f1 score as a function of random noise injected into the entities.  The 'noise' value is the probability of a character flip in each character of each company entity in the test set.

This gives the following plot


text:
---
layout: post
title: "Interfacing PDM sensors with PFM spiking systems: application for Neuromorphic Auditory Sensors"
date: 2019-04-30 14:04:16
categories: arXiv_SD
tags: arXiv_SD Face
author: Angel Jimenez-Fernandez, Juan Pedro Dominguez-Morales, Daniel Gutierrez-Galan, Antonio Rios-Navarro, Ricardo Tapiador-Morales, Alejandro Linares-Barranco
mathjax: true
---

* content
{:toc}

##### Abstract
In this paper we present a sub-system to convert audio information from low-power MEMS microphones with pulse density modulation (PDM) output into rate coded spike streams. These spikes represent the input signal of a Neuromorphic Auditory Sensor (NAS), which is implemented with Spike Signal Processing (SSP) building blocks. For this conversion, we have designed a HDL component for FPGA able to interface with PDM microphones and converts their pulses to temporal distributed spikes following a pulse frequency modulation (PFM) scheme with an accurate configurable Inter-Spike-Interval. The new FPGA component has been tested in two scenarios, first as a stand-alone circuit for its characterization, and then it has been integrated with a full NAS design to verify its behavior. This PDM interface demands less than 1% of a Spartan 6 FPGA resources and has a power consumption below 5mW.

##### Abstract (translated by Google)

##### URL
[http://arxiv.org/abs/1905.00390](http://arxiv.org/abs/1905.00390)

##### PDF
[http://arxiv.org/pdf/1905.00390](http://arxiv.org/pdf/1905.00390)


text:
  PushFish API

A self-hosted alternative to services like PushBullet.

  Key Features •
  How To Use •
  Download •
  License

## Key Features

* Self-Hosted
  - Host your own instance, be in control of your data.
* Third-party service free
  - The API server needs no third-party services to function.
* Cross platform
  - Uses Docker, so Windows, macOS and Linux ready.

## Configuration

The pushfish API server reads various options from a configuration file. This configuration file can be specified by setting the environment variable `PUSHROCKET_CONFIG`. If this variable is not set, then the file is searched for in a default path.

```
     ~/.config/pushfish-api/pushfish-api.cfg # on Linux
     %APPDATA%\pushfish-api\pushfish-api.cfg # on Windows
     ~/Library/Application Support/pushfish-api/pushfish-api.cfg # on OSX
```

where the value for "user" will be changed to your current username. If this file does not exist, then the API server will generate a default configuration, which looks like this:

```
[database]
#for mysql, use something like:
#uri = 'mysql+pymysql://pushfish@localhost/pushfish_api?charset=utf8mb4'

#for sqlite (the default), use something like:
uri = sqlite:////home/pushfish/.local/share/pushfish-api/pushfish-api.db

[dispatch]
google_api_key =
google_gcm_sender_id =<PHONE_NUMBER>86
#point this at the pushfish-connectors zeroMQ pubsub socket
zeromq_relay_uri =

[server]
#set to 0 for production mode
debug = 1

```

the format of the database URI is an SQLAlchemy URL as [described here](http://docs.sqlalchemy.org/en/latest/core/engines.html)

## How To Use

To clone and run this application, you'll need [Git](https://git-scm.com) and [Docker](https://www.docker.com/get-started) installed on your computer. From your command line:

```bash
# Clone this repository
$ git clone https://gitlab.com/PushFish/PushFish-API

# Go into the repository
$ cd PushFish-API

# Build docker
$ docker build -t pushfish-api:latest .

# Run the app
$ docker run pushfish-api:latest
```

## Download

You can [download](https://gitlab.com/PushFish/PushFish-API) the latest version of the PushFish API server for Windows, Linux and MacOS.

## Clients

* [Android](https://www.gitlab.com/PushFish/PushFish-Android)

* More coming soon

## License

BSD

---

> [push.fish](https://push.fish)  ·
> GitLab [@PushFish](https://gitlab.com/PushFish)  ·
> GitHub [@PushFish](https://github.com/PushFish)

repository: OliverParoczai/pushfish-api

repo_name: OliverParoczai/pushfish-api


text:
# Distillation Workflow: Dual (Pairwise + In-batch-negatives) Supervision

![](documentation/figures/dual-supervision.png)

For dual supervision to work you need pairwise scores from teacher models, as described in [distillation_workflow_pairwise-supervision.md](documentation/distillation_workflow_pairwise-supervision.md) and in addition a trained ColBERT model (best trained with those same pairwise teacher scores, and without the MASK augmenting).

The ColBERT teacher used for in-batch-negatives is run in a dynamic subprocess and infers every batch as it comes from the dataloader (this makes it independent from the used dataloader), but usually we use it for TAS-Balanced

The required config settings are as follows:

````yaml
#
# pairwise supervision (via static scores)
#
train_pairwise_distillation: True
loss: "margin-mse"

#
# in batch teacher (via dynamic teacher)
#
in_batch_negatives: True
in_batch_neg_lambda: 0.75       # here you can scale the loss influence
in_batch_main_pair_lambda: 1    # if set to 0 only use in-batch neg loss
in_batch_neg_loss: "margin-mse" #KLDivTeacherList

dynamic_teacher: True
dynamic_teacher_in_batch_scoring: True

````

**Please cite TAS-Balanced as:**
````
@inproceedings{Hofstaetter2021_tasb_dense_retrieval,
 author = {Sebastian Hofst{\"a}tter and Sheng-Chieh Lin and Jheng-Hong Yang and Jimmy Lin and Allan Hanbury},
 title = {{Efficiently Teaching an Effective Dense Retriever with Balanced Topic Aware Sampling}},
 booktitle = {Proc. of SIGIR},
 year = {2021},
}
````

repository: luanps/matchmaker

repo_name: luanps/matchmaker


text:
Chip8
=====

What is?
--------

Chip8 is an old, old, old "VM" spec for games

"CHIP-8 is an interpreted programming language, developed by Joseph Weisbecker. It was initially used on the COSMAC VIP and Telmac 1800 8-bit microcomputers in the mid-1970s. CHIP-8 programs are run on a CHIP-8 virtual machine. It was made to allow video games to be more easily programmed for these computers." (https://en.wikipedia.org/wiki/CHIP-8)

There are many state-of-the-70s games for it
- BRIX
- PONG
- SNAKE
- ....

Main features
-------------

- 4096 bytes of ram (!!)

- 16 8-bit registers (V0 to VF). VF also serves as "FLAG"

- Two 60hz timers (Delay, Sound)

- Beeper

- 16 inputs, 0-F

- 64x32 display, 1 bit per pixel

- 35 opcodes, 16-bit fixed opcode length, stored in big endian byte order

- Amazing 1bpp font, 0 - F

Technial documentation
----------------------

[Cowgod's Chip-8 Technical Reference v1.0](http://devernay.free.fr/hacks/chip8/C8TECH10.HTM)

Boot sequence
-------------

Game image is loaded to address 0x200

Execution starts at 0x200

... That's it

DeMo
----

[.....]

Help
----

What is binary?
 1 byte = 8 bits = 8 switches storing the number in powers of 2

What is hex?
 Similar, but instead of '0' and '1' digits there are 16, '0' to 'F'

What is an opcode?
 It the numeric representation for an instruction for a cpu. Usually it is fixed in length, but there are architectures that have variable length encodings (x86 & co)

For any questions, poke skmp@emudev.org


text:
---
layout: "azuredevops"
page_title: "AzureDevops: azuredevops_serviceendpoint_kubernetes"
description: |-
  Manages a Kubernetes service endpoint Azure DevOps organization.
---

# azuredevops_serviceendpoint_kubernetes

Manages a Kubernetes service endpoint within Azure DevOps.

## Example Usage

```hcl
resource "azuredevops_project" "example" {
  name               = "Example Project"
  visibility         = "private"
  version_control    = "Git"
  work_item_template = "Agile"
  description        = "Managed by Terraform"
}

resource "azuredevops_serviceendpoint_kubernetes" "example-azure" {
  project_id            = azuredevops_project.example.id
  service_endpoint_name = "Example Kubernetes"
  apiserver_url         = "https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io"
  authorization_type    = "AzureSubscription"

  azure_subscription {
    subscription_id   = "00000000-0000-0000-0000-000000000000"
    subscription_name = "Example"
    tenant_id         = "00000000-0000-0000-0000-000000000000"
    resourcegroup_id  = "example-rg"
    namespace         = "default"
    cluster_name      = "example-aks"
  }
}

resource "azuredevops_serviceendpoint_kubernetes" "example-kubeconfig" {
  project_id            = azuredevops_project.example.id
  service_endpoint_name = "Example Kubernetes"
  apiserver_url         = "https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io"
  authorization_type    = "Kubeconfig"

  kubeconfig {
    kube_config            = <<EOT
                              apiVersion: v1
                              clusters:
                              - cluster:
                                  certificate-authority: fake-ca-file
                                  server: https://<IP_ADDRESS>
                                name: development
                              contexts:
                              - context:
                                  cluster: development
                                  namespace: frontend
                                  user: developer
                                name: dev-frontend
                              current-context: dev-frontend
                              kind: Config
                              preferences: {}
                              users:
                              - name: developer
                                user:
                                  client-certificate: fake-cert-file
                                  client-key: fake-key-file
                             EOT
    accept_untrusted_certs = true
    cluster_context        = "dev-frontend"
  }
}

resource "azuredevops_serviceendpoint_kubernetes" "example-service-account" {
  project_id            = azuredevops_project.example.id
  service_endpoint_name = "Example Kubernetes"
  apiserver_url         = "https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io"
  authorization_type    = "ServiceAccount"

  service_account {
    token   = "000000000000000000000000"
    ca_cert = "0000000000000000000000000000000"
  }
}
```

## Argument Reference

The following arguments are supported:

- `project_id` - (Required) The ID of the project.
- `service_endpoint_name` - (Required) The Service Endpoint name.
- `apiserver_url` - (Required) The hostname (in form of URI) of the Kubernetes API.
- `authorization_type` - (Required) The authentication method used to authenticate on the Kubernetes cluster. The value should be one of AzureSubscription, Kubeconfig, ServiceAccount.
- `azure_subscription` - (Optional) A `azure_subscription` block defined blow.
- `kubeconfig` - (Optional) A `kubeconfig` block defined blow.
- `service_account` - (Optional)  A `service_account` block defined blow.

---

A `azure_subscription` block supports the following:

The configuration for authorization_type="AzureSubscription".

- `azure_environment` - (Optional) Azure environment refers to whether the public cloud offering or domestic (government) clouds are being used. Currently, only the public cloud is supported. The value must be AzureCloud. This is also the default-value.
- `cluster_name` - (Required) The name of the Kubernetes cluster.
- `subscription_id` - (Required) The id of the Azure subscription.
- `subscription_name` - (Required) The name of the Azure subscription.
- `tenant_id` - (Required) The id of the tenant used by the subscription.
- `resourcegroup_id` - (Required) The resource group name, to which the Kubernetes cluster is deployed.
- `namespace` - (Optional) The Kubernetes namespace. Default value is "default".
- `cluster_admin` - (Optional) Set this option to allow use cluster admin credentials.

A `kubeconfig` block supports the following:

The configuration for authorization_type="Kubeconfig".

- `kube_config` - (Required) The content of the kubeconfig in yaml notation to be used to communicate with the API-Server of Kubernetes.
- `accept_untrusted_certs` - (Optional) Set this option to allow clients to accept a self-signed certificate.
- `cluster_context` - (Optional) Context within the kubeconfig file that is to be used for identifying the cluster. Default value is the current-context set in kubeconfig.

A `service_account` block supports the following:

The configuration for authorization_type="ServiceAccount". This type uses the credentials of a service account currently deployed to the cluster.

- `token` - (Required) The token from a Kubernetes secret object.
- `ca_cert` - (Required) The certificate from a Kubernetes secret object.

## Attributes Reference

The following attributes are exported:

- `id` - The ID of the service endpoint.
- `project_id` - The ID of the project.
- `service_endpoint_name` - The Service Endpoint name.

## Relevant Links

- [Azure DevOps Service REST API 7.0 - Endpoints](https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints?view=azure-devops-rest-7.0)

## Import

Azure DevOps Service Endpoint Kubernetes can be imported using **projectID/serviceEndpointID** or **projectName/serviceEndpointID**

```sh
terraform import azuredevops_serviceendpoint_kubernetes.example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
```


text:
![PTN Engine](<Doc/Logo/PTN%20Engine%20Logo.svg> "PTN Engine")

[![Build Status](https://travis-ci.com/vldtecno/PTN-Engine.svg?branch=master)](https://travis-ci.com/vldtecno/PTN-Engine)

# PTN Engine
The *PTN Engine* is a C++ library that implements Petri nets.
Its purpose is to provide a framework to other programs, enabling them
to have their business logic formally defined by Petri nets.

For more information read the documentation in the [Doc](Doc) directory. There is also
a [user guide](Doc/User%20Guide/UserGuide.md) that will help you getting started fast. Additionaly, examples of
the *PTN Engine* usage are available in the the [Examples](Examples) directory.

The *PTN Engine* is distributed under the [Apache License, Version 2.0](
http://www.apache.org/licenses/LICENSE-2.0)

repository: vldtecno/PTN-Engine

repo_name: vldtecno/PTN-Engine


text:
# angular-data-table

[![Join the chat at https://gitter.im/Swimlane/angular-data-table](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/swimlane/angular-data-table?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
![npm-version](https://img.shields.io/npm/v/angular-data-table.svg)
![Dependency Status](https://david-dm.org/swimlane/angular-data-table.svg)
![devDependency Status](https://david-dm.org/swimlane/angular-data-table/dev-status.svg)
![download-count](https://img.shields.io/npm/dm/angular-data-table.svg)

`angular-data-table` is a AngularJS directive for presenting large and complex data.  It has all the features you would expect from any other table but in a light package with _no external depedencies_. The table was designed to be extremely flexible and light; it doesn't make any assumptions about your data or how you: filter, sort or page it.

It was engineered from its conception to handle thousands of rows without sacrificing performance.  It was built for modern browsers using _ES6, CSS3 and HTML5_ and **only supports [Evergreen Browsers](http://eisenbergeffect.bluespire.com/evergreen-browsers/) and Angular >= 1.4.x and < 1.6.0**.

Sadly, this project is **not Angular2 upgrade compatible**. Fortunately, we have authored [ngx-datatable](https://github.com/swimlane/ngx-datatable) which is the successor to this project. **We are going to slowly be transitioning this project maintenance mode**. We will continue to provide feedback to the community and accept PRs but we won't be doing any major new development.

See live demos [here]( http://swimlane.github.io/angular-data-table/).

## Features

- Handle large data sets ( Virtual DOM )
- Left and Right Column Pinning
- Column Reordering
- Column Resizing
- Intelligent Column Width Algorithms ( Force fill / Flex-grow )
- Horizontal/Vertical Scrolling
- Virtual Paging WITH linked traditional pager
- Tree Grids
- Row Grouping
- Checkbox and Row Selection ( multi / single / keyboard / touch )
- Light codebase / No external deps
- Client-side AND Server Pagination / Sorting
- Rich header / column templates
- Fixed AND Fluid height
- Decoupled themeing with included Google Material theme
- Decoupled Cell tooltips on overflow
- Decoupled Column Add/Removing Menu
- Expressive Syntax

## Using It

#### Download

- NPM `npm install angular-data-table`
- JSPM `jspm install github:swimlane/angular-data-table`
- BOWER `bower install angular-data-table`

or Github download or clone of course!

#### Include

You've got 5 different options to include this in your build depending on your setup.

- `./release/dataTable.js` - A standalone file that was compiled with Babel (UMD)
- `./release/dataTable.min.js` - A minified standalone file that was compiled with Babel (UMD)
- `./release/dataTable.cjs.js` - A standalone file that was compiled with Babel (CommonJS)
- `./release/dataTable.es6.js` - Raw ES6 Version.

All distributions include babel helpers, so they do not have to be included separately.

There is also the CSS too:

- `./release/dataTable.css` - The base CSS, pretty much required
- `./release/material.css` - Material theme
- `./release/icons.css` - If you want to show fancy icons when sorting

#### Usage

Include the `data-table` module as a dependency:

```javascript
    var module = angular.module('myApp', [ 'data-table' ]);
```

Set the data and the options in your controller:

```javascript
    module.controller('HomeController', function($scope){
      $scope.options = {
        scrollbarV: false
      };

      $scope.data = [
        { name: 'Austin', gender: 'Male' },
        { name: 'Marjan', gender: 'Male' }
      ];
    });
```

then using expressive markup in your template:

```html
    <dtable options="options" rows="data" class="material dt">
      <column name="Name" width="300" flex-grow="2"></column>
      <column name="Gender">
        <strong>{{$row.name}}</strong>: {{$cell}}
      </column>
    </dtable>
```

and your off to the races! See live demos [here](http://swimlane.github.io/angular-data-table/).

## API

The data table can be created with the following `options`:

- `checkboxSelection`: Checkbox selection vs row click (default: `false`)
- `columnMode`: Possible values are `flex`, `force` and `standard` (default: `standard`)
- `columns`
  - `canAutoResize`: Whether the column can automatically resize to fill space in the table (default: `true`)
  - `cellDataGetter`: Type `function`. Returns content for the `cellRenderer`. If not provided, the cell data will be collected from row data instead (default: `undefined`)
  - `cellRenderer`: Type `function`. Returns HTML for the cell.
  - `className`: CSS class for the body cell (default: `undefined`)
  - `comparator`: Type `function`. Custom sort comparator, pass `false` if you want to do server sort
  - `flexGrow`: The growth factor relative to other columns (default: `0`)
  - `frozenLeft`: Column is pinned to the left (default: `false`)
  - `frozenRight`: Column is pinned to the right (default: `false`)
  - `group`: Whether to group by the column (default: `false`)
  - `headerCheckbox`:  Toggles the checkbox column in the header for selecting all values given to the grid (default: `false`)
  - `headerClassName`: CSS class for the header cell (default: `undefined`)
  - `headerRenderer`: Type `function`. Returns HTML for the cell (default: `undefined`)
  - `isCheckboxColumn`: Adds the checkbox selection to the column (default: `false`)
  - `isTreeColumn`: Adds +/- button and makes a secondary call to load nested data (default: `false`)
  - `maxWidth`: Maximum width, in pixels (default: `undefined`)
  - `minWidth`: Minimum width, in pixels (default: `100`)
  - `name`: Name of the column
  - `prop`: Property to use to get the data
  - `resizable`: Whether the column can be resized (default: `true`)
  - `sort`: Default sort asecending/descending for the column (default: `undefined`)
  - `sortBy`: Property by which to sort (default: `undefined`)
  - `sortable`: Whether the column can be sorted (default: `true`)
  - `template`
  - `width`: Width, in pixels (default: `150`)
- `emptyMessage`: Message to show when array is presented but contains no values (default: `'No data to display'`)
- `footerHeight`: Footer height in pixels. Pass a  `falsey` value for no footer (default: `0`)
- `headerHeight`: Header height in pixels. Pass a  `falsey` value for no header (default: `30`)
- `loadingMessage`: Loading message presented when the array is undefined (default: `'Loading...'`)
- `multiSelect`: Whether users can select multiple items (default: `false`)
- `paging`
  - `externalPaging`. Default `false`
  - `size`. Default `undefined`
  - `count`. Default `0`
  - `offset`. Default `0`
  - `loadingIndicator`. Default `false`
- `reorderable`: Whether you can reorder columns (default: `true`)
- `rowHeight`: Row height in pixels, necessary if using lazy rendering (default: `30`)
- `scrollbarV`: Enable vertical scrollbars (default: `true`)
- `selectable`: Whether users can select items (default: `false`)

## Contributing

#### Run Demos

Ensure you have the latest NPM and JSPM installed globally.  If you don't already have JSPM installed run: `npm install jspm -g`.

- `npm install`
- `jspm install`
- `gulp watch serve`
- Open your browser to `http://localhost:9000`

#### Build

`gulp release` to build Modules, ES* via Babel and compile.

## Credits

`angular-data-table` is a [Swimlane](http://swimlane.com) open-source project; we believe in giving back to the open-source community by sharing some of the projects we build for our application. Swimlane is an automated cyber security operations and incident response platform that enables cyber security teams to leverage threat intelligence, speed up incident response and automate security operations.

repository: swimlane/angular-data-table

gha_language: JavaScript

repo_name: swimlane/angular-data-table


text:
# Scala.js typings for angular-gettext

Typings are for version v2.1.1

## Library description:
Gettext support for Angular.js

|                    |                 |
| ------------------ | :-------------: |
| Full name          | angular-gettext |
| Keywords           | angular, gettext |
| # releases         | 2 |
| # dependents       | 0.0 |
| # downloads        | 45102.333333333336 |
| # stars            | 654.0 |

## Links
- [Homepage](http://angular-gettext.rocketeer.be/)
- [Npm](https://www.npmjs.com/package/angular-gettext)

## Note
This library has been generated from typescript code from [DefinitelyTyped](https://definitelytyped.org).

Provided with :purple_heart: from [ScalablyTyped](https://github.com/oyvindberg/ScalablyTyped)

## Usage
See [the main readme](../../readme.md) for instructions.

repository: ScalablyTyped/Distribution

repo_name: ScalablyTyped/Distribution


text:
# Debugging

luma.gl has a number of provisions for debugging designed to help you save time during development.

## id strings

Most classes in luma.gl allow you to supply and optional `id` string to their constructors. This allows you to later easily check in the debugger which object (which specific instance of that class) is involved in a stack trace.

```js
const program = new Program(gl, {id: 'cube-program', ...});
const program = new Program(gl, {id: 'pyramid-program', ...});
```

`id`s that you provide are also used by the built-in logging.

## Logging

luma.gl has a logging mechanism. Set the global variable luma.log.level to 3 (can be done in the browser console at any time) and luma will print tables for uniforms and attributes providing information about their values and types before each render call. This can be extremely helpful for checking that shaders are getting valid inputs.

## Shader compilation errors

luma.gl takes care to extract as much information as possible about shader compiler errors etc, and will throw exceptions with very detailed error strings when shaders fail to compile. luma.gl also injects and parses `glslify` "shader names", making it possible to name shaders inside the shader code, making it easier to identify which shader is involved when e.g shader parsing errors occur.

## Parameter Validation

luma.gl runs checks on attributes and buffers when they are being set, catching many trivial errors such as setting uniforms to `undefined` or wrong type (scalar vs array etc).

Buffers will also have their first values checked to ensure that they are not NaN. As an example, setting uniforms to illegal values now throws an exception containing a helpful error message including the name of the problematic uniform.

## Debug Module

Importing<EMAIL_ADDRESS>will enable creation of debug contexts for several **luma.gl** functions. See [@luma.gl/debug](/docs/api-reference/debug) for more information.

```js
import {createGLContext} from<EMAIL_ADDRESS>import<EMAIL_ADDRESS>const gl = createGLContext(gl, {debug: true});
```


text:
# WAVES Visual Pathway

# The WAVES Project

The WAVES project combines skill sets of both academic and enterprise partners to make Scenario-based learning (SBL) more accessible for a wide range of professions.  SBL techniques are widely recognised as a key tool in the educational toolkit, for safe training in competency and decision-making.

[http://wavesnetwork.eu](http://wavesnetwork.eu)

# Description

The pathway visualizer tool extends OpenLabyrinth 3.1 and it is executed at the end of a scenario, for a single user session, when the final node of the scenario is visited. The graph contains a node for each screen card and the links among them showing the possible transitions between the states in the scenario.The tool highlights all visited nodes from a single session of the user (session_traces) in a different color.

# Online demo

Visit the following link:

[WAVES Visual Pathway Demo](http://olab31.wavesnetwork.eu)

# Installation

1. Install OpenLabyrinth 3.1 following the instrcution at [https://github.com/olab/Open-Labyrinth/wiki/Installing-Open-Labyrinth](https://github.com/olab/Open-Labyrinth/wiki/Installing-Open-Labyrinth)

2. Overwrite the  ```renderlabyrinth.php``` and ```basic.php``` found
in the path:
 ```php
 ../application/classes/controller/renderlabyrinth.php
```
 and
```php
../application/views/labyrinth/skin/basic/basic.php respectively with the files placed here.
 ```

# License
WAVES Visual Pathway is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.

repository: wavesnetwork/vispath

repo_name: wavesnetwork/vispath


text:
***THIS PROJECT HAS MOVED TO https://odibpas.visualstudio.com/React%20State%20Template/_git/React%20State%20Template%20Starter***

# state-template-starter

This is a starter repo for projects using the [state-template](https://github.com/vollmerr/state-template) package.

## About
This project uses [create-react-app](https://github.com/facebook/create-react-app) as it's foundation, refer to their documentation for issues related to webpack/bundling, extending configurations, etc.

It also uses the [state-template](https://www.npmjs.com/package/state-template) package as the framework for building [CA State Template](http://template.webstandards.ca.gov/sample/) styled react websites, refer to their documentation for issues related to available components and requirements.

## Quick Start
1. **Clone the Repo**: `git clone https://github.com/vollmerr/state-template-starter.git`
2. **Install Dependencies**: `npm install`
3. **Start Locally**: `npm run start` then navigate to http://localhost:3000

## Running Locally
Use `npm run start:<ENV>`, where `<ENV>` is the environment target.
This will start the project at http://localhost:3000.

For example, use `npm run start:prod` to start the application pointing at the production API.

## Building
Use `npm run build` to build the project for production, using the `.env.production` environment variables. Adding a `.env.production.local` will allow overriding these variables.

Use `npm run build:staging` to build the project for the staging environment, using the `.env.staging` environment variables. Adding a `.env.staging.local` will allow overriding these variables.

The output will be placed in the `/build` folder.

## Testing
Use `npm run test` to perform a single run of all files with a test coverage report.

Use `npm run test:watch` to rerun tests on only files changed (by default) after every file save. To update snapshots, use this command and press `u`.

Environment variables from the `.env.test` are used when running tests.

### Environment Variables
Environments can be configured using the `.env.<ENV>`, where `<ENV>` is the environment. For example, `.env.development` targets running the application in development. Do not add any secret values to these files, such as API keys. The following is the intent of the environment targets:

environment | target
-|-
development | for running locally
production | for running in production
staging | for running in staging
test | for running tests locally

To configure overrides for a given environment, create a `.env.<ENV>.local` file, such as `.env.development.local`. This file will not be added to version control and can therefore contain secrets such as API keys.

**create-react-app** requires all environment variables to be prefixed with `REACT_APP_`, for example use `REACT_APP_API_URL` instead of `API_URL`. Environment variables without the prefix will be stripped out. Refer to create-react-app's [env var documentation](https://create-react-app.dev/docs/adding-custom-environment-variables/) for more details on how it handles them.

## Polyfills (IE...)
This project by default loads the `react-app-polyfill` package for IE11 support, in the `src/index.js` file.

repository: vollmerr/state-template-starter

repo_name: vollmerr/state-template-starter


text:
mvc-spa
=======

As requested, a basic proof-of-concept for [Turn your ASP.NET MVC app into a Single Page Application with one classy Sammy.js route](http://blog.apterainc.com/bid/313071/turn-your-asp-net-mvc-app-into-a-single-page-application-with-one-classy-sammy-js-route).

The **About** and **Contact** links in the header navigation have been updated to reflect the fact that these views get handled by the Sammy route in question, and are loaded into the page via an out-of-band request. I have left it as an exercise for you, dear reader, to update the other links in the app in a similar fashion.

repository: kyklovod/mvc-spa

repo_name: kyklovod/mvc-spa


text:
# ![Jansi](http://jansi.fusesource.org/images/project-logo.png)

## [Jansi 1.7][1_7], released 2011-09-21
[1_7]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.7

* Updated bundled native libraries:
  * Windows: Adding support for PeekConsoleInputW, FlushConsoleInputBuffer so that CTRL-C can be handled by jline. Discarding mouse events on readConsoleInput.
  * Linux: Built against glib 2.0 to be compatible with more versions of Linux.

## [Jansi 1.6][1_6], released 2011-06-19
[1_6]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.6

* Upgrade to HawtJNI 1.2 to pick up a fix to support 32 and 64 bit JVMs on a single machine
* Add copy constructor for Ansi class.
* Port website doco to use Scalate instead of webgen

## [Jansi 1.5][1_5], released 2010-11-04
[1_5]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.5

* Support for parsing Operating System Command (OSC) control sequences
* Windows: added support for setting the console title through an OSC command, like on xterm
* add option to strip ansi escapes if the 'jansi.strip' system property is set to true.

## [Jansi 1.4][1_4], released 2010-07-15
[1_4]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.4

* JNI libs are now bundled in the jansi jar
* Windows: added support for save and restore of cursor position, fixed bug in processCursorTo

## [Jansi 1.3][1_3], released 2010-03-08
[1_3]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.3

* Switched to a HawtJNI generated native library instead of using JNA to access native functions

## [Jansi 1.2.1][1_2_1], released 2010-03-08
[1_2_1]: http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.2.1

* Released to Maven Central

## [Jansi 1.2][1_2], released 2010-02-09
[1_2]: http://jansi.fusesource.org/repo/release/org/fusesource/jansi/jansi/1.2

* Improved Java Docs
* Better windows ansi handling of: erase screen and line and move to col
* new method: Ansi.newline()
* Fixed missing return statement in cursor up case..
* Reset the attributes when the ansi output stream is closed on unix.

## [Jansi 1.1][1_1], released 2009-11-23
[1_1]: http://jansi.fusesource.org/repo/release/org/fusesource/jansi/jansi/1.1

* AnsiRender can now be used in a static way and made easier to use with the Ansi builder.
* Merged [Jason Dillon's Fork](http://github.com/jdillon/jansi/tree/bb86e0e79bec850167ddfd8c4a86fb9ffef704e5):
	* Pluggable ANSI support detection
	* ANSI builder can be configured to not generate ANSI escapes.
	* AnsiRender provides an easier way to generate escape sequences.
* [JANSI-5](http://fusesource.com/issues/browse/JANSI-5): Attribute Reset escape should respect original console colors
* [JANSI-4](http://fusesource.com/issues/browse/JANSI-4): Restore command console after closing wrapped OutputStream on Windows.
* [JANSI-1](http://fusesource.com/issues/browse/JANSI-1): Added extensions for colors and other attributes to Ansi builder.

## [Jansi 1.0][1_0], released 2009-08-25
[1_0]: http://jansi.fusesource.org/repo/release/org/fusesource/jansi/jansi/1.0

* Initial Release

repository: chirino/jansi

repo_name: chirino/jansi


text:
# Command Line Parser

## Translations

1. [Русский](README.RU.md)

## Content

* [Quick Start](#quick-start)
* [Simple Parser](#simple-parser)
* [Parser With Commands](#parser-with-commands)
* [Named Parameters](#named-parameters)
* [Nameless Parameters](#nameless-parameters)

## Quick Start

Let's open the project **Binateq.CommandLine.Demo.Copy**. This is a program that copies
the files like utilities **copy** or **cp**.

In simplest case the program makes a copy of a file with a new name.

```
democopy source.file destination.file
```

If **destination.file** already exists, then the program doesn't rewrite it and prints the warning message.

To force rewrite you need use the option **-f** or **--force**.

```
democopy source.file destination.file -f
```

While copying a file the program reads a part of source file in the buffer and then writers this buffer to the destination file.

The size of buffer may be set with the help of parameter **--size**.

```
democopy source.file destination.file --size=1024
```

Let's see the source code of **Program.cs**

```
static void Main(string[] args)
{
    var parser = Parser.Simple<Command>()
                       .Named(x => x.IsHelp, "-h", "--help")
                       .Named(x => x.IsForce, "-f", "--force")
                       .Nonamed(x => x.Files);

    try
    {
        var command = parser.Parse(args);

        command.Run();
    }
    catch (Exception exception)
    {
        Console.Error.WriteLine(exception.Message);
    }
}
```

Simple problem is solved with a simple program. The library let us *combine* parser from the components. Result parsers can analyze the command lines and create object `command` with specified properties.

Let's see the source code of the `Command` class.

```
class Command
{
    public bool IsHelp { get; set; }

    public bool IsForce { get; set; }

    public IReadOnlyList<string> Files { get; set; }

    public uint Size { get; set; } = 1 << 16;

    public void Run()
    {
        if (IsHelp || Files.Count == 0)
        {
            Console.WriteLine("Usage: democopy [options] source-file+ destination-file");
            Console.WriteLine("Options are:");
            Console.WriteLine("  -h | --help   Print help.");
            Console.WriteLine("  -f | --force  Overwrite destination file if it exists.");
            Console.WriteLine("  -size:N       Set buffer size to N bytes (1024 >= N >= 1048576.");

            return;
        }

        if (Files.Count < 2)
            throw new InvalidOperationException("There are no source files to copy.");

        if (Size < 1024 || Size >= 1024 * 1024)
            throw new InvalidOperationException("Too small or too large buffer size.");

        Copy();
    }

    private void Copy()
    {
        var destinationFile = Files[Files.Count - 1];
        var sourceFiles = new string[Files.Count - 1];
        var buffer = new byte[Size];

        for (int i = 0; i < sourceFiles.Length; i++)
            sourceFiles[i] = Files[i];

        if (File.Exists(destinationFile) && !IsForce)
            throw new InvalidOperationException("Destination file already exists. Specify --force parameter to overwrite.");

        using (var output = new FileStream(destinationFile, FileMode.Create, FileAccess.Write))
        {
            foreach (var sourceFile in sourceFiles)
            {
                using (var input = new FileStream(sourceFile, FileMode.Open, FileAccess.Read))
                {
                    int read;
                    while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
                        output.Write(buffer, 0, read);
                }

                Console.WriteLine(sourceFile);
            }
        }
    }
}
```

This is the pattern *Command*. It's not accident that the class is named that way.
The parser analyzes a command line and fills the properties of `Command`: `IsHelp`, `IsForce`, `Files`, and `Size`.

To execute the command we should call the method `Run`. We can named it as we wish — `Do` or `Execute`. The library doesn't require us to use specific command interface.

## Simple Parser

You can use simple parser if you need a few file names and a few options in a command line, like in the **democopy** program.

Let's make the class with properties that match to required parameters.

If we need the option **--size** with the integer type, let's append public mutable integer property named `Size`. If we need the option **--help** as a flat, let's append boolean property `Help`.

The command should have a method that will be called when we want have a result. Let's call it `Do`.

```
class Foo
{
    public int Size { get; set; }

	public bool Help { get; set; }

	public void Do()
	{
	    if (Help)
		  Console.WriteLine("Usage: program --size=N | --help");
		else
		  Console.WriteLine("Square with side {0} equals to {1}.", Size, Size * Size);
	}
}
```

Finally we should construct the pareser and call the method `Parse`.

```
static void Main(string[] args)
{
    var parser = Parser.Simple<Foo>();

    var foo = parser.Parse(args);
    foo.Do();
}
```

## Parser With Commands

Let's open the project **Binateq.CommandLine.Demo.Zip**. The program can pack files into ZIP archive, and extract them.

In the programs like **arj** or **git** in addition to options and files there are commands too.

To pack the files in **arj** we run

```
arj a -d2 archive file₁ file₂ ... fileₙ
```

To commit changes in **git** we run

```
git commit -m "Comment"
```

The first parameter of the program (**a** of **arj** and **commit** of **git**) is a command name. Sometimes programs recognize as full command names like **remove** as short names like **r**.

We implement four command in the project **Binateq.CommandLine.Demo.Zip**: **add**, **extract**, **list**, and **help**.

We need create separate class for each of them. Let's name them `AddCommand`, `ExtractCommand`, `ListCommand`, and `HelpCommand`.

In the pattern *Command* different commands implement common interface or extend common abstract class.

```
interface ICommand
{
    void Run();
}

class AddCommand : ICommand
{
    public void Run() {  }
}
```

Finally, let's describe the pattern of the command line inside **Program.cs** file.

```
var parser = Parser.Command<ICommand, AddCommand>("add", "a")
           | Parser.Command<ICommand, ExtractCommand>("extract", "x")
           | Parser.Command<ICommand, ListCommand>("list", "l")
           | Parser.Default<ICommand, HelpCommand>("help", "h")
           ;

var command = parser.Parse(args);
command.Run();
```

If the first parameter of command line will be **add** or **a**, then the parser will create the instance of the `AddCommand` class.

The method `parser.Parse(args)` will return an object that implements `ICommand`, or raises an exception.

## Named Parameters

The **add** command let us set level of packing, as a number 0, 1, or 2.

```
demozip add archive -level=2 file₁ file₂ ... fileₙ
```

The `level` parameter called *named* parameter because has the name. By default, all mutable public properties of command class are named parameters.

```
class AddCommand : ICommand
{
    public int Level { get; set; } = 0;

    public void Run() {  }
}
```

Sometimes we want to set short name for named parameter.

```
var parser = Parser.Command<ICommand, AddCommand>("add", "a")
                   .Named(x => x.Level, "-l")
             . . .
```

Sometimes parameter has both short and full name.

```
var parser = Parser.Command<ICommand, AddCommand>("add", "a")
                   .Named(x => x.Level, "-l", "--level")
             . . .
```

## Nameless Parameters

The command **add** can process a few file names. First of them is the archive's name, and other are names of files to pack.

```
demozip add archive file₁ file₂ ... fileₙ
```

All parameters that start with *hyphen* (-) are named. All other parameters are *nameless*. All of them store in a single property, that has the type `IEnumerable<string>`, `IReadOnlyCollection<string>`, or `IReadOnlyList<string>`.

```
class AddCommand : ICommand
{
    public int Level { get; set; } = 0;

    public IReadOnlyList<string> Files { get; set; }

    public void Run() {  }
}
```

```
var parser = Parser.Command<ICommand, AddCommand>("add", "a")
                   .Named(x => x.Level, "-l", "--level")
                   .Nonamed(x => x.Files)
             . . .
```

Implementation of the **add** command.

```
class AddCommand : ICommand
{
    public int Level { get; set; } = 0;

    public uint Size { get; set; } = 1 << 16;

    public IReadOnlyList<string> Files { get; set; }

    public void Run()
    {
        if (Files.Count == 0)
            throw new InvalidOperationException("Missing archive's name.");

        if (Files.Count == 1)
            throw new InvalidOperationException("Missing files to archive.");

        var buffer = new byte[Size];

        using (var archive = ZipFile.Open(Files[0], ZipArchiveMode.Create))
        {
            for (int i = 1; i < Files.Count; i++)
            {
                var entry = archive.CreateEntry(Files[i], (CompressionLevel)Level);
                using (var output = entry.Open())
                using (var input = File.OpenRead(Files[i]))
                {
                    int read;
                    while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
                        output.Write(buffer, 0, read);
                }

                Console.WriteLine(Files[i]);
            }
        }
    }
}
```

The method `Run` does all the work. The parser fills values of properties `Level`, `Size`, and `Files` while anaylyzing command line, so `Run` can use them.

license: Unlicense

repository: tolik-punkoff/command-line-parser

repo_name: tolik-punkoff/command-line-parser