text:
#python-logging-proxy - Python Micro Interceptor Proxy with logging

A small and sweet logging man-in-the-middle proxy workig from pymiproxy.

##Introduction

python-logging-proxy is an addition on top of pymiproxy which gtives logging to
a sqlite database, which can then be used as you like.

##Installation Requirements

The following modules are required:

- pyOpenSSL
- pyMIProxy

##Installation

Just run the following command at the command prompt:

```bash
$ sudo pip install python-logging-proxy
```

##Usage

To start python-logging-proxy run:

```bash
$ python -m python_logging_proxy
```

This will log to the command line and also to a sqlite database

##Extending or Implementing python_logging_proxy

Please see the documentation for `pymiproxy` and for the python standard library
`logger` module. The proxy itself can be extended exactly as `pymiproxy`,
either by registering an interceptor or method overloading. As for the logging
it is possible to add filters, handlers etc to the LoggingProxyHandler.logger
class property.

##Kudos

Thanks to the great documentation at python.org, and Nadeem Douba for pymiproxy,
which provides a good chunk the functionality I wanted when I started this
project.

##Contributing

Please feel free to add issues to the github project, fork, pull, push, and
otherwise fold spindle and mutilate - as per the License below. For help with
usage and extenseion please feel free to get in touch either through issues,
or by email.

##License

The MIT License (MIT)

Copyright (c) 2013 Alistair Broomhead

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

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

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

repository: josegonzalez/python-logging-proxy

repo_name: josegonzalez/python-logging-proxy


text:
# Release 3.0.0

Dependencies update.

## Changed :slot_machine:

- The required PHP version has been bumped to 7.4 to support the latest features.
- The package dependencies have been updated to the latest versions.

---
Previous: [Release 2.0.1](CHANGELOG-2.0.1.md)

license: MIT

repository: norse-blue/php-extensible-objects

branch_name: refs/heads/master

extension: md

gha_language: PHP

gha_license_id: MIT

license_type: permissive

repo_name: norse-blue/php-extensible-objects


text:
---
title: |
    189. Something for Jesus - Christ in Song
metadata:
    description: |
        Christ in Song 189. Something for Jesus. They bro't their gifts to Jesus, And laid them at his feet, And love for this dear Saviour, Made ev'ry off'ring sweet; Good deeds and words of kindness, Help for the poor of earth, And not a gift among them Was tho't of little worth. Chorus: Wouldst bring a gift to Jesus, That he will count most sweet? Say, "Lord, my heart I give thee," And lay it at his feet.
    keywords:  |
        Christ in Song, adventhymnals, advent hymnals, Something for Jesus, They bro't their gifts to Jesus. Wouldst bring a gift to Jesus,
    author: Brian Onang'o
---

#### Advent Hymnals
## 189. SOMETHING FOR JESUS
####  Christ in Song,

```txt
1.
They bro't their gifts to Jesus,
And laid them at his feet,
And love for this dear Saviour,
Made ev'ry off'ring sweet;
Good deeds and words of kindness,
Help for the poor of earth,
And not a gift among them
Was tho't of little worth.

Chorus:
Wouldst bring a gift to Jesus,
That he will count most sweet?
Say, "Lord, my heart I give thee,"
And lay it at his feet.

2.
Apart from other givers
A poor wayfarer stood;
He saw the gifts they offered,
The poorest counted good,
And he was filled with longing,
A gift, tho' poor, to bring;
Alas!  all empty handed
He stood before the King.  [Chorus]

3.
"Dear Lord," he cried in sorrow,
"I know how kind thou art,
Take all I have to give thee,
My sinful, wayward heart."
Then Jesus answered softly,
"Count not the gift as small,
Tho' all of them are precious,
Thine is the best of all.  [Chorus]

```

- |   -  |
-------------|------------|
Title | Something for Jesus |
Key | F Major |
Titles | Wouldst bring a gift to Jesus, |
First Line | They bro't their gifts to Jesus |
Author | Eben E. Rexford
Year | 1908
Composer| Joseph Garrison |
Hymnal|  - |
Tune| They bro't their gifts to Jesus |
Metrical pattern | |
# Stanzas |  |
Chorus |  |
Chorus Type |  |
Subjects | Living His Life: Consecration |
Texts | Proverbs 23:26 |
Print Texts |
Scripture Song |  |

repository: GospelSounders/adventhymnals

repo_name: GospelSounders/adventhymnals


text:
# ismember

[![Python](https://img.shields.io/pypi/pyversions/ismember)](https://img.shields.io/pypi/pyversions/ismember)
[![PyPI Version](https://img.shields.io/pypi/v/ismember)](https://pypi.org/project/ismember/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/erdogant/ismember/blob/master/LICENSE)
[![Downloads](https://pepy.tech/badge/ismember)](https://pepy.tech/project/ismember)
[![Downloads](https://pepy.tech/badge/ismember/month)](https://pepy.tech/project/ismember/)
[![Sphinx](https://img.shields.io/badge/Sphinx-Docs-Green)](https://erdogant.github.io/ismember/)

``ismember`` is a Python library that checks whether the elements in X is present in Y.

#
**⭐ Star this repo if you like it ⭐**
#

### [Documentation pages](https://erdogant.github.io/ismember/)

On the [documentation pages](https://erdogant.github.io/ismember/) you can find more information about ``ismember`` with examples.

#

##### Install ismember from PyPI
```bash
pip install ismember     # normal install
pip install -U ismember  # update if needed
```

### Import ismember package
```python
from ismember import ismember
```

#### Quick example

Use the documentation pages for more detailed usage. Some of the most used functionalities are linked below.

```python

from ismember import ismember

# Example with lists
I, idx = ismember([1,2,3,None], [4,1,2])
I, idx = ismember(["1","2","3"], ["4","1","2"])
```

#

#### [Example: Check whether the elements of X are present in Y](https://erdogant.github.io/ismember/pages/html/Examples.html#)

#

#### [Example: Determine the corresponding location of the values that are present in Y array](https://erdogant.github.io/ismember/pages/html/Examples.html#determine-the-corresponding-location-of-the-values-that-are-present-in-y-array)

#

#### [Example: Row wise comparison](https://erdogant.github.io/ismember/pages/html/Examples.html#row-wise-comparison-1)

#

#### [Example: Elementwise comparison](https://erdogant.github.io/ismember/pages/html/Examples.html#elementwise-comparison)

### References
* https://in.mathworks.com/help/matlab/ref/ismember.html

### Maintainer
* Erdogan Taskesen, github: [erdogant](https://github.com/erdogant)
* Contributions are welcome.
* If you wish to buy me a Coffee for this work, it is very appreciated :)

repository: erdogant/ismember

gha_language: Python

gha_license_id: NOASSERTION

repo_name: erdogant/ismember


text:
# Element Blog  | Helium
> A simple blog system using [Notion](https://notion.so) as a CMS.

Example:

[![Helium Theme Example](https://raw.githubusercontent.com/iuzn/assets/master/Element%20Blog/Theme%20Assets/Favicon/Helium-icon_48x48.png)](https://helium.blog.elementlab.net)

Deploy now:

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fiuzn%2Fhelium-theme%2Ftree%2Fmain&env=NEXT_PUBLIC_NAME,NAME,NEXT_PUBLIC_FAVICON_URL,NEXT_PUBLIC_AVATAR_URL,NEXT_PUBLIC_BLOG_TITLE,NEXT_PUBLIC_BLOG_DESCRIPTION,NEXT_PUBLIC_BLOG_ID,NEXT_PUBLIC_PROJECT_ID,NEXT_PUBLIC_CUSTOM_PAGE_ID&envDescription=Please%20follow%20learn%20more%20to%20help&envLink=https%3A%2F%2Fgithub.com%2Fiuzn%2Fhelium-theme%2Fblob%2Fmain%2FREADME.md)

## Building blocks
- React renderer: [*react-notion*](https://github.com/splitbee/react-notion)  *(Redesigned)*
- Serverless wrapper: [*notion-api-worker*](https://github.com/splitbee/notion-api-worker)
- Website template: [*twitter-web-react*](https://github.com/ademilter/twitter-web-react) *(Redesigned)*
- CSS framework: [*tailwindcss*](https://github.com/tailwindlabs/tailwindcss)

## Setup
### 1- Duplicate this  [page](https://www.notion.so/elementlab/Tables-7378cd4912a14b099a23ada31cbd1871)
![enter image description here](https://raw.githubusercontent.com/iuzn/assets/master/Element%20Blog/Introduction/step-1.png)

### 2- Share to web
![Share this page](https://raw.githubusercontent.com/iuzn/assets/master/Element%20Blog/Introduction/step-2.png)![Activate "Share to web" button](https://raw.githubusercontent.com/iuzn/assets/master/Element%20Blog/Introduction/step-3.png)
### 3- Deploy project:
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fiuzn%2Fhelium-theme%2Ftree%2Fmain&env=NEXT_PUBLIC_NAME,NAME,NEXT_PUBLIC_FAVICON_URL,NEXT_PUBLIC_AVATAR_URL,NEXT_PUBLIC_BLOG_TITLE,NEXT_PUBLIC_BLOG_DESCRIPTION,NEXT_PUBLIC_BLOG_ID,NEXT_PUBLIC_PROJECT_ID,NEXT_PUBLIC_CUSTOM_PAGE_ID&envDescription=Please%20follow%20learn%20more%20to%20help&envLink=https%3A%2F%2Fgithub.com%2Fiuzn%2Fhelium-theme%2Fblob%2Fmain%2FREADME.md)
### 4- Fill in the Environment Variables as indicated in the images.
![enter image description here](https://raw.githubusercontent.com/iuzn/assets/master/Element%20Blog/Introduction/vercel-import.png)
- You must use linked images for  `NEXT_PUBLIC_FAVICON_URL` and `NEXT_PUBLIC_AVATAR_URL`
*(You can host these images in a public repo on Github.)*

![enter image description here](https://raw.githubusercontent.com/iuzn/assets/master/Element%20Blog/Introduction/environment-variables.png)
![Blog ID](https://raw.githubusercontent.com/iuzn/assets/master/Element%20Blog/Introduction/step-4.png)
![Project ID](https://raw.githubusercontent.com/iuzn/assets/master/Element%20Blog/Introduction/step-5.png)
![Custom Page ID](https://raw.githubusercontent.com/iuzn/assets/master/Element%20Blog/Introduction/step-6.png)

repository: leftchest/helium-theme

branch_name: refs/heads/main

repo_name: leftchest/helium-theme


text:
# REACT & REDUX BOOK-STORE

> A book-store developed and deployed to heroku

✧
    Watch the Live Version ✧
    Prerequisites ✧
    Getting Started ✧
    Usage ✧
    Contributing ✧
    Author ✧
    Show your support ✧
    License ✧
    Acknowledgments ✧
    Report Bug✧

React Calcultor A book-store application built using react redux and react redux and deployed to heroku

## Watch the Live Version

[Live Demo](https://pure-wildwood-49126.herokuapp.com/)

### Prerequisites

- JavaScript ES6
- React
- React-Redux
- Redux
- NodeJS
- Webpack
- Buildpack
- Heroku
- Code Editor(VScode)

### Usage
1. Navigate to the reposatory of this application https://github.com/Rashad-Muntar/Book-store
2. Clone the reposatory by using the `git clone` command in your terminal
3. `cd` into the clone reposatory
4. Open the code base using any code editor or your choice, preferably "visual studio code editor"
5. Open the vscode terminal and run the application by typing `npm start` and hit enter.

## Contributing

This project was created for educational purposes as part of the Microverse web development curriculum; contributing is not accepted.

Feel free to check the [issues page](https://github.com/Rashad-Muntar/Book-store/issues).

## Author

👤 **Rashad Muntar**

- GitHub: [@Rashad-Muntar](https://github.com/Rashad-Muntar)
- Twitter - [@RashadToure](https://twitter.com/RashadToure)
- LinkedIn: [Rashad Muntar](https://www.linkedin.com/in/rashad-muntar/)

👤 **Widzmarc Jean Nesly Phelle**

- GitHub: [@widzthedvloper](https://github.com/widzthedvloper)
- Twitter - [@widzthedvloper](https://twitter.com/widzthedvloper)
- LinkedIn: [@widzthedvloper](https://www.linkedin.com/in/widzmarc-jean-nesly-phelle-252a26129/)

### Show your support

Give a ⭐ if you like this project!

## License

This project is licensed under the MIT License

repository: Rashad-Muntar/Book-store

branch_name: refs/heads/develop

gha_language: JavaScript

repo_name: Rashad-Muntar/Book-store


text:
---
layout: post
title:  "Deep learning notes 03: Switch, Feedback, and generally transformers"
date:   2021-02-17 21:29:08 +0100
author: Petr Houška
categories: papers
#truncate: 3600
---

> This post if from a series of quick notes written primarily for personal usage while reading random ML/SWE/CS papers. As such they might be incomprehensible and/or flat out wrong.

### Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity
- [Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity](https://www.youtube.com/watch?v=iAR8LkkMMIM)
- 1 trillion parameters (sparse) vs 175B parameters dense of GPT-3
- Mixture of experts, each token routed to only single expert per layer
  - Few experts per machine, allows parallel execution: indiv. Token to different experts -> machines
- On large NLP test loss goes down with more parameters even with the same:
  - Training dataset, number of steps, FLOPs per forward pass (due to sparsity)
  - -> tradeoff distributable memory for training speed / performance (demonstrated on super-huge models)
- Transformer:
  - MHA: relates tokens within layer to each other
  - Feed forward layer (for all tokens): relates layers to each other
- Switching transformer: Multiple feed forward layers, each token uses one of them
  - Routing matrix, dot product with token -> softmax -> routing weight (soft) -> hard clip "argmax"
  - In forward pass -> only one FF "expert" is used per token
- Previously thought impossible to use just one "argmaxed" expert due to instability
  - Better initialization, adaptive precision (float16 on communication, float32 for within node computation), better dropout

### Transformers dimensionality via [Attention is all you need](https://papers.nips.cc/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf)
- Multiple dimensionalities:
  - Model dimension (`Dmodel`): initial embedding dimension, input/output of both attention and feed forward network layers
  - Value, key dimensions (`Dk`, `Dv`): dimensionality of individual keys (and thus queries) and values
  - Hidden FFN size (`Dff`): dimensionality of first out of two (second has dimensionality of `Dmodel`) layers of FFN
  - Heads (`H`): number of attention heads
  - Layers (`N`): number of attention, feed forward network stacks
- Network computation
  - `Dmodel` token vector projected per attention head to `Dk`, `Dk`, and `Dv` vectors for keys, queries, and values, attention happens
  - After attention finishes, concatenation of `Dv` outputs per attention head projected to `Dmodel`
  - `Dmodel` sized vector is projected through a single hidden layer (`Dff`) and then reprojected to `Dmodel`
- `Dmodel`: `512`, `Dk`: `64`, `Dv`: `64`, `H`: `8`, `Dff`: `2048`, Bert is similar; more thorough description
  - Not insignificant portion of parameters is in FFN portion (`2048*512 * 2`) that recombines indiv. heads info

### Feedback Transformers: Addressing Some Limitations of Transformers with Feedback Memory
- [Feedback Transformers: Addressing Some Limitations of Transformers with Feedback Memory (Explained)](https://www.youtube.com/watch?v=zdb8MM94A5c)
- RNN: Data flows one step per time in shared hidden state
- Transformer: Data flows each token to all tokens on every layer
  - Each layer very limited ~linear parallel recombination
  - Casual masking: Only let transformers see "previous" tokens (big in NLP)
- Normal transformer: only feed forward, can recombine left-previous-layer tokens
- Memory transformer: allow lateral (left same layer) and also feed-forward (left-upper) connections
  - Disables parallel training, need to compute left tokens fully first (even upper layers) to compute current
  - Representations of all layers of a token are combined (weighted sum) to a single per-token memory representation
  - Tokens to the right attend to individual left tokens' memory representations
- In a way attention over multiple-layer RNN (not super-new idea, attention originated in RNNs in similar way)
- It seems that connection from past-tokens top (highest layer) representation is responsible for most gains

repository: petrroll/devblog

extension: markdown

gha_language: SCSS

repo_name: petrroll/devblog


text:
# Developing javascript juno-magic

# Install

Note: Juno-magic currently relies on the `@timbr/react-machine` repo for its UI. In order to develop the JS locally you need to have the `timbr-omni` package locally, and then run 'npm link' in the `packages/react-machine` repo.

1. `npm link @timbr/react-machine`
2. `npm install`
3. `python setup.py develop`
4. `jupyter notebook`

branch_name: refs/heads/development


text:
Project Maintainer
==================
[headRx](https://github.com/joshbelmar<EMAIL_ADDRESS>
Contributors
------------
This project wouldn't be possible without all the hard work and contributions of the following people:

* [wh1tel1sted](https://github.com/wh1tel1sted)
* [ws0h3ll](https://github.com/ws0h3ll)
* [CMSteffen](https://github.com/cmsteffen-code)

repository: joshbelmar/File-Roulette

repo_name: joshbelmar/File-Roulette


text:
# Contributing

Note we have a code of conduct, please follow it in all your interactions with the project.

Ensure you've read through the [documentation][docs] so you understand the core concepts of the
project. If you're looking to get familiar with go, following the getting started [guide][guide]
can be a good starting point.

## Pull Request Process

1. Ensure any dependencies or build artifacts are removed/ignored before creating a commit.
2. Commits follow the [conventional commits][cc] guidelines.
(You can [look up the supported *types*][cc-types] along with an explanation [here][cc-types])
3. Update the documentation with details of changes to the functionality, this includes new segments
   or core functionality.
4. Pull Requests are merged once all checks pass and a project maintainer has approved it.

## Codespaces / Devcontainer Development Environment

Arguably the easiest way to contribute anything is to use our prepared development environment.

We have a `.devcontainer/devcontainer.json` file, meaning we are compatible with:

- [![Open in GitHub Codespaces][codespaces-badge]][codespaces-link], or
- the [Visual Studio Code Remote - Containers][devcontainer-ext] extension.

This Linux environment includes all shells supported by oh-my-posh, including Bash, ZSH,
Fish and PowerShell, the latter of which is the default.

### Configuring Devcontainer's Timezone & Theme

1. Open the `.devcontainer/devcontainer.json` file and in the "*build*" section modify:

   - `TZ`: with [your own timezone][timezones]
   - `DEFAULT_POSH_THEME`: with [your preferred theme][themes]

2. Summon the Command Panel (Ctrl+Shift+P) and select `Codespaces: Rebuild Container`
   to rebuild your devcontainer. (This should take just a few seconds.)

### Recompiling oh-my-posh within

The devcontainer definition preinstalls the latest stable oh-my-posh release at build time.

To overwrite the installation's version inside the running devcontainer, you may use the
VSCode *task* `devcontainer: build omp` to rebuild your oh-my-posh with that of
your running repository's state. (You might see a button for this in your statusbar.)

If the compile succeeds, `oh-my-posh --version` should reply:
`development`

Should you somehow mess up your devcontainer's OMP install catastrophically, remember that
if you do `Codespaces: Rebuild Container` again, you'll be back to the latest stable release.

[docs]: https://ohmyposh.dev/docs
[guide]: https://ohmyposh.dev/docs/contributing/started
[cc]: https://www.conventionalcommits.org/en/v1.0.0/#summary
[cc-types]: https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/.commitlintrc.yml#L23-L33
[codespaces-badge]: https://github.com/codespaces/badge.svg
[codespaces-link]: https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=175405157
[devcontainer-ext]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
[timezones]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
[themes]: https://ohmyposh.dev/docs/themes

repository: JanDeDobbeleer/oh-my-posh

gha_language: Go

repo_name: JanDeDobbeleer/oh-my-posh


text:
# tf-aws-vpc-bastion

This module will create the below resources:

- VPC
- IGW
- Public Subnets
- Private Subnets
- Route Tables
- Lambda Function (attach EIPs to Bastion hosts and update the route tables)
- SNS Topic
- Lambda SNS Subscription (for Bastion ASG event notifications)
- Lambda IAM role and associated policies (for EIP attachment and route changes)
- Bastion IAM role and associated policies (to read from S3 yum repos)
- EIPs for attachment to Bastion instances
- Bastion Launch Configuration (defaults to t2.micro)
- Bastion ASG (sends ASG events to SNS to trigger Lambda)
- Internal Bastion SG for access from the VPC
- External Bastion SG for SSH access

Resource numbers will differ based on the number of AZs passed to Terraform.
If you pass three AZs you will have an ASG with three instances, three EIPs,
three of each subnet and so on. If you are in a region such as eu-central-1
with only two zones then the module will handle this and only create two
resources where applicable.

The module assumes you are happy with a set of Bastions per VPC. Using this
module it would be sensible to host all `nonprod` infrastructure in a single
VPC. If you don't do this you will have a lot of Bastions.

## Usage

Call the module:

```
module "bastions" {
  source = "/home/chris/dev/tf-aws-vpc-bastion"

  name              = "projectx"
  envname           = "dev"
  envtype           = "nonprod"
  vpc_cidr          = "<IP_ADDRESS>/21"
  public_subnets    = "<IP_ADDRESS>/24,<IP_ADDRESS>/24,<IP_ADDRESS>/24"
  private_subnets   = "<IP_ADDRESS>/24,<IP_ADDRESS>/24,<IP_ADDRESS>/24"
  domain            = "example.com"
  ami_id            = "ami-00000000"
  bastion_userdata  = "${file("bastion_userdata.tmpl")}"
  bastion_ssh_cidrs = "<IP_ADDRESS>/32,<IP_ADDRESS>/32"
  aws_zones         = "eu-west-1a,eu-west-1b,eu-west-1c"
  aws_region        = "eu-west-1"
}
```

## Variables
- `name` - Used to identify your resources, the project name is sensible
- `envname` - You probably only want a `nonprod` and `prod` VPC
- `envtype` - usually `prod` or `nonprod`
- `vpc_cidr` - CIDR to use for your VPC
- `public_subnets` - The public subnets the bastions will sit in
- `private_subnets` - The private subnets your infrastructure will sit in
- `domain` - The domain for your environment (this is only used in userdata)
- `ami_id` - The AWS AMI to use, should be a Linux image like CentOS or Debian
- `bastion_userdata` - The template file to use for bastion userdata
- `bastion_ssh_cidrs` - IPs allowed SSH access to Bastions from the internet
- `aws_zones` - AWS zones to use
- `aws_region` - AWS region to use

## Outputs
- `vpc_id` - VPC ID
- `vpc_cidr` - VPC CIDR
- `availability_zones` - AWS availability zones in use
- `public_subnets` - Comma separated list of public subnets
- `public_route_tables` - Comma separated list of public subnet route tables
- `private_subnets` - Comma separated list of private subnets
- `private_route_tables` - Comma separated list of private subnet route tables
- `bastion_userdata_redndered` - Rendered version of bastion userdata
- `bastion_iam_profile_id` - Bastion instance IAM profile ID
- `bastion_iam_role_id` - Bastion instance IAM role ID
- `bastion_eip_ids` - Comma separated list of EIP IDs to be attached to bastions
- `bastion_eip` - Comma separated list of EIP IPs to be attached to bastions
- `launch_config_id` Bastion launch configuration ID
- `asg_id` - Bastion ASG ID
- `asg_name` - Bastion ASG name
- `lambda_arn` - Lambda function ARN
- `lambda_iam_role_id` - Lambda IAM role ID
- `bastion_sns_arn` - Bastion ASG notification SNS ARN
- `bastion_sns_id` - Bastion ASG notification SNS ID
- `bastion_sns_subscription_arn` - Bastion ASG notification SNS subscription ARN
- `bastion_sns_subscription_id` - Bastion ASG notification SNS subscription ID
- `bastion_external_sg_id` - Bastion external SG ID
- `bastion_internal_sg_id` - Bastion internal SG ID

repository: Daemon-Solutions/tf-aws-vpc-bastion

repo_name: Daemon-Solutions/tf-aws-vpc-bastion


text:
#
 Portable Abstractions and Patterns for Dart

## 1.0.0

- Initial version, created by Sergey Seroukhov and Dmitry Levichev

## 1.0.1

- Fix docs and code style, created by Dmitry Levichev

## 1.0.2

- More fixes docs and code style, created by Dmitry Levichev

## 1.0.3

- Fix all code style by Dmitry Levichev

## 1.0.4

- Fix getOneOptional method in References

## 1.0.5

- Fix toNullableString method in StringConverter for properly works with Lists. Was added tests.

## 1.0.6

- Optimize toNullableString method in StringConverter for properly works with Lists. Added examples.

## 1.0.7

- Fix methods [fromJson] in classes from data package.

## 1.0.8

- Fix work with time, make convert to UTC.

## 1.0.9

 - Add converting to/from JSON for ApplicationException

## 1.0.10

 - Fix setInterval and setDelay methods in FixedRateTimer

## 1.0.11

 - Fix ApplicationException to JSON converting issue

## 1.0.12

 - Added TokenizedPagingParams and TokenizedDataPage classes

## 1.1.0

 - Added null-safety supports

## 1.1.1

 - Make StringValueMap nullable type

## 1.1.2

 - Fixed **JsonConverter** toJson method

## 1.1.3

 - Parameter **id** for **IIdentifiable** made optional

## 1.1.4

 - Fixed FixedRateTimer.setCallback params

## 1.1.5

 - Fixed TypeConverter.toNullableType type cast

## 1.1.6

 - Changed visibility of Command schema property


text:
---
id: moreTopics
title: 'More Topics'
sidebar_label: 'More Topics'
---

### What are inline conditional expressions?

You can use either _if statements_ or _ternary expressions_ which are available from JS to conditionally render expressions. Apart from these approaches, you can also embed any expressions in JSX by wrapping them in curly braces and then followed by JS logical operator `&&`.

```jsx harmony
<h1>Hello!</h1>;
{
  messages.length > 0 && !isLogin ? (
    <h2>You have {messages.length} unread messages.</h2>
  ) : (
    <h2>You don't have unread messages.</h2>
  );
}
```

---

### How to write comments in React?

The comments in React/JSX are similar to JavaScript Multiline comments but are wrapped in curly braces.

**Single-line comments:**

```jsx harmony
<div>
  {/* Single-line comments(In vanilla JavaScript, the single-line comments are represented by double slash(//)) */}
  {`Welcome ${user}, let's play React`}
</div>
```

**Multi-line comments:**

```jsx harmony
<div>
  {/* Multi-line comments for more than
       one line */}
  {`Welcome ${user}, let's play React`}
</div>
```

---

### What is reconciliation?

When a component's props or state change, React decides whether an actual DOM update is necessary by comparing the newly returned element with the previously rendered one. When they are not equal, React will update the DOM. This process is called _reconciliation_.

---

### What would be the common mistake of function being called every time the component renders?

You need to make sure that function is not being called while passing the function as a parameter.

```jsx harmony
    render() {
      // Wrong: handleClick is called instead of passed as a reference!
      return <button onClick={this.handleClick()}>{'Click Me'}</button>
    }
```

---

#### Instead, pass the function itself without parenthesis:

```jsx harmony
    render() {
      // Correct: handleClick is passed as a reference!
      return <button onClick={this.handleClick}>{'Click Me'}</button>
    }
```

---

### Why React uses `className` over `class` attribute?

`class` is a keyword in JavaScript, and JSX is an extension of JavaScript. That's the principal reason why React uses `className` instead of `class`. Pass a string as the `className` prop.

```jsx harmony
    render() {
      return <span className={'menu navigation-menu'}>{'Menu'}</span>
    }
```

---

## What are fragments?

It's common pattern in React which is used for a component to return multiple elements. _Fragments_ let you group a list of children without adding extra nodes to the DOM.

```jsx harmony
    render() {
      return (
        <React.Fragment>
          <ChildA />
          <ChildB />
          <ChildC />
        </React.Fragment>
      )
    }
```

There is also a _shorter syntax_, but it's not supported in many tools:

```jsx harmony
    render() {
      return (
        <>
          <ChildA />
          <ChildB />
          <ChildC />
        </>
      )
    }
```

---

### Why fragments are better than container divs?

Below are the list of reasons,

1. Fragments are a bit faster and use less memory by not creating an extra DOM node. This only has a real benefit on very large and deep trees.
2. Some CSS mechanisms like _Flexbox_ and _CSS Grid_ have a special parent-child relationships, and adding divs in the middle makes it hard to keep the desired layout.
3. The DOM Inspector is less cluttered.

---

## What are portals in React?

_Portal_ is a recommended way to render children into a DOM node that exists outside the DOM hierarchy of the parent component.

```javascript
ReactDOM.createPortal(child, container);
```

The first argument is any render-able React child, such as an element, string, or fragment. The second argument is a DOM element.

---

## What are error boundaries in React v16?

_Error boundaries_ are components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed.

A class component becomes an error boundary if it defines a new lifecycle method called `componentDidCatch(error, info)` or `static getDerivedStateFromError()`:

```jsx harmony
class ErrorBoundary extends React.Component {
  constructor(props) {
    super(props);
    this.state = {hasError: false};
  }

  componentDidCatch(error, info) {
    // You can also log the error to an error reporting service
    logErrorToMyService(error, info);
  }

  static getDerivedStateFromError(error) {
    // Update state so the next render will show the fallback UI.
    return {hasError: true};
  }

  render() {
    if (this.state.hasError) {
      // You can render any custom fallback UI
      return <h1>{'Something went wrong.'}</h1>;
    }
    return this.props.children;
  }
}
```

#### After that use it as a regular component:

```jsx harmony
<ErrorBoundary>
  <MyWidget />
</ErrorBoundary>
```

---

### How error boundaries handled in React v15?

React v15 provided very basic support for _error boundaries_ using `unstable_handleError` method. It has been renamed to `componentDidCatch` in React v16.

---

## How to use innerHTML in React?

The `dangerouslySetInnerHTML` attribute is React's replacement for using `innerHTML` in the browser DOM. Just like `innerHTML`, it is risky to use this attribute considering cross-site scripting (XSS) attacks. You just need to pass a `__html` object as key and HTML text as value.

In this example MyComponent uses `dangerouslySetInnerHTML` attribute for setting HTML markup:

```jsx harmony
function createMarkup() {
  return {__html: 'First · Second'};
}

function MyComponent() {
  return <div dangerouslySetInnerHTML={createMarkup()} />;
}
```

---

## What is the impact of indexes as keys?

Keys should be stable, predictable, and unique so that React can keep track of elements.

In the below code snippet each element's key will be based on ordering, rather than tied to the data that is being represented. This limits the optimizations that React can do.

```jsx harmony
{
  todos.map((todo, index) => <Todo {...todo} key={index} />);
}
```

If you use element data for unique key, assuming todo.id is unique to this list and stable, React would be able to reorder elements without needing to reevaluate them as much.

```jsx harmony
{
  todos.map((todo) => <Todo {...todo} key={todo.id} />);
}
```

---

## Why we need to be careful when spreading props on DOM elements?

When we _spread props_ we run into the risk of adding unknown HTML attributes, which is a bad practice. Instead we can use prop destructuring with `...rest` operator, so it will add only required props.

For example,

```jsx harmony
const ComponentA = () => (
  <ComponentB isDisplay={true} className={'componentStyle'} />
);

const ComponentB = ({isDisplay, ...domProps}) => (
  <div {...domProps}>{'ComponentB'}</div>
);
```

---

## How you use decorators in React?

You can _decorate_ your _class_ components, which is the same as passing the component into a function. **Decorators** are flexible and readable way of modifying component functionality.

```jsx harmony
@setTitle('Profile')
class Profile extends React.Component {
  //....
}

/*
    title is a string that will be set as a document title
      WrappedComponent is what our decorator will receive when
      put directly above a component class as seen in the example above
*/
const setTitle = (title) => (WrappedComponent) => {
  return class extends React.Component {
    componentDidMount() {
      document.title = title;
    }

    render() {
      return <WrappedComponent {...this.props} />;
    }
  };
};
```

**Note:** Decorators are a feature that didn't make it into ES7, but are currently a _stage 2 proposal_.

---

## How you implement Server Side Rendering or SSR?

React is already equipped to handle rendering on Node servers. A special version of the DOM renderer is available, which follows the same pattern as on the client side.

```jsx harmony
import ReactDOMServer from 'react-dom/server';
import App from './App';

ReactDOMServer.renderToString(<App />);
```

This method will output the regular HTML as a string, which can be then placed inside a page body as part of the server response. On the client side, React detects the pre-rendered content and seamlessly picks up where it left off.

---

## How to enable production mode in React?

You should use Webpack's `DefinePlugin` method to set `NODE_ENV` to `production`, by which it strip out things like propType validation and extra warnings. Apart from this, if you minify the code, for example, Uglify's dead-code elimination to strip out development only code and comments, it will drastically reduce the size of your bundle.

---

## What is strict mode in React?

`React.StrictMode` is a useful component for highlighting potential problems in an application. Just like `<Fragment>`, `<StrictMode>` does not render any extra DOM elements. It activates additional checks and warnings for its descendants. These checks apply for _development mode_ only.

```jsx harmony
import React from 'react';
function ExampleApplication() {
  return (
    <div>
      <Header />
      <React.StrictMode>
        <div>
          <ComponentOne />
          <ComponentTwo />
        </div>
      </React.StrictMode>
      <Footer />
    </div>
  );
}
```

In the example above, the _strict mode_ checks apply to `<ComponentOne>` and `<ComponentTwo>` components only.

---

## What are React Mixins?

_Mixins_ are a way to totally separate components to have a common functionality. Mixins **should not be used** and can be replaced with _higher-order components_ or _decorators_.

One of the most commonly used mixins is `PureRenderMixin`. You might be using it in some components to prevent unnecessary re-renders when the props and state are shallowly equal to the previous props and state:

```javascript
const PureRenderMixin = require('react-addons-pure-render-mixin');

const Button = React.createClass({
  mixins: [PureRenderMixin],
  // ...
});
```

    <!-- TODO: mixins are deprecated -->

---

## Why is `isMounted()` an anti-pattern and what is the proper solution?

The primary use case for `isMounted()` is to avoid calling `setState()` after a component has been unmounted, because it will emit a warning.

```javascript
    if (this.isMounted()) {
      this.setState({...})
    }
```

Checking `isMounted()` before calling `setState()` does eliminate the warning, but it also defeats the purpose of the warning. Using `isMounted()` is a code smell because the only reason you would check is because you think you might be holding a reference after the component has unmounted.

An optimal solution would be to find places where `setState()` might be called after a component has unmounted, and fix them. Such situations most commonly occur due to callbacks, when a component is waiting for some data and gets unmounted before the data arrives. Ideally, any callbacks should be canceled in `componentWillUnmount()`, prior to unmounting.

---

### How to re-render the view when the browser is resized?

You can listen to the `resize` event in `componentDidMount()` and then update the dimensions (`width` and `height`). You should remove the listener in `componentWillUnmount()` method.

```javascript
class WindowDimensions extends React.Component {
  constructor(props) {
    super(props);
    this.updateDimensions = this.updateDimensions.bind(this);
  }

  componentWillMount() {
    this.updateDimensions();
  }

  componentDidMount() {
    window.addEventListener('resize', this.updateDimensions);
  }

  componentWillUnmount() {
    window.removeEventListener('resize', this.updateDimensions);
  }

  updateDimensions() {
    this.setState({width: window.innerWidth, height: window.innerHeight});
  }

  render() {
    return (
      <span>
        {this.state.width} x {this.state.height}
      </span>
    );
  }
}
```

---

### Is it possible to use React without rendering HTML?

It is possible with latest version (>=16.2). Below are the possible options:

```jsx harmony
     render() {
       return false
     }
```

```jsx harmony
     render() {
       return null
     }
```

```jsx harmony
     render() {
       return []
     }
```

```jsx harmony
     render() {
       return <React.Fragment></React.Fragment>
     }
```

```jsx harmony
     render() {
       return <></>
     }
```

Returning `undefined` won't work.

---

### How to pretty print JSON with React?

We can use `<pre>` tag so that the formatting of the `JSON.stringify()` is retained:

```jsx harmony
const data = {name: 'John', age: 42};

class User extends React.Component {
  render() {
    return <pre>{JSON.stringify(data, null, 2)}</pre>;
  }
}

React.render(<User />, document.getElementById('container'));
```

---

### How to focus an input element on page load?

You can do it by creating _ref_ for `input` element and using it in `componentDidMount()`:

```jsx harmony
class App extends React.Component {
  componentDidMount() {
    this.nameInput.focus();
  }

  render() {
    return (
      <div>
        <input defaultValue={"Won't focus"} />
        <input
          ref={(input) => (this.nameInput = input)}
          defaultValue={'Will focus'}
        />
      </div>
    );
  }
}

ReactDOM.render(<App />, document.getElementById('app'));
```

---

### How can we find the version of React at runtime in the browser?

You can use `React.version` to get the version.

```jsx harmony
const REACT_VERSION = React.version;

ReactDOM.render(
  <div>{`React version: ${REACT_VERSION}`}</div>,
  document.getElementById('app'),
);
```

---

### How to define constants in React?

You can use ES7 `static` field to define constant.

```javascript
class MyComponent extends React.Component {
  static DEFAULT_PAGINATION = 10;
}
```

_Static fields_ are part of the _Class Fields_ stage 3 proposal.

---

### Is it possible to use async/await in plain React?

If you want to use `async`/`await` in React, you will need _Babel_ and [transform-async-to-generator](https://babeljs.io/docs/en/babel-plugin-transform-async-to-generator) plugin. React Native ships with Babel and a set of transforms.

---

### What are the popular React-specific linters?

ESLint is a popular JavaScript linter. There are plugins available that analyse specific code styles. One of the most common for React is an npm package called `eslint-plugin-react`. By default, it will check a number of best practices, with rules checking things from keys in iterators to a complete set of prop types.

Another popular plugin is `eslint-plugin-jsx-a11y`, which will help fix common issues with accessibility. As JSX offers slightly different syntax to regular HTML, issues with `alt` text and `tabindex`, for example, will not be picked up by regular plugins.

---

repository: krishnaUIDev/UI-Kit

repo_name: krishnaUIDev/UI-Kit


text:
## Cameras

You can track and manage your drone cameras using the Cameras API. Each camera is represented by a `camera` object wth the following properties:

| Property      | Type   | Description                                                                               |
| ------------- | ------ | ----------------------------------------------------------------------------------------- |
| `name`        | String | Name of the camera                                                                        |
| `camera_id`   | String | Camera ID                                                                                |
| `model`       | Object | Object representing the camera model. Contains the `name` of the model and the `model_id` |
| `notes`       | String | Descriptive notes for the camera                                                          |
| `acquired_on` | String | Date that camera was acquired on, in epoch (Unix timestamp), converted to milliseconds    |

### Get all cameras

> Code samples

```ruby
require 'rest-client'
require 'json'
headers = {
  'Accept' => 'application/json'
}
result = RestClient.get 'https://api.garuda.io/v2/fleet/cameras',
  params: {
  }, headers: headers

p JSON.parse(result)
```

```python
import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.garuda.io/v2/fleet/cameras', params={

}, headers = headers)

print r.json()
```

```shell
curl -X GET 'https://api.garuda.io/v2/fleet/cameras' \
     -H 'Authorization: Bearer <AUTH_TOKEN>' \
     -H 'X-API-Key: <API_KEY>' \
```

```javascript
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.garuda.io/v2/fleet/cameras',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

```

> 200 Response

```json
{
  "success": true,
  "data": [
    {
      "name": "CAMERA-001",
      "camera_id": "0b53479856488f542a18fef96b84119d",
      "model": {
        "name": "Powershot S100",
        "model_id": "0e51493cd1ae85c097547de808642659"
      },
      "notes": "For front facing camera",
      "acquired_on":<PHONE_NUMBER>172,
    },
    {
      "name": "CAMERA-002",
      "camera_id": "df0fb1aed5215106cf5bd23f8a005a55",
      "model": {
        "name": "Git2",
        "model_id": "f473a293f4294c6890f955fad4d10dc1"
      },
      "notes": "For downward facing camera",
      "acquired_on":<PHONE_NUMBER>172,
    }
  ]
}
```

`GET /fleet/cameras`

Get all cameras belonging to the company of the user. This endpoint returns an array of JSON objects, with each object representing a `camera` in the database.

### Create new camera

> Code samples

```ruby
require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://api.garuda.io/v2/fleet/cameras',
  params: {
  }, headers: headers

p JSON.parse(result)

```

```python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://api.garuda.io/v2/fleet/cameras', params={

}, headers = headers)

print r.json()

```

```shell
curl -X POST 'https://api.garuda.io/v2/fleet/cameras' \
     -H 'Authorization: Bearer <AUTH_TOKEN>' \
     -H 'X-API-Key: <API_KEY>' \
     -d '{
      "name": "CAMERA-001",
      "model_id": "0e51493cd1ae85c097547de808642659",
      "notes": "For front facing camera"
     }'
```

```javascript
const fetch = require('node-fetch');
const inputBody = '{
  "name": "CAMERA-001",
  "model_id": "0e51493cd1ae85c097547de808642659",
  "notes": "For front facing camera"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'

};

fetch('https://api.garuda.io/v2/fleet/cameras',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

```

> 200 Response

```json
{
  "success": true,
  "data": {
    "name": "CAMERA-001",
    "camera_id": "0b53479856488f542a18fef96b84119d",
    "model": {
      "name": "Powershot S100",
      "model_id": "0e51493cd1ae85c097547de808642659"
    },
    "notes": "For front facing camera",
    "acquired_on":<PHONE_NUMBER>172,
  }
}
```

`POST /fleet/cameras`

Create a new camera belonging to the company of the user. At minimum, you should pass in the following details in the request body:

| Property   | Type   | Description            |
| ---------- | ------ | ---------------------- |
| `name`     | String | Name of the camera     |
| `model_id` | String | Model ID of the camera |

`model_id` has to be a valid model ID that already exists in the database.

There are some additional details that you can add to the request body to flesh out your camera details even further:

| Property      | Type   | Description                                                                            |
| ------------- | ------ | -------------------------------------------------------------------------------------- |
| `notes`       | String | Descriptive notes for the camera                                                       |
| `acquired_on` | String | Date that camera was acquired on, in epoch (Unix timestamp), converted to milliseconds |

If the `acquired_on` property is not specified, it will be saved as the time that the request was made.

A camera that has been successfully created will return a response with a `"success": true` body and a `200 OK` status.

### Get a camera

> Code samples

```ruby
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get 'https://api.garuda.io/v2/fleet/cameras/{camera_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

```

```python
import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.garuda.io/v2/fleet/cameras/{camera_id}', params={

}, headers = headers)

print r.json()

```

```shell
curl -X GET 'https://api.garuda.io/v2/fleet/cameras/{camera_id}' \
     -H 'Authorization: Bearer <AUTH_TOKEN>' \
     -H 'X-API-Key: <API_KEY>' \
```

```javascript
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.garuda.io/v2/fleet/cameras/{camera_id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

```

> 200 Response

```json
{
  "success": true,
  "data": {
    "name": "CAMERA-001",
    "camera_id": "0b53479856488f542a18fef96b84119d",
    "model": {
      "name": "Powershot S100",
      "model_id": "0e51493cd1ae85c097547de808642659"
    },
    "notes": "For front facing camera",
    "acquired_on":<PHONE_NUMBER>172,
  }
}
```

`GET /fleet/cameras/{camera_id}`

Get a specific camera belonging to the company of the user.

`camera_id` parameter has to be a valid camera ID.

### Update a camera

> Code samples

```ruby
require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch 'https://api.garuda.io/v2/fleet/cameras/{camera_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

```

```python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('https://api.garuda.io/v2/fleet/cameras/{camera_id}', params={

}, headers = headers)

print r.json()

```

```shell
curl -X PATCH 'https://api.garuda.io/v2/fleet/cameras/{camera_id}' \
     -H 'Authorization: Bearer <AUTH_TOKEN>' \
     -H 'X-API-Key: <API_KEY>' \
     -d '{
      "notes": "For front facing camera, can also be used for downward facing"
     }'
```

```javascript
const fetch = require('node-fetch');
const inputBody = '{
  "notes": "For front facing camera, can also be used for downward facing"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json'

};

fetch('https://api.garuda.io/v2/fleet/cameras/{camera_id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

```

> 200 Response

```json
{
  "success": true,
  "data": {
    "name": "CAMERA-001",
    "camera_id": "0b53479856488f542a18fef96b84119d",
    "model": {
      "name": "Powershot S100",
      "model_id": "0e51493cd1ae85c097547de808642659"
    },
    "notes": "For front facing camera, can also be used for downward facing",
    "acquired_on":<PHONE_NUMBER>172,
  }
}
```

`PATCH /fleet/cameras/{camera_id}`

Update a specific camera belonging to the company of the user.

To update a specific camera, you can pass whichever properties that you wish to update in the request body. All properties are optional.

| Property      | Type   | Description                                                                               |
| ------------- | ------ | ----------------------------------------------------------------------------------------- |
| `name`        | String | Name of the camera                                                                        |
| `camera_id`   | String | Camera ID                                                                                |
| `model`       | Object | Object representing the camera model. Contains the `name` of the model and the `model_id` |
| `notes`       | String | Descriptive notes for the camera                                                          |
| `acquired_on` | String | Date that camera was acquired on, in epoch (Unix timestamp), converted to milliseconds    |

A camera that has been successfully updated will return a response with a `"success": true` body and a `200 OK` status. Response body will also contain the updated `camera` object.

### Delete a camera

> Code samples

```ruby
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.delete 'https://api.garuda.io/v2/fleet/cameras/{camera_id}',
  params: {
  }, headers: headers

p JSON.parse(result)

```

```python
import requests
headers = {
  'Accept': 'application/json'
}

r = requests.delete('https://api.garuda.io/v2/fleet/cameras/{camera_id}', params={

}, headers = headers)

print r.json()

```

```shell
curl -X DELETE 'https://api.garuda.io/v2/fleet/cameras/{camera_id}' \
     -H 'Authorization: Bearer <AUTH_TOKEN>' \
     -H 'X-API-Key: <API_KEY>' \
```

```javascript
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('https://api.garuda.io/v2/fleet/cameras/{camera_id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

```

> 200 Response

```json
{
  "success": true,
  "data": {
    "name": "CAMERA-001",
    "camera_id": "0b53479856488f542a18fef96b84119d",
    "model": {
      "name": "Powershot S100",
      "model_id": "0e51493cd1ae85c097547de808642659"
    },
    "notes": "For front facing camera",
    "acquired_on":<PHONE_NUMBER>172,
  }
}
```

`DELETE /fleet/cameras/{camera_id}`

Delete a specific camera belonging to the company of the user. A valid `camera_id` in the path parameter is required for a successful call.

A successful deletion will return a `200 OK` status and the deleted camera object in the response body.

repository: blewjy/slate

repo_name: blewjy/slate


text:
### [Find Words That Can Be Formed by Characters](https://leetcode.com/problems/find-words-that-can-be-formed-by-characters)

You are given an array of strings words and a string chars.

A string is good if it can be formed by characters from chars (each character can only be used once).

Return the sum of lengths of all good strings in words.

Example 1:

Input: words = ["cat","bt","hat","tree"], chars = "atach"
Output: 6
Explanation: The strings that can be formed are "cat" and "hat" so the answer is 3 + 3 = 6.

Example 2:

Input: words = ["hello","world","leetcode"], chars = "welldonehoneyr"
Output: 10
Explanation: The strings that can be formed are "hello" and "world" so the answer is 5 + 5 = 10.

Constraints:

1 <= words.length <= 1000

1 <= words[i].length, chars.length <= 100

words[i] and chars consist of lowercase English letters.

url: https://raw.githubusercontent.com/6leetcode/6leetcode/0c0973c634c881bd874bad5a0526b91a2d83f1a0/questions/Algorithms/1160. Find Words That Can Be Formed by Characters/README.md

gha_language: C


text:
# openCV
#Most of the codes are modified for learning and For my projects. Tested on CV 2.9 && 2.10 && 2.11
#using ip camera or any portable phone as camera

RaspberryPi is mostly cheap and good for nothing single board computer compared to its counterpart which are costly.

In our idea of implementation of locomative robot.at first we had no idea about locomation or any algorithm.Myself (NileshPandey) have worked on opencv from basic to advanced programming by my own,so Opencv wasn't problem. Problem is location of robot,It should be fast,Fast processing.
Using RPI which process image pretty slow,we came with idea of cloud computing here.
At first our approach was using webcam on rpi which will send data i.e. video to pc,which will return with result

Our appraoch ,1st we could use VNC or RDP,

http://www.instructables.com/id/Raspberry-Pi-remote-webcam/

this process is fair and simple,it does what its name says,but problem is  we were unable to get data from this. For instance we will say it was our ####app1

Our approach 2,
http://www.instructables.com/id/The-RROP-RaspRobot-OpenCV-Project/?ALLSTEPS

so here motion isn't used instead,VLC or mplayer is used,with this we can get data.
Important thing to note here was  https://www.raspberrypi.org/forums/viewtopic.php?t=48597
the argument mentioned in above site about installing  mjpeg-streamer. This is most  imporatnt and crucial part. If this part fails,nothing is going work,Lets discuss why this method failed in our case.

The web came being used is QHMPL PC WEBCAM,

In above link,we first tried the topmost argument,it didn't worked.

MJPG Streamer Version: svn rev: 3:160M
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 5
i: Format…………: MJPEG
ERROR opening V4L interface: Is a directory
Init v4L2 failed !! exit fatal
i: init_VideoIn failed

if this error appears  after following instruction from https://wolfpaulus.com/journal/embedded/raspberrypi_webcam/

chances are webcam doesn't supports mjpg streamer!

http://jacobsalmela.com/raspberry-pi-webcam-using-mjpg-streamer-over-internet/

we again tried,it again failed to open webcam.
We went to 3rd approach, using netcat

net cat is mostly use in survelliance cameras,so we thought why not give a try,we could see it didn't required mjpeg streamer.
Again it failed,so lets see!
http://zacharybears.com/low-latency-raspberry-pi-video-streaming/

this is entirely to view from ubuntu,but i was on windows,

http://www.recantha.co.uk/blog/?p=4128    this one is for windows,we needed to edit folder and some words mentioned on site.

It was fruitless too. Before i go further,its important to note,( raspivid) is only for rpi cameras not for usb cameras. fswebcam
is used for usb cameras,don't forget to replace raspivid with fswebcam.

After doing all this approach,we had no option but to optimize the opencv code.
I don't have link from where i downloaded the code,only possible way to speed up processing was to reduce captured frame size from HD to 160x240,with number of fps 5,it worked with great success but still there was lag,and reducing frame size ,made the program less optimum.

		resize(camera,camera,Size(160,240),0,0,INTER_LINEAR );

this is extra line added,its funny but its obvious .Most times being on pc,i don't prefer with above change,so without giving up i again started to try for cloud computing ,this time i had success .

We switched from USB camera to andoid /iphone camera,
1.Ip Camera app available on both android /iphone.
It is easy to setup
2. Open vlc under network streaming, type the address as http://<IP_ADDRESS>:8080/video

this will let you stream from android cam to vlc media player.
3.Using this data with Opencv C++ as well as Python code
It took much time to search but finally found ways,in Python its straight method

example:-

import cv2
import urllib
import numpy as np

stream=urllib.urlopen('http://<IP_ADDRESS>:8080/video')
bytes=''
while True:
    bytes+=stream.read(1024)
    a = bytes.find('\xff\xd8')
    b = bytes.find('\xff\xd9')
    if a!=-1 and b!=-1:
        jpg = bytes[a:b+2]
        bytes= bytes[b+2:]
        i = cv2.imdecode(np.fromstring(jpg, dtype=np.uint8),cv2.CV_LOAD_IMAGE_COLOR)
        cv2.imshow('i',i)
        if cv2.waitKey(1) ==27:
            exit(0)

reffered from http://petrkout.com/electronics/low-latency-0-4-s-video-streaming-from-raspberry-pi-mjpeg-streamer-opencv/

 The problem i was facing here was,i never programmed in one language,i keep switching between Python and C++.

C++ doesn't have any library like “urlib”
But it does have it's alternative like “libcurl” it didn't worked for me,may be installation failed but basically i wasn't able to reslove problem,unless i found solution on 1 site,
http://answers.opencv.org/question/3664/ip-network-camera-access/

here is my code:-

#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
#include <stdio.h>

using namespace std;
using namespace cv;

int main()
{
    Mat frame;
    namedWindow("video", 1);

VideoCapture cap;
cap.open("http://<IP_ADDRESS>:8080/video?x.mjpg");

    while ( 1)
    {
        cap >> frame;
        if(frame.empty()) break;

        imshow("video", frame);
        waitKey(5);
    }
    return 0;
}

SUCCESS!!!!!.

We have Mat object in both above cases on which we can perform opencv operations.


text:
---
title: Overview
page_title: Overview
description: Check our "Overview" documentation article for the RadPipsPager control.
slug: radpipspager-overview
tags: overview, radpipspager
published: True
position: 0
CTAControlName: RadPipsPager
---

# {{ site.framework_name }} RadPipsPager Overview

The PipsPager component lets the user navigate a linearly paginated collection using glyphs also known as pips.

{% if site.has_cta_panels == true %}
{% include cta-panel-overview.html %}
{% endif %}

![{{ site.framework_name }} RadPipsPager Overview](images/radpipspager-overview-0.png)

>tip Get started with the control with its [Getting Started]({%slug radpipspager-getting-started%}) help article that shows how to use it in a basic scenario.

## Key Features

* __Navigation__—The PipsPager control allows you to navigate through the data either in a loop or from end to end. The navigation can be done either using the navigation buttons or by selecting a pip.
* __Orientation__—PipsPager allows you to customize how the data will be navigated. The possible options are vertically or horizontally.
* __Customizing navigation buttons__—The PipsPager component provides the ability to customize the navigation buttons. You can learn more about this functionality in the [Navigation Buttons]({%slug radpipspager-navigation-buttons%}) article.

> Check out the demos application at [demos.telerik.com](https://demos.telerik.com/wpf/).

## See Also
* [Visual Structure]({%slug radpipspager-visual-structure%})
* [Getting Started]({%slug radpipspager-getting-started%})

repository: telerik/xaml-docs

repo_name: telerik/xaml-docs


text:
# Controllers
<!-- [[TOC]] -->

## Introduction

Controllers for WebSocket Routes are located in `app/Ws/Controllers`. It is highly recommended that you use Controllers instead of Closures in your routes file.

## Basic Controllers

Here is an example of a basic Controller Class:

```php
namespace App\Ws\Controllers;

use App\Ws\Controllers\Controller;

class ChatController extends Controller
{

    /**
     * Connect the user to given chatroom
     *
     * @param  int  $id
     * @return Response
     */
    public function roomConnect($id)
    {
        return 'You connected to chat room ' . $id;
    }

}
```

Routing to the Controller Action works in the same way you're used to from Laravel:

```php
WsRoute::subscribe('chat/room/{id}', 'ChatController@roomConnect');
```

_**Note:** All controllers should extend the base `Ws\Controller` class, not Laravel's base Controller class!_

## Special Controllers

Laravel provides two special types of Controllers: Implicit and RESTful Resource Controllers. Implicit Controllers work in the same way they do in Laravel, so if you're not sure on how they work go check the [Documentation](http://laravel.com/docs/5.0/controllers#implicit-controllers).

RESTful Controllers do not exist within TwoStream. The `WsRoute` Facade does not provide the `resource()` function, and attempting to use it will result in an error.


text:
# AsisTeam > nebankovni-registr.cz

[![Build Status](https://img.shields.io/travis/com/AsisTeam/nebankovni-registr-cz.svg?style=flat-square)](https://travis-ci.com/AsisTeam/nebankovni-registr-cz)
[![Licence](https://img.shields.io/packagist/l/AsisTeam/nebankovni-registr-cz.svg?style=flat-square)](https://packagist.org/packages/AsisTeam/nebankovni-registr-cz)
[![Downloads this Month](https://img.shields.io/packagist/dm/AsisTeam/nebankovni-registr-cz.svg?style=flat-square)](https://packagist.org/packages/AsisTeam/nebankovni-registr-cz)
[![Downloads total](https://img.shields.io/packagist/dt/AsisTeam/nebankovni-registr-cz.svg?style=flat-square)](https://packagist.org/packages/AsisTeam/nebankovni-registr-cz)
[![Latest stable](https://img.shields.io/packagist/v/AsisTeam/nebankovni-registr-cz.svg?style=flat-square)](https://packagist.org/packages/AsisTeam/nebankovni-registr-cz)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan)

## Credits

The development is under [AsisTeam s.r.o.](https://www.asisteam.cz/).
Feel free to use and contribute.

<img src="https://www.asisteam.cz/img/logo.svg" width="200" alt="Asisteam" title="Asisteam"/>

## Install

```
composer require asisteam/nebankovni-registr-cz
```

## Versions

| State       | Version | Branch   | PHP      |
|-------------|---------|----------|----------|
| development | `^0.1`  | `master` | `>= 7.1` |

## Overview

- [PreScoring](https://github.com/AsisTeam/nebankovni-registr-cz/blob/master/.docs/README.md#PreScoring)
- [Lustration](https://github.com/AsisTeam/nebankovni-registr-cz/blob/master/.docs/README.md#Lustration)
- [SharedService](https://github.com/AsisTeam/nebankovni-registr-cz/blob/master/.docs/README.md#SharedService)

repository: AsisTeam/nebankovni-registr-cz

repo_name: AsisTeam/nebankovni-registr-cz


text:
---
published: true
title: How to flash firmware under Linux in practice?
tags: linux system hardware firmware bios
---
> Well, I am feeling too old for jumping through several burning hoops to upgrade several firmwares via the usual vendor-specific way: Download some DOS tools, waste some time creating a (Free-)DOS boot medium and wasting more time to make the BIOS actually boot from that and finally flash the firmware upgrade. This is so 1980-ies. - [StackExchange](https://unix.stackexchange.com/questions/1920/how-to-flash-firmware-under-linux-in-practice)

## [Freedos](http://www.freedos.org/)
- [Creating a Bootable FreeDOS USB Flash Drive From Linux](https://baheyeldin.com/articles/linux/creating-bootable-freedos-usb-flash-drive-linux.html)


text:
---
layout: post
title:  "Word Up"
date: 2006-04-25 12:00:00 -0500
categories:
---

Something that’s annoyed me lately:  You check your email and open a message from someone.  The message is a memo about something or a laundry list of tasks to complete.  Instead of just writing the memo or the list of tasks in the email, the sender insists on putting it inside of a Word document.

The whole reason we have HTML-formatted email is so people can write out their pretty lists and images within an email, without forcing the receiver to open a $100 application just to read your message.

So, please, before you type up that memo in Word, ask yourself: do I really need to use Word?

Here are some pros and cons of using Word:

Pros:

* Word has fancy features for tables of contents, bookmarks, page numbering and headers, etc.
* Word is great for very large documents
* Word is great for “official” documents, like reports and application requirements documents

Cons:

* Your recipient must have a program that will open Word files
* Your recipient will be forced to save the file to their local disk, then open wait while Word opens the file
* Word files can carry viruses on Windows machines
* Word files consume more disk space than HTML emails
* You can use your email program to search through all your emails for things, instead of having to rely on Google Desktop Search or Windows File Search or searching through each Word document, one at a time

Not directed at anyone specific, just venting :)


text:
# hsqldb_docker
Dockerfile and other required files to build and run a HSQLDB server image.
HSQLDB is a lightweight relational database that maps all data in a database to a files on your local file system and runs on Java. It is suitable for dev and test environments. More info at : http://hsqldb.org/

#Dockerhub

A docker using this Dockerfile has already been published to dockerhub at :

techyugadi/hsqldb

# Build

To build your docker using the Dockerfile in this repository copy the Dockerfile  and hsqldb.jar to the same directory on your local machine and run:

sudo docker build -t="your_user/hsqldb" .

(Replace your_user by your user name)

We have user HSQLDB v2.3.2 here. Replace the jar with a newer one if available.

# Run

To run the docker directly from the image on Docker Hub, execute the command:

sudo docker run -d -p mapped_port:9001 techyugadi/hsqldb

(HSQLDB server runs in the container on port 9001. This port has been exposed in our Dockerfile. Map container port 9001 to a suitable mapped_port on the docker host.)

This starts a HSQLDB server running in a docker, with an empty database named 'starterdb'. The database can be accessed with super-user privileges, using user-name 'SA' with a blank password. The data for this database will be stored in the files /data/starterdb*.

PLEASE NOTE: The directory /data is specified as a VOLUME in our Dockerfile. This enables you to persist the data on the host file system.

You can create a database with your preferred name and data file prefix, when starting up the docker. However, it is recommended that you keep the data file within the /data directory, so that you get the benefits of using Volume. For example:

docker run -it -p 9001:9001 techyugadi/hsqldb --database.0 file:/data/mydb --dbname.0 mydb

You can also create a database with your chosen super-user and password. The way to do this is to pass the database parameters as a server.properties file to HSQLDB (please see HSQLDB documentation). To run your docker in this fashion, you can use a command like:

docker run -it -p 9001:9001 -v /home/user/dbtest/server.properties:/server.properties techyugadi/hsqldb --props /server.properties

Here you are bind-mounting the server.properties file onto /server.properties in the container. The --props option gets passed on to the command line to start HSQLDB.

Your server.properties should include the database URL with preferred user-name and password, as follows:

server.database.0=file:/data/testdb;user=testuser;password=testpswd

server.dbname.0=testdb


text:
# Tests for LoRaWAN Airtime regulations module
All test input datasets contain UniRec records which simulates traffic statistics traffic captured by lora-collector.

## LoRaWAN Airtime regulations - Duty cycle 10%
Use Case: This test verifies the correct detection where breach of the regulated conditions. The duty cycle of radio devices is often regulated by government. For data simulation we used real captured data from the traffic of the campus gateway.

Test: For 10% duty cycle means the signal is on 10% of the time but off 90% of the time.

Configuration parameters: -d 10 (other parameters is default)

Input Traffic: duty_cycle_10.csv

### Input
The input file contains 105 messages capture from real gateway traffic.

### Expected output
The output will show 8 messages where the<PHONE_NUMBER>,<PHONE_NUMBER> and<PHONE_NUMBER> devices has exceeded transmission time.

repository: CESNET/NEMEA-SIoT

repo_name: CESNET/NEMEA-SIoT


text:
# New Racing Point HQ granted planning permission

Published at: **2019-11-01T10:15:00+00:00**

Author: **Louis Shaw**

Original: [GPblog.com](https://www.gpblog.com/en/news/49134/new-racing-point-hq-granted-planning-permission.html)

        Racing Point have been given planning permission for a new HQ at Silverstone. The team will extend its current facility so the team can do all their work under one roof. The building will be two stories high and could be what the team needs to help improve their performances.

“Our team’s origins stem from Jordan in 1991, which is when the current building was built. But we are now known as Racing Point, and we are driven by a passion for motorsport and have clear ambitions to compete at the highest level of it," Simon Lake, a project manager for Racing Point said to the Northampton Chronicle.

        "We want to build on the established team and location that we have, and we need to take advantage of our location at Silverstone as it’s the ideal base from which to grow.

        “Formula One is a highly innovative business with state-of-the-art technology and this is necessary for us to keep up with these advances.”

The old facilities were not adequate for a team trying to make their mark on the F1 grid and this new building should help bring the team together and lead to more success.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
# utf16offset package for [Atom](https://atom.io) [![Build Status](https://travis-ci.org/norio-nomura/atom-utf16offset.svg?branch=master)](https://travis-ci.org/norio-nomura/atom-utf16offset)

Display cursor position as the UTF16 based offset from the beginning of edit buffer in status-bar.

![A screenshot of your package](https://raw.githubusercontent.com/norio-nomura/atom-utf16offset/master/screenshot.gif)

## Plugin installation
```
$ apm install utf16offset
```

## Settings
You can configure UTF16 based Cursor Offset and Selected Length Format by editing ~/.atom/config.cson (choose Open Your Config in Atom menu):
```cson
  utf16offset:
    statusBarFormat: "{%O, %L}"
```

## License
[MIT](LICENSE.md)

gha_language: CoffeeScript


text:
# Exercise 1.0
In this exercise you will setup a work environment for the lessons provided
in this workshop.  Ask the instructor for the URL of the server you will be using during the workshop.

1. Goto to the Workshop URL provided by the instructor;
2. Click on the **Create an account** link in the middle of the page under the **Login** button.
3. Complete the **Sign up** form (all fields are required) and click the **Sign up** button;
4. You should see a **Success** page - click on **the top page** link;
5. Click on the link for the **workshop** folder;
6. In the left menu, click on the **New dev-folder** link;
7. For **Enter an item name** enter your workshop **Username**, select **dev-folder** and click the **OK** button;
8. On the next screen, click the **Save** button;
9. You will now be in your very own **dev-folder** where you will be able to create and edit Pipelines for this workshop.

# Exercise 1.1

In **Exercise 1.1** we will create a simple declarative pipeline directly within the Jenkins interface.

Using the personal folder created for you in Exercise 1.0, do the following:

1. Click on the **create new jobs** link.  Alternatively you can create a job by selecting **New Item** from the left menu and then step 2 below.
2. Type **SimplePipeline** into the **Enter an item name** text box, click on **Pipeline**, and then click on the **OK** button.
3. Copy and paste the following code into the **Pipeline Script** text box near the bottom of the page:

```
pipeline {
   agent any

   stages {
      stage('Say Hello') {
         steps {
            echo 'Hello World!'
         }
      }
   }
}
```

4. Click on **Save** and then click on **Build Now** in the left menu to run your pipeline.

# Exercise 1.2

In **Exercise 1.2** we will update the pipeline we created in Exercise 1.1 to execute in a docker container. To update the pipeline:

1. In the `steps` block add the following after the `echo` step:

```
  sh 'make --version'
```

2. Execute your job by clicking on **Build Now** and check the Console Log. The build will fail with `make: not found`

3. Click on configure and update the ```agent``` portion of the pipeline to read:

```
   agent {
      docker {
        image 'gcc:latest'
        label 'docker-cloud'
      }
   }
```

4. Execute your job by clicking on **Build Now** and check the Console Log to see how Jenkins pulls the appropriate docker image and runs your build inside the container created from that image.

5. Remove the `label 'docker-cloud'` line from your pipeline job and build the job again by clicking on **Build Now**.  The job should still work... but why?? Pipeline Model Definition is why.  The Pipeline Model Definition allows an administrator to define the default label a job should use if one is not specified with docker.  In this case the Pipeline Model Definition is already set to `docker-cloud`.  This means that you will get an agent running dockerd everytime you use the docker {} block so using label parameter is redundant unless you need a specific docker agent.

Before going on to the next exercise let's revert our pipeline to using:

```
   agent any
```

And remove the `sh 'make --version'` step

# Exercise 1.3

For **Exercise 1.3** we are going to update our **SimplePipeline** job to demonstrate how to use environmental variables.

At the top of the pipeline insert the following code between the ```agent``` and ```stages``` blocks:

```
   environment {
      MY_NAME = 'Mary'
   }
```

Then update the ```echo 'Hello World!'``` line to read ```echo "Hello ${MY_NAME}!"``` and run your build again to view the results.  Notice the change from '' to "".  Using double quotes will trigger extrapolation of environment variables.

We can also use environmental variables to import credentials. To demonstrate we will add the following line to our ```environment``` block:

```TEST_USER = credentials('test-user')```

We will also add the following ```echo``` steps within the ```steps``` of the Say Hello ```stage```:

```
            echo "${TEST_USER_USR}"
            echo "${TEST_USER_PSW}"
```

**Note**: After executing the build look at the console output and make note of the fact that the credential user name and password are masked when output via the echo command.

# Exercise 1.4

In **Exercise 1.4** we will alter our pipeline to accept external input in the form of a Parameter.

At the top of your pipeline insert the following block of code between the ```environment``` and ```stages``` blocks:

```
   parameters {
      string(name: 'Name', defaultValue: 'whoever you are',
	     description: 'Who should I say hi to?')
   }
```
Then update the ```echo "Hello ${MY_NAME}!'``` line to read ```echo "Hello ${params.Name}!"``` and run your build again to view the results.

**Note**: Jenkins UI won't update properly when you save the pipeline to show the ```Build with parameters``` option so you need to run a build, view the results, and then return to the project to see the updated option.

# Exercise 1.5

For **Exercise 1.5** we are going to add a new stage after the **Say Hello** stage that will demonstrate how to ask interactively for user input.

**Important Note** The following code demonstrates a new set of features added to Declarative Pipeline in Version 1.2.6:

  - Add options {} for stage - supports block-scoped "wrappers" like timeout and Declarative options like skipDefaultCheckout
  - Add input {} directive for stage - runs the input step with the supplied configuration before entering the when or agent for a stage, and makes any parameters provided as part of the input step available as environment variables.

The declarative `input` directive blocks the `stage` from executing and acquiring an agent - this is an important enhancement as previously a more complicated work-around was required to not tie up an agent with an input step. If the `input` is approved, the stage will then continue.

Insert the following `stage` block into your pipeline after `stage('Say Hello') {} block:

```
    stage('Deploy') {
      input {
        message "Should we continue?"
      }
      steps {
        echo "Continuing with deployment"
      }
    }
```

**Note**: To keep Jenkins from waiting indefinitely for a user response your should set a ```timeout``` for the `stage` like shown below:

```
    stage('Deploy') {
      options {
        timeout(time: 1, unit: 'MINUTES')
      }
      input {
        message "Should we continue?"
      }
      steps {
        echo "Continuing with deployment"
      }
    }
```

On the next build wait for the input time to see what happens.

# Exercise 1.6

In this example we will replace the **Deploy** stage with an input that returns data to the pipeline for use later in a subsequent step or stage.  This form of input is useful when needing to query users for additional data before continuing pipeline processing.

Replace the **Deploy** stage with the following and rerun the job:
```
    stage('Deploy') {
      input {
        message "Which Version?"
        ok "Deploy"
        parameters {
            choice(name: 'APP_VERSION', choices: "v1.1\nv1.2\nv1.3", description: 'What to deploy?')
        }
      }
      steps {
        echo "Deploying ${APP_VERSION}."
      }
    }
```

# Exercise 1.7

What happens if your input step times out? **Post Actions** are designed to handle a variety of conditions (not only failures) that could occur outside the standard pipeline flow.

In this example we will add a Post Action to our **Deploy** stage to handle a time out (aborted run). Modify your **Deploy** stage to look like:

```
    stage('Deploy') {
      options {
        timeout(time: 1, unit: 'MINUTES')
      }
      input {
        message "Which Version?"
        ok "Deploy"
        parameters {
            choice(name: 'APP_VERSION', choices: "v1.1\nv1.2\nv1.3", description: 'What to deploy?')
        }
      }
      steps {
        echo "Deploying ${APP_VERSION}."
      }
      post {
        aborted {
          echo 'Why didn\'t you push my button?'
        }
      }
    }

```

On the next build wait for the input time and you will see the following line in your console output: ```Why didn't you push my button?```.

**Note**: After completing this exercise remove the ```Deploy``` stage from your pipeline so that you will not have to manually approve it each time it runs.

# Exercise 1.8

In this exercise we will combine the simplicity of declarative pipeline with
more advanced features of pipeline available via the `script {}` block.

Scripted Pipelines can be very advanced and contain advanced flow control and variable assignment that are not available in declarative pipelines without using a `script` block.  A `script` block allows you to insert the more advanced scripted version of pipeline into a declarative pipeline.

After removing the ```stage('Deploy')``` block from the previous example add two new stages called ```stage('Get Kernel')``` and ```stage('Say Kernel')``` to your pipeline after the **Say Hello** stage:

```
    stage('Get Kernel') {
      steps {
        script {
          try {
            KERNEL_VERSION = sh (script: "uname -r", returnStdout: true)
          } catch(err) {
            echo "CAUGHT ERROR: ${err}"
            throw err
          }
        }
      }
    }
    stage('Say Kernel') {
      steps {
        echo "${KERNEL_VERSION}"
      }
    }

```
**Note:** Notice the use of the `script` block in the above example.  This allows you to use more advanced scripting options in your declarative pipelines.

**Note**: After completing this exercise remove the ```Get Kernel``` and ```Say Kernel` stages from your pipeline.

# Exercise 1.9

In this exercise we are going to add another stage to our pipeline that runs two steps in parallel on two different docker based agents (one running Java 7 and one running Java 8). The following code also includes ```sleep``` steps to demonstrate what happens when parallel steps complete execution at different times:

**Important Note** The following code demonstrates a new set of features added to Declarative Pipeline in Version 1.2 (parallel stages) and 1.2.1 (failFast inside of a parallel stage).

Add the following stage after ```stage('Say Hello')```:

```
      stage('Testing') {
        parallel {
          stage('Java 7') {
            agent { docker 'openjdk:7-jdk-alpine' }
            failFast true
            steps {
              sh 'java -version'
              sleep time: 1, unit: 'MINUTES'
            }
          }
          stage('Java 8') {
            agent { docker 'openjdk:8-jdk-alpine' }
            steps {
              sh 'java -version'
              sleep time: 2, unit: 'MINUTES'
            }
          }
        }
      }
```

**Note**: If your build breaks double check your pipeline script to make sure that the agent at the top of of the pipeline was reverted back to ```agent any``` as described in exercise 1.2.

# Exercise 1.10

In **Exercise 1.10** we are going to add a stage to our pipeline that uses a **Shared Library** to import functionality that allows us to say hi.

More information on using Shared Libraries is available here: https://jenkins.io/doc/book/pipeline/shared-libraries/

Add the following line at the top of your pipeline **above** the ```pipeline``` line:

```library 'BeedemoLibs'```

Then replace the **Testing** stage with the following:

```
      stage('Shared Lib') {
         steps {
             helloWorld("Jenkins")
         }
      }
```

The ```helloWorld``` function we are calling can be seen at: https://github.com/beedemo/workflowLibs/blob/master/vars/helloWorld.groovy

repository: pipeline-training/jenkins-declarative

repo_name: pipeline-training/jenkins-declarative


text:
## Deprecated.

---------------
# [Online Resume](https://younes-megaache.com/)

My personal website (online resume) built on Angular and NodeJS based on the MEAN stack.

## run locally

1. Start the server with command: `npm start` or `node server.js`
2. In different terminal, start angular app: `ng serve -o`

## Env

copy `.env.example` and rename it to `.env`, then update the variables inside the file as follow:

- CONTACT_EMAIL: The email that will the messages sent through the contact form.
- MONGODB_URL: the website will collect basic analytics which include website view,user agent, location..., I use free MongoDB database called Atlas DB, the URL must be of the following format: mongodb://**username**:**password**@**host**:**port**/**databaseName**.
- NODEMAILER_EMAIL: email address that will be used to send contact form messages to your contact email
- NODEMAILER_PASSWORD: password for **NODEMAILER_EMAIL**, required to authenticate and send emails

## Front End (Angular)

Information like education, experiences, projects... can be set in the config files at `src/app/main/config`.

Assets like profile picture, sidebar background(portrait) can be found in `src/assets`.

## Server Side (Nodejs)

Server side code can be found in folder `server`

Upload your cv to `/server/files`, the name of the file must end with `.cv.pdf`, otherwise you need to set the name of your CV in `/server/controllers/cv.js`.

Messages from contact from will be sent to your email using **nodemailer**, in `.env` file set the sending and receiving emails:

- **CONTACT_EMAIL**: which will be the email to receive the messages
- **NODEMAILER_EMAIL** and **NODEMAILER_PASSWORD**: which will be used to send messages as emails to your **CONTACT_EMAIL**

## Tests

To test the API (server side code), run the command: `npm test`.
No tests are included for the front-end.

## Contributing

All kind of contributions are welcome.

## License

```txt
   Copyright 2021 Younes Megaache

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

```

repository: megaacheyounes/portfolio

gha_language: TypeScript

repo_name: megaacheyounes/portfolio


text:
---
layout: page
title: About
---

<!-- <p class="message">
  Hey there! This page is included as an example. Feel free to customize it for your own use upon downloading. Carry on!
</p> -->

StatapMY is a showcase of inspiring and ambitious local Malaysian startup companies that have been successfully launched their product to the masses. Whether it is just an app or web service, StatapMY will document them all in this little site. It's built and curated by [Nurfaiz Foat](http://nrfz.org).

<!-- There are currently two themes built on Poole:

* [Hyde](http://hyde.getpoole.com)
* [Lanyon](http://lanyon.getpoole.com)

Learn more and contribute on [GitHub](https://github.com/poole). -->

## Submission

Local startups scene is at its best now. So, we accept all submission as long as it follows the instruction on How to Submit section below.

## How to Submit

To submit a site suggestion, open an issue or create a pull request. Pull requests will be given higher priority since they are easier to include. Make sure the screenshot is at least 1000x800 and please double check that everything looks good before submitting.

It’s also a good idea to run the screenshot through an image optimizer like TinyPNG before including it. This will help keep the website fast and the repository small as possible. [Submit a startup. Yes?](https://github.com/nurfaizfoat/statapMY)

## About the Site

This site is hugely inspired by [Bootstrap Expo](http://expo.getbootstrap.com/), [Built with Ember](http://builtwithember.io/) and [Beautiful Open](http://beautifulopen.com). It's built with [Jekyll](http://jekyllrb.com), developed on [GitHub](http://github.com), and yes it is hosted on [GitHub Pages](https://pages.github.com/).

## Some Fun Facts

* Coded with [Atom](https://atom.io/)
* Main purpose *(hidden agenda)* is mainly to push my self to kickstart my own startup! 😂 😂
* Designed and developed while listening to the wonderful sermon of [Ustaz Shamsuri Hj. Ahmad on Zon Kuliah](https://www.facebook.com/zonkuliah)

<!-- Some fun facts about the setup of this project include:

* Built for [Jekyll](http://jekyllrb.com)
* Developed on GitHub and hosted for free on [GitHub Pages](https://pages.github.com)
* Coded with [Sublime Text 2](http://sublimetext.com), an amazing code editor
* Designed and developed while listening to music like [Blood Bros Trilogy](https://soundcloud.com/maddecent/sets/blood-bros-series)

Have questions or suggestions? Feel free to [open an issue on GitHub](https://github.com/poole/issues/new) or [ask me on Twitter](https://twitter.com/mdo).

Thanks for reading! -->

repository: RobbiNespu/statapMY

branch_name: refs/heads/gh-pages

gha_language: HTML

repo_name: RobbiNespu/statapMY


text:
# elm-financial: Proper numeric datatypes for operating on currency data
If you are going to display and process financial data (money, prices, tax rates, quotes)
you need some kind of exact data type. If, instead, you use a float, the floating poing
rounding shenanigans will eventually bit you, adding a penny here or there, or
suddenly creating a number with many decimals out of thin air.

Try for example in your favourite JS repl:
>> 0.1 + 0.2
<- 0.30000000000000004

This is not a valid result, specially if you are adding 0.10 USD and 0.20 USD.

This library attempts to solve this problem in a financial environment, not a general one.

It offers a new data type: *Financial*
*Financial* supports the basic math operations with perfect accuracy: add, substract, multiplication and negate (opposite)
It also supports dividing, but it can't guarantee perfect accuracy when dividing, for obvious
mathematical reasons (1/3 = 0.33333333333...).

# Usage
Currently the library is in alpha stage, although it will reach beta soon.
The way to use it is:

1. Convert a number to a *Financial*

  * fromInt : Generates a *Financial* from an Int
  * withDecimalsFromInt : Generates a *Financial* from an Int specifying how many digits are decimals. For example, withDecimalsFromInt 2 102 would be used to generate a *Financial* for 1.02
  * genPercentage : Generates a *Financial* for calculating a percentage. genPercentage 12 generates a *Financial* 0.12. Then you can use it to extract 12% of another *Financial* by multiplying the two.

2. Combine *Financial*s

  * add, sub : Adds or substracts two *Financial*s. The resulting *Financial* has as many decimals as the *Financial* with the most decimals
  * opposite : Changes the sign of a *Financial*, turning positives into negatives and negatives into positives.
  * mul : Multiplies two *Financial*s. The resulting *Financial* has as many decimals as the sum of the decimals of the *Financial*s involved
  * div : Divides two *Financials*. The resulting *Financial* is created with as many decimals as possible

3. Post-process the resulting *Financial*

  * roundToDecimals : Rounds the *Financial* to have the specified decimals. If it has too few, it adds some. If it has too many, it removes decimals, rounding to the nearest digit.

4. Format the result as a String

  * toString : Converts the *Financial* to a String with standard math representation, as in 3.55 or -41.20.
  * toAccountingString : Converts the *Financial* to a String with that wonky accounting representation that uses parenthesis for negative, as in 3.55 or (41.20).

# Internal representation
Internally, the *Financial* is stored as two Ints: The value, and how many digits of the value are decimals. This way, we can add 0.1 + 0.2, by adding 1 + 2 while keeping in mind that it has 1 decimal digits. Thus 0.1 + 0.2 = (1 + 2) * 10^-1 = 3 * 10^-1 = 0.3.

You don't have to care that much about the internal representation. But you have to remember to round down when you have too many decimals.

# Precision issues
Because the internal representation is a couple of Ints, and the backend is Javascript, there is a limit on how many digits (and thus decimals) can your *Financial*s use. See max\_significative\_digits : Int to see how many digits you can use.
If you try to use more digits, the *Financial* will collapse into the *Invalid* state, which currently I consider better than showing and processing float numbers. This may change and improve in the future.

# Other info
* The module also exports a test suite, as a list of (String, Bool). If all the Bools are True, everything is supposed to be fine.

repository: javcasas/elm-financial

repo_name: javcasas/elm-financial


text:
---
title: "Recover Designer Working Sets"
permalink: "/2011/05/recover-designer-working-sets.html"
categories:
  - domino designer
---
If your Domino Designer environment is as stable as mine, you loose your precisely crafted Working Sets at least once a week. I still do not know why Designer is as instable as it has been the last few weeks, but at least I have found a way to recover a lost Working Set. Hooray!

The first step is to make sure you have a backup of the notes/data directory. I recommend CrashPlan+. The family plan is hard to beat in price if you have more than one computer or a couple of VM's. It allows you to do offsite cloud backups, with up to 10 computers, unlimited in size. Additionally, you can backup to a local drive, NAS or friends computer (free, free, free). There's no excuse not to do backups.

With that out of the way, the Working Sets are stored in a file in your notes/data directory:

> notes\data\workspace\.metadata\.plugins\org.eclipse.ui.workbench\workingsets.xml

Each time Domino Designer starts up with blank Working Sets,  close Notes and Domino Designer, restore the file mentioned above from your backup system and start Notes / Domino Designer.

Game on!


text:
---
title: Examples
type: Details
---

### Basic Configuration

Create a dataset and account that can manage and query the data.
Uses plan: `10ff4e72-6e84-44eb-851f-bdb38a791914`.

**Provision**

```json
{
    "name": "orders_1997"
}
```

**Bind**

```json
{
    "role": "bigquery.user"
}
```

repository: piotrmiskiewicz/bundles

gha_language: Shell

repo_name: piotrmiskiewicz/bundles


text:
# A Research Of Training Data Augmentation For Deep Learning

## About the code

- **generate_images.py**: It can generate 100 pieces of picture from one picture with doing some basic shift on it.
- **train.py**: It is a construction of CNN based on Keras. I used the construct of ResNet to create it. we can regard it as a simplify ResNet construction.It relates to the /keras-data-augmentation-res/pyimagesearch/resnet.py
- **classify.py**: It can test the model which has been trained. The test data was saved in the fold named example.

## Training data

In this paper, I use the training data from < Kaggle: Dogs vs. Cats　dataset >. But I just used a part of it. If you want to learn more, please visit the URL: https://www.kaggle.com/c/dogs-vs-cats

## License
[MIT](https://choosealicense.com/licenses/mit/) © liuminxuan

repository: liuminxuan/keras-data-augmentation-res

repo_name: liuminxuan/keras-data-augmentation-res


text:
[activeannoservice](../../../index.md) / [common](../../index.md) / [HttpAuthentication](../index.md) / [ApplicationJwt](index.md) / [<init>](./-init-.md)

# <init>

`ApplicationJwt()`

Authenticate by sending the application's JWT with the request

repository: MaxMello/ActiveAnno

repo_name: MaxMello/ActiveAnno


text:
---
layout: creature
name: "Necromancer"
tags: [mediana, humanoide, cr9, volos-guide]
cha: 11 (0)
wis: 12 (+1)
int: 17 (+3)
con: 12 (+1)
dex: 14 (+2)
str: 9 (-1)
size: Humanoide Mediano (cualquier raza)
alignment: cualquier alineamiento
challenge: "9 (5,000 XP)"
languages: "any four languages"
skills: "Arcanos +7, Historia +7"
saving_throws: "Int +7, Sab +5"
speed: "30 ft."
hit_points: "66 (12d8+12)"
armor_class: "12 (15 with mage armor)"
damage_resistances: "necrotic"
---

***Lanzamiento de conjuros.*** The necromancer is a 12th-level spellcaster. Its spellcasting ability is Intelligence (spell save DC 15, +7 to hit with spell attacks). The necromancer has the following wizard spells prepared:

Cantrips (at will): chill touch, dancing lights, mage hand, mending

1st level (4 slots):false life*, mage armor, ray of sickness*

2nd level (3 slots): blindness/deafness*, ray of enfeeblement*, web

3rd level (3 slots): animate dead*, bestow curse*, vampiric touch*

4th level (3 slots): blight*, dimension door, stoneskin

5th level (2 slots): Bigby's hand, cloudkill

6th level (1 slot): circle of death*

*Necromancy spell of 1st level or higher

***Grim Harvest (1/Turn).*** When necromancer kills a creature that is neither a construct nor undead with a spell of 1st level or higher, the necromancer regains hit points equal to twice the spell's level, or three times if it is a necromancy spell.

### Acciones

***Withering Touch.*** Melee Spell Attack: +7 al ataque, alcance 5 pies (1.5 mts), una criatura. Impacto: 5 (2d4) necrotic damage.