text:
package java.awt.dnd;

import java.awt.event.InputEvent;
import java.awt.Component;
import java.awt.Point;

import java.util.TooManyListenersException;
import java.util.ArrayList;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

/**
 * The DragGestureRecognizer is an
 * abstract base class for the specification
 * of a platform-dependent listener that can be associated with a particular
 * Component in order to
 * identify platform-dependent drag initiating gestures.
 *

 * The appropriate DragGestureRecognizer
 * subclass instance is obtained from the
 * {@link DragSource} asssociated with
 * a particular Component, or from the Toolkit object via its
 * {@link java.awt.Toolkit#createDragGestureRecognizer createDragGestureRecognizer()}
 * method.
 *

 * Once the DragGestureRecognizer
 * is associated with a particular Component
 * it will register the appropriate listener interfaces on that
 * Component
 * in order to track the input events delivered to the Component.
 *

 * Once the DragGestureRecognizer identifies a sequence of events
 * on the Component as a drag initiating gesture, it will notify
 * its unicast DragGestureListener by
 * invoking its
 * {@link java.awt.dnd.DragGestureListener#dragGestureRecognized gestureRecognized()}
 * method.
 *

 * When a concrete DragGestureRecognizer
 * instance detects a drag initiating
 * gesture on the Component it is associated with,
 * it fires a {@link DragGestureEvent} to
 * the DragGestureListener registered on
 * its unicast event source for DragGestureListener
 * events. This DragGestureListener is responsible
 * for causing the associated
 * DragSource to start the Drag and Drop operation (if
 * appropriate).
 *

 * @author Laurence P. G. Cable
 * @see java.awt.dnd.DragGestureListener
 * @see java.awt.dnd.DragGestureEvent
 * @see java.awt.dnd.DragSource
 */

public abstract class DragGestureRecognizer implements Serializable {

    private static final long serialVersionUID = 8996673345831063337L;

    /**
     * Construct a new DragGestureRecognizer
     * given the DragSource to be used
     * in this Drag and Drop operation, the Component
     * this DragGestureRecognizer should "observe"
     * for drag initiating gestures, the action(s) supported
     * for this Drag and Drop operation, and the
     * DragGestureListener to notify
     * once a drag initiating gesture has been detected.
     *

     * @param ds  the DragSource this
     * DragGestureRecognizer
     * will use to process the Drag and Drop operation
     *
     * @param c the Component
     * this DragGestureRecognizer
     * should "observe" the event stream to,
     * in order to detect a drag initiating gesture.
     * If this value is null, the
     * DragGestureRecognizer
     * is not associated with any Component.
     *
     * @param sa  the set (logical OR) of the
     * DnDConstants
     * that this Drag and Drop operation will support
     *
     * @param dgl the DragGestureRecognizer
     * to notify when a drag gesture is detected
     *

     * @throws IllegalArgumentException
     * if ds is null.
     */

    protected DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl) {
        super();

        if (ds == null) throw new IllegalArgumentException("null DragSource");

        dragSource    = ds;
        component     = c;
        sourceActions = sa & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK);

        try {
            if (dgl != null) addDragGestureListener(dgl);
        } catch (TooManyListenersException tmle) {
            // cant happen ...
        }
    }

    /**
     * Construct a new DragGestureRecognizer
     * given the DragSource to be used in this
     * Drag and Drop
     * operation, the Component this
     * DragGestureRecognizer should "observe"
     * for drag initiating gestures, and the action(s)
     * supported for this Drag and Drop operation.
     *

     * @param ds  the DragSource this
     * DragGestureRecognizer will use to
     * process the Drag and Drop operation
     *
     * @param c   the Component this
     * DragGestureRecognizer should "observe" the event
     * stream to, in order to detect a drag initiating gesture.
     * If this value is null, the
     * DragGestureRecognizer
     * is not associated with any Component.
     *
     * @param sa the set (logical OR) of the DnDConstants
     * that this Drag and Drop operation will support
     *

     * @throws IllegalArgumentException
     * if ds is null.
     */

    protected DragGestureRecognizer(DragSource ds, Component c, int sa) {
        this(ds, c, sa, null);
    }

    /**
     * Construct a new DragGestureRecognizer
     * given the DragSource to be used
     * in this Drag and Drop operation, and
     * the Component this
     * DragGestureRecognizer
     * should "observe" for drag initiating gestures.
     *

     * @param ds the DragSource this
     * DragGestureRecognizer
     * will use to process the Drag and Drop operation
     *
     * @param c the Component
     * this DragGestureRecognizer
     * should "observe" the event stream to,
     * in order to detect a drag initiating gesture.
     * If this value is null,
     * the DragGestureRecognizer
     * is not associated with any Component.
     *

     * @throws IllegalArgumentException
     * if ds is null.
     */

    protected DragGestureRecognizer(DragSource ds, Component c) {
        this(ds, c, DnDConstants.ACTION_NONE);
    }

    /**
     * Construct a new DragGestureRecognizer
     * given the DragSource to be used in this
     * Drag and Drop operation.
     *

     * @param ds the DragSource this
     * DragGestureRecognizer will
     * use to process the Drag and Drop operation
     *

     * @throws IllegalArgumentException
     * if ds is null.
     */

    protected DragGestureRecognizer(DragSource ds) {
        this(ds, null);
    }

    /**
     * register this DragGestureRecognizer's Listeners with the Component
     *
     * subclasses must override this method
     */

    protected abstract void registerListeners();

    /**
     * unregister this DragGestureRecognizer's Listeners with the Component
     *
     * subclasses must override this method
     */

    protected abstract void unregisterListeners();

    /**
     * This method returns the DragSource
     * this DragGestureRecognizer
     * will use in order to process the Drag and Drop
     * operation.
     *

     * @return the DragSource
     */

    public DragSource getDragSource() { return dragSource; }

    /**
     * This method returns the Component
     * that is to be "observed" by the
     * DragGestureRecognizer
     * for drag initiating gestures.
     *

     * @return The Component this DragGestureRecognizer
     * is associated with
     */

    public synchronized Component getComponent() { return component; }

    /**
     * set the Component that the DragGestureRecognizer is associated with
     *
     * registerListeners() and unregisterListeners() are called as a side
     * effect as appropriate.
     *

     * @param c The Component or null
     */

    public synchronized void setComponent(Component c) {
        if (component != null && dragGestureListener != null)
            unregisterListeners();

        component = c;

        if (component != null && dragGestureListener != null)
            registerListeners();
    }

    /**
     * This method returns an int representing the
     * type of action(s) this Drag and Drop
     * operation will support.
     *

     * @return the currently permitted source action(s)
     */

    public synchronized int getSourceActions() { return sourceActions; }

    /**
     * This method sets the permitted source drag action(s)
     * for this Drag and Drop operation.
     *

     * @param actions the permitted source drag action(s)
     */

    public synchronized void setSourceActions(int actions) {
        sourceActions = actions & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK);
    }

    /**
     * This method returns the first event in the
     * series of events that initiated
     * the Drag and Drop operation.
     *

     * @return the initial event that triggered the drag gesture
     */

    public InputEvent getTriggerEvent() { return events.isEmpty() ? null : (InputEvent)events.get(0); }

    /**
     * Reset the Recognizer, if its currently recognizing a gesture, ignore
     * it.
     */

    public void resetRecognizer() { events.clear(); }

    /**
     * Register a new DragGestureListener.
     *

     * @param dgl the DragGestureListener to register
     * with this DragGestureRecognizer.
     *

     * @throws java.util.TooManyListenersException if a
     * DragGestureListener has already been added.
     */

    public synchronized void addDragGestureListener(DragGestureListener dgl) throws TooManyListenersException {
        if (dragGestureListener != null)
            throw new TooManyListenersException();
        else {
            dragGestureListener = dgl;

            if (component != null) registerListeners();
        }
    }

    /**
     * unregister the current DragGestureListener
     *

     * @param dgl the DragGestureListener to unregister
     * from this DragGestureRecognizer
     *

     * @throws IllegalArgumentException if
     * dgl is not (equal to) the currently registered DragGestureListener.
     */

    public synchronized void removeDragGestureListener(DragGestureListener dgl) {
        if (dragGestureListener == null || !dragGestureListener.equals(dgl))
            throw new IllegalArgumentException();
        else {
            dragGestureListener = null;

            if (component != null) unregisterListeners();
        }
    }

    /**
     * Notify the DragGestureListener that a Drag and Drop initiating
     * gesture has occurred. Then reset the state of the Recognizer.
     *

     * @param dragAction The action initially selected by the users gesture
     * @param p          The point (in Component coords) where the gesture originated
     */
    protected synchronized void fireDragGestureRecognized(int dragAction, Point p) {
        try {
            if (dragGestureListener != null) {
                dragGestureListener.dragGestureRecognized(new DragGestureEvent(this, dragAction, p, events));
            }
        } finally {
            events.clear();
        }
    }

    /**
     * Listeners registered on the Component by this Recognizer shall record
     * all Events that are recognized as part of the series of Events that go
     * to comprise a Drag and Drop initiating gesture via this API.
     *

     * This method is used by a DragGestureRecognizer
     * implementation to add an InputEvent
     * subclass (that it believes is one in a series
     * of events that comprise a Drag and Drop operation)
     * to the array of events that this
     * DragGestureRecognizer maintains internally.
     *

     * @param awtie the InputEvent
     * to add to this DragGestureRecognizer's
     * internal array of events. Note that null
     * is not a valid value, and will be ignored.
     */

    protected synchronized void appendEvent(InputEvent awtie) {
        events.add(awtie);
    }

    /**
     * Serializes this DragGestureRecognizer. This method first
     * performs default serialization. Then, this object's
     * DragGestureListener is written out if and only if it can be
     * serialized. If not, null is written instead.
     *
     * @serialData The default serializable fields, in alphabetical order,
     *             followed by either a DragGestureListener, or
     *             null.
     * @since 1.4
     */
    private void writeObject(ObjectOutputStream s) throws IOException {
        s.defaultWriteObject();

        s.writeObject(SerializationTester.test(dragGestureListener)
                      ? dragGestureListener : null);
    }

    /**
     * Deserializes this DragGestureRecognizer. This method first
     * performs default deserialization for all non-transient
     * fields. This object's DragGestureListener is then
     * deserialized as well by using the next object in the stream.
     *
     * @since 1.4
     */
    private void readObject(ObjectInputStream s)
        throws ClassNotFoundException, IOException
    {
        s.defaultReadObject();

        dragGestureListener = (DragGestureListener)s.readObject();
    }

    /*
     * fields
     */

    /**
     * The DragSource
     * associated with this
     * DragGestureRecognizer.
     *
     * @serial
     */
    protected DragSource          dragSource;

    /**
     * The Component
     * associated with this DragGestureRecognizer.
     *
     * @serial
     */
    protected Component           component;

    /**
     * The DragGestureListener
     * associated with this DragGestureRecognizer.
     */
    protected transient DragGestureListener dragGestureListener;

  /**
   * An int representing
   * the type(s) of action(s) used
   * in this Drag and Drop operation.
   *
   * @serial
   */
  protected int  sourceActions;

   /**
    * The list of events (in order) that
    * the DragGestureRecognizer
    * "recognized" as a "gesture" that triggers a drag.
    *
    * @serial
    */
   protected ArrayList<InputEvent> events = new ArrayList<InputEvent>(1);
}


text:
<?php

namespace VisualAppeal\Gitolite;

use VisualAppeal\Gitolite\Group;
use VisualAppeal\Gitolite\PhpGitoliteException;
use VisualAppeal\Gitolite\Repository;
use VisualAppeal\Gitolite\User;

class Config
{
	/**
	 * Contents of config file.
	 *
	 * @var string
	 */
	protected $config;

	/**
	 * Path to config.
	 *
	 * @var string
	 */
	private $_path;

	/**
	 * List of all repostitories.
	 *
	 * @var array
	 */
	private $_repositories = [];

	/**
	 * List of all groups.
	 *
	 * @var array
	 */
	private $_groups = [];

	/**
	 * List of all users without a group.
	 *
	 * @var array
	 */
	private $_users = [];

	/**
	 * Check if the parser is currently parsing a repository.
	 *
	 * @var array
	 */
	private $_parsingRepositories = [];

	/**
	 * Git repository
	 *
	 * @var Cz\Git\GitRepository
	 */
	private $_git;

	/**
	 * Error codes for exceptions.
	 */
	const ERROR_CONFIG_NOT_EXISTS = 100;
	const ERROR_CONFIG_NOT_READABLE = 110;
	const ERROR_CONFIG_NO_REPOSITORY = 120;
	const ERROR_CONFIG_NOT_OPENED = 130;
	const ERROR_CONFIG_NOT_WRITABLE = 140;
	const ERROR_PARSER_GROUP = 200;
	const ERROR_PARSER_PERMISSION_LINE = 210;
	const ERROR_PARSER_PERMISSION_TYPE = 215;
	const ERROR_PARSER_PERMISSION_UNOKWN_TYPE = 218;
	const ERROR_USER_KEY_INVALID_INDEX = 300;
	const ERROR_GROUP_USER_ALREADY_EXISTS = 400;
	const ERROR_GROUP_USER_KEY_NOT_FOUND = 410;
	const ERROR_GROUP_USER_NOT_MOVABLE = 420;

	/**
	 * Create new parser instance.
	 *
	 * @param string $path Path to config
	 * @param boolean $pull If the repository should be pulled before parsing
	 * @param string $remote
	 * @param array $params Git pull parameters
	 */
	public function __construct($path, $pull = true, $remote = null, array $params = null)
	{
		if (!file_exists($path))
			throw new PhpGitoliteException(sprintf('Gitolite config file %s does not exist!', $path), self::ERROR_CONFIG_NOT_EXISTS);

		if (!is_readable($path))
			throw new PhpGitoliteException(sprintf('Gitolite config file %s is not readable!', $path), self::ERROR_CONFIG_NOT_READABLE);

		$this->_path = $path;
		$this->config = file_get_contents($path);

		try {
			$this->_git = new \Cz\Git\GitRepository(dirname(dirname($path)));

			if ($pull)
				$this->pull($remote, $params);
		} catch (Cz\Git\GitException $e) {
			throw new PhpGitoliteException(sprintf('Invalid repository %s: %s', $path, $e->getMessage()), self::ERROR_CONFIG_NO_REPOSITORY);
		}

		if ($this->config === false)
			throw new PhpGitoliteException(sprintf('Gitolite config file %s could not opened!', $path), self::ERROR_CONFIG_NOT_OPENED);

		$i = 1;
		foreach (preg_split("/((\r?\n)|(\r\n?))/", $this->config) as $line) {
			$this->parseLine($line, $i);
			$i++;
		}
	}

	/**
	 * Create group if it does not exist.
	 *
	 * @param string $name
	 * @return Group
	 */
	protected function createOrFindGroup($name)
	{
		if (isset($this->_groups[$name]))
			return $this->_groups[$name];

		$this->_groups[$name] = new Group($name, $this->_path);
		return $this->_groups[$name];
	}

	/**
	 * Create user if it does not exist.
	 *
	 * @param string $name
	 * @return User
	 */
	protected function createOrFindUser($name)
	{
		if (isset($this->_users[$name]))
			return $this->_users[$name];

		$this->_users[$name] = new User($name, $this->_path);
		return $this->_users[$name];
	}

	/**
	 * Create repository if it does not exist.
	 *
	 * @param string $name
	 * @return Repository
	 */
	public function createOrFindRepository($name)
	{
		if (isset($this->_repositories[$name]))
			return $this->_repositories[$name];

		$this->_repositories[$name] = new Repository($name);
		return $this->_repositories[$name];
	}

	/**
	 * Find repository.
	 *
	 * @param string $name
	 * @return Repository|null
	 */
	public function findRepository($name)
	{
		if (isset($this->_repositories[$name]))
			return $this->_repositories[$name];

		return null;
	}

	/**
	 * Delete repository.
	 *
	 * @param string $name
	 * @return bool
	 */
	public function deleteRepository($name)
	{
		if (!isset($this->_repositories[$name]))
			return false;

		unset($this->_repositories[$name]);
		return true;
	}

	/**
	 * Parse user and add it to a group
	 *
	 * @param string $user
	 * @return void
	 */
	protected function parseUserlist($user)
	{
		$users = [];

		if (substr($user, 0, 1) === '@') {
			$groupExpanded = $this->createOrFindGroup(trim(substr($user, 1)));
			$users[] = $groupExpanded;
		} else {
			$users[] = trim($user);
		}

		return $users;
	}

	/**
	 * Parse all groups or users and assign them to a group.
	 *
	 * @param string $line
	 * @param Group $group
	 * @return void
	 */
	protected function parseUsers($line, Group $group, $i)
	{
		$line = trim($line);

		$users = preg_split('/\s+/', $line);

		if (count($users) > 0) {
			foreach ($users as $user) {
				$userNames = $this->parseUserlist($user);

				foreach ($userNames as $userOrGroup) {
					if (is_string($userOrGroup))
						$group->createOrFindUser($userOrGroup);
					else
						$group->createOrFindGroup($userOrGroup);
				}
			}
		} else {
			$userNames = $this->parseUserlist($line);

			foreach ($userNames as $user) {
				$group->createOrFindUser($user);
			}
		}
	}

	/**
	 * Parse a group from config.
	 *
	 * @param string $line
	 * @param int $i Line number
	 * @return void
	 */
	protected function parseGroup($line, $i)
	{
		if (preg_match('/@([a-zA-z\-0-9]+)\s*?=\s*?(.*)/', $line, $matches) !== 1) {
			throw new PhpGitoliteException(sprintf('Could not parse group in line #%d: %s', $i, $line), self::ERROR_PARSER_GROUP);
		}

		$group = $this->createOrFindGroup(trim($matches[1]));
		$this->parseUsers($matches[2], $group, $i);
	}

	/**
	 * Parse permission of repository
	 *
	 * @param string $line
	 * @param int $i Line number
	 * @return Permission
	 */
	protected function parsePermission($line, $i)
	{
		$permission = new Permission;

		if (preg_match('/\s*?(.*)\s*?=\s*?(.*)/', $line, $matches) !== 1) {
			throw new PhpGitoliteException(sprintf('Could not parse permission in line #%d: %s', $i, $line), self::ERROR_PARSER_PERMISSION_LINE);
		}

		$left = trim($matches[1]);
		$userList = trim($matches[2]);

		if (preg_match('/([\-\+RW]+)\s*?(.*?)/', $left, $matches) !== 1) {
			throw new PhpGitoliteException(sprintf('Could not parse permission type in line #%d: %s', $i, $line), self::ERROR_PARSER_PERMISSION_TYPE);
		}

		$permission->setRef(trim($matches[2]));

		$permissionRaw = strtoupper($matches[1]);
		switch ($permissionRaw) {
			case '-':
				$permission->setPermission(Permission::PERMISSION_DENY);
				break;
			case 'R':
				$permission->setPermission(Permission::PERMISSION_READ);
				break;
			case 'RW':
				$permission->setPermission(Permission::PERMISSION_READ_WRITE);
				break;
			case 'RW+':
				$permission->setPermission(Permission::PERMISSION_READ_WRITE_PLUS);
				break;
			default:
				throw new PhpGitoliteException(sprintf('Unknown permission type in line #%d: %s', $i, $permissionRaw), self::ERROR_PARSER_PERMISSION_UNOKWN_TYPE);
				break;
		}

		$users = $this->parseUserlist($userList);
		foreach ($users as $userOrGroup) {
			if (is_string($userOrGroup))
				$permission->addUser($this->createOrFindUser($userOrGroup));
			else
				$permission->addGroup($this->createOrFindGroup($userOrGroup->getName()));
		}

		return $permission;
	}

	/**
	 * Parse a group from config.
	 *
	 * @param string $line
	 * @param int $i Line number
	 * @return array
	 */
	protected function parseRepositories($line, $i)
	{
		$repos = [];

		if (substr($line, 0, 4) === 'repo') {
			$repositoryList = trim(substr($line, 4));

			$repositories = preg_split('/\s+/', $repositoryList);
			if (count($repositories) > 0) {
				foreach ($repositories as $repository) {
					$repos[] = $this->createOrFindRepository($repository);
				}
			} else {
				$repos[] = $this->createOrFindRepository($repositoryList);
			}
		} else {
			$repos = $this->_parsingRepositories;

			foreach ($repos as &$repository) {
				$permission = $this->parsePermission($line, $i);
				$repository->addPermission($permission);
			}
		}

		return $repos;
	}

	/**
	 * Parse a config line.
	 *
	 * @param string $line
	 * @return void
	 */
	protected function parseLine($line, $i)
	{
		// Skipt empty lines and comments
		if (strlen($line) === 0 || substr($line, 0, 1) === '#')
			return;

		// Only parse line until comment
		if (strpos($line, '#') !== false)
			$line = substr($line, 0, strpos($line, '#'));

		// Lines starting with @ are groups
		if (substr($line, 0, 1) === '@') {
			$this->_parsingRepo = [];
			return $this->parseGroup($line, $i);
		}

		// Lines starting with "repo" are repostitories
		if (substr($line, 0, 4) === 'repo' || count($this->_parsingRepositories) > 0) {
			$this->_parsingRepositories = $this->parseRepositories($line, $i);
		}
	}

	/**
	 * Generate config contents based on currently stored settings.
	 *
	 * @return string
	 */
	protected function generateConfig()
	{
		$config = '';
		foreach ($this->_groups as $name => $group) {
			$config .= '@' . $name;
			$users = $group->getUsers();
			if (count($users) > 0) {
				$config .= ' = ' . implode(' ', array_map(function($userOrGroup) {
					if (get_class($userOrGroup) == 'VisualAppeal\Gitolite\User')
						return $userOrGroup->getName();
					else
						return '@' . $userOrGroup->getName();
				}, $users));
			}
			$config .= "\n";
		}

		if (count($this->_groups))
			$config .= "\n";

		foreach ($this->_repositories as $name => $repository) {
			$config .= 'repo ' . $name . "\n";
			$permissions = $repository->getPermissions();
			foreach ($permissions as $permission) {
				$config .= '  ' . implode(' ', array_filter([
						$permission->getPermissionString(),
						$permission->getRef(),
						'=',
						implode(' ', array_map(function($userOrGroup) {
							if (get_class($userOrGroup) == 'VisualAppeal\Gitolite\User')
								return $userOrGroup->getName();
							else
								return '@' . $userOrGroup->getName();
						}, $permission->getUsers())),
					], function($filter) {
						return !empty(trim($filter));
					})) . "\n";
			}
			$config .= "\n";
		}

		return $config;
	}

	/**
	 * Save config changes.
	 *
	 * @return bool
	 */
	public function save()
	{
		$config = $this->generateConfig();

		if (!is_writable($this->_path))
			throw new PhpGitoliteException(sprintf('Gitolite config file %s is not writable!', $this->_path), self::ERROR_CONFIG_NOT_WRITABLE);

		return file_put_contents($this->_path, $config) !== false;
	}

	/**
	 * Save config as new file.
	 *
	 * @param string $path
	 * @return bool
	 */
	public function saveAs($path)
	{
		$config = $this->generateConfig();

		if (file_exists($path) && !is_writable($path))
			throw new PhpGitoliteException(sprintf('Gitolite config file %s is not writable!', $path), self::ERROR_CONFIG_NOT_WRITABLE);

		return file_put_contents($path, $config) !== false;
	}

	/**
	 * Return groups.
	 *
	 * @return array
	 */
	public function &getGroups()
	{
		return $this->_groups;
	}

	/**
	 * Return repositories.
	 *
	 * @return array
	 */
	public function &getRepositories()
	{
		return $this->_repositories;
	}

	/**
	 * Get repositories the user has access to.
	 *
	 * @param User $user
	 * @return array
	 */
	public function &getRepositoriesForUser(User $user)
	{
		$repositories = [];

		foreach ($this->getRepositories() as $repository) {
			if ($user->hasAccess($repository, $this->getGroups()))
				$repositories[$repository->getName()] = $repository;
		}

		return $repositories;
	}

	/**
	 * Pull changes.
	 *
	 * @param string $remote
	 * @param array $params
	 * @return void
	 */
	public function pull($remote = null, array $params = null)
	{
		$this->_git->pull($remote, $params);
	}

	/**
	 * Commit latest changes.
	 *
	 * @param string $message
	 * @return boolean
	 */
	public function commit($message = '[php-gitolite] Updated config')
	{
		$this->_git->addAllChanges();
		$this->_git->commit($message);

		return true;
	}

	/**
	 * Push changes.
	 *
	 * @param string $remote
	 * @param array $params
	 * @return void
	 */
	public function push($remote = null, array $params = null)
	{
		$this->_git->push($remote, $params);

		return true;
	}

	/**
	 * Commit latest changes and push.
	 *
	 * @param string $message
	 * @param string $remote
	 * @param array $params
	 * @return void
	 */
	public function saveAndPush($message = '[php-gitolite] Updated config', $remote = null, array $params = null)
	{
		if (!$this->save())
			return false;

		if (!$this->commit($message))
			return false;

		if (!$this->push($remote, $params))
			return false;

		return true;
	}

	/**
	 * Returns class as string.
	 *
	 * @return string
	 */
	public function __toString()
	{
		$out = $this->_path . ':' . PHP_EOL . PHP_EOL;

		$out .= '## GROUPS' . PHP_EOL . PHP_EOL;
		foreach ($this->_groups as $group) {
			$out .= (string) $group . PHP_EOL;
		}

		$out .= PHP_EOL . '## USERS' . PHP_EOL . PHP_EOL;
		foreach ($this->_users as $user) {
			$out .= (string) $user . PHP_EOL;
		}

		$out .= PHP_EOL . '## REPOSITORIES' . PHP_EOL . PHP_EOL;
		foreach ($this->_repositories as $repository) {
			$out .= (string) $repository . PHP_EOL;
		}

		return $out;
	}
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="/webangebot1/css/cms_allgemein.css" />
<link rel="stylesheet" type="text/css" href="/webangebot1/css/cms_universaltemplate.css" />

Drucksachen und Protokolle

    Hier können Sie Drucksachen und Protokolle abrufen, indem Sie
einen Suchbegriff oder eine Dokumentnummer (z.B. 17/123 für Drucksache
und/oder Protokoll Nr. 123 der 17. Wahlperiode) eingeben. Weitere
Auswahlmöglichkeiten stehen Ihnen in der "Erweiterten Suche" zur
Verfügung. Dort können Sie z. B. durch Auswahl der
Dokumentart gezielt nach Drucksachen oder Protokollen suchen.
Wenn Sie Fragen zu Drucksachen oder Protokollen haben,
wenden Sie sich bitte an die Zentrale Informationsstelle (Tel. 089/4126-2268).

Suchergebnis

      Erweiterte Suche

      Suche verändern
      neue Suche

        Treffer 1-
1
        von 1

        13.05.2015

Schriftliche Anfrage Drucksache Nr. 17/6191 vom 13.05.2015

<nobr>

        </nobr>

    Antwort der Staatsregierung

        Windenergie in Bayern

An wievielen Stunden erfolgte keine Einspeisung von Strom aus Windernergieanlagen; ... [mehr]

An wievielen Stunden erfolgte keine Einspeisung von Strom aus Windernergieanlagen; durchschnittliche Betriebsstunden; Größe der jeweiligen Flächen der Gebiete die und die Landschaftsbild-Wertstufen 1, 2, 3 und 4 fallen; Ersatzzahlungen nach den Landschaftsbild-Wertstufen 1,2, 3 oder 4    [weniger]

                    13.05.2015
                    FREIE WÄHLER

          Antwort der Staatsregierung 17/6191
                    <nobr>

            </nobr>

                 Schlagworte einblenden

        Treffer 1-
1
        von 1


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInspection.dataFlow;

import com.intellij.codeInspection.dataFlow.rangeSet.LongRangeSet;
import com.intellij.codeInspection.dataFlow.value.*;
import com.intellij.psi.*;
import com.intellij.psi.util.PsiUtil;
import com.siyeh.ig.callMatcher.CallMatcher;
import com.siyeh.ig.psiutils.ExpressionUtils;
import com.siyeh.ig.psiutils.MethodUtils;
import one.util.streamex.StreamEx;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import static com.intellij.codeInspection.dataFlow.ContractReturnValue.returnFalse;
import static com.intellij.codeInspection.dataFlow.ContractReturnValue.returnTrue;
import static com.intellij.codeInspection.dataFlow.StandardMethodContract.ValueConstraint.NULL_VALUE;
import static com.intellij.psi.CommonClassNames.*;

/**
 * Represents a method which is handled as a field in DFA.
 *
 * @author Tagir Valeev
 */
public enum SpecialField implements DfaVariableSource {
  ARRAY_LENGTH(null, "length", true, LongRangeSet.indexRange()) {
    @Override
    boolean isMyAccessor(PsiMember accessor) {
      return accessor instanceof PsiField && "length".equals(accessor.getName()) && PsiUtil.isArrayClass(accessor.getContainingClass());
    }

    @Override
    DfaValue fromInitializer(DfaValueFactory factory, PsiExpression initializer) {
      if (initializer instanceof PsiArrayInitializerExpression) {
        return factory.getInt(((PsiArrayInitializerExpression)initializer).getInitializers().length);
      }
      if (initializer instanceof PsiNewExpression) {
        PsiArrayInitializerExpression arrayInitializer = ((PsiNewExpression)initializer).getArrayInitializer();
        if (arrayInitializer != null) {
          return factory.getInt(arrayInitializer.getInitializers().length);
        }
        PsiExpression[] dimensions = ((PsiNewExpression)initializer).getArrayDimensions();
        if (dimensions.length > 0) {
          Object length = ExpressionUtils.computeConstantExpression(dimensions[0]);
          if (length instanceof Integer) {
            return factory.getInt(((Integer)length).intValue());
          }
        }
      }
      return null;
    }
  },
  STRING_LENGTH(JAVA_LANG_STRING, "length", true, LongRangeSet.indexRange()) {
    @Override
    DfaValue fromInitializer(DfaValueFactory factory, PsiExpression initializer) {
      Object value = ExpressionUtils.computeConstantExpression(initializer);
      if(value instanceof String) {
        return factory.getInt(((String)value).length());
      }
      return null;
    }

    @Override
    public DfaValue fromConstant(DfaValueFactory factory, @NotNull Object obj) {
      return obj instanceof String ? factory.getInt(((String)obj).length()) : null;
    }
  },
  COLLECTION_SIZE(JAVA_UTIL_COLLECTION, "size", false, LongRangeSet.indexRange()),
  MAP_SIZE(JAVA_UTIL_MAP, "size", false, LongRangeSet.indexRange()),
  UNBOX(null, "unbox", true, null) {
    private final CallMatcher UNBOXING_CALL = CallMatcher.anyOf(
      CallMatcher.exactInstanceCall(JAVA_LANG_INTEGER, "intValue").parameterCount(0),
      CallMatcher.exactInstanceCall(JAVA_LANG_LONG, "longValue").parameterCount(0),
      CallMatcher.exactInstanceCall(JAVA_LANG_SHORT, "shortValue").parameterCount(0),
      CallMatcher.exactInstanceCall(JAVA_LANG_BYTE, "byteValue").parameterCount(0),
      CallMatcher.exactInstanceCall(JAVA_LANG_CHARACTER, "charValue").parameterCount(0),
      CallMatcher.exactInstanceCall(JAVA_LANG_BOOLEAN, "booleanValue").parameterCount(0),
      CallMatcher.exactInstanceCall(JAVA_LANG_FLOAT, "floatValue").parameterCount(0),
      CallMatcher.exactInstanceCall(JAVA_LANG_DOUBLE, "doubleValue").parameterCount(0)
    );

    @Override
    PsiPrimitiveType getType(DfaVariableValue variableValue) {
      return PsiPrimitiveType.getUnboxedType(variableValue.getType());
    }

    @Override
    boolean isMyAccessor(PsiMember accessor) {
      return accessor instanceof PsiMethod && UNBOXING_CALL.methodMatches((PsiMethod)accessor);
    }
  };

  private final String myClassName;
  private final String myMethodName;
  private final boolean myFinal;
  private final LongRangeSet myRange;

  SpecialField(String className, String methodName, boolean isFinal, LongRangeSet range) {
    myClassName = className;
    myMethodName = methodName;
    myFinal = isFinal;
    myRange = range;
  }

  @Override
  public boolean isStable() {
    return myFinal;
  }

  @Nullable
  public LongRangeSet getRange() {
    return myRange;
  }

  public String getMethodName() {
    return myMethodName;
  }

  /**
   * Checks whether supplied accessor (field or method) can be used to read this special field
   *
   * @param accessor accessor to test to test
   * @return true if supplied accessor can be used to read this special field
   */
  boolean isMyAccessor(PsiMember accessor) {
    return accessor instanceof PsiMethod && MethodUtils.methodMatches((PsiMethod)accessor, myClassName, null, myMethodName);
  }

  /**
   * Finds a special field which corresponds to given accessor (method or field)
   * @param accessor accessor to find a special field for
   * @return found special field or null if accessor cannot be used to access a special field
   */
  @Contract("null -> null")
  @Nullable
  public static SpecialField findSpecialField(PsiElement accessor) {
    if (!(accessor instanceof PsiMember)) return null;
    return StreamEx.of(values()).findFirst(sf -> sf.isMyAccessor((PsiMember)accessor)).orElse(null);
  }

  /**
   * Returns a DfaValue which represents this special field
   *
   * @param factory a factory to create new values if necessary
   * @param qualifier a known qualifier value
   * @return a DfaValue which represents this special field
   */
  public DfaValue createValue(DfaValueFactory factory, DfaValue qualifier) {
    return createValue(factory, qualifier, null);
  }

  /**
   * Returns a DfaValue which represents this special field
   *
   * @param factory a factory to create new values if necessary
   * @param qualifier a known qualifier value
   * @param targetType a type of created value
   * @return a DfaValue which represents this special field
   */
  public DfaValue createValue(DfaValueFactory factory, DfaValue qualifier, PsiType targetType) {
    if (qualifier instanceof DfaVariableValue) {
      DfaVariableValue variableValue = (DfaVariableValue)qualifier;
      PsiModifierListOwner psiVariable = variableValue.getPsiVariable();
      if (psiVariable instanceof PsiField &&
          factory.canTrustFieldInitializer((PsiField)psiVariable) &&
          psiVariable.hasModifierProperty(PsiModifier.STATIC) &&
          psiVariable.hasModifierProperty(PsiModifier.FINAL)) {
        PsiExpression initializer = ((PsiField)psiVariable).getInitializer();
        if (initializer != null) {
          DfaValue value = fromInitializer(factory, initializer);
          if (value != null) {
            return value;
          }
        }
      }
      return factory.getVarFactory().createVariableValue(this, targetType == null ? getType(variableValue) : targetType, variableValue);
    }
    if(qualifier instanceof DfaConstValue) {
      Object obj = ((DfaConstValue)qualifier).getValue();
      if(obj != null) {
        DfaValue value = fromConstant(factory, obj);
        if(value != null) {
          return value;
        }
      }
    }
    return factory.getFactValue(DfaFactType.RANGE, myRange);
  }

  PsiPrimitiveType getType(DfaVariableValue variableValue) {
    return PsiType.INT;
  }

  DfaValue fromInitializer(DfaValueFactory factory, PsiExpression initializer) {
    return null;
  }

  DfaValue fromConstant(DfaValueFactory factory, @NotNull Object obj) {
    return null;
  }

  /**
   * @return a list of method contracts which equivalent to checking this special field for zero
   */
  public MethodContract[] getEmptyContracts() {
    ContractValue thisValue = ContractValue.qualifier().specialField(this);
    return new MethodContract[]{
      MethodContract.singleConditionContract(thisValue, DfaRelationValue.RelationType.EQ, ContractValue.zero(), returnTrue()),
      MethodContract.trivialContract(returnFalse())};
  }

  public MethodContract[] getEqualsContracts() {
    return new MethodContract[]{new StandardMethodContract(new StandardMethodContract.ValueConstraint[]{NULL_VALUE}, returnFalse()),
                         MethodContract.singleConditionContract(
                           ContractValue.qualifier().specialField(this), DfaRelationValue.RelationType.NE,
                           ContractValue.argument(0).specialField(this), returnFalse())};
  }

  @Override
  public String toString() {
    return myMethodName;
  }
}


text:
"""
This module is deprecated. Please use `airflow.providers.google.cloud.utils.field_sanitizer`.
"""

import warnings

# pylint: disable=unused-import
from airflow.providers.google.cloud.utils.field_sanitizer import (  # noqa
    GcpBodyFieldSanitizer, GcpFieldSanitizerException,
)

warnings.warn(
    "This module is deprecated. Please use `airflow.providers.google.cloud.utils.field_sanitizer`.",
    DeprecationWarning, stacklevel=2
)


text:
package io.undertow.server.handlers.proxy;

/**
 * Manager that controls the behaviour of a {@link ProxyConnectionPool}
 *
 * @author Stuart Douglas
 */
public interface ConnectionPoolManager extends ProxyConnectionPoolConfig, ConnectionPoolErrorHandler {

    /**
     *
     * @return The amount of time that we should wait before re-testing a problem server
     */
    int getProblemServerRetry();

}


text:
<?php

namespace Surfnet\StepupMiddleware\ApiBundle\Identity\Projector;

use Broadway\ReadModel\Projector;
use Surfnet\Stepup\Identity\Event\CompliedWithRecoveryCodeRevocationEvent;
use Surfnet\Stepup\Identity\Event\IdentityForgottenEvent;
use Surfnet\Stepup\Identity\Event\PhoneRecoveryTokenPossessionProvenEvent;
use Surfnet\Stepup\Identity\Event\RecoveryTokenRevokedEvent;
use Surfnet\Stepup\Identity\Event\SafeStoreSecretRecoveryTokenPossessionPromisedEvent;
use Surfnet\Stepup\Identity\Value\RecoveryTokenType;
use Surfnet\StepupMiddleware\ApiBundle\Identity\Entity\RecoveryToken;
use Surfnet\StepupMiddleware\ApiBundle\Identity\Repository\RecoveryTokenRepository;
use Surfnet\StepupMiddleware\ApiBundle\Identity\Value\RecoveryTokenStatus;

/**
 * Project RecoveryTokens that are successfully registered by an Identity
 */
class RecoveryTokenProjector extends Projector
{
    /**
     * @var RecoveryTokenRepository
     */
    private $recoveryTokenRepository;

    public function __construct(
        RecoveryTokenRepository $recoveryMethodRepository
    ) {
        $this->recoveryTokenRepository = $recoveryMethodRepository;
    }

    public function applyPhoneRecoveryTokenPossessionProvenEvent(PhoneRecoveryTokenPossessionProvenEvent $event)
    {
        $recoveryToken = new RecoveryToken();
        $recoveryToken->id = $event->recoveryTokenId->getRecoveryTokenId();
        $recoveryToken->identityId = $event->identityId->getIdentityId();
        $recoveryToken->type = RecoveryTokenType::TYPE_SMS;
        $recoveryToken->status = RecoveryTokenStatus::active();
        $recoveryToken->recoveryMethodIdentifier = (string) $event->phoneNumber;
        $recoveryToken->institution = $event->identityInstitution;
        $recoveryToken->email = $event->email;
        $recoveryToken->name = $event->commonName;

        $this->recoveryTokenRepository->save($recoveryToken);
    }

    public function applySafeStoreSecretRecoveryTokenPossessionPromisedEvent(SafeStoreSecretRecoveryTokenPossessionPromisedEvent $event)
    {
        $recoveryToken = new RecoveryToken();
        $recoveryToken->id = $event->recoveryTokenId->getRecoveryTokenId();
        $recoveryToken->identityId = $event->identityId->getIdentityId();
        $recoveryToken->type = RecoveryTokenType::TYPE_SAFE_STORE;
        $recoveryToken->status = RecoveryTokenStatus::active();
        $recoveryToken->recoveryMethodIdentifier = (string) $event->secret;
        $recoveryToken->institution = $event->identityInstitution;
        $recoveryToken->email = $event->email;
        $recoveryToken->name = $event->commonName;

        $this->recoveryTokenRepository->save($recoveryToken);
    }

    public function applyCompliedWithRecoveryCodeRevocationEvent(CompliedWithRecoveryCodeRevocationEvent $event): void
    {
        $token = $this->recoveryTokenRepository->find((string)$event->recoveryTokenId);
        $token->status = RecoveryTokenStatus::revoked();
        $this->recoveryTokenRepository->save($token);
    }

    public function applyRecoveryTokenRevokedEvent(RecoveryTokenRevokedEvent $event): void
    {
        $token = $this->recoveryTokenRepository->find((string)$event->recoveryTokenId);
        $token->status = RecoveryTokenStatus::revoked();
        $this->recoveryTokenRepository->save($token);
    }

    /**
     * When Identity is forgotten, the recovery token projections for this identity
     * are removed from the recovery_tokens table.
     */
    protected function applyIdentityForgottenEvent(IdentityForgottenEvent $event)
    {
        $this->recoveryTokenRepository->removeByIdentity($event->identityId);
    }
}


text:
      <input type="radio" checked name="queryParamsType">
      limit

      <input type="radio" name="queryParamsType">
      ''

      ID
      Item Name
      Item Price


text:
/**
 * Base class for a set of points.
 */
dbm.registerClass("dbm.core.data.points.PointSet", "dbm.core.BaseObject", function(objectFunctions, staticFunctions, ClassReference) {
	//console.log("dbm.core.data.points.PointSet");
	//"use strict";

	//Self reference
	var PointSet = dbm.importClass("dbm.core.data.points.PointSet");

	//Error report
	var ErrorManager = dbm.importClass("dbm.core.globalobjects.errormanager.ErrorManager");
	var ReportTypes = dbm.importClass("dbm.constants.error.ReportTypes");
	var ReportLevelTypes = dbm.importClass("dbm.constants.error.ReportLevelTypes");

	//Dependencies
	var Point = dbm.importClass("dbm.core.data.points.Point");

	//Utils

	//Constants

	/**
	 * Constructor
	 */
	objectFunctions._init = function() {
		//console.log("dbm.core.data.points.PointSet");

		this.superCall();

		this.pointsArray = new Array();
		this.setType = "none";

		return this;
	};

	/**
	 * Base function for determin if a set is of a special kind. Should be overridden.
	 *
	 * @param	aType	The type of set to be matched.
	 * @return	Always false.
	 */
	objectFunctions.isSetType = function(aType) {
		return (aType === this.setType);
	};

	objectFunctions.getNumberOfPoints = function() {
		return this.pointsArray.length;
	};

	/**
	 * Sets up the point set from a one 1d array.
	 *
	 * @param	aArray	The array of values to be set to the points.
	 */
	objectFunctions.setupFromArray = function(aArray, aNumberOfDimesions) {
		//console.log("dbm.core.data.points.PointSet::setupFromArray");
		var currentArray = aArray;
		var theLength = currentArray.length;
		if((theLength/aNumberOfDimesions) !== Math.floor(theLength/aNumberOfDimesions)) {
			ErrorManager.getInstance().report(ReportTypes.ERROR, ReportLevelTypes.NORMAL, this, "setupFromArray", "Length " + (theLength) + " doesn't fit dimensions (" + aNumberOfDimesions + ").");
			return;
		}
		this.pointsArray = new Array(theLength/aNumberOfDimesions);
		var dataArray = new Array(aNumberOfDimesions);
		for(var i = 0; i < theLength; i += aNumberOfDimesions) {
			for(var j = 0; j < aNumberOfDimesions; j++) {
				dataArray[j] = currentArray[i+j];
			}
			var newPoint = (new Point()).init();
			newPoint.setupFromArray(dataArray);
			this.pointsArray[(i/aNumberOfDimesions)] = newPoint;
		}
	};

	/**
	 * Fills the point set with "empty" points
	 *
	 * @param	aLength	The number of points to add
	 */
	objectFunctions.fillWithEmptyPoints = function(aLength) {
		var pointClass = this._pointClass;

		this.pointsArray = new Array(aLength);
		for(var i = -1; ++i < aLength;) {
			this.pointsArray[i] = Point.create();
		}
	};

	/**
	 * Duplicates the object without the data flow connections.
	 *
	 * @return	The newly created object.
	 */
	objectFunctions.duplicate = function() {
		var theObject = (new ClassReference());
		var currentArray = this.pointsArray;
		var outputArray = theObject.pointsArray;
		var theLength = currentArray.length;
		for(var i = 0; i < theLength; i++) {
			outputArray.push(currentArray[i].duplicate());
		}
		return theObject;
	};

	objectFunctions.reverse = function() {
		this.pointsArray.reverse();

		return this;
	};

	objectFunctions.createPoint = function(aX, aY, aZ, aW) {
		var newPoint = Point.create(aX, aY, aZ, aW);
		this.pointsArray.push(newPoint);
		return newPoint;
	};

	objectFunctions.createPoints = function(aNumberOfPoints) {
		for(var i = 0; i < aNumberOfPoints; i++) {
			this.pointsArray.push(Point.create());
		}

		return this;
	};

	objectFunctions.performDestroy = function() {

		ClassReference.destroyArrayIfExists(this.pointsArray);

		this.superCall();
	};

	objectFunctions.setAllReferencesToNull = function() {

		this.pointsArray = null;

		this.superCall();
	};

	staticFunctions.createWithLength = function(aLength) {
		var newSet = (new ClassReference()).init();
		newSet.fillWithEmptyPoints(aLength);
		return newSet;
	};

	staticFunctions.createWithValues = function(aValues, aNumberOfDimensions) {
		var newSet = (new ClassReference()).init();
		newSet.setupFromArray(aValues, aNumberOfDimensions);
		return newSet;
	};
});


text:
//=================================================================================================

//=================================================================================================

#ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_BASETEMPLATE_H_
#define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_BASETEMPLATE_H_

//*************************************************************************************************
// Includes
//*************************************************************************************************

#include <blaze/math/typetraits/IsColumnMajorMatrix.h>
#include <blaze/math/typetraits/IsDenseMatrix.h>
#include <blaze/util/typetraits/IsNumeric.h>

namespace blaze {

//=================================================================================================
//
//  CLASS DEFINITION
//
//=================================================================================================

//*************************************************************************************************
/*!\defgroup symmetric_matrix SymmetricMatrix
// \ingroup adaptors
*/
/*!\brief Matrix adapter for symmetric \f$ N \times N \f$ matrices.
// \ingroup symmetric_matrix
//
// \section symmetricmatrix_general General
//
// The SymmetricMatrix class template is an adapter for existing dense and sparse matrix types.
// It inherits the properties and the interface of the given matrix type \a MT and extends it
// by enforcing the additional invariant of symmetry (i.e. the matrix is always equal to its
// transpose \f$ A = A^T \f$). The type of the adapted matrix can be specified via the first
// template parameter:

   \code
   template< typename MT, bool SO, bool DF, bool NF >
   class SymmetricMatrix;
   \endcode

//  - MT: specifies the type of the matrix to be adapted. SymmetricMatrix can be used with any
//        non-cv-qualified, non-reference, non-pointer, non-expression dense or sparse matrix
//        type. Note that the given matrix type must be either resizable (as for instance
//        HybridMatrix or DynamicMatrix) or must be square at compile time (as for instance
//        StaticMatrix).
//  - SO: specifies the storage order (blaze::rowMajor, blaze::columnMajor) of the matrix. This
//        template parameter doesn't have to be explicitly defined, but is automatically derived
//        from the first template parameter.
//  - DF: specifies whether the given matrix type is a dense or sparse matrix type. This template
//        parameter doesn't have to be defined explicitly, it is automatically derived from the
//        first template parameter. Defining the parameter explicitly may result in a compilation
//        error!
//  - NF: determines how the elements of the matrix are handled internally. In order to provide
//        maximum performance and to save memory by exploiting the symmetry of the matrix, the
//        SymmetricMatrix class template implements several storage strategies. This template
//        parameter must \b NOT be defined explicitly, it is automatically derived from the first
//        template parameter. Defining the parameter explicitly may result in a compilation error!
//
// The following examples give an impression of several possible symmetric matrices:

   \code
   using blaze::unaligned;
   using blaze::unpadded;
   using blaze::rowMajor;
   using blaze::columnMajor;

   // Definition of a 3x3 row-major dense symmetric matrix with static memory
   blaze::SymmetricMatrix< blaze::StaticMatrix<int,3UL,3UL,rowMajor> > A;

   // Definition of a resizable column-major dense symmetric matrix based on HybridMatrix
   blaze::SymmetricMatrix< blaze::HybridMatrix<float,4UL,4UL,columnMajor> B;

   // Definition of a resizable row-major dense symmetric matrix based on DynamicMatrix
   blaze::SymmetricMatrix< blaze::DynamicMatrix<double,rowMajor> > C;

   // Definition of a fixed-size row-major dense symmetric matrix based on CustomMatrix
   blaze::SymmetricMatrix< blaze::CustomMatrix<double,unaligned,unpadded,rowMajor> > D;

   // Definition of a compressed row-major single precision symmetric matrix
   blaze::SymmetricMatrix< blaze::CompressedMatrix<float,rowMajor> > E;
   \endcode

// The storage order of a symmetric matrix is depending on the storage order of the adapted matrix
// type \a MT. In case the adapted matrix is stored in a row-wise fashion (i.e. is specified as
// blaze::rowMajor), the symmetric matrix will also be a row-major matrix. Otherwise, if the
// adapted matrix is column-major (i.e. is specified as blaze::columnMajor), the symmetric matrix
// will also be a column-major matrix.
//
//
// \n \section symmetricmatrix_vs_hermitianmatrix Symmetric Matrices vs. Hermitian Matrices
//
// The blaze::SymmetricMatrix adaptor and the blaze::HermitianMatrix adaptor share several traits.
// However, there are a couple of differences, both from a mathematical point of view as well as
// from an implementation point of view.
//
// From a mathematical point of view, a matrix is called symmetric when it is equal to its
// transpose (\f$ A = A^T \f$) and it is called Hermitian when it is equal to its conjugate
// transpose (\f$ A = \overline{A^T} \f$). For matrices of real values, however, these two
// conditions coincide, which means that symmetric matrices of real values are also Hermitian
// and Hermitian matrices of real values are also symmetric.
//
// From an implementation point of view, \b Blaze restricts Hermitian matrices to numeric data
// types (i.e. all integral types except \a bool, floating point and complex types), whereas
// symmetric matrices can also be block structured (i.e. can have vector or matrix elements).
// For built-in element types, the HermitianMatrix adaptor behaves exactly like the according
// SymmetricMatrix implementation. For complex element types, however, the Hermitian property
// is enforced (see also \ref hermitianmatrix_hermitian).

	\code
	using blaze::DynamicMatrix;
	using blaze::DynamicVector;
	using blaze::HermitianMatrix;
	using blaze::SymmetricMatrix;

	// The following two matrices provide an identical experience (including performance)
	SymmetricMatrix< DynamicMatrix<double> > A;  // Both Hermitian and symmetric
	HermitianMatrix< DynamicMatrix<double> > B;  // Both Hermitian and symmetric

	// The following two matrices will behave differently
	SymmetricMatrix< DynamicMatrix< complex<double> > > C;  // Only symmetric
	HermitianMatrix< DynamicMatrix< complex<double> > > D;  // Only Hermitian

	// Block-structured Hermitian matrices are not allowed
	SymmetricMatrix< DynamicMatrix< DynamicVector<double> > > E;  // Block-structured symmetric matrix
	HermitianMatrix< DynamicMatrix< DynamicVector<double> > > F;  // Compilation error!
	\endcode

// \n \section symmetricmatrix_special_properties Special Properties of Symmetric Matrices
//
// A symmetric matrix is used exactly like a matrix of the underlying, adapted matrix type \a MT.
// It also provides (nearly) the same interface as the underlying matrix type. However, there are
// some important exceptions resulting from the symmetry constraint:
//
//  -# \ref symmetricmatrix_square
//  -# \ref symmetricmatrix_symmetry
//  -# \ref symmetricmatrix_initialization
//
// \n \subsection symmetricmatrix_square Symmetric Matrices Must Always be Square!
//
// In case a resizable matrix is used (as for instance blaze::HybridMatrix, blaze::DynamicMatrix,
// or blaze::CompressedMatrix), this means that the according constructors, the \c resize() and
// the \c extend() functions only expect a single parameter, which specifies both the number of
// rows and columns, instead of two (one for the number of rows and one for the number of columns):

   \code
   using blaze::DynamicMatrix;
   using blaze::SymmetricMatrix;
   using blaze::rowMajor;

   // Default constructed, default initialized, row-major 3x3 symmetric dynamic matrix
   SymmetricMatrix< DynamicMatrix<double,rowMajor> > A( 3 );

   // Resizing the matrix to 5x5
   A.resize( 5 );

   // Extending the number of rows and columns by 2, resulting in a 7x7 matrix
   A.extend( 2 );
   \endcode

// In case a matrix with a fixed size is used (as for instance blaze::StaticMatrix), the number
// of rows and number of columns must be specified equally:

   \code
   using blaze::StaticMatrix;
   using blaze::SymmetricMatrix;
   using blaze::columnMajor;

   // Correct setup of a fixed size column-major 3x3 symmetric static matrix
   SymmetricMatrix< StaticMatrix<int,3UL,3UL,columnMajor> > A;

   // Compilation error: the provided matrix type is not a square matrix type
   SymmetricMatrix< StaticMatrix<int,3UL,4UL,columnMajor> > B;
   \endcode

// \n \subsection symmetricmatrix_symmetry The Symmetric Property is Always Enforced!
//
// This means that modifying the element \f$ a_{ij} \f$ of a symmetric matrix also modifies its
// counterpart element \f$ a_{ji} \f$. Also, it is only possible to assign matrices that are
// symmetric themselves:

   \code
   using blaze::CompressedMatrix;
   using blaze::DynamicMatrix;
   using blaze::StaticMatrix;
   using blaze::SymmetricMatrix;
   using blaze::rowMajor;

   // Default constructed, row-major 3x3 symmetric compressed matrix
   SymmetricMatrix< CompressedMatrix<double,rowMajor> > A( 3 );

   // Initializing three elements via the function call operator
   A(0,0) = 1.0;  // Initialization of the diagonal element (0,0)
   A(0,2) = 2.0;  // Initialization of the elements (0,2) and (2,0)

   // Inserting three more elements via the insert() function
   A.insert( 1, 1, 3.0 );  // Inserting the diagonal element (1,1)
   A.insert( 1, 2, 4.0 );  // Inserting the elements (1,2) and (2,1)

   // Access via a non-const iterator
   *A.begin(1UL) = 10.0;  // Modifies both elements (1,0) and (0,1)

   // Erasing elements via the erase() function
   A.erase( 0, 0 );  // Erasing the diagonal element (0,0)
   A.erase( 0, 2 );  // Erasing the elements (0,2) and (2,0)

   // Construction from a symmetric dense matrix
   StaticMatrix<double,3UL,3UL> B(  3.0,  8.0, -2.0,
                                    8.0,  0.0, -1.0,
                                   -2.0, -1.0,  4.0 );

   SymmetricMatrix< DynamicMatrix<double,rowMajor> > C( B );  // OK

   // Assignment of a non-symmetric dense matrix
   StaticMatrix<double,3UL,3UL> D(  3.0,  7.0, -2.0,
                                    8.0,  0.0, -1.0,
                                   -2.0, -1.0,  4.0 );

   C = D;  // Throws an exception; symmetric invariant would be violated!
   \endcode

// The same restriction also applies to the \c append() function for sparse matrices: Appending
// the element \f$ a_{ij} \f$ additionally inserts the element \f$ a_{ji} \f$ into the matrix.
// Despite the additional insertion, the \c append() function still provides the most efficient
// way to set up a symmetric sparse matrix. In order to achieve the maximum efficiency, the
// capacity of the individual rows/columns of the matrix should to be specifically prepared with
// \c reserve() calls:

   \code
   using blaze::CompressedMatrix;
   using blaze::SymmetricMatrix;
   using blaze::rowMajor;

   // Setup of the symmetric matrix
   //
   //       ( 0 1 3 )
   //   A = ( 1 2 0 )
   //       ( 3 0 0 )
   //
   SymmetricMatrix< CompressedMatrix<double,rowMajor> > A( 3 );

   A.reserve( 5 );         // Reserving enough space for 5 non-zero elements
   A.reserve( 0, 2 );      // Reserving two non-zero elements in the first row
   A.reserve( 1, 2 );      // Reserving two non-zero elements in the second row
   A.reserve( 2, 1 );      // Reserving a single non-zero element in the third row
   A.append( 0, 1, 1.0 );  // Appending the value 1 at position (0,1) and (1,0)
   A.append( 1, 1, 2.0 );  // Appending the value 2 at position (1,1)
   A.append( 2, 0, 3.0 );  // Appending the value 3 at position (2,0) and (0,2)
   \endcode

// The symmetry property is also enforced for symmetric custom matrices: In case the given array
// of elements does not represent a symmetric matrix, a \a std::invalid_argument exception is
// thrown:

   \code
   using blaze::CustomMatrix;
   using blaze::SymmetricMatrix;
   using blaze::unaligned;
   using blaze::unpadded;
   using blaze::rowMajor;

   typedef SymmetricMatrix< CustomMatrix<double,unaligned,unpadded,rowMajor> >  CustomSymmetric;

   // Creating a 3x3 symmetric custom matrix from a properly initialized array
   double array[9] = { 1.0, 2.0, 4.0,
                       2.0, 3.0, 5.0,
                       4.0, 5.0, 6.0 };
   CustomSymmetric A( array, 3UL );  // OK

   // Attempt to create a second 3x3 symmetric custom matrix from an uninitialized array
   CustomSymmetric B( new double[9UL], 3UL, blaze::ArrayDelete() );  // Throws an exception
   \endcode

// Finally, the symmetry property is enforced for views (rows, columns, submatrices, ...) on the
// symmetric matrix. The following example demonstrates that modifying the elements of an entire
// row of the symmetric matrix also affects the counterpart elements in the according column of
// the matrix:

   \code
   using blaze::DynamicMatrix;
   using blaze::SymmetricMatrix;

   // Setup of the symmetric matrix
   //
   //       ( 0 1 0 2 )
   //   A = ( 1 3 4 0 )
   //       ( 0 4 0 5 )
   //       ( 2 0 5 0 )
   //
   SymmetricMatrix< DynamicMatrix<int> > A( 4 );
   A(0,1) = 1;
   A(0,3) = 2;
   A(1,1) = 3;
   A(1,2) = 4;
   A(2,3) = 5;

   // Setting all elements in the 1st row to 0 results in the matrix
   //
   //       ( 0 0 0 2 )
   //   A = ( 0 0 0 0 )
   //       ( 0 0 0 5 )
   //       ( 2 0 5 0 )
   //
   row( A, 1 ) = 0;
   \endcode

// The next example demonstrates the (compound) assignment to submatrices of symmetric matrices.
// Since the modification of element \f$ a_{ij} \f$ of a symmetric matrix also modifies the
// element \f$ a_{ji} \f$, the matrix to be assigned must be structured such that the symmetry
// of the symmetric matrix is preserved. Otherwise a \a std::invalid_argument exception is
// thrown:

   \code
   using blaze::DynamicMatrix;
   using blaze::SymmetricMatrix;

   // Setup of two default 4x4 symmetric matrices
   SymmetricMatrix< DynamicMatrix<int> > A1( 4 ), A2( 4 );

   // Setup of the 3x2 dynamic matrix
   //
   //       ( 1 2 )
   //   B = ( 3 4 )
   //       ( 5 6 )
   //
   DynamicMatrix<int> B( 3UL, 2UL );
   B(0,0) = 1;
   B(0,1) = 2;
   B(1,0) = 3;
   B(1,1) = 4;
   B(2,1) = 5;
   B(2,2) = 6;

   // OK: Assigning B to a submatrix of A1 such that the symmetry can be preserved
   //
   //        ( 0 0 1 2 )
   //   A1 = ( 0 0 3 4 )
   //        ( 1 3 5 6 )
   //        ( 2 4 6 0 )
   //
   submatrix( A1, 0UL, 2UL, 3UL, 2UL ) = B;  // OK

   // Error: Assigning B to a submatrix of A2 such that the symmetry cannot be preserved!
   //   The elements marked with X cannot be assigned unambiguously!
   //
   //        ( 0 1 2 0 )
   //   A2 = ( 1 3 X 0 )
   //        ( 2 X 6 0 )
   //        ( 0 0 0 0 )
   //
   submatrix( A2, 0UL, 1UL, 3UL, 2UL ) = B;  // Assignment throws an exception!
   \endcode

// \n \subsection symmetricmatrix_initialization The Elements of a Dense Symmetric Matrix are Always Default Initialized!
//
// Although this results in a small loss of efficiency (especially in case all default values are
// overridden afterwards), this property is important since otherwise the symmetric property of
// dense symmetric matrices could not be guaranteed:

   \code
   using blaze::DynamicMatrix;
   using blaze::SymmetricMatrix;

   // Uninitialized, 5x5 row-major dynamic matrix
   DynamicMatrix<int,rowMajor> A( 5, 5 );

   // Default initialized, 5x5 row-major symmetric dynamic matrix
   SymmetricMatrix< DynamicMatrix<int,rowMajor> > B( 5 );
   \endcode

// \n \section symmetricmatrix_arithmetic_operations Arithmetic Operations
//
// A SymmetricMatrix can participate in numerical operations in any way any other dense or sparse
// matrix can participate. It can also be combined with any other dense or sparse vector or matrix.
// The following code example gives an impression of the use of SymmetricMatrix within arithmetic
// operations:

   \code
   using blaze::SymmetricMatrix;
   using blaze::DynamicMatrix;
   using blaze::HybridMatrix;
   using blaze::StaticMatrix;
   using blaze::CompressedMatrix;
   using blaze::rowMajor;
   using blaze::columnMajor;

   DynamicMatrix<double,rowMajor> A( 3, 3 );
   CompressedMatrix<double,rowMajor> B( 3, 3 );

   SymmetricMatrix< DynamicMatrix<double,rowMajor> > C( 3 );
   SymmetricMatrix< CompressedMatrix<double,rowMajor> > D( 3 );

   SymmetricMatrix< HybridMatrix<double,3UL,3UL,rowMajor> > E;
   SymmetricMatrix< StaticMatrix<double,3UL,3UL,columnMajor> > F;

   E = A + B;     // Matrix addition and assignment to a row-major symmetric matrix
   F = C - D;     // Matrix subtraction and assignment to a column-major symmetric matrix
   F = A * D;     // Matrix multiplication between a dense and a sparse matrix

   C *= 2.0;      // In-place scaling of matrix C
   E  = 2.0 * B;  // Scaling of matrix B
   F  = C * 2.0;  // Scaling of matrix C

   E += A - B;    // Addition assignment
   F -= C + D;    // Subtraction assignment
   F *= A * D;    // Multiplication assignment
   \endcode

// \n \section symmetricmatrix_block_structured Block-Structured Symmetric Matrices
//
// It is also possible to use block-structured symmetric matrices:

   \code
   using blaze::CompressedMatrix;
   using blaze::StaticMatrix;
   using blaze::SymmetricMatrix;

   // Definition of a 5x5 block-structured symmetric matrix based on CompressedMatrix
   SymmetricMatrix< CompressedMatrix< StaticMatrix<int,3UL,3UL> > > A( 5 );
   \endcode

// Also in this case, the SymmetricMatrix class template enforces the invariant of symmetry and
// guarantees that a modifications of element \f$ a_{ij} \f$ of the adapted matrix is also
// applied to element \f$ a_{ji} \f$:

   \code
   // Inserting the elements (2,4) and (4,2)
   A.insert( 2, 4, StaticMatrix<int,3UL,3UL>( 1, -4,  5,
                                              6,  8, -3,
                                              2, -1,  2 ) );

   // Manipulating the elements (2,4) and (4,2)
   A(2,4)(1,1) = -5;
   \endcode

// \n \section symmetricmatrix_performance Performance Considerations
//
// When the symmetric property of a matrix is known beforehands using the SymmetricMatrix adaptor
// instead of a general matrix can be a considerable performance advantage. The \b Blaze library
// tries to exploit the properties of symmetric matrices whenever possible. However, there are
// also situations when using a symmetric matrix introduces some overhead. The following examples
// demonstrate several situations where symmetric matrices can positively or negatively impact
// performance.
//
// \n \subsection symmetricmatrix_matrix_matrix_multiplication Positive Impact: Matrix/Matrix Multiplication
//
// When multiplying two matrices, at least one of which is symmetric, \b Blaze can exploit the fact
// that \f$ A = A^T \f$ and choose the fastest and most suited combination of storage orders for the
// multiplication. The following example demonstrates this by means of a dense matrix/sparse matrix
// multiplication:

   \code
   using blaze::DynamicMatrix;
   using blaze::SymmetricMatrix;
   using blaze::rowMajor;
   using blaze::columnMajor;

   SymmetricMatrix< DynamicMatrix<double,rowMajor> > A;
   SymmetricMatrix< CompressedMatrix<double,columnMajor> > B;
   DynamicMatrix<double,columnMajor> C;

   // ... Resizing and initialization

   C = A * B;
   \endcode

// Intuitively, the chosen combination of a row-major and a column-major matrix is the most suited
// for maximum performance. However, \b Blaze evaluates the multiplication as

   \code
   C = A * trans( B );
   \endcode

// which significantly increases the performance since in contrast to the original formulation the
// optimized form can be vectorized. Therefore, in the context of matrix multiplications, using the
// SymmetricMatrix adapter is obviously an advantage.
//
// \n \subsection symmetricmatrix_matrix_vector_multiplication Positive Impact: Matrix/Vector Multiplication
//
// A similar optimization is possible in case of matrix/vector multiplications:

   \code
   using blaze::DynamicMatrix;
   using blaze::DynamicVector;
   using blaze::CompressedVector;
   using blaze::SymmetricMatrix;
   using blaze::rowMajor;
   using blaze::columnVector;

   SymmetricMatrix< DynamicMatrix<double,rowMajor> > A;
   CompressedVector<double,columnVector> x;
   DynamicVector<double,columnVector> y;

   // ... Resizing and initialization

   y = A * x;
   \endcode

// In this example it is not intuitively apparent that using a row-major matrix is not the best
// possible choice in terms of performance since the computation cannot be vectorized. Choosing
// a column-major matrix instead, however, would enable a vectorized computation. Therefore
// \b Blaze exploits the fact that \c A is symmetric, selects the best suited storage order and
// evaluates the multiplication as

   \code
   y = trans( A ) * x;
   \endcode

// which also significantly increases the performance.
//
// \n \subsection symmetricmatrix_views Positive Impact: Row/Column Views on Column/Row-Major Matrices
//
// Another example is the optimization of a row view on a column-major symmetric matrix:

   \code
   using blaze::DynamicMatrix;
   using blaze::SymmetricMatrix;
   using blaze::rowMajor;
   using blaze::columnMajor;

   typedef SymmetricMatrix< DynamicMatrix<double,columnMajor> >  DynamicSymmetric;

   DynamicSymmetric A( 10UL );
   DenseRow<DynamicSymmetric> row5 = row( A, 5UL );
   \endcode

// Usually, a row view on a column-major matrix results in a considerable performance decrease in
// comparison to a row view on a row-major matrix due to the non-contiguous storage of the matrix
// elements. However, in case of symmetric matrices, \b Blaze instead uses the according column of
// the matrix, which provides the same performance as if the matrix would be row-major. Note that
// this also works for column views on row-major matrices, where \b Blaze can use the according
// row instead of a column in order to provide maximum performance.
//
// \n \subsection symmetricmatrix_assignment Negative Impact: Assignment of a General Matrix
//
// In contrast to using a symmetric matrix on the right-hand side of an assignment (i.e. for read
// access), which introduces absolutely no performance penalty, using a symmetric matrix on the
// left-hand side of an assignment (i.e. for write access) may introduce additional overhead when
// it is assigned a general matrix, which is not symmetric at compile time:

   \code
   using blaze::DynamicMatrix;
   using blaze::SymmetricMatrix;

   SymmetricMatrix< DynamicMatrix<double> > A, C;
   DynamicMatrix<double> B;

   B = A;  // Only read-access to the symmetric matrix; no performance penalty
   C = A;  // Assignment of a symmetric matrix to another symmetric matrix; no runtime overhead
   C = B;  // Assignment of a general matrix to a symmetric matrix; some runtime overhead
   \endcode

// When assigning a general, potentially not symmetric matrix to a symmetric matrix it is necessary
// to check whether the matrix is symmetric at runtime in order to guarantee the symmetry property
// of the symmetric matrix. In case it turns out to be symmetric, it is assigned as efficiently as
// possible, if it is not, an exception is thrown. In order to prevent this runtime overhead it is
// therefore generally advisable to assign symmetric matrices to other symmetric matrices.\n
// In this context it is especially noteworthy that in contrast to additions and subtractions the
// multiplication of two symmetric matrices does not necessarily result in another symmetric matrix:

   \code
   SymmetricMatrix< DynamicMatrix<double> > A, B, C;

   C = A + B;  // Results in a symmetric matrix; no runtime overhead
   C = A - B;  // Results in a symmetric matrix; no runtime overhead
   C = A * B;  // Is not guaranteed to result in a symmetric matrix; some runtime overhead
   \endcode
*/
template< typename MT                                             // Type of the adapted matrix
        , bool SO = IsColumnMajorMatrix<MT>::value                // Storage order of the adapted matrix
        , bool DF = IsDenseMatrix<MT>::value                      // Density flag
        , bool NF = IsNumeric<typename MT::ElementType>::value >  // Numeric flag
class SymmetricMatrix;
//*************************************************************************************************

} // namespace blaze

#endif


text:
import os

def program(files):
    max_mtime = 0
    for file in files:
        mtime = os.stat(file).st_mtime
        if mtime > max_mtime:
            max_mtime = mtime
            max_file = file

    print max_file


text:
package org.diorite.impl.server.connection;

import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.KeyPair;
import java.util.UUID;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import org.diorite.impl.DioriteCore;
import org.diorite.impl.auth.GameProfile;
import org.diorite.impl.auth.exceptions.AuthenticationUnavailableException;
import org.diorite.impl.connection.MinecraftEncryption;
import org.diorite.impl.server.connection.server.LoginListener;
import org.diorite.cfg.DioriteConfig.OnlineMode;

public class ThreadPlayerLookupUUID extends Thread
{
    private final LoginListener loginListener;
    private final Runnable      onSuccess;

    public ThreadPlayerLookupUUID(final LoginListener loginListener, final String name, final Runnable onSuccess)
    {
        super(name);
        this.loginListener = loginListener;
        this.onSuccess = onSuccess;
    }

    @Override
    public void run()
    {
        final GameProfile oldProfile = this.loginListener.getGameProfile();
        try
        {
            if (this.loginListener.getOnlineMode() != OnlineMode.TRUE) // TODO
            {
                this.loginListener.setUUID(UUID.nameUUIDFromBytes(("OfflinePlayer:" + oldProfile.getName()).getBytes(StandardCharsets.UTF_8)));
                this.allow();
                return;
            }
            final KeyPair serverKeyPair = this.getServer().getKeyPair();
            //noinspection MagicNumber
            final String hash = new BigInteger(MinecraftEncryption.combineKeys(this.loginListener.getServerID(), serverKeyPair.getPublic(), this.loginListener.getSecretKey())).toString(16);
            final GameProfile newProfile = this.getServer().getSessionService().hasJoinedServer(oldProfile, hash);
            this.loginListener.setGameProfile(newProfile);
            if (newProfile == null)
            {
                this.loginListener.disconnect("Failed to verify username!");
                this.loginListener.getLogger().error("Username '" + oldProfile.getName() + "' tried to join with an invalid session");
                return;
            }
            this.allow();
        } catch (final AuthenticationUnavailableException serverEx)
        {
            this.loginListener.disconnect("Authentication servers are down. Please try again later, sorry!");
            this.loginListener.getLogger().error("Couldn't verify username because servers are unavailable");

        } catch (final Exception e)
        {
            e.printStackTrace();
            this.loginListener.disconnect("Failed to verify username!");
            this.loginListener.getLogger().error("Username '" + oldProfile.getName() + "' tried to join with an invalid session");
        }

    }

    @Override
    public String toString()
    {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).appendSuper(super.toString()).append("loginListener", this.loginListener).toString();
    }

    private void allow()
    {
        final GameProfile profile = this.loginListener.getGameProfile();
        //noinspection ObjectToString
        this.loginListener.getLogger().info("Player " + profile.getName() + " (" + profile.getId() + ") [" + this.loginListener.getNetworkManager().getSocketAddress() + "] connected to server! (online-mode: " + this.loginListener.getOnlineMode() + ")");
        this.loginListener.setProtocolState(LoginListener.ProtocolState.READY_TO_ACCEPT);
        this.onSuccess.run();
    }

    public LoginListener getLoginListener()
    {
        return this.loginListener;
    }

    private DioriteCore getServer()
    {
        return this.loginListener.getCore();
    }
}


text:
/**[@test({ "label": "trujs", "type": "singleton" })]*/
function trujsHelperSetup(module) {
  return module("TruJS");
}
/**[@test({ "label": "customEvent", "type": "singleton" })]*/
function trujsHelperSetup2(module) {
  return module(".customEvent");
}
/**[@test({ "title": "TruJS.resolvePath: resolve various path types" })]*/
function testTruJS1(arrange, act, assert, trujs) {
    var obj, path1, res1, path2, res2, path3, res3;

    arrange(function () {
        obj = {
            "name": 'joe shmo'
            , "address": {
                "street": '12345 street drive'
            }
            , "friends": [{
                "name": 'Jane Doh'
            }]
        };

        path1 = 'name';
        path2 = 'address.street';
        path3 = 'friends[0].name';
    });

    act(function () {
        res1 = trujs.resolvePath(path1, obj);
        res2 = trujs.resolvePath(path2, obj);
        res3 = trujs.resolvePath(path3, obj);
    });

    assert(function (test) {
        test('The res1 value should be:').value(res1, 'value').equals(obj.name);
        test('The res2 value should be:').value(obj, 'address.street').equals(res2.value);
        test('The res3 value should be:').value(obj, 'friends[0].name').equals(res3.value);
    });
}
/**[@test({ "title": "apply: no defaults, not removing nulls" })]*/
function testTruJS2(arrange, act, assert, trujs) {
    //shared variables
    var obj1, obj2, obj3;

    arrange(function () {
        obj1 = { var1: "test1", var4: null };
        obj2 = { var1: "test2", var2: "test3" };
    });

    act(function () {
        //run the apply w/ no defaults
        obj3 = trujs.apply(obj1, obj2, null, false);
    });

    assert(function (test) {
        //test that var1 is unchanged
        test('Var1 should be unchanged').value(obj3.var1).equals(obj1.var1);
        //test that var4 exists since we aren't removing nulls
        test('Var4 should still exist').value(obj3).hasProperty("var4");
    });
}
/**[@test({ "title": "apply: with defaults, not removing nulls" })]*/
function testTruJS3(arrange, act, assert, trujs) {
    //shared variables
    var obj1, obj2, defaults, obj3;

    arrange(function () {
        obj1 = { var1: "test1", var4: null };
        obj2 = { var1: "test2", var2: "test3" };
        defaults = { var5: "test5", var4: "test4", var1: "noTest" };
    });

    act(function () {
        //run the apply with defaults
        obj3 = trujs.apply(obj1, obj2, defaults, false);
    });

    assert(function (test) {
        //test var1 is unchanged
        test('Var1 should be unchanged').value(obj1.var1).equals(obj3.var1);
        //test that var4 is present and has a value
        test('Var4 should still exist').value(obj3).hasProperty("var4");
        test('Var4 should not be null').value(obj3.var4).not().isNull();
        //test that var5 is present
        test('Var5 should be present').value(obj3).hasProperty("var5");
    });
}
/**[@test({ "title": "apply: no defaults, removing nulls" })]*/
function testTruJS4(arrange, act, assert, trujs) {
    //shared variables
    var obj1, obj2, obj3;

    arrange(function () {
        obj1 = { var1: "test1", var4: null };
        obj2 = { var1: "test2", var2: "test3" };
    });

    act(function () {
        //run the apply with removing nulls
        obj3 = trujs.apply(obj1, obj2, null, true);
    });

    assert(function (test) {
        //check that var4 is missing
        test('Var4 should be missing').value(obj3).not().hasProperty("var4");
    });
}
/**[@test({ "title": "applyIf: no defaults, no removing nulls" })]*/
function testTruJS5(arrange, act, assert, trujs) {
    //shared variables
    var obj1, obj2, obj3;

    arrange(function () {
        obj1 = { var1: "test1", var4: null };
        obj2 = { var1: "test2", var2: "test3" };
    });

    act(function () {
        //run the apply with removing nulls
        obj3 = trujs.applyIf(obj1, obj2, null, false);
    });

    assert(function (test) {
        //test that var1 is unchanged
        test('Var1 should be unchanged').value(obj2.var1).equals(obj3.var1);
    });
}
/**[@test({ "title": "removeNulls: create an object with a null property" })]*/
function testTruJS6(arrange, act, assert, trujs) {
    //shared variables
    var obj1;

    arrange(function () {
        //setup the object
        obj1 = { var1: "test1", var4: null };
    });

    act(function () {
        trujs.removeNulls(obj1);
    });

    assert(function (test) {
        test('Var4 should be missing').value(obj1).not().hasProperty("var4");
    });
}
/**[@test({ "title": "getType: create some types and check the return value", "format": "browser" })]*/
function testTruJS8(arrange, act, assert, customEvent, trujs) {
    var test1, test2, test3, res1, res2, res3;

    arrange(function () {
        test1 = new customEvent('event');
        test2 = ["test"];
        test3 = 4.0;
    });

    act(function () {
        res1 = trujs.getType(test1);
        res2 = trujs.getType(test2);
        res3 = trujs.getType(test3);
    });

    assert(function (test) {
        test('test1 should be').value(res1).equals('customevent');
        test('test2 should be').value(res2).equals('array');
        test('test3 should be').value(res3).equals('number');
    });
}
/**[@test({ "title": "isArray: test one array and one non-array" })]*/
function testTruJS9(arrange, act, assert, trujs) {
    //shared variables
    var ar, nonar, isar1, isar2;

    arrange(function () {
        ar = [1, 2, 3];
        nonar = { a: 1, b: 2, c: 3 };
        isar1 = null;
        isar2 = null;
    });

    act(function () {
        isar1 = trujs.isArray(ar);
        isar2 = trujs.isArray(nonar);
    });

    assert(function (test) {
        test('The ar variable is an array').value(isar1).isTrue();
        test('The nonar variable is not an array').value(isar2).isFalse();
    });
}
/**[@test({ "title": "isEmpty: an empty string, array, and object, and then a non-empty version of each" })]*/
function testTruJS10(arrange, act, assert, trujs) {
    //shared variables
    var ar, str, obj, isar, isstr, isobj;

    arrange(function () {
        ar = [];
        str = '';
        obj = {};
        isar = null;
        isstr = null;
        isobj = null;
    });

    act(function () {
        isar = trujs.isEmpty(ar);
        isstr = trujs.isEmpty(str);
        isobj = trujs.isEmpty(obj);
    });

    assert(function (test) {
        test('The ar variable is empty').value(isar).isTrue();
        test('The str variable is empty').value(isstr).isTrue();
        test('The obj variable is empty').value(isobj).isTrue();
    });
}
/**[@test({ "title": "isEmpty: a non empty string, array, and object" })]*/
function testTruJS11(arrange, act, assert, trujs) {
    //shared variables
    var ar, str, obj, isar, isstr, isobj;

    arrange(function () {
        ar = [1];
        str = '1';
        obj = {
            "a": 1
        };
        isar = null;
        isstr = null;
        isobj = null;
    });

    act(function () {
        isar = trujs.isEmpty(ar);
        isstr = trujs.isEmpty(str);
        isobj = trujs.isEmpty(obj);
    });

    assert(function (test) {
        test('The ar variable is not empty').value(isar).isFalse();
        test('The str variable is not empty').value(isstr).isFalse();
        test('The obj variable is not empty').value(isobj).isFalse();
    });
}
/**[@test({ "title": "isElement: test one element and one non-element" })]*/
function testTruJS12(arrange, act, assert, document, trujs) {
    //shared variables
    var el, nonel, isel1, isel2;

    arrange(function () {
        el = document.createElement('div');
        nonel = { 'element': 'div' };
        isel1 = null;
        isel2 = null;
    });

    act(function () {
        isel1 = trujs.isElement(el);
        isel2 = trujs.isElement(nonel);
    });

    assert(function (test) {
        test('The el variable is an element').value(isel1).isTrue();
        test('The nonel variable is not an element').value(isel2).isFalse();
    });
}
/**[@test({ "title": "isEvent: test one event and one non-event" })]*/
function testTruJS13(arrange, act, assert, customEvent, trujs) {
    //shared variables
    var evnt, nonevnt, isevnt1, isevnt2;

    arrange(function () {
        evnt = new customEvent('test');
        nonevnt = { 'event': 'test' };
        isevnt1 = null;
        isevnt2 = null;
    });

    act(function () {
        isevnt1 = trujs.isEvent(evnt);
        isevnt2 = trujs.isEvent(nonevnt);
    });

    assert(function (test) {
        test('The evnt variable is an event').value(isevnt1).isTrue();
        test('The nonevnt variable is not an event').value(isevnt2).isFalse();
    });
}
/**[@test({ "title": "isError: test one error and one non-error" })]*/
function testTruJS14(arrange, act, assert, trujs) {
    var err, noerr, errRes, noerrRes;

    arrange(function () {
        err = new Error("This is a test error");
        noerr = "This is not a test error";
        errRes = null;
        noerrRes = null;
    });

    act(function () {
        errRes = trujs.isError(err);
        noerrRes = trujs.isError(noerr);
    });

    assert(function (test) {
        test('The err value should be an Error').value(errRes).isTrue();
        test('The noerr value should not be an Error').value(noerrRes).isFalse();
    });
}
/**[@test({ "title": "isFunc: test one event and one non-event" })]*/
function testTruJS15(arrange, act, assert, trujs) {
    var func, nonfunc, isfunc1, isfunc2;

    arrange(function () {
        func = function () { };
        nonfunc = { 'func': func };
        isfunc1 = null;
        isfunc2 = null;
    });

    act(function () {
        isfunc1 = trujs.isFunc(func);
        isfunc2 = trujs.isFunc(nonfunc);
    });

    assert(function (test) {
        test('The func variable is a function').value(isfunc1).isTrue();
        test('The nonfunc variable is not a function').value(isfunc2).isFalse();
    });
}
/**[@test({ "title": "isNill: test one undefined, null, and object" })]*/
function testTruJS16(arrange, act, assert, trujs) {
    var t1, t2, t3, isn1, isn2, isn3;

    arrange(function () {
        t1 = undefined;
        t2 = null;
        t3 = {};
        isn1 = null;
        isn2 = null;
        isn3 = null;
    });

    act(function () {
        isn1 = trujs.isNill(t1);
        isn2 = trujs.isNill(t2);
        isn3 = trujs.isNill(t3);
    });

    assert(function (test) {
        test('The t1 variable is nill').value(isn1).isTrue();
        test('The t2 variable is nill').value(isn2).isTrue();
        test('The t3 variable is not nill').value(isn3).isFalse();
    });
}
/**[@test({ "title": "isRegEx: test one regex and one non-regex" })]*/
function testTruJS17(arrange, act, assert, trujs) {
    var regex, noregex, regexRes, noregexRes;

    arrange(function () {
        regex = /this is regex/g;
        noregex = "This is not regex";
        regexRes = null;
        noregexRes = null;
    });

    act(function () {
        regexRes = trujs.isRegEx(regex);
        noregexRes = trujs.isRegEx(noregex);
    });

    assert(function (test) {
        test('The regex value should be a regular expression').value(regexRes).isTrue();
        test('The noregex value should not be a regular expression').value(noregexRes).isFalse();
    });
}
/**[@test({ "title": "isArguments: test one Arguments and one non-Arguments" })]*/
function testTruJS18(arrange, act, assert, trujs) {
    var args, noargs, argsRes, noArgsRes;

    arrange(function () {
        args = arguments;
        noargs = [1];
        argsRes = null;
        noArgsRes = null;
    });

    act(function () {
        argsRes = trujs.isArguments(args);
        noArgsRes = trujs.isArguments(noargs);
    });

    assert(function (test) {
        test('The args value should be an Arguments type').value(argsRes).isTrue();
        test('The noargs value should not be an Arguments type').value(noArgsRes).isFalse();
    });
}
/**[@test({ "title": "isPrototypeKey: create a prototype chain and test keys" })]*/
function testTruJS19(arrange, act, assert, trujs) {
    var base, obj, is1, is2;

    arrange(function () {
        base = {
            "base": 'value'
        };
        obj = {
            "obj": 'value'
        };

        Object.setPrototypeOf(obj, base);
    });

    act(function () {
        is1 = trujs.isPrototypeKey(obj, 'base');
        is2 = trujs.isPrototypeKey(obj, 'obj');
    });

    assert(function (test) {
        test('The `base` key should be a prototype key').value(is1).isTrue();
        test('The `obj` key should not be a prototype key').value(is2).isFalse();
    });
}


text:
curl -sSL https://get.haskellstack.org/ | sh

# Create new stack sandbox project
cd ~/src/sandbox
stack new helloworld new-template
cd helloworld

# Build the basic project
stack build --fast

# Clone haskell-ide-engine repo somewhere (like, in your src/libs)
# Install using instructions here:
# https://github.com/haskell/haskell-ide-engine#install-specific-ghc-version

# Build additional dev dependencies
# Not sure if the below steps are still needed...
cd ~/src/sandbox/helloworld
stack build --copy-compiler-tool hoogle hlint
stack build --copy-compiler-tool exec hoogle generate brittany

# With my current vimrc, the Haskell dev environment should just work


text:
using UnityEngine;
using System.Collections;

public class VehicleControls : MonoBehaviour {
	public KeyCode accelerationKey = KeyCode.W;
	public KeyCode brakeKey = KeyCode.S;
	public KeyCode turnLeftKey = KeyCode.A;
	public KeyCode turnRightKey = KeyCode.D;

	public float acceleration = 0.5f;
	public float deceleration = 0.1f;
	public float brake = 0.9f;
	public float maxSpeed = 3.0f;
	public float turnSpeed = 1.0f;
	public float gravity = 8.0f;

	public float currentSpeed = 0.0f;
	Vector3 direction = new Vector3();
	Vector3 turn = new Vector3 ();
	CharacterController cc;
	// Use this for initialization
	void Start () {
		cc = GetComponent<CharacterController> ();
		if (!cc) {
			cc = gameObject.AddComponent<CharacterController>();
		}

	}

	// Update is called once per frame
	void Update () {
		turn.y = 0;
		if (Input.GetKey (turnLeftKey)) {
			turn.y = -turnSpeed;
		} else if (Input.GetKey (turnRightKey)) {
			turn.y = turnSpeed;
		}
		transform.Rotate(turn);
		if (Input.GetKey (accelerationKey) && currentSpeed < maxSpeed) {
						currentSpeed += acceleration * Time.deltaTime;
				} else if (Input.GetKey (brakeKey) && currentSpeed > 0) {
						currentSpeed -= acceleration * Time.deltaTime;
				} else if (currentSpeed > 0) {
						currentSpeed -= deceleration * Time.deltaTime;
				} else {
						currentSpeed = 0;
				}
		direction.x = transform.forward.x * currentSpeed;
		direction.z = transform.forward.z * currentSpeed;
		if (!cc.isGrounded) {
			direction.y -= gravity / 10 * Time.deltaTime;
		} else {
			direction.y = 0;
		}
		cc.Move (direction);
	}
}


text:
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">

  <title>spgl.gobjects.GArc</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />

         Home

         Trees

         Indices

         Help

        Package spgl ::
        Module gobjects ::
        Class GArc

[hide private]

[frames] | no frames]

Class GArc

source code

GObject --+
          |
         GArc

This graphical object subclass represents an elliptical arc.  The arc
  is specified by the following parameters:

       - The coordinates of the bounding rectangle (x, y, width, height)
       - The angle at which the arc starts (start)
       - The number of degrees that the arc covers (sweep)

All angles in a GArc description are measured in degrees moving
  counterclockwise from the +x axis.  Negative values for either start or
  sweep indicate motion in a clockwise direction.

        Instance Methods
        [hide private]

      void

          __init__(self,
        width,
        height,
        start,
        sweep,
        x=0,
        y=0)

      Initializes a new GArc object consisting of an elliptical arc.

            source code

      void

          setStartAngle(self,
        start)

      Sets the starting angle for this GArc object.

            source code

      float

          getStartAngle(self)

      Returns the starting angle for this GArc object.

            source code

      void

          setSweepAngle(self,
        sweep)

      Sets the sweep angle for this GArc object.

            source code

      float

          getSweepAngle(self)

      Returns the sweep angle for this GArc object.

            source code

      GPoint

          getStartPoint(self)

      Returns the point at which the arc starts.

            source code

      GPoint

          getEndPoint(self)

      Returns the point at which the arc ends.

            source code

      void

          setFrameRectangle(self,
        x=None,
        y=None,
        width=None,
        height=None,
        rect=None)

      Changes the boundaries of the rectangle used to frame the arc.

            source code

      GRectangle

          getFrameRectangle(self)

      Returns the boundaries of the rectangle used to frame the arc.

            source code

      void

          setFilled(self,
        flag)

      Sets the fill status for the arc, where false is outlined and true is
      filled.

            source code

      boolean

          getFilled(self)

      Returns true if the arc is filled.

            source code

      void

          setFillColor(self,
        color=None,
        rgb=None)

      Sets the color used to display the filled region of this arc.

            source code

      string

          getFillColor(self)

      Returns the color used to display the filled region of this arc.

            source code

      GRectangle

          getBounds(self)

      Gets the bounding rectangle for this object

            source code

      boolean

          contains(self,
        x,
        y)

      Returns whether or not this object contains the point x, y

            source code

      string

          getType(self)

      Returns the type of this object

            source code

      string

          toString(self)

      Returns the string form of this object

            source code

          getArcPoint(self,
        theta)

      Internal method

            source code

          containsAngle(self,
        theta)

      Internal method

            source code

Inherited from GObject:
      getColor,
      getHeight,
      getLineWidth,
      getLocation,
      getParent,
      getSize,
      getWidth,
      getX,
      getY,
      isVisible,
      move,
      rotate,
      scale,
      sendBackward,
      sendForward,
      sendToBack,
      sendToFront,
      setColor,
      setLineWidth,
      setLocation,
      setVisible

        Method Details
        [hide private]

__init__(self,
        width,
        height,
        start,
        sweep,
        x=0,
        y=0)

(Constructor)

  	source code

Initializes a new GArc object consisting of an elliptical arc. The
  first form creates a GArc whose origin is the point (0, 0); the second
  form positions the GArc at the point (x, y).

Parameters:

start (float) - degrees

sweep (float) - degrees

height (float)

width (float)

y (float)

x (float)

Returns: void

Overrides:
        GObject.__init__

setStartAngle(self,
        start)

  	source code

Sets the starting angle for this GArc object.

Parameters:

start (float) - degrees

Returns: void

getStartAngle(self)

  	source code

Returns the starting angle for this GArc object.

Returns: float

degrees

setSweepAngle(self,
        sweep)

  	source code

Sets the sweep angle for this GArc object.

Parameters:

sweep (float) - degrees

Returns: void

getSweepAngle(self)

  	source code

Returns the sweep angle for this GArc object.

Returns: float

degrees

setFrameRectangle(self,
        x=None,
        y=None,
        width=None,
        height=None,
        rect=None)

  	source code

Changes the boundaries of the rectangle used to frame the arc.

Parameters:

rect (GRectangle) - bounding frame, will override other parameters

y (float)

x (float)

height (float)

width (float)

Returns: void

setFilled(self,
        flag)

  	source code

Sets the fill status for the arc, where false is outlined and true is
  filled.  If a GArc is unfilled, the figure consists only of the arc
  itself.  If a GArc is filled, the figure consists of the pie-shaped wedge
  formed by connecting the endpoints of the arc to the center.  As an
  example, the following program draws a 270-degree arc starting at 45
  degrees, filled in yellow, much like the character in the PacMan video
  game:

       gw = gwindow.GWindow()
       print "This program draws the PacMan character."
       cx = gw.getWidth() / 2
       cy = gw.getHeight() / 2
       r = 25
       pacman = gobjects.GArc(cx - r, cy - r, 2*r, 2*r, 45, 270)
       pacman.setFilled(True)
       pacman.setFillColor("YELLOW")
       gw.add(pacman)

Parameters:

flag (boolean)

Returns: void

setFillColor(self,
        color=None,
        rgb=None)

  	source code

Sets the color used to display the filled region of this arc. Colors
  are specified as strings as described in the notes for the setColor
  method.

Parameters:

color (string) - will override rgb

rgb (int)

Returns: void

getFillColor(self)

  	source code

Returns the color used to display the filled region of this arc.  If
  none has been set, getFillColor returns the empty string.

Returns: string

getBounds(self)

  	source code

Gets the bounding rectangle for this object

Returns: GRectangle

Overrides:
        GObject.getBounds

contains(self,
        x,
        y)

  	source code

Returns whether or not this object contains the point x, y

Parameters:

pt - point to check, will override x and y

y (float)

x (float)

Returns: boolean

Overrides:
        GObject.contains

getType(self)

  	source code

Returns the type of this object

Returns: string

Overrides:
        GObject.getType

toString(self)

  	source code

Returns the string form of this object

Returns: string

Overrides:
        GObject.toString

         Home

         Trees

         Indices

         Help

    Generated by Epydoc 3.0.1 on Fri May 10 02:58:16 2013

      http://epydoc.sourceforge.net


text:
package handler

import (
	"encoding/json"
	"net/http"

	"github.com/Unknwon/macaron"
	"github.com/astaxie/beego/logs"
)

func GetUsersV1Handler(ctx *macaron.Context, log *logs.BeeLogger) (int, []byte) {
	result, _ := json.Marshal(map[string]string{})
	return http.StatusOK, result
}

func PostUsersV1Handler(ctx *macaron.Context, log *logs.BeeLogger) (int, []byte) {
	result, _ := json.Marshal(map[string]string{})
	return http.StatusUnauthorized, result
}


text:
package lib;

import java.awt.Color;
import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author Gil
 */
public class Clipboard {
    private List<Color> myColors;

    public Clipboard(){
        myColors = new LinkedList<Color>();
    }

    public void set(Color color){
        myColors.clear();
        myColors.add(color);
    }

    public void set(List<Color> colors){
        myColors.clear();
        myColors.addAll(colors);
    }

    public List<Color> get(){
        return myColors;
    }

}