text:
---
title:  new_activity_metrics plugin
description: Learn how to use the new_activity_metrics plugin to calculate activity metrics.
ms.reviewer: alexans
ms.topic: reference
ms.date: 01/08/2023
---
# new_activity_metrics plugin

Calculates useful activity metrics (distinct count values, distinct count of new values, retention rate, and churn rate) for the cohort of `New Users`. Each cohort of `New Users` (all users, which were first seen in time window) is compared to all prior cohorts.
Comparison takes into account *all* previous time windows. For example, for records from T2 to T3, the distinct count of users will be all users in T3 who weren't seen in both T1 and T2.
The plugin is invoked with the [`evaluate`](evaluateoperator.md) operator.

## Syntax

*TabularExpression* `| evaluate` `new_activity_metrics(`*IdColumn*`,` *TimelineColumn*`,` *Start*`,` *End*`,` *Window* [`,` *Cohort*] [`,` *dim1*`,` *dim2*`,` ...] [`,` *Lookback*] `)`

## Parameters

| Name | Type | Required | Description |
|--|--|--|--|
| *TabularExpression*| string | ✓ | The tabular expression for which to calculate activity metrics.|
| *IdColumn*| string | ✓ | The name of the column with ID values that represent user activity.|
| *TimelineColumn*| string | ✓ | The name of the column that represents the timeline.|
| *Start*| scalar | ✓ | The value of the analysis start period.|
| *End*| scalar | ✓ | The value of the analysis end period.|
| *Window*| scalar | ✓ | The value of the analysis window period. Can be a numeric, datetime, or timespan value, or a string that is one of `week`, `month` or `year`, in which case all periods will be [startofweek](startofweekfunction.md)/[startofmonth](startofmonthfunction.md)/[startofyear](startofyearfunction.md) accordingly. When using `startofweek`, make sure start time is a Sunday, otherwise first cohort will be empty (since [startofweek](startofweekfunction.md) is considered to be a Sunday).|
| *Cohort*| scalar | | Indicates a specific cohort. If not provided, all cohorts corresponding to the analysis time window are calculated and returned.|
| *dim1*, *dim2*, ...| dynamic | | An array of the dimensions columns that slice the activity metrics calculation.|
| *Lookback*| string | | A tabular expression with a set of IDs that belong to the 'look back' period.|

## Returns

Returns a table that contains the following for each combination of 'from' and 'to' timeline periods and for each existing column (dimensions) combination:

* distinct count values
* distinct count of new values
* retention rate
* churn rate

Output table schema is:

|from_TimelineColumn|to_TimelineColumn|dcount_new_values|dcount_retained_values|dcount_churn_values|retention_rate|churn_rate|dim1|..|dim_n|
|---|---|---|---|---|---|---|---|---|---|
|type: as of *TimelineColumn*|same|long|long|double|double|double|..|..|..|

* `from_TimelineColumn` - the cohort of new users. Metrics in this record refer to all users who were first seen in this period. The decision on *first seen* takes into account all previous periods in the analysis period.
* `to_TimelineColumn` - the period being compared to.
* `dcount_new_values` - the number of distinct users in `to_TimelineColumn` that weren't seen in *all* periods prior to and including `from_TimelineColumn`.
* `dcount_retained_values` - out of all new users, first seen in `from_TimelineColumn`, the number of distinct users that were seen in `to_TimelineCoumn`.
* `dcount_churn_values` - out of all new users, first seen in `from_TimelineColumn`, the number of distinct users that weren't seen in `to_TimelineCoumn`.
* `retention_rate` - the percent of `dcount_retained_values` out of the cohort (users first seen in `from_TimelineColumn`).
* `churn_rate` - the percent of `dcount_churn_values` out of the cohort (users first seen in `from_TimelineColumn`).

>[!NOTE]
>For definitions of `Retention Rate` and `Churn Rate` - refer to **Notes** section in [activity_metrics plugin](./activity-metrics-plugin.md) documentation.

## Examples

The following sample data set shows which users seen on which days. The table was generated based on a source `Users` table, as follows:

```kusto
Users | summarize tostring(make_set(user)) by bin(Timestamp, 1d) | order by Timestamp asc;
```

**Output**

|Timestamp|set_user|
|---|---|
|2019-11-01 00:00:00.0000000|[0,2,3,4]|
|2019-11-02 00:00:00.0000000|[0,1,3,4,5]|
|2019-11-03 00:00:00.0000000|[0,2,4,5]|
|2019-11-04 00:00:00.0000000|[0,1,2,3]|
|2019-11-05 00:00:00.0000000|[0,1,2,3,4]|

The output of the plugin for the original table is the following:

```kusto
let StartDate = datetime(2019-11-01 00:00:00);
let EndDate = datetime(2019-11-07 00:00:00);
Users
| evaluate new_activity_metrics(user, Timestamp, StartDate, EndDate-1tick, 1d)
| where from_Timestamp < datetime(2019-11-03 00:00:00.0000000)
```

**Output**

|R|from_Timestamp|to_Timestamp|dcount_new_values|dcount_retained_values|dcount_churn_values|retention_rate|churn_rate|
|---|---|---|---|---|---|---|---|
|1|2019-11-01 00:00:00.0000000|2019-11-01 00:00:00.0000000|4|4|0|1|0|
|2|2019-11-01 00:00:00.0000000|2019-11-02 00:00:00.0000000|2|3|1|0.75|0.25|
|3|2019-11-01 00:00:00.0000000|2019-11-03 00:00:00.0000000|1|3|1|0.75|0.25|
|4|2019-11-01 00:00:00.0000000|2019-11-04 00:00:00.0000000|1|3|1|0.75|0.25|
|5|2019-11-01 00:00:00.0000000|2019-11-05 00:00:00.0000000|1|4|0|1|0|
|6|2019-11-01 00:00:00.0000000|2019-11-06 00:00:00.0000000|0|0|4|0|1|
|7|2019-11-02 00:00:00.0000000|2019-11-02 00:00:00.0000000|2|2|0|1|0|
|8|2019-11-02 00:00:00.0000000|2019-11-03 00:00:00.0000000|0|1|1|0.5|0.5|
|9|2019-11-02 00:00:00.0000000|2019-11-04 00:00:00.0000000|0|1|1|0.5|0.5|
|10|2019-11-02 00:00:00.0000000|2019-11-05 00:00:00.0000000|0|1|1|0.5|0.5|
|11|2019-11-02 00:00:00.0000000|2019-11-06 00:00:00.0000000|0|0|2|0|1|

Following is an analysis of a few records from the output:

* Record `R=3`, `from_TimelineColumn` = `2019-11-01`,  `to_TimelineColumn` = `2019-11-03`:
  * The users considered for this record are all new users seen on 11/1. Since this is the first period, these are all users in that bin – [0,2,3,4]
  * `dcount_new_values` – the number of users on 11/3 who weren't seen on 11/1. This includes a single user – `5`.
  * `dcount_retained_values` – out of all new users on 11/1, how many were retained until 11/3? There are three values (`[0,2,4]`), while `count_churn_values` is one (user=`3`).
  * `retention_rate` = 0.75 – the three retained users out of the four new users who were first seen in 11/1.

* Record `R=9`, `from_TimelineColumn` = `2019-11-02`,  `to_TimelineColumn` = `2019-11-04`:
  * This record focuses on the new users who were first seen on 11/2 – users `1` and `5`.
  * `dcount_new_values` – the number of users on 11/4 who weren't seen through all periods `T0 .. from_Timestamp`. Meaning, users who are seen on 11/4 but who weren't seen on either 11/1 or 11/2 – there are no such users.
  * `dcount_retained_values` – out of all new users on 11/2 (`[1,5]`), how many were retained until 11/4? There's one such user (`[1]`), `while count_churn_values` is one (user `5`).
  * `retention_rate` is 0.5 – the single user that was retained on 11/4 out of the two new ones on 11/2.

### Weekly retention rate, and churn rate (single week)

The next query calculates a retention and churn rate for week-over-week window for `New Users` cohort (users that arrived on the first week).

> [!div class="nextstepaction"]
> <a href="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAA21Ry27DIBC85yvmFmht2U4V5VDlVqk/0FtVWcisExIbLNg8LPXjC7arHFoOsBpmZ9ihKPBOlrxigldWux5asYJrcQnkoRo2V8OGwqojRh1YecY+kYhNT2JTVru83OZlJV9nCln9H+ElEaLFgfCmRrQ+Wi1y7OauwDSg0qtv0J0TkITYdc4ehEhN+dIhUUSefBB9JKbnC4lnVA+8TkOE/WQrFiWNJ2zLuHmZ4Q8W+zflXOWoIqOSiHr9Naf7EB1g9H5WTc/mcSDXiqQh0ZneMKpyWquiwIc6E5ztRvCR0BofGDeiMxp3dHFu0amIDMqrnpj8NM9VdZf0GZZu9RL+WMdrb5ogPtdGr7+yFGC2RJFN0WXY6V8kyQzenajhKeV6YrObTx+dLBtn6/TnGZrjxc/1D5PKiK4LAgAA" target="_blank">Run the query

```kusto
// Generate random data of user activities
let _start = datetime(2017-05-01);
let _end = datetime(2017-05-31);
range Day from _start to _end step 1d
| extend d = tolong((Day - _start) / 1d)
| extend r = rand() + 1
| extend _users=range(tolong(d * 50 * r), tolong(d * 50 * r + 200 * r - 1), 1)
| mv-expand id=_users to typeof(long) limit 1000000
// Take only the first week cohort (last parameter)
| evaluate new_activity_metrics(['id'], Day, _start, _end, 7d, _start)
| project from_Day, to_Day, retention_rate, churn_rate
```

**Output**

|from_Day|to_Day|retention_rate|churn_rate|
|---|---|---|---|
|2017-05-01 00:00:00.0000000|2017-05-01 00:00:00.0000000|1|0|
|2017-05-01 00:00:00.0000000|2017-05-08 00:00:00.0000000|0.544632768361582|0.455367231638418|
|2017-05-01 00:00:00.0000000|2017-05-15 00:00:00.0000000|0.031638418079096|0.968361581920904|
|2017-05-01 00:00:00.0000000|2017-05-22 00:00:00.0000000|0|1|
|2017-05-01 00:00:00.0000000|2017-05-29 00:00:00.0000000|0|1|

### Weekly retention rate, and churn rate (complete matrix)

The next query calculates retention and churn rate for week-over-week window for `New Users` cohort. If the previous example calculated the statistics for a single week - the following query produces an NxN table for each from/to combination.

> [!div class="nextstepaction"]
> <a href="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAA22RwWrDMBBE7/mKuUVqbWynhByKb4Ve+gelGGFtUhVbMtImTaAf35VtyKH1QRbL25ndUVXhlTxFw4RovA0jrGGDcMQ5UYTp2V0cO0qbgRhdYhMZbYaI3UhqVzeHst6XdaOfF4S8/Q94yoBYnAgv5oZjFKtVjsPSlZgmNHbzA7pyLmQhDkPwJ6VyU7l2aFTC6TsYBczjK41HNPd6l5dI7WyrViWLB+xrOaIu8Kcm/bt6uZVohGg0RG+8lHSdxAHOtotqHptvE4Wjyhoagxsdo6nnb1NVeDOJMZloRmLJ0iUEIZisSOcZL2Y45+A9fXdr0LdO2Oj6pN63zm4/ihxWsa5dzDEVOMyrTzF8Uc9zkt1McVj+Uew8u+C7/K4F+s9zXO6/Mr0rj+8BAAA=" target="_blank">Run the query

```kusto
// Generate random data of user activities
let _start = datetime(2017-05-01);
let _end = datetime(2017-05-31);
range Day from _start to _end step 1d
| extend d = tolong((Day - _start) / 1d)
| extend r = rand() + 1
| extend _users=range(tolong(d * 50 * r), tolong(d * 50 * r + 200 * r - 1), 1)
| mv-expand id=_users to typeof(long) limit 1000000
// Last parameter is omitted -
| evaluate new_activity_metrics(['id'], Day, _start, _end, 7d)
| project from_Day, to_Day, retention_rate, churn_rate
```

**Output**

|from_Day|to_Day|retention_rate|churn_rate|
|---|---|---|---|
|2017-05-01 00:00:00.0000000|2017-05-01 00:00:00.0000000|1|0|
|2017-05-01 00:00:00.0000000|2017-05-08 00:00:00.0000000|0.190397350993377|0.809602649006622|
|2017-05-01 00:00:00.0000000|2017-05-15 00:00:00.0000000|0|1|
|2017-05-01 00:00:00.0000000|2017-05-22 00:00:00.0000000|0|1|
|2017-05-01 00:00:00.0000000|2017-05-29 00:00:00.0000000|0|1|
|2017-05-08 00:00:00.0000000|2017-05-08 00:00:00.0000000|1|0|
|2017-05-08 00:00:00.0000000|2017-05-15 00:00:00.0000000|0.405263157894737|0.594736842105263|
|2017-05-08 00:00:00.0000000|2017-05-22 00:00:00.0000000|0.227631578947368|0.772368421052632|
|2017-05-08 00:00:00.0000000|2017-05-29 00:00:00.0000000|0|1|
|2017-05-15 00:00:00.0000000|2017-05-15 00:00:00.0000000|1|0|
|2017-05-15 00:00:00.0000000|2017-05-22 00:00:00.0000000|0.785488958990536|0.214511041009464|
|2017-05-15 00:00:00.0000000|2017-05-29 00:00:00.0000000|0.237644584647739|0.762355415352261|
|2017-05-22 00:00:00.0000000|2017-05-22 00:00:00.0000000|1|0|
|2017-05-22 00:00:00.0000000|2017-05-29 00:00:00.0000000|0.621835443037975|0.378164556962025|
|2017-05-29 00:00:00.0000000|2017-05-29 00:00:00.0000000|1|0|

### Weekly retention rate with lookback period

The following query calculates the retention rate of `New Users` cohort when taking into
consideration `lookback` period: a tabular query with set of Ids that are used to define
the `New Users` cohort (all IDs that don't appear in this set are `New Users`). The
query examines the retention behavior of the `New Users` during the analysis period.

> [!div class="nextstepaction"]
> <a href="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAA22SzW6DMBCE7zzFHO0WBKSKcki4VepjIBdvUjeAkdn8SXn42jgpjVIfMFq+nR2PyXN8UE9OMcGpXtsOWrGC3eIwkoNq2BwNGxqTlhh1a+3+UzV7VIEjNh2JRVGusmKRFaVcR2pk5fgZWf5BqNf/AW+/wGSjCqZ2hHd1wdZ5c7MBtlFkZBpQ6gR+XUFnDsWgzba1/U6I0JvNjRK5x+Uj7+IkLSReUT5+q0MQYzUZETdRjRcsC/9wMsVTzWssiviWofREKXHT7I4ZnQc/CUZXUTmchC8D2a0IOhKt6QyjLKa1TvJ8CuTu/x5M3K84fZGLAW3uwV8xOPtNDYdy6ietk4lO/JmOqj2Ey+7pVN8u91J3xM40ozA6jS1RKJ0STrHSc+XBhkzmUeF66qmZbdwd+fzY2L4Ov9cPqFoyT2oCAAA=" target="_blank">Run the query

```kusto
// Generate random data of user activities
let _lookback = datetime(2017-02-01);
let _start = datetime(2017-05-01);
let _end = datetime(2017-05-31);
let _data = range Day from _lookback to _end step 1d
    | extend d = tolong((Day - _lookback) / 1d)
    | extend r = rand() + 1
    | extend _users=range(tolong(d * 50 * r), tolong(d * 50 * r + 200 * r - 1), 1)
    | mv-expand id=_users to typeof(long) limit 1000000;
//
let lookback_data = _data | where Day < _start | project Day, id;
_data
| evaluate new_activity_metrics(id, Day, _start, _end, 7d, _start, lookback_data)
| project from_Day, to_Day, retention_rate
```

**Output**

|from_Day|to_Day|retention_rate|
|---|---|---|
|2017-05-01 00:00:00.0000000|2017-05-01 00:00:00.0000000|1|
|2017-05-01 00:00:00.0000000|2017-05-08 00:00:00.0000000|0.404081632653061|
|2017-05-01 00:00:00.0000000|2017-05-15 00:00:00.0000000|0.257142857142857|
|2017-05-01 00:00:00.0000000|2017-05-22 00:00:00.0000000|0.296326530612245|
|2017-05-01 00:00:00.0000000|2017-05-29 00:00:00.0000000|0.0587755102040816|

repository: microsoft/Kusto-Query-Language

gha_language: C#

repo_name: microsoft/Kusto-Query-Language


text:
Spring Boot @Async demonstration
================================

This one shows how to write methods that run asynchronously in their own Threads.

AsyncStarter implements ApplicationListener so that its onApplicationEvent gets
started after SpringBoot has finished initializing.

This method then calls `run()` on an instance of `MyTimer`. That method is
annotated with @Async and thus started in a separate thread.

While `run()` does it's endless loop, the application is still capable of
serving e.g. REST requests in its normal threads.

Links:
* https://spring.io/guides/gs/async-method/
* https://www.baeldung.com/spring-async
* https://www.e4developer.com/2018/03/30/introduction-to-concurrency-in-spring-boot/

branch_name: refs/heads/master

extension: md

gha_language: Java

license_type: permissive


text:
## Artifacts

### Fpl.Client

<img src="https://raw.githubusercontent.com/fplbot/fplbot/fbde22a8f0093ed3a91c972841bbb7ef7eaf90b6/src/Fpl.Client/images/fpl.png" height="25" width="25" align="left">  A .NET Standard 2.0 library for integration to the Fantasy Premier League APIs

![Nuget](https://img.shields.io/nuget/v/Fpl.Client?style=for-the-badge)
![Nuget](https://img.shields.io/nuget/dt/Fpl.Client?style=for-the-badge)

Install:
```
$ dotnet add package Fpl.Client
```

Register via DI providing credentials to a user of the fantasy premier league:
```csharp
services.AddFplApiClient(c =>
{
    c.Login =<EMAIL_ADDRESS>    c.Password =<EMAIL_ADDRESS>});
```

Or if you have the credentials in any other registered .NET Core configuration provider:
```csharp
services.AddFplApiClient(hostContext.Configuration);
```

### Fplbot docker image

[![dockeri.co](https://dockeri.co/image/fplbot/fplbot)](https://hub.docker.com/r/fplbot/fplbot)

Install:
```
 docker pull fplbot/fplbot:latest
```

Run:
```
 docker run --rm \
 -e fpl__login=fpl account username/email \
 -e fpl__password=fpl account password \
 -e REDIS_URL=redisconnstr \
 -e CLIENT_ID=slack app client_id \
 -e CLIENT_SECRET=slack app client_secret \
  fplbot/fplbot
 ```

license: MIT

repository: fplbot/fplbot

gha_license_id: MIT

repo_name: fplbot/fplbot


text:
---
title: Lifecycle
layout: default
weight: 30

---

# Pod lifecycle

> If pod update changes `pod->runtime` all pod will be destroyed and recreated in corresponding SystemD space.

Soil Agent evaluates each pod change in next order:

1. Executes systemd commands defined in `unit->destroy` for units which be destroyed.
2. Disables and destroys (deletes from filesystem) all units which be destroyed.
3. Deletes all BLOBs which be destroyed.
4. Stores all BLOBs which be created or updated.
5. Writes and optionally enables all units which be created or updated.
6. Executes systemd corresponding commands from `unit->create|update` for all units which be created or updated.

![Pod lifecycle]({{site.baseurl}}/assets/images/pod-evaluation.svg)

Stages are optional. Pod creation will fire stages `4`, `5` and `6` with commands from `unit->create`.  On pod update Soil Agent will calculate plan based on diff from deployed and pending pods.

Note in example above what `unit-4` was not changed on pod update.

repository: akaspin/soil

gha_language: Go

repo_name: akaspin/soil


text:
Cadexd for Docker
================

[![Docker Stats](http://dockeri.co/image/cadexcoin/cadexd)](https://hub.docker.com/r/cadexcoin/dashd/)

[![Build Status](https://travis-ci.org/cadexproject/docker-cadex.svg?branch=master)](https://travis-ci.org/cadexproject/docker-cadexd/)

Docker image that runs the Cadex cadexd node in a container for easy deployment.

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

* Physical machine, cloud instance, or VPS that supports Docker (i.e. Vultr, Digital Ocean, KVM or XEN based VMs) running Ubuntu 14.04 or later (*not OpenVZ containers!*)
* At least 4 GB to store the block chain files
* At least 1 GB RAM + 2 GB swap file

Recommended and tested on Vultr 1024 MB RAM/320 GB disk instance @ $8/mo.  Vultr also *accepts Bitcoin payments*!  May run on the 512 MB instance, but took *forever* (1+ week) to initialize due to swap and disk thrashing.

Really Fast Quick Start
-----------------------

One liner for Ubuntu 14.04 LTS machines with JSON-RPC enabled on localhost and adds upstart init script:

    curl https://raw.githubusercontent.com/cadexproject/docker-cadexd/master/bootstrap-host.sh | sh -s trusty

Quick Start
-----------

1. Create a `cadexd-data` volume to persist the cadexd blockchain data, should exit immediately.  The `cadexd-data` container will store the blockchain when the node container is recreated (software upgrade, reboot, etc):

        docker volume create --name=cadexd-data
        docker run -v cadexd-data:/cadex --name=cadexd-node -d \
            -p 27270:27270 \
            -p <IP_ADDRESS>:28280:28280 \
            cadexproject/cadexd

2. Verify that the container is running and cadexd node is downloading the blockchain

        $ docker ps
        CONTAINER ID        IMAGE                         COMMAND             CREATED             STATUS              PORTS                                              NAMES
        d0e1076b2dca        cadexproject/cadexd:latest          "cadex_oneshot"      2 seconds ago       Up 1 seconds        <IP_ADDRESS>:28280->28280/tcp, <IP_ADDRESS>:27270->27270/tcp   cadexd-node

3. You can then access the daemon's output thanks to the [docker logs command]( https://docs.docker.com/reference/commandline/cli/#logs)

        docker logs -f cadexd-node

4. Install optional init scripts for upstart and systemd are in the `init` directory.

Documentation
-------------

* To run in testnet, add environment variable `TESTNET=1` to `docker run` as such:

        docker run -v cadexd-data:/cadex --name=cadexd-node -d \
            --env TESTNET=1 \
            -p 27270:27270 \
            -p <IP_ADDRESS>:28280:28280 \
            cadexproject/cadexd

* Additional documentation in the [docs folder](docs).

Credits
-------

Original work by Kyle Manna [https://github.com/kylemanna/docker-bitcoind](https://github.com/kylemanna/docker-bitcoind).
Modified to use Dash Core instead of Bitcoin Core. Cadex coin forked from dash repo, credit to dash.

repository: cadexproject/docker-cadexd

repo_name: cadexproject/docker-cadexd


text:
# Dendrostilbella smaragdina (Alb. & Schwein.) Seifert, 2000 SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Okada, Jacobs, Kirisits, Louis-Seize, Seifert, Sugita, Takematsu & Wingfield, Stud. Mycol. 45: 185 (2000)

#### Original name
null

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# LINE API Bulk
# Bulk processor for LINE API to support large number of userIds.

For LINE Messaging API, there're some limitation on API call.
Such as [Link rich menu to multiple users API](https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-users) has limited 500 user IDs per request.
If you want to link richmenu to 1,000,000 users, you have to make 2,000 requests.

LINE API Bulk help make these things.

# Features!

  - Link Rich Menu To Multiple Users
  - Unlink Rich Menu From Multiple Users
  - Multicast Messages to Users

### Installation

Requires [Node.js](https://nodejs.org/) to run.
Install the dependencies.

```sh
$ cd line-api-bulk
$ npm install
```

### Save All UserIDs in file [userIds.json]
or you just query from your database as Array of uid string
```json
[
    "U2fcb0a6f123456788901234567890123",
    "U2fcb0a6f123456788901234567890124"
]
```

### Change channelAccessToken in file [index.js] on line #3
```js
const channelAccessToken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
```

# How To Use
CASE 1 : Link Rich Menu To Multiple Users
```js
const richMenuId = 'richmenu-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
processor.linkRichMenuToMultipleUsers(channelAccessToken, userIds, richMenuId);
```

CASE 2 : Unlink Rich Menu From Multiple Users
```js
processor.unlinkRichMenuFromMultipleUsers(channelAccessToken, userIds);
```

CASE 3 : Multicast Messages to Users
```js
const messages = [{ type: 'text', text: 'test' }];
processor.multicast(channelAccessToken, userIds, messages);
```

Then run
```sh
$ node index.js
```

See the results
```sh
   1 -  500 : SUCCESS :  { 'x-line-request-id': '17a23ebf-3f49-xxxx-xxxx-xxxxxxxxxxxx' }
 501 - 1000 : SUCCESS :  { 'x-line-request-id': '478cb4f5-8ffc-xxxx-xxxx-xxxxxxxxxxxx' }
1001 - 1500 : SUCCESS :  { 'x-line-request-id': 'eaf9afbb-7bf7-xxxx-xxxx-xxxxxxxxxxxx' }
1501 - 2000 : SUCCESS :  { 'x-line-request-id': '08677dff-26ed-xxxx-xxxx-xxxxxxxxxxxx' }
2001 - 2500 : SUCCESS :  { 'x-line-request-id': '49f00003-8f57-xxxx-xxxx-xxxxxxxxxxxx' }
2501 - 3000 : SUCCESS :  { 'x-line-request-id': 'bb197116-4f88-xxxx-xxxx-xxxxxxxxxxxx' }
3001 - 3500 : SUCCESS :  { 'x-line-request-id': '25c000b1-709c-xxxx-xxxx-xxxxxxxxxxxx' }
3501 - 4000 : SUCCESS :  { 'x-line-request-id': '2040fe30-b307-xxxx-xxxx-xxxxxxxxxxxx' }
4001 - 4500 : SUCCESS :  { 'x-line-request-id': 'b90134e6-e415-xxxx-xxxx-xxxxxxxxxxxx' }
4501 - 5000 : SUCCESS :  { 'x-line-request-id': 'b0b4e706-26ff-xxxx-xxxx-xxxxxxxxxxxx' }
5001 - 5500 : SUCCESS :  { 'x-line-request-id': '6a40610f-ca0e-xxxx-xxxx-xxxxxxxxxxxx' }
5501 - 6000 : SUCCESS :  { 'x-line-request-id': 'e35d106a-f70e-xxxx-xxxx-xxxxxxxxxxxx' }
6001 - 6500 : SUCCESS :  { 'x-line-request-id': '2f7d1d55-89c0-xxxx-xxxx-xxxxxxxxxxxx' }
6501 - 7000 : SUCCESS :  { 'x-line-request-id': '74e7d542-78fb-xxxx-xxxx-xxxxxxxxxxxx' }
7001 - 7500 : SUCCESS :  { 'x-line-request-id': 'd6ebffa8-9ba7-xxxx-xxxx-xxxxxxxxxxxx' }
7501 - 8000 : SUCCESS :  { 'x-line-request-id': '1a9c34f8-1252-xxxx-xxxx-xxxxxxxxxxxx' }
8001 - 8500 : SUCCESS :  { 'x-line-request-id': '7dedf4cd-7f4e-xxxx-xxxx-xxxxxxxxxxxx' }
8501 - 8731 : SUCCESS :  { 'x-line-request-id': '6263a4f9-df68-xxxx-xxxx-xxxxxxxxxxxx' }
```
Done.

### Todos

 - Write Tests
 - Upload Audience

License
----

ISC

**Happy Coding! LINE Develoeprs**

license: ISC


text:
[Database Structure](Database-Structure) > [World-Database](World-Database) > [npc_spellclick_spells](npc_spellclick_spells)

Column | Type | Description
--- | --- | ---
Npc_entry | int(10) unsigned |
Spell_id | int(10) unsigned |
Cast_flags | tinyint(3) unsigned |
User_type | smallint(5) unsigned |


text:
# Laravel56-tdd-sample

Laravel 5.6 app with test driven development methods

## Getting Started

```bash
git clone https://github.com/NuBOXDevCom/laravel56-tdd-sample.git
```

And

```bash
composer install
```

## Running the tests

```bash
phpunit
```

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


text:
# How to add Platform node to an existing cluster (Momentum 4.1)?

### Prepare the first MTA node

1) Add the new node to the Ecelerity config files:

```
cd /opt/msys/ecelerity/etc
vim conf/default/msg_gen.conf conf/global/msgc_server.conf
```

2) There are two stanzas that have to be updated in msg_gen.conf:
a) cassandra_client - copy another line and change the host name
b) msg_gen - copy one of the existing "node" stanzas (4 lines) and update both the node name and set a new unique mta_id
3) There is one stanza to be updated in msgc_server.conf. Add another line for the new host to the "peers" stanza with both hostname and correct IP address.
4) Commit the new config with eccfg:

```
/opt/msys/ecelerity/bin/eccfg commit -u admin -p $ADMINPASS -m 'Add new Platform node to cluster'
```

5) Update the following file by editing the "seeds" parameter and append the new host:

```
vim /opt/msys/3rdParty/cassandra/conf/cassandra.yaml
```

6) Restart all affected services:

```
 service msys-cassandra restart &&
 service ecelerity restart
```

### Update Engagement Proxy node (may be the same as the first MTA node)

1) Add a "server" line for the new host within the nginx config:

```
vim /opt/msys/3rdParty/nginx/conf.d/click_proxy.conf
```

2) Reload the nginx config:

```
service msys-nginx reload
```

### Update remaining Platform nodes (including Log Aggregator/Manager if present)

1) Update cassandra.yaml in the same fashion as the first node.
2) Restart all affected services:

```
service msys-cassandra restart
service ecelerity restart
```

### Configure the new Platform node

1) Copy the same tarball that was used to install the rest of the cluster to the new node and unpack it.
2) Activate the included yum repo:

```
cd momentum-<IP_ADDRESS>072 # ./setrepodir -i
```

3) Install the meta package msys-role-platform:

```
yum install --enablerepo=momentum -y msys-role-platform
```

4) Bootstrap the Ecelerity config from the first server:

```
mkdir -p /opt/msys/etc/installer/ecelerity.d/ # chown -R ecuser:ecuser /opt/msys/ecelerity/etc/ # cd /opt/msys/ecelerity/etc/ # /opt/msys/ecelerity/bin/eccfg bootstrap --clustername default -u admin -p $ADMINPASS FIRST.NODE.FQDN
```

5) Copy existing config files (execute this on the first MTA node):

```
for file in \  /opt/msys/3rdParty/cassandra/conf/cassandra.yaml \  /opt/msys/3rdParty/nginx/conf.d/api_webhooks_upstream.conf \  /opt/msys/app/metrics-etl/config/production.json \  /opt/msys/app/webhooks-batch/config/production.json \  /opt/msys/app/webhooks-transmitter/config/production.json \  /opt/msys/etc/.svcpasswd \  /opt/msys/etc/.dbhost \  ; do  scp $file $NEWNODE:$file done
```

6) Update cassandra.yaml on the new node to replace the "listen_address" with the correct local IP address for the new node.

7) Then, temporarily remove the new node from the seed list:

```
cp /opt/msys/3rdParty/cassandra/conf/cassandra.yaml /opt/msys/3rdParty/cassandra/conf/cassandra.yaml.new # vi /opt/msys/3rdParty/cassandra/conf/cassandra.yaml
```

8) Start Cassandra on the new node:

```
service msys-cassandra start
```

NOTE: depending on the amount of existing data in your Cassandra database, this will fail (as the init script only waits a fixed amount of time for the service to start).
9) Check that the Cassandra database has been replicated (UN means Up Normal):

```
service msys-cassandra status
```

Note: Ownership information does not include topology; for complete information, specify a keyspace Datacenter:

datacenter1 ======================= Status=Up/Down | / State=Normal/Leaving/Joining/Moving --  Address      Load       Tokens  Owns   Host ID                               Rack UN  <IP_ADDRESS>  215.57 KB  256     25.8%  1b00204c-5dc4-44b8-a024-c1ba47b07233  rack1 UN  <IP_ADDRESS>    178.35 KB  256     23.7%  28e2d1b9-80f6-40f8-b399-4533b2cfb103  rack1 UN  <IP_ADDRESS>   196.56 KB  256     23.2%  4addf36b-10f9-48fb-98c9-e5acf2c19970  rack1 UN  <IP_ADDRESS>  203.12 KB  256     27.3%  5525b410-3f3e-49ec-a176-0efa2383f3f4  rack1

10) Stop Cassandra and restore the saved cassandra.yaml.new to re-add this node to the seed list.
11) Configure RabbitMQ using the attached script setup_rabbitmq.pl:

```
    service msys-rabbitmq start
    chmod +x setup_rabbitmq.pl
    ./setup_rabbitmq.pl
    service msys-rabbitmq stop
```

```
#START OF FILE #!/opt/msys/3rdParty/bin/perl
use 5.16.3;
my $prefix = "/opt/msys"; my $thirdparty = "$prefix/3rdParty";
say STDERR 'Configuring RabbitMQ'; # first we need to configure the rabbitmq-server instance my $rabbitmqctl = "$thirdparty/sbin/rabbitmqctl"; my $rabbitmqadmin = "$thirdparty/sbin/rabbitmqadmin"; my $rabbitpw = decrypt(')<#$M5FLP;%AY'); qx|/etc/init.d/msys-rabbitmq start|; qx|$rabbitmqadmin declare exchange name=momentum_metrics type=topic|; qx|$rabbitmqadmin declare queue name=msg_events|; qx|$rabbitmqadmin declare binding source=momentum_metrics destination=msg_events routing_key=msys.*|; qx|$rabbitmqctl add_user rabbitmq $rabbitpw|; qx|$rabbitmqctl set_user_tags rabbitmq administrator|; qx|$rabbitmqctl set_permissions -p '/' rabbitmq '.*' '.*' '.*'|; qx|$rabbitmqctl delete_user guest|; qx|/etc/init.d/msys-rabbitmq stop|;
sub decrypt {  return unpack(chr(ord('a') + 19 + print ''),shift); }
#END OF FILE
```

12) Start all services on the new node:

```
/etc/init.d/msys-riak start
/etc/init.d/msys-rabbitmq start
/etc/init.d/msys-app-metrics-etl start
/etc/init.d/msys-cassandra start
/etc/init.d/ecelerity start
/etc/init.d/msys-nginx start
/etc/init.d/msys-app-webhooks-batch start
/etc/init.d/msys-app-webhooks-transmitter start
```

### Update Analytics Node(s):
1) On the first Analytics node, the following files need to be updated:

```
/opt/msys/3rdParty/nginx/conf.d/momo_upstream.conf /opt/msys/app/users-api/config/production.json /opt/msys/app/webhooks-api/config/production.json /opt/msys/app/cron/config/production.json
```

The momo_upstream.conf file just needs another "server" line for the new node.

2) The following script fragment can be used to update the various production.json files:

```
# START OF FILE
export PATH=/opt/msys/3rdParty/bin/:$PATH for f in \  /opt/msys/app/users-api/config/production.json \  /opt/msys/app/webhooks-api/config/production.json \  ; do  tmpf=$(mktemp --tmpdir=$(dirname $f) -t)  jq ".cassandra.hosts = .cassandra.hosts + [\"$NEWNODE\"]" -a -M $f > $tmpf  if [ $? = 0 ]; then  mv -f $tmpf $f  fi done for f in \  /opt/msys/app/cron/config/production.json \  ; do  tmpf=$(mktemp --tmpdir=$(dirname $f) -t)  jq ".cassandra.contactPoints = .cassandra.contactPoints + [\"$NEWNODE\"]" -a -M $f > $tmpf  if [ $? = 0 ]; then  mv -f $tmpf $f  fi done
# END OF FILE
```

3) Restart all applicable services on the Analytics node:

```
service msys-app-metrics-api restart
service msys-app-users-api restart
service msys-app-webhooks-api restart
service msys-nginx reload
```

Post-Install Cleanup
On all of the original Platform nodes, the Cassandra database will have duplicate keys that have now been distributed to the added node. At some point after deployment, run the following command on each Platform/Cassandra node:

```
/opt/msys/3rdParty/cassandra/bin/nodetool cleanup
```


text:
# TDD Demo

A repo I'm using to demonstrate TDD technique.

My goal is to teach following TDD concepts:

* 3 rules of TDD
* Red-Green-Refactor
* The Single Assert Rule
* Arrange, Act, Assert Rule
* Principle: "As tests get more specific, code gets more generic"

## 3 rules of TDD

1. You can’t write any production code until you have first written a failing
   unit test.
2. You can’t write more of a unit test than is sufficient to fail, and not
   compiling is failing.
3. You can’t write more production code than is sufficient to pass the
   currently failing unit test.

## Katas

Apart of 3 simple katas presented in this repo, there is a whole world of
katas out there.

## Solutions

You can find my version of the solutions in the
[corresponding branch](https://github.com/sergekukharev/tdd-demo/tree/solutions).

Note that every time you do katas, the solutions would be slightly different.
That's the beauty of katas - you keep discovering new ways of solving the
same problem.

## Resources

### Notable katas

* [Roman Numerals](http://codingdojo.org/kata/RomanNumerals/)               💪
* [Number to LCD - Coding Dojo](http://codingdojo.org/kata/NumberToLCD/)    💪💪
* [Bowling Game](http://codingdojo.org/kata/Bowling/)                       💪💪💪
* [Game of life - Coding Dojo](http://codingdojo.org/kata/GameOfLife/)      💪💪💪

### Kata sources

* [Coding Dojo](http://codingdojo.org)
* [TddBuddy](http://www.tddbuddy.com/)
* [About - Project Euler](https://projecteuler.net/) for math inclined problem.
* [HackerRank](http://hackerrank.com) for all kinds of problems.

### Further study

* 📚 [Test Driven Development: By Example](https://www.goodreads.com/book/show/387190.Test_Driven_Development)
* 📚 [Clean Code, ch. 9](https://www.goodreads.com/book/show/3735293-clean-code)
* 🎥 [Clean Code: TDD ep. 6.1](https://cleancoders.com/video-details/clean-code-episode-6-p1)
* 🎥 [Clean Code: TDD ep. 6.2](https://cleancoders.com/video-details/clean-code-episode-6-p2)
* 🎥 [Clean Code: Advanced TDD (ep. 19-24)](https://cleancoders.com/videos?series=clean-code&subseries=advanced-tdd) ⭐

repository: sergekukharev/tdd-demo

repo_name: sergekukharev/tdd-demo


text:
---
layout: default
title: Troubleshooting
parent: Zimbra
---

## How to track messages sent and received by a user

### Demonstration

```
/opt/zimbra/libexec/zmmsgtrace -s<EMAIL_ADDRESS>```

## Change Zimbra DNS resolve to native

````
su zimbra -l
postconf | grep host_lookup
postconf -e lmtp_host_lookup=native
````

repository: inservio/internship

repo_name: inservio/internship


text:
# florCrosshair
> Simplifiying your crosshair needs!

florCrosshair is a simplistic ui menu that is designed to help you altewr the way your default GTAV crosshair appearance. This tool if very useful for not only alteration of your crosshair, but can be used for multiple other scenarios for attatching a image on your screen.

## Installation

Easy!

```sh
Navigate to: server-data > resources > Drag & Drop
```
and done!

## Contributing

1. Fork it (<https://github.com/floraiin/florCrosshair/fork>)
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request

repository: floraiin/florCrosshair

branch_name: refs/heads/main

repo_name: floraiin/florCrosshair


text:
---
layout: post
title:      "Sessions and Cookies and JavaScript, Oh My! - A Tutorial Series"
date:       2021-02-23 21:16:35 -0500
permalink:  sessions_and_cookies_and_javascript_oh_my_-_a_tutorial_series
---

## Part 8: It’s Refactoring Time!

We have made it! The final tutorial in this series. It has been quite a ride. It’s hard to believe that since starting all of this we went from not having an application to having an application with fully functioning sign up and login features. And if we wanted to, we could move on right now and consider the code we have to be good enough. But that’s not how we do things here. We didn't come this far just to come this far.

via GIPHY

Not only do we want to write functioning code, we also want to write clean, non-repetitive code. So today we’re going to focus on doing just that — cleaning up our code: making sure we don’t have the same code written in multiple places, making sure all code is separated out as it should be, etc.

Our backend is in pretty good shape, so today’s focus will been the frontend.

### DRY

via GIPHY

Let’s start by dealing with some repetitive code. I mentioned this in a previous tutorial — in our SignUp and Login render functions, we are essentially rendering the same form. Let’s see what we can do about that.

It would seem that really we just need one component that renders a form for our users' information. Knowing that, I’m going to create a component called UserInfoForm.js. We know we’re going to need React, and based on the way we have set up the application, this will be a class component, so we’ll need `{ Component }` as well. Let’s import those. And we may as well go ahead and define the class. Right now, I have a nice shell for my component:

```
import React, { Component } from 'react';

class UserInfoForm extends Component {

}

export default UserInfoForm;
```

Whenever I am refactoring and trying to eliminate repeated code, I take a close look at where the code is repeated. It’s important to understand where the code is exactly the same and where there are slight differences, and determine if you are able to abstract anything to handle those differences. From what I can tell, these components are very similar, from their state and functions to the rendered form. The only differences are where we say “Sign Up” vs. “Log In”, and, of course, the action that is triggered when submitting the form. Because they are so similar, I’m just going to copy the body of the SignUp component and paste it in the body of the UserInfoForm component. I’m only taking the body of the component and leaving `mapDispatchToProps` and `connect` behind. Because the actions that we are dispatching from each component are different, we don't want to copy this code to UserInfoForm. Remember, we only want code that is the same.

Now that we have that copied over, I’m going to remove that code from the SignUp component and instead render the UserInfoForm component. Of course, I will also need to import UserInfoForm in my SignUp component. Let’s head over to the browser and take a look. Make sure you’re logged out, and go to your `/signup` route. Do you still see your Sign Up form? So do I! Now, we won’t actually be able to use the form right now because we are calling an action in `handleOnSubmit` that isn’t being imported into UserInfoForm, but don’t worry, we’ll go over how to handle that in a little bit. For now, let’s see how we can update this component so it works with our `/login` route as well.

The first thing I notice is my big header that says “Sign Up”. I will probably want that to say “Log In” on the login page, so I need to figure out how to update this. We have a couple of options. The header is actually outside of the form, so one option would be to render the header separately in each component (as we were doing previously), before rendering UserInfoForm. Another option would be to pass the header as a prop from the Sign Up and Log In components to the UserInfoForm component, and render `{this.props.header}`. Since this copy is separate from the form, I’m going to leave it in the Sign Up and Log In components and remove it from the UserInfoForm component. If you want to do it the other way though, feel free!

There is one other place where we are displaying “Sign Up” and “Log In” — the submit button in the form. Unfortunately, this is part of the form so it’s a bit trickier to render this button in its respective components. Let’s try that other option though — passing it as a prop. I’m going to pass a prop from the SignUp component to the UserInfoComponent called `buttonText`, and set it to whatever I want the text in the button to be for each component. Then, in the UserInfoForm component, I’ll render that prop as the button value.

Great! Now that that’s settled, let’s figure out how to handle our `signup` and `login` actions. Well, we’ve handled the SignUp and Login differences in a couple of ways now. Do you think one of those would work for the actions? I think so! Let’s pass the action as a prop to UserInfoForm. Now, in `handleOnSubmit` in UserInfoForm we can call the function we are passing as a prop. This all may be a bit confusing without any visuals. Take a look at my code so far:

```
// /src/components/SignUp.js

import React, { Component } from 'react';
import { connect } from 'react-redux';

// import UserInfoForm component
import UserInfoForm from './UserInfoForm'
import { signUp } from '../actions/currentUser';

class SignUp extends Component {
  // remove state, handleOnChange(), and handleOnSubmit()

  render() {
    return (
      <div>
        <h1>Sign Up Here!</h1>
        // render UserInfoForm component where form was previously rendered
        // pass unique SignUp information to UserInfoForm as props
        <UserInfoForm buttonText="Sign Up" onFormSubmit={this.props.signUp} />
      </div>
    )
  }
}

export default connect(null, { signUp })(SignUp);
```

```
// /src/components/UserInfoForm.js

import React, { Component } from 'react';

class UserInfoForm extends Component {

  state = {
    username: "",
    password: ""
  }

  handleOnChange = event => {
    this.setState({
      [event.target.name]: event.target.value
    })
  }

  handleOnSubmit = event => {
    event.preventDefault();
    // call the function being passed as the onFormSubmit prop (in the case of Sign Up, this is our signup action)
    this.props.onFormSubmit(this.state)
    this.setState({
      username: "",
      password: ""
    })
  }

  render() {
    return (
      <div>
        <form onSubmit={this.handleOnSubmit}>
          <label htmlFor="username">Username: </label>
          <input
            type="text"
            name="username"
            id="username"
            value={this.state.username}
            onChange={this.handleOnChange}
          />

          <br />

          <label htmlFor="password">Password: </label>
          <input
            type="password"
            name="password"
            id="password"
            value={this.state.password}
            onChange={this.handleOnChange}
          />

         <br />

          // render the prop being passed as buttonText as the value of our Submit button
          <input type="submit" value={this.props.buttonText} />
        </form>
      </div>
    )
  }

}

export default UserInfoForm;
```

Now, see if you’re able to sign up. Did it work? Nice! There’s one last change you can make to the SignUp component, if you'd like. Since we have removed state from this component, there is no reason for it to be a class component anymore, which means you can update it to a functional component. And in doing so, you’ll no longer need to import `{ Component }`:

```
// /src/components/SignUp.js

// remove { Component } from import
import React from 'react';
import { connect } from 'react-redux';

import UserInfoForm from './UserInfoForm'
import { signUp } from '../actions/currentUser';

// update to functional component, pass props as parameter
const SignUp = props => {

  // remove render function and just return JSX
  return (
    <div>
      <h1>Sign Up Here!</h1>
      <UserInfoForm buttonText="Sign Up" onFormSubmit={props.signUp} />
    </div>
  )
}

export default connect(null, { signUp })(SignUp);
```

Now we should be all set to make the same changes to the Login component, removing a bunch of repeated code in the process. I’ll wait while you make your changes. If your code is anything like mine, your Login component probably looks a little something like this:

```
// /src/components/Login.js

import React from 'react';
import { connect } from 'react-redux';

import UserInfoForm from './UserInfoForm'
import { login } from '../actions/currentUser';

const Login = props => {
  return (
    <div>
      <h1>Log In Here!</h1>
      <UserInfoForm buttonText="Log In" onFormSubmit={props.login} />
    </div>
  )
}

export default connect(null, { login })(Login);
```

We just got rid of a bunch of repeated code! That’s great! I wonder what else we could do…

via GIPHY

### Let's Adapt

We are handling quite a bit in our asynchronous action creators, the way they are currently written. These actions are sending fetch requests AND dispatching synchronous actions, which is a lot for an action creator to handle. To alleviate some pressure from the action creators, we can abstract our fetch requests into an Adapter class. Using adapters is a common way to add a transition layer between two interfaces, in our case our React frontend and our Rails API backend. There are several benefits of doing so, including building an application that is easier to maintain and update.

The best part about this refactor is 99% of the code you need is already written, it's just a matter of moving it around.  We'll want to start by creating an adapters folder in our src folder. Then, it's as simple as writing an Adapter class with static methods for any fetch requests we have. Let's take our `signUp` function as an example. Our current `signUp` action looks like this:

```
// /src/actions.currentUser.js

…
  export const signUp = credentials => {
    const userInfo = {
      user: credentials
    }
    return dispatch => {
		  // move this fetch request to an Adapter class
      return fetch("http://localhost:3001/signup", {
        credentials: "include",
        method: "POST",
        headers: {
          "Content-type": "application/json"
        },
        body: JSON.stringify(userInfo)
      })
        .then(response => response.json())
        .then(json => {
          if (json.error) {
            throw new Error(json.error)
          } else {
            dispatch(setCurrentUser(json.data))
          }
        })
        .catch(json => console.log(json))
    }
  }
…
```

We have our fetch request written already, we're just going to move it. Let's get our Adapter class set up so we can do this. In src/adapters create a file called Adapter.js, and within that file define your class:

```
class Adapter {

}

export default Adapter;
```

We need to export the class so we can import it in src/actions/currentUser.js to have access to it. Let's do that now:

```
// /src/actions/currentUser.js

import Adapter from '../adapters/Adapter';
```

Now, in our Adapter class, let's define a static method for our sign up fetch request. Since we have a `signUp` action creator already, we can call this `signUpFetch` to avoid any confusion. We need to define this as a static method because it will be called on the Adapter class, not on an instance of the Adapter class. The body for the `signUpFetch` method is just going to be the fetch request you've already written. It should look something like this:

```
// /src/adapters/Adapter.js

…
  static signUpFetch(userInfo) {
    return fetch("http://localhost:3001/signup", {
      credentials: "include",
      method: "POST",
      headers: {
        "Content-type": "application/json"
      },
      body: JSON.stringify(userInfo)
    })
  }
…
```

Great! Now we just need to call this in our `signUp` action creator, replacing the fetch request that is currently there:

```
// /src/actions/currentUser.js

  export const signUp = credentials => {
    const userInfo = {
      user: credentials
    }
    return dispatch => {
      // replace fetch request with Adapter.signUpFetch()
      return Adapter.signUpFetch(userInfo)
        .then(response => response.json())
        .then(json => {
          if (json.error) {
            throw new Error(json.error)
          } else {
            dispatch(setCurrentUser(json.data))
          }
        })
        .catch(json => console.log(json))
    }
  }

```

If you try to sign up with a new account, everything should be functioning as it was before. We have just abstracted some of the code, creating a class whose only responsibility is talking to our API. This is going to make your life much easier if you have any updates to your backend that will impact your fetch requests, because all fetch requests will happen from one place. You're all set to abstract the rest of your fetch requests into static methods in your Adapter class.

### Is that it?

For now, yes, that is it! We have completed our tutorial series for JavaScript, Sessions, and Cookies (Oh My!). You should be proud of what you accomplished! Of course this series could go on for weeks and weeks still, but it is time to move on with your application. You can finally start adding other components and features, knowing that you have a complete user experience set to go. So go on, now. Get out of here.

via GIPHY

##### Sources

Adapter Design Pattern

Static Methods

Flatiron School React App Build

extension: markdown


text:
# Frequently Asked Questions

## Design Decisions

### Why Is There No `if`?

There's a `switch`, so you can set, e.g., stage specific values. But you can't switch anything entirely on or off, and that's on purpose: The environment of your applications should be as similar as possible on all stages, so the tests you do won't lie to you. Even the `switch` should has a big `handle with care` label to it.

### Why the system property `com.github.t1.deployer.container.CLI#DEBUG`?

CLI statements may contain credentials or other sensitive data that normally should not be logged, but it's essential to see them while developing The Deployer. The normal log level mechanism is security wise not sufficient to hide such information, as manipulating a log level may be too easy. So there's an extra flag to enable logging the CLI statements.

### Does it make sense to use The Deployer for Docker images?

At first sight, it may look like The Deployer would not have any role to play when you use [Docker](https://www.docker.com), as in a fully containerized approach, there's no need to change a running system: changes in the configuration should result in a rebuild and restart of the whole stack and it's sufficiently easy to use the normal CLI for that.

But you may find the abstraction layer that The Deployer provides to be useful nonetheless: A bundle file may be more readable than a long list of CLI statements, as it is more concise and clear (e.g., xa and non-xa data sources both use the same connection uri syntax), and it provides mechanics to reuse common configuration schemes, further DRYing your infrastructure code.

You won't want to download and apply everything at boot time, as this happens very often in a dynamic cloud setup, so it has to be as fast as possible. To apply The Deployer root bundle at Docker build time, you can start the container from your `Dockerfile` with the `shutdown-after-boot` option in your `deployer.config.yaml`. For an example, see `src/main/docker/Dockerfile`; to run it do:

    cp ../../../target/deployer.war .
    docker build --tag=wildfly .
    docker run -it --rm -p 8080:8080 --name wildfly wildfly

To use it for your own applications, you'd only need to change the `deployer.root.bundle`, and maybe configure your `repository` in the `deployer.config.yaml`.

Starting up a container when building an image is not very fast, so to speed things up, we'd like to implement an [offline mode](https://github.com/t1/deployer/issues/59).


text:
# Changelog

We are using [calens](https://github.com/restic/calens) to properly generate a
changelog before we are tagging a new release. To get an idea how this could
look like <https://github.com/restic/restic/tree/master/changelog> would be the
best reference.

repository: webhippie/terrastate

repo_name: webhippie/terrastate


text:
# REMITA PAYMENT GATEWAY

[![Packagist](https://img.shields.io/packagist/dt/femonofsky/remita.svg?style=flat-square)](https://github.com/femonofsky/remita-laravel/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/femonofsky/remita/master.svg?style=flat-square)](https://travis-ci.org/thephpleague/skeleton)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/femonofsky/remita.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/skeleton/code-structure)
[![Quality Score](https://img.shields.io/scrutinizer/g/femonofsky/remita.svg?style=flat-square)](https://scrutinizer-ci.com/g/femonofsky/remita)
[![Total Downloads](https://img.shields.io/packagist/dt/femonofsky/remita.svg?style=flat-square)](https://packagist.org/packages/femonofsky/remita)

**Note:** Replace `skeleton` with the correct package name in the above URLs, then delete this line.

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what
PSRs you support to avoid any confusion with users and contributors.

## Install

Via Composer

``` bash
$ composer require femonofsky/remita
```

or
Add the following to your require block in composer.json config
``` bash
$ "femonofsky/remita": "~1.0"
```

## Usage

``` php

```

## Credits

- [Femonofsky](https://github.com/femonofsky)
- [All Contributors](https://github.com/femonofsky/remita-laravel/contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

repository: femonofsky/remita-laravel

repo_name: femonofsky/remita-laravel


text:
# k8s-openmpi-experiments
Data from experiments executed on top of the k8s-openmpi repository code.

# Experiments
* Running Container-Based MPI Cluster on shared hosts – the MPI cluster consist of four container nodes each running in compliance with host-bound anti-affinity rule guaranteeing that the Kubernetes scheduler will place and maintain each one of the nodes on a separate container platform host.
* Running Container-Based MPI Cluster on exclusive hosts - the MPI cluster consist of four container nodes running in compliance with host-bound affinity rule guaranteeing that the Kubernetes scheduler will place and maintain every two of the nodes on a same container platform host.

# GCE MPI Cluster Properties
* Four Nodes Cluster deployed on Two Hosts
    * Host version = 1.11.7-gke.12
    * Host image = Container Optimized OS (cos)
    * Host type = n1-standard-1 (2vCPU, 4 GB of memory)
    * Host disk = 100G
* Four Nodes Cluster deployed on Four Hosts
    * Host version = 1.11.7-gke.12
    * Host image = Container Optimized OS (cos)
    * Host type = n1-standard-1 (2vCPU, 4 GB of memory)
    * Host disk = 100G
* Three Nodes Cluster deployed on Three Hosts
    * Host version = 1.11.7-gke.12
    * Host image = Container Optimized OS (cos)
    * Host type = n1-standard-1 (1vCPU, 3.75 GB of memory)
    * Host disk = 100G
* Ten Nodes Cluster deployed on Six Hosts
    * Host version = 1.11.7-gke.12
    * Host image = Container Optimized OS (cos)
    * Host type = n1-standard-1 (1vCPU, 3.75 GB of memory)
    * Host disk = 100G


text:
Shortbread
==========

Android library that generates [app shortcuts][1] for activities and methods annotated with `@Shortcut`.
No need to touch the manifest, create XML files or use the shortcut manager. Just annotate the code that
you want the shortcut to call.

![Sample](sample.png)

The four shortcuts above are produced by the following code:

```java
@Shortcut(id = "movies", icon = R.drawable.ic_shortcut_movies, shortLabel = "Movies")
public class MoviesActivity extends Activity {

    // ...

    @Shortcut(id = "add_movie", icon = R.drawable.ic_shortcut_add, shortLabel = "Add movie")
    public void addMovie() {
        // code to add movie, could show an AddMovieDialogFragment for example
    }
}
```

```java
@Shortcut(id = "books", icon = R.drawable.ic_shortcut_books, shortLabel = "Books")
public class BooksActivity extends Activity {

    // ...

    @Shortcut(id = "favorite_books", icon = R.drawable.ic_shortcut_favorite, shortLabel = "Favorite books")
    public void showFavoriteBooks() {
        // code to display favorite books, could show a FavoriteBooksFragment for example
    }
}
```

To display the shortcuts, call `Shortbread.create(Context context)` as early as possible in the app, for
example in `onCreate` of a custom `Application`.

```java
public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        Shortbread.create(this);
    }
}
```

Shortcuts can be customized with attributes, just like using the framework API.

```java
@Shortcut(
    id = "books",
    icon = R.drawable.ic_shortcut_books,
    shortLabel = "Books",
    shortLabelRes = R.string.shortcut_books_short_label,
    longLabel = "List of books",
    longLabelRes = R.string.shortcut_books_long_label,
    rank = 2, // order in list, relative to other shortcuts
    disabledMessage = "No books are available",
    disabledMessageRes = R.string.shortcut_books_disabled_message,
    enabled = true, // default
    backStack = {MainActivity.class, LibraryActivity.class},
    activity = MainActivity.class, // the launcher activity to which the shortcut should be attached
    action = "shortcut_books" // intent action to identify the shortcut from the launched activity
)
public class BooksActivity extends Activity { /*...*/ }
```
Download
--------

### Java

```groovy
dependencies {
    implementation 'com.github.matthiasrobbers:shortbread:1.1.0'
    annotationProcessor 'com.github.matthiasrobbers:shortbread-compiler:1.1.0'
}
```

### Kotlin

```groovy
apply plugin: 'kotlin-kapt'

dependencies {
    implementation 'com.github.matthiasrobbers:shortbread:1.1.0'
    kapt 'com.github.matthiasrobbers:shortbread-compiler:1.1.0'
}
```

License
-------

    Copyright 2017 Matthias Robbers

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

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

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

 [1]: https://developer.android.com/guide/topics/ui/shortcuts.html

repository: nnlrlunaire/shortbread

repo_name: nnlrlunaire/shortbread


text:
# Scripts and utils for HSE Wireless Access Points

## Synopsis

HSE facilities usually have two wireless networks with *HSE* and *hse.ru* SSIDs.
Both of them use captive portal for authentication, but the former requires
credentials input each hour or so.  This project contains utils for automated
HSE captive portal authentication.

# Captive Portal Query

## HSE

### Login

Request URL `https://wlc38.hse.ru/login.html` works fine.  Though I've seen other URLs (e.g. `wlc37`).

- `Submit`: required, value is `Submit`.
- `buttonClicked`: required, value is `4`.
- `username`: required, value is `hseguest`.
- `password`: required, value is `hsepassword`.
- `redirect_url`: optional, redirect URL (defunct).

### Logout

Request URL is `https://wlc38.hse.ru/logout.html`.

- `Logout`: required, value is `Logout`.

## hse.ru

### Login

Request URL is `https://cp.hse.ru:8443/hse-captive-portal/login`.

- `username`: required, user's name.
- `password`: required, user's password.
- `usergroup`: required, user's group.

   Values:
   - `1` for `hse.ru` (afaik it's the default).
   - `2` for `edu.hse.ru`.
- `cookie-enabled`: perhaps the server sends a cookie in response.  Corresponds
  to the *Запомнить*/*Remember me* option on auth web page.

### Logout

Unfortunately, I didn't find the request URL.  Looks like even the web interface
does not support logout.

# Legal notice

## License

No, it's public domain.

## Warning

Any use of this software is entirely at your own risk.

license: Unlicense

repository: tie/hseguest

repo_name: tie/hseguest


text:
# USE CASE anime dataset BY Between Our Worlds

## Context

Between Our Worlds is an initiative to provide metadata information about anime as Linked Open Data.
The dataset has as goal to

- provide globally unique identifiers for anime,
- use globally unique, unambiguous property names,
- provide a self-describing dataset for anime metadata,
- improve the discoverability of anime-related data, and
- improve the sharability of anime-related data

## Challenges
1. Preprocessing of the data so that it can be turned into a Knowledge Graph.
2. Harvesting of the data.

## Resources
- Website: https://betweenourworlds.org/
- Data: https://kitsu.io/
- Mappings: https://github.com/BetweenOurWorlds/generation-rules
- Ontology: https://betweenourworlds.org/ontology/
- Output: https://data.betweenourworlds.org/

repository: maurodragoni/kg-construct-use-cases

repo_name: maurodragoni/kg-construct-use-cases


text:
## Specifications

### Day 1 & 2
- [x] Complete these sections (including the exercises) of the [Rethinking Asynchronous JavaScript][fem-async-js] on Frontend Masters:
  - [x] Parallel vs. Async
  - [x] Callback
  - [x] Thunks
  - [x] Promises
- [x] Complete the [Understanding Promises in JavaScript][treehouse-workshop-promises] workshop (22m)
- [x] Read [this](https://coligo.io/javascript-promises-plain-simple/) blog post
- [x] Read [this](https://scotch.io/tutorials/javascript-promises-for-dummies) blog post

If you complete the above with time to spare, fill any gaps in your understanding by skimming through the [Promises Course][promises-course] on Udacity.

### Day 3
- [x] Look at the [documentation](https://github.com/vitaly-t/pg-promise/wiki/Learn-by-Example) of the `pg-promise` repository
- [x] Exercises 1-7 in the [pg promise exercises][pg-promise-exercises] are complete
  - [x] Exercise 1
  - [x] Exercise 2
  - [x] Exercise 3
  - [x] Exercise 4
  - [x] Exercise 5
  - [x] Exercise 6
  - [x] Exercise 7

### Day 4 & 5
- [x] Exercises 1-13 in the [promise-it-wont-hurt-solutions][promise-it-wont-hurt-solutions] are complete and written to the appropriate file:
  - [x] `src/01-warmup.js`
  - [x] `src/02-fullfill-a-promise.js`
  - [x] `src/03-reject-a-promise.js`
  - [x] `src/04-to-reject-or-not-to-reject.js`
  - [x] `src/05-always-asynchronous.js`
  - [x] `src/06-shortcuts.js`
  - [x] `src/07-promise-after-promise.js`
  - [x] `src/08-values-and-promises.js`
  - [x] `src/09-throw-an-error.js` \* see note below
  - [x] `src/10-an-important-file.js` \* see note below
  - [x] `src/11-multiple-promises.js`
  - [x] `src/12-fetch-json.js`
  - [x] `src/13-do-some-work.js`

\*Note: `promise-it-wont-hurt` has a bug which checks the full path of the files, instead of the relative paths. This causes exercise 9 & 10's verify command to fail even though the solution is correct. If the file path is the only error that you are seeing, it means that your code is correct.

### General
- [x] All dependencies are properly declared in `package.json`.
- [x] All major features are added via pull requests with a clear description and concise commit messages.
- [x] Code uses a linter and there are no linting errors.
- [x] Variables, functions, files, etc. have appropriate and meaningful names.
- [x] Functions are small and serve a single purpose.

### Stretch
- [x] Read Google's [Introduction](https://developers.google.com/web/fundamentals/getting-started/primers/promises) to Promises

repository: spencerdezartsmith/promises-exercises

gha_language: PLpgSQL

repo_name: spencerdezartsmith/promises-exercises


text:
It helps you find why your Ruby application is terrible slow.

## Wow. Audacious. How do I use it?
```ruby
sp = SimpleProfiler.new
sp.start
slow_method(tons, of, parameters)
sp.stop
puts("report=#{sp.report}")
```
```log
report={:steps=>[{:caller=>"/your_ruby_file.rb:5:in simple_test", :time=>3.141516}]}
```

## Do you have more examples?
Look that from [other example](./examples/example.rb):
![](http://www.gabrielsaraiva.com.br/img/project_aux/SimpleRubyProfiler/example.png)

## WOW. How do I get it?
Copy ![this file](./simple_profiler.rb) into your project. Require it (if necessary). Use it.

## Q&A
- Wow only one file? - Yep.
- No Gems? - Soon.
- Does it have tests? - Not yet. There is a button for Pull Requests up there. Feel free to press it.
- Do you will make tests for it? - Yes. Soon.
- But already exists tons of better tools in the marked. Why bother doing one more? - You already waste more time reading that than you would need to use it. Also I want to learn Ruby.
- Oh.  - Yep.
- Do I/they need to pay you something? - No.
- Can I change it? - Yep.
- Do I need to put your name on it? - No.
- Do I need to tell someone I'm using it? - Would be nice to make a PR and ask for reviews before put it into production.
- Can I say that I made this to my boss? - No. I made it. You just copied ;)
- Can I say it if I improve this? - You can say you make it better. Feel free to share with me if you want to.

repository: gabrsar/SimpleRubyProfiler

gha_language: Ruby

repo_name: gabrsar/SimpleRubyProfiler


text:
# Decision Tree Diabetes Predictor
Predictor for whether or not a person has diabetes given a handful of diagnostic measures using ![Decision Tree Learning ](https://en.wikipedia.org/wiki/Decision_tree_learning)

Written in python and made using the ![Pandas Data Analysis API](https://pandas.pydata.org/)

## About

I made this as a personal project during the 2020 COVID Pandemic in my quest to learn and implement various styles of machine learning in place of a lost internship.

This uses ![this publically available dataset of Pima Indian women](https://www.kaggle.com/uciml/pima-indians-diabetes-database) to create and test a decision tree.

When randomly splitting 80% of the database to train and 20% to test, it had an accuracy of 65%

## Future

There are many ways to potentially improve the accuracy of this.
Right now the only criteria used to split the dataset at each node is the median of each given potential variable.
By adding more potential criteria it can be made more accurate.
Additionally, more could be done to clean up the data before creating the tree, right now its just being fed right in while missing variables and outliers could be accounted for.

Also I would like to try using a random forest to further increase accuracy.


text:
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Removed

- `XpringClient` is removed from XpringKit. This class has been deprecated since 1.5.0. Clients should use `XRPClient` instead.

## 1.5.0 - March 9, 2020

This version introduces a public API to retrieve balances and send payments over ILP.
Additionally, the deployment target for XpringKit is now explicitly set to macOS 10.13 and higher.

### Changed
- `XpringClient` has been renamed to `XRPClient`, along with all associated classes, and should be used going forward.
	Top-level class `XpringClient` still exists alongside `XRPClient` and will be deprecated in the future.
- `getTransactionStatus` will now return `TransactionStatus.unknown` if the transaction hash provided references a transaction that is a partial payment or a non payment transaction. This behavior is only enabled when using the rippled protocol buffer implementation.

## 1.4.0 - Feb 28, 2020

This version uses new protocol buffers from rippled which have breaking changes in them. Specifically, the breaking changes include:
- Re-ordering and repurposing of fields in order to add additional layers of abstraction
- Change package from `rpc.v1` to `org.xrpl.rpc.v1`

This change is transparent to public API users. However, clients will need to connect to a rippled node which is built at any commit after [#3254](https://github.com/ripple/rippled/pull/3254).

## 1.3.0 - Feb 4, 2020

repository: LoisRP/XpringKit

repo_name: LoisRP/XpringKit


text:
author: Marc DiPasquale
summary: Create a CodeLab Using Markdown
id: codelab-4-codelab-markdown
categories: codelab,markdown
environments: Web
status: Published
feedback link: https://github.com/Mrc0113/codelab-4-codelab

# CodeLab to Create a CodeLab

## CodeLab Overview
Duration: 0:02:00

Are you trying to create easy to use, visually appealing content for the tech community? This CodeLab will show you how to quickly create your own Google CodeLab just like the one you're using right now.
When creating a Codelab you have two authoring options:
1. Using a Google Doc
1. Using a markdown file

In this codelab we are going to use the second option and author our codelab using a markdown file. This gives us the flexibility of using our markdown file for other things and also storing it in our github repo with any code that might be used for a tutorial.

Here is an example image of another CodeLab that I created:
![image_caption](img/codelabexample.png)

**Resources:**
* This codelab's original home is located here: [Link to Codelab](https://www.marcd.dev/codelab-4-codelab)
* The markdown for the original codelab is located here: [codelab.md](https://github.com/Mrc0113/codelab-4-codelab/blob/master/codelab.md)
* [Google CodeLabs Tools Github](https://github.com/googlecodelabs/tools) - The repo that contains the claat tool we'll be using today
* [Google Group for CodeLab Authors](https://groups.google.com/forum/#!forum/codelab-authors) - great forum for asking questions about codelabs and discussing future functionality
* [A blog that I used when getting started with Google Codelabs](https://medium.com/@mariopce/tutorial-how-to-make-tutorials-using-google-code-labs-gangdam-style-d62b35476816)

## Environment Setup
Duration: 0:04:00

In order to create a CodeLab you need *Go* and *claat* (the codelabs command line tool) installed.

The instructions below are what worked for me on Mac, but you can also find instructions [here](https://github.com/googlecodelabs/tools/tree/master/claat)

#### Install Go

Install [Go](https://golang.org/dl/) if you don't have it.
You can use Homebrew if you have it on mac
``` bash
$ brew install go
```

#### Setup Go Environment Variables
Below is what I set on mac, but instructions are [here](https://golang.org/doc/install) for other OS options

``` bash
$ export GOPATH=$HOME/Go
$ export GOROOT=/usr/local/opt/go/libexec
$ export PATH=$PATH:$GOPATH/bin
$ export PATH=$PATH:$GOROOT/bin
```

#### Install claat
Install claat
``` bash
$ go get -u -v -x github.com/googlecodelabs/tools/claat
```

You should now have the *claat* command available to you.
``` bash
$ claat
```

## Create your initial CodeLab
Duration: 0:05:00

Now that we have the environment setup let's go ahead and create a markdown file where we'll create the actual codelab.

Negative
: If you're using Windows make sure to set your text editor to use UNIX line endings!

####
``` bash
$ vim codelab.md
```

#### Fill-in the header metadata
Copy and paste the headers below into your markdown file and change the values appropriately.
Guidelines are available below the sample headers.

``` bash
author: Author Name
summary: Summary of your codelab that is human readable
id: unique-codelab-identifier
categories: codelab,markdown
environments: Web
status: Published
feedback link: A link where users can go to provide feedback (Maybe the git repo)
analytics account: Google Analytics ID
```

Metadata consists of key-value pairs of the form "key: value". Keys cannot
contain colons, and separate metadata fields must be separated by blank lines.
At present, values must all be on one line. All metadata must come before the
title. Any arbitrary keys and values may be used; however, only the following
will be understood by the renderer:

* Summary: A human-readable summary of the codelab. Defaults to blank.
* Id: An identifier composed of lowercase letters ideally describing the
  content of the codelab. This field should be unique among
  codelabs.
* Categories: A comma-separated list of the topics the codelab covers.
* Environments: A list of environments the codelab should be discoverable in.
  Codelabs marked "Web" will be visible at the codelabs index. Codelabs marked
  "Kiosk" will only be available at codelabs kiosks, which have special
  equipment attached.
* Status: The publication status of the codelab. Valid values are:
  - Draft: Codelab is not finished.
  - Published: Codelab is finished and visible.
  - Deprecated: Codelab is considered stale and should not be widely advertised.
  - Hidden: Codelab is not shown in index.
* Feedback Link: A link to send users to if they wish to leave feedback on the
  codelab.
* Analytics Account: A Google Analytics ID to include with all codelab pages.

#### Add the Title
Next add your title using a single '#' character
```
# Title of codelab
```

#### Add Sections and Durations
Then for each section use Header 2 or '##' and specify an optional duration beneath for time remaining calculations
Optional section times will be used to automatically total and remaining tutorial times
In markdown I've found that the time is formatted hh:mm:ss

Example
``` bash
## Section 1
Duration: 0:10:00

## Section 2
Duration: 0:05:00
```

#### Add Section Content
Now that we have 2 sections to our titled codelab let's go ahead and add some content to each section.
Make up your own or copy and paste the example below:

Copy into section 1 (Below Duration and above Section 2):
```
### Info Boxes
Plain Text followed by green and yellow info boxes

Negative
: This will appear in a yellow info box.

Positive
: This will appear in a green info box.

You created info boxes!

### Bullets
Plain Text followed by bullets
* Hello
* CodeLab
* World

You created bullets!

### Numbered List
1. List
1. Using
1. Numbers

You created a numbered list!

```

Copy into section 2 (Below Duration):
```
### Add a Link
Adding a link!
[Example of a Link](https://www.google.com)

### Add an Image
Adding an image!
![image_caption](https://googlecloud.tips/img/031/codelabs.png)

### Embed an iframe
![https://codepen.io/tzoght/embed/yRNZaP](https://en.wikipedia.org/wiki/File:Example.jpg "Try Me Publisher")
```

More Markdown Parser examples can be found [here](https://github.com/googlecodelabs/tools/tree/master/claat/parser/md).

## Export and Serve
Duration: 0:02:00

Now that you have an initial codelab defined in your markdown file let's go ahead and generate the static site content.
We can export and serve the content locally using the `claat` command that we installed earlier.

``` bash
$ claat export codelab.md
$ claat serve
```

* Your browser should have opened (if it doesn't then try going to localhost:9090 in your browser).
* Choose the directory that matches your "id" that you put in the headers.
* Viola! You should have your first codelab!

## Host Your CodeLab
Duration: 0:01:00

When you ran the `claat export` command you created the static web content needed to host your codelab.
It placed static web content in a directory specified by your unique "id" and you can view it locally by opening the index.html page.

Negative
: Note that when you view it locally by opening index.html some of the graphics may not show up (such as access_time, Next, Back), but they work once online.

Now that you have the static content you can host it however you want.
One option is pushing it to github and serving it up from Netlify.

If you'd like to create your own landing page for codelabs, [like this one](https://codelabs.developers.google.com), there is a tool to do that as well!
Check it out here: [CodeLabs Site](https://github.com/googlecodelabs/tools/blob/master/site/README.md)

repository: googlecodelabs/tools

repo_name: googlecodelabs/tools


text:
---
jobId: 'ohMBefwC'
date: '2021-02-04'
title: 'Senior Communication Designer'
office: 'Recife'
featuredImage: '/images/articles/hero/maximize-value.jpg'
published: false
---

Are you an experienced designer looking to take the next step in your career, joining a global creative team?

Communication Design at Liferay partners primarily with Liferay’s Marketing, Sales, and Human Resources (at Liferay, we call them People) teams to achieve business results by design.

You’ll be the first Communication Designer in our Latin American HQ, collaborating with regional leaders in other functions to support their initiatives:

-   Sales & Marketing — providing creative leadership for campaigns, events, and other materials
-   Human Resources — supporting local and global initiatives to improve the employee experience

You are a highly collaborative designer who has worked within brand guidelines, pushing them to their limits and making them better than ever.

## What will my first year look like?

One of your first initiatives will be working with the global team to articulate foundational aspects of our brand. Every department sees our brand promise in a different way. We need to figure out what’s at the core, and get alignment so we can all more effectively contribute to building brand value.

Other early projects will include working with the global design team and the local Marketing and Events teams to design and produce work required for our events — from branded giveaways to all the new digital assets we’ll need to create in the new paradigm of remote events.

Additionally, you will:

1. Partner with local marketing and HR leadership to provide creative direction and production that supports their business strategy.
2. Collaborate with the global design team to make our design system / brand guidelines / style guides more cohesive.
3. Contribute to developing a framework for measuring and plan for improving the Liferay brand.
4. Expand and improve existing brand guidelines and resources, proactively communicating to drive self-service.

## What do I need to succeed?

1. **Communication**: if we’ve learned anything from being fully remote for the last 9+ months, proactive, effective communication skills are a must. English fluency is a must, Spanish would be helpful but is not required.
2. **Art Direction**: you have a strong portfolio and help others raise the bar within an existing brand ecosystem.
3. **Digital Marketing**: guiding stakeholders through the creative process to achieve design excellence in event marketing, social media, and presentations.

## What will help me stand out?

1. **People management**: developing a team’s skills and careers.
2. **Business acumen**: case studies where you achieved business objectives with quality visual design.
3. **Videography**: xperience in video production is valuable as we work with a lot of media contractors to produce content for marketing and events.

## What do I need to apply?

1. Portfolio link
2. Cover letter (nothing formal) with a few sentences of feedback on our brand.

## Cover letter? Do you really read them?

Yes! It doesn't need to be formal — really all we're looking for is a brief response to the prompt.

_Note that applications sans cover letter are typically rejected post-haste._

## Awesome, but what does Liferay offer for me?

-   Salary package w/ competitive benefits according to qualifications and experience
-   Attractive benefits
-   A place to be yourself, in which everyone can grow personally and professionally
-   Flexible schedule
-   A positive and collaborative work culture
-   Work in a fast-growing, successful company with [incredible mission and values](https://www.liferay.com/company/our-story)

## Liferay is an Equal Opportunity Employer

_Liferay is committed to the equal treatment of all candidates, customers and employees and to fostering a culture of dignity at work. Our operating procedure provides for equal opportunities in recruitment and employment with the aim to eliminate discrimination against any job applicant or employee on the basis of race, age, sexual orientation, gender or gender reassignment, religion or beliefs, marital or civil partnerships status, family or dependency status, disability, pregnancy and maternity or membership of a traveling community._

gha_language: JavaScript


text:
# Responsive Portfolio
A simple demonstration of responsive design, ensuring that following web application renders well on a variety of devices and window or screen sizes. This was designed 'mobile first' but is still pleasing to view on desktop.

## Getting Started

Play on my [site](http://www.spazcool.com/responsive-portfolio/index.html) or host locally after cloning from the [Repo](https://github.com/Spazcool/responsive-portfolio).

### Prerequisites

A browser and an internet connection is all you'll need.

### Installing

No installation required.

## Built With

* JS & jQuery
* HTML
* CSS & Bootstrap
* NASA POD API

## Authors

* **Douglas Wright** - [Spazcool](https://github.com/Spazcool)

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

repository: Spazcool/responsive-portfolio

repo_name: Spazcool/responsive-portfolio


text:
# ENet-ScanNet

PyTorch (v1.0.0) re-implementation of [*ENet: A Deep Neural Network Architecture for Real-Time Semantic Segmentation*](https://arxiv.org/abs/1606.02147), ported from the excellent PyTorch impelentation [ENet-ScanNet](https://github.com/davidtvs/PyTorch-ENet), which was in-turn ported from the lua-torch implementation [ENet-training](https://github.com/e-lab/ENet-training) created by the authors.

This implementation has been tailored to suit the [ScanNet](http://www.scan-net.org) dataset.

## What's new from ENet?

The primary change from ENet is that this repository supports a variant `ENetDepth`, which is a 2.5D (i.e., RGB + Depth) version of ENet. It takes a color image and its corresponding depth image as input, and performs semantic segmentation. `ENetDepth` provides a huge boost in performance (+0.17 mIoU over `ENet`), so use it whenever you can.

On an NVIDIA GeForce GTX 1060, `ENetDepth` operates at a rate of about 40 Hz! Should run faster on a better GPU.

## Installation

1. Python 3 and pip.
2. Set up a virtual environment (recommended).
3. Install dependencies using pip: ``pip install -r requirements.txt``.

## Obtaining ScanNet

To obtain ScanNet, instructions are available in the `README` of [this repository](https://github.com/ScanNet/ScanNet). The entire dataset is huge (1.4 TB or so)! However, you could choose to download only specific scenes. For training a well-performing ENet, one would need about 75-100 scenes from ScanNet.

## Pretrained models

A pretrained model ships with the repository. It is in the [save](https://github.com/krrish94/ENet-ScanNet/tree/master/save) directory.
> **IMPORTANT**: Make sure to edit `save/ENetDepth-scannet20_summary.txt` and specify paths to ScanNet data, in order for the pretrained model to work.

## Data preparation

Data preparation for ENet is identical to that for [3DMV](https://github.com/angeladai/3DMV/tree/master/prepare_data).

For more information, see [data preparation](https://github.com/krrish94/ENet-ScanNet/tree/master/prepare_data).

## Usage

Run [``main.py``](https://github.com/krrish94/ENet-ScanNet/blob/master/main.py), the main script file used for training and/or testing the model. The code has a lot of options. Make sure to read through most of them, before training/testing.

```
usage: main.py [-h] [--mode {train,test,inference,full}] [--resume]
               [--generate-images] [--arch {rgb,rgbd}]
               [--seg-classes {nyu40,scannet20}] [--batch-size BATCH_SIZE]
               [--epochs EPOCHS] [--learning-rate LEARNING_RATE]
               [--beta0 BETA0] [--beta1 BETA1] [--lr-decay LR_DECAY]
               [--lr-decay-epochs LR_DECAY_EPOCHS]
               [--weight-decay WEIGHT_DECAY] [--dataset {scannet}]
               [--dataset-dir DATASET_DIR] [--trainFile TRAINFILE]
               [--valFile VALFILE] [--testFile TESTFILE] [--height HEIGHT]
               [--width WIDTH] [--weighing {enet,mfb,none}]
               [--class-weights-file CLASS_WEIGHTS_FILE] [--with-unlabeled]
               [--workers WORKERS] [--print-step PRINT_STEP] [--imshow-batch]
               [--device DEVICE] [--name NAME] [--save-dir SAVE_DIR]
               [--validate-every VALIDATE_EVERY]
```

For help on the optional arguments run: ``python main.py -h``

### Examples: Training

```
python main.py -b 64 --epochs 200 --dataset-dir /path/to/scannet/scannetv2_images/ --trainFile cache/train.txt  --valFile cache/val.txt --testFile cache/test.txt --print-step 25 --seg-classes scannet20 --class-weights-file cache/class_weights_scannet20.txt  --name ENetDepth --lr-decay-epochs 60 -lr 1e-3 --beta0 0.7 --arch rgbd --validate-every 10
```

Training for 200 epochs will take about 5-6 hours on an NVIDIA GeForce GTX TITANX GPU.

### Examples: Resuming training

```
python main.py -b 64 --epochs 200 --dataset-dir /path/to/scannet/scannetv2_images/ --trainFile cache/train.txt  --valFile cache/val.txt --testFile cache/test.txt --print-step 25 --seg-classes scannet20 --class-weights-file cache/class_weights_scannet20.txt  --name ENetDepth --lr-decay-epochs 60 -lr 1e-3 --beta0 0.7 --arch rgbd --validate-every 10 --resume
```

### Examples: Inference

Once you're all trained and set, you can use `inference.py` to generate the cool-looking qualitative results on top of this `README`. A sample `inference.py` call would look like

```
python inference.py --mode inference -b 2 --epochs 1 --dataset-dir /path/to/scannet/scannetv2_images/ --trainFile cache/train.txt --valFile cache/val.txt --testFile cache/test.txt --arch rgbd --print-step 1 --seg-classes scannet20 --class-weights-file cache/class_weights_scannet20.txt --name ENetDepth --generate-images
```

This will create a directory named `ENetDepth_images` in the `save` directory.

## Project structure

### Folders

- [``data``](https://github.com/krrish94/ENet-ScanNet/tree/master/data): Contains instructions on how to download the datasets and the code that handles data loading.
- [``metric``](https://github.com/krrish94/ENet-ScanNet/tree/master/metric): Evaluation-related metrics.
- [``models``](https://github.com/krrish94/ENet-ScanNet/tree/master/models): ENet model definition.
- [``save``](https://github.com/krrish94/ENet-ScanNet/tree/master/save): By default, ``main.py`` will save models in this folder. The pre-trained models can also be found here.

### Files

- [``args.py``](https://github.com/krrish94/ENet-ScanNet/blob/master/args.py): Contains all command-line options.
- [``main.py``](https://github.com/krrish94/ENet-ScanNet/blob/master/main.py): Main script file used for training and/or testing the model.
- [``test.py``](https://github.com/krrish94/ENet-ScanNet/blob/master/test.py): Defines the ``Test`` class which is responsible for testing the model.
- [``train.py``](https://github.com/krrish94/ENet-ScanNet/blob/master/train.py): Defines the ``Train`` class which is responsible for training the model.
- [``transforms.py``](https://github.com/krrish94/ENet-ScanNet/blob/master/transforms.py): Defines image transformations to convert an RGB image encoding classes to a ``torch.LongTensor`` and vice versa.