text:
# lib-oauth

**OAuth 2.0 Authorization Framework**

Provides a library of funtional primitives upon which a standards-compliant implementaiton of an OAuth 2.0 client and server can be developed.

The OAuth 2.0 authorization framework enables a third-party
application to obtain limited access to an HTTP service, either on
behalf of a resource owner by orchestrating an approval interaction
between the resource owner and the HTTP service, or by allowing the
third-party application to obtain access on its own behalf.

This OAuth library includes data objects specified in several RFCs:

  *  [6749](https://tools.ietf.org/html/rfc6749)  The OAuth 2.0 Authorization Framework
  *  [6750](https://tools.ietf.org/html/rfc6750)  The OAuth 2.0 Authorization Framework: Bearer Token Usage
  *  [6819](https://tools.ietf.org/html/rfc6819)  OAuth 2.0 Threat Model and Security Considerations
  *  [7662](https://tools.ietf.org/html/rfc7662)  OAuth 2.0 Token Introspection
  *  [7591](https://tools.ietf.org/html/rfc7591)  OAuth 2.0 Dynamic Client Registration Protocol
  *  [7592](https://tools.ietf.org/html/rfc7592)  OAuth 2.0 Dynamic Client Registration Management Protocol
  *  [8628](https://tools.ietf.org/html/rfc8628)  OAuth 2.0 Device Authorization Grant

The following specifications are implemented in this library but are marked as deprecated.

  *  [5849](https://tools.ietf.org/html/rfc5849)  The OAuth 1.0 Protocol  **deprecated**
  *  [draft-ietf-oauth-v2-http-mac-05](https://trac.tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-05)  OAuth 2.0 Message Authentication Code (MAC) Tokens **deprecated**

**Road map**

The following specifications are planned for implementation in this library.

  *  [7009](https://tools.ietf.org/html/rfc7009)  OAuth 2.0 Token Revocation
  *  [8252](https://tools.ietf.org/html/rfc8252)  OAuth 2.0 for Native Apps
  *  [8628](https://tools.ietf.org/html/rfc8628)  OAuth 2.0 Device Authorization Grant

**Not implemented**

The following specifications are noted but not planned for implementation in this library.

  *  [7521](https://tools.ietf.org/html/rfc7521)  Assertion Framework for OAuth 2.0 Client Authentication and Authorization Grants
  *  [7522](https://tools.ietf.org/html/rfc7522)  Security Assertion Markup Language (SAML) 2.0 Profile for OAuth 2.0
  *  [7636](https://tools.ietf.org/html/rfc7636)  Proof Key for Code Exchange by OAuth Public Clients
Client Authentication and Authorization Grants
  *  [draft-ietf-oauth-token-binding](https://tools.ietf.org/html/draft-ietf-oauth-token-binding-08)  OAuth 2.0 Token Binding

**Authentication and session management**

The OAuth framework only describes an authorization method. It does not provide details about the user. OpenID Connect is a simple identity layer on top of the OAuth 2.0 protocol. The [OpenID Connect](https://openid.net/connect/) profile is implemented separately in the Key Bridge `lib-openid` project.

  * [OpenID Connect](https://openid.net/connect/) OpenID Connect 1.0 specification

**Encryption and signing**

The OAuth framework does not describe an encryption and signing strategy, nor does it support self asserted claims. The JSON Web Token specification provides a crypographically secure layer for the OAuth 2.0 protocol. The [JSON Web Token](https://tools.ietf.org/html/rfc7523) profile is implemented separately in the Key Bridge `lib-jose` project.

  * [7523](https://tools.ietf.org/html/rfc7523)  JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants

## Bootstrapping

Before they can authenticate end users, OAuth 2.0 clients must first register with
the OAuth authorization server. This is implemented via the [Dynamic Client Registration Protocol](https://tools.ietf.org/html/rfc7591).

        +--------(A)- Initial Access Token (OPTIONAL)
        |   +----(B)- Software Statement (OPTIONAL)
        v   v
    +-----------+                                      +---------------+
    |           |--(C)- Client Registration Request --+|    Client     |
    |           |+-(D)- Client Information Response ---| Registration  |
    |           |                                      +---------------+
    | Client or |--(E)- Read or Update Request -------+|               |
    | Developer |+-(F)- Client Information Response ---|    Client     |
    |           |--(G)- Delete Request ---------------+| Configuration |
    |           |+-(H)- Delete Confirmation -----------|               |
    +-----------+                                      +---------------+

_OAuth 2.0 Dynamic Client Registration Protocol_

## Protocol flow

     +--------+                               +---------------+
     |        |--(A)- Authorization Request -+|   Resource    |
     |        |+-(B)-- Authorization Grant ---|    Owner      |
     |        |                               +---------------+
     | Client |--(C)-- Authorization Grant --+| Authorization |
     |        |+-(D)----- Access Token -------|     Server    |
     |        |                               +---------------+
     |        |--(E)----- Access Token ------+|    Resource   |
     |        |+-(F)--- Protected Resource ---|     Server    |
     +--------+                               +---------------+

_Figure 1: Abstract Protocol Flow_

The abstract OAuth 2.0 flow illustrated in Figure 1 describes the
interaction between the four roles and includes the following steps:

**(A)**  The client requests authorization from the resource owner.  The
authorization request can be made directly to the resource owner
(as shown), or preferably indirectly via the authorization
server as an intermediary.
**(B)**  The client receives an authorization grant, which is a
credential representing the resource owner's authorization,
expressed using one of four grant types defined in this
specification or using an extension grant type.  The
authorization grant type depends on the method used by the
client to request authorization and the types supported by the
authorization server.
**(C)**  The client requests an access token by authenticating with the
authorization server and presenting the authorization grant.
**(D)**  The authorization server authenticates the client and validates
the authorization grant, and if valid, issues an access token.
**(E)**  The client requests the protected resource from the resource
server and authenticates by presenting the access token.
**(F)**  The resource server validates the access token, and if valid,
serves the request.

## Machine to machine applications

With machine-to-machine (M2M) applications, such as CLIs, daemons, or services running on your back-end, the system authenticates and authorizes the app rather than a user. For this scenario, typical authentication schemes like username + password or social logins don't make sense. Instead, M2M apps use the Client Credentials Flow (defined in OAuth 2.0 RFC 6749, section 4.4).

The client can request an access token using only its client
credentials (or other supported means of authentication) when the
client is requesting access to the protected resources under its
control, or those of another resource owner that have been previously
arranged with the authorization server (the method of which is beyond
the scope of this specification).

     +---------+                                  +---------------+
     | Client  |---(A)- Client Authentication ---+| Authorization |
     |         |+--(B)---- Access Token ----------|   Server      |
     +---------+                                  +---------------+

_Figure 6: Client Credentials Flow_

## Roles

The basic purpose of OAuth is to **grant the end user control over who may authenticate and authorize the end user.**
For this the OAuth protocol defines four roles:

| Role | Description |
|---|---|
| **resource owner** | An entity (such as a human) capable of granting access to a protected resource. When the resource owner is a person, it is referred to as an end-user. In this context the _resource_ is the user identify. |
| **resource server**  | A server hosting the protected resources (i.e. a user account), that   can accept and respond to protected resource requests using access tokens.   This is a server that validates the _resource owner's resource_.   In practical terms this is a server that confirms a user identity. |
| **client**           | An application making protected resource requests on behalf of the resource owner and with its (the resource owner's) authorization.  The term "client" does not imply any particular implementation characteristics (e.g., whether the application executes on a server, a desktop, or other devices). This is typically an online service wishing to authenticate or authorize a user. |
| **authorization server**  | The server issuing access tokens to the client after successfully authenticating the resource owner and obtaining authorization (from the resource owner) that the client may authenticate the resource owner. |

What this means in a normal implementation is the end user (typically a human) is the _resource owner_, while the web server is the _client_.

When a web server, configured to use OAuth, wishes a user to authentiate themselves the web server
instead requests an authorization server to authenticate (and in so doing to also authorize)
the end user. _However_, the user must first give permission for the web server (the client)
to authenticate (and authorize) the user.

## License

Copyright 2018 Key Bridge. Published under the Apache License, Version 2.0.

## References

 * [The OAuth 2.0 Authorization Framework](https://tools.ietf.org/html/rfc6749)

repository: KeyBridge/lib-oauth

repo_name: KeyBridge/lib-oauth


text:
# Reverse an Integer

Write a function called `reverse` that takes one integer as a parameter. Return a new integer with all the digits reversed. Only use common math operations like `+*/%`. You may use `Math.floor` to help with rounding.
Do not arrays. Do not use strings. You are forbidden. Stay in the land of numbers.

license: MIT

repository: ambergkim/whiteboard

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: MIT

license_type: permissive

repo_name: ambergkim/whiteboard


text:
dag API
=======

> The dag API comes to replace the `object API`, it support the creation and manipulation of dag-pb object, as well as other IPLD formats (i.e dag-cbor, ethereum-block, git, etc)

#### `dag.put`

> Store an IPLD format node

##### `Go` **WIP**

##### `JavaScript` - ipfs.dag.put(dagNode, options, callback)

- `dagNode` - a DAG node that follows one of the supported IPLD formats.
- `options` - a object that might contain the follwing values:
  - `format` - The IPLD format multicodec.
  - `hashAlg` - The hash algorithm to be used over the serialized dagNode.
  - `cid` - the CID of the node passed.
  - **Note** - You should only pass the CID or the format + hashAlg pair and not both
- `callback` must follow `function (err) {}` signature, where `err` is an error if the operation was not successful.

If no `callback` is passed, a [promise][] is returned.

#### `dag.get`

> Retrieve an IPLD format node

##### `Go` **WIP**

##### `JavaScript` - ipfs.dag.get(cid [, path, options], callback)

- `cid` - a [CID][https://github.com/ipfs/js-cid] instance.
- `path` - the path to be resolved. Optional.
- `options` - a object that might contain the following values:
  - `localResolve` - bool - if set to true, it will avoid resolving through different objects.

`callback` must follow `function (err, result) {}` signature, where `err` is an error if the operation was not successful and `result` is an object containing:

- `value` - the value or node that was fetched during the get operation.
- `remainderPath` - The remainder of the Path that the node was unable to resolve or what was left in a localResolve scenario.

repository: AlexxNica/interface-ipfs-core

repo_name: AlexxNica/interface-ipfs-core


text:
# TIBCO LABS™ Project ART

public Augmented Reality Repo, watch the full content of the Initiative, please [visit our Labs Site via this Link](https://tibcosoftware.github.io/Augmented-Reality/)

![Logo](https://tibcosoftware.github.io/TIBCO-LABS/about/tibcolabs-brand.png "Labs Logo")

repository: worthwhileindustries/Augmented-Reality

repo_name: worthwhileindustries/Augmented-Reality


text:
# CEH v10 Study Guide

Created based off information found in [CEH Certified Ethical Hacker All-in-One Exam Guide, Fourth Edition](https://www.amazon.com/gp/product/126045455X/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1) by Matt Walker

## Table of Contents

[1 - Essential Knowledge](1 - Essential Knowledge.md)

[2 - Reconnaissance](2 - Reconnaissance.md)

[3 - Scanning and Enumeration](3 - Scanning and Enumeration.md)

[4 - Sniffing and Evasion](4 - Sniffing and Evasion.md)

[5 - Attacking a System](5 - Attacking a System.md)

[6 - Web-Based Hacking - Servers and Applications](6 - Web-Based Hacking - Servers and Applications.md)

[7 - Wireless Network Hacking](7 - Wireless Network Hacking.md)

[8 - Mobile Communications and IoT](8 - Mobile Communications and IoT.md)

[9 - Security in Cloud Computing](9 - Security in Cloud Computing.md)

[10 - Trojans and Other Attacks](10 - Trojans and Other Attacks.md)

[11 - Cryptography 101](11 - Cryptography 101.md)

[12 - Low Tech - Social Engineering and Physical Security](12 - Low Tech - Social Engineering and Physical Security.md)

[13 - The Pen Test - Putting It All Together](13 - The Pen Test - Putting It All Together.md)


text:
# :yellow_car: Not So Crazy Taxi :yellow_car:

This is a little taxi driving game made by two second year students of the Videogame Design and Development degree.
Get all the clients to their destination before the time ends!
The game has been made using C++, Visual Studio and Bullet 3D, OpenGl and SDL libraries.

### Controls
-Move to the left      --> RIGHT ARROW
-Move to the right     --> LEFT ARROW
-Move forward          --> UP ARROW
-Move backwards        --> DOWN ARROW
-Brake                 --> SPACEBAR

-Debug                 --> F1
-Restart               --> F2
-Go to Checkpoint      --> F3     (last destination)
-Instant Win           --> F4
-Instant Lose          --> F5
-Free Camera(WASDRF)   --> F10

### Instructions
Try to get all the clients(red cubes) to their destination(green cylinders) before the time ends.
If the time ends and all clients to their destination, you lose(taxi turns red) and the game gets restarted.
If you accomplish the goal, the game also restarts but your taxi will turn green.
You will see a green line that leads you to each destination when you get a client, you should follow it.
You should brake if you want the clients to get on or off the taxi!

### Authors
-Enric-G. Durán Vilar

-Álex López  Agudo

### Github
-https://github.com/EnricGDV/Car_Racing_Game

### Credits
We do not own any of the sprites, tilesets, music or sfx presented in this game. Authors credited below

-Music:       Crazy Taxi Theme --> https://youtu.be/OvjhBDuBXYQ

-SFX:  	      Victory          --> https://www.youtube.com/watch?v=737y4Mvxai8
	      New Client       --> https://www.youtube.com/watch?v=RdxJ5c3MG1M
              Goal Reached     --> https://www.myinstants.com/instant/ka-ching/
              Lose             --> https://www.myinstants.com/instant/the-price-is-right-losing-horn/

Enjoy!


text:
# n7m

n7m (short for [numeronym](https://en.wikipedia.org/wiki/Numeronym)) is an AWS Lambda function built with [serverless](https://github.com/serverless/serverless) that turns words into their number based acronyms.

```bash
$ curl https://n7m.vararu.org/accessibility
a11y
$ curl https://n7m.vararu.org/internationalisation
i18n
```

## License

[MIT](LICENSE.txt).


text:
# hello-world
Not just another repository, but a new branch with the first!

Happy days

:-)

Git hub uses Markdown with a few Github specific addtions. [The basics are available here](https://help.github.com/articles/basic-writing-and-formatting-syntax/) but this is a good place to [start learning how Github uses Markdown](https://help.github.com/articles/about-writing-and-formatting-on-github/)

Don't forget [emoji's](http://www.webpagefx.com/tools/emoji-cheat-sheet/) are first class citizens in GitHub.

Have a great day @DavidRoweWTL :simple_smile:

license: Unlicense

repository: DavidRoweWTL/hellow-world

repo_name: DavidRoweWTL/hellow-world


text:
# extractRequest

## Description

Extracts the complete `HttpRequest` instance.

Use `extractRequest` to extract just the complete URI of the request. Usually there's little use of
extracting the complete request because extracting of most of the aspects of HttpRequests is handled by specialized
directives. See @ref[Request Directives](../by-trait.md#request-directives-java).

## Example

@@snip [BasicDirectivesExamplesTest.java](../../../../../../../test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extractRequest }

repository: jonas/akka-http

repo_name: jonas/akka-http


text:
# "The Ultimate Puzzle" Solver

A simple back-tracking program built in Racket to find all solutions to ["The Ultimate Puzzle"](https://theultimatepuzzle.com/).
You can allow or disallow flipping pieces over from their natural face-up orientation.

Note that the version I solved is slightly different than the one linked above and only has 9 pieces instead of 16.
I did originally solved the one linked above several years prior to this one (also in Racket), but the code was neither organized nor commented so I haven't made it public.

### Run

The easiest way to run the code is use an online Racket compiler such as [OneCompiler](https://onecompiler.com/racket/). Copy the code from puzzle.rkt and paste it there. Alternatively, clone the repository to your computer and open it with [DrRacket](https://download.racket-lang.org/).

As it is, there are only definitions, no expressions to evaluate, so no output/results will appear. To actually generate the solution(s), run `(find-solutions false)` to find all solutions with the pieces face up, or `(find-solutions true)` to find all solutions (face up or face down).

The answer is a list of puzzle pieces, indicating the index, face up or face down, and how to rotate it on the surface. Use puzzle-pieces-picture.png to look-up a physical piece from the index. The list starts with the center piece, then the piece to the left, and from there it circles clockwise:

3 4 5
2 1 6
9 8 7

repository: kr-matthews/the-ultimate-puzzle-solver

branch_name: refs/heads/main

repo_name: kr-matthews/the-ultimate-puzzle-solver


text:
---
layout: default
---

# 1993-05-02 - Re: Tactics.

## Header Data

From: Stanton McCandlish<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: a7b2e762321852e4bbe71d859eeae9a5c47181910d57f53dc0d2be8dc250939a

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1993-05-02 10:02:18 UTC

Raw Date: Sun, 2 May 93 03:02:18 PDT

## Raw message

```
{% raw  %}From: Stanton McCandlish<EMAIL_ADDRESS>Date: Sun, 2 May 93 03:02:18 PDT
To<EMAIL_ADDRESS>Subject: Re: Tactics.
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Hooo boy, just got that new _Wired_ (things get to New Mexico rather behind
schedule.)  What nut came up with that Cypherpunks article?!  The TEXT is good,
but god those photos.  To people like us they are keen.  But what happens
when 16 yr. old Jamie's mom sees that? What is she to think of all these
subversive longhairs with KKK-reminiscent masks, and one of them flashing a
nasty-looking dagger?  Like I say, to ME it was ok, but viewed with a
conservative outsider's eyes, we look positively dangerous.  I can't help
but think that that article was a PR/memetic misadventure of a HIGH mag-
nitude, and could do quite a bit to hurt our cause.  What happens when clipper
is big enough news to earn a prime time news slot, and they show excerpts of
that photo?    In my never
even remotely humble opinion, that article (or photoshoot, anyway) was a
Bad Bad Thing.  Not that Stanton "Call my BBS for free PGP" McCandlish
is known for PR work, but sheesh...
--
Testes saxi solidi!  **********************   Podex opacus gravedinosus est!
Stanton McCandlish,  SysOp:  Noise in the Void Data Center BBS
IndraNet: 369:1/1      FidoNet: 1:301/2      Internet<EMAIL_ADDRESS>Snail: 8020 Central SE #405, Albuquerque, New Mexico 87108 USA
Data phone: +1-505-246-8515 (24hr, 1200-14400 v32bis, N-8-1)
Vox phone:  +1-505-247-3402 (bps rate varies, depends on if you woke me up...:)

{% endraw %}
```

## Thread

+ Return to [May 1993](/archive/1993/05)

+ Return to "[Stanton McCandlish <anton@hydra.unm.edu>](/authors/stanton_mccandlish_anton_at_hydra_unm_edu_)"
+ Return to "[Sy Verpunc <svp@gtoal.com>](/authors/sy_verpunc_svp_at_gtoal_com_)"

+ 1993-05-01 (Sat, 1 May 93 05:02:56 PDT) - [Re: Tactics.](/archive/1993/05/697cf625a3d656d2dc9f1f32a9223e8e8e27dbdd1173a92b921550cbe1f450bc) - _Sy Verpunc<EMAIL_ADDRESS>  + 1993-05-02 (Sun, 2 May 93 03:02:18 PDT) - Re: Tactics. - _Stanton McCandlish<EMAIL_ADDRESS>


text:
# ChainAPI for Air Quality

This is an adaptation of the [ChainAPI project](https://github.com/ResEnv/chain-api) for Air Quality.  I huge amount is owed to Spencer Russell and the ChainAPI development group, please check out the original project from which this was forked for information about the architecture of ChainAPI.

This readme focuses on the Air Quality adaptation and ontology.  This version of ChainAPI is part of [LearnAir, a master's thesis](https://www.davidbramsay.com/learnair).

##**documentation and examples**

![Thesis Excerpt](/readme.jpg)

## related work
**code written for LearnAir includes:**
+ [chainCrawler and chainSearcher](https://github.com/dramsay9/chaincrawler) - *a web crawler and a breadth-first-search tool for the semantic web data achitecture ChainAPI*
+ [chainTraverser and chainDataPush](https://github.com/dramsay9/chainlearnairdata) - *a stateful web spider to traverse, upload, modify, and interact with ChainAPI nodes and data, including pushing data from Excel files*
+ [chainProcessor](https://github.com/dramsay9/chaindataprocessor) - *a scalable machine learning crawler framework, which automatically crawls and downloads data from a list of 'known' device types in ChainAPI, processes their data using a device-specific model (that automatically updates when new data is found), and uploads that processed data back into ChainAPI*
+ [an Air Quality Ontology Adaptation of Chain API](https://github.com/dramsay9/chain-api) ([original tool](https://github.com/ResEnv/chain-api) written by Spencer Russel et al) - *air quality data ontology written with ChainAPI- a semantic web, RESTful Sensor API*

**Additional resources include:**
+ [the thesis document](https://davidbramsay.com/public/RamsayMastersThesis.pdf) (full documentation/motivation, esp. Chap 6. ChainAPI for Air Quality)
+ [the repo for the thesis document](https://github.com/dramsay9/thesis)
+ [jupyter notebooks used in data pre-processing, machine learning, and plot generation](https://github.com/dramsay9/learnair-data-crunching)(with raw data)
+ [a quick video introducing the learnAir concept](https://vimeo.com/188586371)
+ [the original ChainAPI project](https://github.com/ResEnv/chain-api)

#
### Contact
<EMAIL_ADDRESS>

repository: mitmedialab/learnair

repo_name: mitmedialab/learnair


text:
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [12.1.1](https://github.com/egoist/poi/compare/@poi/dev-utils@12.1.0<EMAIL_ADDRESS>(2019-01-23)

### Bug Fixes

- format build time in human-readable format ([a89ecd0](https://github.com/egoist/poi/commit/a89ecd0))
- use a new port if the port is already used ([62053e5](https://github.com/egoist/poi/commit/62053e5))

# [12.1.0](https://github.com/egoist/poi/compare/@poi/dev-utils@12.0.3<EMAIL_ADDRESS>(2019-01-09)

### Bug Fixes

- **dev-utils:** refactor hotDevClient to ES5 compat ([#522](https://github.com/egoist/poi/issues/522)) ([480bce5](https://github.com/egoist/poi/commit/480bce5)), closes [#515](https://github.com/egoist/poi/issues/515)

### Features

- show memory usage ([75f1376](https://github.com/egoist/poi/commit/75f1376))

## [12.0.3](https://github.com/egoist/poi/compare/@poi/dev-utils@12.0.2<EMAIL_ADDRESS>(2018-12-21)

### Bug Fixes

- **cli:** only open browser on the first successful build ([13b1ac8](https://github.com/egoist/poi/commit/13b1ac8))


text:
# Benchmarks

ECP-CANDLE Benchmarks

This repository contains the CANDLE benchmark codes. These codes implement deep learning architectures that are relevant to problems in cancer. These architectures address problems at different biological scales, specifically problems at the molecular, cellular and population scales.

The naming conventions adopted reflect the different biological scales.

Pilot1 (P1) benchmarks are formed out of problems and data at the cellular level. The high level goal of the problem behind the P1 benchmarks is to predict drug response based on molecular features of tumor cells and drug descriptors.

Pilot2 (P2) benchmarks are formed out of problems and data at the molecular level. The high level goal of the problem behind the P2 benchmarks is molecular dynamic simulations of proteins involved in cancer, specifically the RAS protein.

Pilot3 (P3) benchmarks are formed out of problems and data at the population level. The high level goal of the problem behind the P3 benchmarks is to predict cancer recurrence in patients based on patient related data.

Each of the problems (P1,P2,P3) informed the implementation of specific benchmarks, so P1B3 would be benchmark three of problem 1.
At this point, we will refer to a benchmark by it's problem area and benchmark number. So it's natural to talk of the P1B1 benchmark. Inside each benchmark directory, there exists a readme file that contains an overview of the benchmark, a description of the data and expected outcomes along with instructions for running the benchmark code.

Over time, we will be adding implementations that make use of different tensor frameworks. The primary (baseline) benchmarks are implemented using keras, and are named with '\_baseline' in the name, for example p3b1_baseline_keras2.py.

Implementations that use alternative tensor frameworks, such as pytorch, will have the name of the framework in the name. Examples can be seen in the Pilot1 benchmark UnoMT directory, for example: `unoMT_baseline_pytorch.py`

Documentation: https://ecp-candle.github.io/Candle/

repository: ECP-CANDLE/Benchmarks

gha_language: Python

repo_name: ECP-CANDLE/Benchmarks


text:
---
layout: post
title: Podcast Episode 65 - Jeff "Cheezy" Morgan, Trainer and Developer
date: 2016-12-04
author: David McNulla
author_url: http://dmcnulla.wordpress.com
comments: true
tags: [Podcast]
---

Welcome to the Watir Podcast. In this episode of the Watir Podcast, Jeff "Cheezy" Morgan joins the Watir Podcast to talk about his Page Object gem, other significant gems used for Acceptance Test Driven Development, his book Cucumber & Cheeze, and agile.

[Twitter](https://twitter.com/chzy)

Works at [LeanDog](http://www.leandog.com/organizational-design/)

Gems:
* [Page Objects](https://github.com/cheezy/page-object)
* [Fig Newton](https://github.com/cheezy/fig_newton)
* [Data Magic](https://github.com/cheezy/page-object)
* [Service Mock](https://github.com/cheezy/service_mock)
* [Terminal Emulator](https://github.com/cheezy/te3270)

Book: [Cucumber & Cheeze](https://leanpub.com/cucumber_and_cheese)

Conference: [Agile Days in Potsdam](http://www.agiletestingdays.com/program-2016/)

You can listen to this podcast at [SoundCloud](https://soundcloud.com/the-watir-podcast/episode-65-cheezy-returns).
<!--more-->
Please give feedback on this podcast on [SoundCloud](https://soundcloud.com/the-watir-podcast/episode-65-cheezy-returns), as well as what you would like to hear about on future Watir Podcasts.

You can subscribe to [The Watir Podcast feed](http://feeds.soundcloud.com/users/soundcloud:users:248873479/sounds.rss).

*Special Note: We are seeking a sponsor to be associated with the Watir Podcast. We would include some ad time in the podcast in exchange for assisting us with our nominal costs. Please contact<EMAIL_ADDRESS>if you are interested!*

gha_language: HTML


text:
    Build websites even faster with components on top of Tailwind CSS

------
## Table of Contents

- [Table of Contents](#table-of-contents)
- [Documentation](#documentation)
- [Getting started](#getting-started)
  - [Install using NPM](#install-using-npm)
  - [Include via CDN](#include-via-cdn)
  - [Bundled JavaScript](#bundled-javascript)
  - [Data attributes](#data-attributes)
    - [Init functions](#init-functions)
  - [ESM and CJS](#esm-and-cjs)
  - [TypeScript](#typescript)
  - [JavaScript Frameworks](#javascript-frameworks)
  - [Back-end Frameworks](#back-end-frameworks)
- [Components](#components)
- [Figma Design System](#figma-design-system)
- [Flowbite Blocks](#flowbite-blocks)
- [Pro version](#pro-version)
- [Community](#community)
- [Copyright and license](#copyright-and-license)

## Documentation

For full documentation, visit [flowbite.com](https://flowbite.com/).

## Getting started

Flowbite can be included as a plugin into an existing Tailwind CSS project and it is supposed to help you build websites faster by having a set of web components to work with built with the utility classes from Tailwind CSS.

### Install using NPM

Make sure that you have Node.js and Tailwind CSS installed.

1. Install Flowbite as a dependency using NPM by running the following command:

```bash
npm install flowbite
```

2. Require Flowbite as a plugin inside the `tailwind.config.js` file:

```javascript
module.exports = {

    plugins: [
        require('flowbite/plugin')
    ]

}
```

3. Make sure that you add the template path to the `tailwind.config.js` file:

```javascript
module.exports = {

    content: [
        "./node_modules/flowbite/**/*.js"
    ]

}
```

4. Include the main JavaScript file to make interactive elements work:

```html
<script src="../path/to/flowbite/dist/flowbite.js"></script>
```

### Include via CDN

The quickest way to get started working with Flowbite is to simply include the CSS and JavaScript into your project via a CDN service such as UNPKG or CDNJS (content delivery networks).

Require the following minified stylesheet inside the `head` tag:

```html
<link href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.6.5/flowbite.min.css" rel="stylesheet" />
```

And include the following javascript file before the end of the `body` tag:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.6.5/flowbite.min.js"></script>
```

### Bundled JavaScript

One of the most popular way of using Flowbite is to include the bundled Javascript file which is UMD ready using a bundler such as Webpack or Parcel which makes sure that all of the data attributes and functionality will work out-of-the-box.

You can directly import the main JavaScript file inside your bundled `app-bundle.js` file like this:

```javascript
import 'flowbite';
```

This file has access to all of the components and it automatically applies event listeners to the data attributes.

### Data attributes

The preferred way to use the interactive UI components from Flowbite is via the data attributes interface which allows us to add functionality via the HTML element attributes and most of the examples on our documentation applies this strategy.

For example, to set up a modal component all you need to do is use `data-modal-target` and `data-modal-{toggle|show|hide}` to toggle, show, or hide the component by clicking on any trigger element.

```html
<button data-modal-target="defaultModal" data-modal-toggle="defaultModal" class="block text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800" type="button">
  Toggle modal
</button>

<!-- Main modal -->
<div id="defaultModal" tabindex="-1" aria-hidden="true" class="fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] max-h-full">
    <div class="relative w-full max-w-2xl max-h-full">
        <!-- Modal content -->
        <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
            <!-- Modal header -->
            <div class="flex items-start justify-between p-4 border-b rounded-t dark:border-gray-600">
                <h3 class="text-xl font-semibold text-gray-900 dark:text-white">
                    Terms of Service
                </h3>
                <button type="button" class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white" data-modal-hide="defaultModal">
                    <svg aria-hidden="true" class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
                    <span class="sr-only">Close modal</span>
                </button>
            </div>
            <!-- Modal body -->
            <div class="p-6 space-y-6">
                <p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">
                    With less than a month to go before the European Union enacts new consumer privacy laws for its citizens, companies around the world are updating their terms of service agreements to comply.
                </p>
                <p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">
                    The European Union’s General Data Protection Regulation (G.D.P.R.) goes into effect on May 25 and is meant to ensure a common set of data rights in the European Union. It requires organizations to notify users as soon as possible of high-risk data breaches that could personally affect them.
                </p>
            </div>
            <!-- Modal footer -->
            <div class="flex items-center p-6 space-x-2 border-t border-gray-200 rounded-b dark:border-gray-600">
                <button data-modal-hide="defaultModal" type="button" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">I accept</button>
                <button data-modal-hide="defaultModal" type="button" class="text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-blue-300 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600">Decline</button>
            </div>
        </div>
    </div>
</div>
```

#### Init functions

You can also use the init functions to set up the event listeners yourself. Here's an example how you can do it with Vue or Nuxt:

```
<script setup>
import { onMounted } from 'vue'
import { initFlowbite } from 'flowbite'

// initialize components based on data attribute selectors
onMounted(() => {
    initFlowbite();
})
</script>

<template>
    // Modal HTML markup with data attributes from Flowbite
</template>
```

The `initFlowbite` function sets up all of the init functions for dropdowns, modals, navbars, tooltips and so on to hook onto the data attributes. Alternatively, you can also initialise each component category class separately with `initDropdowns` or `initModals`.

You can view more examples by browsing the [components from Flowbite](#components).

### ESM and CJS

Flowbite also offers an API for using the components programmatically and it supports both CJS and ESM for JavaScript which can be helpful if you need to expand the default capabilities of the data attributes interface and get access to function callbacks.

Here's an example how you can import and create a new Modal component inside JavaScript:

```javascript
import { Modal } from 'flowbite'

const $modalElement = document.querySelector('#modalEl');

const modalOptions = {
    placement: 'bottom-right',
    backdrop: 'dynamic',
    backdropClasses: 'bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40',
    onHide: () => {
        console.log('modal is hidden');
    },
    onShow: () => {
        console.log('modal is shown');
    },
    onToggle: () => {
        console.log('modal has been toggled');
    }
}

const modal = new Modal($modalElement, modalOptions);

modal.show();
```

Check out the JavaScript behaviour section of each component's page to learn how you can use this.

### TypeScript

Flowbite supports type declarations for the interactive UI components including object interfaces and parameter types. Check out the following examples to learn how you can use types with Flowbite.

Additionally to our code above, we will now import some relevant types from the Flowbite package, namely the `ModalOptions` and `ModalInterface`:

```javascript
import { Modal } from 'flowbite'
import type { ModalOptions, ModalInterface } from 'flowbite'

// other code
```

Generally speaking, all of the components have an interface definition that you can use whenever you create a new object to make sure that you're using the correct types of parameters and methods.

When creating a new modal you can set the `ModalInterface` as the main type:

```javascript
const modal: ModalInterface = new Modal($modalElement, modalOptions);
```

Flowbite also supports type definitions for the options object so if you want to set the placement of the modal based on types, here's how you would do that:

```javascript
const modalOptions: ModalOptions = {
    placement: 'top-right'
}

const modal: ModalInterface = new Modal($modalElement, modalOptions);
```

Learn more about Flowbite and TypeScript in the [quickstart guide](https://flowbite.com/docs/getting-started/typescript/).

### JavaScript Frameworks

The awesome open-source community also built and currently maintains the following standalone libraries for React, Vue, Svelte, and Angular:

- [🌀 Flowbite React Library](https://github.com/themesberg/flowbite-react)
- [🍀 Flowbite Vue Library](https://github.com/themesberg/flowbite-vue)
- [🎸 Flowbite Svelte Library](https://github.com/themesberg/flowbite-svelte)
- [📕 Flowbite Angular Library](https://github.com/themesberg/flowbite-angular)

We also wrote integration guides for the following front-end frameworks and libraries:

- [📝 Flowbite with React guide](https://flowbite.com/docs/getting-started/react/)
- [📝 Flowbite with Next.js guide](https://flowbite.com/docs/getting-started/next-js/)
- [📝 Flowbite with Remix guide](https://flowbite.com/docs/getting-started/remix/)
- [📝 Flowbite with Vue guide](https://flowbite.com/docs/getting-started/vue/)
- [📝 Flowbite with Nuxt guide](https://flowbite.com/docs/getting-started/nuxt-js/)
- [📝 Flowbite with Svelte guide](https://flowbite.com/docs/getting-started/svelte/)
- [📝 Flowbite with Astro guide](https://flowbite.com/docs/getting-started/astro/)
- [📝 Flowbite with Gatsby guide](https://flowbite.com/docs/getting-started/gatsby/)
- [📝 Flowbite with SolidJS guide](https://flowbite.com/docs/getting-started/solid-js/)

### Back-end Frameworks

Flowbite has a great integration with most of the back-end frameworks because it relies on vanilla JavaScript:

- [📚 Using Flowbite with Laravel](https://flowbite.com/docs/getting-started/laravel/)
- [🎼 Using Flowbite with Symfony](https://flowbite.com/docs/getting-started/symfony/)
- [🚊 Using Flowbite with Ruby on Rails 7](https://flowbite.com/docs/getting-started/rails/)
- [🐉 Using Flowbite with Phoenix (Elixir)](https://flowbite.com/docs/getting-started/phoenix/)
- [🐸 Using Flowbite with Django](https://flowbite.com/docs/getting-started/django/)
- [🌶 Using Flowbite with Flask](https://flowbite.com/docs/getting-started/flask/)

## Components

Flowbite is an open source collection of UI components built with the utility classes from Tailwind CSS that you can use as a starting point when coding user interfaces and websites.

    Alerts
    Badge
    Breadcrumbs

    Buttons
    Button group
    Cards

    Dropdown
    Forms
    List group

    Typography
    Modal
    Tabs

    Navbar
    Pagination
    Timeline

    Progress bar
    Tables
    Toast

    Tooltips
    Datepicker
    Spinner

    Footer
    Accordion
    Sidebar

    Carousel
    Avatar
    Rating

    Input Field
    File Input
    Search Input

    Select
    Textarea
    Checkbox

    Radio
    Toggle
    Range Slider

    Floating Label
    Mega Menu
    Skeleton

    KBD (keyboard)
    Drawer (offcanvas)
    Popover

    Video
    Heading
    Paragraph

    Blockquote
    Image
    List

    Link
    Text
    Horizontal line (HR)

    Speed Dial
    Stepper
    Indicators

    Bottom Navigation
    Sticky Banner
    Gallery (Masonry)

    Bottom Navigation

## Figma Design System

If you need the Figma files for the components you can check out our website for more information:

🎨 [Get access to the Figma design files](https://flowbite.com/figma/)

## Flowbite Blocks

Check out Flowbite Blocks to get access to over 310+ website sections coded in Tailwind CSS and Flowbite:

📦 [Check out Flowbite Blocks](https://flowbite.com/blocks/)

## Pro version

Get access to all premium features including the Figma design system, access to all Flowbite Block sections and a dashboard UI interface:

💎 [Check out Flowbite Pro](https://flowbite.com/pro/)

## Community

If you need help or just want to discuss about the library join the community on Github:

⌨ [Discuss about Flowbite on GitHub](https://github.com/themesberg/flowbite/discussions)

For casual chatting with others using the library:

💬 [Join the Flowbite Discord Server](https://discord.gg/4eeurUVvTy)

Video tutorials and presentations using Flowbite:

🎥 [Subscribe to our YouTube channel](https://www.youtube.com/channel/UC_Ms4V2kYDsh7F_CSsHyQ6A)

## Copyright and license

The Flowbite name and logos are trademarks of Bergside Inc.

- 📝 [Read about the licensing terms](https://flowbite.com/docs/getting-started/license/)
- 📀 [Brand guideline and trademark usage agreement](https://flowbite.com/brand/)


text:
[![Build Status](https://travis-ci.org/siscia/effe-tool.svg?branch=master)](https://travis-ci.org/siscia/effe-tool)
# Effe-tool, create and compile effes.

`effe-tool` is a simple command line utility that let you create and compiles new [effes][effe].

As you may ask what is an `effe`, an effe is an isolable computation unit, it is been build to be an open source alternative to AWS Lambda.

`effe-tool` gives you the possibility to manage fairly large projects completely written using `effes`.

Since `effe`s are state-less they provide you the foundation to build infinitely scalable systems, `effe-tool` provides the ability to manage those systems in a sane way.

## Getting Started

`effe` and `effe-tool` are built in go, I am assuming that you are not completely foreign to the languange.

You need to have `go` installed on your machine; if you type `go` in your terminal something should happen.

### Download effe-tool

Assuming your $GOPATH is set and that your $PATH contains $GOPATH/bin, then the quickest way to get `effe-tool` is:

`go get github.com/siscia/effe-tool`

followed by

`go install effe-tool`

Otherwise you can simply download the source file and compile it yourself.

## Create your first effe

To create your first `effe` all you need to do is `effe-tool new foo.go`.

This command will created the file `foo.go`.

Such file is already a valid `effe`, it serves as introductory example, but it is very scarse and you can easily bend it to your will.

``` go
simo@simo:~/gopath$ effe-tool new foo.go
Successfully created the new effe, path: foo.go
simo@simo:~/gopath$ cat foo.go

package logic

import (
	"fmt"
	"math/rand"
	"net/http"
	"time"
		// it is possible to import any library in your gopath
)

var Info string = `
{
	"name": "hello_effe",  // these info will be used to
	"version": "0.1",      // create the name of the executable
	"doc" : "Getting start with effe"
}
`

type Context struct {
	value int64
}

func Init() {
	rand.Seed(time.Now().UTC().UnixNano())
}

func Start() (Context, error) {
	fmt.Println("Start new Context")
	return Context{1 + rand.Int63n(2)}, nil
}

func Run(ctx Context, w http.ResponseWriter, r *http.Request) error {
	fmt.Fprintf(w, "Hello from Effe:  %d\n", ctx.value)
	return nil
}

func Stop(ctx Context) { return }

```

## Compile your effe

Compile your `effe` is very simple as well. Continuing the example above all you need to do is `effe-tool compile foo.go`.

This simple command will compile your `effe`, the executable will be called as specified in the `Info` variable inside the source file.

It is also possible to specify in what directory put the executable, `--dirout dir_name` (default to `out/`) and how to call the executable, `--out name`, by default it will be called using the variable `Info` inside the source file.

``` bash
simo@simo:~/gopath$ effe-tool compile foo.go
File: foo.go | Everything went good, the file is been compiled.
Executable path: /home/simo/gopath/out/hello_effe_v0.1
simo@simo:~/gopath$ tree out/
out/
└── hello_effe_v0.1

0 directories, 1 file
```

Please keep in mind that effes are compiled with the option `GCO_ENABLE=0`

This because it makes possible to run `effe` in a extremely light container.

Since the GCO disabled could break something, is still possible to compile with GCO enabled, just pass the `--cgo` option during the compilation phase.

``` bash
simo@simo:~/gopath$ effe-tool compile foo.go
File: foo.go | Everything went good, the file is been compiled.
Executable path: /home/simo/gopath/out/hello_effe_v0.1
simo@simo:~/gopath$ ldd out/hello_effe_v0.1
	not a dynamic executable
simo@simo:~/gopath$ effe-tool compile --cgo foo.go
File: foo.go | Everything went good, the file is been compiled.
Executable path: /home/simo/gopath/out/hello_effe_v0.1
simo@simo:~/gopath$ ldd out/hello_effe_v0.1
	linux-vdso.so.1 =>  (0x00007fffceffe000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ffd5ac85000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffd5a8c0000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ffd5aecd000)
```

## Compile a whole directory

It is also possible to compile a whole directory of `effe`s.

All you need to do is `effe-tool compile directory/` and `effe-tool` will try to compile every single file in that directory, it is pretty resistent to error and it will print all the information you may need.

When compiling a directory you can still provide the `--dirout dir_name` flag to decide in which directory put the resulting executable.

Also, keep in mind that compile preserve the folder structure of the source directory into the binary directory.

## Run your effe

Once your `effe` is been compiled you can run it, following the example above it is sufficient to run: `./out/hello_effe_v0,1`

Now if you go to `localhost:8080` you should see a welcome message.

``` bash
simo@simo:~$ curl http://localhost:8080
Hello from Effe:  2
```

## Docker integration

It is also possible to create docker containers out of compiled `effe`.

Under the hood `effe-tool` simply invoke the docker commands, so make sure that your user can create the docker container.

``` bash
simo@simo:~/gopath$ effe-tool docker out/hello_effe_v0.1
WARNING: Error loading config file:/home/simo/.docker/config.json - stat /home/simo/.docker/config.json: permission denied
Sending build context to Docker daemon  5.48 MB
Step 1 : FROM centurylink/ca-certs
 ---> ec29b98d130f
Step 2 : ADD exec exec
 ---> 9dae5b436645
Removing intermediate container 927ade657ba3
Step 3 : ENTRYPOINT /exec
 ---> Running in b8abe3aafa78
 ---> 8f4339a840f7
Removing intermediate container b8abe3aafa78
Successfully built 8f4339a840f7
File: out/hello_effe_v0.1 | Everything went good: /tmp/effedocker-849288
simo@simo:~/gopath$
simo@simo:~/gopath$ docker images
REPOSITORY                                 TAG                 IMAGE ID            CREATED             SIZE
hello_effe                                 0.1                 8f4339a840f7        16 seconds ago      5.735 MB
```

The docker images is extremely simple, it start from `centurylink/ca-certs` which is the `SCRATCH` images plus some certificated so that your effe can make HTTPS calls.

## Contributing

Please.

You can simply open an issues or a pull request, I will do my best to reply promptly.

If you want to contribute but you don't know what to do just write me, I have more ideas than time.

If the effe source is modified is necessary to reload it using:
`go-bindata -o sources/bindata.go -pkg sources effe/effe.go effe/logic/logic.go` from the `effe-tool` root.

The command will generate a source file `source/bindata.go` that contains the file saved as byte.

## License

`effe-tool` is released under the MIT License, the same of `effe`.

[effe]: https://github.com/siscia/effe

repository: siscia/effe-tool

gha_language: Go

repo_name: siscia/effe-tool


text:
# Course intro

## Course background

* Designed as hands-on classroom course
* *from techies for techies*
* Historically very free-flowing
* No slides, only markdown, Vagrantfiles and instructors in classroom
* Tentative timeline, *grab coffee when you need it*, rearranging topics
* Make students go through painful troubleshooting on purpose!
    * You don't store this knowledge from listening to lectures or copy-pasting commands

## Taking it remote

* 6x3h sessions
* spread out over 2 weeks
* to avoid burnout
* shortened format
* timeline is still tentative

## TODO

* Teaching Suricata (well, duh)
* Back to basics, cut some tricky stuff
  * log shipping, group work, etc
* Focus on core Suricata on week 1
  * rules, EVE, replay, rulesets, malware pcap explore
* Advanced topics on week 2
  * building, config, datasets, lua, elastic
* Rules, rulesets, JSON logs, replay

## Goal / Important notes

* Passing on our knowledge
    * But we are not full-time teachers
* Everyone takes something home
* Open materials, repeatable environments
* No Powerpoint, only markdown and git
* Materials are in ArchLinux Wiki style!

## Instructors

* https://github.com/markuskont
* https://github.com/mpihelgas
* https://github.com/regit

## Tooling

* github
* Vagrant **
* command line
* jupyter notebooks
* docker

repository: markuskont/CDMCS

repo_name: markuskont/CDMCS


text:
#
 Proxmox VM with Home Assistant OS

To create a new Proxmox VM with the latest version of Home Assistant OS, run the following from Proxmox web shell

```
bash -c "$(wget -qLO - https://github.com/tteck/proxmox_haos_vm/raw/master/install.sh)"
```
###
:zap: Default Settings:  4GB RAM - 32GB Storage - 2vCPU :zap:

After the script completes, If you're dissatisfied with the default settings, click on the VM, then on the **_Hardware_** tab and change the **_Memory_** and **_Processors_** settings to what you desire. Once all changes have been made, **_Start_** the VM.


text:
# Share plugin

[![pub package](https://img.shields.io/pub/v/share.svg)](https://pub.dartlang.org/packages/share)

A Flutter plugin to share content from your Flutter app via the platform's
share dialog.

Wraps the ACTION_SEND Intent on Android and UIActivityViewController
on iOS.

## Usage
To use this plugin, add `share` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).

## Example

Import the library via
``` dart
import 'package:share/share.dart';
```

Then invoke the static `share` method anywhere in your Dart code
``` dart
Share.share('check out my website https://example.com');
```


text:
# celery-redundant-scheduler

[Celery](http://celeryproject.org) beat scheduler providing ability to run multiple `celerybeat` instances.

# Problem
Production level deployment requires redundancy and fault-tolerance environment. Unfortunately [Celery](http://celeryproject.org) doesn't provide periodic tasks scheduling redundancy out of the box. Running multiple `celerybeat` instances results multiple scheduled tasks queuing. This package provides synchronized scheduler class with failover support. By default `redis` backend used, but developers are free too use their own based on package primitives.

# Installation
```#bash
pip install celery-redundant-scheduler
pip install git+https://github.com/MnogoByte/celery-redundant-scheduler.git
```

# Usage
1. Setup scheduler synchronization backend:

        CELERYBEAT_REDUNDANT_BACKEND_OPTIONS = {
            'HOST': 'localhost',
            'PORT': 6379,
            'DB': 0,
            'PASSWORD': 'secret'
        }

2. Provide `--scheduler=celery_redundant_scheduler:RedundantScheduler` option running your `worker` or `beat` instance.

# Settings
- `CELERYBEAT_REDUNDANT_BACKEND_OPTIONS` - redis connection options.
- `CELERYBEAT_REDUNDANT_REDIS_KEYPREFIX` - prefix for redis keys. Default is `redundant-scheduler`.
- `CELERYBEAT_REDUNDANT_REDIS_LOCK_EXPIRES` - redis lock timeout. Default is 60 seconds.

# Using custom scheduler synchronization backend
1. Define subclass of `celery_redundant_scheduler.backends.base:BaseBackend`.
2. Override back-end interaction methods.
3. Provide backend options with `CELERYBEAT_REDUNDANT_BACKEND_OPTIONS`
4. Claim using your subclass providing `CELERYBEAT_REDUNDANT_BACKEND` setting or environment variable.

# Author

[Antonov Mikhail](https://github.com/atin65536)

# License

BSD - 3

repository: SMASHDOCs/celery-redundant-scheduler

repo_name: SMASHDOCs/celery-redundant-scheduler


text:
---
layout: post
title: "Automatic Video Colorization using 3D Conditional Generative Adversarial Networks"
date: 2019-05-08 12:06:29
categories: arXiv_CV
tags: arXiv_CV Adversarial GAN CNN
author: Panagiotis Kouzouglidis, Giorgos Sfikas, Christophoros Nikou
mathjax: true
---

* content
{:toc}

##### Abstract
In this work, we present a method for automatic colorization of grayscale videos. The core of the method is a Generative Adversarial Network that is trained and tested on sequences of frames in a sliding window manner. Network convolutional and deconvolutional layers are three-dimensional, with frame height, width and time as the dimensions taken into account. Multiple chrominance estimates per frame are aggregated and combined with available luminance information to recreate a colored sequence. Colorization trials are run succesfully on a dataset of old black-and-white films. The usefulness of our method is also validated with numerical results, computed with a newly proposed metric that measures colorization consistency over a frame sequence.

##### Abstract (translated by Google)

##### URL
[http://arxiv.org/abs/1905.03023](http://arxiv.org/abs/1905.03023)

##### PDF
[http://arxiv.org/pdf/1905.03023](http://arxiv.org/pdf/1905.03023)


text:
# Native Javascript for Bootstrap
This is a set of scripts developed with vanilla Javascript, with superior performance compared to the original jQuery Plugins for Bootstap 3.
See demo for examples and instructions.

# CDN
New releases will be available automatically on jsdelivr CDN repositories here.

# Browser Support
The scripts are developed with clean code mainly for modern browsers that nativelly support HTML5. When using polyfills IE8-IE9 will thank you.

# License
The scripts are released under the MIT license.


text:
gammaSpectrum
=============

Welcome!  gammaSpectrum.js is a simple, lightweight JavaScript tool for making interactive histograms and 2D field plots in the browser, originally developed for the GRIFFIN Collaboration at TRIUMF.  gammaSpectrum is still under heavy development, so check back for new features and feel free to make requests!

Tested in Chrome & FF, and distributed under the MIT license.

#Usage

##Set-Up
gammaSpectrum has been built with an eye for creating simple custom builds, so you only have to use what you need!  Currently, there are three modules:

-  gammaSpectrum.js, the 1D histogram plotting package
-  fitit.js, for fitting 1D histograms (only bother including this if you're also using gammaSpectrum.js)
-  fieldViewer.js, for plotting 2D field intensity plots

Include each as needed in your page, and feel free to omit anything you're not using - the main modules are completely independent.  No matter what configuration you choose, you must include the fabulous [easel.js](http://www.createjs.com/#!/EaselJS) via

    <script src="http://code.createjs.com/easeljs-0.7.0.min.js"></script>

All objects are kept nicely namespaced in their respective objects, and one function each are appended to the prototypes of canvas and Math, respectively.

##1D Spectra - gammaSpectrum.js

###Instantiation
Once it's loaded, spectrums can be plotted on any \<canvas\> element.  Just declare a new spectrumViewer object, pointing to your canvas' ID:

    var viewer = new spectrumViewer('spectrumCanvas');

Go ahead and declare as many of these canvas / viewer pairs as you need - everything is encapsulated so there shouldn't be any collision problems.

###Loading Data
Data to be plotted is loaded using the .addData method:

    viewer.addData('myPlot', [0,0,1,4,9,16,9,4,1,0,0]);

would add the array in the second argument to the list of histograms to be plotted, and assign the key 'myPlot' to reference it by.  Data series can be removed with

    viewer.removeData('myPlot');

gammaSpectrum comes with a fake spectrum you can play around with, which is loaded in the demo page.

###Options
Have a look in the gammaSpectrum.js file near the top, under the heading 'member variables' - this section has a list of all the parameters that govern plot generation, and comments describing them.  You don't need to do anything to run the demo, but here's where all the options are if you're looking for them.

###Plot Interactions
gammaSpectrum offers several pre-packaged methods for interacting with your spectra.

####Mouseover
When you mouse over a spectrumViewer object, it keeps track of what x and y bin you're pointing at.  There's an example in the demo of how to also pass in a callback to the mouseover event, so you can do things with those numbers as the mouse moves.

  Try all of these in the included demo.html.

#####Click Window
Open up the demo.html example in a browser, and click on either side of one of the peaks - voila!  The display zooms in to be bounded by the two x-bins you clicked on, no extra setup required.

#####Unzoom
Unzoom is set up by default as the canvas' double-click feature.  Also, the demo provides an example of attaching the unzoom() method to a button.

#####Drag Window
Mouse down on the plot, drag across, and release - the window zooms in on the range you dragged over.

#####Scroll Window
Functionality is provided to easily make scroll buttons for your spectrum.  The 'left' and 'right' buttons in demo.html are an example of how to set these up; try changing the +-100 parameter to change how far the plot scrolls on every click.

#####Log Scale
Linear and Log Y axes are available per the example.

#####
Spectrums that have been loaded into the spectrum viewer can be hidden and recalled at will by use of the toggleSpectrum method.  toggleSpectrum takes two arguments: the name of the data set to show or hide, and a boolean corresponding to whether or not to hide the spectrum (ie true === hidden).

####Fitting
gammaSpectrum was built for looking at gamma ray spectra (surprise!), so currently the only fit function available is a gaussian.

The fitting suite in gammaSpectrum, fitit.js, is a first-pass at a maximum likelihood fitter.  An instance of this tool requires the following minimal member variables to be defined in order to converge a fit:

    fitter.x: array containing the left edge of each channel in x
    fitter.y: array containing the y values corresponding the the channels in fitter.x
    fitter.fxn: JS function of the form function(x, par), where x is the indept. variable and par is an array of arguments.
    fitter.guess: guess for the initial value of par in fitter.fxn

At present, the fitter assumes channels are all 1 unit wide, and associates the corresponding y value with the center of that bin; better generality forthcoming.  Likelihood is computed from the poissonian probability of seeing the observed number of counts in each bin if the true average is given by fitter.fxn; this likelihood is extremized by walking down the gradient of the likelihood function from the point in parameter space fitter.guess, towards the corresponding local minimum.  Derivatives for this gradient are approximated using a two-step Richardson extrapolation.

If that all sounds a bit ambitious, gammaSpectrum has a flag .MLfit, which when set to false will replace the maximum likelihood fit with a simple gaussian approximation using the mode of the region selected, and the width of the peak around that max.

In either case, to fit a peak, tell the spectrumViewer object which spectrum you want to fit by setting the member variable fitTarget to the key tagging the data in plotBuffer, and then enter fit mode for the spectrumViewer object by calling the member function setupFitMode.  Then, just click on the plot to the left and right of the peak you want to fit, and voila!  A gaussian guess is drawn.  Pass in a callback to fetch the fit parameters out and do something with them, like the example in demo.html.

##2D Fields - fieldViewer.js

The fieldViewer.js module provides support for drawing temperature-style intensity plots of a field of values.  It works a lot like the 1D module, save for a few salient differences:

###Instantiation
Simmilarly to 1D spectra, 2D fields can be plotted on any \<canvas\> element:

    var field = new fieldViewer('fieldCanvas');

###Loading Data
Data management is a bit simpler in the 2D case, since overlaying fields would look terrible and so only one field need be loaded at a time.  Simply populate the .plotBuffer with a two-index array, where the first index runs over rows (ie the y axis), and the second index runs over columns (ie the x axis).  There's a dummy field available for you to see some results quickly:

    field.plotBuffer = field.fakeData.gaussian;

###Interactions
fieldViewer objects have analagous interactions to their 1D counterparts; clicking two points on a field will crop to a box defined by those two points, and dragging while holding down the left mouse button will achieve a similar effect.  Double click to zoom back out.  The demo also has an example of using the member functions scrollX and scrollY, for walking around the canvas in increments of your choosing.

repository: BillMills/gammaSpectrum

repo_name: BillMills/gammaSpectrum


text:
---
metaTitle: "MySQL - MySQL Admin"
description: "Atomic RENAME & Table Reload, Change root password, Drop database"
---

# MySQL Admin

## Atomic RENAME & Table Reload

```sql
RENAME TABLE t TO t_old, t_copy TO t;

```

No other sessions can access the tables involved while RENAME TABLE executes, so the rename operation is not subject to concurrency problems.

Atomic Rename is especially for completely reloading a table without waiting for `DELETE` and load to finish:

```sql
CREATE TABLE new LIKE real;
load `new` by whatever means - LOAD DATA, INSERT, whatever
RENAME TABLE real TO old, new TO real;
DROP TABLE old;

```

## Change root password

```sql
mysqladmin -u root -p'old-password' password 'new-password'

```

## Drop database

Useful for scripting to drop all tables and deletes the database:

```sql
mysqladmin -u[username] -p[password] drop [database]

```

Use with extreme caution.

To `DROP` database as a SQL Script (you will need DROP privilege on that database):

```sql
DROP DATABASE database_name

```

or

```sql
DROP SCHEMA database_name

```

repository: haifenghuang/generate

repo_name: haifenghuang/generate


text:
# MetaMagic

[![Build Status](https://travis-ci.org/johnotander/meta_magic.svg?branch=master)](https://travis-ci.org/johnotander/meta_magic)

Some useful methods for object-agnostic views, controllers, and models.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'meta_magic'
```

And then execute:

```
$ bundle
```

Or install it yourself as:

```
$ gem install meta_magic
```

## Usage

### The Helpers

Sometimes it can be a pain when you need to link to certain actions when you don't necessarily know what type of object you have in a Rails view. The `object_path` and `objects_path` methods make this easy.

First, include helper in your `helpers/application_helper.rb` to gain access to the methods in your view:

```ruby
module ApplicationHelper
  include MetaMagic::Helper
end
```

Then, link away:

```html+erb
<%= link_to object.display_name, object_path(@user_object) %>
<!-- <a href="/users/:id">John Doe</a> -->

<%= link_to 'See Activity', object_path(product_object, action: :activities) %>
<!-- <a href="/products/:id/activities">See Activity</a> -->

<%= link_to 'See All', objects_path(@book) %>
<!-- <a href="/books">See All</a> -->
```

### The Controllers

The controller methods are quite handy for controller concerns, especially when the concerns are shared across multiple controllers.

```ruby
class UsersController < ApplicationController
  include MetaMagic::Controller
end
```

Including Meta Magic will expose a few handy methods that can be used dynamically amongst controllers:

```ruby
def get_model_instance_variable
  instance_variable_get(:"@#{ controller_name.classify.underscore.downcase }")
end

def set_model_instance_variable
  send(:"set_#{ controller_name.classify.underscore.downcase }")
end

def assign_models_instance_variable_array
  instance_variable_set(:"@#{ controller_name }", get_model_class.all)
end

def get_model_class
  controller_name.classify.constantize
end
```

## Contributing

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


text:
---
id: customize-startup
title: Customizing Startup Behavior
---

## Allow retries when adding objects to OPA

Gatekeeper's webhook servers undergo a bootstrapping period during which they are unavailable until the initial set of resources (constraints, templates, synced objects, etc...) have been ingested. This prevents Gatekeeper's webhook from validating based on an incomplete set of policies. This wait-for-bootstrapping behavior can be configured.

The `--readiness-retries` flag defines the number of retry attempts allowed for an object (a Constraint, for example) to be successfully added to OPA.  The default is `0`.  A value of `-1` allows for infinite retries, blocking the webhook until all objects have been added to OPA.  This guarantees complete enforcement, but has the potential to indefinitely block the webhook from serving requests.

## Enable profiling using `pprof`

The `--enable-pprof` flag enables an HTTP server for profiling using the [pprof](https://pkg.go.dev/net/http/pprof) library. By default, it serves to `localhost:6060` but the port can be customized with the `--pprof-port` flag.

## Disable certificate generation and rotation for Gatekeeper's webhook

By default, Gatekeeper uses [`open-policy-agent/cert-controller`](https://github.com/open-policy-agent/cert-controller) to handle the webhook's certificate rotation and generation. If you want to use a third-party solution, you may disable the cert-controller feature using `--disable-cert-rotation`.

## Disable OPA built-in functions

The `--disable-opa-builtin` flag disables specific [OPA built-ins functions](https://www.openpolicyagent.org/docs/v0.37.2/policy-reference/#built-in-functions). Starting with v3.8.0, Gatekeeper disables the `http.send` built-in function by default. For more information, please see [external data](./externaldata.md#motivation).

## [Alpha] Emit admission and audit events

The `--emit-admission-events` flag enables the emission of all admission violations as Kubernetes events. This flag is in alpha stage and it is set to `false` by default.

The `--emit-audit-events` flag enables the emission of all audit violation as Kubernetes events. This flag is in alpha stage and it is set to `false` by default.

The `--admission-events-involved-namespace` flag controls which namespace admission events will be created in. When set to `true`, admission events will be created in the namespace of the object violating the constraint. If the object has no namespace (ie. cluster scoped resources), they will be created in the namespace Gatekeeper is installed in. Setting to `false` will cause all admission events to be created in the Gatekeeper namespace.

The `--audit-events-involved-namespace` flag controls which namespace audit events will be created in. When set to `true`, audit events will be created in the namespace of the object violating the constraint. If the object has no namespace (ie. cluster scoped resources), they will be created in the namespace Gatekeeper is installed in. Setting to `false` will cause all audit events to be created in the Gatekeeper namespace.

There are four types of events that are emitted by Gatekeeper when the emit event flags are enabled:

| Event              | Description                                                             |
| ------------------ | ----------------------------------------------------------------------- |
| `FailedAdmission`  | The Gatekeeper webhook denied the admission request (default behavior). |
| `WarningAdmission` | When `enforcementAction: warn` is specified in the constraint.          |
| `DryrunViolation`  | When `enforcementAction: dryrun` is specified in the constraint.        |
| `AuditViolation`   | A violation is detected during an audit.                                |

> ❗ Warning: if the same constraint and violating resource tuple was emitted for [more than 10 times in a 10-minute rolling interval](https://github.com/kubernetes/kubernetes/blob/v1.23.3/staging/src/k8s.io/client-go/tools/record/events_cache.go#L429-L438), the Kubernetes event recorder will aggregate the events, e.g.
> ```
> 39s         Warning   FailedAdmission   namespace/test      (combined from similar events):  Admission webhook "validation.gatekeeper.sh" denied request, Resource Namespace: , Constraint: ns-must-have-gk, Message: you must provide labels: {"gatekeeper"}
> ```
> Gatekeeper might burst 25 events about an object, but limit the refill rate to 1 new event every 5 minutes. This will help control the long-tail of events for resources that are always violating the constraint.

## [Beta] Enable mutation logging and annotations

The `--log-mutations` flag enables logging of mutation events and errors.

The `--mutation-annotations` flag adds the following two annotations to mutated objects:

| Annotation                  | Value                                                                                |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gatekeeper.sh/mutation-id` | The UUID of the mutation.                                                                                |
| `gatekeeper.sh/mutations`   | A list of comma-separated mutations in the format of `<MutationType>/<MutationNamespace>/<MutationName>:<MutationGeneration>` that are applied to the object. |

## Other Configuration Options

For the complete list of configuration flags for your specific version of Gatekeeper, run the Gatekeeper binary with the `--help` flag. For example:

`docker run openpolicyagent/gatekeeper:v3.10.0-beta.0 --help`

To ensure you are seeing all relevant flags, be sure the image tag (`:3.10.0-beta.0` above) corresponds with the version of Gatekeeper you are running.

repository: open-policy-agent/gatekeeper

repo_name: open-policy-agent/gatekeeper


text:
---
category: advanced
slug: /advanced/lifecycle-scripts
title: "Lifecycle Scripts"
description: An overview of Yarn's supported lifecycle scripts.
---

Packages can define in the `scripts` field of their manifest various actions that should be executed when the package manager executes a particular workflow.

:::info
Note that we don't support every single lifecycle script originally present in npm. This is a deliberate decision based on the observation that too many lifecycle scripts make it difficult to know which one to use in which circumstances, leading to confusion and mistakes. We are open to add the missing ones on a case-by-case basis if compelling use cases are provided.

In particular, we intentionally don't support arbitrary `pre` and `post` hooks for user-defined scripts (such as `prestart`). This behavior caused scripts to be implicit rather than explicit, obfuscating the execution flow. It also sometimes led to surprising behaviors, like `yarn serve` also running `yarn preserve`.
:::

## `prepack` and `postpack`

Those script are called right at the beginning and the end of each call to `yarn pack`. They are respectively meant to turn your package from development into production, and cleanup any lingering artifact. For instance, a typical `prepack` script would call Babel or TypeScript on the source directory to turn `.ts` files into `.js` files.

:::info
Although rarely called directly, `yarn pack` is a crucial part of Yarn. Each time Yarn has to fetch a dependency from a "raw" source (such as a Git repository), it will automatically run `yarn install` and `yarn pack` to generate the package to use.
:::

## `prepublish`

This script is called before `yarn npm publish` before the package has even been packed. This is the place where you'll want to check that the project is in an ok state.

:::caution
Because it's only called on prepublish, **the prepublish hook shouldn't have side effects.** In particular don't transpile the package sources in `prepublish`, as people consuming directly your repository (such as through the [`git:` protocol](/features/protocols#git)) wouldn't be able to use your project. Instead, use `prepack`.
:::

## `postinstall`

This script is called after the package dependency tree changed in any way -- usually after a dependency (or transitive dependency) got added, removed, or updated, but also sometimes when the project configuration or environment changed (for example when changing the Node.js version).

It is guaranteed to be called in topological order (in other words, your dependencies' `postinstall` scripts will always run before yours).

For backwards compatibility, the `preinstall` and `install` scripts, if presents, are called right before running the `postinstall` script from the same package. In general, prefer using `postinstall` over those two.

:::warning
Postinstall scripts have should be avoided at all cost, as they make installs slower and riskier. Many users will refuse to install dependencies that have `postinstall` scripts. Additionally, since the output isn't shown out of the box, using them to print a message to the user will not work as you expect.
:::

## Environment variables

When running scripts and binaries, some environment variables are usually made available:

| Variable | Description |
| --- | --- |
| `$INIT_CWD` | Directory from which the script has been invoked. This isn't the same as the cwd, which for scripts is always equal to the closest package root. |
| `$PROJECT_CWD` | Root of the project on the filesystem. |
| `$npm_package_name` | Name of the running package. |
| `$npm_package_version` | Version of the running package. |
| `$npm_package_json` | Absolute path to the `package.json` of the running package. |
| `$npm_execpath` | Absolute path to the Yarn binary. |
| `$npm_node_execpath` | Absolute path to the Node binary. |
| `$npm_config_user_agent` | String defining the Yarn version currently in use. |
| `$npm_lifecycle_event` | Name of the script or lifecycle event, if relevant. |

repository: yarnpkg/berry

gha_language: TypeScript

repo_name: yarnpkg/berry


text:
BlackFlatTheme for trac 1.2.*
=============================

Forked from https://trac-hacks.org/svn/blueflattheme/

read [COPYING.txt](COPYING.txt)

# Installation
```
pip install svn+https://trac-hacks.org/svn/themeengineplugin/trunk/
pip install git+https://github.com/barjomet/blackflattheme
```

Enable ThemeEnginePlugin and BlackFlatTheme by adding the following to your trac.ini file:

```
[components]
blueflattheme.theme.* = enabled
themeengine.* = enabled

[theme]
theme = blueflat
```

You may do this from the admin pages, too.

repository: barjomet/blackflattheme

repo_name: barjomet/blackflattheme


text:
# Formik and React Native Formik Step by Step

This is the livecoding session done at [a meetup](https://www.meetup.com/fr-FR/ReactJS-Paris/events/256773363/) to explain how easy it is to implement forms with `formik`, and why we built react-native-formik to make it even easier.

- [Step 0: let's start with a simple useless form](#step-0-lets-start-with-a-simple-useless-form)
- [Step 1: wrap it in Formik](#step-1-wrap-it-in-formik)
- [Step 2: connect our inputs to the formik context](#step-2-connect-our-inputs-to-the-formik-context)
- [Step 3: let's submit!](#step-3-lets-submit)
- [Step 4: So easy to add validation](#step-4-so-easy-to-add-validation)
- [Step 5: Show errors only when necessary](#step-5-show-errors-only-when-necessary)
- [Step 6: Introducing react-native-formik](#step-6-introducing-react-native-formik)
- [Step 7: handling types of inputs](#step-7-handling-types-of-inputs)
- [Step 8: auto focus the next input](#step-8-auto-focus-the-next-input)
- [Step 9: handle any component](#step-9-handle-any-component)
- [Step 10: Questions?](#step-10-questions)

## Step 0: let's start with a simple useless form

```javascript
import React from "react";
import { Button, TextInput, View } from "react-native";
import { TextField } from "react-native-material-text-field";

export default () => (
  <View style={{ padding: 10 }}>
    <TextField label="email" />
    <TextField label="password" />

    <Button onPress={() => alert("SUBMIT WOUHOU")} title="SUBMIT" />
  </View>
);
```

![image](https://user-images.githubusercontent.com/4534323/50046957-da65f280-00ac-11e9-8aa1-7a7a5b5b6336.png)

Obviously this won't do much, let's wrap it in Formik.

## Step 1: wrap it in Formik

`formik` provides context to the form that we can display in a `Text` component.

```javascript
import React from "react";
import { Text, View } from "react-native";
import { Formik } from "formik";
import { TextField } from "react-native-material-textfield";

export default props => (
  <Formik>
    {props => {
      return (
        <View style={{ padding: 10 }}>
          <TextField label="email" />
          <TextField label="password" />

          <Text style={{ fontSize: 20 }}>{JSON.stringify(props, null, 2)}</Text>
        </View>
      );
    }}
  </Formik>
);
```

![image](https://user-images.githubusercontent.com/4534323/50047009-accd7900-00ad-11e9-9488-990069375f19.png)

As we can see, `formik` exposes the whole form state, but typing text doesn't change anything. Indeed, we have to explicitely tell our inputs to modify the formik context when their values change.

## Step 2: connect our inputs to the formik context

We'll add `onChangeText={text => props.setFieldValue("email", text)}` on the inputs:

```javascript
import React from "react";
import { Text, View } from "react-native";
import { Formik } from "formik";
import { TextField } from "react-native-material-textfield";

export default props => (
  <Formik>
    {props => {
      return (
        <View style={{ padding: 10 }}>
          <TextField
            label="email"
            onChangeText={text => props.setFieldValue("email", text)}
          />
          <TextField
            label="password"
            onChangeText={text => props.setFieldValue("password", text)}
          />

          <Text style={{ fontSize: 20 }}>{JSON.stringify(props, null, 2)}</Text>
        </View>
      );
    }}
  </Formik>
);
```

Awesome, now the values are updated directly!

![image](https://user-images.githubusercontent.com/4534323/50047036-4432cc00-00ae-11e9-95c5-8a3fedac0f34.png)

## Step 3: let's submit!

We can now add a `Button` to submit:

```javascript
import React from "react";
import { Button, Text, View } from "react-native";
import { Formik } from "formik";
import { TextField } from "react-native-material-textfield";

export default props => (
  <Formik onSubmit={values => alert(JSON.stringify(values, null, 2))}>
    {props => {
      return (
        <View style={{ padding: 10 }}>
          <TextField
            label="email"
            onChangeText={text => props.setFieldValue("email", text)}
          />
          <TextField
            label="password"
            onChangeText={text => props.setFieldValue("password", text)}
          />

          <Button onPress={props.handleSubmit} title="SUBMIT" />

          <Text style={{ fontSize: 20 }}>{JSON.stringify(props, null, 2)}</Text>
        </View>
      );
    }}
  </Formik>
);
```

![image](https://user-images.githubusercontent.com/4534323/50047050-a12e8200-00ae-11e9-9635-2e649fe11f2a.png)

## Step 4: So easy to add validation

We can create a `validationSchema` with the JS lib `yup` and bring validation to our form with ease!
Plus it's easy to add any custom validation message you'd like.
Since `react-native-material-text-field` takes `error` as prop, let's pass it

```javascript
import React from "react";
import { Button, Text, View } from "react-native";
import { Formik } from "formik";
import { TextField } from "react-native-material-textfield";
import * as Yup from "yup";

const validationSchema = Yup.object().shape({
  email: Yup.string()
    .required()
    .email("Welp, that's not an email"),
  password: Yup.string()
    .required()
    .min(6, "That can't be very secure")
});

export default props => (
  <Formik
    onSubmit={values => alert(JSON.stringify(values, null, 2))}
    validationSchema={validationSchema}
  >
    {props => {
      return (
        <View style={{ padding: 10 }}>
          <TextField
            label="email"
            onChangeText={text => props.setFieldValue("email", text)}
            error={props.errors.email}
          />
          <TextField
            label="password"
            onChangeText={text => props.setFieldValue("password", text)}
            error={props.errors.password}
          />

          <Button onPress={props.handleSubmit} title="SUBMIT" />

          <Text style={{ fontSize: 20 }}>{JSON.stringify(props, null, 2)}</Text>
        </View>
      );
    }}
  </Formik>
);
```

`formik` automatically validates your fields and prevents submission if there are errors.

![image](https://user-images.githubusercontent.com/4534323/50047106-81e42480-00af-11e9-8551-cc91b2813c1a.png)

Now we have an issue though, the errors display as soon as I type anything, quite annoying for the user.

## Step 5: Show errors only when necessary

The best practice is to show an error only if an input has been focused then left (we'll mark it as "touched" in formik in that case) or if the form has been submitting.
The good news is we can handle that with what `formik` gives us:

We can add on the input:

```javascript
error={
  props.touched.email || props.submitCount > 0
    ? props.errors.email
    : null
}
```

And the code becomes:

```javascript
import React from "react";
import { Button, Text, View } from "react-native";
import { Formik } from "formik";
import { TextField } from "react-native-material-textfield";
import * as Yup from "yup";

const validationSchema = Yup.object().shape({
  email: Yup.string()
    .required()
    .email("Welp, that's not an email"),
  password: Yup.string()
    .required()
    .min(6, "That can't be very secure")
});

export default props => (
  <Formik
    onSubmit={values => alert(JSON.stringify(values, null, 2))}
    validationSchema={validationSchema}
  >
    {props => {
      return (
        <View style={{ padding: 10 }}>
          <TextField
            label="email"
            onChangeText={text => props.setFieldValue("email", text)}
            onBlur={() => props.setFieldTouched("email")}
            error={
              props.touched.email || props.submitCount > 0
                ? props.errors.email
                : null
            }
          />
          <TextField
            label="password"
            onChangeText={text => props.setFieldValue("password", text)}
            onBlur={() => props.setFieldTouched("password")}
            error={
              props.touched.password || props.submitCount > 0
                ? props.errors.password
                : null
            }
          />

          <Button onPress={props.handleSubmit} title="SUBMIT" />

          <Text style={{ fontSize: 20 }}>{JSON.stringify(props, null, 2)}</Text>
        </View>
      );
    }}
  </Formik>
);
```

Ok, we talked about reducing boilerplate, but I see a lot of code repetition between the password and the email input. We need a refactoring, and react-native-formik makes it easy for you.

## Step 6: Introducing react-native-formik

With react-native-formik:

```javascript
onChangeText={text => props.setFieldValue("password", text)}
onBlur={() => props.setFieldTouched("password")}
error={
  props.touched.password || props.submitCount > 0
    ? props.errors.password
    : null
}
```

is equivalent to:

```javascript
name = "password";
```

Thanks to a [High Order Component](https://reactjs.org/docs/higher-order-components.html) called `handleTextInput`.

The code becomes cleaner:

```javascript
import React from "react";
import { Button, Text, View } from "react-native";
import { Formik } from "formik";
import { handleTextInput } from "react-native-formik";
import { TextField } from "react-native-material-textfield";
import * as Yup from "yup";

const FormikInput = handleTextInput(TextField);

const validationSchema = Yup.object().shape({
  email: Yup.string()
    .required()
    .email("Welp, that's not an email"),
  password: Yup.string()
    .required()
    .min(6, "That can't be very secure")
});

export default props => (
  <Formik
    onSubmit={values => alert(JSON.stringify(values, null, 2))}
    validationSchema={validationSchema}
  >
    {props => {
      return (
        <View style={{ padding: 10 }}>
          <FormikInput label="email" name="email" />
          <FormikInput label="password" name="password" />

          <Button onPress={props.handleSubmit} title="SUBMIT" />

          <Text style={{ fontSize: 20 }}>{JSON.stringify(props, null, 2)}</Text>
        </View>
      );
    }}
  </Formik>
);
```

## Step 7: handling types of inputs

But now we're lacking a few essential features. You probably noticed some unacceptable behaviors in the form. Yes:

- the password input is not hidden
- it's also auto capitalized
- the email input doesn't show the `@` in the keyboard

Whenever you build a form, there are a few input props you should never forget to set.

The good news is with `react-native-formik`, you can just add a `type` to your input:

```javascript
<FormikInput label="email" name="email" type="email" />
```

Much better:
![image](https://user-images.githubusercontent.com/4534323/50047210-67ab4600-00b1-11e9-9282-7f4f0e92739f.png)

## Step 8: auto focus the next input

When typing on a form, users can be used to click "next" on the keyboard to automatically go to the next input and submit on the last input.

In React Native, to do so, you have to change `returnKeyType` on your inputs, and add `onSubmitEditing={() => this.nextInputRef.focus()}` on every input. Which requires you to add refs to all your inputs.

With `react-native-formik`, we can use two HOC:

- `withNextInputAutoFocusForm` on the view containing all inputs
- `withNextInputAutoFocusInput` on the inputs

as long as the decorated input:

- is a class
- has a focus metho

With code as small as this, we have this behavior handled:

```javascript
import React from "react";
import { Button, Text, View } from "react-native";
import { Formik } from "formik";
import { compose } from "recompose";
import {
  handleTextInput,
  withNextInputAutoFocusForm,
  withNextInputAutoFocusInput
} from "react-native-formik";
import { TextField } from "react-native-material-textfield";
import * as Yup from "yup";

const FormikInput = compose(
  handleTextInput,
  withNextInputAutoFocusInput
)(TextField);
const InputsContainer = withNextInputAutoFocusForm(View);

const validationSchema = Yup.object().shape({
  email: Yup.string()
    .required()
    .email("Welp, that's not an email"),
  password: Yup.string()
    .required()
    .min(6, "That can't be very secure")
});

export default props => (
  <Formik
    onSubmit={values => alert(JSON.stringify(values, null, 2))}
    validationSchema={validationSchema}
  >
    {props => {
      return (
        <InputsContainer style={{ padding: 10 }}>
          <FormikInput label="email" name="email" type="email" />
          <FormikInput label="password" name="password" type="password" />

          <Button onPress={props.handleSubmit} title="SUBMIT" />

          <Text style={{ fontSize: 20 }}>{JSON.stringify(props, null, 2)}</Text>
        </InputsContainer>
      );
    }}
  </Formik>
);
```

## Step 9: handle any component

Well there's more to life than TextInputs. But for any component you want to have, you can use `withFormikControl` to easily manage its state in `formik`.

`withFormikControl` will pass the following props:

```javascript
{
  value: ValueType,
  setFieldValue: (value: ValueType) => void,
  error: ?string,
  setFieldTouched: () => void
}
```

So, for instance you could have a simple `Switch` component:

```javacript
import React from "react";
import { Text, Switch as RNSwitch, View } from "react-native";
import { withFormikControl } from "react-native-formik";

class Switch extends React.PureComponent {
  render() {
    const { error, value, setFieldValue, label } = this.props;

    return (
      <View
        style={{
          flexDirection: "row",
          alignItems: "center",
          marginTop: 10
        }}
      >
        <RNSwitch
          value={value}
          ios_backgroundColor={error ? "red" : "transparent"}
          onValueChange={setFieldValue}
        />
        <Text style={{ marginLeft: 10, flex: 1 }}>{label}</Text>
      </View>
    );
  }
}

export default withFormikControl(Switch);
```

And easily add it to your form:

```javascript
import React from "react";
import { Button, Text, View } from "react-native";
import { Formik } from "formik";
import { compose } from "recompose";
import {
  handleTextInput,
  withNextInputAutoFocusForm,
  withNextInputAutoFocusInput
} from "react-native-formik";
import { TextField } from "react-native-material-textfield";
import * as Yup from "yup";
import Switch from "./Switch";

const FormikInput = compose(
  handleTextInput,
  withNextInputAutoFocusInput
)(TextField);
const InputsContainer = withNextInputAutoFocusForm(View);

const validationSchema = Yup.object().shape({
  email: Yup.string()
    .required()
    .email("Welp, that's not an email"),
  password: Yup.string()
    .required()
    .min(6, "That can't be very secure"),
  star: Yup.boolean()
    .required()
    .oneOf([true], "Feel free to submit an issue if you found some bugs!")
});

export default props => (
  <Formik
    onSubmit={values => alert(JSON.stringify(values, null, 2))}
    validationSchema={validationSchema}
  >
    {props => {
      return (
        <InputsContainer style={{ padding: 10 }}>
          <FormikInput label="email" name="email" type="email" />
          <FormikInput label="password" name="password" type="password" />
          <Switch
            label="If you like the repo, have you starred it 😁?"
            name="star"
          />
          <Button onPress={props.handleSubmit} title="SUBMIT" />

          <Text style={{ fontSize: 20 }}>{JSON.stringify(props, null, 2)}</Text>
        </InputsContainer>
      );
    }}
  </Formik>
);
```

![image](https://user-images.githubusercontent.com/4534323/50047321-19974200-00b3-11e9-929a-f5e73dc7bab3.png)

## Step 10: Questions?

Feel free to star this repo if you like it as well as [formik](https://github.com/jaredpalmer/formik)!
Please open issues if something's wrong with it, you can also ping me on [Twitter @almouro](https://twitter.com/almouro)

repository: bamlab/react-native-formik

repo_name: bamlab/react-native-formik


text:
fb_hostconf Cookbook
====================
This cookbook configures host.conf and provides an API for modifying all
aspects of host.conf

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

Attributes
----------
* node['fb_hostconf']['trim']
* node['fb_hostconf']['multi']
* node['fb_hostconf']['nospoof']
* node['fb_hostconf']['spoofalert']
* node['fb_hostconf']['spoof']
* node['fb_hostconf']['reorder']
* node['fb_hostconf']['order']

Usage
-----
Will take arbirtrary values under `node['fb_hostconf']` and write them out
to /etc/host.conf in different ways depending on the name of key or datatype
of the value.

If key name is 'spoof' or 'trim', the value is written out as is without
validation

If datatype of the value is an Array the values will be written out as
comma seperated strings

All other values are interpeted as boolean and if evaluated to true, the
string 'on' is written out else 'off' is written out.

See man host.conf for all settable attributes

The default sets `multi` to `true`.

repository: facebook/chef-cookbooks

gha_language: Ruby

repo_name: facebook/chef-cookbooks


text:
# processanimateR

> Flexible token replay animation for process maps

[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/processanimater)](https://cran.r-project.org/package=processanimater)
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)

Flexible token replay animation for process maps created through the [processmapR](https://github.com/gertjanssenswillen/processmapR/) package from the [bupaR](http://www.bupar.net) suite. This package uses [htmlwidgets](https://www.htmlwidgets.org/) and SVG animations ([SMIL](https://www.w3.org/standards/techs/smil#w3c_all)) to create the animation. Sizes, colors, and the image used for tokens are customizable based on trace, event attributes, or a secondary data frame if an attribute does not change according to the original event log.

## Getting Started

### Installing

ProcessanimateR is not yet available on CRAN. Please use the remotes package or similar means to install it directly from source.

```r
# install the remotes package
source("https://install-github.me/r-lib/remotes")

# use remotes to install the latest version of processanimateR
remotes::install_github("fmannhardt/processanimateR")

# or install a specific tag
<EMAIL_ADDRESS>```

### Usage

There are two main functions: `animate_process` and `ianimate_process` (interactive version).

We use the `patients` event log provided by the `eventdataR` package.
```r
library(processanimateR)
library(eventdataR)
data(patients)
```

A basic animation with static color and token size:
```r
animate_process(patients)
```

Default token color or size can be changed as follows:
```r
animate_process(patients, token_size = 2)
animate_process(patients, token_color = "red")
```

Dynamic token color or size can be achieved as follows:
```r
animate_process(add_token_color(patients, "time", "color"), token_color = "color")
animate_process(add_token_color(patients, "employee", "color", color_mapping = scales::col_factor("Paired", patients$employee)),
                token_color = "color")
```

There is also an interactive variant that starts a Shiny web-application. It expects that attributes are of an apropriate data type to choose a good color scale.
```r
library(edeaR)
library(dplyr)
ianimate_process(sepsis %>%
 filter_trace_frequency(percentage = 0.3) %>%
 # we fix the datatype of some of the attributes to allow proper rendering of the token color
 # the token size option currently only support numeric attributes
 mutate_at(c("lacticacid", "leucocytes", "crp", "age"), as.numeric) %>%
 mutate_at(c("disfuncorg", "sirscriteria2ormore", "infectionsuspected"), as.logical))
```

## Libraries Used
This package makes use of the following libraries:
* [d3](https://d3js.org), to dynamically changing the SVG;
* [fakesmil](https://github.com/FakeSmile/FakeSmile), to provide SMIL support in most browsers;
* [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom), for the panning/zooming option;
* [viz](https://github.com/mdaines/viz.js/), to compile the DOT generated by processmapR in JavaScript;
* [bupaR](https://github.com/gertjanssenswillen/bupaR), for the base Process Mining functions in R.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/fmannhardt/processanimateR/tags).

## Authors
Felix Mannhardt ([SINTEF Læring og beslutningsstøtte](https://www.sintef.no/sintef-teknologi-og-samfunn/arbeid_naringsliv/laring-og-beslutningsstotte/))

## License

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

## Acknowledgments

This software was developed in the [HUMAN project](http://www.humanmanufacturing.eu/), which has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement no. 723737 (HUMAN)

repository: gertjanssenswillen/processanimateR

repo_name: gertjanssenswillen/processanimateR