text:
using System;
using System.Xml;
using System.Xml.Linq;
using System.Xml.Schema;
using System.Xml.Serialization;
using MathNet.Numerics;
using MathNet.Spatial.Units;

namespace MathNet.Spatial.Euclidean
{
    /// <summary>
    /// A line between two points
    /// </summary>
    [Serializable]
    public struct Line3D : IEquatable<Line3D>, IXmlSerializable
    {
        /// <summary>
        /// The startpoint of the line
        /// </summary>
        public readonly Point3D StartPoint;

        /// <summary>
        /// The endpoint of the line
        /// </summary>
        public readonly Point3D EndPoint;
        private double _length;
        private UnitVector3D _direction;

        /// <summary>
        /// Throws if StartPoint == EndPoint
        /// </summary>
        /// <param name="startPoint"></param>
        /// <param name="endPoint"></param>
        public Line3D(Point3D startPoint, Point3D endPoint)
        {
            this.StartPoint = startPoint;
            this.EndPoint = endPoint;
            if (this.StartPoint == this.EndPoint)
            {
                throw new ArgumentException("StartPoint == EndPoint");
            }

            this._length = -1.0;
            this._direction = new UnitVector3D();
        }

        /// <summary>
        /// Distance from startpoint to endpoint, the length of the line
        /// </summary>
        public double Length
        {
            get
            {
                if (this._length < 0)
                {
                    var vectorTo = this.StartPoint.VectorTo(this.EndPoint);
                    this._length = vectorTo.Length;
                    if (this._length > 0)
                    {
                        this._direction = vectorTo.Normalize();
                    }
                }

                return this._length;
            }
        }

        /// <summary>
        /// The direction from the startpoint to the endpoint
        /// </summary>
        public UnitVector3D Direction
        {
            get
            {
                if (this._length < 0)
                {
                    this._length = this.Length; // Side effect hack
                }

                return this._direction;
            }
        }

        /// <summary>
        /// Creates a Line from its string representation
        /// </summary>
        /// <param name="startPoint">The string representation of the startpoint</param>
        /// <param name="endPoint">The string representation of the endpoint</param>
        /// <returns></returns>
        public static Line3D Parse(string startPoint, string endPoint)
        {
            return new Line3D(Point3D.Parse(startPoint), Point3D.Parse(endPoint));
        }

        public static bool operator ==(Line3D left, Line3D right)
        {
            return left.Equals(right);
        }

        public static bool operator !=(Line3D left, Line3D right)
        {
            return !left.Equals(right);
        }

        /// <summary>
        /// Returns the shortest line to a point
        /// </summary>
        /// <param name="p"></param>
        /// <param name="mustStartBetweenStartAndEnd">If false the startpoint can be on the line extending beyond the start and endpoint of the line</param>
        /// <returns></returns>
        public Line3D LineTo(Point3D p, bool mustStartBetweenStartAndEnd)
        {
            return new Line3D(this.ClosestPointTo(p, mustStartBetweenStartAndEnd), p);
        }

        /// <summary>
        /// Returns the closest point on the line to the given point.
        /// </summary>
        /// <param name="p">The point which the returned point is the closest point on the line to</param>
        /// <param name="mustBeOnSegment">If true the returned point is contained by the segment ends, otherwise it can be anywhere on the projected line.</param>
        /// <returns></returns>
        public Point3D ClosestPointTo(Point3D p, bool mustBeOnSegment)
        {
            Vector3D v = (p - this.StartPoint);
            double dotProduct = v.DotProduct(this.Direction);
            if (mustBeOnSegment)
            {
                if (dotProduct < 0)
                    dotProduct = 0;

                if (dotProduct > this.Length)
                    dotProduct = this.Length;
            }

            Vector3D alongVector = dotProduct*this.Direction;
            return this.StartPoint + alongVector;
        }

        /// <summary>
        /// The line projected on a plane
        /// </summary>
        /// <param name="plane"></param>
        /// <returns></returns>
        public Line3D ProjectOn(Plane plane)
        {
            return plane.Project(this);
        }

        /// <summary>
        /// Find the intersection between the line and a plane
        /// </summary>
        /// <param name="plane"></param>
        /// <param name="tolerance"></param>
        /// <returns></returns>
        public Point3D? IntersectionWith(Plane plane, double tolerance = double.Epsilon)
        {
            return plane.IntersectionWith(this, tolerance);
        }

        /// <summary>
        /// Checks to determine whether or not two lines are parallel to each other, using the dot product within
        /// the double precision specified in the MathNet.Numerics package.
        /// </summary>
        /// <param name="other">The other line to check this one against</param>
        /// <returns>True if the lines are parallel, false if they are not</returns>
        public bool IsParallelTo(Line3D other)
        {
            return this.Direction.IsParallelTo(other.Direction, Precision.DoublePrecision * 2);
        }

        /// <summary>
        /// Checks to determine whether or not two lines are parallel to each other within a specified angle tolerance
        /// </summary>
        /// <param name="other">The other line to check this one against</param>
        /// <param name="angleTolerance">If the angle between line directions is less than this value, the method returns true</param>
        /// <returns>True if the lines are parallel within the angle tolerance, false if they are not</returns>
        public bool IsParallelTo(Line3D other, Angle angleTolerance)
        {
            return this.Direction.IsParallelTo(other.Direction, angleTolerance);
        }

        /// <summary>
        /// Computes the pair of points which represent the closest distance between this Line3D and another Line3D, with the first
        /// point being the point on this Line3D, and the second point being the corresponding point on the other Line3D.  If the lines
        /// intersect the points will be identical, if the lines are parallel the first point will be the start point of this line.
        /// </summary>
        /// <param name="other">line to compute the closest points with</param>
        /// <returns>A tuple of two points representing the endpoints of the shortest distance between the two lines</returns>
        public Tuple<Point3D, Point3D> ClosestPointsBetween(Line3D other)
        {
            if (this.IsParallelTo(other))
            {
                return Tuple.Create(this.StartPoint, other.ClosestPointTo(this.StartPoint, false));
            }

            // http://geomalgorithms.com/a07-_distance.html
            var P0 = this.StartPoint;
            var u = this.Direction;
            var Q0 = other.StartPoint;
            var v = other.Direction;

            var w0 = P0 - Q0;
            var a = u.DotProduct(u);
            var b = u.DotProduct(v);
            var c = v.DotProduct(v);
            var d = u.DotProduct(w0);
            var e = v.DotProduct(w0);

            double sc = (b*e - c*d)/(a*c - b*b);
            double tc = (a*e - b*d)/(a*c - b*b);

            return Tuple.Create(P0 + sc*u, Q0 + tc*v);
        }

        /// <summary>
        /// Computes the pair of points which represents the closest distance between this Line3D and another Line3D, with the option
        /// of treating the lines as segments bounded by their start and end points.
        /// </summary>
        /// <param name="other">line to compute the closest points with</param>
        /// <param name="mustBeOnSegments">if true, the lines are treated as segments bounded by the start and end point</param>
        /// <returns>A tuple of two points representing the endpoints of the shortest distance between the two lines or segments</returns>
        public Tuple<Point3D, Point3D> ClosestPointsBetween(Line3D other, bool mustBeOnSegments)
        {
            // If the segments are parallel and the answer must be on the segments, we can skip directly to the ending
            // algorithm where the endpoints are projected onto the opposite segment and the smallest distance is
            // taken.  Otherwise we must first check if the infinite length line solution is valid.
            if (!this.IsParallelTo(other) || !mustBeOnSegments)  // If the lines aren't parallel OR it doesn't have to be constrained to the segments
            {
                // Compute the unbounded result, and if mustBeOnSegments is false we can directly return the results
                // since this is the same as calling the other method.
                var result = this.ClosestPointsBetween(other);
                if (!mustBeOnSegments)
                    return result;

                // A point that is known to be colinear with the line start and end points is on the segment if
                // its distance to both endpoints is less than the segment length.  If both projected points lie
                // within their segment, we can directly return the result.
                if (result.Item1.DistanceTo(this.StartPoint) <= this.Length &&
                    result.Item1.DistanceTo(this.EndPoint) <= this.Length &&
                    result.Item2.DistanceTo(other.StartPoint) <= other.Length &&
                    result.Item2.DistanceTo(other.EndPoint) <= other.Length)
                {
                    return result;
                }
            }

            // If we got here, we know that either we're doing a bounded distance on two parallel segments or one
            // of the two closest span points is outside of the segment of the line it was projected on.  In either
            // case we project each of the four endpoints onto the opposite segments and select the one with the
            // smallest projected distance.
            Point3D checkPoint;
            Tuple<Point3D, Point3D> closestPair;
            double distance;

            checkPoint = other.ClosestPointTo(this.StartPoint, true);
            distance = checkPoint.DistanceTo(this.StartPoint);
            closestPair = Tuple.Create(this.StartPoint, checkPoint);
            double minDistance = distance;

            checkPoint = other.ClosestPointTo(this.EndPoint, true);
            distance = checkPoint.DistanceTo(this.EndPoint);
            if (distance < minDistance)
            {
                closestPair = Tuple.Create(this.EndPoint, checkPoint);
                minDistance = distance;
            }

            checkPoint = this.ClosestPointTo(other.StartPoint, true);
            distance = checkPoint.DistanceTo(other.StartPoint);
            if (distance < minDistance)
            {
                closestPair = Tuple.Create(checkPoint, other.StartPoint);
                minDistance = distance;
            }

            checkPoint = this.ClosestPointTo(other.EndPoint, true);
            distance = checkPoint.DistanceTo(other.EndPoint);
            if (distance < minDistance)
            {
                closestPair = Tuple.Create(checkPoint, other.EndPoint);
            }

            return closestPair;
        }

        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
        /// </returns>
        /// <param name="other">An object to compare with this object.</param>
        public bool Equals(Line3D other)
        {
            return this.StartPoint.Equals(other.StartPoint) && this.EndPoint.Equals(other.EndPoint);
        }

        /// <summary>
        /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <returns>
        /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
        /// </returns>
        /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority>
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            return obj is Line3D && this.Equals((Line3D)obj);
        }

        /// <summary>
        /// Serves as a hash function for a particular type.
        /// </summary>
        /// <returns>
        /// A hash code for the current <see cref="T:System.Object"/>.
        /// </returns>
        /// <filterpriority>2</filterpriority>
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = this.StartPoint.GetHashCode();
                hashCode = (hashCode * 397) ^ this.EndPoint.GetHashCode();
                return hashCode;
            }
        }

        public override string ToString()
        {
            return string.Format("StartPoint: {0}, EndPoint: {1}", this.StartPoint, this.EndPoint);
        }

        public XmlSchema GetSchema()
        {
            return null;
        }

        public void ReadXml(XmlReader reader)
        {
            reader.MoveToContent();
            var e = (XElement)XNode.ReadFrom(reader);
            var startPoint = Point3D.ReadFrom(e.SingleElement("StartPoint").CreateReader());
            XmlExt.SetReadonlyField(ref this, l => l.StartPoint, startPoint);
            var endPoint = Point3D.ReadFrom(e.SingleElement("EndPoint").CreateReader());
            XmlExt.SetReadonlyField(ref this, l => l.EndPoint, endPoint);
        }

        public void WriteXml(XmlWriter writer)
        {
            writer.WriteElement("StartPoint", this.StartPoint);
            writer.WriteElement("EndPoint", this.EndPoint);
        }
    }
}


text:
package org.unitils.database;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.unitils.core.UnitilsException;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.unitils.database.SqlUnitils.executeUpdate;
import static org.unitils.database.SqlUnitils.executeUpdateQuietly;

/**
 * @author Tim Ducheyne
 */
public class SqlUnitilsGetIntegerIntegrationTest {

    @Before
    public void initialize() {
        cleanup();
        executeUpdate("create table my_table (value int, other varchar)");
        executeUpdate("create table my_table (value int)", "database2");
        executeUpdate("insert into my_table (value, other) values (11, 'xxx')");
        executeUpdate("insert into my_table (value) values (22)", "database2");
    }

    @After
    public void cleanup() {
        executeUpdateQuietly("drop table my_table", "database1");
        executeUpdateQuietly("drop table my_table", "database2");
    }

    @Test
    public void defaultDatabase() throws Exception {
        int result = SqlUnitils.getInteger("select value from my_table");
        assertEquals(11, result);
    }

    @Test
    public void namedDatabase() throws Exception {
        int result = SqlUnitils.getInteger("select value from my_table", "database2");
        assertEquals(22, result);
    }

    @Test
    public void exceptionWhenNullValue() throws Exception {
        executeUpdate("update my_table set value = null");
        try {
            SqlUnitils.getInteger("select value from my_table");
            fail("UnitilsException expected");
        } catch (UnitilsException e) {
            assertEquals("Unable to get int value. Statement returned a null value: 'select value from my_table'.", e.getMessage());
        }
    }

    @Test
    public void exceptionWhenNotAnIntValue() throws Exception {
        try {
            SqlUnitils.getInteger("select other from my_table");
            fail("UnitilsException expected");
        } catch (UnitilsException e) {
            assertEquals("Unable to execute statement: 'select other from my_table'.\n" +
                    "Reason: BadSqlGrammarException: StatementCallback; bad SQL grammar [select other from my_table]; nested exception is java.sql.SQLSyntaxErrorException: incompatible data type in conversion: from SQL type VARCHAR to java.lang.Integer, value: xxx", e.getMessage());
        }
    }

    @Test
    public void exceptionWhenMoreThanOneResultFound() throws Exception {
        executeUpdate("insert into my_table (value) values (33)");
        try {
            SqlUnitils.getInteger("select value from my_table");
            fail("UnitilsException expected");
        } catch (UnitilsException e) {
            assertEquals("Unable to get value. Statement produced more than 1 result: 'select value from my_table'.\n" +
                    "Reason: IncorrectResultSizeDataAccessException: Incorrect result size: expected 1, actual 2", e.getMessage());
        }
    }

    @Test
    public void exceptionWhenNoResultsFound() throws Exception {
        try {
            SqlUnitils.getInteger("select value from my_table where value = 999");
            fail("UnitilsException expected");
        } catch (UnitilsException e) {
            assertEquals("Unable to get value. Statement did not produce any results: 'select value from my_table where value = 999'.\n" +
                    "Reason: EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0", e.getMessage());
        }
    }

    @Test
    public void exceptionWhenDatabaseNameNotFound() throws Exception {
        try {
            SqlUnitils.getInteger("select value from my_table", "xxx");
            fail("UnitilsException expected");
        } catch (UnitilsException e) {
            assertEquals("No configuration found for database with name 'xxx'", e.getMessage());
        }
    }

    @Test
    public void defaultDatabaseWhenNullDatabaseName() throws Exception {
        int result = SqlUnitils.getInteger("select value from my_table", null);
        assertEquals(11, result);
    }

    @Test
    public void exceptionWhenInvalidStatement() throws Exception {
        try {
            SqlUnitils.getInteger("xxx");
            fail("UnitilsException expected");
        } catch (UnitilsException e) {
            assertEquals("Unable to execute statement: 'xxx'.\n" +
                    "Reason: BadSqlGrammarException: StatementCallback; bad SQL grammar [xxx]; nested exception is java.sql.SQLSyntaxErrorException: unexpected token: XXX", e.getMessage());
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package oic.simulator.clientcontroller.manager;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.osgi.framework.Bundle;

import java.net.URL;

import oic.simulator.clientcontroller.Activator;
import oic.simulator.clientcontroller.utils.Constants;

/**
 * Class which loads the icons/images into the image registry, and has methods
 * to handle the image related requests from other UI modules.
 */
public class ImageManager {

    private static ImageManager imageManager;

    public static ImageManager getInstance() {
        if (null == imageManager) {
            imageManager = new ImageManager();
        }
        return imageManager;
    }

    static {
        ImageRegistry r = Activator.getDefault().getImageRegistry();
        Bundle bundle = Activator.getDefault().getBundle();

        r.put(Constants.CHECKED, ImageDescriptor.createFromURL(bundle
                .getEntry("icons/checked.gif")));
        r.put(Constants.UNCHECKED, ImageDescriptor.createFromURL(bundle
                .getEntry("icons/unchecked.gif")));

        // Log View related icons
        r.put(Constants.DEBUG_LOG, ImageDescriptor.createFromURL(bundle
                .getEntry("/icons/debug_log.gif")));
        r.put(Constants.INFO_LOG, ImageDescriptor.createFromURL(bundle
                .getEntry("/icons/info_log.gif")));
        r.put(Constants.WARNING_LOG, ImageDescriptor.createFromURL(bundle
                .getEntry("/icons/warning_log.gif")));
        r.put(Constants.ERROR_LOG, ImageDescriptor.createFromURL(bundle
                .getEntry("/icons/error_log.gif")));
        r.put(Constants.UNKNOWN_LOG, ImageDescriptor.createFromURL(bundle
                .getEntry("/icons/unknown_log.gif")));
    }

    public static Image getImage(String imagePath) {
        if (null == imagePath || imagePath.length() < 1) {
            return null;
        }
        URL imageURL = Activator.getDefault().getBundle().getEntry(imagePath);
        ImageDescriptor descriptor = ImageDescriptor.createFromURL(imageURL);
        return descriptor.createImage();
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>

<apidoc>
	<namespace name="SEIDS::Heaps">
		<class name="Heap" version="1.0">
			<implements>Countable</implements>
			<implements>Iterator</implements>

			<title>A generic heap class</title>
			<description>

					This is the abstract base class from which all the heap
					implementations in this library are derived.

					It provides the same interface as SplHeap with the extra
					method, <method>Heap::update</method> which allows one to
					update a node in the heap.

					With the exceptions of
					<method>Heap::recoverFromCorruption</method> and
					<method>Heap::value</method>, the methods implemented in
					this class are common to all of the heap implementations in
					this library.

				<note>
					This class is not intended for public consumption. Most
					users should instead be deriving from one of the 'almost
					concrete' classes, such as the pairing heap class,
					<class>Pairing::Heap</class>.
				</note>
			</description>

			<see>
				<link href="http://php.net/manual/en/spl.datastructures.php">The SplHeap class</link>
			</see>
			<see>
				<link href="http://php.net/manual/en/class.countable.php">The Countable interface</link>
			</see>
			<see>
				<link href="http://php.net/manual/en/class.iterator.php">The Iterator interface</link>
			</see>
			<see>
				<class>Pairing::Heap</class>
			</see>

			<property name="size" type="int" access="protected" version="1.0">
				The number of items in the heap.
			</property>

			<constructor access="public" abstract="yes" version="1.0">
				<title>Constructs a new heap</title>
				<description>
					This constructs a new heap. If no argument is supplied the
					heap will be empty.
				</description>

				<parameter type="array" name="array" optional="yes">An array of value to initialise the heap with.</parameter>
				<throws type="SEIDS::Heaps::ConstructorException"><parameter>array</parameter> is not an array.</throws>

				<see>
					<link href="http://php.net/manual/en/splheap.construct.php">SplHeap::__construct</link>
				</see>
			</constructor>

			<method name="compare" access="protected" abstract="yes" version="1.0">
				<title>Compare elements in order to place them correctly in the heap</title>
				<description>

						Compare <parameter>value1</parameter> with
						<parameter>value2</parameter>.

					<note>
						Having multiple elements with the same value in a Heap
						is not recommended. They will end up in an arbitrary
						relative position.
					</note>
					<warning>

						Throwing exceptions in <method>Heap::compare</method>
						can corrupt the Heap and place it in a blocked state.
						You can unblock it by calling
						<method>Heap::recoverFromCorruption</method>. However,
						some elements might not be placed correctly and it may
						hence break the heap-property.

</warning>
				</description>

				<parameter name="value1">The value of the first node being compared.</parameter>
				<parameter name="value2">The value of the second node being compared.</parameter>
				<return type="int">Result of the comparison, positive integer if <parameter>value1</parameter> is greater than <parameter>value2</parameter>, <literal>0</literal> if they are equal, negative integer otherwise.</return>

				<see>
					<link href="http://php.net/manual/en/splheap.compare.php">SplHeap::compare</link>
				</see>
			</method>

			<method name="extract" access="public" abstract="yes" version="1.0">
				<title>Extracts a node from top of the heap</title>
				<description>
					Extracts a node from top of the heap and sifts up.
				</description>

				<return>The value of the extracted node.</return>
				<throws type="SEIDS::Heaps::ExtractException">the data-structure is empty.</throws>

				<see>
					<link href="http://php.net/manual/en/splheap.extract.php">SplHeap::extract</link>
				</see>
			</method>

			<method name="insert" access="public" abstract="yes" version="1.0">
				<title>Inserts an element in the heap</title>
				<description>
					Insert <parameter>value</parameter> in the heap by sifting
					it up.
				</description>

				<parameter name="value">The value to insert.</parameter>
				<return type="bool"><constant>TRUE</constant>.</return>

				<see>
					<link href="http://php.net/manual/en/splheap.insert.php">SplHeap::insert</link>
				</see>
			</method>

			<method name="recoverFromCorruption" access="public" abstract="yes" version="1.0">
				<title>Recover from the corrupted state</title>
				<description>

						Recover from the corrupted state and allow further
						actions on the heap.

					<note>
						This function is undocumented in the SPL. It is provided
						only for API compatibility.
					</note>
				</description>

				<return type="bool"><constant>TRUE</constant>.</return>

				<see>
					<link href="http://php.net/manual/en/splheap.recoverfromcorruption.php">SplHeap::recoverFromCorruption</link>
				</see>
			</method>

			<method name="top" access="public" abstract="yes" version="1.0">
				<title>Peeks at the node from the top of the heap</title>
				<description>
					Returns the value at the top of the heap without removing
					it.
				</description>

				<return>The value of the node on the top.</return>
				<throws type="SEIDS::Heaps::PeekException">the data-structure is empty.</throws>

				<see>
					<link href="http://php.net/manual/en/splheap.top.php">SplHeap::top</link>
				</see>
			</method>

			<method name="update" access="public" abstract="yes" version="1.0">
				<title>Updates a node in the heap to a new value</title>
				<description>

						Updates a node in the heap from its current value to a
						new value, <parameter>value2</parameter>. Where the
						current value is given by executing
						<method>Heap::value</method> on
						<parameter>value1</parameter>.

						If two nodes in the heap have the same value then only
						one will be changed.

				</description>

				<parameter name="value1">The current value.</parameter>
				<parameter name="value2">The new value.</parameter>
				<throws type="SEIDS::Heaps::UpdateException"><parameter>value1</parameter> is not in the heap.</throws>
			</method>

			<method name="count" access="public" version="1.0">
				<title>Counts the number of elements in the heap</title>
				<description></description>

				<return type="int">Returns the number of elements in the heap.</return>

				<see>
					<link href="http://php.net/manual/en/splheap.count.php">SplHeap::count</link>
				</see>
				<see>
					<link href="http://php.net/manual/en/countable.count.php">Countable::count</link>
				</see>
			</method>

			<method name="current" access="public" version="1.0">
				<title>Return current node pointed by the iterator</title>
				<description>Get the current datastructure node.</description>

				<return>The current node value.</return>

				<see>
					<link href="http://php.net/manual/en/splheap.current.php">SplHeap::current</link>
				</see>
				<see>
					<link href="http://php.net/manual/en/iterator.current.php">Iterator::current</link>
				</see>
			</method>

			<method name="isEmpty" access="public" version="1.0">
				<title>Checks whether the heap is empty</title>
				<description></description>

				<return type="bool">Returns whether the heap is empty.</return>

				<see>
					<link href="http://php.net/manual/en/splheap.isempty.php">SplHeap::isEmpty</link>
				</see>
			</method>

			<method name="key" access="public" version="1.0">
				<title>Return current node index</title>
				<description>

						This function returns the current node index.

					<note>
						The current node is always viewed as the last node.
						Which means this function will always return
						'<method>Heap::count</method><literal> - 1</literal>'.
					</note>
				</description>

				<return type="int">The current node index.</return>

				<see>
					<link href="http://php.net/manual/en/splheap.key.php">SplHeap::key</link>
				</see>
				<see>
					<link href="http://php.net/manual/en/iterator.key.php">Iterator::key</link>
				</see>
			</method>

			<method name="next" access="public" version="1.0">
				<title>Move to the next node</title>
				<description>
					Move to the next node. This will delete the top node of the
					heap.
				</description>

				<see>
					<link href="http://php.net/manual/en/splheap.next.php">SplHeap::next</link>
				</see>
				<see>
					<link href="http://php.net/manual/en/iterator.next.php">Iterator::next</link>
				</see>
			</method>

			<method name="rewind" access="public" version="1.0">
				<title>Rewind iterator back to the start (no-op)</title>
				<description>
					This rewinds the iterator to the beginning. This is a no-op
					for heaps as the iterator is virtual and in fact never moves
					from the top of the heap.
				</description>

				<see>
					<link href="http://php.net/manual/en/splheap.rewind.php">SplHeap::rewind</link>
				</see>
				<see>
					<link href="http://php.net/manual/en/iterator.rewind.php">Iterator::rewind</link>
				</see>
			</method>

			<method name="valid" access="public" version="1.0">
				<title>Check whether the heap contains more nodes</title>
				<description>
					Checks if the heap contains any more nodes.
				</description>

				<return type="bool">Returns <constant>TRUE</constant> if the heap contains any more nodes, <constant>FALSE</constant> otherwise.</return>

				<see>
					<link href="http://php.net/manual/en/splheap.valid.php">SplHeap::valid</link>
				</see>
				<see>
					<link href="http://php.net/manual/en/iterator.valid.php">Iterator::valid</link>
				</see>
			</method>

			<method name="value" access="protected" version="1.0">
				<title>Returns the true value of a node</title>
				<description>

						Takes a node and extracts its 'value' as opposed to its
						priority within the heap.

						In this implementation, this method returns its argument
						unaltered. But it can be overloaded in child classes to
						produce an updatable heap suitable for use by a priority
						queue.

						This method is called by
						<method>Heap::hashtIndex</method> allowing one to update
						a node's priority without knowing its current priority.

				</description>

				<parameter name="value">The node.</parameter>
				<return>The 'value' of the node.</return>
			</method>

			<method name="hashtIndex" access="protected" version="1.0">
				<title>Returns an index for use in a hash table</title>
				<description>

						Takes a value and returns a value to be used to
						represent it as an index in a hash table. (Hash tables
						are used to 'tag' nodes for faster updates.)

						In most cases it simply returns
						<parameter>value</parameter> unaltered (unless
						<method>Heap::value</method> has been overridden), but
						in the case of objects it returns their
						<function>spl_object_hash</function>.

				</description>

				<parameter name="value">The value to be mapped.</parameter>
				<return>The hash table index.</return>

				<see>
					<link href="http://php.net/manual/en/function.spl-object-hash.php">spl_object_hash</link>
				</see>
			</method>
		</class>
	</namespace>
</apidoc>


text:
<?php

/* FOSUserBundle:Registration:checkEmail.html.twig */
class __TwigTemplate_0697fbcf2e2454d8c695dbbc69500b51 extends Twig_Template
{
    protected $parent;

    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->blocks = array(
            'fos_user_content' => array($this, 'block_fos_user_content'),
        );
    }

    public function getParent(array $context)
    {
        if (null === $this->parent) {
            $this->parent = $this->env->loadTemplate("FOSUserBundle::layout.html.twig");
        }

        return $this->parent;
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $context = array_merge($this->env->getGlobals(), $context);

        $this->getParent($context)->display($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    public function block_fos_user_content($context, array $blocks = array())
    {
        // line 4
        echo "    <p>";
        echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("registration.check_email", array("%email%" => $this->getAttribute($this->getContext($context, 'user'), "email", array(), "any", false)), "FOSUserBundle"), "html");
        echo "</p>
";
    }

    public function getTemplateName()
    {
        return "FOSUserBundle:Registration:checkEmail.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }
}


text:
LookingForSatchels (LFS) lets you select which dungeons you want to do, and tells you when the Call to Arms buff for one of these dungeons is active.

## Quick guide

I installed the addon. What now?

1. Set your role(s) to scan

    Type `/lfs roles x x x` (where `x` is either `0` or `1`) to define if you want to scan for Tank, Heal and/or Damage (in that order). `/lfs roles 0 1 0` for example will scan for Heal only. `/lfs roles 1 0 1` will scan for Tank and Damage, but not for Heal.

2. Select dungeons

    Open the Dungeon Finder window, select the dungeon(s) you want to scan, and press the L+ button for each dungeon to add them to your watch list. When the Raidfinder window is open, you can SHIFT-Click the L+ button to add all Raidfinder wings to the watch list.

3. Select role(s) to queue

    In any Dungeon Finder window select the role(s) you want to queue for. These are not the roles being scanned! You can scan for Tank only, but queue for Tank/Damage.

4. Done

    Sit back and wait for the addon to find a satchel. For more options, like what the "L" in the center of the screen is for, how you can move/hide/interact with it and more, read below!

## General functions

Click the L+ button to add a dungeon to your watch list; click again to remove it. (Shift-Click to add all Raidfinder wings to your watch list, Ctrl-Click to remove all Raidfinder wings from the list)

![click the button](Screenshots/q1449860524768lk.LFSpressthebutton.jpg)

Whenever you have a dungeon selected LFS will tell you when the Call to Arms buff is active, so you can get the most out of random queuing. The addon will throw a Raid Warning, write a line to chat, flash the Windows Taskbar, and play a sound.

![taskbar flash](Screenshots/q1449860534932lk.wowflashtaskbar.jpg)

Ingame you have the option to show a one-click-queue popup which lets you queue for a dungeon without needing to click through the Blizzard UI to find the right dungeon. It also shows which roles will get the bonus reward, so you won't accidentally do dungeons without getting a satchel at the end.

![one click queue](Screenshots/q1503430584149lk.lfs.queue.popup.jpg)

You can also select the roles you want to queue with from the popup.

![one click queue roles](Screenshots/q1503430590157lk.lfs.queue.popup.select.roles.jpg)

## Command Options

- `/lfs` for command options.

- `/lfs roles ‹tank› ‹heal› ‹damage›` Replace the roles with `0`s and `1`s, `1` meaning the addon will search for that role.

    Example: `/lfs roles 1 0 1` will tell you when you get a special reward for tanking or dealing damage, but will ignore rewards for healers.

- `/lfs move` to move the search indicator around. Red: No dungeon selected. Yellow: Searching. Green: Satchel found. Grey: Scanning paused.

- `/lfs hide` if you want to hide the indicator (`/lfs show` to show it again).

- To change the sound file enter `/lfs sound`, followed by the sound id:

    `/lfs sound 120`

    This will change the sound to `120`, the default coin sound. See [this link](https://wow.gamepedia.com/API_PlaySound) for available sound files (shown as "soundKitID").

- `/lfs togglescan` or shift+click on the search indicator: quickly toggle scanning on/off

- `/lfs first` toggle whether require first-run (valor) reward, to ignore a satchel when you already completed that dungeon/raid finder wing this day/week.

## Search Indicator Options

The "L" in the center of the screen is a status indicator and shows what the addon is doing at the moment.

- Red color: No dungeon selected. Yellow color: Searching. Green color: Satchel found. Grey color: Scanning paused.

- Shift+Left-Click: toggle scanning

- Control+Left-Click: clear watch list

- Right-Click: Rescan all instances. Useful if you dismissed a popup window by accident.

---

Go ahead, tab out of the game, watch [your favourite YouTube video](https://www.youtube.com/watch?v=J---aiyznGQ) and get back when it's time to grab the monies!

---

Future plans:

integrate the indicator functionality into a Minimap button,
separate roles per dungeon (e.g. search for Tank-satchel in Random Heroic Dungeon and Heal-satchel in RaidFinder),


text:
<?xml version="1.0" encoding="UTF-8"?>
<testPlan xmlns="urn:io.apiman.test:2014:02:testPlan">

  <!-- Make sure Gateways are working properly -->
  <testGroup name="Gateway Management">
    <test name="Gateway 1">test-plan-data/gateways/001_create-1.resttest</test>
    <test name="Gateway 2">test-plan-data/gateways/002_create-2.resttest</test>
    <test name="Gateway 3">test-plan-data/gateways/003_create-3.resttest</test>
    <test name="Get Gateway 2">test-plan-data/gateways/004_get-2.resttest</test>
    <test name="List All Gateways [1]">test-plan-data/gateways/005_list-all.resttest</test>
    <test name="Update Gateway 1">test-plan-data/gateways/006_update-1.resttest</test>
    <test name="Delete Gateway 3">test-plan-data/gateways/007_delete-3.resttest</test>
    <test name="List All Gateways [2]">test-plan-data/gateways/008_list-all.resttest</test>
    <test name="Get Gateway 1 (Updated)">test-plan-data/gateways/009_get-1.resttest</test>

    <test name="Test Gateway">test-plan-data/gateways/010_test_gateway_success.resttest</test>

    <test name="Create Gateway Endpoint Test">test-plan-data/gateways/011_create-gateway-to-test-get-endpoint.resttest</test>
    <test name="Get gateway endpoint">test-plan-data/gateways/012-list-gateways.resttest</test>
  </testGroup>

</testPlan>


text:
package org.apache.lucene.facet.index;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.TextField;

import org.apache.lucene.facet.index.attributes.CategoryAttribute;
import org.apache.lucene.facet.index.attributes.CategoryAttributesIterable;
import org.apache.lucene.facet.index.categorypolicy.OrdinalPolicy;
import org.apache.lucene.facet.index.categorypolicy.PathPolicy;
import org.apache.lucene.facet.index.params.DefaultFacetIndexingParams;
import org.apache.lucene.facet.index.params.FacetIndexingParams;
import org.apache.lucene.facet.index.streaming.CategoryAttributesStream;
import org.apache.lucene.facet.index.streaming.CategoryListTokenizer;
import org.apache.lucene.facet.index.streaming.CategoryParentsStream;
import org.apache.lucene.facet.index.streaming.CategoryTokenizer;
import org.apache.lucene.facet.index.streaming.CountingListTokenizer;
import org.apache.lucene.facet.taxonomy.CategoryPath;
import org.apache.lucene.facet.taxonomy.TaxonomyWriter;

/**
 * A utility class which allows attachment of {@link CategoryPath}s or
 * {@link CategoryAttribute}s to a given document using a taxonomy.

 * Construction could be done with either a given {@link FacetIndexingParams} or
 * the default implementation {@link DefaultFacetIndexingParams}.

 * A CategoryDocumentBuilder can be reused by repeatedly setting the categories
 * and building the document. Categories are provided either as
 * {@link CategoryAttribute} elements through {@link #setCategories(Iterable)},
 * or as {@link CategoryPath} elements through
 * {@link #setCategoryPaths(Iterable)}.
 *

 * Note that both {@link #setCategories(Iterable)} and
 * {@link #setCategoryPaths(Iterable)} return this
 * {@link CategoryDocumentBuilder}, allowing the following pattern: {@code new
 * CategoryDocumentBuilder(taxonomy,
 * params).setCategories(categories).build(doc)}.
 *
 * @lucene.experimental
 */
public class CategoryDocumentBuilder {

  /**
   * A {@link TaxonomyWriter} for adding categories and retrieving their
   * ordinals.
   */
  protected final TaxonomyWriter taxonomyWriter;

  /**
   * Parameters to be used when indexing categories.
   */
  protected final FacetIndexingParams indexingParams;

  /**
   * A list of fields which is filled at ancestors' construction and used
   * during {@link CategoryDocumentBuilder#build(Document)}.
   */
  protected final ArrayList<Field> fieldList = new ArrayList<Field>();

  protected Map<String, List<CategoryAttribute>> categoriesMap;

  /**
   * Creating a facets document builder with default facet indexing
   * parameters.

   * See:
   * {@link #CategoryDocumentBuilder(TaxonomyWriter, FacetIndexingParams)}
   *
   * @param taxonomyWriter
   *            to which new categories will be added, as well as translating
   *            known categories to ordinals
   *
   */
  public CategoryDocumentBuilder(TaxonomyWriter taxonomyWriter) {
    this(taxonomyWriter, new DefaultFacetIndexingParams());
  }

  /**
   * Creating a facets document builder with a given facet indexing parameters
   * object.

   *
   * @param taxonomyWriter
   *            to which new categories will be added, as well as translating
   *            known categories to ordinals
   * @param params
   *            holds all parameters the indexing process should use such as
   *            category-list parameters
   */
  public CategoryDocumentBuilder(TaxonomyWriter taxonomyWriter,
      FacetIndexingParams params) {
    this.taxonomyWriter = taxonomyWriter;
    this.indexingParams = params;
    this.categoriesMap = new HashMap<String, List<CategoryAttribute>>();
  }

  /**
   * Set the categories of the document builder from an {@link Iterable} of
   * {@link CategoryPath} objects.
   *
   * @param categoryPaths
   *            An iterable of CategoryPath objects which holds the categories
   *            (facets) which will be added to the document at
   *            {@link #build(Document)}
   * @return This CategoryDocumentBuilder, to enable this one line call:
   *         {@code new} {@link #CategoryDocumentBuilder(TaxonomyWriter)}.
   *         {@link #setCategoryPaths(Iterable)}.{@link #build(Document)}.
   * @throws IOException If there is a low-level I/O error.
   */
  public CategoryDocumentBuilder setCategoryPaths(
      Iterable<CategoryPath> categoryPaths) throws IOException {
    if (categoryPaths == null) {
      fieldList.clear();
      return this;
    }
    return setCategories(new CategoryAttributesIterable(categoryPaths));
  }

  /**
   * Set the categories of the document builder from an {@link Iterable} of
   * {@link CategoryAttribute} objects.
   *
   * @param categories
   *            An iterable of {@link CategoryAttribute} objects which holds
   *            the categories (facets) which will be added to the document at
   *            {@link #build(Document)}
   * @return This CategoryDocumentBuilder, to enable this one line call:
   *         {@code new} {@link #CategoryDocumentBuilder(TaxonomyWriter)}.
   *         {@link #setCategories(Iterable)}.{@link #build(Document)}.
   * @throws IOException If there is a low-level I/O error.
   */
  public CategoryDocumentBuilder setCategories(
      Iterable<CategoryAttribute> categories) throws IOException {
    fieldList.clear();
    if (categories == null) {
      return this;
    }

    // get field-name to a list of facets mapping as different facets could
    // be added to different category-lists on different fields
    fillCategoriesMap(categories);

    // creates a different stream for each different field
    for (Entry<String, List<CategoryAttribute>> e : categoriesMap
        .entrySet()) {
      // create a category attributes stream for the array of facets
      CategoryAttributesStream categoryAttributesStream = new CategoryAttributesStream(
          e.getValue());

      // Set a suitable {@link TokenStream} using
      // CategoryParentsStream, followed by CategoryListTokenizer and
      // CategoryTokenizer composition (the ordering of the last two is
      // not mandatory).
      CategoryParentsStream parentsStream = (CategoryParentsStream) getParentsStream(categoryAttributesStream);
      CategoryListTokenizer categoryListTokenizer = getCategoryListTokenizer(parentsStream);
      CategoryTokenizer stream = getCategoryTokenizer(categoryListTokenizer);

      // Finally creating a suitable field with stream and adding it to a
      // master field-list, used during the build process (see
      // super.build())
      FieldType ft = new FieldType(TextField.TYPE_NOT_STORED);
      ft.setOmitNorms(true);
      fieldList.add(new Field(e.getKey(), stream, ft));
    }

    return this;
  }

  /**
   * Get a stream of categories which includes the parents, according to
   * policies defined in indexing parameters.
   *
   * @param categoryAttributesStream
   *            The input stream
   * @return The parents stream.
   * @see OrdinalPolicy OrdinalPolicy (for policy of adding category tokens for parents)
   * @see PathPolicy PathPolicy (for policy of adding category list tokens for parents)
   */
  protected TokenStream getParentsStream(
      CategoryAttributesStream categoryAttributesStream) {
    return new CategoryParentsStream(categoryAttributesStream,
        taxonomyWriter, indexingParams);
  }

  /**
   * Fills the categories mapping between a field name and a list of
   * categories that belongs to it according to this builder's
   * {@link FacetIndexingParams} object
   *
   * @param categories
   *            Iterable over the category attributes
   */
  protected void fillCategoriesMap(Iterable<CategoryAttribute> categories)
      throws IOException {
    categoriesMap.clear();

    // for-each category
    for (CategoryAttribute category : categories) {
      // extracting the field-name to which this category belongs
      String fieldName = indexingParams.getCategoryListParams(
          category.getCategoryPath()).getTerm().field();

      // getting the list of categories which belongs to that field
      List<CategoryAttribute> list = categoriesMap.get(fieldName);

      // if no such list exists
      if (list == null) {
        // adding a new one to the map
        list = new ArrayList<CategoryAttribute>();
        categoriesMap.put(fieldName, list);
      }

      // adding the new category to the list
      list.add(category.clone());
    }
  }

  /**
   * Get a category list tokenizer (or a series of such tokenizers) to create
   * the category list tokens.
   *
   * @param categoryStream
   *            A stream containing {@link CategoryAttribute} with the
   *            relevant data.
   * @return The category list tokenizer (or series of tokenizers) to be used
   *         in creating category list tokens.
   */
  protected CategoryListTokenizer getCategoryListTokenizer(
      TokenStream categoryStream) {
    return getCountingListTokenizer(categoryStream);
  }

  /**
   * Get a {@link CountingListTokenizer} for creating counting list token.
   *
   * @param categoryStream
   *            A stream containing {@link CategoryAttribute}s with the
   *            relevant data.
   * @return A counting list tokenizer to be used in creating counting list
   *         token.
   */
  protected CountingListTokenizer getCountingListTokenizer(
      TokenStream categoryStream) {
    return new CountingListTokenizer(categoryStream, indexingParams);
  }

  /**
   * Get a {@link CategoryTokenizer} to create the category tokens.
   * This method can be overridden for adding more attributes to the category
   * tokens.
   *
   * @param categoryStream
   *            A stream containing {@link CategoryAttribute} with the
   *            relevant data.
   * @return The {@link CategoryTokenizer} to be used in creating category
   *         tokens.
   * @throws IOException If there is a low-level I/O error.
   */
  protected CategoryTokenizer getCategoryTokenizer(TokenStream categoryStream)
      throws IOException {
    return new CategoryTokenizer(categoryStream, indexingParams);
  }

  /** Adds the fields created in one of the "set" methods to the document */
  public Document build(Document doc) {
    for (Field f : fieldList) {
      doc.add(f);
    }
    return doc;
  }

}


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenProtocolInterpreter.ParameterSet;
using System.Linq;

namespace MIDTesters.ParameterSet
{
    [TestClass]
    public class TestMid0024 : DefaultMidTests<Mid0024>
    {
        [TestMethod]
        public void Mid0024Revision1()
        {
            string package = "00200024            ";
            var mid = _midInterpreter.Parse(package);

            Assert.AreEqual(typeof(Mid0024), mid.GetType());
            AssertEqualPackages(package, mid, true);
        }

        [TestMethod]
        public void Mid0024ByteRevision1()
        {
            string package = "00200024            ";
            byte[] bytes = GetAsciiBytes(package);
            var mid = _midInterpreter.Parse(bytes);

            Assert.AreEqual(typeof(Mid0024), mid.GetType());
            AssertEqualPackages(bytes, mid, true);
        }
    }
}


text:
<?php

namespace Proxies\__CG__\Admin\EinstitutAdminBundle\Entity;

/**
 * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR
 */
class Dossier extends \Admin\EinstitutAdminBundle\Entity\Dossier implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with
     *      three parameters, being respectively the proxy object to be initialized, the method that triggered the
     *      initialization process and an array of ordered parameters that were passed to that method.
     *
     * @see \Doctrine\Common\Persistence\Proxy::__setInitializer
     */
    public $__initializer__;

    /**
     * @var \Closure the callback responsible of loading properties that need to be copied in the cloned object
     *
     * @see \Doctrine\Common\Persistence\Proxy::__setCloner
     */
    public $__cloner__;

    /**
     * @var boolean flag indicating if this object was already initialized
     *
     * @see \Doctrine\Common\Persistence\Proxy::__isInitialized
     */
    public $__isInitialized__ = false;

    /**
     * @var array properties to be lazy loaded, with keys being the property
     *            names and values being their default values
     *
     * @see \Doctrine\Common\Persistence\Proxy::__getLazyProperties
     */
    public static $lazyPropertiesDefaults = array();

    /**
     * @param \Closure $initializer
     * @param \Closure $cloner
     */
    public function __construct($initializer = null, $cloner = null)
    {

        $this->__initializer__ = $initializer;
        $this->__cloner__      = $cloner;
    }

    /**
     *
     * @return array
     */
    public function __sleep()
    {
        if ($this->__isInitialized__) {
            return array('__isInitialized__', '' . "\0" . 'Admin\\EinstitutAdminBundle\\Entity\\Dossier' . "\0" . 'id', '' . "\0" . 'Admin\\EinstitutAdminBundle\\Entity\\Dossier' . "\0" . 'numDossier', '' . "\0" . 'Admin\\EinstitutAdminBundle\\Entity\\Dossier' . "\0" . 'fichiers', '' . "\0" . 'Admin\\EinstitutAdminBundle\\Entity\\Dossier' . "\0" . 'candidat');
        }

        return array('__isInitialized__', '' . "\0" . 'Admin\\EinstitutAdminBundle\\Entity\\Dossier' . "\0" . 'id', '' . "\0" . 'Admin\\EinstitutAdminBundle\\Entity\\Dossier' . "\0" . 'numDossier', '' . "\0" . 'Admin\\EinstitutAdminBundle\\Entity\\Dossier' . "\0" . 'fichiers', '' . "\0" . 'Admin\\EinstitutAdminBundle\\Entity\\Dossier' . "\0" . 'candidat');
    }

    /**
     *
     */
    public function __wakeup()
    {
        if ( ! $this->__isInitialized__) {
            $this->__initializer__ = function (Dossier $proxy) {
                $proxy->__setInitializer(null);
                $proxy->__setCloner(null);

                $existingProperties = get_object_vars($proxy);

                foreach ($proxy->__getLazyProperties() as $property => $defaultValue) {
                    if ( ! array_key_exists($property, $existingProperties)) {
                        $proxy->$property = $defaultValue;
                    }
                }
            };

        }
    }

    /**
     *
     */
    public function __clone()
    {
        $this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', array());
    }

    /**
     * Forces initialization of the proxy
     */
    public function __load()
    {
        $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', array());
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __isInitialized()
    {
        return $this->__isInitialized__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setInitialized($initialized)
    {
        $this->__isInitialized__ = $initialized;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setInitializer(\Closure $initializer = null)
    {
        $this->__initializer__ = $initializer;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __getInitializer()
    {
        return $this->__initializer__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setCloner(\Closure $cloner = null)
    {
        $this->__cloner__ = $cloner;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific cloning logic
     */
    public function __getCloner()
    {
        return $this->__cloner__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     * @static
     */
    public function __getLazyProperties()
    {
        return self::$lazyPropertiesDefaults;
    }

    /**
     * {@inheritDoc}
     */
    public function getId()
    {
        if ($this->__isInitialized__ === false) {
            return (int)  parent::getId();
        }

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array());

        return parent::getId();
    }

    /**
     * {@inheritDoc}
     */
    public function setNumDossier($numDossier)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setNumDossier', array($numDossier));

        return parent::setNumDossier($numDossier);
    }

    /**
     * {@inheritDoc}
     */
    public function getNumDossier()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getNumDossier', array());

        return parent::getNumDossier();
    }

    /**
     * {@inheritDoc}
     */
    public function addFichier(\Admin\EinstitutAdminBundle\Entity\Fichier $fichiers)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'addFichier', array($fichiers));

        return parent::addFichier($fichiers);
    }

    /**
     * {@inheritDoc}
     */
    public function removeFichier(\Admin\EinstitutAdminBundle\Entity\Fichier $fichiers)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'removeFichier', array($fichiers));

        return parent::removeFichier($fichiers);
    }

    /**
     * {@inheritDoc}
     */
    public function getFichiers()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getFichiers', array());

        return parent::getFichiers();
    }

    /**
     * {@inheritDoc}
     */
    public function setCandidat(\Admin\EinstitutAdminBundle\Entity\Candidat $candidat)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCandidat', array($candidat));

        return parent::setCandidat($candidat);
    }

    /**
     * {@inheritDoc}
     */
    public function getCandidat()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getCandidat', array());

        return parent::getCandidat();
    }

}


text:
// The MIT License (MIT)
//
// Copyright (c) 2015-2018 Rasmus Mikkelsen
// Copyright (c) 2015-2018 eBay Software Foundation
// https://github.com/rasmus/EventFlow
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using EventFlow.Aggregates;
using EventFlow.EventStores;
using EventFlow.ReadStores;
using EventFlow.ReadStores.InMemory;
using EventFlow.TestHelpers;
using EventFlow.TestHelpers.Aggregates;
using EventFlow.TestHelpers.Aggregates.Events;
using EventFlow.TestHelpers.Extensions;
using FluentAssertions;
using Moq;
using NUnit.Framework;

namespace EventFlow.Tests.UnitTests.ReadStores
{
    [Category(Categories.Unit)]
    public class AggregateReadStoreManagerTests : ReadStoreManagerTestSuite<AggregateReadStoreManager<
        ThingyAggregate,
        ThingyId,
        IReadModelStore<TestReadModel>,
        TestReadModel>>
    {
        private Mock<IEventStore> _eventStoreMock;

        [SetUp]
        public void SetUp()
        {
            _eventStoreMock = InjectMock<IEventStore>();
        }

        [Test]
        public async Task EventsAreApplied()
        {
            // Arrange
            var thingyId = A<ThingyId>();
            var emittedEvents = new[]
                {
                    ToDomainEvent(thingyId, A<ThingyPingEvent>(), 3),
                };
            Arrange_ReadModelStore_UpdateAsync(ReadModelEnvelope<TestReadModel>.With(
                thingyId.Value,
                A<TestReadModel>(),
                2));

            // Act
            await Sut.UpdateReadStoresAsync(emittedEvents, CancellationToken.None).ConfigureAwait(false);

            // Assert
            AppliedDomainEvents.Should().HaveCount(emittedEvents.Length);
            AppliedDomainEvents.Should().BeEquivalentTo(emittedEvents);
        }

        [Test]
        public async Task AlreadyAppliedEventsAreNotApplied()
        {
            // Arrange
            var thingyId = A<ThingyId>();
            var emittedEvents = new[]
                {
                    ToDomainEvent(thingyId, A<ThingyPingEvent>(), 3),
                };
            var resultingReadModelUpdates = Arrange_ReadModelStore_UpdateAsync(ReadModelEnvelope<TestReadModel>.With(
                thingyId.Value,
                A<TestReadModel>(),
                3));

            // Act
            await Sut.UpdateReadStoresAsync(emittedEvents, CancellationToken.None).ConfigureAwait(false);

            // Assert
            AppliedDomainEvents.Should().BeEmpty();
            resultingReadModelUpdates.Single().IsModified.Should().BeFalse();
        }

        [Test]
        public async Task OutdatedEventsAreNotApplied()
        {
            // Arrange
            var thingyId = A<ThingyId>();
            var emittedEvents = new[]
                {
                    ToDomainEvent(thingyId, A<ThingyPingEvent>(), 1),
                };
            Arrange_ReadModelStore_UpdateAsync(ReadModelEnvelope<TestReadModel>.With(
                thingyId.Value,
                A<TestReadModel>(),
                3));

            // Act
            await Sut.UpdateReadStoresAsync(emittedEvents, CancellationToken.None);

            // Assert
            AppliedDomainEvents.Should().BeEmpty();
        }

        [Test]
        public async Task StoredEventsAreAppliedIfThereAreMissingEvents()
        {
            // Arrange
            var thingyId = A<ThingyId>();
            var emittedEvents = new[]
                {
                    ToDomainEvent(thingyId, A<ThingyPingEvent>(), 3),
                    ToDomainEvent(thingyId, A<ThingyPingEvent>(), 4),
                };
            var missingEvents = new[]
                {
                    ToDomainEvent(thingyId, A<ThingyPingEvent>(), 2)
                };
            var storedEvents = Enumerable.Empty<IDomainEvent<ThingyAggregate, ThingyId>>()
                .Concat(missingEvents)
                .Concat(emittedEvents)
                .ToArray();
            Arrange_ReadModelStore_UpdateAsync(ReadModelEnvelope<TestReadModel>.With(
                thingyId.Value,
                A<TestReadModel>(),
                1));
            _eventStoreMock.Arrange_LoadEventsAsync(storedEvents);

            // Act
            await Sut.UpdateReadStoresAsync(emittedEvents, CancellationToken.None).ConfigureAwait(false);

            // Assert
            AppliedDomainEvents.Should().HaveCount(storedEvents.Length);
            AppliedDomainEvents.Should().BeEquivalentTo(storedEvents);
        }

        [Test]
        public void ThrowsIfReadModelSubscribesNoEvents()
        {
            Action a = () =>
            {
                var _ = new SingleAggregateReadStoreManager<InMemoryReadStore<ReadModelWithoutEvents>,
                    ReadModelWithoutEvents>(null, null, null, null, null);
            };

            a.Should().Throw<TypeInitializationException>().WithInnerException<Exception>().WithMessage("*does not implement any*");
        }

        [Test]
        public void ThrowsIfReadModelSubscribesSameEventTwice()
        {
            Action a = () =>
            {
                var _ = new SingleAggregateReadStoreManager<InMemoryReadStore<ReadModelWithAmbigiousEvents>,
                    ReadModelWithAmbigiousEvents>(null, null, null, null, null);
            };

            a.Should().Throw<TypeInitializationException>().WithInnerException<Exception>().WithMessage("*implements ambiguous*");
        }

        private class ReadModelWithoutEvents : IReadModel
        {
        }

        private class ReadModelWithAmbigiousEvents : IReadModel,
            IAmReadModelFor<ThingyAggregate, ThingyId, ThingyPingEvent>,
            IAmAsyncReadModelFor<ThingyAggregate, ThingyId, ThingyPingEvent>
        {
            public void Apply(IReadModelContext context, IDomainEvent<ThingyAggregate, ThingyId, ThingyPingEvent> domainEvent)
            {
            }

            public Task ApplyAsync(IReadModelContext context, IDomainEvent<ThingyAggregate, ThingyId, ThingyPingEvent> domainEvent,
                CancellationToken cancellationToken)
            {
                return Task.FromResult(true);
            }
        }
    }
}


text:
package ctpolicy

import (
	"testing"

	"github.com/google/certificate-transparency-go/x509"

	"github.com/kylelemons/godebug/pretty"
)

func wantedGroups(goog int, nonGoog int, base int, minusBob bool) LogPolicyData {
	gi := LogPolicyData{
		"Google-operated": {
			Name: "Google-operated",
			LogURLs: map[string]bool{
				"https://ct.googleapis.com/logs/argon2020/": true,
				"https://ct.googleapis.com/aviator/":        true,
				"https://ct.googleapis.com/icarus/":         true,
				"https://ct.googleapis.com/rocketeer/":      true,
				"https://ct.googleapis.com/racketeer/":      true,
			},
			MinInclusions: goog,
			IsBase:        false,
			LogWeights: map[string]float32{
				"https://ct.googleapis.com/logs/argon2020/": 1.0,
				"https://ct.googleapis.com/aviator/":        1.0,
				"https://ct.googleapis.com/icarus/":         1.0,
				"https://ct.googleapis.com/rocketeer/":      1.0,
				"https://ct.googleapis.com/racketeer/":      1.0,
			},
		},
		"Non-Google-operated": {
			Name: "Non-Google-operated",
			LogURLs: map[string]bool{
				"https://log.bob.io": true,
			},
			MinInclusions: nonGoog,
			IsBase:        false,
			LogWeights: map[string]float32{
				"https://log.bob.io": 1.0,
			},
		},
		BaseName: {
			Name: BaseName,
			LogURLs: map[string]bool{
				"https://ct.googleapis.com/logs/argon2020/": true,
				"https://ct.googleapis.com/aviator/":        true,
				"https://ct.googleapis.com/icarus/":         true,
				"https://ct.googleapis.com/rocketeer/":      true,
				"https://ct.googleapis.com/racketeer/":      true,
				"https://log.bob.io":                        true,
			},
			MinInclusions: base,
			IsBase:        true,
			LogWeights: map[string]float32{
				"https://ct.googleapis.com/logs/argon2020/": 1.0,
				"https://ct.googleapis.com/aviator/":        1.0,
				"https://ct.googleapis.com/icarus/":         1.0,
				"https://ct.googleapis.com/rocketeer/":      1.0,
				"https://ct.googleapis.com/racketeer/":      1.0,
				"https://log.bob.io":                        1.0,
			},
		},
	}
	if minusBob {
		delete(gi[BaseName].LogURLs, "https://log.bob.io")
		delete(gi[BaseName].LogWeights, "https://log.bob.io")
		delete(gi["Non-Google-operated"].LogURLs, "https://log.bob.io")
		delete(gi["Non-Google-operated"].LogWeights, "https://log.bob.io")
	}
	return gi
}

func TestCheckChromePolicy(t *testing.T) {
	tests := []struct {
		name string
		cert *x509.Certificate
		want LogPolicyData
	}{
		{
			name: "Short",
			cert: getTestCertPEMShort(),
			want: wantedGroups(1, 1, 2, false),
		},
		{
			name: "2-year",
			cert: getTestCertPEM2Years(),
			want: wantedGroups(1, 1, 3, false),
		},
		{
			name: "3-year",
			cert: getTestCertPEM3Years(),
			want: wantedGroups(1, 1, 4, false),
		},
		{
			name: "Long",
			cert: getTestCertPEMLongOriginal(),
			want: wantedGroups(1, 1, 5, false),
		},
	}

	var policy ChromeCTPolicy
	sampleLogList := sampleLogList(t)

	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			got, err := policy.LogsByGroup(test.cert, sampleLogList)
			if diff := pretty.Compare(test.want, got); diff != "" {
				t.Errorf("LogsByGroup: (-want +got)\n%s", diff)
			}
			if err != nil {
				t.Errorf("LogsByGroup returned an error when not expected: %v", err)
			}
		})
	}
}

func TestCheckChromePolicyWarnings(t *testing.T) {
	tests := []struct {
		name    string
		cert    *x509.Certificate
		want    LogPolicyData
		warning string
	}{
		{
			name:    "Short",
			cert:    getTestCertPEMShort(),
			want:    LogPolicyData{},
			warning: "trying to assign 1 minimal inclusion number while only 0 logs are part of group \"Non-Google-operated\"",
		},
		{
			name:    "2-year",
			cert:    getTestCertPEM2Years(),
			want:    LogPolicyData{},
			warning: "trying to assign 1 minimal inclusion number while only 0 logs are part of group \"Non-Google-operated\"",
		},
		{
			name:    "3-year",
			cert:    getTestCertPEM3Years(),
			want:    LogPolicyData{},
			warning: "trying to assign 1 minimal inclusion number while only 0 logs are part of group \"Non-Google-operated\"",
		},
		{
			name:    "Long",
			cert:    getTestCertPEMLongOriginal(),
			want:    LogPolicyData{},
			warning: "trying to assign 1 minimal inclusion number while only 0 logs are part of group \"Non-Google-operated\"",
		},
	}

	var policy ChromeCTPolicy
	sampleLogList := sampleLogList(t)
	// Removing Bob-log.
	sampleLogList.Operators = sampleLogList.Operators[:1]

	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {

			got, err := policy.LogsByGroup(test.cert, sampleLogList)
			if diff := pretty.Compare(test.want, got); diff != "" {
				t.Errorf("LogsByGroup: (-want +got)\n%s", diff)
			}
			if err == nil && len(test.warning) > 0 {
				t.Errorf("LogsByGroup returned no error when expected")
			} else if err != nil {
				if err.Error() != test.warning {
					t.Errorf("LogsByGroup returned error message %q while expected %q", err.Error(), test.warning)
				}
			}
		})
	}
}


text:
const mouse = new Mouse();
const keyboard = new Keyboard();
let stage, renderer;
let deltaTime = 1 / 60;

// TODO: on resize event: change size of canvas etc..
$(window).on('resize', function () {
  if (!renderer) { return; }
  let w = $(this);
  renderer.resize(w.width(), w.height());
  stage.position.x = renderer.width / 2;
  stage.position.y = renderer.height / 2;
});

class App {
  constructor() {
    this.timeElapsed = 0;
    this.initRenderer();
    this.initStage();

    this.game = new Game();
    this.state = this.game.update.bind(this.game);

    this.loadTextures().load((a, b, c) => {
      this.game.initPostLoad();

      this.gameLoop();
    });
  }

  initRenderer() {
    renderer = PIXI.autoDetectRenderer({
      width: window.innerWidth,
      height: window.innerHeight,
      backgroundColor: 0x6b8155,
      antialias: true
    });
    document.getElementById('display').appendChild(renderer.view);
  }

  initStage() {
    stage = new PIXI.Container();
    stage.interactive = true;
    stage.position.x = renderer.width / 2;
    stage.position.y = renderer.height / 2;
  }

  loadTextures() {
    return PIXI.loader
      .add("/images/shotgun.png")
      .add("/images/axe.png")
      .add("/images/tree.png")
      .add("/images/bullet.png")
      .add("/images/stone.png")
      .add("/images/maggot.png")
      .add("/images/wall.png")
      .add("/images/cow.png");
  }

  connectToServer(playerName) {
    this.socket = io();
    this.game.bindSocket(playerName);
    mouse.bindSocket();
    keyboard.bindSocket();
  }

  gameLoop(dt = 0.1) {
    deltaTime = (dt - this.timeElapsed) / 1000;
    this.timeElapsed = dt;
    this.state();
    renderer.render(stage);
    requestAnimationFrame(this.gameLoop.bind(this));
  }

  AppStart(playerName) {
    this.connectToServer(playerName);
  }
}
// Start the application
let app = new App();

$(document).on('keyup', '#txtName', (e)=>{e.key == 'Enter' && (startGame())});
$(document).on('click', '#btStartGame', startGame);

function startGame() {
  let playerName = $('#txtName').val() || 'Unknown';
  $('.startMenu').hide();
  app.AppStart(playerName);
}

// Global helper functions
function radiansToDegrees(angle) { return angle * 180 / Math.PI; }
function rotateToPoint(mx, my, px, py) {
  var dist_Y = my - py;
  var dist_X = mx - px;
  var angle = Math.atan2(dist_Y, dist_X);
  return angle;
}


text:
using NPOI.OpenXml4Net.OPC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NPOI.XSSF.UserModel
{
    public class XSSFVBAPart : POIXMLDocumentPart
    {

        /**
         * Create a new XSSFVBAPart node
         */
        public XSSFVBAPart() : base()
        {
        }

        /**
         * Construct XSSFVBAPart from a package part
         *
         * @param part the package part holding the VBA data,
         * @param rel  the package relationship holding this part
         */
        public XSSFVBAPart(PackagePart part)
                : base(part)
        {

        }
        [Obsolete("deprecated in POI 3.14, scheduled for removal in POI 3.16")]
        protected XSSFVBAPart(PackagePart part, PackageRelationship rel)
            : this(part)
        {

        }
        /**
         * Like *PictureData, VBA objects store the actual content in the part
         * directly without keeping a copy like all others therefore we need to
         * handle them differently.
         */
        protected internal override void PrepareForCommit()
        {
            // do not clear the part here
        }

    }
}


text:
<?php
    $this->pageTitle = Yii::t('BlogModule.blog', 'Блоги');
    $this->breadcrumbs = array(Yii::t('BlogModule.blog', 'Блоги'));
?>

<?php echo Yii::t('BlogModule.blog', 'Блоги'); ?> <a href="<?php echo Yii::app()->createUrl('/blog/blogRss/feed/');?>"><img src="<?php echo Yii::app()->AssetManager->publish(Yii::app()->theme->basePath . "/web/images/rss.png"); ?>" alt="<?php echo Yii::t('BlogModule.blog', 'Subscribe for updates') ?>" title="<?php echo Yii::t('BlogModule.blog', 'Subscribe for updates') ?>">

<?php
$this->widget(
    'bootstrap.widgets.TbListView', array(
        'dataProvider' => $dataProvider,
        'template' => '{items} {pager}',
        'itemView' => '_view',
    )
); ?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.9.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
 <name>Net_IPv6</name>
 <channel>pear.php.net</channel>
 <summary>Check and validate IPv6 addresses</summary>
 <description>The class allows you to:
* check if an address is an IPv6 address
* compress/uncompress IPv6 addresses
* check for an IPv4 compatible ending in an IPv6 address
* check the assigned address space of an IPv6 address
* do netmask calculations</description>
 <lead>
  <name>Alexander Merz</name>
  <user>alexmerz</user>
  <email>alexander.merz@web.de</email>
  <active>yes</active>
 </lead>
 <date>2011-02-07</date>
 <time>22:45:00</time>
 <version>
  <release>1.2.1</release>
  <api>1.2.0</api>
 </version>
 <stability>
  <release>stable</release>
  <api>stable</api>
 </stability>
 <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
 <notes>
No Changes. Go to stable.
 </notes>
 <contents>
  <dir baseinstalldir="/" name="/">
   <file baseinstalldir="/" md5sum="5f80432e717f07e652eaeac38d9ffa15" name="Net/IPv6.php" role="php" />
   <file baseinstalldir="Net" md5sum="62bf24bd1e9d4dc0cfbd25b433026e71" name="tests/AllTests.php" role="test" />
   <file baseinstalldir="Net" md5sum="6110be4ce383e5dba080ba845c13b1af" name="tests/NetIPv6Test.php" role="test" />
  </dir>
 </contents>
 <dependencies>
  <required>
   <php>
    <min>4.0.0</min>
   </php>
   <pearinstaller>
    <min>1.4.0b1</min>
   </pearinstaller>
  </required>
 </dependencies>
 <phprelease />
 <changelog>
  <release>
   <date>2010-12-30</date>
   <time>05:30:00</time>
   <version>
    <release>1.2.1RC1</release>
    <api>1.2.0</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
Go to Release Candidate.
Updated Peardoc to reflect the API changes.
   </notes>
  </release>
  <release>
   <date>2010-12-22</date>
   <time>02:10:00</time>
   <version>
    <release>1.2.1b1</release>
    <api>1.2.0</api>
   </version>
   <stability>
    <release>beta</release>
    <api>alpha</api>
   </stability>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
Feature request:
+ add parameter to uncompress() to add leading zeros to an address (Pascal Uhlmann)
   </notes>
  </release>
  <release>
   <date>2010-11-25</date>
   <time>14:30:00</time>
   <version>
    <release>1.2.1b</release>
    <api>1.2.0</api>
   </version>
   <stability>
    <release>beta</release>
    <api>alpha</api>
   </stability>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
#18085 Fix wrong file path
   </notes>
  </release>
  <release>
   <date>2010-11-18</date>
   <time>03:40:00</time>
   <version>
    <release>1.2.0b</release>
    <api>1.2.0</api>
   </version>
   <stability>
    <release>beta</release>
    <api>alpha</api>
   </stability>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
+ New method isCompressible()
+ New method separate()
+ compress() got a second parameter to enforce compression
+ add new address types
- deprecated getPrefixLength() (technical identical to getNetmaskSpec)
- deprecated removePrefixLength() (technical identical to removeNetmaskSpec)
   </notes>
  </release>
  <release>
   <date>2010-11-08</date>
   <time>19:15:00</time>
   <version>
    <release>1.1.0</release>
    <api>1.1.0</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
Jump from beta to stable.
Fixed:
#17819 documentation needs to be updated
   </notes>
  </release>
  <release>
   <version>
  	<release>1.1.0b2</release>
  	<api>1.1.0b1</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
    <notes>
Fixed:
#14747  Compressing an already compressed IP returns the IP "as is" now
#15947  checkIPv6 returned true although the IP was too long
#16220  using the wrong variable in _bin2Ip
   </notes>
  </release>
  <release>
   <version>
    <release>1.1.0b1</release>
    <api>1.1.0b1</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
Because this release adds a new method and some bug tickets are still open, the package
release is named as Beta, instead of releasing a 5th RC version.

#14728   add parseAddress(), thanks to Nicholas Williams!
#14767   most CS issues should be solved
   </notes>
  </release>
  <release>
   <version>
    <release>1.1.0RC3</release>
    <api>1.1.0RC3</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
Fix Bug #12442, thanks to pear at erikdebruijn dot nl
   + add getNetmaskSpec()
   </notes>
  </release>
  <release>
   <version>
    <release>1.1.0RC4</release>
    <api>1.1.0RC4</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
take care of prefix length specification in an address, thanks to Jens Ott
   </notes>
  </release>
  <release>
   <version>
    <release>1.0</release>
    <api>1.0</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2004-03-02</date>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
First official release
   </notes>
  </release>
  <release>
   <version>
    <release>1.0.1</release>
    <api>1.0.1</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2004-11-24</date>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
rewrite compress()/uncompress
fixes this bugs:
Bug #2803  	compress() adds colon
Bug #2802  	compress() doesn't compress correctly
Thanks to cmoehrke at netviser dot de
   </notes>
  </release>
  <release>
   <version>
    <release>1.0.2</release>
    <api>1.0.2</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2005-02-13</date>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
Bug #3404: checkIPv6() is case sensitive
Bug #3405: compress() does not compress '0000'
Thanks to elfrink at introweb dot nl
   </notes>
  </release>
  <release>
   <version>
    <release>1.0.3</release>
    <api>1.0.3</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2005-03-19</date>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
Bug #3851: IPv4-mapped/compatible IPv6 uncompress bug
Thanks to dtaylor at jasi dot com
   </notes>
  </release>
  <release>
   <version>
    <release>1.0.4</release>
    <api>1.0.4</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2005-08-03</date>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
Bug #4977: trying to compress where nothing is to compress
Thanks to pvenegas at gmail dot com
   </notes>
  </release>
  <release>
   <version>
    <release>1.0.5</release>
    <api>1.0.5</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2005-09-01</date>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
Bug #3405 again: problem with compressing
Thanks to elfrink at introweb dot nl
   </notes>
  </release>
  <release>
   <version>
    <release>1.1.0RC1</release>
    <api>1.1.0RC1</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <date>2005-11-24</date>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
This new minor version adds some methods proposed
by Josh Peck (jmp @ joshpeck dot org).
+ Change license to BSD
+ Improved comments and docblocks
+ add removeNetmaskSpec()
+ add getNetmask()
+ add isInNetmask()
+ add getAddressType()
+ add _ip2Bin()
+ add _bin2Ip()
+ add serveral constants for address types
   </notes>
  </release>
  <release>
   <version>
    <release>1.1.0RC2</release>
    <api>1.1.0RC2</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <date>2006-02-09</date>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
- fixed a notice, when removeNetmaskSpec is used on an IP
without a netmask
   </notes>
  </release>
  <release>
   <version>
    <release>1.1.0b2</release>
    <api>1.1.0b1</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <date>2010-02-12</date>
   <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
   <notes>
Fixed:
#14747  Compressing an already compressed IP returns the IP "as is" now
#15947  checkIPv6 returned true although the IP was too long
#16220  using the wrong variable in _bin2Ip
   </notes>
  </release>
 </changelog>
</package>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.camel</groupId>
        <artifactId>components</artifactId>
        <version>2.15-SNAPSHOT</version>
    </parent>

    <artifactId>camel-avro</artifactId>
    <packaging>bundle</packaging>
    <name>Camel :: Avro</name>
    <description>Camel Avro data format</description>

    <properties>
        <camel.osgi.export.pkg>org.apache.camel.dataformat.avro*,org.apache.camel.component.avro*</camel.osgi.export.pkg>
        <camel.osgi.export.service>
          org.apache.camel.spi.ComponentResolver;component=avro,
          org.apache.camel.spi.DataFormatResolver;dataformat=avro
      </camel.osgi.export.service>
    </properties>

    <build>
        <plugins>
            <!--plugin>
                <groupId>org.apache.avro</groupId>
                <artifactId>avro-maven-plugin</artifactId>
                <version>${avro-version}</version>
                <executions>
                    <execution>
                        <id>schemas</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>schema</goal>
                            <goal>protocol</goal>
                            <goal>idl-protocol</goal>
                        </goals>
                        <configuration>
                            <sourceDirectory>${project.basedir}/src/test/avro/</sourceDirectory>
                            <outputDirectory>${project.basedir}/src/test/java/</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin-->
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro</artifactId>
            <exclusions>
	          <exclusion>
	          	<groupId>org.codehaus.jackson</groupId>
	            <artifactId>jackson-core-asl</artifactId>
	          </exclusion>
	          <exclusion>
	          	<groupId>org.codehaus.jackson</groupId>
	            <artifactId>jackson-mapper-asl</artifactId>
	          </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro-ipc</artifactId>
            <exclusions>
	          <exclusion>
	          	<groupId>org.codehaus.jackson</groupId>
	            <artifactId>jackson-core-asl</artifactId>
	          </exclusion>
	          <exclusion>
	          	<groupId>org.codehaus.jackson</groupId>
	            <artifactId>jackson-mapper-asl</artifactId>
	          </exclusion>
	          <exclusion>
	          	<groupId>io.netty</groupId>
	            <artifactId>netty</artifactId>
	          </exclusion>
            </exclusions>
        </dependency>

        <!-- use Netty version as Camel -->
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty</artifactId>
            <version>${netty3-version}</version>
        </dependency>
        <!-- use Jackson version as Camel -->
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>${jackson-version}</version>
        </dependency>

        <!-- testing -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-juel</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-spring</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>


text:
package org.artifactory.log.logback;

import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.selector.ContextSelector;
import ch.qos.logback.classic.util.ContextSelectorStaticBinder;
import org.artifactory.api.context.ArtifactoryContext;
import org.artifactory.api.context.ContextHelper;
import org.artifactory.common.ArtifactoryHome;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * @author Yoav Landman
 */
public class LogbackContextSelector implements ContextSelector {

    private final ConcurrentMap<String, LoggerContext> loggerContextsByContextId;
    private final LoggerContext defaultContext;

    private static final ThreadLocal<LoggerContext> tlsLoggingContext = new ThreadLocal<>();
    private static final ThreadLocal<LoggerConfigInfo> tlsConfigInfo = new ThreadLocal<>();

    public LogbackContextSelector(LoggerContext context) {
        loggerContextsByContextId = new ConcurrentHashMap<>();
        defaultContext = context;
    }

    @Override
    public LoggerContext getDefaultLoggerContext() {
        return defaultContext;
    }

    @Override
    public LoggerContext detachLoggerContext(String loggerContextName) {
        return loggerContextsByContextId.remove(loggerContextName);
    }

    @Override
    public LoggerContext getLoggerContext() {
        //First check if ThreadLocal has been set already
        LoggerContext loggerContext = tlsLoggingContext.get();
        if (loggerContext != null) {
            return loggerContext;
        }
        LoggerConfigInfo configInfo = getConfigInfo();
        if (configInfo != null) {
            //Try to get it from the cache by contextPath
            String contextPath = configInfo.getContextId();
            loggerContext = loggerContextsByContextId.get(contextPath);
            if (loggerContext == null) {
                //We have to create a new LoggerContext
                loggerContext = new LoggerContext();
                loggerContext.setName(contextPath);
                ArtifactoryHome home = configInfo.getHome();
                if (home == null) {
                    throw new IllegalStateException(
                            "Trying to create a new configuration but artifactory home is null.");
                }
                LogbackContextHelper.configure(loggerContext, home, configInfo.getContextId());
                LoggerContext existingContext = loggerContextsByContextId.putIfAbsent(contextPath, loggerContext);
                return existingContext == null ? loggerContext : existingContext;
            } else {
                return loggerContext;
            }
        } else {
            //Return the default context
            return defaultContext;
        }
    }

    @Override
    public List<String> getContextNames() {
        List<String> list = new ArrayList<>();
        list.addAll(loggerContextsByContextId.keySet());
        return list;
    }

    @Override
    public LoggerContext getLoggerContext(String name) {
        return loggerContextsByContextId.get(name);
    }

    /**
     * Returns the number of managed contexts Used for testing purposes
     *
     * @return the number of managed contexts
     */
    public int getCount() {
        return loggerContextsByContextId.size();
    }

    public static void bind() {
        LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
        ContextSelector selector = ContextSelectorStaticBinder.getSingleton().getContextSelector();
        if (selector instanceof LogbackContextSelector) {
            tlsLoggingContext.set(context);
        }
    }

    public static void unbind() {
        tlsLoggingContext.remove();
    }

    public static void bindConfig(LoggerConfigInfo info) {
        tlsConfigInfo.set(info);
    }

    public static void unbindConfig() {
        tlsConfigInfo.remove();
    }

    /**
     * Try to get a thread bound config (set during initialization). If there is no config info on the thread try
     * creating it from artifactory home
     */
    private LoggerConfigInfo getConfigInfo() {
        LoggerConfigInfo configInfo = tlsConfigInfo.get();
        if (configInfo == null) {
            ArtifactoryContext context = ContextHelper.get();
            if (context != null) {
                configInfo = new LoggerConfigInfo(context);
            }
        }
        return configInfo;
    }

}