text:
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.3.1](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.3.0...gatsby-remark-prismjs@3.3.1) (2019-07-02)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.3.0](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.11...gatsby-remark-prismjs@3.3.0) (2019-06-20)

**Note:** Version bump only for package gatsby-remark-prismjs

## [3.2.11](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.10...gatsby-remark-prismjs@3.2.11) (2019-06-07)

**Note:** Version bump only for package gatsby-remark-prismjs

## [3.2.10](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.9...gatsby-remark-prismjs@3.2.10) (2019-06-05)

### Features

- **gatsby-remark-prismjs:** add support for language extensions ([#11932](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/issues/11932)) ([a20afb1](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/commit/a20afb1))

## [3.2.9](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.8...gatsby-remark-prismjs@3.2.9) (2019-05-02)

**Note:** Version bump only for package gatsby-remark-prismjs

## [3.2.8](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.7...gatsby-remark-prismjs@3.2.8) (2019-04-09)

### Bug Fixes

- **gatsby-remark-prismjs:** Update warnings to handle missing language ([#13159](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/issues/13159)) ([422f91d](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/commit/422f91d))

## [3.2.7](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.6...gatsby-remark-prismjs@3.2.7) (2019-04-04)

### Features

- **gatsby-remark-prismjs:** load languages when referred to by an alias ([#13127](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/issues/13127)) ([de8f99b](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/commit/de8f99b))

## [3.2.6](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.5...gatsby-remark-prismjs@3.2.6) (2019-03-18)

**Note:** Version bump only for package gatsby-remark-prismjs

## [3.2.5](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.4...gatsby-remark-prismjs@3.2.5) (2019-03-11)

**Note:** Version bump only for package gatsby-remark-prismjs

## [3.2.4](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.3...gatsby-remark-prismjs@3.2.4) (2019-02-01)

**Note:** Version bump only for package gatsby-remark-prismjs

## [3.2.3](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.2...gatsby-remark-prismjs@3.2.3) (2019-01-29)

### Bug Fixes

- **gatsby-remark-prismjs:** use aliased name for highlighters ([#11038](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/issues/11038)) ([d2eba72](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/commit/d2eba72))

## [3.2.2](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.1...gatsby-remark-prismjs@3.2.2) (2019-01-24)

### Features

- **gatsby-remark-prismjs:** Add class when using highlighted lines ([#11218](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/issues/11218)) ([e1d6622](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/commit/e1d6622))

## [3.2.1](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.2.0...gatsby-remark-prismjs@3.2.1) (2019-01-23)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.2.0](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.1.4...gatsby-remark-prismjs@3.2.0) (2018-12-31)

### Features

- Support hide lines in remark-embed-snippet ([#6084](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/issues/6084)) ([dad0628](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/commit/dad0628))

## [3.1.4](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.1.3...gatsby-remark-prismjs@3.1.4) (2018-12-06)

**Note:** Version bump only for package gatsby-remark-prismjs

## [3.1.3](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.1.2...gatsby-remark-prismjs@3.1.3) (2018-12-03)

### Features

- **gatsby-remark-prismjs:** Allow global line number config ([#10076](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/issues/10076)) ([2efec7a](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/commit/2efec7a))

## [3.1.2](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.1.1...gatsby-remark-prismjs@3.1.2) (2018-11-30)

### Bug Fixes

- **gatsby-remark-prismjs:** prevent additional blank line from appearing ([#10209](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/issues/10209)) ([71d7f23](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/commit/71d7f23))

## [3.1.1](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.1.0...gatsby-remark-prismjs@3.1.1) (2018-11-29)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.1.0](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.3...gatsby-remark-prismjs@3.1.0) (2018-11-26)

### Features

- **gatsby-remark-prismjs:** add in ability to use comments to specify line highlighting ([#9696](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/issues/9696)) ([11e1834](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/commit/11e1834))

## [3.0.3](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.2...gatsby-remark-prismjs@3.0.3) (2018-10-29)

**Note:** Version bump only for package gatsby-remark-prismjs

## [3.0.2](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.1...gatsby-remark-prismjs@3.0.2) (2018-10-12)

**Note:** Version bump only for package gatsby-remark-prismjs

## [3.0.1](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0...gatsby-remark-prismjs@3.0.1) (2018-09-26)

### Features

- add noInlineHighlight option ([#7554](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/issues/7554)) ([f7c07f7](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/commit/f7c07f7))

# [3.0.0](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-rc.2...gatsby-remark-prismjs@3.0.0) (2018-09-17)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-rc.2](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-rc.1...gatsby-remark-prismjs@3.0.0-rc.2) (2018-08-29)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-rc.1](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-rc.0...gatsby-remark-prismjs@3.0.0-rc.1) (2018-08-29)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-rc.0](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-beta.8...gatsby-remark-prismjs@3.0.0-rc.0) (2018-08-21)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-beta.8](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-beta.7...gatsby-remark-prismjs@3.0.0-beta.8) (2018-08-20)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-beta.7](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-beta.6...gatsby-remark-prismjs@3.0.0-beta.7) (2018-08-15)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-beta.6](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-beta.5...gatsby-remark-prismjs@3.0.0-beta.6) (2018-08-15)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-beta.5](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-beta.4...gatsby-remark-prismjs@3.0.0-beta.5) (2018-07-27)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-beta.4](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-beta.3...gatsby-remark-prismjs@3.0.0-beta.4) (2018-07-21)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-beta.3](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-beta.2...gatsby-remark-prismjs@3.0.0-beta.3) (2018-06-27)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-beta.2](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-beta.1...gatsby-remark-prismjs@3.0.0-beta.2) (2018-06-20)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-beta.1](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@3.0.0-beta.0...gatsby-remark-prismjs@3.0.0-beta.1) (2018-06-17)

**Note:** Version bump only for package gatsby-remark-prismjs

# [3.0.0-beta.0](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-prismjs/compare/gatsby-remark-prismjs@2.0.4...gatsby-remark-prismjs@3.0.0-beta.0) (2018-06-17)

**Note:** Version bump only for package gatsby-remark-prismjs


text:
package org.ojalgo.array.operation;

import static org.ojalgo.function.constant.PrimitiveMath.*;

import java.math.BigDecimal;

import org.ojalgo.array.PlainArray;
import org.ojalgo.function.constant.BigMath;
import org.ojalgo.scalar.Scalar;
import org.ojalgo.structure.Access1D;
import org.ojalgo.structure.Structure2D;

/**
 * Given a vector x, the i?amax functions return the position of the vector element x[i] that has the largest
 * absolute value for real flavors, or the largest sum |Re(x[i])|+|Im(x[i])| for complex flavors. If n is not
 * positive, 0 is returned. If more than one vector element is found with the same largest absolute value, the
 * index of the first one encountered is returned.
 *
 * @author apete
 */
public abstract class AMAX implements ArrayOperation {

    public static int THRESHOLD = 128;

    public static long invoke(final Access1D<?> data, final long first, final long limit, final long step) {

        long retVal = first;
        double largest = 0D;
        double candidate;

        for (long i = first; i < limit; i += step) {
            candidate = Math.abs(data.doubleValue(i));
            if (candidate > largest) {
                largest = candidate;
                retVal = i;
            }
        }

        return retVal;
    }

    public static int invoke(final BigDecimal[] data, final int first, final int limit, final int step) {

        int retVal = first;
        BigDecimal largest = BigMath.ZERO;
        BigDecimal candidate;

        for (int i = first; i < limit; i += step) {
            candidate = data[i].abs();
            if (candidate.compareTo(largest) > 0) {
                largest = candidate;
                retVal = i;
            }
        }

        return retVal;
    }

    public static int invoke(final byte[] data, final int first, final int limit, final int step) {

        int retVal = first;
        byte largest = 0;
        byte candidate;

        for (int i = first; i < limit; i += step) {
            candidate = (byte) Math.abs(data[i]);
            if (candidate > largest) {
                largest = candidate;
                retVal = i;
            }
        }

        return retVal;
    }

    public static int invoke(final double[] data, final int first, final int limit, final int step) {

        int retVal = first;
        double largest = 0D;
        double candidate;

        for (int i = first; i < limit; i += step) {
            candidate = Math.abs(data[i]);
            if (candidate > largest) {
                largest = candidate;
                retVal = i;
            }
        }

        return retVal;
    }

    public static long invoke(final double[][] data) {

        int nbRows = data.length;
        int nbCols = nbRows != 0 ? data[0].length : 0;

        long retVal = 0;
        double largest = ZERO;
        double candidate;

        double[] tmpRow;

        for (int i = 0; i < nbRows; i++) {
            tmpRow = data[i];

            for (int j = 0; j < nbCols; j++) {
                candidate = Math.abs(tmpRow[j]);
                if (candidate > largest) {
                    largest = candidate;
                    retVal = Structure2D.index(nbRows, i, j);
                }
            }
        }

        return retVal;
    }

    public static int invoke(final float[] data, final int first, final int limit, final int step) {

        int retVal = first;
        float largest = 0F;
        float candidate;

        for (int i = first; i < limit; i += step) {
            candidate = Math.abs(data[i]);
            if (candidate > largest) {
                largest = candidate;
                retVal = i;
            }
        }

        return retVal;
    }

    public static int invoke(final int[] data, final int first, final int limit, final int step) {

        int retVal = first;
        int largest = 0;
        int candidate;

        for (int i = first; i < limit; i += step) {
            candidate = Math.abs(data[i]);
            if (candidate > largest) {
                largest = candidate;
                retVal = i;
            }
        }

        return retVal;
    }

    public static int invoke(final long[] data, final int first, final int limit, final int step) {

        int retVal = first;
        long largest = 0L;
        long candidate;

        for (int i = first; i < limit; i += step) {
            candidate = Math.abs(data[i]);
            if (candidate > largest) {
                largest = candidate;
                retVal = i;
            }
        }

        return retVal;
    }

    public static <N extends Scalar<N>> int invoke(final N[] data, final int first, final int limit, final int step) {

        int retVal = first;
        double largest = 0D;
        double candidate;

        for (int i = first; i < limit; i += step) {
            candidate = data[i].norm();
            if (candidate > largest) {
                largest = candidate;
                retVal = i;
            }
        }

        return retVal;
    }

    public static int invoke(final PlainArray<?> data, final int first, final int limit, final int step) {

        int retVal = first;
        double largest = 0D;
        double candidate;

        for (int i = first; i < limit; i += step) {
            candidate = Math.abs(data.doubleValue(i));
            if (candidate > largest) {
                largest = candidate;
                retVal = i;
            }
        }

        return retVal;
    }

    public static int invoke(final short[] data, final int first, final int limit, final int step) {

        int retVal = first;
        short largest = 0;
        short candidate;

        for (int i = first; i < limit; i += step) {
            candidate = (short) Math.abs(data[i]);
            if (candidate > largest) {
                largest = candidate;
                retVal = i;
            }
        }

        return retVal;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package coordinator

import (
	"context"

	"github.com/influxdata/influxdb"
	"github.com/influxdata/influxdb/task/backend"
	"github.com/influxdata/influxdb/task/backend/middleware"
	"go.uber.org/zap"
)

var _ middleware.Coordinator = (*Coordinator)(nil)

type Coordinator struct {
	logger *zap.Logger
	sch    backend.Scheduler

	limit int
}

type Option func(*Coordinator)

func WithLimit(i int) Option {
	return func(c *Coordinator) {
		c.limit = i
	}
}

func New(logger *zap.Logger, scheduler backend.Scheduler, opts ...Option) *Coordinator {
	c := &Coordinator{
		logger: logger,
		sch:    scheduler,
		limit:  1000,
	}

	for _, opt := range opts {
		opt(c)
	}

	return c
}

func (c *Coordinator) TaskCreated(ctx context.Context, task *influxdb.Task) error {
	return c.sch.ClaimTask(ctx, task)
}

func (c *Coordinator) TaskUpdated(ctx context.Context, from, to *influxdb.Task) error {
	// if disabling the task release it before schedule update
	if to.Status != from.Status && to.Status == string(backend.TaskInactive) {
		if err := c.sch.ReleaseTask(to.ID); err != nil && err != influxdb.ErrTaskNotClaimed {
			return err
		}
	}

	if err := c.sch.UpdateTask(ctx, to); err != nil && err != influxdb.ErrTaskNotClaimed {
		return err
	}

	// if enabling the task then claim it
	if to.Status != from.Status && to.Status == string(backend.TaskActive) {
		if err := c.sch.ClaimTask(ctx, to); err != nil && err != influxdb.ErrTaskAlreadyClaimed {
			return err
		}
	}

	return nil
}

func (c *Coordinator) TaskDeleted(ctx context.Context, id influxdb.ID) error {
	if err := c.sch.ReleaseTask(id); err != nil && err != influxdb.ErrTaskNotClaimed {
		return err
	}

	return nil
}

func (c *Coordinator) RunCancelled(ctx context.Context, taskID, runID influxdb.ID) error {
	return c.sch.CancelRun(ctx, taskID, runID)
}

func (c *Coordinator) RunRetried(ctx context.Context, task *influxdb.Task, run *influxdb.Run) error {
	return c.sch.UpdateTask(ctx, task)
}

func (c *Coordinator) RunForced(ctx context.Context, task *influxdb.Task, run *influxdb.Run) error {
	return c.sch.UpdateTask(ctx, task)
}


text:
import sys

from code2html.args import Args
from code2html.util import which
from code2html import core

def main():
    # Exit if Vim is not available
    if which('vim') is None:
        sys.exit(u'ERROR: Vim is not available on this system '
                 u'(maybe a PATH issue), aborted.')

    # Get the arguments passed by user
    args = Args()
    args.check_args()

    # Call Vim to do the conversion
    core.fire(args)

    # Good bye
    sys.exit(0)

if __name__ == '__main__':
    main()


text:
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace MonoGame.Extended.Shapes
{
    /// <summary>
    ///     Sprite batch extensions for drawing primitive shapes
    /// </summary>
    public static class SpriteBatchExtensions
    {
        private static Texture2D _texture;

        private static Texture2D GetTexture(SpriteBatch spriteBatch)
        {
            if (_texture == null)
            {
                _texture = new Texture2D(spriteBatch.GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
                _texture.SetData(new[] {Color.White});
            }

            return _texture;
        }

        /// <summary>
        ///     Draws a closed polygon from a <see cref="PolygonF" /> shape
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// ///
        /// <param name="position">Where to position the polygon</param>
        /// <param name="polygon">The polygon to draw</param>
        /// <param name="color">The color to use</param>
        /// <param name="thickness">The thickness of the lines</param>
        public static void DrawPolygon(this SpriteBatch spriteBatch, Vector2 position, PolygonF polygon, Color color,
            float thickness = 1f)
        {
            DrawPolygon(spriteBatch, position, polygon.Vertices, color, thickness);
        }

        /// <summary>
        ///     Draws a closed polygon from an array of points
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// ///
        /// <param name="offset">Where to offset the points</param>
        /// <param name="points">The points to connect with lines</param>
        /// <param name="color">The color to use</param>
        /// <param name="thickness">The thickness of the lines</param>
        public static void DrawPolygon(this SpriteBatch spriteBatch, Vector2 offset, Vector2[] points, Color color,
            float thickness = 1f)
        {
            if (points.Length == 0)
                return;

            if (points.Length == 1)
            {
                DrawPoint(spriteBatch, points[0], color, (int) thickness);
                return;
            }

            var texture = GetTexture(spriteBatch);

            for (var i = 0; i < points.Length - 1; i++)
                DrawPolygonEdge(spriteBatch, texture, points[i] + offset, points[i + 1] + offset, color, thickness);

            DrawPolygonEdge(spriteBatch, texture, points[points.Length - 1] + offset, points[0] + offset, color,
                thickness);
        }

        private static void DrawPolygonEdge(SpriteBatch spriteBatch, Texture2D texture, Vector2 point1, Vector2 point2,
            Color color, float thickness)
        {
            var length = Vector2.Distance(point1, point2);
            var angle = (float) Math.Atan2(point2.Y - point1.Y, point2.X - point1.X);
            var scale = new Vector2(length, thickness);
            spriteBatch.Draw(texture, point1, color: color, rotation: angle, scale: scale);
        }

        /// <summary>
        ///     Draws a filled rectangle
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// <param name="rectangle">The rectangle to draw</param>
        /// <param name="color">The color to draw the rectangle in</param>
        public static void FillRectangle(this SpriteBatch spriteBatch, RectangleF rectangle, Color color)
        {
            FillRectangle(spriteBatch, rectangle.Location, rectangle.Size, color);
        }

        /// <summary>
        ///     Draws a filled rectangle
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// <param name="location">Where to draw</param>
        /// <param name="size">The size of the rectangle</param>
        /// <param name="color">The color to draw the rectangle in</param>
        public static void FillRectangle(this SpriteBatch spriteBatch, Vector2 location, SizeF size, Color color)
        {
            spriteBatch.Draw(GetTexture(spriteBatch), location, null, color, 0, Vector2.Zero, size, SpriteEffects.None, 0);
        }

        /// <summary>
        ///     Draws a filled rectangle
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// <param name="x">The X coord of the left side</param>
        /// <param name="y">The Y coord of the upper side</param>
        /// <param name="width">Width</param>
        /// <param name="height">Height</param>
        /// <param name="color">The color to draw the rectangle in</param>
        public static void FillRectangle(this SpriteBatch spriteBatch, float x, float y, float width, float height,
            Color color)
        {
            FillRectangle(spriteBatch, new Vector2(x, y), new SizeF(width, height), color);
        }

        /// <summary>
        ///     Draws a rectangle with the thickness provided
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// <param name="rectangle">The rectangle to draw</param>
        /// <param name="color">The color to draw the rectangle in</param>
        /// <param name="thickness">The thickness of the lines</param>
        public static void DrawRectangle(this SpriteBatch spriteBatch, RectangleF rectangle, Color color,
            float thickness = 1f)
        {
            var texture = GetTexture(spriteBatch);
            var topLeft = new Vector2(rectangle.X, rectangle.Y);
            var topRight = new Vector2(rectangle.Right - thickness, rectangle.Y);
            var bottomLeft = new Vector2(rectangle.X, rectangle.Bottom - thickness);
            var horizontalScale = new Vector2(rectangle.Width, thickness);
            var verticalScale = new Vector2(thickness, rectangle.Height);

            spriteBatch.Draw(texture, topLeft, scale: horizontalScale, color: color);
            spriteBatch.Draw(texture, topLeft, scale: verticalScale, color: color);
            spriteBatch.Draw(texture, topRight, scale: verticalScale, color: color);
            spriteBatch.Draw(texture, bottomLeft, scale: horizontalScale, color: color);
        }

        /// <summary>
        ///     Draws a rectangle with the thickness provided
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// <param name="location">Where to draw</param>
        /// <param name="size">The size of the rectangle</param>
        /// <param name="color">The color to draw the rectangle in</param>
        /// <param name="thickness">The thickness of the line</param>
        public static void DrawRectangle(this SpriteBatch spriteBatch, Vector2 location, SizeF size, Color color,
            float thickness = 1f)
        {
            DrawRectangle(spriteBatch, new RectangleF(location.X, location.Y, size.Width, size.Height), color, thickness);
        }

        /// <summary>
        ///     Draws a line from point1 to point2 with an offset
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// <param name="x1">The X coord of the first point</param>
        /// <param name="y1">The Y coord of the first point</param>
        /// <param name="x2">The X coord of the second point</param>
        /// <param name="y2">The Y coord of the second point</param>
        /// <param name="color">The color to use</param>
        /// <param name="thickness">The thickness of the line</param>
        public static void DrawLine(this SpriteBatch spriteBatch, float x1, float y1, float x2, float y2, Color color,
            float thickness = 1f)
        {
            DrawLine(spriteBatch, new Vector2(x1, y1), new Vector2(x2, y2), color, thickness);
        }

        /// <summary>
        ///     Draws a line from point1 to point2 with an offset
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// <param name="point1">The first point</param>
        /// <param name="point2">The second point</param>
        /// <param name="color">The color to use</param>
        /// <param name="thickness">The thickness of the line</param>
        public static void DrawLine(this SpriteBatch spriteBatch, Vector2 point1, Vector2 point2, Color color,
            float thickness = 1f)
        {
            // calculate the distance between the two vectors
            var distance = Vector2.Distance(point1, point2);

            // calculate the angle between the two vectors
            var angle = (float) Math.Atan2(point2.Y - point1.Y, point2.X - point1.X);

            DrawLine(spriteBatch, point1, distance, angle, color, thickness);
        }

        /// <summary>
        ///     Draws a line from point1 to point2 with an offset
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// <param name="point">The starting point</param>
        /// <param name="length">The length of the line</param>
        /// <param name="angle">The angle of this line from the starting point</param>
        /// <param name="color">The color to use</param>
        /// <param name="thickness">The thickness of the line</param>
        public static void DrawLine(this SpriteBatch spriteBatch, Vector2 point, float length, float angle, Color color,
            float thickness = 1f)
        {
            var origin = new Vector2(0f, 0.5f);
            var scale = new Vector2(length, thickness);
            spriteBatch.Draw(GetTexture(spriteBatch), point, null, color, angle, origin, scale, SpriteEffects.None, 0);
        }

        /// <summary>
        ///     Draws a point at the specified x, y position. The center of the point will be at the position.
        /// </summary>
        public static void DrawPoint(this SpriteBatch spriteBatch, float x, float y, Color color, float size = 1f)
        {
            DrawPoint(spriteBatch, new Vector2(x, y), color, size);
        }

        /// <summary>
        ///     Draws a point at the specified position. The center of the point will be at the position.
        /// </summary>
        public static void DrawPoint(this SpriteBatch spriteBatch, Vector2 position, Color color, float size = 1f)
        {
            var scale = Vector2.One*size;
            var offset = new Vector2(0.5f) - new Vector2(size*0.5f);
            spriteBatch.Draw(GetTexture(spriteBatch), position + offset, color: color, scale: scale);
        }

        /// <summary>
        ///     Draw a circle from a <see cref="CircleF" /> shape
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// <param name="circle">The circle shape to draw</param>
        /// <param name="sides">The number of sides to generate</param>
        /// <param name="color">The color of the circle</param>
        /// <param name="thickness">The thickness of the lines used</param>
        public static void DrawCircle(this SpriteBatch spriteBatch, CircleF circle, int sides, Color color,
            float thickness = 1f)
        {
            DrawCircle(spriteBatch, circle.Center, circle.Radius, sides, color, thickness);
        }

        /// <summary>
        ///     Draw a circle
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// <param name="center">The center of the circle</param>
        /// <param name="radius">The radius of the circle</param>
        /// <param name="sides">The number of sides to generate</param>
        /// <param name="color">The color of the circle</param>
        /// <param name="thickness">The thickness of the lines used</param>
        public static void DrawCircle(this SpriteBatch spriteBatch, Vector2 center, float radius, int sides, Color color,
            float thickness = 1f)
        {
            DrawPolygon(spriteBatch, center, CreateCircle(radius, sides), color, thickness);
        }

        /// <summary>
        ///     Draw a circle
        /// </summary>
        /// <param name="spriteBatch">The destination drawing surface</param>
        /// <param name="x">The center X of the circle</param>
        /// <param name="y">The center Y of the circle</param>
        /// <param name="radius">The radius of the circle</param>
        /// <param name="sides">The number of sides to generate</param>
        /// <param name="color">The color of the circle</param>
        /// <param name="thickness">The thickness of the line</param>
        public static void DrawCircle(this SpriteBatch spriteBatch, float x, float y, float radius, int sides,
            Color color, float thickness = 1f)
        {
            DrawPolygon(spriteBatch, new Vector2(x, y), CreateCircle(radius, sides), color, thickness);
        }

        private static Vector2[] CreateCircle(double radius, int sides)
        {
            const double max = 2.0*Math.PI;
            var points = new Vector2[sides];
            var step = max/sides;
            var theta = 0.0;

            for (var i = 0; i < sides; i++)
            {
                points[i] = new Vector2((float) (radius*Math.Cos(theta)), (float) (radius*Math.Sin(theta)));
                theta += step;
            }

            return points;
        }
    }
}


text:
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP
#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP

namespace boost { namespace geometry { namespace index {

namespace detail { namespace rtree { namespace visitors {

template <typename Value, typename Options, typename Translator, typename Box, typename Allocators>
class children_box
    : public rtree::visitor<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag, true>::type
{
    typedef typename rtree::internal_node<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type internal_node;
    typedef typename rtree::leaf<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type leaf;

public:
    inline children_box(Box & result, Translator const& tr)
        : m_result(result), m_tr(tr)
    {}

    inline void operator()(internal_node const& n)
    {
        typedef typename rtree::elements_type<internal_node>::type elements_type;
        elements_type const& elements = rtree::elements(n);

        m_result = rtree::elements_box<Box>(elements.begin(), elements.end(), m_tr);
    }

    inline void operator()(leaf const& n)
    {
        typedef typename rtree::elements_type<leaf>::type elements_type;
        elements_type const& elements = rtree::elements(n);

        m_result = rtree::elements_box<Box>(elements.begin(), elements.end(), m_tr);
    }

private:
    Box & m_result;
    Translator const& m_tr;
};

}}} // namespace detail::rtree::visitors

}}} // namespace boost::geometry::index

#endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP


text:
var helpers = require('yeoman-test');
var assert = require('yeoman-assert');
var path = require('path');

describe('goatstack:app', function() {

	describe('goatstack:app => MongoDB', function() {

		beforeAll(done => {
			return helpers.run(path.join(__dirname, '../generators/app'))
				.inDir(path.join(__dirname, '../temp'))
				.withPrompts({
					databases: ['MongoDB'],
					appname: 'testApp',
					appdescription: 'This is a test App',
					appkeywords: 'testing, app',
					protocol: 'http',
					analyticschoice: false
				})
				.on('end', () => done());
		});

		it('should generate the app with correct server files', () => {
			assert.file([
				'../temp/server/mongo-db/api/user/user.controller.ts',
				'../temp/server/mongo-db/api/user/user.integration.ts',
				'../temp/server/mongo-db/api/user/user.model.ts',
				'../temp/server/mongo-db/api/user/user.router.ts',
				'../temp/server/mongo-db/api/user/user.spec.ts',
				'../temp/server/mongo-db/auth/local/local.router.ts',
				'../temp/server/mongo-db/auth/local/local.passport.ts',
				'../temp/server/mongo-db/auth/auth.router.ts',
				'../temp/server/mongo-db/auth/auth.service.ts',
				'../temp/server/mongo-db/index.ts',
				'../temp/server/mongo-db/seed.ts',
				'../temp/server/db-connect.ts',
				'../temp/server/express.ts',
				'../temp/server/server.ts',
				'../temp/server/socketio.ts',
				'../temp/server/routes.ts'
			]);
		});

		it('should generate the correct server file content', () => {
			assert.fileContent('../temp/server/db-connect.ts', /import \{ mongoConnect\, mongoDisconnect \} from \'\.\/mongo-db\'/);
			assert.fileContent('../temp/server/db-connect.ts', /mongoConnect/);
			assert.fileContent('../temp/server/db-connect.ts', /mongoDisconnect/);

			assert.fileContent('../temp/server/routes.ts', /import \{userRoutes\} from \'\.\/mongo-db\/api\/user\/user\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /import \{authRoutes\} from \'\.\/mongo-db\/auth\/auth\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /\'\/api\/users\'\, userRoutes/);
			assert.fileContent('../temp/server/routes.ts', /\'\/auth\'\, authRoutes/);
		});

		it('should generate the correct config files', () => {
			assert.file([
				'../temp/config/env/default.ts',
				'../temp/config/env/development.ts',
				'../temp/config/env/production.ts',
				'../temp/config/env/test.ts',
				'../temp/config/other/generate-ssl-certs.sh',
				'../temp/config/other/tslint.json',
				'../temp/config/test-libs/karma-test-shim.js',
				'../temp/config/test-libs/karma.config.js',
				'../temp/config/test-libs/protractor.config.js',
				'../temp/config/test-libs/server.test.js',
				'../temp/config/webpack/webpack.client.js',
				'../temp/config/webpack/webpack.common.js',
				'../temp/config/webpack/webpack.server.js',
				'../temp/config/helpers.js',
				'../temp/config/index.ts',
				'../temp/config/scripts.js',
			]);
		});

		it('should generate the correct config file content', () => {
			assert.fileContent('../temp/config/env/development.ts', /mongo/);
			assert.fileContent('../temp/config/env/production.ts', /mongo/);
			assert.fileContent('../temp/config/env/test.ts', /mongo/);
		});

	});

	describe('goatstack:app => Apache-Cassandra', function() {

		beforeAll(done => {
			return helpers.run(path.join(__dirname, '../generators/app'))
				.inDir(path.join(__dirname, '../temp'))
				.withPrompts({
					databases: ['Apache Cassandra'],
					appname: 'testApp',
					appdescription: 'This is a test App',
					appkeywords: 'testing, app',
					protocol: 'http',
					analyticschoice: false
				})
				.on('end', () => done());
		});

		it('should generate the app with correct server files', () => {
			assert.file([
				'../temp/server/cassandra-db/api/user/user.controller.ts',
				'../temp/server/cassandra-db/api/user/user.integration.ts',
				'../temp/server/cassandra-db/api/user/user.model.ts',
				'../temp/server/cassandra-db/api/user/user.router.ts',
				'../temp/server/cassandra-db/api/user/user.spec.ts',
				'../temp/server/cassandra-db/auth/local/local.router.ts',
				'../temp/server/cassandra-db/auth/local/local.passport.ts',
				'../temp/server/cassandra-db/auth/auth.router.ts',
				'../temp/server/cassandra-db/auth/auth.service.ts',
				'../temp/server/cassandra-db/index.ts',
				'../temp/server/cassandra-db/seed.ts',
				'../temp/server/db-connect.ts',
				'../temp/server/express.ts',
				'../temp/server/server.ts',
				'../temp/server/socketio.ts',
				'../temp/server/routes.ts'
			]);
		});

		it('should generate the correct server file content', () => {
			assert.fileContent('../temp/server/db-connect.ts', /import \{ cassandraConnect\, cassandraDisconnect \} from \'\.\/cassandra-db\'/);
			assert.fileContent('../temp/server/db-connect.ts', /cassandraConnect/);
			assert.fileContent('../temp/server/db-connect.ts', /cassandraDisconnect/);

			assert.fileContent('../temp/server/routes.ts', /import \{userRoutes\} from \'\.\/cassandra-db\/api\/user\/user\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /import \{authRoutes\} from \'\.\/cassandra-db\/auth\/auth\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /\'\/api\/users\'\, userRoutes/);
			assert.fileContent('../temp/server/routes.ts', /\'\/auth\'\, authRoutes/);
		});

		it('should generate the correct config files', () => {
			assert.file([
				'../temp/config/env/default.ts',
				'../temp/config/env/development.ts',
				'../temp/config/env/production.ts',
				'../temp/config/env/test.ts',
				'../temp/config/other/generate-ssl-certs.sh',
				'../temp/config/other/tslint.json',
				'../temp/config/test-libs/karma-test-shim.js',
				'../temp/config/test-libs/karma.config.js',
				'../temp/config/test-libs/protractor.config.js',
				'../temp/config/test-libs/server.test.js',
				'../temp/config/webpack/webpack.client.js',
				'../temp/config/webpack/webpack.common.js',
				'../temp/config/webpack/webpack.server.js',
				'../temp/config/helpers.js',
				'../temp/config/index.ts',
				'../temp/config/scripts.js',
			]);
		});

		it('should generate the correct config file content', () => {
			assert.fileContent('../temp/config/env/development.ts', /cassandra/);
			assert.fileContent('../temp/config/env/production.ts', /cassandra/);
			assert.fileContent('../temp/config/env/test.ts', /cassandra/);
		});

	});

	describe('goatstack:app => PostgresSQL', function() {

		beforeAll(done => {
			return helpers.run(path.join(__dirname, '../generators/app'))
				.inDir(path.join(__dirname, '../temp'))
				.withPrompts({
					databases: ['PostgresSQL'],
					appname: 'testApp',
					appdescription: 'This is a test App',
					appkeywords: 'testing, app',
					protocol: 'http',
					analyticschoice: false
				})
				.on('end', () => done());
		});

		it('should generate the app with correct server files', () => {
			assert.file([
				'../temp/server/postgres-db/api/user/user.controller.ts',
				'../temp/server/postgres-db/api/user/user.integration.ts',
				'../temp/server/postgres-db/api/user/user.model.ts',
				'../temp/server/postgres-db/api/user/user.router.ts',
				'../temp/server/postgres-db/api/user/user.spec.ts',
				'../temp/server/postgres-db/auth/local/local.router.ts',
				'../temp/server/postgres-db/auth/local/local.passport.ts',
				'../temp/server/postgres-db/auth/auth.router.ts',
				'../temp/server/postgres-db/auth/auth.service.ts',
				'../temp/server/postgres-db/index.ts',
				'../temp/server/postgres-db/seed.ts',
				'../temp/server/db-connect.ts',
				'../temp/server/express.ts',
				'../temp/server/server.ts',
				'../temp/server/socketio.ts',
				'../temp/server/routes.ts'
			]);
		});

		it('should generate the correct server file content', () => {
			assert.fileContent('../temp/server/db-connect.ts', /import \{ postgresConnect\, postgresDisconnect \} from \'\.\/postgres-db\'/);
			assert.fileContent('../temp/server/db-connect.ts', /postgresConnect/);
			assert.fileContent('../temp/server/db-connect.ts', /postgresDisconnect/);

			assert.fileContent('../temp/server/routes.ts', /import \{userRoutes\} from \'\.\/postgres-db\/api\/user\/user\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /import \{authRoutes\} from \'\.\/postgres-db\/auth\/auth\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /\'\/api\/users\'\, userRoutes/);
			assert.fileContent('../temp/server/routes.ts', /\'\/auth\'\, authRoutes/);
		});

		it('should generate the correct config files', () => {
			assert.file([
				'../temp/config/env/default.ts',
				'../temp/config/env/development.ts',
				'../temp/config/env/production.ts',
				'../temp/config/env/test.ts',
				'../temp/config/other/generate-ssl-certs.sh',
				'../temp/config/other/tslint.json',
				'../temp/config/test-libs/karma-test-shim.js',
				'../temp/config/test-libs/karma.config.js',
				'../temp/config/test-libs/protractor.config.js',
				'../temp/config/test-libs/server.test.js',
				'../temp/config/webpack/webpack.client.js',
				'../temp/config/webpack/webpack.common.js',
				'../temp/config/webpack/webpack.server.js',
				'../temp/config/helpers.js',
				'../temp/config/index.ts',
				'../temp/config/scripts.js',
			]);
		});

		it('should generate the correct config file content', () => {
			assert.fileContent('../temp/config/env/development.ts', /postgres/);
			assert.fileContent('../temp/config/env/production.ts', /postgres/);
			assert.fileContent('../temp/config/env/test.ts', /postgres/);
		});

	});

	describe('goatstack:app => MySQL', function() {

		beforeAll(done => {
			return helpers.run(path.join(__dirname, '../generators/app'))
				.inDir(path.join(__dirname, '../temp'))
				.withPrompts({
					databases: ['MySQL'],
					appname: 'testApp',
					appdescription: 'This is a test App',
					appkeywords: 'testing, app',
					protocol: 'http',
					analyticschoice: false
				})
				.on('end', () => done());
		});

		it('should generate the app with correct server files', () => {
			assert.file([
				'../temp/server/mysql-db/api/user/user.controller.ts',
				'../temp/server/mysql-db/api/user/user.integration.ts',
				'../temp/server/mysql-db/api/user/user.model.ts',
				'../temp/server/mysql-db/api/user/user.router.ts',
				'../temp/server/mysql-db/api/user/user.spec.ts',
				'../temp/server/mysql-db/auth/local/local.router.ts',
				'../temp/server/mysql-db/auth/local/local.passport.ts',
				'../temp/server/mysql-db/auth/auth.router.ts',
				'../temp/server/mysql-db/auth/auth.service.ts',
				'../temp/server/mysql-db/index.ts',
				'../temp/server/mysql-db/seed.ts',
				'../temp/server/db-connect.ts',
				'../temp/server/express.ts',
				'../temp/server/server.ts',
				'../temp/server/socketio.ts',
				'../temp/server/routes.ts'
			]);
		});

		it('should generate the correct server file content', () => {
			assert.fileContent('../temp/server/db-connect.ts', /import \{ mysqlConnect\, mysqlDisconnect \} from \'\.\/mysql-db\'/);
			assert.fileContent('../temp/server/db-connect.ts', /mysqlConnect/);
			assert.fileContent('../temp/server/db-connect.ts', /mysqlDisconnect/);

			assert.fileContent('../temp/server/routes.ts', /import \{userRoutes\} from \'\.\/mysql-db\/api\/user\/user\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /import \{authRoutes\} from \'\.\/mysql-db\/auth\/auth\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /\'\/api\/users\'\, userRoutes/);
			assert.fileContent('../temp/server/routes.ts', /\'\/auth\'\, authRoutes/);
		});

		it('should generate the correct config files', () => {
			assert.file([
				'../temp/config/env/default.ts',
				'../temp/config/env/development.ts',
				'../temp/config/env/production.ts',
				'../temp/config/env/test.ts',
				'../temp/config/other/generate-ssl-certs.sh',
				'../temp/config/other/tslint.json',
				'../temp/config/test-libs/karma-test-shim.js',
				'../temp/config/test-libs/karma.config.js',
				'../temp/config/test-libs/protractor.config.js',
				'../temp/config/test-libs/server.test.js',
				'../temp/config/webpack/webpack.client.js',
				'../temp/config/webpack/webpack.common.js',
				'../temp/config/webpack/webpack.server.js',
				'../temp/config/helpers.js',
				'../temp/config/index.ts',
				'../temp/config/scripts.js',
			]);
		});

		it('should generate the correct config file content', () => {
			assert.fileContent('../temp/config/env/development.ts', /mysql/);
			assert.fileContent('../temp/config/env/production.ts', /mysql/);
			assert.fileContent('../temp/config/env/test.ts', /mysql/);
		});

	});

	describe('goatstack:app => MariaDB', function() {

		beforeAll(done => {
			return helpers.run(path.join(__dirname, '../generators/app'))
				.inDir(path.join(__dirname, '../temp'))
				.withPrompts({
					databases: ['MariaDB'],
					appname: 'testApp',
					appdescription: 'This is a test App',
					appkeywords: 'testing, app',
					protocol: 'http',
					analyticschoice: false
				})
				.on('end', () => done());
		});

		it('should generate the app with correct server files', () => {
			assert.file([
				'../temp/server/maria-db/api/user/user.controller.ts',
				'../temp/server/maria-db/api/user/user.integration.ts',
				'../temp/server/maria-db/api/user/user.model.ts',
				'../temp/server/maria-db/api/user/user.router.ts',
				'../temp/server/maria-db/api/user/user.spec.ts',
				'../temp/server/maria-db/auth/local/local.router.ts',
				'../temp/server/maria-db/auth/local/local.passport.ts',
				'../temp/server/maria-db/auth/auth.router.ts',
				'../temp/server/maria-db/auth/auth.service.ts',
				'../temp/server/maria-db/index.ts',
				'../temp/server/maria-db/seed.ts',
				'../temp/server/db-connect.ts',
				'../temp/server/express.ts',
				'../temp/server/server.ts',
				'../temp/server/socketio.ts',
				'../temp/server/routes.ts'
			]);
		});

		it('should generate the correct server file content', () => {
			assert.fileContent('../temp/server/db-connect.ts', /import \{ mariaConnect\, mariaDisconnect \} from \'\.\/maria-db\'/);
			assert.fileContent('../temp/server/db-connect.ts', /mariaConnect/);
			assert.fileContent('../temp/server/db-connect.ts', /mariaDisconnect/);

			assert.fileContent('../temp/server/routes.ts', /import \{userRoutes\} from \'\.\/maria-db\/api\/user\/user\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /import \{authRoutes\} from \'\.\/maria-db\/auth\/auth\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /\'\/api\/users\'\, userRoutes/);
			assert.fileContent('../temp/server/routes.ts', /\'\/auth\'\, authRoutes/);
		});

		it('should generate the correct config files', () => {
			assert.file([
				'../temp/config/env/default.ts',
				'../temp/config/env/development.ts',
				'../temp/config/env/production.ts',
				'../temp/config/env/test.ts',
				'../temp/config/other/generate-ssl-certs.sh',
				'../temp/config/other/tslint.json',
				'../temp/config/test-libs/karma-test-shim.js',
				'../temp/config/test-libs/karma.config.js',
				'../temp/config/test-libs/protractor.config.js',
				'../temp/config/test-libs/server.test.js',
				'../temp/config/webpack/webpack.client.js',
				'../temp/config/webpack/webpack.common.js',
				'../temp/config/webpack/webpack.server.js',
				'../temp/config/helpers.js',
				'../temp/config/index.ts',
				'../temp/config/scripts.js',
			]);
		});

		it('should generate the correct config file content', () => {
			assert.fileContent('../temp/config/env/development.ts', /maria/);
			assert.fileContent('../temp/config/env/production.ts', /maria/);
			assert.fileContent('../temp/config/env/test.ts', /maria/);
		});

	});

	describe('goatstack:app => SQLite', function() {

		beforeAll(done => {
			return helpers.run(path.join(__dirname, '../generators/app'))
				.inDir(path.join(__dirname, '../temp'))
				.withPrompts({
					databases: ['SQLite'],
					appname: 'testApp',
					appdescription: 'This is a test App',
					appkeywords: 'testing, app',
					protocol: 'http',
					analyticschoice: false
				})
				.on('end', () => done());
		});

		it('should generate the app with correct server files', () => {
			assert.file([
				'../temp/server/sqlite-db/api/user/user.controller.ts',
				'../temp/server/sqlite-db/api/user/user.integration.ts',
				'../temp/server/sqlite-db/api/user/user.model.ts',
				'../temp/server/sqlite-db/api/user/user.router.ts',
				'../temp/server/sqlite-db/api/user/user.spec.ts',
				'../temp/server/sqlite-db/auth/local/local.router.ts',
				'../temp/server/sqlite-db/auth/local/local.passport.ts',
				'../temp/server/sqlite-db/auth/auth.router.ts',
				'../temp/server/sqlite-db/auth/auth.service.ts',
				'../temp/server/sqlite-db/index.ts',
				'../temp/server/sqlite-db/seed.ts',
				'../temp/server/db-connect.ts',
				'../temp/server/express.ts',
				'../temp/server/server.ts',
				'../temp/server/socketio.ts',
				'../temp/server/routes.ts'
			]);
		});

		it('should generate the correct server file content', () => {
			assert.fileContent('../temp/server/db-connect.ts', /import \{ sqliteConnect\, sqliteDisconnect \} from \'\.\/sqlite-db\'/);
			assert.fileContent('../temp/server/db-connect.ts', /sqliteConnect/);
			assert.fileContent('../temp/server/db-connect.ts', /sqliteDisconnect/);

			assert.fileContent('../temp/server/routes.ts', /import \{userRoutes\} from \'\.\/sqlite-db\/api\/user\/user\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /import \{authRoutes\} from \'\.\/sqlite-db\/auth\/auth\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /\'\/api\/users\'\, userRoutes/);
			assert.fileContent('../temp/server/routes.ts', /\'\/auth\'\, authRoutes/);
		});

		it('should generate the correct config files', () => {
			assert.file([
				'../temp/config/env/default.ts',
				'../temp/config/env/development.ts',
				'../temp/config/env/production.ts',
				'../temp/config/env/test.ts',
				'../temp/config/other/generate-ssl-certs.sh',
				'../temp/config/other/tslint.json',
				'../temp/config/test-libs/karma-test-shim.js',
				'../temp/config/test-libs/karma.config.js',
				'../temp/config/test-libs/protractor.config.js',
				'../temp/config/test-libs/server.test.js',
				'../temp/config/webpack/webpack.client.js',
				'../temp/config/webpack/webpack.common.js',
				'../temp/config/webpack/webpack.server.js',
				'../temp/config/helpers.js',
				'../temp/config/index.ts',
				'../temp/config/scripts.js',
			]);
		});

		it('should generate the correct config file content', () => {
			assert.fileContent('../temp/config/env/development.ts', /sqlite/);
			assert.fileContent('../temp/config/env/production.ts', /sqlite/);
			assert.fileContent('../temp/config/env/test.ts', /sqlite/);
		});

	});

	describe('goatstack:app => MSSQL', function() {

		beforeAll(done => {
			return helpers.run(path.join(__dirname, '../generators/app'))
				.inDir(path.join(__dirname, '../temp'))
				.withPrompts({
					databases: ['MSSQL'],
					appname: 'testApp',
					appdescription: 'This is a test App',
					appkeywords: 'testing, app',
					protocol: 'http',
					analyticschoice: false
				})
				.on('end', () => done());
		});

		it('should generate the app with correct server files', () => {
			assert.file([
				'../temp/server/mssql-db/api/user/user.controller.ts',
				'../temp/server/mssql-db/api/user/user.integration.ts',
				'../temp/server/mssql-db/api/user/user.model.ts',
				'../temp/server/mssql-db/api/user/user.router.ts',
				'../temp/server/mssql-db/api/user/user.spec.ts',
				'../temp/server/mssql-db/auth/local/local.router.ts',
				'../temp/server/mssql-db/auth/local/local.passport.ts',
				'../temp/server/mssql-db/auth/auth.router.ts',
				'../temp/server/mssql-db/auth/auth.service.ts',
				'../temp/server/mssql-db/index.ts',
				'../temp/server/mssql-db/seed.ts',
				'../temp/server/db-connect.ts',
				'../temp/server/express.ts',
				'../temp/server/server.ts',
				'../temp/server/socketio.ts',
				'../temp/server/routes.ts'
			]);
		});

		it('should generate the correct server file content', () => {
			assert.fileContent('../temp/server/db-connect.ts', /import \{ mssqlConnect\, mssqlDisconnect \} from \'\.\/mssql-db\'/);
			assert.fileContent('../temp/server/db-connect.ts', /mssqlConnect/);
			assert.fileContent('../temp/server/db-connect.ts', /mssqlDisconnect/);

			assert.fileContent('../temp/server/routes.ts', /import \{userRoutes\} from \'\.\/mssql-db\/api\/user\/user\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /import \{authRoutes\} from \'\.\/mssql-db\/auth\/auth\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /\'\/api\/users\'\, userRoutes/);
			assert.fileContent('../temp/server/routes.ts', /\'\/auth\'\, authRoutes/);
		});

		it('should generate the correct config files', () => {
			assert.file([
				'../temp/config/env/default.ts',
				'../temp/config/env/development.ts',
				'../temp/config/env/production.ts',
				'../temp/config/env/test.ts',
				'../temp/config/other/generate-ssl-certs.sh',
				'../temp/config/other/tslint.json',
				'../temp/config/test-libs/karma-test-shim.js',
				'../temp/config/test-libs/karma.config.js',
				'../temp/config/test-libs/protractor.config.js',
				'../temp/config/test-libs/server.test.js',
				'../temp/config/webpack/webpack.client.js',
				'../temp/config/webpack/webpack.common.js',
				'../temp/config/webpack/webpack.server.js',
				'../temp/config/helpers.js',
				'../temp/config/index.ts',
				'../temp/config/scripts.js',
			]);
		});

		it('should generate the correct config file content', () => {
			assert.fileContent('../temp/config/env/development.ts', /mssql/);
			assert.fileContent('../temp/config/env/production.ts', /mssql/);
			assert.fileContent('../temp/config/env/test.ts', /mssql/);
		});

	});

	describe('goatstack:app => MongoDB, Apache-Cassandra, PostgresSQL', function() {

		beforeAll(done => {
			return helpers.run(path.join(__dirname, '../generators/app'))
				.inDir(path.join(__dirname, '../temp'))
				.withPrompts({
					databases: ['MongoDB', 'Apache Cassandra', 'PostgresSQL'],
					defaultDb: 'MongoDB',
					appname: 'testApp',
					appdescription: 'This is a test App',
					appkeywords: 'testing, app',
					protocol: 'http',
					analyticschoice: false
				})
				.on('end', () => done());
		});

		it('should generate the app with correct server files', () => {
			assert.file([
				'../temp/server/mongo-db/api/user/user.controller.ts',
				'../temp/server/mongo-db/api/user/user.integration.ts',
				'../temp/server/mongo-db/api/user/user.model.ts',
				'../temp/server/mongo-db/api/user/user.router.ts',
				'../temp/server/mongo-db/api/user/user.spec.ts',
				'../temp/server/mongo-db/auth/local/local.router.ts',
				'../temp/server/mongo-db/auth/local/local.passport.ts',
				'../temp/server/mongo-db/auth/auth.router.ts',
				'../temp/server/mongo-db/auth/auth.service.ts',
				'../temp/server/mongo-db/index.ts',
				'../temp/server/mongo-db/seed.ts',
				'../temp/server/cassandra-db/index.ts',
				'../temp/server/cassandra-db/seed.ts',
				'../temp/server/postgres-db/index.ts',
				'../temp/server/postgres-db/seed.ts',
				'../temp/server/db-connect.ts',
				'../temp/server/express.ts',
				'../temp/server/server.ts',
				'../temp/server/socketio.ts',
				'../temp/server/routes.ts'
			]);
		});

		it('should generate the correct server file content', () => {
			assert.fileContent('../temp/server/db-connect.ts', /import \{ mongoConnect\, mongoDisconnect \} from \'\.\/mongo-db\'/);
			assert.fileContent('../temp/server/db-connect.ts', /mongoConnect/);
			assert.fileContent('../temp/server/db-connect.ts', /mongoDisconnect/);
			assert.fileContent('../temp/server/db-connect.ts', /import \{ cassandraConnect\, cassandraDisconnect \} from \'\.\/cassandra-db\'/);
			assert.fileContent('../temp/server/db-connect.ts', /cassandraConnect/);
			assert.fileContent('../temp/server/db-connect.ts', /cassandraDisconnect/);
			assert.fileContent('../temp/server/db-connect.ts', /import \{ postgresConnect\, postgresDisconnect \} from \'\.\/postgres-db\'/);
			assert.fileContent('../temp/server/db-connect.ts', /postgresConnect/);
			assert.fileContent('../temp/server/db-connect.ts', /postgresDisconnect/);

			assert.fileContent('../temp/server/routes.ts', /import \{userRoutes\} from \'\.\/mongo-db\/api\/user\/user\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /import \{authRoutes\} from \'\.\/mongo-db\/auth\/auth\.router\'/);
			assert.fileContent('../temp/server/routes.ts', /\'\/api\/users\'\, userRoutes/);
			assert.fileContent('../temp/server/routes.ts', /\'\/auth\'\, authRoutes/);
		});

		it('should generate the correct config files', () => {
			assert.file([
				'../temp/config/env/default.ts',
				'../temp/config/env/development.ts',
				'../temp/config/env/production.ts',
				'../temp/config/env/test.ts',
				'../temp/config/other/generate-ssl-certs.sh',
				'../temp/config/other/tslint.json',
				'../temp/config/test-libs/karma-test-shim.js',
				'../temp/config/test-libs/karma.config.js',
				'../temp/config/test-libs/protractor.config.js',
				'../temp/config/test-libs/server.test.js',
				'../temp/config/webpack/webpack.client.js',
				'../temp/config/webpack/webpack.common.js',
				'../temp/config/webpack/webpack.server.js',
				'../temp/config/helpers.js',
				'../temp/config/index.ts',
				'../temp/config/scripts.js',
			]);
		});

		it('should generate the correct config file content', () => {
			assert.fileContent('../temp/config/env/development.ts', /mongo/);
			assert.fileContent('../temp/config/env/production.ts', /mongo/);
			assert.fileContent('../temp/config/env/test.ts', /mongo/);
			assert.fileContent('../temp/config/env/development.ts', /cassandra/);
			assert.fileContent('../temp/config/env/production.ts', /cassandra/);
			assert.fileContent('../temp/config/env/test.ts', /cassandra/);
			assert.fileContent('../temp/config/env/development.ts', /postgres/);
			assert.fileContent('../temp/config/env/production.ts', /postgres/);
			assert.fileContent('../temp/config/env/test.ts', /postgres/);
		});

	});

});


text:
require 'active_resource'
require 'wistia/initialization'
require 'wistia/config'
require 'wistia/base'
require 'wistia/media'
require 'wistia/medias/caption'
require 'wistia/project'
require 'wistia/projects/sharing'
require 'wistia/stats'


text:
title: Kubernetes controllers configuration
description: API for KubeControllersConfiguration resource.
canonical_url: '/reference/resources/kubecontrollersconfig'
---

A {{site.prodname}} [Kubernetes controllers]({{ site.baseurl }}/reference/kube-controllers/configuration) configuration resource (`KubeControllersConfiguration`) represents configuration options for the {{site.prodname}} Kubernetes controllers.

For `calicoctl` [commands]({{ site.baseurl }}/reference/calicoctl/overview) that specify a resource type on the CLI, the following
aliases are supported (all case insensitive): `kubecontrollersconfiguration`, `kubecontrollersconfig`.

### Sample YAML

```yaml
apiVersion: projectcalico.org/v3
kind: KubeControllersConfiguration
metadata:
  name: default
spec:
  logSeverityScreen: Info
  healthChecks: Enabled
  etcdv3CompactionPeriod: 10m
  prometheusMetricsPort: 9094
  controllers:
    node:
      reconcilerPeriod: 5m
      leakGracePeriod: 15m
      syncLabels: Enabled
      hostEndpoint:
        autoCreate: Disabled
    policy:
      reconcilerPeriod: 5m
    workloadEndpoint:
      reconcilerPeriod: 5m
    serviceAccount:
      reconcilerPeriod: 5m
    namespace:
      reconcilerPeriod: 5m
```

### Kubernetes controllers configuration definition

#### Metadata

| Field | Description                                               | Accepted Values   | Schema |
|-------|-----------------------------------------------------------|-------------------|--------|
| name  | Unique name to describe this resource instance. Required. | Must be `default` | string |

- {{site.prodname}} automatically creates a resource named `default` containing the configuration settings, only the name `default` is used and only one object of this type is allowed. You can use [calicoctl]({{ site.baseurl }}/reference/calicoctl/overview) to view and edit these settings

#### Spec

| Field                  | Description                                               | Accepted Values                    | Schema | Default    |
|------------------------|-----------------------------------------------------------|------------------------------------|--------|------------|
| logSeverityScreen      | The log severity above which logs are sent to the stdout. | Debug, Info, Warning, Error, Fatal | string | Info       |
| healthChecks           | Enable support for health checks                          | Enabled, Disabled                  | string | Enabled    |
| prometheusMetricsPort  | Port on which to serve prometheus metrics.                | Set to 0 to disable, > 0 to enable. | TCP port | 9094 |
| etcdv3CompactionPeriod | The period between etcdv3 compaction requests. Only applies when using etcd as the {{site.prodname}} datastore. | Set to 0 to disable, > 0 to enable |  [Duration string][parse-duration] | 10m |
| controllers            | Enabled controllers and their settings                    |                                    | [Controllers](#controllers) | |

#### Controllers

| Field            | Description                                           |  Schema                                        |
|------------------|-------------------------------------------------------|------------------------------------------------|
| node             | Enable and configure the node controller              | omit to disable, or [NodeController](#nodecontroller) |
| policy           | Enable and configure the network policy controller    | omit to disable, or [PolicyController](#policycontroller)           |
| workloadEndpoint | Enable and configure the workload endpoint controller | omit to disable, or [WorkloadEndpointController](#workloadendpointcontroller) |
| serviceAccout    | Enable and configure the service account controller   | omit to disable, or [ServiceAccountController](#serviceaccountcontroller)  |
| namespace        | Enable and configure the namespace controller         | omit to disable, or [NamespaceController](#namespacecontroller)        |

#### NodeController

The node controller automatically cleans up configuration for nodes that no longer exist. Optionally, it can create host endpoints for all Kubernetes nodes.

| Field                              | Description                 | Accepted Values   | Schema | Default    |
|------------------------------------|-----------------------------|-------------------|--------|------------|
| reconcilerPeriod | Period to perform reconciliation with the {{site.prodname}} datastore | | [Duration string][parse-duration] | 5m |
| syncLabels | When enabled, Kubernetes node labels will be copied to {{site.prodname}} node objects. | Enabled, Disabled | string | Enabled |
| hostEndpoint | Controls allocation of host endpoints | | [HostEndpoint](#hostendpoint) | |
| leakGracePeriod | Grace period to use when garbage collecting suspected leaked IP addresses. | | [Duration string][parse-duration] | 15m |

#### HostEndpoint

| Field      | Description                                                      | Accepted Values   | Schema | Default    |
|------------|------------------------------------------------------------------|-------------------|--------|------------|
| autoCreate | When enabled, automatically create a host endpoint for each node | Enabled, Disabled | string | Disabled   |

#### PolicyController

The policy controller syncs Kubernetes network policies to the Calico datastore.  This controller is only valid when using etcd as the {{site.prodname}} datastore.

| Field            | Description                                                           | Schema                            | Default |
|------------------|-----------------------------------------------------------------------|-----------------------------------|---------|
| reconcilerPeriod | Period to perform reconciliation with the {{site.prodname}} datastore | [Duration string][parse-duration] | 5m      |

#### WorkloadEndpointController

The workload endpoint controller automatically syncs Kubernetes pod label changes to the {{site.prodname}} datastore by updating the corresponding workload
endpoints appropriately.  This controller is only valid when using etcd as the {{site.prodname}} datastore.

| Field            | Description                                                           | Schema                            | Default |
|------------------|-----------------------------------------------------------------------|-----------------------------------|---------|
| reconcilerPeriod | Period to perform reconciliation with the {{site.prodname}} datastore | [Duration string][parse-duration] | 5m      |

#### ServiceAccountController

The service account controller syncs Kubernetes service account changes to the {{site.prodname}} datastore.  This controller is only valid when using etcd as
the {{site.prodname}} datastore.

| Field            | Description                                                           | Schema                            | Default |
|------------------|-----------------------------------------------------------------------|-----------------------------------|---------|
| reconcilerPeriod | Period to perform reconciliation with the {{site.prodname}} datastore | [Duration string][parse-duration] | 5m      |

#### NamespaceController

The namespace controller syncs Kubernetes namespace label changes to the {{site.prodname}} datastore. This controller is only valid when using etcd as the
{{site.prodname}} datastore.

| Field            | Description                                                           | Schema                            | Default |
|------------------|-----------------------------------------------------------------------|-----------------------------------|---------|
| reconcilerPeriod | Period to perform reconciliation with the {{site.prodname}} datastore | [Duration string][parse-duration] | 5m      |

### Supported operations

| Datastore type        | Create  | Delete (Global `default`)  |  Update  | Get/List | Notes
|-----------------------|---------|----------------------------|----------|----------|------
| etcdv3                | Yes     | Yes                        | Yes      | Yes      |
| Kubernetes API server | Yes     | Yes                        | Yes      | Yes      |

[parse-duration]: https://golang.org/pkg/time/#ParseDuration


text:
package org.activiti.editor.constants;

/**

 */
public interface EditorJsonConstants {

  final String EDITOR_CHILD_SHAPES = "childShapes";
  final String EDITOR_SHAPE_ID = "resourceId";
  final String EDITOR_SHAPE_PROPERTIES = "properties";
  final String EDITOR_STENCIL = "stencil";
  final String EDITOR_STENCIL_ID = "id";
  final String EDITOR_BOUNDS = "bounds";
  final String EDITOR_BOUNDS_LOWER_RIGHT = "lowerRight";
  final String EDITOR_BOUNDS_UPPER_LEFT = "upperLeft";
  final String EDITOR_BOUNDS_X = "x";
  final String EDITOR_BOUNDS_Y = "y";
  final String EDITOR_DOCKERS = "dockers";
  final String EDITOR_OUTGOING = "outgoing";

  final String EDITOR_PROPERTIES_GENERAL_ITEMS = "items";
}


text:
module Nyauth
  module Test
    module ControllerMacros
      include Nyauth::SessionConcern

      def self.included(base)
        base.instance_eval do
          before do
            @request.env['nyauth'] = Nyauth::Nyan.new(@request.env)
          end
        end
      end
    end
  end
end


text:
$(function () {
	 /* body... */
	 alert("hello world!");
	 cosnole.log("alert");
})


text:
#include <geode/DataInput.hpp>

#include <SerializationRegistry.hpp>

namespace apache {
namespace geode {
namespace client {

void DataInput::readObjectInternal(SerializablePtr& ptr, int8_t typeId) {
  ptr = SerializationRegistry::deserialize(*this, typeId);
}
}  // namespace client
}  // namespace geode
}  // namespace apache


text:
<!doctype html>

    <link rel="stylesheet" href="css/DragItems_adapted.css"/>

    <meta charset="UTF-8" />
    <title>Canvas Drag and Drop Test</title>

Drag & drop the potatoes into the coordinate system. Press the 'End' button. You can then see their x and y coordinates in JATOS' results.

            <canvas id="potatoDropzone" class="dropzone"></canvas>

        <button id="endStudyButton">End</button>


text:
package root.adt;

import java.util.Collection;
import java.util.Iterator;

import root.lang.ImmutableListItemizer;
import root.lang.Itemizer;
import root.lang.StringExtractor;
import root.random.RNG;
import root.util.Root;
import root.validation.IndexOutOfBoundsException;

/**
 * Single-linked list implementation of the {@link RootList} interface.
 *
 * @author Edward Smith
 * @version 0.5
 * @since 0.5
 *
 * @param <T>
 *            The type of elements in the list
 */
public final class ListLinked<T> implements RootList<T> {

	// <><><><><><><><><><><><><><><> Attributes <><><><><><><><><><><><><><><>

	int size;
	Node<T> head;
	Node<T> tail;

	// <><><><><><><><><><><><><><>< Constructors ><><><><><><><><><><><><><><>

	/**
	 * Default constructor.
	 */
	public ListLinked() {
		// No-op default constructor
	}

	/**
	 * A constructor that adds all of the elements within the {@link Collection} to this list upon creation.
	 *
	 * @param collection
	 *            the {@link Collection} to add to the list upon creation
	 */
	public ListLinked(final Collection<? extends T> collection) {
		this.addAll(collection);
	}

	/**
	 * A constructor that takes an array and uses it to initialize the list upon creation.
	 *
	 * @param array
	 *            the array to initialize the list with upon creation
	 */
	@SafeVarargs
	public ListLinked(final T... array) {
		this.addAll(array, 0, array.length);
	}

	// <><><><><><><><><><><><><><> Public Methods <><><><><><><><><><><><><><>

	/**
	 * Inserts the {@code obj} at the specified index.
	 *
	 * @param index
	 *            the index to insert the {@code obj} at
	 * @param obj
	 *            the object to insert
	 * @throws IndexOutOfBoundsException
	 *             if the index is greater than the list size or less than zero
	 */
	@Override
	public final void add(final int index, final T obj) {
		if (index > this.size || index < 0) {
			throw new IndexOutOfBoundsException(index, this.size);
		}

		final Node<T> node = new Node<T>(obj);

		if (index == this.size) {
			if (this.tail == null) {
				this.head = node;
			} else {
				this.tail.next = node;
			}

			this.tail = node;
		} else if (index == 0) {
			node.next = this.head;
			this.head = node;
		} else {
			Node<T> prev = this.head;
			for (int i = 1; i < index; i++) {
				prev = prev.next;
			}

			node.next = prev.next;
			prev.next = node;
		}

		this.size++;
	}

	/**
	 * Adds the {@code obj} at the end of the list.
	 *
	 * @param obj
	 *            the object to add to the list
	 * @return always returns {@code true}
	 */
	@Override
	public final boolean add(final T obj) {
		final Node<T> node = new Node<T>(obj);

		if (this.tail == null) {
			this.head = node;
		} else {
			this.tail.next = node;
		}

		this.tail = node;
		this.size++;

		return true;
	}

	/**
	 * Adds all the objects from the {@link Collection} to the end of the list.
	 *
	 * @param collection
	 *            the {@link Collection} to add to the list
	 * @return {@code true} if items were added to the list, {@code false} otherwise
	 */
	@Override
	public final boolean addAll(final Collection<? extends T> collection) {
		if (collection != null && collection.size() > 0) {
			final Iterator<? extends T> iterator = collection.iterator();
			Node<T> node = new Node<T>(iterator.next());

			if (this.tail == null) {
				this.head = node;
			} else {
				this.tail.next = node;
			}

			this.tail = node;

			while (iterator.hasNext()) {
				node = new Node<T>(iterator.next());
				this.tail.next = node;
				this.tail = node;
			}

			this.size += collection.size();

			return true;
		}

		return false;
	}

	/**
	 * Inserts all the objects from the {@link Collection} into the list at the specified index.
	 *
	 * @param index
	 *            the index to insert the {@link Collection} at
	 * @param collection
	 *            the {@link Collection} to add to the list
	 * @return {@code true} if items were added to the list, {@code false} otherwise
	 * @throws IndexOutOfBoundsException
	 *             if the index is greater than the list size or less than zero
	 */
	@Override
	public final boolean addAll(final int index, final Collection<? extends T> collection) {
		if (index > this.size || index < 0) {
			throw new IndexOutOfBoundsException(index, this.size);
		}

		if (collection != null && collection.size() > 0) {
			Node<T> collHead = null, collTail = null, node;

			for (final T obj : collection) {
				node = new Node<T>(obj);

				if (collTail == null) {
					collHead = node;
				} else {
					collTail.next = node;
				}

				collTail = node;
			}

			if (index == this.size) {
				if (this.tail == null) {
					this.head = collHead;
				} else {
					this.tail.next = collHead;
				}

				this.tail = collTail;
			} else if (index == 0) {
				collTail.next = this.head;
				this.head = collHead;
			} else {
				Node<T> prev = this.head;
				for (int i = 1; i < index; i++) {
					prev = prev.next;
				}

				collTail.next = prev.next;
				prev.next = collHead;
			}

			this.size += collection.size();
			return true;
		}

		return false;
	}

	/**
	 * Adds the objects from the {@code T[]} array starting from {@code offset} and for the specified {@code length} to the end of the list.
	 *
	 * @param array
	 *            the {@code T[]} array to add to the list
	 * @param offset
	 *            the starting position in the array to add
	 * @param length
	 *            the number of elements from the array to add
	 */
	@Override
	public final void addAll(final T[] array, final int offset, final int length) {
		if (length > 0) {
			Node<T> node = new Node<T>(array[offset]);

			if (this.tail == null) {
				this.head = node;
			} else {
				this.tail.next = node;
			}

			this.tail = node;

			final int endLoop = offset + length;
			for (int i = offset + 1; i < endLoop; i++) {
				node = new Node<T>(array[i]);

				this.tail.next = node;
				this.tail = node;
			}

			this.size += length;
		}
	}

	/**
	 * Clears the list.
	 */
	@Override
	public final void clear() {
		Node.clear(this.head);

		this.head = null;
		this.tail = null;
		this.size = 0;
	}

	/**
	 * Returns a shallow copy of this {@link ListLinked} instance. (The elements themselves are not copied.)
	 *
	 * @return a shallow copy of this {@link ListLinked} instance
	 */
	@Override
	public final ListLinked<T> clone() {
		return new ListLinked<>(this);
	}

	/**
	 * Returns {@code true} if the list contains the specified object, {@code false} otherwise.
	 *
	 * @param obj
	 *            the object to check whether or not it is present in the list
	 * @return {@code true} if the list contains the specified object, {@code false} otherwise
	 */
	@Override
	public final boolean contains(final Object obj) {
		for (Node<T> n = this.head; n != null; n = n.next) {
			if (Root.equals(n.data, obj)) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Returns {@code true} if the list contains all of the objects within the specified {@link Collection}, {@code false} otherwise.
	 *
	 * @param collection
	 *            the {@link Collection} to check whether or not all of its objects are present in the list
	 * @return {@code true} if the list contains all of the objects within the specified {@link Collection}, {@code false} otherwise
	 */
	@Override
	public final boolean containsAll(final Collection<?> collection) {
		Node<T> n;

		items: for (final Object obj : collection) {
			for (n = this.head; n != null; n = n.next) {
				if (Root.equals(n.data, obj)) {
					continue items;
				}
			}

			return false;
		}

		return true;
	}

	/**
	 * Returns {@code true} if the list contains any of the objects within the specified {@link Iterable}, {@code false} otherwise.
	 *
	 * @param iterable
	 *            the {@link Iterable} to check whether or not any of its objects are present in the list
	 * @return {@code true} if the list contains any of the objects within the specified {@link Iterable}, {@code false} otherwise
	 */
	@Override
	public final boolean containsAny(final Iterable<? extends T> iterable) {
		Node<T> n;

		for (final T t : iterable) {
			for (n = this.head; n != null; n = n.next) {
				if (Root.equals(n.data, t)) {
					return true;
				}
			}
		}

		return false;
	}

	/**
	 * Adds the {@code obj} at the end of the list and returns the object from the method. This method is useful when you want to create an object and
	 * add it to the list at the same time.
	 *
	 * @param obj
	 *            the object to add to the list
	 * @return always returns the object added to the list
	 */
	@Override
	public final T echo(final T obj) {
		this.add(obj);

		return obj;
	}

	/**
	 * Returns {@code true} if the specified {@link Object} is equal to {@code this} object. The specified {@link Object} is equal to {@code this}
	 * object if:
	 *

	 *
The {@link Class} of the specified {@link Object} is an instance of {@link Collection}

	 *
The {@code size} of the specified {@link Collection} and {@code this} object are equal

	 *
All objects in both the specified {@link Collection} and {@code this} object are equal to each other

	 *

	 *
	 * @param obj
	 *            the specified {@link Object} to compare for equality to {@code this} object
	 * @return {@code true} if the specified {@link Object} is equal to {@code this} object, false otherwise
	 */
	@Override
	public final boolean equals(final Object obj) {
		return Node.equals(obj, this.head, this.size);
	}

	/**
	 * Extracts a {@link String} representation of the list.
	 *
	 * @param extractor
	 *            the {@link StringExtractor} to populate
	 */
	@Override
	public final void extract(final StringExtractor extractor) {
		Node.extract(extractor, this.head);
	}

	/**
	 * Returns the object located at the specified index.
	 *
	 * @param index
	 *            the index of the item in the list to return
	 * @return the object located at the specified index
	 */
	@Override
	public final T get(final int index) {
		if (index >= this.size || index < 0) {
			throw new IndexOutOfBoundsException(index, this.size);
		}

		Node<T> n = this.head;
		for (int i = 0; i < index; i++) {
			n = n.next;
		}

		return n.data;
	}

	/**
	 * Returns the capacity of the list.
	 *
	 * @return the capacity of the list
	 */
	@Override
	public final int getCapacity() {
		return Integer.MAX_VALUE;
	}

	/**
	 * Returns the size of the list, which is how many elements are actually in the list.
	 *
	 * @return the size of the list
	 */
	@Override
	public final int getSize() {
		return this.size;
	}

	/**
	 * Returns the hash code of the list.
	 *
	 * @return the hash code of the list
	 */
	@Override
	public final int hashCode() {
		return Node.hashCode(this.head, this.size);
	}

	/**
	 * Returns the index of the first occurrence of the specified object in the list, or -1 if the list does not contain the object.
	 *
	 * @param obj
	 *            the object to check for its index in the list
	 * @return the index of the first occurrence of the specified object in the list, or -1 if the list does not contain the object
	 */
	@Override
	public final int indexOf(final Object obj) {
		int i = 0;

		for (Node<T> n = this.head; n != null; n = n.next, i++) {
			if (Root.equals(n.data, obj)) {
				return i;
			}
		}

		return -1;
	}

	/**
	 * Inserts the {@code obj} at the specified index.
	 *
	 * @param index
	 *            the index to insert the {@code obj} at
	 * @param obj
	 *            the object to insert
	 * @throws IndexOutOfBoundsException
	 *             if the index is greater than the list size or less than zero
	 */
	@Override
	public final void insert(final int index, final T obj) {
		if (index > this.size || index < 0) {
			throw new IndexOutOfBoundsException(index, this.size);
		}

		final Node<T> node = new Node<T>(obj);

		if (index == this.size) {
			if (this.tail == null) {
				this.head = node;
			} else {
				this.tail.next = node;
			}

			this.tail = node;
		} else if (index == 0) {
			node.next = this.head;
			this.head = node;
		} else {
			Node<T> prev = this.head;
			for (int i = 1; i < index; i++) {
				prev = prev.next;
			}

			node.next = prev.next;
			prev.next = node;
		}

		this.size++;
	}

	/**
	 * Inserts all the objects from the {@link Collection} into the list at the specified index.
	 *
	 * @param index
	 *            the index to insert the {@link Collection} at
	 * @param collection
	 *            the {@link Collection} to add to the list
	 * @throws IndexOutOfBoundsException
	 *             if the index is greater than the list size or less than zero
	 */
	@Override
	public final void insertAll(final int index, final Collection<? extends T> collection) {
		if (index > this.size || index < 0) {
			throw new IndexOutOfBoundsException(index, this.size);
		}

		if (collection != null && collection.size() > 0) {
			Node<T> collHead = null, collTail = null, node;

			for (final T obj : collection) {
				node = new Node<T>(obj);

				if (collTail == null) {
					collHead = node;
				} else {
					collTail.next = node;
				}

				collTail = node;
			}

			if (index == this.size) {
				if (this.tail == null) {
					this.head = collHead;
				} else {
					this.tail.next = collHead;
				}

				this.tail = collTail;
			} else if (index == 0) {
				collTail.next = this.head;
				this.head = collHead;
			} else {
				Node<T> prev = this.head;
				for (int i = 1; i < index; i++) {
					prev = prev.next;
				}

				collTail.next = prev.next;
				prev.next = collHead;
			}

			this.size += collection.size();
		}
	}

	/**
	 * Returns {@code true} if the list is empty, which means its size is equal to zero.
	 *
	 * @return {@code true} if the list is empty
	 */
	@Override
	public final boolean isEmpty() {
		return this.size == 0;
	}

	/**
	 * Returns an {@link Itemizer} for the list.
	 *
	 * @return an {@link Itemizer} for the list
	 */
	@Override
	public final Itemizer<T> iterator() {
		return new Node.Iterator<T>(this.head, this.size);
	}

	/**
	 * Returns the last element of the list, or {@code null} if the list is empty.
	 *
	 * @return the last element of the list, or {@code null} if the list is empty
	 */
	@Override
	public final T last() {
		return this.tail == null ? null : this.tail.data;
	}

	/**
	 * Returns the index of the last occurrence of the specified object in the list, or -1 if the list does not contain the object.
	 *
	 * @param the
	 *            object to check for its last index in the list
	 * @return the index of the last occurrence of the specified object in the list, or -1 if the list does not contain the object
	 */
	@Override
	public final int lastIndexOf(final Object obj) {
		Node<T> node = this.head;
		int lastIndex = -1;

		for (int i = 0; node != null; i++) {
			if (Root.equals(node.data, obj)) {
				lastIndex = i;
			}

			node = node.next;
		}

		return lastIndex;
	}

	/**
	 * Throws {@link UnsupportedOperationException}.
	 *
	 * @throws UnsupportedOperationException
	 */
	@Override
	public final ImmutableListItemizer<T> listIterator() {
		throw new UnsupportedOperationException();
	}

	/**
	 * Throws {@link UnsupportedOperationException}.
	 *
	 * @throws UnsupportedOperationException
	 */
	@Override
	public final ImmutableListItemizer<T> listIterator(final int index) {
		throw new UnsupportedOperationException();
	}

	/**
	 * Returns a random element from the list using the {@link RNG#nextIndex(int)} method to pick the element. A {@code null} value is returned if the
	 * list is empty.
	 *
	 * @param rng
	 *            the random number generator to use
	 * @return a random element from the list
	 */
	@Override
	public final T random(final RNG rng) {
		if (this.size == 0) {
			return null;
		}

		final int index = rng.nextIndex(this.size);

		Node<T> n = this.head;
		for (int i = 0; i < index; i++) {
			n = n.next;
		}

		return n.data;
	}

	/**
	 * Removes the element in the list at the specified index.
	 *
	 * @param index
	 *            the index of the element to remove
	 * @return the element removed from the list
	 */
	@Override
	public final T remove(final int index) {
		if (index >= this.size || index < 0) {
			throw new IndexOutOfBoundsException(index, this.size);
		}

		Node<T> prev = null, node = this.head;
		for (int i = 0; i < index; i++) {
			prev = node;
			node = node.next;
		}

		if (this.head == node) {
			this.head = this.head.next;
		}

		if (this.tail == node) {
			this.tail = prev;
		}

		if (prev != null) {
			prev.next = node.next;
		}

		final T oldVal = node.data;
		node.data = null;
		node.next = null;
		node = null;
		this.size--;

		return oldVal;
	}

	/**
	 * Removes the first element in the list that equals the specified object.
	 *
	 * @param obj
	 *            the object to remove from the list
	 * @return {@code true} if the object was removed from the list, {@code false} otherwise
	 */
	@Override
	public final boolean remove(final Object obj) {
		Node<T> prev = null, node = this.head;

		for (; node != null; prev = node, node = node.next) {
			if (Root.equals(node.data, obj)) {
				if (this.head == node) {
					this.head = this.head.next;
				}

				if (this.tail == node) {
					this.tail = prev;
				}

				if (prev != null) {
					prev.next = node.next;
				}

				node.data = null;
				node.next = null;
				node = null;
				this.size--;

				return true;
			}
		}

		return false;
	}

	/**
	 * Removes all elements in the list that are found in the specified collection.
	 *
	 * @param collection
	 *            the {@link Collection} of objects to remove from the list
	 * @return {@code true} if at least one object was removed from the list, {@code false} otherwise
	 */
	@Override
	public final boolean removeAll(final Collection<?> collection) {
		final int origSize = this.size;

		for (final Object obj : collection) {
			this.remove(obj);
		}

		return origSize != this.size;
	}

	/**
	 * Replaces the first occurrence of {@code oldObj} in the list with {@code newObj}.
	 *
	 * @param oldObj
	 *            the original object to replace
	 * @param newObj
	 *            the new object
	 * @return {@code true} if the replace was successful, {@code false} otherwise
	 */
	@Override
	public final boolean replace(final T oldObj, final T newObj) {
		for (Node<T> n = this.head; n != null; n = n.next) {
			if (Root.equals(n.data, oldObj)) {
				n.data = newObj;
				n.hash = 0; // reset the cached hash value
				return true;
			}
		}

		return false;
	}

	/**
	 * Retains all elements in the list that are found in the specified collection.
	 *
	 * @param collection
	 *            the {@link Collection} of objects to retain within the list
	 * @return {@code true} if the list was modified in any way, {@code false} otherwise
	 */
	@Override
	public final boolean retainAll(final Collection<?> collection) {
		if (collection != null && collection.size() > 0) {
			Node<T> prev = null, node = this.head, toDelete;
			final int origSize = this.size;

			for (; node != null;) {
				if (!collection.contains(node.data)) {
					toDelete = node;

					if (this.head == node) {
						this.head = this.head.next;
					}

					if (this.tail == node) {
						this.tail = prev;
					}

					if (prev != null) {
						prev.next = node.next;
					}

					node = node.next;

					toDelete.data = null;
					toDelete.next = null;
					toDelete = null;
					this.size--;
				} else {
					prev = node;
					node = node.next;
				}
			}

			return origSize != this.size;
		}

		return false;
	}

	/**
	 * Sets the element in the list at the specified index to the specified object.
	 *
	 * @param index
	 *            the index whose element to set
	 * @param obj
	 *            the object to set
	 * @return the original element at the specified index
	 */
	@Override
	public final T set(final int index, final T obj) {
		if (index >= this.size || index < 0) {
			throw new IndexOutOfBoundsException(index, this.size);
		}

		Node<T> n = this.head;
		for (int i = 0; i < index; i++) {
			n = n.next;
		}

		final T oldValue = n.data;
		n.data = obj;
		n.hash = 0; // reset the cached hash value
		return oldValue;
	}

	/**
	 * Shuffles the contents of the {@link ListLinked} using the Knuth shuffling algorithm.
	 *
	 * @param rng
	 *            The random number generator to use during the shuffle
	 */
	@Override
	public final void shuffle(final RNG rng) {
		if (this.size > 1) {
			int i = 0;

			// 1. Create an array of Nodes to make this easier to implement
			@SuppressWarnings("unchecked")
			final Node<T>[] nodes = new Node[this.size];
			for (Node<T> n = this.head; n != null; n = n.next) {
				nodes[i++] = n;
			}

			// 2. Shuffle the data elements using the Knuth shuffling algorithm
			int r, tempHash;
			T tempData;

			for (i = this.size; i > 1;) {
				r = rng.nextIndex(i--);
				tempData = nodes[i].data;
				tempHash = nodes[i].hash;

				nodes[i].data = nodes[r].data;
				nodes[i].hash = nodes[r].hash;

				nodes[r].data = tempData;
				nodes[r].hash = tempHash;
			}
		}
	}

	/**
	 * Returns the size of the list, which is how many elements are actually in the list.
	 *
	 * @return the size of the list
	 */
	@Override
	public final int size() {
		return this.size;
	}

	/**
	 * Returns a sub-list of the list starting at {@code fromIndex}.
	 *
	 * @param fromIndex
	 *            the index to start the sub-list
	 * @return a {@link ListLinked} that is the sub-list of the list starting at {@code fromIndex}
	 */
	@Override
	public final ListLinked<T> subList(final int fromIndex) {
		return this.subList(fromIndex, this.size);
	}

	/**
	 * Returns a sub-list of the list starting at {@code fromIndex} and ending at {@code toIndex - 1}.
	 *
	 * @param fromIndex
	 *            the index to start the sub-list
	 * @param toIndex
	 *            the index the end the sub-list
	 * @return a {@link ListLinked} that is the sub-list of the list starting at {@code fromIndex} and ending at {@code toIndex - 1}
	 */
	@Override
	public final ListLinked<T> subList(final int fromIndex, final int toIndex) {
		if (fromIndex >= toIndex || fromIndex < 0 || toIndex < 0) {
			throw new IndexOutOfBoundsException(fromIndex, toIndex);
		}

		if (toIndex > this.size) {
			throw new IndexOutOfBoundsException(toIndex, this.size);
		}

		final ListLinked<T> l = new ListLinked<>();

		int i = 0;
		Node<T> n = this.head;
		for (; i < fromIndex; i++) {
			n = n.next;
		}

		for (; i < toIndex; i++) {
			l.add(n.data);
			n = n.next;
		}

		return l;
	}

	/**
	 * Returns a subset of the list starting at {@code fromIndex}.
	 *
	 * @param fromIndex
	 *            the index to start the subset
	 * @return a {@link SetHashed} that is the subset of the list starting at {@code fromIndex}
	 */
	@Override
	public final SetHashed<T> subset(final int fromIndex) {
		return this.subset(fromIndex, this.size);
	}

	/**
	 * Returns a subset of the list starting at {@code fromIndex} and ending at {@code toIndex - 1}.
	 *
	 * @param fromIndex
	 *            the index to start the subset
	 * @param toIndex
	 *            the index the end the subset
	 * @return a {@link SetHashed} that is the subset of the list starting at {@code fromIndex} and ending at {@code toIndex - 1}
	 */
	@Override
	public final SetHashed<T> subset(final int fromIndex, final int toIndex) {
		if (fromIndex >= toIndex || fromIndex < 0 || toIndex < 0) {
			throw new IndexOutOfBoundsException(fromIndex, toIndex);
		}

		if (toIndex > this.size) {
			throw new IndexOutOfBoundsException(toIndex, this.size);
		}

		final SetHashed<T> s = new SetHashed<>(toIndex - fromIndex);

		int i = 0;
		Node<T> n = this.head;
		for (; i < fromIndex; i++) {
			n = n.next;
		}

		for (; i < toIndex; i++) {
			s.add(n.data);
			n = n.next;
		}

		return s;
	}

	/**
	 * Returns a {@code T[]} array representation of the list.
	 *
	 * @return a {@code T[]} array representation of the list
	 */
	@Override
	public final T[] toArray() {
		final T[] array = Root.newArray(this.size);
		Node<T> node = this.head;

		for (int i = 0; i < this.size; i++) {
			array[i] = node.data;
			node = node.next;
		}

		return array;
	}

	/**
	 * Returns an {@code E[]} array representation of the list.
	 *
	 * @return an {@code E[]} array representation of the list
	 */
	@Override
	@SuppressWarnings("unchecked")
	public final <E> E[] toArray(final E[] arrayParam) {
		final E[] array = Root.newArray(arrayParam, this.size);
		Node<T> node = this.head;

		for (int i = 0; i < this.size; i++) {
			array[i] = (E) node.data;
			node = node.next;
		}

		return array;
	}

	/**
	 * Returns an immutable version of the list.
	 *
	 * @return an immutable version of the list
	 */
	@Override
	public final ListImmutable<T> toImmutable() {
		return new ListImmutable<>(this);
	}

	/**
	 * Returns a set containing all the elements of the list.
	 *
	 * @return a {@link SetHashed} containing all the elements of the list
	 */
	@Override
	public final SetHashed<T> toSet() {
		return new SetHashed<>(this);
	}

	/**
	 * Returns a {@link String} representation of the list.
	 *
	 * @return a {@link String} representation of the list
	 */
	@Override
	public final String toString() {
		final StringExtractor extractor = new StringExtractor(this.size << 4);
		this.extract(extractor);
		return extractor.toString();
	}

} // End ListLinked