text:
# aping

aping is an average ping script. It wraps `ping` and prints out data as each ping is (or isn't) received.

## Usage

	aping <address>

## Example

	Julius:aping(master) caius$ ./build/Debug/aping google.com
	PING google.com (<IP_ADDRESS>): 56 data bytes
	64 bytes from <IP_ADDRESS>: icmp_seq=0 ttl=49 time=193.129 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=1 ttl=49 time=187.329 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=2 ttl=49 time=271.651 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=3 ttl=49 time=285.301 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=4 ttl=49 time=275.630 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=5 ttl=49 time=245.522 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=6 ttl=49 time=190.020 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=7 ttl=49 time=230.764 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=8 ttl=49 time=224.335 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=9 ttl=49 time=223.009 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=10 ttl=49 time=215.395 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=11 ttl=49 time=185.624 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=12 ttl=49 time=190.114 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=13 ttl=49 time=306.613 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=14 ttl=49 time=310.030 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=15 ttl=49 time=187.502 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=16 ttl=49 time=247.679 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=17 ttl=49 time=234.007 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=18 ttl=49 time=307.930 ms
	19 sent, 19 received, 0.0% packet lossping: sendto: Network is down
	ping: sendto: No route to host
	ping: sendto: No route to host
	ping: sendto: No route to host
	ping: sendto: No route to host
	Request timeout for icmp_seq 19
	Request timeout for icmp_seq 20et loss
	Request timeout for icmp_seq 21et loss
	Request timeout for icmp_seq 22ket loss
	Request timeout for icmp_seq 23ket loss
	64 bytes from <IP_ADDRESS>: icmp_seq=24 ttl=49 time=322.844 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=25 ttl=49 time=210.551 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=26 ttl=49 time=200.314 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=27 ttl=49 time=277.611 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=28 ttl=49 time=186.949 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=29 ttl=49 time=228.979 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=30 ttl=49 time=190.477 ms
	64 bytes from <IP_ADDRESS>: icmp_seq=31 ttl=49 time=186.764 ms
	32 sent, 27 received, 15.6% packet loss^C
	--- google.com ping statistics ---
	32 packets transmitted, 27 packets received, 15.6% packet loss
	round-trip min/avg/max/stddev = 185.624/233.929/322.844/44.409 ms

## Licence

The MIT License

Copyright (c) 2009 Caius Durling<EMAIL_ADDRESS>
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: paragkavar/aping

repo_name: paragkavar/aping


text:
# routes-getter
[![Build Status](https://travis-ci.org/nitin42/routes-getter.svg?branch=master)](https://travis-ci.org/nitin42/routes-getter)
[![npm](https://img.shields.io/npm/v/npm.svg)]()
[![dependency](https://img.shields.io/badge/dependencies-up--to--date-green.svg)]()
![downloads](https://img.shields.io/badge/downloads-73-brightgreen.svg)

> ***Accessible routes in your ExpressJS application***

An easy way of working with your routes in [ExpressJS](https://expressjs.com) applications.
It walks through your routes folder and imports them to your project.

**Note** - It does not walk through the `middlewares` folder in your `routes` folder. Since they are used and shared by routes as further middlewares.

#### Table of Contents

* [Installation](#installation)
* [Examples](#examples)
* [API](#api)

## Installation

```
npm install -g routes-getter
```

## Examples

Assuming the `src` directory to be the application folder, this is how you will define the routes

```javascript
// src/routes/index.js

module.exports = (app) => {
	app.get('/', (req, res) => {
		res.render('../views/index.html');
	});
}
```
`server.js` file in your app directory.

```javascript
// src/server.js

const express = require('express');
const loader = require('routes-getter');

const app = express();

loader.routers(__dirname + '/routes', app); // Loads the routes in your application
```

Check the complete example [here](https://github.com/nitin42/routes-getter/tree/master/example)

## API

### loader.routers([options])

### options

#### path

*Required*

Path to routes in your application folder.

#### app

*Required*

app should be instance of **express**

## Tests

```
npm test
```

## Contributing

Add unit tests for any new or changed functionality.

## License

ISC

license: ISC

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# fib-impls

For comparing AssemblyScript vs. JavaScript implementations of the same, non-memoized and slow, Fibonacci algorithm

A webserver will be needed (since the .wasm file is retrieved using `fetch`) that you can control the mime-type configuration for, I'm using NGinx and merely had to add the following line to mimes.type

    	application/wasm                                 wasm;

license: MIT

repository: dexygen/fib-impls

repo_name: dexygen/fib-impls


text:
## Snapshot Testing

Adding [snapshot tests with Jest](https://facebook.github.io/jest/docs/en/snapshot-testing.html) is a great way to help avoid unintended changes to your app's UI.

By diffing the serialized value of your React tree Jest can show you what changed in your app and allow you to fix it or update the snapshot.

By default snapshots with emotion show generated class names. Adding [jest-emotion](https://github.com/emotion-js/emotion/tree/master/packages/jest-emotion) allows you to output the actual styles being applied.

<img height="360px" src="https://user-images.githubusercontent.com/514026/31314015-02b79ca6-abc3-11e7-8f70-1edb31c7f43b.jpg"/>

### Installation

```bash
npm install --save-dev jest-emotion
```

**testSetup.js** _or_ at the top of your test file

```javascript
import * as emotion from 'emotion'
import { createSerializer } from 'jest-emotion'

expect.addSnapshotSerializer(createSerializer(emotion))
```

**package.json**

```json
"jest": {
	[...]
	"setupTestFrameworkScriptFile": "<rootDir>/testSetup.js",
	"testEnvironment": "jsdom"
	[...]
}
```

### Adding a test

```javascript
import React from 'react';
import renderer from 'react-test-renderer';
import App from './App';

test('Link renders correctly', () => {
    const tree = renderer.create(<App />).toJSON();
    expect(tree).toMatchSnapshot();
});
```

### Notes

Your snapshot class names will appear as `emotion-[0...n]` instead of `css-[hash]`.

repository: darahak/emotion

repo_name: darahak/emotion


text:
# DSC implementations: tradeoffs
`dsc_lite` is a new approach to managing nodes by leveraging Microsoft's [Desired State Configuration](https://docs.microsoft.com/en-us/powershell/dsc/overview).
Puppet has an existing approach in the form of the supported [`dsc` Module](https://github.com/puppetlabs/puppetlabs-dsc).

This document explains the benefits and drawbacks of each approach and why a second approach has been implemented.

## Overview
The approach to managing DSC Resources in `dsc_lite` is to use a generalized Puppet call.
This lets you use any DSC Resource available on the target node but requires you to set all of the configuration data correctly.

Instead of writing a declaration in your Puppet manifest that looks like this:

```puppet
dsc_file {'fruit_file':
  dsc_ensure          => 'present',
  dsc_type            => 'File',
  dsc_destinationpath => 'C:\\Fruit.txt',
  dsc_contents        => 'Apple, Banana, Cherry.',
}
```

You'll write a simplified declaration that looks like this:

```puppet
dsc {'fruit_file':
  resource_name => 'File',
  module => 'PSDesiredStateConfiguration',
  properties => {
    ensure          => 'present',
    content         => 'Apple, Banana, Cherry.',
    destinationpath => 'C:\\Fruit.txt',
  }
}
```

The latter is a generalized resource that allows you to use _any_ DSC Resource which is compatible with [`Invoke-DscResource`](https://docs.microsoft.com/en-us/powershell/module/psdesiredstateconfiguration/invoke-dscresource?view=powershell-5.1) and is available on the machine that you are configuring, while the former only allows you to use the DSC Resources bundled with the Puppet `dsc` module.

## Why should you use the new `dsc_lite` module?

Use `dsc_lite` if one or more of the following apply to you:

+ You need to use one or more DSC Resources which are _not_ [vendored](#vendoring) into Puppet's `dsc` module
+ You want to use class-based or custom DSC Resources
+ You need to use multiple versions of the same DSC resource
+ You want pluginsync to benefit from a [reduced footprint](#pluginsync-impact) - the file count for the module is reduced from thousands of files to a handful
+ You don't want to build your own custom version of the Puppet `dsc` module to include custom resources
+ You can live without the [validation](#validation) of the existing Puppet `dsc` module
+ You don't mind managing the installation of PowerShell modules containing DSC Resources on your nodes
+ You want to use the latest versions of DSC Resources even if they're not [vendored](#vendoring)

## Why should you keep using the Puppet `dsc` module?

You should consider continuing to use the existing Puppet `dsc` module if one or more of the following apply to you:

+ You want [earlier feedback about the validity of manifest code](#validation)
+ You're only using Microsoft-provided DSC Resources - i.e., not using custom, community-maintained, or class-based DSC Resources
+ You've already got a good [workflow for building an internal release of the Puppet `dsc` module with custom resources](https://github.com/puppetlabs/puppetlabs-dsc/blob/master/README_BUILD.md)
+ You don't want to manage installing DSC Resources on your nodes
+ You need the granularity of reporting in the Puppet Enterprise (PE) console which is based on each resource type being different - allowing you to filter and group on DSC Resources

## Additional considerations

The `dsc_lite` module is currently in an early, unsupported state and undergoing rapid iteration.
It is intended to be a lighter weight alternative to the existing module which primarily trades off flexibility for ease-of-use and safety.

Switching between the two approaches will require some work to update the resource declarations in your manifests.

A primary drawback of using `dsc_lite` is that you're responsible for installing DSC Resources onto all of the nodes you wish to configure with it - the module no longer vendors the DSC Resources for you.

### Vendoring

The existing Puppet `dsc` module vendors numerous DSC Resources into it - that is, the Puppet `dsc` module includes [many PowerShell DSC Resources](https://github.com/puppetlabs/puppetlabs-dsc/tree/master/lib/puppet_x/dsc_resources) inside it.
This means that those DSC Resources are automatically on every machine which has the Puppet `dsc` module without you having to manage them individually.
However, this means that if there are DSC Resources you do _not_ want to sync, or DSC Resources not vendored in the Puppet `dsc` module, you'll need to [rebuild the module to your own specifications](https://github.com/puppetlabs/puppetlabs-dsc/blob/master/README_BUILD.md).

The `dsc_lite` module does not vendor the DSC Resources for you, but neither does it limit you to only using vendored DSC Resources.
Any DSC Resource available on the machine can be used by the `dsc_lite` module.

#### Pluginsync impact
The Puppet `dsc` module vendors many different DSC Resources, and therefore has a large footprint and includes thousands of files.
The pluginsync downloads files from every module in the agent's environment modulepath, regardless of whether the node uses them.
This means that _every_ machine using an environment that includes the Puppet `dsc` module will get thousands of files synced to them.
This can be very slow and has the most noticeable impact amongst short-lived machines.

### Validation
The existing Puppet `dsc` module also gives you valuable development and compile-time validation.
The Puppet `dsc` module is aware of the types required for the DSC Resources, including whether a property should be an `int` or a `string`, whether it should be a well-formed path, and whether or not the property is required for the DSC Resource to properly run.
Because of this awareness, the Puppet `dsc` module is able to give you immediate feedback when parsing your manifest - letting you know right away if you've made a syntactic mistake - and useful, human readable feedback at compile time.

For example, if we specify an integer for a property that requires a path:

```puppet
dsc_file {'fruit_file':
  dsc_ensure          => 'present',
  dsc_type            => 'File',
  dsc_destinationpath => 1,
}
```

In the Puppet `dsc` module we get a well-formed error and the invocation never runs on the machine.

```txt
Notice: Compiled catalog for win-tmihi4gdjn2.localdomain in environment production in 0.30 seconds
Error: Parameter dsc_destinationpath failed on Dsc_file[fruit_file]: Invalid value '1'. Should be a string at C:/code/old.pp:1
```

If we do the same with the new `dsc_lite` module:

```puppet
dsc {'fruit_file':
  resource_name => 'File',
  module => 'PSDesiredStateConfiguration',
  properties => {
    ensure          => 'present',
    destinationpath => 1,
  }
}
```

We get a less clear error message from the code _actually_ running (and erroring) on the machine.

```txt
Notice: Compiled catalog for win-tmihi4gdjn2.localdomain in environment production in 0.46 seconds
Error: /Stage[main]/Main/Dsc[fruit_file]: Could not evaluate: Convert property 'destinationpath' value from type 'SINT64' to type 'STRING' failed
 At line:9, char:2
 Buffer:
irectResourceAccess";
};^

insta

Notice: Applied catalog in 3.33 seconds
```

Because `dsc_lite` is unaware of the types and requirements of any given DSC Resource, the module can't provide validation without actually calling the code.

branch_name: refs/heads/main


text:
# Radiations

![](include/spat_06.jpg)

## (19) Distance
Distance from the source to the center reference point (listener position), in meters.

## (20) Azimuth
Angle between the source location and the listener-front reference axis, in degrees.

## (21) Yaw
Angle of the source direction orientation relative to the listener-source axis, in degrees.

## (22) Relative direction
When engaged, the source movement done with the mouse in the display are done in a way that the source
always keep the same source-listener orientation.
If not, the source direction is constant.

## (23) Elevation
Elevation angle, in degrees.

> Please note that when the source is not located onto the base horizontal plane, at listener ear level (z = 0), a small gauge is
displayed on the right edge of the preview, which gives the distance of the source to listener projected onto the Z axis, for easier
handling of elevation.

## (24) Pitch
Source direction orientation pitch angle, in degrees.
> Please pay attention to the fact that the graphic preview cannot not display pitch movements because of the 2D projection constraints.

## (25) Aperture
The aperture parameter relates to the "sound cone" projected by the virtual source in the acoustic space, and is measured in
degrees. It determines wether the source will be very directive (small aperture), or omnidirectional (large aperture) inside the
reverberant environment. You can use this parameter to simulate the how a source will interact with its acoustical environment.

Each source has a set of two three-band equalizers associated with it, as described below.


text:
Light Controller API
====================

Description
-----------
Android Client Library for [Light Controller Android App](https://github.com/eliotstocker/Light-Controller) allowing your application to control the lighting in a users home with ease and no need to write any socket connections etc.

Usage
-----
Light Controller is available on [BinTray](https://bintray.com/eliotstocker/maven/LightControllerAPI) in the JCenter Repo
The API can be added into your Gradle dependencies with the following line
```gradle
dependencies {
    compile 'Light-ControllerAPI:lightcontrollerapi:1.0.+'
}
```

API Usage is as follows:

* Add Light Controller Permission to your manifest
```xml
<uses-permission android:name="tv.piratemedia.lightcontroler.api"/>
```

* Initialize API
```java
LightControllerAPI api
try {
    api = new LightControllerAPI(this);
} catch(LightControllerException e) {
    if(e.getCode() == TYPE_APPLICATION_MISSING) {
        //Light Controller application is not installed
        //open store to download Light Controller
        LightControllerAPI.getApplicationFromPlayStore(this);
    } elseif(e.getCode() == TYPE_APPLICATION_OLD) {
        //Light Controller application too old
        //open store to download Latest Light Controller
        LightControllerAPI.getApplicationFromPlayStore(this);
    }
}
```

* Check if your application is allowed permission to control lights
```java
if(api.hasPermission()) {
            //application has permission
} else {
    //app doesnt have permission, set event for if any permissions change on the api
    api.setOnPermissionChanged(new OnPermissionChanged() {
        @Override
        public void onChange() {
            //still need to check if your app has permission as this is called on any app permission change
            if(api.hasPermission()) {
                perms.setVisibility(View.GONE);
            }
        }
    });
}
```
It is not explicityly required that an app must request permission as sending a command (such as light on) will result in a permission request being sent, however it is best use that in any app with a main activity that permissions are requested and checked on create or resume so as to avoid user confusion.
The Commandr usage for example does not explicitly request permission, thus on first use a permission requested be be sent.

* Select Zone the user wishes to control
there are multiple ways to do this

1: using the Zone List Picker
```java
api.pickZone();

//register Activity Result Listener withing your activity, required to get the return from the pick activity
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if(requestCode == LightControllerAPI.PickRequestCode) {
        if(resultCode == RESULT_OK) {
            //save zone for later use
            Zone = (LightZone)data.getSerializableExtra("LightZone");
            //show user selected zone
            selected.setText(Character.toUpperCase(Zone.Type.charAt(0)) + Zone.Type.substring(1) + ": " + Zone.Name);
        } else if(resultCode == RESULT_CANCELED) {
            //picker was closed without picking
        }
    }
}
```

2: using LightZone List API
```java
LightZone[] zoneList = api.listZones();

for(int i = 0; i < zoneList.length; i++) {
    LightZone zone = zoneList[i];
    Log.d("Zone", "Name: "+zone.Name+" Type: "+zone.Type);

    //do what ever you like with the zones here (add to listView perhapse)
}
```

* Now you have the zones you can start to control the zones with like the following
```java
//zone1 is a LightZone returned from either Zone List
api.lightsOn(zone1);
```

API Documentation
-----------------
Methods:

| Return Type    | Invocation                                       | Description    |
| :------------- | :----------------------------------------------- | :------------- |
| Void           | LightControllerAPI(Context context)              | Class constructor you must pass it your | applications context for it to call the intents from, Throws a LightControllerException if The application is not installed or The Application version is to old to support this version of the API Client |
| Void           | getApplicationFromPlayStore(Context context)     | (Static) Will bring the user to the play store where they can or update download light controller if needed. |
| Boolean        | isLightControllerInstalled()                     | Return (Boolean) weather Light Controller Application is installed, should not need to be used as is called from the class constructor. |
| LightZone[]    | listZones()                                      | Returns an array of all available Light Zones as LightZone Objects|
| LightZone      | getZone(int Zone, String Type)                   | Will return the Light Zone Object for the specified zone, accepted values for Type are LightControllerAPI.LIGHT_TYPE_COLOR and LightControllerAPI.LIGHT_TYPE_WHITE |
| Boolean        | hasPermission()                                  | Returns (boolean) weather your application has permission to use the Light Controller API |
| Void           | RequiestPermission()                             | Request Permission to use the Light Controller API, this will create in interactive prompt for the user to allow to deny your app, use setOnPermissionChanged to listen for changes to your Permission Status |
| Void           | setOnPermissionChanged(OnPermissionChanged oPC)  | Set a class that implements OnPermissionChanged where the onChange() Function is called when the application is granted/rescinded permission to access the Light Controller API |
| Void           | lightsOn(LightZone lz)                           | Turn lights on for LightZone returned from listZones() or getZone(), you should not construct a LightZone Object for this. |
| Void           | lightsOn(int Zone, String Type)                  | Turn on lights for the numbered zone of the type specified, accepted values for Type are LightControllerAPI.LIGHT_TYPE_COLOR and LightControllerAPI.LIGHT_TYPE_WHITE. |
| Void           | lightsOff(LightZone lz)                          | Turn lights off for a LightZone Object returned from listZones() or getZone(), you should not construct a LightZone Object for this. |
| Void           | lightsOff(int Zone, String Type)                 | Turn off lights for the numbered zone of the type specified, accepted values for Type are LightControllerAPI.LIGHT_TYPE_COLOR and LightControllerAPI.LIGHT_TYPE_WHITE. |
| Void           | setColor(LightZone lz, int Color)                | Set Lights to specified color (For Colored Light Only Dummy!) for LightZone Object returned from listZones() or getZone(), Color Should be a color integer return from the Color class. |
| Void           | setColor(int Zone, String Type, int Color)       | Set Lights to specified color (For Colored Light Only Dummy!) for the numbered zone of the type specified, Color Should be a color integer return from the Color class. |
| Void           | setDefault(LightZone lz)                         | Set Colored Zone Lights to White, and White Zone Lights to Full Brightness for a LightZone Object returned from listZones() or getZone(). |
| Void           | setDefault(int Zone, String Type)                | Set Colored Zone Lights to White, and White Zone Lights to Full Brightness for for the numbered zone of the type specified. |
| Void           | startFadeIn(LightZone lz, int duration)          | Starts the lights lowly getting brighter from the lowest setting over the duration (in seconds) specified for a LightZone Object returned from listZones() or getZone(), Vaules from 30 to 900 are allowed, throws a LightControllerException if the values are outside to the acceptable range. |
| Void           | startFadeIn(int Zone, String Type, int duration) | Starts the lights lowly getting brighter from the lowest setting over the duration (in seconds) specified for a the numbered zone of the type specified, Vaules from 30 to 900 are allowed, throws a LightControllerException if the values are outside to the acceptable range. |
| Void           | startFadeOut(LightZone lz, int duration)         | Starts the lights lowly getting brighter from the highest setting over the duration (in seconds) specified for a LightZone Object returned from listZones() or getZone(), Vaules from 30 to 900 are allowed, throws a LightControllerException if the values are outside to the acceptable range. |
| Void           | startFadeOut(int Zone, String Type, int duration)| Starts the lights lowly getting darker from the highest setting over the duration (in seconds) specified for a the numbered zone of the type specified, Vaules from 30 to 900 are allowed, throws a LightControllerException if the values are outside to the acceptable range. |
| Void           | cancelFade()                                     | Cancels and fade currently in transition on any zone |
| String         | getZoneName(int Zone, String Type)               | Returns the Name saved in Light Controller for the number zone of the specified type, accepted values for Type are LightControllerAPI.LIGHT_TYPE_COLOR and LightControllerAPI.LIGHT_TYPE_WHITE. |
| Void           | pickZone()                                       | Brings forward an interactive dialog withing which users may select a zone to control. The Light Zone Object can be caught from the activity response in the calling activity using onActivityResult, by getting the LightZone Extra as Follows: (LightZone)data.getSerializableExtra("LightZone") |

Properties:

| Type         | Name                   | Description    |
| :----------- | :--------------------- | :------------- |
| int          | PickRequestCode        | this is the request code of the pickZone() dialog so as you may catch this particular Activity response |
| String       | LightControllerPackage | the Light Controller Package Name should you require it. |
| String       | LIGHT_TYPE_COLOR       | Colored Lights LightZone type value, to be used with functions such as LightsOn etc. |
| String       | LIGHT_TYPE_WHITE       | White Lights LightZone type value, to be used with functions such as LightsOn etc. |

Exception:
Some Functions will throw a LightControllerException which you can catch and inspect the Code to know why the Exception was thrown, for example if the installed version of Light Controller is too old, when constructing the LightControllerAPI Class the Code will be Equal to LightControllerException.TYPE_APPLICATION_OLD the known Codes are as follows:
* TYPE_APPLICATION_MISSING: The Light Controller application is not installed, call the getApplicationFromPlayStore method to show the user the play store page.
* TYPE_APPLICATION_OLD: The Light Controller application is installed, but too old to be used with this version of the API client library, call the getApplicationFromPlayStore method to show the user the play store page.
* TYPE_ZONE_TYPE_INCORRECT: The Type String specified to a method such as lightsOn width not and accepted value
* TYPE_VALUE_OUT_OF_RANGE: The Value specified for a fade Method such as startFadeOut was outside of the accepted range

Example
-------
a simple example of the API can be found here: [API Example](https://github.com/eliotstocker/Light-ControllerAPI/tree/master/example)

License
-------
Light Controller API is free for use or modify as to allow any application to interface with Light Controller using the Apache 2.0 License

repository: Allsimon/Light-ControllerAPI

repo_name: Allsimon/Light-ControllerAPI


text:
# OneGuard Micro-Service Architecture Inter-Service Communication Protocol Specification

Specification of asynchronous Inter-Service Communication for OneGuard Micro-Service Architecture ecosystem.

## Architecture overview

Inter-service communication is facilitated via use of [AMQP](https://www.amqp.org/) broker.
Specifically we use [RabbitMQ](http://www.rabbitmq.com/).

Each service instance is identified with a service name and instance ID.
**Service name** should be lower case words with removed punctuation and spaces replaced by single dash (`-`).
**Instance ID** must be a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).

Each service instance subscribes to two queues - one specific to the instance
and one that is load-balanced between all instances of the service.

Service queue is bound to the exchange named **`service.{service_name}`**,
and instance queue is bound to the exchange named **`service.{service-name}.{instance-id}`**.

### Message format

Messages sent between service have standardized format. This is description of its properties:

- **`id`** `uuid` *mandatory* - message ID; recommend v4 UUID (randomly generated)
- **`type`** `string` *mandatory* - notification type - used to determine notification handler(s)
- **`principal`** `string` *optional* - security principal ID in whose authority the message is sent
- **`issuer`** `Issuer` *mandatory* - issuing service instance
  - **`service`** `string` *mandatory* - issuing instance service name
  - **`id`** `uuid` *mandatory* - issuing instance ID
- **`payload`** `object` *mandatory* - actual message content; structure depends on the specific message use case
- **`context`** `object` *optional* -
    client context, to be returned unmodified on any response; structure depends solely on the issuer
- **`responseTo`** `uuid` *optional* - original message ID, this message was created as a result of, if any
- **`occurredAt`** `date` *mandatory* -
    time of message occurrence in milliseconds since the epoch (1970-01-01 00:00:00.000 UTC)
- **`respondToInstance`** `boolean` *optional* -
    if `true`, any response is to be sent to the specific instance that issued this message,
    otherwise it is to be sent to the service; defaults to `false`

Context is used by message issuer upon receiving the response.
For example it can be used to store the request ID for response matching.

AMQP message must be encoded in supported content type and must specify **`content_type`** property.
Currently only [JSON](https://www.json.org/) (content type **`application/json`**) is supported.

### Message example

Properties:

```json
{"content_type": "application/json"}
```

Content:

```json
{
  "id": "42944b91-a8df-4e88-8a62-98284496a67d",
  "type": "example.message",
  "principal": "73c656a2-51cb-4388-a23a-625e5bea3a67",
  "issuer": {
    "name": "example-service",
    "id": "c035a5f5-1db5-4bae-bd01-d6966b402f70"
  },
  "payload": {
    "greeting": "Hullo!"
  },
  "context": {
    "sessionId": "862b2a20-f1de-4617-abbc-72f5c9f7314b"
  },
  "responseTo": null,
  "occurredAt":<PHONE_NUMBER>000,
  "respondToInstance": true
}
```

### Error handling

Following checks are executed on every message:

1) If **`content_type`** is not supported, the error is logged, and message is discarded.
1) If parsing fails for the specified content type, the error is logged, and message is discarded.
1) If mapping onto the model fails, the error is logged, an attempt to identify the issuer
   and report error to it is made, and message is discarded.
1) If an error occurs during message handling, it is reported to the issuer.

Error report messages have type `error.report` and their payload have following structure:

- **`message`** `string` *mandatory* - error message (description)
- **`errors`** `array` *mandatory* - array of Errors
  - **`Error`**
    - **`className`** `string` *mandatory*
    - **`message`** `string` *mandatory* - error message
    - **`stackTrace`** `array` *mandatory*
      - **`StackTraceElement`**
        - **`class`** `string` *optional* -
            the fully qualified name of the class containing the execution point represented
            by this stack trace element, or `null` if this information is unavailable
        - **`function`** `string` *mandatory* -
            the name of the function containing the execution point represented by the stack trace element
        - **`fileName`** `string` *optional* -
            the name of the file containing the execution point represented by the stack trace element,
            or `null` if this information is unavailable
        - **`lineNumber`** `int` *optional* -
            the line number of the source line containing the execution point represented by this stack trace element,
            or a negative number if this information is unavailable; defaults to `-1`

Error report message example:

```json
{
  "id": "message UUID",
  "type": "error.report",
  "principal": "user ID if applicable",
  "issuer": {
    "name": "reporting service name",
    "id": "reporting service instance ID"
  },
  "payload": {
    "message": "string error message",
    "errors": [
      {
        "type": "solutions.oneguard.msa.core.MessagingException",
        "message": "Could not convert the payload to 'String'",
        "stackTrace": [
          {
            "declaringClass": "org.example.ExampleHandler",
            "methodName": "handleMessage",
            "fileName": "ExampleHandler.java",
            "lineNumber": "13"
          }
        ],
        "cause": {
          "type": "java.lang.NullPointerException",
          "stackTrace": [
            {
              "declaringClass": "java.util.Objects",
              "methodName": "requireNonNull",
              "fileName": "Objects.java",
              "lineNumber": "221"
            },
            {
              "declaringClass": "org.example.ExampleHandler",
              "methodName": "convertPayload",
              "fileName": "ExampleHandler.java",
              "lineNumber": "23"
           }
          ]
        }
      }
    ]
  },
  "context": {"content": "replayed context"},
  "responseTo": "original message ID",
  "occurredAt":<PHONE_NUMBER>000
}
```

### Submiting message from CLI

To submit the message to RabbitMQ directly from CLI,
you need to have [`rabbitmqadmin`](https://www.rabbitmq.com/management-cli.html) installed.

The command below sends this minimal message to service `example-service`:

```json
{
  "id": "42944b91-a8df-4e88-8a62-98284496a67d",
  "type": "example.message",
  "issuer": {
    "name": "example-service",
    "id": "c035a5f5-1db5-4bae-bd01-d6966b402f70"
  },
  "payload": {},
  "occurredAt":<PHONE_NUMBER>000
}
```

```bash
rabbitmqadmin publish \
    exchange=service.example-service \
    routing_key=anything \
    payload='{"id":"42944b91-a8df-4e88-8a62-98284496a67d","type":"example.message","issuer":{"name":"example-service","id":"c035a5f5-1db5-4bae-bd01-d6966b402f70"},"payload":{},"occurredAt":1514764800000}' \
    properties='{"content_type":"application/json"}'
```

### See also

- [OneGuard Micro-Service Architecture Core Library for Java](https://github.com/OneGuardSolutions/msa-core) -
    library for easy implementation of micro-services in Java that implements this protocol
- [RabbitMQ Clients & Developer Tools](https://www.rabbitmq.com/devtools.html) -
    documentation for varius RabbitMQ client libraries


text:
# iotor-lm: An arduino library manager

> iotor-lm needs is forked from [Bower](https://github.com/bower/bower)

[![Build Status](https://travis-ci.org/taoyuan/iotor-lm.svg?branch=master)](https://travis-ci.org/taoyuan/iotor-lm)
[![Windows Build](https://ci.appveyor.com/api/projects/status/jr6vfra8w84plh2g/branch/master?svg=true)](https://ci.appveyor.com/project/sheerun/bower/history)
[![Coverage Status](https://img.shields.io/coveralls/taoyuan/iotor-lm.svg)](https://coveralls.io/r/taoyuan/iotor-lm?branch=master)
[![Issue Stats](http://issuestats.com/github/taoyuan/iotor-lm/badge/pr?style=flat)](http://issuestats.com/github/taoyuan/iotor-lm)
[![Issue Stats](http://issuestats.com/github/taoyuan/iotor-lm/badge/issue?style=flat)](http://issuestats.com/github/taoyuan/iotor-lm)

---

## Install

```sh
$ npm install -g iotor-lm
```

ANO LM depends on [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/). Also make sure that [git](http://git-scm.com/) is installed as some bower
libraries require it to be fetched and installed.

## Usage

See complete command line reference at [bower.io/docs/api/](http://bower.io/docs/api/)

### Installing libraries and dependencies

```sh
# install dependencies listed in library.json
$ iotlm install

# install a library and add it to library.json
$ iotlm install <library> --save

# install specific version of a library and add it to library.json
$ iotlm install <library>#<version> --save
```

### Uninstalling libraries

To uninstall a locally installed library:

```sh
$ iotlm uninstall <library-name>
```

### prezto and oh-my-zsh users

On `prezto` or `oh-my-zsh`, do not forget to `alias iotlm='noglob iotlm'` or `iotlm install jquery\#1.9.1`

### Never run Bower with sudo

Bower is a user command; there is no need to execute it with superuser permissions.

### Windows users

To use Bower on Windows, you must install
[Git for Windows](http://git-for-windows.github.io/) correctly. Be sure to check the
options shown below:

Note that if you use TortoiseGit and if Bower keeps asking for your SSH
password, you should add the following environment variable: `GIT_SSH -
C:\Program Files\TortoiseGit\bin\TortoisePlink.exe`. Adjust the `TortoisePlink`
path if needed.

### Ubuntu users

To use Bower on Ubuntu, you might need to link `nodejs` executable to `node`:

```
sudo ln -s /usr/bin/nodejs /usr/bin/node
```

## Configuration

ANO LM can be configured using JSON in a `.iotorrc` file. Read over available options at [bower.io/docs/config](http://bower.io/docs/config).

## License

Licensed under the MIT License

repository: iotorlabs/iotor-lm

repo_name: iotorlabs/iotor-lm


text:
# Rubber_Ducky

Background

Rubber duck debugging is an informal term used in software engineering for a method of debugging code. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug his code by forcing himself to explain it, line-by-line, to the duck.

What is this?

This website provides a RDD tool for the programmer.

How do I use this?
	Github:
		Clone files to your local repository
		Open index.html files in a web brower of your choice

	On the web:

How do I contribute?
	TBD


text:
# User Stories

Below is a list of User Stories that can guide a developer on an End Users work
flow when using the Keybase. It is broken down into stories around the following topics:

- User Management
- Identity Management
- Usage
- Export / Backup

# User Management

This section details what a User may want to do with their User profile, or
situations the system may encounter.

#### I want to Add a Profile

Create a profile with `username`, `label`, and a `password`.

This has an empty `addressBook` and `keyring`. The `securityModel` is
initialized from the system defaults.

#### I have Profile and want to Login.

Request login using supplied `username` and `password`.

This decrypts the associated profile.

#### I want to delete my Profile.

Request profile deletion using supplied `username` and `password`.

This removes the `UserProfile` from the store and logs the `User` out.

#### I am a User who is away from my computer for X time.

The profile should lock according to the timeout set in the `User`'s `securityModel`.

#### I want to logout of my `UserProfile`

Flush in memory changes to disk, after encrypting the `UserProfile`.

# Identity Management

The following entries discuss the routes a User will take to make identities.

#### I don't have a `SeedIdentity` and want to Add one

Create a new a `keyringEntry` with a generated `SeedIdentity`. This
`keyringEntry` is added to the `keyringEntries` array.

#### I want to Import a `SeedIdentity` from an `HD Seed`

Create a new `keyringEntry`. The `HD Seed` is inserted into the `SeedIdentity`
of the `keyringEntry`, and its `type` set to `seed`.

#### I want to add a Hardware `SeedIdentity` to the `Keyring`.

Create a `keyringEntry` and scrape hardware identifiers from the device to
populate the `SeedIdentity`.

#### I want to create an Universal Address Pair

Add two `publicIdentity`s, one for `ed25519` and one for `secp256k1`, to
`publicIdentities` using the `SeedIdentity`. These identities use only the
BIP32 standard.

#### I want to create an Extended Address

Add a `publicIdentity` to `publicIdentities` using the `SeedIdentity`. This
identity uses the full BIP44 and BIP32 standards.

# Usage

The following entries discuss the routes a User will take to use their profile.

####  I want to add a `contact` to my `AddressBook`

Add a `contact` to the `addressBook` in the `UserProfile`

#### I have a populated `KeyringEntry` and want to sign a something

Create a signature from `bytes`, a `SeedIdentity` and `PublicIdentity`
pair. Return a `signature`.

####  I have a populated `KeyringEntry` and want to get a balance

Return an `address` and a `chain` from a `PublicIdentity`. These will be used
query the associated chain.

# Export / Backup

Users will need a way to pull material out of the system. This is usually done
for backup purposes, but other reasons may include:

- Setting up a watch only wallet on a device
- Making an alternate installation on another machine
- Recreating a profile on the same device

#### I want to export my `UserProfile`

Return a JSON file with the contents of the `UserProfile`

#### I want to export the whole `Keyring`

Return a JSON file with the contents of the `Keyring`

#### I want to export a `SeedIdentity` from a `KeyringEntry`

Return the `seed` in plain text from the `SeedIdentity`.

#### I want to export a `PublicIdentity` from a `KeyringEntry`

Return the `PublicIdentity` as a JSON file.

repository: swiftma/iov-core

repo_name: swiftma/iov-core


text:
# Flexible Framework

Flexible Framework is an ever-growing collection of useful and customizable SASS (breakpoints, grids, spacing, etc). It is the standardization of repeated patterns in our application development work at Phillip Gore Design.

## Quick Start

To get started, download the zip or clone the repo. Documentation and details can be found at [Phillip Gore Design: Flexible Framework](https://www.phillipgoredesign.com/flexible-framework/flexible-framework "Phillip Gore Design"). That's the best place to start.

## Included Files
```
flexible_framework/sass
├── _background-color.scss
├── _breakpoint-variables.scss
├── _color-variables.scss
├── _color.scss
├── _custom.scss
├── _display.scss
├── _float.scss
├── _font-size.scss
├── _font-style.scss
├── _font-weight.scss
├── _grid.scss
├── _image-szing.scss
├── _line-height.scss
├── _margin.scss
├── _normalize.scss // Reset code from github.com/necolas/normalize.css. (You may wish to check for an updated version)
├── _padding.scss
├── _text-align.scss
├── _text-decoration-lines.scss
├── _text-transform.scss
├── _typography.scss
├── flexible-styles.scss

```

## Requirements

Flexible Framework is modular. Some files can be used on their own. Some of them must be used in conjuction with `_breakpoint-variables.scss`or `_color-variables.scss`.

SCSS files that require the code in `_breakpoint-variables.scss`.

- `_custom.scss`
- `_display.scss`
- `_float.scss`
- `_font-size.scss`
- `_grid.scss`
- `_image-sizing.scss`
- `_margin.scss`
- `_padding.scss`
- `_text-align.scss`

SCSS files that require the code in `_color-variables.scss`.

- `_background-colors.scss`
- `_color.scss`

## Current Features

Flexible Framework will continue to grow but currently includes the following features:

- Background Colors: Customizable
- Breakpoints: Customizable
- Color Variables: Customizable With Customizable Light & Dark Ranges
- Displays: Breakpoint Based
- Floats: Breakpoint Based
- Font Sizes: Breakpoint Based & Customizable
- Font & Text Utilities: Line Height, Text Overflow, Font Style, Font Transform, Font Weight
- Grid Layouts: Breakpoint Based & Customizable
- Image Sizing: Breakpoint Based & Customizable
- Margins: Breakpoint Based & Customizable
- Padding: Breakpoint Based & Customizable
- Text Alignment: Breakpoint Based
- Text Colors: Customizable

## License

All parts of Flexible Framework are free to use and abuse under the [open-source MIT license](https://github.com/phillipgore/flexible-framework/blob/master/LICENSE.md).

## Acknowledgement

Flexible Framework was created by [Phillip Gore Design](https://www.phillipgoredesign.com/).

repository: phillipgore/flexible-framework

repo_name: phillipgore/flexible-framework


text:
# 04 - Tags Cardio - Lists
------

Submit your solutions in the [SoftUni Judge System](https://judge.softuni.bg/Contests/1136/Introduction-to-HTML-and-CSS).
## Constraints
 * Change the document **title** to *Lists*
 * Add section with two articles inside (for each list)
 * Each article must have a **h2** heading
 * Use **ul** for unordered list
	* Add four list items
 * Use **ol reversed** for ordered reversed list
	* Add three **list** items

repository: alenSavov/Software-University-SoftUni

gha_language: HTML

gha_license_id: MIT

repo_name: alenSavov/Software-University-SoftUni


text:
# Assignment

The assignment is to complete 11 simple javascript exercises. Each exercise has the
implementation (in src file) and test (in spec  file ). You need to write the appropriate code in the src file to make the test work. The test will show you what are the expected functionalities that an exercise must implement. The text of the exercise is given as the comment in the implementation file.
To run the tests for an exercise, just open the runner.html file present in each exercise folder in a browser of your choice, and it will run the tests for you and tell you if they pass (all green) or fail (red).

## Tasks

All tasks should be compatible with the W3C standard.
Everything needs to work in all major modern browsers.
You do not need to make them backwards compatible with older IE browsers.

Helpful references:

* [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
* [DevDocs](http://devdocs.io/)
* [Can I Use](http://caniuse.com/)

repository: petarsJS/js-exercises-simple

repo_name: petarsJS/js-exercises-simple


text:
# FaSST
Fast, scalable, and simple transactions over RDMA. For historical reasons, FaSST
is called HoTS in this codebase. This is the source code for our
[USENIX OSDI paper](http://www.cs.cmu.edu/~akalia/doc/osdi16/fasst_osdi.pdf).

## Required hardware and software
 * InfiniBand HCAs
    * RoCE HCAs have not been tested, but should work with minor modifications.
      See `is_roce()` usage in [HERD](https://github.com/efficient/HERD) for
      details.
 * Ubuntu 12.04+
 * Mellanox OFED 2.4+
 * memcached, libmemcached-dev, libmemcached-tools
 * libnuma-dev (numactl-devel on CentOS)
 * Boost 1.6 (earlier and newer versions not tested)
   * Depends on python-dev and libbz2-dev
 * libpapi-dev
 * gcc-5.3 (C++11 support required; gcc-4.8 works but can have ~10% lower performance)

## Required settings
All benchmarks run in a symmetric setting with multiple machines (i.e., there
are no designated server or client machines. Every benchmark is contained in one
directory.
 * Benchmark parameters are contained in a json file in the experiment directory.
 * Modify `HRD_REGISTRY_IP` in `run-servers.sh` to the IP address of server 0's
   machine. This machine runs a memcached instance that is used as a queue pair
   registry.
 * Allocate hugepages on the NIC's socket at the server machine. On our machines,
   the NIC is attached to socket 0, so all benchmark scripts bind allocated
   memory and threads to socket 0. On Ubuntu systems, create 8192 hugepages on
   socket 0 using:
```
	sudo echo 8192 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
```

## Code structure

| Directory | Description |
| ------------- | ------------- |
| `libhrd` | An RDMA management and communication library. |
| `rpc` | FaSST RPCs. This should depend only on `libhrd` and `hots.h`. |
| `mica2` | A C++ implementation of a MICA hash table. |
| `datastore` | Interface of FaSST datastores, and RPC handlers for MICA.|
| `tx` | The transaction protocol. |
| `logger` | The commit record logger for transactions. |
| `mappings` | Helper functions to determine primary/backup/log machine numbers. |
| `app` | Benchmarks (TATP, SmallBank, RPC microbenchmark, packet loss test). |
| `drivers` | Modified `libmlx4` and `libmlx5` drivers with the cheap RECV posting optimization.|
| `loss\_study` | The code and output logs used in our InfiniBand packet loss study. |
| `other` | Contains a DCT benchmark. |

## Building the benchmarks
Each benchmark in the `app` directory contains a Makefile to build the benchmark.

## Instructions to run on Emulab's Apt cluster:
 * Set `HRD_REGISTRY_IP` to `node-1`'s IP address
 * Reduce `HRD_MAX_INLINE` to 60 bytes
 * Reduce `num_ports` to 1
 * Change the thread-to-core binding from `thread i -> core 2 * i` to
   `thread i -> core i`

## Acknowledgements
Hyeontaek Lim's MICA code is used directly and in a modified way.

## Contact
Anuj Kalia<EMAIL_ADDRESS>
## License
		Copyright 2016, Carnegie Mellon University

        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.


text:
Syntax
======

Lily's syntax is likely to seem familiar to those who come from Python, Ruby, or other interpreted languages. First, and most importantly, there are no semicolons. Instead, Lily infers where a statement should end based on matching parentheses and determining where values apply:

```
print(
    "Hello")

print("World")
```

Since 'print' is a value, the second 'print' command is inferred to be the beginning of a different expression, instead of applying to the previous expression.

# Comments

There are two kinds of comments in Lily:

```
# This comment covers a single line.

#[ This
   covers
   multiple
   lines ]#
```

Multi-line comments do **not** nest.

# Identifiers

Identifiers must start with _ or a letter. But after that, numbers are allowed. Spaces are not okay though. Capital letters and underscores have no special meaning. As a fun note, utf-8 can be used in identifiers.

```
_i_like_pie
camelCase
abc123
I□UNICODE
```

# Special words

Lily reserves the following words:

```
__file__ __function__ __line__ break case class continue define do elif
else enum except false for if import match private protected raise return
self true try var while
```

The first three keywords are extra interesting:

`__line__` will always evaluate to the line of the current file.

`__function__` will always evaluate to the name of the name of the current function.

`__file__` will always evaluate to the name of the current file.

extension: markdown


text:
# Convert Chrome cookies to Netscape format

This is a very simple Node.js script to convert the cookies you can copy/paste from Chrome's Application -> Storage -> Cookies, into the [Netscape cookies format](https://curl.haxx.se/docs/http-cookies.html) accepted by tools like `curl` and `youtube-dl`.

It's useful because you don't have to install any browser extension in order to save or convert the cookies.  Download [the script](https://raw.githubusercontent.com/dandv/convert-chrome-cookies-to-netscape-format/master/convert-cookies.js) (or clone this repo if you prefer)
2. In an editor, open a new blank file
2. In Chrome/Chromium, launch Developer Tools (F12)
3. Navigate to the site you need cookies from, e.g. YouTube, and log in.
4. Go to Application -> Storage -> Cookies
5. For each URL under Cookies (e.g. `https://www.youtube.com`), copy the table of cookies into the clipboard, then paste it at the end of the file you've opened in step 2. ![Chrome cookies](chrome-cookies.png)
6. Save the file with a name like `file-with-cookies-copy-pasted-from-Chrome.txt`
7. Run the script:

       node convert-cookies.js file-with-cookies-copy-pasted-from-Chrome.txt > netscape-cookies.txt

Now, `netscape-cookies.txt` will contain cookies ready to be used by any application that reads cookies in Netscape format (e.g. `yotube-dl` or `curl`).

## Author

Copyright © 2020 [Dan Dascalescu](https://dandascalescu.com).


text:
# Vue Atomic Design

Vue front-end boilerplate based on
[atomic design][atomic-design-url] methodology

## Main Features
- I18N Internationalization
- Page Templates
- Store modules
- Storybook
- Vee-validate
- Vue CLI 3.0
- Vuetify
- Vuex

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn run serve
```

### Compiles and minifies for production
```
yarn run build
```

### Run storybook
```
yarn storybook:serve
```

### Run your tests
```
yarn test
```

### Lints and fixes files
```
yarn lint
```

### Run your unit tests
```
yarn test:unit
```

[atomic-design-url]: http://bradfrost.com/blog/post/atomic-web-design/

repository: alexander-elgin/vue-atomic-design

branch_name: refs/heads/dev

gha_language: JavaScript

repo_name: alexander-elgin/vue-atomic-design


text:
# cleavage
A simple personal media organizer that sorts your downloads into subdirectories of your choice.

## Configuration
The config directory contains JSON configuration files. You'll need to create your own version of each file without the `.template` suffix in order for the script to work.

### paths.json
This file contains the path information for the organizer script.
`downloadDir` is the directory containing your media files.
`modelsDir` is the location of the model subdirectories. These subdirectories are the destinations of the media files.
`trashDir` is where non-media files will be relocated.
The script does not remove any files from the file system. The purpose of the trash directory is to provide a single location that you can manually inspect before permanently removing the files.

### models.json
This file contains a list of models and aliases that are used to determine which files to move and where to move them. For example, if the configuration contains a model with the name `jane doe`, the script will locate files containing `jane.doe` as part of the filename and move them to the subdirectory `jane doe` under the directory defined by `modelsDir`.

`aliases` allows you to map multiple names to the same target directory. For example, if `jane doe` has an alias `jane dough`, then files containing `jane.dough` will be moved to the `jane doe` subdirectory.

## Running the organizer
```
python organize.py
```
The script will output which files it intends to move as well as the destination directory. It will ask for confirmation before performing the move operation. The same applies for the cleanup step. The actions are printed to the screen and confirmation is obtained before any files are moved.

repository: neuroticpeon/cleavage

gha_language: Python

repo_name: neuroticpeon/cleavage


text:
---
title: Component
type: core
layout: docs
parent_section: core
order: 3
source_code: src/core/component.js
examples: []
---

[ecs]: ../introduction/entity-component-system.md
[entity]: ./entity.md
[multiple]: #multiple
[three]: http://threejs.org/
[setAttribute]: ../introduction/javascript-events-dom-apis.md#updating-a-component-with-setattribute
[flushToDom]: #flushtodom

In the [entity-component-system pattern][ecs], a component is a reusable and
modular chunk of data that we plug into an entity to add appearance, behavior,
and/or functionality.

In A-Frame, components modify entities which are 3D objects in the scene. We
mix and compose components together to build complex objects. They let us
encapsulate [three.js][three] and JavaScript code into modules that we can use
declaratively from HTML.

As an abstract analogy, if we define a smartphone as an entity, we might use
components to give it appearance (color, shape), to define its behavior
(vibrate when called, shut down on low battery), or to add functionality
(camera, screen).

Components are roughly analogous to CSS. Like how CSS rules modify the
appearance of elements, component properties modify the appearance, behavior,
and functionality of entities.

## Component HTML Form

A component holds a bucket of data in the form of one or more component
properties. Components use this data to modify entities. Consider an *engine*
component, we might define properties such as *horsepower* or *cylinders*.

HTML attributes represent component names and the value of those attributes
represent component data.

### Single-Property Component

If a component is a *single-property* component, meaning its data consists of a
single value, then in HTML, the component value looks like a normal HTML
attribute:

```html
<!-- `position` is the name of the position component. -->
<!-- `1 2 3` is the data of the position component. -->
<a-entity position="1 2 3"></a-entity>
```

### Multi-Property Component

If a component is a *multi-property* component, meaning the data consists of
multiple properties and values, then in HTML, the component value resembles
inline CSS styles:

```html
<!-- `light` is the name of the light component. -->
<!-- The `type` property of the light is set to `point`. -->
<!-- The `color` property of the light is set to `crimson`. -->
<a-entity light="type: point; color: crimson"></a-entity>
```

## Register a Component

### `AFRAME.registerComponent (name, definition)`

Register an A-Frame component. We must register components *before* we use them
anywhere in `<a-scene>`. Meaning from an HTML file, components should come in
order before `<a-scene>`.

- `{string} name` - Component name. The component's public API as represented through an HTML attribute name.
- `{Object} definition` - Component definition. Contains schema and lifecycle handler methods.

```js
// Registering component in foo-component.js
AFRAME.registerComponent('foo', {
  schema: {},
  init: function () {},
  update: function () {},
  tick: function () {},
  remove: function () {},
  pause: function () {},
  play: function () {}
});
```

```html
<!-- Usage of `foo` component. -->
<html>
  <head>
    <script src="aframe.min.js"></script>
    <script src="foo-component.js"></script>
  </head>
  <body>
    <a-scene>
      <a-entity foo></a-entity>
    </a-scene>
  </body>
</html>
```

## Schema

The schema is an object that defines and describes the property or properties
of the component. The schema's keys are the names of the property, and the
schema's values define the types and values of the property (in case of a
multi-property component):

```js
AFRAME.registerComponent('bar', {
  schema: {
    color: {default: '#FFF'},
    size: {type: 'int', default: 5}
  }
}
```

```html
<a-scene>
  <a-entity bar="color: red; size: 20"></a-entity>
</a-scene>
```

[propsimage]: https://cloud.githubusercontent.com/assets/674727/20326452/b7f94966-ab3d-11e6-95e1-47cabf425278.jpg
![propsimage]
Image by Ruben Mueller from vrjump.de

### Property Types

Property types primarily define how the schema parses incoming data from the
DOM for each property. The parsed data will then be available via the `data`
property on the component's prototype. Below are A-Frame's built-in property
types:

| Property Type   | Description                                                                                | Default Value            |
| --------------- | -------------                                                                                | -------------            |
| array           | Parses comma-separated values to array (i.e., `"1, 2, 3" to ['1', '2', '3'])`.                                                                                | []                       |
| asset           | For URLs pointing to general assets. Can parse URL out of a string in the form of `url(<url>)`. If the value is an element ID selector (e.g., `#texture`), this property type will call `getElementById` and `getAttribute('src')` to return a URL. The `asset` property type may or may not change to handle XHRs or return MediaElements directly (e.g., `<img>` elements). | ''                       |
| audio           | Same parsing as the `asset` property type. Will possibly be used by the A-Frame Inspector to present audio assets.                                                                                | ''                       |
| boolean         | Parses string to boolean (i.e., `"false"` to false, everything else truthy).                                                                                | false                    |
| color           | Currently doesn't do any parsing. Primarily used by the A-Frame Inspector to present a color picker. Also, it is required to use color type for color animations to work.                                                                                | #FFF                     |
| int             | Calls `parseInt` (e.g., `"124.5"` to `124`).                                                                                | 0                        |
| map             | Same parsing as the `asset` property type. Will possibly be used by the A-Frame Inspector to present texture assets.                                                                                | ''                       |
| model           | Same parsing as the `asset` property type. Will possibly be used by the A-Frame Inspector to present model assets.                                                                                | ''                       |
| number          | Calls `parseFloat` (e.g., `"124.5"` to `124.5`).                                                                                | 0                        |
| selector        | Calls `querySelector` (e.g., `"#box"` to `<a-entity id="box">`).                                                                                | null                     |
| selectorAll     | Calls `querySelectorAll` and converts `NodeList` to `Array` (e.g., `".boxes"` to [<a-entity class="boxes", ...]),                                                                                | null                     |
| string          | Doesn't do any parsing.                                                                                | ''                       |
| vec2            | Parses two numbers into an `{x, y}` object (e.g., `1 -2` to `{x: 1, y: -2}`.                                                                                | {x: 0, y: 0}             |
| vec3            | Parses three numbers into an `{x, y, z}` object (e.g., `1 -2 3` to `{x: 1, y: -2, z: 3}`.                                                                                | {x: 0, y: 0, z: 0}       |
| vec4            | Parses four numbers into an `{x, y, z, w}` object (e.g., `1 -2 3 -4.5` to `{x: 1, y: -2, z: 3, w: -4.5}`.                                                                                | {x: 0, y: 0, z: 0, w: 0} |

#### Property Type Inference

The schema will try to infer a property type given only a default value:

```js
schema: {default: 10}  // type: "number"
schema: {default: "foo"}  // type: "string"
schema: {default: [1, 2, 3]}  // type: "array"
```

The schema will set a default value if not provided, given the property type:

```
schema: {type: 'number'}  // default: 0
schema: {type: 'string'}  // default: ''
schema: {type: 'vec3'}  // default: {x: 0, y: 0, z: 0}
```

#### Custom Property Type

We can also define our own property type by providing a `parse` and `stringify`
function in place of a `type`:

```js
schema: {
  // Parse slash-delimited string to an array (e.g., `foo="myProperty: a/b"` to `['a', 'b']`),
  // stringify array to string (e.g., `['a', 'b']` to `foo="myProperty: a/b"`)
  myProperty: {
    default: [],
    parse: function (value) {
      return value.split('/');
    },
    stringify: function (value) {
      return value.join('/');
    }
  }
}
```

`parse` is called when component properties are updated by `setAttribute` method.
`stringify` is called when DOM is updated by [flushToDom][flushToDom] method.

### Single-Property Schema

A component can either be a single-property component (consisting of one
anonymous value) or a multi-property component (consisting of multiple named
values). A-Frame will infer whether a component is single-property vs.
multi-property based on the structure of the schema.

A single-property component's schema contains `type` and/or `default` keys, and
the schema's values are plain values rather than objects:

```js
AFRAME.registerComponent('foo', {
  schema: {type: 'int', default: 5}
});
```

```html
<a-scene>
  <a-entity foo="20"></a-entity>
</a-scene>
```

## Definition Lifecycle Handler Methods

With the schema being the anatomy, the lifecycle methods are the physiology;
the schema defines the shape of the data, the lifecycle handler methods *use*
the data to modify the entity. The handlers will usually interact with the
[Entity API][entity].

[methodsimage]: https://cloud.githubusercontent.com/assets/674727/21803913/2966ba7e-d6e1-11e6-9179-8acafc87540c.jpg
![methodsimage]
Lifecycle method handlers. Image by Ruben Mueller from vrjump.de

### Overview of Methods

| Method       | Description                                                                                |
|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| init         | Called once when the component is initialized. Used to set up initial state and instantiate variables.                                                                                |
| update       | Called both when the component is initialized and whenever any of the component's properties is updated (e.g, via *setAttribute*). Used to modify the entity.                                                             |
| remove       | Called when the component is removed from the entity (e.g., via *removeAttribute*) or when the entity is detached from the scene. Used to undo all previous modifications to the entity.                                  |
| tick         | Called on each render loop or tick of the scene. Used for continuous changes or checks.                                                                                |
| tock         | Called on each render loop or tick of the scene after the scene has rendererd. Used for post processing effects or other logic that needs to happen after the scene has been drawn.                                                                                |
| play         | Called whenever the scene or entity plays to add any background or dynamic behavior. Also called once when the component is initialized. Used to start or resume behavior.                                                |
| pause        | Called whenever the scene or entity pauses to remove any background or dynamic behavior. Also called when the component is removed from the entity or when the entity is detached from the scene. Used to pause behavior. |
| updateSchema | Called whenever any of the component's properties is updated. Can be used to dynamically modify the schema.                                                                                |

### Component Prototype Properties

[scene]: ./scene.md

Within the methods, we have access to the component prototype via `this`:

| Property        | Description                                                                                |
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| this.data       | Parsed component properties computed from the schema default values, mixins, and the entity's attributes.
__Important:__ Do not modify the data attribute directly. It is updated internally by A-Frame. To modify a component, use [setAttribute][setAttribute].|
| this.el         | Reference to the [entity][entity] as an HTML element.                                                                                |
| this.el.sceneEl | Reference to the [scene][scene] as an HTML element.                                                                                |
| this.id         | If the component can have [multiple instances][multiple], the ID of the individual instance of the component (e.g., `foo` from `sound__foo`).                                                                                |

### `.init ()`

`.init ()` is called once at the beginning of the component's lifecycle.
An entity can call the component's `init` handler:

- When the component is statically set on the entity in the HTML file and the page is loaded.
- When the component is set on an attached entity via `setAttribute`.
- When the component is set on an unattached entity, and the entity is
  then attached to the scene via `appendChild`.

The `init` handler is often used to:

- Set up initial state and variables
- Bind methods
- Attach event listeners

For example, a cursor component's `init` would set state variables, bind
methods, and add event listeners:

```js
AFRAME.registerComponent('cursor', {
  // ...
  init: function () {
    // Set up initial state and variables.
    this.intersection = null;
    // Bind methods.
    this.onIntersection = AFRAME.utils.bind(this.onIntersection, this);
    // Attach event listener.
    this.el.addEventListener('raycaster-intersection', this.onIntersection);
  }
  // ...
```

### `.update (oldData)`

`.update (oldData)` is called whenever the component's properties change,
including at the beginning of the component's lifecycle. An entity can call a
component's `update` handler:

- After `init ()` is called, at the beginning of component's lifecycle.
- When the component's properties are updated with `.setAttribute`.

The `update` handler is often used to:

- Do most of the work in making modifications to the entity, using `this.data`.
- Modify the entity whenever one or more component properties change.

[diff]: ./utils.md#aframe-utils-diff-a-b

Granular modifications to the entity can be done by [diffing][diff] the current
dataset (`this.data`) with the previous dataset before the update (`oldData`).

A-Frame calls `.update()` both at the beginning of a component's lifecycle and every
time a component's data changes (e.g., as a result of `setAttribute`). The
update handler often uses `this.data` to modify the entity. The update handler
has access to the previous state of a component's data via its first argument.
We can use the previous data of a component to tell exactly which
properties changed to do granular updates.

[visible]: ../components/visible.md

For example, the [visible][visible] component's `update` sets the visibility of
the entity.

```js
AFRAME.registerComponent('visible', {
  /**
   * this.el is the entity element.
   * this.el.object3D is the three.js object of the entity.
   * this.data is the component's property or properties.
   */
  update: function (oldData) {
    this.el.object3D.visible = this.data;
  }
  // ...
});
```

### `.remove ()`

`.remove ()` is called whenever the component is detached from the entity. An
entity can call a component's `remove` handler:

- When the component is removed from the entity via `removeAttribute`.
- When the entity is detached from the scene (e.g., `removeChild`).

The `remove` handler is often used to:

- Remove, undo, or clean up all of the component's modifications to the entity.
- Detach event listeners.

[light]: ../components/light.md

For example, when the [light component][light] is removed, the light component
will remove the light object that it had previously set on the entity, thus
removing it from the scene.

```js
AFRAME.registerComponent('light', {
  // ...
  remove: function () {
    this.el.removeObject3D('light');
  }
  // ...
});
```

### `.tick (time, timeDelta)`

`.tick ()` is called on each tick or frame of the scene's render loop. The scene
will call a component's `tick` handler:

- On each frame of the render loop.
- On the order of 60 to 120 times per second.
- If the entity or scene is not paused (e.g., the Inspector is open).
- If the entity is still attached to the scene.

The `tick` handler is often used to:

- Continuously modify the entity on each frame or on an interval.
- Poll for conditions.

The `tick` handler is provided the global uptime of the scene in milliseconds
(`time`) and the time difference in milliseconds since the last frame
(`timeDelta`). These can be used for interpolation or to only run parts of the
`tick` handler on a set interval.

[trackedcontrols]: ../components/tracked-controls.md

For example, the [tracked controls component][trackedcontrols] will progress
the controller's animations, update the controller's position and rotation, and
check for button presses.

```js
AFRAME.registerComponent('tracked-controls', {
  // ...
  tick: function (time, timeDelta) {
    this.updateMeshAnimation();
    this.updatePose();
    this.updateButtons();
  }
  // ...
});
```

### `.tock (time, timeDelta, camera)`

Identical to the tick method but invoked after the scene has rendered.

The `tock` handler is used to run logic that needs access to the drawn scene before it's pushed into the headset like postprocessing effects.

### `.pause ()`

`.pause ()` is called when the entity or scene pauses. The entity can call a
component's `pause` handler:

- Before the component is removed, before the `remove` handler is called.
- When the entity is paused with `Entity.pause ()`.
- When the scene is paused with `Scene.pause ()` (e.g., the Inspector is opened).

The `pause` handler is often used to:

- Remove event listeners.
- Remove any chances of dynamic behavior.

[sound]: ../components/sound.md

For example, the [sound component][sound] will pause the sound and remove an
event listener that would have played a sound on an event:

```js
AFRAME.registerComponent('sound', {
  // ...
  pause: function () {
    this.pauseSound();
    this.removeEventListener();
  }
  // ...
});
```

### `.play ()`

`.play ()` is called when the entity or scene resumes. The entity can call
a component's `play` handler:

- When the component is first attached, after the `update` handler is called.
- When the entity was paused but then resumed with `Entity.play ()`.
- When the scene was paused but then resumed with `Scene.play ()`.

The `play` handler is often use to:

- Add event listeners.

For example, the [sound component][sound] will play the sound and update the
event listener that would play a sound on an event:

```js
AFRAME.registerComponent('sound', {
  // ...
  play: function () {
    if (this.data.autoplay) { this.playSound(); }
    this.updateEventListener();
  }
  // ...
});
```

### `.updateSchema (data)`

`.updateSchema ()`, if defined, is called on every update in order to check if
the schema needs to be dynamically modified.

The `updateSchema` handler is often used to:

- Dynamically update or extend the schema, usually depending on the value of a property.

[geometry]: ../components/geometry.md

For example, the [geometry component][geometry] checks if the `primitive`
property changed to determine whether to update the schema for a different
type of geometry:

```js
AFRAME.registerComponent('geometry', {
  // ...
  updateSchema: (newData) {
    if (newData.primitive !== this.data.primitive) {
      this.extendSchema(GEOMETRIES[newData.primitive].schema);
    }
  }
  // ...
});
```

## Definition Properties

### `dependencies`

`dependencies` allows for control on ordering of component initialization if a
component depends on one or more other components. Component names specified in
the `dependencies` array will be initialized left-to-right before initializing
the current component. If the dependency have other dependency components,
those other dependency components will be ordered in the same manner:

```js
// Initializes last.
AFRAME.registerComponent('a', {
  dependencies: ['b']
});

// Initializes second.
AFRAME.registerComponent('b', {
  dependencies: ['c']
});

// Initializes first.
AFRAME.registerComponent('c', {});
```

### `multiple`

[sound]: ../components/sound.md

The `multiple` flag allows for a component to have multiple instances of itself
on an entity. Since `multiple` is set to `false` by default, an entity could
only have a single instance of a component. For example, an entity could only
have one geometry component.

But if a component has `multiple` set to `true`, then the component can have
multiple instances:

```js
AFRAME.registerComponent('foo', {
  multiple: true,
  // ...
});
```

In the DOM, we can differentiate between instances of the component by giving a
suffix of a double underscore and ID (`__<ID>`). For example, to attach
multiple instances of the sound component:

```html
<a-scene>
  <a-entity
    sound="src: url(sound.mp3)"
    sound__beep="src: url(beep.mp3)"
    sound__boop="src: url(boop.mp3)"
  ></a-entity>
</a-scene>
```

From the component lifecycle handler methods, we can differentiate between
instances of the component with `this.id`. If a component instance is set with
`foo__bar`, then `this.id` would be `"bar"`:

```js
AFRAME.registerComponent('foo', {
  multiple: true,

  update: function () {
    console.log('This component instance has the ID', this.id);
  }
});
```

If we're doing a `setObject3D()`, we'll usually want to use `this.attrName`. If
a component instance is set with `foo__bar`, then `this.attrName` would be
`foo__bar`. This gives us a namespace and an ID to set an `object3D` on the
entity's `object3DMap`:

```js
AFRAME.registerComponent('foo', {
  multiple: true,

  update: function () {
    // An object3D will be set using `foo__bar` as the key.
    this.el.setObject3D(this.attrName, new THREE.Mesh());
  }
});
```

### `events`

The `events` object allows for conveniently defining event handlers that get
binded and automatically attached and detached at appropriate times during the
component's lifecycle:

- Attached on `.play()`
- Detached on `.pause()` and `.remove()`

Using `events` ensures that event handlers properly clean themselves up when
the entity or scene is paused, or the component is detached. If a component's
event handlers are registered manually and not detached properly, the event
handler can still fire even after the component no longer exists.

```js
AFRAME.registerComponent('foo', {
  events: {
    click: function (evt) {
      console.log('This entity was clicked!');
      this.el.setAttribute('material', 'color', 'red');
    }
  }
});
```

## Component Prototype Methods

### `.flushToDOM ()`

[componentserialization]: ../components/debug.md#component-to-dom-serialization

To save on CPU time on stringification, A-Frame will only update in debug mode
the component's serialized representation in the actual DOM. Calling
`flushToDOM ()` will manually serialize the component's data and update the
DOM:

```js
document.querySelector('[geometry]').components.geometry.flushToDOM();
```

Read more about [component-to-DOM serialization][componentserialization].

## Accessing a Component's Members and Methods

A component's members and methods can be accessed through the entity from the
`.components` object. Look up the component from the entity's map of
components, and we'll have access to the component's internals. Consider this
example component:

```js
AFRAME.registerComponent('foo', {
  init: function () {
    this.bar = 'baz';
  },

  qux: function () {
    // ...
  }
});
```

Let's access the `bar` member and `qux` method:

```js
var fooComponent = document.querySelector('[foo]').components.foo;
console.log(fooComponent.bar);
fooComponent.qux();
```

repository: aframevr/aframe

repo_name: aframevr/aframe


text:
---
layout: engineering-education
status: publish
published: true
url: /sql-injection-made-familiar/
title: SQL Injection Made Familiar
description: This article will take the reader through SQL infusions and will have an unmistakable illustration of how it is carried out and how to forestall SQL infusions.
author: bernard-mburu
date: 2021-10-08T00:00:00-05:30
topics: [Languages]
excerpt_separator: <!--more-->
images:

  - url: /engineering-education/sql-injection-made-familiar/hero.jpg
    alt: SQL Injection Made Familiar Hero Image
---
Information is the most crucial part of a data system. Information-base controlled web applications are utilized by most associations to get information from clients. Thus, drawing in information security.
<!--more-->
SQL injection is an assault that harms dynamic SQL articulations to remark out specific pieces of the assertion or affixing a condition that will consistently be valid.

It exploits the plan imperfections in inadequately planned web applications.

This is done to take advantage of SQL proclamations to execute vindictive SQL code.

This article will take the reader through SQL infusions. It will also have an unmistakable illustration of how it is carried out, and how to forestall SQL infusions.

### Table of contents
- [Introduction](#introduction)
- [Understanding SQL infusion](#understanding-sql-infusion)
- [Activity: Infuse a webPage](#activity-infuse-a-webpage)
- [Other SQL infusion assault types](#other-sql-infusion-assault-types)
- [Automation devices for SQL infusion](#automation-devices-for-sql-infusion)
- [Forestall SQL infusion assaults](#forestall-sql-infusion-assaults)
- [Conclusion](#conclusion)

### Understanding SQL infusion
The sorts of assaults that can be performed utilizing SQL infusion differ contingent upon the kind of data set motor. The assault chips away at dynamic SQL articulations.

A powerful assertion is an explanation that is created at run time utilizing boundaries secret phrases from a web structure or URI query string.

Let us take a look at a simple login form with some basic styling:
- [Get the form](https://github.com/fabulousDesigns/sql-injection-login-page)
- create 2 files:
  - `index.html`
  - `style.css`

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="style.css" />
    <title>Demo</title>
  </head>
  <body>
    <div class="wrapper">
      <form action="loginAuth.php" method="post">
        <h4 class="logo-text">LOGIN</h4>
        <div class="line"></div>
        <input
          type="text"
          name="uName"
          class="input-group"
          placeholder="Enter your Username"
        /><input
          type="text"
          name="pass"
          class="input-group"
          placeholder="Enter your Password"
        />
        <pre> <input type="checkbox" name="chkbox"> Remember me</pre>
        <button type="submit" name="submit" class="btn">LOGIN</button>
      </form>
    </div>
  </body>
</html>
```

![Form](/engineering-education/sql-injection-made-familiar/form.jpg)

The structure above acknowledges the username and password, then submits them to a PHP record named `loginAuth.php`.

It has an alternative of putting away the login session in a cookie.

We have derived this from the `remember-me` checkbox. It utilizes the post strategy to submit information.

This implies that the user credentials are not shown in the URL.

Suppose user authentication is done using the following statement:

```sql
SELECT * FROM members WHERE username = $_POST['uName'] AND password = md5($_POST['pass']);
```

The assertion above utilizes the upsides of the `$_POST[]` cluster without cleaning them. The password is encoded using the `MD5` calculation.

We will represent SQL infusion assault using `sqlfiddle`.

Open the [SQL Fiddle](http://sqlfiddle.com/) in your internet browser.

You will get the accompanying window.

The first thing you want to do in `sqlfiddle` is to create a schema.

so, on the left pane paste the SQL code below:

```sql
CREATE TABLE `members` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `userName` VARCHAR(45) NULL,
  `password` VARCHAR(45) NULL,
  PRIMARY KEY (`id`));

insert into members (username,password) values ('johnD',md5('doe'));
```

Click the `build schema` button:

![schema](/engineering-education/sql-injection-made-familiar/schema.png)

On the right pane enter:

```sql
SELECT * FROM members;
```

Run the code:

![sql-code](/engineering-education/sql-injection-made-familiar/sqlcode.png)

Your output will be:

![result](/engineering-education/sql-injection-made-familiar/result.png)

Let us say the user supplies `logan` as the username and `5678` as the password.

The SQL code to execute would probably be:

```sql
SELECT * FROM members WHERE username = 'logan` AND password = md5('5678');
```

The code above can be taken advantage of by remarking out the secret key (password) part and affixing a condition that will consistently be valid.

Let's say an assailant gives the following in the input fields:
1. `username = xyz.mnp' OR 1 = 1 LIMIT 1 — ']`
2. `password = fff`

The statement to execute would be as follows:

```sql
SELECT * FROM members WHERE username = 'xyz.mnp' OR 1 = 1 LIMIT 1 -- ‘ ] AND password = md5(‘5678’);
```

`Xyz.mnp` closes with a solitary statement that finishes the string quote.

Or so `1 = 1 LIMIT 1` is a condition that will consistently be valid and limits the returned results to just one record.

`-- 'AND …` is a SQL remark that takes out the secret key part.

Run the code above in SQL FiddleRun SQL Text box as shown below:

![image](/engineering-education/sql-injection-made-familiar/sql2.png)

The result is as shown below:

![result2](/engineering-education/sql-injection-made-familiar/result2.png)

### Activity: Infuse a webpage
I have created a log-in form that we will use to employ SQL injection exploits. you can get it [here](https://github.com/fabulousDesigns/sql-injection-login-page).

The form has some fundamental security, for example, sanitizing the username field.

This implies that our code above can't be utilized to sidestep the login.

To get around that, we can take advantage of the secret word field.

The outline below shows the steps that you should follow.

#### Step 1
Clone the source code in your local computer and run it with the `xammp` server.

#### Step 2
Enter login info:
- username = 'xyzxyz'
- password = 'xyz') OR 1=1 -- ]

As shown below:

![hack-activity](/engineering-education/sql-injection-made-familiar/app1.png)

Click on submit.

#### Step 3
Access Granted -> redirected to Dashboard

If a user provides the following:
- username = `xyzxyz`
- password = `xyz') OR 1 = 1 -- ]`

The user will be redirected to the dashboard upon clicking the submit button.

Let's take a closer look at the generated statements:

```sql
SELECT * FROM members WHERE username = ‘xyzxyzx’ AND password = md5(‘xyz’) OR 1 = 1 — ]’);
```

![generated-statements](/engineering-education/sql-injection-made-familiar/stmt.png)

### Other SQL infusion assault types
SQL injections can do more damage than just bypassing the login calculations.

A part of the assaults incorporate:
- Erasing information.
- Updating information.
- Embedding information.
- Executing orders on the worker that can download and introduce malignant projects like Trojans.
- Sending out significant information. For example, Mastercard subtleties, email, and passwords to the assailant's far-off worker.
- Getting client login subtleties and so on.

The list above isn't thorough; it simply gives you a thought of what SQL Injection is capable of.

### Automation devices for SQL infusion
In the model above, we utilized manual assault methods dependent on our huge information on SQL.

There are mechanized apparatuses that can assist you with playing out the assaults all the more proficiently. And, inside the briefest conceivable time.

These apparatuses incorporate:
- **[Sonarqube](https://www.sonarqube.org/)**
- **[sqlsus](http://sqlsus.sourceforge.net/)**

### Forestall SQL infusion assaults
An association can take on the accompanying strategy to ensure itself against SQL Injection assaults:
1. Client info ought to never be trusted – It should consistently be disinfected before it is utilized in unique SQL explanations.
2. Use the put away method – these can exemplify the SQL explanations and treat all contributions as boundaries.
3. Arranged explanations – arranged proclamations work by making the SQL articulation first, then at the point of all submitted client information as boundaries. This has no impact on the linguistic structure of the SQL articulation.
4. Customary articulations – these can be utilized to distinguish possible hurtful code, and end it before executing the SQL explanations.
5. Information base association client access rights – only vital access rights ought to be given to accounts used to interface with the data set. This can assist with lessening what the SQL explanations can perform on the worker.
6. Blunder messages – these ought not to uncover touchy data and the precise area a mistake happened. Straight-forward custom blunder messages, for example, "Heartbroken, we are encountering specialized mistakes. The specialized group has been reached. Kindly attempt again later" can be utilized rather than show the SQL explanations that caused the mistake.

### Conclusion
SQL injection is a sort of assault that benefits from terrible SQL articulations.

SQL infusion can be utilized to sidestep login calculations, recover, addition, and refresh and erase information.

SQL infusion instruments incorporate `SqlSus`, `SQLPing`, and `Sonarqube`, and so on

A decent security strategy when composing SQL proclamation can assist with decreasing SQL infusion assaults.

Happy coding!

---
Peer Review Contributions by: [Dawe Daniel](/engineering-education/authors/dawe-daniel/)

repository: mbuguac/engineering-education

gha_language: SCSS

repo_name: mbuguac/engineering-education


text:
# Sourcegraph search results CSV export extension

[![master build status](https://img.shields.io/github/workflow/status/sourcegraph/sourcegraph-search-export/build/master?logo=github)](https://github.com/sourcegraph/sourcegraph-search-export/actions?query=branch%3Amaster)
[![codecov](https://codecov.io/gh/sourcegraph/sourcegraph-search-export/branch/master/graph/badge.svg)](https://codecov.io/gh/sourcegraph/sourcegraph-search-export)

## ⚠ Deprecation notice

**Sourcegraph extensions have been deprecated with the September 2022 Sourcegraph
release. [Learn more](https://docs.sourcegraph.com/extensions/deprecation).**

Starting with the September 2022 release of Sourcegraph, search export is a core part of the product.

The repo and the docs below are kept to support older Sourcegraph versions.

## Description

A [Sourcegraph extension](https://docs.sourcegraph.com/extensions) to export a list of search results to CSV.

[**🗃 Source code**](https://github.com/sourcegraph/sourcegraph-search-export)

[**➕ Add to Sourcegraph**](https://sourcegraph.com/extensions/sourcegraph/search-export) (for self-hosted instances: visit the **Extensions** page)

## Features

-   Adds a **Sourcegraph: Export search results** button on top of the Sourcegraph search results pages
![image](https://user-images.githubusercontent.com/68532117/138749863-2d5bb850-5707-4d3f-9090-ef73236d7053.png)
## Usage

1. Enable the extension at https://sourcegraph.com/extensions/sourcegraph/search-export or on the **Extensions** page of your self-hosted instance.
1. Perform a search query on Sourcegraph.
1. Press the **Sourcegraph: Export search results** button above the list of search results. (Note: This may take a while for large result sets. The extension is not optimized for streaming or paginating results.)
1. Click `Download CSV` from the pop-up window to download the CSV file.
![image](https://user-images.githubusercontent.com/68532117/138749809-9c074bd8-d9f2-4998-a84e-f6a3b0cfd4aa.png)

## Configuration

The extension can be configured through JSON in user, organization or global settings.

```jsonc
{
    // The maximum length of the preview for each match ("Search matches" column).
    // By default, the limit is 200.
    "searchExport.maxMatchContentLength": 50
}
```

## Development

1. Run `yarn && yarn run serve` and keep the Parcel bundler process running.
1. [Sideload the extension](https://docs.sourcegraph.com/extensions/authoring/local_development) (at the URL http://localhost:1234 by default) on your Sourcegraph instance or Sourcegraph.com.

When you edit a source file in your editor, Parcel will recompile the extension. Reload the Sourcegraph web page to use run the updated extension.

## Release

Run `src extension publish` using the [Sourcegraph `src` CLI](https://github.com/sourcegraph/src-cli).

repository: sourcegraph/sourcegraph-search-export

gha_language: TypeScript

repo_name: sourcegraph/sourcegraph-search-export


text:
<img src="https://i.imgur.com/HZZG8wr.jpg" width="1358" alt="workerize-loader">

# workerize-loader [![npm](https://img.shields.io/npm/v/workerize-loader.svg?style=flat)](https://www.npmjs.org/package/workerize-loader) [![travis](https://travis-ci.org/developit/workerize-loader.svg?branch=master)](https://travis-ci.org/developit/workerize-loader)

> A webpack loader that moves a module and its dependencies into a Web Worker, automatically reflecting exported functions as asynchronous proxies.

- Bundles a tiny, purpose-built RPC implementation into your app
- If exported module methods are already async, signature is unchanged
- Supports synchronous and asynchronous worker functions
- Works beautifully with async/await
- Imported value is instantiable, just a decorated `Worker`

## Install

```sh
npm install -D workerize-loader
```

### Usage

**worker.js**:

```js
// block for `time` ms, then return the number of loops we could run in that time:
export function expensive(time) {
    let start = Date.now(),
        count = 0
    while (Date.now() - start < time) count++
    return count
}
```

**index.js**: _(our demo)_

```js
import worker from 'workerize-loader!./worker'

let instance = worker()  // `new` is optional

instance.expensive(1000).then( count => {
    console.log(`Ran ${count} loops`)
})
```

### Options

#### `inline`

Type: `Boolean`
Default: `false`

You can also inline the worker as a BLOB with the `inline` parameter

```js
// webpack.config.js
{
  loader: 'workerize-loader',
  options: { inline: true }
}
```
or
```js
import worker from 'workerize-loader?inline!./worker'
```

### About [Babel](https://babeljs.io/)

If you're using [Babel](https://babeljs.io/) in your build, make sure you disabled commonJS transform. Otherwize, workerize-loader won't be able to retrieve the list of exported function from your worker script :
```js
{
    test: /\.js$/,
    loader: "babel-loader",
    options: {
        presets: [
            [
                "env",
                {
                    modules: false,
                },
            ],
        ]
    }
}
```

### Testing

To test a module that is normally imported via `workerize-loader` when not using Webpack, import the module directly in your test:

```diff
-const worker = require('workerize-loader!./worker.js');
+const worker = () => require('./worker.js');

const instance = worker();
```

To test modules that rely on workerized imports when not using Webpack, you'll need to dig into your test runner a bit. For Jest, it's possible to define a custom `transform` that emulates workerize-loader on the main thread:

```js
// in your Jest configuration
{
  "transform": {
    "workerize-loader(\\?.*)?!(.*)": "<rootDir>/workerize-jest.js"
  }
}
```

... then add the `workerize-jest.js` shim to your project:

```js
module.exports = {
  process(src, filename, config, options) {
    return 'module.exports = () => require(' + JSON.stringify(filename.replace(/.+!/,'')) + ')';
  },
};
```

Now your tests and any modules they import can use `workerize-loader!` prefixes.

### Credit

The inner workings here are heavily inspired by [worker-loader](https://github.com/webpack-contrib/worker-loader). It's worth a read!

### License

[MIT License](https://oss.ninja/mit/developit) © [Jason Miller](https://jasonformat.com)


text:
# Releases WG

### Date: 2020-01-29

## Attendees

**Members**
* @ckerr
* @codebytere
* @jkleinsc
* @robo
* @sofianguy
* @zcbenz

**Visitors**

## Agenda

* Update from Apple on private `CAContext/CALayerHost` APIs?
* App upgrade feedback

## Backport Requests

* [feat: Exposing methods required by capturing a hidden webContents (8-x-y)](https://github.com/electron/electron/pull/21895)
    * Decision - hold off until possible 8-1-x
* [feat: Exposing methods required by capturing a hidden webContents (7-1-x)](https://github.com/electron/electron/pull/21894)
    * Decision - hold off until possible 7-2-x

## Action Items

## Follow-Up Discussion

repository: electron/governance

gha_language: Shell

repo_name: electron/governance


text:
---
layout: default
header-title: Sigma Alliance Resilience
gg-link: https://swgoh.gg/g/4969/resilience/
gg-link-text: visit swgoh.gg profile
guild-photo: /assets/img/resilience.jpg
short-description: Sigma Alliance Resilience
intro_paragraph: You can edit edit `pages/guilds/resilience.md` in a text editor.
---

### About Us

Joining Sigma Alliance in May 2019, Resilience is the newest addition to the cluster. We are an European guild, with a sizable French and Swedish member base. Resilience is an active community within the vast member base of Sigma Alliance. When you're a member of Resilience, you're also a member of the Sigma Alliance. One big guild, built in to different tiers, based on activity, roster and performance, both US and EU based.

### Requirements

In order to join Resilience, you are required to
* Have a 3 million GP
* Have Discord
* Have a swgoh.gg account
* Have hSTR ready rooster.
* Be able to complete 90 Combat waves in TB
* Contribute 600 tickets daily

### Raid Info

#### The Pit

* Sim Raid Heroic Pit is launced on auto at 17:00hrs UTC.
* We use join period of 24hrs.

#### hAAT Raid:

* Raid Launch is at 18:00hrs UTC.
* We use join period of 24hrs.

#### Hstr Raid:

* Raid Launch is at 18:00hrs UTC.
* We use join period of 24hrs.

[Join Sigma Alliance!](https://discord.gg/V33Kfaj)

Hope to see you soon!

repository: join-sigma/sigma-jekyll-netlify

repo_name: join-sigma/sigma-jekyll-netlify