text:
# New-vRAReservationNetworkDefinition

## SYNOPSIS
Creates a new network definition for a reservation.

## SYNTAX

```
New-vRAReservationNetworkDefinition -Type <String> -ComputeResourceId <String> -NetworkPath <String>
 [-NetworkProfile <String>] [-WhatIf] [-Confirm]
```

## DESCRIPTION
Creates a new network definition for a reservation.
This cmdlet is used to create a custom
complex network object.
One or more of these can be added to an array and passed to New-vRAReservation.

## EXAMPLES

### -------------------------- EXAMPLE 1 --------------------------
```
$NetworkDefinitionArray = @()
```

$Network1 = New-vRAReservationNetworkDefinition -Type vSphere -ComputeResourceId 75ae3400-beb5-4b0b-895a-0484413c93b1 -Path "VM Network" -Profile "Test"
$NetworkDefinitionArray += $Networ1

## PARAMETERS

### -Type
The reservation type

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ComputeResourceId
The id of the compute resource

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -NetworkPath
The network path

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -NetworkProfile
The network profile

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

## INPUTS

### System.String.

## OUTPUTS

### System.Management.Automation.PSObject

## NOTES

## RELATED LINKS

repository: marcuspuckett/PowervRA

branch_name: refs/heads/development

repo_name: marcuspuckett/PowervRA


text:
# weechat-split-logs
Script to split existing weechat logs into multiple files based on date.

The weechat setting that does this is `logger.file.mask`. This is script is useful for converting your old, huge log files that are not yet split by date into multiple files.

## Usage
```
./weechat-split-logs <log/dir> <output/dir/with/%Y/%m>
```
Available date placeholder: https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior

## Example
- Make a backup of your log files. I wouldn't just trust a random script from The Internet.
- Change the weechat setting `logger.file.mask` to the desired value. weechat will start writing log files to the new locations.
- Then, run this script to convert the old log files:
```
$ ls ~/.weechat/logs/**/irc.server.freenode.weechatlog
/home/minnozz/.weechat/logs/irc.server.freenode.weechatlog
$ ./weechat-split-logs ~/.weechat/logs ~/.weechat/logs/%Y/%m
$ ls ~/.weechat/logs/**/irc.server.freenode.weechatlog
/home/minnozz/.weechat/logs/irc.server.freenode.weechatlog
/home/minnozz/.weechat/logs/2017/07/irc.server.freenode.weechatlog
/home/minnozz/.weechat/logs/2017/08/irc.server.freenode.weechatlog
(...)
/home/minnozz/.weechat/logs/2020/05/irc.server.freenode.weechatlog
/home/minnozz/.weechat/logs/2020/05/irc.server.freenode.weechatlog.split
```
- Files ending in `.split` will be created when weechat has already created a file in the location we want to write to. We can't just append to that file because then the lines would be in incorrect order, and weechat probably still has the file opened.
- Check if the script worked correctly and delete the old (non-split) files if you want.

## Caveats
- Only the date part of the timestamp is read, so time placeholders are not available.
- Placeholders are only supported in the directory name, because the file name is identical to the input file.

license: MIT

repository: Minnozz/weechat-split-logs

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: Minnozz/weechat-split-logs


text:
# React-map

##Python script that maps React Components to platform native (Web, iOS, and Android) components.

##Set up
* Install python or python3 `sudo apt-get install idle-python3.4`
* Install pip3 `sudo apt-get install python3-pip`

##Instructions
* Put the files to parse in [React-map/jsfilestoparse/input_type_folder] (https://github.com/mutohq/React-map/tree/master/jsfilestoparse)
* Configure dictionary in [React-map/Dictionary/Storage.json] (https://github.com/mutohq/React-map/blob/master/Dictionary/storage.json)
* Path and Mapping type of input file  is set in [React-map/config.json] (https://github.com/mutohq/React-map/blob/master/config.json)
* After this run `python3 reactmap.py config.json`

## Input type
* let input file is of ios type in [ios] (https://github.com/mutohq/React-map/tree/master/jsfilestoparse/ios)
```
return ( <View style = {styles.container}>
            <Text style ={styles.name}>
            Hello, Bhavyanth!
            </Text> </View>
			<Nav />
			<App />

        );
```

## Ouput
* then gerated output will be
* 1. [Android] (https://github.com/mutohq/React-map/blob/master/jsfilestoparse/android/index.android.js)
```
    return ( /*<View style = {styles.container}>
            /*<Text style ={styles.name}>
            Hello, Bhavyanth!
            </Text>*/ </View>*/
			/*<Nav />*/
			/*<App />*/

        );
```

* 2. [Web] (https://github.com/mutohq/React-map/blob/master/jsfilestoparse/web/index.web.js)

```
    return ( <span style = {styles.container}>
            <p style ={styles.name}>
            Hello, Bhavyanth!
            </p> </span>
			/*<Nav />*/
			/*<App />*/

        );
```

## Dictionary used
[Dictionary] (https://github.com/mutohq/React-map/blob/master/Dictionary/storage.json)

repository: mutohq/React-map

repo_name: mutohq/React-map


text:
# CHANGELOG for 2.0.x

This changelog references the relevant changes done in 2.0 version.

### 2.0.0(2018-03-26)

* This new version is only for PHP ⩾7.1.
* Update all dependencies (remove all doctrine dependencies)
* DoctrineParamConverter is not used anymore
* This bundle only converts hashid into an id
* Replace `autowire` with `passthrough`.
This new parameter which allows to continue with the next param converters available.

repository: QuentinNanomonx/HashidsBundle

gha_license_id: MIT

repo_name: QuentinNanomonx/HashidsBundle


text:
# companion-module-panasonic-ptz
See HELP.md and LICENSE

**V1.0.7**
* Added Hanging and Desktop mode
* Added One Touch Auto Focus
* Zoom and Focus speed

**V1.0.8**
* Fixed bug with changing config settings, forcing the user to disable and re-enable the module to connect again.
* Fixed bug with OTAF missing an action

**V1.0.9**
* Cleaned up "Help.md" file
* Cleaned up "Index.js" file, by splitting it up into difrent files
* Sorted Actions in dropdown
* Fixed Auto Focus Action having wrong default
* Added Feedback Structure and Support
* Added Variables Structure and Support
* Added Auto Detect Model, and the option to specify camera type
* Made Actions Model specific, with options that match the model
* Updated all presets to work with current feedbacks and actions, and is made dynamicly based on model

**V1.0.10**
* Added Basic support for AW-HE2
* Added Config option to enable PTZ debug to the "Info" and "Warn" log window
* Added Support for Start and Stop Recording on SD Card (Only some models)

**V1.0.11**
* Added support for AW-UE4

**V1.0.12**
* Hotfix for SD Card Record Action
* Bug Fix: Tally on variable, not working on integer variables, now works with both integer and string variables

**V1.0.13**
* Bug Fix: some actions not working with defaults, due too not having a default declared
* Enabled presets on Aw-HE2


text:
## aframe-clubber

Audio driven visualizations for [A-Frame](https://aframe.io) using the [Clubber](https://github.com/wizgrav/clubber) rhythm analysis library.

[Demo](http://wizgrav.github.io/aframe-clubber/demo)

### Usage

A system (`clubbers`) is responsible for fetching the frequency data from an audio element. It also creates three bands to cover the whole spectrum. Refer to [Clubber](https://github.com/wizgrav/clubber) for more details on the library itself.

The system can be configured using the following properties:

| Property              | Description                                                          | Default Value |
| --------              | -----------                                                          | ------------- |
| src                   | A selector to get the audio/video element to listen to.              | null          |
| size                  | The number of samples to grab for the fourier transform.             | 2048          |
| mute                  | If true the audio element will not output to the speakers.               | false          |
| lowRange              | The range of midi notes tracked by the low band.                     | [10,32]       |
| midRange              | The range of midi notes tracked by the mid band.                     | [32,48]       |
| highRange             | The range of midi notes tracked by the high band.                    | [48,128]      |
| lowSmooth             | Exponential smoothing factors for the low band.                      | [0.1,0.1,0.1,0.16] |
| midSmooth             | Exponential smoothing factors for the mid band.                      | [0.1,0.1,0.1,0.16] |
| highSmooth            | Exponential smoothing factors for the high band.                     | [0.1,0.1,0.1,0.16] |

There's also a component(`clubber`) that performs the various modulations. To achieve optimal flexibility with minimal coding a scheme utilizing inline js assignments is employed. One or more oneliners are provided via the exec: property and they get translated into js functions to be executed on every tick. The arguments passed to these functions include the current time, previous frame's values and the vec4 arrays produced by the three clubber bands. Here are some examples of the functionality:

```html
  <a-entity clubber="exec: material.opacity = mid[3]" ></a-entity>
```
will be translated to
```js
function (time, values, low, mid, high) {
  var prev, mesh = this.getObject3D('mesh');
  prev = values[0];
  values[0] = prev =  mid[3]; // our statement goes here
  this.setAttribute('material', 'opacity', prev);
}
```
`this` refers to the element on which the component is attached. `values` is an array that persists the values from all assignments of the previous frame. Notice that `prev` is setup before the oneliner executes, which allows the developer to use the last value in the assignment eg. to smooth values like:
```html
  <a-entity clubber="exec: material.opacity = 0.33 * mid[3] + 0.66 * prev" >
  </a-entity>
```
Multiple properties can be assigned like
```html
  <a-entity clubber="exec: scale.x.y.z = low[3]" ></a-entity>
```
And multiple statements can be provided using a hash delimiter
```html
  <a-entity clubber="exec: scale.x = mid[3] # scale.y = mid[0]" ></a-entity>
```

Assignments can be as complex as one liners allow
```html
  <a-entity clubber="exec: material.opacity = 1.2 - Math.min(mid[3],low[3])" >
  </a-entity>
```
when the left side of the assignment starts with a dot, it will directly access the element's underlying mesh instead of using setAttribute() to access other components on the element, so for instance
```html
  <a-entity clubber="exec: .material.uniforms.opacity.value = mid[3]" >
  </a-entity>
```
will translate to
```js
function (time, values, low, mid, high) {
  var prev, mesh = this.getObject3D('mesh');
  prev = values[0];
  values[0] = prev =  mid[3];
  mesh.material.uniforms.opacity.value = prev;
}
```
in this case though we can't do multiple property assignments as described above.

By setting debug:true on the component, the function body is logged on the console for inspection.

Even though it seems(`and is`) abusive, this scheme makes the tuning of visualisations an effortless process while sacrificing very little in terms of creativity. Check the provided demo's markup.
#### Browser Installation

Install and use by directly including the [browser files](dist):

```html
<head>
  <title>Clubber Audio Visualizer</title>
  <script src="https://aframe.io/releases/0.3.1/aframe.min.js"></script>
  <script src="https://wizgrav.github.io/aframe-clubber/dist/aframe-clubber.min.js"></script>
</head>
```

#### NPM Installation

Install via NPM:

```bash
npm install aframe-clubber
```

Then register and use.

```js
require('aframe');
require('aframe-clubber');
```

repository: bottlehs/ar-card

branch_name: refs/heads/main

gha_language: HTML

repo_name: bottlehs/ar-card


text:
## mod_ishttps - reverse proxy / ballancer proxy module which helps set the https header, port and schema when terminating SSL at the proxy level.

This is a strip down version of mod_rpaf.

### Summary

Sets `REQUEST_SCHEME`, `HTTPS`, and `SERVER_PORT` to the values provided by an upstream proxy.

### Compile Debian/Ubuntu Package and Install

    sudo apt-get install build-essential apache2-threaded-dev
    apxs -i -c -n mod_ishttps.so mod_ishttps.c

### Compile and Install for RedHat/CentOS

    yum install httpd-devel
    apxs -i -c -n mod_ishttps.so mod_ishttps.c

### Configuration Directives

    ISHTTPS_Enable             (On|Off)                - Enable reverse proxy add forward

    ISHTTPS_SetHTTPS           (On|Off)                - Set the HTTPS environment variable
                                                      to the header value contained in
                                                      X-HTTPS, or X-Forwarded-HTTPS. For
                                                      best results make sure that mod_ssl
                                                      is NOT enabled.

    ISHTTPS_SetPort            (On|Off)                - Set the server port to the header
                                                      value contained in X-Port, or
                                                      X-Forwarded-Port.

## TODO
- Limit changes from specific PROXY IPs only.

## Example Configuration

    LoadModule ishttps_module /usr/lib64/apache2/modules/mod_ishttps.so
    <IfModule ishttps_module>
    ISHTTPS_Enable             On
    ISHTTPS_SetHTTPS           On
    ISHTTPS_SetPort            On
    </IfModule>

## Authors

* Thomas Eibner<EMAIL_ADDRESS>* Geoffrey McRae<EMAIL_ADDRESS>* Proxigence Inc<EMAIL_ADDRESS>
## License and distribution

This software is licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0). The
latest version is available [from GitHub](http://github.com/gnif/mod_rpaf)


text:
# Laravel External Queues

Laravel queues are an awesome thing to use internally in an application in order to manage asynchronous tasks. However, in the usecase where you want external components such as desktop applications or other web applications to communicate with Laravel through queues it becomes somewhat more messy, since there is quite a bit of information embedded in a queue message about the internal workings, such as class names.

This package is an attempt to let applications communicate through queues by using a string as the job name, and then letting the internals of Laravel translate handle the execution.

If you don't need to send queue messages outside of your laravel application, then you don't need this package. The default works excellent.

## Installation

Pull this package in through Composer.

```js
{
    "require": {
        "kristianedlund/laravel-external-queue": "1.0"
    }
}
```

    $ composer update

Add the package to your application service providers in `config/app.php`

```php
'providers' => [

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...

    'Kristianedlund\LaravelExternalQueue\ExternalQueueServiceProvider',

],
```

Publish the package config file to your application.

    $ php artisan vendor:publish

## Usage

### Configuration

First of all you set up an external queue in the normal queue config file in laravel. It should look like

```php
'externalsqs' => [
    'driver' => 'externalsqs',
    'key'    => 'your-public-key',
    'secret' => 'your-secret-key',
    'queue'  => 'your-queue-url',
    'region' => 'us-east-1',
],
```

Second part is that you set up the different job names and map them to handler classes in the "externalqueue" config file.

### Handler files
Last but not least you need to write the handler files.

They need to implement the handler contract `Kristianedlund\LaravelExternalQueue\Contracts\ExternalQueueJobHandler` and could look like

```php
<?php

namespace App\Handlers\ExternalJobs;

use Kristianedlund\LaravelExternalQueue\Contracts\ExternalQueueJobHandler as HandlerContract;
use Illuminate\Queue\Jobs\Job;

class TestJob implements HandlerContract
{
    public function handle(Job $job, $data = null)
    {
        // Do you job handling here
    }
}
```

### License

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

repository: CedricLeong/laravel-external-queue

repo_name: CedricLeong/laravel-external-queue


text:
# bpk-component-button

> Backpack React Native button component.

## Primary

| Day | Night |
| --- | --- |
|  |  |
|  |  |

## Primary On Light

| Day | Night |
| --- | --- |
|  |  |
|  |  |

## Primary On Dark

| Day | Night |
| --- | --- |
|  |  |
|  |  |

## Secondary

| Day | Night |
| --- | --- |
|  |  |
|  |  |

## Secondary On Dark

| Day | Night |
| --- | --- |
|  |  |
|  |  |

## Destructive

| Day | Night |
| --- | --- |
|  |  |
|  |  |

## Featured

| Day | Night |
| --- | --- |
|  |  |
|  |  |

## Link

| Day | Night |
| --- | --- |
|  |  |
|  |  |

## Link On Dark

| Day | Night |
| --- | --- |
|  |  |
|  |  |

## Installation

Check the main [Readme](https://github.com/skyscanner/backpack-react-native#usage) for a complete installation guide.

## Usage

```js
import { StyleSheet, View } from 'react-native';
import React, { Component } from 'react';
import { BUTTON_TYPES, ICON_ALIGNMENTS, BpkButtonV2 } from 'backpack-react-native/bpk-component-button';
import { spacingBase } from<EMAIL_ADDRESS>
const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    padding: spacingBase,
  }
});

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <BpkButtonV2
          type={BUTTON_TYPES.primary}
          title="Book flight"
          onPress={() => {}}
        />
        <BpkButtonV2
          type={BUTTON_TYPES.featured}
          title="Book flight"
          onPress={() => {}}
        />
        <BpkButtonV2
          disabled
          type={BUTTON_TYPES.destructive}
          title="Book flight"
          onPress={() => {}}
        />
        <BpkButtonV2
          large
          type={BUTTON_TYPES.primary}
          title="Book flight"
          onPress={() => {}}
        />
        <BpkButtonV2
          type={BUTTON_TYPES.featured}
          title="Book flight"
          icon="baggage"
          onPress={() => {}}
        />
        <BpkButtonV2
          type={BUTTON_TYPES.primary}
          title="Book flight"
          icon="baggage"
          iconAlignment={ICON_ALIGNMENTS.leading}
          onPress={() => {}}
        />
        <BpkButtonV2
          type={BUTTON_TYPES.featured}
          title="Book flight"
          icon="baggage"
          iconOnly
          onPress={() => {}}
        />
      </View>
    );
  }
}
```

## Props

| Property              | PropType                                                                  | Required | Default Value |
| --------------------- | ------------------------------------------------------------------------- | -------- | ------------- |
| onPress               | func                                                                      | true     | -             |
| title                 | string                                                                    | true     | -             |
| accessibilityLabel    | string                                                                    | false    | props.title   |
| disabled              | bool                                                                      | false    | false         |
| icon                  | oneOf(string, element) Strings must be a [BpkIcon](/components/web/icons) | false    | null          |
| iconAlignment         | oneOf('leading', 'trailing')                                              | false    | trailing      |
| iconOnly              | bool                                                                      | false    | false         |
| large                 | bool                                                                      | false    | false         |
| type                  | oneOf('primary', 'featured', 'secondary', 'destructive', 'primaryOnLight', 'primaryOnDark', 'secondaryOnDark', 'link', 'linkOnDark')       | false    | null          |

repository: Skyscanner/backpack-react-native

gha_language: JavaScript

repo_name: Skyscanner/backpack-react-native


text:
# Configure Envoy to Perform X.509 SVID Authentication

This tutorial builds on the [Kubernetes Quickstart Tutorial](https://spiffe.io/docs/latest/try/getting-started-k8s/) to demonstrate how to configure SPIRE to provide service identity dynamically in the form of X.509 certificates that will be consumed by Envoy secret discovery service (SDS). The changes required to implement X.509 SVID authentication are shown here as a delta to that tutorial, so you should run, or at least read through, the Kubernetes Quickstart Tutorial first.

To illustrate X.509 authentication, we create a simple scenario with three services. One service will be the backend that is a simple nginx instance serving static data. On the other side, we run two instances of the `Symbank` demo banking application acting as the frontend services. The `Symbank` frontend services send HTTP requests to the nginx backend to get the user account details.

![SPIRE Envoy integration diagram][diagram]

[diagram]: images/SPIRE_Envoy_diagram.png "SPIRE Envoy integration diagram"

As shown in the diagram, the frontend services connect to the backend service via an mTLS connection established by the Envoy instances that perform X.509 SVID authentication on each workload's behalf.

In this tutorial you will learn how to:

* Set up SDS support in SPIRE
* Configure Envoy SDS to consume X.509 certificates provided by SPIRE
* Create registration entries on the SPIRE Server for the Envoy instances
* Test successful X.509 authentication using SPIRE
* Optionally, configure an Envoy RBAC HTTP filter policy

# Prerequisites

Before proceeding, review the following:

* You'll need access to the Kubernetes environment configured when going through the [Kubernetes Quickstart Tutorial](https://spiffe.io/docs/latest/try/getting-started-k8s/). Optionally, you can create the Kubernetes environment with the `pre-set-env.sh` script described just below. The Kubernetes environment must be able to expose an Ingress to the public internet. _Note: This is generally not true for local Kubernetes environments such as Minikube._
* Required YAML files for this tutorial can be found in the `k8s/envoy-x509` directory in https://github.com/spiffe/spire-tutorials. If you didn't already clone the repo for the _Kubernetes Quickstart Tutorial_ please do so now.

If the _Kubernetes Quickstart Tutorial_ environment is not available, you can use the following script to create it and use it as starting point for this tutorial. From the `k8s/envoy-x509` directory, run the following command:

```console
$ bash scripts/pre-set-env.sh
```

The script will create all the resources needed for the SPIRE Server and SPIRE Agent to be available in the cluster.

## External IP support

This tutorial requires a LoadBalancer that can assign an external IP (e.g., [metallb](https://metallb.universe.tf/))

```console
$ kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml
```

Wait until metallb has started
```console
$ kubectl wait --namespace metallb-system \
                --for=condition=ready pod \
                --selector=app=metallb \
                --timeout=90s
```

Apply metallb configuration

```console
$ kubectl apply -f metallb-config.yaml
```

# Envoy SDS Support

The SPIRE Agent has native support for the Envoy Secret Discovery Service (SDS). SDS is served over the same Unix domain socket as the Workload API and Envoy processes connecting to SDS are attested as workloads.

# Part 1: Run Workloads

Now let's deploy the workloads we'll use in this tutorial. It consists of three workloads: as mentioned before, two instances of the `Symbank` demo application will act as frontend services and the other, an instance of _nginx_ serving static files, will be the backend service.

To make a distinction between the two instances of the `Symbank` application, let's call one `frontend` and the other `frontend-2`. The former is configured to present data related to the user _Jacob Marley_ and the second will show account details for the user _Alex Fergus_.

## Deploy all Workloads

Ensure that the current working directory is `.../spire-tutorials/k8s/envoy-x509` and deploy the new resources using:

```console
$ kubectl apply -k k8s/.

configmap/backend-balance-json-data created
configmap/backend-envoy created
configmap/backend-profile-json-data created
configmap/backend-transactions-json-data created
configmap/frontend-2-envoy created
configmap/frontend-envoy created
configmap/symbank-webapp-2-config created
configmap/symbank-webapp-config created
service/backend-envoy created
service/frontend-2 created
service/frontend created
deployment.apps/backend created
deployment.apps/frontend-2 created
deployment.apps/frontend created
```

The `kubectl apply` command creates the following resources:
   * A Deployment for each of the workloads. It contains one container for our service plus the Envoy sidecar.
   * A Service for each workload. It is used to communicate between them.
   * Several Configmaps:
      * _*-json-data_ are used to provide static files to the nginx instance running as the backend service.
      * _*-envoy_ contains the Envoy configuration for each workload.
      * _symbank-webapp-*_ contains the configuration supplied to each instance of the frontend services.

The next two sections focus on the settings needed to configure Envoy.

### SPIRE Agent Cluster

For Envoy SDS to consume X.509 certificates provided by SPIRE Agent, we configure a cluster that points to the Unix Domain Socket the SPIRE Agent provides. The Envoy configuration for the backend service is located at `k8s/backend/config/envoy.yaml`.

```console
clusters:
- name: spire_agent
  connect_timeout: 0.25s
  http2_protocol_options: {}
  load_assignment:
    cluster_name: spire_agent
    endpoints:
    - lb_endpoints:
      - endpoint:
          address:
            pipe:
              path: /run/spire/sockets/agent.sock
```

### TLS Certificates

To obtain a TLS certificate and private key from SPIRE, you set up an SDS configuration within a TLS context. The name of the TLS certificate is the SPIFFE ID of the service that Envoy is acting as a proxy for.
Furthermore SPIRE provides a validation context per trust domain that Envoy uses to verify peer certificates.

```console
transport_socket:
  name: envoy.transport_sockets.tls
  typed_config:
    "@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
    common_tls_context:
      tls_certificate_sds_secret_configs:
      - name: "spiffe://example.org/ns/default/sa/default/backend"
        sds_config:
          resource_api_version: V3
          api_config_source:
            api_type: GRPC
            transport_api_version: V3
            grpc_services:
              envoy_grpc:
                cluster_name: spire_agent
      combined_validation_context:
        # validate the SPIFFE ID of incoming clients (optionally)
        default_validation_context:
          match_typed_subject_alt_names:
          - san_type: URI
            matcher:
              exact: "spiffe://example.org/ns/default/sa/default/frontend"
          - san_type: URI
            matcher:
              exact: "spiffe://example.org/ns/default/sa/default/frontend-2"
        # obtain the trust bundle from SDS
        validation_context_sds_secret_config:
          name: "spiffe://example.org"
          sds_config:
            resource_api_version: V3
            api_config_source:
              api_type: GRPC
              transport_api_version: V3
              grpc_services:
                envoy_grpc:
                  cluster_name: spire_agent
```

Similar configurations are set on both frontend services to establish an mTLS communication. Check the configuration of the cluster named `backend` in `k8s/frontend/config/envoy.yaml` and `k8s/frontend-2/config/envoy.yaml`.

## Create Registration Entries

In order to get X.509 certificates issued by SPIRE, the services must be registered. We achieve this by creating registration entries on the SPIRE Server for each of our workloads. Let's use the following Bash script:

```console
$ bash create-registration-entries.sh
```

Once the script is run, the list of created registration entries will be shown. The output will show other registration entries created by the [Kubernetes Quickstart Tutorial](https://spiffe.io/docs/latest/try/getting-started-k8s/). The important ones here are the three new entries belonging to each of our workloads:

```console
...
Entry ID      : 0d02d63f-712e-47ad-a06e-853c8b062835
SPIFFE ID     : spiffe://example.org/ns/default/sa/default/backend
Parent ID     : spiffe://example.org/ns/spire/sa/spire-agent
TTL           : 3600
Selector      : k8s:container-name:envoy
Selector      : k8s:ns:default
Selector      : k8s:pod-label:app:backend
Selector      : k8s:sa:default

Entry ID      : 3858ec9b-f924-4f69-b812-5134aa33eaee
SPIFFE ID     : spiffe://example.org/ns/default/sa/default/frontend
Parent ID     : spiffe://example.org/ns/spire/sa/spire-agent
TTL           : 3600
Selector      : k8s:container-name:envoy
Selector      : k8s:ns:default
Selector      : k8s:pod-label:app:frontend
Selector      : k8s:sa:default

Entry ID      : 4e37f863-302a-4b3c-a942-dc2a86459f37
SPIFFE ID     : spiffe://example.org/ns/default/sa/default/frontend-2
Parent ID     : spiffe://example.org/ns/spire/sa/spire-agent
TTL           : 3600
Selector      : k8s:container-name:envoy
Selector      : k8s:ns:default
Selector      : k8s:pod-label:app:frontend-2
Selector      : k8s:sa:default
...
```

Note that the selectors for our workloads point to the Envoy container: `k8s:container-name:envoy`. This is how we configure Envoy to perform X.509 SVID authentication on a workload's behalf.

# Part 2: Test Connections

Now that services are deployed and also registered in SPIRE, let's test the authorization that we've configured.

## Test for Successful Authentication with Valid X.509 SVIDs

The first set of testing will demonstrate how valid X.509 SVIDs allow for the display of associated data. To do this, we show that both frontend services, (`frontend` and `frontend-2`) can talk to the `backend` service by getting the correct IP address and port for each one. To run these tests, we need to find the IP addresses and ports that make up the URLs to use for accessing the data.

```console
$ kubectl get services

NAME            TYPE           CLUSTER-IP    EXTERNAL-IP      PORT(S)          AGE
backend-envoy   ClusterIP      None          <none>           9001/TCP         6m53s
frontend        LoadBalancer   <IP_ADDRESS>   <IP_ADDRESS>   3000:32586/TCP   6m52s
frontend-2      LoadBalancer   <IP_ADDRESS>     <IP_ADDRESS>   3002:32056/TCP   6m53s
kubernetes      ClusterIP      <IP_ADDRESS>      <none>           443/TCP          59m
```

The `frontend` service will be available at the `EXTERNAL-IP` value and port `3000`, which was configured for our container. In the sample output shown above, the URL to navigate is `http://<IP_ADDRESS>:3000`. Open your browser and navigate to the IP address shown for `frontend` in your environment, adding the port `:3000`. Once the page is loaded, you'll see the account details for user _Jacob Marley_.

![Frontend][frontend-view]

[frontend-view]: images/frontend_view.png "Frontend view"

Following the same steps, when you connect to the URL for the `frontend-2` service  (e.g. `http://<IP_ADDRESS>:3002`) the browser displays the account details for user _Alex Fergus_.

![Frontend-2][frontend-2-view]

[frontend-2-view]: images/frontend-2_view.png "Frontend-2 view"

## Update the TLS Configuration So Only One Frontend Can Access the Backend

The Envoy configuration for the `backend` service uses the TLS configuration to filter incoming connections by validating the Subject Alternative Name (SAN) of the certificate presented on the TLS connection. For SVIDs, the SAN field of the certificate is set with the SPIFFE ID associated with the service. So by specifying the SPIFFE IDs in the `match_typed_subject_alt_names` filter we indicate to Envoy which services can establish a connection.

Let's now update the Envoy configuration for the `backend` service to allow requests from the `frontend` service only. This is achieved by removing the SPIFFE ID of the `frontend-2` service from the `combined_validation_context` section at the [Envoy configuration](k8s/backend/config/envoy.yaml#L49). The updated configuration looks like this:

```console
combined_validation_context:
  # validate the SPIFFE ID of incoming clients (optionally)
  default_validation_context:
    match_typed_subject_alt_names:
    - san_type: URI
      matcher:
        exact: "spiffe://example.org/ns/default/sa/default/frontend"
```

## Apply the New Configuration for Envoy

To update the Envoy configuration for the `backend` workload use the file `backend-envoy-configmap-update.yaml`:

```console
$ kubectl apply -f backend-envoy-configmap-update.yaml
```

Next, the `backend` pod needs to be restarted to pick up the new configurations:

```console
$ kubectl scale deployment backend --replicas=0
$ kubectl scale deployment backend --replicas=1
```

Wait some seconds for the deployment to propagate before trying to view the `frontend-2` service in your browser again.
Once the pod is ready, refresh the browser using the correct URL for `frontend-2` service (e.g. `http://<IP_ADDRESS>:3002`). As a result, now Envoy does not allow the request to get to the `backend` service and account details are not shown in your browser.

![Frontend-2-no-details][frontend-2-view-no-details]

[frontend-2-view-no-details]: images/frontend-2_view_no_details.png "Frontend-2 view no details account"

On the other hand, you can check that the `frontend` service is still able to get a response from the `backend`. Refresh the browser at the correct URL (e.g. `http://<IP_ADDRESS>:3000`) and confirm that account details are shown for _Jacob Marley_.

# Extend the Scenario with a Role Based Access Control Filter

Envoy provides a Role Based Access Control (RBAC) HTTP filter that checks the request based on a list of policies. A policy consists of permissions and principals, where the principal specifies the downstream client identities of the request, for example, the URI SAN of the downstream client certificate. So we can use the SPIFFE ID assigned to the service to create policies that allow for more granular access control.

The `Symbank` demo application consumes three different endpoints to get all the information about the bank account. The `/profiles` endpoint provides the name and the address of the account's owner. The other two endpoints, `/balances` and `/transactions`, provide the balance and transactions for the account.

To demonstrate an Envoy RBAC filter, we can create a policy that allows the `frontend` service to obtain only data from the `/profile` endpoint and deny requests sent to other endpoints. This is achieved by defining a policy with a principal that matches the SPIFFE ID of the service and the permissions to allow only GET requests to the `/profiles` resource.

The following snippet can be added to the Envoy configuration for the `backend` service as a new HTTP filter to test the policy. _Note: In order for the Envoy configuration to work properly, this snippet must be added just before the existing `envoy.router` filter_.

```console
- name: envoy.filters.http.rbac
  typed_config:
    "@type": type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBAC
    rules:
      action: ALLOW
      policies:
        "general-rules":
          permissions:
              - and_rules:
                  rules:
                    - header: { name: ":method", exact_match: "GET" }
                    - url_path:
                        path: { prefix: "/profiles" }
          principals:
          - authenticated:
              principal_name:
                exact: "spiffe://example.org/ns/default/sa/default/frontend"
```

The example illustrates how to perform more granular access control based on request parameters when there is a TLS connection already established by Envoy instances which have obtained their identities from SPIRE.

# Cleanup

When you are finished running this tutorial, you can use the following script to remove all the resources used for configuring Envoy to perform X.509 authentication on workload's behalf. This command will remove:
   * All resources created for the SPIRE - Envoy X.509 integration tutorial.
   * All deployments and configurations for the SPIRE Agent, SPIRE Server, and namespace.

```console
$ bash scripts/clean-env.sh
```

repository: spiffe/spire-tutorials

gha_language: Shell

repo_name: spiffe/spire-tutorials


text:
---
redirect_from:
 - /ru/UpdateModes.html

title: ConEmu | Automatic update modes

description: ConEmu may be updated automatically in several ways

breadcrumbs:
 - url: TableOfContents.html#conemu
   title: ConEmu
 - url: Installation.html
   title: Installation

readalso:
 - url: SettingsUpdate.html
   title: "Settings › Update page"
 - url: InternetIssues
   title: "Troubleshoot internet issues"
 - url: VersionComparison.html
   title: "Comparison: distros, bitness, stages"
 - url: Installation.html
   title: "Installation"
 - url: AutoInstall.html
   title: "Automate your box installation"
 - url: UpdateSpeedup.html
   title: "Speedup update with installer"
---

# Automatic update modes

You may choose any suitable way to update you ConEmu installation

* [Automatic update (internal)](#automatic)
  * [Internet access issues](#auto-troubleshoot)
    * [Update Internet Explorer](#auto-ie)
    * [Change version.ini location](#auto-location)
    * [Change internal downloader switches](#auto-commandline)
    * [Use any third-party downloader tool](#auto-curl-wget)
* [Chocolatey](#chocolatey)
* [Manual update](#manual)
* [PortableApps.com](#portableapps)
* [MSYS2](#msys2)

{% include in_article.html %}

## Automatic update (internal)   {#automatic}

ConEmu is able to update itself if it was installed by
[Installer](http://conemu.github.io/en/VersionComparison.html#installer)
or
[7-Zip package](http://conemu.github.io/en/VersionComparison.html#zip-package).

All what you need is to enable
[Automatic updates](SettingsUpdate.html)
or just call ‘Help > Check for updates’ from
[SystemMenu](SystemMenu.html).

ConEmu's internal update is using [ConEmuC](ConEmuC.html#Download)
for accessing external sites. When automatic update check is issued,
ConEmu tries to download `version.ini` with information about current
versions available, and than, after confirmation, it downloads appropriate
[Installer](http://conemu.github.io/en/VersionComparison.html#installer)
or
[7-Zip package](http://conemu.github.io/en/VersionComparison.html#zip-package).

If download procedure fails for some reason please read
[Troubleshoot internet issues](InternetIssues.html) article.

## Chocolatey   {#chocolatey}

[Chocolatey](https://chocolatey.org/) is a Machine Package Manager,
somewhat like apt-get, but built with Windows in mind.

With help of Chocolatey you may execute the command,
which will download the
[Installer](http://conemu.github.io/en/VersionComparison.html#installer)
and do the update by `msiexec`.

~~~
choco upgrade conemu
~~~

## Manual update   {#manual}

If ConEmu failed to download update package, you may download the package yourself
from the [primary download site](Downloads.html).

Than you may trigger update procedure by Dropping downloaded package:

* either on the ConEmu shortcut on the desktop;
* or on the ConEmu's window title bar or [tab bar](TabBar.html).

## PortableApps.com   {#portableapps}

You may use automatic update by
[7-Zip package](http://conemu.github.io/en/VersionComparison.html#zip-package)
or PortableApps' standard method by selecting downloaded `ConEmu_*_English.paf.exe`.

## MSYS2   {#msys2}

**Note** Version of the available package may be obsolete because it's not maintained by ConEmu's authors.
Anyway, the command to update MSYS2 package is below.

~~~
pacman --needed -S conemu
~~~


text:
## DS : Data Science related
_____________________________
### S : Specializations
_____________________________

-             Biostatistics in Public Health
-             Excel to MySQL: Analytic Techniques for Business
-             Natural Language Processing
-             Ethics in the Age of AI
-             Advanced Machine Learning
-             Machine Learning for Everyone with Eric Siegel

_____________________________

### P : Projects
_____________________________

-
-                     Emotion AI: Facial Key points Detection
-                     Transfer Learning for NLP with TensorFlow Hub
-                     Image Compression with K Means Clustering
-                     Image Classification with CNNs using Keras
-                     Optimization of Topic Models using Grid Search Method
-                     Image Super Resolution Using Autoencoders in Keras
-                     Unsupervised Machine Learning for Customer Market Segmentation
-                     Fake News Detection with Machine Learning
-                     Neural Network from Scratch in TensorFlow
-                     Image Processing with Python
-                     Javascript animation for websites, storytelling, data visualization and games
-                     Create a First Person Camera (VM Compatible!) in Unity
-                     Deep Learning NLP: Training GPT 2 from scratch
-                     Siamese Network with Triplet Loss in Keras
-                     Language Classification with Naive Bayes in Python
-                     Image Noise Reduction with Auto encoders using TensorFlow
-                     Avoid Overfitting Using Regularization in TensorFlow
-                     Developing AI Applications on Azure
-                     Perform Sentiment Analysis with scikit learn
-                     Using Google Forms to Analyze User Research Data
-                     Predict Sales Revenue with scikit learn

_____________________________

### C : Courses
_____________________________

-                   Applied Data Science for Data Analysts
-                   Introduction to Designing Data Lakes in AWS
-                   Contact Center AI: Operations and Implementation
-                   Summary Statistics in Public Health
-                   Simple Regression Analysis in Public Health
-                   The Data Scientist’s Toolbox
-                   Multiple Regression Analysis in Public Health
-                   Population Health During A Pandemic: Contact Tracing and Beyond
-                   Hypothesis Testing in Public Health
-                   Measuring and Maximizing Impact of COVID-19 Contact Tracing
-                   Data Visualization and Dashboards with Excel and Cognos
-                   Custom Training Loops, Gradients, and Distributed Training
-                   Apache Spark (TM) SQL for Data Analysts
-                   AWS IoT: Developing and Deploying an Internet of Things
-                   Artificial Intelligence Privacy and Convenience
-                   Predictive Modeling with Logistic Regression using SAS
-                   Natural Language Processing with Classification and Vector Spaces
-                   Natural Language Processing with Attention Models
-                   Natural Language Processing with Probabilistic Models
-                   Natural Language Processing with Sequence Models
-                   Introduction to Deep Learning
-                   Artificial Intelligence Ethics in Action
-                   Natural Language Processing
-                   Custom Models, Layers, and Loss Functions with TensorFlow
-                   Artificial Intelligence Data Fairness and Bias
-                   Addressing Large Hadron Collider Challenges by Machine Learning
-                   Practical Reinforcement Learning
-                   Increasing Real Estate Management Profits: Harnessing Data Analytics
-                   Artificial Intelligence Algorithms Models and Limitations
-                   Unsupervised Learning
-                   Data Visualization and Communication with Tableau
-                   Deep Learning in Computer Vision
-                   Mastering Data Analysis in Excel
-                   How to Win a Data Science Competition: Learn from Top Kagglers
-                   Business Metrics for Data-Driven Companies
-                   Bayesian Methods for Machine Learning
-                   Big Data Integration and Processing
-                   Managing Big Data with MySQL
-                   Machine Learning Under the Hood: The Technical Tips, Tricks, and Pitfalls
-                   The Power of Machine Learning: Boost Business, Accumulate Clicks, Fight Fraud, and Deny Deadbeats
-                   Explainable AI: Scene Classification and GradCam Visualization
-                   Launching Machine Learning: Delivering Operational Success with Gold Standard ML Leadership
-                   COVID-19 Contact Tracing
-                   Building Conversational Experiences with Dialogflow
-                   Managing Machine Learning Projects with Google Cloud
-                   AWS Computer Vision: Getting Started with GluonCV


text:
(Ru)st ra(ft)
====

Basic implementation of a Raft distributed consensus algorithm, using `tokio` based on raft paper
[https://raft.github.io/raft.pdf](https://raft.github.io/raft.pdf).
Proof-of-concept made to learn, proceeding step by step starting with simple
abstractions over the concepts.
Referring to
[https://www.brianstorti.com/raft/](https://www.brianstorti.com/raft/) and
[http://thesecretlivesofdata.com/raft/](http://thesecretlivesofdata.com/raft/).

repository: codepr/ruft

repo_name: codepr/ruft


text:
# OctoberCMS Printful API Wrapper for OFFLINE/Mall

This plugin adds [Printful](https://www.printful.com/docs) Sync capabilities to the [OFFLINE\Mall](https://github.com/OFFLINE-GmbH/oc-mall-plugin) plugin.

It adds a new tab in the product backend called "Printful". There, you can pick your product and specify your print files. Once saved, each variant you have in your product will generate items to pick for each variant (Printful Variant, Print File, Option ID, and Option Value). Customize these to your needs

## Getting started
To use this plugin, you'll need the following:

 - OctoberCMS 2.0.*
 - you will need to set up your queue works in your application. You can learn how to do that via [OctoberCMS Documentation](https://octobercms.com/docs/setup/installation#queue-setup).
 - specify the `PRINTFUL_API_KEY` Found in your store in the `.env` file of your application.
 - specify if you would like to confirm the orders as soon as they are made under `PRINTFUL_CONFIRM_ORDERS` (boolean 1 = true, 0 = false)
 - specify your currency code under `PRINTFUL_CURRENCY_CODE`
 - Specify if you want to sync your products on save `PRINTFUL_SYNC_ON_SAVE` (boolean 1 = true, 0 = false)

 Env examples below:

```dotenv
PRINTFUL_API_KEY=someapiKey
# Confirm orders immediately in Printful (1 for yes, 0 for no. Defaults to 0)
PRINTFUL_CONFIRM_ORDERS=0
# Currency code, should be the one you set in the OFFLINE.mall backend.
PRINTFUL_CURRENCY_CODE=USD
# Sync Products on save to Printful. (1 for yes, 0 for no. Defaults to 1)
PRINTFUL_SYNC_ON_SAVE=1
```

To sync products to your store, run the command `php aritsan printful:sync` in your application's directory via command line. The products sync on save in the background if the queue workers are setup

### Sync on save
This option will sync ALL products in your system on save. Only useful if you have already run the command `php artisan printful:sync`. If you would like to change this, Please submit a pull request!

### Other Notes
This is a one way sync to Printful. It only syncs variants if the variant is selected in the backend and creates orders on the fly. If you would like to contribute to the code, I'd love the help! Please submit a pull request.

### License
MIT License

Copyright (c) 2021 Devin Green

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

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

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

repository: damsfx/printfulapi

repo_name: damsfx/printfulapi


text:
# User Agents
The agent package contains a number of methods for creating user agent strings for popular browsers
and crawlers, and for generating your own user agents.

```go
bow := surf.NewBrowser()

// Use the Google Chrome user agent. The Chrome() method returns:
// "Mozilla/5.0 (Windows NT 6.3; x64) Chrome/37.0.2049.0 Safari/537.36".
bow.SetUserAgent(agent.Chrome())

// The Firefox() method returns:
// "Mozilla/5.0 (Windows NT 6.3; x64; rv:31.0) Gecko/20100101 Firefox/31.0".
bow.SetUserAgent(agent.Firefox())

// The Safari() method returns:
// "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Safari/8536.25".
bow.SetUserAgent(agent.Safari())

// There are methods for a number of bows and crawlers. For example
// Opera(), MSIE(), AOL(), GoogleBot(), and many more. You can even choose
// the bow version. This will create:
// "Mozilla/5.0 (Windows NT 6.3; x64) Chrome/35 Safari/537.36".
ua := agent.CreateVersion("chrome", "35")
bow.SetUserAgent(ua)

// Creating your own custom user agent is just as easy. The following code
// generates the user agent:
// "Mybow/1.0 (Windows NT 6.1; WOW64; x64)".
agent.Name = "Mybow"
agent.Version = "1.0"
agent.OSName = "Windows NT"
agent.OSVersion = "6.1"
agent.Comments = []string{"WOW64", "x64"}
bow.SetUserAgent(agent.Create())
```

The agent package has an internal database for many different versions of many different browsers.
See the [agent package API documentation](api/packages/agent) for more information.

repository: cardigann/cardigann

gha_language: Go

repo_name: cardigann/cardigann


text:
---
layout: tutorials
title: Request/Reply
summary: Learn how to set up request/reply messaging.
icon: I_dev_R+R.svg
links:
    - label: BasicRequestor.cs
      link: /blob/master/src/BasicRequestor/BasicRequestor.cs
    - label: BasicReplier.cs
      link: /blob/master/src/BasicReplier/BasicReplier.cs
---

This tutorial outlines both roles in the request-response message exchange pattern. It will show you how to act as the client by creating a request, sending it and waiting for the response. It will also show you how to act as the server by receiving incoming requests, creating a reply and sending it back to the client. It builds on the basic concepts introduced in [publish/subscribe tutorial]({{ site.baseurl }}/publish-subscribe).

## Assumptions

This tutorial assumes the following:

*   You are familiar with Solace [core concepts]({{ site.docs-core-concepts }}){:target="_top"}.
*   You have access to Solace messaging with the following configuration details:
    *   Connectivity information for a Solace message-VPN
    *   Enabled client username and password

One simple way to get access to Solace messaging quickly is to create a messaging service in Solace Cloud [as outlined here]({{ site.links-solaceCloud-setup}}){:target="_top"}. You can find other ways to get access to Solace messaging below.

The build instructions in this tutorial assume you are using a Linux shell. If your environment differs, adapt the instructions.

## Goals

The goal of this tutorial is to understand the following:

*   On the requestor side:
    1.  How to create a request
    2.  How to receive a response
    3.  How to use the Solace API to correlate the request and response
*   On the replier side:
    1.  How to detect a request expecting a reply
    2.  How to generate a reply message

## Overview

Request-reply messaging is supported by the Solace message router for all delivery modes. For direct messaging, the Solace APIs provide the Requestor object for convenience. This object makes it easy to send a request and wait for the reply message. It is a convenience object that makes use of the API provided “inbox” topic that is automatically created for each Solace client and automatically correlates requests with replies using the message correlation ID. (See Message Correlation below for more details). On the reply side another convenience method enables applications to easily send replies for specific requests. Direct messaging request reply is the delivery mode that is illustrated in this sample.

It is also possible to use guaranteed messaging for request reply scenarios. In this case the replier can listen on a queue for incoming requests and the requestor can use a temporary endpoint to attract replies. The requestor and replier must manually correlate the messages. This is explained further in the [Solace documentation]({{ site.docs-gm-rr }}){:target="_top"} and shown in the API samples named `RRGuaranteedRequestor` and `RRGuaranteedReplier`.

### Message Correlation

For request-reply messaging to be successful it must be possible for the requestor to correlate the request with the subsequent reply. Solace messages support two fields that are needed to enable request-reply correlation. The reply-to field can be used by the requestor to indicate a Solace Topic or Queue where the reply should be sent. A natural choice for this is often the unique `P2PInboxInUse` topic which is an auto-generated unique topic per client which is accessible as a session property. The second requirement is to be able to detect the reply message from the stream of incoming messages. This is accomplished using the correlation-id field. This field will transit the Solace messaging system unmodified. Repliers can include the same correlation-id in a reply message to allow the requestor to detect the corresponding reply. The figure below outlines this exchange.

![]({{ site.baseurl }}/images/Request-Reply_diagram-1.png)

For direct messages however, this is simplified through the use of the `Requestor` object as shown in this sample.

{% include solaceMessaging.md %}
{% include solaceApi.md %}

## Making a request

First let’s look at the requestor. This is the application that will send the initial request message and wait for the reply.

![]({{ site.baseurl }}/images/Request-Reply_diagram-2.png)

The requestor must create a message and the topic to send the message to:

```csharp
using (IMessage requestMessage = ContextFactory.Instance.CreateMessage())
    requestMessage.Destination = ContextFactory.Instance.CreateTopic("tutorial/requests");
requestMessage.BinaryAttachment = Encoding.ASCII.GetBytes("Sample Request");
}
```

Now the request can be sent. This example demonstrates a blocking call where the method will wait for the response message to be received.

```csharp
IMessage replyMessage = null;
int timeout = 10000; // 10 secs
ReturnCode returnCode = session.SendRequest(requestMessage, out replyMessage, timeout);
```

If the call request was executed successfully then the returned return code is `ReturnCode.SOLCLIENT_OK`.

If the timeout is set to zero then the `SendRequest` call becomes non-blocking and it returns immediately.

## Replying to a request

Now it is time to receive the request and generate an appropriate reply.

![Request-Reply_diagram-3]({{ site.baseurl }}/images/Request-Reply_diagram-3.png)

Just as with previous tutorials, you still need to connect a session and subscribe to the topics that requests are sent on. The following is an example of such reply.

```csharp
private void HandleRequestMessage(object source, MessageEventArgs args)
{
    Console.WriteLine("Received request.");
    // Received a request message
    using (IMessage requestMessage = args.Message)
    {
        // Expecting the request content as a binary attachment
        RequestContent = Encoding.ASCII.GetString(requestMessage.BinaryAttachment);
        // Create reply message
        using (IMessage replyMessage = ContextFactory.Instance.CreateMessage())
        {
            // Set the reply content as a binary attachment
            replyMessage.BinaryAttachment = Encoding.ASCII.GetBytes("Sample Reply");
            Console.WriteLine("Sending reply...");
            ReturnCode returnCode = session.SendReply(requestMessage, replyMessage);
            if (returnCode == ReturnCode.SOLCLIENT_OK)
            {
                Console.WriteLine("Sent.");
            }
            else
            {
                Console.WriteLine("Reply failed, return code: {0}", returnCode);

            }
            // finish the program
            waitEventWaitHandle.Set();
        }
    }
}
```

The `HandleRequestMessage` is the routine that is passed as a callback to the CreateSession call:

```csharp
session = context.CreateSession(sessionProps, HandleRequestMessage, null);
```

## Receiving the Reply Message

All that’s left is to receive and process the reply message as it is received at the requestor. If you now update your requestor code to match the following you will see each reply printed to the console.

```csharp
ReturnCode returnCode = session.SendRequest(requestMessage, out replyMessage, timeout);
if (returnCode == ReturnCode.SOLCLIENT_OK)
{
    // Expecting reply as a binary attachment
    Console.WriteLine("Received reply: {0}", Encoding.ASCII.GetString(replyMessage.BinaryAttachment));
}
else
{
    Console.WriteLine("Request failed, return code: {0}", returnCode);
}
```

## Summarizing

The full source code for this example is available in [GitHub]({{ site.repository }}){:target="_blank"}. If you combine the example source code shown above results in the following source:

{% for item in page.links %}

{{ item.label }}

{% endfor %}

### Getting the Source

Clone the GitHub repository containing the Solace samples.

```
git clone {{ site.repository }}
cd {{ site.repository | split: '/' | last}}
```

### Building

Build it from Microsoft Visual Studio or command line:

```
> csc /reference:SolaceSystems.Solclient.Messaging_64.dll /optimize /out:BasicReplier.exe BasicReplier.cs
> csc /reference:SolaceSystems.Solclient.Messaging_64.dll /optimize /out:BasicRequestor.exe BasicRequestor.cs
```

You need `SolaceSystems.Solclient.Messaging_64.dll` (or `SolaceSystems.Solclient.Messaging.dll`) at compile and runtime time and `libsolclient.dll` at runtime in the same directory where your source and executables are.

Both DLLs are part of the Solace C#/.NET API distribution and located in `solclient-dotnet\lib` directory of that distribution.

### Running the Sample

First start the BasicReplier.exe so that it is up and listening for requests. Then you can use the BasicRequestor.exe sample to send requests and receive replies. Pass your Solace messaging router connection properties as parameters.

```
$ ./BasicReplier <host> <username>@<vpnname> <password>
Connecting as <username>@<vpnname> on <host>...
Session successfully connected.
Waiting for a request to come in...
Received request.
Request content: Sample Request
Sending reply...
Sent.
Finished.
```

```
$ ./BasicRequestor <host> <username>@<vpnname> <password>
Connecting as <username>@<vpnname> on <host>...
Session successfully connected.
Sending request...
Received reply: Sample Reply
Finished.
```

With that you now know how to successfully implement the request-reply message exchange pattern using Direct messages.

If you have any issues sending and receiving a message, check the [Solace community]({{ site.links-community }}){:target="_top"} for answers to common issues.

repository: bhalchandratk/solace-samples-dotnet

repo_name: bhalchandratk/solace-samples-dotnet


text:
# Dogmatiq Website

Source code for the [public website](https://dogmatiq.io).

[![Deployment Status](https://img.shields.io/github/deployments/dogmatiq/dogmatiq.github.io/github-pages?label=deployment&style=for-the-badge)](https://github.com/dogmatiq/dogmatiq.github.io/actions/workflows/pages/pages-build-deployment)


text:
- [Develop Locally, Use Images from Production | CSS-Tricks](https://css-tricks.com/develop-locally-use-images-production/)
- [pozorvlak | Falsehoods programmers believe about build systems](https://pozorvlak.dreamwidth.org/174323.html)

## Debug

- [Debugging Node.js with Chrome DevTools – Medium](https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27) - `node --inspect index.js` then open the provieded URL (start with `chrome-devtools://`)
- [RemoteDebug, an initiative to unify remote debugging across browsers.](http://remotedebug.org/)
- [google/tamperchrome: Tamper Chrome is a Chrome extension that allows you to modify HTTP requests on the fly and aid on web security testing. Tamper Chrome works across all operating systems (including Chrome OS).](https://github.com/google/tamperchrome)
- [RemoteDebug Protocol Compatibility Tables](https://compatibility.remotedebug.org/)
- [RemoteDebug, an initiative to unify remote debugging across browsers.](https://remotedebug.org/adaptors/)
- [WICG/devtools-protocol: DevTools Protocol](https://github.com/WICG/devtools-protocol)
- [ChromeDevTools/awesome-chrome-devtools: Awesome tooling and resources in the Chrome DevTools & DevTools Protocol ecosystem](https://github.com/ChromeDevTools/awesome-chrome-devtools#browser-adapters)
- [Microsoft/edge-diagnostics-adapter: Microsoft Edge Diagnostics Adapter is a protocol adapter that enables tools to debug Microsoft Edge using the Chrome DevTools Protocol.](https://github.com/Microsoft/edge-diagnostics-adapter)
- [Microsoft Edge DevTools Protocol - Microsoft Edge Development | Microsoft Docs](https://docs.microsoft.com/en-us/microsoft-edge/devtools-protocol/)

### Debug webpage on remote iOS Safari

Only for Safari, or webview in application **developper version only** (installed via XCode or App for [iOS simulator](../Operating%20Systems/iOS/iOS.md#test-application))

At least works with iOS 11.4:

1. connect iOS device with a cable
2. install iTunes, because usbmuxd can't configure correcly USB devices on Windows: [ios - Why are Windows binaries of libimobiledevice dependent on iTunes? - Stack Overflow](https://stackoverflow.com/questions/48851719/why-are-windows-binaries-of-libimobiledevice-dependent-on-itunes)
3. start iTunes and allow paring (iTunes show an alert)
4. "trust this computer" (iOS show an alert). See [Apple Support page](https://support.apple.com/en-ca/HT202778)
5. install `ios-webkit-debug-proxy` (win64 release comes with libimobiledevice) [Releases · google/ios-webkit-debug-proxy](https://github.com/google/ios-webkit-debug-proxy/releases)
6. allow Web Inpsector on iOS: Settings > Safari > Advanced > Web Inspector = ON
7. start `ios_webkit_debug_proxy.exe`
8. open chrome://inspect/#devices in Chrome

- [How to build libimobiledevice on Windows? · Issue #582 · libimobiledevice/libimobiledevice](https://github.com/libimobiledevice/libimobiledevice/issues/582)
- [libimobiledevice-win32/libimobiledevice: A cross-platform protocol library to communicate with iOS devices](https://github.com/libimobiledevice-win32/libimobiledevice)
- [google/ios-webkit-debug-proxy: A DevTools proxy (Chrome Remote Debugging Protocol) for iOS devices (Safari Remote Web Inspector).](https://github.com/google/ios-webkit-debug-proxy#installation)
- [RemoteDebug/remotedebug-ios-webkit-adapter: Debug Safari and WebViews on iOS from tools like VS Code, Chrome DevTools, Mozilla Debugger.html](https://github.com/RemoteDebug/remotedebug-ios-webkit-adapter) - Not required if you use ios-webkit-debug-proxy and Chrome
- [Install Quamotion iMobileDevice for Windows — Quamotion WebDriver 0.1 documentation](http://docs.quamotion.mobi/en/latest/imobiledevice/install.html)
- [Inspect docs](https://inspectdev.notion.site/Inspect-docs-ce34803e95d04b48ac5fe1255c0c3f6f)

Install a Fiddler proxy certificate:

1. [Configure Fiddler for iOS | Progress Telerik Fiddler](https://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureForiOS)
2. go to http://ipv4.fiddler:8888/ (update the right port Fiddler use) and click _FiddlerRoot certificate_ and install
3. **Important** Settings > General > About > Certificate Trust Settings and trust the installed root certificate (for the option : Fiddler > Tools > Options... > HTTPS > Capture HTTPS CONNECTs > Decrypt HTTPS traffic)

### Debug webpage on remote Android device

1. install Android SDK (could be [command line tools only](https://developer.android.com/studio/#command-tools)). Exemple in `%PROGRAMFILES(X86)%\Google\Android SDK`
2. install plaform tools `.\tools\bin\sdkmanager.bat "platform-tools"`. Note: if you install in "Program Files" folder, you need adminstrative rights to execute this commande, overwise you will get an error "Failed to read or create install properties file" or "Warning: File C:\Users\XXXXX\.android\repositories.cfg could not be loaded."
3. enable USB Debugging on the smartphone
4. `.\platform-tools\adb devices`
5. if needed, install USB drivers
6. open `chrome://inspect/` with Chrome (or in DevTools > Menu "Customize and Control DevTools" > More Tools > Remove devices)

- [Chrome DevTools Devices does not detect device when plugged in - Stack Overflow](https://stackoverflow.com/questions/21925992/chrome-devtools-devices-does-not-detect-device-when-plugged-in/22028058#22028058)
- [sdkmanager  |  Android Developers](https://developer.android.com/studio/command-line/sdkmanager)
- [Get Started with Remote Debugging Android Devices  |  Tools for Web Developers  |  Google Developers](https://developers.google.com/web/tools/chrome-devtools/remote-debugging/)
- [Start the emulator from the command line  |  Android Developers](https://developer.android.com/studio/run/emulator-commandline)
- [How can I install the GUI android SDK manager without installing Android Studio - Stack Overflow](https://stackoverflow.com/questions/43685301/how-can-i-install-the-gui-android-sdk-manager-without-installing-android-studio/51429889#51429889)
- [Is GUI for Android SDK manager gone? - Stack Overflow](https://stackoverflow.com/questions/41407396/is-gui-for-android-sdk-manager-gone)
- [WebView docs (go/webview-docs) - Net debugging in WebView](https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/net-debugging.md)

Android Emulator:

- [Download Android Studio and SDK tools  |  Android Developers](https://developer.android.com/studio#cmdline-tools) - "Command line tools only"
- [How to update Android emulator without Android Studio? - Stack Overflow](https://stackoverflow.com/questions/43147699/how-to-update-android-emulator-without-android-studio/43148199#43148199)
- [Releases · intel/haxm](https://github.com/intel/haxm/releases)
- [Paste text on Android Emulator - Stack Overflow](https://stackoverflow.com/questions/3391160/paste-text-on-android-emulator/16618811#16618811)
- [Use modified hosts file on Android Emulator – Code, Procedure and Rants – Medium](https://medium.com/code-procedure-and-rants/use-modified-hosts-file-on-android-emulator-4f29f5d12ac1)
- [android - Why is the intel x86 emulator accelerator (HAXM installer) is showing not compatible with windows? - Stack Overflow](https://stackoverflow.com/questions/41408552/why-is-the-intel-x86-emulator-accelerator-haxm-installer-is-showing-not-compat/43656782#43656782) (activate virtualization - Intel® VT-x - in the BIOS then install HAXM)

## Tools & Workflow

Export, Packing, Application packer (simple app/site vs. complexe app/site)

### Tasks

- generate output: HTML, CSS, JS, JSON, Image
- include/inject
- loose bits:
	- minification (optimize/reduce without require reverse operation)
		- use progressive images
		- remove unessary data (duplicates, unused), tags, selectors

- compact/compress (require processing to recover operable state): pre-gzip

- http://incident57.com/codekit/
- http://hammerformac.com/
- http://alphapixels.com/prepros/
- http://yeoman.io/
- [Grunt](http://gruntjs.com/configuring-tasks)
- https://speakerdeck.com/addyosmani/automating-front-end-workflow
- [Package Webproject with `make`]()
- http://www.nofluffjuststuff.com/blog/eric_wendelin/2011/08/continuous_integration_for_javascript

### NPM

	npm shrinkwrap && shrinkpack

	npm install someModule --ignore-scripts

- [shrinkwrap | npm Documentation](https://docs.npmjs.com/cli/shrinkwrap)
- https://www.npmjs.com/package/shrinkpack
- [Vulnerability Note VU#319816 - npm fails to restrict the actions of malicious npm packages](https://www.kb.cert.org/vuls/id/319816)

### Transcode

### Package

- https://github.com/rollup/rollup

## Package with `ninja`

- [Ninja, a small build system with a focus on speed](http://martine.github.io/ninja/)

## Build with `cmake`

- https://github.com/kogmbh/ViewerJS/blob/master/CMakeLists.txt
- https://github.com/markand/cmake-modules/blob/master/FindNode.cmake
- https://github.com/kogmbh/WebODF/blob/master/webodf/CMakeLists.txt
- [The Kitware Blog - CMake: building with all your cores](http://www.kitware.com/blog/home/post/434)
- https://stackoverflow.com/questions/11524481/minify-css-and-javascripts-files-before-packing-into-zip-using-cmake

## Build with `make`

- [.mobo — Se passer de Grunt/Gulp/Brunch/Broccoli/Mimosa/Jake grâce à Make](http://dotmobo.github.io/makefile-frontend.html)
- [GNU make](https://www.gnu.org/software/make/manual/make.html)
- https://algorithms.rdio.com/post/make/
- http://www.vittoriozaccaria.net/wmake/#make https://github.com/vzaccaria/make4web/blob/master/makefile.mk
- https://stackoverflow.com/questions/8385359/compile-all-less-file-using-a-makefile
- http://blog.yjl.im/2013/03/using-makefile-to-minify-and-switch.html
- http://blogs.mpr.org/developer/2014/02/makefile/
- http://nefariousdesigns.co.uk/website-builds-using-make.html
- [Simple makefile to minify CSS and JS - wonko.com](http://wonko.com/post/simple-makefile-to-minify-css-and-js)
- http://en.wikipedia.org/wiki/Make_(software)
- https://stackoverflow.com/questions/1079832/how-can-i-configure-my-makefile-for-debug-and-release-builds
- [Building Web Applications With Make – Smashing Magazine](http://www.smashingmagazine.com/2015/10/building-web-applications-with-make/)
- [Making the case for make | Shape Shed](http://shapeshed.com/making-the-case-for-make/)

Examples:

- [Makefile](https://gist.github.com/joho/7297517)
- https://github.com/es-shims/es-shim-api/blob/master/Makefile
- https://github.com/const-io/numeric-constants/blob/master/Makefile

 ```make
# scripts and map
scripts.js scripts.js.map: js-and-map
# And
js-and-map: scripts.js
	touch scripts.js
	touch scripts.js.map

.INTERMEDIATE: js-and-map
```

Few notes:

- [Recursive Make Considered Harmful](http://miller.emu.id.au/pmiller/books/rmch/)

Use make

#### Pro

- c'est une roue, pas besoin qu'elle soit réinventée
- n'intègre pas de package manager, quelques doit l'outils certain dépendances / outils (imagemagick, PHP, python, ruby, etc.) nécessitent d'être installés séparément (à la main ou via des package manager comme port, apt-get, composer, npm, gem, etc.)
- can be multicore task (use the parameter `-j`)

#### Cons

- can't handle space in paths
- http://www.conifersystems.com/whitepapers/gnu-make/
- plusieurs versions existent
- plutôt UNIX

Escape some chars:

```sh
VAR="Hello $USER! This symbole '#' is a hash."
```

Must be escaped as:

```sh
VAR="Hello $$USER! This symbole '\#' is a hash"
```

To not be considered as a comment

- [make - Anomalies: bug #712, GNU make can't handle spaces in... [Savannah]](http://savannah.gnu.org/bugs/?712)
- [shell - Can GNU make handle filenames with spaces? - Stack Overflow](https://stackoverflow.com/questions/9838384/can-gnu-make-handle-filenames-with-spaces)

### Steps `./configure && make && make install`

```sh
./configure
```

tells you whether are quite ready to build the application. It will check if you have everything needed to build the application, and, if it sees any critical errors it will inform you.

```sh
make
```

builds (compiles) the source code. Compiler compiles the code, but, most of the times, the code cannot stand alone, it requires external libraries (usually provided by ubuntu packages) to be installed. After this step the executable(s) of this specific application you are trying to install will be created.

```sh
sudo make install
```

moves all the needed for the application files to the appropriate system directories. This has to be done after make because the executables of the application have been created and can be moved to the appropriate system directory (e.g. /usr/bin/) for later use.

Libraries are necessary, because they allow a programmer to use code made by other people to achieve certain things. i.e. if I wanted to do some disk formatting in my program, I could use the libs someone already wrote to do the formatting, and I just have to make my program call those libraries. If that person finds an issue in their library, they can fix it, and it will fix it in my program too. This is how open-source software can be written so fast and be so stable.

http://askubuntu.com/questions/173088/what-does-configure-make-make-install-do

### When files changes

Continuous integration

- [automation - Do something when a file is changed - Super User](http://superuser.com/questions/416846/do-something-when-a-file-is-changed)
- [makefile - Is there a smarter alternative to "watch make"? - Stack Overflow](https://stackoverflow.com/questions/7539563/is-there-a-smarter-alternative-to-watch-make)
- http://superuser.com/questions/181517/how-to-execute-a-command-whenever-a-file-changes
- https://stackoverflow.com/questions/1515730/is-there-a-command-like-watch-or-inotifywait-on-the-mac
- http://andries.filmer.nl/kb/Monitoring-file-system-events-with-inotify,-incron-and-authctl/129
- [The Refresh CSS Bookmarklet -or- How to iterate quickly when debugging CSS - Paul Irish](https://www.paulirish.com/2008/how-to-iterate-quickly-when-debugging-css/)

#### Bash script

```sh
#!/bin/sh
while true ; do make ; sleep 1 ; done
```

#### watch command

```sh
watch make
```

```sh
watch -n 0.5 "make 2>&1"
```

- [coderwall.com : establishing geek cred since<PHONE_NUMBER>](https://coderwall.com/p/e0kj9w/watch-for-changes-and-then-rebuild-source-code-using-make)

#### watchman

https://github.com/facebook/watchman

```sh
brew install watchman
```

```sh
sudo port install watchman
```

#### fswatch

https://github.com/alandipert/fswatch

```sh
brew install fswatch
```

```sh
cd /tmp && git clone https://github.com/alandipert/fswatch && cd fswatch/ && make && cp fswatch /usr/local/bin/fswatch
```

#### inotifywait

Via `inotify-tools` package

Only available on LINUX

- http://liquidat.wordpress.com/2013/11/14/howto-acting-on-inotify-events-in-a-shell-with-inotifywait/
- http://blog.lagentz.com/general/automate-your-shell-scripts-using-inotify-and-inotifywait/
- https://stackoverflow.com/questions/18289449/how-to-get-recursive-directory-path-using-inotify-tools-in-terminal
- https://stackoverflow.com/questions/tagged/inotify-tools
- http://xaroumenosloukoumas.wordpress.com/2011/01/28/watching-directories-for-file-changes-with-inotifywait/

### Filename with spaces

Make generaly don't handle filename with space (spaces used as separators)

- Use quotes when it's possible
- `touch $(subst \,\\,$@)`

- http://www.cmcrossroads.com/article/gnu-make-meets-file-names-spaces-them?page=0%2C2
- https://stackoverflow.com/questions/9838384/can-gnu-make-handle-filenames-with-spaces

### Dependencies

## Others

- https://github.com/ai/autoprefixer/tree/master/lib/hacks
- http://www.phpied.com/diy-source-maps/
- http://www.phpied.com/css-diff/

### Java

http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html#javasejdk

### Google Closure Compiler

`/usr/share/java/closure-compiler.jar`

Externs:

```js
// ==ClosureCompiler==
// @output_file_name default.js
// @compilation_level ADVANCED_OPTIMIZATIONS
// @js_externs window.sas = {}
// @js_externs window.sas.setup = function(config){config.networkid;config.domain}
// ==/ClosureCompiler==
window.sas;
sas.setup({networkid: 0, domain: 0})
```

- [Advanced Compilation and Extern  |  Closure Compiler  |  Google Developers](https://developers.google.com/closure/compiler/docs/api-tutorial3#externs)
- [Advanced Compilation and Extern  |  Closure Compiler  |  Google Developers](https://developers.google.com/closure/compiler/docs/api-tutorial3#howto-api)

#### `git && ant`

```sh
#!/bin/bash
mkdir closure-compiler
cd closure-compiler
git clone https://github.com/google/closure-compiler.git .
ant jar
sudo cp -f ./build/compiler.jar /opt/local/share/java/closure-compiler.jar
cd ..
rm -rf closure-compiler
```

#### Download

```sh
#!/bin/bash
wget -qO- -O compiler-latest.zip http://dl.google.com/closure-compiler/compiler-latest.zip
unzip compiler-latest.zip -d compiler-latest
cp -f compiler-latest/compiler.jar /opt/local/share/java/closure-compiler.jar
rm -rf compiler-latest
```

https://github.com/google/closure-compiler
http://dl.google.com/closure-compiler/compiler-latest.zip

Homebrew
https://github.com/Homebrew/homebrew/blob/master/Library/Formula/closure-compiler.rb
https://groups.google.com/forum/#!topic/brew-test-bot/OiQ3aliyUkw
https://github.com/gmarty/grunt-closure-compiler/issues/2

Debian
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=705565
https://packages.debian.org/source/sid/closure-compiler

### Nailgun

Nailgun (for java)
http://www.martiansoftware.com/nailgun/
https://github.com/Homebrew/homebrew/issues/21880
https://github.com/sethp-jive/homebrew/blob/0f0a86819d8f5bd53251f263a26ae8119f88dc20/Library/Formula/nailgun.rb

	#!/bin/bash
	# Server (java)
	sudo wget -qO- -O /opt/local/share/java/nailgun.jar http://central.maven.org/maven2/com/martiansoftware/nailgun-server/0.9.1/nailgun-server-0.9.1.jar
	# Client (c)
	mkdir nailgun-client
	cd nailgun-client
	git clone https://github.com/martylamb/nailgun.git .
	# Will install ng in /usr/local/bin/ng
	sudo make install
	cd ..
	rm -rf nailgun-client

Exist as a variant of jruby: https://trac.macports.org/ticket/20552

## Bundling

- [Modern web apps without JavaScript bundling or transpiling](https://world.hey.com/dhh/modern-web-apps-without-javascript-bundling-or-transpiling-a20f2755)
- [Webpack](#webpack)

## Webpack

- [How webpack works - sokra](https://github.com/sokra/slides/blob/master/data/how-webpack-works.pdf)

Webpack use enhanced-resolve

- [enhanced-resolve/ResolverFactory.js at 5c1495a947060cf11106abc325b8adf1a0eff9b1 · webpack/enhanced-resolve](https://github.com/webpack/enhanced-resolve/blob/5c1495a947060cf11106abc325b8adf1a0eff9b1/lib/ResolverFactory.js#L160-L173)
- [API - Document When a Plugin Should Call `doResolve()` · Issue #1458 · webpack/webpack.js.org](https://github.com/webpack/webpack.js.org/issues/1458) - webpack resolver waterfall/sequential of resolution
- [rename-loader - npm](https://www.npmjs.com/package/rename-loader)
- [shaketbaby/directory-named-webpack-plugin: A Webpack plugin that treats a file with the name of directory as the index file](https://github.com/shaketbaby/directory-named-webpack-plugin)

Import a file that is not in the filesystem:

- data URI, or loader without resource but with [inline matchResource](https://webpack.js.org/api/loaders/#inline-matchresource)
- [v5 module dep invalidation not working in cases that do in v4 · Issue #11074 · webpack/webpack](https://github.com/webpack/webpack/issues/11074#issuecomment-648658214)
- use a custom scheme [reactjs - Module build failed: UnhandledSchemeError: Reading from "alias:/path" is not handled by plugins (Unhandled scheme) - Stack Overflow](https://stackoverflow.com/questions/66278241/module-build-failed-unhandledschemeerror-reading-from-alias-path-is-not-han)

Loaders:

- Loader rule/condition: `resourceQuery` (match the resource query string), `issuer` (parent resource)
- [Loaders | webpack](https://webpack.js.org/loaders/) and [list of loaders · webpack/docs Wiki](https://github.com/webpack/docs/wiki/list-of-loaders)

Other:

- [javascript - How to import library which is not module in webpack - Stack Overflow](https://stackoverflow.com/questions/50176740/how-to-import-library-which-is-not-module-in-webpack/51360811#51360811)
- [Plugins | webpack](https://webpack.js.org/plugins/) and [list of plugins · webpack/docs Wiki](https://github.com/webpack/docs/wiki/list-of-plugins)
- [scinos/webpack-plugin-hash-output: Plugin to replace webpack chunkhash with an md5 hash of the final file conent.](https://github.com/scinos/webpack-plugin-hash-output)

## Puppeteer

See also [playwright](https://github.com/microsoft/playwright)

- [puppeteer/examples at master · GoogleChrome/puppeteer](https://github.com/GoogleChrome/puppeteer/tree/master/examples)
- [Migrating from Puppeteer to Playwright | Checkly](https://web.archive.org/web/20211116174819/https://www.checklyhq.com/guides/puppeteer-to-playwright/)

### Update DOM objects

```js
page.evaluateOnNewDocument(() => {
	// Return fake languages preferences
	Object.defineProperty(navigator, "languages", {
	  get: function() {
		return ["en-US", "en", "bn"];
	  }
	});
});
```

```js
page.evaluateOnNewDocument(() => {
	// Return fake list of plugins
	const mimetype = Object.create(MimeType.prototype, {
		description: {value: "Portable Document Format"},
		suffixes: {value: "pdf"},
		type: {value: "application/x-google-chrome-pdf"},
	});
	const plugin = Object.create(Plugin.prototype, {
		description: {value: "Portable Document Format"},
		filename: {value: "internal-pdf-viewer"},
		length: {value: 1},
		name: {value: "Chrome PDF Plugin"},
		[mimetype.type]: {value: mimetype},
		0: {value: mimetype},
	});
	Object.defineProperty(mimetype, "enabledPlugin", {value: plugin});

	const pluginsArray = Object.create(PluginArray.prototype, {
		0: {value: plugin},
		[plugin.name]: {value: plugin},
		length: {value: 1},
	});

	// Fix item/namedItem listing
	for(const [{prototype}, type] of [[PluginArray, Plugin], [Plugin, MimeType]]){
		Object.defineProperties(prototype, {
			item: {value: function item(index){
				index = parseInt(index);
				return !isNaN(index) && this[index] instanceof type ? this[index] : null;
			}},
			namedItem: {value: function namedItem(name){
				return this[name] instanceof type ? this[name] : null;
			}},
		});
	}

	// TODO:
	// - implement iterator protocol on plugin array
	// - set correctly object properties descriptions (enumerable, configurable)
	// - set correctly function toString() -> "function namedItem() { [native code] }"
	Object.defineProperty(navigator, "plugins", {
		configurable: true,
		enumerable: true,
		get: function plugins() {
			return pluginsArray;
		}
	});
});
```

- [puppeteer/api.md at master · GoogleChrome/puppeteer](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageevaluateonnewdocumentpagefunction-args)

### Get page metrics

```js
await page.goto(url, {waitUntil: 'load'});
const performance = JSON.parse(await page.evaluate(() => performance.toJSON()));
```

```js
await this._client.send('Performance.enable');
const metrics = await page._client.send('Performance.getMetrics');
```

- [How can we get response time? Page metrics doesn't have it. · Issue #1368 · GoogleChrome/puppeteer](https://github.com/GoogleChrome/puppeteer/issues/1368#issuecomment-343866624)
- [puppeteer/api.md at master · GoogleChrome/puppeteer](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagemetrics)

### Get cookies

Get only first party cookies (see https://stackoverflow.com/questions/50252943/puppeteer-get-3rd-party-cookies):

```js
const cookies = await page.cookies();// gives only first party cookies
```

To get all (first and third) parties cookies, we need to use Dev Tools protocol (low level)

```js
const {cookies} = await page._client.send('Network.getAllCookies');
```

### Listen page events

Use an exposed function ([`Page.exposeFunction()`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageexposefunctionname-puppeteerfunction))

- [javascript - Puppeteer: How to listen to object events - Stack Overflow](https://stackoverflow.com/questions/47107465/puppeteer-how-to-listen-to-object-events/56173142#56173142)
- [puppeteer/custom-event.js at master · GoogleChrome/puppeteer](https://github.com/GoogleChrome/puppeteer/blob/master/examples/custom-event.js)

## Extending tools

### Extending ESLint

Aka write a plugin for ESLint

- [javascript - How to forbid a specific named function with ESlint - Stack Overflow](https://stackoverflow.com/questions/40977713/how-to-forbid-a-specific-named-function-with-eslint/40979625#40979625)

### Extending Prettier

Aka write a plugin for Prettier

TODO

### Extending Babel

Aka write a plugin for Babel

TODO

### Extending webpack

Aka write a plugin for webpack, write a loader for webpack

- [Writing a Plugin | webpack](https://webpack.js.org/contribute/writing-a-plugin/#root)
- [Writing a Loader | webpack](https://webpack.js.org/contribute/writing-a-loader/)

repository: mems/calepin

repo_name: mems/calepin


text:
Add / edit your timed-task in this screen.

### Timed-tasks have a unique ID

openHAB stores *Timed-tasks* by their unique ID.
You can retrieve a *Timed-task* in *Rules* and *Scripts* by referencing it by its ID.

### Tags

Tags can be assigned to *Timed-tasks*.
You can retrieve all *Timed-tasks* of a given Tag within *Rules* and *Scripts*.

### Show Timed-tasks in apps

The Android and iOS App as well as HabPanel will only show *Timed-tasks* that have the "Expose" checkbox ticked.
Others are considered *private*.

All dynamically created *Timed-tasks* are *private* by default.

### Delete after triggered

Removes the *Timed-task* after it has triggered.
Most useful for dynamically created ones.

### Enabled

A disabled *Timed-task* will not trigger.
An absolute *Timed-task*, that has triggered will disable itself.

<mark>Use-case:</mark> Create *Timed-tasks* here in this interface, but enable/disable them in Rules for example.

### Trigger item command

You can also issue an item command directly instead of just triggering.
A *Timed-task* that triggers is usually only useful for Rules and Scripts.

repository: Schnilz/paperui-ng

repo_name: Schnilz/paperui-ng


text:
# Algorithmic Heights

A collection of exercises in introductory algorithms to accompany
["Algorithms"][book], the popular textbook by Dasgupta, Papadimitriou, and
Vazirani.

[book]: http://www.amazon.com/Algorithms-Sanjoy-Dasgupta/dp/0073523402

## Progress

repository: erictleung/rosalind

repo_name: erictleung/rosalind


text:
---
type: rule
archivedreason:
title: Do you have good quality images?
guid: d20d60cd-d725-48db-8dd7-d739d0f0db63
uri: good-quality-images
created: 2020-04-06T19:39:15.0000000Z
authors:
- title: Adam Cogan
  url: https://ssw.com.au/people/adam-cogan
- title: Tiago Araujo
  url: https://ssw.com.au/people/tiago-araujo
related: []
redirects:
- do-you-have-good-quality-images

---

Every time you add an image to your content, make sure it:

<!--endintro-->

* Has at least 800px width (except for logos, icons, and profile images)
* Is readable if it has any text on it
* Looks consistent with others on the same page
* (optional) Is not in dark-mode - Light background images look better most of the times


text:
---
title: SOC0
name: Social Studies
code: SOC0
subject_area: Social Studies
date: 2019-07-29T02:43:12.682Z
year: '10'
type: Compulsory
course_duration: Full Year
course_level: Year 10
leads_to:
  - GEO1
  - SOC1
  - ACC1
  - ECO1
  - GEO1S
  - CLS1
  - TOU2
credits: ''
entry_requirements: Completion of SOCE (Year 9) Social Science Course.
---
**Purpose:**

To provide students with the knowledge and skills required for future studies in Social Science.

**Content:**

Students will develop understanding of the unique nature of Aotearoa, New Zealand's bi-cultural heritage as well as multi-cultural societies in other parts of the world.

**Assessment:**

Year 10 End of Year Exam. Internal Unit Assessment.

repository: WhanganuiHigh/Website

repo_name: WhanganuiHigh/Website


text:
# alpine

Create, control, and connect to Alpine instances.

## Description

Create, control, and connect to Alpine instances.

## Options

```
  -h, --help   help for alpine
```

repository: beringresearch/macpine

repo_name: beringresearch/macpine


text:
---
title: "World War Z (2013) Full Movie [Hindi English] 480p 720p"
date: "2020-10-06"
---

[**![World War Z (2013) Full Movie [Hindi English] 480p 720p ](https://1.bp.blogspot.com/-WPGySqNg0Wk/XywQYBemJaI/AAAAAAAAEQA/ExX1kD8bIOYzqbTVTnGUysLqYP0scMlKACLcBGAsYHQ/s1600/RsTbddCGbe6S.webp "World War Z (2013) Full Movie [Hindi English] 480p 720p ")**](https://1.bp.blogspot.com/-WPGySqNg0Wk/XywQYBemJaI/AAAAAAAAEQA/ExX1kD8bIOYzqbTVTnGUysLqYP0scMlKACLcBGAsYHQ/s1600/RsTbddCGbe6S.webp)

 **World War Z (2013)**

**Full Movie \[Hindi English\] 480p 720p**

**World War Z (2013)**

**116 min|Action, Adventure, Horror, Sci-Fi|**

**Rating: 7.0 / 10**

**Director: Marc Forster**

**Creator: Matthew Michael Carnahan (screenplay), Drew Goddard (screenplay), Damon Lindelof (screenplay), Matthew Michael Carnahan (screen story), J. Michael Straczynski (screen story), Max Brooks**

**Actors: Brad Pitt, Mireille Enos, Daniella Kertesz, James Badge Dale**

**Please Off Ad- Block Download**

**{ Hindi-English } Blu-Ray Dual Audio**

**480p Dual Audio { Hindi English }**

[**Download**](http://hdmovielink.xyz/2724)

**720p Dual Audio { Hindi English }**

[**Download**](http://hdmovielink.xyz/2725)

 **Hollywood Adventure Movies In Hindi Dubbed Full Action HD, Fantasy Action Sci-Fi,**

**Horror Movies, Hollywood Hindi Dual 480P, 720P, 1080P, Download Best Sci-Fi Movies Imdb**

**Hollywood Full Movies Series All Part**

**Available On This Sites.**


text:
# Practice

## Task #1

## Task #2

Design a prototype with appropriate variables and events to allow users increase and decrease each value in a table and calculate the sum.

![Order demo](./media/order.gif)

1. Start from the blank prototyping [template](./../Setup/README.md).
2. Create a layout similar to the shown above but with your own styles.
3. Store all prices, quantities and a total as [variables](./../Data/README.md) and [display](./../Data/display.md#displaying-in-containers) them in the layout.
4. Create [click events](./click.md) for each '-', '+' and 'Calculate' buttons.
5. Make sure that your total is a sum of all prices, each multiplied by the corresponding quantity. You'll need to [group](./arithmetics.md#groupping) your operations to achieve that.


text:
# GenericTypeReflection
Small demonstration of how to get the generic type arguments of a field with reflection

The important things are:

    Field field; // a field that you get through java.lang.reflect, for example with `object.getClass().getDeclaredFields()`
    Type type = field.getGenericType();
    if (type instanceof ParameterizedType) {
        ParameterizedType parameterized = (ParameterizedType) type;
        Type[] types = parameterized.getActualTypeArguments();
    }

Remember that `Class extends Type`, so your resulting `Type` objects may be for example `String.class`

license: Unlicense

repository: Zomis/GenericTypeReflection

repo_name: Zomis/GenericTypeReflection