text:
/**
 * @fileoverview Definitions for W3C's IndexedDB API. In Chrome all the IndexedDB
 * classes are prefixed with 'webkit'. In order to access constants and static
 * methods of these classes they must be duplicated with the prefix here.
 * @see http://www.w3.org/TR/IndexedDB/
 *
 * @externs
 * @author guido.tapia@picnet.com.au (Guido Tapia)
 */

/** @type {IDBFactory} */
Window.prototype.moz_indexedDB;

/** @type {IDBFactory} */
Window.prototype.mozIndexedDB;

/** @type {IDBFactory} */
Window.prototype.webkitIndexedDB;

/** @type {IDBFactory} */
Window.prototype.msIndexedDB;

/** @type {IDBFactory} */
Window.prototype.indexedDB;

/**
 * @constructor
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBFactory
 */
function IDBFactory() {}

/**
 * @param {string} name The name of the database to open.
 * @param {string=} opt_description The description of the database.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBFactory.prototype.open = function(name, opt_description) {};

/**
 * @param {string} name The name of the database to delete.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBFactory.prototype.deleteDatabase = function(name) {};

/**
 * @constructor
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabaseException
 */
function IDBDatabaseException() {}

/**
 * @constructor
 * @extends {IDBDatabaseException}
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabaseException
 */
function webkitIDBDatabaseException() {}

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.UNKNOWN_ERR;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.UNKNOWN_ERR;

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.NON_TRANSIENT_ERR;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.NON_TRANSIENT_ERR;

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.NOT_FOUND_ERR;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.NOT_FOUND_ERR;

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.CONSTRAINT_ERR;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.CONSTRAINT_ERR;

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.DATA_ERR;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.DATA_ERR;

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.NOT_ALLOWED_ERR;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.NOT_ALLOWED_ERR;

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.TRANSACTION_INACTIVE_ERR;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.TRANSACTION_INACTIVE_ERR;

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.ABORT_ERR;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.ABORT_ERR;

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.READ_ONLY_ERR;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.READ_ONLY_ERR;

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.TIMEOUT_ERR;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.TIMEOUT_ERR;

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.QUOTA_ERR;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.QUOTA_ERR;

/**
 * @const
 * @type {number}
 */
IDBDatabaseException.code;

/**
 * @const
 * @type {number}
 */
webkitIDBDatabaseException.code;

/**
 * @const
 * @type {string}
 */
IDBDatabaseException.message;

/**
 * @const
 * @type {string}
 */
webkitIDBDatabaseException.message;

/** @type {function(new:IDBRequest)} */
Window.prototype.IDBRequest;

/** @type {function(new:IDBRequest)} */
Window.prototype.webkitIDBRequest;

/**
 * @constructor
 * @implements {EventTarget}
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequest
 */
function IDBRequest() {}

/** @override */
IDBRequest.prototype.addEventListener = function(type, listener, useCapture) {};

/** @override */
IDBRequest.prototype.removeEventListener =
    function(type, listener, useCapture) {};

/** @override */
IDBRequest.prototype.dispatchEvent = function(evt) {};

/**
 * @constructor
 * @extends {IDBRequest}
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBRequest
 */
function webkitIDBRequest() {}

/**
 * @type {number}
 * @const
 */
IDBRequest.LOADING;

/**
 * @type {number}
 * @const
 */
webkitIDBRequest.LOADING;

/**
 * @type {number}
 * @const
 */
IDBRequest.DONE;

/**
 * @type {number}
 * @const
 */
webkitIDBRequest.DONE;

/**
 * @type {number}
 * @const
 */
IDBRequest.prototype.readyState;

/**
 * @type {function(!Event)}
 */
IDBRequest.prototype.onsuccess = function(e) {};

/**
 * @type {function(!Event)}
 */
IDBRequest.prototype.onerror = function(e) {};

/**
 * @type {*}
 * @const
 */
IDBRequest.prototype.result;

/**
 * @type {number}
 * @const
 */
IDBRequest.prototype.errorCode;

/**
 * @type {Object}
 * @const
 */
IDBRequest.prototype.source;

/**
 * @type {IDBTransaction}
 * @const
 */
IDBRequest.prototype.transaction;

/**
 * @constructor
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBDatabase
 */
function IDBDatabase() {}

/**
 * @type {string}
 * @const
 */
IDBDatabase.prototype.name;

/**
 * @type {string}
 * @const
 */
IDBDatabase.prototype.description;

/**
 * @type {string}
 * @const
 */
IDBDatabase.prototype.version;

/**
 * @type {Array.<string>}
 * @const
 */
IDBDatabase.prototype.objectStoreNames;

/**
 * @param {string} name The name of the object store.
 * @param {Object=} opt_parameters Parameters to be passed
 *     creating the object store.
 * @return {!IDBObjectStore} The created/open object store.
 */
IDBDatabase.prototype.createObjectStore =
    function(name, opt_parameters)  {};

/**
 * @param {string} name The name of the object store to remove.
 */
IDBDatabase.prototype.deleteObjectStore = function(name) {};

/**
 * @param {string} version The new version of the database.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBDatabase.prototype.setVersion = function(version) {};

/**
 * @param {Array.<string>} storeNames The stores to open in this transaction.
 * @param {(number|string)=} mode The mode for opening the object stores.
 * @return {!IDBTransaction} The IDBRequest object.
 */
IDBDatabase.prototype.transaction = function(storeNames, mode) {};

/**
 * Closes the database connection.
 */
IDBDatabase.prototype.close = function() {};

/**
 * @type {Function}
 */
IDBDatabase.prototype.onabort = function() {};

/**
 * @type {Function}
 */
IDBDatabase.prototype.onerror = function() {};

/**
 * @type {Function}
 */
IDBDatabase.prototype.onversionchange = function() {};

/**
 * @constructor
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBObjectStore
 */
function IDBObjectStore() {}

/**
 * @type {string}
 * @const
 */
IDBObjectStore.prototype.name;

/**
 * @type {string}
 * @const
 */
IDBObjectStore.prototype.keyPath;

/**
 * @type {Array.<string>}
 * @const
 */
IDBObjectStore.prototype.indexNames;

/**
 * @param {*} value The value to put into the object store.
 * @param {*=} key The key of this value.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBObjectStore.prototype.put = function(value, key) {};

/**
 * @param {*} value The value to add into the object store.
 * @param {*=} key The key of this value.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBObjectStore.prototype.add = function(value, key) {};

/**
 * @param {*} key The key of the document to remove.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBObjectStore.prototype.remove = function(key) {};

/**
 * @param {*} key The key of the document to retrieve.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBObjectStore.prototype.get = function(key) {};

/**
 * @param {IDBKeyRange=} range The range of the cursor.
 * @param {(number|string)=} direction The direction of cursor enumeration.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBObjectStore.prototype.openCursor = function(range, direction) {};

/**
 * @param {string} name The name of the index.
 * @param {string} keyPath The path to the index key.
 * @param {Object=} opt_paramters Optional parameters
 *     for the created index.
 * @return {!IDBIndex} The IDBIndex object.
 */
IDBObjectStore.prototype.createIndex = function(name, keyPath, opt_paramters) {};

/**
 * @param {string} name The name of the index to retrieve.
 * @return {!IDBIndex} The IDBIndex object.
 */
IDBObjectStore.prototype.index = function(name) {};

/**
 * @param {string} indexName The name of the index to remove.
 */
IDBObjectStore.prototype.deleteIndex = function(indexName) {};

/**
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBObjectStore.prototype.clear = function() {};

/**
 * Note: This is currently only supported by Mozilla's implementation
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBObjectStore.prototype.getAll = function() {};

/**
 * @constructor
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBIndex
 */
function IDBIndex() {}

/**
 * @type {string}
 * @const
 */
IDBIndex.prototype.name;

/**
 * @type {!IDBObjectStore}
 * @const
 */
IDBIndex.prototype.objectStore;

/**
 * @type {string}
 * @const
 */
IDBIndex.prototype.keyPath;

/**
 * @type {boolean}
 * @const
 */
IDBIndex.prototype.unique;

/**
 * @param {IDBKeyRange=} range The range of the cursor.
 * @param {(number|string)=} direction The direction of cursor enumeration.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBIndex.prototype.openCursor = function(range, direction) {};

/**
 * @param {IDBKeyRange=} range The range of the cursor.
 * @param {(number|string)=} direction The direction of cursor enumeration.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBIndex.prototype.openKeyCursor = function(range, direction) {};

/**
 * @param {*} key The id of the object to retrieve.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBIndex.prototype.get = function(key) {};

/**
 * @param {*} key The id of the object to retrieve.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBIndex.prototype.getKey = function(key) {};

/** @type {function(new:IDBCursor)} */
Window.prototype.IDBCursor;

/** @type {function(new:IDBCursor)} */
Window.prototype.webkitIDBCursor;

/**
 * @constructor
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursor
 */
function IDBCursor() {}

/**
 * @constructor
 * @extends {IDBCursor}
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBCursor
 */
function webkitIDBCursor() {}

/**
 * @const
 * @type {number}
 */
IDBCursor.NEXT;

/**
 * @const
 * @type {number}
 */
webkitIDBCursor.NEXT;

/**
 * @const
 * @type {number}
 */
IDBCursor.NEXT_NO_DUPLICATE;

/**
 * @const
 * @type {number}
 */
webkitIDBCursor.NEXT_NO_DUPLICATE;

/**
 * @const
 * @type {number}
 */
IDBCursor.PREV;

/**
 * @const
 * @type {number}
 */
webkitIDBCursor.PREV;

/**
 * @const
 * @type {number}
 */
IDBCursor.PREV_NO_DUPLICATE;

/**
 * @const
 * @type {number}
 */
webkitIDBCursor.PREV_NO_DUPLICATE;

/**
 * @type {*}
 * @const
 */
IDBCursor.prototype.source;

/**
 * @type {number}
 * @const
 */
IDBCursor.prototype.direction;

/**
 * @type {*}
 * @const
 */
IDBCursor.prototype.key;

/**
 * @type {number}
 * @const
 */
IDBCursor.prototype.primaryKey;

/**
 * @param {*} value The new value for the current object in the cursor.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBCursor.prototype.update = function(value) {};

/**
 * Note: Must be quoted to avoid parse error.
 * @param {*=} key Continue enumerating the cursor from the specified key
 *    (or next).
 */
IDBCursor.prototype['continue'] = function(key) {};

/**
 * @param {number} count Number of times to iterate the cursor.
 */
IDBCursor.prototype.advance = function(count) {};

/**
 * Note: Must be quoted to avoid parse error.
 * @return {!IDBRequest} The IDBRequest object.
 */
IDBCursor.prototype['delete'] = function() {};

/** @type {function(new:IDBTransaction)} */
Window.prototype.IDBTransaction;

/** @type {function(new:IDBTransaction)} */
Window.prototype.webkitIDBTransaction;

/**
 * @constructor
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBTransaction
 */
function IDBTransaction() {}

/**
 * @constructor
 * @extends {IDBTransaction}
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBTransaction
 */
function webkitIDBTransaction() {}

/**
 * @const
 * @type {number}
 */
IDBTransaction.READ_WRITE;

/**
 * @const
 * @type {number}
 */
webkitIDBTransaction.READ_WRITE;

/**
 * @const
 * @type {number}
 */
IDBTransaction.READ_ONLY;

/**
 * @const
 * @type {number}
 */
webkitIDBTransaction.READ_ONLY;

/**
 * @const
 * @type {number}
 */
IDBTransaction.VERSION_CHANGE;

/**
 * @const
 * @type {number}
 */
webkitIDBTransaction.VERSION_CHANGE;

/**
 * @type {number}
 * @const
 */
IDBTransaction.prototype.mode;

/**
 * @type {IDBDatabase}
 * @const
 */
IDBTransaction.prototype.db;

/**
 * @param {string} name The name of the object store to retrieve.
 * @return {!IDBObjectStore} The object store.
 */
IDBTransaction.prototype.objectStore = function(name) {};

/**
 * Aborts the transaction.
 */
IDBTransaction.prototype.abort = function() {};

/**
 * @type {Function}
 */
IDBTransaction.prototype.onabort = function() {};

/**
 * @type {Function}
 */
IDBTransaction.prototype.oncomplete = function() {};

/**
 * @type {Function}
 */
IDBTransaction.prototype.onerror = function() {};

/** @type {function(new:IDBKeyRange)} */
Window.prototype.IDBKeyRange;

/** @type {function(new:IDBKeyRange)} */
Window.prototype.webkitIDBKeyRange;

/**
 * @constructor
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange
 */
function IDBKeyRange() {}

/**
 * @constructor
 * @extends {IDBKeyRange}
 * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange
 */
function webkitIDBKeyRange() {}

/**
 * @type {*}
 * @const
 */
IDBKeyRange.prototype.lower;

/**
 * @type {*}
 * @const
 */
IDBKeyRange.prototype.upper;

/**
 * @type {*}
 * @const
 */
IDBKeyRange.prototype.lowerOpen;

/**
 * @type {*}
 * @const
 */
IDBKeyRange.prototype.upperOpen;

/**
 * @param {*} value The single key value of this range.
 * @return {!IDBKeyRange} The key range.
 */
IDBKeyRange.only = function(value) {};

/**
 * @param {*} value The single key value of this range.
 * @return {!IDBKeyRange} The key range.
 */
webkitIDBKeyRange.only = function(value) {};

/**
 * @param {*} bound Creates a lower bound key range.
 * @param {boolean=} open Open the key range.
 * @return {!IDBKeyRange} The key range.
 */
IDBKeyRange.lowerBound = function(bound, open) {};

/**
 * @param {*} bound Creates a lower bound key range.
 * @param {boolean=} open Open the key range.
 * @return {!IDBKeyRange} The key range.
 */
webkitIDBKeyRange.lowerBound = function(bound, open) {};

/**
 * @param {*} bound Creates an upper bound key range.
 * @param {boolean=} open Open the key range.
 * @return {!IDBKeyRange} The key range.
 */
IDBKeyRange.upperBound = function(bound, open) {};

/**
 * @param {*} bound Creates an upper bound key range.
 * @param {boolean=} open Open the key range.
 * @return {!IDBKeyRange} The key range.
 */
webkitIDBKeyRange.upperBound = function(bound, open) {};

/**
 * @param {*} left The left bound value of openLeft is true.
 * @param {*} right The right bound value of openRight is true.
 * @param {boolean=} openLeft Whether to open a left bound range.
 * @param {boolean=} openRight Whether to open a right bound range.
 * @return {!IDBKeyRange} The key range.
 */
IDBKeyRange.bound = function(left, right, openLeft, openRight) {};

/**
 * @param {*} left The left bound value of openLeft is true.
 * @param {*} right The right bound value of openRight is true.
 * @param {boolean=} openLeft Whether to open a left bound range.
 * @param {boolean=} openRight Whether to open a right bound range.
 * @return {!IDBKeyRange} The key range.
 */
webkitIDBKeyRange.bound = function(left, right, openLeft, openRight) {};


text:
import sys

from setuptools import setup, find_packages

setup(
    name='awscli-keyring',
    version='0.1.3',
    description='AWS command line credentials from OS X Keychain and other keyrings.',
    long_description='AWS command line credentials from OS X Keychain and other keyrings.',
    author='Samuel Cochran',
    author_email='sj26@sj26.com',
    url='https://github.com/sj26/awscli-keyring',
    packages=find_packages(exclude=['tests*']),
    install_requires=[
        'awscli',
        'keyring',
    ],
    license="MIT",
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Natural Language :: English',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python',
    ],
)

redpajama_set_name: RedPajamaGithub


text:
package com.amazonaws.services.mediaconnect.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * An entitlement that has been granted to you from other AWS accounts.
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListedEntitlement implements Serializable, Cloneable, StructuredPojo {

    /** The ARN of the entitlement. */
    private String entitlementArn;
    /** The name of the entitlement. */
    private String entitlementName;

    /**
     * The ARN of the entitlement.
     *
     * @param entitlementArn
     *        The ARN of the entitlement.
     */

    public void setEntitlementArn(String entitlementArn) {
        this.entitlementArn = entitlementArn;
    }

    /**
     * The ARN of the entitlement.
     *
     * @return The ARN of the entitlement.
     */

    public String getEntitlementArn() {
        return this.entitlementArn;
    }

    /**
     * The ARN of the entitlement.
     *
     * @param entitlementArn
     *        The ARN of the entitlement.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListedEntitlement withEntitlementArn(String entitlementArn) {
        setEntitlementArn(entitlementArn);
        return this;
    }

    /**
     * The name of the entitlement.
     *
     * @param entitlementName
     *        The name of the entitlement.
     */

    public void setEntitlementName(String entitlementName) {
        this.entitlementName = entitlementName;
    }

    /**
     * The name of the entitlement.
     *
     * @return The name of the entitlement.
     */

    public String getEntitlementName() {
        return this.entitlementName;
    }

    /**
     * The name of the entitlement.
     *
     * @param entitlementName
     *        The name of the entitlement.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListedEntitlement withEntitlementName(String entitlementName) {
        setEntitlementName(entitlementName);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getEntitlementArn() != null)
            sb.append("EntitlementArn: ").append(getEntitlementArn()).append(",");
        if (getEntitlementName() != null)
            sb.append("EntitlementName: ").append(getEntitlementName());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ListedEntitlement == false)
            return false;
        ListedEntitlement other = (ListedEntitlement) obj;
        if (other.getEntitlementArn() == null ^ this.getEntitlementArn() == null)
            return false;
        if (other.getEntitlementArn() != null && other.getEntitlementArn().equals(this.getEntitlementArn()) == false)
            return false;
        if (other.getEntitlementName() == null ^ this.getEntitlementName() == null)
            return false;
        if (other.getEntitlementName() != null && other.getEntitlementName().equals(this.getEntitlementName()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getEntitlementArn() == null) ? 0 : getEntitlementArn().hashCode());
        hashCode = prime * hashCode + ((getEntitlementName() == null) ? 0 : getEntitlementName().hashCode());
        return hashCode;
    }

    @Override
    public ListedEntitlement clone() {
        try {
            return (ListedEntitlement) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.mediaconnect.model.transform.ListedEntitlementMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
package byronRestaurant.interfaces;

/**
 * A sample Customer interface built to unit test a CashierRole.
 *
 * @author Monroe Ekilah
 *
 */
public interface Customer {
	/**
	 * @param total The cost according to the cashier
	 *
	 * Sent by the cashier prompting the customer's money after the customer has approached the cashier.
	 */
	public abstract void HereIsYourTotal(double total);

	/**
	 * @param total change (if any) due to the customer
	 *
	 * Sent by the cashier to end the transaction between him and the customer. total will be >= 0 .
	 */
	public abstract void HereIsYourChange(double total);

	/**
	 * @param remaining_cost how much money is owed
	 * Sent by the cashier if the customer does not pay enough for the bill (in lieu of sending {@link #HereIsYourChange(double)}
	 */
	public abstract void YouOweUs(double remaining_cost);

}


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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>net.vexelon.wcp</groupId>
	<artifactId>wschat</artifactId>
	<packaging>war</packaging>
	<version>0.0.1-SNAPSHOT</version>
	<name>wschat Maven Webapp</name>
	<url>http://maven.apache.org</url>

	<properties>
		<!-- Adapt this to a version found on http://central.maven.org/maven2/org/eclipse/jetty/jetty-maven-plugin/ -->
		<jettyVersion>9.1.1.v20140108</jettyVersion>
		<jdk.version>1.7</jdk.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-webapp</artifactId>
			<version>${jettyVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-servlets</artifactId>
			<version>${jettyVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-jsp</artifactId>
			<version>${jettyVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-util</artifactId>
			<version>${jettyVersion}</version>
		</dependency>
		<!-- <dependency> -->
		<!-- <groupId>org.eclipse.jetty</groupId> -->
		<!-- <artifactId>jetty-websocket</artifactId> -->
		<!-- <version>8.1.12.v20130726</version> -->
		<!-- </dependency> -->
		<dependency>
			<groupId>org.eclipse.jetty.websocket</groupId>
			<artifactId>websocket-core</artifactId>
			<version>9.0.0.M2</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty.websocket</groupId>
			<artifactId>websocket-server</artifactId>
			<version>${jettyVersion}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty.websocket</groupId>
			<artifactId>websocket-servlet</artifactId>
			<version>${jettyVersion}</version>
		</dependency>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.2.4</version>
		</dependency>
	</dependencies>

	<build>
		<finalName>wschat</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.1</version>
				<configuration>
					<source>${jdk.version}</source>
					<target>${jdk.version}</target>
				</configuration>
			</plugin>
			<plugin>
			  <groupId>org.eclipse.jetty</groupId>
			  <artifactId>jetty-maven-plugin</artifactId>
			  <version>9.1.3.v20140225</version>
			</plugin>
		</plugins>
	</build>
</project>


text:
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx.h"

/** @addtogroup STM32F4xx_StdPeriph_Examples
  * @{
  */

/** @addtogroup TIM_Synchro
  * @{
  */

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
TIM_TimeBaseInitTypeDef  TIM_TimeBaseStructure;
TIM_OCInitTypeDef  TIM_OCInitStructure;
TIM_BDTRInitTypeDef TIM_BDTRInitStructure;

/* Private function prototypes -----------------------------------------------*/
void TIM_Config(void);

/* Private functions ---------------------------------------------------------*/

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /*!< At this stage the microcontroller clock setting is already configured,
       this is done through SystemInit() function which is called from startup
       files (startup_stm32f40_41xxx.s/startup_stm32f427_437xx.s/startup_stm32f429_439xx.s)
       before to branch to application main.
       To reconfigure the default setting of SystemInit() function, refer to
       system_stm32f4xx.c file
     */

  /* TIM1 Configuration */
  TIM_Config();

  /* ---------------------------------------------------------------------------
    TIM1 and Timers(TIM3 and TIM4) synchronisation in parallel mode.
     1/TIM1 is configured as Master Timer:
         - PWM Mode is used
         - The TIM1 Update event is used as Trigger Output

     2/TIM3 and TIM4 are slaves for TIM1,
         - PWM Mode is used
         - The ITR0(TIM1) is used as input trigger for both slaves
         - Gated mode is used, so starts and stops of slaves counters
           are controlled by the Master trigger output signal(update event).

    In this example TIM1 input clock (TIM1CLK) is set to 2 * APB2 clock (PCLK2),
    since APB2 prescaler is different from 1.
      TIM1CLK = 2 * PCLK2
      PCLK2 = HCLK / 2
      => TIM1CLK = HCLK = SystemCoreClock

    The TIM1 counter clock is equal to SystemCoreClock = 168 Mhz.

    The Master Timer TIM1 is running at:
    TIM1 frequency = TIM1 counter clock / (TIM1_Period + 1) = 656 KHz
    TIM1_Period = (TIM1 counter clock / TIM1 frequency) - 1 = 255
    and the duty cycle is equal to: TIM1_CCR1/(TIM1_ARR + 1) = 50%

    The TIM3 is running at:
    (TIM1 frequency)/ ((TIM3 period +1)* (Repetition_Counter+1)) = 43.730 KHz and
    a duty cycle equal to TIM3_CCR1/(TIM3_ARR + 1) = 33.3%

    The TIM4 is running at:
    (TIM1 frequency)/ ((TIM4 period +1)* (Repetition_Counter+1)) = 65.600 KHz and
    a duty cycle equal to TIM4_CCR1/(TIM4_ARR + 1) = 50%

    Note:
     SystemCoreClock variable holds HCLK frequency and is defined in system_stm32f4xx.c file.
     Each time the core clock (HCLK) changes, user had to call SystemCoreClockUpdate()
     function to update SystemCoreClock variable value. Otherwise, any configuration
     based on this variable will be incorrect.
  --------------------------------------------------------------------------- */

  /* TIM3 Peripheral Configuration ----------------------------------------*/
  /* TIM3 Slave Configuration: PWM1 Mode */
  TIM_TimeBaseStructure.TIM_Period = 2;
  TIM_TimeBaseStructure.TIM_Prescaler = 0;
  TIM_TimeBaseStructure.TIM_ClockDivision = 0;
  TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;

  TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure);

  TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
  TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
  TIM_OCInitStructure.TIM_Pulse = 1;

  TIM_OC1Init(TIM3, &TIM_OCInitStructure);

  /* Slave Mode selection: TIM3 */
  TIM_SelectSlaveMode(TIM3, TIM_SlaveMode_Gated);
  TIM_SelectInputTrigger(TIM3, TIM_TS_ITR0);

  /* TIM4 Peripheral Configuration ----------------------------------------*/
  /* TIM4 Slave Configuration: PWM1 Mode */
  TIM_TimeBaseStructure.TIM_Period = 1;
  TIM_TimeBaseStructure.TIM_Prescaler = 0;
  TIM_TimeBaseStructure.TIM_ClockDivision = 0;
  TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;

  TIM_TimeBaseInit(TIM4, &TIM_TimeBaseStructure);

  TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
  TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
  TIM_OCInitStructure.TIM_Pulse = 1;

  TIM_OC1Init(TIM4, &TIM_OCInitStructure);

  /* Slave Mode selection: TIM4 */
  TIM_SelectSlaveMode(TIM4, TIM_SlaveMode_Gated);
  TIM_SelectInputTrigger(TIM4, TIM_TS_ITR0);

  /* TIM1 Peripheral Configuration ----------------------------------------*/
  /* Time Base configuration */
  TIM_TimeBaseStructure.TIM_Prescaler = 0;
  TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
  TIM_TimeBaseStructure.TIM_Period = 255;
  TIM_TimeBaseStructure.TIM_ClockDivision = 0;
  TIM_TimeBaseStructure.TIM_RepetitionCounter = 4;

  TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure);

  /* Channel 1 Configuration in PWM mode */
  TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM2;
  TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
  TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable;
  TIM_OCInitStructure.TIM_Pulse = 127;
  TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low;
  TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_Low;
  TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set;
  TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCIdleState_Reset;

  TIM_OC1Init(TIM1, &TIM_OCInitStructure);

  /* Automatic Output enable, Break, dead time and lock configuration*/
  TIM_BDTRInitStructure.TIM_OSSRState = TIM_OSSRState_Enable;
  TIM_BDTRInitStructure.TIM_OSSIState = TIM_OSSIState_Enable;
  TIM_BDTRInitStructure.TIM_LOCKLevel = TIM_LOCKLevel_1;
  TIM_BDTRInitStructure.TIM_DeadTime = 5;
  TIM_BDTRInitStructure.TIM_Break = TIM_Break_Disable;
  TIM_BDTRInitStructure.TIM_BreakPolarity = TIM_BreakPolarity_High;
  TIM_BDTRInitStructure.TIM_AutomaticOutput = TIM_AutomaticOutput_Disable;

  TIM_BDTRConfig(TIM1, &TIM_BDTRInitStructure);

  /* Master Mode selection */
  TIM_SelectOutputTrigger(TIM1, TIM_TRGOSource_Update);

  /* Select the Master Slave Mode */
  TIM_SelectMasterSlaveMode(TIM1, TIM_MasterSlaveMode_Enable);

  /* TIM1 counter enable */
  TIM_Cmd(TIM1, ENABLE);

  /* TIM enable counter */
  TIM_Cmd(TIM3, ENABLE);
  TIM_Cmd(TIM4, ENABLE);

  /* Main Output Enable */
  TIM_CtrlPWMOutputs(TIM1, ENABLE);

  while (1)
  {}
}

/**
  * @brief  Configures TIM1, TIM3 and TIM4 Pins.
  * @param  None
  * @retval None
  */
void TIM_Config(void)
{
  GPIO_InitTypeDef GPIO_InitStructure;

  /* GPIOA, GPIOB and GPIOC clocks enable */
  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC, ENABLE);

  /* TIM1 clock enable */
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE);

  /* TIM3 and TIM4 clock enable */
  RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3 | RCC_APB1Periph_TIM4, ENABLE);

  /* GPIOA Configuration: TIM1 Channel1 as alternate function push-pull */
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  GPIO_Init(GPIOA, &GPIO_InitStructure);

  /* GPIOC Configuration: TIM3 Channel1 as alternate function push-pull */
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
  GPIO_Init(GPIOC, &GPIO_InitStructure);

  /* GPIOB Configuration: TIM4 Channel1 as alternate function push-pull */
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
  GPIO_Init(GPIOB, &GPIO_InitStructure);

  /* Connect TIM pins to AF1 */
  GPIO_PinAFConfig(GPIOA, GPIO_PinSource8, GPIO_AF_TIM1);

  /* Connect TIM pins to AF2 */
  GPIO_PinAFConfig(GPIOC, GPIO_PinSource6, GPIO_AF_TIM3);
  GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_TIM4);
}

#ifdef  USE_FULL_ASSERT

/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t* file, uint32_t line)
{
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  while (1)
  {}
}

#endif

/**
  * @}
  */

/**
  * @}
  */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package practice.ConditionalFlowControls;

/**
 *
 * @author mars
 */
public class Animal {
    private String move;

}


text:
$( document ).ready( function(){

//alert(document.URL);
	/* SHARES : BEGIN */

	var DialogW = 520;
	var DialogH = 350
	var winTop = (screen.height / 2) - (DialogW / 2);
    var winLeft = (screen.width / 2) - (DialogH / 2);

    var sectionImage = false;
    var sectionVideo;
    var sectionImageTip = false;
  	var tipCat;
    var screenCat;
	var tip_title;
	var tip_num;
	var tip_copy;

	//if( whichTut =="moment"){tutorialTotalSlides = 4}
	//else{tutorialTotalSlides = 7};
	//

	//alert(tutCountTotal);

    $(".categories .ro,.categories .label").css({opacity:0});

    	/*FACEBOOK*/
    $("#social-share .facebook").click(function(e) {
	    e.preventDefault();

	    window.open('https://www.facebook.com/sharer/sharer.php?u=http://bringit.usa.canon.com','null','width='+DialogW+',height='+DialogH+',toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left='+winLeft+',top='+winTop);
	    return false;
	});

		/*TWITTER*/

	$("#social-share .twitter").click(function(e) {
	    e.preventDefault();

	    window.open("https://twitter.com/intent/tweet?text=Bring your Canon. Bring your lenses. Bring your talent. Bring everything you've got. %23bringit", "tweet", "height="+DialogH+",width="+DialogW+",resizable=1,left="+winLeft+",top="+winTop);
	     return false;
	});

		/*GOOGLE*/
	$("#social-share .google").click(function(e) {
	    e.preventDefault();

	    window.open("https://plus.google.com/share?url=http://bringit.usa.canon.com?",'google+', 'menubar=no,toolbar=no,resizable=yes,,left='+winLeft+',top='+winTop+',scrollbars=no,height='+DialogH+',width='+DialogW);
	     return false;
	});

		/*MAIL*/

		$('#social-share .mail').click(function(e){
		sendMail();
		});

		function sendMail() {

		var mailBody = "Bring your Canon. Bring your lenses. Bring your talent.";
		mailBody += " Bring everything you've got. Then share your photographs and Full HD video with #bringit and show the world.%0d%0a%0d%0a";
		mailBody += "Your creativity can be featured at http://bringit.usa.canon.com.";
		mailBody += "";
		mailBody += "";

	    	var link = "mailto:"
	             + "?subject=" + escape("Grab your Canon and #bringit.")
	             //+ "&body=" + escape("This is the body.")
	             + "&body=" + mailBody;

	    window.location.href = link;
	}

	/* SHARES : END */

	$("#scroll-arrow").on('click',function(event){
		$("body , html").animate({ scrollTop: 0},1000);

		}).on('mouseenter',function(){
			$( this ).attr('src','img/scroll_arrow_RO.png');
		}).on('mouseleave',function(){
			$( this ).attr('src','img/scroll_arrow.png')
		})

	$(window).scroll(function() {

			scrollLoc = $(window).scrollTop();

			if(scrollLoc > 85 && scrollLoc < 90 || scrollLoc > 100){$( "#scroll-nav" ).stop().animate({top:0});}
			if(scrollLoc < 84){$( "#scroll-nav" ).stop().animate({top:-46});}

			if ( scrollLoc > 90 && $("#scroll-arrow").css('opacity') == 0)
				{
					$('.site-header').addClass('scroll');
					$("#scroll-arrow").animate({opacity:1});

				}

			else if ( scrollLoc < 90 && $("#scroll-arrow").css('opacity') == 1)
				{
					$('.site-header').removeClass('scroll');
					$("#scroll-arrow").animate({opacity:0});

				}

	});

	/* CLICK OUTSIDE OF PLAYER TO CLOSE */
	$("#video-cover").on('click',function(){
		closeOverlay();
	});

	/* CLICK BUTTON TO CLOSE PLAYER */
	$("#video-holder .closeBtn").on('click',function(){
		closeOverlay();
	});

	var tutorialTotalSlides;
		if(window.location.href.indexOf("In-The-Moment") > -1) {tutorialTotalSlides = 4;}
		else{tutorialTotalSlides = 7;}

	/* HIGHLIGHT SECTION LINK ON NAV */

	if(window.location.href.indexOf("With-Your-Family") > -1) {
       $("#site-nav-top .family").css({color:"#e21a22"});
    }
    else if(window.location.href.indexOf("When-You-Travel") > -1) {
    	$("#site-nav-top .travel").css({color:"#e21a22"});
    }
    else if(window.location.href.indexOf("In-The-Moment") > -1) {
    	$("#site-nav-top .moment").css({color:"#e21a22"});

    }

	/* */

});

	/*	VARS : BEGIN */

		var whichTrailer = "";
		var whichTutorial = "";
		var scrollLoc = $(window).scrollTop();
		var windowH = $(window).height();
		var windowW = $(window).width();
		var vidHeight = 532;
		var videoPlaying;

		var documentH = $( document ).height();

		var social_follow_Btns;
		var social_share_Btns;

		var whichIcon;
		var whichImage;
		var sectionVideoCatCount = 1;
		var sectionVideoCat ="";

		var tutorialTotalSlides;
		if(window.location.href.indexOf("With-Your-Family") > -1) {
	       tutorialTotalSlides = 7;
	    }
	    else if(window.location.href.indexOf("When-You-Travel") > -1) {
	    	tutorialTotalSlides = 9;
	    }
	    else if(window.location.href.indexOf("In-The-Moment") > -1) {
	    	tutorialTotalSlides = 4;

	    }

//alert(tutorialTotalSlides);

	/*  VARS : END */

	$( "#scroll-nav #bg" ).css({opacity:.1});
	$("#site-nav-top").clone().appendTo( "#scroll-nav #nav #left-nav" );
	$(".site-nav").clone().appendTo( "#scroll-nav #nav #right-nav" );

	/* SOCIAL NAV : BEGIN */

	/* HOME ICON : BEGIN */

	$(".h_icon").on('mouseenter',function(){
		$( this ).find('img').attr('src',"img/i_home_o.png");
	}).on('mouseleave',function(){
		$( this ).find('img').attr('src',"img/i_home.png");
	}).on('mousedown',function(){
		$( this ).find('img').attr('src',"img/i_home_p.png");
	})

	/* HOME ICON : END */

	$("#social-share, #scroll-nav #social-share").on('mouseenter',function(){

		social_share_Btns = $( this ).find( "div" );
		$( this ).stop().animate({width:160});
		social_share_Btns.stop().animate({right:0});

		$( "#social-share a, #scroll-nav #social-share a" ).css({color:"#696969",left:2});

		$( "#social-follow, #scroll-nav #social-follow" ).stop().animate({width:85});
		$( "#social-follow div, #scroll-nav #social-follow div"  ).stop().animate({right:-74});

	}).on('mouseleave',function(){

		$( this ).stop().animate({width:73});
		social_share_Btns.stop().animate({right:-104});

		$( "#social-share a, #scroll-nav #social-share a" ).css({color:"#000",left:0});

		$( "#social-follow, #scroll-nav #social-follow" ).stop().animate({width:150});
		$( "#social-follow div, #scroll-nav #social-follow div"  ).stop().animate({right:12});

	});

		/* ICON ROLLOVERS */

	$(".site-nav a").on('mouseenter',function(event){

		whichIcon = $( this ).attr('class');
		whichImage = $( this ).find( "img" );

		whichImage.attr('src','img/i-'+whichIcon+'_o.png');
	}).on('mouseleave',function(event){
		whichImage.attr('src','img/i-'+whichIcon+'.png');
	});

	/* SOCIAL NAV : ENDS */

	/*
    new AnimOnScroll( document.getElementById( 'grid' ), {
		minDuration : 0.4,
		maxDuration : 0.7,
		viewportFactor : 0.2
	} );
*/

	function closeOverlay()
		{
			function overlayReset()
				{
					$("#video-holder #video-player").tubeplayer("destroy");
					//$( "#video-holder").css({ width:"50%",height:"auto"});
					imageOverlay = "off";
					$("#video-holder #video-player img").remove();
					sectionImage = false;
					sectionVideo = false;
					sectionImageTip = false;
					$("#video-holder h2").html("#bringit");
					$(".tip").css({visibility:"hidden"});
					sectionVideoCat ="";
					sectionVideoCatCount = 1;
					$( "#video-cover" ).css({width:"0%",height:"0%",visibility:"hidden"});
					$( "#video-holder").css({"position":"absolute",visibility:"hidden",left:(windowW-$( "#video-holder" ).width())/2,top:(windowH-$( "#video-holder" ).height())/2})
				}
			$( "#video-cover" ).animate({opacity:0});
			$( "#video-holder" ).animate({opacity:0},overlayReset);
		}

	function videoHeaderLoad(whichVid){

		///$("#video-player img").remove();

		$("#video-holder #video-player").tubeplayer({
			width:"100%", // the width of the player
			height: "100%", // the height of the player
			allowFullScreen: "true", // true by default, allow user to go full screen
			initialVideo: whichVid, // the video that is loaded into the player
			preferredQuality: "default",// preferred quality: default, small, medium, large, hd720
			iframed: true, // iframed can be: true, false; if true, but not supported, degrades to flash
			showinfo: false, // if you want the player to include details about the video
			modestbranding: false, // specify to include/exclude the YouTube watermark
			autoPlay: true, // whether the player should autoplay the video, 0 or 1
			autoHide: true,
			onPlayerEnded: function(){

							if(sectionVideoCat == "family")
								{

									if(sectionVideoCatCount == 1){
										sectionVideoCatCount++;
										$("#video-holder #video-player").tubeplayer("play", "5hM3wx_Iw50");
									}
									else if(sectionVideoCatCount == 2){
										sectionVideoCatCount++;
										$("#video-holder #video-player").tubeplayer("play", "ypXLT6ckJZY");
									}
									else if(sectionVideoCatCount == 3){closeOverlay();}

								}
							else if( sectionVideoCat == "travel")
								{
									if(sectionVideoCatCount == 1){sectionVideoCatCount++;$("#video-holder #video-player").tubeplayer("play", "drsFiUNLk9s");}
									else if(sectionVideoCatCount == 2){sectionVideoCatCount++;$("#video-holder #video-player").tubeplayer("play", "atmo_ot1Dzo");}
									else if(sectionVideoCatCount == 3){closeOverlay();}
								}

								else if (sectionVideoCat == ""){
									closeOverlay();
								}

				}

		});
	}

		var imageOverlay;

		function tipOverlay(itemSrc)
			{

				documentH = $( document ).height();
				$( "#video-cover" ).css({width:"100%",height:documentH,visibility:"visible"});

				var tips = $('');

				$(".tip").css({visibility:"visible"});
				//alert(tip_num+" "+tip_copy+" "+tip_title);
				//alert(screenCat+" "+tipCat);

				tips.load(function(){
					  // console.log('ad load complete '+ itemSrc);
					 	 windowH = $(window).height();
						windowW = $(window).width();
						var mageW = $("#video-player img").width();
						var mageH = $("#video-player img").height();
						var mageHolder = $( "#video-holder").height();
						var mageHolderW = $( "#video-holder").width();
						$( "#video-holder" ).animate({opacity:1});

						if( tipCat == "family")
							{
								if( itemSrc == 5)
										{
											$("#video-holder h2").html(" TELLING A STORY");
											$("#video-holder .tip-number").html("tip 1: ");
											$("#video-holder .tip-copy").html("When shooting video, you want to try to have medium, close and wide shots that show variety and change. You want to have shots that introduce something, have a build up or climax, and some sort of an ending.");
										}
								else if( itemSrc == 6)
										{
											$("#video-holder h2").html(" CAPTURING B-ROLL");
											$("#video-holder .tip-number").html("tip 2: ");
											$("#video-holder .tip-copy").html("B-roll is very important. We like to take our time going through the footage afterwards to pick and choose the right moments to tell a story.");
										}
								else if( itemSrc == 7)
										{
											$("#video-holder h2").html(" A CINEMATIC LOOK");
											$("#video-holder .tip-number").html("tip 3: ");
											$("#video-holder .tip-copy").html("Shooting at 24 frames is a must if you want to achieve a cinematic film look. ");
										}
							}
						else if( tipCat == "travel")
							{
								if( itemSrc == 5)
										{
											$("#video-holder h2").html(" TRIPOD TRICKS");
											$("#video-holder .tip-number").html("tip 1: ");
											$("#video-holder .tip-copy").html("A neat little trick people might like is that if you actually flip the tripod and camera upside-down, the legs will fan out in a way that kind of acts as a stabilization so you can actually get really low to the ground.");
										}
								else if( itemSrc == 6)
										{
											$("#video-holder h2").html(" STABILIZATION TECHNIQUES");
											$("#video-holder .tip-number").html("tip 2: ");
											$("#video-holder .tip-copy").html("In the cases where you don't have a tripod, you can literally lean your body up against a stump or a tree — anything that's stable — and get the same stabilization technique without a tripod.");
										}
								else if( itemSrc == 7)
										{
											$("#video-holder h2").html(" WIDE SHOT LENSES");
											$("#video-holder .tip-number").html("tip 3: ");
											$("#video-holder .tip-copy").html("For the big, wide shots you want the EF 14mm f/2.8 II USM lens to make the world look as big as it is.");
										}
								else if( itemSrc == 8)
										{
											$("#video-holder h2").html(" LOW LIGHT LENSES");
											$("#video-holder .tip-number").html("tip 4: ");
											$("#video-holder .tip-copy").html("The EF 24mm f/1.4L II USM lens is wide enough for low-light situations. So, for instance, you can be around a campfire and have the ability to pick off shots super quick!");
										}
								else if( itemSrc == 9)
										{
											$("#video-holder h2").html(" BEAUTY LENSES");
											$("#video-holder .tip-number").html("tip 5: ");
											$("#video-holder .tip-copy").html("I like to think of the EF 50mm f/1.2L USM lens as a beauty lens. It has a really nice, super shallow depth-of field to capture amazing moments. ");
										}
							}

						if(mageW > mageH)
							{

								if(windowH > 640 && windowH < 768)
									{
										$( "#video-holder").css({ height:"70%"});

									}
								else if(windowH < 640)
									{
										$( "#video-holder").css({ height:"80%"});

									}
								else if(windowH > 768)
									{
										if(windowW < 1024)
										{
											$( "#video-holder").css({ height:"45%"});

										}

										if(windowW > 1024 && windowW < 1200)
										{
											$( "#video-holder").css({ height:"50%"});

										}
										if(windowW > 1200)
										{
											$( "#video-holder").css({ height:"60%"});

										}

									}

										$( "#video-player").css({height:"89%"});
										$( "#video-player img").css({height:"100%",width:"auto"});
										$( "#video-player").css({width:$( "#video-player img").width()});
										$( "#video-holder").css({ width:$( "#video-player img").width()+60});
										$( "#video-player").css({height:$( "#video-player img").height()});
										$( "#video-holder").css({ height:$( "#video-player img").height()+140});

										var tipCenter = (($("#video-holder").width() - $("#video-holder .tip").width())/2)+30;
										//alert(tipCenter)
										$("#video-holder .tip").css({left:tipCenter});
										$( "#video-holder").css({"position":"fixed",visibility:"visible",left:(windowW-$( "#video-holder" ).width())/2,top:(windowH-$( "#video-holder" ).height())/2})

							}

					});
					$( "#video-cover" ).animate({opacity:.5},function(){});
					$("#video-player").append(tips);

			}

		function videoOverlay(imageVid,itemSrc)
		{

			documentH = $( document ).height();

			$( "#video-cover" ).css({width:"100%",height:documentH,visibility:"visible"});

			if(imageVid == "image")
				{
					imageOverlay = "on";

					if (sectionImage == true)
						{
							var img = $('');

						}

					else{
						var img = $('');
					}

					img.load(function(){
					  // console.log('ad load complete '+ itemSrc);
					 	 windowH = $(window).height();
						windowW = $(window).width();
						var mageW = $("#video-player img").width();
						var mageH = $("#video-player img").height();
						var mageHolder = $( "#video-holder").height();
						var mageHolderW = $( "#video-holder").width();
						$( "#video-holder" ).animate({opacity:1});

						if(mageW > mageH)
							{

								if(windowH > 640 && windowH < 768)
									{
										$( "#video-holder").css({ height:"70%"});

									}
								else if(windowH < 640)
									{
										$( "#video-holder").css({ height:"80%"});

									}
								else if(windowH > 768)
									{
										if(windowW < 1024)
										{
											$( "#video-holder").css({ height:"45%"});

										}

										if(windowW > 1024 && windowW < 1200)
										{
											$( "#video-holder").css({ height:"50%"});

										}
										if(windowW > 1200)
										{
											$( "#video-holder").css({ height:"60%"});

										}

									}

										$( "#video-player").css({height:"89%"});
										$( "#video-player img").css({height:"100%",width:"auto"});
										$( "#video-player").css({width:$( "#video-player img").width()});
										$( "#video-holder").css({ width:$( "#video-player img").width()+60});
										$( "#video-player").css({height:$( "#video-player img").height()});
										$( "#video-holder").css({ height:$( "#video-player img").height()+80});
										$( "#video-holder").css({"position":"fixed",visibility:"visible",left:(windowW-$( "#video-holder" ).width())/2,top:(windowH-$( "#video-holder" ).height())/2})

							}
						else if(mageW == mageH)
							{

								if(windowH > 640 && windowH < 768)
									{
										$( "#video-holder").css({ height:"80%"});

									}
								else if(windowH < 640)
									{
										$( "#video-holder").css({ height:"80%"});

									}
								else if(windowH > 768)
									{
										if(windowW < 1024)
										{
											$( "#video-holder").css({ height:"65%"});

										}

										if(windowW > 1024 && windowW < 1200)
										{
											$( "#video-holder").css({ height:"50%"});

										}
										if(windowW > 1200)
										{
											$( "#video-holder").css({ height:"60%"});

										}

									}

								//$( "#video-holder").css({ height:"55%"});
								$( "#video-player").css({height:"89%"});
								$( "#video-player img").css({height:"100%",width:"auto"});
								$( "#video-player").css({width:$( "#video-player img").width()});
								$( "#video-holder").css({ width:$( "#video-player img").width()+60});
								$( "#video-player").css({height:$( "#video-player img").height()});
								$( "#video-holder").css({ height:$( "#video-player img").height()+80});

								$( "#video-holder").css({"position":"fixed",visibility:"visible",left:(windowW-$( "#video-holder" ).width())/2,top:(windowH-$( "#video-holder" ).height())/2})
								//$( "#video-cover" ).animate({opacity:.5});

							}
						else if( mageH > mageW)
							{

								$( "#video-holder").css({ height:"75%"});
								$( "#video-player").css({height:"89%"});
								$( "#video-player img").css({height:"100%",width:"auto"});
								$( "#video-player").css({width:$( "#video-player img").width()});
								$( "#video-holder").css({ width:$( "#video-player img").width()+60});
								$( "#video-player").css({height:$( "#video-player img").height()});
								$( "#video-holder").css({ height:$( "#video-player img").height()+80});

								//
								$( "#video-holder").css({"position":"fixed",visibility:"visible",left:(windowW-$( "#video-holder" ).width())/2,top:(windowH-$( "#video-holder" ).height())/2})
								//$( "#video-cover" ).animate({opacity:.5});

							}

					});
					$( "#video-cover" ).animate({opacity:.5},function(){

					});

				$("#video-player").append(img);
				}
			else if(imageVid == "video")
				{

					$( "#video-holder").css({ width:930,height:597});
					$( "#video-holder").css({"position":"fixed",visibility:"visible",left:(windowW-$( "#video-holder" ).width())/2,top:(windowH-$( "#video-holder" ).height())/2})
					$( "#video-player").css({width:880,height:518});

					$( "#video-cover" ).animate({opacity:.5});

					$( "#video-player img").remove();
					$("#video-holder").animate({opacity:1},videoHeaderLoad(itemSrc));

				}

		}

	/* CLICK HEADER TO PLAY VIDEO */
	$("#header-video").on('click',function(){
		videoOverlay("video","S6vFwq6Zuhw");
	});

	/* CLICK VIDEO ONE */
	$("#video1").on('click',function(){
		videoOverlay("video","owlmI8syfnE");
	});

	$("#video3").on('click',function(){
		videoOverlay("video","-l203wNDqsQ");
	});

	$("#video4").on('click',function(){
		videoOverlay("video","m8STkEDNIWs");
	});

	/* GRID ROLLOVERS : BEGIN*/
	var gridPic;
	var gridProd;
	var gridProdCta;

		$("#grid li").on('mouseenter',function(){

			gridPic = $( this ).find( "img" );
			gridProd = $( this ).find( "a" ).attr('class');
			gridProdCta = $( this ).find(".cta");

			if( gridProd == "prod"){

				gridProdCta.attr('src','img/learnMore_RO.png');

			}else{
				gridPic.css({ "opacity":.3});
			}

		}).on('mouseleave',function(){

			if( gridProd == "prod")
				{
					gridProdCta.attr('src','img/learnMore.png');
				}
			else{
					gridPic.css({ "opacity":1});
				}

		}).on('click',function(){

			if( gridProd == "prod"){

			}else{
				if(gridProd == "vid")
					{}
				else{
				var mageSrc = $( this ).attr('data');
				//alert(mageSrc);
				sectionImage = false;
				videoOverlay("image",mageSrc);
					}

			}
		})

		$("#grid-mid li").on('mouseenter',function(){

			gridPic = $( this ).find( "img" );
			gridProd = $( this ).find( "a" ).attr('class');
			gridProdCta = $( this ).find(".cta");

			if( gridProd == "prod"){

				gridProdCta.attr('src','img/learnMore_RO.png');

			}else{
				gridPic.css({ "opacity":.3});
			}

		}).on('mouseleave',function(){

			if( gridProd == "prod")
				{
					gridProdCta.attr('src','img/learnMore.png');
				}
			else{
					gridPic.css({ "opacity":1});
				}

		}).on('click',function(){

			if( gridProd == "prod"){

			}else{
				if(gridProd == "vid")
					{}
				else{
				var mageSrc = $( this ).attr('data');
				//alert(mageSrc);
				sectionImage = false;
				videoOverlay("image",mageSrc);
					}

			}
		})
	/* GRID ROLLOVERS : END */

	/* CATEGORIES ROLLOVERS : BEGIN */

		$("#cat-1").on('mouseenter',function(){

			$( this ).find( ".label" ).stop().animate({opacity:1},100);
			$( this ).find( ".btn" ).stop().animate({opacity:0},100);
			$( this ).find( ".ro" ).stop().animate({opacity:.5},100);
		}).on('mouseleave',function(){

			$( this ).find( ".label" ).stop().animate({opacity:0},100);
			$( this ).find( ".btn" ).stop().animate({opacity:1},100);
			$( this ).find( ".ro" ).stop().animate({opacity:0},100);
		});

		$("#cat-2").on('mouseenter',function(){

			$( this ).find( ".label" ).stop().animate({opacity:1},100);
			$( this ).find( ".btn" ).stop().animate({opacity:0},100);
			$( this ).find( ".ro" ).stop().animate({opacity:.5},100);
		}).on('mouseleave',function(){

			$( this ).find( ".label" ).stop().animate({opacity:0},100);
			$( this ).find( ".btn" ).stop().animate({opacity:1},100);
			$( this ).find( ".ro" ).stop().animate({opacity:0},100);
		});
		$("#cat-3").on('mouseenter',function(){

			$( this ).find( ".label" ).stop().animate({opacity:1},100);
			$( this ).find( ".btn" ).stop().animate({opacity:0},100);
			$( this ).find( ".ro" ).stop().animate({opacity:.5},100);
		}).on('mouseleave',function(){

			$( this ).find( ".label" ).stop().animate({opacity:0},100);
			$( this ).find( ".btn" ).stop().animate({opacity:1},100);
			$( this ).find( ".ro" ).stop().animate({opacity:0},100);
		});

		/*

		*/
		/* links */
		//

	/* CATEGORIES ROLLOVERS : END */

	$('#cat-1').on('click',function(){
			$(location).attr('href', '/With-Your-Family');

		});
		$("#cat-2").on('click',function(){
			$(location).attr('href', '/When-You-Travel');

		});
		$("#cat-3").on('click',function(){
			$(location).attr('href', '/In-The-Moment');

		});

$(window).resize(function(){
	windowH = $(window).height();
	windowW = $(window).width();
	$( "#video-holder").css({left:(windowW-$( "#video-holder" ).width())/2,top:(windowH-$( "#video-holder" ).height())/2});

	if(imageOverlay == "on")
		{
			$( "#video-player").css({height:$( "#video-player img").height()});
			$( "#video-holder").css({ height:$( "#video-player img").height()+80});
		}

});

/*--------------------------------------------------------------------------------------------*/


text:
package org.jbpm.process.workitem.bpmn2;

import java.io.File;
import java.math.BigDecimal;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;

import org.apache.commons.io.IOUtils;
import org.drools.compiler.compiler.ProcessBuilderFactory;
import org.drools.compiler.kie.builder.impl.InternalKieModule;
import org.drools.core.impl.EnvironmentFactory;
import org.drools.core.impl.KnowledgeBaseFactory;
import org.drools.core.runtime.process.ProcessRuntimeFactory;
import org.jbpm.process.builder.ProcessBuilderFactoryServiceImpl;
import org.jbpm.process.instance.ProcessRuntimeFactoryServiceImpl;
import org.junit.Before;
import org.junit.Test;
import org.kie.api.KieBase;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
import org.kie.api.builder.Message;
import org.kie.api.builder.ReleaseId;
import org.kie.api.builder.Results;
import org.kie.api.io.Resource;
import org.kie.api.io.ResourceType;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.KieSessionConfiguration;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie.api.runtime.process.WorkflowProcessInstance;
import org.kie.internal.builder.InternalKieBuilder;
import org.kie.internal.builder.KnowledgeBuilder;
import org.kie.internal.builder.KnowledgeBuilderFactory;
import org.kie.internal.io.ResourceFactory;
import org.kie.scanner.KieMavenRepository;

import static org.junit.Assert.*;

public class BusinessRuleTaskTest {

    private static final String GROUP_ID = "org.jbpm";
    private static final String ARTIFACT_ID = "test-kjar";
    private static final String VERSION = "1.0-SNAPSHOT";

    private KieServices ks = KieServices.Factory.get();

    @Before
    public void setup() throws Exception {

        createAndDeployJar(ks,
                           ks.newReleaseId(GROUP_ID,
                                           ARTIFACT_ID,
                                           VERSION),
                           ks.getResources().newClassPathResource("businessRule.drl"),
                           ks.getResources().newClassPathResource("0020-vacation-days.dmn"));
    }

    @Test
    public void testBusinessRuleTaskProcess() throws Exception {
        KieBase kbase = readKnowledgeBase();
        KieSession ksession = createSession(kbase);

        BusinessRuleTaskHandler handler = new BusinessRuleTaskHandler(GROUP_ID,
                                                                      ARTIFACT_ID,
                                                                      VERSION);
        ksession.getWorkItemManager().registerWorkItemHandler("BusinessRuleTask",
                                                              handler);
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("person",
                   new org.jbpm.process.workitem.bpmn2.objects.Person("john"));

        WorkflowProcessInstance processInstance = (WorkflowProcessInstance) ksession.startProcess("evaluation.ruletask",
                                                                                params);
        org.jbpm.process.workitem.bpmn2.objects.Person variable = (org.jbpm.process.workitem.bpmn2.objects.Person) processInstance.getVariable("person");
        assertEquals("john",
                     variable.getName());
        assertEquals(35,
                     variable.getAge().intValue());
        assertEquals(ProcessInstance.STATE_COMPLETED,
                     processInstance.getState());
    }

    @Test
    public void testDecisionTaskProcess() throws Exception {
        KieBase kbase = readKnowledgeBase();
        KieSession ksession = createSession(kbase);

        BusinessRuleTaskHandler handler = new BusinessRuleTaskHandler(GROUP_ID,
                                                                      ARTIFACT_ID,
                                                                      VERSION);
        ksession.getWorkItemManager().registerWorkItemHandler("DecisionTask",
                                                              handler);
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("age",
                   16);
        params.put("yearsOfService",
                   1);

        WorkflowProcessInstance processInstance = (WorkflowProcessInstance) ksession.startProcess("BPMN2-BusinessRuleTask",
                                                                                params);
        BigDecimal variable = (BigDecimal) processInstance.getVariable("vacationDays");

        assertEquals(27,
                     variable.intValue());
        assertEquals(ProcessInstance.STATE_COMPLETED,
                     processInstance.getState());
    }

    private static KieBase readKnowledgeBase() throws Exception {
        ProcessBuilderFactory.setProcessBuilderFactoryService(new ProcessBuilderFactoryServiceImpl());
        ProcessRuntimeFactory.setProcessRuntimeFactoryService(new ProcessRuntimeFactoryServiceImpl());
        KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        kbuilder.add(ResourceFactory.newClassPathResource("businessRuleTaskProcess.bpmn2"),
                     ResourceType.BPMN2);
        kbuilder.add(ResourceFactory.newClassPathResource("businessRuleTaskDMN.bpmn2"),
                     ResourceType.BPMN2);
        return kbuilder.newKieBase();
    }

    private static KieSession createSession(KieBase kbase) {
        Properties properties = new Properties();
        properties.put("drools.processInstanceManagerFactory",
                       "org.jbpm.process.instance.impl.DefaultProcessInstanceManagerFactory");
        properties.put("drools.processSignalManagerFactory",
                       "org.jbpm.process.instance.event.DefaultSignalManagerFactory");
        KieSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
        return kbase.newKieSession(config,
                                   EnvironmentFactory.newEnvironment());
    }

    private byte[] createAndDeployJar(KieServices ks,
                                      ReleaseId releaseId,
                                      Resource... resources) throws Exception {
        KieFileSystem kfs = ks.newKieFileSystem().generateAndWritePomXML(releaseId);
        for (int i = 0; i < resources.length; i++) {
            if (resources[i] != null) {
                kfs.write(resources[i]);
            }
        }
        KieBuilder kieBuilder = ks.newKieBuilder(kfs);
        ((InternalKieBuilder) kieBuilder).buildAll(o -> true);
        Results results = kieBuilder.getResults();
        if (results.hasMessages(Message.Level.ERROR)) {
            throw new IllegalStateException(results.getMessages(Message.Level.ERROR).toString());
        }
        InternalKieModule kieModule = (InternalKieModule) ks.getRepository().getKieModule(releaseId);
        byte[] pomXmlContent = IOUtils.toByteArray(kieModule.getPomAsStream());
        File pom = new File("target",
                            UUID.randomUUID().toString());
        Files.write(pom.toPath(),
                    pomXmlContent);
        KieMavenRepository.getKieMavenRepository().installArtifact(releaseId,
                                                                   kieModule,
                                                                   pom);

        byte[] jar = kieModule.getBytes();
        return jar;
    }
}


text:
package com.novoda.downloadmanager.lib;

import java.lang.reflect.Field;

final class Reflector {

    private static final String CLASS_NAME = "com.novoda.downloadmanager.Authority";
    private static final String CONSTANT_FULL_NAME = CLASS_NAME + ".AUTHORITY";

    private static String cachedAuthority;

    private Reflector() {
        // static helper class
    }

    static String reflectAuthority() {
        if (cachedAuthority == null) {
            try {
                Class<?> authorityClass = Class.forName(CLASS_NAME);
                Field authorityField = authorityClass.getDeclaredField("AUTHORITY");
                Object o = authorityField.get(authorityClass);
                cachedAuthority = (String) o;
            } catch (ClassNotFoundException e) {
                throwNoAuthorityClass();
            } catch (NoSuchFieldException e) {
                throwNoAuthorityField();
            } catch (IllegalAccessException e) {
                throwHiddenFieldName();
            } catch (ClassCastException e) {
                throwNotAString();
            }
        }
        return cachedAuthority;
    }

    private static void throwNotAString() {
        throw new IllegalArgumentException(CONSTANT_FULL_NAME + " is not a string");
    }

    private static void throwHiddenFieldName() {
        throw new IllegalStateException(CONSTANT_FULL_NAME + " is not a visible field");
    }

    private static void throwNoAuthorityField() {
        throw new NullPointerException(CONSTANT_FULL_NAME + " was not defined");
    }

    private static void throwNoAuthorityClass() {
        throw new NullPointerException(CLASS_NAME + " is not defined. See the documentation.");
    }
}


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.policy;

import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;

/**
 * Allows converting Java policies, contained as key/value pairs in {@link android.os.Bundle}s to
 * native {@code PolicyBundle}s.
 *
 * This class is to be used to send key/value pairs to its native equivalent, that can then be used
 * to retrieve the native {@code PolicyBundle}.
 *
 * It should be created by calling {@link #create(long)} from the native code, and sending it back
 * to Java.
 */
@JNINamespace("policy::android")
public class PolicyConverter {
    private long mNativePolicyConverter;

    private PolicyConverter(long nativePolicyConverter) {
        mNativePolicyConverter = nativePolicyConverter;
    }

    /** Convert and send the key/value pair for a policy to the native {@code PolicyConverter}. */
    public void setPolicy(String key, Object value) {
        assert mNativePolicyConverter != 0;

        if (value instanceof Boolean) {
            nativeSetPolicyBoolean(mNativePolicyConverter, key, (Boolean) value);
            return;
        }
        if (value instanceof String) {
            nativeSetPolicyString(mNativePolicyConverter, key, (String) value);
            return;
        }
        if (value instanceof Integer) {
            nativeSetPolicyInteger(mNativePolicyConverter, key, (Integer) value);
            return;
        }
        if (value instanceof String[]) {
            nativeSetPolicyStringArray(mNativePolicyConverter, key, (String[]) value);
            return;
        }
        assert false : "Invalid setting " + value + " for key " + key;
    }

    @CalledByNative
    private static PolicyConverter create(long nativePolicyConverter) {
        return new PolicyConverter(nativePolicyConverter);
    }

    @CalledByNative
    private void onNativeDestroyed() {
        mNativePolicyConverter = 0;
    }

    private native void nativeSetPolicyBoolean(
            long nativePolicyConverter, String policyKey, boolean value);
    private native void nativeSetPolicyInteger(
            long nativePolicyConverter, String policyKey, int value);
    private native void nativeSetPolicyString(
            long nativePolicyConverter, String policyKey, String value);
    private native void nativeSetPolicyStringArray(
            long nativePolicyConverter, String policyKey, String[] value);
}


text:
sync
echo 3 | sudo tee /proc/sys/vm/drop_caches >/dev/null


text:
use crate::{
    application::interface::NetworkInterface,
    constants::NETWORK_CHANNEL_SIZE,
    counters,
    error::NetworkError,
    logging::NetworkSchema,
    peer_manager::{ConnectionRequestSender, PeerManagerRequestSender},
    protocols::{
        health_checker::interface::{HealthCheckData, HealthCheckNetworkInterface},
        network::{
            AppConfig, ApplicationNetworkSender, Event, NetworkEvents, NetworkSender,
            NewNetworkSender,
        },
        rpc::error::RpcError,
    },
    ProtocolId,
};
use async_trait::async_trait;
use bytes::Bytes;
use channel::{diem_channel, message_queues::QueueStyle};
use diem_config::network_id::{NetworkContext, PeerNetworkId};
use diem_logger::prelude::*;
use diem_time_service::{TimeService, TimeServiceTrait};
use diem_types::PeerId;
use futures::{
    channel::oneshot,
    stream::{FuturesUnordered, StreamExt},
};
use rand::{rngs::SmallRng, Rng, SeedableRng};
use serde::{Deserialize, Serialize};
use short_hex_str::AsShortHexStr;
use std::{collections::hash_map::Entry, time::Duration};

pub mod builder;
mod interface;
#[cfg(test)]
mod test;

/// The interface from Network to HealthChecker layer.
///
/// `HealthCheckerNetworkEvents` is a `Stream` of `PeerManagerNotification` where the
/// raw `Bytes` rpc messages are deserialized into
/// `HealthCheckerMsg` types. `HealthCheckerNetworkEvents` is a thin wrapper
/// around an `channel::Receiver<PeerManagerNotification>`.
pub type HealthCheckerNetworkEvents = NetworkEvents<HealthCheckerMsg>;

/// The interface from HealthChecker to Networking layer.
///
/// This is a thin wrapper around a `NetworkSender<HealthCheckerMsg>`, so it is
/// easy to clone and send off to a separate task. For example, the rpc requests
/// return Futures that encapsulate the whole flow, from sending the request to
/// remote, to finally receiving the response and deserializing. It therefore
/// makes the most sense to make the rpc call on a separate async task, which
/// requires the `HealthCheckerNetworkSender` to be `Clone` and `Send`.
#[derive(Clone)]
pub struct HealthCheckerNetworkSender {
    inner: NetworkSender<HealthCheckerMsg>,
}

/// Configuration for the network endpoints to support HealthChecker.
pub fn network_endpoint_config() -> AppConfig {
    AppConfig::p2p(
        [ProtocolId::HealthCheckerRpc],
        diem_channel::Config::new(NETWORK_CHANNEL_SIZE)
            .queue_style(QueueStyle::LIFO)
            .counters(&counters::PENDING_HEALTH_CHECKER_NETWORK_EVENTS),
    )
}

impl NewNetworkSender for HealthCheckerNetworkSender {
    fn new(
        peer_mgr_reqs_tx: PeerManagerRequestSender,
        connection_reqs_tx: ConnectionRequestSender,
    ) -> Self {
        Self {
            inner: NetworkSender::new(peer_mgr_reqs_tx, connection_reqs_tx),
        }
    }
}

impl HealthCheckerNetworkSender {
    pub async fn disconnect_peer(&mut self, peer_id: PeerId) -> Result<(), NetworkError> {
        self.inner.disconnect_peer(peer_id).await
    }
}

#[async_trait]
impl ApplicationNetworkSender<HealthCheckerMsg> for HealthCheckerNetworkSender {
    /// Send a HealthChecker Ping RPC request to remote peer `recipient`. Returns
    /// the remote peer's future `Pong` reply.
    ///
    /// The rpc request can be canceled at any point by dropping the returned
    /// future.
    async fn send_rpc(
        &self,
        recipient: PeerId,
        req_msg: HealthCheckerMsg,
        timeout: Duration,
    ) -> Result<HealthCheckerMsg, RpcError> {
        let protocol = ProtocolId::HealthCheckerRpc;
        self.inner
            .send_rpc(recipient, protocol, req_msg, timeout)
            .await
    }
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub enum HealthCheckerMsg {
    Ping(Ping),
    Pong(Pong),
}

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Ping(u32);

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Pong(u32);

/// The actor performing health checks by running the Ping protocol
pub struct HealthChecker {
    network_context: NetworkContext,
    /// A handle to a time service for easily mocking time-related operations.
    time_service: TimeService,
    /// Network interface to send requests to the Network Layer
    network_interface: HealthCheckNetworkInterface,
    /// Random-number generator.
    rng: SmallRng,
    /// Time we wait between each set of pings.
    ping_interval: Duration,
    /// Ping timeout duration.
    ping_timeout: Duration,
    /// Number of successive ping failures we tolerate before declaring a node as unhealthy and
    /// disconnecting from it. In the future, this can be replaced with a more general failure
    /// detection policy.
    ping_failures_tolerated: u64,
    /// Counter incremented in each round of health checks
    round: u64,
}

impl HealthChecker {
    /// Create new instance of the [`HealthChecker`] actor.
    pub fn new(
        network_context: NetworkContext,
        time_service: TimeService,
        network_interface: HealthCheckNetworkInterface,
        ping_interval: Duration,
        ping_timeout: Duration,
        ping_failures_tolerated: u64,
    ) -> Self {
        HealthChecker {
            network_context,
            time_service,
            network_interface,
            rng: SmallRng::from_entropy(),
            ping_interval,
            ping_timeout,
            ping_failures_tolerated,
            round: 0,
        }
    }

    pub async fn start(mut self) {
        let mut tick_handlers = FuturesUnordered::new();
        info!(
            NetworkSchema::new(&self.network_context),
            "{} Health checker actor started", self.network_context
        );

        let ticker = self.time_service.interval(self.ping_interval);
        tokio::pin!(ticker);

        loop {
            futures::select! {
                maybe_event = self.network_interface.next() => {
                    // Shutdown the HealthChecker when this network instance shuts
                    // down. This happens when the `PeerManager` drops.
                    let event = match maybe_event {
                        Some(event) => event,
                        None => break,
                    };

                    match event {
                        Event::NewPeer(metadata) => {
                            self.network_interface.app_data().insert(
                                metadata.remote_peer_id,
                                HealthCheckData::new(self.round)
                            );
                        }
                        Event::LostPeer(metadata) => {
                            self.network_interface.app_data().remove(
                                &metadata.remote_peer_id
                            );
                        }
                        Event::RpcRequest(peer_id, msg, protocol, res_tx) => {
                            match msg {
                                HealthCheckerMsg::Ping(ping) => self.handle_ping_request(peer_id, ping, protocol, res_tx),
                                _ => {
                                    warn!(
                                        SecurityEvent::InvalidHealthCheckerMsg,
                                        NetworkSchema::new(&self.network_context).remote_peer(&peer_id),
                                        rpc_message = msg,
                                        "{} Unexpected RPC message from {}",
                                        self.network_context,
                                        peer_id
                                    );
                                    debug_assert!(false, "Unexpected rpc request");
                                }
                            };
                        }
                        Event::Message(peer_id, msg) => {
                            error!(
                                SecurityEvent::InvalidNetworkEventHC,
                                NetworkSchema::new(&self.network_context).remote_peer(&peer_id),
                                "{} Unexpected direct send from {} msg {:?}",
                                self.network_context,
                                peer_id,
                                msg,
                            );
                            debug_assert!(false, "Unexpected network event");
                        }
                    }
                }
                _ = ticker.select_next_some() => {
                    self.round += 1;
                    let connected = self.network_interface.connected_peers();
                    if connected.is_empty() {
                        trace!(
                            NetworkSchema::new(&self.network_context),
                            round = self.round,
                            "{} No connected peer to ping round: {}",
                            self.network_context,
                            self.round
                        );
                        continue
                    }

                    for peer_id in connected {
                        let nonce = self.rng.gen::<u32>();
                        trace!(
                            NetworkSchema::new(&self.network_context),
                            round = self.round,
                            "{} Will ping: {} for round: {} nonce: {}",
                            self.network_context,
                            peer_id.short_str(),
                            self.round,
                            nonce
                        );

                        tick_handlers.push(Self::ping_peer(
                            self.network_context,
                            self.network_interface.sender(),
                            peer_id,
                            self.round,
                            nonce,
                            self.ping_timeout,
                        ));
                    }
                }
                res = tick_handlers.select_next_some() => {
                    let (peer_id, round, nonce, ping_result) = res;
                    self.handle_ping_response(peer_id, round, nonce, ping_result).await;
                }
            }
        }
        warn!(
            NetworkSchema::new(&self.network_context),
            "{} Health checker actor terminated", self.network_context
        );
    }

    fn handle_ping_request(
        &mut self,
        peer_id: PeerId,
        ping: Ping,
        protocol: ProtocolId,
        res_tx: oneshot::Sender<Result<Bytes, RpcError>>,
    ) {
        let message = match protocol.to_bytes(&HealthCheckerMsg::Pong(Pong(ping.0))) {
            Ok(msg) => msg,
            Err(e) => {
                warn!(
                    NetworkSchema::new(&self.network_context),
                    error = ?e,
                    "{} Unable to serialize pong response: {}", self.network_context, e
                );
                return;
            }
        };
        trace!(
            NetworkSchema::new(&self.network_context).remote_peer(&peer_id),
            "{} Sending Pong response to peer: {} with nonce: {}",
            self.network_context,
            peer_id.short_str(),
            ping.0,
        );
        let _ = res_tx.send(Ok(message.into()));
    }

    async fn handle_ping_response(
        &mut self,
        peer_id: PeerId,
        round: u64,
        req_nonce: u32,
        ping_result: Result<Pong, RpcError>,
    ) {
        match ping_result {
            Ok(pong) => {
                if pong.0 == req_nonce {
                    trace!(
                        NetworkSchema::new(&self.network_context).remote_peer(&peer_id),
                        rount = round,
                        "{} Ping successful for peer: {} round: {}",
                        self.network_context,
                        peer_id.short_str(),
                        round
                    );
                    // Update last successful ping to current round.
                    // If it's not in storage, don't bother updating it
                    let _ = self.network_interface.app_data().write(peer_id, |entry| {
                        match entry {
                            Entry::Vacant(..) => {
                                // Don't do anything if there isn't an entry
                            }
                            Entry::Occupied(inner) => {
                                let data = inner.get_mut();
                                // Update state if it's a newer round
                                if round > data.round {
                                    data.round = round;
                                    data.failures = 0;
                                }
                            }
                        };
                        Ok(())
                    });
                } else {
                    warn!(
                        SecurityEvent::InvalidHealthCheckerMsg,
                        NetworkSchema::new(&self.network_context).remote_peer(&peer_id),
                        "{} Pong nonce doesn't match Ping nonce. Round: {}, Pong: {}, Ping: {}",
                        self.network_context,
                        round,
                        pong.0,
                        req_nonce
                    );
                    debug_assert!(false, "Pong nonce doesn't match our challenge Ping nonce");
                }
            }
            Err(err) => {
                warn!(
                    NetworkSchema::new(&self.network_context)
                        .remote_peer(&peer_id),
                    error = ?err,
                    round = round,
                    "{} Ping failed for peer: {} round: {} with error: {:?}",
                    self.network_context,
                    peer_id.short_str(),
                    round,
                    err
                );
                let _ = self.network_interface.app_data().write(peer_id, |entry| {
                    // Don't add in a default in case it's already disconnected
                    match entry {
                        Entry::Vacant(..) => {
                            // Don't do anything if there isn't an entry
                        }
                        Entry::Occupied(inner) => {
                            // If this is the result of an older ping, we ignore it.
                            // Increment num of failures.
                            let data = inner.get_mut();
                            if data.round <= round {
                                data.failures += 1;
                            }
                        }
                    }
                    Ok(())
                });

                // If the ping failures are now more than
                // `self.ping_failures_tolerated`, we disconnect from the node.
                // The HealthChecker only performs the disconnect. It relies on
                // ConnectivityManager or the remote peer to re-establish the connection.
                let failures = self
                    .network_interface
                    .app_data()
                    .read(&peer_id)
                    .map(|data| data.failures)
                    .unwrap_or(0);
                if failures > self.ping_failures_tolerated {
                    info!(
                        NetworkSchema::new(&self.network_context).remote_peer(&peer_id),
                        "{} Disconnecting from peer: {}",
                        self.network_context,
                        peer_id.short_str()
                    );
                    let peer_network_id =
                        PeerNetworkId::new(self.network_context.network_id(), peer_id);
                    if let Err(err) = self
                        .network_interface
                        .disconnect_peer(peer_network_id)
                        .await
                    {
                        warn!(
                            NetworkSchema::new(&self.network_context)
                                .remote_peer(&peer_id),
                            error = ?err,
                            "{} Failed to disconnect from peer: {} with error: {:?}",
                            self.network_context,
                            peer_id.short_str(),
                            err
                        );
                    }
                }
            }
        }
    }

    async fn ping_peer(
        network_context: NetworkContext,
        network_tx: HealthCheckerNetworkSender,
        peer_id: PeerId,
        round: u64,
        nonce: u32,
        ping_timeout: Duration,
    ) -> (PeerId, u64, u32, Result<Pong, RpcError>) {
        trace!(
            NetworkSchema::new(&network_context).remote_peer(&peer_id),
            round = round,
            "{} Sending Ping request to peer: {} for round: {} nonce: {}",
            network_context,
            peer_id.short_str(),
            round,
            nonce
        );
        let res_pong_msg = network_tx
            .send_rpc(peer_id, HealthCheckerMsg::Ping(Ping(nonce)), ping_timeout)
            .await
            .and_then(|msg| match msg {
                HealthCheckerMsg::Pong(res) => Ok(res),
                _ => Err(RpcError::InvalidRpcResponse),
            });
        (peer_id, round, nonce, res_pong_msg)
    }
}


text:
package org.elasticsearch.action.admin.cluster.node.tasks.list;

import org.elasticsearch.action.ActionType;

/**
 * ActionType for retrieving a list of currently running tasks
 */
public class ListTasksAction extends ActionType<ListTasksResponse> {

    public static final ListTasksAction INSTANCE = new ListTasksAction();
    public static final String NAME = "cluster:monitor/tasks/lists";

    private ListTasksAction() {
        super(NAME, ListTasksResponse::new);
    }

}


text:
<!--
id: 1418397051
link: http://tumblr.atmos.org/post/1418397051/firesheep-a-day-later-codebutler
slug: firesheep-a-day-later-codebutler
date: Wed Oct 27 2010 16:07:14 GMT-0700 (PDT)
publish: 2010-10-027
tags:
title: Firesheep, a day later - codebutler
-->

Firesheep, a day later - codebutler
===================================

[http://codebutler.com/firesheep-a-day-later](http://codebutler.com/firesheep-a-day-later)


text:
#pragma once
#include "kernel/environment.h"
#include "kernel/find_fn.h"
#include "library/inductive_compiler/ginductive_decl.h"

namespace lean {

enum class ginductive_kind { BASIC, MUTUAL, NESTED };

environment register_ginductive_decl(environment const & env, ginductive_decl const & decl, ginductive_kind k);

optional<ginductive_kind> is_ginductive(environment const & env, name const & ind_name);

/* \brief Returns the names of the introduction rules for the inductive type \e ind_name. */
list<name> get_ginductive_intro_rules(environment const & env, name const & ind_name);

/* \brief Returns the name of the inductive type if \e ir_name is indeed an introduction rule. */
optional<name> is_ginductive_intro_rule(environment const & env, name const & ir_name);

/* \brief Returns the number of parameters for the given inductive type \e ind_name. */
unsigned get_ginductive_num_params(environment const & env, name const & ind_name);

/* \brief Returns the names of all types that are mutually inductive with \e ind_name */
list<name> get_ginductive_mut_ind_names(environment const & env, name const & ind_name);

/* \brief Returns the names of all mutual ginductive types */
list<name> get_ginductive_all_mutual_inds(environment const & env);

/* \brief Returns the names of all nested ginductive types */
list<name> get_ginductive_all_nested_inds(environment const & env);

void initialize_inductive_compiler_ginductive();
void finalize_inductive_compiler_ginductive();
}


text:
import {IS_DART} from '../../src/facade/lang';
import {MessageBus} from '../web_workers/shared/message_bus';
import {NgZone} from '@angular/core/src/zone/ng_zone';
import {
  ExceptionHandler,
  APPLICATION_COMMON_PROVIDERS,
  PLATFORM_COMMON_PROVIDERS,
  RootRenderer,
  PLATFORM_INITIALIZER
} from '@angular/core';
import {Provider, Injector, OpaqueToken} from '@angular/core/src/di';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {DomEventsPlugin} from '@angular/platform-browser/src/dom/events/dom_events';
import {KeyEventsPlugin} from '@angular/platform-browser/src/dom/events/key_events';
import {HammerGesturesPlugin} from '@angular/platform-browser/src/dom/events/hammer_gestures';
import {DOCUMENT} from '@angular/platform-browser/src/dom/dom_tokens';
import {DomRootRenderer, DomRootRenderer_} from '@angular/platform-browser/src/dom/dom_renderer';
import {
  DomSharedStylesHost,
  SharedStylesHost
} from '@angular/platform-browser/src/dom/shared_styles_host';
import {BrowserDetails} from '../animate/browser_details';
import {AnimationBuilder} from '../animate/animation_builder';
import {Testability} from '@angular/core/src/testability/testability';
import {BrowserGetTestability} from '@angular/platform-browser/src/browser/testability';
import {BrowserDomAdapter} from '../browser/browser_adapter';
import {wtfInit} from '@angular/core/src/profile/wtf_init';
import {MessageBasedRenderer} from '../web_workers/ui/renderer';
import {
  ServiceMessageBrokerFactory,
  ServiceMessageBrokerFactory_
} from '../web_workers/shared/service_message_broker';
import {
  ClientMessageBrokerFactory,
  ClientMessageBrokerFactory_
} from '../web_workers/shared/client_message_broker';
import {
  BrowserPlatformLocation
} from '@angular/platform-browser/src/browser/location/browser_platform_location';
import {Serializer} from '../web_workers/shared/serializer';
import {ON_WEB_WORKER} from '../web_workers/shared/api';
import {RenderStore} from '../web_workers/shared/render_store';
import {HAMMER_GESTURE_CONFIG, HammerGestureConfig} from '../dom/events/hammer_gestures';
import {EventManager, EVENT_MANAGER_PLUGINS} from '../dom/events/event_manager';
import {XHR} from "../../../compiler/src/xhr";
import {XHRImpl} from "../../../platform-browser-dynamic/src/xhr/xhr_impl";
import {MessageBasedXHRImpl} from "../web_workers/ui/xhr_impl";
// TODO change these imports once dom_adapter is moved out of core

export const WORKER_SCRIPT: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken("WebWorkerScript");

// Message based Worker classes that listen on the MessageBus
export const WORKER_RENDER_MESSAGING_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
    /*@ts2dart_const*/[MessageBasedRenderer, MessageBasedXHRImpl];

export const WORKER_RENDER_PLATFORM_MARKER =
    /*@ts2dart_const*/ new OpaqueToken('WorkerRenderPlatformMarker');

export const WORKER_RENDER_PLATFORM: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/[
  PLATFORM_COMMON_PROVIDERS,
  /*@ts2dart_const*/ (/* @ts2dart_Provider */ {provide: WORKER_RENDER_PLATFORM_MARKER, useValue: true}),
  /* @ts2dart_Provider */ {provide: PLATFORM_INITIALIZER, useValue: initWebWorkerRenderPlatform, multi: true}
];

/**
 * A list of {@link Provider}s. To use the router in a Worker enabled application you must
 * include these providers when setting up the render thread.
 */
export const WORKER_RENDER_ROUTER: Array<any /*Type | Provider | any[]*/> =
    /*@ts2dart_const*/[BrowserPlatformLocation];

export const WORKER_RENDER_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*/> =
    /*@ts2dart_const*/[
      APPLICATION_COMMON_PROVIDERS,
      WORKER_RENDER_MESSAGING_PROVIDERS,
      /* @ts2dart_Provider */ {provide: ExceptionHandler, useFactory: _exceptionHandler, deps: []},
      /* @ts2dart_Provider */ {provide: DOCUMENT, useFactory: _document, deps: []},
      // TODO(jteplitz602): Investigate if we definitely need EVENT_MANAGER on the render thread
      // #5298
      /* @ts2dart_Provider */ {provide: EVENT_MANAGER_PLUGINS, useClass: DomEventsPlugin, multi: true},
      /* @ts2dart_Provider */ {provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true},
      /* @ts2dart_Provider */ {provide: EVENT_MANAGER_PLUGINS, useClass: HammerGesturesPlugin, multi: true},
      /* @ts2dart_Provider */ {provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig},
      /* @ts2dart_Provider */ {provide: DomRootRenderer, useClass: DomRootRenderer_},
      /* @ts2dart_Provider */ {provide: RootRenderer, useExisting: DomRootRenderer},
      /* @ts2dart_Provider */ {provide: SharedStylesHost, useExisting: DomSharedStylesHost},
      /* @ts2dart_Provider */ {provide: XHR, useClass: XHRImpl},
      MessageBasedXHRImpl,
      /* @ts2dart_Provider */ {provide: ServiceMessageBrokerFactory, useClass: ServiceMessageBrokerFactory_},
      /* @ts2dart_Provider */ {provide: ClientMessageBrokerFactory, useClass: ClientMessageBrokerFactory_},
      Serializer,
      /* @ts2dart_Provider */ {provide: ON_WEB_WORKER, useValue: false},
      RenderStore,
      DomSharedStylesHost,
      Testability,
      BrowserDetails,
      AnimationBuilder,
      EventManager
    ];

export function initializeGenericWorkerRenderer(injector: Injector) {
  var bus = injector.get(MessageBus);
  let zone = injector.get(NgZone);
  bus.attachToZone(zone);

  zone.runGuarded(() => {
    WORKER_RENDER_MESSAGING_PROVIDERS.forEach((token) => { injector.get(token).start(); });
  });
}

export function initWebWorkerRenderPlatform(): void {
  BrowserDomAdapter.makeCurrent();
  wtfInit();
  BrowserGetTestability.init();
}

function _exceptionHandler(): ExceptionHandler {
  return new ExceptionHandler(getDOM(), !IS_DART);
}

function _document(): any {
  return getDOM().defaultDoc();
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _09.Reversed_chars
{
	class Program
	{
		static void Main(string[] args)
		{
			char firstLetter = char.Parse(Console.ReadLine());
			char secondLetter = char.Parse(Console.ReadLine());
			char thirdLetter = char.Parse(Console.ReadLine());
			Console.WriteLine("{0}{1}{2}",thirdLetter,secondLetter,firstLetter );
		}
	}
}


text:
package com.couchbase.lite.performance;

import com.couchbase.lite.CouchbaseLiteException;
import com.couchbase.lite.Document;
import com.couchbase.lite.TransactionalTask;
import com.couchbase.lite.util.Log;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Test3_ReadDocs extends PerformanceTestCase {
    public static final String TAG = "ReadDocsPerformance";
    private List<String> docIds;

    @Override
    protected String getTestTag() {
        return TAG;
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();

        if (!performanceTestsEnabled())
            return;

        char[] chars = new char[getSizeOfDocument()];
        Arrays.fill(chars, 'a');
        final String content = new String(chars);

        // Prepare data:
        docIds = new ArrayList<String>();
        boolean success = database.runInTransaction(new TransactionalTask() {
            public boolean run() {
                for (int i = 0; i < getNumberOfDocuments(); i++) {
                    Map<String, Object> props = new HashMap<String, Object>();
                    props.put("content", content);
                    Document doc = database.createDocument();
                    try {
                        assertNotNull(doc.putProperties(props));
                        docIds.add(doc.getId());
                    } catch (CouchbaseLiteException e) {
                        Log.e(TAG, "Document create failed", e);
                        return false;
                    }
                }
                return true;
            }
        });
        assertTrue(success);

        // Close and reopen the database:
        database.close();
        database = manager.getDatabase(DEFAULT_TEST_DB);
    }

    public void testReadDocsPerformance() throws Exception {
        if (!performanceTestsEnabled())
            return;

        long start = System.currentTimeMillis();
        for(String docId : docIds) {
            Document doc = database.getDocument(docId);
            assertNotNull(doc);
            Map<String,Object> properties = doc.getProperties();
            assertNotNull(properties);
            assertNotNull(properties.get("content"));
        }
        long end = System.currentTimeMillis();
        logPerformanceStats((end - start), getNumberOfDocuments() + ", " + getSizeOfDocument());
    }

    private int getSizeOfDocument() {
        return Integer.parseInt(System.getProperty("test3.sizeOfDocument"));
    }

    private int getNumberOfDocuments() {
        return Integer.parseInt(System.getProperty("test3.numberOfDocuments"));
    }
}


text:
require "omniauth-keystone/version"
require 'openstack'
require 'omniauth'

module OmniAuth
  module Strategies
    class Keystone
      include OmniAuth::Strategy

      #args [:auth_url]

      option :auth_url, nil
      option :name, 'keystone'
      option :setup, false
      option :skip_info, true

      def log(level, message)
        OmniAuth.logger.send(level, "(#{name}) #{message}")
      end

      def request_phase
        log :info, "--Request phase initiated."
        f = OmniAuth::Form.new(:title => (options[:title] || "OpenStack Authentication"), :url => callback_path)
        f.text_field 'Login', 'username'
        f.password_field 'Password', 'password'
        f.button "Sign in"
        f.to_response
      end

      def callback_phase
        log :info, "--Callback phase initiated."
        begin
	  u = request.env["rack.request.form_hash"]["username"]
	  p = request.env["rack.request.form_hash"]["password"]
          log :info, "--Callback phase (1)."
#          log :info, "req: %s" % [request.inspect]
#          log :info, "req-u: <%s>" % [u]
#          log :info, "req-p: <%s>" % [p]

          os = OpenStack::Connection.create({
		:username => u,
		:api_key=> p,
		:auth_method=>"password",
		:auth_url => options.auth_url})
        rescue Exception => e
          #log :info, "--Callback phase (3)."
          #log :info, e.message
          return fail!(:keystone_error, e)
        end
        #log :info, "--Callback phase (4)."
	@user = u
	@user_email = u
        @user_info = {
            'name' => @user
        }
      end

      uid do
	@user
      end
      info do {
        :name => @user,
        :email => @user_email
      }
      end
    end
  end
end