text:
## 0.3.0 - 2020-06-12

* Change package from `nl.codestar` to `com.scalatsi`

Libraries will be published under both organizations on maven central for backwards-compatibility initially.

## 0.2.2 - 2020-05-29

* Add ability to rename generated types
* Output will now be generated even if parent directories do not exists yet and improve error messages
* Fixed unused import warning when generating model

## 0.2.1 - 2020-05-22

* Add support for [Literal types](https://docs.scala-lang.org/sips/42.type.html) under Scala 2.13

## 0.2.0 - 2020-05-22

Implicits aren't needed anymore in most cases, the plugin will use the standard generation by default!

* Scala 2.13 support
* Plugin now requires SBT 1.3
* Case classes and sealed trait are now automatically generated
* Sealed traits are now converted into a Typescript Discriminated Union
* Add experimental semicolon support with `typescriptStyleSemicolons` sbt setting (#62)
* `TSExternalName` was renamed to `TSTypeReference` (#43)
* Types are now always outputted in alphabetical order
* Output now has constined and no superflous whitespace

## 0.1.3 - 2018-03-08

* Add `export` to all typescript definitions for easier importing from other files (#31, Fixes #28)
* Add `TSObject` for the Typescript `object` type (#25)
* Map `scala.Any` to Typescript `any`
* Map `scala.AnyRef` and `java.lang.Object` to `object` (#25)
* Map `java.time.*` and `java.util.Date` to `string`
   changeable by overriding `val java8TimeTSType` from `JavaTSTypes` or`DefaultTSTypes` (#26)
* Map java numeric types to `Number` (#26)
* Fix collection types not automatically being converted to an array of the collection element (#27)

## 0.1.2 - 2018-06-08

* Fixes exception when using the plugin in SBT 1.1+ (#23)

## 0.1.1 - 2018-03-16

* `scala-tsi` artifact now contains all dependencies, does not depend on a macro project any more

## 0.1.0 - 2018-03-16

Initial Release of scala-tsi

Features:
* Sbt plugin to generate a typescript file from your domain definition
* Matchings (`TSType`) from a good set of built-in Java and Scala types
* macro to generate typescript interfaces from your case classes
* DSL to write your own typescript definitions
* AST that can model the whole typescript type system (afaik)

repository: rahulAtGit/scala-tsi

repo_name: rahulAtGit/scala-tsi


text:
# morsecode
Welcome to my very first project developed in C++ by leewilliam236!

I've currently developed the following functions.
- print (type in a few words or sentences and the computer will translate them by typing in the dots and dashes. It includes a generic beep sound too!)
- display (does the same as the print function, except the computer just displays the morse code.)

I'm still working on these functions.
- adjusting the speed (user can set it)
- adjusting the pitch (user can set it)
- typing in certain buttons to do certain commands during runtime
- telegraph mode

As you can see, the project is currently under construction. I might add more to the list of what I'm working on, but I'm currently showing this project simply for feedback!

To download exe or zip file (includes source code) click the link below:
https://github.com/leewilliam236/morsecode/releases

NOTE: The beeps and sleep function only work on Windows! So Unfortunately, it's not going to work in Mac or Linus OS at the moment.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
description: "Learn what swaps are, swap processes implemented in the Medusa backend, and a swap’s relation to other entities"
---

# Swaps Architecture Overview

In this document, you’ll learn what swaps are, swap processes implemented in the Medusa backend, and a swap’s relation to other entities.

## Overview

After an order is created and fulfilled, the customer may need to replace an item they received with another. They can then create a swap, requesting to return an item they have in place for a new item. The swap, similar to an order, can then be paid, fulfilled, and more.

The Medusa core provides the necessary implementation and functionalities that allow you to integrate swaps in your store and automate the Return Merchandise Authorization (RMA) flow.

---

## Swap Entity Overview

Some of the attributes of the `Swap` entity include:

- `fulfillment_status`: a string indicating the status of the swap’s fulfillment. Its possible values indicated by the [SwapFulfillmentStatus enum](../../references/entities/enums/SwapFulfillmentStatus.md) can determine whether all items have been fulfilled, shipped, or canceled.
- `payment_status`: a string indicating the status of the swap’s payment. Its possible values indicated by the [SwapPaymentStatus enum](../../references/entities/enums/SwapFulfillmentStatus.md) can determine whether the payment of the swap has been captured or refunded.
- `difference_due`: An integer indicating the difference amount between the order’s original total and the new total imposed by the swap.
  - If the value of `difference_due` is negative, that means the customer should be refunded.
  - If it’s positive, that means the customer must authorize additional payment.
  - If it’s zero, then no refund or additional payment is required.
- `confirmed_at`: A date indicating when the swap was confirmed by the customer.
- `canceled_at`: A date indicating when the swap was canceled.
- `no_notification`: a boolean value indicating whether the customer should receive notifications when the order is updated.
- `allow_backorder`: a boolean value indicating whether a swap can be created and completed with items that are out of stock.

There are other important attributes discussed in later sections. Check out the full [Swap entity in the entities reference](../../references/entities/classes/Swap.md).

---

## How are Swaps Created

In Medusa, Swaps are created by the customer through the storefront. This ensures an automated Return Merchandise Authorization (RMA) flow. This section explains the ideal and recommended process, but you’re free in how you choose to implement Swaps creation flow.

### Idempotency Key

An Idempotency Key is a unique key associated with a swap. It is generated when the swap creation process is started and can be used to retry the swap creation safely if an error occurs. The idempotency key is stored in the `Swap` entity under the attribute `idempotency_key`.

Keep in mind that the idempotency key stored in the swap is only used when creating the swap. All operations related to the swap’s cart and its completion use the [cart’s idempotency key](../carts-and-checkout/cart.md#idempotency-key).

You can learn more about idempotency keys [here](../../development/idempotency-key/overview.mdx).

### Swap Creation Process

The customer starts by creating their swap, which can be done through the Create Swap endpoint. In this endpoint, the following steps are implemented:

![Swap Creation Flowchart](https://res.cloudinary.com/dza7lstvk/image/upload/v1681983755/Medusa%20Docs/Diagrams/swap-process_kylqq0.jpg)

1. The swap’s creation is initiated with the `SwapService`'s [create method](../../references/services/classes/SwapService.md#create):
    1. The order is first validated to see if a swap can be created. This includes checking the `payment_status` of the order to ensure the payment has already been captured, and the `fulfillment_status` of the order to ensure the status isn’t `not_fulfilled`. If any of these conditions aren’t met, the process is terminated with an error.
    2. The items that the customer chose to return are then validated. If any item has been previously canceled, meaning that its order, swap, or claim have been previously canceled, the process is terminated with an error.
    3. If all the conditions above are met, the swap is then created and associated with the order using the `order_id` attribute.
    4. A return is created and linked to the swap. The return’s items are set to the items that the customer chose to return.
2. After the swap has been created, a cart is then created for the swap using the `SwapService`'s [createCart method](../../references/services/classes/SwapService.md#createcart). The cart is used to finalize the process of the swap creation process, but more on that later. The swap is associated with the cart using the `cart_id` attribute.
3. The return associated with the swap is marked as fulfilled, as this is taken care of by the customer.

After the swap has been created, the customer should undergo a swap-completion process similar to the checkout process where they provide shipping and billing addresses, choose shipping and payment methods, authorize any additional payment required, then finally completing the cart.

This is all made possible since the swap is linked to a cart, so the same checkout flow can be implemented in a swap context. The cart completion strategy also handles the completion differently for swaps, as explained [here](../carts-and-checkout/cart.md#cart-completion).

---

## Handling Swap Payment

After the swap has been created and completed by the customer, the merchant can then process the payment of the swap. This includes either refunding or capturing an additional payment, which is decided by the value of the `difference_due` attribute as explained in the [Swap Entity section](#swap-entity-overview).

The processing of the swap’s payment can be done either using the `SwapService`'s [processDifference method](../../references/services/classes/SwapService.md#processdifference), or using the [Process Swap Payment endpoint](https://docs.medusajs.com/api/admin#orders_postordersorderswapsswapprocesspayment).

If the swap requires any additional payment, the customer is expected to have authorized the payment during the [swap and cart completion flow explained earlier](#how-are-swaps-created). The merchant can then capture the payment and the `payment_status` of the swap is set to `captured`.

If the swap requires a refund, the merchant can refund the payment to the customer and the `payment_status` of the swap is set to `difference_refunded`. The same status is used if no refund or additional payment are required.

If the capturing or refunding of the payment causes any errors, the payment status is changed to `requires_action`.

A swap’s payment can be accessed by expanding the `payment` relation and accessing `swap.payment`. A payment is represented by the `Payment` entity.

---

## Handling Swap Fulfillment

After the swap has been created and completed by the customer, the merchant should handle the [fulfillment](./fulfillments.md) of the new items.

Although you have freedom in how you implement the process, the recommended process provided in the Medusa backend is as follows:

![Swap Fulfillment Flowchart](https://res.cloudinary.com/dza7lstvk/image/upload/v1681984933/Medusa%20Docs/Diagrams/swap-fulfillment-process_xfurko.jpg)

1. The fulfillment is created either using the `SwapService`'s [createFulfillment method](../../references/services/classes/SwapService.md#createfulfillment) or using the [Create a Swap Fulfillment endpoint](https://docs.medusajs.com/api/admin#orders_postordersorderswapsswapfulfillments). This would set the `fulfillment_status` of the swap either to `fulfilled` if all items have been fulfilled, or `partially_fulfilled` if only some items were fulfilled.
2. The shipment can then be created using the `SwapService`'s [createShipment method](../../references/services/classes/SwapService.md#createshipment) or using the [Create Swap Shipment endpoint](https://docs.medusajs.com/api/admin#orders_postordersorderswapsswapshipments). This would set the `fulfillment_status` of the swap either to `shipped` if all items have been shipped, or `partially_shipped` if only some items were shipped.
3. Alternatively, a fulfillment can be canceled after it has been created using the `SwapService`'s [cancelFulfillment method](../../references/services/classes/SwapService.md#cancelfulfillment) or using the [Cancel Swap’s Fulfillment endpoint](https://docs.medusajs.com/api/admin#orders_postordersswapfulfillmentscancel). This would set the `fulfillment_status` of the swap to `canceled`.

A swap’s fulfillments can be accessed by expanding the `fulfillments` relation and accessing `swap.fulfillments`. A fulfillment is represented by the `Fulfillment` entity.

---

## Handling a Swap's Return

A swap's return can be marked as received, which would adjust the inventory and change the status of the return. This process is explained within the [Returns documentation](./returns.md#mark-return-as-received-process).

---

## Canceling a Swap

A swap can be canceled by the merchant if necessary. It can be done either through the `SwapService`'s [cancel method](../../references/services/classes/SwapService.md#cancel) or the [Cancel Swap endpoint](https://docs.medusajs.com/api/admin#orders_postordersswapcancel).

A swap can’t be canceled if:

- The payment has been refunded (the `payment_status` is either `difference_refunded`, `partially_refunded`, or `refunded`).
- Its fulfillment isn’t canceled. You’ll have to cancel the swap’s fulfillment as explained in the [Handling Swap Fulfillment section](#handling-swap-fulfillment).
- Its return isn’t canceled. You’ll have to [cancel the return](./returns.md#cancel-a-return) associated with the swap first before canceling the swap.

---

## RMA Automation with Swaps

Giving the client control over the creation of the swap and handling the returns allows businesses to automate their RMA flow.

The client, typically the customer, creates the swap, authorizes any additional payment required, and handles returning the item. The admin, typically the merchant, can view the created swap, process the payment, and fulfill and ship the additional items.

![RMA Automation with Swaps Flowchart](https://res.cloudinary.com/dza7lstvk/image/upload/v1681987907/Medusa%20Docs/Diagrams/rma-automation-swap_c9wwaj.jpg)

This removes any friction and support required between the client and the admin.

---

## Relation to Other Entities

This section includes relations that weren’t mentioned in other sections.

### Order

The swap must be associated with the [order](./orders.md) it’s created for. An order is represented by the `Order` entity.

You can access the order’s ID using the `order_id` attribute. You can also access the order by expanding the `order` relation and accessing `swap.order`.

### Cart

The swap must be associated with a [cart](../carts-and-checkout/cart.md). A cart is represented by the `Cart` entity.

You can access the cart’s ID using the `cart_id` attribute. You can also access the cart by expanding the `cart` relation and accessing `swap.cart`.

### LineItem

The swap is associated with new items that should replace the customer’s items. These items are represented by the `LineItem` entity.

You can access the swap’s new items by expanding the `additional_items` relation and accessing `swap.additional_items`.

### Return

The swap is associated with a [return](./returns.md) that is created when the swap is created. A return is represented by the `Return` entity.

You can access the swap’s return by expanding the `return_order` relation and accessing `swap.return_order`.

### Address

The swap can be associated with shipping and billing addresses. Both shipping and billing addresses are represented by the `Address` entity.

You can access the swap’s billing address ID using the `billing_address_id` property. You can also access the billing address by expanding the `billing_address` relation and accessing `swap.billing_address`.

You can access the swap’s shipping address ID using the `shipping_address_id` property. You can also access the shipping address by expanding the `shipping_address` relation and accessing `swap.shipping_address`.

---

## See Also

- [How to manage swaps](./admin/manage-swaps.mdx)
- [Order Architecture Overview](./orders.md)

repository: medusajs/medusa

branch_name: refs/heads/develop

gha_language: TypeScript

gha_license_id: MIT

repo_name: medusajs/medusa


text:
# bitfountain-test

Technical test for Bitfountain. Built with React, TS, Bootstrap

## Building and running on localhost

First install dependencies:

```sh
npm install
```

To run in hot module reloading mode:

```sh
npm start
```

To create a production build:

```sh
npm run build-prod
```

## Running

Open `localhost:1234` in your browser

### Notes/Assumptions:
- The 'access_token' from the API is used in the authorization header. Without an updated access token, the APIs return 403 error.
- No UI design is provided, so I have used Bootstrap.

branch_name: refs/heads/main


text:
# Macrosporium erectum (Ellis & Everh.) Pound & Clem., 1896 SPECIES

#### Status
SYNONYM

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

#### Published in
Minn. bot. Stud. 1(Bulletin 9): 657 (1896)

#### Original name
Mystrosporium erectum Ellis & Everh., 1888

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Rhexoacrodictys/Rhexoacrodictys erecta/ Syn. Macrosporium erectum/README.md

repo_name: mdoering/backbone


text:
# Common Anaconda Commands

```bash
# To create an environment call this command:
conda create --name environment_name python=3.7
# You can save all the info necessary to recreate the environment in a file by calling
conda env export > environment.yml
# To recreate the environment you can do the following:
conda env create -f environment.yml

# Useful jupyter package
pip install jupyter_contrib_nbextensions && jupyter contrib nbextension install

# Start out
conda deactivate
conda activate environment_name
# list all installed packages
conda list
# list all current environments
conda env list

```

gha_language: Python


text:
---
title: "Ben Hutton"
description: SchemaBlocks Contributor
template: post.html
is_contact: false
---

* Senior Web Developer, Wellcome Sanger Institute, Hinxton
* Primary work: [DECIPHER](https://www.sanger.ac.uk/science/tools/decipher-mapping-clinical-genome)

<!--more-->

#### Links

* [@relequestual :fontawesome-brands-twitter:]((https://twitter.com/relequestual))
* [@Relequestual :fontawesome-brands-github:](https://github.com/Relequestual)

license: Unlicense

gha_license_id: Unlicense


text:
<!-- This file is machine generated: DO NOT EDIT! -->

# BayesFlow Entropy (contrib)
[TOC]

Entropy Ops.

## Background

Common Shannon entropy, the Evidence Lower BOund (ELBO), KL divergence, and more
all have information theoretic use and interpretations.  They are also often
used in variational inference.  This library brings together `Ops` for
estimating them, e.g. using Monte Carlo expectations.

## Examples

Example of fitting a variational posterior with the ELBO.

```python
# We start by assuming knowledge of the log of a joint density p(z, x) over
# latent variable z and fixed measurement x.  Since x is fixed, the Python
# function does not take x as an argument.
def log_joint(z):
  theta = tf.Variable(0.)  # Trainable variable that helps define log_joint.
  ...

# Next, define a Normal distribution with trainable parameters.
q = distributions.Normal(mu=tf.Variable(0.), sigma=tf.Variable(1.))

# Now, define a loss function (negative ELBO) that, when minimized, will adjust
# mu, sigma, and theta, increasing the ELBO, which we hope will both reduce the
# KL divergence between q(z) and p(z | x), and increase p(x).  Note that we
# cannot guarantee both, but in general we expect both to happen.
elbo = entropy.elbo_ratio(log_p, q, n=10)
loss = -elbo

# Minimize the loss
train_op = tf.train.GradientDescentOptimizer(0.1).minimize(loss)
tf.global_variables_initializer().run()
for step in range(100):
  train_op.run()
```

## Ops

- - -

### `tf.contrib.bayesflow.entropy.elbo_ratio(log_p, q, z=None, n=None, seed=None, form=None, name='elbo_ratio')` {#elbo_ratio}

Estimate of the ratio appearing in the `ELBO` and `KL` divergence.

With `p(z) := exp{log_p(z)}`, this `Op` returns an approximation of

```
E_q[ Log[p(Z) / q(Z)] ]
```

The term `E_q[ Log[p(Z)] ]` is always computed as a sample mean.
The term `E_q[ Log[q(z)] ]` can be computed with samples, or an exact formula
if `q.entropy()` is defined.  This is controlled with the kwarg `form`.

This log-ratio appears in different contexts:

#### `KL[q || p]`

If `log_p(z) = Log[p(z)]` for distribution `p`, this `Op` approximates
the negative Kullback-Leibler divergence.

```
elbo_ratio(log_p, q, n=100) = -1 * KL[q || p],
KL[q || p] = E[ Log[q(Z)] - Log[p(Z)] ]
```

Note that if `p` is a `Distribution`, then `distributions.kl(q, p)` may be
defined and available as an exact result.

#### ELBO

If `log_p(z) = Log[p(z, x)]` is the log joint of a distribution `p`, this is
the Evidence Lower BOund (ELBO):

```
ELBO ~= E[ Log[p(Z, x)] - Log[q(Z)] ]
      = Log[p(x)] - KL[q || p]
     <= Log[p(x)]
```

User supplies either `Tensor` of samples `z`, or number of samples to draw `n`

##### Args:

*  <b>`log_p`</b>: Callable mapping samples from `q` to `Tensors` with
    shape broadcastable to `q.batch_shape`.
    For example, `log_p` works "just like" `q.log_prob`.
*  <b>`q`</b>: `tf.contrib.distributions.Distribution`.
*  <b>`z`</b>: `Tensor` of samples from `q`, produced by `q.sample(n)` for some `n`.
*  <b>`n`</b>: Integer `Tensor`.  Number of samples to generate if `z` is not provided.
*  <b>`seed`</b>: Python integer to seed the random number generator.
*  <b>`form`</b>: Either `ELBOForms.analytic_entropy` (use formula for entropy of `q`)
    or `ELBOForms.sample` (sample estimate of entropy), or `ELBOForms.default`
    (attempt analytic entropy, fallback on sample).
    Default value is `ELBOForms.default`.
*  <b>`name`</b>: A name to give this `Op`.

##### Returns:

  Scalar `Tensor` holding sample mean KL divergence.  `shape` is the batch
    shape of `q`, and `dtype` is the same as `q`.

##### Raises:

*  <b>`ValueError`</b>: If `form` is not handled by this function.

- - -

### `tf.contrib.bayesflow.entropy.entropy_shannon(p, z=None, n=None, seed=None, form=None, name='entropy_shannon')` {#entropy_shannon}

Monte Carlo or deterministic computation of Shannon's entropy.

Depending on the kwarg `form`, this `Op` returns either the analytic entropy
of the distribution `p`, or the sampled entropy:

```
-n^{-1} sum_{i=1}^n p.log_prob(z_i),  where z_i ~ p,
    \approx - E_p[ Log[p(Z)] ]
    = Entropy[p]
```

User supplies either `Tensor` of samples `z`, or number of samples to draw `n`

##### Args:

*  <b>`p`</b>: `tf.contrib.distributions.Distribution`
*  <b>`z`</b>: `Tensor` of samples from `p`, produced by `p.sample(n)` for some `n`.
*  <b>`n`</b>: Integer `Tensor`.  Number of samples to generate if `z` is not provided.
*  <b>`seed`</b>: Python integer to seed the random number generator.
*  <b>`form`</b>: Either `ELBOForms.analytic_entropy` (use formula for entropy of `q`)
    or `ELBOForms.sample` (sample estimate of entropy), or `ELBOForms.default`
    (attempt analytic entropy, fallback on sample).
    Default value is `ELBOForms.default`.
*  <b>`name`</b>: A name to give this `Op`.

##### Returns:

  A `Tensor` with same `dtype` as `p`, and shape equal to `p.batch_shape`.

##### Raises:

*  <b>`ValueError`</b>: If `form` not handled by this function.
*  <b>`ValueError`</b>: If `form` is `ELBOForms.analytic_entropy` and `n` was provided.

- - -

### `tf.contrib.bayesflow.entropy.renyi_ratio(log_p, q, alpha, z=None, n=None, seed=None, name='renyi_ratio')` {#renyi_ratio}

Monte Carlo estimate of the ratio appearing in Renyi divergence.

This can be used to compute the Renyi (alpha) divergence, or a log evidence
approximation based on Renyi divergence.

#### Definition

With `z_i` iid samples from `q`, and `exp{log_p(z)} = p(z)`, this `Op` returns
the (biased for finite `n`) estimate:

```
(1 - alpha)^{-1} Log[ n^{-1} sum_{i=1}^n ( p(z_i) / q(z_i) )^{1 - alpha},
\approx (1 - alpha)^{-1} Log[ E_q[ (p(Z) / q(Z))^{1 - alpha} ]  ]
```

This ratio appears in different contexts:

#### Renyi divergence

If `log_p(z) = Log[p(z)]` is the log prob of a distribution, and
`alpha > 0`, `alpha != 1`, this `Op` approximates `-1` times Renyi divergence:

```
# Choose reasonably high n to limit bias, see below.
renyi_ratio(log_p, q, alpha, n=100)
                \approx -1 * D_alpha[q || p],  where
D_alpha[q || p] := (1 - alpha)^{-1} Log E_q[(p(Z) / q(Z))^{1 - alpha}]
```

The Renyi (or "alpha") divergence is non-negative and equal to zero iff
`q = p`.  Various limits of `alpha` lead to different special case results:

```
alpha       D_alpha[q || p]
-----       ---------------
--> 0       Log[ int_{q > 0} p(z) dz ]
= 0.5,      -2 Log[1 - Hel^2[q || p]],  (\propto squared Hellinger distance)
--> 1       KL[q || p]
= 2         Log[ 1 + chi^2[q || p] ],   (\propto squared Chi-2 divergence)
--> infty   Log[ max_z{q(z) / p(z)} ],  (min description length principle).
```

See "Renyi Divergence Variational Inference", by Li and Turner.

#### Log evidence approximation

If `log_p(z) = Log[p(z, x)]` is the log of the joint distribution `p`, this is
an alternative to the ELBO common in variational inference.

```
L_alpha(q, p) = Log[p(x)] - D_alpha[q || p]
```

If `q` and `p` have the same support, and `0 < a <= b < 1`, one can show
`ELBO <= D_b <= D_a <= Log[p(x)]`.  Thus, this `Op` allows a smooth
interpolation between the ELBO and the true evidence.

#### Stability notes

Note that when `1 - alpha` is not small, the ratio `(p(z) / q(z))^{1 - alpha}`
is subject to underflow/overflow issues.  For that reason, it is evaluated in
log-space after centering.  Nonetheless, infinite/NaN results may occur.  For
that reason, one may wish to shrink `alpha` gradually.  See the `Op`
`renyi_alpha`.  Using `float64` will also help.

#### Bias for finite sample size

Due to nonlinearity of the logarithm, for random variables `{X_1,...,X_n}`,
`E[ Log[sum_{i=1}^n X_i] ] != Log[ E[sum_{i=1}^n X_i] ]`.  As a result, this
estimate is biased for finite `n`.  For `alpha < 1`, it is non-decreasing
with `n` (in expectation).  For example, if `n = 1`, this estimator yields the
same result as `elbo_ratio`, and as `n` increases the expected value
of the estimator increases.

#### Call signature

User supplies either `Tensor` of samples `z`, or number of samples to draw `n`

##### Args:

*  <b>`log_p`</b>: Callable mapping samples from `q` to `Tensors` with
    shape broadcastable to `q.batch_shape`.
    For example, `log_p` works "just like" `q.log_prob`.
*  <b>`q`</b>: `tf.contrib.distributions.Distribution`.
     `float64` `dtype` recommended.
     `log_p` and `q` should be supported on the same set.
*  <b>`alpha`</b>: `Tensor` with shape `q.batch_shape` and values not equal to 1.
*  <b>`z`</b>: `Tensor` of samples from `q`, produced by `q.sample` for some `n`.
*  <b>`n`</b>: Integer `Tensor`.  The number of samples to use if `z` is not provided.
    Note that this can be highly biased for small `n`, see docstring.
*  <b>`seed`</b>: Python integer to seed the random number generator.
*  <b>`name`</b>: A name to give this `Op`.

##### Returns:

*  <b>`renyi_result`</b>: The scaled log of sample mean.  `Tensor` with `shape` equal
    to batch shape of `q`, and `dtype` = `q.dtype`.

- - -

### `tf.contrib.bayesflow.entropy.renyi_alpha(step, decay_time, alpha_min, alpha_max=0.99999, name='renyi_alpha')` {#renyi_alpha}

Exponentially decaying `Tensor` appropriate for Renyi ratios.

When minimizing the Renyi divergence for `0 <= alpha < 1` (or maximizing the
Renyi equivalent of elbo) in high dimensions, it is not uncommon to experience
`NaN` and `inf` values when `alpha` is far from `1`.

For that reason, it is often desirable to start the optimization with `alpha`
very close to 1, and reduce it to a final `alpha_min` according to some
schedule.  The user may even want to optimize using `elbo_ratio` for
some fixed time before switching to Renyi based methods.

This `Op` returns an `alpha` decaying exponentially with step:

```
s(step) = (exp{step / decay_time} - 1) / (e - 1)
t(s) = max(0, min(s, 1)),  (smooth growth from 0 to 1)
alpha(t) = (1 - t) alpha_min + t alpha_max
```

##### Args:

*  <b>`step`</b>: Non-negative scalar `Tensor`.  Typically the global step or an
    offset version thereof.
*  <b>`decay_time`</b>: Positive scalar `Tensor`.
*  <b>`alpha_min`</b>: `float` or `double` `Tensor`.
    The minimal, final value of `alpha`, achieved when `step >= decay_time`
*  <b>`alpha_max`</b>: `Tensor` of same `dtype` as `alpha_min`.
    The maximal, beginning value of `alpha`, achieved when `step == 0`
*  <b>`name`</b>: A name to give this `Op`.

##### Returns:

*  <b>`alpha`</b>: A `Tensor` of same `dtype` as `alpha_min`.

repository: yijunyu/demo

gha_language: C

repo_name: yijunyu/demo


text:
# NotifyAddThingTopo {#reference_fhb_trz_wdb .reference}

You can call this operation to notify the specified gateway to add the topology.

## Request parameters {#section_zl1_wqt_xdb .section}

|name|Type|Required|Description|
|:---|:---|:-------|:----------|
|Action |String | Yes|The operation that you want to perform. Set the value to NotifyAddThingTopo.|
|GwIotId|String| No| The identifier or IotId of the gateway that you want to notify.

 **Note:** If you specify this parameter, GwProductKey and GwDeviceName are not required. GwIotId is a globally unique identifier \(GUID\), and corresponds to a combination of GwProductKe and GwDeviceName. If you specify both GwIotId and the combination of GwProductKey and GwDeviceName, the system follows GwIotId.

 |
|GwProductKey|String| No| The product key of the product which the gateway device belongs to.

 **Note:** If you specify this parameter, GwDeviceName is required.

 |
|GwDeviceName|String| No| The name of the gateway device.

 **Note:** If you specify this parameter, GwProductKey is required.

 |
|DeviceListStr|List|Yes|The array of sub-devices that you want to mount to the specified gateway. The array is a JSON string. For more information about the array structure, see DeviceList.|

|Name |Type|Required|Description|
|:----|:---|:-------|:----------|
|ProductKey|String | Yes|The product key of the specified sub-device.|
|DeviceName|String | Yes|The name of the specified sub-device.|

## Response parameters {#section_qrj_cst_xdb .section}

|Name |Type|Description|
|:----|:---|:----------|
|RequestId|String|The GUID generated by Alibaba Cloud for the request.|
|Success|Boolean|Indicates whether the call is successful. A value of true indicates that the call is successful. A value of false indicates that the call has failed.|
|ErrorMessage|String|The error message returned when the call fails.|
|Code|String|The error code returned when the call fails. For more information on error codes, see [Error codes](reseller.en-US/Developer Guide (Cloud)/API reference/Error codes.md#).|
|Data|Data|The data returned when the call is successful. For more information, see the following table Data.|

|Name |Type|Description|
|:----|:---|:----------|
|MessageId|String|The ID of the message which IoT Platform sends to the gateway device.|

## Examples  {#section_zl2_jst_xdb .section}

**Request example**

```
https://iot.cn-shanghai.aliyuncs.com/?Action=NotifyAddThingTopo
&GwProductKey=...
&GwDeviceName=...
&DeviceListStr=[{"productKey":"...","deviceName":"..."},{"productKey":"...","deviceName":"..."}]
&common request parameters
```

**Response example**

-   JSON format

    ```
    {
      "RequestId":"419A3FC1-B517-4958-9414-5546765FA51F",
      "Success": true,
      "Data"：{
    	 "MessageId": "abcabc123"
      }
    }
    ```

-   XML format

    ```
    <? xml version='1.0' encoding='UTF-8'? >
    <NotifyAddThingTopoResponse>
        <RequestId>419A3FC1-B517-4958-9414-5546765FA51F</RequestId>
        <Success>true</Success>
        <Data>
    	<MessageId>abcabc123</MessageId>
        </Data>
    </NotifyAddThingTopoResponse>
    ```

path: /intl.en-US/Developer Guide (Cloud)/API reference/Manage devices/NotifyAddThingTopo.md


text:
Change Log: `yii2-nav-x`
========================

## Version 1.2.6

*Date:* 24-Jan-2022

- Enhance & standardize php docs for new website https://docs.krajee.com.

## Version 1.2.5

*Date:* 02-Nov-2021

- (enh #22): Enhancements to support Bootstrap v5.x.

## Version 1.2.4

**Date:** 19-Sep-2018

- Maintain dependency on kartik-v/yii2-dropdown-x for Backward compatibility.

## Version 1.2.3

**Date:** 19-Sep-2018

- Correct README for dependencies.

## Version 1.2.2

**Date:** 19-Sep-2018

- Enhancements to support Bootstrap v4.x.
- Move all source code to `src` directory.

## Version 1.2.1

**Date:** 13-May-2017

- Chronological ordering of issues for change log.
- Add github contribution and PR templates.
- (enh #14, #15, #16): Better styling for submenu items for smaller device screens.
- Add branch alias for dev-master latest release.
- (enh #12): Refactor NavX code based on latest `yii\bootstrap\Nav`.

## Version 1.2.0

**Date:** 07-Dec-2014

- (enh #7): Enhance multi level navigation beyond 2 levels.

## Version 1.1.0

**Date:** 08-Nov-2014

- Set release to stable
- Enhance dependency validation using common code base.

## Version 1.0.0

**Date:** 08-May-2014

- PSR4 alias change
- (bug #6): Enhance the extension to have the right dependency on `yii\bootstrap` assets.
- Initial release

gha_language: PHP


text:
# Entoloma sarcitulum var. majusculum (Kühner & Romagn.) Noordel., 1985 VARIETY

#### Status
SYNONYM

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

#### Published in
Persoonia 12(4): 462 (1985)

#### Original name
Rhodophyllus majusculus Kühner & Romagn., 1954

### Remarks
null

path: /life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Entolomataceae/Entoloma/Entoloma longistriatum/ Syn. Entoloma sarcitulum majusculum/README.md


text:
# oak

A middleware framework for Deno's native HTTP server,
[Deno Deploy](https://deno.com/deploy) and Node.js 16.5 and later. It also
includes a middleware router.

This middleware framework is inspired by [Koa](https://github.com/koajs/koa) and
middleware router inspired by [@koa/router](https://github.com/koajs/router/).

- [API Documentation](https://doc.deno.land/https://deno.land/x/oak/mod.ts)
- [oak and Deno Deploy](./deploy)
- [oak and Node.js](./node)
- [Testing oak](./testing)
- [Frequently Asked Questions](./FAQ)
- [Awesome oak](https://oakserver.github.io/awesome-oak/) - Community resources
  for oak.
- [oak_middleware](https://oakserver.github.io/middleware/) - A collection of
  middleware maintained by us.
- [Getting Started](#getting-started)
- [Server Sent Events](./sse)

## Getting started

Oak is designed with Deno in mind, and versions of oak are tagged for specific
versions of Deno in mind. In the examples here, we will be referring to using
oak off of `main`, though in practice you should _pin_ to a specific version of
oak in order to ensure compatibility.

For example if you wanted to use version 9.0.0 of oak, you would want to import
oak from<EMAIL_ADDRESS>
All of the parts of oak that are intended to be used in creating a server are
exported from `mod.ts` and most of the time, you will simply want to import the
main class `Application` to create your server.

To create a very basic "hello world" server, you would want to create a
`server.ts` file with the following content:

```ts
import { Application } from "https://deno.land/x/oak/mod.ts";

const app = new Application();

app.use((ctx) => {
  ctx.response.body = "Hello world!";
});

await app.listen({ port: 8000 });
```

And then you would run the following command:

```shell
$ deno run --allow-net server.ts
```

If you aren't overly familiar with Deno, by default it does not trust the code
you are running, and need you to let it have access to your machines network, so
`--allow-net` provides that.

When navigating on your local machine to `http://localhost:8000/` you should see
the `Hello world!` message in your browser.

## Middleware

The main architecture of middleware frameworks like oak is, unsurprisingly, the
concept of middleware. These are functions which are executed by the application
in a predictable order between when the application receives a request and the
response is sent.

Middleware functions allow you to break up the logic of your server into
discreet functions that encapsulate logic, as well as import in other middleware
that can add functionality to your application in a very loosely coupled way.

To get an application to use a middleware function, an instance of an
application has a `.use()` method. Middleware functions are provided with two
parameters, a context object, and a `next()` function. Because the processing of
middleware is asynchronous by nature, middleware functions can return a promise
to indicate when they are done processing.

### Control the execution of middleware

Middleware gets executed in the order that it is registered with the application
via the `.use()` method. Just executing the functions in order though is
insufficient in a lot of cases to create useful middleware. This is where the
`next()` function passed to a middleware function allows the function to control
the flow of other middleware, without the other middleware having to be aware of
it. `next()` indicates to the application that it should continue executing
other middleware in the chain. `next()` always returns a promise which is
resolved when the other middleware in the chain has resolved.

If you use `next()`, almost all the time you will want to `await next();` so
that the code in your middleware function executes as you expect. If you don't
await `next()` the rest of the code in your function will execute without all
the other middleware resolving, which is not usually what you want.

There are few scenarios where you want to control with your middleware. There is
when you want the middleware to do something just before the response is sent,
like logging middleware. You would want to create a middleware function like
this:

```ts
const app = new Application();

app.use(async (ctx, next) => {
  await next();
  /* Do some cool logging stuff here */
});
```

Here, you are signalling to the application to go ahead and run all the other
middleware, and when that is done, come back to this function and run the rest
of it.

Another scenario would be where there is a need to do some processing, typically
of the request, like checking if there is a valid session ID for a user, and
then allowing the rest of the middleware to run before finalising some things,
like maybe checking if the response needs to refresh the session ID. You would
want to create a middleware function like this:

```ts
app.use(async (ctx, next) => {
  /* Do some checking of the request */
  await next();
  /* Do some finalising of the response */
});
```

In situations where you want the rest of the middleware to run after a function
has run, or it isn't important what order the middleware runs in, you could
`await next()` before the end of your function, but that would be unnecessary.

There is also the scenario where you might not want to hold up the sending of a
response while you perform other asynchronous operations. In this case you could
chose to simply not await `next()` or not return the promise related to the
asynchronous work from the function. This is a bit risky though, because other
middleware and even the application might behave in unexpected ways if the
middleware function makes incorrect assumptions about how the context changes.
You would want to make sure you understand the consequences of code like that.

### Context

Each middleware function is passed a context when invoked. This context
represents "everything" that the middleware should know about the current
request and response that is being handled by the application. The context also
includes some other information that is useful for processing requests. The
properties of the context are:

- `.app`

  A reference to the application that is invoking the middleware.

- `.cookies`

  An interface to get and set cookies that abstracts the need to mediate between
  the request and response. If the `.keys` property has been set on the
  application, the cookies will be signed and verified automatically to help
  prevent with clients attempting to tamper with the keys. Because the cookies
  are signed and verified with the asynchronous web crypto APIs, the methods on
  the cookies object work asynchronously as well.

- `.request`

  An interface to information about the request. This information is used to
  figure out what information is being requested and information about the
  capabilities of the client.

- `.response`

  An interface to information about what the server will respond with.

- `.state`

  An object that is "owned" by the application which is an easy way to persist
  information between requests. When using TypeScript this can be strongly typed
  to give structure to this state object.

There is also currently a couple methods available on context:

- `.assert()`

  Makes an assertion. If the assertion is not valid, throws an HTTP error based
  on the HTTP status code passed.

- `.throw()`

  Throws an HTTP error based on the HTTP status code passed as the first
  argument.

repository: oakserver/oak

repo_name: oakserver/oak


text:
# OpenAI Gym

    Gym is a toolkit for developing and comparing reinforcement learning
    algorithms. It makes no assumptions about the structure of your agent, and
    is compatible with any numerical computation library, such as TensorFlow or
    Theano.

    The gym library is a collection of test problems — environments — that you
    can use to work out your reinforcement learning algorithms. These
    environments have a shared interface, allowing you to write general
    algorithms.

- Official web site: https://gym.openai.com/
- Getting Started: https://gym.openai.com/docs/

## Install Gym

```pip install gym```

## Optional dependencies

    To install the full set of environments, you'll need to have some system packages installed.
    Also, take a look at the docker files (py.Dockerfile) to see the composition of our CI-tested images.

### Atari games

```pip install gym[atari]```

### MuJoCo

    MuJoCo has a proprietary dependency we can't set up for you.
    Follow the instructions in the mujoco-py package for help.
    As an alternative to mujoco-py, consider PyBullet which uses the open source Bullet physics engine and has no license requirement.

### All dependencies

```pip install 'gym[all]'```

## Troubleshooting

On Debian/Ubuntu, the following error may arise:

    ERROR: Could not find a version that satisfies the requirement opencv-python (from gym) (from versions: none)
    ERROR: No matching distribution found for opencv-python (from gym)

Solution:

```
pip install --upgrade pip
pip install opencv-python
pip install gym
```

https://stackoverflow.com/questions/45293933/could-not-find-a-version-that-satisfies-the-requirement-opencv-python

repository: jeremiedecock/snippets

repo_name: jeremiedecock/snippets


text:
---
title: NFL Playoff Picks 2017 Divisional Round
date: "2017-01-14T11:22:44"
tags:
  - nfl
  - gambling
---

Lines from [Vegas Insider](http://www.vegasinsider.com/nfl/matchups/matchups.cfm/week/19/season/2016).

- ATLANTA -4.5 over Seattle **(W)**
- NEW ENGLAND -16 over Houston **(W)**
- Pittsburgh +2 over Kansas City **(W)**
- Dallas -4.5 over Green Bay **(L)**

**This week: 3-1**<br/>
**Overall: 5-3**

gha_language: JavaScript


text:
# Virtuo Bank

Developed by:
- Aakash Nair (Team Lead)
- Shristi Shah (Front - End)
- Hina Fathima (Back End)
- Karen Quinn (Marketing Analyst, Finastra)

## A banking service company that enables customers to choose for the best.
### This application is concentrated for upcoming innovative and creative startups and emerging new businesses

 Virtuo Bank is about to connect all the bank from all over the **GLOBE** and recommend the best options, also, this application provides daily financial global news throughout the day

# Virtuo Bank enables customers to choose the following constrains:
# Loan
  - Education
  - Jewellery
  - House
  - Vehicle
  - Property
  - Startup
  - Farming

# Investment
  - Land
  - Startup
  - Jewellery
  - Farming
  - Cryptocurrency

# Equated Monthly Installment (EMI)
  - Vehicle
  - House
  - Jewellery
  - Accessories – Electronics, and all other online/ offline products (if the product is eligible).

# Insurance
  - Vehicle
  - Health
  - Warranties of products
  - House

- To pay Taxes

# The Banking services are of *3*:
- Basic
- Advanced
- Premium

# Basic Features:
- #### In basic feature, Customers will be provided all the banking features through globally. (For eg: A person in France can have loan features from Australia easily throught our app)

- #### After certain amount of transactions, customers would be getting points and can buy things under some eligible crtierias of products.

# Advanced Features:
- #### Advanced accounts will have extra features of managing own financial management account as well as banking from all the purchases or transactions.

- #### Global payment is only featured for Advanced subscription, students can get free subscriptions (16+) for advance.

# Premium Features
- #### Premium accounts will have features of Basic account and Advance account including extra features, they are:

  - #### Virtuo Connect, A social media platform to talk about finance in their daily life and share experiences of transactions each other.


text:
# EbExtensionExecuter

[![Build status](https://ci.appveyor.com/api/projects/status/m00bxmvhi9ioe2pu?svg=true)](https://ci.appveyor.com/project/AlbertoMonteiro/ebextensionexecuter)
[![Nuget count](http://img.shields.io/nuget/v/EbExtensionExecuter.svg)](http://www.nuget.org/packages/EbExtensionExecuter/)

Small library to help to write steps execution to substitute the ebextensions from AWS

repository: AlbertoMonteiro/EbExtensionExecuter

gha_language: C#

repo_name: AlbertoMonteiro/EbExtensionExecuter


text:
# krjhnsn.blog

This is a simple, lightweight, blog for mildy interesting commentary and (hopefully) useful programming knowledge.

Feel free to check out the published site [here](https://krjhnsn.github.io/).

This blog runs on [GitHub Pages](https://pages.github.com/) and [Jekyll](https://jekyllrb.com/). The theme is based on the [Tale](https://github.com/chesterhow/tale) theme, kindly shared by chesterhow.

## Contributing
Found a bug or have a suggestion? Feel free to create an issue or make a pull request!


text:
# HTML for PDFreactor themes

## Language for hyphenation

### Include in `<html lang="de">`

## Changes from mpdf converter

### Delete mpdf tags:
* `<pagebreak ... />`
* All header and footer related mpdf tags:
  * `<htmlpageheader ... </htmlpageheader>`
  * `<htmlpagefooter ... </htmlpagefooter>`
* `<tocpagebreak ...</tocpagebreak>`
* `<sethtmlpagefooter page="odd" value="off">`
* `<sethtmlpagefooter page="even" value="off">`
* `<tocentry ...</tocentry>`

### Trim headlines in tags

Currently, the headline tags sometimes include line breaks like this:
```
<h1 class="chapter-h1">
H1: Font styles and paragraph settings
</h1>
```
These need to be trimmed to look like this:

`<h1 class="chapter-h1">H1: Font styles and paragraph settings</h1>`

### Remove aloha tag classes
Tags like this show up in the export:

* `<p class="aloha-editing-p">`
* `<br class="aloha-end-br">`

## Frontmatter

### Wrap pages in tags
* `<div id="frontmatter-half-title">`
* `<div id="frontmatter-dedication">`
* `<div id="frontmatter-title-page">`
* `<div id="frontmatter-collophon">`
* `<div class="mpdf_toc">`

### Generate HTML for table of contents

The table of contents need to have the chapter titles linked with relative links to the IDs of the
chapters and subheadings inside the chapter. It could look like this (indentation just for clarity):

```
<section class="mpdf_toc">
  <div class="toc-title">Inhalt</div>
  <div class="mpdf_toc_level_0"><a href="#part1">###Frontmatter</a></div>
    <div class="mpdf_toc_level_1"><a href="#ch1-1">Foreword</a></div>
    <div class="mpdf_toc_level_1"><a href="#ch2-1">Preface</a></div>
    <div class="mpdf_toc_level_1"><a href="#ch3-1">Acknowledgements</a></div>
    <div class="mpdf_toc_level_1"><a href="#ch4-1">Abbreviations</a></div>
  <div class="mpdf_toc_level_0"><a href="#part2">###Mainmatter</a></div>
    <div class="mpdf_toc_level_1"><a href="#ch5-1">Introduction and Executive Summary</a></div>
      <div class="mpdf_toc_level_2"><a href="#ch5-11">Heading level 1</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch5-111">Sub-heading level two 1.1</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch5-121">make headline here</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch5-122">Sub-heading level three 1.2</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch5-123">Sub-heading level three 1.3</a></div>
      <div class="mpdf_toc_level_2"><a href="#ch5-13">Heading level 2</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch5-131">Sub-heading level two 2.1</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch5-132">Sub-heading level three 2.2</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch5-133">Sub-heading level three 2.3</a></div>
    <div class="mpdf_toc_level_1"><a href="#ch6-1">Long Article in Mainmatter</a></div>
      <div class="mpdf_toc_level_2"><a href="#ch6-11">Heading level 1</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch6-111">Sub-heading level two 1.1</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch6-112">Sub-heading level three 1.2</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch6-113">Sub-heading level three 1.3</a></div>
      <div class="mpdf_toc_level_2"><a href="#ch6-12">Heading level 2</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch6-121">Sub-heading level two 2.1</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch6-122">Sub-heading level three 2.2</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch6-123">Sub-heading level three 2.3</a></div>
    <div class="mpdf_toc_level_1"><a href="#ch7-1">References</a></div>
    <div class="mpdf_toc_level_1"><a href="#ch8-1">Example code for Booktype features</a></div>
    <div class="mpdf_toc_level_1"><a href="#ch8-2">Heading H1</a></div>
      <div class="mpdf_toc_level_2"><a href="#ch8-21">Subheading H2</a></div>
        <div class="mpdf_toc_level_3"><a href="#ch8-211">Subsubheading H3</a></div>
  <div class="mpdf_toc_level_0"><a href="#part3">###Backmatter</a></div>
</section>
```

## Mainmatter

### Wrap chapters in tags
* `<div data-type="chapter" class="chapter mainmatter">`

### Add unique ID to chapter titles and sections (parts)
* `<h1 class="body-h1" id="rellinkch1">`

These unique IDs need to match the IDs in the table of contents HTML (see above).

We will also need to include unique IDs to the h1, h2, h3, h4 and h5 inside each chapter.
In case we need them in the table of contents.

The ID does not need to make sense to the world, it just needs to be an ID.
But best might be that we have some kind of counter running, possibly a counter
for each level, resulting in an ID for the first `h3` tag in chapter 2 which is
a child of the second `h2` inside the third `h1`:

* `id="ch2-321"`
  * `ch2` = chapter 2
  * `-` = only for readability
  * `3` = third `h1`
  * `2` = second `h2`
  * `1` = first `h1`

If there are no `h1` used inside the chapter, the first `h2` would then look like this:
* `id="ch2-01"`

The chapter title is also an `h1`, therefore the chapter title of chapter number 5 is:
* `id="ch5-1"`

Book sections (or parts, as they are sometimes called) also need unique IDs. Just count them.
* `id="part1"`

# Would be good to do

## Standardise classes

### Parapgraph in chapter
* default in Booktype: `p.body` and `p.body-first`
* BoD mpdf print CSS: `p.normal` and `p.normal-first`

repository: MiczFlor/PDFreactor-examples

repo_name: MiczFlor/PDFreactor-examples


text:
---
layout: post
title: Which ESXi VMkernel interface is used for NAS?
comments: true
---
I have two VMkernel interfaces in my ESXi server and I use NAS datastores. I would like to know which of my vmk interfaces is used for NAS. Sure, I can ask the NAS Admin. Hey, here's a volume on this filer, can you give me the list of IPs it is exported to? But I am a Linux admin and I would like to run some commands and I find it myself.

List the VMKernel interfaces

    esxcfg-vmknic -l

Get the NAS filer IP

    esxcfg-nas -l

Then I run this command

    tcpdump-uw -i vmk0 dst mynasfiler | grep nfs
    11:54:59.228779 IP truncated-ip - 8450 bytes missing! myesxihost.925 > mynasfiler.nfs: Flags [.], ack 40445, win 512,     options [nop,nop,TS val 557074583 ecr 557506100], length 8480
    11:54:59.228801 IP truncated-ip - 5762 bytes missing! myesxihost.925 > mynasfiler.nfs: Flags [.], ack 40445, win 512,     options [nop,nop,TS val 557074583 ecr 557506100], length 5792
    11:54:59.228951 IP truncated-ip - 11658 bytes missing! myesxihost.925 > mynasfiler.nfs: Flags [.], ack 40445, win 512     , options [nop,nop,TS val 557074583 ecr 557506100], length 11688
    11:54:59.229095 IP truncated-ip - 12794 bytes missing! myesxihost.925 > mynasfiler.nfs: Flags [.], ack 40445, win 512     , options [nop,nop,TS val 557074583 ecr 557506100], length 12824

This tells me there is NFS traffic between the ESXi host and NAS filer on the vmk0 VMkernel interface.


text:
---
layout: page
title: Cancel
date: 2012-06-20 15:59
author: anya.stettler
comments: true
categories: []
---

Description

This operation cancels the tax document specified by the DocId, DocCode, and DocType parameters. See CancelTax for more details.

URI

Production:
[code]POST https://avatax.avalara.net/1.0/tax/cancel[/code]
Development:
[code]POST https://development.avalara.net/1.0/tax/cancel[/code]

Supported Request Methods

POST: Performs the CancelTax operation on a single specified invoice.

Required Request Headers

[code]Authorization Basic <Base64(username:password)>[/code]

where <Base64(username:password)> is the Base64-encoded credential (username and password, delimited with the colon (:) character, as specified by HTTP basic access authentication)

Request Body

A transaction can either be identified by DocId or by the set of values CompanyCode, DocCode, and DocType. The latter method, while requiring more parameters, is recommended, as these values are easily accessed in your system, and easily visible to your end user.

Field
Description
Format
Required

CompanyCode
Client application company reference code
String
Y, or DocId

DocType
Value describing what type of tax document is being cancelled
String
One of:

SalesInvoice

ReturnInvoice

PurchaseInvoice

DocCode
Client application identifier describing this tax transaction (i.e. invoice number, sales order number, etc.)
String
Y, or DocId

CancelCode
The reason for cancelling the tax record. CancelTax Details.
String
One of:

Unspecified

PostFailed

DocDeleted

DocVoided

AdjustmentCancelled

DocId
Avatax-assigned unique Document Id
String
Y, or DocCode, DocType, and CompanyCode

Response Status Codes

200 (OK): request was processed successfully

401 (Unauthorized): no authentication credentials were included in the request

Response Headers

[code]WWW-Authenticate (Only if status code 401 is returned.)
Basic realm= "AvaTax Services"
Content-Type:<media-type>
Content-Length:<media-size>
Server:<server-id>
Date:<HTTP-date>[/code]

Where:
<media-type> represents message format of response. Supported formats are text/json and text/xml. The value of Content-Type will be identical to that supplied in the Content-Type request header, unless a format specifier was provided on the URL.
<media-size> is the length in bytes of the body in the response.
<server-id> is the identifier of the server that generated the response.
<HTTP-date>represents the date and time at which the message was originated in RFC 1036 or RFC 1123 format

Response Body

The response will contain:

The TransactionId, DocCode, and DocId (on successful requests only),

ResultCode in Common Response Format,

Error messages relevant to failed requests (500 error only).

Field
Description
Format

TransactionId
The unique numeric identifier of the API operation assigned by the AvaTax service.
String

ResultCode
Result Code as per Common Response Format

DocId
The unique numeric identifier (Document ID) assigned to the tax document in question by the AvaTax Service.
String

Samples

Sample JSON Request (Successful)

Note that this request will only be successful on your account if you have a company with Company Code XYZ which has a SalesInvoice with DocCode INV223.

Sample Request URI

Production:
[code]POST https://avatax.avalara.net/1.0/tax/cancel[/code]
Development:
[code]POST https://development.avalara.net/1.0/tax/cancel[/code]

Sample Request Body
[code]{
"CompanyCode": "XYZ",
"DocType" : "SalesInvoice",
"DocCode" : "INV223",
"CancelCode" : "PostFailed"
}[/code]

Sample Response Headers
[code]HTTP/1.1 200 OK
Date: Thu, 01 Mar 2012 00:21:47 GMT
Content-Length: 203
Server: Microsoft-IIS/7.5
Content-Type: text/json; charset=utf-8[/code]

Sample Response Body
[code]{
"CancelTaxResult": {
"DocId": "22436671",
"TransactionId": 198364949,
"ResultCode": "Success"
}-
}[/code]

Sample Request (Unsuccessful)

Sample Request URI
Production:
[code]POST https://avatax.avalara.net/1.0/tax/cancel[/code]
Development:
[code]POST https://development.avalara.net/1.0/tax/cancel[/code]

Sample Request Body
[code]{
"DocType" : "SalesInvoice",
"DocCode" : "INV223",
"CancelCode" : "DocDeleted"
}[/code]

Sample Response Headers
[code]HTTP/1.1 200 OK
Date: Thu, 01 Mar 2012 00:21:47 GMT
Content-Length: 203
Server: Microsoft-IIS/7.5
Content-Type: text/json; charset=utf-8[/code]

Sample Response Body
[code]{
"CancelTaxResult": {
"TransactionId": 198370554,
"ResultCode": "Error",
"Messages": [(1)
{
"Summary": "The tax document could not be found.",
"Details": "INV223",
"Severity": "Error",
"Source": "Avalara.AvaTax.Services.Tax"
}-
]-
}-
}[/code]

repository: rajthapliyal/developer-dot

repo_name: rajthapliyal/developer-dot


text:
# Day 57 | [HWS 57](https://www.hackingwithswift.com/100/swiftui/57) | [Index](https://github.com/JulesMoorhouse/100DaysOfSwiftUI/blob/main/README.md)

- [P12 CoreDataProject](https://github.com/JulesMoorhouse/100DaysOfSwiftUI/blob/main/P12%20CoreDataProject/P12%20CoreDataProject/ContentView.swift)

- Explanation of hashable and uniqueness.

path: /P12 CoreDataProject/README.md


text:
# The Raspi-Cluster

![PoC Cluster](https://github.com/hdwinkel/quarkus-logger/blob/develop/doc/pictures/DL-Raspi-cluster.jpg "PoC Cluster")

The idea behind the (Raspi-) Cluster is to understand a **Kubernetes** environment hosting a **MicroService** (In my case a **Quarkus** App)
In addition to learn more about some operational elements like **Dashboards** for computer monitoring and the sensor/meter data
A **time-series database** is needed as well

### Install the Raspi-Cluster
The installation of the OS for the Raspi-cluster is quite similar to the installation of the Controller:
[Install Controller](https://github.com/hdwinkel/quarkus-logger/blob/develop/doc/Architecture/Controller.md "Install Controller")
As OS it is selected as well the arm64 version of Ubuntu in the headless version.

### Install Kubernetes on Raspi-Cluster
After different tests with K8s on Raspberries with relatively complex installation procedure I decided to go with **K3S** for Ubuntu arm64.
[Install Kubernetes K3S](https://blog.alexellis.io/test-drive-k3s-on-raspberry-pi/ "Install Kubernetes K3S")

The Installation of K3S is surprisingly easy with this setup.
**Remark:** For the cluster manager a Raspberry Pi 3 isn't a valid choice due the memory limitations. Here it's better to start directly with a Raspberry Pi 4.

**Execute on on master:**
```
sudo curl -sfL https://get.k3s.io | sh -
# check service:
sudo systemctl status k3s
# get the token for nodes setup
sudo cat /var/lib/rancher/k3s/server/node-token
# result on system e.g.:  K10238cd1d108fb1206ff5a89cf1b0d27cca5f9196f12f2a6c142d8b41b8cc06a2c::server:4193948658388d9fcc0efa27e86294a3
```

**Execute on nodes:**
```
export K3S_URL="https://<IP_ADDRESS>:6443"
# export the key from master:
export K3S_TOKEN="K10238cd1d108fb1206ff5a89cf1b0d27cca5f9196f12f2a6c142d8b41b8cc06a2c::server:4193948658388d9fcc0efa27e86294a3"
# install K3S and let the node connect to master
sudo curl -sfL https://get.k3s.io | sh -
```

**Execute on master:**
(it will be an application be deployed, discussed in the development chapter of the PoC) logger-server-jvm-arm64
```
sudo kubectl get node -o wide

# create the service and deployment
# nano logger-deployment.yaml
# nano logger-service.yaml
sudo k3s kubectl create -f logger-deployment.yaml,logger-service.yaml
# check
sudo k3s kubectl get services
sudo k3s kubectl get deployment logger-deployment
sudo kubectl get pods -l app=logger -o wide

# get deployment info
sudo kubectl get deployments logger-deployment
sudo kubectl describe deployments logger-deployment

# get replicaset info
sudo kubectl get replicasets
sudo kubectl describe replicasets

# exposing the service
sudo kubectl expose deployment logger-deployment --type=LoadBalancer --name=logger-server-jvm-arm64
# check:
sudo kubectl get services logger-server-jvm-arm64
# check the pod status
sudo kubectl get pods -l app=logger -o wide

# scale replicaset to 3
sudo kubectl scale --replicas=3 -f logger-deployment.yaml
```

### Install the database (MariaDB)
Not as part of the Raspi-Cluster itself the time-series database have to be installed.
For that purpose another Raspberry Pi 4 is selected. The reason for the Raspi-4 is to have more than 1 GByte RAM available (4 GByte).
Currently a normal MariaDB is installed.
See docker-compose.yml for a Docker-Compose install of MariaDB

Remark: There is an option to give the MariaDB in the installation process an init script as root user. This can be perfectly used to create an additional schema to distinguish between a Development and a Test environment.

### Install Prometheus and Grafana
The Prometheus and Grafana installation is straightforward with Docker-Compose but must be prepared for the monitoring of the cluster itself.

#### Install Node Exporter on any Raspi:
```
cd /opt
sudo wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-arm64.tar.gz
sudo tar xfz node_exporter-0.18.1.linux-arm64.tar.gz
sudo ln -s /opt/node_exporter-0.18.1.linux-arm64/node_exporter /usr/local/bin/node_exporter

# start node_exporter
sudo node_exporter &
```

write in crontab for starting up at boot-time
```
crontab -e
# write line
----------------------------------------------------
@reboot /usr/local/bin/node_exporter
----------------------------------------------------
# enable cron
sudo systemctl enable cron
# check metrics
curl localhost:9100/metrics | less
```

#### Install Prometheus
In addition to Docker-Compose a Scrape Config has to be applied:

```
# edit scrape config
cd ~/work/docker/prometheus
sudo docker create --name prom_empty prom/prometheus
sudo docker cp prom_empty:/etc/prometheus/prometheus.yml ./prometheus.yml
sudo chmod a+rw prometheus.yml

#add scrape configs for any raspi
----------------------------------------------------
scrape_configs:
  - job_name: 'ubuntu-s2'
    static_configs:
      - targets: ['<IP_ADDRESS>:9100']
  - job_name: 'ubuntu-c1'
    static_configs:
      - targets: ['<IP_ADDRESS>:9100']
  - job_name: 'ubuntu-c2'
    static_configs:
      - targets: ['<IP_ADDRESS>:9100']
  - job_name: 'aml'
    static_configs:
      - targets: ['<IP_ADDRESS>:9100']
----------------------------------------------------

```

repository: hdwinkel/quarkus-logger

gha_language: Java

repo_name: hdwinkel/quarkus-logger


text:
SwiftRebound is a library for binding Swift programs together.

# SwiftRebound

## Basic usage

Create a bound variable

```swift
let binding = Binding.create(1);
```

Observe it for changes

```swift
binding.observe { newValue in print(newValue); }.forever();
binding.value = 3; /// prints '3'
```

Derive a computed binding

```swift
let computed = Binding.computed { binding.value + 1 };
computed.observe { newValue in print(newValue); }.forever();
binding.value = 5; /// prints '6' (well, and '5' with the above binding ;-)
```

## Manage binding lifetimes

```swift
let lifetime = binding.observe { newValue in print(newValue); };
binding.value = 1; /// prints
lifetime.done();
binding.value = 2; /// observer no longer runs
```

```swift
let lifetime = binding.observe { newValue in print(newValue); };
lifetime.forever();
binding.value = 1; /// prints
binding.value = 2; /// observe lasts as long as binding
```

```swift
var someView: NSView = view;
let lifetime = binding.observe { newValue in print(newValue); };
lifetime.liveAsLongAs(someView); /// binding will go away when the view goes away
```

## Do Key-Value observation

```swift
class ObservableObject : NSObject {
    dynamic var foo = 0;
}

let kvo = ObservableObject();
let bound = kvo.bindKeyPath("foo");
let value = bound.value as! Int;    /// == 0

let lifetime = bound.observe { newValue in print(newValue); }
kvo.foo = 1;        /// Prints '1'
lifetime.done();    /// Must stop observing KVO bindings to allow the target object to be released
```

repository: Logicalshift/SwiftRebound

repo_name: Logicalshift/SwiftRebound


text:
gulp-jspm-react-coffee-starter
==============================

A hand-rolled pipeline for front end projects using gulp, jspm, and coffeescript.

## Usage

### Clone and Enter the Repo
```
git clone git@github.com:perspectivezoom/gulp-jspm-react-coffee-starter.git
cd gulp-jspm-starter
```

### Install Dependencies
```
npm install
jspm install
```

### Build and Start the Dev Server
```
gulp serve
```
Builds from `src` into `dev` and starts BrowserSync.
Note: This project uses gulp 4. If you don't have gulp 4 globally installed, or [have not aliased the gulp command](https://github.com/greypants/gulp-starter/blob/master/README.md#the-gulp-command) to the local repo, you will need to use `./node_modules/.bin/gulp serve` instead.

### Generate a Production Build
```
gulp clean
gulp dev
gulp prod
```
Builds from `dev` into `prod`, minifying css, js, and images.

## Acknowledgements

Large portions of this repo were more or less copied from:

* [Glen Maddern's post and screencast](http://glenmaddern.com/articles/javascript-in-2015), for explaining [JSPM](http://jspm.io) and how it might be better than [Browserify](http://browserify.org/) as it need not pre-compile.
* [Gulp Starter](https://github.com/greypants/gulp-starter), for showing how to split tasks across files, and for most of the tasks.
* [This post](http://demisx.github.io/gulp4/2015/01/15/install-gulp4.html) to get Gulp 4 working and take advantage of `gulp.series` and `gulp.parallel`
* [This post](http://pem-musing.blogspot.com/2014/02/a-gulp-of-coffee-your-gulpfile-in.html) to get coffeescript Gulp tasks working
* [HTML5 Boilerplate](https://github.com/h5bp/html5-boilerplate)
* [normalize.css](http://necolas.github.io/normalize.css/)

## License
MIT. Go nuts.


text:
# Employee-Tracker

## Description

This is my thirteenth project for UA's coding bootcamp. It is NodeJS application that allows you to manage a database of employees, roles, and departments.

## Installation

To install this project download the repository. Then open the server.js file and put in the username and password for your mysql server. Install the necessary packages using 'npm install' and run 'node server.js' from your terminal.

If you just wish to test the project, there is a seed.sql file you may use to fill the database.

## Usage

Follow the prompts in your terminal, you will be able to view all or add employees, roles, and datbases. You may also update an emloyee's role or manager or delete employees from the database.

## Credits

Credit to Simon Boudrias for the inquirer.js package, Doug Wilson for the mysql and express packages, and Abbey Hawk Sparrow for the ascii-art package.

## License

MIT License

Copyright (c) 2020 Kaylee Nelson

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

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

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

repository: WhoaNellie/Employee-Tracker

repo_name: WhoaNellie/Employee-Tracker


text:
# Getting Started With Unity (Part 4 Scripting)

![](Images/Title.jpg)

This will be the last tutorial of **Getting started with Unity** and it will be about scripting in Unity. If you haven't read the previous parts, make sure you do from the links in the reference section at the end.

## Overview

We will be coding using **C#** and **Visual Studio**. But first, we will setup our preference with the IDE of our choice which in our case is **Visual Studio**. We will later understand what is a **componenet** and write a simple script that moves the attached object based on player input.

![](Images/17.jpg)

*End result*

## Organization and Setting Preference

In any empty project created, It is good to keep things organized for you and for others working with you. Usually, the main folders are

* **_Scenes** (The *underscore* is to keep the folder always at the top to easily find it)
* **Materials**
* **Scripts**

There are some other important folders as well but we don't need them here like

* **Sound**
* **Models**
* **Textures/Sprites**
* **Prefabs**

![](Images/1.jpg)

*Folders Organized*

Now put the **Level1** scene we created earlier in the **_Scenes** folder and you are good to go.

For the preference, go to **Edit** > **Preferences**
![](Images/2.jpg)
*Setting*

A small window will pop up. From there, go to **External Tools** and open the drop down of **External Script Editor** and choose the IDE you want. If it's not there, click the browse option and navigate for the *.exe* file. Also, ignore the SDK and JDK for now, they are only needed for Android build which will have it's separate tutorial.
![](Images/3.jpg)

*Pereference*

## Everything is a component

Before diving in deep, you need to understand that Unity uses entity component system to create it's **GameObject**. This means all **GameObjects** are containers for components which can be attached to give it its behavior and properties. For example the **Transform** that comes by default with any GameObject. There are other stuff too like **Box Colliders**, **Rigidbodies**, etc...

The script that we write is considered a behavioral component. That's because we are specifying certain behavior writing that script. It is a good practice to split your script to multiple behaviors and use them as modular puzzle pieces. For example, **Movment** and **DieAfterCollision**. I see these are 2 different puzzle pieces. If you want an object to move, add the **Movement** behaviour/script to it and same thing if you want it to kill it after collision.

## Script

Now that we are organized and have chosen our favorite IDE, let's create our script. There are various ways of creating scripts, we will mention each when times come. The first way is by **Right click** in project tab, then **Create** > **C# Script**. It is extremely important to name it once you create it as we will discuss now.

Go to the **Scripts** folder and create a new script and name it anything. I named mine **Test**

![](Images/4.gif)
*Script creation*

You will notice the inspector changed with the content of the script. Double click the script to open it in your favorite IDE. This is what you will be welcomed with.

![](Images/5.jpg)

*Test script*

Notice clearly the name of the class **Test** matches the name of the script **Test.cs**

``` C#
Public class Test : Monobehavior
```

If they didn't match, the script won't work and you won't be able to attach it to anything until you fix it. Either change the class name or the script name. That's why it is important to name the script after creating it and avoid renaming it.

The created class derives from **Monobehavior** which allows the script to run in the game loop. It gives the script also the ability to listen to certain events like:

* **Start** : That run only once at the beginning
* **Update** : That runs every frame (where game logic would be)
* **On Collision Enter**: That gets called once a collision happen (but a collider and a rigidbody components are needed)

You can check the full list in [Unity's documentation](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html)

Add this line of code

``` C#
public float speed = 1.5f;
```

![](Images/6.jpg)

*Float speed*

The good thing about Unity is that the public variables are editable in the inspector and you can tweak it in the editor without returning back to the script every time. Any floating point ends with **f**.

Now add this to your **Update** function

``` C#
transform.Translate(new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")) * speed * Time.deltaTime);
```

![](Images/7.jpg)

*Update*

Now, what does this code does?
let's break it down a bit:

``` C#
transform.Translate
```

This is a built in function that access the **Transform** component of the **GameObject** that this script is attached to. The capital **T Transform** is the class itself while the **t Transform** is the transform of the object that is attached to the script.

There are various functions in the **Transform** class like

* Translate
* Rotate
* LookAt

And a lot more. You can check them in the [Unity's Documentation](https://docs.unity3d.com/ScriptReference/Transform.html)

The translate functions takes a **Vector3** which is simply a vector in 3D space. A x,y and z coordinates.

We can look at this line of code as:

``` C#
transform.Translate(DirectionVector * speed * Time.deltaTime);
```

We want to move on the X-axis when we press (left or right) and move on Z-axis when we press (up and down). The Input.GetAxis function is a built in function that returns a value of an axis between -1 and 1 and can be mapped to joystick buttons [(Check documentation)](https://docs.unity3d.com/ScriptReference/Input.GetAxis.html). The **Horizontal** is mapped to the left,right and A,D keys while the **Vertical** is mapped to up,down and W,S keys.

You can edit and add new axes from **Edit**>**Project Settings**>**Input**

![](Images/8.jpg)
*Custom Axes*

Finally the **Time.deltaTime** is to make the speed frame independent. As we know, the **Update** function run 60 frames per seconds. On a very fast machines, it could be 90FPS. On mobile devices, it might be 30 FPS. To make our speed frame independent, we multiply our speed by **Time.deltaTime**

## Assign Script

First of all, go to your scene and

* Set the camera position (0,11,-22)
* Set the rotation to (-30,0,0)
* Set the Scale to (1,1,1).

![](Images/9.jpg)

*Camera transform*

Now, create a new a new cube give it a name, I called it **Player** and

* Set the Position (0,3,-15)
* Set the Rotation to (0,0,0).
* Set the Scale to (1,1,2).

![](Images/10.jpg)

*Player transform*

Let's assign your script to it. There are many ways to assign the script

* **Drag and drop in Inspector, Hierarchy or Scene**
![](Images/11.gif)
*Drag and drop*

* **Add Componenet** button in Inspector
You can create a script by pressed AddComponenet button and wirting down the name of the new **C#** script, or you can add an existing script by writing the name down
![](Images/12.gif)
*Add componenet button*

* **Component**>**Scripts** drop down
![](Images/13.gif)
*Menu Dropdown*

You can now edit the public variable **speed** and it will affect the speed without going back to the script everytime.

![](Images/14.gif)

*Update public variable*

To remove a component, Simply click on the **Gear icon** and choose **Remove Component**

![](Images/15.JPG)

*Remove Component*

Now that it's completed. Press play to enter **Player mode** and enjoy. You can edit your **speed** variable at run time, but be careful. The changes done at runtime are lost when you exit **Play mode**.
![](Images/16.gif)

*Play Mode*

## Summary

We were able to make a cube move based on your input. This cube can be later replaced with anything like a car, human, alien, anything! We understood what a component is and that the script we write is a behavioral component. We knew different ways of adding and assigning scripts. We also know how to expose some variable from scripts to the inspector to be able to modify them.

Make sure to refer to [Unity's Documentation](https://docs.unity3d.com/ScriptReference/index.html) when you are stuck with anything, They have examples ready for you to copy paste and test. You will find the clases you need under **UnityEngine**>**Classes**.

## Reference

* [Getting Started With Unity Part 1 (Installation)](https://boostlog.io/@mohammedalsayedomar/getting-started-with-unity-part-1-installation-5a99e4f98575ad004e55bccf)
* [Getting Started With Unity Part 2 (Interface)](https://boostlog.io/@mohammedalsayedomar/getting-started-with-unity-part-2-interface-5aa21238e922f1008c7efc11)
* [Getting Started With Unity Part 3 (Navigation)](https://boostlog.io/@mohammedalsayedomar/getting-started-with-unity-part-3-navigation-5ab9dab10814730093a2ee28)
* [Unity's documentation on **Monobehavior**](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html)
* [Unity's Documentation on **Transform**](https://docs.unity3d.com/ScriptReference/Transform.html)
* [Unity's Documentation on **GetAxis**](https://docs.unity3d.com/ScriptReference/Input.GetAxis.html)

repository: MohammedAlsayedOmar/Tutorials

path: /Tuts/Article4_Getting Started With Unity Part4 (Scripting)/Article4_GettingStartedWithUnityPart4(ScriptingInUnity).md

branch_name: refs/heads/gh-pages

repo_name: MohammedAlsayedOmar/Tutorials


text:
---
layout: book
title: Fortran Style Guide
permalink: /learn/best_practices/style_guide
---

Naming Convention
-----------------

Ultimately this is a matter of preference. Here is a style guide that we
like and that seems to be prevalent in most scientific codes (as well as
the Fortran standard library), and you are welcome to follow it.

1.  Use lowercase for all Fortran constructs (`do`, `subroutine`,
    `module`, ...).
2.  Follow short mathematical notation for mathematical
    variables/functions (`Ylm`, `Gamma`, `gamma`, `Enl`, `Rnl`, ...).
3.  For other names use all lowercase: try to keep names to one or two
    syllables; if more are required, use underscores to clarify
    (`sortpair`, `whitechar`, `meshexp`, `numstrings`, `linspace`,
    `meshgrid`, `argsort`, `spline`, `spline_interp`,
    `spline_interpolate`, `stoperr`, `stop_error`, `meshexp_der`).

For example "spline interpolation" can be shortened to
`spline_interpolation`, `spline_interpolate`, `spline_interp`, `spline`,
but not to `splineint` ("int" could mean integration, integer, etc. ---
too much ambiguity, even in the clear context of a computational code).
This is in contrast to `get_argument()` where `getarg()` is perfectly
clean and clear.

The above are general guidelines. In general, choosing the right name
certainly depends on the word being truncated as to whether the first
syllable is sufficient. Usually it is but clearly not always. Thus some
thought should go into step "try to keep names to 2 syllables or less"
since it can really affect the indicativeness and simplicity. Simple
consistent naming rules are a real help in this regard -- for both
collaboration and for one's own sanity when going back to some old code
you haven't seen in while.

Indentation
-----------

Use a consistent indentation to make your code readable.
The amount of indentation is a matter of preference, the most common choices
are two, three or four spaces.

Comparison to Other Languages
-----------------------------

On the other hand, in most of the rest of the programming world, where
the main focus is, in one form or another, on defining and using large
sets of complex objects, with tons of properties and behaviors, known
only in the code in which they are defined (as opposed to defined by the
same notation throughout the literature), it makes more sense to use
longer, more descriptive names. The naming conventions one sees used in
more general-purpose languages such as C++ and Python, therefore, are
perfectly consistent with their more general-purpose missions. But
Fortran has a different mission (numerical scientific computing).


text:
# SimpleJWT
The most simplistic .NET Json Web Token (JWT) Library.
This repository demonstrates the basic functionality of encoding and decoding JWT tokens.

**Warning**: If you want to use authentication in a production environment, I highly suggest using a proper identity provider. Some of the recommended products are:
* [IdentityServer 4](https://github.com/IdentityServer/IdentityServer4) (open-source)
* [Duende IdentityServer](https://duendesoftware.com/) (paid)
* [Keycloak](https://github.com/keycloak/keycloak) (open-source)

## Target Frameworks
* .NET Standard 1.4

## NuGet
* Package available on [NuGet.org](https://www.nuget.org/packages/SimpleJWT/)

## Features
* Encodes and decodes Json Web Tokens (JWT)
* Verifies the signature while decoding
* Validates the exp-Claim if available
* Allows the usage of custom serializers and Base64 encoders
* Allows to provide standard claims which will always be added to the payload

# Usage
The use of dependency injection (if available) is recommended. However, the following code demonstrates the basic usage.
## Encode
```csharp
var jwtEncoder = new JwtEncoder(new NewtonsoftJsonSerializer(), new Base64Encoder(), new List<IStandardClaim>() { new ExpirationClaim() });

var payload = new Dictionary<string, object>
{
	{"sub", "1234567890"},
	{"name", "John Doe"},
	{"admin", true}
};

const string secret = "secret";
var jwt = jwtEncoder.Encode(payload, secret);
```

## Decode
```csharp
var jwtDecoder = new JwtDecoder(new NewtonsoftJsonSerializer(), new Base64Encoder(), new Base64Encoder());

const string secret = "secret";
const string jwt = @"eyJUeXAiOiJKV1QiLCJBbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibm
FtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.du+/ve+/vUNj77+977+9Tu+/vdSmUzjvv71UBnFMbe+/vQTvv
71b77+9yZ7vv73vv73vv70Y77+9Uw==";

var payload = jwtDecoder.Decode(jwt, secret);
```

## Custom serializers and Base64 encoders
SimpleJWT allows you to use custom serializers and Base64 encoders. There are constructor overloads for ```JwtEncoder``` as well as ```JwtDecoder```:
Implement the ```IJsonSerializer``` and ```IJsonDeserializer``` interfaces or the ```IBase64Encoder``` and ```IBase64Decoder``` interface as needed.

## Standard claims
Implement the ```IStandardClaim``` interface to automatically add a claim to the payload while encoding. The only thing required to make it work is to pass the implementation to the constructor of the ```JwtEncoder``` or register it in your dependency injection container.

**Note**: If you want to have the *exp*-claim which will be verified during decoding you have to add the ExpirationClaim to the collection of ```IStandardClaim```'s you pass to the constructor or register it in your dependency injection container.

## Breaking changes from version 1.1 to 2.0
* Dropped explicit target framework ```net452``` (It's still supported because of the ```netstandard1.4``` target framework)
* Removed parameterless contructors for ```JwtDecoder``` and ```JwtEncoder``` types.
* Updated Newtonsoft.Json to the latest version.

## Known issues 2.0.0
* ```ExpirationClaim``` is internal (instead of public). Fixed in 2.0.1.

repository: claudiobernasconi/SimpleJWT

repo_name: claudiobernasconi/SimpleJWT


text:
# User-Defined Functions

Kusto supports user-defined functions, which are either:
* Part of the query itself (**ad-hoc functions**)
* Stored in a persistent manner as part of the database metadata (**stored functions**)

A user-defined function has:
* A name:
    * Must follow the [identifier naming rules](../schema-entities/entity-names.md#identifier-naming-rules)
    * Must be unique in the scope of the definition with a type specification
* A strongly-typed list of input parameters:
    * May be scalar or tabular expressions
    * Scalar parameters may be provided with a default value, used implicitly when the function's caller doesn't provide a value for the parameter (see [Default values](#default-values), below)
* A strongly-typed return value, which may be scalar or tabular

A function's inputs and output determine how and where it can be used:

* **A scalar function**:
    * Is a function with no inputs, or with scalar inputs only, and that produces a scalar output
    * Can be used wherever a scalar expression is allowed
    * May only use the row context in which it is defined
    * Can only refer to tables (and views) that are in the accessible schema

Example:

<!-- csl -->
```
let Add7 = (arg0:long = 5) { arg0 + 7 };
range x from 1 to 10 step 1
| extend x_plus_7 = Add7(x), five_plus_seven = Add7()
```

* **A tabular function**:
    * Is a function with no inputs, or at least one tabular input, and produces a tabular output
    * Can be used wherever a tabular expression is allowed

> [!NOTE]
> All tabular parameters must appear before scalar parameters.

Example of a tabular function that takes no arguments:

<!-- csl --->
```
let tenNumbers = () { range x from 1 to 10 step 1};
tenNumbers
| extend x_plus_7 = x + 7
```

Example of a tabular function that uses a tabular input and a scalar input:

<!-- csl -->
```
let MyFilter = (T:(x:long), v:long) {
  T | where x >= v
};
MyFilter((range x from 1 to 10 step 1), 9)
```

|x|
|---|
|9|
|10|

Example of a tabular function that uses a tabular input with no column specified. Any table can be passed to a function, and no table's column can be referenced inside the function.

<!-- csl -->
```
let MyDistinct = (T:(*)) {
  T | distinct *
};
MyDistinct((range x from 1 to 3 step 1))
```

|x|
|---|
|1|
|2|
|3|

## Declaring user-defined functions

The declaration of a user-defined function provides:

* Function **name**
* Function **schema** (parameters it accepts, if any)
* Function **body**

> [!Note]
> Overloading functions isn't supported. For example, you can't create multiple functions with the same name and different
   input schemas.

> [!TIP]
> Lambda functions do not have a name and are bound to a name using a [let statement](../letstatement.md). Therefore, they can be regarded as user-defined stored functions.
> Example: Declaration for a lambda function that accepts two arguments (a `string` called `s` and a `long` called `i`). It returns the product of the first (after converting it into a number) and the second. The lambda is bound to the name `f`:

<!-- csl -->
```
let f=(s:string, i:long) {
    tolong(s) * i
};
```

The function **body** includes:

* Exactly one expression, which provides the function's
   return value (scalar or tabular value).
* Any number (zero or more) of [let statements](../letstatement.md),
   whose scope is that of the function body. If specified,
   the let statements must precede the expression defining the function's return value.
* Any number (zero or more) of [query parameters statements](../queryparametersstatement.md),
   which declare query parameters used by the function. If specified,
   they must precede the expression defining the function's return value.

> [!NOTE]
> Other kinds of [query statements](../statements.md) which are supported
> at the query "top level", are not supported inside a function body.

### Examples of user-defined functions

**User-defined function that uses a let statement**

The following example binds the name `Test` to a user-defined
function (lambda) that makes use of three let
statements. The output is `70`:

<!-- csl -->
```
let Test1 = (id: int) {
  let Test2 = 10;
  let Test3 = 10 + Test2 + id;
  let Test4 = (arg: int) {
      let Test5 = 20;
      Test2 + Test3 + Test5 + arg
  };
  Test4(10)
};
range x from 1 to Test1(10) step 1
| count
```

**User-defined function that defines a default value for a parameter**

The following example shows a function that accepts three arguments. The latter
two have a default value and do not have to be present at the call site.

<!-- csl -->
```
let f = (a:long, b:string = "b.default", c:long = 0) {
  strcat(a, "-", b, "-", c)
};
print f(12, c=7) // Returns "12-b.default-7"
```

## Invoking a user-defined function

A user-defined function that takes no arguments can be invoked by its
name or by its name with an empty argument list in parentheses.

Examples:

<!-- csl -->
```
// Bind the identifier a to a user-defined function (lambda) that takes
// no arguments and returns a constant of type long:
let a=(){123};
// Invoke the function in two equivalent ways:
range x from 1 to 10 step 1
| extend y = x * a, z = x * a()
```

<!-- csl -->
```
// Bind the identifier T to a user-defined function (lambda) that takes
// no arguments and returns a random two-by-two table:
let T=(){
  range x from 1 to 2 step 1
  | project x1 = rand(), x2 = rand()
};
// Invoke the function in two equivalent ways:
// (Note that the second invocation must be itself wrapped in
// an additional set of parentheses, as the union operator
// differentiates between "plain" names and expressions)
union T, (T())
```

A user-defined function that takes one or more scalar arguments can be invoked
by using the table name and a concrete argument list in parentheses:

<!-- csl -->
```
let f=(a:string, b:string) {
  strcat(a, " (la la la)", b)
};
print f("hello", "world")
```

A user-defined function that takes one or more table arguments (and any number
of scalar arguments) can be invoked using the table name and a concrete argument list
in parentheses:

```
let MyFilter = (T:(x:long), v:long) {
  T | where x >= v
};
MyFilter((range x from 1 to 10 step 1), 9)
```

You can also use the operator `invoke` to invoke a user-defined function that
takes one or more table arguments and returns a table. This is useful when
the first concrete table argument to the function is the source of the `invoke`
operator:

<!-- csl -->
```
let append_to_column_a=(T:(a:string), what:string) {
    T | extend a=strcat(a, " ", what)
};
datatable (a:string) ["sad", "really", "sad"]
| invoke append_to_column_a(":-)")
```

## Default values

Functions may provide default values to some of their parameters under the following conditions:

* Default values may be provided for scalar parameters only.
* Default values are always literals (constants). They can't be arbitrary
   calculations.
* Parameters with no default value always precede parameters
   that do have a default value.
* Callers must provide the value of all parameters with no default values
   arranged in the same order as the function declaration.
* Callers don't need to provide the value for parameters with default values,
   but may do so.
* Callers may provide arguments in an order that doesn't match the order of the parameters. If so, they must name their arguments.

The following example returns a table with two identical records. In the first invocation of `f`, the arguments are completely "scrambled", so each one is explicitly given a name:

<!-- csl -->
```
let f = (a:long, b:string = "b.default", c:long = 0) {
  strcat(a, "-", b, "-", c)
};
union
  (print x=f(c=7, a=12)), // "12-b.default-7"
  (print x=f(12, c=7))    // "12-b.default-7"
```

|x|
|---|
|12-b.default-7|
|12-b.default-7|

## View functions

A user-defined function that takes no arguments and returns a tabular expression
can be marked as a **view**. Marking a user-defined function as a view means
that the function behaves like a table whenever wildcard table name resolution
is done.
The following example shows two user-defined functions, `T_view` and
`T_notview`, and shows how only the first one is resolved by the wildcard
reference in the `union`:

<!-- csl -->
```
let T_view = view () { print x=1 };
let T_notview = () { print x=2 };
union T*
```

## User-defined functions usage restrictions

The following restrictions apply:

* User-defined functions can't pass into
   [toscalar()](../toscalarfunction.md) invocation
   information that depends on the row-context in which the
   function is called.
* User-defined functions that return a tabular expression can't
   be invoked with an argument that varies with the row context.
* A function taking at least one tabular input can't be invoked on a remote cluster.
* A scalar function can't be invoked on a remote cluster.

The only place a user-defined function may be invoked
with an argument that varies with the row context is when the
user-defined function is composed of scalar functions only and
doesn't use `toscalar()`.

**Example of Restriction 1**

<!-- csl -->
```
// Supported:
// f is a scalar function that doesn't reference any tabular expression
let Table1 = datatable(xdate:datetime)[datetime(1970-01-01)];
let Table2 = datatable(Column:long)[1235];
let f = (hours:long) { now() + hours*1h };
Table2 | where Column != 123 | project d = f(10)

// Supported:
// f is a scalar function that references the tabular expression Table1,
// but is invoked with no reference to the current row context f(10):
let Table1 = datatable(xdate:datetime)[datetime(1970-01-01)];
let Table2 = datatable(Column:long)[1235];
let f = (hours:long) { toscalar(Table1 | summarize min(xdate) - hours*1h) };
Table2 | where Column != 123 | project d = f(10)

// Not supported:
// f is a scalar function that references the tabular expression Table1,
// and is invoked with a reference to the current row context f(Column):
let Table1 = datatable(xdate:datetime)[datetime(1970-01-01)];
let Table2 = datatable(Column:long)[1235];
let f = (hours:long) { toscalar(Table1 | summarize min(xdate) - hours*1h) };
Table2 | where Column != 123 | project d = f(Column)
```

**Example of Restriction 2**

<!-- csl -->
```
// Not supported:
// f is a tabular function that is invoked in a context
// that expects a scalar value.
let Table1 = datatable(xdate:datetime)[datetime(1970-01-01)];
let Table2 = datatable(Column:long)[1235];
let f = (hours:long) { range x from 1 to hours step 1 | summarize make_list(x) };
Table2 | where Column != 123 | project d = f(Column)
```


text:
---
lang: en
title: 'API docs: repository-tests.crudfeatures.supportstransactions'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository-tests.crudfeatures.supportstransactions.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [@loopback/repository-tests](./repository-tests.md) > [CrudFeatures](./repository-tests.crudfeatures.md) > [supportsTransactions](./repository-tests.crudfeatures.supportstransactions.md)

## CrudFeatures.supportsTransactions property

Does the connector support using transactions for performing CRUD operations atomically and being able to commit or rollback the changes? SQL databases usually support transactions

Default: `false`

<b>Signature:</b>

```typescript
supportsTransactions: boolean;
```

gha_language: HTML

gha_license_id: NOASSERTION


text:
# Changelog

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

## Released

## 2.2.6 - 2021-06-21

### Fixed
- Proper typing for xarrays.

### Changed
- Significant reading speed-up through memmap.

## 2.2.4 - 2021-06-18

### Changed
- Significant reading speed-up through memmap.

## 2.2.3 - 2020-11-18

### Changed
- Removed read_plink deprecation.
- Updated Example.ipynb
- Improved read_plink documentation.

### Added
- Support for Python 3.9.

## 2.2.1 - 2020-10-07

### Fixed
- Broken CHANGELOG link.

## 2.2.0 - 2020-10-07

### Added
- Added PLINK writer.

### Fixed
- Proper support for sample major layout.

## 2.1.0 - 2020-10-06

### Added
- User can specify reference allele.

### Changed
- IO optimization.

## 2.0.4 - 2020-02-07

### Fixed
- Progress bar flushes at the end.

## 2.0.0 - 2019-05-29

### Added
- Reader for PLINK realized relationship matrix.
- Reader for GCTA realized relationship matrix.
- Simplified reader for PLINK BED files.

repository: ji-younkim/pandas-plink

repo_name: ji-younkim/pandas-plink