text:
---
theme: scottdoy
highlight-style: atelier-dune-light
transition: fade
slide-level: 2

author: Scott Doyle
contact<EMAIL_ADDRESS>title: Random Forests
subtitle: Machine Learning for Biomedical Data
date: 2020-02-18
---

#
## Problems with Decision Trees

## When Do Decision Trees Perform Badly?

Decision Trees are sensitive to the training set!

In cases where there are few training samples, the measure of impurity,
splitting, and so on are extremely dependent on just a few data points.

This is what we mean when we refer to **variance**.

## DTs are Sensitive to Training

![Grey Area Indicates Lower-Left Region](img/pruning01.png){width=90%}

## DTs are Sensitive to Training

![Slight Change in Training Leads to New Splits](img/pruning02.png){width=90%}

## Decision Trees Rely on Smaller Problems

Decision Trees depend on a **small** number of highly **relevant** features.

For highly complex datasets that require a large number of attribute:value pairs, the process of growing / splitting / pruning trees can be overly complex.

These problems are quite common in biomedical applications, when there could be **thousands** of input variables and **tens of thousands** of training samples.

## Example Problem: Character Recognition

![Target Glyphs](img/glyphs.png){width=90%}

The goal in Amit and Geman's "Shape Quantization" paper was to describe binary glyphs (left) under various deformations using trees.

Each of the training images was broken down into sub-images of \$4\\times 4\$ pixels to create a set of glyph "parts".

At each pixel, there was a binary split: was the pixel black or white?

## Example Problem: Character Recognition

![Glyph Tree](img/glyphtree.png){width=90%}

This image space is obviously very large for all of the glyphs on the previous slide.

Training a single tree to recognize all of these image subtypes is computationally intractable and time-expensive.

How can we deal with these large, complex datasets?

#
## Classifier Ensembles

Bagging Estimators

## Bootstrap Aggregation (Bagging)

Bootstrap aggregation or "bagging": multiple classifiers are trained on **samples** of the training set.

The classification is some combination (average, weighted average, majority vote, etc.) of each individual classifier's guess.

This **reduces variance** (sensitivity to training data)

## Intuition to Bagging

![Bagging](img/bagging.svg){width=80%}

Take training \$\\mathcal{D}\$ of size \$n\$ and create \$m\$ new subsets, \$\\mathcal{D}\_{i}\$, each of size \$n\^{\\prime}\$.

## Intuition to Bagging

![Bagging](img/bagging01.svg){width=80%}

Take training \$\\mathcal{D}\$ of size \$n\$ and create \$m\$ new subsets, \$\\mathcal{D}\_{i}\$, each of size \$n\^{\\prime}\$.

These subsets are created by uniformly sampling **with replacement** from \$\\mathcal{D}\$; so a sample may appear in multiple subsets.

Each \$\\mathcal{D}\_{i}\$ is a "bootstrap" sample.

## Intuition to Bagging

![Bagging](img/bagging02.svg){width=80%}

We then build \$m\$ classifiers, where the \$i\$-th classifier is trained on bootstrap sample \$\\mathcal{D}\_{i}\$.

The final classification result is some combination of each \$m\$ classifier
outputs (like a vote).

## Intuition to Bagging

Bagging has the greatest benefit on classifiers where the training is **highly dependent** on the specific samples used.

Leo Brieman, who developed the technique, called these "unstable" classifiers.

> "If perturbing the learning set can cause significant changes in the predictor
> constructed, then bagging can improve accuracy."

Reasoning: If you resample the training set (with replacement) over and over again, the small pertubations that cause a large change in the classifier will be "lost" in the aggregated (bagged) classifier.

## How Does Bagging Work? (Technical)

It seems reasonable that if you have a "sensitive" training set, then taking an aggregate of multiple samples (i.e. "trials") will give a more stable answer.

Can we prove this? (Yes, we can.)

## How Does Bagging Work? (Technical)

Our training \$\\mathcal{D}\$ is made up of samples \$(\\mathbf{x}, y)\$ drawn from some underlying distribution which we'll call \$P\$.

The classifier takes both the target feature vector (the one we want to predict a class label for) and the training set: \$\\varphi(\\mathbf{x},\\mathcal{D})\$.

The **aggregated classifier** is the "expected" classifier over the distribution \$P\$:

\$\$\\varphi\_{A}(\\mathbf{x},P)=\\mathcal{E}\_{\\mathcal{D}}\\left[\\varphi(\\mathbf{x},\\mathcal{D})\\right]\$\$

where \$\\mathcal{E}\_{\\mathcal{D}}\$ is the expected classifier over the entire training set \$\\mathcal{D}\$.

In other words: \$\\varphi\_{A}(\\mathbf{x}, P)\$ is the "average" classifier we get from the training distribution; it's the one that's most likely to occur in a single observation of \$P\$.

## How Does Bagging Work? (Technical)

Let's say \$\\mathbf{X}, Y\$ are two random variables where:

\$\\mathbf{X}\$ is the random variable for the data points

\$Y\$ is the variable for the class labels.

We can write the expected **error** of the classifier trained on a single training set as the difference between the true labels and the classifier output:

\$\$ e = \\mathcal{E}\_{\\mathcal{D}}\\left[\\mathcal{E}\_{\\mathbf{X},Y}\\left[Y - \\varphi(\\mathbf{X},\\mathcal{D})\\right]\^{2}\\right]\$\$

The error on the **aggregated** classifier is:

\$\$ e\_{A} = \\mathcal{E}\_{\\mathbf{X}, Y}\\left[Y - \\varphi\_{A}(\\mathbf{X},P)\\right]\^{2} \$\$

## How Does Bagging Work? (Technical)

\\begin{align}
e = \\mathcal{E}\_{\\mathcal{D}}\\left[\\mathcal{E}\_{\\mathbf{X},Y}\\left[Y - \\varphi(\\mathbf{X},\\mathcal{D})\\right]\^{2}\\right] && e\_{A} = \\mathcal{E}\_{\\mathbf{X}, Y}\\left[Y - \\varphi\_{A}(\\mathbf{X},P)\\right]\^{2} \\\\
\\textrm{Error of a single, fully-trained classifier} && \\textrm{Error of an aggregate classifier} \\\\
\\end{align}

To show that bagging (training multiple classifiers on subsets of \$\\mathcal{D}\$) reduces classification error versus a single classifier trained only on \$\\mathcal{D}\$, we must show that \$e \\geq e\_{A}\$.

## Sidenote: Variance

Variance is the expected difference between a random variable and its mean, squared.

According to the [Algebraic formula for the variance](https://en.wikipedia.org/wiki/Algebraic\_formula\_for\_the\_variance):

\\begin{align}
\\textrm{Var}\\left[\\mathbf{X}\\right] &= \\mathcal{E}\\left[(\\mathbf{X}-\\mathcal{E}\\left[\\mathbf{X}\\right])\^{2}\\right]\\\\
&= \\mathcal{E}\\left[(\\mathbf{X}\^{2}-2\\mathbf{X}\\mathcal{E}\\left[\\mathbf{X}\\right] + (\\mathcal{E}\\left[\\mathbf{X}\\right])\^{2}\\right]\\\\
&= \\mathcal{E}\\left[\\mathbf{X}\^{2}\\right] - 2\\mathcal{E}\\left[\\mathbf{X}\\right]\\mathcal{E}\\left[\\mathbf{X}\\right] + (\\mathcal{E}\\left[\\mathbf{X}\\right])\^{2}\\\\
&= \\mathcal{E}\\left[\\mathbf{X}\^{2}\\right] - 2(\\mathcal{E}\\left[\\mathbf{X}\\right])\^{2} + (\\mathcal{E}\\left[\\mathbf{X}\\right])\^{2}\\\\
&= \\mathcal{E}\\left[\\mathbf{X}\^{2}\\right] - (\\mathcal{E}\\left[\\mathbf{X}\\right])\^{2} \\\\
\\end{align}

Variance is always greater than or equal to zero. Thus, \$\\mathcal{E}\\left[\\mathbf{X}\^{2}\\right] \\geq
(\\mathcal{E}\\left[\\mathbf{X}\\right])\^{2}\$.

## How Does Bagging Work? (Technical)

Since \$\\mathcal{E}\\left[\\mathbf{X}\^{2}\\right] \\geq (\\mathcal{E}\\left[\\mathbf{X}\\right])\^{2}\$, we can compare the average single-classifier error with the average aggregated-classifier error by treating \$Y-\\varphi(\\cdot)\$ as the random variable:

\\begin{align}
e = \\mathcal{E}\_{\\mathcal{D}}\\left[\\mathcal{E}\_{\\mathbf{X},Y}\\left[Y - \\varphi(\\mathbf{X},\\mathcal{D})\\right]\^{2}\\right] \\sim \\mathcal{E}\\left[\\mathbf{X}\^{2}\\right]\\\\
e\_{A} = \\mathcal{E}\_{\\mathbf{X}, Y}\\left[Y - \\varphi\_{A}(\\mathbf{X},P)\\right]\^{2} \\sim (\\mathcal{E}\\left[\\mathbf{X}\\right])\^{2}
\\end{align}

Thus:

\$\$ e \\geq e\_{A} \$\$

**Takeaway**: The predicted error on a single predictor should always be
greater than or equal to the error on the aggregated predictor.

## When Bagging Does Not Help

There are three situations in which bagging doesn't improve accuracy:

If changes in \$\\mathcal{D}\$ do not cause a large change in \$\\varphi(\\mathbf{X},\\mathcal{D})\$, then the two sides of the inequality will be nearly equal and performance will be about the same.

If the predictor is already close to optimal, then bagging can't improve things any more.

If the classifiers are very poor, there's a limit to how much bagging can help.

There is actually a crossover point between instability and stability where
bagged classifiers actually do **worse**.

## Stability vs. Instability

![Bagging Instability](img/bagging\_stability.png){width=60%}

## Randomizing Everything in Random Forests

In addition to collecting bootstrap samples, we can also select random features.

The reasoning is similar: perturbations in the feature space can cause fluctuations in the performance of the classifier, and so by randomizing over the feature sets we can "smooth out" this variance.

In this case we rely on the fact that each feature adds at least **some** descriminatory information to the system.

#
## Combining Multiple Trees

## Growing a Forest

Suppose we train a group of trees, \$T\_{1}, \\ldots, T\_{N}\$. Our label of classification is now denoted:

\$ \\widehat{Y}\_{A} = \\textrm{arg max}\_c
\\left[P(Y=c|T\_{1},\\ldots,T\_{N})\\right] \$

The probability is conditional upon all of the trees, which is a very difficult parameter set to estimate properly.

For complex problems, estimating the parameters for a classifier like this is computationally intractable.

## Averaging Across Trees

Let \$\\mu\_{T\_{n}}(\\mathbf{x})\$ be the leaf that \$\\mathbf{x}\$ arrives at
when it's evaluated by tree \$T\_{n}\$.

Then the arithmetic average of the
distributions at the leaves is the average across all of the \$N\$ trees:

\$\$ \\bar{\\mu}(\\mathbf{x}) = \\frac{1}{N}\\sum\_{n=1}\^{N}\\mu\_{T\_{n}}(\\mathbf{x})\$\$

The mode of \$\\bar{\\mu}(\\mathbf{x})\$ is the class assigned to the data point of
\$\\mathbf{x}\$; this allows our new classifier to be:

\$ \\widehat{Y}\_{S} = \\textrm{arg max}\_{c}\\left[\\bar{\\mu}\_{c}\\right] \$

## Assumption for All Ensemble Classifiers

We have to assume that while we are building decently-accurate trees, they are
**minimally correlated**, meaning they make **independent** errors.

If we have a set of trees \$T\_{1},\\ldots,T\_{N}\$ and tree \$T\_{i}\$ makes an error,
that error should be extremely unlikely to appear in any other tree \$T\_{j}\$.

Thus the error is "lost" or averaged out when we calculate our aggregated
classification label.

We will see this idea again in a later lecture on classifier ensembles.

## Experimental Validation

Brieman offers a number of characteristics of Random Forests:

The accuracy it achieves is comparable to other popular ensemble methods (Adaptive Boosting or AdaBoost was the main competitor at the time)

It is relatively robust to noise and outliers

It's faster than alternative methods

It gives internal measures of error estimates, strength (certainty in classification), correlation, and variable importance

It can be easily parallelized

## Experimental Validation

![Comparison of Forest Accuracy](img/accuracy\_table.png){width=45%}

#
## Parting Words

## Classifier Ensembles

Classifier ensembles are a "meta" topic.

Ensembles can be used with ANY classifier, not just decision trees.

Random Forests (like most classifiers) utilize the "averaging" effect of randomized selection to handle
unstable situations, where the classifier is overly sensitive to the training.

#
## Next Class

## Next Class

We will look more closely at discriminants and perceptrons - what they are and
how to work with them under various conditions.

This will provide an introduction to a very popular classifier, Support Vector
Machines.

In terms of traditional classifier algorithms, these three - Bayes, Decision
Trees, and SVMs - are the most well-studied.

Everything else is useful under certain situations.

repository: scottdoy/lectures

branch_name: refs/heads/gh-pages

repo_name: scottdoy/lectures


text:
# Admin Info and Resources

For adding people to Flowdock, you can use [this page](/admin/onboarding) to get a list of people that signed up in the last week.

For creating new projects go to: [/projects/create](/projects/create)
> Technically anyone can do this right now, but we haven't made the url discoverable because we haven't figured out how we want to handle that yet

## Other useful admin links

- [Our Code of Conduct](https://github.com/codefordenver/codeofconduct)
- [CfA Resources for Brigades](http://brigade.codeforamerica.org/resources)
  - [Finances](http://brigade.codeforamerica.org/resources/financial-administration)
    - [2019](https://docs.google.com/spreadsheets/d/1M_ElQAHxtUqrp1Bfta2DwloevE-roLzbIwjg9OIay2I/edit#gid=0)
    - [2018](https://docs.google.com/spreadsheets/d/1H4-cLKeBFBxoOTO35dXsi_hxvOzfnIfUoS-qVDq4vig/edit#gid=0)
    - [2017](https://docs.google.com/spreadsheets/d/1ORwvp9rPOidH-bhTAfzSmUGWpi7AHOKyhrgCKZmkGKQ)
  - [Brigade Organizer's Playbook](https://docs.google.com/document/d/1G_v53fGyHqdZNmXkDxqhqkzT7q2TBZ9Xmh9JkWtFQ8Y)
  - [Free Software for Brigades](http://brigade.codeforamerica.org/resources/software)
  - [Brigade Contact Sheet](https://docs.google.com/spreadsheets/d/1zglhAKDUNnvKindAhb6K_DJaLQ_myRYGKvE2DTYolAQ/edit#gid=0)
  - [Workshop and Event Videos](https://discourse.codeforamerica.org/c/announcements/workshops)
  - [Code for America Network Discourse](https://discourse.codeforamerica.org/)
  - [Community Fellowship](https://www.codeforamerica.org/fellowship)
- [CfA Brigade Handbook](https://docs.google.com/document/d/16CL9TdmWV0hDY6c85PwtzUcu1VjeSeiDFD2CbtLKf7s)
- [CfA Slack signup form](https://docs.google.com/forms/d/e/1FAIpQLSfRqy9L8Z5bS8cPHmHrY6BPT5g6K45uo0Z3KicYLB4bsFp2wA/viewform)
- [2019 Leadership Roles Document](https://docs.google.com/document/d/1oV579Rcg-fFPejeaUWvm15-CuU4lk3sLFH0w_WZzz-8/edit#heading=h.imv9u411tnfu)

license: ISC

repository: codefordenver/members

branch_name: refs/heads/master

extension: md

gha_language: TypeScript

gha_license_id: ISC

license_type: permissive

repo_name: codefordenver/members


text:
# TOML parser for [Pike](https://pike.lysator.liu.se)

A [TOML](https://github.com/toml-lang/toml) parser trying to comply to the
v0.5 spec.

## Examle

```toml
# config.toml

name = "Global Server Config"
support =<EMAIL_ADDRESS>"055-5555"]
last-updated = 2020-11-10T12:13:14+01:00

[server.dev]
  host = "dev.host.com"
  port = 1337
  tls = false
  os.platform = "CentOS"
  os.version = "6.5"

[server.prod]
  host = "host.com"
  port = 80
  tls = true
  # This is the same as in `server.dev`
  os = { platform = "CentOS", version = "7.6" }

[[regex]]
dot = '\.'

[[regex]]
dot = '\.\.'
```

Pass this file to `Parser.TOML.parse_file()` like so:

```pike
mapping res = Parser.TOML.parse_file("config.toml");
```

and expect `res` to contain the following content:

```pike
([
  "last-updated": Second(Tue 10 Nov 2020 12:13:14 UTC+1),
  "name": "Global Server Config",
  "regex": ({
    ([ "dot": "\\." ]),
    ([ "dot": "\\.\\." ])
  }),
  "server": ([
    "dev": ([
      "host": "dev.host.com",
      "os": ([
        "platform": "CentOS",
        "version": "6.5"
      ]),
      "port": 1337,
      "tls": Val.false
    ]),
    "prod": ([
      "host": "host.com",
      "os": ([
        "platform": "CentOS",
        "version": "7.6"
      ]),
      "port": 80,
      "tls": Val.true
    ])
  ]),
  "support": ({
<EMAIL_ADDRESS>    "055-5555"
  })
])
```

license: MIT

repository: poppa/pike-toml

repo_name: poppa/pike-toml


text:
# Seed-REST-Server-JEE7
This is a sample REST service based on JEE7.

 [![status](https://travis-ci.org/AllanHoejgaardJensen/seed-rest-server-jee7.svg?branch=master)](https://travis-ci.org/AllanHoejgaardJensen/seed-rest-server-jee7)
 [![coverage](https://codecov.io/gh/AllanHoejgaardJensen/seed-rest-server-jee7/coverage.svg?branch=master)](https://codecov.io/gh/AllanHoejgaardJensen/seed-rest-server-jee7)

## Deployment
The sample has two very simple concepts - "account" and customer" - which is assembled into one deployable war file.
Databases are separate to illustrate two different services. Normally they would be deployed as two different deployable units.

Useful Commands
---------------

To build the whole project:

    mvn package

To build project including running integration tests:

    mvn verify

To run in Wildfly:

    mvn -N -Pwildfly cargo:run

To run in WebLogic:

    mvn -N -Pweblogic cargo:run

To redeploy in Wildfly

    mvn -N -Pwildfly cargo:redeploy

To redeploy in WebLogic

    mvn -N -Pweblogic cargo:redeploy

Admin console
-------------
The WebLogic console may be accessed from http://localhost:7001/console using username "weblogic" and password "weblogic1".
The JBoss console may be accessed from http://localhost:9990 using username "advisor1" and password "passw0rd".

Inspiration
-------------
The code here is inspired heavily by work done by Nykredit on REST services.

gha_language: Java

gha_license_id: MIT


text:
# RTL-Whatsapp
Makes the [Whatsapp's web interface](https://web.whatsapp.com/) work properly with Hebrew (RTL).

This changes the entire interface to RTL, so if you're using English in your conversations it probably isn't for you.

Currently only works in Chrome and Firefox.

# How to install for Firefox:
1. Install the [Stylish Firefox extension](https://addons.mozilla.org/en-us/firefox/addon/stylish/ "Stylish's Firefox add-on page").
2. Install the [WhatsappRTL style](https://userstyles.org/styles/110154/whatsapprtl "The WhatsappRTL Stylish page.").
3. Test to [see if it works](https://web.whatsapp.com/ "WhatsApp web interface.").

# How to install for Chrome:
1. Install the [Stylish Chrome extension](https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe "Stylish's Chrome Web Store page").
2. Install the [WhatsappRTL style](https://userstyles.org/styles/110154/whatsapprtl "The WhatsappRTL Stylish page.").
3. Test to [see if it works](https://web.whatsapp.com/ "WhatsApp web interface.").

repository: omertuc/RTL-Whatsapp

gha_language: CSS

repo_name: omertuc/RTL-Whatsapp


text:
# Challenge Bot 1.0
This is a Discord bot (ChallengeBot#8891) designed to facilitate Mario Kart Wii
scrimmages between pre-made teams in Lounge (https://discord.gg/HkbxJAM).

## Command Overview
- `!c` serves to start a team, confirm for a team, or confirm as a sub.
  - Starting a team involves specifying a division (RT or CT) and tagging your
  teammates.
  - Confirming for a team involves specifying a division (RT or CT) and team
  size (5).
  - Confirming as a sub involves specifying the ID of the team that has
  requested you as a sub.
- `!d` serves to remove one or more of your teams.
  - Specifying a division and a team size will only remove your team from that
  pool.
  - Specifying a division will remove your team from pools of that division of
  any team size.
  - Specifying nothing will remove your teams from all pools.
- `!team` serves to view the status of one of your teams.
  - A division and a team size must be specified.
- `!challenge` serves to request a match of another team in the same pool.
  - The ID of the team being challenged must be specified.
- `!accept` serves to confirm a challenge from another team.
  - The ID of the challenging team must be specified.
- `!decline` serves to remove a challenge from another team.
  - The ID of the challenging team must be specified.
- `!sub` serves to request a sub for an ongoing match.
  - This command must be done in the main channel for challenges and you must
  tag the person you want to sub in for your team in your ongoing match.
- `!remove` is a staff-only command that serves to remove a team from a pool.
  - The ID of the team must be specified.
- `!end` is a staff-only command that serves to remove a match from the server.
  - This command must be done in the text channel created for an accepted
  challenge.

## Forming a team

Team formation is done similarly to 5v5 squad queue in that one person starts
the team by tagging their teammates and then each teammate confirms. **The last
teammate tagged is assumed to be the bagger.** The two differences are that a
division (RT or CT) must be specified for the team and that events are not
scheduled. Instead, each division consists of a pool open at all times from
which teams can challenge one another and play scrimmages.
>[2:03 PM] Sartaglo: !c rt @Stubbz @Process @Edison @Sprixy
[2:03 PM] ChallengeBot: Stubbz, Process, Edison, and Sprixy must now each send
`!c RT 5` to confirm. Send `!team RT 5` to check the status of your team.
[2:03 PM] Stubbz: !c rt 5
[2:03 PM] ChallengeBot: You are now confirmed for RT 5v5. Send `!team RT 5` to
check the status of your team.
[2:03 PM] Edison: !c rt 5
[2:03 PM] ChallengeBot: You are now confirmed for RT 5v5. Send `!team RT 5` to
check the status of your team.
[2:03 PM] Process: !c rt 5
[2:03 PM] ChallengeBot: You are now confirmed for RT 5v5. Send `!team RT 5` to
check the status of your team.
[2:03 PM] Sprixy: !c rt 5
[2:03 PM] ChallengeBot: Your team **[26]** is now confirmed for RT 5v5. You may
now challenge other teams in the pool.
[2:04 PM] Sartaglo: !team rt 5
[2:04 PM] ChallengeBot: Team **[26]** for RT 5v5 has 5/5 players confirmed.
✓ Sartaglo (Runner)
✓ Stubbz (Runner)
✓ Process (Runner)
✓ Edison (Runner)
✓ Sprixy (Bagger)

## Playing a match
In addition to the *challenge* channel, there is also a *pools* channel
dedicated to presenting the current state of all pools in the server.
>[1:28 PM] ChallengeBot: **RT 5v5 Pool**
**[25]** Cheron (1500 Runner MMR), Niko (1500 Runner MMR), Lucas (1500 Runner
MMR), Starstrike (1500 Runner MMR), and Elbling (750 Bagger MMR)
**[26]** Sartaglo (1500 Runner MMR), Stubbz (1500 Runner MMR), Process (1500
Runner MMR), Edison (1500 Runner MMR), and Sprixy (750 Bagger MMR)
>
>*Pending Challenges: None*

Once you have formed your team, you may challenge other teams in the same pool.
Your challenge will be announced with instructions for the other team and will
be listed as a pending challenge in the pool. When a member of the other team
accepts the challenge, a text channel and two voice channels, one for each team,
will be created to facilitate your match.
>[2:05 PM] Sartaglo: !challenge 25
[2:05 PM] ChallengeBot: Team **[25]** has been challenged for RT 5v5 by the
following team:
>
>**[26]** Sartaglo (1500 Runner MMR), Stubbz (1500 Runner MMR), Process (1500
Runner MMR), Edison (1500 Runner MMR), and Sprixy (750 Bagger MMR)
>
>To accept this challenge as a member of team **[25]**, send `!accept 26`. To
decline, send `!decline 26`.
[2:06 PM] Cheron: !accept 26

## Obtaining a sub
During a match, players may need to be subbed out for any number of reasons. You
may request a player to sub into your ongoing match from the challenge channel.
If that player accepts the request, they will be added to the appropriate text
and voice channel.
>[2:29 PM] Sartaglo: !sub @ELP
>[2:29 PM] ChallengeBot: Sartaglo has asked ELP to sub for team **[26]** in
their RT 5v5 match against team **[25]**.
>[2:30 PM] ELP: !sub 26
>[2:30 PM] ChallengeBot: ELP has agreed to sub in for team **[26]** in their RT
5v5 match against team **[25]**.

## Ending a match
After a match completes and a table is posted, a staff member may delete the
text channel and voice channels associated with the match from within that text
channel.
>[3:01 PM] Sartaglo: !end
>[3:01 PM] ChallengeBot: This channel will be deleted in five seconds.

repository: Sartaglo/challengebot

branch_name: refs/heads/main

repo_name: Sartaglo/challengebot


text:
orpse Walker 01
---
##
The war in the south is **none of your concern** anymore. Your new **mission** is... ... to take your fellow soldiers to Sector 21 of the Northern Hills.

But sir... that road is **steep** and can't be reached by **vehicle.**

Don't worry. Someone will take them there. All you need to do is to protect them. That's not all. Here is your second **mission.** Do **not** open it **until** you arrive, and **keep it to yourself.**

Yes, sir !

How could it be possible... for one man to transport all those **corpses?**

You'll know soon.

**Commander,** it's an honor to meey you.

*"It **turned out** to be a girl."* Likewise. How may I **address** you?

You can call me Xun.

Ok then. let's **move out.**

Yes, sir.

Rise.

*"This is a little **frightening**; maybe I should say something to **break the silence.** "* Xun, it's good to have you along. **At least** there is someone alive to talk to.

Yes, dead men don't speak.

That's true. so how long have you been a Corpse Walker for?

I'm still only a beginner. These six **corpses** are the most I've handled so far.

One, two, three, four, five... **Hold on,** there're only five **corpses.** Are we **missing** someone?

**My mistake.** There're only five.

Xun, you have an amazing ability to control the dead. Why not **join the army?**

I can control how they move and that's it. In a war, they would just be meat **shields.**

A part of **victory** still comes from **strengthening troops.** With a secret **weapon** like that, we would never lose a battle.

Secret **weapon?**

Sector 21 is now researching this. We're not sure whether the results would be a success or not.

Commander, **is it appropriate to** tell me this information?

...

We shouldn't **march** anymore during the daytime. Let's take a rest.

*"I heard that all corpse walkers were really ugly... Let me take a look..."*

We **marched** for a whole night. Aren't you tired?

Whatever's **on your mind,** we can talk about it tonight.

Okay.

##
---
### during the daytime "白天，日间"
	We shouldn't march anymore during the daytime.
	白天，我们还是不要在赶路了，
### take a rest "休息"
	Let's take a rest.
	去休息一下吧。
### on one's mind "挂在心上，心里惦念"
	Whatever's on your mind, we can talk about it tonight.
	不管你在想什么，今晚上路时再说吧。
### keep somthing to yourself "保密"
	Do not open it until you arrive, and keep it to yourself.
	到了地方才能拆，要保守秘密。
	Keep this to yourself. Mary and I are breaking up.
	Mary和我正在闹分手，这件事要保密。
### break the silence "打破沉默"
	this is a little frightening; maybe I should say something to break the silence.
	这样有点瘆人啊，也许我该说点什么来打破沉默。
	He started talking to break the silence.
	为了打破沉默，他开始说话。

	长官，跟我透露这些情况，合适吗？
	It is appropriate to ask when you have questions.
	有疑问的时候提问是很合适的。
### Likewise "(表示感觉相同)我也是"
	Likewise. How may i address you?
	我也很幸会，怎么称呼您呢？
	'You're welcome at our house.' 'Likwise.'
	“我们家欢迎你。” ”我们家也欢迎你。“
### so far "到目前为止"
	These six corpses are the most I've handled so far.
	这留个尸体已经是到现在我赶得最多的一次了。
	We haven't received your letter so far.
	到目前为止我们还未收到你的来信。

repository: seedcm/English

repo_name: seedcm/English


text:
## v2.8.1
 * Remove CURLOPT_CAINFO - path to Certificate Authority (CA) bundle
 * Remove paymill.crt
 * Change user agent info to "Paymill-OXID/2.8.1"

## v2.8.0
 * Integration of PayFrame to enable use of SAQ A for easier PCI DSS 3.0 compliance.

## v2.7.1
 * Using window.addEventListener

## v2.7.0
 * remove jQuery import and use shops native jQuery
 * allow preauth/capture workflow
 * allow refund

## v2.6.0
 * added OXID mobile theme support. Tested with Nexus 7 Chrome emulation and iOS simulator (iPhone 4-inch iOS 7.1).
 * added autocomplete="off" for input fields, browser shall not save sensitive data like credit card number and card verification value
 * changed CVV input field type from "text" to "password"
 * ui change: added support for payment long description (configurable in the OXID backend payment methods settings)
 * ui change: credit card form - valid until months are shown in a new format instead of just having the name of the month it also shows the number, e.g. "1 - January"
 * ui change: hover tooltip for CVV input field
 * refactoring: removed all deprecated calls, e.g. oxConfig::getInstance() etc
 * max length of transaction description set to 128 characters
 * fixed: order number was not set correctly, is now updated after order execution

## v2.5.0
 * united SEPA and regular ELV forms
 * added backend option to show credit card logos in frontend
 * added prenotification in order mail for direct debit (see Readme.md "Notes about direct debit (ELV) Prenotification" regarding invoice pdf)
 * added check for block entries in oxtplblocks
 * fixed exception in install with alter table sql

## v2.4.0
 * added iban validation
 * added creditcard predetection and improved validation
 * added multilang support

## v2.3.0
 * webhook support
 * translate bridge errors
 * elv sepa support

## v2.2.0
 * maestro handling
 * better logging view
 * better error messages
 * add validateHolder() for card holder validation
 * fastcheckout add possibility to change the payment data
 * reuse clients and update them if email address has changed
 * dynamic credit card icons

## v2.1.3
 * mark complete orders as paid

## v2.1.2
 * now using unique id's instead of classes for as js selector

## v2.1.1
 * support specialchars in names

## v2.1.0
 *  improve payment workflow
 * update readme
 * update install.sql
 * update update.sql

## v2.0.0
 * update php wrapper
 * edit api endpoints
 * fix user logout bug
 * adjust admin menu traslation

repository: paymill/paymill-oxid

gha_language: PHP

repo_name: paymill/paymill-oxid


text:
# Roadmap

High-level overview of key features.

* [ ] Phase 1 - Jupyter Notebooks, versioning
	* [ ] AWS SageMaker integration (abiilty to launch notebooks from T4)
	* [ ] Hosted buckets
	* [ ] T4 for AWS marketplace
	* [ ] Full version browsing + rollback support in the catalog
	* [ ] Standardize location for local/remote installs
* [ ] Phase 2 - Cloud agnostic storage (via minio or ceph)
	* [ ] S3-like interface for packages, buckets, local stores
	* [ ] Examples of using packages in Spark, R, Java
	* [ ] Seamless de/serialization hooks, user-provided de/serializers
	* [ ] Improve "git for data"-layer of API
* [ ] Phase 3 - CI/CD for data science
	* [ ] Branch/merge packages
	* [ ] Git integration for CI lifecycle
	* [ ] Data unit tests
	* [ ] Declarative data profiles for unit tests
	* [ ] Data lineage visualization

* [ ] Phase 4 - Hive metastore integration
	* [ ] Discovery mechanism for hive columns/annotations (use ElasticSearch)
	* [ ] Ability to include Hive tables in packages

* [ ] Phase 5 - Cloud agnostic compute, via K8s
	* [ ] Transition all containers under K8s
	* [ ] Transition Lambda functions
	* [ ] Transition ElasticSearch


text:
# SUPERPOWERS TUTORIAL #1 SUPER PONG
## *Chapter 2 : Preparing Superpowers*

### Building the project structure

*I consider you already have Superpowers installed and working and we jump directly to the game.
If you want to learn the basics of the application please check the [official documentation][1].*

We start our server and we create our **new project** than we call PongTutorial.

We start by creating a **Scene** (new asset or ctrl+n) called **Game**.

In **settings**, we put Game in the **Startup Scene**. (drag and drop or write Game)
A gray label should appear. And we set the **Screen ratio** to (400, 300)

We create a hierarchy structure for our assets, we will put sprites files inside
GameSprites, sounds in GameSounds and Scripts in GameScripts.

We create new assets, 4 Sprites, 3 Sounds and 2 Scripts, we add also a Font asset:

*Note : The order of your assets and folders have no incidence.*

* Game
* GameSprites
    * background
    * pad1
    * pad2
    * ball
* GameScripts
    * Ball
    * Paddles
* GameSounds
    * tac
    * toc
    * tada
* Font

![settingassets.png](img/settingassets.png)

###  Loading the game assets

*An asset is a box holding an element of the game, it can be an image, a script, a sound, etc.*

We have built the game assets structure but they will stay empty if we don't give
them contents (which is files for sprites and sounds and code for scripts).

First you will need to download the source assets on [the repository github here][2].

The sprites and sound assets need to be uploaded inside the project.
For each asset, we load the file related. (Example, background.png in asset backgound)

The sprites assets need calibration with a **setup**, the **grid size** must be the same size than
the image because we don't use frame for this game.
We just accept the default frames/row and frames/column which is 1 for both.

We change the rendering **Pixels / Unit** of each Sprite assets which is by default 100, to 50.

We don't need to change the **origin** of our sprites. The default % (50, 50) which is
origin to the center is good for all of our sprites for this game.

Here the example of pad2 with the correct set up.

![spriteset.png](img/spriteset.png)

In the Font Asset, we change the **Pixels / Unit** to 100 and the **Size** to 64.

After loading the sound file to the Sound assets, everything fine, you can just test each sound.

We are now fine with the assets, we can start to build our game scene.

### Building the scene

*The Scene is the screen where all objects (called actors) are connected together.*

We will now set all the objects of the scene. We call an object inside the scene, an Actor.

To see the others Actors inside the game, we first need a Camera Actor.

*Note : We can switch the camera mode 2D / 3D to navigate inside the scene, see documentation.*

We create a **new actor** than we name **Camera**.

We set the **position** on axis Z (the third) to 5 to place the camera to the front of all
others objects who have a position on axis Z less than 5 :

We add a **new component** Camera.

And we change the mode to **Orthographic**.

We then set the **Orthographic Scale** at 6. (We do this to fit with the background)

![camera.png](img/camera.png)

We create All the Actors objects of our game following this organization of actors :

![actors.png](img/actors.png)

We add a **new component Sprite Renderer** in Background Actor and drag and drop the Sprite
background in Sprite. (or write the path GameSprites/background)

We do this step again for the Actors Ball, and the two Paddles of Player1 and Player2.
For each of them we create a new component Sprite Renderer and we connect the Sprite
Path of the correct Sprite. Pad1 for the Paddle of Player1, etc.

We create a new component **Text Renderer** for each of the Score Actors and we drag
and drop the Font in the Font area. We write 0 to the Text area.

*Note : When the project become bigger, there is the possibility to duplicate Actors
to avoid repetition, but as we are learning, repetition of this step is important.*

We have everything inside the scene now.

We need to set correctly all the **positions** of the Actors, to be able to see them
nicely when we launch the game.

We have already set the Position of the Actor Camera to (0, 0, 5), here the position
of all the others Actors :

* Background (0, 0, 0)
* Ball (0, 0, 4)
* Player1 (0, 0, 0)
    * Paddle (-3.7, 0, 4)
    * Score (-2, 2.5, 2)
* Player2 (0, 0, 0)
    * Paddle (3.7, 0, 4)
    * Score (2, 2.5, 2)

To finish we can change the color of each Score Actors, you can do so by clicking
on the little checkbox next to the label color and choose color.
Here the hexadecimal colors codes :

* Player 1 – Score : f14735
* Player 2 – Score : 356ef1

Ok, all the Actors are placed, we can launch the game to see if everything display correctly.
Right now, nothing will happen beside the display and it is normal. We need to start
programming the logic of our game to have some interaction. However a last step before jumping in the code is to set the Physic Bodies to our sprites, we will need these solid bodies
for the collision between the ball and the paddles.

### Setting Arcade Bodies

In our Game Scene, we need to gave new component **Arcade Body 2D** to both of our Paddles and to our Ball.

We then change for both paddles the size of x to 0.2 and keep y to 1 (size = 0.2, 1) and for the ball
the size of x and y to 0.2  (size = 0.2, 0.2) in a way than the bodies do the same size than our sprites.

In the game the illusion is than the sprite ball will collide with the sprite paddle,
in reality, it is the ball physic body and the paddles physic bodies that will collide.
The sprite is just attached to it and follow the movement of the body.

![arcadebody.png](img/arcadebody.png)

[1]: http://docs.superpowers-html5.com/en/getting-started/about-superpowers
[2]: https://github.com/mseyne/superpowers-sources/tree/master/1SuperPong


text:
# Local Inference deployment

## 1. Description

This document describes deploying segmentation models on the server side using the Python interface for Paddle Inference. With a certain configuration and a small amount of code, you can integrate the model into your own service to complete the task of image segmentation.

Paddle Inference's [official website document](https://paddleinference.paddlepaddle.org.cn/product_introduction/summary.html) introduces the steps to deploy the model, various API interfaces, examples, etc. You can use it according to your actual needs .

## 2. Preliminary preparation

Please use the [Model Export Tool](../../model_export.md) to export your model, or click to download our [Sample Model](https://paddleseg.bj.bcebos.com/dygraph/demo/bisenet_demo_model.tar.gz) for testing.

Then prepare a test image for the test effect, we provide a [image](https://paddleseg.bj.bcebos.com/dygraph/demo/cityscapes_demo.png) in the validation set of cityscapes for demonstration effect, if Your model is trained using another dataset, please prepare test images by yourself.

## 3. Prediction

Enter the following command in the terminal to make predictions:
```shell
python deploy/python/infer.py --config /path/to/deploy.yaml --image_path # if you set input_shape in export, you need to pass in images with the same shape as input_shape or pass in shape-changing transforms in deploy.yaml.
````

The parameter descriptions are as follows:
|Parameter name|Purpose|Required option|Default value|
|-|-|-|-|
|config|**The configuration file generated when exporting the model**, not the configuration file in the configs directory|Yes|-|
|image_path|The path or directory of the predicted image|is|-|
|use_cpu|Whether to use X86 CPU prediction, the default is to use GPU prediction|No|No|
|use_trt|Whether to enable TensorRT to speed up prediction|No|No|
|use_int8|Whether to run in int8 mode when starting TensorRT prediction|no|no|
|use_mkldnn|Whether to enable MKLDNN for accelerated prediction|No|No|
|batch_size|single card batch size|no|specified value in configuration file|
|save_dir|Directory where prediction results are saved|no |output|
|with_argmax| Perform argmax operation on the prediction result|No|No|

*Test examples and predicted results are as follows*
![cityscape_predict_demo.png](../../images/cityscapes_predict_demo.png)

**Notice**

1. When using quantitative model prediction, both TensorRT prediction and int8 prediction need to be turned on to have the acceleration effect

2. To use TensorRT, you need to use the Paddle library that supports the TRT function. Please refer to [Appendix](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/Tables.html#whl-release) to download the corresponding PaddlePaddle installation package, or refer to [source code compilation](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/compile/fromsource.html) to compile it yourself.

repository: PaddlePaddle/PaddleSeg

gha_language: Python

repo_name: PaddlePaddle/PaddleSeg


text:
---
layout: post
date: 2010-04-25 07:13:45 GMT
title: "Instapaper Pro 2.2.3"
---
# [Instapaper Pro 2.2.3](http://blog.instapaper.com/post/545408126)

> The iPad screen is actually too large for comfortable text reading spanning the entire width unless you move to multiple columns, which is a technical challenge that I’m not ready to tackle yet (especially since I don’t particularly like multi-column reading).

repository: arpith/blog

repo_name: arpith/blog


text:
# Oracle drivers for Records

Get the driver RPMs from official Oracle site or with `curl` below and convert
them to DEBs with `alien -d *.rpm`.

## curling the RPMs (from unofficial location)

    curl -O http://repo.dlt.psu.edu/RHEL5Workstation/x86_64/RPMS/oracle-instantclient12.1-basic-<IP_ADDRESS>.0-1.x86_64.rpm
    curl -O http://repo.dlt.psu.edu/RHEL5Workstation/x86_64/RPMS/oracle-instantclient12.1-devel-<IP_ADDRESS>.0-1.x86_64.rpm

repository: mrts/docker-python-selenium-xvfb

repo_name: mrts/docker-python-selenium-xvfb


text:
# Fine dust sensor SDS011 via Bluetooth

The sensor works best if connected to USB. You can buy "active" USB cables up to 10 meter length. I have never tried, but you will find a lot of negative reviews. Even 10 meter are not much if you have to go up and down a roof.

But putting the whole Raspberry Pi outside would be a severe security issue, because it's to easy to extract stored Wifi passwords. So I connected it via Bluetooth.

## Wiring

![bluetooth-wired](/home/hub/projects/sds011-mqtt/doc/bluetooth-wired.jpg)

The USB connector was replaced by a 230V AC to 5V DC power supply (e.g. [Amazon Germany](https://www.amazon.de/gp/product/B079138QY1/)). As Bluetooth module use a HC-05 or HC-06.

Make sure you cross the RX and TX wires between Bluetooth module and sensor. It took me some time to figure that out!

The sensor has a JST-XH plug socket (2.54 mm), but I was not able to crimp it properly. So I crimped all as Dupont connectors (also pin pitch of 2.54 mm).

## Configure Bluetooth on Raspberry Pi

It's recommended to use an external Bluetooth adapter for better transmission. Then an USB extension cable can be used to bring to the Bluetooth dongle as near as possible to the target. The Bluetooth target may be behind an outer wall, don't underestimate the signal loss.

Run: `hciconfig`

The one with bus "USB" is your choice, bus "UART" is the on-board device.

Disable the on-board Bluetooth dongle:
```bash
sudo hciconfig hci1 up
sudo hciconfig hci0 down
```
After reboot the Bluetooth adapter index could be changed!

"BD Address" is the Bluetooth ID within `bluetoothctl`.

### Paring

`sudo bluetoothctl`

Within "bluetoothctl" command mode:

```
# list Bluetooth adapters
list

# select the right adapter; format "00:11:22:33:FF:AD"
select <adapter_id>
select 00:11:22:33:FF:AD

power on
agent on
default-agent
pairable on
discoverable on

# unpairing devices connected to internal Bluetooth adapter didn't work for me
# remove 00:11:22:33:FF:EE
#   Failed to remove device: org.bluez.Error.NotReady
# just pair with the new adapter!

scan on
# your device will be listed
scan off

pair <device_id>
pair 00:11:22:33:FF:EE
# type in your pin (1234 for HC-06)
trust <device_id>
trust 00:11:22:33:FF:EE

info <device_id>
info 00:11:22:33:FF:EE

pairable off
paired-devices

```

### Check signal strength (RSSI)

```bash
# implicit adapter index == 0
sudo btmgmt find

# define adapter index (e.g. == 1 for an external adapter)
sudo btmgmt --index 1 find
```

Make sure the value is higher than **-60**.

### Prepare a serial port

```bash
sudo rfcomm bind 1 00:14:03:05:59:DF 1
sudo rfcomm bind 00:1A:7D:DA:71:0B 00:14:03:05:59:DF 1

sudo rfcomm release 1 00:14:03:05:59:DF
```

Binding the Bluetooth device to a serial port is best done by `ExecStartPre` within the service script.


text:
# truthyjs

Javascript library for testing truthiness of anything. Coerce string booleans into boolean primitives. Truthyness is not the same as equality!

----

### usage

```js
var truthy = require('truthyjs')();

var someParam = req.params('foo');
if (truthy(someParam)) {
  // do stuff
}

//----
// or with options
var truthy = require('truthyjs')({ coerceStringBooleans: true });

var someParam = req.params('foo');
if (truthy(someParam)) {
  // do stuff
}

```

### objects

```js
truthy({}) === true
truthy({ foo: 'bar' }) === true
truthy(function() {}) === true
```

### arrays

```js
truthy([]) === true
truthy(["foo", "bar"]) === true
truthy(undefined) === false
```

### null

```js
truthy(null) === false
```

### numbers

```js
truthy(NaN) === false)
truthy(0) === false
truthy(1) === true
truthy(2) === true
truthy(-1) === true
```

### strings

```js
truthy('') === false
truthy('false') === true
truthy('true') === true
truthy('abc') === true
```

### booleans

```js
truthy(true) === true
truthy(false) === false
truthy(Boolean(false)) === false
truthy(Boolean(true)) === true
truthy(new Boolean(true)) === true
truthy(new Boolean(false)) === false
truthy(new Boolean("true")) === true
truthy(new Boolean("false")) === true
truthy(Boolean(0)) === false
truthy(Boolean(1)) === true
truthy(new Boolean(0)) === false
truthy(new Boolean(1)) === true
truthy(new Boolean(0)) === false
truthy(new Boolean(1)) === true
truthy(new Boolean("0")) === true
truthy(new Boolean("1")) === true
truthy(Boolean("abc")) === true
truthy(new Boolean("abc")) === true
```

### options explained - coerceStringBooleans: true
You can set the `coerceStringBooleans` option to coerce the string value "true" to boolean true and the string "false" to boolean false. String "true" and "false" matches are case-insensitive.

```js

// with coerceStringBooleans set to true
truthy('') === false
truthy('false') === false
truthy('False') === false
truthy('FALSE') === false
truthy('true') === true
truthy('True') === true
truthy('TRUE') === true
truthy('abc') === true
```

===========

License

Copyright (c) 2013 Calvin Alvin https://github.com/calvinalvin

The MIT License (MIT)

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: calvinalvin/truthyjs

repo_name: calvinalvin/truthyjs


text:
---
title: "Cleanup"
date: 2018-10-087T08:30:11-07:00
weight: 14
draft: false
---

Congratulations on completing the Tracing with X-Ray module.

The content for this module was based on the [Application Tracing on Kubernetes with AWS X-Ray](https://aws.amazon.com/blogs/compute/application-tracing-on-kubernetes-with-aws-x-ray/) blog post.

This module is not used in subsequent steps, so you can remove the resources now or at the end of the workshop.

repository: zengelan/eks-workshop

gha_license_id: NOASSERTION

repo_name: zengelan/eks-workshop


text:
All style changes are done in the src/scss folder and generated into css automatically using gulp.

Note!
None of the dist files are included in git, which means less conflicts of compiled css files.
The dist files are compiled when deploying to test/production.

For everything to work correctly you need to install required modules. Run the following:

    npm install

After this you can run the command that compiles your sass files to css. It will compile the css into human-readable form and begins watching the scss/js source folders.

    npm run gulp

If you just want to compile the sass and js, you can run:

    npm run gulp development

If you want to test how the css and js is compiled in production, you can run:

    npm run gulp production

branch_name: refs/heads/dev


text:
# Noa

Noa is an OAuth2 Server Implementation. This is still a work-in-progress. It currently supports the following:

-   Authorization Code Grant
-   Implicit Grant
-   Client Credentials Grant
-   Refresh Token Grant

Resource Owner Credentials Grant is not supported. Besides this,
there is no support for custom grant types.

> Noa Installation Instructions are available further down on this page.

### Authorization Providers

Noa has the ability to support segmentation/isolation of authorization.
Any request approvals and issued tokens are confined to that context.
The authorization related services (`authorize`, `issue`,
`introspect`, `revoke`) provided in such isolation are known as
"Authorization Providers". Each authorize service provider has its
own "Provider URL" that looks like:

```
http://my.noa:4000/as/v1/6n33hfmvplm2sbctpuppz2upajrqvzup
```

The specific operation URLs for such a provider will look like:

```
http://my.noa:4000/as/v1/6n33hfmvplm2sbctpuppz2upajrqvzup/authorize
http://my.noa:4000/as/v1/6n33hfmvplm2sbctpuppz2upajrqvzup/issue
http://my.noa:4000/as/v1/6n33hfmvplm2sbctpuppz2upajrqvzup/introspect
http://my.noa:4000/as/v1/6n33hfmvplm2sbctpuppz2upajrqvzup/revoke
```

Out of these, `authorize` is supported as an HTTP GET request.
The rest of them are only supported with HTTP POST.

### Provider and Client Registrations

At this point in time there are no REST APIs or Web based administration
for managing Authorization Providers and OAuth Clients. Low level
APIs are available for these. A simple seeding mechnism is provided
to bootstrap the system using these low-level APIs. (Follow along the
installation instructions on how to set this up.)

### Resource Owner approvals

At its core, Noa is an OAuth2 system. It has to rely on other systems for
Resource Owner authentication during authorization request approval
during "Authorization Code Grant" and "Implicit Grant" flows. It does
have built-in ability to do prompt for end user consent once the
user is authenticated. For a successful adoption, Noa needs a
better integration story.

As it stands right now, this is pegged on Ueberauth. A "Quickstart"
show-me-how implementation is included. This implementation simply
authenticates the end use based on information in a credential file.

Other "enterprise-y" approaches such as fronting Noa with the likes of
Nginx for authentication and having Nginx make "authenticated user"
available in as a request header in a proxy forward would work as well.

### Noa Playground

There is a companion Github Repo [Noa Playground](https://github.com/handnot2/noa_playground).
This is very similar to Google OAuth2 Playground. Once Noa is setup and running
you can use Noa Playground to try-out Authorization Code Grant flow
end-to-end without writing any code!

Make sure to get Noa installed before you follow the instructions on setting up the playground.

## Installation

Make sure that you have Elixir 1.5.0/Erlang 20.0.x, Nodejs, npm
and Docker installed.

### Build Docker Image

```
git clone https://github.com/handnot2/noa
cd noa
mix deps.get
cd assets
npm install
cd ..
mix compile
sudo mix docker.build --no-cache
sudo mix docker.release --no-cache
```

> If you have any issues with PATH when doing `docker.build` and
> `docker.release` commands, insert `env "PATH=$PATH"` between sudo
> and mix in the above commands.

### Noa Installation using Docker Image

```
./noa_docker_init.sh ${HOME}/mynoa
cd ${HOME}/mynoa
vim seeds/ro_quickstart.creds
./noa_docker_seed.sh
```

Checkout the `README.md` file in `${HOME}/mynoa` for instructions on
`seeds/ro_quickstart.creds` file.

At the end of this you will have a docker based instance of Noa running.
From this point out, you simply use `docker-compose` to manage Noa.

> Make sure to add
>
> `<IP_ADDRESS> my.noa`
>
> To your `/etc/hosts` file.

Head over to [Noa Playground](https://github.com/handnot2/noa_playground).
Instructions over there show how to setup your own local OAuth2 Playground
to work with Noa.


text:
# jasmine-example
> javascript test example

document http://jasmine.github.io/edge/introduction.html

## How to use
- install node.js from https://nodejs.org/download/
- go to root project directory
```shell
$ cd jasmine-example
```
- install grunt from package.json by command
```shell
$ npm install
```
- run grunt (jasmine)
```shell
$ grunt
```

## Automate test
- by command
```shell
$ grunt watch
```

repository: jittagornp/jasmine-example

repo_name: jittagornp/jasmine-example


text:
---
layout: post
title: "Build home backup system"
date: 2014-02-24 20:28
comments: true
categories: Archlinux
---

I never seriously consider photoes as precious wealth till one day I drowned into my album collections. Those silly and embarrassed moments instantly became vivid. In order to backup and organize all my family's pictures at one place, I decide to build up a system on my out-of-date netbook since I don't want to spare money on an expensive NAS machine.

<!--more-->

## Backup folders from Android/iOS automatically

First of all, I need sync the pictures from all of my family phones and tablet. [BitTorrent Sync](http://www.bittorrent.com/sync) is good choice because it covers almost all platforms, Windows/Linux/Android/iOS, etc. And it's FREE.

* Follow [this wiki entry](https://wiki.archlinux.org/index.php/BitTorrent_Sync), I can easily set up BT Sync on my netbook running Archlinux. And run `systemctl status btsync@user` to check the status;
* Install *BT Sync* on all phones and iPad;
* Choose camera folders and set them as backup folders;
* Add backup folders on PC with secret codes;

Now all the pictures will be uploaded to the specific folders on PC and new photoes will be synchronized later as well. And If *BT Sync* drains the phones' battery, you could try to enable "Auto Sleep".

The only constraint is, I have to keep *BT Sync* opening on iPad during synchronization. But I can bear it since I seldom take pictures on iPad.

## Set sharing folders on Archlinux

NFS ([Network File System](https://wiki.archlinux.org/index.php/Nfs)) is the my first choice to share folders on Archlinux because it's UNIX/Linux oriented and highly efficient. However I dropped it later due to the lack of decent client apps on Android/iOS.

Samba, as an alternative, was set up instead.

## View Pictures on Android/iOS/TV box

[ES File Explorer](https://play.google.com/store/apps/details?id=com.estrongs.android.pop&hl=en) on Andorid and [FileExplorer](https://itunes.apple.com/us/app/fileexplorer-free/id510282524?mt=8) on iPad are able to mount SMB folders as well as browse remote pictures freely.

On TV box, [XBMC](http://xbmc.org/) is always the best choice. It could even support NFS!

## Existed problem

The only problem I meet now is the speed. The wireless ethernet card on netbook is only 150Mbps while my TP Link router at home is also 150Mbps. I can approximately get 6Mbps transmission from another Windows PC in the same LAN. But only 2Mbps data rate could be reached on an android phone. SMB client might be the bottleneck I guess.

I'd like to put it aside. Because I only use it to browse family photographs. Fine is just enouge. Don't let the pefectionism ruin your life!

extension: markdown


text:
# Get started with cloud-native on the open Java stack

## Abstract

Have a go at developing a cloud-native microservice on a fully open source and open standards stack. Use the Eclipse MicroProfile programming model to develop a robust and flexible microservice. Deploy it to the Open Liberty server running on the Eclipse OpenJ9 JVM.  Handle microservice metrics and alerting with MicroProfile Metrics and Health.  Finally, build and run the application in a Docker container ready for deployment to your favourite cloud.

### Pre-requisites

To take this quick tutorial you need the following pre-requisites:
1. A Java 8 JDK (the tutorial covers OpenJ9 but other Java distributions should work https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=openj9)
2. Apache Maven (https://maven.apache.org/)
3. An editor with Java support (e.g. Eclipse, VS Code, IntelliJ)
4. Docker (if you want to do the steps to build and run in a Docker container)

## Introduction

Cloud-native is an approach to application development and deployment.  It's the product of a number of industry movements over the past 10-15 years - agile development practices, DevOps, Microservices and Cloud.  Cloud-native applications are developed using agile practices, use continuous integration/continuous delivery to streamline deployment, are architected around team-aligned microservices, and leverage the cloud for rapid deployment at scale.

Cloud-native doesn't change the principles around which solutions are chosen and so often avoiding vendor lock-in is key.  Open source and open standards are essential enablers for avoiding vendors lock-in.  This quick tutorial takes you through using an Open Java Stack with Open Source and Open Standards at its heart; OpenJ9, AdoptOpenJDK, Open Liberty, MicroProfile, and Docker.

### 1. A look at OpenJ9 and AdoptOpenJDK

OpenJ9 is an Eclipse open source JVM. It resulted from the contribution of IBM's JVM implementation to Eclipse and so has many years of high-volume, high-availability production use behind it. It's low footprint, fast startup and high throughput characteristics make it an ideal choice for cloud-native applications - if you pay for your cloud by memory footprint, this is going to be important to you.

Every JVM needs a class library, and most people don't want to build their own Java distribution.  The best place to get a build of OpenJ9 is AdoptOpenJDK.  This provides pre-built binaries of the OpenJDK class libraries with different JVMs.  The OpenJ9 + OpenJDK builds can be found here: https://adoptopenjdk.net/?variant=openjdk8-openj9 .

In a terminal, type: `which java`

To find out more about the Java you have installed, type: `java -version`

```
openjdk version "1.8.0-internal"
OpenJDK Runtime Environment (build 1.8.0-internal-jenkins_2018_01_30_13_02-b00)
Eclipse OpenJ9 VM (build 2.9, JRE 1.8.0 Linux amd64-64 Compressed References 20180130_57 (JIT enabled, AOT enabled)
OpenJ9   - 8f03f71
OMR      - f410d65
JCL      - 687ce89 based on jdk8u152-b16)
```

### 2. Build a cloud-native microservice

This tutorial comes with a pre-build Microservice for you to study and extend.  Start by cloning the repository.

```
git clone https://github.com/gcharters/open-cloud-native-intro.git
```

Inside the `open-cloud-native-intro` directory you'll see a `pom.xml` file for the maven build, a `Dockerfile` to build a docker image and a `src` directory containing the implementation.

Build and run the microservice application:

`mvn install liberty:run`

Building the application (`mvn install`) also downloads Open Liberty from Maven Central and installs it to `target/liberty`.  The build also packages the application in the `target` directory in a WAR file, called `mpservice.war` and creates a minimal runnable jar containing Open Liberty and the application, called `mpservice.jar`. The `liberty:run` command (Maven goal) starts the `mpserviceServer` server in the `target/liberty` directory.

Note: you will see some warnings from the server relating to SSL configuration.  These are expected and will be addressed later.

To see what the app does, open a web browser at the following URL:
http://localhost:9080/mpservice

This displays a simple web page that provides a link to the microservice.  On that page, click on the link to the greeting service.  This will call the microservice URL:
http://localhost:9080/mpservice/greeting/hello/John%20Doe

The response should look like:

```JSON
{
    "message": "Hello",
    "name": "John Doe"
}
```

### 3. A look at MicroProfile

MicroProfile is a set of industry specifications for developing Cloud-native applications. At its foundation are a small number of Java EE specifications; JAX-RS, CDI and JSON-P, which are then augmented with technologies addressing the needs of Cloud-native applications.

The tutorial code shows example use of MicroProfile Health and Metrics.

#### MicroProfile Health

When you started Open Liberty, it wrote out a number of available endpoints.  One of those is the health endpoint for the application: http://localhost:9080/health/.

Open the health endpoint in a browser and you should see:

```JSON
{
  "checks": [
    {
      "data": {

      },
      "name": "GreetingServiceReadiness",
      "status": "UP"
    }
  ],
  "status": "UP"
}
```

The MicroProfile health for this application has an overall "outcome" which is determined by the outcome of any available individual health "checks".  If any of those checks are "DOWN" then the overall outcome is considered to be "DOWN".

As well as returning a JSON description of the health outcome, the health endpoint also reflects the outcome in the http response code.  An outcome of "UP" returns a 200 OK, whereas an outcome of "DOWN" returns a 503 Service Unavailable.  This means the endpoint can be hooked up to Kubernetes liveness or readiness probes to reflect the service availability.

The tutorial application health has one "check".  This is implemented in `src/main/java/my/demo/health/GreetingReadinessCheck.java`, the main code of which looks like:

```Java
@Readiness
@ApplicationScoped
public class GreetingReadinessCheck implements HealthCheck {

    public boolean isReady() {

        // Check the health of dependencies here

        return true;

    }

    @Override
    public HealthCheckResponse call() {
        boolean up = isReady();
        return HealthCheckResponse.named("GreetingServiceReadiness").state(up).build();
    }
}
```

MicroProfile supports two types of health checks: readiness and liveness.  These match the health checks supported by deployment environments like Kubernetes and, indeed, the MicroProfile Health APIs have been designed to integrate perfectly and Kubernetes liveness and readiness probes.

A readiness check will typically check the availability of resources the service requires in order to correctly function (e.g. services it depends on, database connections, etc).  The tutorial application has a simple example readiness check which just returns true because this service does not have any other dependencies.

You can implement many checks as part of your service and their outcomes are aggregated at the `/health/ready` endpoint.  Liveness checks are aggregated at `/health/live` and all checks are aggregated at `/health`.

Feel free to try each of these endpoints.  You'll see there's a default `/health/live` endpoint that always reports as `UP`.

http://localhost:9080/health/ready

http://localhost:9080/health/live

http://localhost:9080/health

#### MicroProfile Metrics

When you started Open Liberty it wrote out an endpoint for MicroProfile Metrics: http://localhost:9080/metrics/. If you tried to access the endpoint you will have found that it requires security configuration to work.  The Metrics endpoint is only available over https and, by default, also requires an authorized user in order to prevent disclosing potentially sensitive information.

The MicroProfile Metrics feature allows you to turn off the security requirements.  This makes it easier to test out Metrics, but is not intended for production systems.

Edit the source server configuration: `src/main/liberty/config/server.xml` and add the following line:

```XML
    <mpMetrics authentication="false" />
```

Rebuild and start the server: `mvn package liberty:run`

Now when you access the metrics endpoint you will be able to access it over http and not be asked to authenticate.

You should now see metrics data like this:

```
# TYPE base:classloader_total_loaded_class_count counter
# HELP base:classloader_total_loaded_class_count Displays the total number of classes that have been loaded since the Java virtual machine has started execution.
base:classloader_total_loaded_class_count 8807
# TYPE base:cpu_system_load_average gauge
...
```

The MicroProfile system metrics, for example, JVM heap, cpu, and garbage collection information, don't require any additional coding - they're produced automatically from the JVM.  The metrics data is in Prometheus format, the default for MicroProfile.  Using an `Accept` header on the request, you can also receive json format (not show in this tutorial).

The tutorial application also shows a MicroProfile application metric in the microservice implementation: `src/main/java/my/demo/GreetingService.java`

```Java
@Path("/hello")
@RequestScoped
public class GreetingService {

    @Inject
    @ConfigProperty(name="greetingServiceGreeting", defaultValue = "Hello")
    private String greetingStr;

    @GET
    @Path("/{name}")
    @Produces(MediaType.APPLICATION_JSON)
    @Timed(name = "sayHelloTime", displayName = "Call duration",
           description = "Time spent in call")
    public Greeting sayHello(@PathParam("name") String name) {
        return new Greeting(greetingStr, name);
    }

}
```

The `@Timed` annotation is an example of one of a number of MicroProfile metric types.  This metric produces timing information for the execution of the `sayHello` service method.  Other metrics include counting method access to measure load, or gauges for custom measurement.

Access the service endpoint to cause some application measurements to be recorded: http://localhost:9080/mpservice/greeting/hello/John%20Doe.

These measurement will be available at the `/metrics` endpoint, but you can also just see the applications metrics at: https://localhost:9443/metrics/application.

### MicroProfile Config

Externalizing configuration is one of the key tenets of 12-factor applications. Externalizing everything that varies between deployments into configuration means you can build once and deploy in the many stages of your DEvOps pipeline, thus removing the risk of your application changing between deployments and invalidating previous testing.

The tutorial application has also included the use of MicroProfile Config for injecting a configuration property using `@ConfigProperty`.  Open Liberty supports a number of `config sources`.  The tutorial shows the use of Open Liberty `bootstrap.properties`.

The `pom.xml` file contains the following configuration for the greeting:

```XML
<bootstrapProperties>
    ...
    <greetingServiceGreeting>Hello</greetingServiceGreeting>
</bootstrapProperties>
```

The maven build puts this value in: `target/ilberty/wlp/usr/servers/mpserviceServer/bootstrap.properites`

```
greetingServiceGreeting=Hello
```

This file is read at server startup and the value injected into the GreetingService bean when it is created.

Edit the pom.xml file and change the greeting to `Bonjour`

```XML
<bootstrapProperties>
    ...
    <greetingServiceGreeting>Bonjour</greetingServiceGreeting>
</bootstrapProperties>
```
Stop the server (e.g. `Ctrl-C`) and start it again: `mvn liberty:run`.

*Note: if you trigger a rebuild, the integration test will fail as it's expecting the response message to be "Hello". However, the server will still build and run.*

Call the service again to see the greeting change: http://localhost:9080/mpservice/greeting/hello/John%20Doe

You should now see:

```JSON
{
    "message": "Bonjour",
    "name": "John Doe"
}
```

This example shows static config injection, where the configuration is read at server start-up.  MicroProfile and Open Liberty also support dynamic configuration injection which means the configuration is re-read periodically (e.g. every 500ms) and so does not require a server restart.

#### MicroProfile OpenAPI

When you started Open Liberty it wrote out two endpoints for MicroProfile OpenAPI: http://localhost:9080/openapi/ and http://localhost:9080/openapi/ui/.  Clicking on the first link displays a machine-readable yaml description of the service, the format of which is defined by the OpenAPI Initiative.

```YAML
openapi: 3.0.0
info:
  title: Deployed APIs
  version: 1.0.0
servers:
- url: http://localhost:9080/mpservice
- url: https://localhost:9443/mpservice
paths:
  /greeting/hello/{name}:
    get:
      operationId: sayHello
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
      responses:
        default:
          description: default response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Greeting'
components:
  schemas:
    Greeting:
      type: object
      properties:
        message:
          type: string
        name:
          type: string
```

This yaml form of the API can be used by API Gateways or generators for clients to work with your service - for example, to generate client code to call your service.  A number of generators are available for a variety of languages.

The second link is to a web page that gives a human-readable representation of the API and also allows you to browse and call the API.

The machine-readable and Web page API descriptions are created automatically from the JAX-RS definition with no additional work required.  As a result, the information provided for your service is pretty basic.  One of the things MicroProfile OpenAPI provides is a number of annotations to enable you to provide better API documentation.

Edit the `src/main/java/my/demo/GreetingService.java` to add documentation for the operation using the @Operation annotation:

```Java
   ...
    @GET
    @Path("/{name}")
    @Produces(MediaType.APPLICATION_JSON)
    @Timed(name = "sayHelloTime", displayName = "Call duration",
           description = "Time spent in call")
    @Operation(
        summary = "Get a greeting",
        description = "Returns a greeting for the provided name.")
    public Greeting sayHello(@PathParam("name") String name) {
        return new Greeting(greetingStr, name);
    }
    ...
```

You'll also need to add the package import for the annotation:

```Java
import org.eclipse.microprofile.openapi.annotations.Operation;
```

If your service is not running and your IDE does not automatically recompile the class, re-run your build and start the server:

`mvn compile liberty:run`

Browse the OpenAPI endpoint http://localhost:9080/openapi/

You'll see that your API now has additional documentation:

```yaml
...
  /greeting/hello/{name}:
    get:
      summary: Get a greeting
      description: Returns a greeting for the provided name.
      operationId: sayHello
      parameters:
...
```

There are additional annotations available to help you document the parameters and more.

#### Further Reading

MicroProfile has many other important capabilities, such as a type-safe REST client, and fault tolerance (the ability to gracefully handle failures in service dependencies).  Visit the Open Liberty MicroProfile Guides for more details and deeper dives into what we've covered here.

### 5. Containerization (Docker)

Docker has rapidly become the containerization technology of choice for deploying cloud-native applications. All major cloud vendors support Docker, including IBM Cloud and IBM Cloud Private.

The tutorial includes a Dockerfile for building a docker image for the Microservice.  This Dockerfile is based on the Open Liberty docker image from Docker Hub and adds in the project's server configuration and application from an Open Liberty 'usr server package'.  A usr server package only contains an application and server configuration and is designed to be unzipped over an existing Open Liberty installation (such as the one on the Liberty Docker image).  The advantage of this approach over putting a 'fat jar' (an option supported by Liberty as well as Spring Boot) which contains a lot of infrastructure code, in a docker container, is Docker will cache the pre-req infrastructure layers (e.g. Open Liberty, Java, etc) which makes building and deploying much faster.

#### Build a usr server package

By default the `pom.xml` builds a 'fat jar': `target/mpservice.jar` so we need to build a different package that only includes the server configuration and application (not the server runtime) - a `usr` server package.

The project's maven pom file includes a maven profile for building a usr package, which isn't built by default.  Build the usr server package with: `mvn -P usr-package install`

This results in a server zip package: `target/defaultServer.zip`.  In the `usr-package` build we also use the name `defaultServer` for the server because this is the name of the server the base Liberty Docker images automatically runs when the container is started.

#### Build and run in Docker

In the directory where the `Dockerfile` is located run: `docker build -t my-demo:mpservice .`

If the server is already running, stop it: `mvn liberty:stop` or `Ctrl-C`

Run the docker image: `docker run -p 9080:9080 -p 9443:9443 my-demo:mpservice`

Because the service is running in docker you need to access it on <IP_ADDRESS>: <a href="http://<IP_ADDRESS>:9080/mpservice/greeting/hello/John%20Doe">http://<IP_ADDRESS>:9080/mpservice/greeting/hello/John%20Doe

Note: the `open-liberty` image referenced in the Dockerfile is based on IBM Java (built on Open J9) because we wanted to re-use the official Open Liberty Docker image. Creating an image based on Open J9 would be relatively straightforward.

## Summary

Congratulations, you've have built, a cloud-native application, seen how you can monitor it for health and metrics, change it's configuration, and package and run it in Docker, ready for deployment to your cloud of choice.  I recommend IBM Cloud or IBM Cloud Private, of course ;)

repository: gcharters/open-cloud-native-intro

repo_name: gcharters/open-cloud-native-intro


text:
# Apollo Client with `@defer` support

This branch of `apollo-client` has `@defer` support on top of the latest master, along with a fix for https://github.com/apollographql/apollo-client/issues/4484.

As soon as I can make https://github.com/rmosolgo/graphql_defer_example work without this fork, I'll stop maintaining it.

### Installing

This repo contains several TypeScript libraries which must be copied locally, "compiled", then installed with yarn.

#### Copy & Compile

```sh
$ git submodule add git@github.com:rmosolgo/apollo-client.git
$ # installs this fork into `./apollo-client`
$ cd apollo-client
$ npm install
$ # installs dependencies and compiles typescript
```

#### Installing from local files

Add to your `package.json`, for example, `apollo-boost`:

```js
  "apollo-boost": "file:./path/to/apollo-client/packages/apollo-boost",
```

(If you need specific other packages, do the same thing for those other packages.)

Then, `yarn install`.

repository: Tech-at-DU/apollo-client

repo_name: Tech-at-DU/apollo-client


text:
rancher-cattle-metadata
===============

This image permit to get config from Rancher metadata and expose them on `scheduler.cfg`.
In fact, on application container we use Confd, but it doesn't permit to get config in few backend at the same time. So we source `scheduler.cfg` before run Confd and then we use `getenv` to get scheduler config.

## How use it

1. Just add this image as sidekick on your application container and set it as volume-from.
2. On your init strategy call all scripts (on begining) exposed by this image in `/opt/scheduler/script.d`.
For exemple, if you use s6-overlay add `/etc/cont-init.d/00-extract-scheduler.sh`:
```sh
#!/usr/bin/with-contenv sh
if [ -d "${SCHEDULER_VOLUME}/script.d" ]; then
  for SCRIPT in ${SCHEDULER_VOLUME}/script.d/*
	do
		if [ -f $SCRIPT ]
		then
			sh $SCRIPT
		fi
	done
fi
```
3. Then, source `/opt/scheduler/conf/scheduler.cfg` before launch Confd that manage your application setting.
```sh
#!/usr/bin/with-contenv sh
if [ "${CONFD_NODES}X" == "X" ]; then
  NODE=""
else
  NODE="-node ${CONFD_NODES}"
fi
# Get setting from scheduler
if [ -f "${SCHEDULER_VOLUME}/conf/scheduler.cfg" ]; then
  source "${SCHEDULER_VOLUME}/conf/scheduler.cfg"
fi
${CONFD_HOME}/bin/confd -confdir ${CONFD_HOME}/etc -onetime -backend ${CONFD_BACKEND} ${PREFIX} ${NODE}
```

4. To finish, add condition on your Confd template to use environment variable exposed by scheduler.cfg.
For example :
```sh
{{ if (getenv "SCHEDULER_CONTAINERS_IP") }}
  # Use setting provided by scheduler
{{ else }}
  # Use setting that you provide
{{ end }}
```

## Data exposed by scheduler

The following environment variable are exposed by `scheduler.cfg`:
- **SCHEDULER_CONTAINERS_IP**: The list of primary IP for each containers that composed the current service separated by coma. For example "<IP_ADDRESS>,<IP_ADDRESS>,<IP_ADDRESS>".
- **SCHEDULER_CONTAINER_IP**: The primary IP of the current container. For example "<IP_ADDRESS>".
- **SCHEDULER_CONTAINER_NAME**: The name of the current container.
- **SCHEDULER_CONTAINER_INDEX**: The index of the current container.
- **SCHEDULER_CONTAINER_STATE**: The state of the current container.
- **SCHEDULER_SERVICE_NAME**: The name of the current service.
- **SCHEDULER_SERVICE_SCALE**: The number of instance in the current service.
- **SCHEDULER_SERVICE_PORTS**: The list of ports exposed in the current server, separated by coma.
- **SCHEDULER_STACK_NAME**: The name of the current stack.
- **SCHEDULER_HOST_NAME**: The name of the current host.
- **SCHEDULER_HOST_IP**: The public IP of the current host.
- **SCHEDULER_HOST_HOSTNAME**: The hostname of the current host.
- **SCHEDULER_CONTAINERS_COUNT**: The number of current instance that exist on service


text:
# d3-streamline

An update to [d3.svg.ribbon](https://github.com/emeeks/d3.svg.ribbon) as a D3 v4+ module/plugin.
Designed to interpolate ribbon or band areas based on sample points with radii.

![d3-streamline](images/example.png)

[Interactive example](http://bl.ocks.org/emeeks/a1e48992be56681e3f93)

Thicknesses get attenuated creating bump charts with d3.area. If they jump between ranks too significantly, it makes the corresponding graphical transition look too thin. Like the circled blue area, which is rendered significantly thinner than if it was being drawn horizontally.

![d3-streamline](images/area_bump.png)

In contrast, the same bump chart using d3-streamline does not create these attenuation artifacts.

![d3-streamline](images/ribbon_bump.png)

## Installing

If you use NPM, `npm install d3-streamline`. Otherwise, download the [latest release](https://github.com/gordongli/d3-streamline/releases/latest).

## API Reference

# streamline.x([x])

The x-accessor for the points array, just like d3.line and d3.area. Defaults to returning d.x.

# streamline.y([y])

The y-accessor for the points array, just like d3.line and d3.area. Defaults to returning d.y.

# streamline.r([r])

The radius accessor for the points array. This determines the thickness of the stream at that point. Defaults to returning d.r.

# streamline.curve([curve])

The D3 curve interpolator method to use. Default is d3.curveLinearClosed.


text:
# Razor Component multi render

This sample shows the ability for Blazor to host components with different rendering mode in a single Razor Component Page.

The Razor Component Page is server side render. It hosts "number" component with with Streaming rendering and hosts "interactive" component backed by Blazor Web Assembly.

The Web Assembly components **need to be hosted in a separate project**.

repository: dodyg/practical-aspnetcore

gha_language: C#

repo_name: dodyg/practical-aspnetcore


text:
## ECBM 4040 Final Project: [Learning-based EM image segmentation]
Our group dealt with the segmentation of electron microscopy (EM) images of neuronal structures using the PyraMid-LSTM model proposed by the [paper](https://arxiv.org/abs/1506.07452). We also achieved a Multi-Dimensional LSTM (MD-LSTM) model for comparison.

### Group: DPLN
* 	Huixiang Zhuang<EMAIL_ADDRESS>>https://github.com/hz2538
* 	Yutao Tang<EMAIL_ADDRESS>>https://github.com/yt2639
* 	Xuzhe Zhang<EMAIL_ADDRESS>>https://github.com/XuzheZ

### Getting Started
These instructions will provide you a guideline for our basic functions as well as how to running on your machine for development and testing purposes.
#### Prerequisites
>python 3.6 (some specific packages you may need)
>>numpy:         pip install numpy
>
>>libtiff:        pip install libtiff
>
>>tensorflow:      pip install tensorflow-gpu
>
>>matplotlib:      pip install matplotlib

>Jupyter Notebook

#### Introducing the files in project
main.iqynp
>This script is our main jupyter notebook. Implemented our whole project.
>
loaddata.iqynp
>This script is our second jupyter notebook. However, you have to run it first, since it will read the tiff file and convert it to array
>make sure you hace already install libtiff before using it.
./DPLN/pyramidLSTM.py
>
>
./DPLN/Net_PyramidLSTM.py
>
>
./DPLN/MDLSTM.py
>
>
./DPLN/Net_MDLSTM.py
>Above py files define the layers.
>
./DPLN/ProcGenerator.py
>This py file is refered to as a batch generator.
>
./DPLN/ProcessingV2.py
>This py file provides the basic function for image preprocessing, including ROF denoise, Z-score normalization and augmentation.
>
test-volume.tiff, train-volume.tiff, train-label.tiff
>They are the training data, labels and test data. Because it is a little tricky to download them, we provide them in the submission
>
./model
>Save the trained model in this folder
mainOut256.iqynb
>this is the automated produced version when we trained our model on the serverl. It record the printout output while training the Pyramid-LSTM, with a batch size 256*256
>
### Running the test
#### 1. Firstly,  _run the loaddata.iqynb_ to read the tiff image.
#### 2. Secondly, Open _**main.iqynb**_  through Jupyter Notebook:
* Run the **first several cells** to finish modules importing, to load the data and labels as well as to implement preprocessing
    * This step will print out the size of data and label
    * This step apply ROF denoise and Z-score to training data and test data, and also apply data augmentation to training data and labels
* For PyramidLSTM training, run the **corresponding cell** (which contains training function)
    * Set up proper batch_size (how many batch used in one step), input size (the size of voxel batch, and max_step (training steps).
    * The recommendation is: batch_size=1, input_size=[128,128,15], max_step=1000, (256*256 training is very time-consuming, may take about 12 mins for 10 steps)
    * This step will print out the number of net parameters, restored model, and will display the loss for every 10 steps.
* For PyramidLSTM validation, run the **corresponding cell** (which contains validation function)
    * The fifth cell will reshape and save the validation sets remained in the training. It will print out th size of validation set.
    * The sixth cell can load the saved validation set.
    * The seventh cell will prediction for validation sets. And you can run the next two cells to save the prediction to .tiff file.
* For PyramidLSTM test, run the run the **corresponding cell** (which contains test function)
    * This step will use the trained model "model/pyramidnet_size128" to finish the prediction for test data. You can run the next cell to save the prediction result to .tiff file. And upload this 32-bit .tiff file to [2012 ISBI Challenge](http://brainiac2.mit.edu/isbi_challenge/) for evaluation.
* Please kindly notice that, in the main.iqynb, some cells have been to converted Markdown, if you find some cell can't run, please kindly try to convert above or below cells to code, and try again. We don't have so many time to clean them. Sorry for any inconvenience, we very appreciate your understanding.

####  Or: Run _**main.iqynb**_ from terminal
* You can also run the script from terminal, after enter your proper environment, and cd to the proper folder by
>cd ./project
* and input:
>$ jupyter nbconvert --to notebook --execute --allow-errors --ExecutePreprocessor.timeout=600 main.ipynb
>

### Our data set
In our project, the data set we uesd is The Drosophila first instar larva ventral nerve cord (VNC, [Cardona et al., 2010, 2012](https://www.ini.uzh.ch/~acardona/trakem2.html)) , provided by [2012 ISBI Challenge: Segmentation of neuronal structures in EM stacks](http://brainiac2.mit.edu/isbi_challenge/). It contains 30 consecutive images as the training set with the ground truth 2D segmentation as training labels, as well as 30 consecutive images as the testing set. The microcube measures 2 x 2 x 1.5 microns approx, with a resolution of 4x4x50 nm/pixel. ![**Templete training data and labels**](http://brainiac2.mit.edu/isbi_challenge/sites/default/files/Challenge-ISBI-2012-Animation-Input-Labels.gif)Templete training data and labels (image from [ISBI](http://brainiac2.mit.edu/isbi_challenge/))
This dataset is not completely public. If you want to get access to the dataset, you have to [register](http://brainiac2.mit.edu/isbi_challenge/user/register), to login and then you can download the data. Since the dataset is relative small-size: 3 .tiff file, including 30 slices of 512*512 TEM images, with a size about 180MB. So we will provide the dataset in our submission.

### Evaluation
The evaluation of the test result is based on two empirical metrics: **Foreground-restricted Rand Scoring after border thinning**: $V^{Rand}$ and **Foreground-restricted Information Theoretic Scoring after border thinning**: $V^{Info}$.
Since the ground-truth of test data is not provided publicly, to evaluate the test result, you have to register and login the [2012 ISBI Challenge](http://brainiac2.mit.edu/isbi_challenge/) website and then upload the result. The evaluation is manually implemented by the logistics of ISBI, so it may take some time.

### Our result
![test image](https://github.com/XuzheZ/DPLN-EMSeg/blob/master/images/test.GIF?raw=true)Test data ![prediction](https://github.com/XuzheZ/DPLN-EMSeg/blob/master/images/prediction.GIF?raw=true)Prediction

### Leaderboard
![Leaderboard](https://github.com/XuzheZ/DPLN-EMSeg/blob/master/images/leaderboard.png?raw=true)Leaderboard

repository: huazhz/DPLN-EMSeg

repo_name: huazhz/DPLN-EMSeg


text:
### Project Information:
Project: Spirent TestCenter Basics
Description: Provides basic traffic quickcalls for the Spirent TestCenter session type and response maps for result and statistics views
Category: library
Class: Tested by Spirent

Tags: Test Equipment, Traffic Generator

 ----
1 quickcall library in project
## Quickcall Library: Spirent_TestCenter_QCLib.fftc
### Spirent TestCenter QuickCall Library
Spirent TestCenter basic Quickcalls
### StartArp
```
Starts ARP/ND on all devices in config. Returns status in a JSON block.
Returns block
 status "OK" if all ARPs resolve successfully, "error" otherwise
```

### RunTraffic
```
Run all traffic generators in current STC config for a specified time and return basic traffic stats.
```

Argument	Description

run_time	Time in seconds to run traffic

### StartTraffic
```
Start all traffic generators in current STC config
```

### StopTraffic
```
Stop all traffic generators in current STC config
```

### GetPortInfo
```
Get info on all ports in the current STC config.
```

41 response maps in project
## Response Map File: STC_open.ffrm
## Response Map File: 2214-filter2-output.ffrm
## Response Map File: get_port_location.ffrm
## Response Map File: show_analyzer_port_results.ffrm
## Response Map File: StreamBlockResults_Advanced_Sequencing_1.ffrm
## Response Map File: conformance_get_execution_results.ffrm
## Response Map File: show_streamblock_results.ffrm
## Response Map File: StreamThresholdResults1.ffrm
## Response Map File: StreamBlockResults1.ffrm
## Response Map File: show_stats_RSVP_Aggregated_Statistics.ffrm
## Response Map File: spirent_lab_server_ps_ax.ffrm
## Response Map File: StreamBlockResults_Basic_Counters_1.ffrm
## Response Map File: show_stats_Traffic_Item_Statistics.ffrm
## Response Map File: show_stream_block.ffrm
## Response Map File: 2213-filter1-output.ffrm
## Response Map File: show_igmp_port_results.ffrm
## Response Map File: show_rsvp_results_466.ffrm
## Response Map File: drv_aggregate_streamblock.ffrm
## Response Map File: IsisResults__ISIS__466.ffrm
### show ISIS results STC
Response map for 'show ISIS results' STC command. PLease take a look at IsisResults_ISIS_466_pattern.ffrm
This response map cannot be used because sample is incomplete. A column is missing
### show ISIS results STC
Response map for 'show ISIS results' STC command. PLease take a look at IsisResults_ISIS_466_pattern.ffrm
This response map cannot be used because sample is incomplete. A column is missing
## Response Map File: showPorts.ffrm
## Response Map File: BgpRouterResults.ffrm
## Response Map File: show_dhcpv4_block_results.ffrm
## Response Map File: show_stats_Flow_Statistics.ffrm
## Response Map File: TxStreamBlockResults.ffrm
## Response Map File: STC_lappend_routerconfigList.ffrm
## Response Map File: BgpResults.ffrm
## Response Map File: 2215-filter3-output.ffrm
## Response Map File: IsisResults__ISIS__466_pattern.ffrm
### show ISIS results STC command
It replaces 'ISISresults__ISIS__466' rpm output which has a missing column.
### show ISIS results STC command
It replaces 'ISISresults__ISIS__466' rpm output which has a missing column.

repository: Spirent/iTest-assets

repo_name: Spirent/iTest-assets


text:
# iCanHazMusic
A music player for macOS 10.12 or higher. Currently in active development, early preview version can be downloaded on [the releases page](https://github.com/deseven/iCanHazMusic/releases).

![iCHM screenshot](https://d7.wtf/s/GollySuspectfulNonrealization.png)

## Why
I was a big fan of the legendary [foobar2000](https://www.foobar2000.org/) until I moved to macOS in 2010. Naturally, for some time I continued using foobar under Wine, but the experience was subpar and eventually I started jumping from player to player. Some notable examples in no particular order:
 - [Clementine](https://www.clementine-player.org/) with its [6 year old bug](https://github.com/clementine-player/Clementine/issues/4733) that makes it eat up to 50% of CPU for a simple mp3 playback
 - [cmus](https://cmus.github.io/), which was fun and all, but just a bit too minimalistic
 - [DeaDBeeF](https://deadbeef.sourceforge.io/) with no stable release and insane bugs, although the development of the macOS version started 7 years ago and is pretty active to this day
 - [mac version of foobar2000](https://www.foobar2000.org/mac) which is a fucking joke of a player

I remember many other apps, both free and paid, however each and every one of them did lack something important. It's also worth mentioning that with every year the chance to get a decent desktop audio player is only getting lower and lower - it's an age of cloud music now, not many people are still interested in those mammoths of a bygone era. Hell, even I will probably go cloud in the coming years, I already use [iBroadcast](https://www.ibroadcast.com/) as a mobile and web player. However, the urge of having a good desktop player is still here for me, that's why I finally decided to go for it myself.

It's by no means a replacement for foobar2000, just my personal compilation of things I would like to see in an audio player. Nothing is set in stone, however, feel free to create new issues with feedback and suggestions.

## Current state
#### What should work
 - m4a, aac, mp3, wav, ogg, flac and aiff playback
 - last.fm scrobbling and now playing updates (enable it in the menu)
 - playback navigation and queue
 - grouping by albums
 - dock menu
 - big (10k+ entries) playlists
 - window size and position saving
 - album art from external files
 - lyrics loading from Genius (if you installed the lyricsgenius module, see the section below)

#### What should work in the future
 - global hotkeys for playback
 - album art from tags
 - playlist entries rearrangement
 - seekbar
 - volume control
 - shuffle
 - drag'n'drop operations
 - playlist search

#### What NOT to expect
 - gapless playback (well, maybe someday...)
 - CUE support
 - equalizer
 - tags editing, format conversion and other Swiss knife functions
 - advanced foobar2000-level customization (i'm too dumb for that, sorry)

## Enabling lyrics loading
This should be changed in the future but for now in order for this to work you need to install [python3 from<EMAIL_ADDRESS>with `brew install<EMAIL_ADDRESS>and then [lyricgenius module](https://pypi.org/project/lyricsgenius/) with `pip3 install lyricsgenius`. Test that this works in your terminal:
`/usr/local/bin/python3 -m lyricsgenius -h`

## Compiling from source
iCHM is created in [PB](http://purebasic.com) and depends on [pb-macos-audioplayer](https://github.com/deseven/pb-macos-audioplayer), along with [pb-httprequest-manager](https://github.com/deseven/pb-httprequest-manager).
You also need [node-appdmg](https://github.com/LinusU/node-appdmg) if you want to build dmg.
1. Obtain the latest LTS version of pbcompiler, install it to ```/Applications```.
2. Install xcode command line tools by running ```xcode-select --install```.
3. Clone iCHM repo.
4. Clone ```pb-macos-audioplayer``` and ```pb-httprequest-manager``` modules to neighboring directories.
5. Run the included ```build/build.sh``` script to build the app. If you want codesigning then provide your developer ID as a first argument.

license: Unlicense


text:
# interpolate-sw-plugin

[![NPM version](https://img.shields.io/npm/v/interpolate-sw-plugin.svg?style=flat)](https://npmjs.com/package/interpolate-sw-plugin) [![NPM downloads](https://img.shields.io/npm/dm/interpolate-sw-plugin.svg?style=flat)](https://npmjs.com/package/interpolate-sw-plugin) [![Build Status](https://travis-ci.org/manu-garcia/interpolate-sw-plugin.svg?branch=master)](https://travis-ci.org/manu-garcia/interpolate-sw-plugin)

InterpolateSWPlugin is a webpack plugin that will replace, in your own implementation of a service worker, an auto generated cache version string and a list of webpack compiled assets for pre-cache purposes.

Notes:

  - When developing with webpack dev server, the file will be watched for changes.
  - When building assets, the file will be interpolated and copied to the destination folder configured in your webpack config.

## Install

```bash
yarn add interpolate-sw-plugin --dev
```

## Usage

"%SW_CACHE_VERSION%": An automatically generated version string for your cache. Use "%SW_CACHE_VERSION%" variable in your service worker. Please note the double quotes around "%SW_CACHE_VERSION%":

```js
  caches.open('cache-name-v' + '"%SW_CACHE_VERSION%"') ...
```
"%SW_ASSET_FILES%": A coma-separated list of assets generated by webpack for pre-cache purposes. Use "%SW_ASSET_FILES%" variable in your service worker. Please note the double quotes around "%SW_ASSET_FILES%":

```js
  cache.addAll(["%SW_ASSET_FILES%"]);
```

Call the plugin from your webpack configuration:

```js
module.exports = {
  plugins: [
    new InterpolateSWPlugin({
      // Your source sw template full path. Not opinionated service worker implementation having variables to be replaced.
      from: path.resolve(__dirname, './public/sw.js'),
      // Destination file inside your build directory, after replacing variables.
      to: 'sw.js',
      // Activate or deactivate replacement of the version variable %SW_CACHE_VERSION%
      replaceCacheVersion: true | false,
      // Activate or deactivate replacement of the files variable %SW_ASSET_FILES%
      replaceAssetFiles: true | false,
      // This config will replace your own Service Worker with a dummy one (if true),
      // effectively deactivates all service worker functionalities.
      deactivateSW: true | false,
    }),
  ]
}
```

repository: manu-garcia/interpolate-sw-plugin

repo_name: manu-garcia/interpolate-sw-plugin


text:
# Answers for Questions

### Q5a
**Question:** Choose __one__ comparison scenario and create at least three alternative designs that would allow this comparison.

-
**Answer:**

- put your sketches in folder [designStudio/](designStudio/)

- add any additional comments here

### Q5b
**Question:** Implement one design in your visualization for **PrioVis** and explain why you have chosen this design.

-
**Answer:**

- your reasoning goes here.

### Q5c
**Question:** As a very minimal case study submit a screenshot of an interesting pattern which you have found with your method and briefly describe the pattern.

-
**Answer:**

- your description goes here