text:
# Frontend gulp build tools

Script for a simple frontend build with some defaults which can be extended and customized. Optimizes css, images, html and JavaScript for production and creates a svg symbol sprite.

## Getting Started

#### Project setup

Clone or download the repository and install dependencies:

```
npm install
```

Customize the config variable in the [gulpfile](gulpfile.js) to your liking. An initial default folder structure can be setup by running:

```
npm run build
```

#### Running gulp

Default gulp task is optimized for production and includes browsersync with active file watching. Just run:

```
gulp
```

To prepare the production files (minimize, copy and remove sourcemaps and unused css definitions), run the production gulp task:

```
gulp production
```

For production, images are processed with imagemin which can take some time if source images are not optimized already.

## Tools

* [gulp](http://gulpjs.com/) - Build system automating tasks
* [webpack](https://webpack.github.io/) - Module bundler
* [PostSCC](http://postcss.org/) - A tool for transforming CSS with JavaScript
* [imagemin](https://github.com/imagemin/imagemin) - Minify images seamlessly
* [svg-sprite](https://github.com/jkphl/svg-sprite) - SVG sprites & stacks galore

## Dependencies

* [npm](https://www.npmjs.com/) - Package manager for JavaScript

See [package.json](package.json) for the whole list.

## License

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

## Additional resources

Some useful links for further customizing your build process:

#### gulp

* **[Getting started - Web](https://developers.google.com/web/tools/setup/)** Some web development workspace and tool suggestions from Google Developers.
* **[Introduction to Gulp.js](https://stefanimhoff.de/tags/gulp/)** An expansive tutorial on setting up a gulp workflow by Stefan Imhoff. Great starting point and reference.
* **[Gulp documentation](https://github.com/gulpjs/gulp/blob/master/docs/README.md)** Official gulp documentation with many examples and articles.

#### SVG icons

* **[How to work with SVG icons](https://fvsch.com/code/svg-icons/how-to/)** An SVG icons primer by Florens Verschelde. Everything from export to implementation.
* **[Creating an SVG icon workflow](https://lukewhitehouse.co.uk/blog/svg-icon-workflow/)** A tutorial by Luke Whitehouse that covers gulp and SVG icons integration with fallbacks for older broswers.
* **[Creating SVG sprites using gulp and Sass](https://www.liquidlight.co.uk/blog/article/creating-svg-sprites-using-gulp-and-sass/)** SVG and Sass with gulp example by Mike Street.
* **[A Gulp-Based External SVG Symbol Sprite Icon System](http://una.im/svg-icons/)** Some considerations for SVG icons implementation by Una Kravets.

#### Static site

* **[Using A Static Site Generator At Scale: Lessons Learned](https://www.smashingmagazine.com/2016/08/using-a-static-site-generator-at-scale-lessons-learned/)** Some considerations for choosing your page html templates manager by Stefan Baumgartner.
* **[How to Modularize HTML Using Template Engines and Gulp](https://zellwk.com/blog/nunjucks-with-gulp/)** An example integration of nunjucks templates into a gulp workflow by Zell Liew.

#### Webpack

* **[Unpacking Webpack](https://blog.tighten.co/unpacking-webpack)** A tutorial for replacing gulp with a purely webpack based workflow by Samantha Geitz.
* **[Getting Started with webpack 2](https://blog.madewithenvy.com/getting-started-with-webpack-2-ed2b86c68783)** Webpack basics and multiple files examples by Drew Powers that also covers fully webpack based workflow.
* **[A Beginner’s Guide to Webpack 2 and Module Bundling](https://www.sitepoint.com/beginners-guide-to-webpack-2-and-module-bundling/)** A guide by Mark Brown which covers initial webpack setup and configuration, modules, loaders, plugins, code splitting and hot module replacement.

#### PostCSS

* **[PostCSS Deep Dive](https://webdesign.tutsplus.com/series/postcss-deep-dive--cms-889)** A great PostCSS reference and tutorial series by Kezz Bracey.

repository: subic/frontend-gulp

repo_name: subic/frontend-gulp


text:
**AirC remote DB**
To run program locate into: **cd ./bin/server/** and run **./server**
Default table in: ./bin/server/db/air.json

Server will start on <IP_ADDRESS>:4000, to get access you can use any HTTP client.

**DB requests**
To get data send GET HTTP request with JSON body, ex:
```
{
    "target": "db",
    "table": "air"
}
```
![Get all data](https://github.com/licurg/airc-db/blob/master/screenshots/Screenshot%20from%202020-04-25%2017-55-36.png)

```
{
    "target": "db",
    "table": "air",
    "index": 0
}
```
![Get all data](https://github.com/licurg/airc-db/blob/master/screenshots/Screenshot%20from%202020-04-25%2018-24-54.png)

```
{
    "target": "db",
    "table": "air",
    "search": [
        {"key": "longitude", "value": 30.5238}
    ]
}
```
![Get all data](https://github.com/licurg/airc-db/blob/master/screenshots/Screenshot%20from%202020-04-25%2018-26-58.png)

To change data send POST HTTP request with JSON body, ex:
```
{
    "target": "db",
    "table": "air",
    "index": 0,
    "data": [
        {"key": "id", "value": 2}
    ]
}
```
![Get all data](https://github.com/licurg/airc-db/blob/master/screenshots/Screenshot%20from%202020-04-25%2018-02-27.png)

To put data send PUT HTTP request with JSON body, ex:
```
{
    "target": "db",
    "table": "air",
    "row": {
        "id": 2,
        "area": "Los Angeles",
        "latitude": 40.3333,
        "longitude": 36.3333,
        "value": 0.2
    }
}
```
![Get all data](https://github.com/licurg/airc-db/blob/master/screenshots/Screenshot%20from%202020-04-25%2018-05-45.png)

To delete data send DELETE HTTP request with JSON body, ex:
```
{
    "target": "db",
    "table": "air",
    "index": 0
}
```
![Delete data with search](https://github.com/licurg/airc-db/blob/master/screenshots/Screenshot%20from%202020-04-25%2018-12-50.png)

```
{
    "target": "db",
    "table": "air",
    "search": [
        {"key": "id", "value": 3}
    ]
}
```
![Delete data with search](https://github.com/licurg/airc-db/blob/master/screenshots/Screenshot%20from%202020-04-25%2018-10-19.png)

license: MIT

repository: licurg/airc-db

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: licurg/airc-db


text:
---
title: Flux sensu package
list_title: sensu package
description: >
  The Flux `sensu` package provides functions for sending events to
  [Sensu Go](https://docs.sensu.io/sensu-go/latest/).
  Import the `contrib/sranka/sensu` package.
aliases:
  - /influxdb/v2.0/reference/flux/stdlib/contrib/sensu/
  - /influxdb/cloud/reference/flux/stdlib/contrib/sensu/
menu:
  flux_0_x_ref:
    name: sensu
    parent: sranka
weight: 201
v2.0/tags: [functions, teams, sensu, package]
introduced: 0.90.0
---

The Flux `sensu` package provides functions for sending events to
[Sensu Go](https://docs.sensu.io/sensu-go/latest/).
Import the `contrib/sranka/sensu` package:

```js
import "contrib/sranka/sensu"
```

{{< children type="functions" show="pages" >}}

## Sensu API Key authentication
The Flux Sensu package only supports [Sensu API key authentication](https://docs.sensu.io/sensu-go/latest/api/#authenticate-with-an-api-key).
All `sensu` functions require an `apiKey` parameter to successfully authenticate
with your Sensu service.
For information about managing Sensu API keys, see the
[Sensu APIKeys API documentation](https://docs.sensu.io/sensu-go/latest/api/apikeys/).

gha_license_id: MIT


text:
# Syntax workshop

[![hackmd-github-sync-badge](https://hackmd.io/9MHp3vuPRVGy1Zf7VILBvw/badge)](https://hackmd.io/9MHp3vuPRVGy1Zf7VILBvw)

###### tags: `GTScript` `syntax` `workshop`

- **URL:** --
- **Next session:** --

[TOC]

:::info
# Issue description template

### Change/Enhancement/Discussion: Short description

_Author:_ name (institution)

_Priority:_ :heavy_check_mark: / :heavy_minus_sign: / :x:

_Description:_ Here goes the description of the issue ….

_Proposals:_ Here goes the description of optional proposals (by the author or others) to discuss…
:::

# GTScript Syntax: Open Issues

## Computation

### Change: Change `interval()` to `vertical()`
_Author:_ Johann Dahm (Vulcan), Enrique G. P. (CSCS)

_Priority:_

_Description:_ The current gtscript language specifies vertical intervals using `interval()` with-blocks. This is intuitive when only vertical intervals are created, however with the addition of horizontal iteration spaces it may make sense to make this consistent and name one `vertical()` and the other `horizontal()`.
```python

# proposal 1
with computation(FORWARD):
    with vertical(...):
        field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]

with computation(FORWARD):
    with vertical(0, -1):
        with horizontal(region[0:1, 0:2]):
            field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]

field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]

# proposal 2
field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]
field_e = field_b[-2, 0, 0] + field_b[1, 0, 0]

with vertical(BACKWARD):
    with interval(0, -1):
        field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]

with vertical(BACKWARD):
    with interval(0, -1):
        with horizontal(region[0:1, 0:2]):
            field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]

# current
with computation():
    with interval(0, -1):
        with parallel(region[0:1, 0:2]):
            field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]

```

_Proposals:_

Use two different keywords for parallel (`vertical_stencil`) and non-parallel (`vertical_iteration`) computations, and make `interval()` to accept slices of axes. So that:
```python
with computation():
    with interval(0, -1):
        with parallel(region[0:1, 0:2]):  # optionally
            field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]
```

would be transformed to:
```python
with vertical_stencil():
    with interval(K[0:-1]):
        with interval(I[0:1], J[0:2]):  # optionally
            field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]
```

and a FORWARD/BACKWARD computation:
```python
with computation(FORWARD):
    with interval(0, -1):
        with parallel(region[0:1, 0:2]):  # optionally
            field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]
```
would be
```python
with vertical_iteration(FORWARD):
    with interval(K[0:-1]):
        with horizontal(interval(I[0:1], J[0:2]):  # optionally
            field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]
```

This could also help to explain some constraints inside non-sequential/stencil computations, like forbidden off-center writes, etc.

_Decision [2020/09/29]:_ postpone for now

### Enhancement: Definition of horizontal regions and named horizontal regions
_Author:_ Johann Dahm (Vulcan), Hannes Vogt (CSCS), Enrique G. P. (CSCS)

_Priority:_

_Description:_ discuss GDP about horizontal region definitions and optional syntax to use custom names in the definition of the regions.

_Proposals:_

[GDP #2](https://github.com/GridTools/gt4py/blob/cc81856935bc2026284b13bedd0053e7e88913d6/docs/GDPs/gdp-0002-regions.rst) was introduced to allow motifs found in the FV3 dynamical core.

Example usage:

```python
def stencil(in_f: gtscript.Field[float], out_f: gtscript.Field[float]):
    from __splitters__ import i0, j0

    with computation(PARALLEL), interval(...):
        out_f = in_f + 1.0
        with parallel(region[i0, :], region[:, j0]):
            tmp_f = 2 * in_f
            out_f = tmp_f

stencil(in_f, out_f, splitters={"i0": 0, "j0": 1})
```

This GDP adds a feature allowing computation on horizontal `region[...]` relative to "splitters" which are integers passed at run-time (currently using a dict) in the call without separate stencils. The splitter values in the call are relative to the compute domain origin.

At the implementation level, this currently generates an `if` condition for those stages. **We currently disable extent calculation on these stages to avoid false positive error checks at stencil call time.**

1. Add method of specifying stencils
2. Change `parallel()` to `horizontal()` to make this consistent with proposal to change `interval()` to `vertical()`.

_Decision [2020/09/29]:_ postpone for now

### Enhancement: Stencils calling stencils
_Author:_ Johann Dahm (Vulcan)

_Priority:_

_Description:_ Stencils should be allowed to call other stencils outside computations.

_Proposals:_ Another stencil should be allowed to be called from outside computations, and inlined during compilation. Will need to ignore domain and origin arguments if they exist.

```python
@gtscript.stencil(...)
def stencil(in_f: Field):
  another_stencil(...)
  with computation(...):
    ...
```

This may require a significant rewrite of the gtscript frontend parsing method.

_Decision [2020/09/29]:_ create a GDP to properly define, discuss and implement this feature

### Enhancement: For loops
_Author:_ Johann Dahm (Vulcan)

_Priority:_

_Description:_ Add Python-style for loops over iterables, ranges or other Iterable objects.

_Proposals:_

1. For loop on a set of statements

```python
@gtscript.stencil(...)
def stencil(in_f: gtscript.Field[float]):
    for computation(PARALLEL), interval(...):
        for n in range(num_n):
            ...
```

`n` becomes a parameter inside the block, and can be used in computations, but not as an index.

2. For loop outside computations

```python
@gtscript.stencil(...)
def stencil(field: Field[], *tracer: gtscript.Field[[I,J,K], Tuple[float, float, float]]):

    tracer = field[-1,1,1] * tracer[0,1,0]

    for n in range(num_n):
        for computation(PARALLEL), interval(...):
            in_f[0, 0, 0][n] = ...
```

This is a useful pattern for applying advection to a set of tracers.

_Open Questions:_
- If allowing this, should `num_n` be only allowed to be a compile-time constant?
- Type signature `Tuple[float, float, float]` seems limiting, could syntax like `Tuple[float]*num_n` be supported?

_Decision:_ create two GDPs to properly define, discuss and implement both features and try to understand all the use cases first.

---------------------------------------

## Grid and domain

### Discussion: Definition of domain and extented domain concepts
_Author:_ Enrique G. P. (CSCS), Hannes Vogt (CSCS)

_Priority:_

_Description:_ discuss/review formal definitions of domain-related concepts. _WIP_

_Proposals:_ ...

### Discussion: Use of grid objects in cartesian grid definitions
_Author:_ Till Ehrengruber (CSCS), Enrique G. P. (CSCS)

_Priority:_

_Description:_ discuss if a explicit grid object should be declared as a parameter of the definition function even for cartesian grids. _WIP_

_Proposals:_ ...

### Discussion/Enhancement: Syntax to define objects in cartesian grid definitions
_Author:_ Enrique G. P. (CSCS)

_Priority:_

_Description:_ discuss syntax to define cartesian grids, optionally including axis splitter definitions. _WIP_

_Proposals:_ ...

# GTScript Syntax: Discussed Issues [2020/09/29]

## Field indexing

### Discussion/Enhancement: Support for accessing fields with absolute and indirect indices
_Author:_ Rhea George (Vulcan)

_Priority:_

_Description:_

Discuss if support for indirect and absolute indices should be added and for which axes (only `K` or also `I`,`J`). Indirect indices means that run-time variables can be used as field indices. Absolute indices means that index values are not longer interpreted as relative offsets to the current iteration point but as an absolute reference to an element of the grid.

Examples/use cases:
- Vulcan physics: ...
```
def ...
```

_Proposals:_ it probably makes sense to restrict the discussion to the `K` axis, which is most common use case. Interesting points to discuss:
- Review use-cases and discuss the currently viable alternatives
- Implementation strategies for absolute/indirect access: complexity and performance penalty
- Strategies in and consequences for the analysis toolchain

_Decision_: :x: This proposal has been withdrawn.

### Discussion/Enhancement: Support for vertical off-center writes
_Author:_ Rhea George (Vulcan), Oliver Fuhrer (Vulcan)

_Priority:_

_Description:_ some column based atmospheric science algorithms are intuitive to scientists to write in such a way that adjacent vertical layers are modified in conjunction. For example, if you take mass from the layer you are at and add it to the one below you, it is intuitive to write:
```python
with computation(BACKWARD), interval(1, None):
        if mass[0, 0, 0] > 0:
             delta = x * y
             mass[0, 0, 0]  = mass[0, 0, 0]  - delta
             mass[0, 0, -1] = mass[0, 0, -1] + delta
```
Without off-center writes, we need to write it something like
```python
with computation(BACKWARD):
       with interval(-1, None):
               delta = x * y
               if mass > 0:
                     mass  = mass  - delta
        with interval(1, -1):
               delta = x * y
               if mass[0, 0, 1] > 0:
                     mass = mass + delta[0, 0, 1]
               if mass > 0:
                     mass  = mass  - delta
        with interval(0, 1):
               if mass[0, 0, 1] > 0:
                     mass = mass + delta[0, 0, 1]
```
This is not terrible, and makes sense with this small example, but it quickly can get confusing with more complex patterns.   The special handling at the top and bottom can be easy to forget to do.
Here is a sample we ported:

Python loop version
```python
for j in range(js, je ):
    for k in range(1, nz - 1):
        for i in range(is_, ie):
            if qv[i, j, k] < 0 and qv[i, j, k - 1] > 0.0:
                dq = min(
                    -qv[i, j, k] * dp[i, j, k], qv[i, j, k - 1] * dp[i, j, k - 1]
                )
                qv[i, j, k - 1] -= dq / dp[i, j, k - 1]
                qv[i, j, k] += dq / dp[i, j, k]
            if qv[i, j, k] < 0.0:
                qv[i, j, k + 1] += qv[i, j, k] * dp[i, j, k] / dp[i, j, k + 1]
                qv[i, j, k] = 0.0
```
Stencil version avoiding offcenter writes-introduce fields `upper_fix` and `lower_fix`:
```python
@utils.stencil()
def fix_water_vapor_down(qv: Field, dp: Field, upper_fix: Field, lower_fix: Field):
    with computation(PARALLEL):
        with interval(1, 2):
            if qv[0, 0, -1] < 0:
                qv = qv + qv[0, 0, -1] * dp[0, 0, -1] / dp
        with interval(0, 1):
            qv = qv if qv >= 0 else 0
    with computation(FORWARD), interval(1, -1):
        dq = qv[0, 0, -1] * dp[0, 0, -1]
        if lower_fix[0, 0, -1] != 0:
            qv = qv + lower_fix[0, 0, -1] / dp
        if (qv < 0) and (qv[0, 0, -1] > 0):
            dq = dq if dq < -qv * dp else -qv * dp
            upper_fix = dq
            qv = qv + dq / dp
        if qv < 0:
            lower_fix = qv * dp
            qv = 0
    with computation(PARALLEL), interval(0, -2):
        if upper_fix[0, 0, 1] != 0:
            qv = qv - upper_fix[0, 0, 1] / dp
    with computation(PARALLEL), interval(-1, None):
        if lower_fix[0, 0, -1] > 0:
            qv = qv + lower_fix / dp
        upper_fix = qv
```
In the stencil version, it's hard to tell what's going on. The examples can get more complex. I think that unrestricted off-center writes might create a lot of problems, but this adjacent vertical adjustments pattern comes up a few times in the FV3 dycore and physics.

_Proposals:_ off-center writes could only be allowed in the vertical direction and only for sequential/non-parallel computations with any additional restrictions that'd need to be made.

_Decision:_ off-center writes should only be allowed with the following restrictions:
- in the vertical direction
- in non parallel computations
- relative offsets (in any direction)

Open question: check if all cases can be converted to the current parallel model with workarounds

_Issue:_ https://github.com/GridTools/gt4py/issues/200

---------------------------------------

## Computation

### Change: Remove PARALLEL keyword as iteration order
_Author:_ Enrique G. P. (CSCS), Hannes Vogt (CSCS)
_Priority:_

_Description:_ the `PARALLEL` keyword used as vertical iteration order in the computation definition is often misunderstood by users. We should find a cleaner way to specify stencils without a `FORWARD` or `BACKWARD` iteration order.

_Proposals:_ remove `PARALLEL` and define `computation()` as:

```python
def computation(iteration_order: Optional[IterationOrder] = None):
    pass
```
so it can be used with an empty `computation()`:
```python
with computation():  # Ok
    ...
```

_Decision:_ it should be removed in the future (maybe with a transition period where is deprecated)

_Issue:_ https://github.com/GridTools/gt4py/issues/205

### Change/Discussion: Specification order of vertical intervals
_Author:_ Till Ehrengruber (CSCS), Enrique G. P. (CSCS)

_Priority:_

_Description:_ currently vertical intervals can be specified in any order inside a `computation()`, but they will be executed in the order defined by the `iteration_order` parameter, which means that reading GTScript code from top to bottom does not always reflect the execution order.

```python
with computation(BACKWARD):
  with interval(0, 1): # executed last
    ...
  with interval(-1, None): # executed first
    ...
  with interval(1, -1): # executed "inbetween"
    ...
```

_Proposals:_

 + [ ] Allow the user to specify in order of preference and reorder automatically (current behaviour in GT4Py)
      - :heavy_plus_sign: Boundary cases can be grouped together. Might be closer to how you think and develop the underlying algorithm
 + [ ] Force the user to specify in order of execution
      - :heavy_plus_sign: Comprehension of the execution order and hence the result of the computation is directly apparent
 + [X] The specification order should match execution order when is a sequential computation, and can be any other order when is "parallel"

_Issue:_ https://github.com/GridTools/gt4py/issues/201

### Discussion/Enhancement: Expose the iteration index (_positional computations_)
_Author:_ Till Ehrengruber (CSCS), Enrique G. P. (CSCS)

_Priority:_

_Description:_ Users may want to access the current iteration index in the computation and use it as a numerical value. Since a stencil program will normally contain several iteration loops with different bounds (as part of the extended computation domain), if GT4Py exposes the iteration index, it should be clearly defined how the exposed index maps to the computation domain, and possible what are the possible consequences/interactions with the stage merging step in the analysis phase.

_Proposals:_
The syntax could be something like the following approach, but it must be always clear to the user which iteration loop is being uexposed:
```python

with computation(), interval(...):
    field_a = field_b[-2, 0, 0] + field_b[1, 0, 0]

    I = index(I)
    field = field[idx, idx, idx]

    with axes(I, J, K) as i_index, j, k:  # option 2
        tmp = 3 * i_index * index(I)
        field_c = 3 * i_indextmp * (field_a[-1, -1, 0] - field_a[1, 1, 0])

    out = field_c[I-1]
    ...

    with axes(I, J, K) as i_index, j, k:
        tmp = 3 * i_index
        field_c = 3 * i_indextmp * (field_a[-1, -1, 0] -
```

Example: Cloud physics (TBD @tobias)

https://github.com/ofuhrer/HPC4WC/blob/55c9c9242ed6bc7810541725c2cfcf0dfa655aec/projects2020/group05/shalconv/kernels/stencils_part2.py#L101

https://github.com/ofuhrer/HPC4WC/blob/55c9c9242ed6bc7810541725c2cfcf0dfa655aec/projects2020/group05/shalconv/kernels/stencils_part2.py#L196

Should have the same restrictions as for loop variable (see discussion below).

_Decision:_
Syntax: use `index(AXES_NAME)` to get the actual iteration index
Functionality:
- only as a run time int value in an expression
- (Not as an index in field)

# GTScript Syntax: Discussed Issues [2020/08/29]

## Data types

### Discussion: Definition of supported data types in GTScript

_Author:_ Enrique G. P. (CSCS)

_Priority:_

_Description:_ there has not been discussion about the supported data types in GTScript stencils. This is not a big issue for `Storage` objects since they can deal with NumPy `dtypes` transparently, but a clear definition of which ones are supported would be helpful for the users and needed anyway for analysis and code generation tasks.

_Proposal:_
- Promote the list of the currently supported data types in the IR definition as the standard data types for GTScript (`bool`, `int8`, `int16`, `int32`, `int64`, `float32`, `float64`) and define a list of data types which might be interesting to add (or remove) in the future.
- (Optional) Interaction with Dusk/Dawn toolchain?

_Decision:_ **Approved**. Interesting data types to be added or discussed in the future are `unsigned` and `complex` types with different precision.

### Enhancement: Definition of typed scalars (externals and literals)
_Author:_ Enrique G. P. (CSCS)

_Priority:_

_Description:_ data types are currently specified (both for fields and scalar parameters) in the type annotations of the definition function:
```python
@gtscript.stencil(...)
def my_stencil(field_a: Field[float], field_b: Field[float], value: float):
    pass
```

The content of each annotation sets argument's data type following these rules:

- if the annotation is a Numpy dtype-like instance, it will be used as it is
- if the annotation is a builtin numeric type (`float`, `int`) it will be first transformed to a NumPy dtype using NumPy rules (which means: `float` -> `np.float64` and `int` most likely `np.int64`)
- if the type annotation is a string, the actual data type will be the value of the string in the `dtypes` mapping provided as argument in the stencil decorator call. Example:
```python
@gtscript.stencil(..., dtypes={"small_float": np.float32, "large_float": np.float64})
def my_stencil(field_a: Field["small_float"], field_b: Field["large_float"], value: np.float64):
    pass
```

Different approaches can be mixed freely in the same definition signature, and data type aliases are allowed, therefore the following example is also valid:
```python
my_float_type = np.float64

@gtscript.stencil(..., dtypes={"my_float": np.float32})
def my_stencil(field_a: Field[my_float_type], field_a: Field["my_float"], value: float):
    pass
```

These options allow the user to write "generic" stencil definitions where the actual data types are choosen at compile time (the `stencil` decorator call). However, since there is no way to define a scalar literal (or a `external` constant) with a specific data type in GTScript, applying these rules to scalar values means that literals are always promoted to `int64` or `float64` data types in the current implementation. This hidden type promotion can lead to generated code with unneccessary type casting operations and numerical issues, since some operations might be executed at the wrong precision.

_Proposal:_ extend the syntax to specify the data types of all the values used in GTScript code.
- For externals: support and document the use of NumPy scalars (https://numpy.org/doc/stable/reference/arrays.scalars.html) to pass external constant values

Example:
```python
ALPHA = 4.5

@gtscript.stencil(backend=backend, externals={"ALPHA": np.float32(ALPHA)})
def my_stencil(...):
    pass
```

- For literals, different _non-exclusive_ strategies:
  1. Inline creation of typed literals (so it can be used inside expressions): `float32(4.5)`
  2. Provide a `cast_to()` operator for dtypes defined with strings: `field_b = field_a + cast_to("small_float", 43.5)`
  3. Type annotations for symbol definitions (it should also work with string annotations for types provided at compilation time): `ALPHA: float32 = 4.5`,  `ALPHA: "my_float_type" = 4.5`
  4. Use `dtypes` argument of `gt.stencil`, with the builtins `int` and `float` as keys, to define the actual implementation data types of Python builtin dtypes (for compile-time definition of the actual dtypes, instead of hardcoding them in the definition code):
```python
@gtscript.stencil(dtypes={int: np.int32, float: np.float32})
def my_stencil(...):
  field_a = field_a + 43.5 # => field_a = field_a + float32(43.5)
```
  5. Use user-defined type aliases as keywords for casting: `small_float(43.5)`

_Decision:_ As a first step, we will implement the following options: 1, 3, 4, and later decide about 5.

_Follow-up questions:_
- Where are type annotations required? Currently not required on functions, but when stencils can call other stencils this will not be parallel.

---------------------------------------

## Field definitions

### Discussion: Clarification of the _Field_ concept

_Author:_ Enrique G. P. (CSCS), Till Ehrengruber (CSCS), Hannes Vogt (CSCS)

_Priority:_

_Description:_ before discussing specific syntatic proposal for the definition of fields in GTScript, it would be useful to clarify the concept of Field and its link with the domain/grid. The main open question is how to classify the dimensions of a field (domain dimensions, data dimensions, ...) and how to map them to the domain.

_Proposal:_ The following table sketches a possible definition of a Field as a mapping from some set of elements in the domain to scalar or vector quantities, and the representation of a similar mapping concept in Python via type hints. Following this idea, the left-hand side of the mapping always represent _domain dimensions_, and the right-hand side _data dimensions_, and it is then clear that any high-dimensional field (dims > 3) includes additional data dimensions.

| Meaning                     | Math                                              | Python/GTScript           |
| --------------------------- |-------------------------------------------------- | ------------------------- |
| Mapping/function            | $f: X \rightarrow Y$                              | `Callable[[X], Y]  ## Mapping[X, Y]`    |
| Cartesian 3D                | $F: I \times J \times K \rightarrow \mathbb{R}$   | `Field[[I, J, K], float]` |
| Cartesian 2D                | $F: I \times J \rightarrow \mathbb{Z}$            | `Field[[I, J], int]`      |
| Cartesian 3D (vector field) | $F: I \times J \times K \rightarrow \mathbb{R}^3$ | `Field[[I, J, K], Tuple[float, float]]` |

This proposal also works for unstructured meshes:

| Meaning                                     | Math                                              | Python/GTScript          |
| ------------------------------------------- | ------------------------------------------------- | ------------------------ |
| Field on vertices                           | $F: V \rightarrow \mathbb{R}$                     | `Field[[Vertex], float]` |
| Field on vertex->edge ("sparse")            | $F: V \times E^{adj} \rightarrow \mathbb{R} \\ v \in V, e \in E^{adj} \iff e \text{ is adj. to } v$ | `Field[[Vertex, Adjacent[Edge]], float]`  |
| Alt:  Field on vertex->edge ("local field") | $F: V \rightarrow (G: E^{adj} \rightarrow \mathbb{R}) \\ v \in V, e \in E^{adj} \iff e \text{ is adj. to } v$ | `Field[[Vertex], LocalField[[Edge], float]]`  |

### Enhancement: Enhanced definition of fields for cartesian fields
_Author:_ Enrique G. P. (CSCS), Till Ehrengruber (CSCS), Hannes Vogt (CSCS)

_Priority:_

_Description:_ discuss a syntax to support the definition of lower (1d, 2d) dimensional (and optionally higher dimensional) fields for cartesian grids.

_Proposal:_ following the interpretation of the Field concept as a mapping, and since the Python type hint for functions and callables is `Callable[[args], result]`, this is a possible way to define fields in a sufficiently flexible way, while still keeping readiblity (all keywords are assumed to live in the `gtscript` module). The general formula is: `Field[[domain_elements], data_item]`, with specific adaptations to more complicated cases.

Examples:
- 3d field on cell centers: `Field[[I, J, K], float32]`
- 2d horizontal field on cell centers: `Field[[I, J], float32]`
- 1d vertical field on cell centers: `Field[[K], float32]`
- 3d field on J cell edges (both):
    + [ ] `Field[[I, J[LEFT, RIGHT], K], float32]`
    + [ ] `Field[[I, J_INTERFACES, K], float32]`
    + [ ] `Field[[I, J ^ INTERFACES, K], float32]`
    + [ ] `Field[[I, J | INTERFACES, K], float32]`
    + [ ] All of the previous, but with `North`, `East`, `South`, `West`
    + [ ] Others ...
- 3d field on J left cell edges:
    + [ ] `Field[[I, J[LEFT], K], float32]`
    + [ ] `Field[[I, J_LEFT, K], float32]`
    + [ ] `Field[[I, J ^ LEFT, K], float32]`
    + [ ] `Field[[I, J | LEFT, K], float32]`
    + [ ] `Field[[I, J_LEFT_INTERFACE, K], float32]`
    + [ ] `Field[[I, J_INTERFACES[LEFT], K], float32]`
    + [ ] Avoid horizontal axes altogether and use offsets to reference neighbors (just something to ponder)
    ```python
    def stencil(f_a : Field[[Edge, K], float32], f_b : Field[[Cell, K], float32])
      with location(Cell), ...:
        # since f_a is a field on edges [-1, 0, 0] refers to the left edge
        #  of the currently considered cell. [1, 0, 0] would be the right edge
        #  and [0, 0, 0] is invalid
        f_a[-1, 0, 0] = f_b[0, 0, 0]
    ```
    + [ ] Others ...

In the case of high dimensional fields with data dimensions, it should be first discussed if the sizes of the dimensions should be fixed (and thus the sizes are part of the type) or if they can be flexible (and then specified only at compile time or run time).

Examples:
- 5d field => a 3d field of matrices (M x N) on cell centers:
  (should or could `M`, `N` be fixed values?)
    + [ ] `Field[[I, J, K], Matrix[float32]`
    + [ ] `Field[[I, J, K], Tensor[2, float32]]`
    + [ ] `Field[[I, J, K], Tensor[[M,N], float32]`
    + [ ] `Field[[I, J, K], Matrix[[M, N], float32]]`
    + [ ] `Field[[I, J, K], Vector[N, float32]]`
    + [ ] Allow both, fixed and dynamically sized: `Matrix[float32]`, `SMatrix[[M, N], float32]`
    + [ ] Others ...
- 4d field => a 3d field of N-dimensional row-vectors:
    + [ ] `Field[[I, J, K], Vector[N, float32]]`
    + [ ] `Field[[I, J, K], Tensor[[N], float32]`
    + [ ] Others ...
  Note: `Matrix[1, N]` has different meaning.

_Decision:_ Accept trivial extension to field annotations (structured grids) and delay decision on edges and non-scalar data types until later.

### Enhancement: Definition of fields for unstructured meshes
_Author:_ Enrique G. P. (CSCS), Till Ehrengruber (CSCS)

_Priority:_

_Description:_ discuss a syntax to support the definition of fields for unstructured meshes, taking into account sparse dimensions/neighbor chains.

_Proposal:_ following the same proposal of the enhanced field definition for cartesian grids (in order to be compatible with it), a possible way to define fields for unstructured meshes would be:

Examples:
- field on vertices: `Field[[Vertex], float]`
- field on edges: `Field[[Edge], float]`
- field on cells: `Field[[Cell], float]`

**_Sparse_ concept for neighborhood chains:**
- field on edges adjacent to cells (_sparse_ concept):
    + [ ] `Field[[Edge, Adjacent[Vertex]], float]`
    + [ ] `Field[[Cell, Neighbor[Edge]], float]`
    + [ ] `Field[[Cell >> Edge], float]`
    + [ ] `Field[[Cell ^ Edge], float]`
    + [ ] `Field[[Cell @ Edge], float]`
    + [ ] Others ...

- field on vertices adjacent to edges adjacent to cells (_sparse_ concept):
    + [ ] `Field[[Cell, Adjacent[Edge, Vertex]], float]`
    + [ ] `Field[[Cell, Neighbor[Edge, Vertex]], float]`
    + [ ] `Field[[Cell, Adjacent[Edge | Vertex]], float]`
    + [ ] `Field[[Cell, Neighbor[Edge | Vertex]], float]`
    + [ ] `Field[[Cell >> Edge >> Vertex], float]`
    + [ ] `Field[[Cell ^ Edge ^ Vertex], float]`
    + [ ] `Field[[Cell @ Edge @ Vertex], float]`
    + [ ] Others ...

**_Local field_ concept for neighborhood chains:**
- field on edges adjacent to cells (_local field_ concept): `Field[[Cell], LocalField[[Edge], float]]`
- field on vertices adjacent to edges adjacent to cells (_local field_ concept):
    + `Field[[Cell], LocalField[[Edge, Vertex], float]]`
    + [ ] Others ...

_Decision:_ More examples and discussions are needed before taking a decision.

## Field indexing

### Enhancement: Enhance syntax for field indexing in cartesian grids
_Author:_ Enrique G. P. (CSCS), Oliver Fuhrer (Vulcan)

_Priority:_

_Description:_ index operations with non-3d fields can be quickly become ambiguous or ill-defined, and lack of direction/axes variables end up involving a lot of code duplication repeating exactly the same statements several times, one per axes

_Proposal:_
- Support variables containing axes:
```python
dir = I
field[dir + 3]

def gtscript_function(field, dir):
    return field[dir + 3] + 5.0
```
- Indexing domain dimensions:
  (examples for `field: Field[[I, K], float32] => [I-1, J=, K+1]`)
    + [ ] Map indices to dimensions according to the Field declaration: `field[-1, 1]`
         - :heavy_check_mark: succint
         - :x: error-prone
    + [ ] Always specify the 3 domain indices in order: `field[-1, False, 1]`
         - :heavy_check_mark: not ambiguous
         - :heavy_minus_sign: strict I, J, K ordering
         - :x: verbose
    + [x] Explicit axes for non-zero offsets in any order: `field[K+1, I-1]`
         - :heavy_check_mark: succint
         - :heavy_check_mark: readable
         - :heavy_minus_sign: unusual
    + [ ] Others ...

- Indexing data dimensions:
  (examples for `field: Field[[I, K], Vector[2, float32]] => [I-1, J=, K+1]`)
    + [ ] Use `__getitem__` of the indexed point: `field[K+1 | I-1][1]`
    + [ ] Use `__getitem__` of the field: `field[K+1 | I-1, 1]`
    + [ ] Others ...

_Decision:_
  - Support variables containing axes: **approved**
  - Indexing domain dimensions: **Explicit axes for non-zero offsets in any order** (taking into account collisions with variables declarations and with the syntax for absolute indexing)

### Enhancement: Definition of syntax to specify temporary fields dimensionality
_Author:_ Oliver Fuhrer (Vulcan), Enrique G. P. (CSCS)

_Priority:_

_Description:_ currently GT4Py infers the type of temporaries from the resulting type of the RHS of the assignement to the temporary. For large stencils with many input / output fields of different type (`real`, `integer`, `boolean`), it feels that we are loosing type checking by not being explicit about the type of temporaries.

Also, in operations mixing fields of diferent dimensionality/rank (e.g. 3d and 2d fields), it is not always clear the shape of the output result and it would likely need to be explicitly declared by the user. For example:
```python
c = a[i, j] * b[k]
```
could imply `c[i, j, k]` or simply `c[i, j]`.

**Data dimensions:** if it is allowed to define temporary fields with extra data dimensions, the ambiguities could be harder to solve automatically without explicit user annotations (examples missing).

_Proposals:_
- [ ] Use type annotations in the declaration of temporary fields:
```python
c: Field[I, J, K] = a[i, j] * b[k]
```
- [x] Define that all temporary fields always behave as 3d fields, and implement an analysis step to reduce the actual rank of the temporary in the generated code when this is possible.

_Decision:_ as a first step, we will try to implement an analysis step to optimize the rank of temporaries without requiring the user to provide type annotations, but this decision could be reverted in the future if we find corner cases where it is not possible to select the right shape without additional information provided by the user.

repository: egparedes/concepts

repo_name: egparedes/concepts


text:
# MonokaiFree for iTerm2

A port of the [MonokaiFree](https://github.com/gerardroche/sublime-monokai-free) theme by @gerardroche for iTerm2.

![screenshot](assets/screenshot.png)

## How to install

1. Launch iTerm2.
2. Go to `Preferences`.
3. Choose `Profiles`.
4. Go to  `Colors` tab.
5. Click on `Color Presets`.
6. Choose `Import...`.
7. Select `MonokaiFree.itermcolors`.
8. Click on `Color Presets` again and choose `MonokaiFree`.

## License

[MIT](LICENSE)

## Acknowledgements

Thanks to @gerardroche as the original creator of [MonokaiFree](https://github.com/gerardroche/sublime-monokai-free)


text:
# Bulk mails
Sending bulk mails from a list with Python.
\
\
## How To Use

1. Install the required libraries.
```
pip3 install smtp
```
2. Clone this repo.
```
git clone https://github.com/mtbun/mail.git
```
3. Edit sender in the smtp.py
   For example:
```
sender = {
	'email'<EMAIL_ADDRESS>	'password': 'Th1s1sThePassW0Rd'
}
```
4. Edit content in the smtp.py
5. Edit your email_list file and add the addresses you want to send mail to
6. Run code
```
python3 smtp.py
```

repository: mtbun/BulkMail

branch_name: refs/heads/main

repo_name: mtbun/BulkMail


text:
# Role Name

`install_compui`

## Description

Installs `comp-ui-cron-job` to the machine and arranges for it to run daily.

## Variables Required

Requires `gather_facts` to detect the target operating system.

## Example Playbook

```
# Install test_machine_monitor that doesn't launch Swarming.
- hosts: compui
  user: chrome-bot
  gather_facts: yes

  roles:
    - install_compui

```

## Pushing a test/debug binary:

To deploy a test/debug binary to a machine first upload the cipd package via the
//comp-ui Makefile:

```
$ cd comp-ui
$ make release_compui
```

Then visit http://go/cipd/p/skia/internal/comp-ui-cron-job/+/ (or look in the
logs) to find the version for that build and pass is to this playbook via
--extra-vars.

For example:

```
$ ansible-playbook ./switchboard/install_compui.yml \
  --extra-vars comp_ui_cron_job_version=2021-09-19T15:36:31Z-jcgregorio-ba7510fdcda7d3979cc2c0df21fee100e3ba4075-dirty
```

repository: google/skia-buildbot

gha_language: Go

repo_name: google/skia-buildbot


text:
---
hrs_structure:
  division: '2'
  volume: '9'
  title: '24'
  chapter: '431'
  section: '431:8-326'
type: hrs_section
tags:
  - Business
menu:
  hrs:
    identifier: HRS_0431-0008-0326
    parent: HRS0431
    name: '431:8-326 Time of examinations'
weight: 12130
title: Time of examinations
full_title: '431:8-326 Time of examinations'
---
**[§431:8-326] Time of examinations.** (a) The commissioner shall give examinations within this State at times and places as may reasonably serve the convenience of both the commissioner and applicants.

(b) The commissioner may require a waiting period of not more than six months before giving a new examination to an applicant who has failed to pass two previous examinations for a surplus brokers license. [L 2012, c 66, pt of §1]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# youtube-comment-downloader
Simple script for downloading Youtube comments without using the Youtube API. The output is in line delimited JSON.

### Installation

Preferably inside a [python virtual environment](https://virtualenv.pypa.io/en/latest/) install this package via:

```
pip install youtube-comment-downloader
```

Or directly from the GitHub repository:

```
pip install https://github.com/egbertbouman/youtube-comment-downloader/archive/master.zip
```

### Usage as command-line interface
```
$ youtube-comment-downloader --help
usage: youtube-comment-downloader [--help] [--youtubeid YOUTUBEID] [--url URL] [--output OUTPUT] [--limit LIMIT] [--language LANGUAGE] [--sort SORT]

Download Youtube comments without using the Youtube API

optional arguments:
  --help, -h                             Show this help message and exit
  --youtubeid YOUTUBEID, -y YOUTUBEID    ID of Youtube video for which to download the comments
  --url URL, -u URL                      Youtube URL for which to download the comments
  --output OUTPUT, -o OUTPUT             Output filename (output format is line delimited JSON)
  --pretty, -p                           Change the output format to indented JSON
  --limit LIMIT, -l LIMIT                Limit the number of comments
  --language LANGUAGE, -a LANGUAGE       Language for Youtube generated text (e.g. en)
  --sort SORT, -s SORT                   Whether to download popular (0) or recent comments (1). Defaults to 1
```

For example:
```
youtube-comment-downloader --url https://www.youtube.com/watch?v=ScMzIvxBSi4 --output ScMzIvxBSi4.json
```
or using the Youtube ID:
```
youtube-comment-downloader --youtubeid ScMzIvxBSi4 --output ScMzIvxBSi4.json
```

For Youtube IDs starting with - (dash) you will need to run the script with:
`-y=idwithdash` or `--youtubeid=idwithdash`

### Usage as library
You can also use this script as a library. For instance, if you want to print out the 10 most popular comments for a particular Youtube video you can do the following:

```python
from itertools import islice
from youtube_comment_downloader import *
downloader = YoutubeCommentDownloader()
comments = downloader.get_comments_from_url('https://www.youtube.com/watch?v=ScMzIvxBSi4', sort_by=SORT_BY_POPULAR)
for comment in islice(comments, 10):
    print(comment)
```

repository: egbertbouman/youtube-comment-downloader

gha_language: Python

repo_name: egbertbouman/youtube-comment-downloader


text:
# Artificial Intelligence in Medical Imaging
This project was done as part of a 4th year capstone project at the University of Toronto to reduce time and space demands of MRI scans.
We designed a system using U-Nets and kMeans to optimally select a subset of k-space points from a MRI scan that yields a high quality image.
Our system utilizes a custom masking technique and a modified version of Facebook’s fastMRI U-Net to quickly reconstruct a MRI image from a subset of k-space points.
The system overall is able to achieve Structural Similarity Index Metric scores exceeding 75% between the ground truth and the reconstructed MRI image.

## Usage
In order to use or build upon the existing code, the custom filtering technique is provided in KSpaceReductionModel.ipynb, you will need a set of MRI scans and the Facebook's fastMRI, both of which are available [here](https://fastmri.org/).

## Context
Current Medical Resonance Imaging (MRI) reconstruction procedure is
inefficient; k-space data acquisition and transformation is time
consuming

## Goal
Determine if machine learning algorithms can be applied to identify a
subset of k-space points from an MR scan, that when reconstructed
produces an MR image of a comparable level of detail to that of the
ground truth image.

## Design Flow
![Alt text](images/System.png?raw=true "System Diagram")
1. A raw k-space dataset is first fed into the k-space reduction model to
obtain a sub-sampled k-space dataset via unsupervised learning
models like K-Means clustering.
2. A U-Net model is pre-trained on 300 k-space subsets (i.e. 9000
images) to accurately enhance the input subsampled k-space dataset
3. During the prediction phase, we send the subsampled k-space dataset
from part 1 through the U-Net to obtain an enhanced MR image
4. SSIM is then computed for ground truth and reconstructed image for
quantifying similarity
5. For our experiment, we calculated the mean SSIM of the 1050 images
that were obtained from the U-Net. Our final SSIM score was 0.80285.

## Results and Conclusion
- Achieved final SSIM of 80.285%, beating our target of 75%
- Confirmed hypothesis of patterns in k-space, obtainable via
AI algorithms
- Fulfilled all project requirements, while maintaining flexibility
through tunable parameters

![Alt text](images/gndVSout.png?raw=true "Ground Truth vs Output")
![Alt text](images/MaskingVsResult.png?raw=true "Masking Example")


text:
# diver.js
Dives deep into the DOM and dumps it as a js object.
# What does it do ?
Creating a rest based app requires you to send data to your server in json or xml (most likely). Well you know when the data is huge on the client side you tend to create the json yourself most of the time by writing a lot of boiler plate code. What if you just had to tweak in your html and the hierarchical json with the values would be created magically for you. Interesting ?

So basically diver does all that for you.
# How it works ?
It works by accepting a root-node-id and an empty object. Now it traverses the complete tree and translates every leaf node having a name into its corresponding object literal notation. The name of the leaf node would be translated into an object key and its value will be that key's value.
It is important to note that "Select" html element is an exception to the aforementioned criteria. The name attribute on the select element will be taken as the key and the selected option would be taken as it's value.
# Terminologies
Read more about the terms used in this repository on the [wiki page](https://github.com/raul1991/diver.js/wiki)
# Attributes supported by the library

| Attribute |                   Value                   |                                                                          Use With                                                                          |  Output Type |
|---------|-----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
|   group   |         path.to.your.json.property        | Any non-container html element like h1..h6, p, input(preferably) etc. Any element which will have child elements inside it won't work like table, div etc. | string |
| delimiter | Any token that separates the input value. |                                                                    input - Html Element                                                                    | javascript array [] |
|    name   |            Any valid object key           | Any non-container html element like h1..h6, p, input(preferably) etc. Any element which will have child elements inside it won't work like table, div etc. | string |

# How to use it ?
### Include the script
```javascript
<script type="text/javascript" src="diver.js"></script>
```
### Example Html
```html
<div id="container-top" style="margin:10%">
    <div>
        <div style="margin-left: -118px">
            <label for="inputName">Name</label>
            <div>
                <input  type="text"  name="first_name" group="personal_details" placeholder="First"
                value="cafebabe">
                <input  type="text"  name="last_name"  group="personal_details" placeholder="Last"
                value="1991">
            </div>
        </div>
        <div style="margin-left: -118px">
            <label for="inputAge">Age</label>
            <div>
                <input type="text"  name="age" group="personal_details.age" placeholder="Age" value="21">
            </div>
        </div>
        <div style="margin-left: -118px">
            <label for="inputEmail">Email</label>
            <div>
                <input type="text" group="personal_details.email" name="email_id"  placeholder="Email"<EMAIL_ADDRESS>                <input type="checkbox" group="personal_details" name="isChecked">
                <input type="text" name="values" delimiter="," placeholder="delimited values" value="foo,bar,john-doe">
                <select name="cars">
                    <option>Lamborghini</option>
                    <option>Porsche</option>
                    <option>Maybach</option>
                </select>
            </div>
        </div>
    </div>
</div>
```
### Example call to the diver's function
```javascript
var obj = diver.traverse('container-top',{});
```
### Output
Input fields with no value will not be dumped for example 'isChecked'
```json
{
"personal_details": {
   "first_name": "cafebabe",
   "last_name": "1991",
   "values":["foo","bar","john-doe"],
   "age": {
     "age": "21"
   },
   "email": {
     "email_id"<EMAIL_ADDRESS>    }
},
"cars": "Lamborghini"
}
```

gha_language: HTML


text:
# Config JSON Setup

The project uses **four** `json` files througout the flow to ensure smooth communication among different components.

- **`status.json`**: Stores information about the state of the training server and whether the project is currently in _dev_ or _live_ mode.
- **`cleanup.json`**: Contains a flag depending upon which the `clean` lambda function in the [inference](../inference/) module performs S3 cleanup.
- **`training.json`**: Stores training configuration which includes model parameters and dataset.
- **`inference.json`**: Keeps information regarding the models which are currently available for inference.

In case your are interested, sample preview for each JSON file has been provided. Check the contents of this directory to view the format of those files.

## Setup Instructions

This section will explain how the config files are initialized and setup for use in the project.

- Create a S3 bucket
- Inside the bucket, create the following folders
  - _training_
  - _classification_
  - _sentimentanalysis_
- Read through the sections below to setup each of the config file
  - _Location_ refers to the path of the file relative to the root of S3
  - _Initial Content_ refers to the content that should be stored inside the file before uploading to S3

### Status

The config file contains the following keys

- **`status`**: Can be either `active` or `sleeping`. If the value is set to `active`, it means that the training server is currently busy and it won't accept any more training requests for the time being.
- **`token`**: If the status is active then this key will hold the token of the user whose model is currently being trained on the server.
- **`task_type`**: Can be either `classification` or `sentimentanalysis`. If the status is active then it will store the type of the task that is currently being trained on the server.
- **`dev_mode`**: Can be a _boolean_ value. If it is set to true then the platform will halt all operations. This key is set to true only when any maintainence work has to be done.

[Click here](status.json) to check a sample preview of status.json

#### Location

`status.json`

#### Initial Content

```
{
  "status": "sleeping",
  "token": "",
  "task_type": "",
  "dev_mode": false
}
```

### Cleanup

The config file contains the following keys

- **`status`**: Can be either `active` or `sleeping`. If the value is set to `sleeping`, the cleanup lambda function won't delete old models from S3.

[Click here](cleanup.json) to check a sample preview of cleanup.json

#### Location

`cleanup.json`

#### Initial Content

```
{
  "status": "active"
}
```

### Inference

At the top level, this config file contains the tokens of the models available for inference as keys. For each token, the file has the following set of keys

- **`task_type`**: Can be either `classification` or `sentimentanalysis`. It determines the model type.
- **`model_filename`**: Path of the _.pt_ (trained model) file in the S3 bucket.
- **`classes`** or **`metadata_filename`**: The name of this key depends upon the model type. If the model is an image classification model then the name will be `classes` else if the model belongs to sentiment analysis then the name will be `metadata_filename`
- **`accuracy`**: Represents the best accuracy of the model on validation dataset.
- **`accuracy_plot`**: Stores the _base64_ string of the accuracy chart plot created during the training process.
- **`created`**: Stores the date and time when the model was created and made available for inference.

[Click here](inference.json) to check a sample preview of inference.json

#### Location

`inference.json`

#### Initial Content

```
{}
```

### Training

The config file contains the following keys

- **`token`**: Token assigned to the user so that he can access the model after it has been deployed.
- **`task_type`**: Can be either `classification` or `sentimentanalysis`. It determines the model type.
- **`num_classes`**: Total number of classes present in the dataset.
- **`optimizer`**: Optimizer for training.
- **`learning_rate`**: Learning rate for the optimizer.
- **`batch_size`**: Batch size to use for training.
- **`epochs`**: Number of epochs for which the model will be trained.
- **`data_split`**: Ratio at which the dataset will be split into training and validation set.
- **`dataset`**: Dataset to be used to training in the form of _base64_ strings.
- **`model`**: Model type.
- **`reduce_lr_on_plateau`**: Whether to add reduce LR on plateau scheduler to the training process
  - **`factor`**: Factor at which the learning rate will be reduced.
  - **`patience`**: How many epochs to wait for before reducing the learning rate.
  - **`min_lr`**: Minimum value to which the learning rate can be reduced.

[Click here](training.json) to check a sample preview of training.json

You don't need to create this file. It will be automatically created by the [training server](../train_config/training_server/) module.

repository: amitkayal/Flash

repo_name: amitkayal/Flash


text:
Schmince - Android game
========

This is the evolution of a game created for Ludum Dare 28.

The game is about navigating a group of scattered characters through a maze like land with purple slug monsters chasing you down.

You can see the original code in the other repository I created:
https://github.com/derekmu/Schmince
The game is also on Google Play:
https://play.google.com/store/apps/details?id=com.schmince&hl=en

gha_language: Java


text:
# flfm
>Flask File Manager. View files & upload files with style.

Flask File Manager (flfm) is a WSGI application written in Python.

[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/m-flak/flfm.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/m-flak/flfm/context:python)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/m-flak/flfm.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/m-flak/flfm/context:javascript)

![flfm_new_gif](https://user-images.githubusercontent.com/35634280/69560476-6ea13080-0f71-11ea-8ffe-999281dac39c.gif)

**Features:**
* **Private sharing between Accounts** _Registered users can share the contents of their folders with other users & vice versa!_
* **Account Management.** _Do you want to serve things publicly or do you want users (or you) to be able to upload & save files privately?_ The choice is yours!
* **Built-in viewer for files.** _Currently Supported: Text Files, Image Files, Video Files_
* _**Configurable**_. Define where users can snoop around and upload (or not) files.
* **SLIDESHOWS!** For image files, you can watch a slideshow of all images in a folder or manually sift through them.
* **Uploading of files.**
* **STREAM VIDEO CONTENT** The built-in viewer can play videos with a properly configured nginx.

**Table of Contents**
* [Configuring flfm](#configuring-flfm)
1. [.env file](#dotenv-file)
2. [rules file](#rules-file)
* [Before Using flfm](#before-using-flfm)
* [MySQL Configuration](#mysql-configuration)
* [Deploying flfm](#deploying-flfm)
* [Running Tests](#running-tests)
* [Creating Initial Accounts](#creating-initial-accounts)
* [Special Thanks](#special-thanks)

### Configuring flfm
flfm is configured via a couple of files. The _.env_ file and the _rules_ file. We'll go over both of these here.
##### dotenv file
First, refer to the _.env\_example_ file. You'll see the following:
```
# Example .env file
# Refer to config.py

# Allow Account Registration
ACCOUNT_REGISTRATION_ENABLED=True

# Where to create users' home folders at
USERS_HOME_FOLDERS=/var/flfm/homes

# Rules file location
RULES_FILE=/etc/flfm.d/rules

# Where to store session files
SESSION_FILE_DIR=/var/cache/flfm/

# Where to sideload videos for streaming thru the viewer
VIEWER_VIDEO_DIRECTORY=/var/cache/videos

# Uncomment to change Application Root
##APPLICATION_ROOT=/flfm

# Customize the banner
##BANNER="My Cool Custom Banner"
# Or use one from a file (limit one line)
##BANNER_TYPE="file"
##BANNER=/etc/flfm.d/banner

# DATABASE
DB_SCHEMA="mysql"
DB_USERNAME="flfm_user"
DB_PASSWORD="PASSWORD"
DB_HOST="localhost"
DB_DATABASE="flfm"
```
**Explanation:**

```RULES_FILE``` - _the location of the rules file_
It should be in a secure location such as /etc and also be read-only.
```SESSION_FILE_DIR``` - _storage for flask-session files_
[See here for more information](https://github.com/fengsp/flask-session/blob/master/docs/index.rst)

##### rules file
The rules file is plain text and does not support comments. Here is an example:

```
Allowed=/var/www/public
Disallowed=/var/www/public/private
AllowUploads=/var/www/public/incoming
```

By default, all paths are non-traversable. If you want a path on your server to be accessible, you'll need to add an **Allowed** rule.

You can explicitly restrict subdirectories within an allowed directory by specifying a **Disallowed** rule with the fully-qualified path to that subdirectory.

###### Nesting:
When it comes to the nesting of rules, **do not** nest an _Allowed_ rule in a _Disallowed_ rule's directory tree. There's no reason to do this, for Flask File Manager will not allow access to files or directories by default in the absence of rules.

*Please note that all of these rules apply only to directories & files that are accessible by the WSGI server's _uid/gid_.*

**Explanation:**

```Allowed=/path/to/foo``` - _give flfm access to this dir_

```Disallowed,DisAllowed=/path/to/foo``` - _restrict flfm's access to this dir_

```AllowUpload,AllowUploads=/path/to/foo``` - _allow a user to upload files in the given directory_

### Before Using flfm
Configuring the rules and creating a dot-env file is not quite enough to get started with flfm.
Before using flfm, you'll need to _**generate the secret key**_.
This is easily accomplished with running ```make``` in the project root directory _(requires bash & openssl)_.

You'll also want to [setup the database](#mysql-configuration), [create initial accounts](#creating-initial-accounts) _(optional)_, and [deploy](#deploying-flfm).

### MySQL Configuration
MySQL is used to store user credentials. Before you can run migrations, perform the initial setup on your MySQL server. To illustrate:

```SQL
CREATE DATABASE flfm;
CREATE USER 'flfm_user'@'localhost' IDENTIFIED WITH mysql_native_password BY '<PASSWORD_HERE>';
GRANT ALL ON flfm.* TO 'flfm_user'@'localhost';
```
If you're going to run tests, then also:
```SQL
CREATE DATABASE flfm_tests;
GRANT ALL ON flfm_tests.* TO 'flfm_user'@'localhost';
```

Once this is done, you can run migrations to create the table schemas and what-all for _flfm_.

###### Other SQL Backends:

Hate MySQL? Think it's overkill?? While there's no guarantee of compatibility, you can easily change the SQL backend. Look at the _DATABASE_ section of the [.env file](#dotenv-file).

### Deploying flfm
###### systemd Service
Refer to the example systemd service file in _systemd/flfm.service_.

You'll be able to start flfm as a service with ```systemctl```.

For a tutorial concerning this, [check out this guide](https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-16-04).

###### nginx Configuration

Checkout the example nginx config file in _nginx/example\_nginx.conf_.

There are two ways to configure nginx as a reverse-proxy for flfm.
* From the root, _or **/**_
* From a location, _such as **/flfm**_

Let's look at how our location directives would look for the first method.

```
        location / {
                proxy_pass http://<IP_ADDRESS>:<port>/;
                proxy_redirect off;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }
```
 Now, let's look at how our location directives would look for the second method. **Whatever location you pick must be both in the proxy_pass directive and also set as the APPLICATION_ROOT variable in the [.env file](#dotenv-file).**

```
         location ^~ /flfm {
                proxy_pass http://<IP_ADDRESS>:<port>/flfm;
                proxy_redirect off;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }
```

**REMEMBER:**  _APPLICATION_ROOT == Location == End of proxy\_pass_.

##### Playing videos

Make an alias to the **VIEWER_VIDEO_DIRECTORY** variable.

```
        location /videos/ {
            alias <VIEWER_VIDEO_DIRECTORY>;
            mp4;
            mp4_buffer_size 2M;
            mp4_max_buffer_size 10M;
        }
```

Then, set up socket.io in nginx, [Click Here To See How](https://flask-socketio.readthedocs.io/en/latest/#using-nginx-as-a-websocket-reverse-proxy).

### Running Tests
If you wish to run the tests for yourself, ensure that you have created a [.env file](#dotenv-file) pointing to a sample [rules file](#rules-file).

You'll also want to ensure that you have the appropriate directory tree structure to run the tests against as well.

Then, from the project root directory, simply execute:
```
python tests.py
```

### Creating Initial Accounts
FLFM supports account sessions. **_By default_**, account registration is disabled, but you can modify that in your [.env file](#dotenv-file).

To create accounts, use the management script like so:
```
python manage.py createuser
```
Follow the interactive prompts to create the needed account(s) for use with FLFM.

### Special Thanks
Special thanks go out to the following javascript libraries not listed in the project's dependencies:
* [Filepond](https://pqina.nl/filepond/) (for the uploader)
* [js.cookies](https://github.com/js-cookie/js-cookie)
* [base64.js](https://github.com/dankogai/js-base64)
* @FreshVine's [jQuery-cache-images](https://github.com/FreshVine/jQuery-cache-images)
* [video.js](https://videojs.com/)

repository: tangyiyong/flfm

repo_name: tangyiyong/flfm


text:
# setState
* setState performs as async in React life cycle
React

```js
                <button onClick={() => {
                    console.log('print state before setState:', this.state.value)
                    this.setState(state => ({value: state.value + 1}),
                        () => {
                            console.log('print state in setState callback:', this.state.value)
                        })
                    console.log('print state after setState:', this.state.value)
                }}>add 1
                </button>
```

* setState performs as sync out of  React life cycle,eg in Promise/setTimeout
```js
                <button onClick={() => {
                    setTimeout(() => {
                        console.log('print state before setState:', this.state.value)
                        this.setState(state => ({value: state.value + 1}),
                            () => {
                                console.log('print state in setState callback:', this.state.value)
                            })
                        console.log('print state after setState:', this.state.value)
                    })
                }}>add 1 in setTimeout
                </button>
                <button onClick={() => {
                    const p = new Promise(resolve => resolve())
                    p.then(() => {
                        console.log('print state before setState:', this.state.value)
                        this.setState(state => ({value: state.value + 1}),
                            () => {
                                console.log('print state in setState callback:', this.state.value)
                            })
                        console.log('print state after setState:', this.state.value)
                    })
                }}>add 1 in Promise
                </button>
```


text:
JLImageDownload
===============

A class that handles image download using completion blocks (GCD) and can work hand in hand with operation queues

Properties
----------

* ``delegate``
   * A delegate used for callback after downloading the image.
   * Used for single image download

Parameters
----------

* ``downloadImageLink``
   * The imageLink that needs to be downloaded

* ``forView``
   * The current view showing
   * Used to display the loading notification

* ``optionalParam``
   * A dictionary passed to the downloader then retrieved back from the delegate method
   * Since the downloader runs in an operation queue we can pass details/data about the image in this parameter and retrieve it in the callback method

Callback
--------

* ``-(void)downloadFinished:(UIImage *)JLImage withParams:(NSMutableDictionary *)param``
    * The callback method if single image download is used
    * ``JLImage`` is the downloaded image
    * ``param`` is the dictionary that contains details/data about the image, passed during method call

Usage
-----

Single image download
* It is better to use ``[JLImageDLInstance downloadImageLink:@"imageLink" forView:self.view optionalParam:dictionary];`` if you are only downloading a single image.

Steps:

1) Include JLImageDL.h

2) Add the protocol ``JLImageDLDelegate``

3) Instantiate a new ```JLImageDL *jlImage = [JLImageDL new]``` object.

4) Set the delegate ``jlImage.delegate = self``

5) Call ``[JLImageDLInstance downloadImageLink:@"imageLink" forView:self.view optionalParam:params];``

6) The callback function will be called after the download finishes

Image download using a block
* It is useful in downloading image inside a loop (tableview). It uses GCD to download the images and calls the completion when its done.

Steps:

1) Include JLImageDL.h

2) call

    [JLImageDL downloadImageLinkBlock:[images objectAtIndex:indexPath.row] forView:cv completion:^(UIImage *image) {

              //do something with the image
    }];

Credits
-------
I'd appreciate it to mention the use of this code in your project. On a website, in an about page, in the app itself, whatever. Or let me know by email or through github. It's nice to know that it is being used.

repository: joshuaLareta/JLImageDownload

repo_name: joshuaLareta/JLImageDownload


text:
# We ahead's Docker Registry configuration

[![latest 2.0.0](https://img.shields.io/badge/latest-2.0.0-green.svg)](https://github.com/weahead/docker-registry-conf/releases/tag/v2.0.0)

Docker image that puts configuration for Docker Registry on a volume at `/usr/local/etc/registry` via [confd](https://github.com/kelseyhightower/confd).

For use with [Rancher](http://rancher.com/), because configuration files use Rancher's [metadata service](http://docs.rancher.com/rancher/rancher-services/metadata-service/).

Based on [`weahead/conf`](https://github.com/weahead/docker-conf).

## License

[X11](LICENSE)

repository: weahead/docker-registry-conf

repo_name: weahead/docker-registry-conf


text:
---
title: Smart Mocha API Reference

language_tabs:
  - curl

toc_footers:
  - Sign Up for a Developer Key

includes:
  - errors

---

# Introduction

Welcome to the Smart Mocha API. Here you can get access to all of your devices, data, and notifications.

The Smart Mocha API is built around REST / JSON. We use the same API to power our dashboards and other services. We hope to see you build innovative applications around your devices and data.

All requests must be to our secure endpoint and we're currently at v0 of our API.

e.g. https://api.smartmocha.com/v0/:endpoint

# Authentication

Authenication is handled via API tokens and basic auth. You can manage your API tokens in your account.

In your terminal, you pass your credentials as such:

```shell
curl -u your-api-token: https://api.smartmocha.com/v0/:endpoint
```

# Devices

## Get All Devices

This endpoint retrieves all devices for your account.

### HTTP Request

`GET https://api.smartmocha.com/v0/devices`

```shell
curl -u your-api-token: https://api.smartmocha.com/v0/devices
```

> The above command returns JSON structured like this:

```json
{
  "count": 1,
  "data": [
    {
      "attached_devices": [
        "A6B2E93A15267DBF",
        "3AD97529EE51A8A4",
        "CCE29492A7044737"
      ],
      "created_at": "2014-05-02T18:54:09",
      "deployed": false,
      "description": null,
      "firmware_version": "1.0.0",
      "id": "D0A0D862CC766B7A",
      "last_seen": "2014-05-05T20:35:30",
      "location": null,
      "metrics": [
        {
          "id": "3a853a54-e0fc-4aa9-b1a8-82cfa6dbb783",
          "last_seen": "2014-05-05T13:35:30",
          "last_val": "8.61819792521705",
          "name": "Battery Voltage"
        },
        {
          "id": "115d1dae-ffc0-40cf-ade0-18e9da3b654a",
          "last_seen": "2014-05-05T13:35:30",
          "last_val": "12.285120019427794",
          "name": "External Voltage"
        }
      ],
      "name": null,
      "status": "online",
      "type": "SmartMocha Base Station",
      "updated_at": "2014-05-02T18:54:39"
    }
  ],
  "object": "list",
  "url": "/v0/devices"
}
```

## Get Device

This endpoint retrieves info about a specific device.

### HTTP Request

`GET https://api.smartmocha.com/v0/device/:device_id`

```shell
curl -u your-api-token: https://api.smartmocha.com/v0/device/D0A0D862CC766B7A
```

> The above command returns JSON structured like this:

```json
{
  "attached_devices": [
    "A6B2E93A15267DBF",
    "3AD97529EE51A8A4",
    "CCE29492A7044737"
  ],
  "created_at": "2014-05-02T18:54:09",
  "deployed": false,
  "description": null,
  "firmware_version": "1.0.0",
  "id": "D0A0D862CC766B7A",
  "last_seen": "2014-05-05T20:35:34",
  "location": null,
  "metrics": [
    {
      "id": "3a853a54-e0fc-4aa9-b1a8-82cfa6dbb783",
      "last_seen": "2014-05-05T13:35:34",
      "last_val": "4.941293067865106",
      "name": "Battery Voltage"
    },
    {
      "id": "115d1dae-ffc0-40cf-ade0-18e9da3b654a",
      "last_seen": "2014-05-05T13:35:34",
      "last_val": "12.487047065296252",
      "name": "External Voltage"
    }
  ],
  "name": null,
  "status": "online",
  "type": "SmartMocha Base Station",
  "updated_at": "2014-05-02T18:54:39"
}
```

## Update Device

This endpoint updates info about a specific device.

### HTTP Request

`PUT https://api.smartmocha.com/v0/device/:device_id`

```shell
curl -u your-api-token: -H "Content-Type: application/json" -XPUT -d @update-device.json https://api.smartmocha.com/v0/device/D0A0D862CC766B7A
```

> Where `update-device.json` is structured like this:

```json
{
  "name": "awesome basestation",
  "description": "Pacific Building 5th Floor",
  "location": "520 SW Yamhill St, Portland, OR 97204"
}
```

> The above command returns JSON structured like this:

```json
{
  "attached_devices": [
    "A6B2E93A15267DBF",
    "3AD97529EE51A8A4",
    "CCE29492A7044737"
  ],
  "created_at": "2014-05-02T18:54:09",
  "deployed": false,
  "description": "Pacific Building 5th Floor",
  "firmware_version": "1.0.0",
  "id": "D0A0D862CC766B7A",
  "last_seen": "2014-05-06T15:30:24",
  "location": "520 SW Yamhill St, Portland, OR 97204",
  "metrics": [
    {
      "id": "3a853a54-e0fc-4aa9-b1a8-82cfa6dbb783",
      "last_seen": "2014-05-06T08:30:24",
      "last_val": "7.923217610472991",
      "name": "Battery Voltage"
    },
    {
      "id": "115d1dae-ffc0-40cf-ade0-18e9da3b654a",
      "last_seen": "2014-05-06T08:30:24",
      "last_val": "49.934818435763376",
      "name": "External Voltage"
    }
  ],
  "name": "awesome basestation",
  "status": "offline",
  "type": "SmartMocha Base Station",
  "updated_at": "2014-05-06T20:22:29"
}
```

# Sensor Data

At the moment, all sensor data is attached to the device. Soon you will be able to query sensor data across devices.

### HTTP Request

`GET https://api.smartmocha.com/v0/device/:device_id/data`

## Get sensor data

```shell
curl -u your-api-token: 'https://api.smartmocha.com/v0/device/D0A0D862CC766B7A/data?start=2014-05-01&rollup=1h-avg'
```

> The above command returns JSON structured like this:

```json
{
  "end": "2014-05-06T20:36:27",
  "object": "query",
  "results": [
    {
      "data": {
        "1399322129": 26.650172630945843
      },
      "device": "D0A0D862CC766B7A",
      "metric": "Battery Voltage",
      "name": "awesome basestation",
      "ts": "115d1dae-ffc0-40cf-ade0-18e9da3b654a"
    },
    {
      "data": {
        "1399322129": 28.36407470703125
      },
      "device": "D0A0D862CC766B7A",
      "metric": "External Voltage",
      "name": "awesome basestation",
      "ts": "115d1dae-ffc0-40cf-ade0-18e9da3b654a"
    }
  ],
  "rollup": "1h-avg",
  "start": "2014-05-01T00:00:00"
}
```

### Query Parameters

Parameter | Default | Description
--------- | ------- | -----------
rollup | none/required | see options below for rollup
start | none/required | query start time is required, see options below for date/time formats
end | now | see options below for data/time formats
arrays | none | if &arrays, data will be returned as JSON arrays versus objects
metric_id | none | a semicolon delimited list of metric ids specific to this device

### Rollup Examples

Example | Description
------- | -----------
1h-min | downsampled to 1 hour/min
1d-max | downsampled to 1 day/max
10m-avg | downstampled to 10 minute/average

### Rollup Operations

Operation | Description
--------- | -----------
min | returns the smallest value
max | returns the largest value
sum | returns the sum of all values
avg | returns the average value
dev | returns the standard deviation
rate | returns the rate of change between pairs of data points

### Date Formats

Dates are returned in ISO8601 format, though we gladly accept many other formats in the start and end fields,
including unix timestamps and relative times.

### Relative Times
You can use relative times for your start and end query parameters.

Example | Description
------- | -----------
1h-ago | one hour ago
2n-ago | two months ago
3y-ago | three years ago

### Time units

Time unit | Description
--------- | -----------
ms | milliseconds
s | seconds
m | minutes
h | hours
d | days
w | weeks
n | months
y | years

# Streaming Data

We're using server-sent events for some of our
realtime streaming features. Please do not use this directly in javascript loaded in your browser, as
you will leak your API key.

### HTTP Request

`GET https://api.smartmocha.com/v0/device/:device_id/stream`

## Connect to device stream

```shell
curl -u your-api-token: http://api.smartmocha.dev:5000/v0/device/D0A0D862CC766B7A/stream
```

> The above command will return text/event-stream structured like this:

```json
data: {"device": "D0A0D862CC766B7A", "data": [[1399588748000, 78.40191068442397]], "metric": "Battery Voltage", "type": "data"}

data: {"device": "D0A0D862CC766B7A", "data": [[1399588748000, 73.46231559449963]], "metric": "External Voltage", "type": "data"}

data: {"device": "D0A0D862CC766B7A", "data": [[1399588749000, 63.86665544710024]], "metric": "Battery Voltage", "type": "data"}

data: {"device": "D0A0D862CC766B7A", "data": [[1399588749000, 35.487668612821295]], "metric": "External Voltage", "type": "data"
```

repository: smartmocha/smartmocha-api-docs

repo_name: smartmocha/smartmocha-api-docs


text:
---
title: Coauthor a new employee handbook
contexts: office365,microsoft365
copyright: Microsoft
translations: en
tools: Microsoft Teams,Office 365,OneDrive,SharePoint
areas: HUMAN RESOURCES
color: #777777
icon: https://jumpto365.com/resources/images/app/jumpto365-Icon-white.png
externalref: https://www.microsoft.com/en-us/microsoft-365/success/productivitylibrary/coauthor-a-new-employee-handbook
---
Work together in a single document with your team to create a new employee handbook.

## Share drafts and resources in a secure, accessible location

Start by setting up a **Microsoft Teams** channel for your employee handbook team. In this channel, your team can securely share, discuss, and coauthor the handbook. When you post handbook drafts and resources to the channel’s Files tab, they are stored in your team's **SharePoint** folder, so you can be sure that they are up to date and secure.

[View Training](https://support.office.com/article/Managing-files-in-Microsoft-Teams-c593c78a-27c4-4661-a598-682baa30ca7e)

[IFRAME](https://www.microsoft.com/en-us/videoplayer/embed/RE1UMOJ)

## Collaborate to craft the perfect welcome statement

Your employee handbook’s welcome statement introduces your company to new employees, but creating a well-crafted welcome statement takes some brainstorming. Get the conversation started with an audio or video call from **Microsoft Teams**, and share your document or screen to help your team find the right language quickly.

[View Training](https://support.office.com/article/Meetings-and-calling-d92432d5-dd0f-4d17-8f69-06096b6b48a8)

[IFRAME](https://www.microsoft.com/en-us/videoplayer/embed/RE1UCnc)

## Coauthor handbook sections with your team in real time

You can save time and get to consensus quickly by coauthoring draft sections in real time with **Office 365**. With coauthoring, multiple people can edit a **Word** document, **Excel** spreadsheet, or **PowerPoint** presentation at the same time, and everyone can see what others are working on.

[View Training](https://support.office.com/article/Document-collaboration-and-co-authoring-EE1509B4-1F6E-401E-B04A-782D26F564A4)

[IFRAME](https://www.microsoft.com/en-us/videoplayer/embed/RE1Tmqp)

repository: Hexatown/docs

path: /microsoft/usecases/microsoft365/coauthor a new employee handbook/index.md

gha_language: PowerShell

repo_name: Hexatown/docs


text:
Two text files can be used to build and implement a graph.

One is the architecture file which specifies how everything is connected,
and the other is the implementation file which maps the nodes in the
architecture file to logic.

These files are fed to `buildDataGraph()` and `implementDataGraph()` to
create the executable graph.

## Architecture File

The architecture file is used to build the connections in the graph. It's
compatible with DOT file renderers, which makes it easy to see high-level
architecture without needing to create separate graphs. This is the driving
idea behind maplang: diagrams as code.

For example, the
[ip-echo-architecture.dot](../ip-echo-demo/ip-echo-architecture.dot) results
in ![IP Echo Architecture Diagram](ip-echo-architecture.png)

There are some conventions to note when building architecture files.

First, the current syntax for subgraphs (like "TCP Server" in the above
example) requires the name to start with "Cluster". It will still work
without the Cluster prefix, but it won't be grouped together when rendered
to a diagram.

Second, the output channel of a node uses the edge's "label" property. It's
not intuitive, and will be changed to "channel" once a better renderer is
built (label will be deprecated at that point, but kept for
backwards-compatibility).

## Implementation File

The implementation file connects classes to individual nodes in the graph.

This is a JSON file.
[IP Echo Example](../ip-echo-demo/ip-echo-implementation.json)

TODO: define syntax for the architecture and implementation files.

repository: vdodev/maplang

repo_name: vdodev/maplang


text:
# Ory Kratos, Keto, and Oathkeeper with Kubernetes

This example show how create an SSO and ACL system with the Ory stack and
Kubernetes.

Many thanks to [@pngouin](https://github.com/pngouin) for the the
[original example](https://github.com/pngouin/k8s-ory-example) 🙌

## Overview

This example uses the
[kratos-selfservice-ui-node](https://github.com/ory/kratos-selfservice-ui-node),
a fork of [mailslurper](https://github.com/pngouin/mailslurper) and a
[react-admin app](https://github.com/pngouin/react-admin-ory) for the _admin_
page.

![schema](_assets/diagram.png) _(This is an outline and does not exactly reflect
the reality of how the stack works)_

## Develop

### Prerequisites

- [minikube](https://minikube.sigs.k8s.io/docs/start/)
- [kustomize](https://kubernetes-sigs.github.io/kustomize/installation/)

### Run locally

```bash
$ minikube start
$ minikube addons enable ingress

# Create all resources
$ ./build.sh | kubectl apply -f -

# waits for Keto to be ready and add policies
$ ./add-keto-policies.sh | kubectl apply -f -
$ kubectl get ingress
NAME               CLASS    HOSTS            ADDRESS        PORTS   AGE
fake-smtp-server   <none>   mail.test.info   192.168.XXX.XXX   80      119s
oathkeeper         <none>   ory.test.info    192.168.XXX.XXX   80      119s

# add ingress to the hosts file
$ sudo bash -c 'cat << EOF >> /etc/hosts
# ORY Minikube SSO stack
192.168.XXX.XXX    mail.test.info
192.168.XXX.XXX    ory.test.info
EOF'

```

Open your browser and navigate to `http://ory.test.info/panel/welcome` and
`http://mail.test.info`.

Go to `http://ory.test.info/panel/` and create an account. You can validate your
email on http://mail.test.info. When you create an account you have to add the
role `user` or `admin`. Only the admin role has the right to access the admin
react app.

| URL                                | Description                                               |
| :--------------------------------- | :-------------------------------------------------------- |
| http://ory.test.info/panel/welcome | User app for create an account, login, other              |
| http://ory.test.info/admin/        | Admin react app, you need the role `admin` to access      |
| http://mail.test.info              | Local mail panel, you will receive mail confirmation here |

## Contribute

Feel free to
[open a discussion](https://github.com/ory/examples/discussions/new) to provide
feedback or talk about ideas, or
[open an issue](https://github.com/ory/examples/issues/new) if you want to add
your example to the repository or encounter a bug. You can contribute to Ory in
many ways, see the
[Ory Contributing Guidelines](https://www.ory.sh/docs/ecosystem/contributing)
for more information.

repository: ory/examples

gha_language: Shell

repo_name: ory/examples


text:
---
layout: post
title: https and URL canonical support from S3
tags: s3 cloudfront website ACM
---

The main disadvantage of hosting static websites from S3 is, there is no native https/SSL enabled for S3 website endpoints,it supports only http endpoint, to get around this, https/SSL termination can be enabled at cloudfront distribution for S3 website using ACM feature of AWS, so websites accessed using cloudfront ( Route 53 and cloudfront alias), will support http/https traffic. More details on this on enabling https for S3 using cloudfront can be found  [here](https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-https-requests-s3/)

For redirecting the www traffic to root-domain, most recommendations are to have additional bucket as www.example.com and set 301 redirect to example.com, However this continues to fail the URL cannonical test for SEOs, which is https/http and www/non-www pages  should all work.

| | non-www | www  |   |
| --- | --- | --- | --- |
| http | http://nageshdn.com (Pass)| http://www.nageshdn.com (Pass)| |
| https | https://nageshdn.com (Pass) | https://www.nageshdn.com (Fail)| |
|    |   |   |  |

As workaround, have to overcome https termination for  https://www.nageshdn.com at layer before S3 using cloudfront, hence setup additional cloudfront distribution which will perform https offloads to only subdomain www and the backend S3 bucket ( which is empty) will just redirect www.nageshdn.com  to [nageshdn.com](http://nageshdn.com), to support this additional cloudfront distribution, have to modify AWS certificate manager(ACM) to be applicable to wildcard subdomains (*.nageshdn.com )

Per [AWS well architected framework](https://aws.amazon.com/architecture/well-architected/), this changes should

    - Security : Increase security of the architecure, as www traffic will also support https
    - Performance: for www bound traffic,there is additional step of redirect , which is cached at cloudfront and uses alias for faster   performance
    - Operational Excellence: all www/non-www and http/https is supported, additional cloudfront distribution does not need any maintenance.
    - Cost: there is no additional cost incurred, since existing traffic is divided between 2 distributions and converged in the backend
    - Reliability: there is no additional failure aspects introduced by this change

After setting this up, I see URL cannonical test works for this website.

url: https://raw.githubusercontent.com/ndn97/ndn97.github.io/8768e54c90e83d10fc11b90d77d8615c32402de4/_posts/2018-12-10- https and URL canonical support from S3.md

branch_name: refs/heads/drafts

gha_license_id: NOASSERTION


text:
# Alorium_FPGA_Images
Repository for officially released and beta/unreleased FPGA images that can be used with Alorium Technology's FPGA-based boards.

## Loading new FPGA Images

There are a few ways that new images can be loaded to the FPGA on Alorium's boards:

- Arduino IDE
- Command line
- RPD Image Webloader

### Arduino IDE
All of the officially released FPGA images for our boards are available through the
Tools dropdown menu in the Arduino IDE.  Updating the images is as easy as connecting
your board, selecting an image, and clicking "Burn Bootloader".

Detailed instructions for doing this can be found in this YouTube tutorial:

[How to Update XLR8/Snō Board Package in Arduino IDE](https://youtu.be/OsKAWWdKsxM)

### Command Line
The FPGA image is uploading using a utility we provide in our Arduino board package
called xlr8reconfig. This program can be run from outside of Arduino for any RPD
image you wish to load.

The program is located in tools directory for the Alorium board package in the Arduino
installation path.  This differs a little bit based on operating system.  The following
paths represent where the tool likely lives for default installtions:

```
macOS: [USER]/Library/Arduino15/packages/alorium/tools/xlr8reconfig/1.3.0/xlr8reconfig

Windows: [USER]\AppData\Local\Arduino15\packages\alorium\tools\xlr8reconfig\1.3.0\xlr8reconfig

Linux: [USER]/Library/Arduino15/packages/alorium/tools/xlr8reconfig/1.3.0/xlr8reconfig
```

The command line options for the xlr8reconfig tool are as follows:

```
usage: xlr8reconfig [-h] [-v [VERBOSE]] [-p PORT | --list_ports]
                    [--rpd_file RPD_FILE] [--load_image {0,1}]
                    [--baud_rate BAUD_RATE]

Connect to board through USB

optional arguments:

  -h, --help            Show this help message and exit

  -v [VERBOSE], --verbose [VERBOSE]
                        Increase verbosity. ex: -v, -vv, -vvv, -v 2

  -p PORT, --port PORT  Required: specify port from command line

  --list_ports          Optional: list out ports available and exit

  --rpd_file RPD_FILE   Required: specify rpd file name to use to program XLR8

  --load_image {0,1}    Forces xlr8 to load selected image.
                        1 = load application image,         <--- USE THIS!!!
                        0 = load factory image              <--- don't use this

  --baud_rate BAUD_RATE
                        Optional: Define serial transmission baud rate.
                        Default = 115200
```

### RPD Image Webloader
If you are feeling adventurous, you can also try our Beta web-based RPD Image loader.

You can learn more about that process here:

[How to Update FPGAs Over the Web with the Alorium Web Loader](https://youtu.be/_GwRZJImrWo)


text:
# ContentV1ApprovalFetch

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Sid** | Pointer to **string** | The unique string that that we created to identify the Content resource. |
**AccountSid** | Pointer to **string** | The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. |
**Whatsapp** | Pointer to **interface{}** | Contains the whatsapp approval information for the Content resource, with fields such as approval status, rejection reason, and category, amongst others. |
**Url** | Pointer to **string** | The URL of the resource, relative to `https://content.twilio.com`. |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

repository: twilio/twilio-go

repo_name: twilio/twilio-go


text:
Changelog for pdfname
=====================

0.3.1
-----

* Tested with GHC 8.10.1.
* Added substitutions.

0.3
---

Added Unicode and HTML escaped text substitutions.

0.2
---

* Fixed default author, [#7](https://github.com/asr/pdfname/issues/7).
* Added substitutions for Unicode and some HTML entities.

0.1.3
-----

* Added Unicode substitutions,
  [#5](https://github.com/asr/pdfname/issues/5) and
  [#6](https://github.com/asr/pdfname/issues/6).
* An empty PDF file does not generate an exception,
  [#3](https://github.com/asr/pdfname/issues/3).
* Added and fixed substitutions.

0.1.2
-----

Improved error message, [#1](https://github.com/asr/pdfname/issues/1).

0.1.1
-----

Fixed installation instructions (by Juan Pedro Villa-Isaza).

0.1
---

First release.

repository: asr/pdfname

repo_name: asr/pdfname


text:
---
hrs_structure:
  division: '1'
  volume: '3'
  title: '10'
  chapter: '121'
  section: 121-34
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0121-0034
    parent: HRS0121
    name: '121-34 Right-of-way on street, violation, and penalty'
weight: 4175
title: 'Right-of-way on street, violation, and penalty'
full_title: '121-34 Right-of-way on street, violation, and penalty'
---
**§121-34 Right-of-way on street, violation, and penalty.** Any portion of the army or air national guard while parading, drilling, moving in convoy, or performing any military duty pursuant to orders and according to law, shall have the right-of-way in any street or highway through which they may pass; provided that the carriage of the United States mail or the legitimate functions of the police and the progress and operations of fire engines and fire departments shall not be interfered with thereby. Any person who wilfully interferes or obstructs such right-of-way shall be guilty of a misdemeanor and shall be punishable by a fine not exceeding $100\. [L 1967, c 196, pt of §1; [HRS §121-34](/title-10/chapter-121/section-121-34/)]

Cross References

Classification of offense and authorized punishment, see §§701-107, 706-640, 663.


text:
# CacheDebug
Magento 2 Module : Debug Cache

## Description
This module allow you to find blocks without cachekey or cachelifetime.
These blocks are not cached.

## Configuration
After installation has completed go to :

#### Step 1
* Admin > Stores > Settings > Configuration
* TheCactus117 > CacheDebug
* Enabled cache block debug : **Yes**
    > **Debug Type :** Log files will be written into */var/cache/cachedebug.log*

#### Step 2
* Admin > System > Cache Management
* Disable Full Page Cache

#### Step 3
* Load the page you want to debug


text:
HybridJS
========

(In development) Experimental JavaScript web framework and template engine, similar to AngularJS, but allow hybrid rendering on server (with Node.js) and client side.

This framework is still under development, and should not be used for production use. If you want to help in the creation of web frameworks, please contact me.

## Planned features

* Template engine similar to [Jade](http://jade-lang.com), [Haml](http://haml.info) and [Emblem.js](http://emblemjs.com)
* Server and client side rendering and routing
* Client side two-way data binding similar to AngularJS, Ember.js or Kockout.js
  * (If possible) on the base of the native `Object.observe` (like in the future AngularJS 2.0), with a dirty-checking fallback for older browsers (like the current AngularJS 1.x)
    * maybe with [Watchtower.js](https://github.com/angular/watchtower.js/)?
  * (Alternatively, if not possible) with a getters and setters (like Ember.js, Kockout.js or Backbone.js)
* Internationalisation support
  * maybe with [i18next](http://i18next.com)?
* Client to server communication via AJAX or WebSocket
  * WebSocket communication via [Socket.io](https://github.com/Automattic/socket.io) or [SockJS](https://github.com/sockjs/sockjs-node)?

## Technical realization

* The server compiles the template into an executable function (as in Jade).
* When a page call, the previously compiled function generates the HTML document.
* If the client supports JavaScript, a JavaScript file will be loaded, which contains all the code needed for client-side rendering.
* The client can now take care of the rendering, and only needs to retrieve the necessary data from the server.
* All necessary raw template segments are passed through `data-` attributes in the DOM.

## Technical implementation details

* Client side DOM manipulation via [jQuery](http://jquery.com)
* Integrated [jQuery Lite](https://docs.angularjs.org/api/ng/function/angular.element) version for use without an external dependency (like in AngularJS)

## Used libraries (in progress)

### Server side
* [Express](http://expressjs.com/)
* [Chai](http://chaijs.com/)

### Client side
* [jQuery](http://jquery.com)

repository: HybridJS/HybridJS

repo_name: HybridJS/HybridJS


text:
# Cribl AppScope - Alpine Integration Test

This is an integration test to wring out AppScope with musl libc on an Alpine
container. Supporting musl required adjustments in the way we handle console
IO, DNS lookups, and the Go runtime so we will be focusing there for now.

I'm starting with the Go tests in `../go/` and adjusting...

  - Changed the FROM image to `alpine:latest` and `apk add`'ed packages.
  - Removed the InfluxDB tests because they're slow and the client we use
    is built on glibc and won't work in Alpine. Copied `test_go.sh` from
    `../go/` and cut out the InfluxDB bits.
  - `pkill` isn't working and there is a leftover server listening on 80 which
    prevents Apache from starting later so I've just changed the ports used
    in the Go tests from 80/81 to 8080/8081.
  - Had to rebuild the Rust test program in the build stage.
  - Added checks when running the versions of curl to ensure we're getting DNS
    events.

Run the test with `docker-compose run alpine` and get a shell with
`docker-compose run alpine /bin/bash`.


text:
# iOS Private Framework

![Apple's Private Frameworks for iOS](https://cdn.netmotionsoftware.com/wp-content/uploads/2016/10/iOS-Apple.png)

This repo contains reversed-engendered private frameworks used by Apple in iOS.

Private frameworks are frameworks which you are not allowed to use.
They are not expected to be used outside of Apple, hence "Private". They are often lower-level libraries which may "break" the system if not used correctly.

## Why?
For research purposes 🙂

## Enjoy!

repository: reels-research/iOS-Private-Frameworks

repo_name: reels-research/iOS-Private-Frameworks


text:
# Togl

<img align="left" src="logo.jpg">

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'togl'
```

And then execute:

    $ gem install -g

Or install it directly:

    $ gem install togl

## Usage

First have a configuration file where you add features as you introduce them

``` ruby
Togl.configure do
  feature :recommendations
  feature :threaded_comments
end
```

Now in your code you can check if a feature is on

``` ruby
if Togl.on? :recommendations
  # ... implement the feature ...
end
```

## Contributing

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

repository: fnordfish/togl

repo_name: fnordfish/togl