text:
package nz.co.gregs.dbvolution.expressions;

import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.Point;
import java.sql.SQLException;
import java.util.List;
import java.util.Set;
import nz.co.gregs.dbvolution.*;
import nz.co.gregs.dbvolution.annotations.*;
import nz.co.gregs.dbvolution.datatypes.*;
import nz.co.gregs.dbvolution.datatypes.spatial2D.*;
import nz.co.gregs.dbvolution.generic.AbstractTest;
import static org.hamcrest.Matchers.*;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 *
Support DBvolution at
 * Patreon

 *
 * @author gregorygraham
 */
public class Point2DExpressionTest extends AbstractTest {

	final GeometryFactory geometryFactory = new GeometryFactory();

	public Point2DExpressionTest(Object testIterationName, DBDatabase db) throws SQLException {
		super(testIterationName, db);
		PointTestTable pointTestTable = new PointTestTable();

		db.preventDroppingOfTables(false);
		db.dropTableNoExceptions(pointTestTable);
		db.createTable(pointTestTable);

		pointTestTable.point.setValue(geometryFactory.createPoint(new Coordinate(2, 3)));
		db.insert(pointTestTable);

		pointTestTable = new PointTestTable();
		pointTestTable.point.setValue(geometryFactory.createPoint(new Coordinate(4, 6)));
		db.insert(pointTestTable);

		pointTestTable = new PointTestTable();
		pointTestTable.point.setValue(geometryFactory.createPoint(new Coordinate(0, 0)));
		db.insert(pointTestTable);
	}

	public static class PointTestTable extends DBRow {

		private static final long serialVersionUID = 1L;

		@DBColumn
		@DBPrimaryKey
		@DBAutoIncrement
		public DBInteger point_id = new DBInteger();

		@DBColumn("point_col")
		public DBPoint2D point = new DBPoint2D();
	}

	@Test
	public void testToWKTValue() throws SQLException {
		System.out.println("value");
		Point point = geometryFactory.createPoint(new Coordinate(2.0, 3.0));
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(Point2DExpression.value(point).toWKTFormat().is(pointTestTable.column(pointTestTable.point).toWKTFormat()));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));
		Assert.assertThat(allRows.get(0).point.jtsPointValue(), is(point));
	}

	@Test
	public void testValue() throws SQLException {
		System.out.println("value");
		Point point = geometryFactory.createPoint(new Coordinate(2.0, 3.0));
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(Point2DExpression.value(point).is(pointTestTable.column(pointTestTable.point)));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));
		Assert.assertThat(allRows.get(0).point.jtsPointValue(), is(point));
	}

	@Test
	public void testValueUsingLongs() throws SQLException {
		System.out.println("value");
		Point point = geometryFactory.createPoint(new Coordinate(2.0, 3.0));
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(Point2DExpression.value(2L,3L).is(pointTestTable.column(pointTestTable.point)));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));
		Assert.assertThat(allRows.get(0).point.jtsPointValue(), is(point));
	}

	@Test
	public void testValueUsingPoint2DResult() throws SQLException {
		System.out.println("value");
		Point point = geometryFactory.createPoint(new Coordinate(2.0, 3.0));
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(Point2DExpression.value(Point2DExpression.value(point)).is(pointTestTable.column(pointTestTable.point)));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));
		Assert.assertThat(allRows.get(0).point.jtsPointValue(), is(point));
	}

	@Test
	public void testGetQueryableDatatypeForExpressionValue() {
		System.out.println("getQueryableDatatypeForExpressionValue");
		Point2DExpression instance = new Point2DExpression();
		DBPoint2D result = instance.getQueryableDatatypeForExpressionValue();
		assertEquals(DBPoint2D.class, result.getClass());
	}

	@Test
	public void testCopy() {
		System.out.println("copy");
		Point2DExpression instance = new Point2DExpression();
		Point2DExpression result = instance.copy();
		assertEquals(instance, result);
	}

	@Test
	public void testIsAggregator() {
		System.out.println("isAggregator");
		Point2DExpression instance = new Point2DExpression();
		boolean expResult = false;
		boolean result = instance.isAggregator();
		assertEquals(expResult, result);
	}

	@Test
	public void testGetTablesInvolved() {
		System.out.println("getTablesInvolved");
		final PointTestTable pointTestTable = new PointTestTable();
		Point2DExpression instance = new Point2DExpression(pointTestTable.column(pointTestTable.point));
		Set<DBRow> result = instance.getTablesInvolved();
		Assert.assertThat(result.size(), is(1));
		DBRow[] resultArray = result.toArray(new DBRow[]{});
		DBRow aRow = resultArray[0];
		if (!(aRow instanceof PointTestTable)) {
			fail("Set should include PointTestTable");
		}
	}

	@Test
	public void testIsPurelyFunctional() {
		System.out.println("isPurelyFunctional");
		Point2DExpression instance = new Point2DExpression();
		boolean result = instance.isPurelyFunctional();
		Assert.assertThat(result, is(true));

		final PointTestTable pointTestTable = new PointTestTable();
		instance = new Point2DExpression(pointTestTable.column(pointTestTable.point));
		Assert.assertThat(instance.isPurelyFunctional(), is(false));
	}

	@Test
	public void testGetIncludesNull() {
		System.out.println("getIncludesNull");
		Point2DExpression instance = new Point2DExpression((Point) null);
		Assert.assertThat(instance.getIncludesNull(), is(true));

		final PointTestTable pointTestTable = new PointTestTable();
		instance = new Point2DExpression(pointTestTable.column(pointTestTable.point));
		Assert.assertThat(instance.getIncludesNull(), is(false));
	}

	@Test
	public void testStringResult() throws SQLException {
		System.out.println("stringResult");
		Point point = geometryFactory.createPoint(new Coordinate(2.0, 3.0));
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(Point2DExpression.value(point).stringResult().is(pointTestTable.column(pointTestTable.point).stringResult()));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));
	}

	@Test
	public void testIs_Point() throws SQLException {
		System.out.println("is");
		Point point = geometryFactory.createPoint(new Coordinate(2.0, 3.0));
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).is(point));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));
	}

	@Test
	public void testIs_Point2DResult() throws SQLException {
		System.out.println("is");
		Point point = geometryFactory.createPoint(new Coordinate(2.0, 3.0));
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(Point2DExpression.value(point).is(pointTestTable.column(pointTestTable.point)));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));
	}

	@Test
	public void testIsNot_Point2D() throws SQLException {
		System.out.println("isNot");
		Point point = geometryFactory.createPoint(new Coordinate(2.0, 3.0));
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).isNot(point));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(2));
		Assert.assertThat(allRows.get(0).point_id.intValue(), isOneOf(2,3));
	}

	@Test
	public void testGetX() throws SQLException {
		System.out.println("getX");
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).getX().is(2));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));

		dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).getX().is(4));
		allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(2));
	}

	@Test
	public void testGetY() throws SQLException {
		System.out.println("getY");
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).getY().is(3));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));

		dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).getY().is(6));
		allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(2));
	}

	@Test
	public void testMaxX() throws SQLException {
		System.out.println("maxX");
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).maxX().is(2));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));

		dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).maxX().is(4));
		allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(2));
	}

	@Test
	public void testMaxY() throws SQLException {
		System.out.println("maxY");
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).maxY().is(3));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));

		dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).maxY().is(6));
		allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(2));
	}

	@Test
	public void testMinX() throws SQLException {
		System.out.println("minX");
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).minX().is(2));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));

		dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).minX().is(4));
		allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(2));
	}

	@Test
	public void testMinY() throws SQLException {
		System.out.println("minY");
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).minY().is(3));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));

		dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).minY().is(6));
		allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(2));
	}

	@Test
	public void testDimension() throws SQLException {
		System.out.println("dimension");
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).measurableDimensions().is(0));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(3));
	}

	@Test
	public void testHasMagnitude() throws SQLException {
		System.out.println("dimension");
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).hasMagnitude().isNot(Boolean.TRUE));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(3));

		dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).hasMagnitude().is(Boolean.FALSE));
		allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(3));
	}

	@Test
	public void testMagnitude() throws SQLException {
		System.out.println("dimension");
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).magnitude().isNull());
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(3));
	}

	@Test
	public void testSpatialDimension() throws SQLException {
		System.out.println("dimension");
		final PointTestTable pointTestTable = new PointTestTable();
		DBQuery dbQuery = database.getDBQuery(pointTestTable);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).spatialDimensions().is(2));
		List<PointTestTable> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		Assert.assertThat(allRows.size(), is(3));
	}

	public static class BoundingBoxTest extends PointTestTable {

		private static final long serialVersionUID = 1L;

		@DBColumn
		public DBString stringPoint = new DBString(this.column(this.point).stringResult().substringBetween("(", " "));
		@DBColumn
		public DBString stringAfter = new DBString(this.column(this.point).stringResult().substringAfter("("));
		@DBColumn
		public DBString stringBefore = new DBString(this.column(this.point).stringResult().substringBefore(" "));
		@DBColumn
		public DBNumber getX = new DBNumber(this.column(this.point).getX());
		@DBColumn
		public DBNumber getY = new DBNumber(this.column(this.point).getY());
		@DBColumn
		public DBPolygon2D boundingBox = new DBPolygon2D(this.column(this.point).boundingBox());
		@DBColumn
		public DBBoolean getXis2 = new DBBoolean(this.column(this.point).getX().is(2));

	}

	@Test
	public void testBoundingBox() throws SQLException {
		System.out.println("boundingBox");
		final BoundingBoxTest pointTestTable = new BoundingBoxTest();
		DBQuery dbQuery = database.getDBQuery(pointTestTable).setBlankQueryAllowed(true);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.point).getY().is(3));
		List<BoundingBoxTest> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		database.print(allRows);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));
		final String boundingText = allRows.get(0).boundingBox.jtsPolygonValue().toText();
		String[] splits = boundingText.split("[^-0-9.]+");
		int numbersTested = 0;
		for (String split : splits) {
			System.out.println("SPLIT: " + split);
			if (split.length() > 0) {
				Assert.assertThat(Math.round(Double.parseDouble(split) * 1000) / 1000.0, isOneOf(2.0, 3.0));
				numbersTested++;
			}
		}
		Assert.assertThat(numbersTested, is(10));
	}

	public static class DistanceTest extends PointTestTable {

		private static final long serialVersionUID = 1L;

		@DBColumn
		public DBNumber getX = new DBNumber(this.column(this.point).getX());
		@DBColumn
		public DBNumber getY = new DBNumber(this.column(this.point).getY());
		@DBColumn
		public DBPoint2D point2 = new DBPoint2D(Point2DExpression.value(2, 3));
		@DBColumn
		public DBNumber getX2 = new DBNumber(Point2DExpression.value(2, 3).getX());
		@DBColumn
		public DBNumber getY2 = new DBNumber(Point2DExpression.value(2, 3).getY());
		@DBColumn
		public DBNumber distance = new DBNumber(this.column(this.point).distanceTo(Point2DExpression.value(2, 3)));
	}

	@Test
	public void testDistance() throws SQLException {
		System.out.println("distance");
		final DistanceTest pointTestTable = new DistanceTest();
		DBQuery dbQuery = database.getDBQuery(pointTestTable).setBlankQueryAllowed(true);
		database.print(dbQuery.getAllInstancesOf(pointTestTable));
		dbQuery.addCondition(pointTestTable.column(pointTestTable.distance).is(0));
		List<DistanceTest> allRows = dbQuery.getAllInstancesOf(pointTestTable);
		database.print(allRows);
		Assert.assertThat(allRows.size(), is(1));
		Assert.assertThat(allRows.get(0).point_id.intValue(), is(1));

		dbQuery = database.getDBQuery(pointTestTable).setBlankQueryAllowed(true);
		dbQuery.addCondition(pointTestTable.column(pointTestTable.distance).round(2).is(3.61));
		allRows = dbQuery.getAllInstancesOf(pointTestTable);
		database.print(allRows);
		Assert.assertThat(allRows.size(), is(2));
	}
}


text:
module Quickbooks
  module QbxmlDebugAdapter
    class Connection
      def send_xml(xml)
        puts "Sending XML: #{xml.to_s}"
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
makehackvoid.com
================

This project maintains the [Jekyll](https://jekyllrb.com/) layouts, stylesheets, and other assets required to automatically build the [makehackvoid.com](https://makehackvoid.com) website.

Usage
-----

We build the website automatically from plaintext [Markdown](https://en.wikipedia.org/wiki/Markdown) files. This means adding your content is quite simple, with two options for doing so:

1. directly via GitHub's web interface; or
2. by downloading the project for editing locally

For more detail see the [howto for writing/adding content on the MHV blog](http://makehackvoid.com/blog/2014/03/15/writing-howto/).

To hack on the website you'll need [Ruby and Ruby Gems](https://jekyllrb.com/docs/installation/). To fetch the necessary packages/dependencies use bundle, in the root of the project:

    bundle install

and then build the site locally while watching for changes:

    jekyll serve --watch

File structure
--------------

- `news/_posts/`: news items (blog)
- `events/_posts/`: event postings (blog)
- `projects/_posts/`: project exhibition

We're making use of some extra features over vanilla Jekyll:

- `_assets`: https://github.com/ixti/jekyll-assets
- `_data`: https://jekyllrb.com/docs/datafiles/

Technologies
------------
* Jekyll (1.1)
* Twitter Bootstrap (3.0)
* jQuery (1.10)
* [Jekyll-Incorporated](https://github.com/kippt/jekyll-incorporated)

Other resources
---------------

Liquid cheat-sheet: http://cheat.markdunkley.com/

License
-------
The licensed for this project will be finalised before public release. It is proposed that it be released under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).

To-dos
------

Layout/code:

- join link (dropdown?) — membership.md - membership options, entry to google forms, email
- events/news structure — fold together under journal

Content:

- homepage
- membership/join page
- about/about our space page

Design:

- mhv logo
- homepage hero/banner items
- footer goodness
- project portfolio layout & typography
- blog-reel layout & typography
- news item styling (blog)
- event item styling (blog)
- table formatting


text:
package org.sakaiproject.search.component;

import java.util.Properties;
import java.util.Set;

import org.sakaiproject.component.api.ComponentManager;

/**
 * @author ieb
 */
public class ComponentManagerBean implements ComponentManager
{
	/**
	 * @return
	 */
	private ComponentManager getComponentManager()
	{
		return org.sakaiproject.component.cover.ComponentManager.getInstance();
	}

	public void init()
	{

	}

	public void destroy()
	{

	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.sakaiproject.component.api.ComponentManager#close()
	 */
	public void close()
	{
		getComponentManager().close();
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.sakaiproject.component.api.ComponentManager#contains(java.lang.Class)
	 */
	public boolean contains(Class iface)
	{
		return getComponentManager().contains(iface);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.sakaiproject.component.api.ComponentManager#contains(java.lang.String)
	 */
	public boolean contains(String ifaceName)
	{
		return getComponentManager().contains(ifaceName);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.sakaiproject.component.api.ComponentManager#get(java.lang.Class)
	 */
	public Object get(Class iface)
	{
		return getComponentManager().get(iface);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.sakaiproject.component.api.ComponentManager#get(java.lang.String)
	 */
	public Object get(String ifaceName)
	{
		return getComponentManager().contains(ifaceName);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.sakaiproject.component.api.ComponentManager#getConfig()
	 */
	public Properties getConfig()
	{
		return getComponentManager().getConfig();
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.sakaiproject.component.api.ComponentManager#getRegisteredInterfaces()
	 */
	public Set getRegisteredInterfaces()
	{
		return getComponentManager().getRegisteredInterfaces();
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.sakaiproject.component.api.ComponentManager#hasBeenClosed()
	 */
	public boolean hasBeenClosed()
	{
		return getComponentManager().hasBeenClosed();
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.sakaiproject.component.api.ComponentManager#loadComponent(java.lang.Class,
	 *      java.lang.Object)
	 */
	public void loadComponent(Class iface, Object component)
	{
		getComponentManager().loadComponent(iface, component);

	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.sakaiproject.component.api.ComponentManager#loadComponent(java.lang.String,
	 *      java.lang.Object)
	 */
	public void loadComponent(String ifaceName, Object component)
	{
		getComponentManager().loadComponent(ifaceName, component);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.sakaiproject.component.api.ComponentManager#waitTillConfigured()
	 */
	public void waitTillConfigured()
	{
		getComponentManager().waitTillConfigured();
	}

}


text:
import {
  GOOGLE_CHART_TYPE_OPTIONS
} from './Constant'

/*!*************************************************************************
[Utils.js]
*****************************************************************************/
/* global define */
/**
 * Defines all the types necessary for making api calls.
 * module src/Utils
 */

/**
 * @module Utils
 * @params {String} Url - Provides the post url
 * @params {Object} data - The object that represents the contents of the
 * request being sent
 */
export function postApiRequest(uri, data, onSuccessCallback,
                               onFailureCallback, callbackParmas) {
  data = jsonStringfy(data)
  apiCall(uri, data, 'POST', onSuccessCallback, onFailureCallback, callbackParmas)
}

export function baseUrl() {
  return window.location.origin + '/'
}
/**
 * @module Utils
 * @params {String} Url - Provides the post url
 * @params {Object} data - The object that represents the contents of the
 * request being sent
 */
export function getApiRequest(uri, data, onSuccessCallback, onFailureCallback,
  callbackParmas, interval) {
  let payload = data ? {payload: jsonStringfy(data)} : data
  apiCall(uri, payload, 'GET', onSuccessCallback, onFailureCallback, callbackParmas,  interval)
}

/**
 * description: converts a JavaScript value to a JSON string
 * @module Utils
 * @params {Object} data - The object that represents the contents of the
 * request being sent
 */
function jsonStringfy(data) {
  return JSON.stringify(data)
}

/**
 * description: Ajax call for post/get api
 * Created a method to be called to get the data and
 * stop the interval once the promise is resolved and user receives the data
 * @module Utils
 * @params {String} Url - Provides the post url
 * @params {Object} data - The object that represents the contents of the
 * request being sent
 * @params {String} methodType - Defines type of request to be made
 * @params {Function} onSuccess - Success callback function
 * @params {Function} onFailure - Failure callback function
 * TODO: Need to add a callback function on success and failure
 */
export function apiCall(uri, data, methodType, onSuccess, onFailure, callbackParmas=null) {
  const csrftoken = getCookie('csrftoken');
  $.ajaxSetup({
    beforeSend: function(xhr, settings) {
      if (!this.crossDomain) {
          xhr.setRequestHeader('X-CSRFToken', csrftoken);
      }
    }
  });
  $.ajax({
    url: uri,
    method: methodType,
    contentType: 'application/json',
    data: data,
    success: function (response) {
      if (onSuccess) {
        if(callbackParmas){
          onSuccess(response, callbackParmas)
        }else {
          onSuccess(response)
        }

      }
    },

    error: function (error) {
      if (onFailure) {
        onFailure(error)
      }
    }
  })
}

function getCookie(name) {
  let cookieValue = null;
  if (document.cookie && document.cookie !== '') {
    let cookies = document.cookie.split(';');
    for (let i = 0; i < cookies.length; i++) {
      let cookie = jQuery.trim(cookies[i]);
      // Does this cookie string begin with the name we want?
      if (cookie.substring(0, name.length + 1) === (name + '=')) {
        cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
        break;
      }
    }
  }
  return cookieValue;
}

export function getEmptyApiDefinition() {
  return {
    id: null,
    name: 'first chart',
    url: 'first-chart',
    query: '',
    parameters: [],
    testParameters: {},
    validations: [],
    transformations: [],
    transpose: false,
    type: 'ColumnChart',
    options: {},
    chartData: {},
    pivotColumn: undefined,
    metric: undefined,
    columnsToMerge: undefined,
    newColumnName: '',
    apiErrorMsg: null,
    database: null
  }
}

export function getEmptyFilterDefinition() {
  return {
    id: null,
    name: '',
    url: '',
    database: '',
    query: '',
    apiErrorMsg: '',
    filterData: [],
    parameters: []
  }
}

export function getEmptyWidgetDefinition() {
  return {
    width: 4,
    height: 20,
    top: 7,
    left: 1,
    title: 'Chart Title',
    chartType: GOOGLE_CHART_TYPE_OPTIONS[7].value,
    chartStyles: {},
    api_url: '',
    apiParams: {}
  }
}

export function getEmptyUserInfo() {
  return {
    'first_name': '',
    'last_name': '',
    'name': 'none',
    'email': '',
    'can_add_chart': false,
    'can_delete_chart': false
  }
}

export function getEmptyParamDefinition(apiIndex) {
  return {
    name: '',
    order: 0,
    type: 1,
    data_type: 'string',
    mandatory: false,
    default_value: '',
    kwargs: {},
    test_value: '',
    dropdown_api: '',
    is_parameterized: false
  }
}

function processParamDef(definitions) {
  let appliedDef = {}
  if (definitions.length) {
    definitions.map((data) => {
      appliedDef[data.name] = {
        type: data.type,
        optional: data.optional,
        default_value: data.default_value,
        isParamDefCustom: data.isParamDefCustom
      }
      if (data.hasOwnProperty('kwargs')) {
        appliedDef[data.name].kwargs = data.kwargs
      }
    })
  }
  return appliedDef
}

// The following function loads the google charts JS files
export function googleChartLoader(onSuccess, version, packages) {
  var options = {
    dataType: 'script',
    cache: true,
    url: 'https://www.gstatic.com/charts/loader.js',
  };
  jQuery.ajax(options).done(function(){
    google.charts.load(version || 'current', {
      packages: packages || ['corechart'],
      'callback': onSuccess
    });
  });
}

function execRegexGroupedMulValues(regex, text, result) {
  let match = regex.exec(text),
    newResult = result.slice()

  while (match !== null) {
    if (newResult.indexOf(match[1]) === -1) {
      newResult.push(match[1])
    }
    match = regex.exec(text)
  }

  return newResult
}

export function fetchQueryParamsFromQuery(text) {
  let regExpForParams = /{{\s*params\.([^\s}%]+)\s*}}/g,
      regExpForExp = /{%[^(%})]*params\.([^\s}%]+)[^({%)]*%}/g,
      paramsArray = []

  paramsArray = execRegexGroupedMulValues(regExpForParams, text, paramsArray)
  paramsArray = execRegexGroupedMulValues(regExpForExp, text, paramsArray)

  return paramsArray
}

export function fetchSessionParamsFromQuery(text) {
  let regExpForParams = /{{\s*user\.([^\s}%]+)\s*}}/g,
      regExpForExp = /{%[^(%})]*user\.([^\s}%]+)[^({%)]*%}/g,
      paramsArray = []

  paramsArray = execRegexGroupedMulValues(regExpForParams, text, paramsArray)
  paramsArray = execRegexGroupedMulValues(regExpForExp, text, paramsArray)

  return paramsArray
}

export function isJsonString(str) {
    try {
        JSON.parse(str);
    } catch (e) {
        return false;
    }
    return true;
}

export function checkObjectAlreadyExists (data, keyName, value) {
  for (let i = 0; i < data.length; i++) {
    if (data[i].hasOwnProperty(keyName) && data[i][keyName] === value) {
      return i
    }
  }
  return -1
}

export function formatTestParameters (paramDefintion, key, valueKey) {
  let testParams = {
    params: {},
    user: {}
  }

  paramDefintion.map((param) => {
    if (param.type === 2) {
      testParams.user[param[key]] = param[valueKey]
    } else {
      testParams.params[param[key]] = param[valueKey]
    }
  })
  return testParams
}

export function getUrlParams() {
  let pageURL = decodeURIComponent(window.location.search.substring(1)),
    parameterName,
    i
  if(pageURL === '') {
    return null
  }
  return JSON.parse('{"' + decodeURI(pageURL).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}')
}

export function setUrlParams(newParams) {
  let queryString = Object.keys(newParams).map(function(k) {
    return encodeURIComponent(k) + '=' + encodeURIComponent(newParams[k])
  }).join('&')
  var newurl = window.location.protocol + '//' + window.location.host + window.location.pathname + '?' + queryString;
  window.history.replaceState({path: newurl},'',newurl);
}

export function formatForDropdown(data) {
  let result = []

  data.map((val) => {
    result.push({
      label: val[0],
      value: val[0]
    })
  })
  return result
}


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

using System;
using System.ComponentModel;
using System.Windows.Forms;
using NUnit.ProjectEditor.ViewElements;

namespace NUnit.ProjectEditor
{
    public partial class XmlView : UserControl, IXmlView
    {
        #region Constructor

        /// <summary>
        /// Constructor
        /// </summary>
        public XmlView()
        {
            InitializeComponent();

            Xml = new TextElement(richTextBox1);
        }

        #endregion

        #region IXmlView Members

        /// <summary>
        /// Gets or sets the XML text
        /// </summary>
        public ITextElement Xml { get; private set; }

        public void DisplayError(string message)
        {
            errorMessageLabel.Visible = true;
            errorMessageLabel.Text = message;

            richTextBox1.Dock = DockStyle.Top;
            richTextBox1.Height = this.ClientSize.Height - errorMessageLabel.Height;
        }

        public void DisplayError(string message, int lineNumber, int linePosition)
        {
            DisplayError(message);

            if (lineNumber > 0 && linePosition > 0)
            {
                int offset = richTextBox1.GetFirstCharIndexFromLine(lineNumber - 1) + linePosition - 1;
                int length = 0;

                string text = richTextBox1.Text;
                if (char.IsLetterOrDigit(text[offset]))
                    while (char.IsLetterOrDigit(text[offset + length]))
                        length++;
                else
                    length = 1;

                richTextBox1.Select(offset, length);
            }
        }

        public void RemoveError()
        {
            errorMessageLabel.Visible = false;
            richTextBox1.Dock = DockStyle.Fill;
        }

        #endregion

        #region ISelectableView Members

        public event ActionStartingHandler Deselecting;
        public event ActionHandler Selected;

        void ISelectableView.NotifySelected()
        {
            if (Selected != null)
                Selected();
        }

        public bool CanDeselect()
        {
            if (Deselecting != null)
            {
                var eventArgs = new ActionStartingEventArgs();
                Deselecting(eventArgs);
                return !eventArgs.Cancel;
            }

            return true;
        }

        #endregion

        #region IView Members

        public IMessageDisplay MessageDisplay { get; private set; }

        #endregion
    }
}


text:
import * as React from "react"

import { ILink } from "../models/Link"

interface Props extends React.Props<App> {
    link: ILink
}

// alternate way to define prop inline
// export default class App extends React.Component<{ link: ILink }, {}> {
export default class App extends React.Component<Props, {}> {
    public render() {
        return (

                  {this.props.link.title}

        )
    }
}


text:
#pragma once
#ifndef EGLPLUS_FRIEND_OF_1305291005_HPP
#define EGLPLUS_FRIEND_OF_1305291005_HPP

#include <eglplus/config.hpp>

namespace eglplus {

template <typename T>
class FriendOf
{
protected:
	static auto GetHandle(const T& x) ->
		decltype(x._handle)
	{
		return x._handle;
	}
};

} // namespace eglplus

#endif // include guard


text:
'use strict';

const JSDOMEnvironment = require('jest-environment-jsdom');

class TestEnvironment extends JSDOMEnvironment {
  constructor(config, context) {
    super(config, context);
    this.global.myCustomPragma = context.docblockPragmas['my-custom-pragma'];
  }
}

module.exports = TestEnvironment;


text:
/**
* Component de RankPPrice
*/
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { MdButtonModule } from '@angular/material';
import { ChartRankPPriceService } from './chartRankPPrice.service';
import { AutocompleteOverviewProduct } from './../../../searcher/product/searcherProduct.component';

@Component({
  selector: 'chartRankPPrice',
  templateUrl: './chartRankPPrice.html',
  styleUrls: ['./../../chartistJsProduct.scss'],
})

export class ChartRankPPrice implements OnInit {
  data: any;
  products: any;
  active: boolean;
  dbdata: any;
  product_id: any;
  startDate = new Date('2015/01/01');
  endDate = Date.now();
  constructor(private _ChartRankPPriceService: ChartRankPPriceService) {

  }
  /**
  * función ngOnInit, función lanzada en paralelo a la carga de la página
  */
  ngOnInit() {
    //this.data = this._ChartRankPPriceService.getAll();
    this.active = false;
    this._ChartRankPPriceService.getProductsDb()
      .subscribe(
      data => {
        this.products = data;
      }
      )
  }
  /**
  * Método donde se obtiene el id del producto que se desea consultar.
  * @param event variable que se envía desde component AutocompleteOverviewCustomer
  */
  showId(event): void {
    if (event.id !== null) {
      this.product_id = event.id;
    }
  }
  /**
  * Función onSubmit, se envía el formulario a función del services que se encarga de realizar llamada a API y envíar los datos de esta al gráfico mediante la función setData().
  * @param f:NgForm, formulario creado con NgModel.
  */
  onSubmit(f: NgForm) {
    this.active = false;
    if (this.product_id == null) {
      alert('Debe ingresar un producto');
      return;
    }

    let form = JSON.stringify({
      start: f.value.start,
      end: f.value.end,
      k: f.value.k,
      id: this.product_id
    });
    const filter = JSON.parse(form);
    this._ChartRankPPriceService.getPrices(filter)
      .subscribe(
      data => {
        this.dbdata = data['data'];

        this.data = this._ChartRankPPriceService.setData(this.dbdata);
        this.active = true;
      },
      err => { console.log(err) }
      );
  }
  /**
  * Función de conversión Responsive
  */
  getResponsive(padding, offset) {
    return this._ChartRankPPriceService.getResponsive(padding, offset);

  }
}


text:
import {R3PartialDeclaration} from '@angular/compiler';
import {AbsoluteFsPath} from '../../../src/ngtsc/file_system';
import {AstObject} from '../ast/ast_value';
import {DeclarationScope} from './declaration_scope';
import {EmitScope} from './emit_scopes/emit_scope';
import {IifeEmitScope} from './emit_scopes/iife_emit_scope';
import {LinkerEnvironment} from './linker_environment';
import {createLinkerMap, PartialLinkerSelector} from './partial_linkers/partial_linker_selector';

export const NO_STATEMENTS: Readonly<any[]> = [] as const;

/**
 * This class is responsible for linking all the partial declarations found in a single file.
 */
export class FileLinker<TConstantScope, TStatement, TExpression> {
  private linkerSelector: PartialLinkerSelector<TExpression>;
  private emitScopes = new Map<TConstantScope, EmitScope<TStatement, TExpression>>();

  constructor(
      private linkerEnvironment: LinkerEnvironment<TStatement, TExpression>,
      sourceUrl: AbsoluteFsPath, code: string) {
    this.linkerSelector = new PartialLinkerSelector<TExpression>(
        createLinkerMap(this.linkerEnvironment, sourceUrl, code), this.linkerEnvironment.logger,
        this.linkerEnvironment.options.unknownDeclarationVersionHandling);
  }

  /**
   * Return true if the given callee name matches a partial declaration that can be linked.
   */
  isPartialDeclaration(calleeName: string): boolean {
    return this.linkerSelector.supportsDeclaration(calleeName);
  }

  /**
   * Link the metadata extracted from the args of a call to a partial declaration function.
   *
   * The `declarationScope` is used to determine the scope and strategy of emission of the linked
   * definition and any shared constant statements.
   *
   * @param declarationFn the name of the function used to declare the partial declaration - e.g.
   *     `ɵɵngDeclareDirective`.
   * @param args the arguments passed to the declaration function, should be a single object that
   *     corresponds to the `R3DeclareDirectiveMetadata` or `R3DeclareComponentMetadata` interfaces.
   * @param declarationScope the scope that contains this call to the declaration function.
   */
  linkPartialDeclaration(
      declarationFn: string, args: TExpression[],
      declarationScope: DeclarationScope<TConstantScope, TExpression>): TExpression {
    if (args.length !== 1) {
      throw new Error(
          `Invalid function call: It should have only a single object literal argument, but contained ${
              args.length}.`);
    }

    const metaObj =
        AstObject.parse<R3PartialDeclaration, TExpression>(args[0], this.linkerEnvironment.host);
    const ngImport = metaObj.getNode('ngImport');
    const emitScope = this.getEmitScope(ngImport, declarationScope);

    const minVersion = metaObj.getString('minVersion');
    const version = metaObj.getString('version');
    const linker = this.linkerSelector.getLinker(declarationFn, minVersion, version);
    const definition = linker.linkPartialDeclaration(emitScope.constantPool, metaObj);

    return emitScope.translateDefinition(definition);
  }

  /**
   * Return all the shared constant statements and their associated constant scope references, so
   * that they can be inserted into the source code.
   */
  getConstantStatements(): {constantScope: TConstantScope, statements: TStatement[]}[] {
    const results: {constantScope: TConstantScope, statements: TStatement[]}[] = [];
    for (const [constantScope, emitScope] of this.emitScopes.entries()) {
      const statements = emitScope.getConstantStatements();
      results.push({constantScope, statements});
    }
    return results;
  }

  private getEmitScope(
      ngImport: TExpression, declarationScope: DeclarationScope<TConstantScope, TExpression>):
      EmitScope<TStatement, TExpression> {
    const constantScope = declarationScope.getConstantScopeRef(ngImport);
    if (constantScope === null) {
      // There is no constant scope so we will emit extra statements into the definition IIFE.
      return new IifeEmitScope(
          ngImport, this.linkerEnvironment.translator, this.linkerEnvironment.factory);
    }

    if (!this.emitScopes.has(constantScope)) {
      this.emitScopes.set(
          constantScope, new EmitScope(ngImport, this.linkerEnvironment.translator));
    }
    return this.emitScopes.get(constantScope)!;
  }
}


text:
import json = require('jsonstream');

var read: NodeJS.ReadableStream;
var write: NodeJS.WritableStream;

read = read.pipe(json.parse('*'));
read = read.pipe(json.parse(['foo/*', 'bar/*']));

read = json.stringify();
read = json.stringify(false);
read = json.stringify('{', ',', '}');

read = json.stringifyObject();
read = json.stringifyObject('{', ',', '}');


text:
/* $NetBSD: extern.h,v 1.9 2010/06/10 06:17:21 dholland Exp $ */

/*
 * Copyright (c) 1994 Christopher G. Demetriou
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *          This product includes software developed for the
 *          NetBSD Project.  See http://www.NetBSD.org/ for
 *          information about NetBSD.
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
 */

#include <sys/types.h>
#include <sys/param.h>
#include <db.h>

/* structures */

struct cmdinfo {
	char		ci_comm[MAXCOMLEN+2];	/* command name (+ '*') */
	uid_t		ci_uid;			/* user id */
	u_quad_t	ci_calls;		/* number of calls */
	u_quad_t	ci_etime;		/* elapsed time */
	u_quad_t	ci_utime;		/* user time */
	u_quad_t	ci_stime;		/* system time */
	u_quad_t	ci_mem;			/* memory use */
	u_quad_t	ci_io;			/* number of disk i/o ops */
	u_int32_t	ci_flags;		/* flags; see below */
};
#define	CI_UNPRINTABLE	0x0001			/* unprintable chars in name */

struct userinfo {
	uid_t		ui_uid;			/* user id; for consistency */
	u_quad_t	ui_calls;		/* number of invocations */
	u_quad_t	ui_utime;		/* user time */
	u_quad_t	ui_stime;		/* system time */
	u_quad_t	ui_mem;			/* memory use */
	u_quad_t	ui_io;			/* number of disk i/o ops */
};

/* typedefs */

typedef	int (*cmpf_t)(const DBT *, const DBT *);

/* external functions in sa.c */
const char *fmt(const DBT *);

/* external functions in pdb.c */
int	pacct_init(void);
void	pacct_destroy(void);
int	pacct_add(const struct cmdinfo *);
int	pacct_update(void);
void	pacct_print(void);

/* external functions in usrdb.c */
int	usracct_init(void);
void	usracct_destroy(void);
int	usracct_add(const struct cmdinfo *);
int	usracct_update(void);
void	usracct_print(void);

/* variables */

extern int	aflag, bflag, cflag, dflag, Dflag, fflag, iflag, jflag, kflag;
extern int	Kflag, lflag, mflag, qflag, rflag, sflag, tflag, uflag, vflag;
extern int	cutoff;
extern cmpf_t	sa_cmp;

/* some #defines to help with db's stupidity */

#define	DB_CLOSE(db) \
	((*(db)->close)(db))
#define	DB_GET(db, key, data, flags) \
	((*(db)->get)((db), (key), (data), (flags)))
#define	DB_PUT(db, key, data, flags) \
	((*(db)->put)((db), (key), (data), (flags)))
#define	DB_SYNC(db, flags) \
	((*(db)->sync)((db), (flags)))
#define	DB_SEQ(db, key, data, flags) \
	((*(db)->seq)((db), (key), (data), (flags)))


text:
package com.roncoo.pay.account.dao;

import com.roncoo.pay.account.entity.RpSettDailyCollect;
import com.roncoo.pay.common.core.dao.BaseDao;

/**
 * 每日待结算汇总dao
 * 龙果学院:www.roncoo.com
 * @author:zenghao
 */
public interface RpSettDailyCollectDao  extends BaseDao<RpSettDailyCollect> {
}


text:
require('../proposals/efficient-64-bit-arithmetic');
require('../proposals/function-is-callable-is-constructor');
require('../proposals/function-un-this');
require('../proposals/string-at');
require('../proposals/url');
// TODO: Obsolete versions, remove from `core-js@4`:
require('../proposals/array-filtering');
var parent = require('./1');

module.exports = parent;


text:
package com.sun.corba.se.spi.orb ;

import java.util.List ;
import java.util.LinkedList ;
import java.util.Map ;
import java.util.HashMap ;
import java.util.Iterator ;
import java.util.Properties ;

import com.sun.corba.se.impl.orb.ParserAction ;
import com.sun.corba.se.impl.orb.ParserActionFactory ;

public class PropertyParser {
    private List actions ;

    public PropertyParser( )
    {
        actions = new LinkedList() ;
    }

    public PropertyParser add( String propName,
        Operation action, String fieldName )
    {
        actions.add( ParserActionFactory.makeNormalAction( propName,
            action, fieldName ) ) ;
        return this ;
    }

    public PropertyParser addPrefix( String propName,
        Operation action, String fieldName, Class componentType )
    {
        actions.add( ParserActionFactory.makePrefixAction( propName,
            action, fieldName, componentType ) ) ;
        return this ;
    }

    /** Return a map from field name to value.
    */
    public Map parse( Properties props )
    {
        Map map = new HashMap() ;
        Iterator iter = actions.iterator() ;
        while (iter.hasNext()) {
            ParserAction act = (ParserAction)(iter.next()) ;

            Object result = act.apply( props ) ;

            // A null result means that the property was not set for
            // this action, so do not override the default value in this case.
            if (result != null)
                map.put( act.getFieldName(), result ) ;
        }

        return map ;
    }

    public Iterator iterator()
    {
        return actions.iterator() ;
    }
}


text:
fcmla
=====

MLA document class for LaTeX. It's still in it's early stages. However, it is usable. Look at the example.tex file to see how it's used.


text:
.. _zend.validator.messages:

Validation Messages
===================

Each validator which is based on ``Zend\Validator\ValidatorInterface`` provides one or multiple messages in the
case of a failed validation. You can use this information to set your own messages, or to translate existing
messages which a validator could return to something different.

These validation messages are constants which can be found at top of each validator class. Let's look into
``Zend\Validator\GreaterThan`` for an descriptive example:

.. code-block:: php
   :linenos:

   protected $messageTemplates = array(
       self::NOT_GREATER => "'%value%' is not greater than '%min%'",
   );

As you can see the constant ``self::NOT_GREATER`` refers to the failure and is used as key, and the message itself
is used as value of the message array.

You can retrieve all message templates from a validator by using the ``getMessageTemplates()`` method. It returns
you the above array which contains all messages a validator could return in the case of a failed validation.

.. code-block:: php
   :linenos:

   $validator = new Zend\Validator\GreaterThan();
   $messages  = $validator->getMessageTemplates();

Using the ``setMessage()`` method you can set another message to be returned in case of the specified failure.

.. code-block:: php
   :linenos:

   $validator = new Zend\Validator\GreaterThan();
   $validator->setMessage(
       'Please enter a lower value',
       Zend\Validator\GreaterThan::NOT_GREATER
   );

The second parameter defines the failure which will be overridden. When you omit this parameter, then the given
message will be set for all possible failures of this validator.

.. _zend.validator.messages.pretranslated:

Using pre-translated validation messages
----------------------------------------

Zend Framework is shipped with more than 45 different validators with more than 200 failure messages. It can be a
tedious task to translate all of these messages. But for your convenience Zend Framework comes with already
pre-translated validation messages. You can find them within the path ``/resources/languages`` in your Zend
Framework installation.

.. note::

   **Used path**

   The resource files are outside of the library path because all of your translations should also be outside of
   this path.

So to translate all validation messages to German for example, all you have to do is to attach a translator to
``Zend\Validator\AbstractValidator`` using these resource files.

.. code-block:: php
   :linenos:

   $translator = new Zend\Mvc\I18n\Translator();
   $translator->addTranslationFile(
       'phpArray',
       'resources/languages/en/Zend_Validate.php', //or Zend_Captcha
       'default',
       'en_US'
   );
   Zend\Validator\AbstractValidator::setDefaultTranslator($translator);

.. note::

   **Supported languages**

   The amount of supported languages may not be complete. New languages will be
   added with each release. Additionally feel free to use the existing resource files to make your own
   translations.

   You could also use these resource files to rewrite existing translations. So you are not in need to create these
   files manually yourself.

.. _zend.validator.messages.limitation:

Limit the size of a validation message
--------------------------------------

Sometimes it is necessary to limit the maximum size a validation message can have. For example when your view
allows a maximum size of 100 chars to be rendered on one line. To simplify the usage,
``Zend\Validator\AbstractValidator`` is able to automatically limit the maximum returned size of a validation
message.

To get the actual set size use ``Zend\Validator\AbstractValidator::getMessageLength()``. If it is -1, then the
returned message will not be truncated. This is default behaviour.

To limit the returned message size use ``Zend\Validator\AbstractValidator::setMessageLength()``. Set it to any
integer size you need. When the returned message exceeds the set size, then the message will be truncated and the
string '**...**' will be added instead of the rest of the message.

.. code-block:: php
   :linenos:

   Zend\Validator\AbstractValidator::setMessageLength(100);

.. note::

   **Where is this parameter used?**

   The set message length is used for all validators, even for self defined ones, as long as they extend
   ``Zend\Validator\AbstractValidator``.


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

<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct template vararg</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../proto/reference.html#header.boost.proto.matches_hpp" title="Header <boost/proto/matches.hpp>">
<link rel="prev" href="convertible_to.html" title="Struct template convertible_to">
<link rel="next" href="matches.html" title="Struct template matches">

Home
Libraries
People
FAQ
More

Struct template vararg

boost::proto::vararg — For matching a Grammar to a variable number of sub-expressions.

Synopsis

// In header: <boost/proto/matches.hpp>

template<typename Grammar>
struct vararg {
};

Description

            An expression type proto::basic_expr<AT,
            proto::listN<A0,...An,U0,...Um> >
            matches a grammar proto::basic_expr<BT,
            proto::listM<B0,...Bn,proto::vararg<V> > >
            if BT is proto::_
            or AT, and if
            Ax matches
            Bx
            for each x in [0,n]
            and if Ux matches
            V for each x in [0,m].

For example:

// Match any function call expression, regardless
// of the number of function arguments:
struct Function :
  proto::function< proto::vararg<proto::_> >
{};

            When used as a transform, proto::vararg<G>
            applies G's transform.

Copyright © 2008 Eric Niebler

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
require 'spec'
PRJ_DIR = File.join(File.dirname(__FILE__),"..")


text:
extractImgsFromVideo()
{
#Calculate the approximate number of frames from the video given the fps
expected_frame_count=`echo "scale=0; ( $video_duration_in_secs * $fps ) + 5"|bc`

#Determine the frameCountFormat
inFrameCountFormat="3"
if [ $expected_frame_count -gt 1000 ]; then
inFrameCountFormat="4"
fi
if [ $expected_frame_count -gt 10000 ]; then
inFrameCountFormat="5"
fi
if [ $expected_frame_count -gt 100000 ]; then
inFrameCountFormat="6"
fi

case "$inFrameCountFormat" in
3)
`ffmpeg -i $media_path -s $video_extract_img_size -r ${fps} -f image2 $INPUT_FRAMES/${video_extract_img_prefix}-%03d.${video_extract_img_format}`
;;
4)
`ffmpeg -i $media_path -s $video_extract_img_size -r ${fps} -f image2 $INPUT_FRAMES/${video_extract_img_prefix}-%04d.${video_extract_img_format}`
;;
5)
`ffmpeg -i $media_path -s $video_extract_img_size -r ${fps} -f image2 $INPUT_FRAMES/${video_extract_img_prefix}-%05d.${video_extract_img_format}`
;;
6)
`ffmpeg -i $media_path -s $video_extract_img_size -r ${fps} -f image2 $INPUT_FRAMES/${video_extract_img_prefix}-%06d.${video_extract_img_format}`
;;
esac

}

getVideoDuration()
{

if [ ! -f "$1" ] ; then
	 echo "0"
fi

duration_hhmmss=`ffmpeg -i $1 2>&1 | grep Duration | awk -F',' '{ print $1 }' | awk '{print $2 }' | awk -F'.' '{print $1}' `

duration_hh=`echo $duration_hhmmss | awk -F':' '{ print $1 }'`
duration_mm=`echo $duration_hhmmss | awk -F':' '{ print $2 }'`
duration_ss=`echo $duration_hhmmss | awk -F':' '{ print $3 }'`

duration_in_secs=`echo "( $duration_hh * 3600 ) + ( $duration_mm * 60 ) + $duration_ss"|bc`

echo $duration_in_secs

}

copyFilesToDirectory()
{

toDir="$1"
shift
for file in $@
do

cp $file $toDir

done

}

moveFilesToDirectory()
{

toDir="$1"
shift
for file in $@
do

mv $file $toDir

done

}

getImageHeight()
{
img_size=`getImageSize $1`
img_ht=`echo $img_size | awk -F'x' '{ print $2 }'`
echo $img_ht
}

getImageWidth()
{
img_size=`getImageSize $1`
img_wd=`echo $img_size | awk -F'x' '{ print $1 }'`
echo $img_wd
}

getImageSize()
{
if [ -f $1 ]; then
echo `identify -verbose $1 | grep Geometry | awk -F':' '{ print $2 }' | awk -F '+' '{ print $1 }'`
else
echo "0x0"
fi
}

#--------------------------------------------------------------------------------------------------#
# So this method will do the following
# A - Determine the length of the video being created using the number of frames and fps
# B - From the input music file, create a music file with the length of the video (trim or append)
# C - Return the path of the file to the caller methods
#-------------------------------------------------------------------------------------------------#

mixMusic()
{

if [ ! -f ${audio_filename} ]; then
echo "Important Message: The audio file [${audio_filename}] does not exist. Fix the property file and try again!"
forcequit
fi

#Calculating the final video duration
finalFrameCount=`ls $VIDEODIR/${video_extract_img_prefix}* | wc -l | awk '{print $1}'`
finalVidDuration=`echo "scale=0; ( $finalFrameCount / $fps ) + 5"|bc`
audioFileDuration=`getVideoDuration ${audio_filename}`

if [ "$finalVidDuration" -le "$audioFileDuration" ]; then
audiofilename=`basename ${audio_filename}`
`cp ${audio_filename} $VIDEODIR/$audiofilename`

cutoff=$(( $audio_fade_trim * 2 ))
if [ $finalVidDuration -gt $cutoff ]; then
cutoff=$finalVidDuration
fi

`sox $VIDEODIR/$audiofilename $VIDEODIR/szaudio_${audiofilename} fade $audio_fade_trim $cutoff $audio_fade_trim`
else
audioFileCount=`echo "scale=0; ( $finalVidDuration / $audioFileDuration ) + 0.5"|bc`
`cp ${audio_filename} $VIDEODIR/$audiofilename`

new_audio_trim_length=$(( $audio_fade_trim / 2 ))
if [ $new_audio_trim_length -le 0 ]; then
new_audio_trim_length=1
fi

sox $VIDEODIR/$audiofilename $VIDEODIR/szaudio_${audiofilename} fade $new_audio_trim_length $audioFileDuration $new_audio_trim_length
f=1
cp $VIDEODIR/szaudio_${audiofilename} $VIDEODIR/szaudio_tmp_${audiofilename}
while [ $f -lt $audioFileCount ]
do
sox $VIDEODIR/szaudio_tmp_${audiofilename} $VIDEODIR/szaudio_${audiofilename} $VIDEODIR/szaudio_tmp_${audiofilename}  splice
done

rm $VIDEODIR/szaudio_${audiofilename}
mv $VIDEODIR/szaudio_tmp_${audiofilename} $VIDEODIR/szaudio_${audiofilename}

sox $VIDEODIR/szaudio_${audiofilename} $VIDEODIR/szaudio_tmp_${audiofilename} fade $audio_fade_trim $finalVidDuration $audio_fade_trim

rm $VIDEODIR/szaudio_${audiofilename}
mv $VIDEODIR/szaudio_tmp_${audiofilename} $VIDEODIR/szaudio_${audiofilename}

fi

rm $VIDEODIR/$audiofilename

echo $VIDEODIR/szaudio_${audiofilename}
#ffmpeg -i $VIDEODIR/szaudio_${audiofilename} -i $VIDEODIR/${outputfilename} $VIDEODIR/tmp_${outputfilename}
#mv $VIDEODIR/tmp_${outputfilename} $VIDEODIR/${outputfilename}

}


text:
/* eslint-disable strict */
// (Node 4 compat)

'use strict'

const http = require('http')
const SseChannel = require('sse-channel')

module.exports = (onRequest, cb) => {
  const server = http.createServer((request, response) => {
    let channel
    if (
      request.url.indexOf('/v1/data/listen/') === 0 ||
      request.url.indexOf('/listen/beerns?query=') === 0
    ) {
      channel = new SseChannel({jsonEncode: true})
      channel.addClient(request, response)
    }

    onRequest({request, channel, response})
  })

  server.listen(0, '127.0.0.1', err => {
    cb(err, err ? null : server)
  })
}


text:
package lb.library;

import android.text.TextUtils;
import android.widget.Filter;
import android.widget.Filterable;

import java.util.ArrayList;

/**
 * This gives the ability of searching in a pinnedHead list view
 */
public abstract class SearchablePinnedHeaderListViewAdapter<T> extends IndexedPinnedHeaderListViewAdapter implements
		Filterable {
	private ArrayList<T> mFilterListCopy;
	private final Filter mFilter;

	public SearchablePinnedHeaderListViewAdapter() {
		mFilter = new Filter() {
			CharSequence lastConstraint = null;

			@Override
			protected FilterResults performFiltering(final CharSequence constraint) {
				if (constraint == null || constraint.length() == 0)
					return null;
				final ArrayList<T> newFilterArray = new ArrayList<T>();
				final FilterResults results = new FilterResults();
				for (final T item : getOriginalList())
					if (doFilter(item, constraint))
						newFilterArray.add(item);
				results.values = newFilterArray;
				results.count = newFilterArray.size();
				return results;
			}

			@SuppressWarnings("unchecked")
			@Override
			protected void publishResults(final CharSequence constraint, final FilterResults results) {
				mFilterListCopy = results == null ? null : (ArrayList<T>) results.values;
				final boolean needRefresh = !TextUtils.equals(constraint,lastConstraint);
				lastConstraint = constraint == null ? null : constraint;
				if (needRefresh)
					notifyDataSetChanged();
			}
		};
	}

	@Override
	public Filter getFilter() {
		return mFilter;
	}

	/** returns true iff the item can "pass" the filtering process and should be shown */
	public abstract boolean doFilter(T item, CharSequence constraint);

	public abstract ArrayList<T> getOriginalList();

	@Override
	public T getItem(final int position) {
		if (position < 0)
			return null;
		final ArrayList<T> listCopy = getFilterListCopy();
		if (listCopy != null) {
			if (position < listCopy.size())
				return listCopy.get(position);
			else
				return null;
		} else {
			final ArrayList<T> originalList = getOriginalList();
			if (position < originalList.size())
				return originalList.get(position);
			else
				return null;
		}
	}

	@Override
	public int getCount() {
		final ArrayList<T> listCopy = getFilterListCopy();
		if (listCopy != null)
			return listCopy.size();
		else
			return getOriginalList().size();
	}

	private ArrayList<T> getFilterListCopy() {
		return mFilterListCopy;
	}

}


text:
@interface RamblerInitialAssemblyCollector (Activate)

+ (id)rds_activateAssemblyWithClass:(Class)assemblyClass;

@end


text:
package com.tom_roush.pdfbox.rendering;

import android.graphics.Path;
import android.util.Log;

import java.io.IOException;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

import com.tom_roush.pdfbox.pdmodel.font.PDSimpleFont;

/**
 * Glyph to Path conversion for Type 1 PFB and CFF, and TrueType fonts with a 'post' table.
 */
final class Type1Glyph2D implements Glyph2D
{
    private final Map<Integer, Path> cache = new HashMap<Integer, Path>();
    private final PDSimpleFont font;

    /**
     * Constructor.
     *
     * @param font PDF Type1 font.
     */
    Type1Glyph2D(PDSimpleFont font)
    {
        this.font = font;
    }

    @Override
    public Path getPathForCharacterCode(int code)
    {
        // cache
        Path path = cache.get(code);
        if (path == null)
        {
            // fetch
            try
            {
                String name = font.getEncoding().getName(code);
                if (!font.hasGlyph(name))
                {
                    Log.w("PdfBox-Android", "No glyph for code " + code + " (" + name + ") in font " + font.getName());
                    if (code == 10 && font.isStandard14())
                    {
                        // PDFBOX-4001 return empty path for line feed on std14
                        path = new Path();
                        cache.put(code, path);
                        return path;
                    }

                    // try unicode name
                    String unicodes = font.getGlyphList().toUnicode(name);
                    if (unicodes != null && unicodes.length() == 1)
                    {
                        String uniName = getUniNameOfCodePoint(unicodes.codePointAt(0));
                        if (font.hasGlyph(uniName))
                        {
                            name = uniName;
                        }
                    }
                }

                // todo: can this happen? should it be encapsulated?
                path = font.getPath(name);
                if (path == null)
                {
                    path = font.getPath(".notdef");
                }

//                cache.put(code, path); TODO: PdfBox-Android
                return path;
            }
            catch (IOException e)
            {
                // todo: escalate this error?
                Log.e("PdfBox-Android", "Glyph rendering failed", e);
                path = new Path();
            }
        }
        return path;
    }

    @Override
    public void dispose()
    {
        cache.clear();
    }

    // copied from UniUtil
    private static String getUniNameOfCodePoint(int codePoint)
    {
        String hex = Integer.toString(codePoint, 16).toUpperCase(Locale.US);
        switch (hex.length())
        {
            case 1:
                return "uni000" + hex;
            case 2:
                return "uni00" + hex;
            case 3:
                return "uni0" + hex;
            default:
                return "uni" + hex;
        }
    }
}


text:
namespace Stripe.Client.Sdk.Models
{
    public class AdditionalOwner
    {
        public Address Address { get; set; }

        public BirthDay Dob { get; set; }

        public string FirstName { get; set; }

        public string LastName { get; set; }

        public LegalEntityVerification Verification { get; set; }
    }
}