text:
// Generated by OJB SchemeGenerator

package gov.nih.nci.rembrandt.dbbean;

/**
* caIntegrator License
*
* Copyright 2001-2005 Science Applications International Corporation ("SAIC").
* The software subject to this notice and license includes both human readable source code form and machine readable,
* binary, object code form ("the caIntegrator Software"). The caIntegrator Software was developed in conjunction with
* the National Cancer Institute ("NCI") by NCI employees and employees of SAIC.
* To the extent government employees are authors, any rights in such works shall be subject to Title 17 of the United States
* Code, section 105.
* This caIntegrator Software License (the "License") is between NCI and You. "You (or "Your") shall mean a person or an
* entity, and all other entities that control, are controlled by, or are under common control with the entity. "Control"
* for purposes of this definition means (i) the direct or indirect power to cause the direction or management of such entity,
*  whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii)
* beneficial ownership of such entity.
* This License is granted provided that You agree to the conditions described below. NCI grants You a non-exclusive,
* worldwide, perpetual, fully-paid-up, no-charge, irrevocable, transferable and royalty-free right and license in its rights
* in the caIntegrator Software to (i) use, install, access, operate, execute, copy, modify, translate, market, publicly
* display, publicly perform, and prepare derivative works of the caIntegrator Software; (ii) distribute and have distributed
* to and by third parties the caIntegrator Software and any modifications and derivative works thereof;
* and (iii) sublicense the foregoing rights set out in (i) and (ii) to third parties, including the right to license such
* rights to further third parties. For sake of clarity, and not by way of limitation, NCI shall have no right of accounting
* or right of payment from You or Your sublicensees for the rights granted under this License. This License is granted at no
* charge to You.
* 1. Your redistributions of the source code for the Software must retain the above copyright notice, this list of conditions
*    and the disclaimer and limitation of liability of Article 6, below. Your redistributions in object code form must reproduce
*    the above copyright notice, this list of conditions and the disclaimer of Article 6 in the documentation and/or other materials
*    provided with the distribution, if any.
* 2. Your end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This
*    product includes software developed by SAIC and the National Cancer Institute." If You do not include such end-user
*    documentation, You shall include this acknowledgment in the Software itself, wherever such third-party acknowledgments
*    normally appear.
* 3. You may not use the names "The National Cancer Institute", "NCI" "Science Applications International Corporation" and
*    "SAIC" to endorse or promote products derived from this Software. This License does not authorize You to use any
*    trademarks, service marks, trade names, logos or product names of either NCI or SAIC, except as required to comply with
*    the terms of this License.
* 4. For sake of clarity, and not by way of limitation, You may incorporate this Software into Your proprietary programs and
*    into any third party proprietary programs. However, if You incorporate the Software into third party proprietary
*    programs, You agree that You are solely responsible for obtaining any permission from such third parties required to
*    incorporate the Software into such third party proprietary programs and for informing Your sublicensees, including
*    without limitation Your end-users, of their obligation to secure any required permissions from such third parties
*    before incorporating the Software into such third party proprietary software programs. In the event that You fail
*    to obtain such permissions, You agree to indemnify NCI for any claims against NCI by such third parties, except to
*    the extent prohibited by law, resulting from Your failure to obtain such permissions.
* 5. For sake of clarity, and not by way of limitation, You may add Your own copyright statement to Your modifications and
*    to the derivative works, and You may provide additional or different license terms and conditions in Your sublicenses
*    of modifications of the Software, or any derivative works of the Software as a whole, provided Your use, reproduction,
*    and distribution of the Work otherwise complies with the conditions stated in this License.
* 6. THIS SOFTWARE IS PROVIDED "AS IS," AND ANY EXPRESSED OR IMPLIED WARRANTIES, (INCLUDING, BUT NOT LIMITED TO,
*    THE IMPLIED WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE) ARE DISCLAIMED.
*    IN NO EVENT SHALL THE NATIONAL CANCER INSTITUTE, SAIC, OR THEIR AFFILIATES BE LIABLE FOR ANY DIRECT, INDIRECT,
*    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
*    GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
*    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
*    OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/

public class ArrayGenoAbnFact
{
  public final static String SNP_PROBESET_ID = "snpProbesetId";
    public final static String DISEASE_TYPE = "diseaseType";
    public final static String INSTITUTION_NAME = "institutionName";
    public final static String SPECIMEN_NAME = "specimenName";
  private Long agaId;

  private Long agentId;

  private String ageGroup;

  private Long biospecimenId;

  private Double channelRatio;

  private String chromosome;

  private Double copyNumber;

  private String institutionName;

 private Double copynoPval;
 private String specimenName;

    /**
 * @return Returns the specimenName.
 */
public String getSpecimenName() {
	return specimenName;
}

/**
 * @param specimenName The specimenName to set.
 */
public void setSpecimenName(String specimenName) {
	this.specimenName = specimenName;
}

	public String getSampleId() {
        return sampleId;
    }

    public void setSampleId(String sampleId) {
        this.sampleId = sampleId;
    }

    private String sampleId;

  private String cytoband;

  private Long datasetId;

  private Long diseaseHistoryId;

  private Long diseaseTypeId;
    private String diseaseType;

  private Long expPlatformId;

  private String genderCode;

  private Long institutionId;

  private Double loh;

  private String lossGain;

  private Long snpProbesetId;
    private String snpProbesetName ;

  private Long physicalPosition;

  private String survivalLengthRange;

  private Long timecourseId;

  private Long treatmentHistoryId;

    public Long getAgaId() {
        return agaId;
    }

    public void setAgaId(Long agaId) {
        this.agaId = agaId;
    }

    public Long getAgentId() {
        return agentId;
    }

    public void setAgentId(Long agentId) {
        this.agentId = agentId;
    }

    public String getAgeGroup() {
        return ageGroup;
    }

    public void setAgeGroup(String ageGroup) {
        this.ageGroup = ageGroup;
    }

    public Long getBiospecimenId() {
        return biospecimenId;
    }

    public void setBiospecimenId(Long biospecimenId) {
        this.biospecimenId = biospecimenId;
    }

    public Double getChannelRatio() {
        return channelRatio;
    }

    public void setChannelRatio(Double channelRatio) {
        this.channelRatio = channelRatio;
    }

    public String getChromosome() {
        return chromosome;
    }

    public void setChromosome(String chromosome) {
        this.chromosome = chromosome;
    }

    public Double getCopyNumber() {
        return copyNumber;
    }

    public void setCopyNumber(Double copyNumber) {
        this.copyNumber = copyNumber;
    }

    public Double getCopynoPval() {
        return copynoPval;
    }

    public void setCopynoPval(Double copynoPval) {
        this.copynoPval = copynoPval;
    }

    public String getCytoband() {
        return cytoband;
    }

    public void setCytoband(String cytoband) {
        this.cytoband = cytoband;
    }

    public Long getDatasetId() {
        return datasetId;
    }

    public void setDatasetId(Long datasetId) {
        this.datasetId = datasetId;
    }

    public Long getDiseaseHistoryId() {
        return diseaseHistoryId;
    }

    public void setDiseaseHistoryId(Long diseaseHistoryId) {
        this.diseaseHistoryId = diseaseHistoryId;
    }

    public Long getDiseaseTypeId() {
        return diseaseTypeId;
    }

    public void setDiseaseTypeId(Long diseaseTypeId) {
        this.diseaseTypeId = diseaseTypeId;
    }

    public String getDiseaseType() {
        return diseaseType;
    }

    public void setDiseaseType(String diseaseType) {
        this.diseaseType = diseaseType;
    }

    public Long getExpPlatformId() {
        return expPlatformId;
    }

    public void setExpPlatformId(Long expPlatformId) {
        this.expPlatformId = expPlatformId;
    }

    public String getGenderCode() {
        return genderCode;
    }

    public void setGenderCode(String genderCode) {
        this.genderCode = genderCode;
    }

    public Long getInstitutionId() {
        return institutionId;
    }

    public void setInstitutionId(Long institutionId) {
        this.institutionId = institutionId;
    }

    public Double getLoh() {
        return loh;
    }

    public void setLoh(Double loh) {
        this.loh = loh;
    }

    public String getLossGain() {
        return lossGain;
    }

    public void setLossGain(String lossGain) {
        this.lossGain = lossGain;
    }

    public Long getSnpProbesetId() {
        return snpProbesetId;
    }

    public void setSnpProbesetId(Long snpProbesetId) {
        this.snpProbesetId = snpProbesetId;
    }

    public String getSnpProbesetName() {
        return snpProbesetName;
    }

    public void setSnpProbesetName(String snpProbesetName) {
        this.snpProbesetName = snpProbesetName;
    }

    public Long getPhysicalPosition() {
        return physicalPosition;
    }

    public void setPhysicalPosition(Long physicalPosition) {
        this.physicalPosition = physicalPosition;
    }

    public String getSurvivalLengthRange() {
        return survivalLengthRange;
    }

    public void setSurvivalLengthRange(String survivalLengthRange) {
        this.survivalLengthRange = survivalLengthRange;
    }

    public Long getTimecourseId() {
        return timecourseId;
    }

    public void setTimecourseId(Long timecourseId) {
        this.timecourseId = timecourseId;
    }

    public Long getTreatmentHistoryId() {
        return treatmentHistoryId;
    }

    public void setTreatmentHistoryId(Long treatmentHistoryId) {
        this.treatmentHistoryId = treatmentHistoryId;
    }

	/**
	 * @return Returns the institutionName.
	 */
	public String getInstitutionName() {
		return institutionName;
	}

	/**
	 * @param institutionName The institutionName to set.
	 */
	public void setInstitutionName(String institutionName) {
		this.institutionName = institutionName;
	}

}


text:
#ifndef KMSENGINE_BRIDGE_EX_DATA_UTIL_ENGINE_DATA_H_
#define KMSENGINE_BRIDGE_EX_DATA_UTIL_ENGINE_DATA_H_

#include <memory>
#include <string>

#include <openssl/rsa.h>

#include "src/backing/client/client.h"
#include "src/bridge/memory_util/openssl_structs.h"

namespace kmsengine {
namespace bridge {

// Container for structures that need to be referred to across OpenSSL engine
// calls.
//
// An instance of `EngineData` is attached to the OpenSSL `ENGINE` struct via
// OpenSSL's "ex_data" API. Then, when OpenSSL delegates calls to the engine
// implementation, our codebase can retrieve the native `EngineData` from the
// `ENGINE` struct passed from OpenSSL and then retrieve structures specific
// to our engine implementation.
class EngineData {
 public:
  EngineData(std::unique_ptr<backing::Client> client,
             OpenSslRsaMethod rsa_method,
             OpenSslEcKeyMethod ec_key_method)
      : client_(std::move(client)),
        rsa_method_(std::move(rsa_method)),
        ec_key_method_(std::move(ec_key_method)) {}

  // `EngineData` is not copyable or movable.
  EngineData(const EngineData&) = delete;
  EngineData& operator=(const EngineData&) = delete;

  // Returns a reference to the `backing::Client` associated with the
  // `EngineData`.
  backing::Client const& client() const { return *client_; }

  // Returns a raw pointer to the engine's `RSA_METHOD`.
  //
  // The return type is a raw pointer instead of a reference since the main
  // usage case for accessing the `RSA_METHOD` is to pass it to an OpenSSL API
  // function, and the OpenSSL API functions consume raw pointers.
  const RSA_METHOD *rsa_method() const { return rsa_method_.get(); }

  // Returns a raw pointer to the engine's `EC_KEY_METHOD`.
  //
  // The return type is a raw pointer instead of a reference since the main
  // usage case for accessing the `EC_KEY_METHOD` is to pass it to an OpenSSL
  // API function, and the OpenSSL API functions consume raw pointers.
  const EC_KEY_METHOD *ec_key_method() const { return ec_key_method_.get(); }

 private:
  const std::unique_ptr<backing::Client> client_;
  const OpenSslRsaMethod rsa_method_;
  const OpenSslEcKeyMethod ec_key_method_;
};

}  // namespace bridge
}  // namespace kmsengine

#endif  // KMSENGINE_BRIDGE_EX_DATA_UTIL_ENGINE_DATA_H_

redpajama_set_name: RedPajamaGithub


text:
#ifndef OSPL_DDS_PUB_TCOHERENTSET_HPP_
#define OSPL_DDS_PUB_TCOHERENTSET_HPP_

/**
 * @file
 */

/*
 * OMG PSM class declaration
 */
#include <spec/dds/pub/TCoherentSet.hpp>

// Implementation

namespace dds
{
namespace pub
{

template <typename DELEGATE>
TCoherentSet<DELEGATE>::TCoherentSet(const dds::pub::Publisher& pub) : dds::core::Value<DELEGATE>(pub)  {  }

template <typename DELEGATE>
void TCoherentSet<DELEGATE>::end()
{
    this->delegate().end();
}

template <typename DELEGATE>
TCoherentSet<DELEGATE>::~TCoherentSet()
{
    this->delegate().end();
}

}
}

// End of implementation

#endif /* OSPL_DDS_PUB_TCOHERENTSET_HPP_ */


text:
package edu.hm.hafner.analysis.parser;

import org.junit.jupiter.api.Test;

import edu.hm.hafner.analysis.AbstractParserTest;
import edu.hm.hafner.analysis.Report;
import edu.hm.hafner.analysis.Severity;
import edu.hm.hafner.analysis.assertions.SoftAssertions;

import static edu.hm.hafner.analysis.assertions.Assertions.*;

/**
 * Tests the class {@link IntelParserTest}.
 */
class IntelParserTest extends AbstractParserTest {
    IntelParserTest() {
        super("intelc.txt");
    }

    @Override
    protected IntelParser createParser() {
        return new IntelParser();
    }

    @Override
    protected void assertThatIssuesArePresent(final Report report, final SoftAssertions softly) {
        softly.assertThat(report).hasSize(9);
        softly.assertThat(report.get(0))
                .hasSeverity(Severity.WARNING_LOW)
                .hasCategory("Remark")
                .hasLineStart(1460)
                .hasLineEnd(1460)
                .hasMessage("LOOP WAS VECTORIZED.")
                .hasFileName("D:/Hudson/workspace/foo/busdates.cpp")
                .hasColumnStart(20);

        softly.assertThat(report.get(1))
                .hasSeverity(Severity.WARNING_LOW)
                .hasCategory("Remark")
                .hasLineStart(2630)
                .hasLineEnd(2630)
                .hasMessage("FUSED LOOP WAS VECTORIZED.")
                .hasFileName("D:/Hudson/workspace/foo/hols.cpp")
                .hasColumnStart(15);

        softly.assertThat(report.get(2))
                .hasSeverity(Severity.WARNING_LOW)
                .hasCategory("Remark #1")
                .hasLineStart(721)
                .hasLineEnd(721)
                .hasMessage("last line of file ends without a newline")
                .hasFileName("D:/Hudson/workspace/zoo/oppdend2d_slv_strip_utils.cpp");

        softly.assertThat(report.get(3))
                .hasSeverity(Severity.WARNING_LOW)
                .hasCategory("Remark #1418")
                .hasLineStart(17)
                .hasLineEnd(17)
                .hasMessage("external function definition with no prior declaration")
                .hasFileName("D:/Hudson/workspace/boo/serviceif.cpp");

        softly.assertThat(report.get(4))
                .hasSeverity(Severity.WARNING_NORMAL)
                .hasCategory("Warning #6843")
                .hasLineStart(1)
                .hasLineEnd(1)
                .hasMessage(
                        "A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value.   [X]")
                .hasFileName("/path/to/file1.f90");

        softly.assertThat(report.get(5))
                .hasSeverity(Severity.WARNING_LOW)
                .hasCategory("Remark #8577")
                .hasLineStart(806)
                .hasLineEnd(806)
                .hasMessage(
                        "The scale factor (k) and number of fractional digits (d) do not have the allowed combination of either -d < k <= 0 or 0 < k < d+2. Expect asterisks as output.")
                .hasFileName("/path/to/file2.f");

        softly.assertThat(report.get(6))
                .hasSeverity(Severity.WARNING_HIGH)
                .hasCategory("Error #5082")
                .hasLineStart(1)
                .hasLineEnd(1)
                .hasMessage("Syntax error, found END-OF-STATEMENT when expecting one of: ( % [ : . = =>")
                .hasFileName("t.f90");

        softly.assertThat(report.get(7))
                .hasSeverity(Severity.WARNING_HIGH)
                .hasCategory("Error ")
                .hasLineStart(17)
                .hasLineEnd(17)
                .hasMessage("expected a \";\"")
                .hasFileName("main.cpp");

        softly.assertThat(report.get(8))
                .hasSeverity(Severity.WARNING_LOW)
                .hasCategory("Message #593")
                .hasLineStart(35)
                .hasLineEnd(35)
                .hasMessage("variable \"var\" was set but never used")
                .hasFileName("D:/path/to/source/file.cpp");
    }

    /**
     * Parses a warning log with 3 warnings and 1 error.
     *
     * @see Issue 5402
     */
    @Test
    void issue5402() {
        Report warnings = parse("issue5402.txt");

        assertThat(warnings).hasSize(4);

        try (SoftAssertions softly = new SoftAssertions()) {
            softly.assertThat(warnings.get(0))
                    .hasSeverity(Severity.WARNING_NORMAL)
                    .hasCategory("Warning #177")
                    .hasLineStart(980)
                    .hasLineEnd(980)
                    .hasMessage("label \"find_rule\" was declared but never referenced")
                    .hasFileName("<stdout>");

            softly.assertThat(warnings.get(1))
                    .hasSeverity(Severity.WARNING_NORMAL)
                    .hasCategory("Warning #177")
                    .hasLineStart(2454)
                    .hasLineEnd(2454)
                    .hasMessage("function \"yy_flex_strlen\" was declared but never referenced")
                    .hasFileName("<stdout>");

            softly.assertThat(warnings.get(2))
                    .hasSeverity(Severity.WARNING_NORMAL)
                    .hasCategory("Warning #1786")
                    .hasLineStart(120)
                    .hasLineEnd(120)
                    .hasMessage(
                            "function \"fopen\" (declared at line 237 of \"C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\INCLUDE\\stdio.h\") was declared \"deprecated (\"This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.\") \"")
                    .hasFileName(
                            "D:/hudson/workspace/continuous-snext-main-Win32/trunk/src/engine/AllocationProfiler.cpp");

            softly.assertThat(warnings.get(3))
                    .hasSeverity(Severity.WARNING_HIGH)
                    .hasCategory("Error #1786")
                    .hasLineStart(120)
                    .hasLineEnd(120)
                    .hasMessage(
                            "function \"fopen\" (declared at line 237 of \"C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\INCLUDE\\stdio.h\") was declared \"deprecated (\"This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.\") \"")
                    .hasFileName(
                            "D:/hudson/workspace/continuous-snext-main-Win32/trunk/src/engine/AllocationProfiler.cpp");
        }
    }
}


text:
Installing VIPA
==============

This guide will explain how you can install VIPA on an Ubuntu server.

**NOTICE:** Some steps takes longer time than others. So you may want to make some changes on your computer before connecting to the server over SSH for avoiding 'Broken pipe' situation. If you lost the connection between your computer and server (over SSH), you can't follow some steps' procesing status.

Before start
----------------
This script requires a domain name while creating cookies so if you run this project under a pseudo domain (instead of a real one like .com) you should modify your computer's host file in order to connect your server instead of IP adress.
It's not a complicated step, feel free to visit Google and use search box.

Required Software
-----------------
Install and run these services and extensions before attempting to install VIPA.

* Nginx
* PostgreSQL
* Memcached
* PHP7
* Elasticsearch
* Node
* Bower

```
# Java

$ sudo add-apt-repository -y ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get -y install oracle-java8-installer

# Elastic

$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
$ echo "deb http://packages.elastic.co/elasticsearch/1.7/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-1.7.list
$ sudo apt-get update
$ sudo apt-get -y install elasticsearch

$ sudo update-rc.d elasticsearch defaults 95 10
$ sudo service elasticsearch restart

# Install PostgreSQL and Git
$ sudo apt-get install -y postgresql git

# Add php7 repo and update

$ LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y
$ apt-get update

# Install PHP and its extensions

$ apt-get install -y --force-yes php7.0-cli php7.0-dev \
php-pgsql php-sqlite3 php-gd php-apcu php7.0-curl php7.0-mcrypt \
php-imap php7.0-gd php-memcached php7.0-pgsql php7.0-readline \
php-xdebug php-mbstring php7.0-xml php7.0-zip php7.0-intl php7.0-bcmath

# Install Composer

$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer

# Add Composer executable to PATH if you're using Vagrant

$ printf "\nPATH=\"$(composer config -g home 2>/dev/null)/vendor/bin:\$PATH\"\n" | tee -a /home/vagrant/.profile

# Configure PHP CLI

$ sudo sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.0/cli/php.ini
$ sudo sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.0/cli/php.ini
$ sudo sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.0/cli/php.ini
$ sudo sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/cli/php.ini

# Install Nginx & PHP-FPM

$ apt-get install -y --force-yes nginx php7.0-fpm

# If you don't have any websites which using files below
$ rm /etc/nginx/sites-enabled/default
$ rm /etc/nginx/sites-available/default
$ service nginx restart

# Configure PHP-FPM

$ sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.0/fpm/php.ini
$ sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.0/fpm/php.ini
$ sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.0/fpm/php.ini
$ sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.0/fpm/php.ini
$ sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.0/fpm/php.ini
$ sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.0/fpm/php.ini
$ sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/fpm/php.ini

$ service nginx restart
$ service php7.0-fpm restart

# PostgreSQL database and user setup
$ su - postgres
$ psql -d template1 -U postgres

CREATE USER vipa WITH PASSWORD 'vipa';
CREATE DATABASE vipa;
GRANT ALL PRIVILEGES ON DATABASE vipa to vipa;
\q

$ su
$ cd $OLDPWD

# Node & Bower
$ sudo apt-get -y install nodejs nodejs-legacy
$ sudo apt-get -y install npm
$ sudo npm install -g bower

```

Getting most recent version
-----------------------

```
# Create the directory and set permissions
$ sudo mkdir -p /var/www
$ sudo chown -R www-data:www-data /var/www

# Switch to www-data user

$ sudo su -s /bin/bash www-data
$ cd /var/www

# Remove default nginx index.php page if you don't have any website in there
$ rm -rf html

# Obtain the latest code

$ git clone https://github.com/academic/vipa.git
$ cd vipa

```

Installing Dependencies
-----------------------

While installing some depenencies, Composer will ask for a GitHub access token. You don't have to proivde one, as it will try to download from the source but you will need to press `ENTER` each time it tries. If you want to provide, see [GitHub's help article](https://help.github.com/articles/creating-an-access-token-for-command-line-use/).

When installation is complete, you will need to provide some parameters to VIPA. Some of those are:

* *Database parameters*: Use the one you have created before installing dependencies. Type them carefully as you might have to re-run this wizard if anything goes wrong.
 * `database_driver` (`pdo_pgsql` by default)
 * `database_host` (`127.0.0.1` by default)
 * `database_port` (`5432` by default)
 * `database_name` (`vipa` by default)
 * `database_user` (`vipa` by default)
 * `database_password` (`vipa` by default)
* `base_host`: Treat this as your domain name. If you want to use a virtualhost, make sure you pass its name here.

```
$ composer update -vvv -o
$ bower update
$ php app/console assets:install web --symlink
$ php app/console assetic:dump
$ php app/console doctrine:schema:drop --force
$ php app/console doctrine:schema:create
$ php app/console vipa:install
$ php app/console vipa:install:samples

```

After the wizard is done, install the initial data if you would like: `$ php app/console vipa:install:initial-data`

Web Server Configuration Examples
-------------------------
### /etc/nginx/sites-available/vipa

```
# Type this command (or change type your favourite text editor instead of 'nano') and paste the server example section
$ sudo nano /etc/nginx/sites-available/vipa

```
Server example
------------
```
server {
    listen 80;
    server_name vipa.prod www.vipa.prod local.vipa.prod *.vipa.prod;
    client_max_body_size 1024M;

    root /var/www/vipa/web;

    rewrite ^/app.php?(.*)$ /$1 permanent;

    try_files $uri @rewriteapp;
    location @rewriteapp {
        rewrite ^(.*)$ /app.php/$1 last;
    }

    location ~ ^/(app|config)\.php(/|$) {
        fastcgi_pass            127.0.0.1:9000;
        fastcgi_buffer_size     16k;
        fastcgi_buffers         4 16k;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include                 fastcgi_params;
        fastcgi_param           SCRIPT_FILENAME     $document_root$fastcgi_script_name;
        fastcgi_param           HTTPS               off;
    }
}

server {
    listen 80;
    server_name vipa.dev www.vipa.dev local.vipa.dev *.vipa.dev;
    client_max_body_size 1024M;

    root /var/www/vipa/web;

    rewrite ^/app_dev.php?(.*)$ /$1 permanent;

    try_files $uri @rewriteapp;

    location @rewriteapp {
        rewrite ^(.*)$ /app_dev.php/$1 last;
    }

    location ~ ^/(app|app_dev|app_local|config)\.php(/|$) {
        fastcgi_pass            127.0.0.1:9000;
        fastcgi_buffer_size     16k;
        fastcgi_buffers         4 16k;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include                 fastcgi_params;
        fastcgi_param           SCRIPT_FILENAME     $document_root$fastcgi_script_name;
        fastcgi_param           HTTPS               off;
    }
}
```

Restart nginx service
-------
```
$ service nginx restart
```

Install Bundles
----------------
You should run this command in **vipa** folder, if you're not sure, run this before:

```
$ cd /var/www/vipa
```

Then

```
# Citation bundle

$ app/console vipa:install:package citation

```

Troubleshooting
----------------
If anything goes wrong (ie. you get a blank page instead of VIPA home) check logs under app/log directory and Nginx's own log file.


text:
<?php
namespace Codeception\Lib\Connector;

use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Client;

class Laravel5 extends Client
{

    /**
     * @var Application
     */
    private $app;

    /**
     * @var \Codeception\Module\Laravel5
     */
    private $module;

    /**
     * @var array
     */
    private $triggeredEvents = [];

    /**
     * @var object
     */
    private $oldDb;

    /**
     * Constructor.
     * @param \Codeception\Module\Laravel5 $module
     */
    public function __construct($module)
    {
        $this->module = $module;
        $this->initialize();

        $components = parse_url($this->app['config']->get('app.url', 'http://localhost'));
        $host = isset($components['host']) ? $components['host'] : 'localhost';

        parent::__construct($this->app, ['HTTP_HOST' => $host]);

        // Parent constructor defaults to not following redirects
        $this->followRedirects(true);
    }

    /**
     * @param SymfonyRequest $request
     * @return Response
     */
    protected function doRequest($request)
    {
        $this->initialize($request);

        $request = Request::createFromBase($request);
        $response = $this->kernel->handle($request);
        $this->app->make('Illuminate\Contracts\Http\Kernel')->terminate($request, $response);

        return $response;
    }

    /**
     * Initialize the Laravel framework.
     * @param SymfonyRequest $request
     */
    private function initialize($request = null)
    {
        // Store a reference to the database object
        // so the database connection can be reused during tests
        $this->oldDb = null;
        if ($this->app['db'] && $this->app['db']->connection()) {
            $this->oldDb = $this->app['db'];
        }

        // The module can login a user with the $I->amLoggedAs() method,
        // but this is not persisted between requests. Store a reference
        // to the logged in user to simulate this.
        $loggedInUser = null;
        if ($this->app['auth'] && $this->app['auth']->check()) {
            $loggedInUser = $this->app['auth']->user();
        }

        // Load the application object
        $this->app = $this->kernel = $this->loadApplication();

        // Set the request instance for the application
        if (is_null($request)) {
            $appConfig = require $this->module->config['project_dir'] . 'config/app.php';
            $request = SymfonyRequest::create($appConfig['url']);
        }

        $this->app->instance('request', Request::createFromBase($request));
        $this->app->instance('middleware.disable', $this->module->config['disable_middleware']);

        // Reset the old database after the DatabaseServiceProvider ran.
        // This way other service providers that rely on the $app['db'] entry
        // have the correct instance available.
        if ($this->oldDb) {
            $this->app['events']->listen('Illuminate\Database\DatabaseServiceProvider', function () {
                $this->app->singleton('db', function () {
                    return $this->oldDb;
                });
            });
        }

        $this->app->make('Illuminate\Contracts\Http\Kernel')->bootstrap();

        // If events should be disabled mock the event dispatcher instance
        if ($this->module->config['disable_events']) {
            $this->mockEventDispatcher();
        }

        // Setup an event listener to listen for all events that are triggered
        $this->setupEventListener();

        // If there was a user logged in restore this user.
        // Also reload the user object from the user provider to prevent stale user data.
        if ($loggedInUser) {
            $refreshed = $this->app['auth']->getProvider()->retrieveById($loggedInUser->getAuthIdentifier());
            $this->app['auth']->setUser($refreshed ?: $loggedInUser);
        }

        $this->module->setApplication($this->app);
    }

    /**
     * Boot the Laravel application object.
     * @return Application
     * @throws ModuleConfig
     */
    private function loadApplication()
    {
        $app = require $this->module->config['bootstrap_file'];
        $app->loadEnvironmentFrom($this->module->config['environment_file']);
        $app->instance('request', new Request());

        return $app;
    }

    /**
     * Replace the Laravel event dispatcher with a mock.
     */
    private function mockEventDispatcher()
    {
        $mockGenerator = new \PHPUnit_Framework_MockObject_Generator;
        $mock = $mockGenerator->getMock('Illuminate\Contracts\Events\Dispatcher');
        $this->app->instance('events', $mock);
    }

    /**
     * Listen for events.
     * Even works when events are disabled.
     */
    private function setupEventListener()
    {
        if ($this->module->config['disable_events']) {
            // Events are disabled so we should listen for events through the mocked event dispatcher
            $mock = $this->app['events'];
            $callback = function ($event) {
                $this->triggeredEvents[] = $this->normalizeEvent($event);
            };

            $mock->expects(new \PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount)
                ->method('fire')
                ->will(new \PHPUnit_Framework_MockObject_Stub_ReturnCallback($callback));
        } else {
            // Listen for all events by registering a wildcard event listener
            $callback = function () {
                $this->triggeredEvents[] = $this->normalizeEvent($this->app['events']->firing());
            };
            $this->app['events']->listen('*', $callback);
        }
    }

    /**
     * Normalize events to class names.
     *
     * @param $event
     * @return string
     */
    private function normalizeEvent($event)
    {
        if (is_object($event)) {
            $event = get_class($event);
        }

        if (preg_match('/^bootstrapp(ing|ed): /', $event)) {
            return $event;
        }

        // Events can be formatted as 'event.name: parameters'
        $segments = explode(':', $event);

        return $segments[0];
    }

    /**
     * Did an event trigger?
     *
     * @param $event
     * @return bool
     */
    public function eventTriggered($event)
    {
        $event = $this->normalizeEvent($event);

        foreach ($this->triggeredEvents as $triggeredEvent) {
            if ($event == $triggeredEvent || is_subclass_of($event, $triggeredEvent)) {
                return true;
            }
        }

        return false;
    }

    /**
     * Clear all expected events.
     * Should be called before each test.
     */
    public function clearTriggeredEvents()
    {
        $this->triggeredEvents = [];
    }

}


text:
using System;
using Microsoft.Azure.EventHubs;
using Orleans.Providers.Streams.Common;
using Orleans.Streams;

namespace Orleans.ServiceBus.Providers
{
    public interface IEventHubDataAdapter : IQueueDataAdapter<EventData>, ICacheDataAdapter
    {
        CachedMessage FromQueueMessage(StreamPosition position, EventData queueMessage, DateTime dequeueTime, Func<int, ArraySegment<byte>> getSegment);

        StreamPosition GetStreamPosition(string partition, EventData queueMessage);

        string GetOffset(CachedMessage cachedMessage);
    }
}


text:
namespace ASC.Web.Sample {

    public partial class Elements {

        /// <summary>
        /// Master property.
        /// </summary>
        /// <remarks>
        /// Auto-generated property.
        /// </remarks>
        public new ASC.Web.Sample.Masters.BasicTemplate Master {
            get {
                return ((ASC.Web.Sample.Masters.BasicTemplate)(base.Master));
            }
        }
    }
}


text:
#ifndef __CCEGLVIEW_H__
#define __CCEGLVIEW_H__

#include "platform/CCCommon.h"
#include "cocoa/CCGeometry.h"
#include "platform/CCEGLViewProtocol.h"
#include "ppapi/cpp/input_event.h"
#include <pthread.h>
#include <queue>

bool initExtensions();

class OpenGLContext;
class CocosPepperInstance;

NS_CC_BEGIN

class CCEGLView : public CCEGLViewProtocol
{
public:
    CCEGLView();
    virtual ~CCEGLView();

    /**
     * iPixelWidth, height: the window's size
     * iWidth ,height: the point size, which may scale.
     * iDepth is not the buffer depth of opengl, it indicate how may bits for a pixel
     */
    virtual void setFrameSize(float width, float height);
    virtual void setViewPortInPoints(float x , float y , float w , float h);
    virtual void setScissorInPoints(float x , float y , float w , float h);

    /*
     * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop.
     */
    virtual bool isOpenGLReady();
    virtual void end();
    virtual void swapBuffers();
    virtual void setIMEKeyboardState(bool bOpen);

    void addEvent();
    void ProcessEventQueue();
    void AddEvent(const pp::InputEvent& event);

    /**
     @brief get the shared main open gl window
     */
    static CCEGLView* sharedOpenGLView();
    static CocosPepperInstance* g_instance;
private:
    void HandleMouseEvent(const pp::MouseInputEvent* event);
    bool initGL();
    void destroyGL();
    bool bIsInit;
    bool bIsMouseDown;
    float m_fFrameZoomFactor;
    OpenGLContext* m_context;
    std::queue<pp::InputEvent> m_event_queue;
    pthread_mutex_t m_mutex;
};

NS_CC_END

#endif /* __CCEGLVIEW_H__ */


text:
import os

# Where JAAD data will be saved if you run process_jaad.py
DATA_DIR = '/local_home/JAAD_Dataset/'

XML_DIR = '/local_home/JAAD_Dataset/JAAD_behavioral_data_xml_new/'

RESIZED_IMGS_DIR = '/local_home/JAAD_Dataset/iros/resized_imgs_208_thesis/'
if not os.path.exists(RESIZED_IMGS_DIR):
    os.mkdir(RESIZED_IMGS_DIR)

TEST_DIR = '/local_home/JAAD_Dataset/iros/resized_imgs_208_thesis/test/'
if not os.path.exists(TEST_DIR):
    os.mkdir(TEST_DIR)

TRAIN_DIR = '/local_home/JAAD_Dataset/iros/resized_imgs_208_thesis/train/'
if not os.path.exists(TRAIN_DIR):
    os.mkdir(TRAIN_DIR)

VAL_DIR = '/local_home/JAAD_Dataset/iros/resized_imgs_208_thesis/val/'
if not os.path.exists(VAL_DIR):
    os.mkdir(VAL_DIR)


text:
package evanq.game.module.rpg;

public interface IItemManager {

}


text:
from screed import ToFastq
import sys, os

# Shell interface to the ToFastq screed conversion function
if __name__ == '__main__':
    if len(sys.argv) != 3:
        print "Usage: %s <dbfilename> <outputfilename>" % sys.argv[0]
        exit(1)

    dbFile = sys.argv[1]
    outputFile = sys.argv[2]

    if not os.path.isfile(dbFile):
        print "No such file: %s" % dbFile
        exit(1)
    if os.path.isfile(outputFile):
        os.unlink(outputFile)

    ToFastq(dbFile, outputFile)


text:
An Android app that updates other apps without the need for the Google Play Store

The details of the app can be found in our wiki: https://wiki.curiouslearning.org/index.php/Updater_App


text:
import {Control, ControlView} from "./control"

import {ButtonType} from "core/enums"
import {div} from "core/dom"
import * as p from "core/properties"

import {bk_btn, bk_btn_group, bk_btn_type} from "styles/buttons"
import buttons_css from "styles/buttons.css"

export abstract class ButtonGroupView extends ControlView {
  model: ButtonGroup

  protected _buttons: HTMLElement[]

  connect_signals(): void {
    super.connect_signals()

    const p = this.model.properties
    this.on_change(p.button_type, () => this.render())
    this.on_change(p.labels,      () => this.render())
    this.on_change(p.active,      () => this._update_active())
  }

  styles(): string[] {
    return [...super.styles(), buttons_css]
  }

  render(): void {
    super.render()

    this._buttons = this.model.labels.map((label, i) => {
      const button = div({
        class: [bk_btn, bk_btn_type(this.model.button_type)],
        disabled: this.model.disabled,
      }, label)
      button.addEventListener("click", () => this.change_active(i))
      return button
    })

    this._update_active()

    const group = div({class: bk_btn_group}, this._buttons)
    this.el.appendChild(group)
  }

  abstract change_active(i: number): void

  protected abstract _update_active(): void
}

export namespace ButtonGroup {
  export type Attrs = p.AttrsOf<Props>

  export type Props = Control.Props & {
    labels: p.Property<string[]>
    button_type: p.Property<ButtonType>
  }
}

export interface ButtonGroup extends ButtonGroup.Attrs {}

export abstract class ButtonGroup extends Control {
  properties: ButtonGroup.Props & {
    active: p.Property<unknown>
  }

  constructor(attrs?: Partial<ButtonGroup.Attrs>) {
    super(attrs)
  }

  static init_ButtonGroup(): void {
    this.define<ButtonGroup.Props>({
      labels:      [ p.Array,      []        ],
      button_type: [ p.ButtonType, "default" ],
    })
  }
}


text:
from enum import IntEnum
from typing import Dict

import logging

from Engine.Communication.protobuf.referee_pb2 import SSL_Referee
from Util.constant import TeamColor, FieldSide
from Util.position import Position
from Util.team_color_service import TeamColorService
from config.config import Config

class RawRefereeCommand(IntEnum):
    HALT = 0
    STOP = 1
    NORMAL_START = 2
    FORCE_START = 3

    # raw commands
    PREPARE_KICKOFF_YELLOW = 4
    PREPARE_KICKOFF_BLUE = 5
    PREPARE_PENALTY_YELLOW = 6
    PREPARE_PENALTY_BLUE = 7
    DIRECT_FREE_YELLOW = 8
    DIRECT_FREE_BLUE = 9
    INDIRECT_FREE_YELLOW = 10
    INDIRECT_FREE_BLUE = 11
    TIMEOUT_YELLOW = 12
    TIMEOUT_BLUE = 13
    GOAL_YELLOW = 14
    GOAL_BLUE = 15
    BALL_PLACEMENT_YELLOW = 16
    BALL_PLACEMENT_BLUE = 17

class RefereeCommand(IntEnum):
    HALT = 0
    STOP = 1
    NORMAL_START = 2
    FORCE_START = 3

    PREPARE_KICKOFF_US = 4
    PREPARE_KICKOFF_THEM = 5
    PREPARE_PENALTY_US = 6
    PREPARE_PENALTY_THEM = 7
    DIRECT_FREE_US = 8
    DIRECT_FREE_THEM = 9
    INDIRECT_FREE_US = 10
    INDIRECT_FREE_THEM = 11
    TIMEOUT_US = 12
    TIMEOUT_THEM = 13
    GOAL_US = 14
    GOAL_THEM = 15
    BALL_PLACEMENT_US = 16
    BALL_PLACEMENT_THEM = 17

    PREPARE_SHOOTOUT_US = 18
    PREPARE_SHOOTOUT_THEM = 19
    NORMAL_START_SHOOTOUT = 20

class Stage(IntEnum):
    NORMAL_FIRST_HALF_PRE = 0
    NORMAL_FIRST_HALF = 1
    NORMAL_HALF_TIME = 2
    NORMAL_SECOND_HALF_PRE = 3
    NORMAL_SECOND_HALF = 4
    EXTRA_TIME_BREAK = 5
    EXTRA_FIRST_HALF_PRE = 6
    EXTRA_FIRST_HALF = 7
    EXTRA_HALF_TIME = 8
    EXTRA_SECOND_HALF_PRE = 9
    EXTRA_SECOND_HALF = 10
    PENALTY_SHOOTOUT_BREAK = 11
    PENALTY_SHOOTOUT = 12
    POST_GAME = 13

new_team_info = {"name": "",
                 "score": 0,
                 "red_cards": 0,
                 "yellow_cards": 0,
                 "yellow_card_times": [],
                 "timeouts": 4,
                 "timeout_time": 0,
                 "goalie": 0}

class RefereeState:

    last_packet = None
    logger = logging.getLogger('RefereeState')

    def __init__(self, referee_info: Dict):
        self.command = RawRefereeCommand.STOP
        self.stage = Stage.NORMAL_FIRST_HALF_PRE
        self.stage_time_left = 0
        self.ball_placement_position = None
        self.team_info = {"ours": dict(new_team_info), "theirs": dict(new_team_info)}

        self.blue_team_is_positive = None

        self._update(referee_info)

        RefereeState.log_change(referee_info)

    @property
    def info(self) -> Dict:
        return {
            "command": self.command.name,
            "stage": self.stage.name,
            "stage_time_left": self.stage_time_left
        }

    def _update(self, referee_info: Dict) -> None:
        self.stage = Stage(referee_info["stage"])

        # TODO: Currently the only optional field that we might rely on is the time left
        # since most packet don't specify it we need a additional state to track it
        if "stage_time_left" in referee_info:
            self.stage_time_left = referee_info["stage_time_left"]

        if "blueTeamOnPositiveHalf" in referee_info:
            self.blue_team_is_positive = referee_info["blueTeamOnPositiveHalf"]

        if "designated_position" in referee_info:
            self.ball_placement_position = self._convert_vision_position_to_ai_position(
                                                    Position(referee_info["designated_position"]["x"],
                                                             referee_info["designated_position"]["y"]))

        raw_command = RawRefereeCommand(referee_info["command"])

        if "blueTeamOnPositiveHalf" in referee_info and Config()['COACH']['competition_mode']:
            self._validate_field_side(referee_info["blueTeamOnPositiveHalf"])

        self.command = self._parse_command(raw_command)
        self._parse_team_info(referee_info)

    def _parse_command(self, command: RawRefereeCommand):
        # Color wise commands
        parsed_cmd = command
        if command >= RawRefereeCommand.PREPARE_KICKOFF_YELLOW:
            if self._is_our_team_command(command):
                parsed_cmd = self._convert_raw_to_us(command)
            else:
                parsed_cmd = self._convert_raw_to_them(command)

        # Not color wise commands
        referee_command = RefereeCommand(parsed_cmd)

        # Convert commands in case of a shootout
        if self.stage == Stage.PENALTY_SHOOTOUT:
            referee_command = RefereeState._convert_shootout_commands(referee_command)

        return referee_command

    @staticmethod
    def _convert_shootout_commands(referee_command):
        if referee_command == RefereeCommand.PREPARE_PENALTY_THEM:
            return RefereeCommand.PREPARE_SHOOTOUT_THEM
        if referee_command == RefereeCommand.PREPARE_PENALTY_US:
            return RefereeCommand.PREPARE_SHOOTOUT_US
        if referee_command == RefereeCommand.NORMAL_START:
            return RefereeCommand.NORMAL_START_SHOOTOUT
        else:
            return referee_command

    def _parse_team_info(self, frame):

        if TeamColorService().our_team_color is TeamColor.YELLOW:
            self.team_info['ours'] = frame['yellow']
            self.team_info['theirs'] = frame['blue']
        else:
            self.team_info['ours'] = frame['blue']
            self.team_info['theirs'] = frame['yellow']

        # Fixme : Since referee state is state-less, we can not keep track of the time since last yellow card
        # Currently only ui-debug use it
        for team in self.team_info:
            self.team_info[team]["yellow_card_times"] = []

    @staticmethod
    def _convert_vision_position_to_ai_position(designated_position: Position):
        if Config()["COACH"]["on_negative_side"]:
            designated_position.x *= -1
        return designated_position

    @staticmethod
    def _convert_raw_to_us(command):
        if TeamColorService().our_team_color is TeamColor.YELLOW:
            return command
        else:
            return command - 1

    @staticmethod
    def _convert_raw_to_them(command):
        if TeamColorService().our_team_color is TeamColor.YELLOW:
            return command
        else:
            return command + 1

    @staticmethod
    def _is_our_team_command(command):
        return (RefereeState._is_yellow_command(command) and TeamColorService().our_team_color is TeamColor.YELLOW) or \
               (RefereeState._is_blue_command(command) and TeamColorService().our_team_color is TeamColor.BLUE)

    @staticmethod
    def _is_yellow_command(command):
        return (command % 2) == 0  # even commands are yellow commands

    @staticmethod
    def _is_blue_command(command):
        return not RefereeState._is_yellow_command(command)

    @staticmethod
    def _validate_field_side(is_blue_positive):
        truth_table = {
            True: {
                TeamColor.BLUE: FieldSide.POSITIVE,
                TeamColor.YELLOW: FieldSide.NEGATIVE
            },
            False: {
                TeamColor.BLUE: FieldSide.NEGATIVE,
                TeamColor.YELLOW: FieldSide.POSITIVE
            }
        }
        expected = truth_table[is_blue_positive][TeamColorService().our_team_color]
        current = FieldSide.NEGATIVE if Config()["COACH"]["on_negative_side"] else FieldSide.POSITIVE
        assert expected == current, \
            "The referee is expecting that team {our_team} is {expected}, but currently it's {current}, CHANGE IT!!!"\
                .format(our_team=TeamColorService().our_team_color.name,
                        expected=expected.name,
                        current=current.name)

    @classmethod
    def log_change(cls, packet: SSL_Referee):

        if packet['blue']['name'] == '': packet['blue']['name'] = 'unknown'
        if packet['yellow']['name'] == '': packet['yellow']['name'] = 'unknown'

        if cls.last_packet:
            last_stage = cls.last_packet['stage']
            last_blue_team_info = cls.last_packet['blue']
            last_yellow_team_info = cls.last_packet['yellow']
        else:
            last_stage = None
            last_blue_team_info = {'name': None, 'score': 0, 'red_cards': 0, 'yellow_cards': 0, 'timeouts': 4}
            last_yellow_team_info = {'name': None, 'score': 0, 'red_cards': 0, 'yellow_cards': 0, 'timeouts': 4}

        cls.last_packet = packet

        new_blue_team_info = packet['blue']
        new_yellow_team_info = packet['yellow']
        new_stage = packet['stage']

        is_name_change = last_blue_team_info['name'] != new_blue_team_info['name'] or \
                         last_yellow_team_info['name'] != new_yellow_team_info['name']

        is_state_change = last_stage != new_stage

        scoring_team = {'blue': None, 'yellow': None}
        score_change = {'blue': 0, 'yellow': 0}
        if last_blue_team_info['score'] != new_blue_team_info['score']:
            scoring_team['blue'] = new_blue_team_info['name']
            score_change['blue'] = new_blue_team_info['score'] - last_blue_team_info['score']
        if last_yellow_team_info['score'] != new_yellow_team_info['score']:
            scoring_team['yellow'] = new_yellow_team_info['name']
            score_change['yellow'] = new_yellow_team_info['score'] - last_yellow_team_info['score']

        red_card_team = {'blue': None, 'yellow': None}
        red_card_change = {'blue': 0, 'yellow': 0}
        if last_blue_team_info['red_cards'] != new_blue_team_info['red_cards']:
            red_card_team['blue'] = new_blue_team_info['name']
            red_card_change['blue'] = new_blue_team_info['red_cards'] - last_blue_team_info['red_cards']
        if last_yellow_team_info['red_cards'] != new_yellow_team_info['red_cards']:
            red_card_team['yellow'] = new_yellow_team_info['name']
            red_card_change['yellow'] = new_yellow_team_info['red_cards'] - last_yellow_team_info['red_cards']

        yellow_card_team = {'blue': None, 'yellow': None}
        yellow_card_change = {'blue': 0, 'yellow': 0}
        if last_blue_team_info['yellow_cards'] != new_blue_team_info['yellow_cards']:
            yellow_card_team['blue'] = new_blue_team_info['name']
            yellow_card_change['blue'] = new_blue_team_info['yellow_cards'] - last_blue_team_info['yellow_cards']
        if last_yellow_team_info['yellow_cards'] != new_yellow_team_info['yellow_cards']:
            yellow_card_team['yellow'] = new_yellow_team_info['name']
            yellow_card_change['yellow'] = new_yellow_team_info['yellow_cards'] - last_yellow_team_info['yellow_cards']

        timeout_team = {'blue': None, 'yellow': None}
        timeout_time = {'blue': 0, 'yellow': 0}
        timeout_left = {'blue': 0, 'yellow': 0}
        timeout_change = {'blue': 0, 'yellow': 0}
        if last_blue_team_info['timeouts'] != new_blue_team_info['timeouts']:
            timeout_team['blue'] = new_blue_team_info['name']
            timeout_time['blue'] = new_blue_team_info['timeout_time']
            timeout_left['blue'] = new_blue_team_info['timeouts']
            timeout_change['blue'] = new_blue_team_info['timeouts'] - last_blue_team_info['timeouts']
        if last_yellow_team_info['timeouts'] != new_yellow_team_info['timeouts']:
            timeout_team['yellow'] = new_yellow_team_info['name']
            timeout_time['yellow'] = new_yellow_team_info['timeout_time']
            timeout_left['yellow'] = new_yellow_team_info['timeouts']
            timeout_change['yellow'] = new_yellow_team_info['timeouts'] - new_yellow_team_info['timeouts']

        if is_name_change:
            cls.logger.info('Team change detected.\n\n' + '-' * 40 + '\n' +
                            '  {} (BLUE) vs. {} (YELLOW)'.format(new_blue_team_info['name'], new_yellow_team_info['name'])
                            + '\n' + '-' * 40 + '\n\n')

        for team_color in ('blue', 'yellow'):
            if scoring_team[team_color] is not None:
                if score_change[team_color] == 1:
                    cls.logger.info('A goal was score by {}'.format(scoring_team[team_color]))
                elif score_change[team_color] > 1:
                    cls.logger.info('{} goals were score by {}.'.format(score_change[team_color], scoring_team[team_color]))
                else:
                    cls.logger.info('A goal was remove to {}'.format(scoring_team[team_color]))

                cls.logger.info('Current score: ({}: {} - {}: {})'.format(new_blue_team_info['name'],
                                                                      new_blue_team_info['score'],
                                                                      new_yellow_team_info['name'],
                                                                      new_yellow_team_info['score']))

            if red_card_team[team_color] is not None:
                if red_card_change[team_color] == 1:
                    cls.logger.info('A red card was taken by {}.'.format(red_card_team[team_color]))
                elif red_card_change[team_color] > 1:
                    cls.logger.info('{} red cards were taken by {}.'.format(red_card_change[team_color], red_card_team[team_color]))
                else:
                    cls.logger.info('A red card was remove to {}'.format(red_card_team[team_color]))

            if yellow_card_team[team_color] is not None:
                if yellow_card_change[team_color] == 1:
                    cls.logger.info('A yellow card was taken by {}.'.format(yellow_card_team[team_color]))
                elif yellow_card_change[team_color] > 1:
                    cls.logger.info('{} yellow cards were taken by {}.'.format(yellow_card_change[team_color], yellow_card_team[team_color]))
                else:
                    cls.logger.info('A yellow card was remove to {}'.format(yellow_card_team[team_color]))

            if timeout_team[team_color] is not None:
                if timeout_change[team_color] == -1:
                    cls.logger.info('A timeout was ask by {}.'.format(timeout_team[team_color]))
                elif timeout_change[team_color] < -1:
                    cls.logger.info('{} timeout calls were given to {}'.format(timeout_change[team_color], timeout_team[team_color]))
                else:
                    cls.logger.info('A timeout call was given to {}'.format(timeout_team[team_color]))
                cls.logger.info('Timeout left: {}. Time left: {:.1f} seconds'.format(timeout_left[team_color],
                                                                                timeout_time[team_color]/1000000))

        if is_state_change:
            stage = Stage(new_stage)
            cls.logger.info('Stage change detected. Now at {}.'.format(stage.name))
            if stage is Stage.POST_GAME:
                cls.logger.info(
                    'The game has ended. Final score: ({}: {} - {}: {})'.format(new_blue_team_info['name'],
                                                                                new_blue_team_info['score'],
                                                                                new_yellow_team_info['name'],
                                                                                new_yellow_team_info['score']))


text:
Wallet

                                            <form class="form-horizontal text-left" role="form">

                                                        SENDING:

                                                            <input type="text" class="form-control input-lg amount" id="amount" placeholder="How much?">

                                                        FROM:

                                                            <button class="address-view btn btn-default" type="button">xChoose Account to send from</button>
                                                            <button type="button" class="btn btn-default dropdown-toggle"
                                                                    aria-expanded="false" data-toggle="dropdown">

                                                                Toggle Dropdown
                                                            </button>

                                                                        Primary Spend Account
                                                                        175

                                                                        Savings
                                                                        0

                                                                    Generate new address

                                                        <button class="btn btn-default qrButton" disabled>

                                                        </button>

                                                        TO:

                                                            <input type="text" class="form-control toAddress" id="toAddress" placeholder="Recipient Address" value="{{to}}">

                                                        <button class="btn btn-default qrScanButton">

                                                        </button>

                                                        Select one or more spendable amounts.

                                                                Transaction Hex:
                                                                <textarea class="transaction-hash form-control" rows="5" id="comment" style="margin: 0px 449px 0px 0px; width: 630px; height: 118px;"></textarea>

                                                    <button type="button" class="btn btn-default send-now" disabled>
                                                        Send Now
                                                    </button>
                                                    <button class="btn btn-default reset">
                                                        Reset
                                                    </button>

                                            </form>

History

Account history coming soon


text:
@interface CVIssuesRequest()
@property (strong, nonatomic) NSNumber *volumeId;
@property (strong, nonatomic) NSMutableArray *issues;
@end

@implementation CVIssuesRequest

static NSString *const IssuesUrlTemplate = @"http://api.comicvine.com/issues/?api_key=%@&format=json&filter=volume:%@&sort=issue_number:asc&offset=%ld";

#pragma mark - Lifecycle

- (id) initWithVolumeId:(NSNumber *)volumeId atOffset:(unsigned long)offset withDelegate:(id)delegate {
    self = [super init];

    if(self) {
        self.issues = [[NSMutableArray alloc] init];
        self.volumeId = volumeId;
        self.requestURL = [NSString stringWithFormat:IssuesUrlTemplate, self.apiKey, volumeId, offset];
        self.delegate = delegate;
    }

    return self;
}

#pragma mark - NSURLDataConnectionData

- (void) connectionDidFinishLoading:(NSURLConnection *)connection {
    [super connectionDidFinishLoading:connection];

    if(self.responseOK) {
        for(NSDictionary *issue in self.responseResults) {
            CVIssue *vineVolume = [[CVIssue alloc] initWithRawData:issue];
            [self.issues addObject:vineVolume];
        }

        NSNumber *totalResults = [self.responseFull objectForKey:@"number_of_total_results"];
        if(self.issues.count < [totalResults integerValue]) {
            self.requestURL = [NSString stringWithFormat:IssuesUrlTemplate, self.apiKey, self.volumeId, (unsigned long)self.issues.count];
            self.requestData.length = 0;
            [self send];
        }
        else {
            NSSortDescriptor *valueDescriptor = [[NSSortDescriptor alloc]
                                                 initWithKey:@"issueNumber" ascending:YES selector:@selector(localizedStandardCompare:)];

            NSMutableArray  *sortedIssues = [[self.issues sortedArrayUsingDescriptors:@[valueDescriptor]] mutableCopy];

            if([self.delegate respondsToSelector:@selector(issuesResponseReceived:)]) {
                [self.delegate performSelectorOnMainThread:@selector(issuesResponseReceived:) withObject:sortedIssues waitUntilDone:NO];
            }
        }
    }
}

@end

@implementation CVIssuesRequestOperation

#pragma mark - Lifecycle

- (id) initWithVolumesRequest:(CVIssuesRequest *)request {
    self = [super init];

    if(self) {
        self.request = request;
    }

    return self;
}

#pragma mark - Private

- (void) main
{
    @autoreleasepool {
        if(self.isCancelled) {
            return;
        }

        [self.request send];
    }
}

@end


text:
    /**
     * @ngdoc resource
     * @name orderResource
     * @description Loads in data and allows modification for orders
     **/
    angular.module('merchello.resources')
        .factory('orderResource', ['$http', 'umbRequestHelper',
            function($http, umbRequestHelper) {

            return {

                getOrder: function (orderKey) {

                    return umbRequestHelper.resourcePromise(
                        $http({
                            url: umbRequestHelper.getApiUrl('merchelloOrderApiBaseUrl', 'GetOrder'),
                            method: "GET",
                            params: { id: orderKey }
                        }),
                        'Failed to get order: ' + orderKey);
                },

                getOrdersByInvoice: function (invoiceKey) {

                    return umbRequestHelper.resourcePromise(
                        $http({
                            url: umbRequestHelper.getApiUrl('merchelloOrderApiBaseUrl', 'GetOrdersByInvoiceKey'),
                            method: "GET",
                            params: { id: invoiceKey }
                        }),
                        'Failed to get orders by invoice: ' + invoiceKey);
                },

                getUnFulfilledItems: function (invoiceKey) {

                    return umbRequestHelper.resourcePromise(
                        $http({
                            url: umbRequestHelper.getApiUrl('merchelloOrderApiBaseUrl', 'GetUnFulfilledItems'),
                            method: "GET",
                            params: { id: invoiceKey }
                        }),
                        'Failed to get unfulfilled items by invoice: ' + invoiceKey);
                },

                getShippingAddress: function (invoiceKey) {
                    return umbRequestHelper.resourcePromise(
                        $http({
                            url: umbRequestHelper.getApiUrl('merchelloOrderApiBaseUrl', 'GetShippingAddress'),
                            method: "GET",
                            params: { id: invoiceKey }
                        }),
                        'Failed to get orders by invoice: ' + invoiceKey);
                },

                processesProductsToBackofficeOrder: function (customerKey, products, shippingAddress, billingAddress) {
                    var model = {};
                    model.CustomerKey = customerKey;
                    model.ProductKeys = products;
                    model.ShippingAddress = shippingAddress;
                    model.BillingAddress = billingAddress;

                    return umbRequestHelper.resourcePromise(
                        $http.post(umbRequestHelper.getApiUrl('merchelloOrderApiBaseUrl', 'ProcessesProductsToBackofficeOrder'),
                            model
                        ),
                        'Failed to add products to invoice');
                },

                getShippingMethods: function (customerKey, products, shippingAddress, billingAddress) {
                    var model = {};
                    model.CustomerKey = customerKey;
                    model.ProductKeys = products;
                    model.ShippingAddress = shippingAddress;
                    model.BillingAddress = billingAddress;

                    return umbRequestHelper.resourcePromise(
                        $http.post(umbRequestHelper.getApiUrl('merchelloOrderApiBaseUrl', 'GetShippingMethods'),
                            model
                        ),
                        'Failed to get shipping methods');
                },

                getPaymentMethods: function () {
                    return umbRequestHelper.resourcePromise(
                        $http({
                            url: umbRequestHelper.getApiUrl('merchelloOrderApiBaseUrl', 'GetPaymentMethods'),
                            method: "GET"
                        }),
                        'Failed to get payment methods');
                },

                finalizeBackofficeOrder: function (customerKey, products, shippingAddress, billingAddress, paymentKey, paymentProviderKey, shipmentKey) {
                    var model = {};
                    model.CustomerKey = customerKey;
                    model.ProductKeys = products;
                    model.ShippingAddress = shippingAddress;
                    model.BillingAddress = billingAddress;
                    model.PaymentKey = paymentKey;
                    model.PaymentProviderKey = paymentProviderKey;
                    model.ShipmentKey = shipmentKey;
                    return umbRequestHelper.resourcePromise(
                        $http.post(umbRequestHelper.getApiUrl('merchelloOrderApiBaseUrl', 'FinalizeBackofficeOrder'),
                            model
                        ),
                        'Failed to finalize backoffice order');
                }
            };

        }]);


text:
using System.Collections.Generic;
using System.Runtime.CompilerServices;

/// <summary>
/// Check for identity equality, used for various hashsets.
/// </summary>
/// <typeparam name="T">Type to check for identity equality</typeparam>
public class IdentityEqualityComparer<T> : IEqualityComparer<T>
    where T : class {

    /// <summary>
    /// Returns a hash code for this instance.
    /// </summary>
    /// <param name="value">The value.</param>
    /// <returns>
    /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
    /// </returns>
    public int GetHashCode(T value) {
        return RuntimeHelpers.GetHashCode(value);
    }

    /// <summary>
    /// Checks if left and right are equal referentially.
    /// </summary>
    /// <param name="left">The left.</param>
    /// <param name="right">The right.</param>
    /// <returns></returns>
    public bool Equals(T left, T right) {
        return left == right;
    }
}


text:
Hardware

					978 MHz

						<ui-switch ng-model='UAT_Enabled' settings-change></ui-switch>

					1090 MHz

						<ui-switch ng-model='ES_Enabled' settings-change></ui-switch>

					Ping ADS-B

						<ui-switch ng-model='Ping_Enabled' settings-change></ui-switch>

					GPS

						<ui-switch ng-model='GPS_Enabled' settings-change></ui-switch>

Diagnostics

					Show Traffic Source in Callsign

						<ui-switch ng-model='DisplayTrafficSource' settings-change></ui-switch>

					Verbose Message Log

						<ui-switch ng-model='DEBUG' settings-change></ui-switch>

					Record Replay Logs

						<ui-switch ng-model='ReplayLog' settings-change></ui-switch>

Configuration

					Mode S Code (Hex)
					<form name="modeForm" ng-submit="updatemodes()" novalidate>

						<input class="col-xs-7" type="string" required ng-model="OwnshipModeS" placeholder="FAA HEX code" ng-blur="updatemodes()" />
					</form>

					Watch List
					<form name="watchForm" ng-submit="updatewatchlist()" novalidate>

						<input class="col-xs-7" type="string" required ng-model="WatchList" placeholder="space-delimited identifiers" ng-blur="updatewatchlist()" />
					</form>

					PPM Correction
					<form name="ppmForm" ng-submit="updateppm()" novalidate>

						<input class="col-xs-7" type="number_format" required ng-model="PPM" placeholder="integer" ng-blur="updateppm()" />
					</form>

					Serial Output Baudrate
					<form name="ppmForm" ng-submit="updateBaud()" novalidate>

						<input class="col-xs-7" type="number_format" required ng-model="Baud" placeholder="integer" ng-blur="updateBaud()" />
					</form>

Commands

							Click to select System Update file
							<input style="opacity:0.0; position: absolute; top: 0; right: 0;" class="col-xs-12" type="file" name="update_file" onchange="angular.element(this).scope().setUploadFile(this.files)"/>

						<button class="btn btn-block" onclick="angular.element(this).scope().uploadFile()">Install {{update_files[0].name}}</button>

	  				  <button class="btn btn-primary btn-block" ui-turn-on="modalReboot">Reboot</button>

						<button class="btn btn-primary btn-block"ui-turn-on="modalShutdown">Shutdown</button>

Developer Options

						Static IPs
						<form name="staticipForm" ng-submit="updatestaticips()" novalidate>
							<input class="col-xs-7" type="string" required ng-model="StaticIps" ng-list=" " ng-trim="false" placeholder="space-delimited ip's to send network data" ng-blur="updatestaticips()" />
						</form>

Raw Configuration

stratux.conf:

{{rawSettings}}

Stratux is rebooting.  You may need to reconnect WiFi once it reboots.

Stratux is shutting down.  You may disconnect power.

          <button class="close"
                  ui-turn-off="modalReboot"></button>

Are you really sure?

Do you wish to reboot the Stratux?

Note that the system will reboot immediately and it will stop responding during the reboot

          Cancel
          Reboot

          <button class="close"
                  ui-turn-off="modalShutdown"></button>

Are you really sure?

Do you wish to shutdown the Stratux?

Note that the system will shutdown immediately. Please disconnect the power after the shutdown.

          Cancel
          Shutdown


text:
package com.atlassian.webdriver.it.tests;

import com.atlassian.pageobjects.browser.Browser;
import com.atlassian.pageobjects.browser.IgnoreBrowser;
import com.atlassian.webdriver.it.AbstractSimpleServerTest;
import com.atlassian.webdriver.it.pageobjects.page.WaiterTestPage;
import com.atlassian.webdriver.utils.Check;
import com.atlassian.webdriver.waiter.Waiter;
import com.atlassian.webdriver.waiter.webdriver.function.ConditionFunction;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

@IgnoreBrowser(Browser.HTMLUNIT_NOJS)
public class TestWaiter extends AbstractSimpleServerTest
{

    WaiterTestPage waiterTestPage;
    Waiter waiter;
    WebDriver driver;

    ConditionFunction falseFunc = new ConditionFunction()
    {
        public Boolean apply(WebDriver from)
        {
            return false;
        }
    };

    @Before
    public void setup()
    {
        waiterTestPage = product.visit(WaiterTestPage.class);
        waiter = waiterTestPage.getWaiter();
        driver = product.getTester().getDriver();
    }

    @Test
    public void testFunctionWaiterIsTrue()
    {
        assertEquals("Title was not what it was expected to be", "JavaScriptUtils test page",
                driver.getTitle());

        waiter.until(10, TimeUnit.MILLISECONDS).function(new ConditionFunction() {
            public Boolean apply(WebDriver from)
            {
                return from.getTitle().equals("JavaScriptUtils test page");
            }
        }).isTrue().execute();
    }

    @Test
    public void testFunctionWaiterIsFalse()
    {
        assertEquals("Title was not what it was expected to be", "JavaScriptUtils test page",
                driver.getTitle());
        Assert.assertNotSame("Not real title", driver.getTitle());
        waiter.until(10, TimeUnit.MILLISECONDS).function(new ConditionFunction() {
            public Boolean apply(WebDriver from)
            {
                return from.getTitle().equals("Not real title");
            }
        }).isFalse().execute();
    }

    @Test
    public void testWebElementIsVisible()
    {
        WebElement showEl = driver.findElement(By.id("dialog-one-show-button"));
        WebElement el = driver.findElement(By.id("dialog-one"));
        assertFalse(el.isDisplayed());
        showEl.click();

        waiter.until(1).element(el).isVisible().execute();

        assertTrue(el.isDisplayed());
    }

    @Test
    public void testWebElementIsVisibleWithDefaultWait()
    {
        WebElement showEl = driver.findElement(By.id("dialog-one-show-button"));
        WebElement el = driver.findElement(By.id("dialog-one"));
        assertFalse(el.isDisplayed());
        showEl.click();

        waiter.until().element(el).isVisible().execute();

        assertTrue(el.isDisplayed());
    }

    @Test
    public void testWebElementWithByLocatorIsVisible()
    {
        WebElement showEl = driver.findElement(By.id("dialog-one-show-button"));
        WebElement el = driver.findElement(By.id("dialog-one"));
        assertFalse(el.isDisplayed());
        showEl.click();

        waiter.until(1).element(By.id("dialog-one")).isVisible().execute();

        assertTrue(el.isDisplayed());
    }

    @Test
    public void testWebElementWithByLocatorAndContextIsVisible()
    {
        WebElement showEl = driver.findElement(By.id("dialog-one-show-button"));
        WebElement container = driver.findElement(By.id("dialog-one-container"));
        WebElement el = container.findElement(By.id("dialog-one"));

        assertFalse(el.isDisplayed());
        showEl.click();

        waiter.until(1).element(By.id("dialog-one"), container).isVisible().execute();

        assertTrue(el.isDisplayed());

    }

    @Test
    public void testWebElementIsNotVisible()
    {
        WebElement hideEl = driver.findElement(By.id("dialog-two-hide-button"));
        WebElement el = driver.findElement(By.id("dialog-two"));

        assertTrue(el.isDisplayed());
        hideEl.click();

        waiter.until(1).element(el).isNotVisible().execute();

        assertFalse(el.isDisplayed());
    }

    @Test
    public void testWebElementExists()
    {
        WebElement createEl = driver.findElement(By.id("dialog-three-create-button"));
        try
        {
            driver.findElement(By.id("dialog-three"));
            fail("The web element was not supposed to exist");
        }
        catch (NoSuchElementException e) {}

        createEl.click();

        waiter.until(1).element(By.id("dialog-three")).exists().execute();

        assertTrue(driver.findElement(By.id("dialog-three")).isDisplayed());
    }

    @Test
    public void testWebElementNotExists()
    {
        WebElement removeEl = driver.findElement(By.id("dialog-four-remove-button"));
        WebElement el = driver.findElement(By.id("dialog-four"));

        removeEl.click();

        waiter.until(1).element(By.id("dialog-four")).doesNotExist().execute();

        try
        {
            driver.findElement(By.id("dialog-four"));
            fail("The web element was not supposed to exist");
        }
        catch (NoSuchElementException e) {}

    }

    @Test
    public void testWebElementIsSelected()
    {
        WebElement checkEl = driver.findElement(By.id("dialog-five-select-button"));
        WebElement el = driver.findElement(By.id("dialog-five"));

        assertFalse(el.isSelected());

        checkEl.click();

        waiter.until(1).element(el).isSelected().execute();

        assertTrue(el.isSelected());
    }

    @Test
    public void testWebElementIsNotSelected()
    {
        WebElement unCheckEl = driver.findElement(By.id("dialog-six-select-button"));
        WebElement el = driver.findElement(By.id("dialog-six"));

        assertTrue(el.isSelected());

        unCheckEl.click();

        waiter.until(1).element(el).isNotSelected().execute();

        assertFalse(el.isSelected());
    }

    @Test
    public void testWebElementIsEnabled()
    {
        WebElement enableEl = driver.findElement(By.id("dialog-seven-enable-button"));
        WebElement el = driver.findElement(By.id("dialog-seven"));

        assertFalse(el.isEnabled());

        enableEl.click();

        waiter.until(1).element(el).isEnabled().execute();

        assertTrue(el.isEnabled());
    }

    @Test
    public void testWebElementIsNotEnabled()
    {
        WebElement disableEl = driver.findElement(By.id("dialog-eight-disable-button"));
        WebElement el = driver.findElement(By.id("dialog-eight"));

        assertTrue(el.isEnabled());

        disableEl.click();

        waiter.until(1).element(el).isNotEnabled().execute();

        assertFalse(el.isEnabled());
    }

    @Test
    public void testWebElementHasClass()
    {
        WebElement addClassEl = driver.findElement(By.id("dialog-nine-addclass-button"));
        WebElement el = driver.findElement(By.id("dialog-nine"));

        assertFalse(Check.hasClass("awesome", el));

        addClassEl.click();

        waiter.until(1).element(el).hasClass("awesome").execute();

        assertTrue(Check.hasClass("awesome", el));
    }

    @Test
    public void testWebElementDoesNotHaveClass()
    {
        WebElement removeClassEl = driver.findElement(By.id("dialog-ten-removeclass-button"));
        WebElement el = driver.findElement(By.id("dialog-ten"));

        assertTrue(Check.hasClass("awesome", el));

        removeClassEl.click();

        waiter.until(1).element(el).doesNotHaveClass("awesome").execute();

        assertFalse(Check.hasClass("awesome", el));
    }

    @Test
    public void testWebElementGetText()
    {
        WebElement addTextEl = driver.findElement(By.id("dialog-eleven-addtext-button"));
        WebElement el = driver.findElement(By.id("dialog-eleven"));

        assertTrue("".equals(el.getText()));

        addTextEl.click();

        waiter.until(1).element(el).getText().isNotEmpty().execute();

        assertFalse("".equals(el.getText()));
        assertEquals("Element text did not match expected.", "Dialog eleven", el.getText());
    }

    @Test
    public void testWebElementGetAttribute()
    {
        WebElement addAttrEl = driver.findElement(By.id("dialog-twelve-addattribute-button"));
        WebElement el = driver.findElement(By.id("dialog-twelve"));

        assertNull(el.getAttribute("data-test"));

        addAttrEl.click();

        waiter.until(1).element(el).getAttribute("data-test").isNotEmpty().execute();

        assertFalse("".equals(el.getAttribute("data-test")));
        assertEquals("Element attribute data-test did not match expected.",
                "value", el.getAttribute("data-test"));
    }

    @Test(expected = org.openqa.selenium.TimeoutException.class)
    public void testWaiterFailure()
    {
        waiter.until(1).function(new ConditionFunction() {
            public Boolean apply(WebDriver from)
            {
                return false;
            }
        }).isTrue().execute();
    }

    @Test
    public void testAndWaiterQuery()
    {
        WebElement addClassAndTextEl =
                driver.findElement(By.id("dialog-thirteen-addattributeandclass-button"));
        WebElement el = driver.findElement(By.id("dialog-thirteen"));

        assertFalse(Check.hasClass("awesome", el));
        assertTrue("".equals(el.getText()));

        addClassAndTextEl.click();

        waiter.until(1500, TimeUnit.MILLISECONDS).element(el).hasClass("awesome").and()
                .element(el).getText().isNotEmpty().execute();

        assertTrue(Check.hasClass("awesome", el));
        assertFalse("".equals(el.getText()));
        assertEquals("element text was not what was expected.", "Dialog thirteen", el.getText());
    }

    @Test
    public void testOrWaiterQuery()
    {
        WebElement addClassEl = driver.findElement(By.id("dialog-nine-addclass-button"));
        WebElement el = driver.findElement(By.id("dialog-nine"));

        assertFalse(Check.hasClass("awesome", el));

        addClassEl.click();

        waiter.until(1)
                .function(falseFunc).isTrue().or()
                .element(el).hasClass("awesome").execute();

        assertTrue(Check.hasClass("awesome", el));
    }

    @Test
    public void testAndOrWaiterQuery()
    {
        WebElement addClassEl = driver.findElement(By.id("dialog-nine-addclass-button"));
        WebElement el = driver.findElement(By.id("dialog-nine"));

        assertFalse(Check.hasClass("awesome", el));

        addClassEl.click();

        waiter.until(1)
            .function(falseFunc).isFalse().and()
            .function(falseFunc).isTrue().or()
            .element(el).hasClass("awesome").execute();

        assertTrue(Check.hasClass("awesome", el));
    }

    @Test
    public void testOrAndWaiterQuery()
    {
        WebElement addClassAndTextEl =
                driver.findElement(By.id("dialog-thirteen-addattributeandclass-button"));
        WebElement el = driver.findElement(By.id("dialog-thirteen"));

        assertFalse(Check.hasClass("awesome", el));
        assertTrue("".equals(el.getText()));

        addClassAndTextEl.click();

        waiter.until(1500, TimeUnit.MILLISECONDS)
                .function(falseFunc).isTrue().or()
                .element(el).hasClass("awesome").and()
                .element(el).getText().isNotEmpty().execute();

        assertTrue(Check.hasClass("awesome", el));
        assertFalse("".equals(el.getText()));
        assertEquals("element text was not what was expected.", "Dialog thirteen", el.getText());
    }

}