text:
[![][ElasTest Logo]][ElasTest]

Copyright © 2017-2019 Technishce Universitaet Berlin. Licensed under
[Apache 2.0 License].

# ElasTest Device Emulator Service

This is the Elastest Device-Emulator Service (EDS) which provides to emulates
sensor devices. The emulated devices include sensors, actuators and smart
devices.

EDS follows a Service Oriented Architecture (SOA). The service in this context
 is a light-weight micro-service. Furthermore, several micro-services are
linked together to achieve the goals of EDS. The aim of a micro-service in EDS
is to run the functions of an emulator for a device which could be a sensor,
actuator or a smart device.

Additionally a micro-service called FrontEnd connects to the other
micro-services to provide a common interface for the user to access all micro-
services.

The micro-services use [oneM2M](http://onem2m.org) for communication. Furthermore
an Interworking Proxy (IPE) is used to transfer data from a non-oneM2M domain
to oneM2M domain. The available micro-services supporting oneM2M in the present
release of EDS are:
* ZigBeeIPE : Provides simulated data from brightness, pressure, movement,
humidity, temperature sensors.
* MemsIPE : Provides simulated data from the accelerometer sensor containing
values for x, y and z components of acceleration.
* FrontEnd : Provides a user interface to interact with MemsIPE and ZigBeeIPE.
A user interface (UI) displays the data from micro-services.
* rest_app : Provides an interaction UI using RESTful API.In order to use the
facility of the EDS, its API is used. The API is based upon the
latest (2.12) version of the Open Service Broker API. To this end there are some
specific ElasTest extensions added.

EDS runs each micro-service in a docker container, the containers are linked
together to link the micro-services.

# Clone the Project
```shell
#Clone the project to your system
#Alternatively, you can download the zip file from Github and unzip it
git clone git@github.com:elastest/elastest-device-emulator-service.git

#Change working directory to main project folder
cd elastest-device-emulator-service
```

# How to run
* Run EDS using docker-compose: This method allows docker to setup containers
and connect them in a custom network. All the IPEs register after 10 seconds with
FrontEnd.

Start EDS using:
```shell
chmod +x script/*
./script/startup-linux.sh
```
To stop EDS:
```shell
./script/teardown-linux.sh
```
* Run EDS on local machine : This is explained in the development documenation, as
it requires changing the default network configuration.

The EDS FrontEnd UI can be accessed from port 6065, FrontEnd gateway from port
8000 and Swagger UI on port 8080.

It is important for MemsIPE to have "/dev/i2c-1" device node available on the
host machine. Please make sure to stop and remove the stale containers. If running using
docker compose, it is advisable to remove docker bridge with name "build_eds_netowrk"
before running startup-linux.sh script.

# Basic usage
The Frontend operates a gateway which accepts curl requests to return the
simulated sensor data posted by MemsIPE and ZigBeeIPE in the JSON format on port 8000.
All the data that follows are simulated through EDS.

Request to show registered oneM2M IPEs:

```shell
$ curl http://localhost:8000/onem2m/ -s | jq '.'

{
  "m2m:cb": {
    "ch": [
      {
        "typ": 2,
        "nm": "ZigBeeIPE",
        "val": "ae1"
      },
      {
        "typ": 2,
        "nm": "FrontEnd",
        "val": "ae0"
      },
      {
        "typ": 2,
        "nm": "MemsIPE",
        "val": "ae2"
      }
    ],
    "csi": "/mn-cse-1",
    "ri": "cb0",
    "ty": 5,
    "lt": "2017-08-29T15:26:31.813938+00:00",
    "srt": [
      16,
      23,
      4,
      5,
      3,
      2
    ],
    "cst": 2,
    "rn": "onem2m",
    "ct": "2017-08-29T15:26:31.813938+00:00",
    "poa": [
      "http://<IP_ADDRESS>:8000",
      "http://<IP_ADDRESS>:8000"
    ]
  }
}

```
### Requests to ZigBeeIPE

Request to access ZigBeeIPE:

```shell
$ curl http://localhost:8000/onem2m/ZigBeeIPE -s | jq '.'

{
  "m2m:ae": {
    "ri": "ae1",
    "nl": "dummy",
    "rr": false,
    "ty": 2,
    "et": "2017-08-29T16:45:39.003547+00:00",
    "ch": [
      {
        "typ": 3,
        "nm": "devices",
        "val": "cnt0"
      }
    ],
    "lt": "2017-08-29T16:25:39.012676+00:00",
    "api": "dummy",
    "aei": "CZigBeeIPE",
    "pi": "cb0",
    "rn": "ZigBeeIPE",
    "poa": [
      "http://<IP_ADDRESS>:5001"
    ],
    "ct": "2017-08-29T15:26:39.806291+00:00"
  }
}

```

Request to show available devices on ZigBeeIPE:

```shell
$ curl http://localhost:8000/onem2m/ZigBeeIPE/devices -s | jq '.'

{
  "m2m:cnt": {
    "ch": [
      {
        "typ": 3,
        "nm": "ZBS122S000001",
        "val": "cnt1"
      },
      {
        "typ": 3,
        "nm": "ZBS122S000000",
        "val": "cnt6"
      }
    ],
    "mni": 30,
    "cr": "CZigBeeIPE",
    "et": "2017-08-29T16:55:39.048780+00:00",
    "ty": 3,
    "lt": "2017-08-29T16:35:39.098708+00:00",
    "rn": "devices",
    "ct": "2017-08-29T15:26:39.900545+00:00",
    "ri": "cnt0",
    "cni": 0,
    "cbs": 0,
    "pi": "ae1",
    "st": "0"
  }
}

```
Request to access list of sensors in ID ZBS122S000001. This returns available
sensors namely light, pressure, movement, humidity and temperature.

```shell
$ curl http://localhost:8000/onem2m/ZigBeeIPE/devices/ZBS122S000001/sensor_data -s | jq '.'

{
  "m2m:cnt": {
    "ch": [
      {
        "typ": 3,
        "nm": "brightness",
        "val": "cnt17"
      },
      {
        "typ": 3,
        "nm": "pressure",
        "val": "cnt19"
      },
      {
        "typ": 3,
        "nm": "movement",
        "val": "cnt21"
      },
      {
        "typ": 3,
        "nm": "humidity",
        "val": "cnt20"
      },
      {
        "typ": 3,
        "nm": "temperature",
        "val": "cnt18"
      }
    ],
    "mni": 30,
    "cr": "CZigBeeIPE",
    "et": "2017-08-29T17:05:50.104399+00:00",
    "ty": 3,
    "lt": "2017-08-29T16:45:50.148437+00:00",
    "rn": "sensor_data",
    "ct": "2017-08-29T15:26:50.508627+00:00",
    "ri": "cnt16",
    "cni": 0,
    "cbs": 0,
    "pi": "cnt1",
    "st": "0"
  }
}

```

Request to receive latest data from the temperature sensor. Please note that the
reply from the curl request is base64 decoded.

```shell

$ curl http://localhost:8000/onem2m/ZigBeeIPE/devices/ZBS122S000001/sensor_data/temperature/latest \
-s | jq -r '.["m2m:cin"].con' | base64 -d | jq '.'

[
  {
    "bn": "urn:dev:xbee:ZBS122S000001",
    "v": 17.5,
    "u": "Cel",
    "t": "1504025850.892",
    "n": "temperature"
  }
]

```
Request to receive latest data from the humidity sensor. Please note that the
reply from the curl request is base64 decoded. Furthermore this can be repeated
for the remaining sensors.

```shell

$ curl http://localhost:8000/onem2m/ZigBeeIPE/devices/ZBS122S000001/sensor_data/humidity/latest \
-s | jq -r '.["m2m:cin"].con' | base64 -d | jq '.'

[
  {
    "bn": "urn:dev:xbee:ZBS122S000001",
    "v": 84,
    "u": "%RH",
    "t": "1504026051.652",
    "n": "humidity"
  }
]

```
### Requests to MemsIPE

Request to show available sensors in MemsIPE:

```shell
$ curl http://localhost:8000/onem2m/MemsIPE/sensor_data/ -s | jq '.'

{
  "m2m:cnt": {
    "ch": [
      {
        "typ": 3,
        "nm": "x",
        "val": "cnt3"
      },
      {
        "typ": 3,
        "nm": "y",
        "val": "cnt4"
      },
      {
        "typ": 3,
        "nm": "z",
        "val": "cnt5"
      }
    ],
    "mni": 10,
    "cr": "CMemsIPE",
    "et": "2017-08-29T17:15:39.122764+00:00",
    "lbl": [
      "sensor_data",
      "openmtc:device"
    ],
    "ty": 3,
    "lt": "2017-08-29T16:55:39.171379+00:00",
    "rn": "sensor_data",
    "ct": "2017-08-29T15:26:39.996691+00:00",
    "ri": "cnt2",
    "cni": 0,
    "cbs": 0,
    "pi": "ae2",
    "st": "0"
  }
}

```
Request to receive the latest reading from the z axis of the accelerometer.
Please note that the returned value is to be base64 decoded. A similar approach
can be followed for x and y axes.

```shell

curl http://localhost:8000/onem2m/MemsIPE/sensor_data/z/latest -s | jq -r '.["m2m:cin"].con' | base64 -d | jq '.'

[
  {
    "bn": "urn:dev1:memsipe",
    "v": 0.016461689528667167,
    "u": "g",
    "t": "1504026602.834",
    "n": "z"
  }
]

```

### Access EDS FrontEnd user interface

This user interface displays plots in real time the data received from various
senors of the ZigBeeIPE and MemsIPE. This can be accessed on a browser using the
link:

```shell
http://localhost:6065/static/eds.html
```

### Access Swagger UI
Swagger UI provides the RESTful API available with EDS. The linking of API to
different IPE is to be done.

```shell
http://localhost:8080/eds/ui/
```

# Development documentation
TBD

# Source

Source code for other ElasTest projects can be found in the [GitHub ElasTest
Group].

# News

Check the [ElasTest Blog] and follow us on Twitter [@elastestio][ElasTest Twitter].

# Issue tracker

Issues and bug reports should be posted to the [GitHub ElasTest Bugtracker].

# Licensing and distribution

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.

# Contribution policy

You can contribute to the ElasTest community through bug-reports, bug-fixes,
new code or new documentation. For contributing to the ElasTest community,
you can use GitHub, providing full information about your contribution and its
value. In your contributions, you must comply with the following guidelines

* You must specify the specific contents of your contribution either through a
  detailed bug description, through a pull-request or through a patch.
* You must specify the licensing restrictions of the code you contribute.
* For newly created code to be incorporated in the ElasTest code-base, you
  must accept ElasTest to own the code copyright, so that its open source
  nature is guaranteed.
* You must justify appropriately the need and value of your contribution. The
  ElasTest project has no obligations in relation to accepting contributions
  from third parties.
* The ElasTest project leaders have the right of asking for further
  explanations, tests or validations of any code contributed to the community
  before it being incorporated into the ElasTest code-base. You must be ready
  to addressing all these kind of concerns before having your code approved.

# Support

The ElasTest project provides community support through the [ElasTest Public
Mailing List] and through [StackOverflow] using the tag *elastest*.

  Funded by the European Union

[Apache 2.0 License]: http://www.apache.org/licenses/LICENSE-2.0
[ElasTest]: http://elastest.io/
[ElasTest Blog]: http://elastest.io/blog/
[ElasTest Doc]: http://elastest.io/docs/
[ElasTest Logo]: http://elastest.io/images/logos_elastest/elastest-logo-gray-small.png
[ElasTest Public Mailing List]: https://groups.google.com/forum/#!forum/elastest-users
[ElasTest Twitter]: https://twitter.com/elastestio
[GitHub ElasTest Group]: https://github.com/elastest
[GitHub ElasTest Bugtracker]: https://github.com/elastest/bugtracker
[StackOverflow]: http://stackoverflow.com/questions/tagged/elastest
[Universidad Rey Juan Carlos]: https://www.urjc.es/


text:
# QuestionPoint Failover Chat for LibraryH3lp Chat

This code can be used to check the current status of LibraryH3lp Chat and either display the LibraryH3lp Chat if online or the QuestionPoint Chat if not online. If LibraryH3lp is staffed during business hours, then QuestionPoint will only display during after-hours.

## Prep

To failover to QuestionPoint Chat, you will need to first create a QWIDGET. More information about creating a QWIDGET can be found on OCLC's website at: http://www.oclc.org/content/dam/oclc/services/brochures/213410usf_questionpoint_qwidget.pdf

## Installation and Configuration

The application consists of 3 parts: a PHP script that checks the real-time status of LibraryHelp, a JS script that calls the PHP using an AJAX request and the HTML page where a link to open the Chat popup exists.

### PHP

The file php/chat_status.php needs to be installed on a web server that can process PHP scripts. The $libraryh3lp_queue variable needs to be set to the name of your libraryh3lp chat queue. If you are calling the chat_status.php from a different domain than the domain where the JS file will reside, then you will need to update the Access-Control-Allow-Origin line to include the alternate domain.

### JS

The js/chat.js file needs to be installed on a web server. The following three settings need to be configured:

```js

var chat_status_url = "//library.university.edu/chat/chat_status.php";
var libraryh3lp_queue = "library-queue";
var questionpoint_instid = "12345";

```

chat_status_url - the location of the PHP script you installed in the previous step
libraryh3lp_queue - the name of your LibraryH3lp queue
questionpoint_instid - the QuestionPoint institution ID for your institution

### HTML

On your website you can add a link to open the chat popup. You can follow the example HTML used in html/index.html. The link href needs to be set to javascript:ChatPopup(); and the chat.js include file needs to be referenced in the location where it was installed in the previous step.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# git-code-review

![CI](https://github.com/ReverentEngineer/git-code-review/workflows/CI/badge.svg?branch=master)

A code review tool built into the git objects.

# Usage

```
git code-review list [--closed]
git code-review open <name> <commit> <commit>
git code-review close <name>
git code-review view <name>
```

# List Code Reviews

To see open code reviews:
```
git code-review list
```

To see previous closed closed reviews:
```
git code-review list --closed
```

# Opening A Code Review

First, a code review author would run:
```
git code-review open <name> <first sha> <last sha>
```

It will then prompt the user for a code review message.

# Close A Code Review

After a code review is over, the code reviw author would run:
```
git code-review close <name>
```

# View A Code Review

 A code reviewer would run:
```
git code-review view <name>
```

The tool will iterate through all the diff hunks as well as comments.
During each hunk or comment, a user will be prompted to (c)omment (s)skip or
(q)uit.

repository: ReverentEngineer/git-code-review

repo_name: ReverentEngineer/git-code-review


text:
# Lifecycle

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**action** | [**ActionEnum**](#ActionEnum) | The action to perform. Delete the files or leave the files exists after processing. The files can be delete manually. |  [optional]
**type** | [**TypeEnum**](#TypeEnum) | Determine when to delete the job and associated files.  JOB_DONE means delete directly after the job finished processing. |  [optional]

## Enum: ActionEnum
Name | Value
---- | -----
DELETE | "DELETE"
NONE | "NONE"

## Enum: TypeEnum
Name | Value
---- | -----
DONE | "JOB_DONE"

repository: Sphereon-SDK/vision-sdk

gha_language: HTML

repo_name: Sphereon-SDK/vision-sdk


text:
---
title: Release Notes for 2020.9.0
seo-title: AEM Cloud Manager Release Notes for 2020.9.0
description: Follow this page to get information for Cloud Manager Release 2020.9.0
seo-description: Follow this page to get information for AEM Cloud Manager Release 2020.9.0
feature: Release Information
exl-id: ee339c4d-c7f5-4239-95d1-1891028cd9c7
---
# Release Notes for 2020.9.0 {#release-notes-for}

The following section outlines the general Release Notes for [!UICONTROL Cloud Manager] Release 2020.9.0.

## Release Date {#release-date}

The Release Date for [!UICONTROL Cloud Manager] Version 2020.9.0 is September 03, 2020.

## What's New {#whats-new}

* The build process has been separated into three separate Maven commands.
* If the git repository fails to be cloned, it will be reattempted up to three times.
* There is now an indicator on the pipeline execution details page when authentication is used during performance testing.

branch_name: refs/heads/main

gha_license_id: MIT


text:
# DockerSandbox

Sandbox for experimenting with Docker.

Building an image and tagging it:
```
docker build -t wetadigital/usdpluginexamples:latest USDPluginExamples/
```

Running an image with an interactive bash terminal:
```
docker run -it aswf/ci-vfxall /bin/bash
```

repository: moddyz/DockerSandbox

repo_name: moddyz/DockerSandbox


text:
Audience Meter: Lightweight daemon to mesure audience of a live event
=====================================================================

Audience Meter is a simple daemon written in [Node.js](http://nodejs.org) to mesure the number of users currently online. This can be used to mesure the audience of live events.

## Features

- Namespaces to track an unlimited number of events
- Cross browser push notification thru [EventSource](http://dev.w3.org/html5/eventsource/) polyfill using xhr-streaming-CORS for recent browsers and flash/URLStream for older browser
- Monitoring interface on a dedicated port
- Spreads the load on multiple CPUs and/or multiple servers

## How to use

Start by running the daemon on a server, root privilege is required to let the daemon listen on ports 80:

    $ sudo node audience-meter.js

Here are available parameters:

    Usage: audience-meter.js [options]

    Options:

      -h, --help                           output usage information
      -V, --version                        output the version number
      -d, --debug                          Log everything
      -w, --workers <num>                  Number of worker processes to spawn (default to the number of CPUs)
      -m, --cluster-addr <ip:port>         Use a given multicast IP:PORT to sync several instances of audience-meter
                                           (disabled by default, prefered address is <IP_ADDRESS>:314)
      --max-conn-duration <seconds>        The maximum number of seconds a connection can stay established
                                           (default 3600, 0 to disable)
      --enable-uuid                        Enable connection UUID to prevent several connections with same
                                           (EXPERIMENTAL, known to leak memory)
      --cluster-notify-interval <seconds>  Interval between notifications for a node's notification (default 2 seconds
      --cluster-node-timeout <seconds>     Delay after which node's namespace info will be forgotten if no notification
                                           is recieved by a node (default 5 seconds)
      --notify-delta-ratio <ratio>         Minimum delta of number of members to reach before to notify listeners based
                                           on a fraction of the current number of members (default 0.1)
      --notify-min-delay <seconds>         Minimum delay between notifications (default 2)
      --notify-max-delay <seconds>         Maximum delay to wait before not sending notification because of min-delta not
                                           reached (default 25)
      --increment-delay <seconds>          Number of seconds to wait before to increment the counter in order to mitigate
                                           de/connection floods
      --namespace-clean-delay <seconds>    Minimum delay to wait before to clean an empty namespace (default 60)
      --demo-port <port>                   Public port on which to bind the demo server (default 8080, 0 to disable)
      --stats-port <port>                  Local port on which to bind the global stats server (default 1442, 0 to disable)
      --notification-port <port>           Local port on which to bind the global notification server (default 2442, 0 to disable)

In the webpage of the event, add the following javascript to join an event.:

Note that you can only join a single event at a time in a single page.

You may want to report the current number of online users on the event. By default, joining an event listen for it. To get event members count when it changes, listen for incoming messages like this:

    Connected users -

## Monitoring Interface

The daemon listen on the 1442 port on localhost in order to let another process to dump all namespace counters for monitoring or graphing purpose. One possible usage is to update RRD files to track the evolution of the audiance over time.

The server send all namespaces and their associated info separated formated as a JSON object. Each namespace is stored in a proprety, with an object containing info on the namespace. Namespace fields are:

* *created*: the UNIX timestamp of the namespace creationg time
* *connections*: the total number of connections to the namespace since its creation
* *members*: the current number of participents in the namespace

Here is a usage example using netcat (indentation added for clarity):

    $ nc localhost 1442
    {
        "namespace1":
        {
            "created":1300804962,
            "connections":234,
            "members":123
        },
        "namespace2":
        {
            "created":1300804302,
            "connections":456,
            "members":345
        },
        "namespace3":
        {
            "created":1300824940,
            "connections":789,
            "members":678
        }
    }

## License

(The MIT License)

Copyright (c) 2011 Olivier Poitrey<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.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 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: rs/audience-meter

gha_language: JavaScript

repo_name: rs/audience-meter


text:
# StegIMG

This application allows to hide arbitrary data into bitmaps by simple steganography algorithm.
The main idea of the algorithm is based on using lower bits of some components in RGBA to store of hidden data.
`[A][R][G][B]` -- pixel presented in RGBA color space.
In this scheme each byte D of input data is decomposed into four part, two bits each.
Each part written to lower bits of R and/or B bytes.
Here we use R and B parts only, because it allows to doesn't much spoil input image.

## User Guide

The main window at the time of starting the program:

![1-a.0](doc/1-a.0.png)

The button `Image` opens dialog to load of a base image.
If this step finished with error, you will see the next message:

![1-c.0](doc/1-c.0.png)

Otherwise, you will get extended options:

![2-a.0](doc/2-a.0.png)

The status bar displays capacity of the steganographic container.

The buttons `AddBefore` and `AddAfter` allow to add new
contents into archive.
Following choise of the file in corresponding dialog
you will see window with available options:

![2-b.2](doc/2-b.2.png)

Here `ItemName` is a name of the file into archive.
It must not longer than 255 characters!

You also can choose one of the available compression methods:
`None` -- without compression;
`RLE` -- run-length encoding (for uniform strings);
`LZW` -- Lempel-Ziv-Welch.

There are some possible errors here:

![2-c.1](doc/2-c.1.png)

It may be caused by not conforming file permissions or corrupted of the file system.

![2-c.2](doc/2-c.2.png)

This message means that capacity of the container exceeded.

After adding the files into archive:

![3-a.0](doc/3-a.0.png)

![4-a.0](doc/4-a.0.png)

The progress bar displays bussy space volume in percent of available capacity.

The table contains list of properties of the each item.

The table also supports a feature to rename items:

![5-a.0](doc/5-a.0.png)

But this operation can throw error if name is longer than 255 or
resulted file header does not fit into container:

![5-c.0](doc/5-c.0.png)

The button `Del` is responsible to remove items from archive.
The button `Get` allows to extract item to external file.

The button `Encrypt` saves container into a bitmap image.
But only 'bmp' and 'png' formats are supported.

You also can set own password to a secure encryption:

![6-b.4](doc/6-b.4.png)

Further, when opening the container, you can decrypt its content by same password
(the button `Decrypt` opens a corresponding dialog).

In this case if your password is false, you can get corresponding message:

![7-c.0](doc/7-c.0.png)

But it is also possible that the container will be unpacked incorrectly.

repository: AnderOne/StegIMG

repo_name: AnderOne/StegIMG


text:
# Medoo

The Lightest PHP database framework to accelerate development

### Main Features

* **Lightweight** - Only 8KB, one file included.

* **Easy** - Extremely easy to learn and use, friendly construction.

* **Powerful** - Support various common SQL queries.

* **Compatible** - Support various SQL database, including MySQL, MSSQL, SQLite and more.

* **Security** - Prevent SQL injection.

* **Free** - Under MIT license, you can use it anywhere if you want.

### Get Started

    // Include Medoo
    require_once 'medoo.php';

    // Initialize
    $database = new medoo('my_database');

    // Enjoy
    $database->insert('account', [
        'user_name' => 'foo'
        'email' =><EMAIL_ADDRESS>        'age' => 25,
        'lang' => ['en', 'fr', 'jp', 'cn']
    ]);

    // Or initialize via independent configuration
    $database = new medoo([
        'database_type' => 'mysql',
        'database_name' => 'name',
        'server' => 'localhost',
        'username' => 'your_username',
        'password' => 'your_password',
    ]);

### Links

* Official website: [http://medoo.in](http://medoo.in)

* Documentation: [http://medoo.in/doc](http://medoo.in/doc)

repository: onesy/Medoo

repo_name: onesy/Medoo


text:
HTTPKit
==========

Task based, RESTful, HTTP library for iOS and OS X. Built off ConcurrentKit and NSURLSession. Tasked based is much simpler to explain in example, so check that out below. This library was mainly a learning experience of combining parts of [PromiseKit](https://github.com/mxcl/PromiseKit) and [AFNetworking](https://github.com/AFNetworking/AFNetworking) to learn more about promises and NSURLSession. That being said, it uses portions of AFNetworking code for serialization and the within ConcurrentKit, the design pattern of promiseKit. You can see that library here:

- [AFNetworking](https://github.com/AFNetworking/AFNetworking)
- [PromiseKit](https://github.com/mxcl/PromiseKit)

## Examples

## GET

```objc
DCHTTPTask *task = [DCHTTPTask GET:@"http://www.vluxe.io"];
task.thenMain(^(DCHTTPResponse *response){
    NSString *str = [[NSString alloc] initWithData:response.responseObject encoding:NSUTF8StringEncoding];
    NSLog(@"web request finished: %@",str);
}).catch(^(NSError *error){
    NSLog(@"failed to load Request: %@",[error localizedDescription]);
});
[task start];
```
The power here isn't simply the fact we preformed an HTTP request, that can be accomplished very easily from standard NSURLSession. The power here is the chainable, tasked-based approach. More information on the power of task can be found in [ConcurrentKit](https://github.com/daltoniam/ConcurrentKit). Here is another example to better drive home the power.

```objc
DCHTTPTask *task = [DCHTTPTask GET:@"http://www.vluxe.io"];
task.then(^(DCHTTPResponse *response) {
    //this is a on a background thread
    NSString *str = [[NSString alloc] initWithData:response.responseObject encoding:NSUTF8StringEncoding];
	//let's say we got a personal issue against h2 tags, but h3 tags are cool.
    str = [str stringByReplacingOccurrencesOfString:@"</h2>" withString:@"</h3>"];
    str = [str stringByReplacingOccurrencesOfString:@"<h2>" withString:@"<h3>"];
    return str;
}).thenMain(^(NSString *str) {
    //this is the main thread
    //load modified webpage into webview...
}).catch(^(NSError *error){
    NSLog(@"got an error: %@",[error localizedDescription]);
});
[task start];
```
Boom. We just made a request, did some possibly long running operation (like parsing and modifying a webpage in this example), then switch to the UI thread to update the UI. We don't suffer from rightward driving blocks and our code stays simple, clean, and totally async. You're welcome.

## Multipart/File Upload

```objc
NSURL *fileURL = [NSURL fileURLWithPath:@"/Users/dalton/Desktop/somefile"];
DCHTTPTask *task = [DCHTTPTask POST:@"http://domain.com/upload"
                         parameters:@{@"file": [DCHTTPUpload uploadWithFile:fileURL],
                                      @"auth_token": @"someToken"}];
[task.requestSerializer setValue:[NSString stringWithFormat:@"Token token=\"%@\"", API_TOKEN] forHTTPHeaderField:@"Authorization"];
task.responseSerializer = [DCJSONResponseSerializer new];
task.thenMain(^(DCHTTPResponse *response){
    NSLog(@"payload: %@",response.responseObject);
    NSLog(@"finished upload task");
    return nil;
}).catch(^(NSError *error){
    NSLog(@"failed to upload file: %@",[error localizedDescription]);
});
[task start];
```
Multi form for file upload is very simple. Simple create a provide DCHTTPUpload object.

## Background File Download Task

```objc
DCHTTPTask *task = [DCHTTPTask GET:@"https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/ObjC_classic/FoundationObjC.pdf" parameters:nil];
task.download = YES;
[task setProgress:^(CGFloat progress) {
    NSLog(@"download task progress: %f",progress);
}];
task.then(^(DCHTTPResponse *response){
    NSURL *downloadURL = response.responseObject;
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSArray *URLs = [fileManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask];
    NSURL *documentsDirectory = [URLs objectAtIndex:0];
    NSURL *destinationURL = [documentsDirectory<EMAIL_ADDRESS>    [fileManager removeItemAtURL:destinationURL error:NULL];
    [fileManager copyItemAtURL:downloadURL toURL:destinationURL error:NULL];
    return destinationURL;
}).thenMain(^(NSURL *destinationURL) {
    self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:destinationURL];
    [self.documentInteractionController setDelegate:self];
    [self.documentInteractionController presentPreviewAnimated:YES];
    return nil;
}).catch(^(NSError *error) {
        NSLog("We got an error!?!?: %@",[error localizedDescription]);
});
[task start];
```
With just a few lines we scheduled a background based task and we get notified when it finished. We leveraged background downloading from NSURLSession and then while still on the background, we copied our file to it's new permanent location, then jump back to the main thread to view the file. We even got progress notifications we could have hooked up to a progressView.

## Background Upload Task

```objc
NSURL *fileURL = [NSURL fileURLWithPath:@"/Users/dalton/Desktop/somefile"];
DCHTTPTask *task = [DCHTTPTask POST:@"http://domain.com/upload"
                         parameters:@{@"file": [DCHTTPUpload uploadWithFile:fileURL]}];
[task setProgress:^(CGFloat progress) {
    NSLog(@"upload task progress: %f",progress);
}];
[task.requestSerializer setValue:[NSString stringWithFormat:@"Token token=\"%@\"", API_TOKEN] forHTTPHeaderField:@"Authorization"];
task.responseSerializer = [DCJSONResponseSerializer new];
task.thenMain(^(DCHTTPResponse *response){
    NSLog(@"payload: %@",response.responseObject);
    NSLog(@"finished upload task");
    return nil;
}).catch(^(NSError *error){
    NSLog(@"failed to upload file: %@",[error localizedDescription]);
});
[task start];
```

This will upload a file in the background. It is important to note NSURLSession limits the **background** (only the background) upload to be a single fileURL and will ignore all parameters other than the file uploaded. This is way less than ideal, but we play with the cards we are dealt. (This limitation only exist when doing a background upload, normal uploads are fine.)

## HTTP Manager

API interaction is a very common need on mobile. HTTPKit has got you covered.
```objc
DCHTTPTaskManager *manager = [DCHTTPTaskManager new];
manager.baseURL = @"http://domain.com/1/";
[manager.requestSerializer setValue:[NSString stringWithFormat:@"Token token=\"%@\"", API_TOKEN] forHTTPHeaderField:@"Authorization"];
[manager addParameter:@"someToken" forKey:@"auth_token"];

DCHTTPTask *task = [manager GET:@"users" parameters:@{@"id": @1}];
task.thenMain(^(DCHTTPResponse *response){
    // do something with the JSON.
    return nil;
}).catch(^(NSError *error){
    NSLog(@"failed to load user request: %@",[error localizedDescription]);
});
[task start];

DCHTTPTask *otherTask = [manager POST:@"users" parameters:@{@"id": @1, @"name": @"Dalton"}];
otherTask.thenMain(^(DCHTTPResponse *response){
    // do something with the JSON.
    return nil;
}).catch(^(NSError *error){
    NSLog(@"failed to load user request: %@",[error localizedDescription]);
});
[otherTask start];
```

The tasks will be created and contain the shared data (baseURL,header value, auth_token parameter,etc). The DCHTTPTaskManager has the JSON serializer as its default serializer.

## Serializer

Each request can have a request and response serializer. These basically serialize or encode/decode the request parameters and responses. They are very simple to use. By default the HTTPRequestSerializer is used for the requestSerializer and No responseSerializer is set by default (meaning an NSData object will be returned).

```objc
DCHTTPTask *task = [manager POST:@"users" parameters:@{@"id": @1}];
//set both to be JSON serializer
task.requestSerializer = [DCJSONRequestSerializer new];
task.responseSerializer = [DCJSONResponseSerializer new];
```

You can set multiple response serializer for each different content Types as well.

```objc
[task setResponseSerializer:[DCJSONResponseSerializer new] forContentType:@"application/json"];
```
The JSONResponse serializer will only be used for that contentType and the `responseSerializer` will be used for all the rest.

## Other

There are built in methods for HEAD, DELETE, GET, POST, PUT. You aren't limited to just these HTTPMethods (verbs), but those are the most common. You can simple swap on the HTTP method like so:

```objc
DCHTTPTask *task = [DCHTTPTask GET:@"http://www.vluxe.io"];
task.HTTPMethod = @"OTHERMETHOD";
task.thenMain(^(DCHTTPResponse *response){
    NSString *str = [[NSString alloc] initWithData:response.responseObject encoding:NSUTF8StringEncoding];
    NSLog(@"web request finished: %@",str);
    return nil;
}).catch(^(NSError *error){
    NSLog(@"failed to load Request: %@",[error localizedDescription]);
});
[task start];
```

## Install ##

The recommended approach for installing HTTPKit is via the CocoaPods package manager, as it provides flexible dependency management and dead simple installation.

via CocoaPods

Install CocoaPods if not already available:

	$ [sudo] gem install cocoapods
	$ pod setup
Change to the directory of your Xcode project, and Create and Edit your Podfile and add HTTPKit:

	$ cd /path/to/MyProject
	$ touch Podfile
	$ edit Podfile
	platform :ios, '7.0'
	#or platform :osx, '10.9'
	pod 'HTTPKit'

Install into your project:

	$ pod install

Open your project in Xcode from the .xcworkspace file (not the usual project file)

## Requirements ##

HTTPKit requires at least iOS 7/OSX 10.9 or above.

## License ##

HTTPKit is license under the Apache License.

## Contact ##

### Dalton Cherry ###
* https://github.com/daltoniam
* http://twitter.com/daltoniam
* http://daltoniam.com

repository: icanzilb/HTTPKit

repo_name: icanzilb/HTTPKit


text:
## jQuery Utilities plugin ##

### Why this plugin ###

This plugin is for everyone who had the same problem like me. I hate it to write the same code over and over. This plugin does some basic stuff so I don't need to write the code for every project.

### What does it do? ###

* Search all external links and adds an attribute `target` with value `_blank` and a class 'external'.
* Array.unique() functionality
* ScrollTo
* Logging to console or alert
* Add a rule-method to the jQuery Validate plugin for defaultValue
* Functionality for defaultValue in text-inputs to clear and come back when an input get focused or blurred.

### Getting Started ###

To use the Utilities plugin, you have to include the jQuery library in your `<head>` tag of your HTML document or just above the closing `<body>`-tag.

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript" src="/js/jquery.glam.utilities.js"></script>
    <script type="text/javascript" src="/js/general.js"></script>
    </body>
    </html>

We will use the `general.js`-file for the specefic jQuery-code to call our plugin.

### Basic setup ###

    $(document).ready(function(){
        $.glamUtilities();
    });

Yes, it's so simple! The code above is pretty the same as this:

    $(document).ready(function(){
        $.glamUtilities({
            debug: false,
    		externalLinks: true,
    		externalClass: 'external',
    		defaultValueAsLabel: false,
    		validateDefaultValue: false
        });
    });

### More advanced setup ###

    $(document).ready(function(){
        $.glamUtilities({
            debug: false,
    		externalLinks: true, // when false the plugin will not add `attr('target','_blank')`
    		externalClass: 'otherNameForClassAtAllExternalLinks', // or false
    		defaultValueAsLabel: true, // or you can specify wich elements that has to change: `$("form input[type=text]")`
    		validateDefaultValue: false
        });
    });

## If you use the jQuery Validate plugin than this is handy ##

    $(document).ready(function(){
        $.glamUtilities({
      		validateDefaultValue: {
      		    name: 'RuleName',
      		    error: 'This is the error message for the rule'
      		}
        });
    });

You can also pass `true` and use the fallback name and error-message.

## How to log with the plugin ##

    $.glamLog('This is my message','DEBUG'); // DEBUG is the log-type, other: INFO, WARN, ERROR, LOG (default-type)

## How to use the ScrollTo function with the plugin ##

    $.glamScroll($("#top"), 200); //default 500ms

## How to use the Array unique function ##

    var myArray = [1,3,4,2,2,4];

    myArray.unique();

    // myArray is now [1,3,4,2]

## How to use the isset function (works only for global variables and jQuery objects) ##

	var $divs = jQuery('div');

	isset($divs) 			// true if there are div's in the page, false if there are not div's in the page
	isset($divs, false)		// true even if there are no divs
	isset($divs)			// false when $divs is not defined like above
	isset('myvariable')		// true if the variable is defined, false if not

## Issues/Bugs ##

If you find one, please inform us with the issue tracker on [github](http://github.com/glamorous/jQuery-Utilities/issues).

## Changelog ##

**0.3.0 - 13/01/2012**

- [feature] There is now a fallback method name and error message for the custom validator rule for defaultValue checking so you can pass `true` instead of an object with a method name and error message
- [bug] From now on the defaultValue works again for textarea's, this was removed in a cleanup in commit e10a6de3f and extra cleaning up some typo's and a `console.log()` (shame on me for this one!)

**0.2.0 - 05/09/2011**

- [feature] Added an isset function to test if a global variable or jQuery object exists

**0.1.3 - 18/05/2010**

- [feature] DefaultValue works now also with textareas

**0.1.2 - 09/04/2010**

- [bug] Unwanted console.log in the scroll function

**0.1.1 - 08/04/2010**

- Minified version of the plugin
- [feature] Ability to exclude the extra class for external links
- [feature] Ability to exclude the `attr('target','_blank')`

**0.1 - 07/04/2010**

- First release

## Feature Requests / To come ##

If you want something to add on this plugin, feel free to fork the project on [github](http://github.com/glamorous/jQuery-Utilities) or add an [issue](http://github.com/glamorous/jQuery-Utilities/issues) as a feature request.

## License ##

This plugin has a [BSD License](http://www.opensource.org/licenses/bsd-license.php). You can find the license in license.txt that is included with plugin-package

repository: glamorous/jQuery-Utilities

extension: markdown

repo_name: glamorous/jQuery-Utilities


text:
---
title: Sentry
menu: docs_patterns
weight: 1020
---

# Sentry Crash Reporting

[Sentry](https://sentry.io/) is a crash reporting system that supports the
failure crate which is the base of the actix error reporting.  With a
middleware it's possible to automatically report server errors to sentry.

# Middleware

This middleware captures any error in the server error range (500 - 599)
and sends the attached error to sentry with its stacktrace.

```rust
use actix_web::{HttpRequest, HttpResponse, Error};
use actix_web::middleware::{Middleware, Response};
use failure::Fail;
use sentry::with_client_and_scope;
use sentry::protocol::{Event, Level};
use sentry::integrations::failure::exception_from_single_fail;

/// Reports certain failures to sentry.
pub struct CaptureSentryError;

impl<S> Middleware<S> for CaptureSentryError {
    fn response(&self, _: &mut HttpRequest<S>, mut resp: HttpResponse)
        -> Result<Response, Error>
    {
        if resp.status().is_server_error() {
            if let Some(error) = resp.error() {
                report_actix_error_to_sentry(error);
            }
        }
        Ok(Response::Done(resp))
    }
}

pub fn report_actix_error_to_sentry(err: &Error) {
    with_client_and_scope(|client, scope| {
        let mut exceptions = vec![
            exception_from_single_fail(err.cause(), Some(err.backtrace())),
        ];
        let mut ptr: Option<&Fail> = err.cause().cause();
        while let Some(cause) = ptr {
            exceptions.push(exception_from_single_fail(cause, cause.backtrace()));
            ptr = Some(cause);
        }
        exceptions.reverse();
        client.capture_event(
            Event {
                exceptions: exceptions,
                level: Level::Error,
                ..Default::default()
            },
            Some(scope),
        )
    });
}
```

# Middleware Usage

To use the middleware the [sentry crate](https://crates.io/crates/sentry) needs to be
initialized and configured.  Additionally it makes sense to also register the panic handler
to be informed about hard panics.

```rust
extern crate sentry;

use std::env;

fn main() {
    sentry::init("SENTRY_DSN_GOES_HERE");
    env::set_var("RUST_BACKTRACE", "1");
    sentry::integrations::panic::register_panic_handler();

    let mut app = App::with_state(state)
        .middleware(CaptureSentryError)
        // ...
}
```

repository: mitsuhiko/actix-website

repo_name: mitsuhiko/actix-website


text:
# Cryptocurrencies website payment

This is an amazing website

This is a Python script to accept cryptocurrencies payment for website owner.

The program is very simple, It basically allow the website owner to creates DEPOSIT wallets for USERS or CLIENTS, and save them into a DATABASE.

It works with all the coins that use a BITCOIN core clone wallet client. The code published is based on CLAM coin.

I'm going to add new codes to this repository, to manage transactions to hot wallet, and to allow withdrawals to USERS or CLIENTS EXTERNAL WALLETS.

You need a local wallet installed an sync on your computer or on the server.
It uses subprocess library to call, and execture che -cli WALLET CONSOLE commands.


text:
# Typist

This is my CSE mini project for my second semester of undergrad. It is a command-line application that measures your typing speed and accuracy. This program only runs on *nix systems.

# Installation

1. Clone the repository using one of the following methods.
    - HTTPS: `git clone https://github.com/neelkamath/typist.git`
    - SSH: `git clone git@github.com:neelkamath/typist.git`
1. `cd typist`
1. `make -f makefile.make`

# Usage

1. `cd typist`
1. `./typist.out`

# Documentation

Persistent storage is implemented by saving and reading from `src/records.txt`.

# License

This project is under the [MIT License](LICENSE).

repository: standardgalactic/typist

repo_name: standardgalactic/typist


text:
---
title: Image Licenses
category: Features
order: 735
---

You can use the _License_ filter to get image search results that can be reused in various ways. The filter options are based on the [Creative Commons](https://creativecommons.org/about/cclicenses/) licensing system.

We have partnered with Bing to provide this feature. You can find more information about the filter options and related licenses [here](https://help.bing.microsoft.com/#apex/18/en-us/10006/0).

![Example usage of the image]({{ site.baseurl }}/images/image-license.png)

Neither Bing nor DuckDuckGo can verify or represent that a specific license is associated with an image or that you can use the image under that license. Before using an image, check the originating website to make sure you fully understand the license permissions and restrictions.


text:
# Sean's Webpage

Built off of the al-folio template: originally, **al-folio** was based on the [\*folio theme](https://github.com/bogoli/-folio) (published by [Lia Bogoev](http://liabogoev.com) and under the MIT license).

## Purpose

As a challenge to myself, I wanted to create and maintain my personal webspace provided by Drexel University: [Sean's Page](https://physics.drexel.edu/~slewis/). The hope is to use this as a professional blog/self-advertisement.

## Other

Currently a work in progress...

## Compiling and Publishing

On my machine, after making edits to website dependencies I need to compile using the blog-aware site generator jekyll (written in ruby): `bundle exec jekyll build`
Then, send the compiled site to the hosting server, in this case: Drexel University Physics Department's server. `scp -r {my_local_website_dir}/_site/* {cluster_username}@{cluster_url}:~{cluster_username}/public_html`

repository: seanlabean/seanWebpage

repo_name: seanlabean/seanWebpage


text:
# Specifications for the Sinatra Assessment

Specs:
- [x] Use Sinatra to build the app
The project was made using Sinatra framework for Ruby
- [x] Use ActiveRecord for storing information in a database
ActiveRecord is used for all models in this project.
- [x] Include more than one model class (list of model class names e.g. User, Post, Category)
5 models: Agency, Recruiter, Vacancy, RecruiterVacancy, Request.
- [x] Include at least one has_many relationship (x has_many y e.g. User has_many Posts)
For example, Recruiter has many Vacancies, Vacancy has many Recruiters.
- [x] Include user accounts
Both agencies and recruiters have user accounts. Both can log in. Only Agencies can Sign up and they can create new accounts for their Recruiters.
- [x] Ensure that users can't modify content created by other users
All validations were implemented to prevent private information rendering without appropriate permission.
- [x] Include user input validations
All validations were implemented.
- [x] Display validation failures to user with error message (example form URL e.g. /posts/new)
Users will will see all validation errors.
- [x] Your README.md includes a short description, install instructions, a contributors guide and a link to the license for your code
Done.


text:
# Single Page App SEO Renderer

The goal of this gem is to create a rack middleware that will re-request pages that come from a webcrawler and render them using a headless webkit driver (Capybara Webkit)

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'spa_seo_renderer'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install spa_seo_renderer

## Usage

Built for rails to work out of the box

The only caveat is that rails has a rack mutex that will block multiple request from being processed (which means this will hang until it hits a timeout) unless you set
```ruby
config.allow_concurrency = true
```

And you do not use WEBrick (which rails will enforce using the mutux if you do use). Thin, Puma, Nginx, Apache, etc work fine.

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

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


text:
[![Build Status](https://travis-ci.org/nespresso/ntaf.svg?branch=master)](https://travis-ci.org/nespresso/ntaf)
[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/5wsjr8by0lqsngw4/branch/master?svg=true)](https://ci.appveyor.com/project/racodond/ntaf/branch/master)
[![Quality Gate status](https://sonarcloud.io/api/badges/gate?key=ntaf)](https://sonarcloud.io/dashboard/index/ntaf)
[![npm version](https://badge.fury.io/js/ntaf.svg)](https://badge.fury.io/js/ntaf)

# Nestle Test Automation Framework (NTAF)

This framework is designed to help you get quickly started with test automation on any project.
It is based on [WebdriverIO](http://webdriver.io/) and [cucumber](https://cucumber.io/) ([cucumberJS](https://github.com/cucumber/cucumber-js) to be exact).
Integrating this module provides a ready-to-go environment to write and execute functional test scenarios.
It includes:
* A template to generate your test automation project so that you don't start from a blank page
* The necessary packages pre-configured to be able to run your scenarios without requiring any other setup. The only requirement is to have a browser on the machine running the tests: either Chrome or Firefox.
* [Guidelines and good practices](https://github.com/nespresso/ntaf/blob/master/template/doc/Framework.md) to ensure great maintainability of test scenarios
* A decoupled architecture between scenarios and data sets to allow high execution scalability
* Some useful [custom browser commands](http://webdriver.io/guide/usage/customcommands.html) such as `fillInForm` to ease and accelerate test automation writing. See related [JSDoc](https://nespresso.github.io/ntaf/) for more details.

This framework is suitable for big solutions that will be covered by an important number of scenarios.
Note that it requires good development skills as well as good knowledge and understanding of JavaScript.

## Integrating NTAF to Your Project

### Prerequisites
* Install Node.js v6.10.3 or greater.

### Adding NTAF Package and Configuration to Your Project
1. Create a new folder <AUTOMATED_TESTS> in your project to host your automated tests.
2. Add a `package.json` file into <AUTOMATED_TESTS> based on the below model:
```
{
    "name": "my-automated-tests",
    "version": "1.0.0",
    "dependencies": {
      "ntaf": "X.X.X",
      "grunt": "1.0.1"
    },
    "scripts": {
      "clean": "grunt clean",
      "generate-local-conf": "grunt copy:generateLocalConf",
      "prepare": "grunt prepare",
      "test": "grunt test-functional",
      "test-local": "grunt test-functional-local",
      "test-debug": "grunt test-functional-debug",
      "test-unit": "grunt test-unit",
      "test-unit-with-coverage": "grunt test-unit-with-coverage"
    },
    ...
}
```
3. Install the project dependencies by running the following command from <AUTOMATED_TESTS>: `npm install`. It creates a `node_modules` directory containing all the dependencies needed to run the project.
4. From <AUTOMATED_TESTS>, run `./node_modules/.bin/ntaf install` to generate the skeleton of your test project.

### Behind a Proxy
Set the configuration of your proxy by editing the `.npmrc` file in your home directory:
```
proxy=http://localhost:3128
https-proxy=http://localhost:3128
```

## Running Tests
Run `npm run test` to launch the tests as they would be played remotely.
By default it runs all the tests tagged as `@nrt`.

Run command line `npm run test-local` to run the tests with your local configuration.
Note that the local configuration has to be generated first (see Configuration section).

### Configuration
The global configuration is set in the `wdio.conf.js` file in the root folder of your project.

The local configuration is set in the `wdio.local.conf.js`. This local configuration can be reset by running `npm run generate-local-conf`.

### Parameters
To pass parameters to the command, add `--`: `npm run test -- --parameter1=value1`

#### URL of the Website to Test
Add command line parameter `--baseUrl="https://base.url"` or update the wdio configuration file accordingly.

#### Locale
Add command line parameter `--locale="en"` or update the wdio configuration file accordingly.

#### Running a Subset of Tests Using Tags
Add command line parameter `--tags='@tag'`.
You can add several tags separated by commas such as `--tags='@tag1,@tag2'`. It will run tests with tags `@tag1` and `@tag2`.
You can also add negation with `~` such as`--tags='@tag1,~@tag2'`. It will tests with tag `@tag1` but not `@tag2`.

#### Realm (market, brand, environment, ...)
A realm is a configuration file that defines some wdio properties specific to a realm. A realm can be seen as a market,
a brand, an environment (such as dev or staging), etc. or a combination of them. Realm files are stored in the
`conf/realm` directory.

Usually realms define at least the following properties:
* `baseUrl`: website to test
* `specs`: list of features to run

Add command line parameter `--realm="xxx"`. Where `xxx` is the file name in `conf/real` without the `.js` extension.

For example:
* To run NRT tests from the catalog domain on mywebsite.com: `npm run test -- --baseUrl="https://mywebsite.com" --tags='@nrt,@catalog'`
* To run NRT tests on realm `us_dev`: `npm run test -- --realm="us_dev" --tags='@nrt'`

## Running Tests in Debug Mode

### Initial Configuration

#### Installing node-inspector
1. Install `node-inspector`: `npm install -g node-inspector`

#### Setting Configuration in IntelliJ
1. Go to Run > Edit Configurations...
1. Add New Configuration > Node.js Remote Debug and fill in details as follows:
![alt text](https://raw.githubusercontent.com/nespresso/ntaf/master/template/doc/resources/intellij-debug-configuration.png "Name: My Node.js Remote Debug / Host: <IP_ADDRESS> / Port: 5859")

### Running Tests
1. In a terminal, run `node-inspector`. The following should be printed:
`Node Inspector v0.12.8
 Visit http://<IP_ADDRESS>:8080/?port=5858 to start debugging.
`
1. In IntelliJ, Run > Debug 'My Node.js Remote Debug'
1. In IntelliJ, add breakpoints to your code
1. In a terminal, run `npm run test-debug` (usually targeting a single test: `npm run test-debug -- --tags='@mytest'`). Note that the local debug configuration has to be generated first (see Configuration section).
1. Once the first breakpoint is reached, use standard IntelliJ Debug window to move forward and debug.

## Writing Automated Tests
Read detailed explanations in [Framework.md](https://github.com/nespresso/ntaf/blob/master/template/doc/Framework.md).

repository: lzbair/ntaf

repo_name: lzbair/ntaf


text:
---
title: Proxy Engine Documentation

language_tabs: # must be one of https://git.io/vQNgJ
  - javascript

toc_footers:
  - Proxy Engine

includes:
  - errors

search: true
---

# Introduction
Welcome to the Proxy Engine Docs! Proxy Engine is an Open Source Node.js Framework created by the team at [Cali Style Technologies](https://cali-style.com).

## What is Proxy Engine?
Proxy Engine is a modern backend scaffold for node applications built on the flexibility and speed of [trails.js](http://trailsjs.io) which means extending it is easy and intuitive.

Proxy Engine acts as an event management engine for a highly scalable and expandable architecture. It's "event protocol" allows for "plugins" to be easily implemented or ripped out to lighten the burden on development costs without sacrificing ease of use and scalability.

## 4 Core Features
The goals of Proxy Engine is to be a free form scaffold that focuses on modern enterprise grade applications and testability. Each of these Core Features can be managed via a Worker Profile, allowing you to easily create micro services, or worker instances of your app.

Proxy Engine marshals 4 Core Features:

### Events
Events are either emitted or consumed, if an event handler fails, it can retired based on "retry rules". In short:
- Publish
- Subscribe
- Retry

A single Published Event can be consumed by an infinite amount of Subscribers. Subscribers that fail can have an infinite amount of Retries. This can be handy for fixing a bug post morten or if a 3rd party service is unavailable.  Events are optionally stored in a database as a "Recorded History". Any event that fails is automatically stored, as well as any retry attempts.

### Tasks
Tasks are long running scripts that are processed in a que. For example: processing a video or crunching a large data set. Tasks can publish events, but not consume them. However, an event can trigger the creation of a new task.

### Timed Jobs (Cron Jobs)
Timed Jobs are scrips that process at specific times.  For example, once an hour, every day at noon, every 3rd wednesday of a month, etc. Timed Jobs can publish events, but not consume them. However, an event can enable or disable a Timed Job. Under the hood, Proxy Engine uses [Node Schedule](https://www.npmjs.com/package/node-schedule) to define when the jobs will be run.

### Error Management
Error Management is one of the most important things to remember in development, especially for Node.js applications. Under the hood, Proxy Engine uses [Boom](https://www.npmjs.com/package/boom) to define errors throughout the APIs.

# Plugins
Plugins are actually Trails.js "Trailpacks" that are built specifically for Proxy Engine.  However, since a Proxy Engine app is at it's core a Trails App, an extensive amount of trailpacks can easily be used.

Currently in the Proxy Engine ecosystem and actively maintained by Cali Style:

*WIP is a Work In Progress

- [Proxy-Sequelize](https://github.com/calistyle/trailpack-proxy-sequelize) The default ORM for all Proxy Engine Apps.
- [Proxy-Router](https://github.com/calistyle/trailpack-proxy-router) The Content Router with built in AAA Testing (WIP)
- [Proxy-Cart](https://github.com/calistyle/trailpack-proxy-cart) A robust eCommerce Backend
  * [Proxy-Cart-Countries](https://github.com/calistyle/trailpack-proxy-cart-countries) Default Tax Rate Provider and Shipping Zones validator.
- [Proxy-Email](https://github.com/calistyle/trailpack-proxy-email) A robust Email Management System.
- [Proxy-Notifications](https://github.com/calistyle/trailpack-proxy-notifications) A robust Notifications System that works with Proxy Email.
- [Proxy-CMS](https://github.com/calistyle/trailpack-proxy-cms) A robust Content Management System (WIP)
- [Proxy-Analytics](https://github.com/calistyle/trailpack-proxy-analytics) A robust Analytics System (WIP)
- [Proxy-Sitemap](https://github.com/calistyle/trailpack-proxy-sitemap) A robust Sitemap Builder (WIP)
- [Proxy-Social](https://github.com/calistyle/trailpack-proxy-social) A robust Social network (WIP)
- [Proxy-Permissions](https://github.com/calistyle/trailpack-proxy-permissions) A robust ERP level Permissions Systems and Access Control List (ACL)
- [Proxy-Generics](https://github.com/calistyle/trailpack-proxy-generics) An adapter protocol for common functions
  * [Stripe.com Payment Processor](https://github.com/CaliStyle/proxy-generics-stripe)
  * [Authorize.net Payment Processor](https://github.com/CaliStyle/proxy-generics-authorize.net) (WIP)
  * [GoShippo.com Shipping/Fulfillment Processor](https://github.com/CaliStyle/proxy-generics-shippo) (WIP)
  * [Shipstation.com Shipping/Fulfillment Processor](https://github.com/CaliStyle/proxy-generics-shipstation) (WIP)
  * [Taxjar.com Tax Processor](https://github.com/CaliStyle/proxy-generics-taxjar) (WIP)
  * [Mandrill Email Provider](https://github.com/CaliStyle/proxy-generics-mandrill)
  * [Gcloud Data Store Provider](https://github.com/CaliStyle/proxy-generics-gcloud) (WIP)
  * [Google Maps Geolocation Provider](https://github.com/calistyle/proxy-generics-google-maps) (WIP)
  * [Cloudinary Image Provider](https://github.com/calistyle/proxy-generics-cloudinary) (WIP)
  * [Render Service](https://github.com/calistyle/proxy-generics-render) for rendering HTML or Markdown

# Example App
We created a boiler plate to get you started
[Proxy Engine Example](https://github.com/CaliStyle/proxy-engine-example)

# Dependencies
## Supported ORMs
| Repo          |  Build Status (edge)                  |
|---------------|---------------------------------------|
| [trailpack-proxy-sequelize](https://github.com/trailsjs/trailpack-proxy-sequelize) | [![Build status][ci-sequelize-image]][ci-sequelize-url] |

## Supported Webserver
| Repo          |  Build Status (edge)                  |
|---------------|---------------------------------------|
| [trailpack-express](https://github.com/trailsjs/trailpack-express) | [![Build status][ci-express-image]][ci-express-url] |

# Installation
To install Proxy Engine:

$ npm install trailpack-proxy-engine

If you are using Trail's yo generator:

$ yo trails:trailpack trailpack-proxy-engine

# Configuration
To configure Proxy Engine is simple, there are only 2 files to create/modify:

## config/main.js
> config/main.js

```javascript
module.exports = {
  packs: [
    // ... other trailpacks
    require('trailpack-proxy-engine')
    // ... other proxy-packs
  ]
}
```
Like all Trails' trailpacks, it must be included in the `config/main.js` file.

## config/proxyEngine.js
> config/proxyEngine.js

```javascript
module.exports = {
  // If the app is in live mode
  live_mode: true,
  // If every event should be saved automatically
  auto_save: false,
  // The worker env profile for this app
  profile: 'testProfile',
  // Configure Cron Jobs
  crons_config: {
    // If a Cron class has a 'schedule' method, automatically call it on config.
    auto_schedule: true,
    // Delay when cron jobs are allowed to start being processed in seconds
    uptime_delay: 180,
    // The profiles that are able to run specified crons
    profiles: {
      // If the worker matches `testProfile`, then it's crons can run
      testProfile:  ['onTestCron.test'],
      // If the worker matches `otherProfile`, then it's crons can run
      otherProfile: ['otherTestCron.test']
    }
  },
  // Configure Events
  events_config: {
    // if the Event class has a 'subscribe' method, automatically call it during config.
    auto_subscribe: true,
    // The profiles that are able to run specified events
    profiles: {
      // If the worker matches `testProfile`, then it's events can run
      testProfile:  ['onTestEvent.test'],
      // If the worker matches `otherProfile`, then it's events can run
      otherProfile: ['otherTestEvent.test']
    }
  },
  // Configure Tasks
  tasks_config: {
    // The profiles that are able to run specified tasks
    profiles: {
      // If the worker matches `testProfile`, then it's tasks can run
      testProfile: ['TestTask'],
      // If the worker matches `otherProfile`, then it's tasks can run
      otherProfile: ['OtherTestTask']
    }
  }
}
```
Also, Proxy Engine takes it's own config in the `config/proxyEngine.js` file.

### Config Parameters

Parameter | Type | Default | Description
--------- | ---- | ------- | -----------
live_mode | Boolean | false | If the app is in live mode
auto_save | Boolean | false | If every Event should be saved
profile | String | null | The name of this App Instance's profile
crons_config | Object | {} | The configuration of the Timed Jobs (Cron Jobs)
events_config | Object | {} | The configuration of the Events
tasks_config | Object | {} | The configuration of Tasks.

# Tutorial: Event
Proxy Engine events are contained into __two__ base categories: Instance, Global.

Events should always return a promise and resolve (succeed) and return a value or they should reject (throw an error) which will trigger a retry on the burn down schedule.

## Instance Events
Instance Events are events that __only a single instance__ in a cluster must deal with. The overwhelming majority of events fall into this category. Mostly, database events, service events etc.

## Global Events (TODO)
Global Events are events that __every instance__ in a cluster must respond to. Very few events fall into this category. Mostly, global settings changes, plugin updates, notifications, etc. This requires redis.

Events make it easy to extend functionality without having to edit or change the core of any Proxy Engine Module.

## Subscribing to Events
Subscribe takes three arguments:

Argument | Type | Default | Description
-------- | ---- | ------- | -----------
callAgainLocation | String | NONE | The location of the Callback function in dot notation eg. `onCustomer.created`. This is used when the first try of the event fails.
eventName | String | NONE | The name of the event to subscribe to eg. `customer.created`
func | Function | NONE | The function to execute when this event happens.

NOTE: Proxy Engine will automatically run the subscribe method for your events if you provide a `subscribe` method in your event handler.

## Automatically Subscribing From Profile
> Example Profile Config: app/config/proxyEngine.js

```javascript
module.exports = {
  // ... other configuration
  profile: 'testProfile',
  events_config: {
    profiles: {
      testProfile: [
        'onTestEvent.test3',
        'onTestEvent.test4'
      ],
      otherProfile: [
        'onTestEvent.test'
      ]
    }
  }
}
```
Alternatively, you can let your profile decide what events it will subscribe to:

## Subscribing from a Service
> Subscribe to an Event from a Service

```javascript
// From some service in your app
const ProxyEngineService = this.app.services.ProxyEngineService
// Create a token that you can use later.
const token = ProxyEngineService.subscribe('callAgainLocation', 'eventName', callback)
```
Also Alternatively, you can subscribe to an event in a service.

## Unsubscribe from an Event

> Unsubscribe to an Event from a Service

```javascript
// continued from above
ProxyEngineService.unsubscribe(token)
```
Once subscribed, to unsubscribe just call the unsubscribe method using the token it was created with.

## Creating Event functions
Create events in the `/api/events` directory.

#### Subscribe

> Example: api/events/onTestEvent.js

```javascript
const Event = require('trailpack-proxy-engine').Event
module.exports = class onTestEvent extends Event {
  // Subscribe Method is called during the Configuration of the trailpack, regardless of worker profile.
  subscribe() {
    this.app.services.ProxyEngineService.subscribe('onTestEvent.test','test', this.test)
    this.app.services.ProxyEngineService.subscribe('onTestEvent.test2','test2', this.test2)
  }

  test(msg, data, options) {
    // This function will be run when a `test` event is published
    return Promise.resolve()
  }
  test2(msg, data, options) {
    // This function will be run when a `test2` event is published
    return Promise.reject()
  }
}
```

The `subscribe()` method method has reserved functionality and is intended to automatically subscribe instances regardless of their worker profile.
This functionality can be disabled by setting `config.proxyEngine.events_config.auto_subscribe` to false.

It's possible to have an instance level cron job gather information from a remote site and change the instance by publishing and event that it is automatically subscribed to.

# Tutorial: Task
While event functions respond to events, tasks initiate functions allowed on a specific worker. A common use of a task is a micro-service or a worker environment for example, processing video or any other significant process that should be segregated out to a more adapt worker environment.

## Creating Task functions
Create tasks in the `/api/tasks` directory.

```javascript
TODO
```

# Tutorial: Timed Job (Cron)

## Creating a Cron
Create cron jobs in the `/api/crons` directory. Cron Jobs use [node-schedule](https://www.npmjs.com/package/node-schedule) and are configured per worker profile.

Using the `uptime_delay` in the `crons_config` can also allow you to delay when cron jobs start to be scheduled. This is useful for when you have an app instance that starts while another is gracefully being shut down.

### Schedule Method
> Example: api/crons/onTestCron.js

```javascript
module.exports = class onTestCron extends Cron {
  // Schedule Method is called during the Configuration of the trailpack
  // Schedule method is reserved to automatically do something regardless of profile.
  schedule() {
    this.test()
  }
  test() {
    console.log('I have been scheduled')
    const j = this.scheduler.scheduleJob('42 * * * *', () => {
      console.log('The answer to life, the universe, and everything!')
    })
  }
}
```
The `schedule()` method has reserved functionality and is intended to automatically schedule other tasks regardless of worker profile.  This is useful for cron jobs that do instance level maintenance. It is not recommended to be used for cron jobs that perform global operations.

This feature can be disabled by setting `config.proxyEngine.crons_config.auto_schedule` to false.

NOTE: If a Cron fails, it is not automatically retried. If you want parts of your cron job to retry automatically, you will need publish them as an event and consume them as a subscriber.

# API: Endpoints

```json
[{
    method: ['GET'],
    path: '/events',
    handler: 'EventController.findAll',
    config: {
      validate: {
        query: {
          offset: joi.number(),
          limit: joi.number(),
          where: joi.object(),
          sort: joi.array().items(joi.array()),
        }
      },
      app: {
        proxyRouter: {
          ignore: true
        },
        proxyPermissions: {
          resource_name: 'apiGetEventsRoute',
          roles: ['admin']
        }
      }
    }
},
{
    method: ['POST'],
    path: '/event',
    handler: 'EventController.create',
    config: {
      app: {
        proxyRouter: {
          ignore: true
        },
        proxyPermissions: {
          resource_name: 'apiPostEventRoute',
          roles: ['admin']
        }
      }
    }
},
{
    method: ['GET'],
    path: '/event/:id',
    handler: 'EventController.findOne',
    config: {
      validate: {
        params: {
          id: joi.string().required()
        }
      },
      app: {
        proxyRouter: {
          ignore: true
        },
        proxyPermissions: {
          resource_name: 'apiGetEventIdRoute',
          roles: ['admin']
        }
      }
    }
}]
```

## GET /events
Get a list of Events

Parameter | Type |  Description
--------- | ---- |  -----------
offset | Integer | The offset of records
limit | Integer | The limit of records to return
where | Object | The criteria for records to match
sort | Array | Sequelize order for records to be returned

## POST /event
Create a new Event.

Parameter | Type |  Description
--------- | ---- |  -----------

## GET /event/:id
Get an Event by ID

Parameter | Type |  Description
--------- | ---- |  -----------
id | Integer | The ID of the event

# API: Controllers

## EventController

# API: Crons
> Example api/crons/index.js

# API: Events
> Example api/events/index.js

```javascript
exports.myEvent = require('./myEvent')
```
Create new Event handlers in the `api/events` directory

# API: Models

## Event
Attribute | Type | Default | Description
--------- | ---- | ------- | -----------

## EventSubscribers
Attribute | Type | Default | Description
--------- | ---- | ------- | -----------

# API: Services
## ProxyEngineService

# API: Tasks

[ci-sequelize-image]: https://img.shields.io/travis/trailsjs/trailpack-proxy-sequelize/master.svg?style=flat-square
[ci-sequelize-url]: https://travis-ci.org/trailsjs/trailpack-proxy-sequelize

[ci-express-image]: https://img.shields.io/travis/trailsjs/trailpack-express/master.svg?style=flat-square
[ci-express-url]: https://travis-ci.org/trailsjs/trailpack-express

repository: CaliStyle/proxy-engine-docs

repo_name: CaliStyle/proxy-engine-docs


text:
---
layout: default
title: A new car experience - costs in Brazil
tags: car cost brazil brasil
comments: true
---
# A new car experience - costs in Brazil

I am not much of a connoisseur of cars. I like any car, as long as it has a good fuel economy and is reliable. The first time I bought a new car, not a used car, was two years back, a beautiful black Siena Fire model 2008 from Fiat.

There was much to like about that car, at least as far as the criteria I mentioned earlier is concerned. The fuel economy with Ethanol was almost always around seven kilometers per litre or about sixteen miles per gallon. With Gasoline it achieved about ten kilometers per litre, or about twenty three miles per gallon, under typical city driving conditions with the average speed well within twenty kilometers per hour, and with the air conditioner used often.

I almost always used Ethanol, which cost about one Brazilian Real and seventy five cents circa 2008. Flex cars, as cars that use both Ethanol and Gasoline or their mixture are called in Brazil, go about seventy percent the distance with Ethanol. So, long as its per litre price is under seventy percent of that of gasoline, it makes economic sense to use Ethanol.

Cars, like most other consumer goods, are pretty expensive in Brazil. The Siena model 2008 made me poorer by about forty thousand Brazilian Reals, over a period of two years. That is about twenty thousand US dollars, or eight hundred thousand (8 lac) Indian Rupees. Similar cars cost about half as much in the United States or India.

Of the total cost of the car about nineteen thousand Brazilian Reals was paid over two years, fourteen thousand of that value was the principal and five thousand was the interest. That translates to about nineteen percent interest per annum. At that rate you would pay for another car in four years. Car loans need to be avoided like the plague.

Then suddenly, about three days before my thirty-fifth birthday, we suffered a pretty bad traffic accident. Luckily none in the car suffered serious injuries, but the car itself was damaged beyond repair. The only setback was financial - as mentioned before, cars are expensive in Brazil. I have since purchased a beige Fiat Siena model 2010. That car will set my wallet lighter by another forty thousand Brazilian Reals. A similar but better car in India would cost me about twenty five thousand Brazilian Reals.

So why are cars in Brazil so expensive?

Here are some facts

* The federal government taxes the manufacturer at about ten percent for a 1000 cc car, it can be as much as twenty five percent for higher-end cars

* Most Brazilian states tax consumer goods at twenty percent or higher

* Almost all transportation happens by trucks over roads that are poorly maintained

* The total amount of taxes and other costs for hiring an employee can be equivalent to the salary paid

In-spite of it all, the manufacturers themselves earn hefty profits. In these days when manufactures around the world are either in the red or just surviving, most manufactures in Brazil are earning hefty profits.

The Brazilian consumer, obviously, pays for it all.

gha_language: Ruby


text:
# Minesweeper
A Java replica of the classic Microsoft Minesweeper game in MacOS! :bomb:

[Wikipeida](https://en.wikipedia.org/wiki/Microsoft_Minesweeper)

Created by <b>Jensen</b> on June 28th, 2017

---

### Features

- Play three gamemodes (Easy, Medium, Hard)
- Custom board feature
- Save Highscores
- Take screenshots of gameplay :camera:
- Flag shop
- And Much More!

### Download

Only MacOS at the moment

![Status](https://travis-ci.org/CaptainJensen/Minesweeper.svg?branch=master)

Download above or [HERE](https://github.com/CaptainJensen/Minesweeper/releases)

Current version: <b> v<IP_ADDRESS>-beta

### Pictures!

![Preview gameplay](preview.png)
![Preview gameover](preview2.png)
![Preview gamehard](preview3.png)

repository: CaptainJensen/Minesweeper

gha_language: Java

repo_name: CaptainJensen/Minesweeper


text:
# Machine Learning Algorithms - Simple and Naive Implementation

As a software engineer with not that strong math background, I had a great difficulty in understanding ML algorithms. It may take me only several minutes to know what an algorithm looks like, but it really takes some time to understand the further details. As a way of learning, I decided to implement some basic ml algorithms from scratch, and this project is the result.

The API is merely a copy from scikit-learn (~~and Keras~~). There’s no parameter check nor any optimization. I tried to focus on the most simple and naive part of these algorithms and keep the code as “dense” as possible.

Currently implemented algorithms are as follows:

* Supervised
  * [LinearRegression](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/linear_model.py#L38)
  * [Ridge](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/linear_model.py#L110)
  * [Lasso](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/linear_model.py#L119)
  * [ElasticNet](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/linear_model.py#L128)
  * [LogisticRegression](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/linear_model.py#L139)
  * [MLPClassifier](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/neural_network.py#L6)
  * [DecisionTree](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/tree.py)
  * [SVM](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/svm.py)
  * [GaussianNB](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/naive_bayes.py#L5)
  * [KNeighborsClassifier](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/neighbors.py#L5)
  * [BaggingClassifier](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/ensemble.py#L8)
  * [AdaBoostClassifier](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/ensemble.py#L102)
  * [GradientBoostingClassifier](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/ensemble.py#L191)
  * [LinearDiscriminantAnalysis](https://github.com/Sacry/mla_sani/blob/master/mla_sani/supervised/discriminant_analysis.py#L5)
* Unsupervised
  * [KMeans](https://github.com/Sacry/mla_sani/blob/master/mla_sani/unsupervised/cluster.py#L5)
  * [DBSCAN](https://github.com/Sacry/mla_sani/blob/master/mla_sani/unsupervised/cluster.py#L53)
  * [PCA](https://github.com/Sacry/mla_sani/blob/master/mla_sani/unsupervised/decomposition.py)
  * [GaussianMixture](https://github.com/Sacry/mla_sani/blob/master/mla_sani/unsupervised/mixture.py#L6)
* DL Layers
  * [Dense](https://github.com/Sacry/mla_sani/blob/master/mla_sani/nn/layers.py#L64)
  * [Activation](https://github.com/Sacry/mla_sani/blob/master/mla_sani/nn/layers.py#L107)
  * [Conv2D](https://github.com/Sacry/mla_sani/blob/master/mla_sani/nn/layers.py#L138)
  * [MaxPooling2D](https://github.com/Sacry/mla_sani/blob/master/mla_sani/nn/layers.py#L376)
  * [Flatten](https://github.com/Sacry/mla_sani/blob/master/mla_sani/nn/layers.py#L360)
  * [Dropout](https://github.com/Sacry/mla_sani/blob/master/mla_sani/nn/layers.py#L480)

The traditional ML algorithms are implemented in the way that it can be used just like scikit-learn,

```python
import numpy as np
from sklearn.datasets import load_boston

# from sklearn.linear_model import LinearRegression
# from sklearn.model_selection import train_test_split
# from sklearn.metrics import mean_absolute_error
# from sklearn.preprocessing import StandardScaler

from mla_sani.supervised.linear_model import LinearRegression
from mla_sani.model_selection import train_test_split
from mla_sani.preprocessing import StandardScaler
from mla_sani.metrics import mean_absolute_error

data = load_boston()
X, y = data.data, data.target
X_train, X_test, y_train, y_test = train_test_split(X, y)

scaler = StandardScaler().fit(X_train)
X_train, X_test = scaler.transform(X_train), scaler.transform(X_test)

model = LinearRegression().fit(X_train, y_train)
y_pred = model.predict(X_test)
print(mean_absolute_error(y_test, y_pred))
```

while the DL algorithms are implemented in the way that it just looks like simplified Keras

```python
import numpy as np
from sklearn.datasets import load_digits

from mla_sani.model_selection import train_test_split
from mla_sani.metrics import confusion_matrix

from mla_sani.nn.layers import Input, Conv2D, Activation, Dropout, Flatten, Dense
from mla_sani.nn.models import Sequential
from mla_sani.nn.optimizers import Adam
from mla_sani.losses import CategoricalCrossEntropy

data = load_digits()
X, y = data.data.reshape(-1, 8, 8, 1), data.target
X_train, X_test, y_train, y_test = train_test_split(X, y)

cnn = Sequential()
cnn.add(Input(X.shape[1:]))
cnn.add(Conv2D(16, (3, 3), padding='same'))
cnn.add(Activation('relu'))
cnn.add(Dropout(rate=0.1))
cnn.add(Flatten())
cnn.add(Dense(10))
cnn.add(Activation('softmax'))

cnn.compile(optimizer=Adam(), loss=CategoricalCrossEntropy(labels=np.unique(y)))
cnn.fit(X_train, y_train, epochs=30, batch_size=128)
y_pred = cnn.predict(X_test).argmax(axis=1)
print(confusion_matrix(y_test, y_pred))
```

Hopefully, this project could help some engineers who are not that good at math,  but know coding well and are tring to grasp these algrithms as quick as possible.


text:
# Documentation

This document describes the process that automatically generates the documentation using Travis CI.

## How it works

Here's a general overview of how things work:

1. A commit is pushed to the repository
2. Travis CI starts a build
3. Main script runs (run unit tests)
4. If main script fails, build exits
5. `./scripts/deploy_docs_to_gh_pages.sh` script is run
6. If commit message does not contain the string `[build-docs]`, build exits
7. Output of `gulp dgeni` is committed to gh-pages branch
8. `docs/*.css` are added to `gh-pages` branch as well
9. `gh-pages` branch is pushed back to GitHub
10. GitHub updates statically hosted documentation on `angular.github.io`.

## Configuration

To provide Travis CI with rights to deploy the newly generated documentation to GitHub, we need to provide it with a GitHub token that represents an account that has sufficient rights to push to the repository.

#### Step 1: create a GitHub token

To generate a new personal access token in GitHub, go to *Personal settings / Applications* and click on *Generate new token* in the *Personal access tokens* section of the page.

Give it an appropriate description such as "Documentation deployment token for router" so you can later identify the token again in case you no longer need it and want to remove it.

Finally copy the generated token that GitHub presents on your screen. It is important to copy it right now because it is only shown once and you'll have to regenerate a new one if you forget it.

#### Step 2: tell Travis to use the token

Travis offers a really convenient feature where it lets you define environment variables to customize the build process.

What's more is that it even lets you encrypt these variables so you can add sensitive information to `.travis.yml` without having to worry about others seeing the file.

To add encryped environment variables to your `.travis.yml` file, you can:

```sh
$ gem install travis
$ cd <repository-directory>
$ travis encrypt GITHUB_TOKEN=<secret-token-from-step-1> --add
```

> On Mac OS X, if `gem install travis` fails, you may have to install the latest version of Ruby first by running: `brew install ruby`.

This will add a line to the `.travis.yml` file that looks like this:

```sh
secure: <encryped string>
```

When Travis runs the deployment script, it will decrypt the encrypted value and make it available as a regular environment variable so we can conveniently access the original GITHUB_TOKEN again from within the deployment script.

That's it! Save and commit the updated `.travis.yml` file.

## Deploying manually

If required, the documentation can also be generated and deployed to GitHub pages from your local machine.

You need to specify the GITHUB_TOKEN manually like this:

```sh
$ GITHUB_TOKEN=<github-token> ./scripts/deploy_docs_to_gh_pages.sh
```

> **Attention**: It is not recommended to run the deployment script locally if you don't know what you are doing. The scripts is written to run on Travis CI in a VM where code can be deleted without repercussions. Make sure you don't have unsaved work that has not been committed and pushed to GitHub to prevent unwanted code loss in case something goes wrong.

## Change log

#### 2015-03-15

- added support for commit message filtering
- updated documentation

#### 2015-03-14

- added dgeni exception handler
- updated documentation

#### 2015-03-13

- initial version

repository: AyogoHealth/router

repo_name: AyogoHealth/router


text:
ByExTopopt
=========

Code for our paper:

> [Structure and Appearance Optimization for Controllable Shape Design][1]

> Jonàs Martínez, Jérémie Dumas, Sylvain Lefebvre, Li-Yi Wei

> ACM Transactions on Graphics (TOG) — Proceedings of ACM SIGGRAPH Asia 2015

> Volume 34 Issue 6, December 2015

[1]: https://sites.google.com/site/jonasmartinezbayona/structure_appearance

Dependencies
------------

- Python 2 or 3
- [NLopt](http://ab-initio.mit.edu/wiki/index.php/NLopt)
- Numpy
- Matplotlib
- [CVXOPT](http://cvxopt.org/)
- [PyOpenCL](https://mathema.tician.de/software/pyopencl/)

You need to compile and install NLopt with its Python bindings. Moreover, you will also need PyOpenCL to run the OpenCL PatchMatch code used by the appearance function. Cholmod (through CXVOPT) is used for the solving the linear system in the FEM elasticity problem. MMA (through NLopt) is used to solve the constrained non-linear minimization problem.

Usage
-----

```
python main.py input/l_beam.json output.png
```

![](doc/top.gif?raw=true) ![](doc/tex.gif?raw=true)

License
-------

The code in this project is distributed under MIT license.
The topology optimization code used in this project is based on the Python implementation of the SIMP method available on the [DTU TopOpt](http://www.topopt.dtu.dk/?q=node/881) research group.
We also use a modified version of [OpenCL implementation](https://github.com/abiusx/CLPatchMatch) of PatchMatch by @abiusx.

Acknowledgments
---------------

This work was supported by ERC grant ShapeForge (StG-2012-307877) and general research fund Dynamic Element Textures (HKU 717112E).

repository: jomorlier/byextopopt

repo_name: jomorlier/byextopopt


text:
=== HEAD

=== 0.7.0 (September 3, 2013)

* Rewrite comments
* `bits-space-gutter-supported-children` now takes asterisk `*`, `li` and class
selectors without the dot `.`
* Add usage to README

=== 0.6.0 (September 2, 2013)

* Add new `u-gutterXx` utilities
* Add new `u-stretchXx` utilities
* Optimize rules generator
* Add demo page
* Add new `u-collapse[Top|Bottom]` utilities
* Add namespace var before `u-collapse[Top|Bottom]`
* Use new style for comments

=== 0.5.0 (August 25, 2013)

* Add !important to all rules

=== 0.4.0 (July 20, 2013)

* Rename organization's name to 'Bits.sass'
* Refactor variables

=== 0.3.0 (July 14, 2013)

* Rename organization's name to 'Bits.scss'
* Rename `bits-ns` var to `bits-utils-ns`

=== 0.2.0 (July 14, 2013)

* Finish the README file
* Edit _space.scss comments

=== 0.1.0 (July 9, 2013)

* Initial public release.

repository: bits-sass/utils-space

repo_name: bits-sass/utils-space


text:
# Virtual lists

`react-beautiful-dnd` supports drag and drop within and between virtual lists. This lets you have fantastic performance with very large data sets. As a general rule, you will want to start using a virtual list when your list size is more than 500 items.

![virtual-board](https://user-images.githubusercontent.com/2182637/66453948-e0044d00-eab1-11e9-88db-3e5165dde69b.gif)

## Background: what are virtual lists?

A "virtual list" is the name given to a _windowing_ performance optimisation technique where only the **visible** list items are rendered. See [Rendering large lists with react-window](https://addyosmani.com/blog/react-window/) by Addy Osmani for more background on virtual lists

> Diagram from [Creating more efficient React views with windowing](https://bvaughn.github.io/forward-js-2017/#/0/0) by Brain Vaughn

There are drawbacks with using virtual lists. They stem from the fact that with a virtual list not all of the page content is rendered into the DOM.

- Accessibility: screenreaders cannot read out all of the content of a page
- Findability: native find (meta + f) will not find things that are not rendered in the DOM.

## Support

`react-beautiful-dnd` is designed to work with existing virtual list solutions and does not have it's own virtual list abstraction. There is no official "virtual list" specification or implementation for the web. Different virtual list libraries achieve windowing through various techniques. So we cannot guarentee that `react-beautiful-dnd` will work with every virtual list library. We have created examples for `react-window` and `react-virtualized` which are the two most popular virtual list libraries for `react`.

## Premade examples 🎁

Please raise a pull request if you would like to add examples for other virtualization libraries! ❤

### [`react-window`](https://github.com/bvaughn/react-window)

- [List](https://react-beautiful-dnd.netlify.com/?path=/story/virtual-react-window--list) ([source](/stories/src/virtual/react-window/list.jsx))
- [Board](https://react-beautiful-dnd.netlify.com/?path=/story/virtual-react-window--board) ([source](/stories/src/virtual/react-window/board.jsx))
- [Basic list on `codesandbox.io`](https://codesandbox.io/s/simple-virtual-list-dark-c6wqc)
- [Basic board on `codesandbox.io`](https://codesandbox.io/s/simple-virtual-list-board-vgvzt)

### [`react-virtualized`](https://github.com/bvaughn/react-virtualized)

- [List](https://react-beautiful-dnd.netlify.com/?path=/story/virtual-react-virtualized--list) ([source](/stories/src/virtual/react-virtualized/list.jsx))
- [Board](https://react-beautiful-dnd.netlify.com/?path=/story/virtual-react-virtualized--board) ([source](/stories/src/virtual/react-virtualized/board.jsx))
- [List](https://react-beautiful-dnd.netlify.com/?path=/story/virtual-react-virtualized--window-list) with [`WindowScroller`](https://github.com/bvaughn/react-virtualized/blob/master/docs/WindowScroller.md) ([source](/stories/src/virtual/react-virtualized/window-list.jsx))

### [`react-virtuoso`](https://github.com/petyosi/react-virtuoso)
React Virtuoso comes with automatic item measurement out of the box.
- [List with source](https://virtuoso.dev/react-beautiful-dnd/)
- [Basic list on `codesandbox.io`](https://codesandbox.io/s/react-virutoso-with-react-beautiful-dnd-e6vmq)

## Usage

`react-beautiful-dnd` does not provide its own virtual list abstraction so there is a bit of wiring that you will need to do in order to get going with existing virtual list solutions 🛠

### Enable overscanning

> Virtualisation libraries often have overscanning enabled by default

Most virtual list libraries support the concept of **overscanning**. Overscanning is where a small about of non-visible items are rendered near the boundary of the window. When a scroll occurs the overscanned item can be immediately moved into view and does not need to be created. Overscanning generally leads to a more fluid experience.

It is required that overscanning be enabled for `react-beautiful-dnd` to work correctly. If overscanning is not enabled, `rbd` cannot tell if there are more items in the list when an item is in the last visual position. We require an overscanning value of one or more.

### Set `<Droppable /> | mode` to `virtual`

Virtual lists behave differently to regular lists. You will need to tell `rbd` that your list is a virtual one.

```js
<Droppable droppableId="droppable" mode="virtual">
  {/*...*/}
</Droppable>
```

### Use the `<Droppable /> | renderClone` API

When using a virtual list the original dragging item can be unmounted during a drag if it becomes invisible. To get around this we require that you drag a clone of the dragging item. See our [reparenting guide](/docs/guides/reparenting.md) for more details.

```js
<Droppable
  droppableId="droppable"
  mode="virtual"
  renderClone={(provided, snapshot, rubric) => (
    <div
      {...provided.draggableProps}
      {...provided.dragHandleProps}
      ref={provided.innerRef}
    >
      Item id: {items[rubric.source.index].id}
    </div>
  )}
>
  {/*...*/}
</Droppable>
```

### Stand in for the placeholder

> 👋 This is only required when you have multiple connected lists. This is not required when using a single list

Usually we require consumers to put a `placeholder` (`<Droppable /> | DroppableProvided | placeholder`) into the list so that we can insert space into a list as needing during a drag.

```js
<Droppable droppableId="droppable">
  {(provided, snapshot) => (
    <div ref={provided.innerRef} {...provided.droppableProps}>
      {/* Usually needed. But not for virtual lists! */}
      {provided.placeholder}
    </div>
  )}
</Droppable>
```

However, a `placeholder` does not make sense in the context of a virtual list as the dimensions of the list is not based on collective size of the visual items, but rather is calculated based on things like `itemCount` and `itemSize`. (eg `height` = `itemSize` \* `itemCount`). For virtual lists, inserting our own node into it would not increase the size of the list. **So we need you do insert the space for us!**

A simple way to add extra space to a virtual list is to add a non-visible item to your list. It is important that this extra item is not a `<Draggable />`.

```js
// This example uses the `react-window` API

const Row = ({ data, index, style }: RowProps) => {
  const item = data[index];

   // We are rendering an extra item for the placeholder
  if (!item) {
    return null;
  }

  return (
    <Draggable draggableId={item.id} index={index} key={item.id}>
      {(provided: DraggableProvided, snapshot: DraggableStateSnapshot) => (
        {/*...*/}
      )}
    </Draggable>
  );
});

function render(provided: DroppableProvided, snapshot: DroppableStateSnapshot) {
  // Add an extra item to our list to make space for a dragging item
  // Usually the DroppableProvided.placeholder does this, but that won't
  // work in a virtual list
  const itemCount: number = snapshot.isUsingPlaceholder
    ? quotes.length + 1
    : quotes.length;

  return (
    <List
      height={500}
      itemCount={itemCount}
      itemSize={110}
      width={300}
      outerRef={provided.innerRef}
      itemData={quotes}
    >
      {Row}
    </List>
  );
}
```

[← Back to documentation](/README.md#documentation-)

repository: atlassian/react-beautiful-dnd

gha_license_id: NOASSERTION

repo_name: atlassian/react-beautiful-dnd