text:
# fdfgen

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

Python port of the PHP [forge_fdf](http://www.pdfhacks.com/forge_fdf/) library by Sid Steward

PDF forms work with FDF data. I ported a PHP FDF library to Python a while back when I had to do this and released it as fdfgen. I use that to generate an fdf file with the data for the form, then use [`pdftk`](http://www.pdflabs.com/tools/pdftk-server/) to push the fdf into a PDF form and generate the output.

## QUICK INSTALL

    pip install fdfgen

## HOW IT WORKS

1. You (or a designer) design the `form.pdf` in Acrobat.
2. Mark the form fields and take note of the field names. This can be done either through Acrobat or by installing pdftk and entering the command line

        pdftk [pdf name] dump_data_fields

3. Let's say your form has fields "name" and "telephone".

    Use fdfgen to create a FDF file:

        #!/usr/bin/env python
        from fdfgen import forge_fdf

        fields = [('name', 'John Smith'), ('telephone', '555-1234')]
        fdf = forge_fdf("",fields,[],[],[])

        with open("data.fdf", "wb") as fdf_file:
            fdf_file.write(fdf)

4. Then you run pdftk to merge and flatten:

       pdftk form.pdf fill_form data.fdf output output.pdf flatten

    and a filled out, flattened (meaning that there are no longer editable form fields) pdf will be in `output.pdf`.

## CHANGELOG

* 0.16.1 -- 2017-11-21 -- Fix `TypeError` in python 3.6 by Tom Grundy (@caver456)
* 0.16.0 -- 2017-02-22 -- Allow for different values for each checkbox by<EMAIL_ADDRESS>* 0.15.0 -- 2016-09-23 -- Encode field names as UTF-16 fix by Andreas Pelme<EMAIL_ADDRESS>* 0.14.0 -- 2016-08-09 -- Adobe FDF Compatibility added by Cooper Stimson (@6C1)
* 0.13.0 -- 2016-04-22 -- python 3 bugfix from Julien Enselme<EMAIL_ADDRESS>* 0.12.1 -- 2015-11-01 -- handle alternative checkbox values fix from Bil Bas <https://github.com/Spooner>
* 0.12.0 -- 2015-07-29 -- python 3 bugfixes
* 0.11.0 -- 2013-12-07 -- python 3 port from Evan Fredericksen
* 0.10.2 -- 2013-06-16 -- minor code refactor and added command line options from Robert Stewart <https://github.com/rwjs>
* 0.10.1 -- 2013-04-22 -- unbalanced paren bugfix from Brandon Rhodes<EMAIL_ADDRESS>* 0.10.0 -- 2012-06-14 -- support checkbox fields and parenthesis in strings from Guangcong Luo<EMAIL_ADDRESS>* 0.9.2  -- 2011-01-12 -- merged unicode fix from Sébastien Fievet<EMAIL_ADDRESS>
## RUNNING TESTS:

* Create a virtual environment
* tox is required to run the tests. You can install the correct version with
  `pip install -r requirements-tests.txt`
* Run `tox` to run tests for all Python versions.
* To run a specific test and specific Python versions, you may use `tox -e py27
  -- tests/test_encoding.py`

repository: ccnmtl/fdfgen

repo_name: ccnmtl/fdfgen


text:
---
layout: default
---

# 1995-11-21 - Re: Are there enough FBI agents to handle Digital Telephony?????

## Header Data

From: Duncan Frissell<EMAIL_ADDRESS>To<EMAIL_ADDRESS>(Peter Wayner)

Message Hash: fb44ecf8af4385765c79c44d893c1591f29e79402453d9223160c4b2a0ea3a38

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-11-21 21:51:04 UTC

Raw Date: Tue, 21 Nov 95 13:51:04 PST

## Raw message

```
{% raw  %}From: Duncan Frissell<EMAIL_ADDRESS>Date: Tue, 21 Nov 95 13:51:04 PST
To<EMAIL_ADDRESS>(Peter Wayner)
Subject: Re: Are there enough FBI agents to handle Digital Telephony?????
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

At 11:05 AM 11/21/95 -0500, Peter Wayner wrote:

>Has anyone ever done the math on the FBI's new wire tapping
>proposals and determined whether they'll have enough agents to
>do all of the listening? Doesn't a court ordered wire tap
>require that people listen in and screen the recordings. Does

No.  Automatic equipment (pen registers) is almost as old as wiretaps.

>12,500 agents would cost $1.2 bill
on a year if they each cost
>about $100,000 in salary and benefits. But we need to account
>for vacations, shift work and testifying the trials of the drug
>lords who are sent to jail. Let's assume that you only need
>1/10th the people to handle the two evening shifts. That gives
>you a cost of $1.4 billion before vacations. Adding 40% to cover
>vacation and weekends puts you close to $2 billion. Let's round
>up.

The bodies are still needed for management, analysis, arrest, prosecution,
and punishment.  Until Robocop is deployed, the criminal justice system will
be a labor intensive effort.  This is still good news for us though.  Anyone
who's been in business (say George McGovern after his Connecticut inn
bankruptcy) can tell you that people are the most expensive part of a
business.  You pay all that cash each year and at the end of the year you
have nothing concrete to show for it.    Labor
costs become more of a problem as the quantity and value of capital goods
increases since the more slowly increasing factor (labor) is bid up.  Thus
people cost a lot more these days than they did in 1800 because capital
goods (per unit) are much cheaper than they used to be.

(Ignore temporary changes in returns to labor as women, 3rd world residents,
or freed commie slaves join the labor force.  They are quickly absorbed.
Wants are unlimited.)

Now the increasing cost of labor is not a problem if those workers are
producing goods of value.  They are "making" their own earnings.  If they
are in a parasitic profession, however, -- one that subsists on what it
steals from others -- the rising cost of labor means that that institution
has to steal more and more to keep up.  Eventually, the speed of economic
change can swamp the theft ability of such an organization.

Such swamping occurs because market entities support their own growth or
they don't grow.  Since they lift themselves up, growth is unlimited.
Parasitic entities on the other hand are limited by the strength and
susceptibility of their host.  Hosts may weaken if the parasite grows too
much or it may find a way to cast off the parasite.  No one rejects a market
economic actor that is a potential customer or employer but parasites are
rejected whenever possible.

Market Earth on the nets gives us many opportunities to both fuel fast
growth and shake off parasites.  It is perfectly possible for markets to
outbid the secret police for the labor of its agents given the compound
growth rates that are a feature of friction-free capitalism.

DCF

"Don't call it Anarchy.  Call it Disintermediation."

{% endraw %}
```

## Thread

+ Return to [November 1995](/archive/1995/11)

+ Return to "[Duncan Frissell <frissell@panix.com>](/authors/duncan_frissell_frissell_at_panix_com_)"

+ 1995-11-21 (Tue, 21 Nov 95 13:51:04 PST) - Re: Are there enough FBI agents to handle Digital Telephony????? - _Duncan Frissell<EMAIL_ADDRESS>

license: MIT

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive


text:
# Customer Support Triaging

According to the Oxford dictionary, _triaging_ or _triage_ is the act of deciding the order of treatment. As customer support, we are the ‘doctors’ to our customers. We provide solutions to them when they have a problem. They are the ‘patients’.

When a customer posts a question/issue/problem in our shared slack channel or email, they end up in the _triage tickets_ view in Zendesk.
What this means is that the customer issue needs to be understood before it’s assigned/picked up by a customer support engineer, which happens in the _Unassigned tickets_ view.

## The speed at which to triage

In order to set-up the team for success meeting our internal 1-hour SLA, it is critical that the triage team triages every ticket that comes in within ~10 minutes of it coming in.

## How to triage like a pro

- **Step 1:** In the triage view, the first step is to open a ticket and understand the context of the message. Slow down and have a closer look at the content and the medium from which the message originated (emails tend to be rare). Is this related to another open issue? Is this a new issue? Is this not an issue at all?

- **Step 2:** If the case came in via Slack (whether or primary account and the support- or trial- channels, or our Community account and the #help channel), change the requestor to the person who requested it. This is not necessary if the ticket came in via email.

  - Sometimes it may be an internal person and that would be correct, unless our teammate is posting on behalf of the customer and then we would want to change it to the customer.
  - When a CSE is assigned to a customer, this step will also trigger that CSE and their backup to appear as a follower (you don't see these auto populate until after you save the ticket (ie "submit as open").

- **Step 3:** Identify if there is action for CS or not

  If there is an action for CS, got to Step 4. There is an action for CS if the action is to:

  - troubleshoot
  - explain how a feature works in the product/how to do something in the product
  - handle anything related to security for a customer without a CE
  - handle a feature request for a customer without a CE

  If there is no action for CS, go to step 8. There is no action for CS if the action is to:

  - handle anything related to licensing
  - handle anything related to security for a customer with a CE
  - handle a feature request for a customer with a CE
  - provide guidance on how to think about using Sourcegraph/drive adoption (ie more proactive in nature guidance)

  If it's not clear, post in #customer-support-triage and brainstorm the best path.

- **Step 4:** Leave an internal note that says "In CS queue for helping" and share any other context for the team. This note also syncs to Salesforce so that CEs know our triaging decision.

- **Step 5:** On the left panel, under _Tags_, select, _triaged_.

- **Step 6:** On the left panel, under the _Select Assignee_ tab, pick _Assign to this group_ and submit the ticket as open -- this will make sure the ticket lands in the _Unassigned queue_ (which requires that ticket have the tag “triaged,” status of “open” and assignee of the Support group).

- **Step 7:** Create a post in our #customer-support-internal Slack channel altering the team that there is a new ticket available to take.

- **Step 8:** If there is no action for CS, use the "no action for CS macro" and leave a reason why not -- remember, these internal notes sync to Salesforce so CEs know our decision making. This macro should also change the assignee to Virginia, which is important so these tickets don't count in the support metric data. You may then submit the ticket as solved.

## FAQs

### 1. Whose responsible for triaging?

Brielle, Nonso, Tamar, and Virginia. If needed, Adeola, Beatrix, Carl, Stompy, and Warren can serve as back-up.

### 2. What should I do when I see a ticket originating from Slack with an internal user as the post owner?

The first step would be to open up the slack channel in which the Sourcegraph colleague posted, which is linked in the Zendesk ticket. In here we can see what happened in the conversation. This helps build context as to whether similar tickets correspond to this as well (may or may not necessitate a merge). Based on a slack channel, tickets can be created in Zendesk that are related to the challenge that the customer is facing. For this, it would be great to merge them and associate them to the customer. Also great to note that the ticket can be closed if the colleague in the thread doesn’t need our help.

### 3. What if a new ticket is related to another ticket?

If the other ticket is still open, merge the new ticket into it and alert our teammates who is responsible for the active ticket. This is easiest to see for tickets that originate from Slack. If you catch it for those that come in via email, that is great, but it can be harder to do.

### 4. Can I merge a ticket into one that I closed in the past?

Short answer, No. Hopefully in the future, Zendesk will give us this feature; for now, we can link to the other ticket and be sure the requestor is correct.

### 5. Do we have anything to triage manually?

Yes, we have a few customers listed in our [Customer Exception list](customer-exceptions.md) that we have to manually triage because we cannot automate the link from Slack to Zendesk. When a customer creates a support request in these channels, we have to manually create a Zendesk ticket and then triage that.

We also look at the queues of anyone who is out that day to see if someone needs to fill-in (the original CSE keeps responsibility) -- great for when the CSE is out a day or two -- or we if we need to transition the case to another CSE --great for when the CSE is out a longer period of time.

### 6. What do I do when I see a company update in the triage queue?

We sometimes get all company updates coming to the support mailbox. Company updates could be meeting updates etc. When you come across these updates, from a data integrity perspective, please go ahead and delete them.

repository: zag/about

branch_name: refs/heads/main

repo_name: zag/about


text:
# Factorial 2/2

![Divide and conquert](../_Assets/images/factorial.png)

[Source](http://www.mrlamont.com/what-is-recursion.html)


text:
# Sean Chen's Blog 🦀

Blog posts, mostly about Rust.

## Posts

| Date | Title |
|-|-|
| 2021-04-06 | [A Beginner's Guide to Handling Errors in Rust](./posts/extending-minigrep/index.md) |
| 2021-01-23 | [Implementing an LRU Cache in Rust](./posts/lru-cache/index.md) |
| 2020-11-27 | [Semaphores in Rust](./posts/semaphores/index.md) |
| 2020-08-18 | [Why I'm Switching from VSCode to OniVim 2](./posts/onivim2/index.md) |
| 2020-07-20 | [Haskell::From(Rust) I: Infix Notation and Currying](./posts/haskell-from-rust-I/index.md) |
| 2020-07-13 | [Some Learnings from Implementing a Normalizing Rust Representer](./posts/rust-representer/index.md) |
| 2020-06-03 | [The Story of Tail Call Optimizations in Rust](./posts/tco-story/index.md) |
| 2020-05-27 | [Takeaways from My Initial Exposure to Rust](./posts/takeaways-I/index.md) |

## Notifications

Get notified when a new post gets published by watching this repo's releases (click `Watch` -> click `Custom` -> select `Releases` -> click `Apply`).

## Feedback

If you have any feedback, please open an [issue][issue] on this repo. PRs for even minor fixes like typos and grammar are appreciated!

## Discuss

Feel free to start a discussion on any of the content published in this blog over in the [discussions forum](https://github.com/seanchen1991/blog/discussions)!

## Licensing

To be compatible with [Rust](https://github.com/rust-lang/rust), all code examples in this blog are licensed under [Apache License Version 2.0](./license-apache) or [MIT License](./license-mit), at your option.

I'd like to retain exclusive rights to the English version of the posts themselves, but as mentioned above if you translate a post into another language you're welcome to promote your translations however you like.

[issue]: https://github.com/seanchen1991/blog/issues/new
[Rust]: https://github.com/rust-lang/rust
[license-apache]: ./license-apache
[license-mit]: ./license-mit


text:
# Xml-Array

[![Run tests](https://github.com/JackieDo/Xml-Array/actions/workflows/run-tests.yml/badge.svg)](https://github.com/JackieDo/Xml-Array/actions/workflows/run-tests.yml)
[![Total Downloads](https://poser.pugx.org/jackiedo/xml-array/downloads)](https://packagist.org/packages/jackiedo/xml-array)
[![Latest Stable Version](https://poser.pugx.org/jackiedo/xml-array/v/stable)](https://packagist.org/packages/jackiedo/xml-array)
[![License](https://poser.pugx.org/jackiedo/xml-array/license)](https://packagist.org/packages/jackiedo/xml-array)

The conversion between xml and array becomes easier than ever. This package provides some very simple classes to convert XML to array and back.

# Features of this package
* Convert an XML object (DOMDocument, SimpleXMLElement) or well-formed XML string to an associative array or Json string.
* Convert an associative array to well-formed XML string or DOMDocument.
* Support parsing and building attributes, Cdata sections and namespaces of XML in conversion process.

# Overview
Look at one of the following sessions to learn more about this package.

- [Xml-Array](#xml-array)
- [Features of this package](#features-of-this-package)
- [Overview](#overview)
  - [Installation](#installation)
  - [Basic usage](#basic-usage)
    - [Convert from XML](#convert-from-xml)
    - [Convert from array](#convert-from-array)
  - [Advanced usage](#advanced-usage)
    - [Set configuration](#set-configuration)
      - [Method 1](#method-1)
      - [Method 2](#method-2)
      - [Method 3](#method-3)
    - [Get configuration](#get-configuration)
    - [Default configuration](#default-configuration)
      - [For Xml2Array](#for-xml2array)
      - [For Array2Xml](#for-array2xml)
    - [Effect of configuration settings](#effect-of-configuration-settings)
      - [version](#version)
      - [encoding](#encoding)
      - [standalone](#standalone)
      - [attributesKey, cdataKey, valueKey](#attributeskey-cdatakey-valuekey)
      - [namespacesOnRoot](#namespacesonroot)
      - [rootElement](#rootelement)
      - [keyFixer](#keyfixer)
- [License](#license)

## Installation
You can install this package through [Composer](https://getcomposer.org).

```shell
$ composer require jackiedo/xml-array
```

## Basic usage

### Convert from XML

Web have two following methods:

**Convert to array**:

```php
Xml2Array::convert(DOMDocument|SimpleXMLElement|string $inputXML)->toArray();
```

**Convert to Json**:

```php
Xml2Array::convert(DOMDocument|SimpleXMLElement|string $inputXML)->toJson(int $flag = 0);
```

> **Note:** The input XML can be one of types DOMDocument object, SimpleXMLElement object or well-formed XML string.

**Example 1**: - _(Convert from XML string)_

```php
use Jackiedo\XmlArray\Xml2Array;
...

$xmlString = '<?xml version="1.0" encoding="UTF-8"?>
    <root_node>
        <tag>Example tag</tag>

        <attribute_tag description="This is a tag with attribute">Another tag with attributes</attribute_tag>

        <cdata_section><![CDATA[ This is CDATA section ]]></cdata_section>

        <tag_with_subtag>
            <sub_tag>Sub tag 1</sub_tag>
            <sub_tag>Sub tag 2</sub_tag>
        </tag_with_subtag>

        <mixed_section>
            Hello

            <![CDATA[ This is another CDATA section ]]>

            <section id="sec_1">Section number 1</section>
            <section id="sec_2">Section number 2</section>
            <section id="sec_3">Section number 3</section>
        </mixed_section>

        <example:with_namespace xmlns:example="http://example.com">
            <example:sub>Content</example:sub>
        </example:with_namespace>
    </root_node>';

$array = Xml2Array::convert($xmlString)->toArray();
```

After running this piece of code `$array` will contain:

```php
$array = [
    "root_node" => [
        "tag"           => "Example tag",
        "attribute_tag" => [
            "@value"      => "Another tag with attributes",
            "@attributes" => [
                "description" => "This is a tag with attribute"
            ]
        ],
        "cdata_section" => [
            "@cdata" => "This is CDATA section"
        ],
        "tag_with_subtag" => [
            "sub_tag" => ["Sub tag 1", "Sub tag 2"]
        ],
        "mixed_section" => [
            "@value"  => "Hello",
            "@cdata"  => "This is another CDATA section",
            "section" => [
                [
                    "@value"      => "Section number 1",
                    "@attributes" => [
                        "id" => "sec_1"
                    ]
                ],
                [
                    "@value"      => "Section number 2",
                    "@attributes" => [
                        "id" => "sec_2"
                    ]
                ],
                [
                    "@value"      => "Section number 3",
                    "@attributes" => [
                        "id" => "sec_3"
                    ]
                ]
            ]
        ],
        "example:with_namespace" => [
            "example:sub" => "Content"
        ],
        "@attributes" => [
            "xmlns:example" => "http://example.com"
        ]
    ]
]
```

**Example 2**: - _(Convert form XML object, such as SimpleXMLElement)_

```php
use Jackiedo\XmlArray\Xml2Array;
...

$xmlObject = simplexml_load_file('https://www.vietcombank.com.vn/ExchangeRates/ExrateXML.aspx');
$array     = Xml2Array::convert($xmlObject)->toArray();
```

The result of above code is:

```php
$array = [
    "ExrateList" => [
        "DateTime" => "11/26/2018 1:56:20 PM",
        "Exrate" => [
            [
                "@attributes" => [
                    "CurrencyCode" => "AUD",
                    "CurrencyName" => "AUST.DOLLAR",
                    "Buy" => "16724.09",
                    "Transfer" => "16825.04",
                    "Sell" => "17008.7"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "CAD",
                    "CurrencyName" => "CANADIAN DOLLAR",
                    "Buy" => "17412.21",
                    "Transfer" => "17570.34",
                    "Sell" => "17762.14"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "CHF",
                    "CurrencyName" => "SWISS FRANCE",
                    "Buy" => "23074.67",
                    "Transfer" => "23237.33",
                    "Sell" => "23538.02"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "DKK",
                    "CurrencyName" => "DANISH KRONE",
                    "Buy" => "0",
                    "Transfer" => "3493.19",
                    "Sell" => "3602.67"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "EUR",
                    "CurrencyName" => "EURO",
                    "Buy" => "26264.39",
                    "Transfer" => "26343.42",
                    "Sell" => "26736.61"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "GBP",
                    "CurrencyName" => "BRITISH POUND",
                    "Buy" => "29562.43",
                    "Transfer" => "29770.83",
                    "Sell" => "30035.68"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "HKD",
                    "CurrencyName" => "HONGKONG DOLLAR",
                    "Buy" => "2939.91",
                    "Transfer" => "2960.63",
                    "Sell" => "3004.95"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "INR",
                    "CurrencyName" => "INDIAN RUPEE",
                    "Buy" => "0",
                    "Transfer" => "331.15",
                    "Sell" => "344.15"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "JPY",
                    "CurrencyName" => "JAPANESE YEN",
                    "Buy" => "200.38",
                    "Transfer" => "202.4",
                    "Sell" => "207.05"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "KRW",
                    "CurrencyName" => "SOUTH KOREAN WON",
                    "Buy" => "19.07",
                    "Transfer" => "20.07",
                    "Sell" => "21.33"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "KWD",
                    "CurrencyName" => "KUWAITI DINAR",
                    "Buy" => "0",
                    "Transfer" => "76615.44",
                    "Sell" => "79621.23"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "MYR",
                    "CurrencyName" => "MALAYSIAN RINGGIT",
                    "Buy" => "0",
                    "Transfer" => "5532.17",
                    "Sell" => "5603.76"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "NOK",
                    "CurrencyName" => "NORWEGIAN KRONER",
                    "Buy" => "0",
                    "Transfer" => "2674.72",
                    "Sell" => "2758.55"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "RUB",
                    "CurrencyName" => "RUSSIAN RUBLE",
                    "Buy" => "0",
                    "Transfer" => "349.9",
                    "Sell" => "389.89"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "SAR",
                    "CurrencyName" => "SAUDI RIAL",
                    "Buy" => "0",
                    "Transfer" => "6206.27",
                    "Sell" => "6449.75"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "SEK",
                    "CurrencyName" => "SWEDISH KRONA",
                    "Buy" => "0",
                    "Transfer" => "2536.35",
                    "Sell" => "2600.19"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "SGD",
                    "CurrencyName" => "SINGAPORE DOLLAR",
                    "Buy" => "16775.66",
                    "Transfer" => "16893.92",
                    "Sell" => "17078.33"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "THB",
                    "CurrencyName" => "THAI BAHT",
                    "Buy" => "691.64",
                    "Transfer" => "691.64",
                    "Sell" => "720.49"
                ]
            ],
            [
                "@attributes" => [
                    "CurrencyCode" => "USD",
                    "CurrencyName" => "US DOLLAR",
                    "Buy" => "23295",
                    "Transfer" => "23295",
                    "Sell" => "23385"
                ]
            ]
        ],
        "Source" => "Joint Stock Commercial Bank for Foreign Trade of Vietnam - Vietcombank"
    ]
];
```

**Example 3**: - _(Convert to Json)_

```php
$jsonString = Xml2Array::convert($xmlString)->toJson(JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
```

### Convert from array

We also have two following methods:

**Convert to XML string**:

```php
Array2Xml::convert(array $array)->toXml(bool $prettyOutput = false);
```

**Convert to DOMDocument object**:

```php
Array2Xml::convert(array $array)->toDom();
```

**Example 4**:

```php
use Jackiedo\XmlArray\Array2Xml;
...

// We will use array from the result of first example as input for this example
$xmlString = Array2Xml::convert($array)->toXml(true);
```

**Example 5**:

```php
$domObject = Array2Xml::convert($array)->toDom();
```

## Advanced usage

### Set configuration
If we want to change the settings for the conversion process, we can do it in the following ways:

#### Method 1

```php
...
$config = [
    'valueKey' => '@text',
    'cdataKey' => '@cdata-section',
    ...
];

$array = Xml2Array::convert($inputXml, $config)->toArray();
...

// And for backward processing
$xml = Array2Xml::convert($inputArray, $config)->toXml();
```

> **Note**: Configuration is an array of parameters. For more details, see section [Default configuration](#default-configuration).

#### Method 2

```php
$converter = new Xml2Array($config);
$array     = $converter->convertFrom($inputXml)->toArray();
```

#### Method 3

```php
$converter = new Xml2Array;
$array     = $converter->setConfig($config)->convertFrom($inputXml)->toArray();
```

### Get configuration
If we implemented the conversion process using methods 2 and 3, we can get configuration of the conversion with method:

```php
$config = $converter->getConfig();
```

### Default configuration

#### For Xml2Array

```php
$defaultConfig = [
    'version'          => '1.0',         // Version of XML document
    'encoding'         => 'UTF-8',       // Encoding of XML document
    'standalone'       => null,          // Standalone directive for XML document
    'attributesKey'    => '@attributes', // The key name use for storing attributes of node
    'cdataKey'         => '@cdata',      // The key name use for storing value of Cdata Section in node
    'valueKey'         => '@value',      // The key name use for storing text content of node
    'namespacesOnRoot' => true           // Collapse all the namespaces at the root node, otherwise it will put in the nodes for which the namespace first appeared.
];
```

#### For Array2Xml

```php
$defaultConfig = [
    'version'       => '1.0',         // Version of XML document
    'encoding'      => 'UTF-8',       // Encoding of XML document
    'standalone'    => null,          // Standalone directive for XML document
    'attributesKey' => '@attributes', // The key name use for storing attributes of node
    'cdataKey'      => '@cdata',      // The key name use for storing value of Cdata Section in node
    'valueKey'      => '@value',      // The key name use for storing text content of node
    'rootElement'   => null,          // The name of root node will be create automatically in process of conversion
    'keyFixer'      => true,          // The automatically key normalization will be used during conversion. It can be bool|string|numeric|callable
];
```

### Effect of configuration settings

#### version

| Use in               | Data type |
| -------------------- | --------- |
| Xml2Array, Array2Xml | string    |

**Effect**: This setting allows specifying the XML version to be generated (in Array2Xml), or reconstructed from the XML string (in Xml2Array)

#### encoding

| Use in               | Data type |
| -------------------- | --------- |
| Xml2Array, Array2Xml | string    |

**Effect**: This setting is to indicate the encoding type of the XML to be generated (in Array2Xml), or reconstructed from the XML string (in Xml2Array)

#### standalone

| Use in               | Data type |
| -------------------- | --------- |
| Xml2Array, Array2Xml | null|bool |

**Effect**: This setting is to allow the `standalone` directive to appear in the XML or not. If it is set to `null`, this directive will not appear.

**Example**:

```php
$xml = Array2Xml::convert($array, [
    'standalone' => true
])->toXml(true);
```

Content in $xml will be

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
...
```

#### attributesKey, cdataKey, valueKey

| Use in               | Data type |
| -------------------- | --------- |
| Xml2Array, Array2Xml | string    |

**Effect**: This setting allows the use of special keywords to contain the values of properties, CDATA section... during the conversion process.

**Example**: Please review the examples above for more detailed understanding.

#### namespacesOnRoot

| Use in    | Data type |
| --------- | --------- |
| Xml2Array | bool      |

**Effect**: This setting allows to collect all the parsed XML namespaces and place them in the root node. If it is set to `false`, the namespaces will be located at the nodes where it is declared.

**Example**: We use the `Example 1` above again, but this time the configuration is different:

```php
$array = Xml2Array::convert($xmlString, [
    'namespacesOnRoot' => false
])->toArray();
```

After running this piece of code `$array` will contain:

```php
$array = [
    "root_node" => [
        "tag"           => "Example tag",
        "attribute_tag" => [
            "@value"      => "Another tag with attributes",
            "@attributes" => [
                "description" => "This is a tag with attribute"
            ]
        ],
        ...
        "example:with_namespace" => [
            "@attributes" => [
                "xmlns:example" => "http://example.com"
            ]
            "example:sub" => "Content"
        ],
    ]
]
```

You see, the `xlmns:example` namespace is put at the `example:with_namespace` key, not at `root_node` as it was originally.

#### rootElement

| Use in    | Data type |
| --------- | --------- |
| Array2Xml | string    |

**Effect**: According to the Well-formed XML standard, the XML content is only allowed to have a single Root node. This setting allows to wrap all the elements of the original array into a single root node, instead of having to manually edit your array.

#### keyFixer

| Use in    | Data type                    |
| --------- | ---------------------------- |
| Array2Xml | bool|string|numeric|callable |

**Effect**:

According to the Well-formed XML standard, the tag names and attributes must satisfy a number of requirements, in which naming is specified as follows:

- Only allowed to start with aphabet characters and underscore.
- Only accept the `[a-zA-Z]`, `-`, `_`, `.`, `:` characters. In which, the `:` is used to indicate the namespace prefix.
- Do not allow to end with `:`

During conversion, array key names that violate these rules are automatically normalized. If you do not agree to this normalization, set this setting to `false`.

By default, this normalization replaces invalid characters with underscores (`_`). You can change to another character as you like.

**Example**:

```php
// Do not use the key normalization
$xml = Array2Xml::convert($array, [
    'keyFixer' => false
])->toXml();

// Use the key normalization with default character (_)
$xml = Array2Xml::convert($array, [
    'keyFixer' => true
])->toXml();

// Replace with '---'
$xml = Array2Xml::convert($array, [
    'keyFixer' => '---'
])->toXml();

// Use a callable for fixing
$xml = Array2Xml::convert($array, [
    'keyFixer' => function ($key) {
        $key = str_replace('/', '_', $key);
        $key = str_replace('\\' , '.', $key);

        return $key;
    }
])->toXml();
```

# License
[MIT](LICENSE) © Jackie Do

repository: JackieDo/Xml-Array

gha_language: PHP

repo_name: JackieDo/Xml-Array


text:
---
title: "Marketing channels based on your strengths & preferences"
created_at: 2020-07-07T21:18:25.000Z
published_at: 2020-07-11T00:11:21.000Z
---
Building on what [@keenencharles posted](https://cowriters.app/words/marketing-yourself-425275f03f4bc30d19):

For products, I've had more success focusing on marketing channels that fit my interests. SEO, email, and social media aren't as dependent on personal networks so it's felt more natural to me to pursue those. For myself, can the equivalent work? What are the marketing channels that suit my personality? Instead of forcing myself to do things I have zero interest in like writing tutorials I can find ways that work for me.

I really like that idea he put out. That there might be some marketing channels that suit me more than others. I kind of always seen marketing as this whole block of activities that I generally not enjoyed doing. But reading his post made me think. Perhaps, just like how SEO, email and social media felt more natural for him to pursue as they aren't dependent on personal networks, what might be the marketing channels that would leverage on and fit my interests, strengths, personality?

Out of say, [51 marketing channels](https://blogs.spectrio.com/51-most-effective-marketing-channels-for-advertising-your-business) listed in this article, what might be great for me? First, let's list them out:

**? Internet marketing -** website, SEO, retargeting (ads), newsletter, live chat, podcast, whitepapers, webinars, blogging, guest blogging, search engine marketing (PPC ads), chat bots, AR/VR

**? Social media channels -** Facebook page, Facebook group, Facebook ads, LinkedIn page, Google business profile, Youtube channel, Yelp profile, custom graphics/content, Twitter, Instagram, livestreaming, influencers

**? Physical marketing -** exterior signage, digital signage, interactive signs, customer loyalty rewards, giveaways, promotions, brochures, packaging, overhead messages, free consultations, on-hold messaging

**? Paid advertising -** podcast ads, affiliate marketing, Nextdoor (what's this??), billboards, mailers, print ads, radio ads, social media ads, TV ads

**? Public relations -** press releases, media interviews, sponsorships, speaking events, conferences, self-hosted events

So coming back to the question, which channels are great for me? For someone who:

*   a solo indie hacker without a PR team nor huge budget
*   doesn't have a huge network online and offline
*   no screen personality, disinterested in media glare, prefers to stay out of limelight or being on stage in real life or digital (like influencers)
*   makes digital products and prefers the scalability of digital marketing
*   prefers things done remotely instead of face-to-face
*   can write content but finds it time-consuming and prefers building

So looking at my preferences and assets, the best marketing channels seems to be:

**? Internet marketing -** website, SEO, retargeting (ads), newsletter, live chat, (ghost/irregular) blogging, guest blogging, search engine marketing (PPC ads), chat bots

**? Social media channels -** Facebook page, Facebook group, Facebook ads, LinkedIn page, Google business profile, custom graphics/content, Twitter

**? Physical marketing -** customer loyalty rewards, giveaways, promotions (all digital, without a high budget)

**? Paid advertising -** affiliate marketing, social media ads

**? Public relations -** maybe an occasional public speaking event or conference, but only very very rarely, and something that I'm dying to share

It's interesting to see how the recurring themes on my preferred marketing channels seems to be more software-based, automated, scalable via other platforms, and network effects from customers. Great! Time to experiment!


text:
---
layout: post
title: The Inspection Paradox
categories: []
tags: []
description: Why does the bus always seem to take longer than the advertised waiting time?
published: true
fullview: false
comments: true
author: Yong Jian
image: /assets/images/communication-4871207.jpg
---

Bit of a lighter post after the MCMC series. Came across this article on the waiting time paradox, and I thought it would be a good chance to dosomething light-hearted amidst this COVID outbreak.

We all know that gnawing irritation we feel when, somehow, things are not as rosy as advertised. Bus schedules say that buses come every 10 minutes on average, but why does it always feel like you just missed the bus? Schools say that their average class size is around 20, but how do you always end up in a sardine-packed class? Why do your friends on Facebook always have more friends than you do?

![jpg](/assets/article_images/2020-04-02-the-inspection-paradox_files/Singapore-Bus-Stop-Poster-Guide.jpg)

Welcome to the inspection paradox, or as the cited post puts it, the "why is my bus always late" paradox.

### What is the inspection paradox?
The inspection paradox occurs when the probability of observing a quantity is related to the quantity being observed. This definition is pretty convoluted on it's own, so let's talk about an intuitive example - class size.

Imagine a university cohort of 100 students with 3 different classes in each semester. Class 1 has 70 students, class 2 has 20, and class 3 has 10. From the university's perspective, the average class size is a straightforward $$\frac{100}{3} = 33$$.

What happens if the students are surveyed? Now the story is completely different! By definition, the class size of 70 is experienced by 70 students, which biases the sample average! Instead of $$\frac{100}{3} = 33$$, we now have a weighted average of class size $$(0.7 \cdot 70) + (0.2 \cdot 20) + (0.1 \cdot 10) = 54$$ instead.

In other words, the probability of an individual observing a class size of 70 is directly related to the probability of him/her being in that class!

### Seeing this in practice
Let's see this for ourselves using a very relatable example: bus arrival timings. First, let's simulate the arrival time of 100000 bus arrivals with 10 minutes as the average waiting time between buses. The timeline below shows the first 10 simulated bus arrivals assuming the arrivals are random.

```python
import numpy as np
import matplotlib.pyplot as plt
simulated_bus_count = 100000
time_between_buses = 10
random = np.random.RandomState(1)
bus_arrival_times = simulated_bus_count * time_between_buses * np.sort(random.random(simulated_bus_count))

fig, ax = plt.subplots()
plt.plot(bus_arrival_times[:10], [0]*10, '-o', color = 'blue')
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
tmp = 1
for i in range(10):
    ax.annotate(round(bus_arrival_times[i], 1), (bus_arrival_times[i], 0.01*tmp))
    tmp *= -1
plt.yticks([])
plt.title(f'Time of Bus Arrivals ({time_between_buses} minute average)')
plt.show()
```

![png](/assets/article_images/2020-04-02-the-inspection-paradox_files/2020-04-02-the-inspection-paradox_1_0.png)

Great! Let's just make sure that, on average, the time between arrivals is 10 minutes.

```python
np.diff(bus_arrival_times).mean()
```
> 9.999899149741081

Next, we simulate the arrival of passengers randomly along this range.

```python
random = np.random.RandomState(123)
num_passengers = 100000

# Get passenger arrival time
passenger_arrival_times = simulated_bus_count * time_between_buses * np.sort(random.random(num_passengers))

fig, ax = plt.subplots()
plt.plot(bus_arrival_times[:20], [0]*20, '-o', color = 'blue')
plt.plot(passenger_arrival_times[:10], [0]*10, '-o', color = 'red')
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['left'].set_visible(False)
tmp = 1
for i in range(0, 20, 3):
    ax.annotate(round(bus_arrival_times[i], 1), (bus_arrival_times[i], 0.01*tmp))
    ax.annotate(round(passenger_arrival_times[i], 1), (bus_arrival_times[i], 0.01*-tmp))
plt.yticks([])
plt.title(f'Time of Bus and Passenger Arrivals')
plt.show()
```

![png](/assets/article_images/2020-04-02-the-inspection-paradox_files/2020-04-02-the-inspection-paradox_5_0.png)

We overlay our randomly generated passengers on our bus timeline. Using the np.searchsorted() function, we input the array of bus and passenger arrivals, and the function returns an `index` of bus_arrival_times for which inserting each passenger_arrival_times[i] preserves the ordering of the array. Since side = 'right', it returns the largest possible value of the index, or the nearest possible bus arrival for each passenger. Using this, we compute the average waiting time for each passenger.

```python
i = np.searchsorted(bus_arrival_times, passenger_arrival_times, side='right')
average_waiting_time = (bus_arrival_times[i] - passenger_arrival_times).mean()
print(average_waiting_time)
```
> 10.061306085620576

This is a surprising result! Although the average time between buses is 10 minutes, passengers experience a 10 minute waiting time on average instead of 5mins, which you would expect if you can arrive randomly at any time between 2 buses.

Like the class size example above, this result arises because you have a higher chance of 'catching' in a time period where the time between buses is large (since it takes up a longer stretch of the number line), and this biases average waiting time upwards!

### Conclusion
This was a really interesting result to me, because it's a prime example of how our statistical heuristics can end up working horrendously. Yes, I know that bus arrivals don't actually follow a uniform distribution, but I found this instructive an example to illustrate the problem of our heuristics in statistical reasoning.

*Based on a blog post by [Jake VanderPlas](http://jakevdp.github.io/blog/2018/09/13/waiting-time-paradox/)*


text:
---
title: Projects
description: How to manage Brigade Projects
section: project-developers
weight: 1
aliases:
  - /projects
  - /topics/projects.md
  - /topics/project-developers/projects.md
---

In Brigade, a project is a conceptual grouping of event subscriptions paired
with logic expressing how to handle those events.

This document explains how to create and manage projects in Brigade.

## An Introduction to Projects

Brigade projects provide the necessary context for executing Brigade scripts.
In addition to event subscriptions, they also specify the configuration of the
worker in charge of running the event handler logic.

Often times, a Brigade Project will point to an external VCS repository, in
which case this configuration will also be a part of the project definition.
The purpose of this feature is to make it easy to inject source code from a
repository into a Brigade pipeline, and do so in a way that meets standard
expectations about file versioning and storage.

Because GitHub is massively popular with open source developers, we chose to
focus on GitHub as a first experience. However, this document explains how to
work with other Git services, and how to extend Brigade to work with other VCS
systems.

## Creating and Managing a Project

Before we can create a Brigade project, we need to define the project itself.
We will discuss the project definition file and then explore how to create and
manage a project from on a given definition file.  If you'd like to skip ahead
and learn how to streamline project creation via the `brig init` command,
proceed to the [brig init section] below.

[brig init section]: #brig-init

### Project definition files

Brigade project definition files are represented in YAML or JSON and follow a
schema that will look familiar to users who have dealt with Kubernetes
manifests - however, they are their own entities and are only understood by
Brigade and the brig CLI.

This approach allows users of Brigade to persist project configuration in a VCS
of their choice.  Updating a pre-existing project is as easy as supplying the
updated configuration to the corresponding brig command.

As an example, let's look at a project definition expressed in YAML and break
it down into its main sections:

```yaml
apiVersion: brigade.sh/v2
kind: Project
metadata:
  id: hello-world
description: Demonstrates responding to an event with brigadier
spec:
  eventSubscriptions:
  - source: brigade.sh/cli
    types:
    - exec
  workerTemplate:
    logLevel: DEBUG
    defaultConfigFiles:
      brigade.js: |
        const { events } = require("@brigadecore/brigadier");

        events.on("brigade.sh/cli", "exec", async event => {
          console.log("Hello, World!");
        });

        events.process();
```

There are three high-level sections in the definition above.  They are:

  1. Project metadata, including:
    i. The `apiVersion` of the schema for this project
    ii. The schema `kind`, which will always be `Project`
    iii. The `id`, or name, of the Project
    iv. A `description` of the project
  2. The `eventSubscriptions` configuration, which contains one event source
    (`brigade.sh/cli`) and one type under that source (`exec`). This particular
    configuration corresponds to events that arise from `brig event create`
    commands.
  3. The `workerTemplate`, which represents the configuration for the worker in
    charge of running the script associated with this project. This particular
    configuration has `logLevel` set to `DEBUG` and the `brigade.js` script for
    this project defined in-line under `defaultConfigFiles`. We'll discuss
    similar scripts in more detail in the [Scripting Guide], but for now we see
    that this script imports the `events` object from the brigadier library and
    declares an event handler for the event source/type combination mentioned
    above.  In response to such events, it prints "Hello, World!" to the
    console.

For further examples of project definition files to help you get started, see
the [examples directory].  Each example sub-directory will have a
`project.yaml` file - this is the project definition file with configuration to
that specific project.

[examples directory]: ./examples
[Scripting Guide]: /topics/scripting

### Brig init

To quickly bootstrap a new project, Brigade offers the `brig init` command. It
will generate a new project definition file based on the options provided,
which can then be used to create the project in Brigade.

For example, to initialize a project named `myproject` with default settings,
which includes TypeScript as the scripting language and no git configuration,
run the following:

```shell
$ brig init --id myproject
```

Or, if the alternate scripting language option of JavaScript is preferred, run:

```shell
$ brig init --id myproject --language js
```

If the project is git-based, supply the git repository name where the Brigade
script for this project will reside:

```shell
$ brig init --id myproject --git https://github.com/<org>/<repo>.git
```

A few assets will be created in the directory in which the command is run.
The bulk of the generated files can be found in the `.brigade/` directory,
including the project definition file (`project.yaml`), a secrets file
(`secrets.yaml`) and a `NOTES.txt` file with next steps.  Additionally, a
`.gitignore` file is created (or amended, if it already exists) to ensure that
the secrets file and script dependencies are not tracked in version control.

### The `brig project create` Command

With a project definition file in hand, you're now ready to create the project
with brig. For purposes of demonstration, let's say the `project.yaml` file
exists in the same directory as the command being run:

```shell
$ brig project create --file project.yaml
```

This command will submit the project definition to Brigade's API server. After
validating that the definition adheres to the project schema, Brigade will
persist the project on the substrate (in the form of a unique namespace) and in
the backing database.

### Update a project

You can update a project at any time with the following command:

```shell
$ brig project update --file project.yaml
```

### Delete a project

To delete a project, run:

```shell
$ brig project delete --id myproject
```

### Listing and inspecting projects with `brig`

You can list all projects via:

```shell
$ brig project list
```

You can also directly inspect your project with `brig project get`. To see the
full project definition, add `--output [yaml|json]`:

```shell
$ brig project get --id myproject --output yaml
```

### Additional project management commands

To manage project secrets, the `brig project secret` suite of commands can be
used. For example, to set secrets for a project via a secrets file, run:

```shell
$ brig project secret set --file secrets.yaml
```

To explore different ways to manage secrets in Brigade, see the [Secrets] doc.

To manage roles for a project, see the `brig project roles` suite of commands.
Roles can be created, listed and revoked. For an overview on roles and
authorization in general, see the [Authorization] doc.

[Secrets]: /topics/project-developers/secrets
[Authorization]: /topics/administrators/authorization

## Project namespaces

Brigade creates a unique namespace on the underlying substrate (Kubernetes)
corresponding to each project. Although most users shouldn't have a need to
inspect resources under a project namespace on the substrate, to see which
unique namespace a project is assigned, run the `brig project get` command and
note the `kubernetes.namespace` value.  For example:

```plain
$ brig project get --id hello-world --output yaml

apiVersion: brigade.sh/v2
description: The simplest possible example
kind: Project
kubernetes:
  namespace: brigade-97cd352f-90e1-48d0-8797-4f7867a72bd3
metadata:
  created: "2021-08-11T17:47:07.555Z"
  id: hello-world
spec:
  eventSubscriptions:
  - source: brigade.sh/cli
    types:
    - exec
  workerTemplate:
    defaultConfigFiles:
      brigade.js: |
        console.log("Hello, World!");
    logLevel: DEBUG
    useWorkspace: false
```

## Git-based projects

### Using SSH Keys

You can use SSH keys and a `git+ssh` URL to secure a private repository.

In this case, your project's `cloneURL` should be of the form
`git@github.com:<org>/<repo>.git` and you will need to add the SSH
_private key_ as a secret to the project with the key `gitSSHKey`.

For example, if project secrets are contained in a `secrets.yaml` file, the
private key would be added like so:

```yaml
gitSSHKey: |-
  <REDACTED_PRIVATE_KEY>
```

The project secrets can then be updated via the usual brig command:

```shell
$ brig project secrets set --file secrets.yaml
```

### Using other Git providers

Brigade ships with generalized Git support, so use of repositories from any Git
provider should be possible on a Brigade project.

You must ensure, however, that the Kubernetes cluster hosting Brigade can
access the Git repository over the network via the URL provided in `cloneURL`.

To subscribe a Git-based project to events from a corresponding provider, a
[Gateway] is necessary. Brigade currently has gateway support for [GitHub] and
[BitBucket]. See the [Gateways] doc for further info.

[Gateway]: /topics/operators/gateways
[GitHub]: https://github.com/brigadecore/brigade-github-gateway
[BitBucket]: https://github.com/brigadecore/brigade-bitbucket-gateway/tree/v2
[Gateways]: /topics/operators/gateways

repository: lukepatrick/brigade

repo_name: lukepatrick/brigade


text:
## SilverStripe Porter

[![Build Status](https://travis-ci.org/fspringveldt/silverstripe-porter.svg?branch=master)](https://travis-ci.org/fspringveldt/silverstripe-porter)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fspringveldt/silverstripe-porter/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fspringveldt/silverstripe-porter/?branch=master)
[![Code coverage](https://codecov.io/gh/fspringveldt/silverstripe-porter/branch/master/graph/badge.svg)](https://codecov.io/gh/fspringveldt/silverstripe-porter)
[![License](https://poser.pugx.org/silverstripe/porter/license)](https://packagist.org/packages/silverstripe/porter)
[![Total Downloads](https://poser.pugx.org/silverstripe/porter/downloads.svg)](https://packagist.org/packages/silverstripe/porter)

SilverStripe Porter (think kitchen porter) seeks to automate several menial tasks for the SilverStripe framework via cli.

Tasks currently supported:
* Creating a new module

## Installation
It is recommended to install globally using composer

```sh
composer require global silverstripe/porter dev-master
```

After installation, create a symlink as follow (Note, adapt this command to your OS):

```sh
ln -s ~/.composer/vendor/silverstripe/porter/silverstripe ~/.composer/bin/silverstripe
```

Reloading your profile (`source ~/.bash_profile`) means you can now run `silverstripe` to view the help menu.

## Usage

### Creating a new module

The full command with all options is:

```sh
silverstripe create-module [--nonVendor] [--ss3] [--withTravisCI] [--withCircleCI] [--] <module-name> <module-namespace> [<module-path>]
```
* **--nonVendor** option adds `type: silverstripe-module` to your composer.json. This defaults to `type: silverstripe-vendormodule`
* **--ss3** option sets your module up with a base skeleton for an SilverStripe 3 module
* **--withTravisCI** adds minimal a travis.yml setup file
* **---withCircleCI** adds a minimal CircleCI config file to a .circleci folder

Example usage:
```
silverstripe create-module --withTravisCI foo/bar Foo\\\\Bar\\\\
```

## Bugtracker
Bugs are tracked on [github.com](https://github.com/fspringveldt/silverstripe-porter/issues).

## Development and Contribution
If you would like to make changes to this module, go on then, raise a PR via GitHub.

## Links
* [Bugtracker](https://github.com/fspringveldt/silverstripe-porter/issues)
* [License](./LICENSE)

## Credits
* Ingo Schommer - https://github.com/chillu
* Robbie Averill - https://github.com/robbieaverill

repository: fspringveldt/silverstripe-porter

repo_name: fspringveldt/silverstripe-porter


text:
# Exercise 2
In this exercise, you'll practice working with data frames and asking questions of them.

To complete the exercise, open the `exercise-2/exercise.R` file in RStudio, and follow the instructions there.

repository: sparkoparko/book-exercises

repo_name: sparkoparko/book-exercises


text:
# it-profile-generator

Generates a CV/Resume (in Germany usually called 'profile') for an IT freelancer.

A Mobile Web Application can display the data of the profile / CV.

## Why?

Freelancers have to provide detailed profiles of their knowledge and work experience when they want to apply for a
job or a project.

Unfortunately the companies demand for profiles in different formats and languages. Maintaining such a profile is
tedious work.

This collection of scripts convert a single XML file of input into different output documents.

## Supported Formats

  * HTML (Classic Version 4 for Desktop Browsers - sorry for formatting with `<table>`)
  * html5 (a [jQuery Mobile](http://jquerymobile.com/) Smartphone/Tablet touch-enabled application)
  * PDF
  * TXT (useful for some IT-profile hosting providers, especially for the list of projects / work experience)
  * JSON (to be used by Smartphone applications)
  * vCard
  * PNG (QR-Code of vCard)

Hopefully coming soon (you can contribute!):

  * DOC (MS-Word 97/2003)

    If you need your resume in Word format, open the HTML page with Internet Explorer, select all (`<Ctrl>+A`)
    and paste it into a new Word document (`<Ctrl>+V`). This will produce a quite suitable document.
    I've tested this with Word 2010, Windows 7, IE 9. Other Versions might crash or produce horrible output ;-)
  * ODT (Open Document Text, readable by new MS-Word and OpenOffice/LibreOffice)
  * html5 (a [Sencha Touch](http://www.sencha.com/products/touch/) Smartphone/Tablet touch-enabled application)

## Example Output

  * Output: <http://www.goebl.com/profiles/hgoebl/>
  * Mobile App: <http://m.goebl.com/> (will redirect to <http://www.goebl.com/m/jqm/?hgoebl>)

The Mobile App should not work with old or trouble-making browsers (you know what I M$ean).

## Getting Started

**By now the generator is only tested under Linux and Windows/Cygwin.
Native Windows support should'nt be a problem for a DOS-Command-Scripter ;-).
iOS will not be supported by me, unless Apple is sponsering an iMac to me - help needed!**

  * Java Runtime Environment must be installed (1.6 recommended)
  * Download [Apache FOP](http://xmlgraphics.apache.org/fop/).
    Alternatively you can use the packaged version from your Linux distribution, e.g.

        sudo apt-get install fop
    I've tested with 0.95 and 1.0. Don't know why, but I'd prefer 1.0.
  * Download and install [Node.js](http://nodejs.org/)
    I've tested with 0.4.x so far, 0.6.x should work well; Tell me, if not!
  * //Optional: Download/install qrencode

        sudo apt-get install qrencode

  * Windows Users can use <http://code.google.com/p/qrencode-win32/>, the executable name is `qrcode.exe`

  * Clone this project (of course you can fork it) and change to its directory
  * Copy the example setenv script and adopt it to your installation.
    If fop and node is in your PATH, just set NODE=node and FOP=fop.
    If not, you have to find out the location of the programs.

        cp setenv-example.sh setenv.sh
        chmod u+x setenv.sh
        # edit the freshly created setenv.sh
        $EDITOR setenv.sh

  * Download and install Node module dependenies
    (Windows/Cygwin-Users: run `npm` in a DOS-Shell. It is said that npm sometimes hangs in Cygwin shell.)

        cd node-app
        npm install
        cd ..

First an initial generation script has to be executed (like make but w/o make):

    ./generate-i18n.sh

Now you should be able to run the generator script:

    ./generate.sh sample-multilang

or (much longer)

    ./generate.sh hgoebl

Warnings like the following can be ignored (come from .rtf generation where the number of pages cannot be computed):

<pre>
    Jan 3, 2012 10:31:42 AM org.apache.fop.events.LoggingEventListener processEvent
    WARNING: Ignored deferred event for org.apache.fop.fo.flow.PageNumberCitationLast@2b12e7f7[@id=] (start). (See position 1:1945)
</pre>

After the generation of different output formats and languages works with your environment, you can create your own
profile.

  * Choose a name for your new profile (should obey `/[A-Za-z0-9-_]/`, dot is not ideal and could cause
    trouble, spaces and non-ASCII characters are evil).
    For this example, lets assume you chose `michaelj` as your name.

  * Choose whether you want to create a profile in different languages or only one language.
    It's not very complicated to switch from single to multi or vice versa. To he honest, it's easier to switch
    from multi to single, so in case of doubt begin with the multi-language profile.

### Multi-Language Profiles

  * Call the create script for multiple languages:

        ./create-profile-multilang.sh michaelj

  * Change to the new directory and edit your profile:

        cd profiles/michaelj

  * Edit the profile with your favorite XML editor. If desired, I can provide a XSD for it.

        $EDITOR michaelj.multilang.xml

  * Adopt the languages you want to support (each line contains a simple language code, like 'en', 'de', 'nl', 'fr').
    Don't append empty lines or spaces before or after the language code, this could lead to unexpected results.

        $EDITOR supported-languages.txt

### Single-Language Profiles

  * Call the create script for only one language:

        ./create-profile-singlelang.sh michaelj

  * Change to the new directory and edit your profile:

        cd profiles/michaelj

  * Edit the profile with your favorite XML editor. If desired, I can provide a XSD for it.

        $EDITOR michaelj.xml

### Generating Output

  * Generate your profile (it can cause problems if you have Acrobat Reader open while re-generating a PDF)

        ./generate.sh michaelj

  * You should find generated files in the profiles/michaelj folder.

## License

See MIT-LICENSE.txt.

## Contributing

I'd appreciate your contribution. I'm afraid especially the translation to English is far below optimum.
If you're not so familiar with Github/git, you can send mails to me (my mail address is in profiles/hgoebl/hgoebl.multilang.xml).

The easiest way to help is by reporting bugs and/or mail whishes. Don't hesitate!

## Add Support for Additional Languages

Edit `xslt/i18n.xml` and create entries for the new language.

If the format of the postal address differs from `{{city}} {{zip}}`, you should edit `xslt/i18n-support.xsl`
and add the format for your language. (Of course language is not equal to country, so selecting the postal format upon
the language is not the most clever solution.)

After that the script `./generate-i18n.sh` must be executed.
If translations for keys are missing, the key will be used instead of the value.

I would be happy if you shared your work with us!
If you don't want to clone/fork/... send me the file by mail.

## TODO and Known Bugs

See TODO.md

## Credits

Thanks for your help:

  * Thomas Siedschlag (Testing/Adaption to Windows/Cygwin, improvements in XSLT scripts)

This is only a collection of software used:

  * [jQuery Mobile](http://jquerymobile.com/)
  * [jQuery - write less, do more](http://jquery.com/)
  * [Debian GNU/Linux](http://www.debian.org/)
  * [The Apache Software Foundation](http://www.apache.org/)
  * [Node.js](http://nodejs.org/)
  * [Mustache - Logic-less templates](http://mustache.github.com/)
  * [FAMFAMFAM icons by Mark James](http://www.famfamfam.com/)
  * Modules for Node: async, optimist, sax, underscore, wordwrap, xml2js

repository: hgoebl/it-profile-generator

gha_language: JavaScript

repo_name: hgoebl/it-profile-generator


text:
---
layout: default
---

# 1995-08-01 - [NOISE] was Re: a hole in PGP

## Header Data

From<EMAIL_ADDRESS>(SysAdmin)

To<EMAIL_ADDRESS>(Dr. Frederick B. Cohen)

Message Hash: b923d3e15870f508339615ef39d4765bebdc9979719fefd75d9c5cde38529f2b

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1995-08-01 02:42:54 UTC

Raw Date: Mon, 31 Jul 95 19:42:54 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(SysAdmin)
Date: Mon, 31 Jul 95 19:42:54 PDT
To<EMAIL_ADDRESS>(Dr. Frederick B. Cohen)
Subject: [NOISE] was Re: a hole in PGP
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text

-----BEGIN PGP SIGNED MESSAGE-----

My response to Dr. Frederick B. Cohen:

I rarely write ANYTHING to the list unless I think it's absolutly
necessary and has a semblence of Crypto (keeps the SNR down).
I'm looking forward to doing something similar to the crack RC4
thing again.

For an individual that parades the title of Doctor (and the indication
of intelligence that title should imply) you seem to lack the grasp of what
has been stated over and over again. If you can't study the source code,
find somone that you trust that can! Prove it *doesn't* work before you
knock it.
Lastly, this interpretation of a threat from being added to a killfile
was the last straw.
Tell the FBI I sent the following Dr.Cohen :   PLONK!
I never play nice.

ObCypherpunk: Anybody heard from Detweiller?

[snipped]

> > You're testing my patience. Feeling flush from my New Orleans road trip, I
> > went out and bought the commercial version of Eudora, filter-feature and
> > all, which means I'm just itching to test it. In other words, it means you
> > are flirting with the kill-file, the bozo-filter, more rudely, a
> > <plonk!ing>.
>
> Ah!!! A threat.  You should be aware that threatening homocide is a form
> of assault.  I will be certain to tell the FBI your exact words...  "the
> kill-file, the bozo-filter, more rudely, a <plonk!ing>." sounds to me
> (and may well sound to them) like a threat to commit murder.
>
> > Play nice, Doc, or don't play at all.
>
> I am being nice, but you are not.  Perhaps you should consider
> addressing the issues.
>
> --
> -> See: Info-Sec Heaven at URL http://all.net
> Management Analytics -<PHONE_NUMBER> - PO Box 1480, Hudson, OH 44236
>

- --
==========================================================================
         PGP Public Keys: 1024/BEB3ED71 & 2047/D9E1F2E9 on request.
           As soon as any man says of the affairs of the state
    " What does it matter to me? " the state may be given up for lost.
                    J.J.Rousseau - The Social Contract
GAT/E/O d++@>- H--- s: a29 C+++$ UL++++($) P+>+++ L++>++++ E W+++ N++ K-
w---- O- M- V-- PS+ PE++ Y+ PGP+++ t 5+ X R* tv b++ DI++ D++ G++ e h+ r
y++ [Geek Code v3.0] a.k.a [<EMAIL_ADDRESS>/<EMAIL_ADDRESS>==========================================================================

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: Protect Your Privacy. Use PGP for all your E-mail security needs!

iQCVAwUBMB2UCLbmxeO+s+1xAQE4fAP/TbNWs17V0U8SVDpp6yaCFGnGelSt4mTL
rXFSChLRtiMq/TevfTi9xmDl0j0gDeXORcpQBWlDi0ZfoownpDxHJJab7u97KlB3
WFho1WGWMXU5kyz+g6HBayPHpckH035R4rmCvGZ1zw1qph2v9NzoDhR+8pTgkCYD
7bOQYV6CKMM=
=K1aG
-----END PGP SIGNATURE-----

{% endraw %}
```

## Thread

+ Return to [August 1995](/archive/1995/08)

+ Return to "["Ed Carp [khijol SysAdmin]" <erc@khijol.intele.net>](/authors/ed_carp_khijol_sysadmin_erc_at_khijol_intele_net_)"
+ Return to<EMAIL_ADDRESS>(Dr. Frederick B. Cohen)](/authors/fc_at_all_net_dr_frederick_b_cohen_)"
+ Return to<EMAIL_ADDRESS>(SysAdmin)](/authors/frenchie_at_magus_dgsys_com_sysadmin_)"
+ Return to "[Phil Fraering        <pgf@tyrell.net>](/authors/phil_fraering_pgf_at_tyrell_net_)"
+ Return to<EMAIL_ADDRESS>(Robert Hettinga)](/authors/rah_at_shipwright_com_robert_hettinga_)"

+ 1995-08-01 (Mon, 31 Jul 95 17:37:01 PDT) - [Re: a hole in PGP](/archive/1995/08/9fcd34607c510874480e2ce6451ba7871cd5733fc8573a4f6b51ab9b7bcfe86a) -<EMAIL_ADDRESS>(Robert Hettinga)_
  + 1995-08-01 (Mon, 31 Jul 95 18:10:12 PDT) - [Re: a hole in PGP](/archive/1995/08/6159db8177e9b5a341e46a7d7d61884c5768de30646308713d7535e195d3c243) -<EMAIL_ADDRESS>(Dr. Frederick B. Cohen)_
    + 1995-08-01 (Mon, 31 Jul 95 19:25:04 PDT) - [a hole in PGP](/archive/1995/08/2163a642887265152dd8ccb9cce33e55f4aac577cc0e0ae6cb197e16bc7a0686) - _Phil Fraering<EMAIL_ADDRESS>    + 1995-08-01 (Mon, 31 Jul 95 19:42:54 PDT) - [NOISE] was Re: a hole in PGP -<EMAIL_ADDRESS>(SysAdmin)_
      + 1995-08-01 (Mon, 31 Jul 95 20:04:22 PDT) - [Re: [NOISE] was Re: a hole in PGP](/archive/1995/08/698ffbcb73c39e626f8fdc69d283eb5ff337a4014c98631891ec8f854b9b04e4) -<EMAIL_ADDRESS>(Dr. Frederick B. Cohen)_
    + 1995-08-01 (Mon, 31 Jul 95 20:15:55 PDT) - [Re: a hole in PGP](/archive/1995/08/d8cefdd8559e82442348853fad234018064a786a61af1e5ae8ca91dcac60eecd) - _"Ed Carp [khijol SysAdmin]"<EMAIL_ADDRESS>


text:
---
title: Bootcamp - Visit the website and create your account
description: Bootcamp - Visit the website and create your account
jira: KT-5342
audience: Data Engineer, Data Architect, Marketer
doc-type: tutorial
activity: develop
solution: Journey Optimizer, Experience Platform
feature-set: Journey Optimizer, Experience Platform
feature: Events, Journeys, Profiles, Identities
exl-id: a56cedba-3ac4-4a9b-aeb8-8036c527a878
---
# 2.1 Visit the website and create your account

## Context

The journey from unknown to known is one of the most important topics amongst brands these days, as is the customer journey from acquisition to retention.

Adobe Experience Platform plays a huge role in this journey. Platform is the brains for communication, the **experience system of record**.

Platform is an environment in which the word customer is broader than just the known customers. An unknown visitor on the website is also a customer from Platform's perspective and as such, all of the behavior as an unknown visitor is also sent to Platform. Thanks to that approach, when this visitor eventually becomes a known customer, a brand can visualize what happened before that moment as well. This helps from an attribution and experience optimization perspective.

## Customer journey flow

Go to [https://bootcamp.aepdemo.net](https://bootcamp.aepdemo.net). Click **Allow All**. Based on your browsing behaviour in the previous user flow, you'll see personalization happen on the homepage of the website.

![DSN](./images/web8.png)

Click the Adobe logo icon in the top left corner of your screen to open the Profile Viewer. Have a look at the Profile Viewer panel and the Real-time Customer Profile with the **Experience Cloud ID** as the primary identifier for this currently unknown customer.

![Demo](./images/pv1.png)

You can also see all the Experience Events that were collected based on the customer's behaviour.

![Demo](./images/pv3.png)

Click the **Profile** icon in the top right corner of your screen.

![Demo](./images/pv4.png)

Click **Create an account**.

![Demo](./images/pv5.png)

Fill out all the fields of the form. Use a real value for email address and phonenumber, as it will be used in later exercises for delivery of email and SMS.

![Demo](./images/pv7.png)

Scroll down and click **Register**.

![Demo](./images/pv8.png)

You'll then see this.

![Demo](./images/pv9.png)

You'll also receive this email:

![Demo](./images/pv10.png)

And a couple of minutes later, you'll also receive this email:

![Demo](./images/pv11.png)

Let's see how this onboarding journey was configured next.

Next Step: [2.2 Create your event](./ex2.md)

[Go Back to User Flow 2](./uc2.md)

[Go Back to All Modules](../../overview.md)


text:
# Conversion Tracking

Conversion Tracking

Conversion tracking allows tracking conversions on programmatic campaigns that run on your DSP

For accurate tracking, &msxt=%msxt% (or ?msxt=%msxt%) is needed to be added to the click tracker and made transferrable to the landing page

repository: mediasmart/gtm-whitelabel

repo_name: mediasmart/gtm-whitelabel


text:
---
title: Component
layout: default
root: ./
---

The abstract base type of components of hw-widgets.
I use a word *abstract* because its tag name is unknown.

They are flex-item.

API
--------

### Inheritance

None.

### Properties

| name | type | default | description |
| ---- | -- | ----------- | ---- |
| tagName | string | - | tag name of the element |
| growable | boolean | `false` | Makes the size of the component's main axis variable.
Refer to [Layout](layout) for details. |
| align | string | `'stretch'` | `'start', 'end', 'center', 'stretch'`
`align-self` property of flex-item. |
| classes | object | `{}` | The object representing html classes. Refer to [bcs](common) for details. |
| m | integer\|Array\|null | null | Set the component's margin in five steps from 1 to 5. If an integer is given, the margins on all four sides will be the same. If a 4-element array is given, it is interpreted in the order of top, right, bottom and left. |

### Children

any.

repository: tyam/ha-widgets

repo_name: tyam/ha-widgets


text:
    A Landing page ReactJS for challenge to work with redemagic.

    Check the DEMO

## Built with

- React
- Typescript
- Styled components

## Getting started

1. `git clone https://github.com/pcampina/redemagic`
2. `$ yarn && yarn start`
3. `Access in your browser http://localhost:3000`

## Testing Requisites

- Click on "Awesome Apps" or "Try for free" links to see smooth scrolling
- A mobile phone in the top area contain Banner functionallity
- Enterely page is responsive
- Contact form area validated and masked for phone
- Return contact form is a simple alert (test purpose)

## License

[MIT license](https://opensource.org/licenses/MIT).

repository: pcampina/redemagic

repo_name: pcampina/redemagic


text:
# Rabman

A simple object oriented wrapper for the [RabbitMQ](https://www.rabbitmq.com) Management HTTP Api.

## Installation

Installable through composer via:

```
$ composer require iMega/rabbitmq-management-api
```

## Table of Contents

 * [Installation](#installation)
 * [Modificators](#modificators)
 * [Overview](#overview)
 * [Cluster](#cluster)
 * [Nodes](#nodes)
 * [Extensions](#extensions)
 * [Definition](#definition)
 * [Connections](#connections)
 * [Channels](#channels)
 * [Consumers](#consumers)
 * [Exchanges](#exchanges)
 * [Queues](#queues)
 * [Bindings](#bindings)
 * [Vhosts](#vhosts)
 * [Users](#users)
 * [Whoami](#whoami)
 * [Permissions](#permissions)
 * [Parameters](#parameter)
 * [Policies](#policies)
 * [Aliveness](#aliveness)
 * [License](#license)

### Modificators

 * sort
 * columns

`Sort` allows you to select a primary field to sort by, and second paramenter will reverse the sort order if set to true. The sort first parameter can contain subfields separated by dots. This allows you to sort by a nested component of the listed items; it does not allow you to sort by more than one field. See the example below.

```
$exchanges = $source->exchanges()->columns(['name'])->sort('name', true);
foreach ($exchanges as $item) {
    var_dump($item);
}
```

You can also restrict what information is returned per item with the columns parameter.

```
$exchanges = $source->exchanges()->columns(['name', 'vhost']);
foreach ($exchanges as $item) {
    var_dump($item);
}
```

[Back to TOC](#table-of-contents)

### Overview

Various random bits of information that describe the whole system.

```
$overview = $source->overview()->columns(['exchange_types.name']);
foreach ($exchanges as $item) {
    var_dump($item);
}
```

[Back to TOC](#table-of-contents)

### Cluster

Name identifying this RabbitMQ cluster.

```
$cluster = $source->cluster();
foreach ($cluster as $item) {
    var_dump($item);
}
```

and rename cluster
```
$source->cluster()->create(['name' => 'rabbit@my-rabbit']);
```

[Back to TOC](#table-of-contents)

### Nodes

A list of nodes in the RabbitMQ cluster.

```
$nodes = $source->nodes();
foreach ($nodes as $item) {
    var_dump($item);
}
```

An individual node in the RabbitMQ cluster.

```
$nodes = $source->nodes('my-node');
foreach ($nodes as $item) {
    var_dump($item);
}
```

[Back to TOC](#table-of-contents)

### Extensions

A list of extensions to the management plugin.

```
$extensions = $source->extensions();
foreach ($extensions as $item) {
    var_dump($item);
}
```

[Back to TOC](#table-of-contents)

### Definition

The server definitions - exchanges, queues, bindings, users, virtual hosts, permissions and parameters. Everything apart from messages.

```
$items = $source->definitions();
foreach ($items as $item) {
    var_dump($item);
}
```

Create to upload an existing set of definitions. Note that:

 * The definitions are merged. Anything already existing on the server but not in the uploaded definitions is untouched.
 * Conflicting definitions on immutable objects (exchanges, queues and bindings) will cause an error.
 * Conflicting definitions on mutable objects will cause the object in the server to be overwritten with the object from the definitions.
 * In the event of an error you will be left with a part-applied set of definitions.

```
$source->definitions()->create(<very-very-big-array>);
```

The server definitions for a given virtual host - exchanges, queues, bindings and policies.

```
$items = $source->definitions()->vhost('second_virtual_host');
foreach ($items as $item) {
    var_dump($item);
}
```

Create to upload an existing set of definitions for a given virtual host. Note that:

 * The definitions are merged. Anything already existing on the server but not in the uploaded definitions is untouched.
 * Conflicting definitions on immutable objects (exchanges, queues and bindings) will cause an error.
 * Conflicting definitions on mutable objects will cause the object in the server to be overwritten with the object from the definitions.
 * In the event of an error you will be left with a part-applied set of definitions.

```
$source->definitions()->vhost('second_virtual_host')->create(<very-very-big-array>);
```

[Back to TOC](#table-of-contents)

### Connections

A list of all open connections.

```
$connections = $source->connections();
foreach ($connections as $item) {
    var_dump($item);
}
```

A list of all open connections in a specific vhost.
```
$connections = $source->vhosts('second_virtual_host')->connections();
foreach ($connections as $item) {
    var_dump($item);
}
```

An individual connection.

```
$connections = $source->connections("<IP_ADDRESS>:35003 -> <IP_ADDRESS>:5672");
foreach ($connections as $item) {
    var_dump($item);
}
```

DELETEing it will close the connection.
```
$source->connections("<IP_ADDRESS>:35003 -> <IP_ADDRESS>:5672")->delete();
```

List of all channels for a given connection.

```
$connections = $source->connections("<IP_ADDRESS>:35003 -> <IP_ADDRESS>:5672")->channels();
foreach ($connections as $item) {
    var_dump($item);
}
```

[Back to TOC](#table-of-contents)

### Channels

A list of all open channels.

```
$items = $source->channels();
foreach ($items as $item) {
    var_dump($item);
}
```

A list of all open channels in a specific vhost.

```
$items = $source->vhosts('second_virtual_host')->channels();
foreach ($items as $item) {
    var_dump($item);
}
```

Details about an individual channel.

```
$items = $source->channels('channnel');
foreach ($items as $item) {
    var_dump($item);
}
```

[Back to TOC](#table-of-contents)

### Consumers

A list of all consumers.

```
$items = $source->consumers();
foreach ($items as $item) {
    var_dump($item);
}
```

A list of all consumers in a given virtual host.

```
$items = $source->consumers()->vhost('second_virtual_host');
foreach ($items as $item) {
    var_dump($item);
}
```

[Back to TOC](#table-of-contents)

### Exchanges

A list of all exchanges.

```
$exchanges = $source->exchanges();
foreach ($exchanges as $item) {
    var_dump($item);
}
```

A list of all exchanges in a given virtual host.

```
$exchanges = $source->exchanges()->vhost('second_virtual_host');
foreach ($exchanges as $item) {
    var_dump($item);
}
```

An individual exchange.

```
$exchanges = $source->exchanges('second.exchange')->vhost('second_virtual_host');
foreach ($exchanges as $item) {
    var_dump($item);
}
```

Create an exchange.

```
$source->exchanges('example.exchange')->vhost('second_virtual_host')->create([
    'type' => 'topic',
]);
```

When DELETEing an exchange you can add the options 'if-unused' => true. This prevents the delete from succeeding if the exchange is bound to a queue or as a source to another exchange.

```
$source->exchanges('example.exchange')->vhost('second_virtual_host')->delete([
    'if-unused' => true
]);
```

A list of all bindings in which a given exchange is the source.

```
$exchanges = $source->exchanges('second.exchange')->vhost('second_virtual_host')->bindings()->source();
foreach ($exchanges as $item) {
    var_dump($item);
}
```

A list of all bindings in which a given exchange is the destination.

```
$exchanges = $source->exchanges('second.exchange')->vhost('second_virtual_host')->bindings()->destination();
foreach ($exchanges as $item) {
    var_dump($item);
}
```

Publish a message to a given exchange. You will need the options looking something like:

```
$source->exchanges('second.exchange')->vhost('second_virtual_host')->publish([
    "properties"       => {},
    "routing_key"      => "my key",
    "payload"          => "my body",
    "payload_encoding" => "string",
]);
```
`"routed" => true` routed will be true if the message was sent to at least one queue.

[Back to TOC](#table-of-contents)

### Queues

A list of all queues.

```
$items = $source->queues();
foreach ($items as $item) {
    var_dump($item);
}
```

A list of all queues in a given virtual host.

```
$items = $source->queues()->vhost('second_virtual_host');
foreach ($items as $item) {
    var_dump($item);
}
```

An individual queue.

```
$items = $source->queues('name-queue')->vhost('second_virtual_host');
foreach ($items as $item) {
    var_dump($item);
}
```

To create a queue, you will need the parameters looking something like this (All keys are optional):

```
$source->queues('name-queue')->vhost('second_virtual_host')->create([
    "auto_delete" => false,
    "durable" => true,
]);
```

When DELETEing a queue you can add the query string parameters if-empty=true and / or if-unused=true. These prevent the delete from succeeding if the queue contains messages, or has consumers, respectively.

```
$source->queues('name-queue')->vhost('second_virtual_host')->delete([
    "if-empty" => true,
]);
```

A list of all bindings on a given queue.

```
$items = $source->queues('name-queue')->vhost('second_virtual_host')->bindings();
foreach ($items as $item) {
    var_dump($item);
}
```

Contents of a queue to purge.

```
$source->queues('example.queues')->vhost('second_virtual_host')->contents();
```

Actions that can be taken on a queue.

```
$source->queues('example.queues')->vhost('second_virtual_host')->actions([
	"action" => "sync"
]);
```
Currently the actions which are supported are sync and cancel_sync.

Get messages from a queue.

```
$items = $source->queues('name-queue')->vhost('second_virtual_host')->get([
    "count"    => 5,
    "requeue"  => true,
    "encoding" => "auto",
]);
foreach ($items as $item) {
    var_dump($item);
}
```
 * count controls the maximum number of messages to get. You may get fewer messages than this if the queue cannot immediately provide them.
 * requeue determines whether the messages will be removed from the queue. If requeue is true they will be requeued - but their redelivered flag will be set.
 * encoding must be either "auto" (in which case the payload will be returned as a string if it is valid UTF-8, and base64 encoded otherwise), or "base64" (in which case the payload will always be base64 encoded).
 * If truncate is present it will truncate the message payload if it is larger than the size given (in bytes).

truncate is optional; all other keys are mandatory.

Please note that the get path in the HTTP API is intended for diagnostics etc - it does not implement reliable delivery and so should be treated as a sysadmin's tool rather than a general API for messaging.

[Back to TOC](#table-of-contents)

### Bindings

A list of all bindings.

```
$items = $source->bindings();
foreach ($items as $item) {
    var_dump($item);
}
```

A list of all bindings in a given virtual host.

```
$items = $source->bindings()->vhost('second_virtual_host');
foreach ($items as $item) {
    var_dump($item);
}
```

A list of all bindings between an exchange and a queue.

```
$items = $source->bindings()->vhost('second_virtual_host')->exchange('name')->queue('name');
foreach ($items as $item) {
    var_dump($item);
}
```

Remember, an exchange and a queue can be bound together many times! To create a new binding, POST to this URI. You will need a body looking something like this:

```
$source->bindings()->vhost('second_virtual_host')->exchange('name')->queue('name')->create([
    "routing_key" => "my_routing_key",
    "arguments"   => [],
]);
```

An individual binding between an exchange and a queue. The props is a "name" for the binding composed of its routing key and a hash of its arguments.

```
$items = $source->bindings('props')->vhost('second_virtual_host')->exchange('name')->queue('name');
foreach ($items as $item) {
    var_dump($item);
}
```

and delete the binding

```
$source->bindings('props')->vhost('second_virtual_host')->exchange('name')->queue('name')->delete();
```

A list of all bindings between two exchanges. Similar to the list of all bindings between an exchange and a queue, above.

```
$items = $source->bindings()->vhost('second_virtual_host')->source('name')->destination('name');
foreach ($items as $item) {
    var_dump($item);
}
```

An individual binding between two exchanges. Similar to the individual binding between an exchange and a queue, above. The props is a "name" for the binding composed of its routing key and a hash of its arguments.

```
$items = $source->bindings('props')->vhost('second_virtual_host')->source('name')->destination('name');
foreach ($items as $item) {
    var_dump($item);
}
```

and delete

```
$source->bindings('props')->vhost('second_virtual_host')->source('name')->destination('name')->delete();
```

[Back to TOC](#table-of-contents)

### Vhosts

A list of all vhosts.

```
$items = $source->vhosts();
foreach ($items as $item) {
    var_dump($item);
}
```

An individual virtual host.

```
$items = $source->vhosts('name');
foreach ($items as $item) {
    var_dump($item);
}
```

A list of all permissions for a given virtual host.

```
$items = $source->vhosts('name')->permissions();
foreach ($items as $item) {
    var_dump($item);
}
```

[Back to TOC](#table-of-contents)

### Users

A list of all users.

```
$items = $source->users();
foreach ($items as $item) {
    var_dump($item);
}
```

An individual user.

```
$items = $source->users('name');
foreach ($items as $item) {
    var_dump($item);
}
```

To create a user, you will need the parameters looking something like this:

```
$source->users('name')->create([
    "password" => "secret",
    "tags"     => "administrator",
]);
```

or

```
$source->users('name')->create([
    "password_hash" => "2lmoth8l4H0DViLaK9Fxi6l9ds8=",
    "tags"          => "administrator",
]);
```

The tags key is mandatory. Either password or password_hash must be set. Setting password_hash to "" will ensure the user cannot use a password to log in. tags is a comma-separated list of tags for the user. Currently recognised tags are "administrator", "monitoring" and "management".

and delete a user

```
$source->users('name')->delete();
```

A list of all permissions for a given user.

```
$items = $source->users('name')->permissions();
foreach ($items as $item) {
    var_dump($item);
}
```

[Back to TOC](#table-of-contents)

### Whoami

Details of the currently authenticated user.

```
$items = $source->whoami();
foreach ($items as $item) {
    var_dump($item);
}
```

[Back to TOC](#table-of-contents)

### Permissions

A list of all permissions for all users.

```
$items = $source->permissions();
foreach ($items as $item) {
    var_dump($item);
}
```

An individual permission of a user and virtual host.

```
$items = $source->permissions()->vhost('second_virtual_host')->user('name');
foreach ($items as $item) {
    var_dump($item);
}
```

To create a permission, you will need the parameters looking something like this (All keys are mandatory):

```
$source->permissions()->vhost('second_virtual_host')->user('name')->create([
    "configure" => ".*",
    "write"     => ".*",
    "read"      => ".*",
]);
```

and delete a user

```
$source->permissions()->vhost('second_virtual_host')->user('name')->delete();
```

[Back to TOC](#table-of-contents)

### Parameters

A list of all parameters.

```
$items = $source->parameters();
foreach ($items as $item) {
    var_dump($item);
}
```

A list of all parameters for a given component.

```
$items = $source->parameters()->component('name');
foreach ($items as $item) {
    var_dump($item);
}
```

A list of all parameters for a given component and virtual host.

```
$items = $source->parameters()->vhost('second_virtual_host')->component('name');
foreach ($items as $item) {
    var_dump($item);
}
```

An individual parameter.

```
$items = $source->parameters('parameter-name')->vhost('second_virtual_host')->component('component-name');
foreach ($items as $item) {
    var_dump($item);
}
```

To create a parameter, you will need the parameters looking something like this:

```
$source->parameters('parameter-name')->vhost('second_virtual_host')->component('component-name')->create([
    "vhost"     => "/",
    "component" => "federation",
    "name"      => "local_username",
    "value"     => "guest",
]);
```

and delete a parameter

```
$source->parameters('parameter-name')->vhost('second_virtual_host')->component('component-name')->delete();
```

[Back to TOC](#table-of-contents)

### Policies

A list of all policies.

```
$items = $source->policies();
foreach ($items as $item) {
    var_dump($item);
}
```

A list of all policies in a given virtual host.

```
$items = $source->policies()->vhost('second_virtual_host');
foreach ($items as $item) {
    var_dump($item);
}
```

An individual policy.

```
$items = $source->policies('name-policy')->vhost('second_virtual_host');
foreach ($items as $item) {
    var_dump($item);
}
```

To create a policy, you will need the parameters looking something like this:

```
$source->policies('name-policy')->vhost('second_virtual_host')->create([
    "pattern"    => "^amq.",
    "definition" => [
        "federation-upstream-set" => "all"
    ],
    "priority"   => 0,
    "apply-to"   => "all",
]);
```

and delete a policy

```
$source->policies('name-policy')->vhost('second_virtual_host')->delete();
```

[Back to TOC](#table-of-contents)

### Aliveness

Declares a test queue, then publishes and consumes a message. Intended for use by monitoring tools. If everything is working correctly, will return `"status" => "ok"`

```
$items = $source->aliveness()->vhost('second_virtual_host');
foreach ($items as $item) {
    var_dump($item);
}
```

Note: the test queue will not be deleted (to to prevent queue churn if this is repeatedly pinged).

[Back to TOC](#table-of-contents)

### License

The MIT License (MIT)

Copyright (c) 2015 Dmitry Gavrilov<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: minhpascal/rabbitmq-management-api

repo_name: minhpascal/rabbitmq-management-api


text:
# flutter_storage_provider
![logo](https://flutter.dev/assets/flutter-lockup-c13da9c9303e26b8d5fc208d2a1fa20c1ef47eb021ecadf27046dea04c0cebf6.png)

Simple universal storage provider for many types of storage for Flutter & Flutter Web.

## About

This library is for storage provider for Flutter and Flutter Web.
It's able to get, store and delete JSON (Map) into the storage.

## Types

| Storage Type             | Description                                          | Import                                                                            |
|--------------------------|------------------------------------------------------|-----------------------------------------------------------------------------------|
| StorageNative            | Storage for native apps based on Sembast.            | ``import 'package:flutter_storage_provider/src/storage_native.dart';``            |
| StorageWeb               | Storage for web based on LocalStorage.               | ``import 'package:flutter_storage_provider/src/storage_web.dart';``               |
| StorageWebIndexedDB      | Storage for web based on IndexedDB.                  | ``import 'package:flutter_storage_provider/src/storage_web_indexeddb.dart';``     |
| StorageSharedPreferences | Storage for native & web based on SharedPreferences. | ``import 'package:flutter_storage_provider/src/storage_sharedpreferences.dart';`` |

## Usage

A simple usage example:

```dart
import 'package:flutter_storage_provider/flutter_storage_provider.dart';

main() {
  var storageweb = new StorageWeb();
  storageweb.get('test'); // Returns Map<String, dynamic>
}
```

## License

Everything is licensed under [BSD-3-Clause](./LICENSE), so you are free to use it.

## Creator / Developer

Design & Code was completely made by [Tristan Marsell](https://github.com/PDesire).

For any questions, you can ask on this repo by opening a new issue or otherwise ask the creator.


text:
<!--
Copyright 2021 Tamás Balog

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# JUnit

## @Test annotated method

The first template is a more generic one in which the whole method name can be customized at hand.
In my experience this works better with the keyword *test*.

```java
@org.junit.Test
public void $methodName$() {
    $code$
}
```

The other template populates the word *should* at the beginning of the test method, which could be something like
*shouldValidateJsonString*. The keyword *should* works better with the option because this way you can type the method name in
a more fluent way.

```java
@org.junit.Test
public void should$doSomething$() {
    $code$
}
```

### General configuration
- Abbreviation: *should*, *test*
- Scope: Java - declaration
- Options enabled: Reformat according to style, Use static import if possible, Shorten FQ names

## @Before and @BeforeClass annotated methods

```java
@org.junit.Before
public void before() {
    $code$
}
```

```java
@org.junit.BeforeClass
public void beforeClass() {
    $code$
}
```

### General configuration
- Abbreviation: *before*, *beforeClass*, *setup*
- Scope: Java - declaration
- Options enabled: Reformat according to style, Use static import if possible, Shorten FQ names

## @After and @AfterClass annotated methods

```java
@org.junit.After
public void after() {
    $code$
}
```

```java
@org.junit.AfterClass
public void afterClass() {
    $code$
}
```

### General configuration
- Abbreviation: *after*, *afterClass*, *teardown*
- Scope: Java - declaration
- Options enabled: Reformat according to style, Use static import if possible, Shorten FQ names

## Parameters method

```java
@org.junit.runners.Parameterized.Parameters
public static Iterable<Object[]> parameters() {
    return java.util.Arrays.asList(new Object[][]{
        {$parameter1$},
        {$parameter2$}
    });
}
```

### General configuration
- Abbreviation: *parameters*
- Scope: Java - declaration
- Options enabled: Reformat according to style, Shorten FQ names

repository: easysg/intellij-live-templates

repo_name: easysg/intellij-live-templates


text:
# Mind Media PhysioLOGX-4 plugin

This plugin provides a driver for the PhysioLOG-4 (PL4) device.

## Installation

First, make sure that the requirements are satisfied:

* Install the FTDI [D2XX driver](https://www.ftdichip.com/Drivers/D2XX.htm) for your platform.
* Install [Timeflux](https://github.com/timeflux/timeflux).

You can then install this plugin in the ``timeflux`` environment:

```
$ conda activate timeflux
$ pip install git+https://github.com/timeflux/timeflux_pl4
```