text:
define([
    'underscore',
    'contrail-config-model'/*,
    'config/services/bgpasaservice/ui/js/models/bgpAsAServiceFamilyAttrModel'*/
], function (_, ContrailConfigModel/*, BGPAsAServiceFamilyAttrModel*/) {
    var bgpAsAServiceModel = ContrailConfigModel.extend({
        defaultConfig: {
            "name": null,
            "display_name": null,
            "fq_name": null,
            "parent_type": 'project',
            "bgpaas_ip_address": null,
            "autonomous_system": null,
            "bgpaas_session_attributes": {
                "admin_down": false,
                "as_override": false,
                "hold_time": null,
                "loop_count": null,
                "address_families": {
                    "family": []
                }/*,
                "family_attributes": []*/
            },
            "virtual_machine_interface_refs": [],
            "user_created_virtual_machine_interface": null,
            /*"user_created_auth_key_type": "none",
            "user_created_auth_key": null*/
            "bgpaas_ipv4_mapped_ipv6_nexthop": false,
            "bgpaas_suppress_route_advertisement": false
        },

        formatModelConfig : function(modelConfig) {
            modelConfig['display_name'] = ctwu.getDisplayNameOrName(modelConfig);
            //prepare family attributes collection
            var familyAttrArray = [];
            var bgpaasSessionAttrs = getValueByJsonPath(modelConfig,
                "bgpaas_session_attributes", null);
            var vmiRefs = [], editVMIRefs = [];
            if(bgpaasSessionAttrs) {
                /*var familyAttrs = getValueByJsonPath(bgpaasSessionAttrs,
                    "family_attributes", []);
                if(!modelConfig.uuid) {
                    familyAttrArray.push(new BGPAsAServiceFamilyAttrModel({
                                           bgpaas_address_family: "inet",
                                           bgpaas_loop_count: 0,
                                           bgpaas_prefix_limit: 0
                                       }));
                    familyAttrArray.push(new BGPAsAServiceFamilyAttrModel({
                                           bgpaas_address_family: "inet6",
                                           bgpaas_loop_count: 0,
                                           bgpaas_prefix_limit: 0
                                       }));
                } else {
                    for(var i = 0; i < familyAttrs.length; i++) {
                        var familyAttr =  new BGPAsAServiceFamilyAttrModel({
                                               bgpaas_address_family: familyAttrs[i].address_family,
                                               bgpaas_loop_count: familyAttrs[i].loop_count,
                                               bgpaas_prefix_limit: getValueByJsonPath(familyAttrs[i], "prefix_limit;maximum", null)
                                           });
                        familyAttrArray.push(familyAttr);
                    }
                }*/

                if(!modelConfig.uuid) {
                    modelConfig["bgpaas_session_attributes"]["address_families"]["family"] =
                        ["inet", "inet6"];
                }
                /*if(bgpaasSessionAttrs['auth_data'] != null) {
                    var authData = bgpaasSessionAttrs['auth_data'];
                    modelConfig['user_created_auth_key_type'] =
                        authData.key_type != null ? authData.key_type : 'none';
                    modelConfig['user_created_auth_key'] =
                        authData.key_items != null &&
                        authData.key_items.length > 0 ?
                        authData.key_items[0].key : '';
                }*/
                if(bgpaasSessionAttrs["admin_down"] != null) {
                    modelConfig["bgpaas_session_attributes"]['admin_down'] =
                        !bgpaasSessionAttrs["admin_down"];
                }
            }
            // virtual machine interface refs
            vmiRefs = getValueByJsonPath(modelConfig,
                "virtual_machine_interface_refs", []);
            if(vmiRefs.length > 0) {
                _.each(vmiRefs, function(vmiRef){
                    var fqName = vmiRef.to;
                    editVMIRefs.push(vmiRef.uuid +
                        cowc.DROPDOWN_VALUE_SEPARATOR + fqName[0] +
                        ":" + fqName[1] +
                        ":" + fqName[2]);
                });
                modelConfig["user_created_virtual_machine_interface"] =
                    editVMIRefs;
            }
            /*modelConfig["familyAttrs"] = new Backbone.Collection(familyAttrArray);*/

            //permissions
            this.formatRBACPermsModelConfig(modelConfig);
            return modelConfig;
        },

        /*addFamilyAttr: function() {
            var familyAttrs = this.model().attributes["familyAttrs"],
                familyAttrsArry = familyAttrs.toJSON();
            var addressFamily = "";
            var inetFamily = "inet";
            if(familyAttrsArry.length === 0) {
                addressFamily = inetFamily;
            } else if(familyAttrsArry.length === 1) {
                addressFamily =
                    familyAttrsArry[0].bgpaas_address_family() === inetFamily ?
                    "inet6" : inetFamily;
            } else if(familyAttrsArry.length === 2) {
                return;
            }
            var newFamilyAttr = new BGPAsAServiceFamilyAttrModel({bgpaas_address_family: addressFamily,
                bgpaas_loop_count: 0, bgpaas_prefix_limit: 0});
            familyAttrs.add([newFamilyAttr]);
        },
        deleteFamilyAttr: function(data, kbInterface) {
            data.model().collection.remove(kbInterface.model())
        },
        getFamilyAttrs: function(attr) {
            var familyAttrs = attr.familyAttrs.toJSON();
            var actFamilyAttrs = [];
            if(familyAttrs instanceof Array) {
                for(var i = 0; i < familyAttrs.length; i++) {
                    var familyAttr = familyAttrs[i];
                    actFamilyAttrs.push({
                        address_family: familyAttr.bgpaas_address_family(),
                        loop_count: Number(familyAttr.bgpaas_loop_count()),
                        prefix_limit: {maximum : Number(familyAttr.bgpaas_prefix_limit())}
                    });
                }
            }
            return actFamilyAttrs;
        },*/
        prepareVMIRefs: function(attr) {
            var vmiStr = attr.user_created_virtual_machine_interface;
            var vmiRefs = [];
            if(vmiStr) {
                var vmiArr = vmiStr.split(ctwc.MULTISELECT_VALUE_SEPARATOR);
                for(var i = 0; i < vmiArr.length; i++) {
                    var vmiDetailsArr  = vmiArr[i].split(cowc.DROPDOWN_VALUE_SEPARATOR);
                    if(vmiDetailsArr.length === 2) {
                        vmiRefs.push({
                            to: vmiDetailsArr[1].split(":"),
                            uuid: vmiDetailsArr[0]
                        });
                    }
                }
            }
            return vmiRefs;
        },

        configBGPAsAService: function (callbackObj, ajaxMethod) {
            var self = this, ajaxConfig = {}, returnFlag = false,
                postBGPAsAServiceData = {}, sessionAttrs,
                validations = [
                {
                    key : null,
                    type : cowc.OBJECT_TYPE_MODEL,
                    getValidation : "configureValidation"
                }/*,
                {
                    key : "familyAttrs",
                    type : cowc.OBJECT_TYPE_COLLECTION,
                    getValidation : "familyAttrValidation"
                }*/
                ,
                //permissions
                ctwu.getPermissionsValidation()
            ];

            if (self.isDeepValid(validations)) {
                var attr = self.model().attributes;
                var newBGPAsAServiceData = $.extend(true, {}, attr);

                ctwu.setNameFromDisplayName(newBGPAsAServiceData);
                if(newBGPAsAServiceData["fq_name"] == [] ||
                    newBGPAsAServiceData["fq_name"] == null) {
                    newBGPAsAServiceData["fq_name"] =
                        [
                            contrail.getCookie(cowc.COOKIE_DOMAIN),
                            contrail.getCookie(cowc.COOKIE_PROJECT),
                            newBGPAsAServiceData["name"]
                        ];
                }
                sessionAttrs =
                    newBGPAsAServiceData["bgpaas_session_attributes"];

                //ip address
                if(!newBGPAsAServiceData["bgpaas_ip_address"]){
                    newBGPAsAServiceData["bgpaas_ip_address"] = null;
                }

                //autonomous system
                newBGPAsAServiceData["autonomous_system"] =
                    newBGPAsAServiceData["autonomous_system"] ?
                    Number(newBGPAsAServiceData["autonomous_system"]) : null;

                //address families
                newBGPAsAServiceData["bgpaas_session_attributes"]["address_families"]["family"] =
                     sessionAttrs.address_families.family.split(",");

                //family attrs
                /*newBGPAsAServiceData["bgpaas_session_attributes"]
                    ["family_attributes"] = self.getFamilyAttrs(attr);*/

                //admin down
                newBGPAsAServiceData["bgpaas_session_attributes"]["admin_down"] =
                    !sessionAttrs.admin_down;

                //hold time
                newBGPAsAServiceData["bgpaas_session_attributes"]["hold_time"] =
                    sessionAttrs.hold_time ? Number(sessionAttrs.hold_time) : 0;

                //loop count
                newBGPAsAServiceData["bgpaas_session_attributes"]["loop_count"] =
                    sessionAttrs.loop_count ? Number(sessionAttrs.loop_count) : 0;

                /*//auth key
                if(newBGPAsAServiceData.user_created_auth_key_type != 'none') {
                    newBGPAsAServiceData["bgpaas_session_attributes"]["auth_data"] = {
                        key_type : newBGPAsAServiceData.user_created_auth_key_type,
                        key_items : [{
                            key_id : 0,
                            key : newBGPAsAServiceData.user_created_auth_key
                        }]
                    };
                } else {
                   newBGPAsAServiceData["bgpaas_session_attributes"]["auth_data"] = null;
                }*/

                //virtual_machine_interface refs
                 newBGPAsAServiceData["virtual_machine_interface_refs"] =
                     self.prepareVMIRefs(attr);

                //permissions
                this.updateRBACPermsAttrs(newBGPAsAServiceData);

                ctwu.deleteCGridData(newBGPAsAServiceData);
                delete newBGPAsAServiceData.id_perms;
                delete newBGPAsAServiceData.user_created_virtual_machine_interface;
                /*delete newBGPAsAServiceData.user_created_auth_key_type;
                delete newBGPAsAServiceData.user_created_auth_key;*/
                /*delete newBGPAsAServiceData.familyAttrs;*/

                postBGPAsAServiceData['bgp-as-a-service'] = newBGPAsAServiceData;

                ajaxConfig.type  = ajaxMethod;
                ajaxConfig.data  = JSON.stringify(postBGPAsAServiceData);
                ajaxConfig.url   = ajaxMethod == 'PUT' ?
                                   ctwc.URL_UPDATE_BGP_AS_A_SERVICE +
                                   newBGPAsAServiceData['uuid'] :
                                   ctwc.URL_CREATE_BGP_AS_A_SERVICE;

                contrail.ajaxHandler(ajaxConfig, function () {
                    if (contrail.checkIfFunction(callbackObj.init)) {
                        callbackObj.init();
                    }
                }, function (response) {
                    if (contrail.checkIfFunction(callbackObj.success)) {
                        callbackObj.success();
                    }
                    returnFlag = true;
                }, function (error) {
                    if (contrail.checkIfFunction(callbackObj.error)) {
                        callbackObj.error(error);
                    }
                    returnFlag = false;
                });
            } else {
                if (contrail.checkIfFunction(callbackObj.error)) {
                    callbackObj.error(self.getFormErrorText(ctwl.BGP_PREFIX_ID));
                }
            }

            return returnFlag;
        },

        deleteBGPAsAServices : function(checkedRows, callbackObj) {
            var ajaxConfig = {}, that = this;
            var uuidList = [];

            $.each(checkedRows, function (checkedRowsKey, checkedRowsValue) {
                uuidList.push(checkedRowsValue.uuid);
            });

            ajaxConfig.type = "POST";
            ajaxConfig.data = JSON.stringify([{'type': 'bgp-as-a-service',
                                              'deleteIDs': uuidList}]);

            ajaxConfig.url = '/api/tenants/config/delete';
            contrail.ajaxHandler(ajaxConfig, function () {
                if (contrail.checkIfFunction(callbackObj.init)) {
                    callbackObj.init();
                }
            }, function (response) {
                if (contrail.checkIfFunction(callbackObj.success)) {
                    callbackObj.success();
                }
            }, function (error) {
                if (contrail.checkIfFunction(callbackObj.error)) {
                    callbackObj.error(error);
                }
            });
        },

        validations: {
            configureValidation: {
                'display_name': {
                    required: true,
                    msg: 'Enter BGP as a Service Name'
                },
                'bgpaas_ip_address' : function(value, attr, finalObj){
                    if (value && (!isValidIP(value) || value.trim().indexOf("/") != -1)) {
                        return "Enter an IP Address in the format xxx.xxx.xxx.xxx";
                    }
                },
                'autonomous_system' : function(value, attr, finalObj){
                     var asn = Number(value);
                     if (isNaN(asn) || asn < 1 || asn > 65534) {
                         return "Enter ASN number between 1-65534";
                     }
                },
                'bgpaas_session_attributes.hold_time' :  function(value, attr, finalObj){
                    if(value) {
                        var holdTime = Number(value);
                        if (isNaN(holdTime) || holdTime < 1 || holdTime > 65535) {
                            return "Enter hold time between 1-65535" ;
                        }
                    }
                },
                 "bgpaas_session_attributes.loop_count" : function(value, attr, finalObj) {
                    if(value) {
                        if(isNaN(value) || Number(value) < 0 || Number(value) > 16) {
                            return "Enter Loop count between 0-16"
                        }
                    }
                },/*
                'user_created_auth_key' : function(value, attr, finalObj){
                    if (finalObj['user_created_auth_key_type'] != 'none'
                        && (value == null || value.trim() == '')) {
                        return "Enter a valid Authentication key";
                    }
                },*/
                "bgpaas_session_attributes.address_families.family" : function(value, attr, finalObj) {
                    if(!value) {
                        return "At least one Address Family is required";
                    }
                }
            }
        }
    });
    return bgpAsAServiceModel;
});


text:
<!--
http://www.apache.org/licenses/LICENSE-2.0.txt

Copyright 2015 Intel Corporation

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.
-->
# Build and Test
This guide gets you started with building and testing Snap. If you have commits you want to contribute, review the [CONTRIBUTING file](../CONTRIBUTING.md) for a shorter list of what we look for and come back here if you need to verify your environment is configured correctly.

## Getting Started
If you prefer a video walkthrough of this process, watch this video: https://vimeo.com/161561815

To build the Snap Framework you'll need:
* [Golang >= 1.5](https://golang.org)
    * Should be [downloaded](https://golang.org/dl/) and [installed](https://golang.org/doc/install)
* [GNU Make](https://www.gnu.org/software/make/)
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)

The instructions below assume that the `GOPATH` environment variable has been set properly. Many of us use [go version manager (gvm)](https://github.com/moovweb/gvm) to easily switch between Go versions.

Now you can install Snap into your `$GOPATH`:
```
$ go get github.com/intelsdi-x/snap
$ cd $GOPATH/src/github.com/intelsdi-x/snap
```

[godeps](https://github.com/tools/godep) is a dependency for running the `make` task(s) required for the build process. If it is not already installed, install `godeps` now:
```
$ # first check to see if it is installed
$ which godep
$ # if not installed, do so
$ # then download and set your path
$ go get github.com/tools/godep
$ export PATH=$GOPATH/bin/
```

In the `snap/` directory there's a `Makefile` that builds all dependencies and then the Snap Framework binaries. To get dependencies and build Snap run:
```
$ cd $GOPATH/src/github.com/intelsdi-x/snap
$ make
```

It runs `make deps` and `make all` commands for you. Alternatively, you can run `make` with any of these other targets:

* `deps`: fetches all dependencies using godeps
* `check`: runs test suite
* `all`: builds snapd, snapctl, and the test plugins
* `snap` builds snapd and snapctl
* `install`: installs snapd and snapctl binaries in /usr/local/bin
* `release`: cuts a Snap release

To see how to use Snap, look at [Running Snap](../README.md#running-snap), [SNAPD.md](SNAPD.md), and [SNAPCTL.md](SNAPCTL.md).

## Test
### Creating Tests
Our tests are written using [smartystreets' GoConvey package](https://github.com/smartystreets/goconvey).  See https://github.com/smartystreets/goconvey/wiki for an introduction to creating a test using this package.

### Tests in Golang
We follow the Golang methodology of placing tests into files with names that look like `*_test.go`. See [this](https://golang.org/cmd/go/#hdr-Test_packages) section from [go command](https://golang.org/cmd/go/) documentation for more details

### Test Types in Snap
As was mentioned previously, tests in Snap are broken down into `small`, `medium`, and `large` tests. Definitions for these test types can be found in the 'Testing Guidelines' section [CONTRIBUTING.md](../CONTRIBUTING.md) document.

But, how do you actually tag a test as *small*, *medium*, or *large* in Golang? As it turns out, this is a relatively simple process. To tag a given test file by the category of tests that it contains, all we have to do is add a single line to the beginning of the file that provides a *build tag* for that file. For example, a line like this:

    // +build small

would identify that file as a file that contains *small* tests, while a line like this as the first line of the file:

	 // +build medium

would identify that file as a file that contains *medium* tests. Once those build tags are have been added to the test files in the Snap codebase, it is relative simple to run a specific set of tests (by type) by simply adding a `-tags [TAG]` command-line flag to the `go test` command (where the `[TAG]` value is replaced by one of our test types). For example, this command will run all of the tests in the current working directory or any of it's subdirectories that have been tagged as *small* tests:

	 $ go test -v  -tags=small ./...

It should be noted here that if there are any untagged tests in the directory referenced by the `go test` command, those untagged tests will also be run, regardless of the `-tags [TAG]` option that is passed into the `go test` command. To deal with this issue, all preexisting tests in the Snap framework have been tagged with a *legacy* tag. We have also modified the current test matrix (in the appropriate TravisCI and test shell-script files) to run both the *small* and *legacy* tests until such time that we feel that there is sufficient test coverage by the *small* tests that are currently being developed).

Once the maintainers feel that the *small* tests provide sufficient code coverage, the existing *legacy* tests will be phased out (or used in the construction of a set of *medium* and *large* tests for the Snap CI/CD toolchain). All new tests being added to the Snap framework by contributors should be marked as either `small`, `medium`, or `large` tests, depending on their scope.

### Running Tests
#### On a local machine
Contributors are assumed to have run the `legacy` and `small` tests that cover their contribution on their local machine prior to submitting the corresponding pull request. There are several ways of accomplishing this depending on the coverage required.

Before any tests can be run, the following command should be executed to pull down all of the test dependencies to the local machine (note; this will also run the `./scripts/test.sh` script, see below for more details):
```
$ cd $GOPATH/src/github.com/intelsdi-x/snap
$ SNAP_TEST_TYPE=[SNAP_TEST_TYPE] make test
```
where the string `[SNAP_TEST_TYPE]` that is shown above is replaced with one of our test types (`legacy`, `small`, `medium`, or `large`). Once the dependencies have been pulled down to the local machine, there are a number of ways to run the various tests included in the Snap framework. To run the complete set of `legacy`, `small`, `medium`, or `large` tests in the Snap framework (and stop at the first failure in a directory before continuing on), you can simply use the same shell-script that is run by the `make test` command that was shown above:
```
$ ./scripts/test.sh [SNAP_TEST_TYPE]
```
As was the case in the `make test` command that was shown above, the string `[SNAP_TEST_TYPE]` that is shown in this command should be replaced by the type of tests you wish to run (`legacy`, `small`, `medium`, or `large`). Note, that for convenience we have also added four new targets to the Snap `Makefile` that can be used to run the `legacy`, `small`, `medium`, or `large` tests in a simple `make test-*` command. To run the `small` tests, for example, one could simply run a command that looks something like this:
```
$ make test-small
```
To run the other types of tests in the Snap framework, simply replace the `small` type with one of the other types (`legacy`, `medium`, or `large` in the example `make test-*` command shown above).

If you are  interested in running all of the `legacy` tests from the Snap framework *and continuing through to all subdirectories, regardless of any errors that might be encountered*, then you can run a `go test ...` command directly (instead of running a `make test-*` or `scripts/test.sh [SNAP_TEST_TYPE]` command like those shown above). That `go test ...` command would look something like this:
```
go test -tags=legacy ./...
```
It should be noted here that the `go test ...` command shown above will iterate over all of the subdirectories of the current working directory and run all of the `legacy` tests found. It will not stop if errors are detected during a test run; those errors will simply be reported as part of the output of the `go test ...` command.

To run all of the small tests from the Snap framework, one would simply change the value of the tag passed into the command from `legacy` to `small`:
```
go test -tags=small ./...
```
All tests in the Snap framework are tagged as `legacy`, `small`, `medium`, or `large`, so at least one of those tags must be provided to any `go test ...` command that is executed by a contributor.

Individual tests from the framework can also be selected and run by passing a test name into the `go test...` command using the `-run` command-line flag:
```
go test -v -tags=legacy -run=[TEST_NAME] ./...
```

e.g. to run the `TestLoad` test from `control_test.go`, one would simply run a command that looks something like this:
```
go test -v -tags=legacy -run=TestLoad ./...
```
Finally, coverage reports can be generated that show (on a function-by-function level) how well a given test or set of tests cover the current codebase. For example, the following pair of commands will generate a report showing the coverage of all of the `legacy` tests in the current working directory (as text output to the console):
```
go test -tags=small -coverprofile=/tmp/coverage.out . && go tool cover -func=/tmp/coverage.out
```
A similar pair of commands can be used to generate an HTML view showing the same information, but in a browsable view that shows how the matching tests cover the code on a line-by-line basis for each file in the current working directory (the resulting view will open in the default web browser defined on the local machine)
```
go test -tags=small -coverprofile=/tmp/coverage.out . && go tool cover -html=/tmp/coverage.out
```
As was the case with the previous commands, the `-run` command-line flag can be used to further reduce the scope of the generated report to only show the coverage of named test. It should be noted here that these coverage reports can only be generated for code in a single directory. The `-coverprofile` command-line flag cannot be used to generate a coverage report across all subdirectories as was shown in the `go test ...` command shown previously.

### Building Effective Small Tests

Any `small` tests added to the Snap framework must conform to the following constraints:
* They should test the behavior of a single function or method in the framework
* There should no reliance rely on external systems or system-level resources (eg. networks, filesystem, external systems or services, system properties, multiple threads of execution, or the use of sleep statements) as part of these tests; the expected responses of any such external systems or access to system-level resources should be mocked appropriately.
* They should be independent of any other tests in the test framework
* They should return the same result every time they are run, regardless of the environment they are run in (a failure of any of these tests should be indicative of an issue with the code being tested, not the environment that the test is being run in)

When complete, the full set of `small` tests for any given function or method should provide sufficient code coverage to ensure that any changes made to that function or method will not 'break the build'. This will assure the Snap maintainers that any pull requests that are made to modify or add to the framework can be safely merged (provided that there is sufficient code coverage and the associated tests pass).

It should be noted here that the maintainers will refuse to merge any pull requests that trigger a failure of any of the `small` or `legacy` tests that cover the code being modified or added to the framework. As such, we highly recommend that contributors run the tests that cover their contributions locally before submitting their contribution as a pull request. Maintainers may also  ask that contributors add tests to their pull requests to ensure adequate code coverage before the they are willing to accept a given pull request, even if all existing tests pass. Our hope is that you, as a contributor, will understand the need for this requirement.

#### In Docker
The Snap Framework supports running tests in an isolated container as opposed to your local host. Run the test script, which calls a `Dockerfile` located at `./scripts/Dockerfile`:

```
$ cd $GOPATH/src/github.com/intelsdi-x/snap
$ scripts/run_tests_with_docker.sh`
```

redpajama_set_name: RedPajamaGithub


text:
'use strict';

const should = require('should');
const testHelper = require('./test-helper');

const { priceFinder, verifyPrice, verifyItemDetails } = testHelper;

describe('price-finder for Target Store URIs', () => {
  describe('testing Video Game item', () => {
    // Super Mario Maker Wii U
    const uri = 'http://www.target.com/p/super-mario-maker-nintendo-wii-u/-/A-47904515';

    it('should respond with a price for findItemPrice()', (done) => {
      priceFinder.findItemPrice(uri, (err, price) => {
        should(err).be.null();
        verifyPrice(price);
        done();
      });
    });

    it('should respond with a price, and the right category and name for findItemDetails()', (done) => {
      priceFinder.findItemDetails(uri, (err, itemDetails) => {
        should(err).be.null();
        verifyItemDetails(itemDetails, 'Super Mario Maker Nintendo Wii U', 'video games');
        done();
      });
    });
  });
});


text:
export async function sleep(milliseconds: number): Promise<void> {
    return new Promise<void>(resolve =>
        setTimeout(() =>
            resolve(), milliseconds));
}

import * as File from 'async-file';
import * as Parallel from 'async-parallel';
import * as WebRequest from 'web-request';

export {File, Parallel, WebRequest};


text:
package org.apache.calcite.rel.logical;

import org.apache.calcite.plan.Convention;
import org.apache.calcite.plan.RelOptCluster;
import org.apache.calcite.plan.RelTraitSet;
import org.apache.calcite.rel.RelCollation;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rel.RelShuttle;
import org.apache.calcite.rel.core.Match;
import org.apache.calcite.rel.type.RelDataType;
import org.apache.calcite.rex.RexNode;
import org.apache.calcite.util.ImmutableBitSet;

import java.util.List;
import java.util.Map;
import java.util.SortedSet;

/**
 * Sub-class of {@link Match}
 * not targeted at any particular engine or calling convention.
 */
public class LogicalMatch extends Match {

  /**
   * Creates a LogicalMatch.
   *
   * <p>Use {@link #create} unless you know what you're doing.
   *
   * @param cluster Cluster
   * @param traitSet Trait set
   * @param input Input relational expression
   * @param rowType Row type
   * @param pattern Regular Expression defining pattern variables
   * @param strictStart Whether it is a strict start pattern
   * @param strictEnd Whether it is a strict end pattern
   * @param patternDefinitions Pattern definitions
   * @param measures Measure definitions
   * @param after After match definitions
   * @param subsets Subset definitions
   * @param allRows Whether all rows per match (false means one row per match)
   * @param partitionKeys Partition by columns
   * @param orderKeys Order by columns
   * @param interval Interval definition, null if WITHIN clause is not defined
   */
  public LogicalMatch(RelOptCluster cluster, RelTraitSet traitSet,
      RelNode input, RelDataType rowType, RexNode pattern,
      boolean strictStart, boolean strictEnd,
      Map<String, RexNode> patternDefinitions, Map<String, RexNode> measures,
      RexNode after, Map<String, ? extends SortedSet<String>> subsets,
      boolean allRows, ImmutableBitSet partitionKeys, RelCollation orderKeys,
      RexNode interval) {
    super(cluster, traitSet, input, rowType, pattern, strictStart, strictEnd,
        patternDefinitions, measures, after, subsets, allRows, partitionKeys,
        orderKeys, interval);
  }

  /**
   * Creates a LogicalMatch.
   */
  public static LogicalMatch create(RelNode input, RelDataType rowType,
      RexNode pattern, boolean strictStart, boolean strictEnd,
      Map<String, RexNode> patternDefinitions, Map<String, RexNode> measures,
      RexNode after, Map<String, ? extends SortedSet<String>> subsets, boolean allRows,
      ImmutableBitSet partitionKeys, RelCollation orderKeys, RexNode interval) {
    final RelOptCluster cluster = input.getCluster();
    final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE);
    return create(cluster, traitSet, input, rowType, pattern,
        strictStart, strictEnd, patternDefinitions, measures, after, subsets,
        allRows, partitionKeys, orderKeys, interval);
  }

  /**
   * Creates a LogicalMatch.
   */
  public static LogicalMatch create(RelOptCluster cluster,
      RelTraitSet traitSet, RelNode input, RelDataType rowType,
      RexNode pattern, boolean strictStart, boolean strictEnd,
      Map<String, RexNode> patternDefinitions, Map<String, RexNode> measures,
      RexNode after, Map<String, ? extends SortedSet<String>> subsets,
      boolean allRows, ImmutableBitSet partitionKeys, RelCollation orderKeys,
      RexNode interval) {
    return new LogicalMatch(cluster, traitSet, input, rowType, pattern,
        strictStart, strictEnd, patternDefinitions, measures, after, subsets,
        allRows, partitionKeys, orderKeys, interval);
  }

  //~ Methods ------------------------------------------------------

  @Override public RelNode copy(RelTraitSet traitSet, List<RelNode> inputs) {
    return new LogicalMatch(getCluster(), traitSet, inputs.get(0), rowType,
        pattern, strictStart, strictEnd, patternDefinitions, measures, after,
        subsets, allRows, partitionKeys, orderKeys, interval);
  }

  @Override public RelNode accept(RelShuttle shuttle) {
    return shuttle.visit(this);
  }
}

// End LogicalMatch.java


text:
ALTER TABLE report DROP KEY `Report_transaction_index`;

-- @UNDO

#TBD


text:
package Global;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.util.Vector;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

import dualscreen.DualScreenFrame;

import JPanels.OspitiInterniPanel;
import dualScreenPanels.ScreenRicercaProf;

/**
 * Classe che contiene tutte le variabili che servono istanziate staticamente come le immagini , in modo da non creare rallentamenti in runtime al costo di aspettare qualche secondo all'avvio del SW,
 * la classe contiene anche delle variabili che sono utili durante la programmazione come il frame o lo stack
 *
 *	le variabili che iniziano con img_ sono immagini , quelle che iniziano con path_ sono i percorsi delle immagini all'interno del progetto.
 *
 */

public class GlobalVar {

	/**
	 * toolbar con back button e home button
	 */
	public static JPanel toolbar;
	/**
	 * Frame riguardante lo schermo touch
	 */
	public static JFrame frame;  // frame principale
	/**
	 * Frame riguardante lo schermo del televisore
	 */
	public static DualScreenFrame dualscreenframe; // frame secondo schermo
	/**
	 * Panel riguardante l'orologio dinamico
	 */
	public static ScreenRicercaProf screenricercaprof;
	/**
	 * BufferedImage bottone grande servizi
	 */
	public static BufferedImage img_btn_ospiti;
	/**
	 * BufferedImage bottone grande servizi premuto
	 */
	public static BufferedImage img_btn_ospiti_pressed;
	/**
	 * BufferedImage bottone grande info/buzzi
	 */
	public static BufferedImage img_btn_interni;
	/**
	 * BufferedImage bottone grande info/buzzi premuto
	 */
	public static BufferedImage img_btn_interni_pressed;
	/**
	 * BufferedImage di background del frame touch quando si sceglie fra servizi e info
	 */
	public static BufferedImage img_background_scelta;
	/**
	 * BufferedImage di background del frame touch quando si sceglie il modulo nella sezione info
	 */
	public static BufferedImage img_background_buzzi;
	/**
	 * BufferedImage di background del frame touch quando si sceglie il modulo nella sezione servizi
	 */
	public static BufferedImage img_background_servizi;
	/**
	 * BufferedImage del home button utilizzato nella toolbar
	 */
	public static BufferedImage img_home;   // bottone home toolbar
	/**
	 * BufferedImage del home button premuto utilizzato nella toolbar
	 */
	public static BufferedImage img_home_pressed; // home premuto toolbar
	/**
	 * BufferedImage del background utilizzato nel modulo dei ricevimenti
	 */
	public static BufferedImage img_ricevimento_panel;
	/**
	 * BufferedImage del background utilizzato nel modulo della ricerca del professore
	 */
	public static BufferedImage img_ricercaprof_panel;
	/**
	 * BufferedImage della freccetta che punta in basso che affianca ogni Combobox in modo da rendere piu intuitivo dove andare a cliccare
	 */
	public static BufferedImage img_drop_arrow_down;  //freccetta per capire dove cliccare
	/**
	 * BufferedImage della freccetta che punta a destra che affianca ogni Combobox in modo da rendere piu intuitivo dove andare a cliccare
	 */
	public static BufferedImage img_drop_arrow_up;    //freccetta per capire dove cliccare
	/**
	 * BufferedImage della freccia utilizzata nella toolbar per tornare alla schermata precedente
	 */
	public static BufferedImage img_left_arrow;      //frecce toolbar
	/**
	 * BufferedImage della freccia premuta, utilizzata nella toolbar per tornare alla schermata precedente
	 */
	public static BufferedImage img_left_arrow_pressed;
	/**
	 * BufferedImage di background del frame touch quando si visualizzano le comunicazioni
	 */
	public static BufferedImage img_comunicazioni_background;
	/**
	 * BufferedImage della freccia utilizzata per passare alla pagina precedente di un file nel modulo delle comunicazioni
	 */
	public static BufferedImage img_com_left_arrow;
	/**
	 * BufferedImage della freccia utilizzata per passare alla pagina successiva di un file nel modulo delle comunicazioni
	 */
	public static BufferedImage img_com_right_arrow;
	/**
	 * BufferedImage di background del frame touch quando si visualizzano le variazioni degli orari della scuola
	 */
	public static BufferedImage img_variazioni_background;
	/**
	 * BufferedImage del bottone del modulo che aprirà la schermata per la ricerca del professore
	 */
	public static BufferedImage img_btn_mod_ricercaprof;
	/**
	 * BufferedImage del bottone del modulo che aprirà la schermata per la visualizzazione della planimetria
	 */
	public static BufferedImage img_btn_mod_planimetria;
	/**
	 * BufferedImage del bottone del modulo che aprirà la schermata per la visualizzazione dell'orario di ricevimento di un professore
	 */
	public static BufferedImage img_btn_mod_ricevimento;
	/**
	 * BufferedImage del bottone del modulo che aprirà la schermata per la visualizzazione delle comunicazioni
	 */
	public static BufferedImage img_btn_mod_comunicazioni;
	/**
	 * BufferedImage del bottone del modulo che aprirà la schermata per la visualizzazione degli orari della scuola
	 */
	public static BufferedImage img_btn_mod_variazioni;
	/**
	 * BufferedImage del bottone premuto, modulo che aprirà la schermata per la visualizzazione della planimetria
	 */
	public static BufferedImage img_btn_mod_ricercaprof_pressed;
	/**
	 * BufferedImage del bottone premuto, modulo che aprirà la schermata per la visualizzazione della planimetria
	 */
	public static BufferedImage img_btn_mod_planimetria_pressed;
	/**
	 * BufferedImage del bottone premuto, modulo che aprirà la schermata per la visualizzazione dell'orario di ricevimento di un professore
	 */
	public static BufferedImage img_btn_mod_ricevimento_pressed;
	/**
	 * BufferedImage del bottone premuto, modulo che aprirà la schermata per la visualizzazione delle comunicazioni
	 */
	public static BufferedImage img_btn_mod_comunicazioni_pressed;
	/**
	 * BufferedImage del bottone premuto, modulo che aprirà la schermata per la visualizzazione degli orari della scuola
	 */
	public static BufferedImage img_btn_mod_variazioni_pressed;
	/**
	 * BufferedImage di background del frame dello schermo della tv
	 */
	public static BufferedImage img_dualscreen_ricercaprof_bg;

	public static String path_btn_ospiti = "/images/btn_ospiti.png";
	public static String path_btn_ospiti_pressed = "/images/btn_ospiti_pressed.png";
	public static String path_btn_interni = "/images/btn_interni.png";
	public static String path_btn_interni_pressed = "/images/btn_interni_pressed.png";
	public static String path_background_scelta = "/images/background_scelta.png";
	public static String path_background_buzzi = "/images/background_buzzi.png";
	public static String path_background_servizi = "/images/background_servizi.png";
	public static String path_home = "/images/home.png";
	public static String path_home_pressed = "/images/home_pressed.png";
	public static String path_close_menu = "/images/close_cross.png";
	public static String path_open_menu = "/images/menu_icon.png";
	public static String path_navigation_menu = "/images/navigation_menu.png";
	public static String path_blur = "/images/blur.png";
	public static String path_ricevimento_panel = "/images/ricevimento_panel.png";
	public static String path_ricercaporf_panel = "/images/ricercaprof_panel.png";
	public static String path_btn_mod = "/images/btn_mod.png";
	public static String path_btn_mod_presssed =  "/images/btn_mod_pressed.png";
	public static String path_drop_arrow_down = "/images/drop_arrow_down.png";
	public static String path_drop_arrow_up = "/images/drop_arrow_up.png";
	public static String path_left_arrow = "/images/left_arrow.png";
	public static String path_left_arrow_pressed = "/images/left_arrow_pressed.png";
	public static String path_right_arrow = "/images/right_arrow.png";
	public static String path_right_arrow_pressed = "/images/right_arrow_pressed.png";
	public static String path_comunicazioni_background = "/images/comunicazioni_background.png";
	public static String path_com_left_arrow = "/images/com_left_arrow.png";
	public static String path_com_right_arrow = "/images/com_right_arrow.png";
	public static String path_variazioni_background = "/images/variazioni_background.png";
	public static String path_dualscreen_ricercaprof_bg = "/images/bg_screen_ricerca.png";

	public static String path_btn_mod_ricercaprof = "/images/btn_mod_ricercaProf.png";
	public static String path_btn_mod_planimetria = "/images/btn_mod_planimetria.png";
	public static String path_btn_mod_ricevimento = "/images/btn_mod_ricevimento.png";
	public static String path_btn_mod_comunicazioni = "/images/btn_mod_comunicazioni.png";
	public static String path_btn_mod_variazioni = "/images/btn_mod_variazioni.png";
	public static String path_btn_mod_ricercaprof_pressed = "/images/btn_mod_ricercaProf_pressed.png";
	public static String path_btn_mod_planimetria_pressed = "/images/btn_mod_planimetria_pressed.png";
	public static String path_btn_mod_ricevimento_pressed = "/images/btn_mod_ricevimento_pressed.png";
	public static String path_btn_mod_comunicazioni_pressed = "/images/btn_mod_comunicazioni_pressed.png";
	public static String path_btn_mod_variazioni_pressed = "/images/btn_mod_variazioni_pressed.png";

	/**
	 * Path riguardante lo shell script che si occupa di scaricare le comunicazioni
	 */
	public static String pathComSh="/home/arazzo/Arazzo/resources/downloadComunicazioni.sh";  //path del .sh per il download
	/**
	 * Path che serve allo shell script per sapere dove salvare i pdf delle comunicazioni convertiti in immagini
	 */
	public static String pathComJPG="/home/arazzo/Arazzo/resources/imgPDF/";  //path della cartella dove andranno inserite le immagini renderizzate
	/**
	 * Path che serve allo shell script per sapere i nomi dei .pdf da renderizzare
	 */
	public static String pathComNew="/home/arazzo/Arazzo/resources/pdf/toImg.txt";  //path del .txt dove sono presenti i nomi dei .pdf da renderizzare
	/**
	 * Path che serve allo shell script per sapere dove salvare i pdf delle comunicazioni
	 */
	public static String pathComPDF="/home/arazzo/Arazzo/resources/pdf";  //path della cartella dove sono presenti i .pdf scaricati
	/**
	 * Path che serve allo shell script per sapere path del .txt dove sono presenti i link per il download dei .pdf
	 */
	public static String pathCom="/home/arazzo/Arazzo/resources/pdf/link.txt";  //path del .txt dove sono presenti i link per il download dei .pdf
	/**
	 * URL da dove scaricare le comunicazioni
	 */
	public static String pathComDownload="http://192.168.1.16/comunicazioni";  //URL da dove scaricare le comunicazioni

	/**
	 *  Path del pdf delle variazioni giornaliere
	 */
	public static String pathDayPdf = "/home/arazzo/Variazioni giornaliere orario.pdf";
	/**
	 *  Path del pdf renderizzato in immagine delle variazioni giornaliere
	 */
	public static String pathDayJPG = "/home/arazzo/Arazzo/resources/imgPDF/variazioniorario.jpg";

	/**
	 * posizione dello stack
	 */
	public static int StackPosition=0;
	/**
	 * stack in cui viene salvata la cornologia dell'utente
	 */
	public static Vector<JPanel> Stack = new Vector<JPanel>(1,1);

	/**
	 * flag per controllare se è stato selezionata l'opzione info
	 */
	public static boolean Ospite = false;   // flag per capire se e' stato selezionato ospite o interno
	/**
	 * flag per controllare se è stato selezionata l'opzione info
	 */
	public static boolean Interno = false;
	/**
	 * Label utilizzata come background del frame touch
	 */
	public static JLabel background;

	/**
	 * Costruttore che istanzia le variabili globali
	 */
	public GlobalVar()
	{

		//istanzio tutte le immagini
		try{

			img_btn_interni =ImageIO.read(getClass().getResource(path_btn_interni));
			img_btn_ospiti =ImageIO.read(getClass().getResource(path_btn_ospiti));
			img_btn_ospiti_pressed = ImageIO.read(getClass().getResource(path_btn_ospiti_pressed));
			img_btn_interni_pressed = ImageIO.read(getClass().getResource(path_btn_interni_pressed));
			img_background_scelta =  ImageIO.read(getClass().getResource(path_background_scelta));
			img_background_buzzi =  ImageIO.read(getClass().getResource(path_background_buzzi));
			img_background_servizi =  ImageIO.read(getClass().getResource(path_background_servizi));
			img_home = ImageIO.read(getClass().getResource(path_home));
			img_home_pressed = ImageIO.read(getClass().getResource(path_home_pressed));
			img_ricevimento_panel = ImageIO.read(getClass().getResource(path_ricevimento_panel));
			img_ricercaprof_panel = ImageIO.read(getClass().getResource(path_ricercaporf_panel));
			img_drop_arrow_down = ImageIO.read(getClass().getResource(path_drop_arrow_down));
			img_drop_arrow_up = ImageIO.read(getClass().getResource(path_drop_arrow_up));
			img_left_arrow = ImageIO.read(getClass().getResource(path_left_arrow));
			img_left_arrow_pressed = ImageIO.read(getClass().getResource(path_left_arrow_pressed));
			img_comunicazioni_background = ImageIO.read(getClass().getResource(path_comunicazioni_background));
			img_com_left_arrow = ImageIO.read(getClass().getResource(path_com_left_arrow));
			img_com_right_arrow = ImageIO.read(getClass().getResource(path_com_right_arrow));
			img_variazioni_background = ImageIO.read(getClass().getResource(path_variazioni_background));
			img_dualscreen_ricercaprof_bg = ImageIO.read(getClass().getResource(path_dualscreen_ricercaprof_bg));

			img_btn_mod_ricercaprof = ImageIO.read(getClass().getResource(path_btn_mod_ricercaprof));
			img_btn_mod_planimetria = ImageIO.read(getClass().getResource(path_btn_mod_planimetria));
			img_btn_mod_ricevimento = ImageIO.read(getClass().getResource(path_btn_mod_ricevimento));
			img_btn_mod_comunicazioni = ImageIO.read(getClass().getResource(path_btn_mod_comunicazioni));
			img_btn_mod_variazioni = ImageIO.read(getClass().getResource(path_btn_mod_variazioni));
			img_btn_mod_ricercaprof_pressed = ImageIO.read(getClass().getResource(path_btn_mod_ricercaprof_pressed));
			img_btn_mod_planimetria_pressed = ImageIO.read(getClass().getResource(path_btn_mod_planimetria_pressed));
			img_btn_mod_ricevimento_pressed = ImageIO.read(getClass().getResource(path_btn_mod_ricevimento_pressed));
			img_btn_mod_comunicazioni_pressed = ImageIO.read(getClass().getResource(path_btn_mod_comunicazioni_pressed));
			img_btn_mod_variazioni_pressed = ImageIO.read(getClass().getResource(path_btn_mod_variazioni_pressed));

			Stack.add(0,new OspitiInterniPanel());

		}catch(Exception e){

			e.printStackTrace();
		}

	}

	/**
	 * Metodo che controlla se lo stack contiene un determinato JPanel
	 * @param tmp  JPanel da comparare
	 * @return 1 se esiste -1 se non esiste nello stack
	 */
	public static int StackContains(JPanel tmp)
	{
		for(int i=0 ;i<Stack.size();i++){

			if(Stack.get(i) == tmp )
				return i;

		}
		return -1;
	}

	/**
	 * Metodo che viene utilizzato per cambiare il JPanel all'interno del frame
	 * @param tmp  nuovo JPanel che verà istanziato al posto del precedente
	 */
	public static void GoToPanel (JPanel tmp){  // da migliorare  ( possibilmente se esiste il jpanel andare direttamente alla posizione dello stack in cui e' istanziato ed eliminare i successivi (forse))

		if((GlobalVar.Stack.get(GlobalVar.StackPosition).getClass()).equals(tmp.getClass())) //controlla se si tenta di aprire la stessa finestra
		{

		}
		else
		{

			GlobalVar.frame.getContentPane().remove(1);  // + 2 perche 0  e 1 sono riservati alla toolbar e al menu
			GlobalVar.frame.getContentPane().add(tmp,1);

			GlobalVar.StackPosition++;
			if(GlobalVar.Stack.size() == GlobalVar.StackPosition)    // se l'indice dello stack non e' istanziato
				GlobalVar.Stack.add(GlobalVar.StackPosition,tmp);    // add jpanl
			else													// altrimenti
				GlobalVar.Stack.set(GlobalVar.StackPosition,tmp);	// set jpanl

		}
		GlobalVar.frame.repaint();
		GlobalVar.frame.getContentPane().repaint();  // i repaint servono per far si che la grafica si aggiorni , altrimenti diventa tutto glitchato

	}

}


text:
<!doctype html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="A front-end template that helps you build fast, modern mobile web apps.">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <title>Home</title>

  <meta name="mobile-web-app-capable" content="yes">
  <link rel="icon" sizes="192x192" href="images/android-desktop.png">

  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Material Design Lite">
  <link rel="apple-touch-icon-precomposed" href="images/ios-desktop.png">

  <meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">
  <meta name="msapplication-TileColor" content="#3372DF">

  <link rel="shortcut icon" href="images/favicon.png">

  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en">
  <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
  <link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.cyan-light_blue.min.css">
  <link rel="stylesheet" href="styles.css">

        Home

          Allan Hieng

        homeHome
        peopleAbout
        flagProjects
        help_outlineDisclaimer

Welcome

              Welcome to my online portfolio. As many things are, this site is a work in progress I'm always looking to improve.

              On this site, you will find information about myself and the notably projects I have done. I hope you find what you're looking for and feel free to contact me. Finally, thank you for visiting.

About

              Want to learn more about me and what I do and or want to do?

            Read More

Projects

              Check out the projects I have worked on and the ones I am currently working on.

            Read More

  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" style="position: fixed; left: -1000px; height: -1000px;">
        <defs>
          <mask id="piemask" maskContentUnits="objectBoundingBox">
            <circle cx=0.5 cy=0.5 r=0.49 fill="white" />
            <circle cx=0.5 cy=0.5 r=0.40 fill="black" />
          </mask>
          <g id="piechart">
            <circle cx=0.5 cy=0.5 r=0.5 />
            <path d="M 0.5 0.5 0.5 0 A 0.5 0.5 0 0 1 0.95 0.28 z" stroke="none" fill="rgba(255, 255, 255, 0.75)" />
          </g>
        </defs>
      </svg>
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 250" style="position: fixed; left: -1000px; height: -1000px;">
        <defs>
          <g id="chart">
            <g id="Gridlines">
              <line fill="#888888" stroke="#888888" stroke-miterlimit="10" x1="0" y1="27.3" x2="468.3" y2="27.3" />
              <line fill="#888888" stroke="#888888" stroke-miterlimit="10" x1="0" y1="66.7" x2="468.3" y2="66.7" />
              <line fill="#888888" stroke="#888888" stroke-miterlimit="10" x1="0" y1="105.3" x2="468.3" y2="105.3" />
              <line fill="#888888" stroke="#888888" stroke-miterlimit="10" x1="0" y1="144.7" x2="468.3" y2="144.7" />
              <line fill="#888888" stroke="#888888" stroke-miterlimit="10" x1="0" y1="184.3" x2="468.3" y2="184.3" />
            </g>
            <g id="Numbers">
              <text transform="matrix(1 0 0 1 485 29.3333)" fill="#888888" font-family="'Roboto'" font-size="9">500</text>
              <text transform="matrix(1 0 0 1 485 69)" fill="#888888" font-family="'Roboto'" font-size="9">400</text>
              <text transform="matrix(1 0 0 1 485 109.3333)" fill="#888888" font-family="'Roboto'" font-size="9">300</text>
              <text transform="matrix(1 0 0 1 485 149)" fill="#888888" font-family="'Roboto'" font-size="9">200</text>
              <text transform="matrix(1 0 0 1 485 188.3333)" fill="#888888" font-family="'Roboto'" font-size="9">100</text>
              <text transform="matrix(1 0 0 1 0 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">1</text>
              <text transform="matrix(1 0 0 1 78 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">2</text>
              <text transform="matrix(1 0 0 1 154.6667 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">3</text>
              <text transform="matrix(1 0 0 1 232.1667 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">4</text>
              <text transform="matrix(1 0 0 1 309 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">5</text>
              <text transform="matrix(1 0 0 1 386.6667 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">6</text>
              <text transform="matrix(1 0 0 1 464.3333 249.0003)" fill="#888888" font-family="'Roboto'" font-size="9">7</text>
            </g>
            <g id="Layer_5">
              <polygon opacity="0.36" stroke-miterlimit="10" points="0,223.3 48,138.5 154.7,169 211,88.5
              294.5,80.5 380,165.2 437,75.5 469.5,223.3 	"/>
            </g>
            <g id="Layer_4">
              <polygon stroke-miterlimit="10" points="469.3,222.7 1,222.7 48.7,166.7 155.7,188.3 212,132.7
              296.7,128 380.7,184.3 436.7,125 	"/>
            </g>
          </g>
        </defs>
      </svg>


text:
package io.sheetal.entity;

import java.io.Serializable;
import java.math.BigInteger;
import java.time.Year;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import lombok.Data;

@Entity
@Table
@Data
public class Program implements Serializable {

	@Id
	@GenericGenerator(strategy = "uuid2",name = "myuuid")
	@GeneratedValue(generator="myuuid")
	private String programId;
	private String title;
	private String year;
	private Date released;
	private int runtime;
	private String plot;

	private int metascore;
	private double imdbRating;
	private BigInteger imdbVotes;
	private String imdbId;

	@Column(columnDefinition="mediumBlob")
	private byte[] poster;

	@OneToMany(fetch=FetchType.LAZY, cascade = {CascadeType.ALL})
	@JoinTable(name = "program_genre",
    	joinColumns = @JoinColumn(name = "Program_programId"),
    inverseJoinColumns = @JoinColumn(name = "genreId"))
	private Set<Genre> genres;

	@OneToMany(fetch=FetchType.LAZY, cascade = {CascadeType.ALL})
	@JoinTable(name = "program_language",
    	joinColumns = @JoinColumn(name = "Program_programId"),
    inverseJoinColumns = @JoinColumn(name = "languageId"))
	private Set<Language> languages;

	@OneToMany(fetch=FetchType.LAZY, cascade = {CascadeType.ALL})
	@JoinTable(name = "program_country",
    	joinColumns = @JoinColumn(name = "Program_programId"),
    inverseJoinColumns = @JoinColumn(name = "countryId"))
	private Set<Country> countries;

	@OneToMany(fetch=FetchType.LAZY, cascade = {CascadeType.ALL})
	@JoinTable(name = "program_actor",
    	joinColumns = @JoinColumn(name = "Program_programId"),
    inverseJoinColumns = @JoinColumn(name = "actorId"))
	private Set<Actor> actors;

	@OneToMany(fetch=FetchType.LAZY, cascade = {CascadeType.ALL})
	@JoinTable(name = "program_director",
    	joinColumns = @JoinColumn(name = "Program_programId"),
    inverseJoinColumns = @JoinColumn(name = "directorId"))
	private Set<Director> directors;

	@OneToMany(fetch=FetchType.LAZY, cascade = {CascadeType.ALL})
	@JoinTable(name = "program_writer",
    	joinColumns = @JoinColumn(name = "Program_programId"),
    inverseJoinColumns = @JoinColumn(name = "writerId"))
	private Set<Writer> writers;

	@OneToOne(cascade = {CascadeType.ALL})
	private Rating rating;

	@OneToOne(cascade = {CascadeType.ALL})
	private Awards awards;

	@OneToOne(cascade = {CascadeType.ALL})
	private ProgramType programType;

}


text:
package com.vaadin.client.ui;

import java.util.HashMap;
import java.util.Map;

import com.google.gwt.user.client.ui.HTML;
import com.vaadin.client.WidgetUtil;

public class VFlash extends HTML {

    public static final String CLASSNAME = "v-flash";

    protected String source;
    protected String altText;
    protected String classId;
    protected String codebase;
    protected String codetype;
    protected String standby;
    protected String archive;
    protected Map<String, String> embedParams = new HashMap<>();
    protected boolean needsRebuild = false;
    protected String width;
    protected String height;

    private int slotOffsetHeight = -1;
    private int slotOffsetWidth = -1;

    public VFlash() {
        setStyleName(CLASSNAME);
    }

    public void setSource(String source) {
        if (this.source != source) {
            this.source = source;
            needsRebuild = true;
        }
    }

    public void setAlternateText(String altText) {
        if (this.altText != altText) {
            this.altText = altText;
            needsRebuild = true;
        }
    }

    public void setClassId(String classId) {
        if (this.classId != classId) {
            this.classId = classId;
            needsRebuild = true;
        }
    }

    public void setCodebase(String codebase) {
        if (this.codebase != codebase) {
            this.codebase = codebase;
            needsRebuild = true;
        }
    }

    public void setCodetype(String codetype) {
        if (this.codetype != codetype) {
            this.codetype = codetype;
            needsRebuild = true;
        }
    }

    public void setStandby(String standby) {
        if (this.standby != standby) {
            this.standby = standby;
            needsRebuild = true;
        }
    }

    public void setArchive(String archive) {
        if (this.archive != archive) {
            this.archive = archive;
            needsRebuild = true;
        }
    }

    /**
     * Call this after changing values of widget. It will rebuild embedding
     * structure if needed.
     */
    public void rebuildIfNeeded() {
        if (needsRebuild) {
            needsRebuild = false;
            this.setHTML(createFlashEmbed());
        }
    }

    @Override
    public void setWidth(String width) {
        // explicitly not calling super here
        if (this.width != width) {
            this.width = width;
            needsRebuild = true;
        }
    }

    @Override
    public void setHeight(String height) {
        // explicitly not calling super here
        if (this.height != height) {
            this.height = height;
            needsRebuild = true;
        }
    }

    public void setEmbedParams(Map<String, String> params) {
        if (params == null) {
            if (!embedParams.isEmpty()) {
                embedParams.clear();
                needsRebuild = true;
            }
            return;
        }

        if (!embedParams.equals(params)) {
            embedParams = new HashMap<>(params);
            needsRebuild = true;
        }
    }

    /**
     * Set dimensions of the containing layout slot so that the size of the
     * embed object can be calculated from percentages if needed.
     *
     * Triggers embed resizing if percentage sizes are in use.
     *
     * @since 7.7.8
     * @param slotOffsetHeight
     *            offset height of the layout slot
     * @param slotOffsetWidth
     *            offset width of the layout slot
     */
    public void setSlotHeightAndWidth(int slotOffsetHeight,
            int slotOffsetWidth) {
        this.slotOffsetHeight = slotOffsetHeight;
        this.slotOffsetWidth = slotOffsetWidth;
        if (hasPercentageHeight() || hasPercentageWidth()) {
            resizeEmbedElement();
        }

    }

    protected String createFlashEmbed() {
        /*
         * To ensure cross-browser compatibility we are using the twice-cooked
         * method to embed flash i.e. we add a OBJECT tag for IE ActiveX and
         * inside it a EMBED for all other browsers.
         */
        StringBuilder html = new StringBuilder();

        // Start the object tag
        html.append("<object ");

        /*
         * Add classid required for ActiveX to recognize the flash. This is a
         * predefined value which ActiveX recognizes and must be the given
         * value. More info can be found on
         * http://kb2.adobe.com/cps/415/tn_4150.html. Allow user to override
         * this by setting his own classid.
         */
        if (classId != null) {
            html.append(
                    "classid=\"" + WidgetUtil.escapeAttribute(classId) + "\" ");
        } else {
            html.append(
                    "classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ");
        }

        /*
         * Add codebase required for ActiveX and must be exactly this according
         * to http://kb2.adobe.com/cps/415/tn_4150.html to work with the above
         * given classid. Again, see more info on
         * http://kb2.adobe.com/cps/415/tn_4150.html. Limiting Flash version to
         * 6.0.0.0 and above. Allow user to override this by setting his own
         * codebase
         */
        if (codebase != null) {
            html.append("codebase=\"" + WidgetUtil.escapeAttribute(codebase)
                    + "\" ");
        } else {
            html.append(
                    "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" ");
        }

        // Add width and height
        html.append("width=\"" + WidgetUtil.escapeAttribute(width) + "\" ");
        html.append("height=\"" + WidgetUtil.escapeAttribute(height) + "\" ");
        html.append("type=\"application/x-shockwave-flash\" ");

        // Codetype
        if (codetype != null) {
            html.append("codetype=\"" + WidgetUtil.escapeAttribute(codetype)
                    + "\" ");
        }

        // Standby
        if (standby != null) {
            html.append(
                    "standby=\"" + WidgetUtil.escapeAttribute(standby) + "\" ");
        }

        // Archive
        if (archive != null) {
            html.append(
                    "archive=\"" + WidgetUtil.escapeAttribute(archive) + "\" ");
        }

        // End object tag
        html.append(">");

        // Ensure we have an movie parameter
        if (embedParams.get("movie") == null) {
            embedParams.put("movie", source);
        }

        // Add parameters to OBJECT
        for (String name : embedParams.keySet()) {
            html.append("<param ");
            html.append("name=\"" + WidgetUtil.escapeAttribute(name) + "\" ");
            html.append("value=\""
                    + WidgetUtil.escapeAttribute(embedParams.get(name))
                    + "\" ");
            html.append("/>");
        }

        // Build inner EMBED tag
        html.append("<embed ");
        html.append("src=\"" + WidgetUtil.escapeAttribute(source) + "\" ");
        if (hasPercentageWidth() && slotOffsetWidth >= 0) {
            html.append("width=\"" + getRelativePixelWidth() + "\" ");
        } else {
            html.append("width=\"" + WidgetUtil.escapeAttribute(width) + "\" ");
        }

        if (hasPercentageHeight() && slotOffsetHeight >= 0) {
            html.append("height=\"" + getRelativePixelHeight() + "px\" ");
        } else {
            html.append(
                    "height=\"" + WidgetUtil.escapeAttribute(height) + "\" ");
        }

        html.append("type=\"application/x-shockwave-flash\" ");

        // Add the parameters to the Embed
        for (String name : embedParams.keySet()) {
            html.append(WidgetUtil.escapeAttribute(name));
            html.append("=");
            html.append("\"" + WidgetUtil.escapeAttribute(embedParams.get(name))
                    + "\"");
        }

        // End embed tag
        html.append("></embed>");

        if (altText != null) {
            html.append("<noembed>");
            html.append(altText);
            html.append("</noembed>");
        }

        // End object tag
        html.append("</object>");

        return html.toString();
    }

    private void resizeEmbedElement() {
        // find <embed> element
        com.google.gwt.dom.client.Element objectElem = getElement()
                .getFirstChildElement();
        com.google.gwt.dom.client.Element objectChild = objectElem
                .getFirstChildElement();
        while (!"EMBED".equalsIgnoreCase(objectChild.getTagName())) {
            objectChild = objectChild.getNextSiblingElement();
            if (objectChild == null) {
                return;
            }
        }
        // update height & width from slot offset, if percentage size is given
        if (hasPercentageHeight() && slotOffsetHeight >= 0) {
            objectChild.setAttribute("height", getRelativePixelHeight());
        }
        if (hasPercentageWidth() && slotOffsetWidth >= 0) {
            objectChild.setAttribute("width", getRelativePixelWidth());
        }

    }

    private String getRelativePixelWidth() {
        float relative = WidgetUtil.parseRelativeSize(width);
        int widthInPixels = (int) (relative / 100) * slotOffsetWidth;
        return widthInPixels + "px";
    }

    private String getRelativePixelHeight() {
        float relative = WidgetUtil.parseRelativeSize(height);
        int heightInPixels = (int) (relative / 100) * slotOffsetHeight;
        return heightInPixels + "px";
    }

    private boolean hasPercentageHeight() {
        return ((height != null) && (height.indexOf('%') > 0));
    }

    private boolean hasPercentageWidth() {
        return ((width != null) && (width.indexOf('%') > 0));
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SimpleSSO
{
    public static class Setting
    {
        public static class RoleConfig
        {

            #region Web

            public const string UserRole = "user";
            public const string AdminRole = "admin";
            public const string InUserAdminRole = UserRole + "," + AdminRole;

            #endregion

            #region API

            public const string AppRole = "app";
            public const string AppUserAllRole = "app-user-all";
            public const string AppUserBaseRole = "app-user-base";

            public const string InAppUserAllRole = "app-user-all," + AdminRole + "," + UserRole;
            public const string InAppUserBaseRole = "app-user-base," + AppUserAllRole + "," + AdminRole + "," + UserRole;

            #endregion
        }

        #region

        public static class ResponseTypes
        {
            public const string Code = "code";
            public const string Token = "token";
        }

        public static class GrantTypes
        {
            public const string AuthorizationCode = "authorization_code";
            public const string ClientCredentials = "client_credentials";
            public const string RefreshToken = "refresh_token";
            public const string Password = "password";
        }

        #endregion

        #region

        public const string TokenKeyPrefix = "IsToken";

        #endregion

        #region endpoint

        public static class EndPointConfig
        {
            public const string TokenEndpointPath = "/Token";

            public const string AuthorizeEndpointPath = "/GrantCode/Authorize";

            public const string AuthorizeGrant = "OAuth/Grant";

            public const string AuthorizeGrantAccess = AuthorizeGrant + "/Access";
        }

        #endregion
    }
}


text:
(function (window, angular) {
    'use strict';

    angular.module('fms').controller('LoginCtrl', ['$scope', '$state', 'AuthService', function ($scope, $state, AuthService) {
        $scope.vm = {};
        $scope.model = {};

        $scope.login = function (form) {
            if (form.$valid) {
                $scope.vm.isSendingRequest = true;
                $scope.vm.errorState = false;
                AuthService.signIn($scope.model).then(function (userinfo) {
                    var route = $scope.redirectState.route;
                    var params = $scope.redirectState.params;
                    delete $scope.redirectState.route;
                    delete $scope.redirectState.params;

                    if (userinfo && AuthService.authorize('admin', userinfo.roles)) {
                        $state.go('root.admin');
                    } else if (route) {
                        $state.go(route, params);
                    } else {
                        $state.go('root.search');
                    }
                }).catch(function () {
                    $scope.vm.errorState = true;
                }).finally(function () {
                    $scope.vm.isSendingRequest = false;
                });
            }
        }
    }]);

})(window, window.angular);


text:
namespace _18.DifferentIntegersSize
{
    using System;
    using System.Numerics;

    public class DifferentIntegersSize
    {
        public static void Main(string[] args)
        {
            var userNumber = Console.ReadLine();
            var parsedNumber = BigInteger.Parse(userNumber);

            if (parsedNumber > long.MaxValue || parsedNumber < long.MinValue)
            {
                Console.WriteLine($"{userNumber} can't fit in any type");
            }
            else
            {
                Console.WriteLine($"{parsedNumber} can fit in:");

                if (parsedNumber >= sbyte.MinValue && parsedNumber <= sbyte.MaxValue)
                {
                    Console.WriteLine("* sbyte");
                }

                if (parsedNumber >= byte.MinValue && parsedNumber <= byte.MaxValue)
                {
                    Console.WriteLine("* byte");
                }

                if (parsedNumber >= short.MinValue && parsedNumber <= short.MaxValue)
                {
                    Console.WriteLine("* short");
                }

                if (parsedNumber >= ushort.MinValue && parsedNumber <= ushort.MaxValue)
                {
                    Console.WriteLine("* ushort");
                }

                if (parsedNumber >= int.MinValue && parsedNumber <= int.MaxValue)
                {
                    Console.WriteLine("* int");
                }

                if (parsedNumber >= uint.MinValue && parsedNumber <= uint.MaxValue)
                {
                    Console.WriteLine("* uint");
                }

                if (parsedNumber >= long.MinValue && parsedNumber <= long.MaxValue)
                {
                    Console.WriteLine("* long");
                }
            }
        }
    }
}


text:
using System;
using System.Diagnostics;
using System.Linq;
using Fatec.Treinamento.Data.Repositories;
using Fatec.Treinamento.Model;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Fatec.Treinamento.Testes.Data.Tests
{
    [TestClass]
    public class AssuntoRepositoryTests
    {

        [TestMethod]
        public void TestarCrudAssunto()
        {
            var id = InserirAssunto();
            var assunto = ObterAssunto(id);
            assunto = AtualizarAssunto(assunto);
            Excluir(assunto);
        }

        private int InserirAssunto()
        {
            using (AssuntoRepository repo = new AssuntoRepository())
            {
                var assunto = new Assunto
                {
                    Nome = "Demo teste 1"
                };

                int id = repo.Inserir(assunto).Id ;

                Assert.IsTrue(id > 0);
                return id;
            }
        }

        public Assunto ObterAssunto(int id)
        {
            using (AssuntoRepository repo = new AssuntoRepository())
            {

                var assunto = repo.Obter(id);

                Assert.AreEqual("Demo teste 1", assunto.Nome);

                return assunto;

            }
        }

        private Assunto AtualizarAssunto(Assunto assunto)
        {
            using (AssuntoRepository repo = new AssuntoRepository())
            {

                assunto.Nome = "Nome Atualizado";
                repo.Atualizar(assunto);

                var assuntoAtualizado = repo.Obter(assunto.Id);

                Assert.AreEqual("Nome Atualizado", assuntoAtualizado.Nome);

                return assuntoAtualizado;
            }
        }

        private void Excluir(Assunto assunto)
        {
            using (AssuntoRepository repo = new AssuntoRepository())
            {
                repo.Excluir(assunto);
                var assuntoRet = repo.Obter(assunto.Id);
                Assert.IsTrue(assuntoRet == null);
            }
        }
    }
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.10.10 at 02:39:29 PM KST
//

package org.oliot.model.epcis;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *

 * Java class for Unsubscribe complex type.
 *
 *

 * The following schema fragment specifies the expected content contained within
 * this class.
 *
 *

 * <complexType name="Unsubscribe">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="subscriptionID" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Unsubscribe", namespace = "urn:epcglobal:epcis-query:xsd:1", propOrder = { "subscriptionID" })
public class Unsubscribe {

	@XmlElement(required = true)
	protected String subscriptionID;

	/**
	 * Gets the value of the subscriptionID property.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getSubscriptionID() {
		return subscriptionID;
	}

	/**
	 * Sets the value of the subscriptionID property.
	 *
	 * @param value
	 *            allowed object is {@link String }
	 *
	 */
	public void setSubscriptionID(String value) {
		this.subscriptionID = value;
	}

}


text:
<?php

namespace CarlosIO\Geckoboard\Tests\Widgets;

use CarlosIO\Geckoboard\Data\Point;
use CarlosIO\Geckoboard\Widgets\Map;

class MapTest extends \PHPUnit_Framework_TestCase
{
    public function testEmptyMapPoints()
    {
        $myMap = new Map();

        $this->assertSame(array(), $myMap->getPoints());
    }

    public function testGetDataWithOneEmptyPoint()
    {
        $myMap = new Map();

        $point1 = new Point();

        $myMap->addPoint($point1);

        $expectedResult = array('points' => array('point' => array(array())));

        $this->assertSame($expectedResult, $myMap->getData());
    }

    public function testGetDataWithSomePoints()
    {
        $myMap = new Map();

        $point1 = new Point();
        $point1->setCityName('city 1');
        $point1->setColor('color 1');
        $point1->setCountryCode('ES');
        $point1->setSize(1);

        $point2 = new Point();
        $point2->setCityName('city 2');
        $point2->setColor('color 2');
        $point2->setCountryCode('ES');
        $point2->setSize(2);

        $myMap->addPoint($point1);
        $myMap->addPoint($point2);

        $expectedResult = array(
            'points' => array(
                'point' => array(
                    array(
                        'city' => array(
                            'city_name' => $point1->getCityName(),
                            'country_code' => $point1->getCountryCode(),
                        ),
                        'size' => $point1->getSize(),
                        'color' => $point1->getColor(),
                    ),
                    array(
                        'city' => array(
                            'city_name' => $point2->getCityName(),
                            'country_code' => $point2->getCountryCode(),
                        ),
                        'size' => $point2->getSize(),
                        'color' => $point2->getColor(),
                    ),
                ),
            ),
        );

        $this->assertSame($expectedResult, $myMap->getData());
    }
}


text:
- Added a debug mode to send messages to the console.
- Set a 100 message limit on the game log. (thanks [FancyRabbitt](https://www.reddit.com/user/FancyRabbitt))
- Added toggles to limit resources to once per season. (thanks [jacob-keller](https://github.com/jacob-keller))

### 2015.05.09 - Version 1.2.3

- Added variable controls over season limits. ([#41](https://github.com/cameroncondry/cbc-kitten-scientists/issues/41))

### 2015.05.08 - Version 1.2.2

- Added season control to crafts. (thanks [jacob-keller](https://github.com/jacob-keller)) ([#37](https://github.com/cameroncondry/cbc-kitten-scientists/issues/37))
- Reimplemented resource stock on buildings. (thanks [jacob-keller](https://github.com/jacob-keller))
- Added season control to trades. (thanks [jacob-keller](https://github.com/jacob-keller))

### 2015.04.30 - Version 1.2.1

- Added mint to the building list. (thanks [lightrider44](https://www.reddit.com/user/lightrider44))
- Removed trading cap temporarily. This will need re-enabled with better cap measures.
- Added the remaining trade possibilities.

### 2015.04.30 - Version 1.2.0

- Added granular controls for build orders. #8 #12 #21
- Added a bitcoin address by request. #16
- Updated README with alterations to build orders.
- Removed restriction of sitting on the "Bonfire" tab for auto building.
- Added all buildings and crafts to auto crafting. (requires toggling on in some cases)
- Stocks are enabled but require manual updating. Ex: "options.auto.craft.items.wood.stock = 5000;"

Thanks for contributing code:
[jacob-keller](https://github.com/jacob-keller)
[trini](https://github.com/trini)
[sjdrodge](https://github.com/sjdrodge)

Thanks for contributing ideas:
[Azulan](https://github.com/Azulan)
[mmccubbing](https://github.com/mmccubbing)

### 2015.04.06 - Version 1.1.6 - 1.1.6.1

- Moved parchments out of the luxury goods until fine controls are implemented.
- Quality of life changes in internal codebase. (thanks [jacob-keller](https://github.com/jacob-keller))
- Added automated trading and enabled trading with Zebras. (thanks [jacob-keller](https://github.com/jacob-keller))
- Specified resource to watch with unicorn pastures. (thanks [jacob-keller](https://github.com/jacob-keller))
- Moved parchment into the "luxury" goods category. (thanks [jacob-keller](https://github.com/jacob-keller))
- Added tradepost to the list of buildings and reprioritized order. (thanks [trini](https://github.com/trini))
- Reprioritized crafting to happen after building. (thanks [trini](https://github.com/trini))
- Updated the build internals to use the buttons directly. (reverted) (thanks [jacob-keller](https://github.com/jacob-keller))

### 2015.03.11 - Version 1.1.5

- Tweaked styles to remove extra margin around interface buttons.
- Fixed a bug with praising, due to refactoring. (thanks [sjdrodge](https://github.com/sjdrodge))
- Fixed a bug with catnip calculations.
- Removed lingering console.log statements. (thanks [sjdrodge](https://github.com/sjdrodge))

### 2015.03.11 - Version 1.1.4

- Major refactor of codebase to have cleaner lines between responsibilities.
- Stacked options in a two column layout.
- Luxury resources now have their own toggle.

### 2015.03.10 - Version 1.1.3

- Updated Auto Faith to wait for 99% faith capacity.
- Lowered minimum capacity of parchments. (thanks [trini](https://github.com/trini))
- Move luxury resources out of Auto Hunt. (thanks [SphtMarathon](https://www.reddit.com/user/SphtMarathon))
- Added safe guards for catnip in the winter. (thanks [jcranmer](https://github.com/jcranmer))

### 2015.03.08 - Version 1.1.2

- Updated auto housing to be toggled and added mansions.
- Added auto housing option. (thanks [mjdillon](https://github.com/mjdillon))
- Plates moved for priority over steel. (thanks [mjdillon](https://github.com/mjdillon))

### 2015.03.03 - Version 1.1.1

- Added barns to the auto build list.

### 2015.02.03 - Version 1.1.0

- Set up the ability to toggle auto crafting, building, hunting, and praising.
- Simplified css rule insertion and tweaked displayed colors.
- Added logging into the GameLog to prevent confusion.
- Updated crafting log to include the warehouse bonuses.

### 2015.25.02 - Version 1.0.0

- Initial release


text:
#include <aws/robomaker/model/RobotSoftwareSuite.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace RoboMaker
{
namespace Model
{

RobotSoftwareSuite::RobotSoftwareSuite() :
    m_name(RobotSoftwareSuiteType::NOT_SET),
    m_nameHasBeenSet(false),
    m_version(RobotSoftwareSuiteVersionType::NOT_SET),
    m_versionHasBeenSet(false)
{
}

RobotSoftwareSuite::RobotSoftwareSuite(JsonView jsonValue) :
    m_name(RobotSoftwareSuiteType::NOT_SET),
    m_nameHasBeenSet(false),
    m_version(RobotSoftwareSuiteVersionType::NOT_SET),
    m_versionHasBeenSet(false)
{
  *this = jsonValue;
}

RobotSoftwareSuite& RobotSoftwareSuite::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("name"))
  {
    m_name = RobotSoftwareSuiteTypeMapper::GetRobotSoftwareSuiteTypeForName(jsonValue.GetString("name"));

    m_nameHasBeenSet = true;
  }

  if(jsonValue.ValueExists("version"))
  {
    m_version = RobotSoftwareSuiteVersionTypeMapper::GetRobotSoftwareSuiteVersionTypeForName(jsonValue.GetString("version"));

    m_versionHasBeenSet = true;
  }

  return *this;
}

JsonValue RobotSoftwareSuite::Jsonize() const
{
  JsonValue payload;

  if(m_nameHasBeenSet)
  {
   payload.WithString("name", RobotSoftwareSuiteTypeMapper::GetNameForRobotSoftwareSuiteType(m_name));
  }

  if(m_versionHasBeenSet)
  {
   payload.WithString("version", RobotSoftwareSuiteVersionTypeMapper::GetNameForRobotSoftwareSuiteVersionType(m_version));
  }

  return payload;
}

} // namespace Model
} // namespace RoboMaker
} // namespace Aws


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;

namespace Onestop.Seo {
    public static class HtmlExtensions {
        public static MvcHtmlString SeoOverrideTextbox(this HtmlHelper htmlHelper, string name, string overriddenValue, string generatedValue, int maxLength) {
            var value = !String.IsNullOrEmpty(overriddenValue) ? overriddenValue : generatedValue;

            return htmlHelper.TextBox(name, value,
                        new {
                                @class = "text onestop-seo-rewrite-value",
                                data_generated_default = generatedValue,
                                data_max_length = maxLength.ToString(),
                                @readonly = "readonly"
                            });
        }
    }
}


text:
package giraudsa.marshall.serialisation.binary.actions;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.BitSet;

import giraudsa.marshall.exception.NotImplementedSerializeException;
import giraudsa.marshall.serialisation.Marshaller;
import giraudsa.marshall.serialisation.binary.ActionBinary;
import utils.champ.FieldInformations;

public class ActionBinaryBitSet extends ActionBinary<BitSet> {

	public ActionBinaryBitSet() {
		super();
	}

	@Override
	protected void ecritValeur(final Marshaller marshaller, final BitSet bitSet,
			final FieldInformations fieldInformations, final boolean isDejaVu)
			throws IOException, IllegalAccessException, InstantiationException, InvocationTargetException,
			NoSuchMethodException, NotImplementedSerializeException {
		if (!isDejaVu) {
			setDejaTotalementSerialise(marshaller, bitSet);
			final int size = bitSet.length();
			writeInt(marshaller, size);
			for (int i = 0; i < size; i++)
				writeBoolean(marshaller, bitSet.get(i));
		}
	}
}


text:
Shindo.tests("Fog::Joyent[:analytics] | joyent_modules", %w{joyent}) do
  @analytics = Fog::Joyent[:analytics]
  @joyent_modules = @analytics.joyent_modules

  tests('#all').succeeds do
    @joyent_modules.all
  end

  tests('#new').succeeds do
    @joyent_modules.new(['cpu', { 'label' => 'CPU' }])
  end

end


text:
package org.jetbrains.plugins.ipnb.editor.actions;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.ipnb.configuration.IpnbConnectionManager;
import org.jetbrains.plugins.ipnb.configuration.IpnbSettings;
import org.jetbrains.plugins.ipnb.editor.IpnbFileEditor;
import org.jetbrains.plugins.ipnb.editor.panels.IpnbEditablePanel;
import org.jetbrains.plugins.ipnb.editor.panels.IpnbFilePanel;

import java.util.List;

public class IpnbRunAllCellsAction extends IpnbRunCellBaseAction {
  public IpnbRunAllCellsAction() {
    super();
  }

  @Override
  public void actionPerformed(@NotNull AnActionEvent event) {
    final DataContext context = event.getDataContext();
    final IpnbFileEditor ipnbEditor = IpnbFileEditor.DATA_KEY.getData(context);
    if (ipnbEditor != null) {
      final IpnbFilePanel ipnbFilePanel = ipnbEditor.getIpnbFilePanel();
      final List<IpnbEditablePanel> cells = ipnbFilePanel.getIpnbPanels();
      final Project project = ipnbFilePanel.getProject();
      final IpnbConnectionManager connectionManager = IpnbConnectionManager.getInstance(project);
      final VirtualFile virtualFile = ipnbEditor.getVirtualFile();
      final String path = virtualFile.getPath();
      if (!connectionManager.hasConnection(path)) {
        String url = IpnbSettings.getInstance(project).getURL();
        if (StringUtil.isEmptyOrSpaces(url)) {
          url = IpnbConnectionManager.showDialogUrl(url);
        }
        if (url == null) return;
        IpnbSettings.getInstance(project).setURL(url);
        final String finalUrl = url;
        ApplicationManager.getApplication().executeOnPooledThread(() -> {
          final boolean serverStarted = connectionManager.startIpythonServer(finalUrl, ipnbEditor);
          if (!serverStarted) {
            return;
          }
          UIUtil.invokeLaterIfNeeded(() -> connectionManager.startConnection(null, path, finalUrl, false));
          runCells(cells, ipnbFilePanel);
        });
      }
      else {
        runCells(cells, ipnbFilePanel);
      }
    }
  }

  private static void runCells(List<IpnbEditablePanel> cells, IpnbFilePanel ipnbFilePanel) {
    for (IpnbEditablePanel cell : cells) {
      cell.runCell(true);
      ipnbFilePanel.revalidate();
      ipnbFilePanel.repaint();
      ipnbFilePanel.requestFocus();
    }
  }
}


text:
require('./angular-locale_zh-hans-cn');
module.exports = 'ngLocale';


text:
<!DOCTYPE html>

        <title>SalPimenta</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" href="css/normalize.css"/>
        <link rel="stylesheet" href="css/icomoon.css"/>
        <link rel="stylesheet" href="css/rateit.css"/>
        <link rel="stylesheet" href="css/main.css"/>

salpi
mentaBeta

Mi salpimenta

Explorar

Blogs

                        Subir receta...

                        <input type="search" placeholder="Buscar">

                        Usuario
                        5 recetas

Aperitivos

Ensaladas y Verduras

Arroces y Cereales

Sopa y Cremas

Pastas y Pizzas

Legumbres

 Carnes

Pescados y Mariscos

Huevos

Setas y Hongos

Salsas

Postres

Subir Blog

                    <form action="/Salpimenta-backend/index.php?url=registroRecetaControler" enctype="multipart/form-data" method="post" name="formReceta">

Titulo del Blog

                            <input type="text" placeholder="Titulo del Blog">

Enlace al Blog

                            <input type="text" placeholder="Direccion completa">

Autor del Blog

                            <input type="text" placeholder="Autor del Blog">

Sube una Imagen

                            <input type="file" name="img">

Descripcion

                                <textarea name="ingredientes" id="ingredientes"  placeholder="Escribe la lista de ingredientes" cols="45" rows="12"></textarea>

Ejemplo

Pica 2 dientes de ajo y la cebolleta finalmente y ponlos a ponchar en una sartén con un chorrito de aceite. Pica tamien las setas y añádelas Sazona y rehoga bien.

Tipo de Blog

                                Blog: <input type="radio" name="tipoBlog" id="B" value="1">

                                Vlog: <input type="radio" name="tipoBlog" id="V" value="2">

Introduce etiquetas para que encuentren tus recetas

                            <input type="text" name="tags" id="tags">

                            <input type="submit" value="Subir Blog">

                    </form>

Siguenos en

Salpimenta, S.L

C010203040

c/ Agustini 89, 1ºC

28009 Madrid

2014 © Salpimenta,S.L

Aviso Legal

Politica de Privacidad


text:
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400");
@import url("https://fonts.googleapis.com/css?family=Source+Code+Pro");

body {
  font-family: "Source Sans Pro", sans-serif;
  background-color: rgb(255, 255, 255);
}


text:
#ifndef TENSORFLOW_COMPILER_XLA_TESTS_HLO_VERIFIED_TEST_BASE_H_
#define TENSORFLOW_COMPILER_XLA_TESTS_HLO_VERIFIED_TEST_BASE_H_

#include <functional>
#include <memory>
#include <utility>

#include "absl/base/macros.h"
#include "tensorflow/compiler/xla/service/hlo_module.h"
#include "tensorflow/compiler/xla/tests/hlo_test_base.h"

namespace xla {

// An HLO module derived class which verifies itself on destruction. This class
// is intended to be used in unit tests. Any verification errors are raised via
// ADD_FAILURE.
class VerifiedHloModule : public HloModule {
 public:
  VerifiedHloModule(const string& name, const HloModuleConfig& config,
                    bool verifier_layout_sensitive,
                    bool allow_mixed_precision_in_hlo_verifier)
      : HloModule(name, config),
        verifier_(verifier_layout_sensitive,
                  allow_mixed_precision_in_hlo_verifier) {}

  ~VerifiedHloModule() override { VerifyOrAddFailure("in destructor"); }

  // Verifies the module using HloVerifier and returns the status.
  Status Verify();

  // Verifies the module and flags any error with ADD_FAILURE. 'message' is
  // included in the failure message.
  void VerifyOrAddFailure(const string& message);

 private:
  HloVerifier verifier_;
};

// A base class for HLO tests that stores a default VerifiedHloModule.
class HloVerifiedTestBase : public HloTestBase {
 protected:
  HloVerifiedTestBase(bool layout_sensitive = false,
                      bool allow_mixed_precision = false);

  // Constructs a default shape verifier.
  std::unique_ptr<ShapeVerifier> MakeShapeVerifier();

  // Returns the default HloModule, lazily creating it if necessary via
  // HloTestBase::CreateNewModule().
  ABSL_DEPRECATED("Use CreateNewVerifiedModule() instead.")
  HloModule& module();

  ABSL_DEPRECATED("Use ParseAndReturnVerifiedModule() instead.")
  void ParseAndVerifyModule(absl::string_view hlo_text,
                            const HloModuleConfig& config = HloModuleConfig());

  // Parses the given string and returns module as a VerifiedHloModule.
  StatusOr<std::unique_ptr<VerifiedHloModule>> ParseAndReturnVerifiedModule(
      absl::string_view hlo_text,
      const HloModuleConfig& config = HloModuleConfig());

  // Creates a new module for a test, and stores it in modules_ so it can be
  // verified. Intentionally hides HloTestBase::CreateNewModule, to prevent
  // creation of unverified modules.
  ABSL_DEPRECATED("Use CreateNewVerifiedModule() instead.")
  HloModule* CreateNewModule(const string& name = TestName());

  // Creates and returns a verified HLO module with the given name.
  std::unique_ptr<VerifiedHloModule> CreateNewVerifiedModule(
      const string& name = TestName());

 private:
  // It is confusing to store modules created by module() and CreateNewModule()
  // in different fields, but it allows us to migrate tests to
  // HloVerifiedTestBase more easily, so it's a win because we can verify more
  // modules. See b/80488902.
  //
  // Lazily populated. Access via module().
  std::unique_ptr<VerifiedHloModule> module_;

  // Populated by calls to CreateNewModule.
  std::vector<std::unique_ptr<VerifiedHloModule>> modules_;

  bool verifier_layout_sensitive_;
  bool allow_mixed_precision_in_hlo_verifier_;
};

}  // namespace xla

#endif  // TENSORFLOW_COMPILER_XLA_TESTS_HLO_VERIFIED_TEST_BASE_H_