text:
package pl.srw.billcalculator.db.dao;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.internal.SqlUtils;

import java.util.ArrayList;
import java.util.List;

import pl.srw.billcalculator.db.PgeG11Bill;
import pl.srw.billcalculator.db.PgePrices;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
 * DAO for table "PGE_G11_BILL".
*/
@SuppressWarnings("ALL")
public class PgeG11BillDao extends AbstractDao<PgeG11Bill, Long> {

    public static final String TABLENAME = "PGE_G11_BILL";

    /**
     * Properties of entity PgeG11Bill.<br/>
     * Can be used for QueryBuilder and for referencing column names.
     */
    public static class Properties {
        public final static Property Id = new Property(0, Long.class, "id", true, "_id");
        public final static Property ReadingFrom = new Property(1, Integer.class, "readingFrom", false, "READING_FROM");
        public final static Property ReadingTo = new Property(2, Integer.class, "readingTo", false, "READING_TO");
        public final static Property DateFrom = new Property(3, java.util.Date.class, "dateFrom", false, "DATE_FROM");
        public final static Property DateTo = new Property(4, java.util.Date.class, "dateTo", false, "DATE_TO");
        public final static Property AmountToPay = new Property(5, Double.class, "amountToPay", false, "AMOUNT_TO_PAY");
        public final static Property PricesId = new Property(6, Long.class, "pricesId", false, "PRICES_ID");
    }

    private DaoSession daoSession;

    public PgeG11BillDao(DaoConfig config) {
        super(config);
    }

    public PgeG11BillDao(DaoConfig config, DaoSession daoSession) {
        super(config, daoSession);
        this.daoSession = daoSession;
    }

    /** Creates the underlying database table. */
    public static void createTable(Database db, boolean ifNotExists) {
        String constraint = ifNotExists? "IF NOT EXISTS ": "";
        db.execSQL("CREATE TABLE " + constraint + "\"PGE_G11_BILL\" (" + //
                "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
                "\"READING_FROM\" INTEGER," + // 1: readingFrom
                "\"READING_TO\" INTEGER," + // 2: readingTo
                "\"DATE_FROM\" INTEGER," + // 3: dateFrom
                "\"DATE_TO\" INTEGER," + // 4: dateTo
                "\"AMOUNT_TO_PAY\" REAL," + // 5: amountToPay
                "\"PRICES_ID\" INTEGER);"); // 6: pricesId
    }

    /** Drops the underlying database table. */
    public static void dropTable(Database db, boolean ifExists) {
        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PGE_G11_BILL\"";
        db.execSQL(sql);
    }

    @Override
    protected final void bindValues(DatabaseStatement stmt, PgeG11Bill entity) {
        stmt.clearBindings();

        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }

        Integer readingFrom = entity.getReadingFrom();
        if (readingFrom != null) {
            stmt.bindLong(2, readingFrom);
        }

        Integer readingTo = entity.getReadingTo();
        if (readingTo != null) {
            stmt.bindLong(3, readingTo);
        }

        java.util.Date dateFrom = entity.getDateFrom();
        if (dateFrom != null) {
            stmt.bindLong(4, dateFrom.getTime());
        }

        java.util.Date dateTo = entity.getDateTo();
        if (dateTo != null) {
            stmt.bindLong(5, dateTo.getTime());
        }

        Double amountToPay = entity.getAmountToPay();
        if (amountToPay != null) {
            stmt.bindDouble(6, amountToPay);
        }

        Long pricesId = entity.getPricesId();
        if (pricesId != null) {
            stmt.bindLong(7, pricesId);
        }
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, PgeG11Bill entity) {
        stmt.clearBindings();

        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }

        Integer readingFrom = entity.getReadingFrom();
        if (readingFrom != null) {
            stmt.bindLong(2, readingFrom);
        }

        Integer readingTo = entity.getReadingTo();
        if (readingTo != null) {
            stmt.bindLong(3, readingTo);
        }

        java.util.Date dateFrom = entity.getDateFrom();
        if (dateFrom != null) {
            stmt.bindLong(4, dateFrom.getTime());
        }

        java.util.Date dateTo = entity.getDateTo();
        if (dateTo != null) {
            stmt.bindLong(5, dateTo.getTime());
        }

        Double amountToPay = entity.getAmountToPay();
        if (amountToPay != null) {
            stmt.bindDouble(6, amountToPay);
        }

        Long pricesId = entity.getPricesId();
        if (pricesId != null) {
            stmt.bindLong(7, pricesId);
        }
    }

    @Override
    protected final void attachEntity(PgeG11Bill entity) {
        super.attachEntity(entity);
        entity.__setDaoSession(daoSession);
    }

    @Override
    public Long readKey(Cursor cursor, int offset) {
        return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
    }

    @Override
    public PgeG11Bill readEntity(Cursor cursor, int offset) {
        PgeG11Bill entity = new PgeG11Bill( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getInt(offset + 1), // readingFrom
            cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2), // readingTo
            cursor.isNull(offset + 3) ? null : new java.util.Date(cursor.getLong(offset + 3)), // dateFrom
            cursor.isNull(offset + 4) ? null : new java.util.Date(cursor.getLong(offset + 4)), // dateTo
            cursor.isNull(offset + 5) ? null : cursor.getDouble(offset + 5), // amountToPay
            cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6) // pricesId
        );
        return entity;
    }

    @Override
    public void readEntity(Cursor cursor, PgeG11Bill entity, int offset) {
        entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
        entity.setReadingFrom(cursor.isNull(offset + 1) ? null : cursor.getInt(offset + 1));
        entity.setReadingTo(cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2));
        entity.setDateFrom(cursor.isNull(offset + 3) ? null : new java.util.Date(cursor.getLong(offset + 3)));
        entity.setDateTo(cursor.isNull(offset + 4) ? null : new java.util.Date(cursor.getLong(offset + 4)));
        entity.setAmountToPay(cursor.isNull(offset + 5) ? null : cursor.getDouble(offset + 5));
        entity.setPricesId(cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6));
     }

    @Override
    protected final Long updateKeyAfterInsert(PgeG11Bill entity, long rowId) {
        entity.setId(rowId);
        return rowId;
    }

    @Override
    public Long getKey(PgeG11Bill entity) {
        if(entity != null) {
            return entity.getId();
        } else {
            return null;
        }
    }

    @Override
    public boolean hasKey(PgeG11Bill entity) {
        return entity.getId() != null;
    }

    @Override
    protected final boolean isEntityUpdateable() {
        return true;
    }

    private String selectDeep;

    protected String getSelectDeep() {
        if (selectDeep == null) {
            StringBuilder builder = new StringBuilder("SELECT ");
            SqlUtils.appendColumns(builder, "T", getAllColumns());
            builder.append(',');
            SqlUtils.appendColumns(builder, "T0", daoSession.getPgePricesDao().getAllColumns());
            builder.append(" FROM PGE_G11_BILL T");
            builder.append(" LEFT JOIN PGE_PRICES T0 ON T.\"PRICES_ID\"=T0.\"_id\"");
            builder.append(' ');
            selectDeep = builder.toString();
        }
        return selectDeep;
    }

    protected PgeG11Bill loadCurrentDeep(Cursor cursor, boolean lock) {
        PgeG11Bill entity = loadCurrent(cursor, 0, lock);
        int offset = getAllColumns().length;

        PgePrices pgePrices = loadCurrentOther(daoSession.getPgePricesDao(), cursor, offset);
        entity.setPgePrices(pgePrices);

        return entity;
    }

    public PgeG11Bill loadDeep(Long key) {
        assertSinglePk();
        if (key == null) {
            return null;
        }

        StringBuilder builder = new StringBuilder(getSelectDeep());
        builder.append("WHERE ");
        SqlUtils.appendColumnsEqValue(builder, "T", getPkColumns());
        String sql = builder.toString();

        String[] keyArray = new String[] { key.toString() };
        Cursor cursor = db.rawQuery(sql, keyArray);

        try {
            boolean available = cursor.moveToFirst();
            if (!available) {
                return null;
            } else if (!cursor.isLast()) {
                throw new IllegalStateException("Expected unique result, but count was " + cursor.getCount());
            }
            return loadCurrentDeep(cursor, true);
        } finally {
            cursor.close();
        }
    }

    /** Reads all available rows from the given cursor and returns a list of new ImageTO objects. */
    public List<PgeG11Bill> loadAllDeepFromCursor(Cursor cursor) {
        int count = cursor.getCount();
        List<PgeG11Bill> list = new ArrayList<PgeG11Bill>(count);

        if (cursor.moveToFirst()) {
            if (identityScope != null) {
                identityScope.lock();
                identityScope.reserveRoom(count);
            }
            try {
                do {
                    list.add(loadCurrentDeep(cursor, false));
                } while (cursor.moveToNext());
            } finally {
                if (identityScope != null) {
                    identityScope.unlock();
                }
            }
        }
        return list;
    }

    protected List<PgeG11Bill> loadDeepAllAndCloseCursor(Cursor cursor) {
        try {
            return loadAllDeepFromCursor(cursor);
        } finally {
            cursor.close();
        }
    }

    /** A raw-style query where you can pass any WHERE clause and arguments. */
    public List<PgeG11Bill> queryDeep(String where, String... selectionArg) {
        Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
        return loadDeepAllAndCloseCursor(cursor);
    }

}


text:
<?php namespace Fungku\NetSuite\Classes;

class ItemSupplyPlanSearch extends SearchRecord {
	public $basic;
	public $itemJoin;
	public $locationJoin;
	public $userJoin;
	public $customSearchJoin;
	static $paramtypesmap = array(
		"basic" => "ItemSupplyPlanSearchBasic",
		"itemJoin" => "ItemSearchBasic",
		"locationJoin" => "LocationSearchBasic",
		"userJoin" => "EmployeeSearchBasic",
		"customSearchJoin" => "CustomSearchJoin[]",
	);
}

redpajama_set_name: RedPajamaGithub


text:
import django.db.models.deletion
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('structure', '0009_project_is_removed'),
        ('waldur_vmware', '0016_port'),
    ]

    operations = [
        migrations.CreateModel(
            name='CustomerNetworkPair',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'customer',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='structure.Customer',
                    ),
                ),
                (
                    'network',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='waldur_vmware.Network',
                    ),
                ),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='customernetworkpair', unique_together=set([('customer', 'network')]),
        ),
    ]


text:
'use strict';

/*!
 * Module dependencies.
 */

var RegExpClone = require('regexp-clone')

/**
 * Clones objects
 *
 * @param {Object} obj the object to clone
 * @param {Object} options
 * @return {Object} the cloned object
 * @api private
 */

var clone = exports.clone = function clone (obj, options) {
  if (obj === undefined || obj === null)
    return obj;

  if (Array.isArray(obj))
    return exports.cloneArray(obj, options);

  if (obj.constructor) {
    if (/ObjectI[dD]$/.test(obj.constructor.name)) {
      return 'function' == typeof obj.clone
        ? obj.clone()
        : new obj.constructor(obj.id);
    }

    if ('ReadPreference' === obj._type && obj.isValid && obj.toObject) {
      return 'function' == typeof obj.clone
        ? obj.clone()
        : new obj.constructor(obj.mode, clone(obj.tags, options));
    }

    if ('Binary' == obj._bsontype && obj.buffer && obj.value) {
      return 'function' == typeof obj.clone
        ? obj.clone()
        : new obj.constructor(obj.value(true), obj.sub_type);
    }

    if ('Date' === obj.constructor.name || 'Function' === obj.constructor.name)
      return new obj.constructor(+obj);

    if ('RegExp' === obj.constructor.name)
      return RegExpClone(obj);

    if ('Buffer' === obj.constructor.name)
      return exports.cloneBuffer(obj);
  }

  if (isObject(obj))
    return exports.cloneObject(obj, options);

  if (obj.valueOf)
    return obj.valueOf();
};

/*!
 * ignore
 */

var cloneObject = exports.cloneObject = function cloneObject (obj, options) {
  var retainKeyOrder = options && options.retainKeyOrder
    , minimize = options && options.minimize
    , ret = {}
    , hasKeys
    , keys
    , val
    , k
    , i

  if (retainKeyOrder) {
    for (k in obj) {
      val = clone(obj[k], options);

      if (!minimize || ('undefined' !== typeof val)) {
        hasKeys || (hasKeys = true);
        ret[k] = val;
      }
    }
  } else {
    // faster

    keys = Object.keys(obj);
    i = keys.length;

    while (i--) {
      k = keys[i];
      val = clone(obj[k], options);

      if (!minimize || ('undefined' !== typeof val)) {
        if (!hasKeys) hasKeys = true;
        ret[k] = val;
      }
    }
  }

  return minimize
    ? hasKeys && ret
    : ret;
};

var cloneArray = exports.cloneArray = function cloneArray (arr, options) {
  var ret = [];
  for (var i = 0, l = arr.length; i < l; i++)
    ret.push(clone(arr[i], options));
  return ret;
};

/**
 * process.nextTick helper.
 *
 * Wraps the given `callback` in a try/catch. If an error is
 * caught it will be thrown on nextTick.
 *
 * node-mongodb-native had a habit of state corruption when
 * an error was immediately thrown from within a collection
 * method (find, update, etc) callback.
 *
 * @param {Function} [callback]
 * @api private
 */

var tick = exports.tick = function tick (callback) {
  if ('function' !== typeof callback) return;
  return function () {
    // callbacks should always be fired on the next
    // turn of the event loop. A side benefit is
    // errors thrown from executing the callback
    // will not cause drivers state to be corrupted
    // which has historically been a problem.
    var args = arguments;
    soon(function(){
      callback.apply(this, args);
    });
  }
}

/**
 * Merges `from` into `to` without overwriting existing properties.
 *
 * @param {Object} to
 * @param {Object} from
 * @api private
 */

var merge = exports.merge = function merge (to, from) {
  var keys = Object.keys(from)
    , i = keys.length
    , key

  while (i--) {
    key = keys[i];
    if ('undefined' === typeof to[key]) {
      to[key] = from[key];
    } else {
      if (exports.isObject(from[key])) {
        merge(to[key], from[key]);
      } else {
        to[key] = from[key];
      }
    }
  }
}

/**
 * Same as merge but clones the assigned values.
 *
 * @param {Object} to
 * @param {Object} from
 * @api private
 */

var mergeClone = exports.mergeClone = function mergeClone (to, from) {
  var keys = Object.keys(from)
    , i = keys.length
    , key

  while (i--) {
    key = keys[i];
    if ('undefined' === typeof to[key]) {
      // make sure to retain key order here because of a bug handling the $each
      // operator in mongodb 2.4.4
      to[key] = clone(from[key], { retainKeyOrder : 1});
    } else {
      if (exports.isObject(from[key])) {
        mergeClone(to[key], from[key]);
      } else {
        // make sure to retain key order here because of a bug handling the
        // $each operator in mongodb 2.4.4
        to[key] = clone(from[key], { retainKeyOrder : 1});
      }
    }
  }
}

/**
 * Read pref helper (mongo 2.2 drivers support this)
 *
 * Allows using aliases instead of full preference names:
 *
 *     p   primary
 *     pp  primaryPreferred
 *     s   secondary
 *     sp  secondaryPreferred
 *     n   nearest
 *
 * @param {String} pref
 */

exports.readPref = function readPref (pref) {
  switch (pref) {
    case 'p':
      pref = 'primary';
      break;
    case 'pp':
      pref = 'primaryPreferred';
      break;
    case 's':
      pref = 'secondary';
      break;
    case 'sp':
      pref = 'secondaryPreferred';
      break;
    case 'n':
      pref = 'nearest';
      break;
  }

  return pref;
}

/**
 * Object.prototype.toString.call helper
 */

var _toString = Object.prototype.toString;
var toString = exports.toString = function (arg) {
  return _toString.call(arg);
}

/**
 * Determines if `arg` is an object.
 *
 * @param {Object|Array|String|Function|RegExp|any} arg
 * @return {Boolean}
 */

var isObject = exports.isObject = function (arg) {
  return '[object Object]' == exports.toString(arg);
}

/**
 * Determines if `arg` is an array.
 *
 * @param {Object}
 * @return {Boolean}
 * @see nodejs utils
 */

var isArray = exports.isArray = function (arg) {
  return Array.isArray(arg) ||
    'object' == typeof arg && '[object Array]' == exports.toString(arg);
}

/**
 * Object.keys helper
 */

exports.keys = Object.keys || function (obj) {
  var keys = [];
  for (var k in obj) if (obj.hasOwnProperty(k)) {
    keys.push(k);
  }
  return keys;
}

/**
 * Basic Object.create polyfill.
 * Only one argument is supported.
 *
 * Based on https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create
 */

exports.create = 'function' == typeof Object.create
  ? Object.create
  : create;

function create (proto) {
  if (arguments.length > 1) {
    throw new Error("Adding properties is not supported")
  }

  function F () {}
  F.prototype = proto;
  return new F;
}

/**
 * inheritance
 */

exports.inherits = function (ctor, superCtor) {
  ctor.prototype = exports.create(superCtor.prototype);
  ctor.prototype.constructor = ctor;
}

/**
 * nextTick helper
 * compat with node 0.10 which behaves differently than previous versions
 */

var soon = exports.soon = 'function' == typeof setImmediate
  ? setImmediate
  : process.nextTick;

/**
 * Clones the contents of a buffer.
 *
 * @param {Buffer} buff
 * @return {Buffer}
 */

exports.cloneBuffer = function (buff) {
  var dupe = new Buffer(buff.length);
  buff.copy(dupe, 0, 0, buff.length);
  return dupe;
};


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

#endregion

namespace GTR.Core.Util
{
    // ReSharper disable once InconsistentNaming
    public class WrappedFunc<T, U>
    {
        private readonly Func<T, U> _baseFunc;
        private readonly ISet<Func<T, U, U>> _funcWrappers;

        public WrappedFunc(Func<T, U> baseFunc)
        {
            _baseFunc = baseFunc;
            _funcWrappers = new HashSet<Func<T, U, U>>();
        }

        public U Execute(T originalParam)
        {
            var runningResult = _baseFunc(originalParam);
            return _funcWrappers.Aggregate(runningResult, (current, funcWrapper) => funcWrapper(originalParam, current));
        }

        public void Unwrap(Func<T, U, U> funcWrapper)
        {
            _funcWrappers.Remove(funcWrapper);
        }

        public void Wrap(Func<T, U, U> funcWrapper)
        {
            _funcWrappers.Add(funcWrapper);
        }
    }
}

namespace GTR.Core.Util
{
    // ReSharper disable once InconsistentNaming
    public class WrappedFunc<U>
    {
        private readonly Func<U> _baseFunc;
        private readonly ISet<Func<U, U>> _funcWrappers;

        public WrappedFunc(Func<U> baseFunc)
        {
            _baseFunc = baseFunc;
            _funcWrappers = new HashSet<Func<U, U>>();
        }

        public U Execute()
        {
            var runningResult = _baseFunc();
            if (runningResult == null) throw new ArgumentNullException("runningResult");
            return _funcWrappers.Aggregate(runningResult, (current, funcWrapper) => funcWrapper(current));
        }

        public void Unwrap(Func<U, U> funcWrapper)
        {
            _funcWrappers.Remove(funcWrapper);
        }

        public void Wrap(Func<U, U> funcWrapper)
        {
            // consider: should we throw an exception if the function is already present?
            _funcWrappers.Add(funcWrapper);
        }
    }
}

namespace GTR.Core.Util
{
    // ReSharper disable once InconsistentNaming
    internal class WrappedFunc<T1, T2, U>
    {
        private readonly Func<T1, T2, U> _baseFunc;
        private readonly ISet<Func<T1, T2, U, U>> _funcWrappers;

        public WrappedFunc(Func<T1, T2, U> baseFunc)
        {
            _baseFunc = baseFunc;
            _funcWrappers = new HashSet<Func<T1, T2, U, U>>();
        }

        public U Execute(T1 originalParam1, T2 originalParam2)
        {
            var runningResult = _baseFunc(originalParam1, originalParam2);
            return _funcWrappers.Aggregate(runningResult,
                (current, funcWrapper) => funcWrapper(originalParam1, originalParam2, current));
        }

        public void Unwrap(Func<T1, T2, U, U> funcWrapper)
        {
            _funcWrappers.Remove(funcWrapper);
        }

        public void Wrap(Func<T1, T2, U, U> funcWrapper)
        {
            _funcWrappers.Add(funcWrapper);
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Interface org.apache.hadoop.mapreduce.counters.CounterGroupBase (hadoop-mapreduce-client-core 2.2.0 API)</title>
<meta name="date" content="2013-12-16">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV

NEXT

FRAMES

NO FRAMES

All Classes

Uses of Interface
org.apache.hadoop.mapreduce.counters.CounterGroupBase

Packages that use CounterGroupBase

Package
Description

org.apache.hadoop.mapred

org.apache.hadoop.mapreduce

org.apache.hadoop.mapreduce.counters

This package contains the implementations of different types of
 map-reduce counters.

org.apache.hadoop.mapreduce.util

Uses of CounterGroupBase in org.apache.hadoop.mapred

Classes in org.apache.hadoop.mapred that implement CounterGroupBase

Modifier and Type
Class and Description

static class
Counters.Group

Group of counters, comprising of counters from a particular
  counter Enum class.

Methods in org.apache.hadoop.mapred that return CounterGroupBase

Modifier and Type
Method and Description

CounterGroupBase<Counters.Counter>
Counters.Group.getUnderlyingGroup()

Methods in org.apache.hadoop.mapred with parameters of type CounterGroupBase

Modifier and Type
Method and Description

void
Counters.Group.incrAllCounters(CounterGroupBase<Counters.Counter> rightGroup)

Uses of CounterGroupBase in org.apache.hadoop.mapreduce

Subinterfaces of CounterGroupBase in org.apache.hadoop.mapreduce

Modifier and Type
Interface and Description

interface
CounterGroup

A group of Counters that logically belong together.

Uses of CounterGroupBase in org.apache.hadoop.mapreduce.counters

Classes in org.apache.hadoop.mapreduce.counters with type parameters of type CounterGroupBase

Modifier and Type
Class and Description

class
AbstractCounters<C extends Counter,G extends CounterGroupBase<C>>

An abstract class to provide common implementation for the Counters
 container in both mapred and mapreduce packages.

class
CounterGroupFactory<C extends Counter,G extends CounterGroupBase<C>>

An abstract class to provide common implementation of the
 group factory in both mapred and mapreduce packages.

Classes in org.apache.hadoop.mapreduce.counters that implement CounterGroupBase

Modifier and Type
Class and Description

class
AbstractCounterGroup<T extends Counter>

An abstract class to provide common implementation of the
 generic counter group in both mapred and mapreduce package.

class
FileSystemCounterGroup<C extends Counter>

An abstract class to provide common implementation of the filesystem
 counter group in both mapred and mapreduce packages.

class
FrameworkCounterGroup<T extends Enum<T>,C extends Counter>

An abstract class to provide common implementation for the framework
 counter group in both mapred and mapreduce packages.

Methods in org.apache.hadoop.mapreduce.counters that return CounterGroupBase

Modifier and Type
Method and Description

CounterGroupBase<T>
CounterGroupBase.getUnderlyingGroup()

Methods in org.apache.hadoop.mapreduce.counters with parameters of type CounterGroupBase

Modifier and Type
Method and Description

void
FileSystemCounterGroup.incrAllCounters(CounterGroupBase<C> other)

void
FrameworkCounterGroup.incrAllCounters(CounterGroupBase<C> other)

void
AbstractCounterGroup.incrAllCounters(CounterGroupBase<T> rightGroup)

void
CounterGroupBase.incrAllCounters(CounterGroupBase<T> rightGroup)

Increment all counters by a group of counters

Uses of CounterGroupBase in org.apache.hadoop.mapreduce.util

Methods in org.apache.hadoop.mapreduce.util with type parameters of type CounterGroupBase

Modifier and Type
Method and Description

static <C extends Counter,G extends CounterGroupBase<C>,T extends AbstractCounters<C,G>>
T
CountersStrings.parseEscapedCompactString(String compactString,
                         T counters)

Parse a pre 0.21 counters string into a counter object.

static <G extends CounterGroupBase<?>>
String
CountersStrings.toEscapedCompactString(G group)

Make the 0.21 counter group string.

static <C extends Counter,G extends CounterGroupBase<C>,T extends AbstractCounters<C,G>>
String
CountersStrings.toEscapedCompactString(T counters)

Make the pre 0.21 counters string

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV

NEXT

FRAMES

NO FRAMES

All Classes

Copyright © 2013 Apache Software Foundation. All Rights Reserved.


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
define([
   "ace",
   "js-mode",
   "backbone",
   "ace/ext/searchbox"
],
function(
    ace
){
    var Editor={};
    Editor.AceView = Backbone.View.extend({
		events:{
			"change":"handleEditorChange"
		},
		initialize:function(options){
			_.bindAll(this,'handleEditorChange');
            options = options || {};
            this.keyName=options.keyName;
			this.readOnly=(options.readOnly?options.readOnly:false);
			this.hasRendered=false;
			this.hasReset=false;
			this.listenTo(this.model,"change:"+options.keyName,this.render);
			//this.listenTo(this.model,"reset",this.handleReset);
			this.model.bind("reset",this.handleReset);
            if(!_.isUndefined(options.css)){
                this.$el.css(options.css);
            }
		},
		handleEditorChange:function(event){
			this.model.set(this.keyName, this.views.editor.session.getValue(),{silent:true});
			if(this.hasReset){
				this.model.trigger("user_edit");
			}
            else{
                this.views.editor.resize();
            }
		},
		handleReset:function(event){
			this.views.editor.session.setValue(this.model.get(this.keyName));
			this.hasReset=true;
		},
		render:function(){
			this.views={
				editor: ace.edit(this.el)
			};
			//this.views.editor.setTheme("ace/theme/xcode");
			if(this.readOnly){
				this.views.editor.setReadOnly(this.readOnly);
			}
			this.views.editor.setShowPrintMargin(false);
            this.views.editor.getSession().setUseWorker(false);
            this.views.editor.getSession().setOption('useSoftTabs',true);
			this.views.editor.getSession().setMode("ace/mode/javascript");
			this.views.editor.getSession().on("change",this.handleEditorChange);
			this.views.editor.session.setValue(this.model.get(this.keyName));
			this.hasRendered=true;
            this.views.editor.resize();
			return this;
		},
		handleChange:function(event){
			this.views.editor.session.setValue(this.model.get(this.keyName));
		},
		close:function(){
			this.stopListening();
			this.$el.remove();
			return this;
		}
    });
    return Editor;
});


text:
package NCIP::Item::BibliographicDescription;

use parent qw(Class::Accessor);

=head1 NAME

BibliographicDescription - As defined in z39.83-1-2012

=head1 SYNOPSIS

=head1 DESCRIPTION

=head1 FIELDS

=head2 Author

Optional text string for the name of person or corporate body
responsible for the intellectual or artistic content of an Item,
including composers, creators, or originators of an Item.

=head2 AuthorOfComponent

Optional text string for the name of the author of a bibliographic
item that is a component part of another item.

=head2 BibliographicItemId

Optional NCIP::Item::BibliographicItemId object.

=head2 BibliographicRecordId

Optional NCIP::Item::BibliographicRecordId object.

=head2 ComponentId

Optional NCIP::Item::ComponentId object.

=head2 Edition

Optional text string for the edition statement that identifies all the
copies of an item produced from one master copy or substantially the
same type image, having the same contents, and, in the case of
non-book materials, issued by a particular publishing agency or group
of such agencies.

=head2 Pagination

Optional text string that gives number of pages or leaves in an item
or a component part of an item.

=head2 PlaceOfPublication

Optional text string that gives geographic location of the publisher,
or failing this, of the printer, distributor, or manufacturer.

=head2 PublicationDate

Optional text string that gives date of issue of an item as designated
by the publisher.

=head2 PublicationDateOfComponent

Optional text string that gives publication date assigned by the
publisher to the component of an item.

=head2 Publisher

Optional text string to indicate the name of the publisher of an item.

=head2 SeriesTitleNumber

Optional text string representing the name given to a group of
separate publications related to one another by the fact that each
bears a collective title applying to the group or subgroup as a whole
as well as its own title, and the number within that series assigned
to one of the pieces.

=head2 Title

Optional text giving the title of the item.

=head2 TitleOfComponent

Optional text string for the title of an item that is a component part
of another item, such as a chapter of a book, or a journal article,
etc.

=head2 BibliographicLevel

Optional text string for the bibliographic description of the item:
monograph, serial, collection.

=head2 SponsoringBody

Optional text string for the name of the body sponsoring the work.

=head2 ElectronicDataFormatType

Option text string identifying the format of electronic data: tiff,
rtf, jpeg, mpeg, etc.

=head2 Language

Optional text string that identifies the language of the item.

=head2 MediumType

Optional text string for the medium on the item has been produced:
audio tape, book, machine-readable computer file, compact disc, etc.

=cut

NCIP::Item::BibliographicDescription->mk_accessors(
    qw(
          Author
          AuthorOfComponent
          BibliographicItemId
          BibliographicRecordId
          ComponentId
          Edition
          Pagination
          PlaceOfPublication
          PublicationDate
          PublicationDateOfComponent
          Publisher
          SeriesTitleNumber
          Title
          TitleOfComponent
          BibliographicLevel
          SponsoringBody
          ElectronicDataFormatType
          Language
          MediumType
      )
);

1;


text:
git_repository="/opt/repositories/blog.git/"

# output directory and filename
output_dir="/opt/wiki/data/pages/external"
output_file="git_blog_scheduled.txt"
output="${output_dir}/${output_file}"

# header title
header_title="Scheduled blog posts"

# limit the number of posts to check to a third for increased performance
n_posts=$(git --git-dir="${git_repository}" ls-tree HEAD _posts --name-only -r | wc -l)
n_posts_to_check=$(( n_posts / 3 ))

echo "==== ${header_title} ====" | tee $output >/dev/null
posts=$(git --git-dir="${git_repository}" ls-tree HEAD _posts --name-only -r | sort | tail -${n_posts_to_check})
for post in $posts; do
  date=$(echo $post | sed "s/\_posts\/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1-\2-\3/")
  date_s=$(date -d ${date} +%s)
  now_s=$(date -d now +%s)
  date_diff=$(( (date_s - now_s) / 86400 ))
  if [ "$date_diff" -ge "0" ]; then
    title=$(git --git-dir="${git_repository}" show HEAD:${post} | grep ^title: |  awk -F ": " '{print $2}')
    echo "  * **$date** \\\\  //$title//" | tee -a $output >/dev/null
  fi
done


text:
<?php

use PHPAST\AddOp;
use PHPAST\Integer;

class AddOpTest extends NodeTest {

	public function createNode($label = NULL) {
		return new AddOp($this->getMockLiteral(1),
		                 $this->getMockLiteral(1),
		                 $label);
	}

	public function testEvaluate() {
		$op = new AddOp($this->getMockLiteral(1), $this->getMockLiteral(2));
		$res = $op->evaluate($this->getMockSymbolTable());
		$this->assertEquals(3, (string)$res);
	}

	public function testToString() {
		$op = new AddOp($this->getMockLiteral(1), $this->getMockLiteral(2));
		$this->assertEquals("(1 + 2)", (string)$op);
	}
}


text:
using System;
using System.Text;
using System.Web.Mvc;
using Forloop.HtmlHelpers;

namespace CustomHtmlHelpers
{
    public static class RequireJSHelper
    {
        /// <summary>
        /// Returns a javascript function that will initialize a given module.  Builds view model and initializes it
        /// </summary>
        /// <param name="helper">override helper</param>
        /// <param name="module">view model to initialize</param>
        /// <param name="bindControlName">html control to bind view model to (knockout js)</param>
        /// <param name="dependencies">modules for requirejs to load that the view is dependant on</param>
        /// <returns></returns>
        public static void AddInitRequireJSModule(this HtmlHelper helper, string module, string bindControlName, string[] dependencies = null)
        {
            var script = new StringBuilder();
            var depString = new StringBuilder();
            if (dependencies != null)
            {
                foreach (var dependency in dependencies)
                {
                    depString.AppendFormat("\"{0}\",", dependency);
                }
            }

            script.AppendFormat("   require([{0} \"domReady!\"],{1}", depString, Environment.NewLine);
            script.AppendLine("       function(){");
            script.AppendFormat("           require([\"{0}\"]{1},", module, Environment.NewLine);
            script.AppendLine("                 function (Module) {");
            script.AppendFormat("                   var bindCt = document.getElementById(\"{0}\");{1}", bindControlName, Environment.NewLine);
            script.AppendLine("                     var viewModel = new Module();");
            script.AppendLine("                     viewModel.init(bindCt);");
            script.AppendLine("                 }");
            script.AppendLine("             );");
            script.AppendLine("         }");
            script.AppendLine("     );");

            helper.AddScriptBlock(script.ToString());
        }
    }
}


text:
@echo off

rm -r .\platforms\android\assets\www
mkdir .\platforms\android\assets\www
xcopy /e /y www .\platforms\android\assets\www

call .\platforms\android\cordova\build --release
"%JAVA_HOME%\bin\jarsigner" -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore keystore .\platforms\android\bin\Malifaux-release-unsigned.apk "malifaux models"
"%ANDROID_HOME%\build-tools\android-4.4W\zipalign" -v -f 4 .\platforms\android\bin\Malifaux-release-unsigned.apk MalifauxModels.apk

echo .
echo Try the short pw.
echo !!! Remember to change platforms\Android\AndroidManifest.xml


text:
#ifndef __LuceneKit_Index__
#define __LuceneKit_Index__

#include "LCCompoundFileReader.h"
#include "LCCompoundFileWriter.h"
#include "LCDocumentWriter.h"
#include "LCFieldInfo.h"
#include "LCFieldInfos.h"
#include "LCFieldsReader.h"
#include "LCFieldsWriter.h"
#include "LCFilterIndexReader.h"
#include "LCIndexModifier.h"
#include "LCIndexReader.h"
#include "LCIndexWriter.h"
#include "LCMultipleTermPositions.h"
#include "LCMultiReader.h"
#include "LCSegmentInfo.h"
#include "LCSegmentInfos.h"
#include "LCSegmentMergeInfo.h"
#include "LCSegmentMergeQueue.h"
#include "LCSegmentMerger.h"
#include "LCSegmentReader.h"
#include "LCSegmentTermDocs.h"
#include "LCSegmentTermEnum.h"
#include "LCSegmentTermPositions.h"
#include "LCSegmentTermPositionVector.h"
#include "LCSegmentTermVector.h"
#include "LCTerm.h"
#include "LCTermBuffer.h"
#include "LCTermDocs.h"
#include "LCTermEnum.h"
#include "LCTermFreqVector.h"
#include "LCTermInfo.h"
#include "LCTermInfosReader.h"
#include "LCTermInfosWriter.h"
#include "LCTermPositions.h"
#include "LCTermPositionVector.h"
#include "LCTermVectorOffsetInfo.h"
#include "LCTermVectorsReader.h"
#include "LCTermVectorsWriter.h"

#endif /* __LuceneKit_Index__ */


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>N-Index</title>
<meta name="date" content="2015-11-04">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I L M N O P Q R S T U V W Y

N

navigationContentDescription - Static variable in class com.example.qyu4.theallswap.R.attr

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.

navigationIcon - Static variable in class com.example.qyu4.theallswap.R.attr

Must be a reference to another resource, in the form "@[+][package:]type:name"
or to a theme attribute in the form "?[package:][type:]name".

navigationMode - Static variable in class com.example.qyu4.theallswap.R.attr

Must be one of the following constant values.

never - Static variable in class com.example.qyu4.theallswap.R.id

new_item_category - Static variable in class com.example.qyu4.theallswap.R.string

new_item_category_spinner - Static variable in class com.example.qyu4.theallswap.R.id

new_item_comment - Static variable in class com.example.qyu4.theallswap.R.string

new_item_name - Static variable in class com.example.qyu4.theallswap.R.id

new_item_name - Static variable in class com.example.qyu4.theallswap.R.string

new_item_privacy - Static variable in class com.example.qyu4.theallswap.R.string

new_item_quality - Static variable in class com.example.qyu4.theallswap.R.id

new_item_quality - Static variable in class com.example.qyu4.theallswap.R.string

new_item_quantity - Static variable in class com.example.qyu4.theallswap.R.id

new_item_quantity - Static variable in class com.example.qyu4.theallswap.R.string

new_patient_id_label - Static variable in class com.example.qyu4.theallswap.R.id

new_user_city - Static variable in class com.example.qyu4.theallswap.R.id

new_user_email - Static variable in class com.example.qyu4.theallswap.R.id

no - Static variable in class com.example.qyu4.theallswap.R.string

none - Static variable in class com.example.qyu4.theallswap.R.id

normal - Static variable in class com.example.qyu4.theallswap.R.id

notification_large_icon_height - Static variable in class com.example.qyu4.theallswap.R.dimen

notification_large_icon_width - Static variable in class com.example.qyu4.theallswap.R.dimen

notification_media_action - Static variable in class com.example.qyu4.theallswap.R.layout

notification_media_cancel_action - Static variable in class com.example.qyu4.theallswap.R.layout

notification_subtext_size - Static variable in class com.example.qyu4.theallswap.R.dimen

notification_template_big_media - Static variable in class com.example.qyu4.theallswap.R.layout

notification_template_big_media_narrow - Static variable in class com.example.qyu4.theallswap.R.layout

notification_template_icon_bg - Static variable in class com.example.qyu4.theallswap.R.drawable

notification_template_lines - Static variable in class com.example.qyu4.theallswap.R.layout

notification_template_media - Static variable in class com.example.qyu4.theallswap.R.layout

notification_template_part_chronometer - Static variable in class com.example.qyu4.theallswap.R.layout

notification_template_part_time - Static variable in class com.example.qyu4.theallswap.R.layout

A B C D E F G H I L M N O P Q R S T U V W Y

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
import { NgModule } from '@angular/core';
import { BotaoComponent } from './botao.component';

@NgModule({
  declarations: [ BotaoComponent ],
  exports: [ BotaoComponent]
})
export class BotaoModule{}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Cassia lentiscifolia Benth.

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><modules>
    <module active="true">
    	<id>0</id>
    	<class>CalculatorModule</class></module>
    <module active="true">
    	<id>1</id>
    	<class>FileSearchModule</class>
    	<exceptions>
        	<exception>0</exception>
        	<exception>3</exception>
        	<exception>4</exception>
        	<exception>5</exception>
        </exceptions>
    </module>
    <module active="true">
    	<id>2</id>
        <class>GoogleSearchModule</class>
        <exceptions>
        	<exception>0</exception>
        	<exception>3</exception>
        	<exception>4</exception>
        	<exception>5</exception>
        </exceptions>
    </module>
    <module active="true">
    	<id>3</id>
        <class>WeatherModule</class>
    <properties><city pref="true">Bremen</city></properties></module>
    <module active="true">
    	<id>4</id>
        <class>TranslateModule</class>
        <properties><defaultSrcLanguage pref="true">eng</defaultSrcLanguage></properties>
    </module>
    <module active="true">
    	<id>5</id>
    	<class>WebSearchModule</class>
    </module>
</modules>


text:
<!DOCTYPE html>

	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
	<meta content="IE=edge" http-equiv="X-UA-Compatible" />
	<meta content="width=device-width, initial-scale=1" name="viewport" />
	<meta content="This is my one page resume website." name="description" />
	<meta content="Vipul,Vipul Munot,Munot,Indiana University,Indiana, Indiana University Bloomington,Bloomington,Data Science, Data, Scientist,Data Scientist" name="keywords" />
	<meta content="Vipul Munot" name="author" />
	<title>Login | Eventpal</title>

	<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
	<link href="fonts/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
	<link href="css/animate.min.css" rel="stylesheet" type="text/css" />

	<link href="css/style.css" rel="stylesheet" />
	<link href="css/form_style.css" rel="stylesheet" />

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            Toggle navigation

          </button>
          Eventpal

Sign Up

Log In

          <form action="signup.php" method="post">

              <input type="text" name="fname" placeholder="First Name*" required autocomplete="off" />

              <input type="text" name="lname" placeholder="Last Name*" required autocomplete="off"/>

            <input type="email" name="reg_email" placeholder="Email Address*" required autocomplete="off"/>

            <input type="password" placeholder="Set A Password*" name = "password" required autocomplete="off"/>

            <input type="text" placeholder="Phone" name = "phone"/>

            <input type="text"name = "city" placeholder="City"/>

            <input type="text"name = "state" placeholder="State"/>

            <select id="country" name="country" class="dropdown" required >
                           <option value ="" selected>Country*</option>
                            <option value="AF">Afghanistan</option>
                            <option value="AL">Albania</option>
                            <option value="DZ">Algeria</option>
                            <option value="AS">American Samoa</option>
                            <option value="AD">Andorra</option>
                            <option value="AO">Angola</option>
                            <option value="AI">Anguilla</option>
                            <option value="AQ">Antarctica</option>
                            <option value="AG">Antigua and Barbuda</option>
                            <option value="AR">Argentina</option>
                            <option value="AM">Armenia</option>
                            <option value="AW">Aruba</option>
                            <option value="AU">Australia</option>
                            <option value="AT">Austria</option>
                            <option value="AZ">Azerbaijan</option>
                            <option value="BS">Bahamas</option>
                            <option value="BH">Bahrain</option>
                            <option value="BD">Bangladesh</option>
                            <option value="BB">Barbados</option>
                            <option value="BY">Belarus</option>
                            <option value="BE">Belgium</option>
                            <option value="BZ">Belize</option>
                            <option value="BJ">Benin</option>
                            <option value="BM">Bermuda</option>
                            <option value="BT">Bhutan</option>
                            <option value="BO">Bolivia</option>
                            <option value="BA">Bosnia and Herzegowina</option>
                            <option value="BW">Botswana</option>
                            <option value="BV">Bouvet Island</option>
                            <option value="BR">Brazil</option>
                            <option value="IO">British Indian Ocean Territory</option>
                            <option value="BN">Brunei Darussalam</option>
                            <option value="BG">Bulgaria</option>
                            <option value="BF">Burkina Faso</option>
                            <option value="BI">Burundi</option>
                            <option value="KH">Cambodia</option>
                            <option value="CM">Cameroon</option>
                            <option value="CA">Canada</option>
                            <option value="CV">Cape Verde</option>
                            <option value="KY">Cayman Islands</option>
                            <option value="CF">Central African Republic</option>
                            <option value="TD">Chad</option>
                            <option value="CL">Chile</option>
                            <option value="CN">China</option>
                            <option value="CX">Christmas Island</option>
                            <option value="CC">Cocos (Keeling) Islands</option>
                            <option value="CO">Colombia</option>
                            <option value="KM">Comoros</option>
                            <option value="CG">Congo</option>
                            <option value="CD">Congo, the Democratic Republic of the</option>
                            <option value="CK">Cook Islands</option>
                            <option value="CR">Costa Rica</option>
                            <option value="CI">Cote d'Ivoire</option>
                            <option value="HR">Croatia (Hrvatska)</option>
                            <option value="CU">Cuba</option>
                            <option value="CY">Cyprus</option>
                            <option value="CZ">Czech Republic</option>
                            <option value="DK">Denmark</option>
                            <option value="DJ">Djibouti</option>
                            <option value="DM">Dominica</option>
                            <option value="DO">Dominican Republic</option>
                            <option value="TP">East Timor</option>
                            <option value="EC">Ecuador</option>
                            <option value="EG">Egypt</option>
                            <option value="SV">El Salvador</option>
                            <option value="GQ">Equatorial Guinea</option>
                            <option value="ER">Eritrea</option>
                            <option value="EE">Estonia</option>
                            <option value="ET">Ethiopia</option>
                            <option value="FK">Falkland Islands (Malvinas)</option>
                            <option value="FO">Faroe Islands</option>
                            <option value="FJ">Fiji</option>
                            <option value="FI">Finland</option>
                            <option value="FR">France</option>
                            <option value="FX">France, Metropolitan</option>
                            <option value="GF">French Guiana</option>
                            <option value="PF">French Polynesia</option>
                            <option value="TF">French Southern Territories</option>
                            <option value="GA">Gabon</option>
                            <option value="GM">Gambia</option>
                            <option value="GE">Georgia</option>
                            <option value="DE">Germany</option>
                            <option value="GH">Ghana</option>
                            <option value="GI">Gibraltar</option>
                            <option value="GR">Greece</option>
                            <option value="GL">Greenland</option>
                            <option value="GD">Grenada</option>
                            <option value="GP">Guadeloupe</option>
                            <option value="GU">Guam</option>
                            <option value="GT">Guatemala</option>
                            <option value="GN">Guinea</option>
                            <option value="GW">Guinea-Bissau</option>
                            <option value="GY">Guyana</option>
                            <option value="HT">Haiti</option>
                            <option value="HM">Heard and Mc Donald Islands</option>
                            <option value="VA">Holy See (Vatican City State)</option>
                            <option value="HN">Honduras</option>
                            <option value="HK">Hong Kong</option>
                            <option value="HU">Hungary</option>
                            <option value="IS">Iceland</option>
                            <option value="IN">India</option>
                            <option value="ID">Indonesia</option>
                            <option value="IR">Iran (Islamic Republic of)</option>
                            <option value="IQ">Iraq</option>
                            <option value="IE">Ireland</option>
                            <option value="IL">Israel</option>
                            <option value="IT">Italy</option>
                            <option value="JM">Jamaica</option>
                            <option value="JP">Japan</option>
                            <option value="JO">Jordan</option>
                            <option value="KZ">Kazakhstan</option>
                            <option value="KE">Kenya</option>
                            <option value="KI">Kiribati</option>
                            <option value="KP">Korea, Democratic People's Republic of</option>
                            <option value="KR">Korea, Republic of</option>
                            <option value="KW">Kuwait</option>
                            <option value="KG">Kyrgyzstan</option>
                            <option value="LA">Lao People's Democratic Republic</option>
                            <option value="LV">Latvia</option>
                            <option value="LB">Lebanon</option>
                            <option value="LS">Lesotho</option>
                            <option value="LR">Liberia</option>
                            <option value="LY">Libyan Arab Jamahiriya</option>
                            <option value="LI">Liechtenstein</option>
                            <option value="LT">Lithuania</option>
                            <option value="LU">Luxembourg</option>
                            <option value="MO">Macau</option>
                            <option value="MK">Macedonia, The Former Yugoslav Republic of</option>
                            <option value="MG">Madagascar</option>
                            <option value="MW">Malawi</option>
                            <option value="MY">Malaysia</option>
                            <option value="MV">Maldives</option>
                            <option value="ML">Mali</option>
                            <option value="MT">Malta</option>
                            <option value="MH">Marshall Islands</option>
                            <option value="MQ">Martinique</option>
                            <option value="MR">Mauritania</option>
                            <option value="MU">Mauritius</option>
                            <option value="YT">Mayotte</option>
                            <option value="MX">Mexico</option>
                            <option value="FM">Micronesia, Federated States of</option>
                            <option value="MD">Moldova, Republic of</option>
                            <option value="MC">Monaco</option>
                            <option value="MN">Mongolia</option>
                            <option value="MS">Montserrat</option>
                            <option value="MA">Morocco</option>
                            <option value="MZ">Mozambique</option>
                            <option value="MM">Myanmar</option>
                            <option value="NA">Namibia</option>
                            <option value="NR">Nauru</option>
                            <option value="NP">Nepal</option>
                            <option value="NL">Netherlands</option>
                            <option value="AN">Netherlands Antilles</option>
                            <option value="NC">New Caledonia</option>
                            <option value="NZ">New Zealand</option>
                            <option value="NI">Nicaragua</option>
                            <option value="NE">Niger</option>
                            <option value="NG">Nigeria</option>
                            <option value="NU">Niue</option>
                            <option value="NF">Norfolk Island</option>
                            <option value="MP">Northern Mariana Islands</option>
                            <option value="NO">Norway</option>
                            <option value="OM">Oman</option>
                            <option value="PK">Pakistan</option>
                            <option value="PW">Palau</option>
                            <option value="PA">Panama</option>
                            <option value="PG">Papua New Guinea</option>
                            <option value="PY">Paraguay</option>
                            <option value="PE">Peru</option>
                            <option value="PH">Philippines</option>
                            <option value="PN">Pitcairn</option>
                            <option value="PL">Poland</option>
                            <option value="PT">Portugal</option>
                            <option value="PR">Puerto Rico</option>
                            <option value="QA">Qatar</option>
                            <option value="RE">Reunion</option>
                            <option value="RO">Romania</option>
                            <option value="RU">Russian Federation</option>
                            <option value="RW">Rwanda</option>
                            <option value="KN">Saint Kitts and Nevis</option>
                            <option value="LC">Saint LUCIA</option>
                            <option value="VC">Saint Vincent and the Grenadines</option>
                            <option value="WS">Samoa</option>
                            <option value="SM">San Marino</option>
                            <option value="ST">Sao Tome and Principe</option>
                            <option value="SA">Saudi Arabia</option>
                            <option value="SN">Senegal</option>
                            <option value="SC">Seychelles</option>
                            <option value="SL">Sierra Leone</option>
                            <option value="SG">Singapore</option>
                            <option value="SK">Slovakia (Slovak Republic)</option>
                            <option value="SI">Slovenia</option>
                            <option value="SB">Solomon Islands</option>
                            <option value="SO">Somalia</option>
                            <option value="ZA">South Africa</option>
                            <option value="GS">South Georgia and the South Sandwich Islands</option>
                            <option value="ES">Spain</option>
                            <option value="LK">Sri Lanka</option>
                            <option value="SH">St. Helena</option>
                            <option value="PM">St. Pierre and Miquelon</option>
                            <option value="SD">Sudan</option>
                            <option value="SR">Suriname</option>
                            <option value="SJ">Svalbard and Jan Mayen Islands</option>
                            <option value="SZ">Swaziland</option>
                            <option value="SE">Sweden</option>
                            <option value="CH">Switzerland</option>
                            <option value="SY">Syrian Arab Republic</option>
                            <option value="TW">Taiwan, Province of China</option>
                            <option value="TJ">Tajikistan</option>
                            <option value="TZ">Tanzania, United Republic of</option>
                            <option value="TH">Thailand</option>
                            <option value="TG">Togo</option>
                            <option value="TK">Tokelau</option>
                            <option value="TO">Tonga</option>
                            <option value="TT">Trinidad and Tobago</option>
                            <option value="TN">Tunisia</option>
                            <option value="TR">Turkey</option>
                            <option value="TM">Turkmenistan</option>
                            <option value="TC">Turks and Caicos Islands</option>
                            <option value="TV">Tuvalu</option>
                            <option value="UG">Uganda</option>
                            <option value="UA">Ukraine</option>
                            <option value="AE">United Arab Emirates</option>
                            <option value="GB">United Kingdom</option>
                            <option value="US">United States</option>
                            <option value="UM">United States Minor Outlying Islands</option>
                            <option value="UY">Uruguay</option>
                            <option value="UZ">Uzbekistan</option>
                            <option value="VU">Vanuatu</option>
                            <option value="VE">Venezuela</option>
                            <option value="VN">Viet Nam</option>
                            <option value="VG">Virgin Islands (British)</option>
                            <option value="VI">Virgin Islands (U.S.)</option>
                            <option value="WF">Wallis and Futuna Islands</option>
                            <option value="EH">Western Sahara</option>
                            <option value="YE">Yemen</option>
                            <option value="YU">Yugoslavia</option>
                            <option value="ZM">Zambia</option>
                            <option value="ZW">Zimbabwe</option>
                        </select>

            <input type="text" placeholder="Zip-Code*" name="zip"required/>

          <button type="submit" class="button button-block" name="register_button">Get Started</button>
          </form>

Welcome Back!

          <form action="login.php" method="post" style="height:auto" class="form1">

              Email Address*

            <input type="email" required name="log_email" autocomplete="off"/>

              Password*

            <input type="password" required name="pwd" autocomplete="off"/>

Forgot Password?

          <button class="button button-block">Log In</button>

          </form>


text:
using System.Diagnostics.CodeAnalysis;

namespace System.Collections
{
    internal static class HashtableExtensions
    {
        public static bool TryGetValue<T>(this Hashtable table, object key, [MaybeNull] out T value)
        {
            if (table.ContainsKey(key))
            {
                value = (T)table[key]!;
                return true;
            }
            value = default!;
            return false;
        }
    }
}


text:
package hell.Factory;

import hell.entities.items.CommonItem;
import hell.entities.items.RecipeItem;
import hell.interfaces.Item;
import hell.interfaces.Recipe;

import java.util.List;

public final class ItemFactory {
    private ItemFactory() {
    }

    public static Item createCommonItem(String name, int strengthBonus, int agilityBonus,
                                        int intelligenceBonus, int hitPointsBonus, int damageBonus) {

        Item commonItem = new CommonItem(name, strengthBonus, agilityBonus,
                intelligenceBonus, hitPointsBonus, damageBonus);

        return commonItem;
    }

    public static Recipe createRecipeItem(String name, int strengthBonus, int agilityBonus, int intelligenceBonus,
                                          int hitPointsBonus, int damageBonus, List<String> requiredItems) {

        Recipe reicpeItem = new RecipeItem(name, strengthBonus, agilityBonus,
                intelligenceBonus, hitPointsBonus, damageBonus, requiredItems);

        return reicpeItem;
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Method. Lich. 55 (1803)

#### Original name
Lecidea pruinosa Ach.

### Remarks
null


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/action_menu_platform"
        android:orderInCategory="0"
        android:title="@string/action_menu_platform_title"
        app:showAsAction="never" />
    <item
        android:id="@+id/action_menu_language"
        android:orderInCategory="1"
        android:title="@string/action_menu_language_title"
        app:showAsAction="never" />
</menu>


text:
package org.apache.xbean.command;

import java.io.InputStream;
import java.io.PrintStream;

public class Exit implements Command {

    public static void register() {
        CommandRegistry.register("exit", Exit.class);
    }

    public int main(String[] args, InputStream in, PrintStream out) {
        throw new UnsupportedOperationException();
    }
}


text:
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
 */
class BunqResponseCardCredit extends BunqResponse
{
    /**
     * @return CardCredit
     */
    public function getValue(): CardCredit
    {
        return parent::getValue();
    }
}


text: mp_obj_t microbit_repeat_iterator(mp_obj_t iterable);


text:
import java.util.*;

class Test {

    public void foo(ArrayList<Integer> integerArrayList, ArrayList<Integer> integers, ArrayList<Integer> l, ArrayList<Integer> l1) {}

    {
      foo(new ArrayList<Integer>(), new ArrayList<Integer>(), new ArrayList<Integer>(), new ArrayList<Integer>());
    }
}


text:
<?php

namespace Liip\RMT\Tests\Unit\Version;

use Liip\RMT\VCS\Hg;

class HgTest extends \PHPUnit_Framework_TestCase
{
    protected $testDir;

    protected function setUp()
    {
        // Create a temp folder and extract inside the Hg test folder
        $tempDir = tempnam(sys_get_temp_dir(),'');
        if (file_exists($tempDir)) {
            unlink($tempDir);
        }
        mkdir($tempDir);
        chdir($tempDir);
        exec('unzip '.__DIR__.'/HgRepo.zip');
        exec('hg update');
        $this->testDir = $tempDir;
    }

    public function testGetAllModificationsSince()
    {
        $vcs = new Hg();
        $modifs = $vcs->getAllModificationsSince('1.1.0');
        $this->assertContains("Add a third file", $modifs[0]);
        $this->assertContains("Modification of the first file", $modifs[1]);
    }

    public function testGetModifiedFilesSince() {
        $vcs = new Hg();
        $files = $vcs->getModifiedFilesSince('1.1.0');
        $this->assertEquals(array("file1" => "M", "file3" => "A", ".hgtags" => "M"), $files);
    }

    public function testGetLocalModifications()
    {
        $vcs = new Hg();
        exec('touch foo');
        $modifs = $vcs->getLocalModifications();
        $this->assertContains('foo', implode($modifs));
    }

    public function testGetTags()
    {
        $vcs = new Hg();
        $this->assertEquals(array("tip", "1.1.0","1.0.0"), $vcs->getTags());
    }

    public function testCreateTag()
    {
        $vcs = new Hg();
        $vcs->createTag('2.0.0');
        $this->assertEquals(array("tip","2.0.0","1.1.0", "1.0.0"), $vcs->getTags());
    }

    public function testSaveWorkingCopy()
    {
        $vcs = new Hg();
        $vcs->createTag('2.0.0');
        $this->assertCount(1, $vcs->getAllModificationsSince('2.0.0'));
        exec('rm file2');
        $vcs->saveWorkingCopy('Remove the second file');
        $this->assertCount(2,$vcs->getAllModificationsSince('2.0.0'));
    }

    public function testGetCurrentBranch()
    {
        $vcs = new Hg();
        $this->assertEquals('default', $vcs->getCurrentBranch());
        system("hg branch -q foo");
        $this->assertEquals('foo', $vcs->getCurrentBranch());
        exec("hg update -q default");
        $this->assertEquals('default', $vcs->getCurrentBranch());
    }

    protected function tearDown()
    {
        // Remove the test folder
        // exec('rm -rf '.$this->testDir);
        chdir(__DIR__);
    }

}


text:
@implementation AKCascadingStyleAppDelegate

@synthesize window = _window;
@synthesize navigationController = _navigationController;

#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
	[self.window addSubview:self.navigationController.view];
    [self.window makeKeyAndVisible];
	return YES;
}

- (void)applicationWillTerminate:(UIApplication *)application
{
}

#pragma mark -
#pragma mark Memory management

- (void)dealloc
{
	[self.navigationController release];
	[self.window release];
	[super dealloc];
}

@end


text:
@class DVTFilePathFieldCell, NSString;

@protocol DVTFilePathFieldCellDelegate

@optional
- (NSString *)DVTFilePathFieldCell:(DVTFilePathFieldCell *)arg1 resolvedPathForPath:(NSString *)arg2;
- (void)DVTFilePathFieldCell:(DVTFilePathFieldCell *)arg1 chooserSelectedPath:(NSString *)arg2;
@end


text:
:orphan:

Report Format
=============

A directory with the sample report format is available on github at:

* https://github.com/cloudmesh/classes/tree/master/webpage/source/format/report

Please note that we may update this format and it will be in your responsibility to check if your report follows the format.

Once you copy  the content of this directory you can go to it and use the conveneint Makefile to create the report. THis assumes you have LaTeX installed.

Go into the shell and type::

  make

To view the report say::

  make view

A sample PDF report can be seen at:

* https://github.com/cloudmesh/classes/blob/master/webpage/source/format/report/report.pdf


text: HealthIT.gov


text:
Like Packages (kind of)

note:
    Great way to break your app up into reusable pieces

    Fine to have a 'common' one also, as a catch-all

    But make an effort to keep things sane, lest it get out of hand


text:
package org.apache.polygene.library.rest.client;

import java.io.File;
import java.io.IOException;
import java.util.Collections;
import org.apache.polygene.api.common.Optional;
import org.apache.polygene.api.common.UseDefaults;
import org.apache.polygene.api.composite.TransientComposite;
import org.apache.polygene.api.constraint.Name;
import org.apache.polygene.api.injection.scope.Structure;
import org.apache.polygene.api.injection.scope.Uses;
import org.apache.polygene.api.property.Property;
import org.apache.polygene.api.structure.Application;
import org.apache.polygene.api.structure.ApplicationDescriptor;
import org.apache.polygene.api.structure.Module;
import org.apache.polygene.api.unitofwork.ConcurrentEntityModificationException;
import org.apache.polygene.api.unitofwork.UnitOfWorkCallback;
import org.apache.polygene.api.unitofwork.UnitOfWorkCompletionException;
import org.apache.polygene.api.unitofwork.UnitOfWorkFactory;
import org.apache.polygene.api.usecase.UsecaseBuilder;
import org.apache.polygene.api.value.ValueBuilder;
import org.apache.polygene.api.value.ValueBuilderFactory;
import org.apache.polygene.api.value.ValueComposite;
import org.apache.polygene.bootstrap.AssemblyException;
import org.apache.polygene.bootstrap.ModuleAssembly;
import org.apache.polygene.library.rest.client.api.ContextResourceClient;
import org.apache.polygene.library.rest.client.api.ContextResourceClientFactory;
import org.apache.polygene.library.rest.client.api.ErrorHandler;
import org.apache.polygene.library.rest.client.api.HandlerCommand;
import org.apache.polygene.library.rest.client.spi.ResponseHandler;
import org.apache.polygene.library.rest.client.spi.ResultHandler;
import org.apache.polygene.library.rest.common.Resource;
import org.apache.polygene.library.rest.common.ValueAssembler;
import org.apache.polygene.library.rest.common.link.Link;
import org.apache.polygene.library.rest.common.link.Links;
import org.apache.polygene.library.rest.common.link.LinksBuilder;
import org.apache.polygene.library.rest.common.link.LinksUtil;
import org.apache.polygene.library.rest.server.api.ContextResource;
import org.apache.polygene.library.rest.server.api.ContextRestlet;
import org.apache.polygene.library.rest.server.api.ObjectSelection;
import org.apache.polygene.library.rest.server.api.ResourceDelete;
import org.apache.polygene.library.rest.server.api.ResourceIndex;
import org.apache.polygene.library.rest.server.api.SubResource;
import org.apache.polygene.library.rest.server.api.SubResources;
import org.apache.polygene.library.rest.server.api.constraint.InteractionValidation;
import org.apache.polygene.library.rest.server.api.constraint.Requires;
import org.apache.polygene.library.rest.server.api.constraint.RequiresValid;
import org.apache.polygene.library.rest.server.api.dci.Role;
import org.apache.polygene.library.rest.server.assembler.RestServerAssembler;
import org.apache.polygene.library.rest.server.restlet.NullCommandResult;
import org.apache.polygene.library.rest.server.spi.CommandResult;
import org.apache.polygene.test.AbstractPolygeneTest;
import org.apache.polygene.test.util.FreePortFinder;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.restlet.Client;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.Server;
import org.restlet.Uniform;
import org.restlet.data.ChallengeScheme;
import org.restlet.data.Form;
import org.restlet.data.MediaType;
import org.restlet.data.Protocol;
import org.restlet.data.Reference;
import org.restlet.resource.ResourceException;
import org.restlet.security.ChallengeAuthenticator;
import org.restlet.security.MapVerifier;
import org.restlet.security.User;
import org.restlet.service.MetadataService;

import static org.apache.polygene.bootstrap.ImportedServiceDeclaration.NEW_OBJECT;
import static org.apache.polygene.library.rest.client.api.HandlerCommand.command;
import static org.apache.polygene.library.rest.client.api.HandlerCommand.query;
import static org.apache.polygene.library.rest.client.api.HandlerCommand.refresh;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsEqual.equalTo;

public class ContextResourceClientFactoryTest
    extends AbstractPolygeneTest
{
    private Server server;
    private ContextResourceClient crc;

    public static String command = null; // Commands will set this

    @Override
    public void assemble( ModuleAssembly module )
        throws AssemblyException
    {
        // General setup of client and server
        new ClientAssembler().assemble( module );
        new ValueAssembler().assemble( module );
        new RestServerAssembler().assemble( module );

        module.objects( NullCommandResult.class );
        module.importedServices( CommandResult.class ).importedBy( NEW_OBJECT );

        module.importedServices( MetadataService.class ).importedBy( NEW_OBJECT );
        module.objects( MetadataService.class );

        // Test specific setup
        module.values( TestQuery.class, TestResult.class, TestCommand.class );
        module.forMixin( TestQuery.class ).declareDefaults().abc().set( "def" );

        module.objects( RootRestlet.class, RootResource.class, RootContext.class, SubResource1.class, PagesResource.class );

        module.objects( DescribableContext.class );
        module.transients( TestComposite.class );

        module.defaultServices();
    }

    @Override
    protected void initApplication( Application app )
        throws Exception
    {
    }

    @BeforeEach
    public void startWebServer()
        throws Exception
    {
        int port = FreePortFinder.findFreePortOnLoopback();
        server = new Server( Protocol.HTTP, port );
        ContextRestlet restlet = objectFactory.newObject( ContextRestlet.class, new org.restlet.Context() );

        ChallengeAuthenticator guard = new ChallengeAuthenticator( null, ChallengeScheme.HTTP_BASIC, "testRealm" );
        MapVerifier mapVerifier = new MapVerifier();
        mapVerifier.getLocalSecrets().put( "rickard", "secret".toCharArray() );
        guard.setVerifier( mapVerifier );

        guard.setNext( restlet );

        server.setNext( guard );
        server.start();

        //START SNIPPET: client-create1
        Client client = new Client( Protocol.HTTP );

        ContextResourceClientFactory contextResourceClientFactory = objectFactory.newObject( ContextResourceClientFactory.class, client );
        contextResourceClientFactory.setAcceptedMediaTypes( MediaType.APPLICATION_JSON );
        //END SNIPPET: client-create1

        //START SNIPPET: client-create2
        contextResourceClientFactory.setErrorHandler( new ErrorHandler().onError( ErrorHandler.AUTHENTICATION_REQUIRED, new ResponseHandler()
        {
            boolean tried = false;

            @Override
            public HandlerCommand handleResponse( Response response, ContextResourceClient client )
            {
                if( tried )
                {
                    throw new ResourceException( response.getStatus() );
                }

                tried = true;
                client.getContextResourceClientFactory().getInfo().setUser( new User( "rickard", "secret" ) );

                // Try again
                return refresh();
            }
        } ).onError( ErrorHandler.RECOVERABLE_ERROR, new ResponseHandler()
        {
            @Override
            public HandlerCommand handleResponse( Response response, ContextResourceClient client )
            {
                // Try to restart
                return refresh();
            }
        } ) );
        //END SNIPPET: client-create2

        //START SNIPPET: client-create3
        Reference ref = new Reference( "http://localhost:" + port + '/' );
        crc = contextResourceClientFactory.newClient( ref );
        //END SNIPPET: client-create3
    }

    @AfterEach
    public void stopWebServer()
        throws Exception
    {
        server.stop();
    }

    @Override
    protected Application newApplicationInstance( ApplicationDescriptor applicationModel )
    {
        return applicationModel.newInstance( polygene.api(), new MetadataService() );
    }

    @Test
    public void testQueryWithoutValue()
    {
        //START SNIPPET: query-without-value
        crc.onResource( new ResultHandler<Resource>()
        {
            @Override
            public HandlerCommand handleResult( Resource result, ContextResourceClient client )
            {
                return query( "querywithoutvalue" );
            }
        } ).
            onQuery( "querywithoutvalue", new ResultHandler<TestResult>()
            {
                @Override
                public HandlerCommand handleResult( TestResult result, ContextResourceClient client )
                {
                    assertThat( result.xyz().get(), equalTo( "bar" ) );
                    return null;
                }
            } );

        crc.start();
        //END SNIPPET: query-without-value
    }

    @Test
    public void testQueryAndCommand()
    {
        //START SNIPPET: query-and-command
        crc.onResource( new ResultHandler<Resource>()
        {
            @Override
            public HandlerCommand handleResult( Resource result, ContextResourceClient client )
            {
                return query( "querywithvalue", null );
            }
        } ).onProcessingError( "querywithvalue", new ResultHandler<TestQuery>()
        {
            @Override
            public HandlerCommand handleResult( TestQuery result, ContextResourceClient client )
            {
                ValueBuilder<TestQuery> builder = valueBuilderFactory.newValueBuilderWithPrototype( result );

                builder.prototype().abc().set( "abc" + builder.prototype().abc().get() );

                return query( "querywithvalue", builder.newInstance() );
            }
        } ).onQuery( "querywithvalue", new ResultHandler<TestResult>()
        {
            @Override
            public HandlerCommand handleResult( TestResult result, ContextResourceClient client )
            {
                return command( "commandwithvalue", null );
            }
        } ).onProcessingError( "commandwithvalue", new ResultHandler<Form>()
        {
            @Override
            public HandlerCommand handleResult( Form result, ContextResourceClient client )
            {
                result.set( "abc", "right" );

                return command( "commandwithvalue", result );
            }
        } );

        crc.start();
        //END SNIPPET: query-and-command
    }

    @Test
    public void testQueryListAndCommand()
    {
        //START SNIPPET: query-list-and-command
        crc.onResource( new ResultHandler<Resource>()
        {
            @Override
            public HandlerCommand handleResult( Resource result, ContextResourceClient client )
            {
                return query( "commandwithvalue" );
            }
        } ).onQuery( "commandwithvalue", new ResultHandler<Links>()
        {
            @Override
            public HandlerCommand handleResult( Links result, ContextResourceClient client )
            {
                Link link = LinksUtil.withId( "right", result );

                return command( link );
            }
        } ).onCommand( "commandwithvalue", new ResponseHandler()
        {
            @Override
            public HandlerCommand handleResponse( Response response, ContextResourceClient client )
            {
                System.out.println( "Done" );
                return null;
            }
        } );

        crc.start();
        //END SNIPPET: query-list-and-command
    }

    @Test
    public void testQueryListAndCommandProgressive()
    {
        //START SNIPPET: query-list-and-command-progressive
        crc.onResource( new ResultHandler<Resource>()
        {
            @Override
            public HandlerCommand handleResult( Resource result, ContextResourceClient client )
            {
                return query( "commandwithvalue" ).onSuccess( new ResultHandler<Links>()
                {
                    @Override
                    public HandlerCommand handleResult( Links result, ContextResourceClient client )
                    {
                        Link link = LinksUtil.withId( "right", result );

                        return command( link ).onSuccess( new ResponseHandler()
                        {
                            @Override
                            public HandlerCommand handleResponse( Response response, ContextResourceClient client )
                            {
                                System.out.println( "Done" );
                                return null;
                            }
                        } );
                    }
                } );
            }
        } );

        crc.start();
        //END SNIPPET: query-list-and-command-progressive
    }

    @Test
    public void testIndexedResource()
    {
        crc.newClient( "subcontext/pages/" ).onResource( new ResultHandler<Resource>()
        {
            @Override
            public HandlerCommand handleResult( Resource result, ContextResourceClient client )
            {
                return query( "index" );
            }
        } ).onQuery( "index", new ResultHandler<Links>()
        {
            @Override
            public HandlerCommand handleResult( Links result, ContextResourceClient client )
            {
                assertThat( result.links().get().size(), equalTo( 3 ) );
                return null;
            }
        } )
            .start();
    }

    public interface TestQuery
        extends ValueComposite
    {
        @UseDefaults
        Property<String> abc();
    }

    public interface TestCommand
        extends ValueComposite
    {
        Property<String> entity();
    }

    public interface TestResult
        extends ValueComposite
    {
        Property<String> xyz();
    }

    public static class RootRestlet
        extends ContextRestlet
    {
        @Override
        protected Uniform createRoot( Request request, Response response )
        {
            return objectFactory.newObject( RootResource.class, this );
        }
    }

    public static class RootResource
        extends ContextResource
        implements SubResources, ResourceDelete
    {
        private static TestComposite instance;

        private RootContext rootContext()
        {
            return context( RootContext.class );
        }

        public RootResource()
        {
        }

        public TestResult querywithvalue( TestQuery testQuery )
            throws Throwable
        {
            return rootContext().queryWithValue( testQuery );
        }

        public TestResult querywithoutvalue()
            throws Throwable
        {
            return rootContext().queryWithoutValue();
        }

        public String querywithstringresult( TestQuery query )
            throws Throwable
        {
            return rootContext().queryWithStringResult( query );
        }

        public void commandwithvalue( TestCommand command )
            throws Throwable
        {
            rootContext().commandWithValue( command );
        }

        public Links commandwithvalue()
        {
            return new LinksBuilder( module ).
                command( "commandwithvalue" ).
                addLink( "Command ABC", "right" ).
                addLink( "Command XYZ", "wrong" ).newLinks();
        }

        @Override
        public void delete()
            throws IOException
        {
            rootContext().delete();
        }

        public void resource( String currentSegment )
        {
            ObjectSelection objectSelection = ObjectSelection.current();

            objectSelection.select( new File( "" ) );

            if( instance == null )
            {
                objectSelection.select( instance = module.newTransient( TestComposite.class ) );
            }
            else
            {
                objectSelection.select( instance );
            }

            subResource( SubResource1.class );
        }
    }

    public static class SubResource1
        extends ContextResource
        implements InteractionValidation
    {
        public SubResource1()
        {
        }

        @Requires( File.class )
        public void commandWithRoleRequirement()
        {
            context( SubContext.class ).commandWithRoleRequirement();
        }

        // Interaction validation
        private static boolean xyzValid = true;

        @RequiresValid( "xyz" )
        public void xyz( @Name( "valid" ) boolean valid )
        {
            xyzValid = valid;
        }

        @RequiresValid( "notxyz" )
        public void notxyz( @Name( "valid" ) boolean valid )
        {
            xyzValid = valid;
        }

        public boolean isValid( String name )
        {
            if( name.equals( "xyz" ) )
            {
                return xyzValid;
            }
            else if( name.equals( "notxyz" ) )
            {
                return !xyzValid;
            }
            else
            {
                return false;
            }
        }

        @Requires( File.class )
        public TestResult queryWithRoleRequirement( TestQuery query )
        {
            return context( SubContext.class ).queryWithRoleRequirement( query );
        }

        public TestResult genericquery( TestQuery query )
            throws Throwable
        {
            return context( SubContext2.class ).genericQuery( query );
        }

        public TestResult querywithvalue( TestQuery query )
            throws Throwable
        {
            return context( SubContext.class ).queryWithValue( query );
        }

        @SubResource
        public void subresource1()
        {
            subResource( SubResource1.class );
        }

        @SubResource
        public void subresource2()
        {
            subResource( SubResource1.class );
        }

        @SubResource
        public void pages()
        {
            subResource( PagesResource.class );
        }
    }

    public static class RootContext
    {
        private static int count = 0;

        @Structure
        UnitOfWorkFactory uowf;

        @Structure
        ValueBuilderFactory vbf;

        public TestResult queryWithValue( TestQuery query )
        {
            return vbf.newValueFromSerializedState( TestResult.class, "{\"xyz\":\"" + query.abc().get() + "\"}" );
        }

        public TestResult queryWithoutValue()
        {
            return vbf.newValueFromSerializedState( TestResult.class, "{\"xyz\":\"bar\"}" );
        }

        public String queryWithStringResult( TestQuery query )
        {
            return "bar";
        }

        public int queryWithIntegerResult( TestQuery query )
        {
            return 7;
        }

        public void commandWithValue( TestCommand command )
        {
            if( !command.entity().get().equals( "right" ) )
            {
                throw new IllegalArgumentException( "Wrong argument" );
            }

            // Done
        }

        public void idempotentCommandWithValue( TestCommand command )
            throws ConcurrentEntityModificationException
        {
            // On all but every third invocation, throw a concurrency exception
            // This is to test retries on the server-side
            count++;
            if( count % 3 != 0 )
            {
                uowf.currentUnitOfWork().addUnitOfWorkCallback( new UnitOfWorkCallback()
                {
                    public void beforeCompletion()
                        throws UnitOfWorkCompletionException
                    {
                        throw new ConcurrentEntityModificationException( Collections.emptyMap(),
                                                                         UsecaseBuilder.newUsecase( "Testing" ) );
                    }

                    public void afterCompletion( UnitOfWorkStatus status )
                    {
                    }
                } );
            }

            if( !command.entity().get().equals( "right" ) )
            {
                throw new IllegalArgumentException( "Wrong argument" );
            }

            // Done
        }

        public void delete()
        {
            // Ok!
            command = "delete";
        }
    }

    public static class SubContext
        implements InteractionValidation
    {
        @Structure
        Module module;

        public TestResult queryWithValue( TestQuery query )
        {
            return module.newValueFromSerializedState( TestResult.class, "{\"xyz\":\"bar\"}" );
        }

        // Test interaction constraints

        @Requires( File.class )
        public TestResult queryWithRoleRequirement( TestQuery query )
        {
            return module.newValueFromSerializedState( TestResult.class, "{\"xyz\":\"bar\"}" );
        }

        @Requires( File.class )
        public void commandWithRoleRequirement()
        {
        }

        // Interaction validation
        private static boolean xyzValid = true;

        @RequiresValid( "xyz" )
        public void xyz( @Name( "valid" ) boolean valid )
        {
            xyzValid = valid;
        }

        @RequiresValid( "notxyz" )
        public void notxyz( @Name( "valid" ) boolean valid )
        {
            xyzValid = valid;
        }

        public boolean isValid( String name )
        {
            if( name.equals( "xyz" ) )
            {
                return xyzValid;
            }
            else if( name.equals( "notxyz" ) )
            {
                return !xyzValid;
            }
            else
            {
                return false;
            }
        }
    }

    public static class SubContext2
    {
        @Structure
        Module module;

        public TestResult genericQuery( TestQuery query )
        {
            return module.newValueFromSerializedState( TestResult.class, "{\"xyz\":\"bar\"}" );
        }
    }

    public static class PagesResource extends ContextResource
        implements ResourceIndex<Links>
    {
        @Override
        public Links index()
        {
            return new LinksBuilder( module )
                .addLink( "Page1", "page1" )
                .addLink( "Page2", "page2" )
                .addLink( "Page3", "page3" )
                .newLinks();
        }
    }

    public static class DescribableContext
    {
        @Structure
        Module module;

        Describable describable = new Describable();

        public void bind( @Uses DescribableData describableData )
        {
            describable.bind( describableData );
        }

        public String description()
        {
            return describable.description();
        }

        public void changeDescription( @Name( "description" ) String newDesc )
        {
            describable.changeDescription( newDesc );
        }

        public static class Describable
            extends Role<DescribableData>
        {
            public void changeDescription( String newDesc )
            {
                self.description().set( newDesc );
            }

            public String description()
            {
                return self.description().get();
            }
        }
    }

    public interface DescribableData
    {
        @UseDefaults
        Property<String> description();
    }

    public interface TestComposite
        extends TransientComposite, DescribableData
    {
        @Optional
        Property<String> foo();
    }
}