text:
Background
==========

This tool can be used with Apache ActiveMQ to dump and send JMS XML TextMessages for performance tests or to execute functional tests of the message processing.

This is not a very sophisticated implementation, i just published the tool because a former coworker requested a copy of it :-)

Features:

- read messages from a messagequeue and store them in the order of the queue to files
  - read messages by queue-browsing (and do not remove them from the queue) or by fetching the from the queue
  - store messages by counts of 1000 (possibility to add additional messages)
- upload message files to a queue
  - read files and send them in sorted order from a directory
  - read files and send them in random order from a directory
  - read gzip compressed files
  - get queuenames from the filename

Example Directory:
```
<Counter > < Queuename         >
0000001000_FOO.BAR_BAZ_Barfoo.IN.xml
0000002000_FOO.BAR_BAZ_Barfoo.IN.xml
0000003000_FOO.BAR_BAZ_Barfoo.IN.xml
0000003100_FOO.BAR_BAZ_BarTTT.IN.xml
0000004200_FOO.BAR_BAZ_Barfoo.IN.xml
0000005000_FOO.BAR_BAZ_Barfoo.IN.xml.gz
0000005000_FOO.BAR_BAZ_Barfoo.IN.xml.gz
```

Help output:
```
$ java -jar target/messageutil-1.0-SNAPSHOT-jar-with-dependencies.jar

Usage: java -jar messageutil-1.0-SNAPSHOT-jar-with-dependencies.jar <options> <dir>

General options:
-u                        Broker url

Dumping options:
-d <queue>                Dump Messages from Queue
-b <inscrement>           Start increment counter at this number
-i <inscrement>           Increment by this number
-m                        Remove 'MANUAL' string in queuename while saving files
-c                        Consume messages instead of browsing  the messages

Replay options:
-r                        Replay messages
-q <queue>                Use a fixed queue for replay
                          (ignore queuename included in the filenames)
-p                        File pattern
                          Default: '\d{10}_(?<queuename>.+)\.xml'
-s                        Shuffle messages on sending
-t [a|e]#<name>#<time mofification> Modify all time information of the specified xml (e)lement or (a)ttribute before sending, separate them by ';'
                          (s=seconds,m=minutes,h=hours,d=days)
                          Example: 'e#ns0:LastModifiedDateTime#-2d;-2m' 't15m;+5s
```

How to extend and to use
=========================

Travis CI is located at: https://travis-ci.org/scoopex/jms-message-util

  * Build project
    ```
    mvn package
    ```
  * Show help
    ```
    java -jar target/jms-message-util-jar-with-dependencies.jar -h
    ```
  * Dump queue "TEST" and store files to /tmp
    ```
    java -jar target/jms-message-util-jar-with-dependencies.jar -d TEST /tmp/
    java -jar target/jms-message-util-jar-with-dependencies.jar -u "tcp://<IP_ADDRESS>:61616?jms.useCompression=true" \
       -d FOO.BAR_BAZ_Barfoo-MANUAL.IN ~/temp/test-jms-dump
    ```
  * Send messages stored in /tmp  and send them in random order
    ```
    java -jar target/jms-message-util-jar-with-dependencies.jar -s  -r src/test/resources/xml/good/
    ```
  * Send Messages from /tmp to the specified queues and change the Timestamps in the XML files
    ```
    java -jar target/jms-message-util-jar-with-dependencies.jar -s  -r \
      -t "attribute#LastModifiedDateTime#-2d;+2m" \
      -t "element#ns0:CreatedDateTime#-2d;+2m" \
      -t "element#ns0:ModifiedDateTime#-2d;+2m" src/test/resources/xml/good/
    ```
  * Send messages of the directory /tmp to queue FOOQUEUE and ignore queuenames contained in the filesnames
    ```
    java -jar target/jms-message-util-jar-with-dependencies.jar -s -q FOOQUEUE -r -t "+2d" src/test/resources/xml/good/
    ```

repository: scoopex/jms-message-util

repo_name: scoopex/jms-message-util


text:
# check_domains

Check if the domain is free by checking if the SOA record exists.

## Installation

Install requirements using pip:

```shell
pip install -r requirements.txt
```

## Generating a list of domains

The easiest way is to use the [crunch](https://sourceforge.net/projects/crunch-wordlist/).

### Examples:

To generate a list consisting of 2-character domains (numbers and letters) for the **.pl**. Just run the command:

```shell
crunch 5 5<PHONE_NUMBER>abcdefghijklmnopqrstuvwxyz -t @@.pl -o domains.txt
```

To generate a list consisting of 3-character domains (letters only) for the **.pl**. Just run the command:

```shell
crunch 6 6 abcdefghijklmnopqrstuvwxyz -t @@@.pl -o domains.txt
```

## Usage

### To view help:

```shell
python check_domains.py
```

### Help:

```
usage: check_domains.py [-h] -p PROCESS [-o OUTPUT] [-e]

Checking if the domain has SOA records. If it doesn't, there is a good chance
that it can be free.

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Output file
  -e, --errors          DNS errors as registered domains

required arguments:
  -p PROCESS, --process PROCESS
                        File to process
```

### To start checking domains:

```shell
python check_domains.py -p domains.txt
```

where `domains.txt` is your domains file to check

### To start checking domains and saving the output:

```shell
python check_domains.py -p domains.txt -o output.txt
```

where `domains.txt` is your domains file to check and `output.txt` is a file with domains that can be free

You can also use the `-e` flag to not display domains as free if there was a DNS error.

```shell
python check_domains.py -p domains.txt -o output.txt -e
```

where `domains.txt` is your domains file to check and `output.txt` is a file with domains that can be free

### Script that checks only **.pl** domains

If you only have a few **.pl** domains to check, for example after using the previous script, you can check them with a
script that queries the [dns.pl](https://dns.pl/) API.

**Remember that there is a limit of API calls!**

```shell
python check_domains_pl.py -p domains.txt -o output.txt
```

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
title: How to Access Your Content via AEM Delivery APIs
description: In this part of the AEM Headless Developer Journey, learn how to use GraphQL queries to access your Content Fragments content.
exl-id: 44f85d00-a958-470a-8a6e-e2ae1580525a
---
# How to Access Your Content via AEM Delivery APIs {#access-your-content}

In this part of the [AEM Headless Developer Journey,](overview.md) you can learn how to use GraphQL queries to access the content of your Content Fragments and feed it to your app (headless delivery).

## The Story So Far {#story-so-far}

In the previous document of the AEM headless journey, [How to Model Your Content](model-your-content.md) you learned the basics of content modeling in AEM, so you should now understand how to model your content structure, then realize that structure using AEM Content Fragment Models and Content Fragments:

* Recognize the concepts and terminology related to content modeling.
* Understand why content modeling is needed for Headless content delivery.
* Understand how to realize this structure using AEM Content Fragment Models (and author content with Content Fragments.
* Understand how to model your content; principles with basic samples.

This article builds on those fundamentals so you understand how to access your existing headless content in AEM using the AEM GraphQL API.

* **Audience**: Beginner
* **Objective**: Learn how to access the content of your Content Fragments using AEM GraphQL queries:
  * Introduce GraphQL and the AEM GraphQL API.
  * Dive into the details of the AEM GraphQL API.
  * Look at some sample queries to see how things work in practice.

## So You'd Like to Access Your Content? {#so-youd-like-to-access-your-content}

So...you've got all this content, neatly structured (in Content Fragments), and just waiting to feed your new app. Question is - how to get it there?

What you need is a way to target specific content, select what you need and return it to your app for further processing.

With Adobe Experience Manager (AEM), you can selectively access your Content Fragments, using the AEM GraphQL API, to return only the content that you need. This means you can realize headless delivery of structured content for use in your applications.

>[!NOTE]
>
>AEM GraphQL API is a customized implementation, based on the standard GraphQL API specification.

## GraphQL - An Introduction {#graphql-introduction}

GraphQL is an open-source specification that provides:

* a query language that enables you to select specific content from structured objects.
* a runtime to fulfill these queries with your structured content.

GraphQL is a *strongly* typed API. This means that *all* content must be clearly structured and organized by type, so that GraphQL *understands* what to access and how. The data fields are defined within GraphQL schemas, that define the structure of your content objects.

GraphQL endpoints then provide the paths that respond to the GraphQL queries.

All this means that your app can accurately, reliably and efficiently select the content that it needs - just what you need when used with AEM.

>[!NOTE]
>
>See *GraphQL*.org and *GraphQL*.com.

<!--
## AEM and GraphQL {#aem-graphql}

GraphQL is used in various locations in AEM; for example:

* Content Fragments
  * A customized API has been developed for this use-case (Headless Delivery to your app).
    * This is the AEM GraphQL API.
* Commerce
  * AEM Commerce consumes data from a Commerce platform via GraphQL.
  * There are GraphQL integrations between AEM and various third-party commerce solutions, used with the extension hooks provided by the CIF Core Components.
    * This does not use the AEM GraphQL API.

>[!NOTE]
>
>This step of the Headless Journey is only concerned with the AEM GraphQL API and Content Fragments.
-->

## AEM GraphQL API {#aem-graphql-api}

The AEM GraphQL API is a customized version based on the standard GraphQL API specification, specially configured to let you perform (complex) queries on your Content Fragments.

Content Fragments are used, as the content is structured according to Content Fragment Models. This fulfills a basic requirement of GraphQL.

* A Content Fragment Model is built up of one, or more, fields.
  * Each field is defined according to a Data Type.
* Content Fragment Models are used to generate the corresponding AEM GraphQL Schemas.

To actually access GraphQL for AEM (and the content) an endpoint is used to provide the access path.

The content returned, via the AEM GraphQL API, can then be used by your applications.

To help you directly input, and test queries, an implementation of the standard GraphiQL interface is also available for use with AEM GraphQL (this can be installed with AEM). It provides features such as syntax-highlighting, auto-complete, auto-suggest, together with a history and online documentation.

>[!NOTE]
>
>The AEM GraphQL API implementation is based on the GraphQL Java libraries.

<!--
### Use Cases for Author and Publish Environments {#use-cases-author-publish-environments}

The use cases for the AEM GraphQL API can depend on the type of AEMenvironment:

* Publish environment; used to:
  * Query content for JS application (standard use-case)

* Author environment; used to:
  * Query content for "content management purposes":
    * GraphQL in AEM is currently a read-only API.
    * The REST API can be used for CR(u)D operations.
-->

## Content Fragments for use with the AEM GraphQL API {#content-fragments-use-with-aem-graphql-api}

Content Fragments can be used as a basis for GraphQL for AEM schemas and queries as:

* They enable you to design, create, curate and publish page-independent content that can be delivered headlessly.
* They are based on a Content Fragment Model, which pre-defines the structure for the resulting fragment using a selection of data types.
* Additional layers of structure can be achieved with the Fragment Reference data type, available when defining a model.

### Content Fragment Models {#content-fragments-models}

These Content Fragment Models:

* Are used to generate the Schemas, once **Enabled**.
* Provide the data types and fields required for GraphQL. They ensure that your application only requests what is possible, and receives what is expected.
* The data type **Fragment References** can be used in your model to reference another Content Fragment, and so introduce additional levels of structure.

### Fragment References {#fragment-references}

The **Fragment Reference**:

* Is a specific data type available when defining a Content Fragment Model.
* References another fragment, dependent on a specific Content Fragment Model.
* Lets you create, and then retrieve, structured data.

  * When defined as a **multifeed**, multiple sub-fragments can be referenced (retrieved) by the prime fragment.

### JSON Preview {#json-preview}

To help with designing and developing your Content Fragment Models, you can preview JSON output in the Content Fragment Editor.

![JSON Preview](assets/cfm-model-json-preview.png "JSON Preview")

<!--
## GraphQL Schema Generation from Content Fragments {#graphql-schema-generation-content-fragments}

GraphQL is a strongly typed API, which means that content must be clearly structured and organized by type. The GraphQL specification provides a series of guidelines on how to create a robust API for interrogating content on a certain instance. To do this, a client needs to fetch the Schema, which contains all the types necessary for a query.

For Content Fragments, the GraphQL schemas (structure and types) are based on **Enabled** Content Fragment Models and their data types.

>[!CAUTION]
>
>All the GraphQL schemas (derived from Content Fragment Models that have been **Enabled**) are readable through the GraphQL endpoint.
>
>This means that you need to ensure that no sensitive content is available, to ensure that no sensitive data is exposed via GraphQL endpoints; for example, this includes information that could be present as field names in the model definition.

For example, if a user created a Content Fragment Model called `Article`, then AEM generates the object `article` that is of a type `ArticleModel`. The fields within this type correspond to the fields and data types defined in the model.

1. A Content Fragment Model:

   ![Content Fragment Model for use with GraphQL](assets/graphqlapi-cfmodel.png "Content Fragment Model for use with GraphQL")

1. The corresponding GraphQL schema (output from GraphiQL automatic documentation):
   ![GraphQL Schema based on Content Fragment Model](assets/graphqlapi-cfm-schema.png "GraphQL Schema based on Content Fragment Model")

   This shows that the generated type `ArticleModel` contains several [fields](#fields).

   * Three of them have been controlled by the user: `author`, `main` and `referencearticle`.

   * The other fields were added automatically by AEM, and represent helpful methods to provide information about a certain Content Fragment; in this example, `_path`, `_metadata`, `_variations`. These [helper fields](#helper-fields) are marked with a preceding `_` to distinguish between what has been defined by the user and what has been auto-generated.

1. After a user creates a Content Fragment based on the Article model, it can then be interrogated through GraphQL. For examples, see the Sample Queries.md#graphql-sample-queries) (based on a sample Content Fragment structure for use with GraphQL.

In GraphQL for AEM, the schema is flexible. This means that it is auto-generated each and every time a Content Fragment Model is created, updated or deleted. The data schema caches are also refreshed when you update a Content Fragment Model.

The Sites GraphQL service listens (in the background) for any modifications made to a Content Fragment Model. When updates are detected, only that part of the schema is regenerated. This optimization saves time and provides stability.

So for example, if you:

1. Install a package containing `Content-Fragment-Model-1` and `Content-Fragment-Model-2`:

   1. GraphQL types for `Model-1` and `Model-2` will be generated.

1. Then modify `Content-Fragment-Model-2`:

   1. Only the `Model-2` GraphQL type will get updated.

   1. Whereas `Model-1` will remain the same.

>[!NOTE]
>
>This is important to note in case you want to do bulk updates on Content Fragment Models through the REST api, or otherwise.

The schema is served through the same endpoint as the GraphQL queries, with the client handling the fact that the schema is called with the extension `GQLschema`. For example, performing a simple `GET` request on `/content/cq:graphql/global/endpoint.GQLschema` will result in the output of the schema with the Content-type: `text/x-graphql-schema;charset=iso-8859-1`.

### Schema Generation - Unpublished Models {#schema-generation-unpublished-models}

When Content Fragments are nested it can happen that a parent Content Fragment Model is published, but a referenced model is not.

>[!NOTE]
>
>The AEM UI prevents this happening, but if publishing is made programmatically, or with content packages, it can occur.

When this happens, AEM generates an *incomplete* Schema for the parent Content Fragment Model. This means that the Fragment Reference, which is dependent on the unpublished model, is removed from the schema.

## AEM GraphQL Endpoints {#aem-graphql-endpoints}

An endpoint is the path used to access GraphQL for AEM. Using this path you (or your app) can:

* access the GraphQL schemas,
* send your GraphQL queries,
* receive the responses (to your GraphQL queries).

AEM allows for:

* A global endpoint - available for use by all sites.
* Endpoints for specific Sites configurations - that you can configure (in the Configuration Browser), specific to a specified site/project.

## Permissions {#permissions}

The permissions are those required for accessing Assets.

## The AEM GraphiQL Interface {#aem-graphiql-interface}

To help you directly input, and test queries, an implementation of the standard GraphiQL interface is available for use with AEM GraphQL. This can be installed with AEM.

>[!NOTE]
>
>GraphiQL is bound the global endpoint (and does not work with other endpoints for specific Sites configurations).

It provides features such as syntax-highlighting, auto-complete, auto-suggest, together with a history and online documentation.

![GraphiQL Interface](assets/graphiql-interface.png "GraphiQL Interface")
-->

## Actually Using the AEM GraphQL API {#actually-using-aem-graphiql}

### Initial Setup {#initial-setup}

Before starting with queries on your content you need to:

* Enable your endpoint
  * Use Tools -> Assets -> GraphQL
  * [Enabling your GraphQL Endpoint](/help/sites-developing/headless/graphql-api/graphql-endpoint.md#enabling-graphql-endpoint)

* Access GraphiQL (if required)
  * [AEM GraphiQL interface](/help/sites-developing/headless/graphql-api/graphql-api-content-fragments.md#graphiql-interface)

### Sample Structure {#sample-structure}

To actually use the AEM GraphQL API in a query, we can use the two very basic Content Fragment Model structures:

* Company
  * Name - Text
  * CEO (Person) - Fragment Reference
  * Employees (Persons) - Fragment Reference(s)
* Person
  * Name - Text
  * First Name - Text

As you can see, the CEO and Employees fields, reference the Person fragments.

The fragment models will be used:

* when creating the content in the Content Fragment Editor
* to generate the GraphQL schemas that you will query

### Where to Test Your Queries {#where-to-test-your-queries}

The queries can be entered in the [GraphiQL interface](/help/sites-developing/headless/graphql-api/graphiql-ide.md), for example at:

* `http://localhost:4502/aem/graphiql.html`

![GraphiQL Interface](assets/graphiql-interface.png "GraphiQL Interface")

### Getting Started with Queries {#getting-Started-with-queries}

A straightforward query is to return the name of all entries in the Company schema. Here you request a list of all company names:

```xml
query {
  companyList {
    items {
      name
    }
  }
}
```

A slightly more complex query is to select all persons that do not have a name of "Jobs". This will filter all persons for any that do not have the name Jobs. This is achieved with the EQUALS_NOT operator (there are many more):

```xml
query {
  personList(filter: {
    name: {
      _expressions: [
        {
          value: "Jobs"
          _operator: EQUALS_NOT
        }
      ]
    }
  }) {
    items {
      name
      firstName
    }
  }
}
```

You can also build up more complex queries. For example, query for all companies that have at least one employee with the name of "Smith". This query illustrates filtering for any person of name "Smith", returning information from across the nested fragments:

```xml
query {
  companyList(filter: {
    employees: {
      _match: {
        name: {
          _expressions: [
            {
              value: "Smith"
            }
          ]
        }
      }
    }
  }) {
    items {
      name
      ceo {
        name
        firstName
      }
      employees {
        name
        firstName
      }
    }
  }
}
```

<!-- need code / curl / cli examples-->

For the full details of using the AEM GraphQL API, together with configuring the necessary elements, you can reference:

* Learning to use GraphQL with AEM
* The Sample Content Fragment Structure
* Learning to use GraphQL with AEM - Sample Content and Queries

## What's Next {#whats-next}

Now that you have learned how to access and query your headless content using the AEM GraphQL API you can now [learn how to use the REST API to access and update the content of your Content Fragments](update-your-content.md).

## Additional Resources {#additional-resources}

* [GraphQL.org](https://graphql.org)
  * [Schemas](https://graphql.org/learn/schema/)
  * [Variables](https://graphql.org/learn/queries/#variables)
  * [GraphQL Java libraries](https://graphql.org/code/#java)
* [GraphiQL](https://graphql.org/learn/serving-over-http/#graphiql)
* [Learning to use GraphQL with AEM](/help/sites-developing/headless/graphql-api/graphql-api-content-fragments.md)
  * [Enabling your GraphQL Endpoint](/help/sites-developing/headless/graphql-api/graphql-endpoint.md#enabling-graphql-endpoint)
  * [Installing the AEM GraphiQL interface](/help/sites-developing/headless/graphql-api/graphql-api-content-fragments.md#installing-graphiql-interface)
* [The Sample Content Fragment Structure](/help/sites-developing/headless/graphql-api/content-fragments-graphql-samples.md#content-fragment-structure-graphql)
* [Learning to use GraphQL with AEM - Sample Content and Queries](/help/sites-developing/headless/graphql-api/content-fragments-graphql-samples.md)
  * [Sample Query - A Single Specific City Fragment](/help/sites-developing/headless/graphql-api/content-fragments-graphql-samples.md#sample-single-specific-city-fragment)
  * [Sample Query for Metadata - List the Metadata for Awards titled GB](/help/sites-developing/headless/graphql-api/content-fragments-graphql-samples.md#sample-metadata-awards-gb)
  * [Sample Query - All Cities with a Named Variation](/help/sites-developing/headless/graphql-api/content-fragments-graphql-samples.md#sample-cities-named-variation)
* [Enable Content Fragment Functionality in Configuration Browser](/help/assets/content-fragments/content-fragments-configuration-browser.md#enable-content-fragment-functionality-in-configuration-browser)
* [Working with Content Fragments](/help/assets/content-fragments/content-fragments.md)
  * [Content Fragment Models](/help/assets/content-fragments/content-fragments-models.md)
  * [JSON output](/help/assets/content-fragments/content-fragments-json-preview.md)
* [Understand Cross-Origin Resource Sharing (CORS)](https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/security/understand-cross-origin-resource-sharing.html?lang=en#understand-cross-origin-resource-sharing-(cors))
* [Getting Started with AEM Headless](https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/graphql/overview.html) - A short video tutorial series giving an overview of using AEM's headless features, including content modeling and GraphQL.

<!--
* [Generating Access Tokens for Server Side APIs](/help/implementing/developing/introduction/generating-access-tokens-for-server-side-apis.md)
-->

branch_name: refs/heads/main

gha_language: Groovy

gha_license_id: MIT


text:
Attribution
-----------

This library is a fork of https://github.com/aloiscochard/grpc-haskell that we
have extended and released under the same [`LICENSE`](./LICENSE)

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

**The current version of this library requires gRPC version 1.2.0. Newer versions may work but have not been tested.**

Usage
-----

There is a tutorial [here](examples/tutorial/TUTORIAL.md)

Building and testing
--------------------

If you want to use `stack` on MacOS, you will need to have GRPC installed
already -- see the [Installing GRPC for `stack`](#stackgrpc) section below. Any
example build and test recipes below which use `stack` assume you have already
performed the steps described in that section.

Without `stack`, `nix-build release.nix -A grpc-haskell` will build and test the
whole thing and put the completed package into the nix store. `nix-shell` can be
used to give you a development environment where you can use the `cabal` and
`stack` toolchains for development and testing:

```bash
$ nix-shell release-nix -A grpc-haskell.env
[nix-shell]$ cabal configure --enable-tests && cabal build && cabal test
```

```bash
$ nix-shell release.nix -A grpc-haskell.env
[nix-shell]$ stack build --fast && stack test --fast
```

Note that, for `stack`, the `nix-shell` environment is only needed to run the
tests, because it uses some custom python tooling (for grpc interop
testing). You should still be able to `stack build` without using the
`nix-shell` environment at all.

NB: You can also instruct `stack` to run the tests inside the `nix-shell`
environment directly, via `stack --nix test --fast`. However, this will
frequently rebuild the custom ghc that is used in `release.nix`, so is not
recommended during develop-debug cycles (use the `cabal` path for that, or
iterate within a `nix-shell`).

Finally, since `stack` does not use `nix` for any Haskell package dependencies,
be sure to update repository references for dependent packages such as
`protobuf-wire` in both `nix/<pkg>.nix` AND in `stack.yaml`.

Installing GRPC for `stack` (MacOS)
-----------------------------------------------------------

If you want to use `stack` in a relatively natural and painless manner, you will
need a working installation of the GRPC C core libraries.

On MacOS, because of
issues [related](https://github.com/commercialhaskell/stack/issues/1161) to
System Integrity Protection, dependencies on the nix-built `grpc` don't seem to
work properly in the stack toolflow when `DYLD_LIBRARY_PATH` refers to the
`nix`-built `grpc` library in the nix store, so the library needs to be
installed somewhere that the loader can pick it up without `DYLD_LIBRARY_PATH`
set (e.g., in `/usr/local/lib`).

There are basically two methods to accomplish this:

1. Run `bin/install-macos-nix-grpc.sh`.

  This script will build the same version of `grpc` used in `release.nix`, which
  is what is used in the end-to-end system and in our CI testing flows. It then
  pretends to be an impoverished version of `brew` and installs symlinks from
  the nix store into `/usr/local/include/grpc` and
  `/usr/local/lib/libgrpc.dylib`. It should be run manually whenever the `grpc`
  dependency is updated. Note that it is intentionally destructive to any
  existing `brew` installs of `grpc`.

  Is it an ugly hack? Yes, but it's better than having either a rootless system
  to circumvent SIP or building atop a version of `grpc` which may differ from
  CI and production environments (which may be the case with `brew`-installed
  grpc).

  After running this script, you should be able to use `stack` normally, in
  combination with a `nix-shell` environment for running the tests:

  ```bash
  $ bin/install-macos-nix-grpc.sh
  $ stack build --fast
  $ stack --nix test --fast
  ```

1. Use `brew`

  If you don't want to hack the global pathing yourself using the above script,
  you can rely on homebrew to do this for you instead. However, you will need to
  specify the version of the `grpc` release that you want to use.

  ```bash
  $ brew tap grpc/grpc
  $ brew edit grpc
  $ brew install grpc
  ```

  Make sure you select a release version that is reasonably close to our grpc
  dependency, e.g.:

  ```
  url "https://github.com/grpc/grpc/archive/release-0_15_0.tar.gz"
  sha256 "d02235dff278869e94cb0dcb31cfea935693c6f87bd73f43d44147185e6becdd"
  ```

  or

  ```
  url "https://github.com/grpc/grpc/archive/v1.0.1.tar.gz"
  sha256 "efad782944da13d362aab9b81f001b7b8b1458794751de818e9848c47acd4b32"
  ```

Using the Library
-----------------

You must compile with `-threaded`, because we rely on being able to execute
Haskell while blocking on foreign calls to the gRPC library. If not using code
generation, the recommended place to start is in the
`Network.GRPC.HighLevel.Server.Unregistered` module, where `serverLoop` provides
a handler loop.

repository: taktoa/gRPC-haskell

repo_name: taktoa/gRPC-haskell


text:
# react-logshine

Shine light on your log files (Papertrail only).

[![NPM version][npm-image]][npm-url]
[![node version][node-image]][node-url]
[![npm download][download-image]][download-url]

[npm-image]: http://img.shields.io/npm/v/react-logshine.svg?style=flat-square
[npm-url]: http://npmjs.org/package/react-logshine
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/kwent/react-logshine.svg?style=flat-square
[download-url]: https://npmjs.org/package/react-logshine

## Screenshot

![react-logshine](https://github.com/kwent/react-logshine/raw/master/doc/screenshot.png)

## Install

[![react-logshine](https://nodei.co/npm/react-logshine.png)](https://npmjs.org/package/react-logshine)

## Usage

```js
var React = require('react');
var ReactDOM = require('react-dom');
var LogShine = require('react-logshine');
require('react-logshine/lib/LogShine.css');
ReactDOM.render(<LogShine token="your_token"/>, container);
```

## Props

Property | Type | Description | Default value
:---|:---|:---|:---
`height` | `PropTypes.string` | Component height | `500px`
`width`  | `PropTypes.string` | Component width  | `100%`
`token`  | `PropTypes.string.isRequired` | Papertrail token | `null`
`query`  | `PropTypes.string` | LogShine query | `null`
`systemID` | `PropTypes.number` or `PropTypes.string` | System to search by ID or in most cases, by name | `null`
`groupID` | `PropTypes.number` | Group to search | `null`
`follow` | `PropTypes.bool` | Follow (`tail -f`) | `true`
`delay` | `PropTypes.number` | Delay between refresh in seconds | `10`
`showTopToolbar` | `PropTypes.bool` | Show top toolbar | `true`
`backgroundColor` | `PropTypes.string` | Set background color | `#252830`
`dateTimeColor` | `PropTypes.string` | Set datetime color | `#e4d836`
`systemColor` | `PropTypes.string` | Set system color | `#1bc98e`
`programColor` | `PropTypes.string` | Set program color | `#9f86ff`
`messageColor` | `PropTypes.string` | Set message color | `#ffffff`
`topToolbarBackgroundColor` | `PropTypes.string` | Set top toolbar background color | `#1bc98e`
`rowFormat` | `PropTypes.function` | Custom row format | `null`

## Custom row format

```javascript
let rowFormat = function(event) {
  return(
        <li className="LogShine event" key={event.id}>
         <hr style={{width: '90%'}}/>
         <p>Date: {event.generated_at}</p>
         <p>System: {event.host}</p>
         <p>Program: {event.program}</p>
         <p>{event.message}</p>
       </li>
  );
}

ReactDOM.render(
  <LogShine token="your_token" rowFormat={rowFormat}/>, document.getElementById('root')
);
```

## Development

```
npm install
npm start
```

## Example

http://localhost:3000

# History

View the [changelog](https://github.com/kwent/react-logshine/blob/master/CHANGELOG.md)

# Authors

- [Quentin Rousseau](https://github.com/kwent)

# License

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

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

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

repository: kwent/react-logshine

repo_name: kwent/react-logshine


text:
# pPXF Assistant

### Description
This package is designed to assist in the application of the pPXF method to Integrated Field Spectra (IFS), to be able to
extract the internal kinematics of galaxies. One major focus
of this package is to make the process more interactive so that
the user has a better grasp of what is being done. Currently, it supports IFS from NIFS.


text:
+++
title = "Moon"

template = "doc.html"
[extra]
category = "arvo"
+++

A **moon** is a kind of [ship](../ship) on the [Arvo](../arvo) network. Moons are issued by planets, and are meant to be used for the issuing planet's connected devices, such as phones, desktops, smart TVs, and digital thermostats. A moon is not independent; it is always subordinated to the planet that issued it.

Unlike planets, moons have no presence on [Azimuth](../azimuth) and have no associated identities. Moons are representable with 64 bits and have long names like `~doznec-salfun-naptul-habrys`, the latter half of which is inherited from their parent planet.

### Further Reading

- [Using Your Ship](/using/os/getting-started#moons): The "Moons" section contains instructions for creating and managing moons.

repository: matildepark/docs

repo_name: matildepark/docs


text:
# vue-router-view-transition [![Build Status](https://badgen.net/circleci/github/posva/vue-router-view-transition)](https://circleci.com/gh/posva/vue-router-view-transition) [![npm package](https://badgen.net/npm/v/vue-router-view-transition)](https://www.npmjs.com/package/vue-router-view-transition) [![thanks](https://badgen.net/badge/thanks/♥/pink)](https://github.com/posva/thanks)

> A transition wrapper for router-view that is compatible with scrollBehavior

## Installation

```sh
npm install vue-router-view-transition
# or
yarn add vue-router-view-transition
```

## Usage

This library exports one component and one function. You need to use both:

First, you can either globally install the component `RouterViewTransition`:

```js
import { RouterViewTransition } from 'vue-router-view-transition'

Vue.component('RouterViewTransition', RouterViewTransition)
```

or import it locally in any Vue component:

```js
import { RouterViewTransition } from 'vue-router-view-transition'

export default {
  components: { RouterViewTransition },
}
```

Then you should replace your `router-view` with this `router-view-transition`:

```vue
<router-view-transition transition="fade" mode="out-in" />
```

Here the `transition` prop refers to the _name_ of the transition (prop named `name` for the `transition` component) while the `mode` is exactly the same as the prop with the same name in the `transition` component.

Then you must import the `waitForTransition` function and wrap your `scrollBehavior` function:

```js
// probably your router.js file
const router = new Router({
  mode: 'history',
  routes: [
    // your routes
  ],
  scrollBehavior: waitForTransition((to, from, savedPosition) => {
    // this code will get executed only once the transition wrapping router-view is finished
    // this ensures
    if (savedPosition) {
      return savedPosition
    } else {
      // this ensures we go to the top of the page when navigating to a new page
      return { x: 0, y: 0 }
    }
  }),
})
```

**Note**: You may also want to enable _manual_ scroll restoration:

```js
history.scrollRestoration = 'manual'
```

## Related

- Vue Router: https://github.com/vuejs/vue-router

## License

[MIT](http://opensource.org/licenses/MIT)

repository: posva/vue-router-view-transition

gha_language: JavaScript

repo_name: posva/vue-router-view-transition


text:
set_ldap_user_attr
=========

Set LDAP user attribute

Requirements
------------

python-ldap module is installed on the build system.

Role Variables
--------------

The variables for this role can be passed via role directly, or inventory file, or playbook vars/main.yml.

Required variables are:

**ldap_bind_dn**: Binding DN, for example "cn=root,secAuthority=default"

**ldap_bind_pw**: Binding password

**ldap_server_uri**: LDAP server URI, for example, "ldaps://<IP_ADDRESS>:636/"

**ldap_state**: LDAP attribute target state, valid options are:
```
  present: all given values will be added if they are missing
  absent: all given values will be removed if present.
  exact: the set of values will be forced to exactly those provided and no others.
```

**ldap_user_attributes**: This is a JSON object which contains 'dn' string and a JSON array 'attributes'. For example:
```
    - dn: "uid=testuser,dc=iswga"
      attributes:
      - { "name": "mail", "values"<EMAIL_ADDRESS>}
      - { "name": "displayName", "values": "Test User" }
```

Dependencies
------------

This role depends on the Ansible module ldap-attr which will be part of Ansible 2.3, not official released yet. We have included it under the /library directory. Once it is officially released by Ansible we will remove it from this role.

https://docs.ansible.com/ansible/ldap_attr_module.html

Example Playbook
----------------

A sample playbook *test.yml* has been placed under *tests/* subdirectory.

```
---
- name: modify LDAP user attributes
  hosts: localhost
  connection: local
  roles:
      - role: set_ldap_user_attr
        ldap_bind_dn: "cn=root,secAuthority=default"
        ldap_bind_pw: "passw0rd"
        ldap_server_uri: "ldaps://<IP_ADDRESS>:636/"
        ldap_state: "exact"
        ldap_user_attributes:
            - dn: "uid=testuser,dc=iswga"
              attributes:
                - { "name": "mail", "values"<EMAIL_ADDRESS>}
                - { "name": "displayName", "values": "Test User" }
```

You may run it with ansible-playbook directly:

```
ansible-playbook -i inventory test.yml
```

License
-------

Apache

Author Information
------------------

IBM

repository: kalemontes/isam-ansible-roles

gha_language: Python

repo_name: kalemontes/isam-ansible-roles


text:
# AnaTechArm
Arduino Library for AnaTech Robotic Arm

This driver is for the AnaTech Robotics arm, and is based on Adafruit PCA9685 PWM Servo Driver Library.

Design by Dejan from howtomechatronics.com

*******************************************************************************************************************************************

AnaTech Robotic Arm is an Open Sourced robotic arm based on combination of 3D printed robotic arm by Dejan (howtomechatronics.com
) and PCA9685 16-Channel Servo Driver.

repository: rajattarade/AnaTechArm

repo_name: rajattarade/AnaTechArm


text:
---

copyright:
  years: 2015, 2016
lastupdated: "2016-08-26"

---

{:new_window: target="_blank"}
{:shortdesc: .shortdesc}
{:screen: .screen}
{:codeblock: .codeblock}
{:pre: .pre}

# Developing devices on {{site.data.keyword.iot_short_notm}}
{: #device_dev_index}

Client libraries, samples, and information are provided to help you to connect devices to your {{site.data.keyword.iot_full}} organization and applications.
{:shortdesc}

You can write code to connect devices to {{site.data.keyword.iot_short_notm}} by using the following supported protocols and standards.

- C#
- Embedded C
- Java
- mBed C++
- MQTT messaging
- Node.js
- Node-RED
- Python

For more information and links to the client libraries that are available, see [Client libraries for {{site.data.keyword.iot_short_notm}} development](../iot_platform_client_lib.html).

repository: leesakcp/docs

repo_name: leesakcp/docs


text:
# Env Spec: A2C on Pong

## 📂The Env Spec

In this tutorial we look at how to use an **env spec** to specify an environment used to train an agent. We will train an A2C agent on the Atari Pong environment.

The environment is specified using the **env** key in a spec file with the following format:

```javascript
{
  "{spec_name}": {
    "agent": [{...}],
    "env": [{
      // Parameter for gym.make()
      // the name must be found in the gym registry
      "name": str,

      // Parameter for <env.wrapper.FrameStack>:
      // - "concat": apply np.concatenate to frames, e.g. concatenate 4 images with shape (1, 84, 84)
      // - "stack": apply np.stack to frames (a new stacking dimension will be created)
      // - null: no frame preprocessing will be applied
      "frame_op": str|null,

      // Parameter for <env.wrapper.FrameStack>:
      // - {int}: the number of successive frames used for frame_op; 4 is common.
      // - null: when frame_op is null
      "frame_op_len": int|null,

      // Parameter for <env.wrapper.NormalizeStateEnv>
      // apply on-line normalization to state
      "normalize_state": bool,

      // Parameter for <env.wrapper.ScaleRewardEnv>
      // - "sign": transform reward wiht np.sign to yield -1, 0, or +1
      // - {int|float}: scale reward by the given number
      // - null, no reward scaling is applied
      "reward_scale": null|str|int|float,

      // Parameter for <env.vec_env.ShmemVecEnv>
      // If > 1, this will apply asynchronous parallelization to spawn vector environments
      "num_envs": int,

      // The maximum time steps per episode
      // - {int|float}: use the given number as the maximum time steps
      // - null: default to the maximum time steps defined in the environment
      "max_t": int|null,

      // The maximum frames (total time steps) to run a sess
      "max_frame": int,
    }],
    ...
  }
}
```

{% hint style="info" %}
The env spec is a list to accommodate for multi-environment setting in the future version of SLM Lab.
{% endhint %}

## ✍ Env Spec for Atari Pong

As an example, let's look at the env spec for A2C on Pong from [slm\_lab/spec/benchmark/a2c/a2c\_gae\_pong.json](https://github.com/kengz/SLM-Lab/blob/master/slm_lab/spec/benchmark/a2c/a2c_gae_pong.json).

{% code title="slm\_lab/spec/benchmark/a2c/a2c\_gae\_pong.json" %}
```javascript
{
  "a2c_gae_pong": {
    "agent": [{
      "name": "A2C",
      ...
    }],
    "env": [{
      "name": "PongNoFrameskip-v4",
      "frame_op": "concat",
      "frame_op_len": 4,
      "reward_scale": "sign",
      "num_envs": 16,
      "max_t": null,
      "max_frame": 1e7
    }],
    ...
  }
}
```
{% endcode %}

Here, we are using the "PongNoFrameskip-v4" environment from gym. This allows us to specify our own state-preprocessing method. Each frame is an automatically-processed greyscale image of shape \(1, 84, 84\). To restore the temporal aspect of the frames, it is useful to concatenate 4 successive frames together as specified by **"frame\_op"** and **"frame\_op\_len"**, so the shape of the input state to A2C becomes \(4, 84, 84\).

{% hint style="info" %}
For Atari environments, we also apply frame-skipping internally via before doing any state-processing. This is done using the `<env.wrapper.MaxAndSkipEnv>` wrapper. Effectively, we are concatenating 4 frames selected from the span of 16 raw frames.
{% endhint %}

To standardize the range of rewards in Atari environments, we also preprocess the rewards to -1, 0, or +1 by taking the sign of the raw reward, as specified in **"reward\_scale"**.

In order to speed up training, we asynchronously parallelize the stepping of environment by using a vector of 16 sub-environments, as specified in **"num\_envs"**. This means that at every environment step, A2C gets a batch of 16 states from 16 instances of the same environment with different random seeds.

Finally, we train A2C using a total of 10 million frames, specified in **"max\_frame"**. Note that when parallelizing using vector environment, the environment will actually step \(10 million / 16\) times. This is so that the total frame-count will sum up to **"max\_frame"** \(with some modular-remainder\) regardless of how many vector environments were used.

## 🚀 Running A2C on Pong

Let's run a Trial using the spec file above. First, run it in **dev** mode to see the rendering of 16 vector environments.

```bash
python run_lab.py slm_lab/spec/benchmark/a2c/a2c_gae_pong.json a2c_gae_pong dev
```

![](../.gitbook/assets/vec_env_pong.png)

We can see these environments are in fact different in their progression, so our agent will obtain a diverse set of experience from them.

Next, terminate \(`Ctrl+C`\) and rerun it in **train** mode for the full 10 million frames:

```bash
python run_lab.py slm_lab/spec/benchmark/a2c/a2c_gae_pong.json a2c_gae_pong train
```

The maximum score for Pong is 21; our learning agent will converge to an average score close to that. When the trial completes, we will see the graphs similar to the ones below generated and saved to the `data/a2c_gae_pong_{ts}` folder.

The trial graph is an average of the 4 session graphs, each of which plots the episodic rewards once every 10,000 steps averaged over all the vector environments.

![The trial graph showing the episodic rewards averaged over 4 sessions.](../.gitbook/assets/a2c_gae_pong_t0_trial_graph_mean_returns_vs_frames.png)

We can also smoothen the trial graph by plotting its moving average over a window of 100 to obtain the graph below.

![The trial graph with a moving average of 100 checkpoints.](../.gitbook/assets/a2c_gae_pong_t0_trial_graph_mean_returns_ma_vs_frames.png)

This trial will complete within a day if no GPU is used, which is still fairly quick in RL terms. In the next section, we will see how SLM Lab can easily enable GPU usage to speed up training on image-based environments like the Atari games.

repository: kengz/SLM-Lab-doc

repo_name: kengz/SLM-Lab-doc


text:
---
title: How to learn Flutter?
date: 2021-04-12T02:32:34+05:30
draft: false
image: images/flutter/flutter.png
sub: true
type: "framework"
keywords: ["dart", "android", "ios", "flutter", "mobile"]
tags: ["dart", "android", "ios", "flutter", "mobile"]
---

Learning path for flutter.

## Requirement

- Basics of the oops concept is needed. [Learn more on Dart](https://github.com/evolvingkid/flutter-learning-path/tree/main/OOPS)
- Previous knowledge in any programing language like C++, JAVA, JS is good
- Laptop with i3 or higher is needed. i5 or Rayzen 5 is recommended.

{{< alert "info" >}}
If you have a low spec system. It is better to use a Linux system like Linux mint xfce and try to run on real devices using USB Debugging.
Linux Mint
{{< / alert >}}

## Install Flutter

- Install Anddroid Studio (In case if you are using Linux-based OS. Sometimes flutter SDK doesn't recognize android studio install. This Error occurs in new versions. To fix this copy android studio folder that you extracted and paste it on " /opt "
  directory.). [Install Android Studio](https://developer.android.com/studio)
- Install Git [Install Git](https://git-scm.com/)
- Install Vscode (Recommeded) [Install Vscode](https://code.visualstudio.com/download)
- Setup Flutter SDK [Setup Flutter](https://flutter.dev/docs/get-started/install)
- This is not recommeded for new peoples but if you are following old project in flutter use FVM to manage flutter version. [Install FVM](https://pub.dev/packages/fvm)
- Setup emulator or real mobile devices for app testing in flutter. (enable USB-Debugging for mobile devices testing).

## Setup Flutter

- In case if you are running flutter for 1st time it can be time-consuming. This is because Gradle needed to set up and android SDK needed to be setup. In any case if android SDK is not able to download and causes error then you can manually download it using android SDK manager.

## Next step

- Build a small flutter project like quiz app. Like [Youtube Link](https://youtu.be/x0uinJvhNxI). Try to learn about Stateless & stateful widgets.
- Need to know more about List and Map data type in dart.
- Try to learn HTTp calls. Use package like [HTTP](https://pub.dev/packages/http) or [DIO](https://pub.dev/packages/dio). Its better to learn with HTTP then lern Dio. In production apps or big project is better to use Dio.
- Do a project with Http or dio.
- Try to learn any of the state Managment Like [Provider](https://pub.dev/packages/provider), [Bloc](https://pub.dev/packages/bloc), [GetX](https://pub.dev/packages/get), [Riverpod](https://pub.dev/packages/riverpod).
- Try to do a project using state managment and follow a structure like MVC.
- Learn about dependency Injection like [Get It](https://pub.dev/packages/get_it).
- Try to learn about database in flutter like [sqflite](https://pub.dev/packages/sqflite), [Shared preferences](https://pub.dev/packages/shared_preferences), [Hive](https://pub.dev/packages/hive). (If you are learning Hive its better to follow youtube videos. Try to learn adapter in Hive).
- Try to implement JAVA or Swift code in to flutter using method channel.

repository: christorejisam/TinkerHub-Learning-Paths

repo_name: christorejisam/TinkerHub-Learning-Paths


text:
# Nexus UI with React Typescript and Mobx

Example of using NexusUI with React.

Under-Construction !!!

# Boilerplate
Based on https://github.com/mobxjs/mobx-react-typescript-boilerplate

# React-TypeScript

Minimal boilerplate for a single-page app using MobX, React and TypeScript with TSX.

Initial run:

* Install Node.js
* `npm install`
* `npm start`

For simplicity sake Webpack Hot Module Reloading is disabled. If you want to use HMR, see the [Reactive2015 demo](https://github.com/mobxjs/mobx-reactive2015-demo) to see a valid setup.


text:
# Virtuous Window Cleaning LLC 🏡🏢

This is a landing page for Virtuous Window Cleaning LLC

## Instruction on How to Run

1. Hit the 🟢 button that says code
2. To preview the code, you can open the `index.html` file in your web browser.

## Technology Stack Used

1. HTML
2. CSS
3. Javascript
4. Bootstrap
5. Facebook Api

## Key Functionality
1. Call the business from a browser using a cellular device
2. Send them an email
3. View a video hosted on facebook of their work.
4. View a photo gallery of all of their work split up into sectors.

## License
[MIT](https://choosealicense.com/licenses/mit/)

To preview the code, you can open the `index.html` file in your web browser.


text:
# Sliding Window Problems

## Longest Substring w/o Repeating Characters
```python
def fn(s):
  freq = collections.defaultdict(int)
  begin = end = counter = maxLen = 0
  while (end < len(s)):

    # if we've already seen this char before...
    if (freq[s[end]] > 0):
      counter += 1

    freq[s[end]] += 1
    end += 1

    while (counter > 0):
      # if there's more than one of this character (not unique)
      if (freq[s[begin]] > 1):
        counter -= 1

      freq[s[begin]] -= 1
      begin += 1

    maxLen = max(maxLen, end-begin)

  return maxLen
```
Notes:
- Scrunch when we've encountered a character more than zero times (now has some repeating characters)
- Un-scrunch when we've encountered a character more than one times

## Minimum Window Substring
[Link](https://leetcode.com/problems/minimum-window-substring/)
```python
def minWindow(s, t):
  freq = collections.defaultdict(int)
  for ch in t:
    freq[ch] += 1

  head = begin = end = 0
  counter = len(t)
  minLen = float('inf')
  while (end < len(s)):
    # if this char belongs to 't'
    if freq[s[end]] > 0:
      counter -= 1

    freq[s[end]] -= 1
    end += 1

    while (counter == 0):
      if (end - begin < minLen):
        head = begin
        minLen = end - begin

      # if char frequency is matches t perfectly, make invalid
      if freq[s[begin]] == 0:
        counter += 1

      freq[s[begin]] += 1
      begin += 1

  return "" if minLen == float('inf') else s[head:head+minLen]
```
Notes:
- Scrunch when we've encountered all characters of t
- Unscrunch when character frequency of t is zero (means we're just perfect)
- Move head if there's a new minLen

## Minimum Window Subsequence
[Link](https://leetcode.com/submissions/detail/341499710/)
```python
def minWindow(s, t):
  head = sidx = end = tidx = 0
  minDis = float('inf')
  while sidx < len(s):
    if s[sidx] == t[tidx]:
      # advance to next char of t
      tidx += 1

      # when we've found last letter of T
      if tidx == len(T):
        end = sidx + 1

        # optimize going left
        tidx -= 1
        while tidx >= 0:
          while (s[sidx] != t[tidx]):
            # move back into s
            sidx -= 1

          # found equal, keep going back for both
          sidx -= 1
          tidx -= 1

        # correct for going too far back
        sidx += 1
        tidx += 1

        if (end - sidx < minDis):
          head = sidx
          minDis = end - sidx

    # move forward s index
    sidx += 1
  return "" if minDis == float('inf') else s[head:head+minDis]
```
Notes:
- Not every problem requires a counter to scrunch.
- This is really interesting as it carries two pointers. Only start doing something when we've found the last char of T
- This is the minimum window so we need to move the s pointer back until we've found the first character of T (scan right ->  optimize left <-)
- careful not to get lost in the pointer arithmetic!

## Longest Substring with at most K Distinct Characters
[Link](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/)
```python
def lengthOfLongestSubstringKDistinct(s, k):
  begin = end = counter = longStr = 0
  freq = collections.defaultdict(int)
  while end < len(s):
    # leading up to the scrunch
    if freq[s[end]] == 0:
      counter += 1
    freq[s[end]] += 1
    end += 1

    if counter > k:
      run = True
      while run:
        freq[s[begin]] -= 1
        run = freq[s[begin]] > 0
        begin += 1

      counter -= 1
    longStr = max(longStr, end-begin)
  return longStr
```
Notes:
- Very similar, only stop scrunching when the frequency for a given character crushes to zero
  - Move begin to whenever that occurs

## find 2 Non-overlapping Sub-arrays w/target sum
[Link](https://leetcode.com/problems/find-two-non-overlapping-sub-arrays-each-with-target-sum/submissions/)
```python
def minSumOfLengths(arr, target):
  n = len(arr)
  best = [float('inf')]*n
  ans = bestSoFar = float('inf')
  end = start = cur_sum = 0
  while end < n:
    # add to sum
    cur_sum += arr[end]

    # scrunch window if we overdo it
    while cur_sum > target:
      cur_sum -= arr[start]
      start += 1

    # make decisions if we hit the target
    if cur_sum == target:
      # check if we've recorded an array who's hit the target before
      if start > 0 and best[start-1] != float('inf'):
        ans = min(ans, best[start-1] + (end-start+1))

      # update single best result so far
      bestSoFar = min(bestSoFar, end-start+1)

    # mark along the way
    best[end] = bestSoFar
    end += 1

  return ans if ans != float('inf') else -1
```
Notes:
- See comments

repository: kennyftan/tech-interview-prep

repo_name: kennyftan/tech-interview-prep


text:
---
date: 2023-07-23T16:34:01Z
title: To delete something, use a form rather than a link
description: 'Great comment from a Rails engineer on a discussion thread'
tags:
- link
- web
- form
- semantics
- HTML
- button
- rails
noteWithTitle: false
linkTarget: https://discuss.hotwired.dev/t/destroy-record-in-turbo-frame/2731/2
mainImage.url: ''
mainImage.alt: ''
mainImage.aspectRatioWidth: ''
mainImage.aspectRatioHeight: ''
mainImage.srcsetWidths: ''
mainImage.sizes: ''
mainImage.isAnchor: false
draft: false

---
In web-based products from e-commerce stores to email clients to accounting software you often find index pages where each item in a list (or row in a table) has a _Delete_ option. This is often coded as a link… but it shouldn’t be.

I liked this comment by Rails developer Dan where he advises a fellow Rails developer that to create his Delete control he should use a form rather than a link, via Rails’s `button_to` method.
---

Dan mentions that in the past Rails UJS set an unsdesirable historical precedent by including a pattern of hijacking links for non-GET reqests.

[But per the HTML standard, links are for navigation:](https://html.spec.whatwg.org/dev/links.html#:~:text=Hyperlinks,a%20browser%20or%20download%20them.)

> Hyperlinks… are links to other resources that… cause the user agent to navigate to those resources, e.g. to visit them in a browser or download them.

And [as Dan goes on to say](https://discuss.hotwired.dev/t/destroy-record-in-turbo-frame/2731/8) links that’s why links make a GET request.
> A GET request is a visit, it says “show me this” and it’s idempotent. When you make the same request it’ll show the same thing.

If on the other hand you want a control that does something (in this case requst an entity to be deleted) then the appropriate HTML element is a form.

Relatedly, Jeremy Keith previously wrote about how to use request methods properly in his excellent post [Get safe](https://adactio.com/journal/17768).

repository: fuzzylogicxx/fuzzylogic

gha_language: SCSS

repo_name: fuzzylogicxx/fuzzylogic


text:
1. Techno theme was inspired by old Motorola P2K skin "Techno":

    ![Motorola P2K Techno Skin "Motorola P2K Techno Skin"](../image/Motorola_P2K_Techno_Skin.png)

2. Pastorg theme was inspired by [paste.org.ru](http://paste.org.ru/) service:

    ![Site paste.org.ru, code sharing service "Site paste.org.ru, code sharing service"](../image/PasteOrgRu_Screenshot.png)

repository: EXL/CodePolyglot

repo_name: EXL/CodePolyglot


text:
# Brak Tribute
A Pen created at CodePen.io. You can find this one at https://codepen.io/rabowlen/pen/pRORZV.

This is a silly site that I built to meet the requirements for a project on freeCodeCamp.

## Technologies Used:

HTML

CSS

JavaScript

 ## To Run:

 Follow the link above and the site will pull up in your browser. Use the change view tab to look at various aspects of the project.

repository: rabowlen/Brak-Tribute-freeCodeCamp-

repo_name: rabowlen/Brak-Tribute-freeCodeCamp-


text:
---
title: Customer Presentations and Silver Sponsorship at 2018 Asian Downstream Summit
date: 2018-10-31
author:
publication: 2018 Asian Downstream Summit
logo: ads2018
category: Events
type: Presentation
source: http://downstream-asia.com
keywords: Asia, Oil and Gas, Digitalization, Operational Excellence
---
Near-Miss Management (NMM) is pleased to be a Silver Sponsor at the 2018 Asian Downstream Summit in Singapore from October 31 - November 1, 2018. NMM’s participation is accompanied by two customer presentations: (a) Technical Services Manager (Fertilizer) presented their implementation experience and benefits of Dynamic Risk Analyzer (DRA) software, and (b) Advanced Process Control Engineer (Refining) discussed the digital transformation in the industry.

Through our customer presentation, the attendees learned:
- how to detect process issues at their initiation stage and prevent emergency maintenance
- how to leverage an early risk detection system like DRA to build a proactive operating culture

*Date*: October 31 - November 1, 2018

*Venue*: Sands Expo and Convention Centre, Singapore

For more information, please see NMM representatives at booth C8. For any other questions about Near-Miss Management’s early risk analytics software, please call +1-267-603-2378, or email<EMAIL_ADDRESS>
**About Asian Downstream Summit**

The Asian Downstream Summit is the largest conference and exhibition dedicated to Asia’s refining, petrochemical and chemicals industry. The purpose of ADS is to bring together key industry operators, decision makers, technology vendors, and research centers under one roof over two full days to discuss strategies and best practices for optimizing efficiency, increasing margins and achieving operational excellence in refining, petrochemicals and chemicals. This year's technical sessions are: (1) Digital Innovations, Manufacturing and Automation, (2) Refining & Petrochemical Technologies/Downstream Digital Roadmap and Disruptive Technologies, (3) Process Optimization, Asset Management and Energy Efficiency.

gha_language: CSS


text:
---
title: 'Using Google Chrome to find keywords and meta data '
date: 2020-10-16
slug: google-chrome-research

---
Google chrome has a huge amount of tools fore developer that we use on a regular basis. You can use some of the tools to help with SEO. The number one way is to use the dev tools to find out what your competitors are using as key words.

Find the top pages in Google for your keys words and go to the pages that rank the best.

From the Google Chrome menu go to View -> Developer -> View Source

![](/google-chrome-for-seo.png)

This will open a new tab where you will see the Meta Data at the top of the page inside the <head></head> tags I am using my website as an example:

![](/screen-shot-2020-10-16-at-4-53-18-pm.png)


text:
---
layout: default
---

# 1994-02-01 - Re: archiving on inet

## Header Data

From<EMAIL_ADDRESS>(Mike McNally)

To<EMAIL_ADDRESS>(Jim Nitchals)

Message Hash: cadc68bb4511833926ba0398e4b948bf050a0d805298a22ca9e723da89622beb

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1994-02-01 19:00:37 UTC

Raw Date: Tue, 1 Feb 94 11:00:37 PST

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Mike McNally)
Date: Tue, 1 Feb 94 11:00:37 PST
To<EMAIL_ADDRESS>(Jim Nitchals)
Subject: Re: archiving on inet
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Jim Nitchals writes:
 > Let me argue against Usenet archiving on a different point.  Archiving
 > violates the poster's implicit right to cancel or provide an expiration
 > date for his posting.

"Implicit right to cancel"?  Where'd that come from?

 >         a potential employer may see a message written in anger or
 > the author was in an exceptionally bad state of mind...

There's a poem by Carl Sandburg with some relevance to this.  I don't
see why the feature of cancel messages (which aren't guaranteed to
work anyway) carries with it a new right.

 > I'm not a lawyer, but it *seems* to me that when you publish a message
 > from a set of newsgroups containing a 'control' group that allows
 > retraction of messages, you're agreeing to honor those retractions when
 > they're issued by the original poster.

I am perfectly free to implement my own news system and mailer that
does not honor cancel messages.  What authority would force me to do
so if I don't want to?

 > when a message contains an expiration date, the author CLEARLY has a
 > reasonable expectation of having it honored.

Why?  Does he have an equally clear right to expect that the message
does not get deleted before then?

 > I'd go further and say
 > there's a strongly implied agreement that says, "if you want to use
 > and republish this information, you must honor my expiration date."

This seems pretty specious to me.

--
| GOOD TIME FOR MOVIE - GOING ||| Mike McNally<EMAIL_ADDRESS>     |
| TAKE TWA TO CAIRO.          ||| Tivoli Systems, Austin, TX:        |
|     (actual fortune cookie) ||| "Like A Little Bit of Semi-Heaven" |

{% endraw %}
```

## Thread

+ Return to [February 1994](/archive/1994/02)

+ Return to<EMAIL_ADDRESS>(Blake Coverett)](/authors/blake_coverett_at_canrem_com_blake_coverett_)"
+ Return to "[Chris Knight <cknight@crl.com>](/authors/chris_knight_cknight_at_crl_com_)"
+ Return to "[Eli Brandt <ebrandt@jarthur.Claremont.EDU>](/authors/eli_brandt_ebrandt_at_jarthur_claremont_edu_)"
+ Return to "[Jason Zions <jazz@hal.com>](/authors/jason_zions_jazz_at_hal_com_)"
+ Return to<EMAIL_ADDRESS>(Jason Zions)](/authors/jazz_at_hal_com_jason_zions_)"
+ Return to "[Jim McCoy <mccoy@ccwf.cc.utexas.edu>](/authors/jim_mccoy_mccoy_at_ccwf_cc_utexas_edu_)"
+ Return to<EMAIL_ADDRESS>(Jim Nitchals)](/authors/jimn8_at_netcom_com_jim_nitchals_)"
+ Return to "[Joe Thomas <jthomas@access.digex.net>](/authors/joe_thomas_jthomas_at_access_digex_net_)"
+ Return to "[Kirk Sheppard <kshep@netcom.com>](/authors/kirk_sheppard_kshep_at_netcom_com_)"
+ Return to<EMAIL_ADDRESS>(Mike McNally)](/authors/m5_at_vail_tivoli_com_mike_mcnally_)"
+ Return to "[Mike Godwin <mnemonic@eff.org>](/authors/mike_godwin_mnemonic_at_eff_org_)"
+ Return to "["Perry E. Metzger" <pmetzger@lehman.com>](/authors/perry_e_metzger_pmetzger_at_lehman_com_)"
+ Return to "[Phil Karn <karn@qualcomm.com>](/authors/phil_karn_karn_at_qualcomm_com_)"
+ Return to<EMAIL_ADDRESS>(Timothy C. May)](/authors/tcmay_at_netcom_com_timothy_c_may_)"

+ 1994-02-01 (Tue, 1 Feb 94 08:05:27 PST) - [Re: archiving on inet](/archive/1994/02/f551243f341d5026ba94fc8f9c6da17e1d8f4af76b76428fb1e668ce619a1eb3) -<EMAIL_ADDRESS>(Jason Zions)_
  + 1994-02-01 (Tue, 1 Feb 94 09:10:34 PST) - [Re: archiving on inet](/archive/1994/02/12082146dc4e88a1b571eb4cb76189b55c06e2a6f4e01f1e61177a2ecfec8677) - _Kirk Sheppard<EMAIL_ADDRESS>    + 1994-02-01 (Tue, 1 Feb 94 09:55:27 PST) - [Re: archiving on inet](/archive/1994/02/f701047efd4120154d7ada3636775b18c38b23fc4aeadc3b953e6a1c1cfa4140) - _Jason Zions<EMAIL_ADDRESS>      + 1994-02-01 (Tue, 1 Feb 94 10:20:35 PST) - [Re: archiving on inet](/archive/1994/02/53efdf17d608270fc7840d93e72505820960e62d720ad6f71b6d3e5b5deba97c) - _Kirk Sheppard<EMAIL_ADDRESS>        + 1994-02-01 (Tue, 1 Feb 94 11:10:37 PST) - [Re: archiving on inet](/archive/1994/02/8085401726205af8943ee0a8184506dd372c0415067d11fee5f8da4f792dbf79) - _Mike Godwin<EMAIL_ADDRESS>      + 1994-02-01 (Tue, 1 Feb 94 12:25:40 PST) - [Re: archiving on inet](/archive/1994/02/9038c847e4757a1f84664c3754642a416ca3305b57e07d650871395b70c65ae2) - _Jim McCoy<EMAIL_ADDRESS>        + 1994-02-01 (Tue, 1 Feb 94 12:35:41 PST) - [Re: archiving on inet](/archive/1994/02/63d2f40870380af4ce925ed7862aed53baeb02bd35fa5fea56700aa93d786f98) - _Jason Zions<EMAIL_ADDRESS>          + 1994-02-01 (Tue, 1 Feb 94 13:10:40 PST) - [Re: archiving on inet](/archive/1994/02/f06c76a9f3244a6eae7e6055cb040e661061dc56e3f40f21102b24bbdfcbf874) - _Mike Godwin<EMAIL_ADDRESS>        + 1994-02-01 (Tue, 1 Feb 94 13:15:29 PST) - [Re: archiving on inet](/archive/1994/02/1b461017e2a4775e7443ae547d09a152dbf56cb7b252058ae6df406ef4d16031) - _Kirk Sheppard<EMAIL_ADDRESS>      + 1994-02-02 (Tue, 1 Feb 94 16:35:30 PST) - [Re: archiving on inet](/archive/1994/02/d4bcf614337bb8a5326d7ba2103a02756e399de8dac11bc6ffd167fbf4acfab3) - _Eli Brandt<EMAIL_ADDRESS>      + 1994-02-02 (Wed, 2 Feb 94 10:00:56 PST) - [Re: archiving on inet](/archive/1994/02/e56eef48e5f87a609ae5d4e09179b76fca67033484c4c951d68814ca2e10fa3e) -<EMAIL_ADDRESS>(Blake Coverett)_
    + 1994-02-01 (Tue, 1 Feb 94 10:05:28 PST) - [Re: archiving on inet](/archive/1994/02/558f9d74bbe8a7f1f97c08f0417f3f5608f5b7f2c9feea4129f9855960896955) -<EMAIL_ADDRESS>(Jim Nitchals)_
      + 1994-02-01 (Tue, 1 Feb 94 11:00:37 PST) - Re: archiving on inet -<EMAIL_ADDRESS>(Mike McNally)_
    + 1994-02-01 (Tue, 1 Feb 94 11:15:29 PST) - [Re: archiving on inet](/archive/1994/02/6b29e589d2c72dd789613fbf3c24b80606d08ce5e0cf31b00994b0df8bc303dd) - _Chris Knight<EMAIL_ADDRESS>      + 1994-02-01 (Tue, 1 Feb 94 11:30:39 PST) - [Re: archiving on inet](/archive/1994/02/99f78fce74884867ef3a575124312b459c824a4215244c6818b7e34b34c044c6) - _Kirk Sheppard<EMAIL_ADDRESS>        + 1994-02-01 (Tue, 1 Feb 94 11:55:28 PST) - [Re: archiving on inet](/archive/1994/02/2fcd14c5741f7db02c4cacb392859f340c91b551c7ad498fbe0764bf9443a415) - _Chris Knight<EMAIL_ADDRESS>          + 1994-02-01 (Tue, 1 Feb 94 12:05:27 PST) - [Re: archiving on inet](/archive/1994/02/f78a1a7dd61ab5762f1f1af22b610ecd01b40dc372cb84599014d48c1b33499e) - _Kirk Sheppard<EMAIL_ADDRESS>          + 1994-02-01 (Tue, 1 Feb 94 12:30:38 PST) - [Re: archiving on inet](/archive/1994/02/742b7b74525e3aa3924387eb49f6014e62d01b587383be4e5f3ef9ca134780c9) - _"Perry E. Metzger"<EMAIL_ADDRESS>            + 1994-02-01 (Tue, 1 Feb 94 13:25:28 PST) - [Re: archiving on inet](/archive/1994/02/fb001b7443b8896cfc8b6a77b605cd5737d086552539d8e797f365110a9556d0) - _Mike Godwin<EMAIL_ADDRESS>              + 1994-02-01 (Tue, 1 Feb 94 13:30:41 PST) - [Re: archiving on inet](/archive/1994/02/83591a6f3fe0409e7fedd0b2f645b55e1e1bd0b796e15a95fca6bd2c0ec300f8) - _"Perry E. Metzger"<EMAIL_ADDRESS>                + 1994-02-01 (Tue, 1 Feb 94 13:40:44 PST) - [Re: archiving on inet](/archive/1994/02/a9a1c7d3b6b4c3e974ec390d66a86eea1ff22729d920d8e08bec6268880cf466) - _Mike Godwin<EMAIL_ADDRESS>            + 1994-02-01 (Tue, 1 Feb 94 13:40:41 PST) - [Re: archiving on inet](/archive/1994/02/60d1d43fc5bc079b30031b2c6876e09f4be621c1d8b6f672c3d30ff76243da88) - _Chris Knight<EMAIL_ADDRESS>        + 1994-02-01 (Tue, 1 Feb 94 12:25:27 PST) - [Re: archiving on inet](/archive/1994/02/8dc535b5df2b0837722723d762e966f0b40c77a235288bf27c4a37181bc8ffea) - _Jason Zions<EMAIL_ADDRESS>          + 1994-02-01 (Tue, 1 Feb 94 12:45:39 PST) - [Re: archiving on inet](/archive/1994/02/6a7f43f230f06429921bb1a6c7e7103f69adb963624dea72948061c2aec40a0a) - _Kirk Sheppard<EMAIL_ADDRESS>            + 1994-02-02 (Tue, 1 Feb 94 16:30:45 PST) - [Re: archiving on inet](/archive/1994/02/bf82dee5c27c7aa1eb4790d03b4c0a46e42b4065591dce288756d828dc3443a6) -<EMAIL_ADDRESS>(Jim Nitchals)_
              + 1994-02-02 (Wed, 2 Feb 94 04:25:30 PST) - [Re: archiving on inet](/archive/1994/02/43fa45e8d062f2f539b973e4ff97999ccb3f346600d0ad34379568614e22614d) - _"Perry E. Metzger"<EMAIL_ADDRESS>                + 1994-02-06 (Sun, 6 Feb 94 00:10:50 PST) - [Re: archiving on inet](/archive/1994/02/497bddb6c3195b0f312d1e06b819932f679b54f47ca9b5166c5f1992c07bebd5) - _Phil Karn<EMAIL_ADDRESS>                  + 1994-02-06 (Sun, 6 Feb 94 00:50:23 PST) - [Re: archiving on inet](/archive/1994/02/52c244a3510bed0ad307b94421b9aee3855456de7955a0c4d653725f75dd9c41) - _Chris Knight<EMAIL_ADDRESS>          + 1994-02-01 (Tue, 1 Feb 94 13:05:39 PST) - [Re: archiving on inet](/archive/1994/02/c58838b4486bd1086f49e8a9674ac7c14764e3500af3f879ceffd9f60ddc48ef) - _"Perry E. Metzger"<EMAIL_ADDRESS>            + 1994-02-01 (Tue, 1 Feb 94 13:25:45 PST) - [Re: archiving on inet](/archive/1994/02/66fd66fa1d30eefb512a054334d8f763eb1e0d0f604825a76bdb265916505aca) - _Jason Zions<EMAIL_ADDRESS>              + 1994-02-01 (Tue, 1 Feb 94 13:35:29 PST) - [Re: archiving on inet](/archive/1994/02/2923c2fa68fa5ae22042efc95d282b0e14ac6d7fa817fd3249af50644a31e334) - _"Perry E. Metzger"<EMAIL_ADDRESS>                + 1994-02-02 (Tue, 1 Feb 94 16:40:47 PST) - [Re: archiving on inet](/archive/1994/02/d2ffcc545ad57284447f35ade7841ebd4514859b370ea4efb6dae042bc3d5984) -<EMAIL_ADDRESS>(Jim Nitchals)_
                  + 1994-02-02 (Wed, 2 Feb 94 04:20:53 PST) - [Re: archiving on inet](/archive/1994/02/7b9b223d721d37ee590d789b97d82d0ccb79ea155e1cdd5519426709d2570654) - _"Perry E. Metzger"<EMAIL_ADDRESS>          + 1994-02-01 (Tue, 1 Feb 94 15:35:29 PST) - [Re: archiving on inet](/archive/1994/02/6bf6515cedb1273834dc07634e52b033e2f755a32393737b3612a6ef16787c3d) - _Joe Thomas<EMAIL_ADDRESS>            + 1994-02-02 (Tue, 1 Feb 94 16:40:53 PST) - [The Death of Statutory Compensation for Intellectual Property (was pissing contest)](/archive/1994/02/150230ca575bd6c20014f29f45779affc712a18c6f4e2979e4a90dc03d015149) - _Jason Zions<EMAIL_ADDRESS>              + 1994-02-02 (Tue, 1 Feb 94 18:55:28 PST) - [Re: The Death of Statutory Compensation for Intellectual Property (was pissing contest)](/archive/1994/02/fa861b07222f67d30a87478ec845116ad02d2677a5200df2b1a4bb75dd7605da) - _Joe Thomas<EMAIL_ADDRESS>            + 1994-02-02 (Tue, 1 Feb 94 17:25:53 PST) - [Re: archiving on inet](/archive/1994/02/2f042d301697b4115d76263317b10388c1c23a834b2191224ee2e61459d752af) -<EMAIL_ADDRESS>(Timothy C. May)_


text:
# Edge Detection

This work was initially developed during the Computational Vision discipline of Professor Aldo von Wangenheim at the Postgraduate Program in Computer Science (PPGCC) at the Federal University of Santa Catarina (UFSC) in the second semester of 2001. In the discipline I implemented a program that performed the detection of edges in an image using an Artificial Neural Network with Backpropagation learning.

Link of work in the discipline: [https://www.inf.ufsc.br/~aldo.vw/visao/2001/saulo/]

Later, in 2005, during my doctorate in the Post-Graduate Program in Automation and Systems Engineering (PPGEAS) at the same university, I suggested another algorithm for edge detection that used only conditionals (single and double). I wrote an article with the help of my doctoral colleague Rui Jorge Tramontin entitled "Proposal for Optimization of Edge Detection Algorithms in Images" which was accepted as a Poster for presentation at the "4th International Information and Telecommunication Technologies Symposium" in 2005.

![Edge Detection](doc/edge_detection.png)

For the article, I implemented the Roberts (and variant), Sobel (and variant) edge detection techniques, I used the edge detection by Neural Network that I had already implemented in Professor Aldo's course, I has implemented the algorithm using only one perceptron and the algorithms and I proposed of Single Conditional and Double Conditional. For the article, a visual and execution time comparison of the presented algorithms was made.

The paper and poster presented are in the doc folder.

## Execution Runtime Comparison

The results presented here are from the time of writing the article.

### Runtime Environment

* Computer Pentium IV 3GHz,  RAM 1GB
* Operationg System Linux
* Programming Language C
* Original image resolution 2048x2560 pixels
* Execution time result at: October 05, 2005

### Runtime Results

| Algorithm  |   1o  |   2o  |   3o  | Average|
| :--------- | ----: | ----: | ----: | -----: |
| Roberts    |  0.60 |  0.60 |  0.60 |  0.60  |
| RobertsAbs |  0.10 |  0.09 |  0.10 |  0.09  |
| Sobel      |  0.64 |  0.64 |  0.65 |  0.64  |
| SobelAbs   |  0.15 |  0.15 |  0.16 |  0.15  |
| Backprop   | 19.39 | 19.49 | 19.48 | 19.48  |
| Perceptron |  1.05 |  1.06 |  1.05 |  1.05  |
| If         |  0.06 |  0.06 |  0.06 |  0.06  |
| Double If  |  0.08 |  0.08 |  0.08 |  0.08  |

## Considerations and Modifications

* The codes were developed in C using allegro library and could only work with BMP images. To publish to github, I made some recent changes (June 10, 2021).
* To use a Multilayer Perceptron with Backpropagation, at the time I used QwikNet V2.23 software that generates code in C to run the network. As much as I have my own implementations of Artificial Neural Networks Multilayer Perceptrons today, for this program I keep the same resource used at the time.
* I switched to Simple Direct Layer 2 (SDL2) library to be able to work with other types of images;
* Each filter was coded in a separate program and a lot of code was rewritten. I put all filters in a single program, selecting the filter by parameter via the command line.
* I changed the photo from the time to a current one and "much prettier" to be used in the tests.


text:
# BAM Slicing

## Overview

If the file listed in the entity page is a BAM file, a "BAM Slicing" button will be available. Clicking on it will open the BAM slicing window.

[![BAM Slicing Window](images/gdc-data-portal-bam-slicing.png)](images/gdc-data-portal-bam-slicing.png "Click to see the full image.")

During preparation of the slice, the icon on the BAM Slicing button will be spinning, and the file will be offered for download to the user as soon as ready.

repository: ksjpswaroop/gdc-docs

repo_name: ksjpswaroop/gdc-docs


text:
# ngx-model2form
A RxJS operator to map a model entity to its equivalent Angular form entity.

## Breaking Change

Notice the addition of a selector function for validators.

## Installing

```
npm install --save ngx-model2form
```

And import to your main application module

```
import 'ngx-model2form';
```

You are ready to use the RxJS custom operator.

## Usage

Assuming ```this.people$``` is a stream of people, represented by the model:

```
interface Person {
  name: string;
  height: number;
  hobbies: string[];
}
```

Chaining the operator with the stream:

```
this.peopleForm$ = this.people$.toNgForm();
```

results with a stream of FormGroup with a structure simillar to the originated Person model.

This stream can be passes through a component input to transform into the underlying FormGroup,
and benefit of the component's change detector.

### Validators

Validators are passed through a selector function. The returned value determines the validators for the form, and is given the current model as parameter.

```
this.people$.toNgForm((person: Person) => ({
  height: person.height > 193
}));
```

You can pass validator/s as-is (for primitives) or an object, reflecting the structure of your model.

#### Primitives:

```
this.people$.toNgForm(_ => Validators.required);
this.people$.toNgForm(_ => [Validators.min(0), Validators.max(9)]);
```

#### Object:

Assuming you model structure is:

```
interface Person {
  name: string;
  height: number;
  hobbies: string[];
}
```

The opearator can be run as follows:

```
this.people$.toNgForm(_ => ({
  name: Validators.required,
  height: [Validators.min(0), Validators.max(9)]]
}));
```

* Notice that the ```hobbies``` property is missing, and thus will be omitted from validation.

##### Array property

Array property can be passed a simple validator/s to validate every item in the list, or an object with index key/s to validate a single or specific items.

Validating the whole array with a validation set:

```
this.people$.toNgForm(_ => ({
  hobbies: [Validators.min(0), Validators.max(9)]
}));
```

Validating specific items:

```
this.people$.toNgForm(_ => ({
  hobbies: {
    "0": [Validators.min(0), Validators.max(9)],
    "3": Validators.required
  }
}));
```

## Planned features
* Include model properties: Only transform properties that are mentioned in the include entity into form entities. Keep other properties as they are.
* Exclude model properties: Omit transforming properties that are mentioned in the exclude entity into form entities. Keep transforming other properties into form entities.

## Running the tests

No tests available at the moments. Working to get it done.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [releases on this repository](https://github.com/Opinya/ngx-model2form/releases).

## Authors

* **Chen Eshchar** - [ChenOpinya](https://github.com/chenopinya)

## License

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/Opinya/ngx-model2form/blob/master/LICENSE) file for details


text:
[![release](https://img.shields.io/badge/release-1.0-green.svg)](https://github.com/adisakshya/masquerade/releases)
[![maintenance](https://img.shields.io/badge/maintained%3F-yes-green.svg)]()
[![dockerized](https://img.shields.io/badge/dockerized-yes-green.svg)](https://github.com/adisakshya/masquerade/blob/master/docker-compose.yml)
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/adisakshya/masquerade/blob/master/LICENSE)
[![Website](https://img.shields.io/badge/website-down-red.svg)](https://adisakshya.github.io/masquerade)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/adisakshya/masquerade/pulls)
[![Open Source Love svg1](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)]()

---

The TOR browser has revolutionized the way we browse in this age of privacy breaches, mass surveillance, and data monetization. It provided the much needed peace of mind to many browsing the internet 😃.
Over the years though, TOR has been exposed quite a couple of times. The browser is still as secure — but not as leak-proof as some would want it to be 🤔. TOR has a habit of storing the IP address at the entry node which can cause security issues of its own. The browser is notorious for being slow 😕.

I needed something that doesn't expose my IP address at the entry node & all the information exchange I do on the web is secure enough to provide me my peace of mind.

So, I built Masquerade 🎭!

## What is Masquerade

A configurable setup that encrypts all the information that you are sending over TOR & hides the fact from your Internet Service Provider (ISP) that you are using TOR and also doesn't exposes your IP address to TOR entry node. Combine that with the fact that you now get to use TOR in regions of the world where it is not supported.

## How Masquerade work?

A VPN will hide your IP address ever before you connect to the TOR. That means the entry node on TOR still records an IP address, but that won’t be your real location, it would be of the VPN Server.

The VPN encrypt all the Internet traffic within the VPN layer. Then, this encrypted traffic would be sent to the wide TOR network through a few TOR hops before it ends up at the final destination (the Internet).

Because you would firstly connect to VPN, this hides from your Internet Service Provider (ISP) that you are using TOR.

When you make TOR the last gateway before connecting to the Internet, you are still able to access TOR’s hidden services and websites (hidden websites with the .onion suffix) which would normally can only be accessed within the TOR network.

You'll be assigned an IP address by the VPN Server that will be seen by the TOR entry node, and the web-browser sees the IP address of the TOR exit node. This means, Google might locate you in Russia and your system IP address says you are in South Korea.

**Caution:** No one knows your real IP address except the VPN provider. Your TOR traffic can be exposed to your ISP in the event if your VPN connection unexpectedly drops.
For now you can use custom configuration files to connect your VPN Provider using OpenVPN, but later releases of this project are aimed to provide an Open-VPN-Server to all clients.

## Getting Started

Follow below steps for setup:

### Prerequisites

Docker - Set of platform as a service products that use OS-level virtualization to deliver software in packages called containers.

- For Windows/MacOS
	- Download & Install **Docker Toolbox**
		- for macOS instructions are [here](https://docs.docker.com/toolbox/toolbox_install_mac/).
		- for Windows instructions are [here](https://docs.docker.com/toolbox/toolbox_install_windows/).
- For Ubuntu
	- Install **Docker**, instructions are [here](https://www.youtube.com/watch?v=V9AKvZZCWLc).

### Operating Instructions

- Fork this repository
	- "Forking" adds a copy of [adisakshya/masquerade](https://github.com/adisakshya/masquerade) repository to your GitHub account as `https://github.com/YourGitHubUserName/masquerade`
- Download or clone your forked repository
	- You can clone the repository executing below command in a location of your choice of your system.
	```$ git clone https://github.com/YourGitHubUserName/masquerade.git```
- Connect to VPN Provider using any of your VPN Client Applications (eg. OpenVPN)
- Activate TOR Proxy by following the README instructions in ```/tor/README.md```.
- Check if the TOR proxy server is functioning good by visiting this [check.torproject](https://check.torproject.org/)
    - Look for the congratulations message and the IP assigned.
- That's it you've done configuring the setup.

#### Developer Guide

- TOR Proxy Service: ```/tor```
	- Dockerfile: ```/tor/Dockerfile``` setup TOR Proxy in docker container
- VPN Service: ```/vpn```
	- Dockerfile: ```/vpn/Dockerfile``` connect to VPN Provider using OpenVPN client in docker container

## What is in the next release ?

Issues to work on next, possibly before the next release are covered in [milestones](https://github.com/adisakshya/masquerade/milestones).

## Suggest Features

Is a feature you care about currently missing? Make sure to browse the [issue tracker](https://github.com/adisakshya/masquerade/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) and add your ":+1:" reaction to the issues you care most about, as we also use those reactions to prioritize issues.

## Contributing

There are multiple ways to contribute to this project, read about them [here](https://github.com/adisakshya/masquerade/blob/master/.github/CONTRIBUTING.md).

## License

All versions of the app are open-sourced, read more about this [LICENSE](https://github.com/adisakshya/masquerade/blob/master/LICENSE).

repository: adisakshya/masquerade

repo_name: adisakshya/masquerade


text:
# Disbumptors

A twitter list of library disruptors displayed in a dynamic table.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

* [NodeJS](https://nodejs.org/en/) - For installing dependencies and running the project.

### Installing

```console
npm install
```

## Deployment

This site is static HTML and can be deployed directly onto a live server.

## Built With

* [Bootstrap](https://getbootstrap.com/) - Web component framework for responsive, mobile first front-end development
* [DataTables](https://datatables.net/) - jQuery plugin for displaying and interacting with data in HTML tables
* [ChartJS](https://www.chartjs.org/) - JavaScript charting library
* [JSZip](https://stuk.github.io/jszip/) - JavaScript library for reading and writing ZIP files
* [jQuery](https://jquery.com/) - JavaScript library for DOM manipulation and event handling
* [MomentJS](https://momentjs.com/) - JavaScript date library
* [Popper.js](https://popper.js.org/) - JavaScript library for creating tooltips and popovers

## Authors

* **Dave Rowe** - *Initial work* - [DaveBathnes](https://github.com/DaveBathnes)

## License

This project is licensed under the [MIT License](LICENSE.md)

## Acknowledgments

* Nick Poole

repository: LibrariesHacked/disbumptors-librarydata

repo_name: LibrariesHacked/disbumptors-librarydata


text:
# VCPU
A virtual CPU written in C++.

# OPCODES
01: load the next number in RAM into reg0
10: load the next number in RAM into reg1
11: Add reg0 and reg1; store result in reg2
100: Call interrupt located in next place in memory
101: Multiply reg0 and reg1; store result in reg2

# Interrupts
10: Print reg2 into the console

# Registers
reg0: General Purpose Register
reg1: General Purpose Regsiter
reg2: Arithmetic Result Storage

# NOTES
 - The above opcodes are the only ones implemented.
 - No assembler; programs must be written in final binary format.

# COMPILING
```make```
```make run```


text:
---
layout: page
title: About
permalink: /about/
---

My name is Dave Hylands, and I'm a professional software developer, currently working for Mozilla in their Emerging Technologies group. My primary interests lie around embedded realtime programming, and interfacing with hardware (i.e. device drivers).

On the personal front, I'm interested in robotics, which has lead me to dabble in electronics, metal-working, and wood-working.

I live in Canada, near Kelowna British Columbia, which is located in the [Okanagan Valley](http://www.okanagan.com/).

### Contact me

My preferred form of contact is via email [dhylands@gmail.com](mailto:dhylands@gmail.com), or you can use
one of the social media links below.


text:
## [Unreleased]

## [20.5.2] - 2020-05-26
Added **fetch-incidents** functionality.

## [20.4.1] - 2020-04-29
- Fixed an issue where filters were not properly implemented in the ***msg-search-alerts*** command.
(**Note**: Existing ***msg-search-alerts*** command results might change the next time the command is executed.)

- Added support to authenticate using a self-deployed Azure application.

## [20.4.0] - 2020-04-14
-

## [19.12.1] - 2019-12-25
Added content-version and content-name headers to Oproxy request.

repository: nicoloereni/content

repo_name: nicoloereni/content


text:
---
title: Whanganui's Kai Iwi Beach Dig attracts 150 participants despite conditions
feature_image:
  description: >-
    Christine and Bevan Hunter, with daughter Lauren, attended the Beach Dig for
    the second time.
  image: >-
    https://res.cloudinary.com/whanganuihigh/image/upload/v1583113335/News/Hunters_at_beach_dig_all_the_family._Chron_25.2.20.jpg
  credit: Lewis Gardner
news_author:
  date: 2020-02-25T01:38:10.176Z
  publication: Whanganui Chronicle
  name: Logan Tutty
image_gallery:
  - description: 'Lauren Hunter, 6, with her sandcastle.  Photo / Supplied.'
    image: >-
      https://res.cloudinary.com/whanganuihigh/image/upload/v1583113379/News/Hunters_at_beach_dig_Lauren._Chron_25.2.20.jpg
  - description: >-
      More than 150 people turned out for the second annual Kai Iwi Beach Dig.
      Photo / Lewis Gardner.
    image: >-
      https://res.cloudinary.com/whanganuihigh/image/upload/v1583113412/News/Hunters_at_beach_dig_story._General_crowd._Chron_25.2.20.jpg
  - description: >-
      All past/present WHS students, Lennart Nowak, Ethan Bryers, Matthew
      Newell, Phoenix Grammaticogiannis and Jack Clifton from Whanganui Surf
      Lifesaving Club.  Photo / Lewis Gardner.
    image: >-
      https://res.cloudinary.com/whanganuihigh/image/upload/v1583113448/News/Hunters_at_beach_dig_story._Lifesaving_ex_WHS._Chron_25.2.20.jpg
show_in_slider: true
date: 2020-03-02T01:38:10.195Z
---
Despite less than ideal weather conditions, more than 150 people hit the sand for the second annual Kai Iwi Beach Dig.

The rain and wind earlier on Sunday morning may have scared off some, but those who made it were fully amongst it.

Mitre 10 Mega's marketing, events and promotions co-ordinator Paula Fore was frustrated by the bad weather earlier in the day, but said those who made the journey to the beach had a great time.

"There were people coming whether it was raining or whatever," Fore said.

"The people that are here are rapt. The kids are all for it."

Wanganui Surf Life Saving Club administrator Matthew Newell said people were in a good mood from the start.

"Had a good chat with a lot of people and they're happy and appreciate what's happening," Newell said.

He was thankful that the weather cleared as the day went on.

"Quite lucky with the weather, sun's come out and wind dropped."

Fore and Newell said the weather played a big part in the lower attendance. Last year's event was a resounding success, with hundreds turning up in what Newell called "the hottest day of the summer".

Christine and Bevan Hunter, along with daughter Lauren, attended the Beach Dig last year and competed in the sandcastle competition this year.

"It's a good cause and a good family day out."

The Beach Dig was a huge success, Fore said.

It involved 205 tokens being buried in the sand, with participants digging them up and each token corresponding to a prize.

Of the 205 tokens, 160 were found, but the largest prize wasn't claimed and will be given to the Surf Lifesaving Club.

"The Surf Lifesaving Club are rapt to have the $1000 gift card given to them," Fore said.

The money raised will go towards two Cam-Am ATVs that have been recently purchased for the club.

"[We're] still a few thousand dollars short so doing all the fundraising we can to help pay for them - they're a big asset to our rescue fleet," Newell said.

He was appreciative of the work and support of Mitre 10 Mega.

"Mitre 10 have been awesome. They've been supporting us from day one with the watchtower. They've been awesome and just want to support the community."

gha_language: Blade


text:
# DKIM

THIS PROJECT IS IMPLEMENTED WITH PURPOSES OF STUDY AND EXPERIMENTATION AND SHOULD NOT BE USED IN REAL CASE SCENARIOS.

## Getting started

After downloading the source code, run the following command to install the software:

```
npm install
```

## Running Tests

In order to run the tests, run the following command:

```
npm test
```

## Using the command-line:

### How To See an example of signing and verifying email?

```
node index.js example
```

### How To Sign an Email

NOTICE: The considered format is JSON. Refer `input-samples` to see an example.

In order to sign an e-mail, run the following command:

```
node index.js sign input-samples/plain-mail.json rsa-sha256
```

Expected output:

```
XcOpw6XCpBvDo8OPw6PCu1ZPaMKywpZEwrvDkMO9w7ZHDjB3w7PCj8OXw4fCj8KfUcOWdmXDhx/DscOvOcKtcMKKZWkJwpPDg1dRw4oKwqtkw78xwpHCjcKxw4nDswFLwpXCsDTDpMKcAwYtQ8OvWMK+TSbDnsOZw7PCgsOlUEAAH8OzXsOww77Du8O6w4t0w652wrouw6dWA8KUYFYlMTh+w7HCrTnCinlNbEfDuH4rwp3DjVnCqlQ3woPCqno9VA==
```

### How to Verify an Email Signature

NOTICE: The considered format is JSON. Refer `input-samples` to see an example.

In order to verify an e-mail signature, run the following command:

```
node index.js verify input-samples/plain-mail.json rsa-sha256 XcOpw6XCpBvDo8OPw6PCu1ZPaMKywpZEwrvDkMO9w7ZHDjB3w7PCj8OXw4fCj8KfUcOWdmXDhx/DscOvOcKtcMKKZWkJwpPDg1dRw4oKwqtkw78xwpHCjcKxw4nDswFLwpXCsDTDpMKcAwYtQ8OvWMK+TSbDnsOZw7PCgsOlUEAAH8OzXsOww77Du8O6w4t0w652wrouw6dWA8KUYFYlMTh+w7HCrTnCinlNbEfDuH4rwp3DjVnCqlQ3woPCqno9VA==
```

Expected output:

```
Signature is valid!
```

### How to run in DEBUG mode

In order to run in debug mode, add `DKIM_DEBUG=true` environment variable. Example:

```
DKIM_DEBUG=true node index.js sign input-samples/plain-mail.json rsa-sha256
```

### Supported Algorithms:

- `rsa-sha256`
- `rsa-sha1`

### Public and Private Keys:

The keys are located in the files `privateKeyPem.js` and `publicKeyPem.js`

### Project Limitations and Assumptions:

### Assumptions:

- Email Test Files in JSON Format. Example:

```json
{
  "headers": [
    "subject: \"Good news\"",
    "from: bob<EMAIL_ADDRESS>    "to<EMAIL_ADDRESS>    "date: Thu Mar 07 2019 17:07:00 GMT+0100"
  ],
  "body": "Hi Alice,\nI guess you will not believe it, but I have found the dog. It was hidden where you never would have expected.\nCheers,\nBob"
}
```

- `body` contains the canonicalized body specified in the "c=" tag and
  is already truncated to the length specified in the "l="

- `headers` contains all the headers are the parameters chosen by the
  signer already canonicalized as well and with the order preserved

- _(signature)_ `domain` and `selector` are used to compute dataHash (before signing),
  due to lack of understanding. It is not clear to me if it needs to be
  out of the hash but in the encryption, or all in. Also, by doing so,
  it is possible to use RSA API `sign` method directly.
  Without this assumption, the approach would be: 1) compute dataHash) 2) concatenate domain, selector and dataHash 3) RSA encrypt the aforementioned concatenation

- _(verification)_ `domain` and `selector` are used to compute dataHash (before verifying),
  due to lack of understanding. It is not clear to me if it needs to be
  out of the hash but in the encryption, or all in. Also, by doing so,
  it is possible to use RSA API `verify` method directly.
  Without this assumption, it is not clear to me how would
  the verification process be.

### Limitations:

- DKIM-Signature header field is not passed to the Step 2

## REFERENCES

These are links from pages that were useful during the progress of this project:

- https://github.com/digitalbazaar/forge
- https://github.com/digitalbazaar/forge#rsa
- https://github.com/emn178/js-sha1
- https://www.npmjs.com/package/crypto-js
- https://github.com/ArnaudValensi/node-jsencrypt
- http://travistidwell.com/jsencrypt/
- http://travistidwell.com/jsencrypt/example.html
- https://medium.com/@DannyAziz97/rsa-encryption-with-js-python-7e031cbb66bb

## About the Author

Geraldo Barbosa Landre - https://geraldo.landre.me

repository: glandre/dkim

repo_name: glandre/dkim