text:
---
title: Reference
order: 500
---

# LoopKit

### new LoopKit(container, {options})

-   **Arguments:**

    -   `{Element | string} container` - CSS selector or DOM node to which loopkit should attach to. Loopkit will add a canvas element to the container.
    -   `{Object} options` - kit options.

-   **Usage:**

    Create a new instance of loopkit.

-   **Options:**

    -   **`{Function} onFrame(g, frame)`**

        If specified, the callback gets called when the frame is ready for drawing. This is the place to do calculations and redraw any graphics. The callback will receive [`kit.graphics`](#graphics) as the first param, and normalized version (0..1) of the current frame as the second param.

    -   **`{boolean} antialias`**

        Whether the scene should be antialiased. Set to false if you are working on a pixelart project or don't want any smooshing to happen. Defaults to `true`.

    -   **`{string | number | Array | Object | Chroma.color} bgColor`**

        Background color of the scene. Accepts any format that chroma.js supports. See [chroma.js reference](https://gka.github.io/chroma.js/#chroma) for details.

    -   **`{number} frames`**

        How many frames should the loop have. This will have direct effect on how quickly the loop runs (the framerate will stay constant, but the change will happen faster). PIXI refresh rate is about 60 frames per second, so setting frames to 30 will result in a 0.5 second loop, while setting it to 180 - in a three second loop.

    -   **`{boolean} debugKeystrokes`**

        Enabled by default, this attaches a few handy keystrokes to the scene:
        -   `Spacebar` binds to [`.pause()`](#pause) and pauses/unpauses the loopkit.
        -   `Left Arrow` binds to [`.loop.tick()`](#tick) and moves loop 10 frames back. `Shift + Left Arrow` will move the loop back 1 frame.
        -   `Right Arrow` binds to [`.loop.tick()`](#tick) and moves loop 10 frames ahead. `Shift + Left Arrow` will move the loop 1 frame ahead.
        -   `R` binds to [`.exportStill()`](#exportStill) and pauses the loopkit and renders all frames of the loop on top of each other.
        -   `Shift+R` binds to `.exportStill()` and pauses the loopkit and renders all frames of the loop on top of each other, and exports the result as a PNG.
        -   `Shift + E` binds to `.exportLoop()` and exports all frames of the loop as PNGs packed into a TAR archive.
        -   `Shift + P` binds to `.pause()` and pauses/unpauses the loopkit.
    -   **`{number} bpm`**

        Beats per minute. When set, switches Loopkit's ticker to time-exact mode. See below for more details.
    -   **`{number} beatsPerLoop`**

        How many beats should count as one loop. Defaults to `1`
    -   **`{Function} onBeat()`**

        Gets called on each beat. The exact time will depend on `bpm` and `beatsPerLoop`.
    -   **`{string} name`**

        used only when creating export scripts to simplify file management

*   **Example:**

    ```javascript
    let kit = new LoopKit(".kit", {
        bgColor: "white",
        frames: 120,
        onFrame: (g, frame) => {
            g.clear();
            g.lineStyle(1, "green");
            frame = Math.max(frame, 0.01);
            g.drawRect(
                kit.width / 2 - (frame * kit.width) / 2,
                kit.height / 2 - (frame * kit.height) / 2,
                frame * kit.width,
                frame * kit.height
            );
        },
    });
    ```

## Properties

### width

The current width of the canvas. Use it to determine placement for whatever you are drawing

### height

The current height of the canvas. Use it to determine placement for whatever you are drawing

### canvas

Kit's [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement).

> In modern browsers canvas is running in WebGL2 mode, so if you need to get access to the context, you can do `kit.canvas.getContext("webgl2")`

### loop

Kit's looper. Access it to reset the frame, or to get hands on the utility functions. See [Loop](#loop-1) for details.

### bpm

Beats per minute. When specified, loopkit switches from sequential looping (meaning all frames will be renderer one after another, no matter how long it takes), to timer-based looping (meaning it will check how much time has passed since last frame, and figure out what frame we are on based on BPM).

-   **Usage**:

    Set bpm when you want match the visuals to a beat.
-   **Details**:

    Thinking in frames, if you set bpm to 120, that amounts to 120/6 = 2 beats per second. PIXI renders 60 frames per second, so one beat will be half that, or 30 frames.
    In this example your loop will effectively be 30 frames long.
    In many cases this will be too fast, which is where `beatsPerLoop` comes in - we can specify how many beats we want to count as a single loop. If at 120 bpm, we specify that we'd like to pack 2 beats in a single loop, we will effectively end up with a 60 frame loop.

    For better understanding, check out [this experiment](https://tomstriker.org/x/bpm). Use Up/Down keyboard buttons to change `bpm`, and Left/Right to increase/decrease `beatsPerLoop`.

    > Even with bpm mode specified, you can still run exports. During export, loopkit will consult the `frames` property for how many frames it should render.

### beatsPerLoop

Current beatsPerLoop. Defaults to 1 and is not used unless you have specified bpm.

-   **Usage**:

    See [`bpm`](#bpm) for full explanation.

### beat

Access to kit's Beat object. Not used, unless bpm is specified See [Beat](#Beat).

### name

Experiment name for exports.

-   **Usage**:

    Used when generating out PNGs and the TAR archive, as well as for naming scripts in the archive. Handy when you are juggling several experiments.

### renderer

Access to PIXI.renderer. See [PIXI's documentation](http://pixijs.download/release/docs/PIXI.Renderer.html) for full details.

### bg

Current background color.

-   **Usage**:

    Set to change the background color. Accepts any format that chroma.js supports. See [chroma.js reference](https://gka.github.io/chroma.js/#chroma) for details.

### graphics

Access to kit's main surface (`Graphics`).

-   **Usage**:

    Use it to either draw directly on the surface, or manipulate the children. The `Graphics` object is a thin wrapper around `PIXI.Graphics`, see [PIXI's documentation](http://pixijs.download/release/docs/PIXI.Graphics.html) for full details. The only difference between PIXI's Graphics object and loopkit's is that you can specify colors in any format.

### frame

Current frame of the loop in the normalized 0..1 form. Meaning 0 is first frame, 0.5 is "half way there", and ~0.99 the last frame. Note - current frame is never 1, as it rolls over to the next iteration and is 0, instead.

-   **Usage**:

    Set the `frame` to reset the current position in the loop.

### fps _`read-only`_

Returns current frames per second. You can use it to gauge as to whether the machine can't take any more abuse (e.g. that redrawing a million circles on each frame might be a few degrees of magnitude too much, after all).

### children

A convenience shortcut to `.graphics.children`

## Methods

### render()

-   **Usage**:

    Call this when loopkit is not running and you want to redraw a frame. Doesn't do anything if loopkit is running, so it's safe to run on key-strokes on any other input events.

### start()

-   **Usage**:

    Starts loopkit in case if it has been stopped

### stop()

-   **Usage**:

    Stop the loopkit in case if it's running

### pause()

-   **Usage**:

    Pause / unpause the loopkit

### addChild(...elements)

-   **Usage**:

    A convenience shortcut to `kit.graphics.addChild`

### removeChild(...elements)

-   **Usage**:

    A convenience shortcut to `kit.graphics.removeChild`

### export(filename)

-   **Usage**:

    Export current frame. If filename is not specified, will return the result of `canvas.toDataURL()`.
    If filename is specified, will trigger a file download

    > Filename should have a `.png` extension as the output is a PNG.

### `async` exportLoop()

-   **Usage**:

    Pauses loopkit, and exports all frames in a tar archive.

### exportStill(filename, opacity)

-   **Usage**:

    Pauses loopkit, and renderers all frames on top of each other.
-   **Arguments**:
    -   `{string} filename` - filename to export under. Should end with `.png`.
    -   `{float} opacity` - Opacity for each frame - controls how much next frames erase previous ones. Defaults to 0.2

### resize()

-   **Usage**:

    Resizes loopkit to fit the container. Call if you have resized the container. By default elements like growing, but not shrinking so, to avoid that, you can set container's size explicitly and set `overflow: hidden` in CSS.

### destroy()

-   **Usage**:

    Stops loopkit, removes any internal listeners, calls PIXI.js's cleanup functions, removes the canvas element and performs WebGL's context cleanup.

    > If you are running loopkit in a hot-reload environment, call the destroy function in the appropriate listener.

# Loop

Loop keeps track of the timeframe and offers a few helper functions that let you split the loop in smaller miniloops, control flow direction, and perform calculations with delays.

> Normally you'll be accessing loop through loopkit, via [`LoopKit.loop`](#loop)

### new Loop(frames)

-   **Arguments:**

    -   `{int} frames` - how many frames this loop will have. Can be changed on the fly later. Defaults to 120.

-   **Usage:**

    Create a new instance of loop.

## Properties

### frame

Current frame in normalized (0..1) form.

### frameFull

Current frame in integer form. E.g if there are 60 frames, frameFull will go from 0..59.

### frames

Total frames for the loop. You can change it on the go, and loopkit will try to maintain roughly the same frame position at moment of the change.

### loops

How many loops have we run since starting up. You can use this value to expand your experiment beyond a single loop. For example, a motion could be deterministic within a loop, but you could add extra change on top based on how many times the loop has run.

# Methods

### tick(frames)

-   **Arguments:**

    -   `{int} frames` - Optional - by how many frames should the loop advance. Specify negative value to step backwards in time. Defaults to 1.

-   **Usage:**
    Use `tick()` to control the flow of the loop. Internally, loopkit calls `.tick()` on each render frame.

### delay(frames)

Returns `frame` value from N frames back (or ahead, if `frames` is negative).

> This function does not affect the loop itself, merely performs the calculations and returns the normalized value

-   **Arguments:**
    -   `{int} frames` - How many frames back (positive value) or ahead (negative value) are we going.
-   **Usage:**
    This will not affect the flow itself, but will return the normalized version of the frame if it would be delayed by N frames. This can be used to do draw ahead or behind the current frame to, for example, draw faded out outlines, or marking where the motion will go next.

*   **Example:**

    ```javascript
    let kit = new LoopKit(".kit.big", {
        frames: 120,
        bgColor: "#eee",
        onFrame: (g, frame) => {
            g.clear();
            let x = kit.width / 2;
            let y = kit.height / 2;

            // xOffset will move the circle back and forth using a sine function
            let xOffset = frame => Math.sin(frame * Math.PI * 2) * (kit.width / 4);
            let trail = 30;
            for (let i = 0; i <= trail; i++) {
                // center determines how close are we to the current frame (0..1)
                let center = 1 - i / trail;
                // Use opacity and thickness to fade out the trail
                g.lineStyle(center * 3, "#666", center);

                // Offset X by delay, and reduce the radius of the trailing circles
                g.drawCircle(x + xOffset(kit.loop.delay(i)), y, 20 + center * 100);
            }
        },
    });
    ```

    > The thing to note here is that our loop is fully deterministic, and after 120 frames it is back where it started!

### zig(times)

A helper function that splits the normalized 0..1 flow, into a see-saw motion, and returns `frame` from that situation.

-   **Arguments:**
    -   `{int} times` - How many times in the loop should we zig and zag back.
-   **Usage:**
    Over the lifecycle of a single loop, the `frame` value goes from 0 to 1. Zig allows to split this interval into several "zigs". At times=2, zig function, over the lifecycle of a single loop will go 0..1..0. At times=3, over the same interval it will go 0..1..0..1.
    This way you can have several back and forth motions in a single loop.

> This function does not affect the loop itself, merely performs the calculations and returns the normalized value.

> Tip: zig works really good in tandem with [Easing functions](#easing)!

### zigzag(times)

Calls `zig` x `times` x 2, and so will always reach 1 in the end. Think: boomerang.

### splitFrame(parts)

> This function does not affect the loop itself, merely performs the calculations and returns the normalized value

Splits frame into smaller buckets. So while frames goes 0..1, this will fill all the buckets one by one till all buckets are at 1. Here's an example of the buckets filling up over time:

| frame      | 0         | 0.2         | 0.4         | 0.6         | 0.8         | 1         |
| ---------- | --------- | ----------- | ----------- | ----------- | ----------- | --------- |
| `parts(2)` | [0, 0]    | [0.4, 0]    | [0.8, 0]    | [1, 0.2]    | [1, 0.6]    | [1, 1]    |
| `parts(3)` | [0, 0, 0] | [0.6, 0, 0] | [1, 0.2, 0] | [1, 0.8, 0] | [1, 1, 0.4] | [1, 1, 1] |

### fullCircle(callback)

Resets frame to 0 and runs through all frames, calling `callback` on each frame. Useful when you want to export all frames yourself.

# Graphics

The `Graphics` class is a thin wrapper around [PIXI.Graphics](http://pixijs.download/release/docs/PIXI.Graphics.html) that overrides `lineStyle` and `beginFill` functions to accept any color chroma.js supports. For details see [chroma.js reference](https://gka.github.io/chroma.js/#chroma).
Use this class instead of the Pixi's version when creating your own custom sprites

> Use the [LoopKit.graphics](#graphics) instance if you want to draw directly on the kit's surface, use the .

# Props

### Props({props})

-   **Usage:**

    Props is the container for reactive properties. In it you can define inter-dependent properties that will be smartly cached and recalculated on demand

-   **Arguments:**

    -   `{Object} props` - a key:value dictionary of initial props

-   **Usage:**

    Use props to manage all parameters of your experiment in a single place. Put anything you want to parametrize in the props.
    Props

-   **Example:**
    ```javascript
    let props = Props({
        // simple values
        x: 100,
        // dynamically calculated values, recalculated when dependencies change
        angle: state => scale(state.c3a, 0, 359, 0, 5),
        frames: state => scale(state.master, 300, 60, 60, 30),
        echo: state => scale(state.c2b, 0, state.frames - 1, 32),
    });
    ```

## Methods

### Props.addWatcher(callback)

-   **Arguments:**
    -   `{function} callback` - callback to call
-   **Usage:**

    -   Add a `callback` that should get called every time any of the props change.

### Props.removeWatcher(callback)

-   **Arguments:**
    -   `{function} callback` - callback to call
-   **Usage:**

    -   Remove previously added `callback` from the list of callbacks to call on change.

### Props.getState()

-   **Usage:**

    -   Get current state of props. This returns values for all props.

### Props.loadState({values})

-   **Arguments:**
    -   `{object} values` - a {key:value} object with all the prop values that have to be set.
-   **Usage:**

    -   Set values for all passed in props.

### Props.derived()
-   **Usage:**

    -   Get all props that have been calculated (derived) rather have static values. The derived props quite often are the ones with the functional meaning. A "c1" prop might correspond to a state of a slider, while "waveLength" that uses c1 to calculate wavelength, is the one that has the real meaning for the user.

### scale(val, min, max, defaultVal, step)

-   **Arguments:**

    -   `{float} val` - normalized (0..1) value
    -   `{Number} min` - left side value of the scale, the one that will be returned when val == 0. Can be negative.
    -   `{Number} max` - right side value of the scale, the one that will be returned when val == 1. Can be negative.
    -   `{Number} defaultVal` - value to return when `val` is `Undefined`
    -   `{Number} step` - step that the return value should be rounded to. Can be floats, e.g. round to increments of 0.1, as well as ints, e.g. round to increments of 30

-   **Usage:**

    Use `scale` to convert a normalized value into any range. Using scale in tandem with props allows to change the parameter ranges quickly, without having to look for the right spot burried in the code.

-   **Example:**

    ```javascript
    let props = Props({
        // dynamically calculated values, recalculated when dependencies change
        angle: state => scale(state.c3a, 0, 359, 0, 5),
        edges: state => scale(state.c1, 3, 200, 200) + scale(state.c1a, 0, 8),
        frames: state => scale(state.master, 300, 60, 60, 30),
        echo: state => scale(state.c2b, 0, state.frames - 1, 32),
    });
    ```

# Easing

Easing module contains all popular easing functions for quick conversion between a linear value and any of the easing ones.

### Easing.linear(t)

Returns the same value that was passed in.

-   **Usage:**

    This function is handy when you need to temporarily turn easing off - easier to replace the easing function to linear, rather than rewriting the call.

### Standard easing functions

All of the functions below accept a normalized value t as input and return the translated value. For details on easing, see [What is easing?](/extra#what-is-easing) You can find graphs of all standard easing functions on https://easings.net/.

-   Sine: `Easing.sineIn`, `Easing.sineOut`, `Easing.sineInOut`
-   Quadratic: `Easing.quadIn`, `Easing.quadOut`, `Easing.quadInOut`
-   Cubic: `Easing.cubicIn`, `Easing.cubicOut`, `Easing.cubicInOut`
-   Quart: `Easing.quartIn`, `Easing.quartOut`, `Easing.quartInOut`
-   Quint: `Easing.quintIn`, `Easing.quintOut`, `Easing.quintInOut`
-   Exponential: `Easing.expoIn`, `Easing.expoOut`, `Easing.expoInOut`
-   Circular: `Easing.circIn`, `Easing.circOut`, `Easing.circInOut`
-   Back: `Easing.backIn`, `Easing.backOut`, `Easing.backInOut`
-   Elastic: `Easing.elasticIn`, `Easing.elasticOut`, `Easing.elasticInOut`
-   Bounce: `Easing.bounceIn`, `Easing.bounceOut`, `Easing.bounceInOut`

### Functions from material design

Functions snatched from [Material Design's motion chapter](https://material.io/design/motion/speed.html#easing)

-   `Easing.material`,
-   `Easing.materialDecelerated`,
-   `Easing.materialAcelerated`

### Easing.bezier(p1x, p1y, p2x, p2y)

-   **Usage:**

    Roll your own easing function - takes in the bezier curve points and returns an easing function. Uses [BezierEasing](https://github.com/gre/bezier-easing#readme) module for it, so check out their docs.

-   **Example:**

    ```javascript
    let materialAccelerated = BezierEasing(0.4, 0, 1, 1),
    ```

# RC

Use RC (short for Remote-ish Control) when you need to communicated two windows on the same machine rendering the same experiment.

-   **Usage:**

    This can be useful if you are projecting one window to an external screen, but want to have a control interface in another.

*   **Example:**

    RC works extra well in combination with Props, as you can broadcast result from [Props.getState](/props#propsgetstate) and then load it in the other windows using [Props.loadState](/props#propsloadstate)

    ```javascript
    const rc = new RC();

    window.addEventListener("keydown", evt => {
        if (evt.code == "ArrowRight") {
            props.bpm += 1;
        } else if (evt.code == "ArrowLeft") {
            props.bpm -= 1;
        }

        // we are sending kit's frame as well to make sure that the other window
        // renders the exact same thing we are rendering
        rc.send({frame: kit.frame, props: props.derived()});
    });

    function onRemoteVars(data) {
        kit.frame = data.frame;
        Object.entries(data.props).forEach(([prop, val]) => {
            props[prop] = val;
        });
        kit.render();
    }
    rc.addWatcher(onRemoteVars);

    // start listening
    rc.connect();
    ```

> Under the hood, RC uses [Broadcast Channel API](https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API) to locally communicate between windows of the same browser on the machine.

## Methods

### connect()

-   **Usage:**

    Start listening to the local channel. The channel is locked to the browser path, so only windows with the same path will hear each other.

### send(data)

-   **Usage:**

    Broadcast data to all listeners

### disconnect()

-   **Usage:**

    Stop listening. Call this in your destruction procedure.

### addWatcher(callback)

-   **Arguments:**

    -   `{Function} callback` - gets called when a message has been received.

-   **Usage:**

    Update local state from the received data.

### removeWatcher(callback)

-   **Arguments:**

    -   `{Function} callback` - callback that was previously passed into `addWatcher`

-   **Usage:**

    Remove the callback from the list of callback to call when a new message comes in.

# Sound

When you want to react to sound

repository: pixi-loopkit/docs

repo_name: pixi-loopkit/docs


text:
## Get Better Performance from your App ##
Date: 2015-10-11

Last Update: 2016-01-10

This will be cleaned up - soon. (2016-01-10)

Generally, the tips come in two varities.

1. Do this.
2. Don't do this.

### 1. Do this ###

* [Performance & UX Considerations For Successful PhoneGap Apps](http://www.tricedesigns.com/2013/03/11/performance-ux-considerations-for-successful-phonegap-apps/) - Andrew Trice - March 11, 2013
 1. Hardware Acceleration
 2. The Impact of Content Reflow (7 points to analyze)
 3. Keep Graphics Simple
 4. Touch Interactivity (use touch events, not mouse)
 5. JavaScript Optimizations
 6. Native Performance
 7. UI & UX Considerations
 8. Test On Devices

### 2. Don't do this. ###

* [You half assed it. That is why your PhoneGap application sucks.](http://sintaxi.com/you-half-assed-it) - Brock Whitten - undated
 > Here are just a few rather obvious mistakes they make.

 1. Uses JQuery (and JQuery Mobile)
 2. Massive Footprint. 248k wowsers
 3. click instead of tap
 4. setTimeout animations

* [BazaarJS: our criticisms of Angular](http://www.leanpanda.com/blog/2015/09/20/our-criticisms-of-angularjs/) - Stefano Verna – September 20, 2015

- Problem #1: Scope inheritance and dynamic scoping
- Problem #2: Dirty checking
- Problem #3: Dependency injection
- Problem #4: Pointless complexity
- Problem #5: Server-side rendering

## Other DO THIS Articles ##

- [Minimizing browser reflow](https://developers.google.com/speed/articles/reflow?hl=en)

## Other Useful articles ##

- [Apache Cordova: after 10 months, I won't be using it anymore](http://geekcoder.org/apache-cordova-after-10-months-i-wont-using-it-anymore/) - July 06, 2015
- [ogv.js: An Ogg Theora and Vorbis Video Decoder in JavaScript](http://badassjs.com/post/71980473022/ogvjs-an-ogg-theora-and-vorbis-video-decoder-in) - January 2nd 2014
- [Top 10 Performance Techniques for PhoneGap and Hybrid Apps ? Slides Available](http://coenraets.org/blog/2013/10/top-10-performance-techniques-for-phonegap-and-hybrid-apps-slides-available/?utm_source=rss%26utm_medium=rss%26utm_campaign=top-10-performance-techniques-for-phonegap-and-hybrid-apps-slides-available) - October 30, 2013 by Christophe Coenraets
- [The Complete Guide to Building HTML5 Games with Canvas & SVG](http://www.htmlgoodies.com/html5/client/the-complete-guide-to-building-html5-games-with-canvas-svg.html) - undated, appears 2013
- [HTML5 vs Native: The Mobile App Debate](http://www.html5rocks.com/en/mobile/nativedebate/) - June 3rd, 2011 by Michael Mahemoff

## My notes from the documentation ##

### Tip #1 ###
With the Android [Webview](http://developer.android.com/reference/android/webkit/WebView.html) you can reduce screen flicker \*when changing orientation*, by reading below.

_Cookie and Window Management_

The standard behavior for an Activity is to be destroyed and recreated, when the device orientation or any other configuration changes. This will cause the WebView to reload the current page. **If you don't want that, you can set your Activity to handle the orientation and keyboardHidden changes**, and then just leave the WebView alone. It'll automatically re-orient itself as appropriate. Read Handling Runtime Changes for more information about how to handle configuration changes during runtime.

## Videos ##

### Responsive HTML5 Touch Interfaces ###

* Stephen Woods: "Creating Responsive HTML5 Touch Interfaces"
* http://yuiblog.com/blog/2012/02/23/video-stephen-woods-html5-touch/
* includes: swipe, snap back/forward, bounce, native scrolling, pinch to zoom + pro-tips.

## Unapplied/Unsorted ##

*Lodash, the JavaScript Library You're Already Using*

http://www.infoq.com/news/2015/03/lodash-utility-library

> Though lodash is popular with node.js developers, it is also used by browser-based projects. Web developers can use the experimental build tool to cherry-pick which methods their project needs rather than downloading the entire library. For node.js projects, individual methods can be included when the whole package isn't needed.

*Comparing JavaScript Templating Engines: Jade, Mustache, Dust and More* - November 11, 2014

https://strongloop.com/strongblog/compare-javascript-templates-jade-mustache-dust/

> Lets talk templates, specifically JavaScript powered templates. Even more specifically ? template engines that work as well on the server side as they do on the client side.

*Templating Engines* (undated)

http://jster.net/category/templating-engines

> These JavaScript templating engines allow you to perform string interpolation and then some using some specific templating syntax. Examples: mustache.js and Jade.

*5 Ways to Make Your Site Smaller and Faster* - February 8, 2015

https://davidwalsh.name/site-speed

> To be a great everyday developer, we're almost destined to feel as though our work isn't good enough -- what a negative way to live our lives!
 The good news is that there are a few methods for incredible easy gains in the performance and load time departments.  Here are five gains you can complete in minutes to make your site faster for all users!

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Model and Deployment Metadata

![metadata](./metadata.svg)

## Incubating feature note
The model metadata feature has currently "incubating" status.
This means that we are currently exploring the best possible interface and functionality for this feature.

As a warning word this means that the API or the way you define metadata may be subject to change before
this feature graduates. If you have any comments or suggestion please open the issue on our GitHub project.

## Examples:
- [Basic Examples for Model with Metadata](../../examples/metadata.html)
- [SKLearn Server example with MinIO](../../examples/minio-sklearn.html)
- [Deployment Level Metadata](../../examples/graph-metadata.html).

- [Deploying models trained with Pachyderm](../../examples/pachyderm.html)
- [Deploying models trained with DVC](../../examples/dvc.html)

## Model Metadata (incubating)

With Seldon you can easily define metadata for your models that is compatible with [kfserving dataplane proposal](https://github.com/kubeflow/kfserving/blob/master/docs/predict-api/v2/required_api.md#model-metadata) specification:
```
$metadata_model_response =
{
  "name" : $string,
  "versions" : [ $string, ... ] #optional,
  "platform" : $string,
  "inputs" : [ $metadata_tensor, ... ],
  "outputs" : [ $metadata_tensor, ... ]
}
```
with
```
$metadata_tensor =
{
  "name" : $string,
  "datatype" : $string,
  "shape" : [ $number, ... ]
}
```

Model metadata can be obtained through GET request at `/api/v1.0/metadata/{MODEL_NAME}` endpoint of your deployment.
Example response:
```json
{
  "name": "my-model",
  "versions": ["my-model/v1"],
  "platform": "platform-name",
  "inputs": [{"datatype": "BYTES", "name": "input", "shape": [1, 5]}],
  "outputs": [{"datatype": "BYTES", "name": "output", "shape": [1, 3]}],
}
```

### Prepackaged model servers

To add metadata to your prepackaged model servers simply add a file named `metadata.yaml`
to the S3 bucket with your model:
```YAML
name: my-model
versions: [my-model/v1]
platform: platform-name
inputs:
- datatype: BYTES
  name: input
  shape: [ 1, 4 ]
outputs:
- datatype: BYTES
  name: output
  shape: [ 3 ]
```

See [SKLearn Server example with MinIO](../../examples/minio-sklearn.html) for more details.

### Python Language Wrapper

You can add model metadata you your custom Python model by implementing `init_metadata` method:

```python
class Model:
    ...
    def init_metadata(self):
        meta = {
            "name": "my-model",
            "versions": ["my-model/v1"],
            "platform": "platform-name",
            "inputs": [{"name": "input", "datatype": "BYTES", "shape": [1, 4]}],
            "outputs": [{"name": "output", "datatype": "BYTES", "shape": [1]}],
        }
        return meta
```

See [Python wrapper](../../python/python_component.html#incubating-features) documentation for more details and
notebook [Basic Examples for Model with Metadata](../../examples/metadata.html).

## Deployment Metadata (incubating)
Model metadata allow you to specify metadata for each of the components (nodes) in your graph.
New orchestrator engine will probe all nodes for their metadata and derive global `inputs` and `outputs` of your graph.
It will then expose them together with all nodes' metadata at a single endpoint `/api/v1.0/metadata/` of your deployment.

![graph-metadata](./graph-metadata.svg)

Example response:
```json
{
  "name": "example",
  "models": {
    "model-1": {
      "name": "Model 1",
      "platform": "platform-name",
      "versions": ["model-version"],
      "inputs": [{"datatype": "BYTES", "name": "input", "shape": [1, 5]}],
      "outputs": [{"datatype": "BYTES", "name": "output", "shape": [1, 3]}]
    },
    "model-2": {
      "name": "Model 2",
      "platform": "platform-name",
      "versions": ["model-version"],
      "inputs": [{"datatype": "BYTES", "name": "input", "shape": [1, 3]}],
      "outputs": [{"datatype": "BYTES", "name": "output", "shape": [3]}]
    }
  },
  "graphinputs": [{"datatype": "BYTES", "name": "input", "shape": [1, 5]}],
  "graphoutputs": [{"datatype": "BYTES", "name": "output", "shape": [3]}]
}
```

See example [notebook](../../examples/graph-metadata.html) for more details.

repository: ttapjinda/seldon-core

repo_name: ttapjinda/seldon-core


text:
(file-types:index)=
# Types of content source files

Jupyter Book supports many kinds of source files for your book's content.
These sections cover the major types of content and how you can control their behavior in Jupyter Book.
See the list of sections to the left for information about each type.

## Section table of contents

```{tableofcontents}
```

## Allowed content types

In general, these are the types of content supported by Jupyter Book (along with
links to their section in this book):

[Markdown files](./markdown.md)
: These are text files written in either CommonMark or in MyST Markdown.

[Jupyter notebooks](./notebooks.md)
: AKA, `.ipynb` files. These files can contain Markdown cells with MyST Markdown.
: A Jupyter notebook can utilise any program kernel that implements the [Jupyter messaging protocol](http://jupyter-client.readthedocs.io/en/latest/messaging.html) for executing code.
  There are kernels available for [Python](http://ipython.org/notebook.html), [Julia](https://github.com/JuliaLang/IJulia.jl), [Ruby](https://github.com/minad/iruby), [Haskell](https://github.com/gibiansky/IHaskell) and [many other languages](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels).

[MyST Markdown notebooks](./myst-notebooks.md)
: These are Markdown files (ending in `.md`) that will be *converted to a notebook and executed*.

[reStructuredText](./restructuredtext.md).
: These are text files used by the Sphinx documentation engine (which is used by Jupyter Book).
  It is recommended to use MyST Markdown instead.

[Custom notebook formats](file-types:custom)
: Any other file type can be *auto-converted* before execution by assigning it a custom Python function, for example those provided by the Jupytext conversion tool.

(rules-all-content-types)=
## Rules for all content types

There are a few things that are true for all content types. Here is a short list:

* **Files must have a title**. Generally this means that they must begin with
  a line that starts with a single `#`
* **Use only one top-level header**. Because each page must have a clear
  title, it must also only have one top-level header. You cannot have multiple
  headers with single `#` tag in them.
* **Headers should increase linearly**. If you're inside of a section with
  one `#`, then the next nested section should start with `##`. Avoid jumping straight
  from `#` to `###`.

## Two-way conversion between text-files and `.ipynb` files

For information about how to convert between text files and `.ipynb` files for use
with Jupyter Book, see [](file-types:custom:jupytext).

repository: executablebooks/jupyter-book

gha_language: Python

repo_name: executablebooks/jupyter-book


text:
## Contributing

The project becomes better for everyone when people like you help make it better!

Have any questions or concerns? Did I forget something? Feel free to submit an issue or pull request.

If you decide to contribute, after downloading a copy of the repository, be sure to install the tools locally to develop and test your contribution before submitting it.

Thanks for taking the time to contribute :)

license: MIT

repository: MorganCaron/IsometricSass

gha_language: Sass

gha_license_id: MIT

repo_name: MorganCaron/IsometricSass


text:
# Tools to assist

Contained here are some tools to assist with the RFC7523 Apigee example.

## provisionKeysProxyProductDeveloperAndApp.sh

This tool provisions the various things for the example.

It creates keys, imports and deploys a proxy, creates an API Product, a Developer and a
Developer app for the API Product.  It prints out the client id and secret.

```
./provisionKeysProxyProductDeveloperAndApp.sh -n -o amer-demo4 -e test
```

## createJwt.sh

This is just a wrapper on the JwtTool, which you can read about below. It
specifies the Java command line and classpath, and it defaults some of the
options for this example.

```
ORG=myorgname
createJwt.sh  -k ./private-20170130-105203.pem -i kjskjsksj  -e test -o $ORG
```

## JwtTool

This tool allows you to decode a JWT, verify an RSA-signed JWT, or generate an RSA-signed JWT.

## Create a signed JWT
```
 java -classpath "jose-tool/target/apigee-jose-tool-20190207.jar:jose-tool/target/lib/*"  com.google.examples.JwtTool \
   -G -A RS256 \
   -i keyid1 \
   -x 18h \
   -k ./private-20170130-105203.pem \
   -c '{
       "sub"   : "DinoChiesa-01918712-C042-49AC-803C-C8CA635D4E64",
       "iss"   : "urn://apigee-edge-jwt-issuer-20170809",
       "scope" : "urn://www.apigee.com/apis/forever",
       "aud"   : "urn://www.apigee.com/the-google-kirkland-office"
   }'
```

The above says:
* create a JWT (-G) using the RS256 algorithm (-A RS256)
* using keyid keyid1 (-i)
* with expiration of 18 hours
* using the specified private key
* and the specified claims

## Verify a signed JWT

This will verify the JWT:

```
 java -classpath "jose-tool/target/apigee-jose-tool-20190207.jar:jose-tool/target/lib/*"  com.google.examples.JwtTool \
   -V \
   -t $JWT \
   -k ./public-20170130-105203.pem
```

The above says:
* verify a JWT (-V)
* given the provided token (-t)
* with the provided public key (-k)

## Decode a signed JWT, without verifying the signature

This will parse, but will not verify the JWT:

```
 java -classpath "jwttool/target/jwt-tool.jar:jwttool/target/lib/*"  com.google.examples.JwtTool \
   -V \
   -t $JWT
```

gha_language: Java


text:
Hey all! This Week in React is back from summer break.

---

## ❤ Adopt Contributor Covenant

React is adopting the [Contributor Covenant](https://www.contributor-covenant.org/). It represents a shared understanding of what is expected form a healthy community.

https://github.com/facebook/react/pull/16613

---

## 🛠 DevTools v4 Release

After months of development, the experimental DevTools rewrite is now public. A lot has changed in version 4, check out the blog post for more detail.

https://reactjs.org/blog/2019/08/15/new-react-devtools.html

---

## 🌏 React Docs Localizations Update

The Arabic localizations is now complete:

- [ar.reactjs.org](https://ar.reactjs.org)

And the following localizations are now live:

- Azerbaijani: [az.reactjs.org](https://az.reactjs.org/)
- Bulgarian: [bg.reactjs.org](https://bg.reactjs.org/)
- Indonesian: [id.reactjs.org](https://id.reactjs.org/)
- Mongolian: [mn.reactjs.org](https://mn.reactjs.org/)
- Vietnamese: [vi.reactjs.org](https://vi.reactjs.org/)

---

## 🚀 Babel Transform JSX to React.jsx/React.jsxDEV

As per the [RFC for createElement changes](https://github.com/reactjs/rfcs/pull/107), this change is an experimental fork of @babel/plugin-transform-react-jsx that transpiles to `React.jsx` instead.

https://github.com/facebook/react/pull/16432

---

## 🔄 Fast Refresh Explainer

Dan wrote an explainer of how a Fast Refresh integration for the Web could look like.

https://github.com/facebook/react/issues/16604#issuecomment-528663101

---

## 💤 Partial Support for `React.lazy()` in Server Renderer

The Server Render now has partial support for lazy-loaded components.

https://github.com/facebook/react/pull/16383

---

## ➡ DevTools Moved into Core Repo

The DevTools are now part of the React Core repository. The previous repository now also directs to the Core one.

https://github.com/facebook/react/tree/master/packages/react-devtools

---

## 🎇 React Events Updates

- [Tap Responder](https://github.com/facebook/react/pull/16628)
- [DOM Event Testing Library](https://github.com/facebook/react/pull/16433)
- [Support Screen Reader Virtual Clicks](https://github.com/facebook/react/pull/16584)
- [Rework the Responder Dispatching/Batching Mechanism](https://github.com/facebook/react/pull/16334)

---

## ⏱ Scheduler: Profiling Features

This change adds two new profiling features to Scheduler, a sample-based approach where profiling information is written into a SharedArrayBuffer and an event-based approach that also works during page initialization.

https://github.com/facebook/react/pull/16542

---

## 🔎 Experimental React Scope Component API

This PR adds an experimental `React.unstable_createScope` for internal tests around focus management within React.

https://github.com/facebook/react/pull/16587

---

## 👏 69 First-Time Contributors

New contributors land their first PR in the [react](https://github.com/facebook/react) or [documentation](https://github.com/reactjs/reactjs.org) repository every week.

https://git.io/fjjVQ

---

Thank you for following along. See you in two weeks!

repository: kznmft/this-week-in-react

repo_name: kznmft/this-week-in-react


text:
# Messenger Bot

[![Known Vulnerabilities](https://snyk.io/test/github/sumtype/messenger-bot/badge.svg)](https://snyk.io/test/github/sumtype/messenger-bot)

A simple Node.js messenger bot for deployment on Heroku.  The "app" directory contains the "index.html" page served at the Heroku deployment URL.  The server folder contains the server files used to manage messages coming from and going to users.  The messenger bot uses Redis for managing ephemeral user data during chats.  Commands for specified responses can be found below, the default response contains the message sent.  The bot can also respond to postback and quick reply payloads.

### Required Environment Variables

To enable this bot to communicate via messenger you'll need to make sure the following environment variables are declared on your Heroku app.

* `FACEBOOK_ACCESS_TOKEN`
* `FACEBOOK_APP_ID`
* `FACEBOOK_GRAPH_MESSAGES_API_URL`
* `FACEBOOK_GRAPH_USER_API_URL`
* `FACEBOOK_PAGE_ID`
* `FACEBOOK_VERIFY_TOKEN`
* `REDIS_URL`
* `REDIS_USER_DATA_EXPIRATION_TIME`

Please refer to the messenger platform documentation to learn how to acquire these for your bot.  The ones which are specific to this bot are covered below.

##### `REDIS_USER_DATA_EXPIRATION_TIME`

This environment variable corresponds to the expiration time, in seconds, before a user's data is deleted from the Redis database after it has been added.  This data is added when the user's data cannot be found in the application's Redis instance when the user messages the bot.

##### `FACEBOOK_GRAPH_MESSAGES_API_URL`

This environment variable corresponds to the Facebook messages API URL used by the bot to send messages.  For example, "https://graph.facebook.com/v2.8/me/messages".

##### `FACEBOOK_GRAPH_USER_API_URL`

This environment variable corresponds to the Facebook user data API URL used by the bot to collect basic user data when the user sends a message to the bot (and their data is not already in the Redis database).  For example, "https://graph.facebook.com/v2.8".

### Messenger Commands

These are keywords you can use to cause specific message response types from the bot.

##### `list`

Sends back a list message.

##### `generic`

Sends back a generic message.

##### `quick reply`

Sends back a quick reply message.

repository: sumtype/messenger-bot

gha_language: JavaScript

repo_name: sumtype/messenger-bot


text:
# PHOENIX Datasets 🐦

## Introduction

[PHOENIX-2014](https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX/) and [PHOENIX-2014-T](https://www-i6.informatik.rwth-aachen.de/~koller/RWTH-PHOENIX-2014-T/) are popular large scale German sign language datasets developed by Human Language Technology & Pattern Recognition Group from RWTH Aachen University, Germany. This package provides a PyTorch dataset wrapper for those two datasets to make the building of PyTorch model on these two datasets easier.

## Installation

```bash
pip install git+https://github.com/enhuiz/phoenix-datasets
```

## Example Usage

### Dataset

```python
from phoenix_datasets import PhoenixVideoTextDataset

from torch.utils.data import DataLoader

dtrain = PhoenixVideoTextDataset(
    # your path to this folder, download it from official website first.
    root="data/phoenix-2014-multisigner",
    split="train",
    p_drop=0.5,
    random_drop=True,
    random_crop=True,
    base_size=[256, 256]
    crop_size=[224, 224],
)

vocab = dtrain.vocab

print("Vocab", vocab)

dl = DataLoader(dtrain, collate_fn=dtrain.collate_fn)

for batch in dl:
    video = batch["video"]
    label = batch["label"]
    signer = batch["signer"]

    assert len(video) == len(label)

    print(len(video))
    print(video[0].shape)
    print(label[0].shape)
    print(signer)

    break
```

### Evaluation

Go to `phoenix-2014-multisigner/evaluation/NIST-sclite_sctk-2.4.0-20091110-0958.tar.bz2` to install `sclite` (the official tool for WER calculation) first and then put it in your PATH.

```python
from phoenix_datasets.evaluators import PhoenixEvaluator

evaluator = PhoenixEvaluator("data/phoenix-2014-multisigner")
hyp = evaluator.corpus.load_data_frame("dev")["annotation"].apply(" ".join).tolist()
hyp[0] = "THIS SENTENCE IS WRONG"
results = evaluator.evaluate("dev", hyp)
print(results["parsed_dtl"])
print(results["sum"])
```

## Supported Features

- [x] Load the automatic alignments for PHOENIX-2014
- [x] Randomly/evenly frame dropping augmentation
- [x] Evaluation for Phoenix-2014
- [x] Language Model

## TODOs

- [ ] Implement Corpus and evaluation for PHOENIX-2014-T

repository: AidynUbingazhibov/phoenix-datasets

branch_name: refs/heads/main

repo_name: AidynUbingazhibov/phoenix-datasets


text:
---
layout: post
title:  "Back in the Rhythm"
date:   2016-04-28
tags: [site, blog, tabla]
---

Finally ... a post.

Today let's discuss one of my passions ... **Tabla**.

Tabla is a North Indian percussive instrument that is many centuries old. I've been learning tabla, on and off for about 7 years and it has slowly developed from a hobby to a passion over that course of time. The subtlety and tone of the tabla as an instrument is remarkable.

It's a percussive instrument like no other, with a uniquely identifying feature being that it has it's own language. Rarely do percussive instruments have a language let alone one as complex and structured as that of the tabla. It has it's own alphabet and grammar with a great many phrases and compositions that have developed over time.

*Here's a sample, played by a famous tabla maestro known as Ustad Zakir Hussain*

I will talk more about the tabla in later posts. This post was just to get an introduction to the instrument and what it's about.

**P.S.**: I know that I've been delayed in my posts, however, I'm going to venture to post something once every week. Whether it is thoughts, opinions or cool things I've seen.

branch_name: refs/heads/develop


text:
Notebooks
==============

We prepared a gallery of notebooks to showcase the applicability of the package to different economic problems.

* Kolmogorov Forward Equations: [View](https://nbviewer.jupyter.org/urls/github.com/QuantEcon/SimpleDifferentialOperators.jl/releases/download/TAG_GOES_HERE/KFE.ipynb) and [download](https://github.com/QuantEcon/SimpleDifferentialOperators.jl/releases/download/TAG_GOES_HERE/KFE.ipynb)

* Optimal Stopping Problems: [View](https://nbviewer.jupyter.org/urls/github.com/QuantEcon/SimpleDifferentialOperators.jl/releases/download/TAG_GOES_HERE/LCP_simple.ipynb) and [download](https://github.com/QuantEcon/SimpleDifferentialOperators.jl/releases/download/TAG_GOES_HERE/LCP_simple.ipynb)

* Optimal Stopping Problems with Jump Diffusion: [View](https://nbviewer.jupyter.org/urls/github.com/QuantEcon/SimpleDifferentialOperators.jl/releases/download/TAG_GOES_HERE/LCP_jump_diffusion.ipynb) and [download](https://github.com/QuantEcon/SimpleDifferentialOperators.jl/releases/download/TAG_GOES_HERE/LCP_jump_diffusion.ipynb)

* Computational Appendix for Optimal Stopping Problems: [View](https://nbviewer.jupyter.org/urls/github.com/QuantEcon/SimpleDifferentialOperators.jl/releases/download/TAG_GOES_HERE/LCP_advanced.ipynb) and [download](https://github.com/QuantEcon/SimpleDifferentialOperators.jl/releases/download/TAG_GOES_HERE/LCP_advanced.ipynb)

gha_language: Julia


text:
# Exception handling (exception-handling)

## Rule Details

Examples of **incorrect** code for this rule:

```js

```

Examples of **correct** code for this rule:

```js
```

## Further Reading

repository: pksilen/eslint-plugin-clean-code

repo_name: pksilen/eslint-plugin-clean-code


text:
---
title: Sell Online
date: 2018-11-18T12:33:46+10:00
draft: false
featured: true
weight: 1
---

# Increase your sales by selling online to your nearby customers. Use our customer facing brand Alluzo to create your online ship in the [Alluzo App](https://play.google.com/store/apps/details?id=com.ekeekaran.commune&hl=en). Give a professional delivery experience with order tracking to your customers using our[Delivery App](https://play.google.com/store/apps/details?id=com.ekeekaran.alluzo.delivery&hl=en).\
\
How to set up your online shop ?\
\
1. Download RaseedBook App\
2. From Profile select “Take Online Orders” then WhatsApp Us.\
3. Our team will connect with you.

## Create Catalog

## Create &manage your catalog yourself, no interference or long wait to update your menu or item list. Add unlimited products to your catalog. Decide the sequence of how items will be visible to customers, add image & more.\
\
You can easily add\
1. Item List\
2. Item Price\
3. Item Category\
4. Item Image\
5. Item Description\
6. Item GST (Coming Soon)\
7. Packaging cost and other miscellaneous charges.

How to create your Catalog

1. Go to Category in items
2. Add your categories
3. Got to Product in items
4. Add products add your item name & price
5. Choose the category item belongs to & add descriptions

## Set Up Online Ordering

Our team will connect you and set up your online shop. We will ask following informations\
1. Shop Location

2. Radius around which you can deliver - Eg 1km, 3km\
3. Minimum Order Amount - Eg Rs 150 , Rs 250

4. Delivery Fee - Eg Rs 5, Rs 10

5. Available modes to accept Payment - Eg Cash, PayTm, UPI etc\
6. Expected Delivery Time - Eg 30 minutes, 2 hours, next day delivery

You can add orders wise GST, packaging cost, shop description and other miscellaneous cost in business details under profile tab.

We will confirm these details and publish your online shop on Alluzo App quickly

## Start Taking Online Orders

## \
Turn on the toggle on the top of the order screen to green and start taking online orders. Alternatively, you can set up shop timing in the profile segment to automatically close and open your shop at specific time.\
\
Once a customer places an online it provides information about items ordered, customer name, phone number & delivery address.\
\
How to open your shop and set up shop timing?

1. ## Go to shop timing in profile
2. ## Create Shop Timing
3. ## Select time corresponding to days
4. ## Save you shop timing

## Manage all Orders Easily

Writing orders down on a piece of paper is efficient and all but what if you could organize your in-store and online orders in one place?

RaseedBook organizes orders by status (pending or confirmed) and by type (in-store or online). Details such as delivery or pick up, as well as customer information and amount, are displayed in one easy-to-understand screen.

* Unlimited orders;
* Transaction history;
* Real-time sync across all devices;
* Secure;
* No commissions.

How to Manage orders?

1. Tap on New Bill to generate an in-shop bill
2. Accept or reject incoming online orders
3. Order under preparation are under processing tab
4.  Order under dispatch are under completed tab
6. Completed orders are stored under past orders tab

## Mark item out of Stock -

Fearful that customers will order items which are out of stock, no worries. Our powerful reports and analytics help you keep tap items sold daily. Using this you can easily mark an item out of stock. You can also mark items available or delete them in bulk.

How to Mark items out of stock.

1. Go to product in item segment
2. Turn off the toggle to mark a product out of stock
3. Long press to bulk activate or disable products
4. Use search bar to quickly reach any item

repository: alluzo/raseedbook-website-hugo

repo_name: alluzo/raseedbook-website-hugo


text:
This repository is a collection of assorted documentation & notes about CoreCLR. Topics include

* Tips and tricks for working with the various components of DotNet Core (CoreCLR)
* Notes about architecture, layout, and code.
* Definitions of jargon.
* Anything else that might be helpful to someone else contributing to the project.

Hope you find this helpful. Additions are welcome. Simply open an issue or
submit a pull request.

repository: ezephir/dotnetcore-notes

repo_name: ezephir/dotnetcore-notes


text:
# lein-dependency-check

A Leiningen plugin for detecting vulnerable project dependencies. Basic clojure wrapper for [OWASP Dependency Check](https://www.owasp.org/index.php/OWASP_Dependency_Check).

## Configuration

### As a User-Level Plugin:

To run dependency-check without having to add it to every Leiningen project as a project-level plugin,
add dependency-check to the `:plugins` vector of your `:user` profile. E.g., a `~/.lein/profiles.clj` with dependency-check as a plugin -
```
{:user {:plugins [[com.livingsocial/lein-dependency-check "1.4.0"]]}}
```

If you are on Leiningen 1.x do `lein plugin install lein-dependency-check 1.4.0`.

### As a Project-Level Plugin:

Add `[com.livingsocial/lein-dependency-check "1.4.0"]` to the `:plugins` vector of your project.clj.

Project-level configuration may be provided under a `:dependency-check` key in your project.clj. Currently supported options are:
 * `log` log each vulnerability found to stdout
 * `throw` throw an exception after analysis and reporting if vulnerabilities are found, eg. to fail a build
 * `min-cvss-v3` minimum [CVSSv3](https://nvd.nist.gov/vuln-metrics/cvss) score required to `:throw` (number from 0.0 to 10.0), defaults to 0.0
 * `properties-file` Specifies a file that contains properties to merge with default values
 * `output-format` Vector of desired output formats: xml, csv, json, html, vuln, all
 * `output-directory` Directory to output results to
 * `suppression-file` Path to the suppression XML file

## Usage

To generate a `dependency-check-report.html` report file to the current project's `target` directory, run:

    $ lein dependency-check

To generate the report in XML format, run:

    $ lein dependency-check --output-format :xml

To generate the report in multiple formats, run:

    $ lein dependency-check --output-format :xml,:json,:html,:csv

To write the report to a different directory (e.g., `/tmp`), run:

    $ lein dependency-check --output-directory /tmp

To set logging to stdout:

    $ lein dependency-check --log

To set throw error when vulnerabilities found:

    $ lein dependency-check --throw

To only throw if there are vulnerabilities with or above a given CVSSv3:

    $ lein dependency-check --throw --min-cvss-v3 5

To set a suppression file:

    $ lein dependency-check --suppression-file /suppression.xml

To set a properties file:

    $ lein dependency-check --properties-file /dependencycheck.properties

##  Suppressing False Positives

Support for suppressing false positives can be utilized by creating `suppression.xml` in your project's root directory.

Suppression snippets can be copied from the HTML report file directly into `suppression.xml`. Upon rerun of `lein-dependency-check`, the suppression file will be used and warnings will not be present in report.

For more information about dependency-check suppression system see https://jeremylong.github.io/DependencyCheck/general/suppression.html

## License

Copyright © 2016 LivingSocial

Distributed as open source under the terms of the [MIT
License](http://opensource.org/licenses/MIT).

repository: livingsocial/lein-dependency-check

gha_language: Clojure

repo_name: livingsocial/lein-dependency-check


text:
# Wind Energy Harvesting with Reinforcement Learning

This repository contains the implementation regarding the work on wind energy production by means of airborne technologies and reinforcement learning.

* In the ```Dynamics``` folder you can find the 2D adn 3D dynamical models of an airborne device (kite) attached to the ground with a tether

* In the ```Learning``` folder you can find the implementation of the sarsa algorithm to perform the learning of the device

## Examples:

![kite3d_gif](https://user-images.githubusercontent.com/32459554/112458379-03ca5a00-8d5d-11eb-8611-d9414d7d4be4.gif)

[Link to complete youtube video](https://www.youtube.com/watch?v=Bk5FHeSUWg4)

Read my thesis [here](https://github.com/nicoleorzan/kite-power/blob/master/Wind_Energy_Harvesting_with_Reinforcement_Learning.pdf)

### Contributors:

- [Nicole Orzan](http://github.com/nicoleorzan)
- [Claudio Leone](https://github.com/LionClaude)

repository: WildGenie/kite-power

repo_name: WildGenie/kite-power


text:
# Querying QLDB as C# Types

In addition to executing statement queries against QLDB which return an Ion Value, `IIonValue`, the driver also provides the interface method `public Generic.IResult<T> Execute<T>(IQuery<T> query);`.

This interface is designed to completely bypass the need to work with Ion by allowing native C# types to be passed in as parameters as well as returning C# native types, which the generic type is.

### Basic Usage Example

```c#
using System;
using Amazon.QLDB.Driver;
using Amazon.QLDB.Driver.Generic;
using Amazon.QLDB.Driver.Serialization;

namespace Example
{
    public class Person
    {
        public string Name { get; init; }

        public int Age { get; init; }
    }

    class Example
    {
        static void Main(string[] args)
        {
            // ISerializer implementation we provide
            ISerializer serializer = new ObjectSerializer();

            IQldbDriver driver = QldbDriver.Builder()
                .WithLedger("vehicle-registration")
                .WithSerializer(serializer)
                .Build();

            Person myPerson = driver.Execute(txn =>
            {
                // Creating a query with native C# type parameters specifying the expected output type Person
                IQuery<Person> myQuery = txn.Query<Person>("SELECT * FROM People WHERE Age = ?", 21);

                // Execute the created query
                IResult<Person> myResult = txn.Execute(myQuery);

                foreach (var Person in myResult)
                {
                    return Person;
                }
                return null;
            });

            // myPerson and its properties are directly returned from QLDB now as C# types instead of IIonType.
            Console.WriteLine(myPerson.Name);
        }
    }
}
```

### ISerializer

In the above example, this library provided an `ISerializer` to the driver, which `txn.Query` uses to create an `IQuery`. The `ObjectSerializer` is a wrapper around the [Amazon Ion Object Mapper](https://github.com/amzn/ion-object-mapper-dotnet) with default settings which supports the following [primitive type conversions](https://github.com/amzn/ion-object-mapper-dotnet/blob/main/SPEC.md#primitive-type-conversion). If desired, a custom implementation can be used as long as it implements the `ISerializer` interface.

```c#
public interface ISerializer
{
    /// <summary>
    /// Serialize a C# object into a ValueHolder object containing the Ion binary or text value.
    /// </summary>
    ///
    /// <param name="o">The C# object to be serialized into ValueHolder.</param>
    ///
    /// <returns>The ValueHolder object containing the Ion binary or text value.</returns>
    ValueHolder Serialize(object o);

    /// <summary>
    /// Deserialize a ValueHolder object containing the Ion binary or text value into an object of type T.
    /// </summary>
    ///
    /// <param name="s">The ValueHolder object to be deserialized into an object of type T.</param>
    /// <typeparam name="T">The return type.</typeparam>
    ///
    /// <returns>The object of type T.</returns>
    T Deserialize<T>(ValueHolder s);
}
```

However, as implementing a fully-functioning `ISerializer` is challenging, it is *highly recommended* to instead utilize the `IonSerializer` in the Amazon Ion Object Mapper mentioned above. It is highly configurable and can be wrapped to call it's own `Serialize` and `Deserialize<T>` methods to satisfy the interface of a custom `Iserializer`.

### IQuery

In the Basic Usage Example, it is shown that `txn.Execute<T>(IQuery<T> query)` is used to return an `IResult<T>` where `T` is the type determined by the `IQuery` parameter. `txn.Query` was used to generate this, using the `ISerializer` that was passed into the builder for the driver. If a different `ISerializer` is desired for a specific `IQuery`, it is possible to do so.

```c#
using System;
using Amazon.IonDotnet;
using Amazon.IonDotnet.Builders;
using Amazon.QLDB.Driver;
using Amazon.QLDB.Driver.Generic;
using Amazon.QLDB.Driver.Serialization;
using Amazon.QLDBSession.Model;

namespace Example
{
    public class AgeAsStringQuery : IQuery<string>
    {
        public string Statement => "SELECT VALUE Age from People";

        public ValueHolder[] Parameters => Array.Empty<ValueHolder>();

        public string Deserialize(ValueHolder ionValueHolder)
        {
            IIonReader reader = IonReaderBuilder.Build(ionValueHolder.IonBinary);
            reader.MoveNext();
            return reader.IntValue().ToString();
        }
    }

    class Example
    {
        static void Main(string[] args)
        {
            // ISerializer implementation we provide but will not be used
            ISerializer serializer = new ObjectSerializer();

            IQldbDriver driver = QldbDriver.Builder()
                .WithLedger("vehicle-registration")
                .WithSerializer(serializer)
                .Build();

            string myAge = driver.Execute(txn =>
            {
                // Custom IQuery implementation
                IQuery<string> myQuery = new AgeAsStringQuery();

                // Execute the created query
                IResult<string> myResult = txn.Execute(myQuery);

                foreach (var age in myResult)
                {
                    return age;
                }
                return null;
            });

            // The custom query returns the age as a string despite the type being an Ion Integer
            Console.WriteLine(myAge);
        }
    }
}
```

repository: awslabs/amazon-qldb-driver-dotnet

gha_language: C#

repo_name: awslabs/amazon-qldb-driver-dotnet


text:
## Flash Fiction

***

Fiction which is faster to write and faster to read, for the busy ones among us.

***

#### 1. Edge

"Marty, don't walk near the edge. Haven't you heard the stories?" a worried Juna questioned.

Marty knew well the risks of playing near the Edge, but he was was a carefree soul.

"Calm down, Juna. Nothing ever hap-" before he could complete the sentence a feather from Marty's left wing touched the edge. And the very next instant, his wings completely burnt off.

Juna left the scene screaming, calling for help. But hardly anyone ever visited the edge. Marty was in bad luck today. He lay there with remnants of his wings still on his back, as black as charcoal with only the thin skeletal part still holding onto whatever was left. Crawling away from the edge, slowly, Marty left a trail of tears on his way back to the safe zone.

In a nearby tree's shadow, he was gasping his final breath. No one ever lived long enough with their wings gone. Marty was no exception. He died moments later. Juan reached there late. Broken, she never went back to the Edge.

The edge had consumed another victim. Marty was now a part of the Edge's ever burning world. A world far away and unforgiven compared to the gentle, windy world he had grown up on. With an inextinguishable fire burning in his eyes, he entered through the door, to begin his journey on the otherside of the Edge.

___


text:
# What is Concourse?

> Concourse is an open-source continuous thing-doer.

Concourse is a CI/CD tool that is configurable with a simple YAML file.

---

## Creating the "Hello World" Resource Type

### Pre-Requisities

Follow the steps on https://concourse-ci.org/ to install Fly & Concourse.
If this is your first time checking out Concourse, I would highly recommend reviewing the tutorials & docs they have posted.

### Exploring a basic Resource Type

You can follow along using or (fork my repo)[https://github.com/thehandsomezebra/concourse-resourcetype-helloworld].

A concourse `resource_type` works well using a minimum of 4 files:

```
+-- resource
|   +-- check
|   +-- in
|   +-- out
+-- Dockerfile
```

Each of the scripts are required to have the output of its execution in json appropriate format.

Let's walk thru each file at a high level and get everything set up!

---

### check
The check file is going to check for new versions.

The check script we will report back a message of Hello World.
```
#!/bin/bash
set -eu
set -o pipefail
echo '[{ "revision": "N/A",  "message": "The check script says Hello World!" }]'
```

---

### in

This fetches the given resource.

For the In script, let's add some metadata.  This metadata will be viewable in a few places in the pipeline.
```
#!/bin/bash
set -eu
set -o pipefail
echo '{ "version": { "revision": "N/A", "message": "The in script version message says Hello World" }, "metadata": [{ "name": "message", "value": "The in script metadata message says Hello World." }] }'

```

---

### out

For the Out script, let's get a little more complex.  We'll be getting a variable `greeting` from the pipeline, and let's echo it out.
We'll be using jq to grab it from the params that get passed via the pipeline.

```
#!/bin/bash
echo '{ "version": { "revision": "N/A", "message": "The out script version message says Hello World" }, "metadata": [{ "name": "message", "value": "The out script metadata message says Hello World." }] }'

set -e -u

exec 3>&1 # make stdout available as fd 3 for the result
exec 1>&2 # redirect all output to stderr for logging

echo "Echo says hi from the out script!" >&2

source=$1

if [[ -z "$source" ]]; then
  echo "usage: $0 <path/to/source>"
  exit 1
fi

# for jq
PATH=/usr/local/bin:$PATH

export TMPDIR=${TMPDIR:-/tmp/rclone}
mkdir -p "${TMPDIR}"

payload=$(mktemp "$TMPDIR/resource-request.XXXXXX")
cat > "$payload" <&0

greeting=$(jq -r '.params.greeting // ""' < "$payload")
echo "Param greeting says: $greeting" >&2
```

---

### Dockerfile

This Dockerfile will be short and sweet.

- Spins up a tiny Alpine Linux instance
- Loads in bash & jq
- Adds in our script files to the /opt/resource folder
- Makes those files executable
- Specifies that we will be running bash in root

```
FROM alpine:3.13

RUN apk add --update --upgrade --no-cache bash

RUN apk update \
    && apk upgrade \
    && apk add --update bash curl unzip jq

ADD resource/ /opt/resource/
RUN chmod +x /opt/resource/*

WORKDIR /
ENTRYPOINT ["/bin/bash"]
```

---

### One last file to get it running: the pipeline yaml file

This file does not need to be in the docker - but it's inluded in my repo, so you can follow along.

**Create a file called hello-pipeline.yml**

```
resource_types:
- name: helloworld
  type: docker-image
  source:
    # set repo of your helloworld resource
    #repository: Your-Docker-Acct/Your-Docker-Repository
    ## or use my helloworld resource
    repository: thehandsomezebra/concourse-test

resources:
- name: helloworld
  type: helloworld

jobs:
- name: hello-job
  plan:
  - get: helloworld
  - put: put-helloworld
    resource: helloworld
    inputs:
         - helloworld
    params:
      greeting: "Hey y'all!"
```

This is going to create a new pipeline called hello-job that will `get` the `in` and `put` the `out`.

# Get it running
Following the steps above, create a github repo ([or fork mine](https://github.com/thehandsomezebra/concourse-resourcetype-helloworld)) & create a docker hub repo. It's fast to connect your github repo to docker and even set it up to autobuild ([learn more about that here](https://docs.docker.com/docker-hub/builds/))).

Once your repo is ready in Docker Hub, let's start the concourse pipeline by using this line

Let's start the hello-world pipeline!
Run the following in your terminal.

```
fly -t ci set-pipeline -c hello-pipeline.yml -p hello-world
```
_`ci` will be the name of your target (if you followed a the tutorial, it might be named `tutorial` or `example`)_

If we look at the pipeline diagram, we can also see the result of the `check` step in the box with the dashed lines (dependency - trigger).

![screenshot2](/screenshot2.png)

Checking our job, we can see our messages in each of the stages.

![screenshot1](/screenshot1.png)

There's a lot you can do creating your own resource types for concourse - be sure to [check out the Resource Types catalog](https://resource-types.concourse-ci.org/), [contribute to the community](https://github.com/concourse/resource-types/blob/master/README.md) and get assistance (or lurk thru questions that have been already answered) in [Discord in the #resource-types channel](https://discord.gg/MeRxXKW).

_Note: I'm not affiliated with Concourse - I am just a nerd that is fascinated by the continuous thing-doer continuously doing things._

---
#### Sources:

- https://concourse-ci.org/implementing-resource-types.html
- https://github.com/concourse/resource-types/blob/master/README.md
- https://github.com/concourse/concourse/wiki/Tutorials


text:
# Clustering-Algorithms
Hierarchical clustering algorithm that uses no libraries for the calculation parts, made in Python.
- Uses matplotlib for visualising data
- Codes are under folder modules
- main.py runs an example clustering
- class_definitions contain 2 class definitions and one function used for class methods
- functional_functions include the main clustering functions
- utility_functions include functions used for functional_functions

- To run, download modules, open main.py and execute
- Requirements: matplotlib


text:
# Server

```js
Server({
  // The return value of Game().
  game: game,

  // The number of players.
  numPlayers: 2,
})
```

Creates a `boardgame.io` server. This is only required when
`multiplayer` is set to `true` on the client. It creates a
[Koa](http://koajs.com/) app that keeps track of the game
states of the various clients connected to it, and also
broadcasts updates to those clients so that all browsers
that are connected to the same game are kept in sync in
realtime.

Notice that `game` is the same object that you also pass
to the `Client` call.

### Arguments
1. obj(*object*): A config object with the options shown above.

### Returns
(`app`): A Koa app.

### Usage

```js
const Server = require('boardgame.io/server');

const app = Server({
  ...
});

app.listen(8000);
```


text:
---
layout: creature
name: "Grisha"
tags: [medium, humanoid, cr2, out-of-the-abyss]
cha: 16 (+3)
wis: 14 (+2)
int: 11 (0)
con: 12 (+1)
dex: 12 (+1)
str: 14 (+2)
size: Medium humanoid (damaran human)
alignment: chaotic evil
challenge: "2 (450 XP)"
languages: "Common, Undercommon"
skills: "Persuasion +5, Religion +2"
saving_throws: "Wis +4, Cha +5"
speed: "30 ft."
hit_points: "33 (6d8+6)"
armor_class: "18 (chain mail, shield)"
---

***Spellcasting.*** Grisha is a 6th-level-spellcaster. His spellcasting ability is Wisdom (spell save DC 12, +4 to hit with spell attacks). He has the following cleric spells prepared:

* Cantrips (at will): guidance, light, sacred flame, thaumaturgy

* 1st level (4 slots): cure wounds, divine favor, inflict wounds, protection from good, shield of faith

* 2nd level (3 slots): continual flame, hold person, magic weapon, spiritual weapon

* 3rd level (3 slots): bestow curse, dispel magic, spirit guardian

### Actions

***Multiattack.*** Grisha makes two attacks with his +1 flail.

***+1 Flail.*** Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit:7 (1d8 + 3) bludgeoning damage

gha_language: CSS

gha_license_id: NOASSERTION


text:
Building for Linux    {#corgi_guide_building_linux}
==================

# Version Requirements

[CORGI][] is known to build with the following tool versions:

-   [cmake][]: 2.8.12

# Before Building    {#building_linux_prerequisites}

Prior to building, install the following components using the [Linux][]
distribution's package manager:

-    [cmake][] (You can also manually install from [cmake.org][].)

For example, on Ubuntu:

    sudo apt-get install cmake

# Building

-   Generate makefiles from the [cmake][] project in the `corgi` directory.
-   Execute `make` to build the library and sample.

For example:

    cd corgi
    cmake -G'Unix Makefiles'
    make

To perform a debug build:

    cd corgi
    cmake -G'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug
    make

Build targets can be configured using options exposed in
`corgi/CMakeLists.txt` by using cmake's `-D` option.
Build configuration set using the `-D` option is sticky across subsequent
builds.

For example, if a build is performed using:

    cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug
    make

to switch to a release build CMAKE_BUILD_TYPE must be explicitly specified:

    cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
    make

# Executing the Sample

After building the project, you can execute the sample from the command line.
For example:

    ./bin/entity_component_system_sample

<br>

  [cmake]: http://www.cmake.org/
  [cmake.org]: http://www.cmake.org/
  [CORGI]: @ref corgi_index
  [Linux]: http://en.wikipedia.org/wiki/Linux

repository: pulcheri/corgi

repo_name: pulcheri/corgi


text:
Lies of Astaroth
================

Lies of Astaroth Battle Simulator

Developed By
============

* cfvbaibai

License
=======

    Copyright 2015 CfvBaibai

    Licensed under the BSD License;
    you may not use this file except in compliance with the License.

Compilation Dependencies
========================

	- JDK 1.8
	- MAVEN 3.2

To start with, go into /workspace folder and run

    mvn clean install

WAR output could be find under %MAVEN_REPOSITORY%/cfvbaibai/mkhx.web/1.0 folder.

Runtime Dependencies
=======================
    - Tomcat 8.0

Eclipse Workspace Supported
===========================
	- Workspace folder: /workspace
	- Tomcat 8.0 server plugin required

repository: cfvbaibai/CardFantasy

repo_name: cfvbaibai/CardFantasy


text:
**Move bot by discord.py**\
Bot help you to move and kick users in your server.\
If you have some permission on server you can use this script too.\
Script work with client.run(discord.py) so you should familiarize yourself with:\
`*Warning:
This function must be the last function to call due to the fact that it is blocking. That means that registration of events or anything being called after this function call will not execute until it returns. `\
Well you work with it at your own risk.

**Instruction:**\
Firstly, you need to make new directory and put .exe to this dir.\
Secondly, create a token.txt file and write in a first line your token. Great, run it.)


text:
## Dependency Injection

* [Pimple](http://pimple.sensiolabs.org/)
* [Container](https://github.com/thephpleague/container)

repository: eddiejaoude/php-useful-resources

repo_name: eddiejaoude/php-useful-resources


text:
naifdsk
=======

Misc tools for working with NAIF/SPICE DS-Kernels (shape models)

- see [http://naif.jpl.nasa.gov/pub/naif/misc/alpha_dsk/] and
  [http://naif.jpl.nasa.gov/pub/naif/misc/alpha_dsk/DSK_alpha_test.pdf]

Manifest
========

dsk2mslinsert.c

- Converts DSK to STK .MDL file, or to VRML .WRL file

Makefile

- simple makefile; needs directory or symlink path to SPICE toolkit
  alpha_dsk_c/

test_dskv02.c

- Implementation of sample code from comments in SPICE/DSK toolkit
  subroutine dskv02_c.c

repository: drbitboy/naifdsk

repo_name: drbitboy/naifdsk


text:
# Audius

Web app

and extension

are in the making

## Keyboard shortcuts

c

Play / pause

b

Next song

s

Shuffle on / off

j

Jump to song

f

Find song on YouTube

## Community

If you have questions or feedback, join the chat on gitter or [create an issue](https://github.com/select/audius/issues).

[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/audius-player/Lobby)

## Install as app

**Chrome desktop:**

1.  At the top right, click _More_ (Icon top right).
2.  Click _More Tools_.
3.  Add the app:
    Windows users: Click _Add to taskbar_.
    Linux users: Click _Add to desktop_.
    Chromebook users: Click _Add to shelf_.

**Chrome android:**
Tap the menu button and tap _Add to homescreen_. The app is not yet optimized for mobile phones, it might work on tables.

**Local HTML5:**
Since this player is a pure HTML5 app without server side code you can simply download the HTML and JS code and run it from a local file. You can also download the latest version from the source code repository at github (see [Source code](#source-code)). Use the web version to always get the latest updates automatically. A word of caution: I recognized that using this app from a local file block$ a lot of videos on YouTube :(

Web apps are true freedom! Support an open and liberal web without geo borders and login screens.

## System requirements

*   [Vivaldi](https://vivaldi.com/download/)
*   Chrome >= 51
*   FireFox >= 49
*   Internet Explorer & Safari ... not supported, might work though

## Extension

... development started, but now stopped until the main app is ready.

The Audius extension allows you to open a music player on any website. It will then automatically collect all linked videos and add it to a playlist similar to the one in this app. The videos will still be played in this app due to [restrictions of some websites](#motivation). This setup allows you to create a "Music" chat group on Whatsapp or Slack and have fresh music from your friends every day playing right where you share it. You can then continue and add this music to you regular playlist with a simple click.

## Migration from Streamus

On Linux use [this script](https://github.com/select/audius/blob/master/src/scripts/streamus-export.sh) I created to dump the Streamus WebSql to a JSON file. The JSON can be imported using the IMPORT button below the playlist. Use the script like this:

```
./streamus-export.sh ~/.config/google-chrome/Profile\ 1/Local\ Storage/chrome-extension_jbnkffmindojffecdhbbmekbmkkfpmjd_0.localstorage
```

Be sure to validate the JSON output, the script is just a quick hack and you might have to tweak it.

## Other Projects

Here are some other fun projects I created this year.

*   [Boom, next video!](https://github.com/select/boomnext/)
*   [ッ Emoji-text](http://emoji-text.com/)
*   [FantasyPlanet](https://www.fantasyplanet.de/)
*   ...

## Motivation

You are writing another music player, seriously? That's what I thought a lot when creating this, but you know ...

The extension should have been the actual player since the original idea was to create a Chrome/FireFox extension with a media player for _web.whatsapp_. This however failed since the conten security policy does not allow the embdding of youtube videos and somehow it is not possible to overwrite the header fields of web.whatsapp. That meant no player, no music. The only way around this issue I could come up with is to create a background process that the extension cummunicates with and that sends messages to a main player web app. This is currently still untested but that is the plan.

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3.  Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## Credits

This work is inspired by the incredible [Streamus](https://www.reddit.com/r/streamus/) app.
It was created with:

*   VueJs
*   Redux
*   Icomoon
*   Google material icons
*   Webpack
*   LivingStyleGuide

## History

... still working on version 0.0.1

## License

MIT


text:
# first-npm-module

[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)

test

## Usage

[![NPM](https://nodei.co/npm/first-npm-module.png)](https://www.npmjs.com/package/first-npm-module)

## License

MIT, see [LICENSE.md](http://github.com/ksomville/first-npm-module/blob/master/LICENSE.md) for details.


text:
* Ticket triage
  * 398 tickets total +2
  * 43 pull requests +2
* Button
  * Jörn reviewed [latest updates](https://github.com/jquery/jquery-ui/pull/1333), especially controlgroup needs more work
  * Alex to work on backcompat for button options, put it on wiki first
* Controlgroup
  * Needs extensibility for which widgets to manage
* Datepicker
  * Scott did first round of review for [PR 1316](https://github.com/jquery/jquery-ui/pull/1316)
  * [new PR](https://github.com/jquery/jquery-ui/pull/1352)
  * [Use `x - 1` for months?](https://github.com/fnagel/jquery-ui/commit/0f431a683968e9e9d30120eb3bf09a3f13da8814#commitcomment-7923265) - yes!
* Widget Factory
  * [Data sources as options](http://bugs.jqueryui.com/ticket/10623)
  * Already possible via array or custom object
  * Leave as is.
* Globalize
  * Cldr data as versioned (peer) dependency
  * [Npm's cldr-data](https://github.com/rxaviers/cldr-data-npm) and [Bower's cldr-data](https://github.com/rxaviers/cldr-data-bower) has been created to address that. We've adopted it on Globalize and so santhoshtr did on santhoshtr/CLDRPluralRuleParser. Yahoo didnt reply about it yet. [Ongoing discussion](https://github.com/ibm-js/ecma402/pull/68) about it on ibm-js/ecma-402 polyfil
  * Creating API site... via https://github.com/jquery/api.globalizejs.com and the globalize branch on https://github.com/jquery/jquery-wp-content
  * [Working on ICU MessageFormat support](https://github.com/jquery/globalize/pull/321)
  * [Discussing naming of Cldrjs module](https://github.com/rxaviers/cldrjs/issues/7)
* Classes option
  * [Alex to work on _setOptions() support](https://github.com/jquery/jquery-ui/pull/790)
1.11.2
  * Ready to release after tooltip PR lands
* Menu
  * [Menu item wrapper PR ready for review](https://github.com/jquery/jquery-ui/pull/1342)


text:
Checks for presence or absence of braces around hash literal as a last
array item depending on configuration.

### Example: EnforcedStyle: braces (default)
    # bad
    [1, 2, one: 1, two: 2]

    # good
    [1, 2, { one: 1, two: 2 }]

### Example: EnforcedStyle: no_braces
    # bad
    [1, 2, { one: 1, two: 2 }]

    # good
    [1, 2, one: 1, two: 2]

repository: filipesperandio/codeclimate-standard

repo_name: filipesperandio/codeclimate-standard


text:
# Dense Head Pose Estimation: Towards Fast, Accurate and Stable 3D Dense Face Alignment

![FaceReconstructionDemo](https://s3.ax1x.com/2021/01/06/sZVyhq.gif)

[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/1996scarlet/Dense-Head-Pose-Estimation.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/1996scarlet/Dense-Head-Pose-Estimation/context:python)
[![License](https://badgen.net/github/license/1996scarlet/Dense-Head-Pose-Estimation)](LICENSE)
[![ECCV](https://badgen.net/badge/ECCV/2020/red)](https://www.ecva.net/papers/eccv_2020/papers_ECCV/html/3162_ECCV_2020_paper.php)

Reimplementation of [(ECCV 2020) Towards Fast, Accurate and Stable 3D Dense Face Alignment](https://github.com/cleardusk/3DDFA_V2) via Tensorflow Lite framework, face mesh, head pose, landmarks, and more.

* CPU real-time face deteciton, alignment, and reconstruction pipeline.
* Lightweight render library, 5x faster (3ms vs 15ms) than the [Sim3DR](https://github.com/cleardusk/3DDFA_V2/tree/master/Sim3DR) tools.
* Camera matrix and dense/sparse landmarks prediction via a single network.
* Generate facial parameters for robust head pose and expression estimation.

## Setup

### Basic Requirements

* Python 3.6+
* `pip3 install -r requirements.txt`

### Render for Dense Face

* GCC 6.0+
* `bash build_render.sh`
* **(Cautious)** For Windows user, please refer to [this tutorial](https://stackoverflow.com/questions/1130479/how-to-build-a-dll-from-the-command-line-in-windows-using-msvc) for more details.

## 3D Facial Landmarks

In this project, we perform dense face reconstruction by 3DMM parameters regression.
The regression target is simplified as camera matrix (**C**, shape of 3x4), appearance parameters (**S**, shape of 1x40), and expression variables (**E**, shape of 1x10), with 62 dimensions in total.

The sparse or dense facial landmarks can be estimated by applying these parameters to a predefined 3D model, such as [BFM](https://faces.dmi.unibas.ch/bfm/main.php?nav=1-1-0&id=details).
More specifically, the following formula describes how to generate a face through parameters:

where **U** and **W** are from pre-defined face model.
Combine them linearly with parameters to generate sparse or dense faces.
Finally, we need to integrate the pose parameters **C**, into the result:

where **R** (shape 3x3) and **T** (shape 3x1) denote rotation and translation matrices, respectively, which are fractured from **C**.

### Sparse

``` bash
python3 demo_video.py -m sparse -f <your-video-path>
```

### Dense

Currently, our method supports up to 38,365 landmarks.
We draw landmarks every 6 indexes for a better illustration.
Run the demonstrate script in **dense** mode for real-time dense facial landmark localization:

``` bash
python3 demo_video.py -m dense -f <your-video-path>
```

## Head Pose and Expression

## Face Mesh Reconstruction

``` bash
python3 demo_video.py -m mesh -f <your-video-path>
```

| Scheme | THREAD=1 | THREAD=2 | THREAD=4 |
| :-: | :-: | :-: | :-: |
| Inference  | 7.79ms  | 6.88ms | 5.83ms |

``` bash
python3 video_speed_benchmark.py <your-video-path>
```

| Stage | Preprocess | Inference | Postprocess | Render |
| :-: | :-: | :-: | :-: | :-: |
| Each face cost  | 0.23ms  | 7.79ms | 0.39ms | 3.92ms |

![HeadPoseLogo](https://s3.ax1x.com/2021/01/06/sZV0BQ.jpg)

## Citation

``` bibtex
@inproceedings{guo2020towards,
    title={Towards Fast, Accurate and Stable 3D Dense Face Alignment},
    author={Guo, Jianzhu and Zhu, Xiangyu and Yang, Yang and Yang, Fan and Lei, Zhen and Li, Stan Z},
    booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
    year={2020}
}
```

repository: rena-ganba/Dense-Head-Pose-Estimation

repo_name: rena-ganba/Dense-Head-Pose-Estimation


text:
# Home Credit Default Risk
Can you predict how capable each applicant is of repaying a loan?

| Name | Type  | Public Kernel |Metric | Date |
| ------ | ------ | ------ | ------ | ------ |
| [Home Credit Default Risk](https://www.kaggle.com/c/home-credit-default-risk) | Classification | [Exploratory Data Analysis-GBM Model](https://www.kaggle.com/sudhirnl7/exploratory-data-analysis-gbm-model) | AUC | May 2018 |

Many people struggle to get loans due to insufficient or non-existent credit histories. And, unfortunately, this population is often taken advantage of by untrustworthy lenders.
Home Credit strives to broaden financial inclusion for the unbanked population by providing a positive and safe borrowing experience. In order to make sure this underserved population has a positive loan experience, Home Credit makes use of a variety of alternative data--including telco and transactional information--to predict their clients' repayment abilities.

## Data set
There are 7 different sources of data:

application_train/application_test: the main training and testing data with information about each loan application at Home Credit. Every loan has its own row and is identified by the feature SK_ID_CURR. The training application data comes with the TARGET indicating 0: the loan was repaid or 1: the loan was not repaid.

bureau: data concerning client's previous credits from other financial institutions. Each previous credit has its own row in bureau, but one loan in the application data can have multiple previous credits.

bureau_balance: monthly data about the previous credits in bureau. Each row is one month of a previous credit, and a single previous credit can have multiple rows, one for each month of the credit length.

previous_application: previous applications for loans at Home Credit of clients who have loans in the application data. Each current loan in the application data can have multiple previous loans. Each previous application has one row and is identified by the feature SK_ID_PREV.

POS_CASH_BALANCE: monthly data about previous point of sale or cash loans clients have had with Home Credit. Each row is one month of a previous point of sale or cash loan, and a single previous loan can have many rows.
credit_card_balance: monthly data about previous credit cards clients have had with Home Credit. Each row is one month of a credit card balance, and a single credit card can have many rows.

installments_payment: payment history for previous loans at Home Credit. There is one row for every made payment and one row for every missed payment.

## Evaluvation metrics
The target is what we are asked to predict: either a 0 for the loan was repaid on time, or a 1 indicating the client had payment difficulties.
Submissions are evaluated on area under the ROC curve between the predicted probability and the observed target.

## Feature engineering
Exploratory Data Analysis (EDA) is an open-ended process where we calculate statistics and make figures to find trends, anomalies, patterns, or relationships within the data. The goal of EDA is to learn what our data can tell us. It generally starts out with a high level overview, then narrows in to specific areas as we find intriguing areas of the data. The findings may be interesting in their own right, or they can be used to inform our modeling choices, such as by helping us decide which features to use.

The descriptive statistic features, binary encoding and one hot encoding on categorical variables are added. The diffirent feature are aggreagated by thier mean, min, max, sum..ect  and add to the train and test dataframe.

## Model
Intial analysis is made using linear regression, later gradient boosting methods are used to build model. The model is evaluated using 5 fold cross validation stragergy.

## Out come of project
This project help to analysze credit rating of loan applicant using exploratory data analysis.


text:
```py
import os
import glob
import numpy as np

def get_meta_data():

    id_path = glob.glob('/home/team/datasets/kface/Midle_Resolution/*')
    clip_path = glob.glob('/home/team/datasets/kface/Midle_Resolution/19082742/*')
    lux_path = glob.glob('/home/team/datasets/kface/Midle_Resolution/19082742/S001/*')
    exp_path = glob.glob('/home/team/datasets/kface/Midle_Resolution/19082742/S001/L30/*')
    angle_path = glob.glob('/home/team/datasets/kface/Midle_Resolution/19082742/S001/L30/E01/*.jpg')

    id = []
    clip = []
    lux = []
    exp = []
    angle = []

    for id_ in id_path:
        id.append(id_.split("/")[-1])

    for clip_ in clip_path:
        clip.append(clip_.split("/")[-1])

    for lux_ in lux_path:
        lux.append(lux_.split("/")[-1])

    for exp_ in exp_path:
        exp.append(exp_.split("/")[-1])

    for angle_ in angle_path:
        angle.append(angle_.split("/")[-1])
    return id, clip, lux, exp, angle

# def count():

# id, clip, lux, exp, angle = get_meta_data()

num = 0
# id = all
# for i in id:
#     # clip = S001
#     for c in clip:
#         if c == 'S001':
#         # lux = L2
#             for l in lux:
#                 if l =='L2':
#                 # exp = all
#                     for e in exp:
#                         # angle = all
#                         for a in angle:

#                             # num = num + 1
#                             # print(num)
#                             if e="E02":
#                                 a =
#                                 pass
#                             if e="E03":
#                                 pass
#                             if os.path.isdir("/home/team/datasets/kface_selected") == False:
#                                 os.system("mkdir /home/team/datasets/kface_selected")
#                             if os.path.isdir("/home/team/datasets/kface_selected/{}".format(i)) == False:
#                                 os.system("mkdir /home/team/datasets/kface_selected/{}".format(i))
import random

id_path = glob.glob('/home/team/datasets/kface/selected_mtcnn_160_train/*')
# num = np.arange(0,120)
# print(num)
# print(id_path)
for id_ in id_path:

    idd = id_.split("/")[-1]
    if len(idd) != 8:
        continue
    print(idd, len(idd))
    # if os.path.isdir("/home/team/datasets/kface/selected_mtcnn_160_test/{idd}".format(idd)) == False:
        # os.system("mkdir /home/team/datasets/kface/selected_mtcnn_160_test/{idd}".format(idd))

    files = glob.glob('/home/team/datasets/kface/selected_mtcnn_160_train/{}/'.format(idd))
    print(files)
    choices = random.sample([1,2,3,4,5], 24)

    print(choices)
    # for choice in choices:
        # print(choice)
        # shutil.copy(choice, test_dir)
    # print ('Finished!')

    # os.system("mv /home/team/datasets/kface/selected_mtcnn_160_train/{}/ /home/team/datasets/kface/selected_mtcnn_160_test/".format(idd) )

    #####################################################################################################
```


text:
---
layout: page
title: Voila - Interactive Health Device
permalink: /Voila/
---
### Skills: Java(Android), Sensors, Arduino, Laser Cutting, CAD
##### I worked on “Voila”, an interactive device using tactile inputs which focuses on the collection and optimization of health choices.

The motivation for this project path came from a shared group interest in personal health and happiness. As busy individuals with many smartphone apps and notifications, we all envisioned a way to make health tracking both simpler and more insightful.

Our dream for this project was to make the technology seem as amiable as possible. One of the ways we sought to do this is by using smooth edges- circles rather than rectangles- in the overall design. We were limited in budget and supplies, so we adapted a rectangular screen to become multiple circular screens.

The final device was created through myriad cycles of 3D printing pieces. The hardware includes a Pico Pro microcontroller and screen, accelerometer, LED strip, motion sensor, and Bluetooth Low Energy (BLE) connection.

Again, here is the promotional video for Voila:

[Back to Portfolio](https://meredithmeyer.info/)

Contact me (below) for more information.