text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2016 Google Inc. All Rights Reserved.
  ~
  ~ 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.
  -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.google.cloud.runtimes</groupId>
    <artifactId>jetty-parent</artifactId>
    <version>0.1.0-SNAPSHOT</version>
  </parent>
  <groupId>com.google.cloud.runtimes.tests</groupId>
  <artifactId>tests-parent</artifactId>
  <name>Jetty Runtime :: Tests :: Parent</name>
  <packaging>pom</packaging>
  <properties>
    <checkstyle.skip>false</checkstyle.skip>
    <!-- default image name for local tests -->
    <jetty.test.image>jetty:${docker.tag.long}</jetty.test.image>
  </properties>
  <modules>
    <module>gcloud-testing-core</module>
    <module>test-war-smoke</module>
    <module>runtimes-common-testing</module>
  </modules>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.19.1</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.surefire</groupId>
              <artifactId>surefire-junit47</artifactId>
              <version>2.19.1</version>
            </dependency>
          </dependencies>
          <configuration>
            <skipTests>true</skipTests>
            <includes>
              <include>%regex[.*IntegrationTest.*]</include>
            </includes>
            <systemPropertyVariables>
              <app.deploy.port>${local.app.port}</app.deploy.port>
            </systemPropertyVariables>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <excludes>
              <exclude>**/*IntegrationTest.java</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>io.fabric8</groupId>
          <artifactId>docker-maven-plugin</artifactId>
          <version>0.19.0</version>
          <configuration>
            <images>
              <image>
                <name>${project.artifactId}:${project.version}</name>
                <alias>${project.artifactId}</alias>
                <run>
                  <ports>
                    <port>${local.app.port}:8080</port>
                  </ports>
                  <env>
                    <JETTY_MODULES_ENABLE>gzip</JETTY_MODULES_ENABLE>
                  </env>
                </run>
              </image>
            </images>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <!-- ensure no artifacts are published during deploy -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>src/main/docker</directory>
        <filtering>true</filtering>
        <targetPath>${project.build.directory}/docker</targetPath>
      </resource>
      <resource>
        <directory>src/main/appengine</directory>
        <filtering>true</filtering>
        <targetPath>${project.build.directory}/appengine-staging</targetPath>
      </resource>
      <resource>
        <directory>src/main/docker</directory>
        <filtering>true</filtering>
        <targetPath>${project.build.directory}/appengine-staging</targetPath>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <targetPath>
          ${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/classes
        </targetPath>
      </resource>
    </resources>
  </build>
</project>


text:
import time
import urllib
from datetime import datetime
from mock import patch

from django.utils import unittest

from tests.case.api import ApiTestCase

import logging
mozlogger = logging.getLogger('moztrap.test')

class ApiCrudCases(ApiTestCase):
    """Re-usable test cases for Create, Read, Update, and Delete.

    Child classes must implement the following abstract methods:
      - factory(self)                           (property)
      - resource_name(self)                     (property)
      - permission(self)                        (property)
      - new_object_data(self)                   (property)
      - backend_object(self, id)                (method)
      - backend_data(self, backend_object)      (method)

    If any of these properties / methods are called on a child class without
    having implemented them, a NotImplementedError will be thrown.

    The following methods have default behavior, but may be extended:
     - manipulate_edit_data                     (method)
     - read_create_fields                       (property)

    Child classes are may extend setUp() to provide required fixtures.

    The test methods provided by this class are:
      - test_create()
      - test_create_fails_with_wrong_perms()
      - test_read_list()
      - test_read_detail()
      - test_update_detail()
      - test_change_fk_should_error()
      - test_update_without_fk()
      - test_update_list_forbidden()
      - test_update_fails_without_creds()
      - test_delete_detail_permanent()
      - test_delete_detail_soft()
      - test_delete_list_forbidden()
      - test_delete_fails_with_wrong_perms()

    Child classes may override these methods if necessary.
    """

    @property
    def factory(self):
        """The factory to use to create fixtures of the object under test.
        Example: self.F.SuiteFactory()
        """
        raise NotImplementedError

    @property
    def is_abstract_class(self):
        """This is used to keep the tests from running them on the abstract
        class.

        It is needed because the django test collector matches path names to
        /test*.py/, which all matches .py files in the tests/ directory.
        The test framework will run the tests for ApiCrudCases, but all of them
        will return without doing anything or asserting on anything.
        """
        if self.__class__.__name__ == "ApiCrudCases":
            return True
        return False

    @property
    def resource_name(self):
        """String defining the resource name.
        Example: "suite"
        """
        raise NotImplementedError

    @property
    def permission(self):
        """String defining the permission required for
        Create, Update, and Delete.
        Example: "library.manage_suites"
        """
        raise NotImplementedError

    @property
    def wrong_permissions(self):
        """String defining permissions that will NOT work for this object.
        This method will only need to be overwritten in ProductResourceTest.
        """
        if self.__class__.__name__ == "ProductResource":
            raise NotImplementedError
        else:
            return "core.manage_products"

    @property
    def new_object_data(self):
        """Generates a dictionary containing the field names and auto-generated
        values needed to create a unique object.

        The output of this method can be sent in the payload parameter of a
        POST message.
        """
        raise NotImplementedError

    def backend_object(self, id):
        """Returns the object from the backend, so you can query it's values in
        the database for validation.
        """
        raise NotImplementedError

    def backend_data(self, backend_object):
        """Query's the database for the object's current values. Output is a
        dictionary that should match the result of getting the object's detail
        via the API, and can be used to verify API output.

        Note: both keys and data should be in unicode
        """
        raise NotImplementedError

    def clean_backend_data(self, backend_obj):
        """Returns backend_data, minus any keys not generated by
        new_object_data.
        Use this for comparing to input fields of a POST or PUT.

        Should be extended for objects that have one-to-many foriegn keys.
        """
        data = self.backend_data(backend_obj)
        data.pop("id")
        data.pop("resource_uri")
        return data

    def backend_meta_data(self, backend_obj):
        """Query's the database for the object's current values for:
          - created_on
          - created_by
          - modified_on
          - modified_by
          - deleted_on
          - deleted_by

        Returns a dictionary of these keys and their values.
        Used to verify that the CRUD methods are updating these
        values.
        """
        actual = {}
        try:
            actual["created_by"] = backend_obj.created_by.username
        except AttributeError:
            actual["created_by"] = None
        try:
            actual["modified_by"] = backend_obj.modified_by.username
        except AttributeError:
            actual["modified_by"] = None
        try:
            actual["deleted_by"] = backend_obj.deleted_by.username
        except AttributeError:
            actual["deleted_by"] = None

        actual["created_on"] = backend_obj.created_on
        actual["modified_on"] = backend_obj.modified_on
        actual["deleted_on"] = backend_obj.deleted_on

        return actual

    def manipulate_edit_data(self, fixture, fields):
        """replace the data for the foreign keys with the current values."""

        for fk in self.read_create_fields:
            fields[fk] = unicode(
                self.get_detail_url(fk, str(getattr(fixture, fk).id)))

        return fields

    @property
    def read_create_fields(self):
        """List of fields that are required for create but read-only for update."""
        return []

    @property
    def datetime(self):
        """May be used to provide mostly-unique strings"""
        return datetime.utcnow().isoformat()

    def setUp(self):
        """Set-up for all CRUD test cases.
        Sets the follwing attributes on self:
          - user
          - apikey
          - credentials

        self.credentials can be sent in the params parameter of POST, PUT, and
        DELETE messages, but should not be required for GET messages.

        Also mocks datetime.utcnow() with datetime in self.utcnow.
        """
        if self.is_abstract_class:
            return

        # credentials
        self.user = self.F.UserFactory.create(permissions=[self.permission])
        self.apikey = self.F.ApiKeyFactory.create(owner=self.user)
        self.credentials = {
            "username": self.user.username,
            "api_key": self.apikey.key}

        # mocking
        self.utcnow = datetime(2011, 12, 13, 22, 39)
        patcher = patch("moztrap.model.mtmodel.datetime")
        self.mock_utcnow = patcher.start().datetime.utcnow
        self.mock_utcnow.return_value = self.utcnow
        self.addCleanup(patcher.stop)

    def _id_from_uri(self, uri):
        return uri.split('/')[-2]

    # test cases

    def test_create(self):
        """Creates an object using the API.
        Verifies that the fields sent in the message have been set in
        the database.
        Verifies that the created_on and created_by have been set in
        the database.
        """
        if self.is_abstract_class:
            return
        mozlogger.info('test_create')

        # get data for creation
        fields = self.new_object_data

        # do the create
        res = self.post(
            self.get_list_url(self.resource_name),
            params=self.credentials,
            payload=fields,
            )

        # make sure response included detail uri
        object_id = self._id_from_uri(res.headers["location"])
        self.assertIsNotNone(object_id)

        # get data from backend
        backend_obj = self.backend_object(object_id)
        created_object_data = self.clean_backend_data(backend_obj)

        # compare backend data to desired data
        self.maxDiff = None
        mozlogger.debug("actual: %s", created_object_data)
        mozlogger.debug("expected: %s", fields)
        self.assertEqual(created_object_data, fields)

        # make sure meta data is correct
        created_obj_meta_data = self.backend_meta_data(backend_obj)
        self.assertEqual(
            created_obj_meta_data["created_by"], self.user.username)
        self.assertEqual(created_obj_meta_data["created_on"], self.utcnow)
        self.assertEqual(
            created_obj_meta_data["modified_by"], self.user.username)
        self.assertEqual(created_obj_meta_data["modified_on"], self.utcnow)

    def test_create_fails_with_wrong_perms(self):
        """Attempts to create an object using a user who has the wrong perms.
        Verifies that the POST message gets a 401 response.
        """
        if self.is_abstract_class:
            return
        mozlogger.info('test_create_fails_with_wrong_perms')

        # get data for creation
        fields = self.new_object_data

        # get user with wrong permissions
        user = self.F.UserFactory.create(permissions=[self.wrong_permissions])
        apikey = self.F.ApiKeyFactory.create(owner=self.user)
        credentials = {"username": user.username, "api_key": apikey.key}

        res = self.post(
            self.get_list_url(self.resource_name),
            params=credentials,
            payload=fields,
            status=401,
            )

    def test_read_list(self):
        """Performs a GET on the list without credentials.
        Verifies that the meta data returned by the API is correct.
        Verifies that the objects returned by the API have the correct data.
        """
        if self.is_abstract_class:
            return
        mozlogger.info('test_read_list')

        # create fixture
        fixture1 = self.factory
        fixture2 = self.factory

        # fetch list (ordered so assert won't flake)
        res = self.get_list(params={'order_by': 'id'})  # no creds

        act = res.json

        act_meta = act["meta"]
        exp_meta = {
            u"limit": 20,
            u"next": None,
            u"offset": 0,
            u"previous": None,
            u"total_count": 2,
            }

        self.assertEquals(act_meta, exp_meta)

        act_objects = act["objects"]
        exp_objects = [
            self.backend_data(fixture1),
            self.backend_data(fixture2)
            ]

        self.maxDiff = None
        self.assertEqual(exp_objects, act_objects)

    def _test_filter_list_by(self, key, value, expected_number_of_results):
        """Performs a get on the list with the supplied filter.
        Validates that the results meet the criteria.

        ::example::

        self._test_filter_list_by(u'name', u'foo', 1)
        self._test_filter_list_by(u'product', u'', 3)
        """

        res = self.get_list(params={key: value, u'limit': 100})
        objects = res.json["objects"]

        # validate
        self.assertEqual(len(objects), expected_number_of_results)
        for obj in objects:
            if value:
                # can't use assertEqual here because for foriegn keys,
                # the filter must be an id
                # but the value in the response is an uri
                self.assertTrue(str(value) in obj[key])
            else:
                # case for value being None
                self.assertEqual(value, obj[key])

    def test_read_detail(self):
        """Performs a GET on the object detail without credentials.
        Verifies that the object returned by the API has the correct data.
        """
        if self.is_abstract_class:
            return
        mozlogger.info('test_read_detail')

        # create fixture
        fixture1 = self.factory

        # fetch detail
        res = self.get_detail(fixture1.id)  # no creds

        actual = res.json

        expected = self.backend_data(fixture1)

        self.maxDiff = None
        self.assertEqual(expected, actual)

    def test_update_detail(self):
        """Performs a PUT on the object detail.
        Verifies that the values in the database entry for the object has
        been updated.
        Verifies that the object's modified_on and modified_by have been
        updated.
        """
        if self.is_abstract_class:
            return
        mozlogger.info('test_update_detail')

        # create fixture
        fixture1 = self.factory
        # change modified on to 2 hours earlier than utcnow
        fixture1.modified_on = datetime(2011, 12, 13, 20, 39)
        meta_before = self.backend_meta_data(fixture1)
        obj_id = str(fixture1.id)
        fields = self.new_object_data

        # make read-only fields unchanging
        fields = self.manipulate_edit_data(fixture1, fields)

        # do put
        res = self.put(
            self.get_detail_url(self.resource_name, obj_id),
            params=self.credentials,
            data=fields
            )

        # make sure object has been updated in the database
        fixture1 = self.refresh(fixture1)
        backend_data = self.clean_backend_data(fixture1)

        self.maxDiff = None
        self.assertEqual(fields, backend_data)

        # make sure 'modified' meta data has been updated
        meta_after = self.backend_meta_data(fixture1)
        self.assertEqual(meta_after["modified_by"], self.user.username)
        self.assertEqual(meta_after["modified_on"], self.utcnow)
        self.assertNotEqual(
            meta_before['modified_on'], meta_after['modified_on'])

    def test_change_fk_should_error(self):
        """Trying to change a read-only foreign key should result in a 400 error."""

        if self.is_abstract_class:
            return

        for fk in self.read_create_fields:
            mozlogger.info('test_change_fk_should_error %s' % fk)

            # create fixture
            fixture1 = self.factory
            obj_id = str(fixture1.id)
            fields = self.new_object_data

            # make sure only the fk under test is inappropriate
            if len(self.read_create_fields) > 1:
                fk_value = fields[fk]
                fields = self.manipulate_edit_data(fixture1, fields)
                fields[fk] = fk_value

            # do put
            res = self.put(
                self.get_detail_url(self.resource_name, obj_id),
                params=self.credentials,
                data=fields,
                status=400,
            )

            assert res.text == str(
                "%s of an existing %s " % (fk, self.resource_name) +
                "may not be changed.")

    def test_update_without_fk(self):
        """fk's cannot be changed, so they are not required on edit."""

        if self.is_abstract_class:
            return

        # fixtures
        fixture1 = self.factory

        for fk in self.read_create_fields:
            mozlogger.info('test_update_without_fk {0}'.format(fk))

            fields = self.backend_data(fixture1)
            fields = self.manipulate_edit_data(fixture1, fields)
            fields.pop(fk)

            # do put
            res = self.put(
                self.get_detail_url(self.resource_name, fixture1.id),
                params=self.credentials,
                data=fields,
            )

    def test_update_list_forbidden(self):
        """Attempts to PUT to the list uri.
        Verifies that the request is rejected with a 405 error.
        """
        if self.is_abstract_class:
            return
        mozlogger.info('test_update_list_forbidden')

        # create fixturs
        fixture1 = self.factory
        fixture2 = self.factory

        backend_obj1 = self.backend_object(fixture1.id)
        backend_obj2 = self.backend_object(fixture2.id)
        fields1 = self.backend_data(backend_obj1)
        fields2 = self.backend_data(backend_obj2)
        fields1.update(self.new_object_data)
        fields2.update(self.new_object_data)
        data = [fields1, fields2]

        # do put
        res = self.put(
            self.get_list_url(self.resource_name),
            params=self.credentials,
            data=data,
            status=405
            )

    def test_update_fails_without_creds(self):
        """Attempts to PUT to the object detail uri without credentials.
        Verifies that the request is denied with a 401 error.
        """
        if self.is_abstract_class:
            return
        mozlogger.info('test_update_fails_without_creds')

        # create fixture
        fixture1 = self.factory
        backend_obj = self.backend_object(fixture1.id)
        obj_id = str(fixture1.id)
        fields = self.backend_data(backend_obj)
        fields.update(self.new_object_data)

        # do put
        res = self.put(
            self.get_detail_url(self.resource_name, obj_id),
            data=fields,
            status=401,
            )

    def test_delete_detail_permanent(self):
        """Tests that an object can be deleted permanently.
        Verifies that the object no longer appears in the database after
        the delete.
        """
        if self.is_abstract_class:
            return
        mozlogger.info('test_delete_detail_permanent')

        # create fixture
        fixture1 = self.factory
        obj_id = str(fixture1.id)

        # check meta data before
        meta_before_delete = self.backend_meta_data(
            self.backend_object(obj_id))
        self.assertIsNone(meta_before_delete["deleted_on"])
        self.assertIsNone(meta_before_delete["deleted_by"])

        # do delete
        params = self.credentials
        params.update({"permanent": True})
        self.delete(self.resource_name, obj_id, params=params, status=204)

        from django.core.exceptions import ObjectDoesNotExist

        with self.assertRaises(ObjectDoesNotExist):
            meta_after_delete = self.backend_meta_data(
                self.backend_object(obj_id))

    def test_delete_detail_soft(self):
        """Tests that an object can be 'soft' deleted.
        Verifies that the object still exists in the database.
        Verifies that the object's deleted_by and deleted_on properties have
        been set.
        """
        if self.is_abstract_class:
            return
        mozlogger.info('test_delete_detail_soft')

        # create fixture
        fixture1 = self.factory
        obj_id = str(fixture1.id)
        backend_obj = self.backend_object(obj_id)
        # set created_on to 2 hours earlier than utcnow
        backend_obj.created_on = datetime(2011, 12, 13, 20, 39)

        # check meta data before
        meta_before_delete = self.backend_meta_data(backend_obj)
        self.assertIsNone(meta_before_delete["deleted_on"])
        self.assertIsNone(meta_before_delete["deleted_by"])

        # do delete
        self.delete(
            self.resource_name,
            obj_id,
            params=self.credentials,
            status=204)

        # check meta data after
        meta_after_delete = self.backend_meta_data(
            self.backend_object(obj_id))
        self.assertEqual(meta_after_delete["deleted_on"], self.utcnow)
        self.assertEqual(meta_after_delete["deleted_by"], self.user.username)
        self.assertNotEqual(
            meta_before_delete["deleted_on"], meta_after_delete["deleted_on"])

    def test_delete_list_forbidden(self):
        """Attempts to send a DELETE message to the list uri.
        Verifies that the message recieves a 405 error.
        """
        if self.is_abstract_class:
            return
        mozlogger.info('test_delete_list_forbidden')

        url = self.get_list_url(self.resource_name)
        url = "{0}?{1}".format(url, urllib.urlencode(self.credentials))
        self.app.delete(url, status=405)

    def test_delete_fails_with_wrong_perms(self):
        """Attempts to send a DELETE message with the wrong credentials.
        Verifies that the message recieves a 401 error.
        Verifies that object still exists.
        Verifies that delete meta data has not been set on object.
        """
        if self.is_abstract_class:
            return
        mozlogger.info('test_delete_fails_with_wrong_perms')

        # create fixture
        fixture1 = self.factory
        obj_id = str(fixture1.id)

        # get user with wrong permissions
        user = self.F.UserFactory.create(permissions=[self.wrong_permissions])
        apikey = self.F.ApiKeyFactory.create(owner=user)
        credentials = {"username": user.username, "api_key": apikey.key}

        # do delete
        self.delete(self.resource_name, obj_id, params=credentials, status=401)

        # make sure object is still found
        backend_obj = self.backend_object(obj_id)

        # and delete meta data has not been set
        meta_after_delete = self.backend_meta_data(backend_obj)
        self.assertIsNone(meta_after_delete["deleted_on"])
        self.assertIsNone(meta_after_delete["deleted_by"])

redpajama_set_name: RedPajamaGithub


text:
var gTestfile = 'uc-002.js';

test();

function test()
{
  enterFunc ("test");

  printStatus ("Unicode non-breaking space character test.");
  printBugNumber (23613);

  reportCompare ("no error", eval("'no'\u00A0+ ' error'"),
		 "Unicode non-breaking space character test.");

  var str = "\u00A0foo";
  reportCompare (0, str.search(/^\sfoo$/),
		 "Unicode non-breaking space character regexp test.");

  exitFunc ("test");
}


text:
#ifndef IMPORTKEYDIALOG_H
#define IMPORTKEYDIALOG_H

#include <QDialog>

QT_BEGIN_NAMESPACE
class QDataWidgetMapper;
QT_END_NAMESPACE

namespace Ui {
    class ImportKeyDialog;
}
class AddressTableModel;

/** Dialog for editing an address and associated information.
 */
class ImportKeyDialog : public QDialog
{
    Q_OBJECT

public:

    explicit ImportKeyDialog(QWidget *parent = 0);
    ~ImportKeyDialog();

    void setModel(AddressTableModel *model);
    void loadRow(int row);

    void accept();

    QString getAddress() const;
    void setAddress(const QString &address);
    void setPrivateKey(const QString &privkey);
    void setLabel(const QString &label);

private:
    bool saveCurrentRow();

    Ui::ImportKeyDialog *ui;
    QDataWidgetMapper *mapper;
    AddressTableModel *model;

    QString label;
    QString address;
    QString privateKey;
};

#endif // IMPORTKEYDIALOG_H


text:
class Myaccount::StoreCreditsController < Myaccount::BaseController

  def show
    @store_credit = current_user.store_credit
  end

  private

  def form_info

  end
end


text:
define('plug',{
    pluginBuilder: './plugBuilder',
    load: function () {
         throw 'Should be using pluginBuilder';
    }
});

define('plug!one',[],function () { return 'one';});

define('main',['plug!one'], function (one) {
    console.log('one === ' + one);
});


text:
#pragma once
#include <aws/rekognition/Rekognition_EXPORTS.h>
#include <aws/rekognition/model/VideoJobStatus.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/rekognition/model/VideoMetadata.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/rekognition/model/PersonMatch.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace Rekognition
{
namespace Model
{
  class AWS_REKOGNITION_API GetFaceSearchResult
  {
  public:
    GetFaceSearchResult();
    GetFaceSearchResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    GetFaceSearchResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The current status of the face search job.

     */
    inline const VideoJobStatus& GetJobStatus() const{ return m_jobStatus; }

    /**
     *
The current status of the face search job.

     */
    inline void SetJobStatus(const VideoJobStatus& value) { m_jobStatus = value; }

    /**
     *
The current status of the face search job.

     */
    inline void SetJobStatus(VideoJobStatus&& value) { m_jobStatus = std::move(value); }

    /**
     *
The current status of the face search job.

     */
    inline GetFaceSearchResult& WithJobStatus(const VideoJobStatus& value) { SetJobStatus(value); return *this;}

    /**
     *
The current status of the face search job.

     */
    inline GetFaceSearchResult& WithJobStatus(VideoJobStatus&& value) { SetJobStatus(std::move(value)); return *this;}

    /**
     *
If the job fails, StatusMessage provides a descriptive error
     * message.

     */
    inline const Aws::String& GetStatusMessage() const{ return m_statusMessage; }

    /**
     *
If the job fails, StatusMessage provides a descriptive error
     * message.

     */
    inline void SetStatusMessage(const Aws::String& value) { m_statusMessage = value; }

    /**
     *
If the job fails, StatusMessage provides a descriptive error
     * message.

     */
    inline void SetStatusMessage(Aws::String&& value) { m_statusMessage = std::move(value); }

    /**
     *
If the job fails, StatusMessage provides a descriptive error
     * message.

     */
    inline void SetStatusMessage(const char* value) { m_statusMessage.assign(value); }

    /**
     *
If the job fails, StatusMessage provides a descriptive error
     * message.

     */
    inline GetFaceSearchResult& WithStatusMessage(const Aws::String& value) { SetStatusMessage(value); return *this;}

    /**
     *
If the job fails, StatusMessage provides a descriptive error
     * message.

     */
    inline GetFaceSearchResult& WithStatusMessage(Aws::String&& value) { SetStatusMessage(std::move(value)); return *this;}

    /**
     *
If the job fails, StatusMessage provides a descriptive error
     * message.

     */
    inline GetFaceSearchResult& WithStatusMessage(const char* value) { SetStatusMessage(value); return *this;}

    /**
     *
If the response is truncated, Amazon Rekognition Video returns this token
     * that you can use in the subsequent request to retrieve the next set of search
     * results.

     */
    inline const Aws::String& GetNextToken() const{ return m_nextToken; }

    /**
     *
If the response is truncated, Amazon Rekognition Video returns this token
     * that you can use in the subsequent request to retrieve the next set of search
     * results.

     */
    inline void SetNextToken(const Aws::String& value) { m_nextToken = value; }

    /**
     *
If the response is truncated, Amazon Rekognition Video returns this token
     * that you can use in the subsequent request to retrieve the next set of search
     * results.

     */
    inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); }

    /**
     *
If the response is truncated, Amazon Rekognition Video returns this token
     * that you can use in the subsequent request to retrieve the next set of search
     * results.

     */
    inline void SetNextToken(const char* value) { m_nextToken.assign(value); }

    /**
     *
If the response is truncated, Amazon Rekognition Video returns this token
     * that you can use in the subsequent request to retrieve the next set of search
     * results.

     */
    inline GetFaceSearchResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;}

    /**
     *
If the response is truncated, Amazon Rekognition Video returns this token
     * that you can use in the subsequent request to retrieve the next set of search
     * results.

     */
    inline GetFaceSearchResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;}

    /**
     *
If the response is truncated, Amazon Rekognition Video returns this token
     * that you can use in the subsequent request to retrieve the next set of search
     * results.

     */
    inline GetFaceSearchResult& WithNextToken(const char* value) { SetNextToken(value); return *this;}

    /**
     *
Information about a video that Amazon Rekognition analyzed.
     * Videometadata is returned in every page of paginated responses from
     * a Amazon Rekognition Video operation.

     */
    inline const VideoMetadata& GetVideoMetadata() const{ return m_videoMetadata; }

    /**
     *
Information about a video that Amazon Rekognition analyzed.
     * Videometadata is returned in every page of paginated responses from
     * a Amazon Rekognition Video operation.

     */
    inline void SetVideoMetadata(const VideoMetadata& value) { m_videoMetadata = value; }

    /**
     *
Information about a video that Amazon Rekognition analyzed.
     * Videometadata is returned in every page of paginated responses from
     * a Amazon Rekognition Video operation.

     */
    inline void SetVideoMetadata(VideoMetadata&& value) { m_videoMetadata = std::move(value); }

    /**
     *
Information about a video that Amazon Rekognition analyzed.
     * Videometadata is returned in every page of paginated responses from
     * a Amazon Rekognition Video operation.

     */
    inline GetFaceSearchResult& WithVideoMetadata(const VideoMetadata& value) { SetVideoMetadata(value); return *this;}

    /**
     *
Information about a video that Amazon Rekognition analyzed.
     * Videometadata is returned in every page of paginated responses from
     * a Amazon Rekognition Video operation.

     */
    inline GetFaceSearchResult& WithVideoMetadata(VideoMetadata&& value) { SetVideoMetadata(std::move(value)); return *this;}

    /**
     *
An array of persons, PersonMatch, in the video whose face(s) match the
     * face(s) in an Amazon Rekognition collection. It also includes time information
     * for when persons are matched in the video. You specify the input collection in
     * an initial call to StartFaceSearch. Each Persons
     * element includes a time the person was matched, face match details
     * (FaceMatches) for matching faces in the collection, and person
     * information (Person) for the matched person.

     */
    inline const Aws::Vector<PersonMatch>& GetPersons() const{ return m_persons; }

    /**
     *
An array of persons, PersonMatch, in the video whose face(s) match the
     * face(s) in an Amazon Rekognition collection. It also includes time information
     * for when persons are matched in the video. You specify the input collection in
     * an initial call to StartFaceSearch. Each Persons
     * element includes a time the person was matched, face match details
     * (FaceMatches) for matching faces in the collection, and person
     * information (Person) for the matched person.

     */
    inline void SetPersons(const Aws::Vector<PersonMatch>& value) { m_persons = value; }

    /**
     *
An array of persons, PersonMatch, in the video whose face(s) match the
     * face(s) in an Amazon Rekognition collection. It also includes time information
     * for when persons are matched in the video. You specify the input collection in
     * an initial call to StartFaceSearch. Each Persons
     * element includes a time the person was matched, face match details
     * (FaceMatches) for matching faces in the collection, and person
     * information (Person) for the matched person.

     */
    inline void SetPersons(Aws::Vector<PersonMatch>&& value) { m_persons = std::move(value); }

    /**
     *
An array of persons, PersonMatch, in the video whose face(s) match the
     * face(s) in an Amazon Rekognition collection. It also includes time information
     * for when persons are matched in the video. You specify the input collection in
     * an initial call to StartFaceSearch. Each Persons
     * element includes a time the person was matched, face match details
     * (FaceMatches) for matching faces in the collection, and person
     * information (Person) for the matched person.

     */
    inline GetFaceSearchResult& WithPersons(const Aws::Vector<PersonMatch>& value) { SetPersons(value); return *this;}

    /**
     *
An array of persons, PersonMatch, in the video whose face(s) match the
     * face(s) in an Amazon Rekognition collection. It also includes time information
     * for when persons are matched in the video. You specify the input collection in
     * an initial call to StartFaceSearch. Each Persons
     * element includes a time the person was matched, face match details
     * (FaceMatches) for matching faces in the collection, and person
     * information (Person) for the matched person.

     */
    inline GetFaceSearchResult& WithPersons(Aws::Vector<PersonMatch>&& value) { SetPersons(std::move(value)); return *this;}

    /**
     *
An array of persons, PersonMatch, in the video whose face(s) match the
     * face(s) in an Amazon Rekognition collection. It also includes time information
     * for when persons are matched in the video. You specify the input collection in
     * an initial call to StartFaceSearch. Each Persons
     * element includes a time the person was matched, face match details
     * (FaceMatches) for matching faces in the collection, and person
     * information (Person) for the matched person.

     */
    inline GetFaceSearchResult& AddPersons(const PersonMatch& value) { m_persons.push_back(value); return *this; }

    /**
     *
An array of persons, PersonMatch, in the video whose face(s) match the
     * face(s) in an Amazon Rekognition collection. It also includes time information
     * for when persons are matched in the video. You specify the input collection in
     * an initial call to StartFaceSearch. Each Persons
     * element includes a time the person was matched, face match details
     * (FaceMatches) for matching faces in the collection, and person
     * information (Person) for the matched person.

     */
    inline GetFaceSearchResult& AddPersons(PersonMatch&& value) { m_persons.push_back(std::move(value)); return *this; }

  private:

    VideoJobStatus m_jobStatus;

    Aws::String m_statusMessage;

    Aws::String m_nextToken;

    VideoMetadata m_videoMetadata;

    Aws::Vector<PersonMatch> m_persons;
  };

} // namespace Model
} // namespace Rekognition
} // namespace Aws


text:
 game.PlayerEntity = me.Entity.extend({
    init: function(x, y, settings) {
        this.setSuper(x, y);
        this.setPlayerTimers();
        this.setAttributes();
        this.type = "PlayerEntity";
        this.setFlags();

        me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH);

        this.addAnimation();

        this.renderable.setCurrentAnimation("idle");
    },

     setSuper: function(x, y) {
        this._super(me.Entity, 'init', [x, y, {
                image: "player",
                width: 64,
                height: 64,
                spritewidth: "64",
                spriteheight: "64",
                getShape: function() {
                    return(new me.Rect(0, 0, 64, 64)).toPolygon();

                }
            }]);
    },

     setPlayerTimers: function() {
        this.now = new Date().getTime();
        this.lastHit = this.now;
        this.lastAttack = new Date().getTime();
    },

     setAttributes: function() {
        this.health = game.data.playerHealth;
        this.body.setVelocity(game.data.playerMoveSpeed, 20);
        this.attack = game.data.playerAttack;

    },

     setFlags: function() {
        //keeps track of which direction your player is going
        this.facing = "right";
        this.dead = "false";
        this.attacking = "false";
    },

     addAnimation: function() {
        this.renderable.addAnimation("idle", [78]);
        this.renderable.addAnimation("walk", [117, 118, 119, 120, 121, 122, 123, 124, 125], 80);
        this.renderable.addAnimation("attack", [65, 66, 67, 68, 69, 70, 71, 72], 80);
    },

     update: function(delta) {
        this.now = new Date().getTime();

        this.dead = this.checkIfDead();

        this.checkKeyPressAndMove();

        this.setAnimation();

        me.collision.check(this, true, this.collideHandler.bind(this), true);
        this.body.update(delta);

        this._super(me.Entity, "update", [delta]);
        return true;

   },

     checkIfDead: function() {
        if (this.health <= 0) {
            return true;
        }
        return false;
    },

     checkKeyPressAndMove: function() {
        if (this.attacking) {
            //sets the posisiton of my X by adding the velocity defined above if set velocioty and multiplying it by me.timer.tick//
            //makes the movement looks smooth
            this.body.vel.x += this.body.accel.x * me.timer.tick;
            this.flipX(true);
        } else if (me.input.isKeyPressed("left")) {
            this.facing = "left";
            this.flipX(false);
            this.body.vel.x -= this.body.accel.x * me.timer.tick;

        } else {
            this.body.vel.x = 0;
        }

        if (me.input.isKeyPressed("up") && !this.body.jumping && !this.body.falling) {
            this.body.jumping = true;
            this.body.vel.y -= this.body.accel.y * me.timer.tick;
        }
        this.attacking = me.input.isKeyPressed("right");
    },

     setAnimation: function() {
        if (me.input.isKeyPressed("attack")) {
            if (!this.renderable.isCurrentAnimation("attack")) {
                //sets the current animation to attack and then returns to the idle animation
                this.renderable.setCurrentAnimation("attack", "idle");
                //makes it so that the animation starts again it starts from the beginning animation
                //and not from the animmation that it was currently in
                this.renderable.setAnimationFrame();
            }
        }
        else if (this.body.vel.x !== 0 && !this.renderable.isCurrentAnimation("attack")) {
            if (!this.renderable.isCurrentAnimation("walk")) {
                this.renderable.setCurrentAnimation("walk");
            }
        } else if (!this.renderable.isCurrentAnimation("attack")) {
            this.renderable.setCurrentAnimation("idle");
        }
    },

     loseHealth: function(damage) {
        this.health = this.health - damage;
        console.log = ("this.health");
    },

     collideHandler: function(response) {
        if (response.b.type === 'EnemyBase') {
        } else if (response.b.type === 'EnemyCreep') {
            this.collideWithEnemyCreep(response);
        }
    },

     collideWithEnemyBase: function(response) {
        var ydif = this.pos.y - response.b.pos.y;
        var xdif = this.pos.x - response.b.pos.x;

        console.log("xdif" + xdif + "ydif" + ydif);

        if (ydif < -40 && xdif < 70 && xdif > -35) {
            this.body.falling = false;
            this.body.vel.y = -1;
        } else if (xdif > -35 && this.facing === 'right' && (xdif < 0) && ydif > -50) {
            this.body.vel.x = 0;
            this.pos.x = this.pos.x - 1;
        } else if (xdif < 70 && this.facing === 'left' && (xdif > 0)) {
            this.body.vel.x = 0;
            this.body.x = this.pos.x + 1;
        }

        if (this, renderable.isCurrentAnimmation("attack") && this.now - this.lastHit >= game.data.playerAttackTimer) {
            this.lastHit = this.now;
            response.loseHealth(game.data.playerAttack);
        }
    },

    collideWithEnemyCreep: function (response){
          var xdif = this.pos.x - response.b.pos.x;
            var ydif = this.pos.y - response.b.pos.y;

           this.stopMovement(xdif);
           this.checkAttack(xdif,ydif,response);

           if(this.checkAttack(xdif,ydif)){
               if(response.b.health <= game.data.playerAttack){
                    //when the creeps is killed adds one gold for the creep death
                    game.data.gold += 1;
                    console.log("Current Gold:" + game.data.gold);
                }

                response.b.loseHealth(game.data.playerAttack);

           };

            if(this.checkAttack(xdif,ydif)){
               if(response.b.health <= game.data.playerAttack){
                    //when the creeps is killed adds one gold for the creep death
                    game.data.gold += 1;
                    console.log("Current Gold:" + game.data.gold);
                }

                response.b.loseHealth(game.data.playerAttack);

           };
    },

     stopMovement: function(xdif){
         if(xdif>0){
                this.pos.x = this.pos.x=1;
                if(this.facing==='left'){
                    this.body.vel.x = 0;
                }
            }else{
                this.pos.x = this.pos.x - 1;
                if(this.facing==='right'){
                    this.body.vel.x = 0;
                }
            }
    },

    checkAttack: function (xdif,ydif,response){
                  if(this.renderable.isCurrentAnimation("attack") && this.now-this.lastHit>=game.data.playerAttackTimer
                   &&(Math.abs(ydif) <=40)&&
                   (((xdif>0)&& this.facing==="left") || ((xdif<0)  && this.facing==='right'))
                   ){
                this.lastHit = this.now;
                //if the creeps health is less than our attack then execute order if "if" statement
                   }
    }

});


text:
using System.Web.Http.Dependencies;

namespace LeagueStatistics.Server.Infrastructure.Extensions
{
    /// <summary>
    /// Contains extension methods for the <see cref="IDependencyResolver"/> interface.
    /// </summary>
    public static class IDependencyResolverExtensions
    {
        /// <summary>
        /// Retrieves a service from the scope.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dependencyResolver">The dependency resolver.</param>
        public static T GetService<T>(this IDependencyResolver dependencyResolver)
        {
            return (T)dependencyResolver.GetService(typeof(T));
        }
    }
}


text:
package refactoring

import (
	"bytes"
	"fmt"
	"go/ast"
	"go/token"
	"go/types"
	"io"
	"reflect"
	"strings"

	"github.com/godoctor/godoctor/text"
	"golang.org/x/tools/go/ast/astutil"
)

// A ToggleVar refactoring converts between explicitly-typed variable
// declarations (var n int = 5) and short assignment statements (n := 5).
type ToggleVar struct {
	RefactoringBase
}

func (r *ToggleVar) Description() *Description {
	return &Description{
		Name:           "Toggle var ⇔ :=",
		Synopsis:       "Toggles between a var declaration and := statement",
		Usage:          "",
		HTMLDoc:        toggleVarDoc,
		Multifile:      false,
		Params:         nil,
		OptionalParams: nil,
		Hidden:         false,
	}
}

func (r *ToggleVar) Run(config *Config) *Result {
	if r.RefactoringBase.Init(config, r.Description()); r.Log.ContainsErrors() {
		return &r.Result
	}

	if r.SelectedNode == nil {
		r.Log.Error("selection cannot be null")
		r.Log.AssociatePos(r.SelectionStart, r.SelectionEnd)
		return &r.Result
	}
	_, nodes, _ := r.Program.PathEnclosingInterval(r.SelectionStart, r.SelectionEnd)
	for i, node := range nodes {
		switch selectedNode := node.(type) {
		case *ast.AssignStmt:
			if selectedNode.Tok == token.DEFINE {
				r.short2var(selectedNode)
				r.UpdateLog(config, true)
			}
			return &r.Result
		case *ast.GenDecl:
			if selectedNode.Tok == token.VAR {
				if _, ok := nodes[i+1].(*ast.File); ok {
					r.Log.Errorf("A global variable cannot be defined using short assign operator.")
					r.Log.AssociateNode(selectedNode)
				} else {
					r.var2short(selectedNode)
					r.UpdateLog(config, true)
				}
				return &r.Result
			}
		}
	}

	r.Log.Errorf("Please select a short assignment (:=) statement or var declaration.\n\nSelected node: %s", reflect.TypeOf(r.SelectedNode))
	r.Log.AssociatePos(r.SelectionStart, r.SelectionEnd)
	return &r.Result
}

func (r *ToggleVar) short2var(assign *ast.AssignStmt) {
	replacement := r.varDeclString(assign)
	r.Edits[r.Filename].Add(r.Extent(assign), replacement)
	if strings.Contains(replacement, "\n") {
		r.FormatFileInEditor()
	}
}

func (r *ToggleVar) rhsExprs(assign *ast.AssignStmt) []string {
	rhsValue := make([]string, len(assign.Rhs))
	for j, rhs := range assign.Rhs {
		offset, length := r.OffsetLength(rhs)
		rhsValue[j] = string(r.FileContents[offset : offset+length])
	}
	return rhsValue
}

func (r *ToggleVar) varDeclString(assign *ast.AssignStmt) string {
	var buf bytes.Buffer
	replacement := make([]string, len(assign.Rhs))
	path, _ := astutil.PathEnclosingInterval(r.File, assign.Pos(), assign.End())
	for i, rhs := range assign.Rhs {
		switch T := r.SelectedNodePkg.TypesInfo.TypeOf(rhs).(type) {
		case *types.Tuple: // function type
			if typeOfFunctionType(T) == "" {
				replacement[i] = fmt.Sprintf("var %s = %s\n",
					r.lhsNames(assign)[i].String(),
					r.rhsExprs(assign)[i])
			} else {
				replacement[i] = fmt.Sprintf("var %s %s = %s\n",
					r.lhsNames(assign)[i].String(),
					typeOfFunctionType(T),
					r.rhsExprs(assign)[i])
			}
		case *types.Named: // package and struct types
			if path[len(path)-1].(*ast.File).Name.Name == T.Obj().Pkg().Name() {
				replacement[i] = fmt.Sprintf("var %s %s = %s\n",
					r.lhsNames(assign)[i].String(),
					T.Obj().Name(),
					r.rhsExprs(assign)[i])
			} else {
				replacement[i] = fmt.Sprintf("var %s %s = %s\n",
					r.lhsNames(assign)[i].String(),
					T,
					r.rhsExprs(assign)[i])
			}
		default:
			replacement[i] = fmt.Sprintf("var %s %s = %s\n",
				r.lhsNames(assign)[i].String(),
				T,
				r.rhsExprs(assign)[i])

		}
		io.WriteString(&buf, replacement[i])
	}
	return strings.TrimSuffix(buf.String(), "\n")
}

// typeOfFunctionType receives a type of function's return type, which must be a
// tuple type; if each component has the same type (T, T, T), then it returns
// the type T as a string; otherwise, it returns the empty string.
func typeOfFunctionType(returnType types.Type) string {
	typeArray := make([]string, returnType.(*types.Tuple).Len())
	initialType := returnType.(*types.Tuple).At(0).Type().String()
	finalType := initialType
	for i := 1; i < returnType.(*types.Tuple).Len(); i++ {
		typeArray[i] = returnType.(*types.Tuple).At(i).Type().String()
		if initialType != typeArray[i] {
			finalType = ""
		}
	}
	return finalType
}

func (r *RefactoringBase) lhsNames(assign *ast.AssignStmt) []bytes.Buffer {
	var lhsbuf bytes.Buffer
	buf := make([]bytes.Buffer, len(assign.Lhs))
	for i, lhs := range assign.Lhs {
		offset, length := r.OffsetLength(lhs)
		lhsText := r.FileContents[offset : offset+length]
		if len(assign.Lhs) == len(assign.Rhs) {
			buf[i].Write(lhsText)
		} else {
			lhsbuf.Write(lhsText)
			if i < len(assign.Lhs)-1 {
				lhsbuf.WriteString(", ")
			}
			buf[0] = lhsbuf
		}
	}
	return buf
}

//calls the edit set
func (r *ToggleVar) var2short(decl *ast.GenDecl) {
	start, _ := r.OffsetLength(decl)
	repstrlen := r.Program.Fset.Position(decl.Specs[0].(*ast.ValueSpec).Values[0].Pos()).Offset - r.Program.Fset.Position(decl.Pos()).Offset
	r.Edits[r.Filename].Add(&text.Extent{Offset: start, Length: repstrlen}, r.shortAssignString(decl))
}

func (r *ToggleVar) varDeclLHS(decl *ast.GenDecl) string {
	offset, _ := r.OffsetLength(decl.Specs[0].(*ast.ValueSpec))
	endOffset := r.Program.Fset.Position(decl.Specs[0].(*ast.ValueSpec).Names[len(decl.Specs[0].(*ast.ValueSpec).Names)-1].End()).Offset
	return string(r.FileContents[offset:endOffset])
}

// returns the shortAssignString string
func (r *ToggleVar) shortAssignString(decl *ast.GenDecl) string {
	return (fmt.Sprintf("%s := ", r.varDeclLHS(decl)))
}

const toggleVarDoc = `

Purpose

The Toggle var ⇔ := refactoring converts a <tt>var</tt> declaration to a
  short assignment statement (using :=), or vice versa.

Usage

Select a local variable declaration (either a <tt>var</tt> declaration
    or a := statement).

Activate the Toggle var ⇔ := refactoring.

If a <tt>var</tt> declaration is selected, it will be converted to a short
  assignment statement (:=).  If a short assignment statement is selected, it
  will be converted to a <tt>var</tt> declaration (with an explicit type
  declaration).

An error or warning will be reported if the selected statements cannot be
  converted.  For example, declarations at the file scope must be declared using
  <tt>var</tt>; they cannot be converted to short assignment statements.

Example

The example below demonstrates the effect of toggling the highlighted
  declaration of <tt>msg</tt> between a short assignment statement and a
  <tt>var</tt> declaration.

      Before	 	After

package main
import "fmt"

func main() {
    msg := hello
    fmt.Println(msg)
}

          ⇔&nbsp

package main
import "fmt"

func main() {
    var msg string = hello
    fmt.Println(msg)
}

`


text:
package com.github.halfbull.weightlog.weightlog;

import android.support.annotation.NonNull;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;

import static org.junit.Assert.*;

@RunWith(Parameterized.class)
@SuppressWarnings({"CanBeFinal", "WeakerAccess", "unused"})
public class InputFilterToolTest {

    @NonNull
    @Parameterized.Parameters(name = "{index} : ({0}) s:{1} e:{2} ({3}) s:{4} e:{5} => future:{6} isDelete:{7} deletedPart:{8}")
    public static Object[] inputs() {
        return new Object[]{
                new Object[]{"1", 0, 1, "", 0, 0, "1", false, ""},
                new Object[]{"2", 0, 1, "1", 1, 1, "12", false, ""},
                new Object[]{".", 0, 1, "12", 2, 2, "12.", false, ""},
                new Object[]{"0", 0, 1, "12.", 3, 3, "12.0", false, ""},
                new Object[]{"8", 0, 1, "12.0", 4, 4, "12.08", false, ""},
                new Object[]{"0", 0, 1, "11", 0, 0, "011", false, ""},
                new Object[]{"0", 0, 1, "11", 1, 1, "101", false, ""},
                new Object[]{"000", 0, 3, "111", 0, 0, "000111", false, ""},
                new Object[]{"000", 0, 3, "111", 0, 3, "000", false, ""},
                new Object[]{"000", 0, 3, "111", 1, 1, "100011", false, ""},
                new Object[]{"", 0, 0, "123", 2, 3, "12", true, "3"},
                new Object[]{"", 0, 0, "123", 1, 2, "13", true, "2"},
                new Object[]{"", 0, 0, "123", 0, 1, "23", true, "1"},
        };
    }

    @Parameter()
    public CharSequence source;

    @Parameter(1)
    public int start;

    @Parameter(2)
    public int end;

    @Parameter(3)
    public CharSequence destination;

    @Parameter(4)
    public int dStart;

    @Parameter(5)
    public int dEnd;

    @Parameter(6)
    public String futureString;

    @Parameter(7)
    public boolean isDeleteAction;

    @Parameter(8)
    public String deletedPart;

    private InputFilterTool inputFilterTool;

    @Before
    public void setUp() {
        inputFilterTool = new InputFilterTool();
    }

    @Test
    public void getDesiredString() throws Exception {

        CharSequence actual = inputFilterTool.getFutureString(source, start, end, destination, dStart, dEnd);
        assertEquals(futureString, actual);
    }

    @Test
    public void isDeleteAction() {
        boolean actual = inputFilterTool.isDeleteAction(destination, futureString);
        assertEquals(isDeleteAction, actual);
    }

    @Test
    public void getDeletedPart() {
        if (isDeleteAction) {
            CharSequence actual = inputFilterTool.getDeletedPart(destination, dStart, dEnd);
            assertEquals(deletedPart, actual);
        } else {
            assertTrue(true);
        }
    }
}


text:
package org.wso2.carbon.dss.services.test;

import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.AxisFault;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.wso2.carbon.automation.core.ProductConstant;
import org.wso2.carbon.automation.utils.axis2client.AxisServiceClient;
import org.wso2.carbon.dss.DSSIntegrationTest;

import java.io.File;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;

public class InputParametersValidationTestCase extends DSSIntegrationTest {
    private static final Log log = LogFactory.getLog(InputParametersValidationTestCase.class);
    private final String serviceName = "InputParamsValidationTest";

    private final OMFactory fac = OMAbstractFactory.getOMFactory();
    private final OMNamespace omNs = fac.createOMNamespace("http://ws.wso2.org/dataservice/samples", "ns1");

    @BeforeClass(alwaysRun = true)
    public void serviceDeployment() throws Exception {

        super.init();
        List<File> sqlFileLis = new ArrayList<File>();
        sqlFileLis.add(selectSqlFile("CreateTables.sql"));

        deployService(serviceName,
                      createArtifact(ProductConstant.SYSTEM_TEST_RESOURCE_LOCATION + "artifacts"
                                     + File.separator + "DSS" + File.separator + "dbs" + File.separator
                                     + "rdbms" + File.separator + "MySql" + File.separator
                                     + "InputParamsValidationTest.dbs", sqlFileLis));

    }

    @AfterClass(alwaysRun = true)
    public void destroy() throws RemoteException {
        deleteService(serviceName);
        cleanup();
    }

    @Test(groups = {"wso2.dss"})
    public void validateFieldLengthMin() {
        validateLastName("BB");
        log.info("Field minimum length verified");
    }

    @Test(groups = {"wso2.dss"})
    public void validateFieldLengthMax() {
        validateLastName("BBBBBBBBBBBB CCCCCCCC");
        log.info("Field maximum length verified");
    }

    @Test(groups = {"wso2.dss"})
    public void validateEmail() {
        validateEmail("aaabbb.com");
        validateEmail("aaa@bbb");
        log.info("Email address pattern verified");
    }

    @Test(groups = {"wso2.dss"})
    public void validatePrimaryKey() throws AxisFault {
        addEmployee("1");
        boolean validatePrimaryKey = false;
        try {
            addEmployee("1");
        } catch (AxisFault e) {
            validatePrimaryKey = true;
            Assert.assertTrue(e.getMessage().contains("DATABASE_ERROR"), "DATABASE_ERROR Not Found in " +
                                                                         "error " +
                                                                         "message");
            /* Assert.assertTrue(e.getMessage().contains("Duplicate entry"),
         "Message Duplicate entry Not " +
         "Found in error message");*/

        }
        Assert.assertTrue(validatePrimaryKey, "primary key validation failed in Employees table");
        log.info("Primary key validation verified");
    }

    private void validateLastName(String lastNameValue) {
        OMElement payload = fac.createOMElement("addEmployee", omNs);

        OMElement empNo = fac.createOMElement("employeeNumber", omNs);
        empNo.setText("127");
        payload.addChild(empNo);

        OMElement lastName = fac.createOMElement("lastName", omNs);
        lastName.setText(lastNameValue);
        payload.addChild(lastName);

        OMElement fName = fac.createOMElement("firstName", omNs);
        fName.setText("AAA");
        payload.addChild(fName);

        OMElement email = fac.createOMElement("email", omNs);
        email.setText("aaa@ccc.com");
        payload.addChild(email);

        OMElement salary = fac.createOMElement("salary", omNs);
        salary.setText("50000");
        payload.addChild(salary);

        boolean validationStatus = false;
        try {
            new AxisServiceClient().sendRobust(payload, getServiceUrl(serviceName), "addEmployee");
            Assert.fail("This Request must throws a AxisFault due to VALIDATION_ERROR");
        } catch (AxisFault e) {
            validationStatus = true;
            Assert.assertTrue(e.getMessage().contains("VALIDATION_ERROR"), "VALIDATION_ERROR Not Found in " +
                                                                           "error message");
            Assert.assertTrue(e.getMessage().contains("Field Name: lastName"),
                              "Field Name: lastName Not Found in error message");
            Assert.assertTrue(e.getMessage().contains("The value length must be between 3 and 20"),
                              "Validation Message: The value length must be between 3 and 20 Not Found in error message");
            log.info("Last Name length validated");
        }
        Assert.assertTrue(validationStatus, "Last Name length Not validated");

    }

    private void validateEmail(String emailAddress) {
        OMElement payload = fac.createOMElement("addEmployee", omNs);

        OMElement empNo = fac.createOMElement("employeeNumber", omNs);
        empNo.setText("124");
        payload.addChild(empNo);

        OMElement lastName = fac.createOMElement("lastName", omNs);
        lastName.setText("BBB");
        payload.addChild(lastName);

        OMElement fName = fac.createOMElement("firstName", omNs);
        fName.setText("AAA");
        payload.addChild(fName);

        OMElement email = fac.createOMElement("email", omNs);
        email.setText(emailAddress);
        payload.addChild(email);

        OMElement salary = fac.createOMElement("salary", omNs);
        salary.setText("50000");
        payload.addChild(salary);

        boolean validationStatus = false;
        try {
            new AxisServiceClient().sendRobust(payload, getServiceUrl(serviceName), "addEmployee");
            Assert.fail("This Request must throws a AxisFault due to VALIDATION_ERROR");
        } catch (AxisFault e) {
            validationStatus = true;
            Assert.assertTrue(e.getMessage().contains("VALIDATION_ERROR"), "VALIDATION_ERROR Not Found in " +
                                                                           "error message");
            Assert.assertTrue(e.getMessage().contains("Field Name: email"), "Field Name: email Not Found in" +
                                                                            " error message");
            Assert.assertTrue(e.getMessage().contains("Pattern"), "Validation Message: Pattern " +
                                                                  "Not Found " +
                                                                  "in " +
                                                                  "error message");

            log.info("email length validated");
        }
        Assert.assertTrue(validationStatus, "email address Not validated");
    }

    private void addEmployee(String employeeNumber) throws AxisFault {
        OMElement payload = fac.createOMElement("addEmployee", omNs);

        OMElement empNo = fac.createOMElement("employeeNumber", omNs);
        empNo.setText(employeeNumber);
        payload.addChild(empNo);

        OMElement lastName = fac.createOMElement("lastName", omNs);
        lastName.setText("BBB");
        payload.addChild(lastName);

        OMElement fName = fac.createOMElement("firstName", omNs);
        fName.setText("AAA");
        payload.addChild(fName);

        OMElement email = fac.createOMElement("email", omNs);
        email.setText("aaa@ccc.com");
        payload.addChild(email);

        OMElement salary = fac.createOMElement("salary", omNs);
        salary.setText("50000");
        payload.addChild(salary);

        new AxisServiceClient().sendRobust(payload, getServiceUrl(serviceName), "addEmployee");

    }

}


text:
namespace Microsoft.Azure.Management.Batch.Models
{
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Parameters for updating an Azure Batch account.
    /// </summary>
    [Rest.Serialization.JsonTransformation]
    public partial class BatchAccountUpdateParameters
    {
        /// <summary>
        /// Initializes a new instance of the BatchAccountUpdateParameters
        /// class.
        /// </summary>
        public BatchAccountUpdateParameters()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the BatchAccountUpdateParameters
        /// class.
        /// </summary>
        /// <param name="tags">The user-specified tags associated with the
        /// account.</param>
        /// <param name="autoStorage">The properties related to the
        /// auto-storage account.</param>
        /// <param name="encryption">The encryption configuration for the Batch
        /// account.</param>
        public BatchAccountUpdateParameters(IDictionary<string, string> tags = default(IDictionary<string, string>), AutoStorageBaseProperties autoStorage = default(AutoStorageBaseProperties), EncryptionProperties encryption = default(EncryptionProperties))
        {
            Tags = tags;
            AutoStorage = autoStorage;
            Encryption = encryption;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets the user-specified tags associated with the account.
        /// </summary>
        [JsonProperty(PropertyName = "tags")]
        public IDictionary<string, string> Tags { get; set; }

        /// <summary>
        /// Gets or sets the properties related to the auto-storage account.
        /// </summary>
        [JsonProperty(PropertyName = "properties.autoStorage")]
        public AutoStorageBaseProperties AutoStorage { get; set; }

        /// <summary>
        /// Gets or sets the encryption configuration for the Batch account.
        /// </summary>
        [JsonProperty(PropertyName = "properties.encryption")]
        public EncryptionProperties Encryption { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (AutoStorage != null)
            {
                AutoStorage.Validate();
            }
        }
    }
}


text:
import './index';

import { expect } from 'chai';
import { $ } from 'common-sk/modules/dom';
import { PaginationSk } from './pagination-sk';

import {
  ResponsePagination,
} from '../json';
import {
  eventPromise,
  setUpElementUnderTest,
} from '../../../infra-sk/modules/test_util';

describe('pagination-sk', () => {
  const newInstance = (() => {
    const factory = setUpElementUnderTest<PaginationSk>('pagination-sk');
    return (paginationData: ResponsePagination) => factory((el: PaginationSk) => {
      if (paginationData) { el.pagination = paginationData; }
    });
  })();

  let paginator: HTMLElement;
  // Array of 4 buttons, First, Previous, Next, Last, respectively.
  const controlButtons = () => paginator.querySelectorAll('button.action');
  // All present numbered page buttons.
  const pageButtons = () => paginator.querySelectorAll('button:not(.action)');
  // Button of current page, disabled.
  const currentPageButton = () => paginator.querySelector('button:not(.action)[disabled]');
  // All page buttons other than currentPageButton.
  const clickablePageButtons = () => paginator.querySelectorAll('button:not(.action):not([disabled])');
  // Should the First and Previous buttons be disabled (are we on page zero).
  const expectFirstPreviousDisabled = (disabled: boolean) => {
    if (disabled) {
      expect(controlButtons()[0].hasAttribute('disabled')).to.be.true;
      expect(controlButtons()[1].hasAttribute('disabled')).to.be.true;
    } else {
      expect(controlButtons()[0].hasAttribute('disabled')).to.be.false;
      expect(controlButtons()[1].hasAttribute('disabled')).to.be.false;
    }
  };
  // Should the Next and Last buttons be disabled (are we on last page).
  const expectNextLastDisabled = (disabled: boolean) => {
    if (disabled) {
      expect(controlButtons()[2].hasAttribute('disabled')).to.be.true;
      expect(controlButtons()[3].hasAttribute('disabled')).to.be.true;
    } else {
      expect(controlButtons()[2].hasAttribute('disabled')).to.be.false;
      expect(controlButtons()[3].hasAttribute('disabled')).to.be.false;
    }
  };

  const assertButtons = (buttons: NodeList, expectations: string[]) => {
    for (let i = 0; i < buttons.length; i++) {
      expect(buttons[i].textContent).to.have.string(expectations[i]);
    }
  };

  // Helpers for clicking control and page buttons.
  const clickFirst = () => {
    (controlButtons()[0] as HTMLElement).click();
  };

  const clickLast = () => {
    (controlButtons()[3] as HTMLElement).click();
  };

  const clickPrevious = () => {
    (controlButtons()[1] as HTMLElement).click();
  };

  const clickNext = () => {
    (controlButtons()[2] as HTMLElement).click();
  };

  // Click the page button at the provided 0-based index. e.g. for page
  // buttons ['5','6','7'] (where showPages===3),
  // clickNthPageButton(2) will click the 'page 7' button.
  const clickNthPageButton = (i: number) => {
    (pageButtons()[i] as HTMLElement).click();
  };

  it('loads with control buttons', async () => {
    paginator = newInstance({ size: 10, offset: 0, total: 0 });
    // Default with no data is the 4 control(action) buttons, disabled.
    expect(pageButtons()).to.have.length(0);
    expect($('button.action:disabled', paginator)).to.have.length(4);
  });

  it('loads with page buttons', async () => {
    paginator = newInstance({ size: 10, offset: 0, total: 100 });
    // Default with enough data shows up to 5 page buttons, plus 4 controls.
    expect(pageButtons()).to.have.length(5);
    assertButtons(pageButtons(), ['1', '2', '3', '4', '5']);
    expect(currentPageButton()?.textContent).to.equal('1');
    assertButtons(clickablePageButtons(), ['2', '3', '4', '5']);
    // We begin at the first page, 'first', 'previous' buttons are disabled.
    expectFirstPreviousDisabled(true);
    expectNextLastDisabled(false);
  });

  it('allows navigation with first/last buttons', async () => {
    paginator = newInstance({ size: 10, offset: 0, total: 100 });
    assertButtons(pageButtons(), ['1', '2', '3', '4', '5']);
    let pageChangedEvent = eventPromise('page-changed');
    clickLast();
    expect(await pageChangedEvent).to.have.nested.property('detail.offset', 90);
    assertButtons(pageButtons(), ['6', '7', '8', '9', '10']);
    expect(currentPageButton()?.textContent).to.equal('10');
    assertButtons(clickablePageButtons(), ['6', '7', '8', '9']);
    expectFirstPreviousDisabled(false);
    expectNextLastDisabled(true);
    // Now return to first.
    pageChangedEvent = eventPromise('page-changed');
    clickFirst();
    expect(await pageChangedEvent).to.have.nested.property('detail.offset', 0);
    assertButtons(pageButtons(), ['1', '2', '3', '4', '5']);
    expect(currentPageButton()?.textContent).to.equal('1');
    assertButtons(clickablePageButtons(), ['2', '3', '4', '5']);
    expectFirstPreviousDisabled(true);
    expectNextLastDisabled(false);
  });

  it('allows navigation with previous/next buttons', async () => {
    paginator = newInstance({ size: 10, offset: 0, total: 100 });
    assertButtons(pageButtons(), ['1', '2', '3', '4', '5']);
    expect(currentPageButton()?.textContent).to.equal('1');
    let pageChangedEvent = eventPromise('page-changed');
    clickNext();
    expect(await pageChangedEvent).to.have.nested.property('detail.offset', 10);
    // Page buttons don't scroll until active page button is in the middle.
    assertButtons(pageButtons(), ['1', '2', '3', '4', '5']);
    expect(currentPageButton()?.textContent).to.equal('2');
    assertButtons(clickablePageButtons(), ['1', '3', '4', '5']);
    expectFirstPreviousDisabled(false);
    expectNextLastDisabled(false);
    // Button number scroll when we go two more.
    pageChangedEvent = eventPromise('page-changed');
    clickNext();
    expect(await pageChangedEvent).to.have.nested.property('detail.offset', 20);
    clickNext();
    assertButtons(pageButtons(), ['2', '3', '4', '5', '6']);
    expect(currentPageButton()?.textContent).to.equal('4');
    assertButtons(clickablePageButtons(), ['2', '3', '5', '6']);
    expectFirstPreviousDisabled(false);
    expectNextLastDisabled(false);
    // Now go back one.
    clickPrevious();
    assertButtons(pageButtons(), ['1', '2', '3', '4', '5']);
    expect(currentPageButton()?.textContent).to.equal('3');
    assertButtons(clickablePageButtons(), ['1', '2', '4', '5']);
    expectFirstPreviousDisabled(false);
    expectNextLastDisabled(false);
  });

  it('allows navigation with page buttons', async () => {
    paginator = newInstance({ size: 10, offset: 0, total: 100 });
    assertButtons(pageButtons(), ['1', '2', '3', '4', '5']);
    // Go to page 5.
    const pageChangedEvent = eventPromise('page-changed');
    clickNthPageButton(4);
    expect(await pageChangedEvent).to.have.nested.property('detail.offset', 40);
    assertButtons(pageButtons(), ['3', '4', '5', '6', '7']);
    expect(currentPageButton()?.textContent).to.equal('5');
    assertButtons(clickablePageButtons(), ['3', '4', '6', '7']);
    // Go to page 7, then 9, then 10.
    clickNthPageButton(4);
    assertButtons(pageButtons(), ['5', '6', '7', '8', '9']);
    expect(currentPageButton()?.textContent).to.equal('7');
    clickNthPageButton(4);
    assertButtons(pageButtons(), ['6', '7', '8', '9', '10']);
    expect(currentPageButton()?.textContent).to.equal('9');
    clickNthPageButton(4);
    assertButtons(pageButtons(), ['6', '7', '8', '9', '10']);
    expect(currentPageButton()?.textContent).to.equal('10');
    expectNextLastDisabled(true);
  });
});


text:
package scalapb.parquet

import scalapb.{GeneratedMessage, Message}
import org.apache.hadoop.mapreduce.Job
import org.apache.parquet.hadoop.ParquetOutputFormat
import org.apache.parquet.hadoop.util.ContextUtil

class ScalaPBOutputFormat[T <: GeneratedMessage with Message[T]] extends ParquetOutputFormat[T](new ScalaPBWriteSupport[T])  {

}

object ScalaPBOutputFormat {
  def setMessageClass[T <: GeneratedMessage with Message[T]](job: Job, protoClass: Class[T]) = {
    ScalaPBWriteSupport.setSchema(ContextUtil.getConfiguration(job), protoClass)
  }
}


text:
BuildOrder::BuildOrder()
    : m_race(sc2::Race::Protoss)
{

}

BuildOrder::BuildOrder(const sc2::Race & race)
    : m_race(race)
{

}

BuildOrder::BuildOrder(const sc2::Race & race, const std::vector<BuildType> & vec)
    : m_race(race)
    , m_buildOrder(vec)
{

}

void BuildOrder::add(const BuildType & type)
{
    m_buildOrder.push_back(type);
}

const sc2::Race & BuildOrder::getRace() const
{
    return m_race;
}

size_t BuildOrder::size() const
{
    return m_buildOrder.size();
}

const BuildType & BuildOrder::operator [] (const size_t & index) const
{
    return m_buildOrder[index];
}

BuildType & BuildOrder::operator [] (const size_t & index)
{
    return m_buildOrder[index];
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.briarshore</groupId>
    <artifactId>ten-collections-tricks</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <name>Ten Collections Tricks</name>
    <url>https://github.com/steveswing/ten-collections-tricks/</url>

    <prerequisites>
        <maven>3.0</maven>
    </prerequisites>

    <properties>
        <maven-surefire-plugin.excludedGroups></maven-surefire-plugin.excludedGroups>
        <maven-surefire-plugin.version>2.19</maven-surefire-plugin.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <commons-collections.version>4.1</commons-collections.version>
        <guava.version>19.0</guava.version>
        <junit.version>4.12</junit.version>
        <commons-lang3.version>3.4</commons-lang3.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava-parent</artifactId>
                <version>${guava.version}</version>
                <type>pom</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-collections4</artifactId>
                <version>${commons-collections.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${commons-collections.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
    </dependencies>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.8</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.2-beta-5</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.surefire</groupId>
                            <artifactId>surefire-junit4</artifactId>
                            <version>2.19</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <executions>
                    <execution>
                        <id>default-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <argLine>-Xms1024m -Xmx1536m</argLine>
                            <threadCountMethods>2</threadCountMethods>
                            <perCoreThreadCount>true</perCoreThreadCount>
                            <excludedGroups>${maven-surefire-plugin.excludedGroups}</excludedGroups>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit4</artifactId>
                        <version>2.19</version>
                        <scope>compile</scope>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <source>1.8</source>
                            <target>1.8</target>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-testCompile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <source>1.8</source>
                            <target>1.8</target>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>default-clean</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <executions>
                    <execution>
                        <id>default-testResources</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>testResources</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-resources</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
                <executions>
                    <execution>
                        <id>default-install</id>
                        <phase>install</phase>
                        <goals>
                            <goal>install</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.4</version>
                <executions>
                    <execution>
                        <id>default-site</id>
                        <phase>site</phase>
                        <goals>
                            <goal>site</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/site</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-deploy</id>
                        <phase>site-deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/site</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <outputDirectory>${project.build.outputDirectory}/site</outputDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <outputDirectory>${project.build.outputDirectory}</outputDirectory>
    </reporting>
</project>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />

  <title>Class: Object</title>

  <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />

          Home
          Classes
          Methods

In Files

Consola.rb

Parent

BasicObject

Methods

#main

Files

Gemfile

Guardfile

LICENSE.txt

Rakefile

salida.txt

Class/Module Index

        <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
        <fieldset>
          <legend>Quicksearch</legend>
          <input type="text" name="quicksearch" value=""
            class="quicksearch-field" />
        </fieldset>
        </form>

Fraccion

Matriz

MatrizDensa

MatrizDispersa

Mydsl

Object

Prac09

Test_Matrices

No matching classes.

Object

Public Instance Methods

            main()
            click to toggle source

# File Consola.rb, line 3
def main
        fin = false
        codigo = ""

        while !fin
                print "Consola>"
                codigo = gets.chomp

                if codigo == 'exit' || codigo == 'salir'
                        fin = true
                else
                        t = Mydsl.new(codigo){gets.chomp} #leemos las ordenes
                        if t.salida == "console"
                                puts t.run
                        end
                        fin = false
                end
        end
end

[Validate]

Generated with the Darkfish
      Rdoc Generator 2.


text:
package runtime

var Mmap = mmap
var Munmap = munmap

const ENOMEM = _ENOMEM
const MAP_ANON = _MAP_ANON
const MAP_PRIVATE = _MAP_PRIVATE
const MAP_FIXED = _MAP_FIXED

func GetPhysPageSize() uintptr {
	return physPageSize
}