text:
# etcd cluster Resource

This resource allows to manage an etcd cluster on multiple hosts over SSH.

## Example Usage

```hcl
locals {
  controller_ips = ["<IP_ADDRESS>"]
  controller_names = ["controller01"]
}

resource "flexkube_pki" "pki" {
  etcd {
    peers   = zipmap(local.controller_names, local.controller_ips)
    servers = zipmap(local.controller_names, local.controller_ips)
  }
}

resource "flexkube_etcd_cluster" "etcd" {
  pki_yaml = flexkube_pki.pki.state_yaml

  ssh {
    user     = "core"
    password = "foo"
  }

  dynamic "member" {
    for_each = flexkube_pki.pki.etcd[0].peers

    content {
      name               = member.key
      peer_address       = member.value
      server_address     = member.value

      host {
        ssh {
          address = member.value
        }
      }
    }
  }
}
```

## Argument Reference

* `member` - (Required) A `member` block as defined below. This block defines single etcd cluster member and can be specified multiple times.

* `image` - (Optional) Docker image with tag to be used to run etcd container. Defaults to `libflexkube` [default etcd image](https://github.com/flexkube/libflexkube/blob/master/pkg/defaults/defaults.go#L6).

* `ssh` - (Optional) A `ssh` block as defined below. This block defines global SSH settings shared by all members.

* `ca_certificate` - (Optional) If `pki_yaml` field is not set, this field must contain PEM encoded etcd X.509 CA certificate.

* `pki_yaml` - (Optional) This field can be set to `state_yaml` value of `flexkube_pki` resource to enable PKI integration for etcd, which allows automatic use of certificates generated by PKI resource.

---

A `member` block supports the following:

* `name` - (Required) Name of the member.

* `server_address` - (Required) IP address which should be used by the etcd member.

* `image` - (Optional) Docker image with tag to be used to run etcd container. Defaults to `libflexkube` [default etcd image](https://github.com/flexkube/libflexkube/blob/master/pkg/defaults/defaults.go#L6).

* `host` - (Optional) A `host` block as defined below. This block defines where to connect for creating the container.

* `ca_certificate` - (Optional) If top level `pki_yaml` field is not set, this field must contain PEM encoded etcd X.509 CA certificate. It will be used to verify incoming peer and client connections.

* `peer_certificate` - (Optional) If top level `pki_yaml` field is not set, this field must contain PEM encoded etcd X.509 peer certificate. It will be used for serving peer communication and as client certificate when talking to remote peers.

* `peer_key` - (Optional) If top level `pki_yaml` field is not set, this field must contain PEM encoded etcd X.509 peer certificate key.

* `initial_cluster` - (Optional) Value for `initial-cluster` etcd flag. If empty, it will be generated automatically and include all defined members.

* `peer_cert_allowed_cn` - (Optional) List of allowed CNs in X.509 client certificate for peer communication. This field is useful, when you have single peer certificate for all members and to distinguish then between the peers and the clients.

* `server_certificate` - (Optional) If top level `pki_yaml` field is not set, this field must contain PEM encoded etcd X.509 server certificate. It will be used for serving client communication.

* `server_key` - (Optional) If top level `pki_yaml` field is not set, this field must contain PEM encoded etcd X.509 server certificate key.

---

A `host` block supports the following:

* `direct` - (Optional) A `direct` block as defined below. Mutually exclusive with all other fields in this block. If defined, container will be created on local machine.

* `ssh` - (Optional) A `ssh` block as defined below. Mutually exclusive with all other fields in this block. If defined, container will be created on a remote machine using SSH connection.

---

A `direct` block does not support any arguments.

---

A `ssh` block supports the following:

* `address` - (Required) An address where SSH client should connect to. Can be either hostname of IP address.

* `port` - (Optional) Port where to open SSH connection. Defaults to `22`.

* `user` - (Optional) Username to use when opening SSH connection. Defaults to `root`.

* `password` - (Optional) Password to use for SSH authentication. Can be combined with `private_key` and SSH agent authentication methods.

* `connection_timeout` - (Optional) Duration for how long to wait before connection attempts times out, expressed in [Go Duration format](https://golang.org/pkg/time/#ParseDuration). Defaults to `30s`.

* `retry_timeout` - (Optional) Duration for how long to wait before giving up on connection attempts, expressed in [Go Duration format](https://golang.org/pkg/time/#ParseDuration). Defaults to `60s`.

* `retry_interval` - (Optional) Duration for how long to wait between connection attempts, expressed in [Go Duration format](https://golang.org/pkg/time/#ParseDuration). Defaults to `1s`.

* `private_key` - (Optional) PEM encoded privat key to be used for authentication. Can be combined with `password` and SSH agent authentication methods.

---

A `mount` block supports the following:

* `source` - (Required) A host directory to be mounted in the container.

* `target` - (Required) Path in the container where host directory should be mounted.

* `propagation` - (Optional) Propagation mode to be set on the mount. See [Docker](https://docs.docker.com/storage/bind-mounts/#configure-bind-propagation) documentation for allowed values.

## Attribute Reference

* `state` - A list of `host_configured_container` blocks as defined below. This attribute represents generated configuration of the managed containers. Sensitive values like configuration files content, environment variables or SSH password are replaced with SHA256 of the values. To get the actual value, use `state_sensitive` block.

* `state_sensitive` - A list of `host_configured_container` blocks as defined below. This attribute represents generated configuration of the managed containers. This attribute is marked entirely as sensitive, so it won't show up detailed in a plan. To see specific changes in generated configuration, use `state` attribute.

* `state_yaml` - State of created containers in YAML format. Can be dumped to a `state.yaml` file and used together with `flexkube kubelet-pool` command.

* `config_yaml` - Generated configuration in YAML format, which can be used by the `flexkube kubelet-pool` command.

---

A `host_configured_container` block supports the following:

* `name` - Name of the container.

* `container` - A `container` block as defined below. Contains container configuration parameters.

* `config_files` - A map of configuration files which are created for the container on the host. The key is the path on the host to the configuration file and the value is either a configuration file content or it's SHA256, depending if read from `state` or from `state_sensitive` attribute.

* `host` - A `host` block as defined above. Describes on which host the container is created.

---

A `container` block supports the following:

* `config` - A `config` block as defined below. Contains container configuration attributes.

* `runtime` - A `runtime` block as defined below. Includes container runtime configuration.

* `status` - A `status` block as defined below. Contains container status information.

---

A `config` block supports the following:

* `name` - Name of the managed container.

* `image` - Container image used.

* `privileged` - If `true`, the container runs as a privileged process on the host.

* `args` - Arguments used for a container.

* `entrypoint` - Binary name which runs in the container.

* `port` - A `port` block as defined below. Contains ports, which are exposed by the container.

* `mount` - A list of `mount` blocks as defined above. Contains information which host paths are mounted into the container.

* `network_mode` - Defines what network mode container use. Actual value may depend on used container runtime.

* `pid_mode` - Defines in which PID mode container runs. Actual value may depend on used container runtime.

* `ipc_mode` - Defines in which IPC mode container runs. Actual value may depend on used container runtime.

* `user` - Name of the user or UID used by the container.

* `group` - Name of the group or GID used by the container.

---

A `port` block supports the following:

* `ip` - IP on which the port is exposed.

* `port` - Exposed port number.

* `protocol` - Exposed protocol.

---

A `runtime` block supports the following:

* `docker` - A `docker` block as defined below. Container Docker runtime configuration attributes.

---

A `docker` block supports the following:

* `host` - URL used to talk to Docker runtime. Defaults to `unix:///var/run/docker.sock`.

---

A `status` block supports the following:

* `id` - ID of the created container given by used container runtime.

* `status` - Text status of the container. If field is empty, it means that the container does not exist.

repository: flexkube/terraform-provider-flexkube

gha_language: Go

repo_name: flexkube/terraform-provider-flexkube


text:
# Market sample

## Run

Start the server process in one terminal:
```
node server
```

Start the operator process in one or more terminal. It will produce random messages, with buy or sale products:
```
node operator
```

Start the subscriber process in one or more terminal. Examples:
```
node subscriber
node subscriber -o buy
node subscriber -o sale
node subscriber -p wheat
node subscriber -p wheat -o buy
```
The `-p` or `--product` flag indicates the product to listen, ie `wheat`.
The `-o` or `--operation` flag indicates the operation to listen: `buy` or `sale`.

license: MIT

repository: coderofsalvation/SimpleBus

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: coderofsalvation/SimpleBus


text:
Ocaml Discrete Interval Encoding Trees
======================================

[![Build Status](https://travis-ci.org/djs55/ocaml-diet.png?branch=master)](https://travis-ci.org/djs55/ocaml-diet) [![Coverage Status](https://coveralls.io/repos/djs55/ocaml-diet/badge.png?branch=master)](https://coveralls.io/r/djs55/ocaml-diet?branch=master)

Please read [the API documentation](https://djs55.github.io/ocaml-diet/).

This is based on the
[Functional Pearls: Diets for Fat Sets](https://web.engr.oregonstate.edu/~erwig/papers/Diet_JFP98.pdf)
by Martin Erwig.

license: ISC

repository: jonludlam/ocaml-diet

gha_license_id: NOASSERTION

repo_name: jonludlam/ocaml-diet


text:
---
title: Release of eProsima Micro XRCE-DDS 1.2.0
author: francesca-finocchiaro
---

eProsima, one of the founding members and coordinator of the EU project OFERA, announces the general availability of Micro XRCE-DDS 1.2.0.

Micro XRCE-DDS is an open source wire protocol that implements the OMG DDS standard for eXtremly Resource Constrained Environments, and is the default Middleware implementing the RMW abstraction layer for the micro-ROS project.

This release introduces the following new features:

* IPv6 support.
* Requester/Replier support.
* Packaging compatibility with colcon.
* Isolated installation option.
* Changed the serial transport.

For a complete list of improvements and bug fixes please read the [release notes](hhttps://github.com/eProsima/Micro-XRCE-DDS/releases/tag/v1.2.0).


text:
---
layout: post
title: ThreadSanitizer in .NET
date: 2014-10-16 13:57
author: matthewwarren
comments: true
categories: [Uncategorized]
---
http://googletesting.blogspot.ru/2014/06/threadsanitizer-slaughtering-data-races.html

https://code.google.com/p/thread-sanitizer/
https://code.google.com/p/thread-sanitizer/w/list
https://code.google.com/p/thread-sanitizer/wiki/Algorithm
https://code.google.com/p/thread-sanitizer/wiki/AboutRaces
https://code.google.com/p/thread-sanitizer/wiki/DeadlockDetector
https://code.google.com/p/thread-sanitizer/wiki/DetectableBugs
https://code.google.com/p/thread-sanitizer/wiki/AtomicOperations
https://code.google.com/p/thread-sanitizer/wiki/VolatileRanges

https://gcc.gnu.org/wiki/cauldron2012?action=AttachFile&do=get&target=kcc.pdf

http://www.slideshare.net/Devexperts/dynamic-data-race-detection-in-concurrent-java-programs
https://code.google.com/p/data-race-test/wiki/ThreadSanitizerJava
https://code.google.com/p/java-thread-sanitizer/source/browse/trunk/examples/Hello.java

Maybe talk about .NET Memory Model and what (if anything) it guarantees on top of the CPU memory model?
Reference Joe Duffy articles!!!!

First do a naive example where the instrumentation is manually inserted in to a C# programme.
Then show how it would work by using code-injection like a C# profiler/agent.

path: /_drafts/2014-10-16- ThreadSanitizer in .NET.md

filename: 2014-10-16- ThreadSanitizer in .NET.md


text:
# TensorFlow Eager Execution

## What is this?

Eager execution is a feature that makes TensorFlow execute operations
immediately: concrete values are returned, instead of a computational graph to
be executed later.

As a result, enabling eager execution provides:

-   A [NumPy](http://www.numpy.org/)-like library for numerical computation with
    support for GPU acceleration and automatic differentiation.
-   A flexible platform for machine learning research and experimentation.

Eager execution is under active development. This guide walks through an
alpha/preview release. In particular, not all TensorFlow APIs currently work
with eager execution enabled, and some models may be slow to execute, compared
to models defined without using eager execution.

## Installation

Eager execution is included in TensorFlow versions 1.5 and above.
Installation instructions at https://www.tensorflow.org/install/

The contents of this guide are compatible with TensorFlow 1.5. However, if you
run into bugs that are fixed in source but not the release, you may want to
either [build from source](https://www.tensorflow.org/install/install_sources)
or try a nightly build. The nightly builds are available as:

- [`pip` packages](https://github.com/tensorflow/tensorflow/blob/master/README.md#installation) and

- [docker](https://hub.docker.com/r/tensorflow/tensorflow/) images.

For example, to run the latest nightly docker image:

```sh
# If you have a GPU, use https://github.com/NVIDIA/nvidia-docker
docker pull tensorflow/tensorflow:nightly-gpu
docker run --runtime=nvidia -it -p 8888:8888 tensorflow/tensorflow:nightly-gpu

# If you do not have a GPU, use the CPU-only image
docker pull tensorflow/tensorflow:nightly
docker run -it -p 8888:8888 tensorflow/tensorflow:nightly
```

And then visit http://localhost:8888 in your browser for a Jupyter notebook
environment.

## Getting Started

With TensorFlow installed, eager execution is enabled via a single call:

```python
import tensorflow as tf

import tensorflow.contrib.eager as tfe

tfe.enable_eager_execution()
```

Enabling eager execution changes how TensorFlow functions behave (in particular,
`Tensor` objects will reference concrete values instead of being symbolic
handles to nodes in a computational graph). As a result, eager execution should
be enabled at the beginning of a program and cannot be disabled afterwards in
the same program.

Code examples in the rest of this guide assume that eager execution has been
enabled.

## A library for numerical computation

A significant fraction of the [TensorFlow
API](https://www.tensorflow.org/api_docs/python/) consists of numerical
operations:
[arithmetic operations](https://www.tensorflow.org/api_guides/python/math_ops#Arithmetic_Operators),
[matrix operations](https://www.tensorflow.org/api_guides/python/math_ops#Matrix_Math_Functions),
[linear algebra operations](https://www.tensorflow.org/versions/master/api_docs/python/tf/linalg),
etc.

With eager execution enabled, these operations consume and return
multi-dimensional arrays as `Tensor` objects, similar to NumPy
[`ndarray`s](https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.ndarray.html).
For example:

```python
# Multiply two 2x2 matrices
x = tf.matmul([[1, 2],
               [3, 4]],
              [[4, 5],
               [6, 7]])
# Add one to each element
# (tf.add supports broadcasting)
y = tf.add(x, 1)

# Create a random random 5x3 matrix
z = tf.random_uniform([5, 3])

print(x)
print(y)
print(z)
```

Output:

```
tf.Tensor(
[[16 19]
 [36 43]], shape=(2, 2), dtype=int32)
tf.Tensor(
[[17 20]
 [37 44]], shape=(2, 2), dtype=int32)
tf.Tensor(
[[ 0.25058532  0.0929395   0.54113817]
 [ 0.3108716   0.93350542  0.84909797]
 [ 0.53081679  0.12788558  0.01767385]
 [ 0.29725885  0.33540785  0.83588314]
 [ 0.38877153  0.39720535  0.78914213]], shape=(5, 3), dtype=float32)
```

For convenience, these operations can also be triggered via operator overloading
of the `Tensor` object. For example, the `+` operator is equivalent to `tf.add`,
`-` to `tf.subtract`, `*` to `tf.multiply`, etc.:

```python
x = (tf.ones([1], dtype=tf.float32) + 1) * 2 - 1
print(x)
```

Output:

```
tf.Tensor([ 3.], shape=(1,), dtype=float32)
```

### Converting to and from NumPy

The operations above automatically convert Python objects (like lists of
numbers) and NumPy arrays to `Tensor` objects. `Tensor` objects can also be used
as NumPy arrays by numpy operations.

```python
import numpy as np

x = tf.add(1, 1)                     # tf.Tensor with a value of 2
y = tf.add(np.array(1), np.array(1)) # tf.Tensor with a value of 2
z = np.multiply(x, y)                # numpy.int64 with a value of 4
```

Alternatively, they can be explicitly converted using
[`tf.constant`](https://www.tensorflow.org/api_docs/python/tf/constant), as
shown in the next example.

Conversely, you can call the `numpy()` method of a `Tensor` object' to obtain
its NumPy `ndarray` value. For example:

```python
import numpy as np

np_x = np.array(2., dtype=np.float32)
x = tf.constant(np_x)

py_y = 3.
y = tf.constant(py_y)

z = x + y + 1

print(z)
print(z.numpy())
```

Output:

```
tf.Tensor(6.0, shape=(), dtype=float32)
6.0
```

### GPU acceleration

Many TensorFlow operations support GPU acceleration. With eager execution
enabled, [computation is *not* automatically
offloaded](https://www.tensorflow.org/tutorials/using_gpu) to GPUs. Instead, you
must explicitly specify when GPUs should be used.

The simplest way to do this is to enclose your computation in a `with
tf.device('/gpu:0')` block. Also of interest is the `tfe.num_gpus()` function,
which returns the number of available GPUs.

For example, consider this snippet to measure the time to multiply two 1000x1000
matrices on CPU:

```python
import time

def measure(x):
  # The very first time a GPU is used by TensorFlow, it is initialized.
  # So exclude the first run from timing.
  tf.matmul(x, x)

  start = time.time()
  for i in range(10):
    tf.matmul(x, x)
  end = time.time()

  return "Took %s seconds to multiply a %s matrix by itself 10 times" % (end - start, x.shape)

# Run on CPU:
with tf.device("/cpu:0"):
  print("CPU: %s" % measure(tf.random_normal([1000, 1000])))

# If a GPU is available, run on GPU:
if tfe.num_gpus() > 0:
  with tf.device("/gpu:0"):
    print("GPU: %s" % measure(tf.random_normal([1000, 1000])))
```

Output (exact numbers will depend on the characteristics of the hardware):

```python
CPU: Took 0.145531892776 seconds to multiply a (1000, 1000) matrix by itself 10 times
GPU: Took 0.000458955764771 seconds to multiply a (1000, 1000) matrix by itself 10 times
```

Alternatively, methods on the `Tensor` object can be used to explicitly copy the
`Tensor` to a different device. Operations are typically executed on the device
on which the inputs are placed. For example:

```python
x = tf.random_normal([10, 10])

x_gpu0 = x.gpu()
x_cpu = x.cpu()

_ = tf.matmul(x_cpu, x_cpu)  # Runs on CPU
_ = tf.matmul(x_gpu0, x_gpu0)  # Runs on GPU:0

if tfe.num_gpus() > 1:
  x_gpu1 = x.gpu(1)
  _ = tf.matmul(x_gpu1, x_gpu1)  # Runs on GPU:1
```

### Automatic Differentiation

[Automatic
differentiation](https://en.wikipedia.org/wiki/Automatic_differentiation) is
very useful when implementing many machine learning algorithms (e.g.,
[backpropagation](https://en.wikipedia.org/wiki/Backpropagation) for training
neural networks). For this purpose, TensorFlow eager execution provides an
[autograd](https://github.com/HIPS/autograd)-style API for automatic
differentiation. Specifically, the functions:

-   `tfe.gradients_function(f)`: Returns a Python function that computes the
    derivatives of the Python function `f` with respect to its arguments. `f`
    must return a scalar value. When the returned function is invoked, it
    returns a list of `Tensor` objects (one element for each argument of `f`).
-   `tfe.value_and_gradients_function(f)`: Similar to `tfe.gradients_function`,
    except that when the returned function is invoked, it returns the value of
    `f` in addition to the list of derivatives of `f` with respect to its
    arguments.

These functions naturally apply to higher order differentiation as well. For
example:

```python
def f(x):
  return tf.multiply(x, x)  # Or x * x
assert 9 == f(3.).numpy()

df = tfe.gradients_function(f)
assert 6 == df(3.)[0].numpy()

# Second order deriviative.
d2f = tfe.gradients_function(lambda x: df(x)[0])
assert 2 == d2f(3.)[0].numpy()

# Third order derivative.
d3f = tfe.gradients_function(lambda x : d2f(x)[0])
assert 0 == d3f(3.)[0].numpy()
```

These functions can be used to train models. For example, consider the following
simple linear regression model:

```python
def prediction(input, weight, bias):
  return input * weight + bias

# A toy dataset of points around 3 * x + 2
NUM_EXAMPLES = 1000
training_inputs = tf.random_normal([NUM_EXAMPLES])
noise = tf.random_normal([NUM_EXAMPLES])
training_outputs = training_inputs * 3 + 2 + noise

# A loss function: Mean-squared error
def loss(weight, bias):
  error = prediction(training_inputs, weight, bias) - training_outputs
  return tf.reduce_mean(tf.square(error))

# Function that returns the derivative of loss with respect to
# weight and bias
grad = tfe.gradients_function(loss)

# Train for 200 steps (starting from some random choice for W and B, on the same
# batch of data).
W = 5.
B = 10.
learning_rate = 0.01
print("Initial loss: %f" % loss(W, B).numpy())
for i in range(200):
  (dW, dB) = grad(W, B)
  W -= dW * learning_rate
  B -= dB * learning_rate
  if i % 20 == 0:
    print("Loss at step %d: %f" % (i, loss(W, B).numpy()))
print("Final loss: %f" % loss(W, B).numpy())
print("W, B = %f, %f" % (W.numpy(), B.numpy()))
```

Output: (the exact numbers may vary depending on the randomness in noise)

```
Initial loss: 66.730003
Loss at step 0: 64.200096
Loss at step 20: 29.872814
Loss at step 40: 14.233772
Loss at step 60: 7.090570
Loss at step 80: 3.819887
Loss at step 100: 2.318821
Loss at step 120: 1.628385
Loss at step 140: 1.310142
Loss at step 160: 1.163167
Loss at step 180: 1.095162
Final loss: 1.064711
W, B = 3.094944, 2.161383
```

To utilize the GPU, place the code above within a `with tf.device("/gpu:0"):`
block. (However, this particular model, with only two floating point parameters,
is unlikely to benefit from GPU acceleration.)

### Customizing gradients

One may want to define custom gradients for an operation, or for a function.
This may be useful for multiple reasons, including providing a more efficient
or more [numerically stable](https://en.wikipedia.org/wiki/Numerical_stability)
gradient for a sequence of operations.

For example, consider the function `log(1 + e^x)`, which commonly occurs in the
computation of cross entropy and log likelihoods.

```python
def log1pexp(x):
  return tf.log(1 + tf.exp(x))
grad_log1pexp = tfe.gradients_function(log1pexp)

# Works fine at x = 0.
assert 0.5 == float(grad_log1pexp(0.)[0])

# Returns a `nan` at x = 100 due to numerical instability.
import math
assert math.isnan(float(grad_log1pexp(100.)[0]))
```

We can define a custom gradient for the above function that analytically
simplifies the gradient expression.

```python
@tfe.custom_gradient
def log1pexp(x):
  e = tf.exp(x)
  def grad(dy):
    return dy * (1 - 1 / (1 + e))
  return tf.log(1 + e), grad
grad_log1pexp = tfe.gradients_function(log1pexp)

# Works as before at x = 0.
assert 0.5 == float(grad_log1pexp(0.)[0])

# But now works at x = 100 as well.
assert 1.0 == float(grad_log1pexp(100.)[0])
```
Also notice how the gradient function implementation reuses an expression
(`tf.exp(x)`) computed during the forward pass, hence making the gradient
computation more efficient by avoiding redundant computation.

## Building and training models

In practice, your computation may have many parameters to be optimized (by
computing derivatives). Encapsulating them into re-usable classes/objects
makes the code easier to follow than writing a single top-level function with
many arguments.

In fact, eager execution encourages use of the [Keras](https://keras.io)-style
"Layer" classes in the
[`tf.layers`](https://www.tensorflow.org/api_docs/python/tf/layers)
module.

Furthermore, you may want to apply more sophisticated techniques to compute
parameter updates, such as those in
[`tf.train.Optimizer`](https://www.tensorflow.org/api_guides/python/train#Optimizers)
implementations.

This next section walks through using the same `Optimizer` and `Layer` APIs used
to build trainable TensorFlow graphs in an environment where eager execution is
enabled.

### Variables and Optimizers

`tfe.Variable` objects store mutable `Tensor` values that can be accessed during
training, making automatic differentiation easier. In particular, parameters of
a model can be encapsulated in Python classes as variables.

`tfe.gradients_function(f)` introduced earlier computes the derivatives of `f`
with respect to its arguments. However, it requires all parameters of interest
to be arguments of `f`, which becomes cumbersome when `f` depends on a large
number of trainable parameters.

`tfe.implicit_gradients` is an alternative function with some useful properties:

-   It computes the derivatives of `f` with respect to all the `tfe.Variable`s
    used by `f`.
-   When the returned function is invoked, it returns a list of
    (gradient value, Variable object) tuples.

Representing model parameters as `Variable` objects, along with the use of
`tfe.implicit_gradients`, typically results in better encapsulation. For
example, the linear regression model described above can be written into a
class:

```python
class Model(object):
  def __init__(self):
    self.W = tfe.Variable(5., name='weight')
    self.B = tfe.Variable(10., name='bias')

  def predict(self, inputs):
    return inputs * self.W + self.B

# The loss function to be optimized
def loss(model, inputs, targets):
  error = model.predict(inputs) - targets
  return tf.reduce_mean(tf.square(error))

# A toy dataset of points around 3 * x + 2
NUM_EXAMPLES = 1000
training_inputs = tf.random_normal([NUM_EXAMPLES])
noise = tf.random_normal([NUM_EXAMPLES])
training_outputs = training_inputs * 3 + 2 + noise

# Define:
# 1. A model
# 2. Derivatives of a loss function with respect to model parameters
# 3. A strategy for updating the variables based on the derivatives
model = Model()
grad = tfe.implicit_gradients(loss)
optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.01)

# The training loop
print("Initial loss: %f" %
      loss(model, training_inputs, training_outputs).numpy())
for i in range(201):
  optimizer.apply_gradients(grad(model, training_inputs, training_outputs))
  if i % 20 == 0:
    print("Loss at step %d: %f" %
          (i, loss(model, training_inputs, training_outputs).numpy()))
print("Final loss: %f" % loss(model, training_inputs, training_outputs).numpy())
print("W, B = %s, %s" % (model.W.numpy(), model.B.numpy()))
```

Output:

```
Initial loss: 69.693184
Loss at step 0: 66.987854
Loss at step 20: 30.553387
Loss at step 40: 14.250237
Loss at step 60: 6.955020
Loss at step 80: 3.690550
Loss at step 100: 2.229739
Loss at step 120: 1.576032
Loss at step 140: 1.283496
Loss at step 160: 1.152584
Loss at step 180: 1.093999
Final loss: 1.067780
W, B = 3.0114281, 2.0865183
```

Using `implicit_gradients` avoids the need to provide all the trainable
parameters of the model as arguments to the `loss` function.

### Using Keras and the Layers API

[Keras](https://keras.io) is a popular API for defining model structures. The
[`tf.keras.layers`](https://www.tensorflow.org/api_docs/python/tf/keras/layers)
module provides a set of building blocks for models and is implemented using the
`tf.layers.Layer` subclasses in the
[`tf.layers`](https://www.tensorflow.org/api_docs/python/tf/layers)
module. We encourage the use of these same building blocks when using
TensorFlow's eager execution feature. For example, the very same linear
regression model can be built using `tf.layers.Dense`:

```python
class Model(object):
  def __init__(self):
    self.layer = tf.layers.Dense(1)

  def predict(self, inputs):
    return self.layer(inputs)
```

The `tf.layers` API makes it more convenient to define more sophisticated
models. For example, the following will train an MNIST model:

```python
class MNISTModel(object):
  def __init__(self, data_format):
    # 'channels_first' is typically faster on GPUs
    # while 'channels_last' is typically faster on CPUs.
    # See: https://www.tensorflow.org/performance/performance_guide#data_formats
    if data_format == 'channels_first':
      self._input_shape = [-1, 1, 28, 28]
    else:
      self._input_shape = [-1, 28, 28, 1]
    self.conv1 = tf.layers.Conv2D(32, 5,
                                  padding='same',
                                  activation=tf.nn.relu,
                                  data_format=data_format)
    self.max_pool2d = tf.layers.MaxPooling2D(
        (2, 2), (2, 2), padding='same', data_format=data_format)
    self.conv2 = tf.layers.Conv2D(64, 5,
                                  padding='same',
                                  activation=tf.nn.relu,
                                  data_format=data_format)
    self.dense1 = tf.layers.Dense(1024, activation=tf.nn.relu)
    self.dropout = tf.layers.Dropout(0.5)
    self.dense2 = tf.layers.Dense(10)

  def predict(self, inputs):
    x = tf.reshape(inputs, self._input_shape)
    x = self.max_pool2d(self.conv1(x))
    x = self.max_pool2d(self.conv2(x))
    x = tf.layers.flatten(x)
    x = self.dropout(self.dense1(x))
    return self.dense2(x)

def loss(model, inputs, targets):
  return tf.reduce_mean(
      tf.nn.softmax_cross_entropy_with_logits(
          logits=model.predict(inputs), labels=targets))

# Load the training and validation data
from tensorflow.examples.tutorials.mnist import input_data
data = input_data.read_data_sets("./mnist_data", one_hot=True)

# Train
device = "gpu:0" if tfe.num_gpus() else "cpu:0"
model = MNISTModel('channels_first' if tfe.num_gpus() else 'channels_last')
optimizer = tf.train.AdamOptimizer(learning_rate=1e-4)
grad = tfe.implicit_gradients(loss)
for i in range(20001):
  with tf.device(device):
    (inputs, targets) = data.train.next_batch(50)
    optimizer.apply_gradients(grad(model, inputs, targets))
    if i % 100 == 0:
      print("Step %d: Loss on training set : %f" %
            (i, loss(model, inputs, targets).numpy()))
print("Loss on test set: %f" % loss(model, data.test.images, data.test.labels).numpy())
```

For a more complete example, see [the example in the tensorflow/models
repository](https://github.com/tensorflow/models/tree/master/official/mnist/mnist_eager.py).

### Checkpointing trained variables

TensorFlow Variables (`tfe.Variable`) provide a way to represent shared,
persistent state of your model. The `tfe.Checkpoint` class provides a means to
save and restore variables to and from _checkpoints_.

For example:

```python
# Create variables.
x = tfe.Variable(10.)
y = tfe.Variable(5.)

# Indicate that the variables should be saved as "x" and "y".
checkpoint = tfe.Checkpoint(x=x, y=y)

# Assign new values to the variables and save.
x.assign(2.)
save_path = checkpoint.save('/tmp/ckpt')

# Change the variable after saving.
x.assign(11.)
assert 16. == (x + y).numpy()  # 11 + 5

# Restore the values in the checkpoint.
checkpoint.restore(save_path)  # save_path='/tmp/ckpt-1'

assert 7. == (x + y).numpy()  # 2 + 5
```

### `tf.keras.Model`

You may often want to organize your models using classes, like the `MNISTModel`
class described above. We recommend inheriting from the `tf.keras.Model` class
as it provides conveniences like keeping track of all model variables.

Sub-classes of `tf.keras.Model` may register `Layer`s (like classes in
[`tf.layers`](https://www.tensorflow.org/api_docs/python/tf/layers), or [Keras
layers](https://www.tensorflow.org/api_docs/python/tf/keras/layers)) by
assigning them to attributes (`self.name = layer_object`) and define the
computation in an implementation of `call()`.

Note that `tf.layers.Layer` objects (like `tf.layers.Dense`) create variables
lazily, when the first input is encountered.

For example, consider the following two-layer neural network:

```python
class TwoLayerNet(tf.keras.Model):
  def __init__(self):
    super(TwoLayerNet, self).__init__()
    self.layer1 = tf.layers.Dense(2, activation=tf.nn.relu, use_bias=False)
    self.layer2 = tf.layers.Dense(3, use_bias=False)

  def call(self, x):
    return self.layer2(self.layer1(x))

net = TwoLayerNet()

# No variables created yet
assert 0 == len(net.variables)

# They are created on first input:
inp = tf.constant([[1.]])

# Since input is a 1x1 matrix, net.l1 has 2 units and net.l2 has 3 units,
# the output is the product of a 1x1 matrix with a 1x2 matrix with a 2x3
# matrix.
assert [1, 3] == net(inp).shape.as_list()  # Invoke net; get output shape.
assert 1 == len(net.layer1.variables)
assert 1 == len(net.layer2.variables)
assert 2 == len(net.variables)  # weights for each layer.
assert [1, 2] == net.variables[0].shape.as_list()  # weights of layer1.
assert [2, 3] == net.variables[1].shape.as_list()  # weights of layer2.
```

The `tf.keras.Model` class is itself a sub-class of `tf.layers.Layer`. This
allows instances of `tf.keras.Model` to be embedded in other models. For
example:

```python
class ThreeLayerNet(tf.keras.Model):
  def __init__(self):
    super(ThreeLayerNet, self).__init__()
    self.a = TwoLayerNet()
    self.b = tf.layers.Dense(4, use_bias=False)

  def call(self, x):
    return self.b(self.a(x))

net = ThreeLayerNet()

assert [1, 4] == net(inp).shape.as_list()
assert 3 == len(net.variables)
assert [1, 2] == net.variables[0].shape.as_list()
assert [2, 3] == net.variables[1].shape.as_list()
assert [3, 4] == net.variables[2].shape.as_list()
```

See more examples in
[`tensorflow/contrib/eager/python/examples`](https://www.tensorflow.org/code/tensorflow/contrib/eager/python/examples).

`tfe.Checkpoint` provides a convenient way to save and load training
checkpoints. Let's define something simple to train. We set an objective for the
output of our network, choose an optimizer, and a location for the checkpoint:

```python
objective = tf.constant([[2., 3., 4., 5.]])
optimizer = tf.train.AdamOptimizer(0.01)
checkpoint_directory = '/tmp/tfe_example'
checkpoint_prefix = os.path.join(checkpoint_directory, 'ckpt')
net = ThreeLayerNet()
```

We group them in a `tfe.Checkpoint` and request that it be restored. This
ensures that variables created by these objects are restored before their values
are used. Our training loop is the same whether starting training or resuming
from a previous checkpoint:

```python
global_step = tf.train.get_or_create_global_step()
checkpoint = tfe.Checkpoint(
    global_step=global_step, optimizer=optimizer, network=net)
checkpoint.restore(tf.train.latest_checkpoint(checkpoint_directory))
for _ in range(100):
  loss_fn = lambda: tf.norm(net(inp) - objective)
  optimizer.minimize(loss_fn, global_step=global_step)
  if tf.equal(global_step % 20, 0):
    print("Step %d, output %s" % (global_step.numpy(),
                                  net(inp).numpy()))
    # Save the checkpoint.
    checkpoint.save(checkpoint_prefix)
```

The first time it runs, `Model` variables are initialized randomly. Then the
output is trained to match the objective we've set:

```
Step 20, output [[ 0.03575622  0.29863232  0.03474367  0.24735749]]
Step 40, output [[ 0.40646029  0.9856872   0.46851286  0.95358551]]
Step 60, output [[ 1.74541104  2.800704    1.79055595  2.74783421]]
Step 80, output [[ 2.14977384  3.44340849  3.96120024  5.16242075]]
Step 100, output [[ 1.99943113  3.02364397  3.93500996  4.9610076 ]]
```

In subsequent iterations, variables are initialized with the values read from
the latest checkpoint. Running the same code again, we continue from where we
left off:

```
Step 120, output [[ 1.99234128  3.0271616   3.98732996  4.96401167]]
Step 140, output [[ 2.00133467  3.01270437  4.00616646  5.00406504]]
Step 160, output [[ 1.99647415  2.9956708   3.99064088  4.99632359]]
Step 180, output [[ 2.00699997  3.00904822  4.00706148  5.01193142]]
Step 200, output [[ 1.98334622  2.98249531  3.97375059  4.97123432]]
```

### Summaries, metrics and TensorBoard

[TensorBoard](https://www.tensorflow.org/get_started/summaries_and_tensorboard)
is a popular tool for understanding, debugging and optimizing the model training
process. To benefit from the visualizations offered by TensorBoard, summary
events need to be written during the course of execution of your program. You
might find many Tensorflow programs that include the
[`tf.summary`](https://www.tensorflow.org/api_guides/python/summary) operations
during graph construction.

`tf.summary` operations are *not* compatible with eager execution, but an
equivalent alternative exists in
[`tf.contrib.summary`](https://www.tensorflow.org/versions/master/api_docs/python/tf/contrib/summary)
that is compatible with both eager execution and graph construction.

During model construction simply insert summary operations like
`tf.contrib.summary.scalar`. These operations do nothing by default, unless a
summary writer is currently active and a writing policy is set.

For example, to record summaries once every 100 global steps, use:

```python
tf.train.get_or_create_global_step()  # Ensuring the global step variable exists
writer = tf.contrib.summary.create_file_writer(logdir)

for _ in range(iterations):
  with writer.as_default():
    with tf.contrib.summary.record_summaries_every_n_global_steps(100):
      # your model code goes here
      tf.contrib.summary.scalar('loss', loss)
      # ...
```

See the full mnist example in
[`tensorflow/contrib/eager/python/examples/mnist`](https://www.tensorflow.org/code/tensorflow/contrib/eager/python/examples/mnist)
for a full model using `tf.contrib.summary`.

Similarly to summaries, the metrics in `tf.metrics` are currently not compatible
with eager execution. We instead provide object-oriented metrics in the
`tfe.metrics` package, which are compatible with graph construction as well.

Metrics in the `tfe.metrics`, such as `tfe.metrics.Mean` and
`tfe.Metrics.Accuracy`, all implement an intuitive object-oriented
interface. Here's an example of how to use the `tfe.metrics.Mean` metric:

```python
# Metrics are objects, which can be created and destroyed.
my_mean = tfe.metrics.Mean(name='my_mean')
# While a metric is active, you can call it as a function to accumulate into its
# internal state.
my_mean(0.0)
my_mean(10.0)
# Once you've finished updating the metric, you can get its result. In this case
# a simple average over all the calls to it. If a summary writer is active the
# metric will write the appropriate summaries using the metric name.
assert 5.0 == my_mean.result().numpy()
```

For a full example of a model using metrics for evaluation, see the mnist
example in
[`tensorflow/contrib/eager/python/examples/mnist`](https://www.tensorflow.org/code/tensorflow/contrib/eager/python/examples/mnist).

### Input Pipelines

The discussion above has been centered around the computation executed by your
model. The
[`tf.data`](https://www.tensorflow.org/api_docs/python/tf/data)
module provides APIs to build complex input pipelines from simple, reusable
pieces.

If you're familiar with constructing `tf.data.Dataset` objects when building
TensorFlow graphs, the same API calls are used when eager execution is enabled.
However, the process of iterating over elements of the dataset differs between
eager execution and graph construction. When eager execution is enabled, the
discussion on iterator creation using `make_one_shot_iterator()` and
`get_next()` in the
[Programmer's Guide](https://www.tensorflow.org/programmers_guide/datasets) is
*not* applicable. Instead, a more Pythonic `Iterator` class is available.

For example:

```python
# Create a source Dataset from in-memory numpy arrays.
# For reading from files on disk, you may want to use other Dataset classes
# like the TextLineDataset or the TFRecordDataset.
dataset = tf.data.Dataset.from_tensor_slices([1, 2, 3, 4, 5, 6])

# Apply transformations, shuffling, batching etc.
dataset = dataset.map(tf.square).shuffle(2).batch(2)

# Use tfe.Iterator to iterate over the dataset.
for x in tfe.Iterator(dataset):
  print(x)
```

Output:

```
tf.Tensor([4 9], shape=(2,), dtype=int32)
tf.Tensor([16 25], shape=(2,), dtype=int32)
tf.Tensor([36  1], shape=(2,), dtype=int32)
```

## Interoperating with Graphs

Eager execution improves the process of model development in Python; however,
because it is in its earliest stages, it does not yet support some features
available to [TensorFlow
graphs](https://www.tensorflow.org/get_started/get_started#the_computational_graph)
that are desirable when deploying models in production. In particular, eager
execution does not yet support distributed training, exporting models (to other
[programming languages](https://www.tensorflow.org/api_docs/), [TensorFlow
serving](https://www.tensorflow.org/serving/), and mobile applications), and
various memory and computation optimizations that are applied to TensorFlow's
dataflow graphs.

That said, the APIs used to build modes are exactly the same whether executing
eagerly or constructing graphs. This means that you can iteratively develop your
model with eager execution enabled and later, if needed, use the same code to
reap the benefits of representing models as computational graphs.

For example, the same model definition used to construct a graph in
[mnist.py`](https://github.com/tensorflow/models/tree/master/official/mnist/mnist.py)
can be trained with eager execution enabled as in [`mnist_eager.py`](https://github.com/tensorflow/models/tree/master/official/mnist/mnist_eager.py).

Other models in the [examples
directory](https://www.tensorflow.org/code/tensorflow/contrib/eager/python/examples/)
demonstrate this as well.

Some differences worth noting:

-   There is no notion of a `tf.placeholder` or a `tf.Session` when eager
    execution is enabled.
-   Many properties on the `tf.Tensor` object, like `tf.Tensor.name`,
    `tf.Tensor.op`, `tf.Tensor.inputs` are not meaningful when eager execution
    is enabled and their use will raise an `AttributeError`.
-   To use `tfe.implicit_gradients` in graph construction, variables must be
    created with [`use_resource=True`] provided to
    [`tf.get_variable()`](https://www.tensorflow.org/api_docs/python/tf/get_variable)
    or
    [`tf.variable_scope()`](https://www.tensorflow.org/api_docs/python/tf/variable_scope).
-   Some API calls (such as the functional-style `tf.layers.dense`,
    `tf.layers.conv2d`) are not compatible with eager execution. Use of such
    methods should raise an error indicating the alternative (e.g., the
    `tf.layers.Dense` and `tf.layers.Conv2D` classes).

## What next?

Please give eager execution a spin. This feature is in early stages and is
evolving, so we welcome your feedback via issues on GitHub (see [known
issues](https://github.com/tensorflow/tensorflow/labels/comp:eager)).

You may want to browse through some sample code, including benchmarks for some:

-   [Linear Regression](https://www.tensorflow.org/code/tensorflow/contrib/eager/python/examples/linear_regression)
-   [MNIST handwritten digit classifier](https://www.tensorflow.org/code/tensorflow/contrib/eager/python/examples/mnist)
-   [ResNet50 image classification](https://www.tensorflow.org/code/tensorflow/contrib/eager/python/examples/resnet50)
-   [RNN to generate colors](https://www.tensorflow.org/code/tensorflow/contrib/eager/python/examples/rnn_colorbot)
-   [RNN language model](https://www.tensorflow.org/code/tensorflow/contrib/eager/python/examples/rnn_ptb)

gha_language: C


text:
# πνικτός, ή, όν.

<!-- Status: S2=NeedsReview -->
<!-- Lexica used for edits: BDAG, LN, FFM, A-S -->

## Word data

* Strongs: G41560.

* Alternate spellings:

* Principle Parts:

* Part of speech:

[Adjective used substantively as a Noun](http://ugg.readthedocs.io/en/latest
/noun_substantive_adj.html).

* Instances in the New Testament: 3.

* All Scriptures cited: Yes

## Etymology:

[πνίγω]()),

* LXX/Hebrew glosses:

* Time Period/Ancient Authors:

* Related words:

* Antonyms for all senses

* Synonyms for all senses:

## Senses:

### Sense  1.0:

#### Definition:

strangled, choked

#### Glosses:

strangled, choked

#### Explanation:

#### Citations:

strangled: [Ac 15:20](Act 15:20), [29](Act 15:29) [21:25](Act 21:25) (cf. [Le 17:13](Lev 17:13), [14](Lev 17:14)).†

repository: mandolyte/uw-obsidian

branch_name: refs/heads/main

repo_name: mandolyte/uw-obsidian


text:
# Bedrock Test

This repo serves as a reference implementation for deploying highly available
WordPress applications using Bedrock, Chef, and Consul, among other tools.

**Warning:** Depending on the environment you're running, this could require a
lot of resources. You will be running up to 8+ virtual machines locally, so make sure
you're running this on a relatively beefy machine. We would recommend at least
16GB of RAM for optimal performance, however it has worked on machines with as
little as 8GB of RAM.

## Installation/Usage

### Consul

We are using consul for monitoring, as well as template generation using
[consul-template](https://github.com/hashicorp/consul-template).

#### Consul Server Cluster

The staging environment requires a cluster of consul servers. We have setup a
simple vagrant configuration that will handle this for you, which you can find
on github:
[vagrant-consul-cluster](https://github.com/thirdwavellc/vagrant-consul-cluster).

Simply clone the repo, cd into its directory, and run:

	vagrant up

This will create a 3-node cluster of consul servers.

We are currently using the ACL features of consul in order to match as closely
to production as possible. The master token is included in the README at the
vagrant-consul-cluster link above. When vagrant finishes creating/provisioning
the servers, access [the web ui](http://consul01:8500/ui/).

Click the settings cog in the upper right, and paste the master token in the
access token input box. You don't need to click any further buttons or refresh
the page (doing so will clear the access token and you will have to enter it
again). Instead, immediately click over to the ACL tab.

We are going to create an ACL token for the bedrock app. Click "New ACL", and
in the form on the right side of the page, enter "bedrock" for the name, set
the type to "client", and paste the following into the rules:

	key "" {
		policy = "deny"
	}

	key "bedrock/" {
		policy = "write"
	}

	key "haproxy/" {
		policy = "write"
	}

Upon creation, a token should be generated for the entry we just added. You
will need to copy this, and paste it into a few places, replacing the example
values currently in the repo.

terraform/consul.tf in one places:
  variable "consul_acl_token" {
    default = "3a6efcc8-b0e5-93e8-9188-b7cda829b929" # change me
  }

data_bags/consul/acl.json in one place:

	"token": "3a6efcc8-b0e5-93e8-9188-b7cda829b929" # change me

You can choose to not replace these values, as the default token is the master
token used for the ACL. This, however, isn't recommended as it differs from the
production environment.

The ACL should now be setup for our bedrock application.

#### Terraform

There are a few keys that we need to add to consul in order to properly
generate the templates for the web servers and haproxy. You can either do this
through the web ui, or using [Terraform](https://terraform.io/).

In either case, make sure you have properly setup the ACL as described in the
section above.

From the terraform directory, run:

	terraform apply

to automatically add the keys to your consul cluster.

### Virtual Machines

There are two sets of virtual machines: development and staging.

#### Development

To test the development environment, copy the '.env.example' file to a new file
'.env', and run:

	vagrant up dev

When this completes, it should be accessible at
[bedrock.test](http://bedrock.test)

#### Staging

As mentioned, the staging environment requires the consul cluster to be
running. Before you start any virtual machines, you will need to modify the
cookbooks/chef-bedrock/recipes/web.rb recipe:

	github_accounts ['adamkrone'] # change 'adamkrone' to your Github username

This will automatically import your public keys stored on Github to the machine
you are provisioning. Make sure your local computer's public key is registered
with your Github account. Password-based ssh login for the deploy user is not
enabled, so Capistrano will fail to deploy unless you have an ssh key imported.
If you are unsure how to add your ssh key to Github, or how to create one in
the first place, please refer to
[Github's documentation](https://help.github.com/articles/generating-ssh-keys/)

To start the staging environment:

	vagrant up

This will also start the dev machine, but it's easier than typing in what is
necessary to start everything but the dev machine:

  vagrant up web0{1,2} db lb0{1,2}

##### Deployment

For the staging environment we use Capistrano for deployment, so make sure you
have ruby installed, and install the dependencies:

	bundle install

Two Capistrano stages have been added for deployment using Capistrano:

	bundle exec cap bedrock1 deploy
	bundle exec cap bedrock2 deploy

These correspond to the two apps we're deploying, in order to simulate a
multi-tenant environment. It's actually deploying the same app, but they each
have their own directory/db, so they should operate separately.

When this completes, it should be accessible at
[bedrock1.stg](http://bedrock1.stg) and
[bedrock2.stg](http://bedrock2.stg)

repository: thirdwavellc/bedrock-test

gha_language: Ruby

gha_license_id: MIT

repo_name: thirdwavellc/bedrock-test


text:
# `@vtmn/icons`

> Decathlon Design System - Vitamin icons library

## Install package

After installing [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) or [yarn](https://yarnpkg.com/en/docs/install), you can install `@vtmn/icons` with this command:

```sh
# with npm
npm i -S @vtmn/icons

# with yarn
yarn add @vtmn/icons
```

Or you can also install it with a CDN like `unpkg.com`. You can browse content [here](https://unpkg.com/@vtmn/icons/).

## Usage

Once you have installed this package, depending on your setup, you can include `@vtmn/icons` in a handful of ways.

- Reference via `<img>` element
- Use the SVG sprite
- Use the icon font
- Include via CSS
- Copy-paste SVGs as embedded HTML

Vitamin icons gives you SVGs, so you can include them into your HTML in a few ways depending on how your project is setup.
Our icons include a `width` and `height` of `16px` by default to allow for easy resizing via `font-size`.

### External image

Reference Icons SVGs like normal images with the `<img>` element.

```html
<img
<EMAIL_ADDRESS>  alt="Home icon filled"
  width="32"
  height="32"
/>
```

### Sprite

Use the SVG sprite to insert any icon through the `<use>` element. Use the icon’s filename as the fragment identifier (e.g., `home-fill` is `#home-fill`). SVG sprites allow you to reference an external file similar to an `<img>` element.

```html
<svg width="32" height="32" fill="#001018">
  <use
<EMAIL_ADDRESS>  />
</svg>
```

### Icon font

Icon fonts with classes for every icon are also included. Include the icon web fonts in your page via CSS (`./node_modules/@vtmn/icons/dist/vitamix/font/vitamix.css`), then reference the class names as needed (e.g. `vtmx-home-fill` for the `home-fill` icon) in your HTML.

Use `font-size` and `color` to change the icon appearance.

If your icon is followed by a text:

```html
<span aria-hidden="true" class="vtmx-home-fill"> </span> Homepage
```

If your icon is alone:

```html
<span aria-label="Homepage" class="vtmx-home-fill"> </span>
```

### CSS

You can also use the SVG within your CSS (**be sure to escape any characters**, such as `#` to `%23` when specifying hex color values). When no dimensions are specified via `width` and `height` on the `<svg>`, the icon will fill the available space.

The `viewBox` attribute is required if you wish to resize icons with `background-size`. Note that the `xmlns` attribute is required.

```css
.vtmx::before {
  display: inline-block;
  content: '';
  vertical-align: -0.125em;
  background-image: url("data:image/svg+xml,<svg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'><path d="M7.3337.333v-4h1.334v4h4v1.334h-4v4h7.333v-4h-4v7.333h4z' fill='#001018'/></svg>');
  background-repeat: no-repeat;
  background-size: 1rem 1rem;
}
```

### Embedded

Embed your icons within the HTML of your page (as opposed to an external image file, not really recommended). Here we’ve used a custom `width` and `height`.

```html
<svg width="16" height="16" fill="#001018" xmlns="http://www.w3.org/2000/svg">
  <path
    d="M7.333 7.333v-4h1.334v4h4v1.334h-4v4H7.333v-4h-4V7.333h4z"
    fill="#001018"
  />
</svg>
```

## Development

To know all the use cases and their associated code, [check out the showcase here](https://decathlon.github.io/vitamin-web/@vtmn/showcase-icons).

## Changelog

If you want to know the different changes between versions of this package, [look at the changelog here](https://github.com/Decathlon/vitamin-web/blob/main/packages/sources/icons/CHANGELOG.md).

## I have an issue, what should I do?

Please file the issue [here](https://github.com/Decathlon/vitamin-web/issues/new).

## Contributing

See [the contributing docs](https://github.com/Decathlon/vitamin-web/blob/main/CONTRIBUTING.md).

## License

Vitamix Icons is the official Decathlon icon library based on the open-source icon library called [Remix Icon](https://remixicon.com/). This original library is under the license Apache 2.0 and has been modified by Decathlon. [Learn more](https://www.decathlon.design/726f8c765/p/76e6e0-vitamix-license).

Apache-2.0 © [Decathlon](https://github.com/Decathlon)

repository: MaximeMenotti/vitamin-web

repo_name: MaximeMenotti/vitamin-web


text:
+++
# Experience widget.
widget = "experience"  # See https://sourcethemes.com/academic/docs/page-builder/
headless = true  # This file represents a page section.
active = true  # Activate this widget? true/false
weight = 40  # Order that this section will appear.

title = "Experience"
subtitle = ""

# Date format for experience
#   Refer to https://sourcethemes.com/academic/docs/customization/#date-format
date_format = "Jan 2006"

# Experiences.
#   Add/remove as many `[[experience]]` blocks below as you like.
#   Required fields are `title`, `company`, and `date_start`.
#   Leave `date_end` empty if it's your current employer.
#   Begin/end multi-line descriptions with 3 quotes `"""`.

[[experience]]
  title = "Customer Success Engineer"
  company = "Layer"
  company_url = "https://www.wearelayer.com/"
  location = "Dublin, Ireland"
  date_start = "2021-04-01"
  date_end = ""
  description = """
  Responsibilities include:

  Python developer building integration protocols and procedures that incorporate with the  customers systems. Delivering technical support to the integration layer between banking application and bank services. Developing RESTfull API using Flask in an Agile environment.

  KEY ACHIEVEMENTS

  * Deployment and management of Docker Services.
  * Troubleshooting complex software issues.
  * Successfully handle technical queries on the company’s Helpdesk.
  * Troubleshoot implementation issues.
  * Writing API technical documentation
  * SOAP API integrations
  """

[[experience]]
  title = "Technical Services Systems Engineer"
  company = "Ryanair DAC"
  company_url = "https://www.ryanair.com/"
  location = "Dublin, Ireland"
  date_start = "2020-03-01"
  date_end = "2021-04-01"
  description = """
  Responsibilities include:

  Delivered technical support as per EASA Part-M regulations, resolved aircraft system issues. maintained Boeing 737NG and Airbus A320 tool calibration specifications database. Assessed Boeing Tool Change Bulletins and advise the company.

  KEY ACHIEVEMENTS

  * Carry out the daily aircraft’s laboratory review, reducing downtime of the system.
  * Reduced ground support equipment maintenance costs by accurately reviewing and amending service/calibration requirements in accordance with international Standards and equipment manufactures.
  * Migrated and reviewed +150 Airbus calibrated ground support equipment to Ryanair Database.
  * Reduced ground support equipment maintenance costs by accurately reviewing and amending service/calibration requirements per international Standards.
  * Handled technical queries on the company’s Technical Services Helpdesk.
  * Wrote SQL queries to generate efficient custom reports.
  * Key contact with international calibration laboratories assessing their capability.

  """

[[experience]]
  title = "Technical Services – Tooling Administrator"
  company = "Ryanair DAC"
  company_url = "https://www.ryanair.com/"
  location = "Dublin, Ireland"
  date_start = "2019-05-01"
  date_end = "2020-03-01"
  description = """
  Ensured that all Ryanair bases had serviceable ground support equipment available for their daily operations. Issued Calibration/Repair Orders that complied to the latest standards & manufacturer instructions for preventative/proactive maintenance. Arranged on-site inspections of tools and ground support equipment around European bases.

  KEY ACHIEVEMENTS

  * Developed a procedure to extract, and process data that generated all KPIs for weekly reports, reducing the time taken from 8 man-hours every week to less than 20 minutes.
  * Maintained all Ryanair’s +8000 calibrated tools in over +80 European bases to EASA Part 145 requirements with AMOS database management software.
  * Resolved tool issues using OEM/Airbus/Boeing Technical Manuals.
  """

[[experience]]
  title = "Continuing Airworthiness Records Officer"
  company = "Ryanair DAC"
  company_url = "https://www.ryanair.com/"
  location = "Dublin, Ireland"
  date_start = "2018-10-01"
  date_end = "2019-05-01"
  description = """
  Ensured that documentation of performed tasks met EASA Part-M, Part-145 continuing airworthiness regulation. Reviewed data entry of maintenance work orders on AMOS; liaising with the base manager to correct work order issues.

  KEY ACHIEVEMENTS
  * Co-developed a tracking solution for the return of technical records from 80 bases using Smartsheet software, showing the real-time status of shipments
  * Improved the tracking and reporting on document review of Airworthiness Directives, providing data visualisation of KPI in to management
  * Created a database to efficiently track aircraft tech logbooks using AMOS and Excel-VBA
  """

[[experience]]
  title = "Mechanical Engineer Intern"
  company = "Avior Airlines"
  company_url = "https://www.avior.com.ve/"
  location = "Barcelona, Venezuela"
  date_start = "2017-06-01"
  date_end = "2018-01-31"
  description = """Completed thesis for the BEng degree while gaining practical experience as an engineering intern.

  KEY ACHIEVEMENTS

  * Created an Excel database to optimise and simplify deferred maintenance activities.
  * Improved the reliability of line maintenance by mentoring technicians on safety hazards and risk mitigation.
  * Gained troubleshooting experience by continual use of the maintenance manuals for Boeing 737 aircraft systems.
  * Managed Line Maintenance Operations database using ALKYM software."""

+++

repository: mfrisoli/cv-page

repo_name: mfrisoli/cv-page


text:
+++
title="Topic - Subscribe Events"
weight = 50
+++

# Topic - Subscribe Events

## Description

This topic can be used to monitor whenever a specified channel receives a new subscription.

## Method Definition

*Required Parameters*

| Name          | Type      | Description  |
| ------------- |:---------:| -----------------:|
| credential | OAuth2Credential | User Auth Token for the target channel id, with the scope `channel_subscriptions` |
| channelId | String | Target Channel Id |

*Optional Parameters*

None

## Code-Snippets

Subscribe to all subscription events to the twitch4j channel and register a listener that prints all messages to console

```java
twitchClient.getPubSub().listenForSubscriptionEvents(credential, "149223493");

twitchClient.getEventManager().onEvent(ChannelSubscribeEvent.class, System.out::println);
```


text:
# algoexpert
Personal repository to save Algoexpert solutions with explanation of approach and analysis.

The content ownership of questions belongs to https://www.algoexpert.io/ This is just a personal repo to save work and has no affiliation to AlgoExpert. It's a wonderful platform and I highly encourage you to buy subscriptions to both AlgoExpert & SystemExpert


text:
# [Hadron](https://github.com/electronspin/hadron)

**Hadron is a WordPress starter theme built upon Sage, using Foundation for Sites 6.2.**

[**Sage**](https://roots.io/sage/) is a WordPress starter theme based on HTML5 Boilerplate, gulp, Bower (and Bootstrap Sass, originally) that will help you make better themes. Sage is produced and maintained by Ben Word and the team at [Roots](https://roots.io).

[**Foundation for Sites**](http://foundation.zurb.com/sites.html) is a front-end framework for rapidly building content-focused websites. It includes a wide range of modular and flexible components that are easily styled. Foundation for Sites is produced and maintained by the team at [ZURB](http://www.zurb.com/)

## Requirements

| Prerequisite    | How to check | How to install
| --------------- | ------------ | ------------- |
| PHP >= 5.4.x    | `php -v`     | [php.net](http://php.net/manual/en/install.php) |
| Node.js 0.12.x  | `node -v`    | [nodejs.org](http://nodejs.org/) |
| gulp >= 3.8.10  | `gulp -v`    | `npm install -g gulp` |
| Bower >= 1.3.12 | `bower -v`   | `npm install -g bower` |

For more installation notes, refer to the [Install gulp and Bower](#install-gulp-and-bower) section in this document.

## Sage Features

* [gulp](http://gulpjs.com/) build script that compiles both Sass and Less, checks for JavaScript errors, optimizes images, and concatenates and minifies files
* [BrowserSync](http://www.browsersync.io/) for keeping multiple browsers and devices synchronized while testing, along with injecting updated CSS and JS into your browser while you're developing
* [Bower](http://bower.io/) for front-end package management
* [asset-builder](https://github.com/austinpray/asset-builder) for the JSON file based asset pipeline
* [Foundation for Sites](http://foundation.zurb.com/sites.html) 6.2 (now with [Babel](https://babeljs.io/) integration)
* Sage [Theme wrapper](https://roots.io/sage/docs/theme-wrapper/)
* ARIA roles and microformats
* Posts use the [hNews](http://microformats.org/wiki/hnews) microformat
* [Multilingual ready](https://roots.io/wpml/) and over 30 available [community translations](https://github.com/roots/sage-translations)

Install Roots' [Soil](https://github.com/roots/soil) plugin to enable additional features:

* Cleaner output of `wp_head` and enqueued assets
* Cleaner HTML output of navigation menus
* Root relative URLs
* Nice search (`/search/query/`)
* Google CDN jQuery snippet from [HTML5 Boilerplate](http://html5boilerplate.com/)
* Google Analytics snippet from [HTML5 Boilerplate](http://html5boilerplate.com/)

## Theme installation

How to get the files in this repo into your local development environment:

### via Command-line

To pull the latest version of Hadron into your working theme directory:

*Note: it is recommended to complete the [theme setup](#theme-setup) and initial steps of [theme development](#theme-development) before activating Hadron in your WordPress installation.*

```sh
cd your-project/wp-content/themes
git clone https://github.com/electronspin/hadron.git your-theme-name && cd your-theme-name

```

Then activate the theme via [wp-cli](http://wp-cli.org/commands/theme/activate/).

```sh
wp theme activate your-theme-name
```

### via WordPress Admin Panel

1. [Download the latest release](https://github.com/electronspin/hadron/releases/latest) of Hadron.
2. In your WordPress admin panel, navigate to Appearance->Themes
3. Click Add New
4. Click Upload Theme
5. Upload the zip file that you downloaded.

## Theme setup

Edit `lib/setup.php` to enable or disable theme features, setup navigation menus, post thumbnail sizes, post formats, and sidebars.

## Theme development

Sage uses [gulp](http://gulpjs.com/) as its build system and [Bower](http://bower.io/) to manage front-end packages.

### Install gulp and Bower

Building the theme requires [node.js](http://nodejs.org/download/). We recommend you update to the latest version of npm: `npm install -g npm@latest`.

From the command line:

1. Install [gulp](http://gulpjs.com) and [Bower](http://bower.io/) globally with `npm install -g gulp bower`

### Install dependencies

Also from the command line:

Navigate to the theme directory, then run

1. `npm install`

1. `bower install`

You now have all the necessary dependencies to run the build process.

### Using gulp

Once you've installed NPM and Bower dependencies---but before you activate the theme---you need to compile the assets:

From your theme directory, run `gulp`

#### Available gulp commands

* `gulp` — Compile and optimize the files in your assets directory
* `gulp watch` — Compile assets when file changes are made
* `gulp --production` — Compile assets for production (no source maps).

For more info about gulp, and to learn how to customize your builds, go to [gulp.js](http://gulpjs.com/)

### Using BrowserSync

To use BrowserSync during `gulp watch` you need to update `devUrl` at the bottom of `assets/manifest.json` to reflect your local development hostname.

For example, if your local development URL is `http://project-name.dev` you would update the file to read:
```json
...
  "config": {
    "devUrl": "http://project-name.dev"
  }
...
```
If your local development URL looks like `http://localhost:8888/project-name/` you would update the file to read:
```json
...
  "config": {
    "devUrl": "http://localhost:8888/project-name/"
  }
...
```

For more info about BrowserSync, go to [browsersync.io](https://www.browsersync.io/)
### Local development using Wocker

I really like using Wocker for quick POCs and experiments.

Wocker is a Docker-based rapid development environment of WordPress that runs inside a Vagrant box.

See the [Getting Started](http://wckr.github.io/#h2-1) guide to get up and running.

## Documentation

This README (which is a variation of the original [Sage README](SAGE_README.md)) is the extent of documentation needed to get up and runnning.

**Sage** documentation is available at [https://roots.io/sage/docs/](https://roots.io/sage/docs/).

**Foundation for Sites** documentation is available at [http://foundation.zurb.com/sites/docs/](http://foundation.zurb.com/sites/docs/)

## Contributing

Contributions to Hadron are welcome from everyone. If you'd like to contribute to Sage or Foundation check out their respective repos.

## Social

This is my first project of this kind, and I'd appreciate any encouragement, suggestions, bug fixes, or general OSS guidance. Reach me [@colinjohnston](https://twitter.com/colinjohnston) or colin [at] electronspin [dot] com

Thanks to Ben Word ([@retlehs](https://twitter.com/retlehs)) and the team at Roots for creating Sage; I'm learning some good habits reading through your code and working with your tools. And thanks to the folks [@ZURB](https://twitter.com/ZURB) for creating Foundation---although the upgrade path from one major version to the next can be pretty hectic, it really is (in my opinion) the best heavy-duty front-end framework out there.

repository: divart/hadron

repo_name: divart/hadron


text:
## Welcome to open-insurance

### [index](index/)
an index of actual and direct (driven by actual companies) activities

### [meta](index/meta.html)
an index of meta and indirect (associations, initiatives, ... ) activities

### [events](events/)
past and upcoming events

### [about](about.html)

the name: [open(-source)](https://en.wikipedia.org/wiki/Open_source)-[insurance](https://en.wikipedia.org/wiki/Insurance)


text:
# Semi-Supervised Learning with ProPPR

This example shows how to use ProPPR for semi-supervised learning task - text categorization.

There are two parts in this example:
1. Run ProPPR with fixed number of examples on different datasets: citeseer, cora, pubmed
2. Tune hyper-parameter with Bayesian Optimization using Spearmint

## Part 1: ProPPR for TextCat-SSL
First, let's run ProPPR with some fixed parameters.
1. Clone the [ProPPR](https://github.com/TeamCohen/ProPPR) project.
2. Set the path of ProPPR in 'expt-getoor.bash'. You can also change other settings, such as dataset, eps, depth, etc.
3. Run '$ ./expt-getoor.bash'
4. You can change the number of unlabelled examples in 'settings.in'. Refer to this [paper](https://arxiv.org/abs/1703.01557v2) for more information.

## Part 2: Tuning Hyper-Parameters
Now, we will run Spearmint to find the optimal number of unlabelled data, which are used as constraints in this example.
1. Install [Spearmint](https://github.com/HIPS/Spearmint)
2. Change the path of ProPPR and Spearmint in 'expt-getoor-spearmint.bash'
3. Run '$ ./expt-getoor-spearmint.bash'
4. You can find the tuning progress in 'spearmint.log'

repository: TeamCohen/ProPPR

branch_name: refs/heads/working

gha_language: Java

repo_name: TeamCohen/ProPPR


text:
# MailChimp Integration

This is a fully hosted and supported integration for use with the [FlowLink](http://flowlink.io/) product. With this integration you can perform the following functions:

* Add new customers to your mailing lists
* Update contact information for existing customers
* Add e-commerce order information about subscribers

# About FlowLink

[FlowLink](http://flowlink.io/) allows you to connect to your own custom integrations.
Feel free to modify the source code and host your own version of the integration
or better yet, help to make the official integration better by submitting a pull request!

This integration is 100% open source an licensed under the terms of the New BSD License.

![FlowLink Logo](http://flowlink.io/wp-content/uploads/logo-1.png)


text:
## Creating from an existing snapshot

Assuming that the snapshot was created after all items were configured from the main server setup file.

##### Update System
``` bash
apt-get update && apt-get upgrade
```

##### Change host name to domain

``` bash
hostname [DOMAIN].[TLD]
```

##### Change host name in host file
``` bash
nano /etc/hosts
```

``` bash
<IP_ADDRESS> localhost
<IP_ADDRESS> [DOMAIN].[TLD] [DOMAIN].[TLD]
```

##### Change host name in mail local hosts
``` bash
nano /etc/mail/local-host-names
```

``` bash
localhost
[DOMAIN].[TLD]
```

##### Generate new Tripwire local key
``` bash
twadmin --generate-keys --local-keyfile /etc/tripwire/$HOSTNAME-local.key
```

##### Reinitialize Tripwire database with new key
``` bash
tripwire --init
```

##### Check Tripwire
``` bash
tripwire --check
```

##### Update RKHunter proposed
``` bash
rkhunter --propupd
```

##### Update New Relic Monitor
If your using the New Relic server monitor, you'll

``` bash
nano /etc/newrelic/nrsysmond.cfg
```
You'll need to change the license key and the host name
```
license_key=[LICENSE_KEY]
hostname=[HOST_NAME]
```

repository: belsrc/simple-server-setup

repo_name: belsrc/simple-server-setup


text:
---
layout: post
title: 232. Implement Queue using Stacks
subtitle: Easy
author: Bin Li
tags: [Coding, LeetCode, Easy, Stack]
image:
comments: true
published: true
---

## Description

Implement the following operations of a queue using stacks.

- push(x) -- Push element x to the back of queue.
- pop() -- Removes the element from in front of queue.
- peek() -- Get the front element.
- empty() -- Return whether the queue is empty.

**Example:**

```
MyQueue queue = new MyQueue();

queue.push(1);
queue.push(2);
queue.peek();  // returns 1
queue.pop();   // returns 1
queue.empty(); // returns false
```

**Notes:**

- You must use *only* standard operations of a stack -- which means only `push to top`, `peek/pop from top`, `size`, and `is empty` operations are valid.
- Depending on your language, stack may not be supported natively. You may simulate a stack by using a list or deque (double-ended queue), as long as you use only standard operations of a stack.
- You may assume that all operations are valid (for example, no pop or peek operations will be called on an empty queue).

## Solutions
### 1. Two Stacks

```python
# Time: O(n)
# Space: O(n)
class MyQueue:

    def __init__(self):
        """
        Initialize your data structure here.
        """
        self.push_stack = []
        self.helper = []

    def pour(self, push_stack, helper):
        if not any(push_stack):
            return
        while push_stack:
            helper.append(push_stack.pop())

    def push(self, x: int) -> None:
        """
        Push element x to the back of queue.
        """
        self.push_stack.append(x)

    def pop(self) -> int:
        """
        Removes the element from in front of queue and returns that element.
        """
        if not any(self.push_stack) and not self.helper:
            return None

        if not any(self.helper):
            self.pour(self.push_stack, self.helper)

        return self.helper.pop()

    def peek(self) -> int:
        """
        Get the front element.
        """
        if not any(self.push_stack) and not self.helper:
            return None

        if not any(self.helper):
            self.pour(self.push_stack, self.helper)

        return self.helper[-1]

    def empty(self) -> bool:
        """
        Returns whether the queue is empty.
        """
        if not any(self.push_stack) and not self.helper:
            return True
        else:
            return False

# Your MyQueue object will be instantiated and called as such:
# obj = MyQueue()
# obj.push(x)
# param_2 = obj.pop()
# param_3 = obj.peek()
# param_4 = obj.empty()
# 17/17 cases passed (20 ms)
# Your runtime beats 98.55 % of python3 submissions
# Your memory usage beats 100 % of python3 submissions (12.8 MB)
```

## References
1. [232. Implement Queue using Stacks](https://leetcode.com/problems/implement-queue-using-stacks)

gha_language: HTML


text:
---
title: Download
has_children: true
nav_order: 2
---
# Download MNE-CPP

Stable Releases
{: .label .label-blue }

| Version | Release | Download link |
|-------|-------|-------|
| [0.1.9](changelog.md#version-018) | 2021-02-26 |  [Windows](https://github.com/mne-tools/mne-cpp/releases/download/v0.1.9/mne-cpp-windows-dynamic-x86_64.zip){: .btn .btn-blue } [Linux](https://github.com/mne-tools/mne-cpp/releases/download/v0.1.9/mne-cpp-linux-dynamic-x86_64.tar.gz){: .btn .btn-blue } [MacOS](https://github.com/mne-tools/mne-cpp/releases/download/v0.1.9/mne-cpp-macos-dynamic-x86_64.tar.gz){: .btn .btn-blue }  |

See the [changelog](changelog.md) to see what features where added in each release version.

---

This is the quickest way to get MNE-CPP up and running on your machine.

### 1. Download MNE-CPP.

Select your version and platform. Download the latest stable release for the best stability.

### 2. Unzip the downloaded file.
Extract the downloaded build into a folder on your machine

### 3. Select the tool you wish to use from the `bin` folder.

In the `bin` folder,  you will find:
  - A real-time analysis application: [MNE-Scan](../documentation/scan.md).
  - An offline visualization/analysis application: [MNE Analyze](../documentation/analyze.md).
  - An anonymization/deidentification tool for FIF files: [MNE Anonymize](../documentation/anonymize.md).

---

Using the latest stable release is recommended for users who wish to use MNE-CPP's command line tools and GUIs. But if you want to check out the latest features, try downloading the [development versions](development_versions.md).

We are also developing some of our aplications so that they can run directly on the browser. No need to install anything! See [On the browser](webasm.md).

repository: mne-tools/mne-cpp

repo_name: mne-tools/mne-cpp


text:
# This image belongs to a larger project called Bioinformatics Docker Images Project (http://pegi3s.github.io/dockerfiles)
## (Please note that the original software licenses still apply)

This image facilitates the usage of [DnaSP v6](http://www.ub.edu/dnasp/), a software package for the analysis of DNA polymorphisms using data from a single locus (a multiple sequence aligned -MSA data), or from several loci (a Multiple-MSA data, such as formats generated by some assembler RAD-seq software).

# Using the DnaSP v6 image in Linux

Please note that the following instructions must be executed in Linux environments only.

You should adapt and run the following command: `docker run -it --rm --env="DISPLAY" --volume="${XAUTHORITY:-${HOME}/.Xauthority}:/root/.Xauthority:ro" --volume="/tmp/.X11-unix:/tmp/.X11-unix:ro" -v=/your/data/dir:/data --hostname="$(hostname)" pegi3s/dnasp-v6 wine "/wineuser/.wine/drive_c/Program Files (x86)/DnaSP v6/DnaSP6.exe"`

If the above command fails, try running `xhost +` first. In this command, you should replace:
- `/your/data/dir` to point to the directory that you want to have available at `DnaSP v6`.

Running this command opens the [DnaSP v6](http://www.ub.edu/dnasp/) Graphical User Interface. Your data directory will be available through the file browser at `/data`. Please, note that you must give write permissions to other users in this directory in order to allow DnaSP v6 write output files in it (e.g. `sudo chmod o+w /your/data/dir`).

# Building the Docker image

DnaSP v6 is a Windows application and it requires wine to run in a Linux-based Docker image. See the [DOCKER-BUILD.md](DOCKER-BUILD.md) file.

gha_language: Dockerfile


text:
# LogBot

  Welcome to LMGN's Logbot

# What do I need to know?

- You should only run LogBot on **one** server

# How do I set it up?

- 1. Download Python 3, and select `Add to PATH`
- 2. Right above the files to the left, click on `Download or Clone`
- 3. Click `Download as ZIP`
- 4. Unzip it
- 5. Open `bot.py` in a text editor
- 6. Edit the config (at the top)
- 7. If you don't have a token, go [here](https://github.com/Just-Some-Bots/MusicBot/wiki/FAQ#how-do-i-create-a-bot-account)
- 8. Run the `run.bat`
- 9. To add it to the server, open the `ADD_TO_SERVER.bat` it created
- 10a. Done! To get the logs type `!getLogs`
- 10b. The `!getLogs` command is only available to people with the `Manage Server` Permission

license: Unlicense

repository: theLMGN/LogBot

repo_name: theLMGN/LogBot


text:
---
title: "Tidy Human Activity Recognition Using Smartphones Dataset"
author: "Keith D. Donldson"
date: "April 26, 2015"
---

The run_analysis.R script:

1. reads the raw data files
2. Merges the training and the test sets to create one data set called observations.
3. Extracts only the measurements on the mean and standard deviation for each measurement.
4. Uses descriptive activity names to name the activities in the data set.
5. Appropriately labels the data set with descriptive variable names.
6. From the data set in step 5, generates an independent tidy data text file that meets the principles of:
* Each variable you measure should be in one column
* Each different observation of that variable should be in a different row
* There should be one table for each "kind" of variable
* If you have multiple tables, they should include a column in the table that allows them to be linked

The data shows the average of each variable for each activity and each subject called meanvariables, which is exported as tidy_data_set.txt.

The raw data:

* activity_labels.txt
* features.txt
* subject_test.txt
* y_test.txt
* X_test.txt
* subject_train.txt
* y_train.txt
* X_train.txt

A tidy data set:

* tidy_data_set.txt

A code book describing each variable and its values in the tidy data set:

* CodeBook.md

repository: kdonaldson/human-activity-recognition

repo_name: kdonaldson/human-activity-recognition


text:
---
layout: post
title:      "creating your own methods"
date:       2018-10-11 04:24:43 +0000
permalink:  creating_your_own_methods
---

One of the most intimidating things about writing code is the beginning.  When you're staring at a nearly blank screen, cursor blinking, and brain ticking off the ideas you could do.

They're so numerous and yet I find myself hitting a block often.

Perhaps I'm a bad problem solver (true)
Perhaps I ought to review (I am at the moment)
Perhaps I need a nudge in the right direction that speaks to me in ways that the instructions don't.

Often times it's not a weakness to admit the truth.  I find that most often the truth helps moving forward.

How do we even start?  If we're limited to our toolset to avoid certain methods, how does it work in the background?

Google is my friend, and so is Ben, even though he doesn't know me.  I found his video incredibly helpful, moreso than sitting here scratching my head while I struggled to think of a way to do what needed to be done in the lab.  Learn.instruct is such a great resource, I'm so glad this was shared with me.

https://youtu.be/XRF-CJFZyCg

Let's think about the hints we're given:

* Think about how to determine which value is the lowest. Do you need to compare each value to something as you iterate?

What's something that can hold a value?  A variable!

* Think about how to collect or store the correct key. Remember that you need your method to return just this key.

What can we use to display the key?  Again, what is something that can hold a value?  A variable!  So versatile.

```
def key_for_min_value(hash)
  low_val = nil
  low_key = nil

	# we're using these variables as placeholders for the values of the hash we're going to iterate over.  Then we're going to use those variables to compare against the values yielded to the block.

  hash.each do |key, val|

	#We iterate!

    if low_val == nil || val < low_val
		# here is where we compare, seeking a boolean value.  If the low_value is equal to nil (as it is in our default value) or if the val yielded to the block is less than the low_val is true...

    low_val = val
    low_key = key
		#we assign the val and key values yielded to the block to low_val and low_key respectively!

 end
end
low_key
#Oh and then we return the value of the KEY!  As instructed.
end

```

extension: markdown


text:
**Media:** Radio, Wire |
**Pins used:** 1 / 2

Oversampling strategy was initially developed in the [PJON_ASK](https://github.com/gioblu/PJON_ASK) repository, and it was integrated in the PJON repository from version 3.0 beta, as a data link layer strategy. Bits are over-sampled to have high resilience in high interference scenarios, like using an ASK/FSK cheap radio transceivers in an urban environment. It is tested effectively with many versions of the ASK/FSK 315/433Mhz modules available on the market, but it works nominally also through wires and the human body.

####Compatibility
- ATmega88/168/328 16Mhz (Diecimila, Duemilanove, Uno, Nano, Mini, Lillypad)
- ATmega2560 16Mhz (Arduino Mega)
- ATmega16u4/32u4 16Mhz (Arduino Leonardo)

####Performance
- Transfer speed: 202 B/s or 1620 Baud
- Data throughput: 150 B/s
- Range: 250 meters in urban environment / 5km with line of sight and ideal atmospheric conditions

####How to use OverSampling
Pass the `OverSampling` type as PJON template parameter to instantiate a PJON object ready to communicate in this Strategy. All the other necessary information is present in the general [Documentation](https://github.com/gioblu/PJON/wiki/Documentation).
```cpp
  /* Maximum latency can be set defining OS_LATENCY before PJON.h inclusion
     (Default 4 milliseconds) */
  #define OS_LATENCY 4000

  /* Set the back-off exponential degree */
  #define OS_BACK_OFF_DEGREE 4

  /* Set the maximum sending attempts */
  #define OS_MAX_ATTEMPTS 20

  /* The values set above are the default producing a 3.2 seconds
     back-off timeout with 20 attempts. Higher OS_MAX_ATTEMPTS to higher
     the back-off timeout, higher OS_BACK_OFF_DEGREE to higher the interval
     between every attempt. */

  #include <PJON.h>

  PJON<OverSampling> bus; // 2 pin over-sampled data link layer

  void setup() {
    bus.strategy.set_pin(12);      // Set the pin 12 as the communication pin
                                   // or
    bus.strategy.set_pins(11, 12); // Set pin 11 as input pin and pin 12 as output pin
  }
```
After the PJON object is defined with its strategy it is possible to set the communication pin accessing to the strategy present in the PJON instance.

####Use OverSampling with cheap 433Mhz transceivers
To build a real open-source PJON packet radio able to communicate up to 5km you need only a couple (for `SIMPLEX` mode) or two couples (for `HALF_DUPLEX` mode) of cheap 315/433Mhz ASK/FSK transmitter / receiver modules (with a cost around 2/3 dollars). Please be sure of the regulations your government imposes on radio transmission over these frequencies before use.

![PJON Oversampling packet radio](http://www.gioblu.com/PJON/PJON-OverSampling-packet-radio-STX882-SRX882.jpg)

The maximum detected range was experimented with a small packet radio transmitting its position every minute. The maximum range obtained was slightly more than 5 kilometers in line of sight in open area. Testing it instead in an urban environment the range is down to 250 meters. Two couples of STX882 and SRX882 were used as transceivers. If you choose these modules, remember to set `HIGH` the pin `CS` on the receiver before starting reception.

If Using `OverSampling` data link layer, the asynchronous acknowledgment is suggested as default acknowledgment mechanism because includes in the packet's meta-info a packet id, avoiding duplicated receptions.

####Antenna design
Experiments in `HALF_DUPLEX` mode have shown that it seems better to keep isolated the two antennas, using two different, not connected elements to transmit and receive. The first suggested antenna design is a wide beam dipole antenna made by two 173mm (quarter wavelength) or 345mm (half wavelength) long conductive elements, one connected to ground and the other connected to the input or output pin:
```cpp

 173mm (quarter wavelength) / 345mm(half wavelength)

 -------------------|--------------------
                  __|__
                 |TX/RX|
                 |_____|

```
A more directional, compact and long range antenna design is the wip antenna. Can be easily crafted with two 173mm (quarter wavelength) / 345mm (half wavelength) long insulated wire sections wrapped with each other every 5mm, one is connected to ground and the other to the input or output pin. This design helps because of its strong ground plane, often necessary to have decent results with this sort of hardware.
```cpp
         5mm
         ||  173mm (quarter wavelength) / 345mm (half wavelength)
 GND   --\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 RX/TX --/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
```

####Known issues
- In older versions, OverSampling was affected by ineffective and short range if used in `HALF_DUPLEX` mode. This issue has been fixed by handling the gain refresh (see issue [91](https://github.com/gioblu/PJON/issues/91)).

repository: skuphmarx/midnightraven

repo_name: skuphmarx/midnightraven


text:
Github API - Angular Project
===================

Team - Byte 2
-------

Members: Reiss, Fareed, Mat Drake, Frazer, Godfrey.

Description

Simple GitHub Profile app that using Github API/Javascript/AngularJS to allow search through Github user profiles and show list of github profiles information for requested username: user's login,user's avatar, number of followers and number of repos.

Technologies

Angular JS,
Javascript,
GitHub API,
Testing with Jasmine/Karma,
Node & npm

Installation
Add dependencies by bower install

Instructions
-------

Testing

Run server npm start,
Run Karma npm test in another terminal tab,
Run Protractor npm run protractor in another terminal tab

User Stories - Must Haves
-------

:white_check_mark:
```
As a hiring partner
So I can view information about Github users rapidly
I want a list of Github users
```

:white_check_mark:
```
As a hiring partner
So I can find a specific user
I want to search for a particular user by username and view them in the list
```
:white_check_mark:
```
As a hiring partner
So I can see what a user looks like
I want to view each user's avatar in the list
```
:white_check_mark:
```
As a hiring partner
So I can see how popular a user is
I want to view the number of followers for each user in the list
```
:white_check_mark:
```
As a hiring partner
So I can see how prolific a user is
I want to view the number of repos each user in the list has
```

User Stories - Nice-to-haves
-------
:construction:
```
As a hiring partner
So I can enjoy my experience of using this app
I want animations on search submission and on loading of new content
```
:white_check_mark:
```
As a hiring partner
So I can easily use this app
I want a beautiful frontend
```


text:
# linkedin-post

It uploads the post on your LinkedIn profile via LinkedIn API.

### Steps to run script
1. Install the requirements using pip as `pip install -r requirements.txt`.
2. Create an app on LinkedIn's developers account [here](https://www.linkedin.com/developers/) and follow the guide [here](https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/context) to get the access token. After getting access token, send a `GET` request defined [here](https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin?context=linkedin/consumer/context#api-request) to get the Person `URN` from the response.
3. Create a `.env` file and write the follwing content into it
```
ACCESS_TOKEN="<your access token>"
URN="<your urn>"
```
4. Run the script using `python post_on_linkedin.py` which will print the `SUCCESS` and `id` of the post shared as a JSON response. You can now check as well on your LinkedIn profile. :)

### License
This code is available with [MIT](https://github.com/gutsytechster/linkedin-post/blob/master/LICENSE) License

repository: gutsytechster/linkedin-post

gha_language: Python

repo_name: gutsytechster/linkedin-post


text:
# Super Galactic Age Calculator 🚀🛸🌌
Super galactic age calculator is a JS app that lets you figure out your age on other planets in the solar system, your life expectancy on that planet, and how long you have left to live (or how long you've been overstaying your welcome).

# New Features!

  - It's version 1.0! Everything is a new feature :)
  - Calculate your age on Earth and several other planets on any given day. Want to know how old you'll be in 2354? You can do that.
  - Calculate your age on various planets. Now when you tell the other soccer moms you're turning 29 for the 14th year in a row, you wont necessarily be lying.
  - Based on your gender, you'll have a different life expectancy. Women get a few bonus years 🎉
  - You can also get a rundown on how many years you have left on different planets*.

   _*Unfortunately the march of time is constant and unrelenting. The only person you'll be fooling is yourself if try moving to Mercury to squeeze out a few more decades._

## Tech

* ES6
* WebPack
* ESLint
* Karma
* Jasmine
* jQuery
* Bootstrap
* Babel

## Installation
1. In terminal, clone repo from Github (https://github.com/ben-kirby/Super-Galactic-Age-Calculator.git) and navigate to the main directory.
2. Run ```npm install``` to install dependencies.

## Usage
1. Create a new Person object with three arguments passed in: birth date, comparison date, and gender.
 ```let ben = new Person ("1991-07-24", "2019-01-11", "male");```
2. Call ```grimReaper()``` on your instance of Person.

_Currently there is no UI, so you will have to manually check variables to see your info. The order of information stored in arrays is the same as the order of the planets._

## What's Next?
- A UI would be helpful. Probably with a vintage space theme (think Jetsons).
- More planets!

### License

*Copyright (c) 2018 Ben Kirby*
*This software is licensed under the MIT license.*

repository: ben-kirby/Super-Galactic-Age-Calculator

repo_name: ben-kirby/Super-Galactic-Age-Calculator