text:
package org.fao.fenix.commons.process.dto;

import org.fao.fenix.commons.msd.dto.full.DSDAggregationRule;

import java.util.LinkedHashMap;
import java.util.LinkedHashSet;

public class AggregationFilter {
    private LinkedHashSet<String> key;
    private LinkedHashMap<String,DSDAggregationRule> rules;

    public LinkedHashSet<String> getKey() {
        return key;
    }

    public void setKey(LinkedHashSet<String> key) {
        this.key = key;
    }

    public LinkedHashMap<String, DSDAggregationRule> getRules() {
        return rules;
    }

    public void setRules(LinkedHashMap<String, DSDAggregationRule> rules) {
        this.rules = rules;
    }
}


text: A simple Java decompiler GUI made using JavaFX and Fernflower.

redpajama_set_name: RedPajamaGithub


text:
package es.uv.etse.bdweb.hotel.init;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

public class InitBD {

	static String nameFileJSON = "datebase/initBD.json";

	public static void main(String[] args) throws SQLException  {

		String JDBCQuery = "";
		ArrayList<String> listaFilas;

		ConnectionBD conn = new ConnectionBD();
		conn.connect();

		listaFilas = new ArrayList<String>(Arrays.asList("tip_hab_tipo", "tip_hab_precio"));
		JDBCQuery = fromJsonToJDBCQuery("tipos_habitaciones", listaFilas);
		System.out.println("Tabla \"tipos_habitaciones\"");
		conn.insertToBD(JDBCQuery.toString());
		listaFilas.clear();

		/*
		 * Insert Tabla "habitaciones"
		 */
		listaFilas = new ArrayList<String>(Arrays.asList("hab_numero", "hab_ocupada", "tipos_habitaciones_tip_hab_id"));
		JDBCQuery = fromJsonToJDBCQuery("habitaciones", listaFilas);
		System.out.println("Tabla \"habitaciones\"");
		conn.insertToBD(JDBCQuery.toString());
		listaFilas.clear();

		/*
		 * Insert Tabla "promociones"
		 */
		listaFilas = new ArrayList<String>(Arrays.asList("prom_fecha_inicio", "prom_fecha_final", "prom_descripcion",
				"prom_precio", "tipos_habitaciones_tip_hab_id"));
		JDBCQuery = fromJsonToJDBCQuery("promociones", listaFilas);
		System.out.println("Tabla \"promociones\"");
		conn.insertToBD(JDBCQuery.toString());
		listaFilas.clear();

		/*
		 * Insert Tabla "clientes"
		 */
		listaFilas = new ArrayList<String>(Arrays.asList("cli_id", "cli_nombre", "cli_apellidos", "cli_password",
				"cli_direccion", "cli_dni", "cli_email", "cli_numero_movil", "cli_numero_tarjeta"));
		JDBCQuery = fromJsonToJDBCQuery("clientes", listaFilas);
		System.out.println("Tabla \"clientes\"");
		conn.insertToBD(JDBCQuery.toString());
		listaFilas.clear();

		/*
		 * Insert Tabla "clientes_habituales"
		 */
		listaFilas = new ArrayList<String>(Arrays.asList("cli_id", "cli_newsletter", "cli_descuento"));
		JDBCQuery = fromJsonToJDBCQuery("clientes_habituales", listaFilas);
		System.out.println("Tabla \"clientes_habituales\"");
		conn.insertToBD(JDBCQuery.toString());
		listaFilas.clear();

		/*
		 * Insert Tabla "reservas"
		 */
		listaFilas = new ArrayList<String>(Arrays.asList("res_fecha_inicio", "res_fecha_final", "res_estado",
				"res_importe", "res_cobrada", "habitaciones_hab_id", "clientes_cli_id", "promociones_prom_id"));
		JDBCQuery = fromJsonToJDBCQuery("reservas", listaFilas);
		System.out.println("Tabla \"reservas\"");
		conn.insertToBD(JDBCQuery.toString());
		listaFilas.clear();

		/*
		 * Insert Tabla "recepcionistas"
		 */
		listaFilas = new ArrayList<String>(Arrays.asList("recep_id", "recep_nombre", "recep_apellidos",
				"recep_password", "recep_email"));
		JDBCQuery = fromJsonToJDBCQuery("recepcionistas", listaFilas);
		System.out.println("Tabla \"recepcionistas\"");
		conn.insertToBD(JDBCQuery.toString());
		listaFilas.clear();

		conn.connectClose();
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	public static String fromJsonToJDBCQuery(String nombreTabla, ArrayList<String> nombresFilasArray) {
		String JDBCQuery = "";
		JSONParser parser = new JSONParser();

		try {

			Object obj = parser.parse(new FileReader(nameFileJSON));
			JSONObject jsonObject = (JSONObject) obj;
			JSONArray jsonArray = (JSONArray) jsonObject.get(nombreTabla);

			StringBuilder sbNombresFilas = new StringBuilder();
			for (String s : nombresFilasArray) {
				sbNombresFilas.append(s);
				sbNombresFilas.append(",");
			}
			sbNombresFilas.delete(sbNombresFilas.length() - 1, sbNombresFilas.length());

			StringBuilder sbQuery = new StringBuilder(
					"INSERT INTO " + nombreTabla + " (" + sbNombresFilas.toString() + ") VALUES ");
			ArrayList<HashMap<String, String>> lista = new ArrayList<>();

			Iterator<List> iterator = jsonArray.iterator();
			while (iterator.hasNext()) {
				lista.add((HashMap<String, String>) iterator.next());
			}

			for (HashMap<String, String> mapa : lista) {
				sbQuery.append("(");
				for (String s : nombresFilasArray) {
					if (mapa.get(s) != null)
						sbQuery.append("'" + mapa.get(s) + "',");
					else
						sbQuery.append("NULL,");
				}
				sbQuery.delete(sbQuery.length() - 1, sbQuery.length());
				sbQuery.append("),");
			}
			sbQuery.delete(sbQuery.length() - 1, sbQuery.length());
			sbQuery.append(";");
			JDBCQuery = sbQuery.toString();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return JDBCQuery;
	}
}


text:
package helloworld.behavioral.visitor;

/**
 * @author yihua.huang@dianping.com
 */
public class HelloWorldCharacterElement implements HelloWorldElement{

    private char ch;

    public HelloWorldCharacterElement(char ch) {
        this.ch = ch;
    }

    public char getCh() {
        return ch;
    }

    @Override
    public void accept(HelloWorldVisitor visitor) {
        visitor.visit(this);
    }
}


text:
import { readFileSync } from 'fs';
import { resolve } from 'path';
import wait from '../output/wait';
import Client from '../client';
import { Cert } from '../../types';

export default async function createCertFromFile(
  client: Client,
  keyPath: string,
  certPath: string,
  caPath: string
) {
  const cancelWait = wait('Adding your custom certificate');

  try {
    const cert = readFileSync(resolve(certPath), 'utf8');
    const key = readFileSync(resolve(keyPath), 'utf8');
    const ca = readFileSync(resolve(caPath), 'utf8');

    const certificate = await client.fetch<Cert>('/v3/now/certs', {
      method: 'PUT',
      body: {
        ca,
        cert,
        key,
      },
    });
    return certificate;
  } catch (error) {
    if (error.code === 'ENOENT') {
      return new Error(`The specified file "${error.path}" doesn't exist.`);
    }

    if (error.status < 500) {
      return error;
    }

    throw error;
  } finally {
    cancelWait();
  }
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using FarseerPhysics.Collision;
using Duality;

namespace FarseerPhysics.Common
{
	public enum PolygonError
	{
		/// <summary>
		/// There were no errors in the polygon
		/// </summary>
		NoError,

		/// <summary>
		/// Polygon must have between 3 and Settings.MaxPolygonVertices vertices.
		/// </summary>
		InvalidAmountOfVertices,

		/// <summary>
		/// Polygon must be simple. This means no overlapping edges.
		/// </summary>
		NotSimple,

		/// <summary>
		/// Polygon must have a counter clockwise winding.
		/// </summary>
		NotCounterClockWise,

		/// <summary>
		/// The polygon is concave, it needs to be convex.
		/// </summary>
		NotConvex,

		/// <summary>
		/// Polygon area is too small.
		/// </summary>
		AreaTooSmall,

		/// <summary>
		/// The polygon has a side that is too short.
		/// </summary>
		SideTooSmall
	}

	[DebuggerDisplay("Count = {Count} Vertices = {ToString()}")]
	public class Vertices : List<Vector2>
	{
		public Vertices()
		{
		}

		public Vertices(int capacity)
		{
			this.Capacity = capacity;
		}

		public Vertices(Vector2[] vector2)
		{
			for (int i = 0; i < vector2.Length; i++)
			{
				Add(vector2[i]);
			}
		}

		public Vertices(IList<Vector2> vertices)
		{
			for (int i = 0; i < vertices.Count; i++)
			{
				Add(vertices[i]);
			}
		}

		/// <summary>
		/// Nexts the index.
		/// </summary>
		/// <param name="index">The index.</param>
		/// <returns></returns>
		public int NextIndex(int index)
		{
			if (index == this.Count - 1)
			{
				return 0;
			}
			return index + 1;
		}

		public Vector2 NextVertex(int index)
		{
			return this[NextIndex(index)];
		}

		/// <summary>
		/// Gets the previous index.
		/// </summary>
		/// <param name="index">The index.</param>
		/// <returns></returns>
		public int PreviousIndex(int index)
		{
			if (index == 0)
			{
				return this.Count - 1;
			}
			return index - 1;
		}

		public Vector2 PreviousVertex(int index)
		{
			return this[PreviousIndex(index)];
		}

		/// <summary>
		/// Gets the signed area.
		/// </summary>
		/// <returns></returns>
		public float GetSignedArea()
		{
			int i;
			float area = 0;

			for (i = 0; i < this.Count; i++)
			{
				int j = (i + 1) % this.Count;
				area += this[i].X * this[j].Y;
				area -= this[i].Y * this[j].X;
			}
			area /= 2.0f;
			return area;
		}

		/// <summary>
		/// Gets the area.
		/// </summary>
		/// <returns></returns>
		public float GetArea()
		{
			int i;
			float area = 0;

			for (i = 0; i < this.Count; i++)
			{
				int j = (i + 1) % this.Count;
				area += this[i].X * this[j].Y;
				area -= this[i].Y * this[j].X;
			}
			area /= 2.0f;
			return (area < 0 ? -area : area);
		}

		/// <summary>
		/// Gets the centroid.
		/// </summary>
		/// <returns></returns>
		public Vector2 GetCentroid()
		{
			// Same algorithm is used by Box2D

			Vector2 c = Vector2.Zero;
			float area = 0.0f;

			const float inv3 = 1.0f / 3.0f;
			Vector2 pRef = Vector2.Zero;
			for (int i = 0; i < this.Count; ++i)
			{
				// Triangle vertices.
				Vector2 p1 = pRef;
				Vector2 p2 = this[i];
				Vector2 p3 = i + 1 < this.Count ? this[i + 1] : this[0];

				Vector2 e1 = p2 - p1;
				Vector2 e2 = p3 - p1;

				float D = MathUtils.Cross(e1, e2);

				float triangleArea = 0.5f * D;
				area += triangleArea;

				// Area weighted centroid
				c += triangleArea * inv3 * (p1 + p2 + p3);
			}

			// Centroid
			c *= 1.0f / area;
			return c;
		}

		/// <summary>
		/// Gets the radius based on area.
		/// </summary>
		/// <returns></returns>
		public float GetRadius()
		{
			float area = GetSignedArea();

			double radiusSqrd = (double)area / MathHelper.Pi;
			if (radiusSqrd < 0)
			{
				radiusSqrd *= -1;
			}

			return (float)Math.Sqrt(radiusSqrd);
		}

		/// <summary>
		/// Returns an AABB for vertex.
		/// </summary>
		/// <returns></returns>
		public AABB GetCollisionBox()
		{
			AABB aabb;
			Vector2 lowerBound = new Vector2(float.MaxValue, float.MaxValue);
			Vector2 upperBound = new Vector2(float.MinValue, float.MinValue);

			for (int i = 0; i < this.Count; ++i)
			{
				if (this[i].X < lowerBound.X)
				{
					lowerBound.X = this[i].X;
				}
				if (this[i].X > upperBound.X)
				{
					upperBound.X = this[i].X;
				}

				if (this[i].Y < lowerBound.Y)
				{
					lowerBound.Y = this[i].Y;
				}
				if (this[i].Y > upperBound.Y)
				{
					upperBound.Y = this[i].Y;
				}
			}

			aabb.LowerBound = lowerBound;
			aabb.UpperBound = upperBound;

			return aabb;
		}

		public void Translate(Vector2 vector)
		{
			Translate(ref vector);
		}

		/// <summary>
		/// Translates the vertices with the specified vector.
		/// </summary>
		/// <param name="vector">The vector.</param>
		public void Translate(ref Vector2 vector)
		{
			for (int i = 0; i < this.Count; i++)
				this[i] = this[i] + vector;
		}

		/// <summary>
		/// Scales the vertices with the specified vector.
		/// </summary>
		/// <param name="value">The Value.</param>
		public void Scale(ref Vector2 value)
		{
			for (int i = 0; i < this.Count; i++)
				this[i] = this[i] * value;
		}

		/// <summary>
		/// Rotate the vertices with the defined value in radians.
		/// </summary>
		/// <param name="value">The amount to rotate by in radians.</param>
		public void Rotate(float value)
		{
			Matrix4 rotationMatrix;
			Matrix4.CreateRotationZ(value, out rotationMatrix);

			for (int i = 0; i < this.Count; i++)
				this[i] = Vector2.Transform(this[i], rotationMatrix);
		}

		/// <summary>
		/// Assuming the polygon is simple; determines whether the polygon is convex.
		/// NOTE: It will also return false if the input contains colinear edges.
		/// </summary>
		/// <returns>
		/// 	<c>true</c> if it is convex; otherwise, <c>false</c>.
		/// </returns>
		public bool IsConvex()
		{
			// Ensure the polygon is convex and the interior
			// is to the left of each edge.
			for (int i = 0; i < this.Count; ++i)
			{
				int i1 = i;
				int i2 = i + 1 < this.Count ? i + 1 : 0;
				Vector2 edge = this[i2] - this[i1];

				for (int j = 0; j < this.Count; ++j)
				{
					// Don't check vertices on the current edge.
					if (j == i1 || j == i2)
					{
						continue;
					}

					Vector2 r = this[j] - this[i1];

					float s = edge.X * r.Y - edge.Y * r.X;

					if (s <= 0.0f)
						return false;
				}
			}
			return true;
		}

		public bool IsCounterClockWise()
		{
			//We just return true for lines
			if (this.Count < 3)
				return true;

			return (GetSignedArea() > 0.0f);
		}

		/// <summary>
		/// Forces counter clock wise order.
		/// </summary>
		public void ForceCounterClockWise()
		{
			if (!IsCounterClockWise())
			{
				Reverse();
			}
		}

		/// <summary>
		/// Check for edge crossings
		/// </summary>
		/// <returns></returns>
		public bool IsSimple()
		{
			for (int i = 0; i < this.Count; ++i)
			{
				int iplus = (i + 1 > this.Count - 1) ? 0 : i + 1;
				Vector2 a1 = new Vector2(this[i].X, this[i].Y);
				Vector2 a2 = new Vector2(this[iplus].X, this[iplus].Y);
				for (int j = i + 1; j < this.Count; ++j)
				{
					int jplus = (j + 1 > this.Count - 1) ? 0 : j + 1;
					Vector2 b1 = new Vector2(this[j].X, this[j].Y);
					Vector2 b2 = new Vector2(this[jplus].X, this[jplus].Y);

					Vector2 temp;

					if (LineTools.LineIntersect2(a1, a2, b1, b2, out temp))
					{
						return false;
					}
				}
			}
			return true;
		}

		/// <summary>
		/// Checks if the polygon is valid for use in the engine.
		///
		/// Performs a full check, for simplicity, convexity,
		/// orientation, minimum angle, and volume.
		///
		/// From Eric Jordan's convex decomposition library
		/// </summary>
		/// <returns>PolygonError.NoError if there were no error.</returns>
		public PolygonError CheckPolygon()
		{
			if (this.Count < 3 || this.Count > Settings.MaxPolygonVertices)
				return PolygonError.InvalidAmountOfVertices;

			if (!IsSimple())
				return PolygonError.NotSimple;

			if (GetArea() <= Settings.Epsilon)
				return PolygonError.AreaTooSmall;

			if (!IsConvex())
				return PolygonError.NotConvex;

			//Check if the sides are of adequate length.
			for (int i = 0; i < this.Count; ++i)
			{
				int next = i + 1 < this.Count ? i + 1 : 0;
				Vector2 edge = this[next] - this[i];
				if (edge.LengthSquared <= Settings.Epsilon * Settings.Epsilon)
				{
					return PolygonError.SideTooSmall;
				}
			}

			if (!IsCounterClockWise())
				return PolygonError.NotCounterClockWise;

			return PolygonError.NoError;
		}

		// From Eric Jordan's convex decomposition library

		/// <summary>
		/// Trace the edge of a non-simple polygon and return a simple polygon.
		///
		/// Method:
		/// Start at vertex with minimum y (pick maximum x one if there are two).
		/// We aim our "lastDir" vector at (1.0, 0)
		/// We look at the two rays going off from our start vertex, and follow whichever
		/// has the smallest angle (in -Pi . Pi) wrt lastDir ("rightest" turn)
		/// Loop until we hit starting vertex:
		/// We add our current vertex to the list.
		/// We check the seg from current vertex to next vertex for intersections
		/// - if no intersections, follow to next vertex and continue
		/// - if intersections, pick one with minimum distance
		/// - if more than one, pick one with "rightest" next point (two possibilities for each)
		/// </summary>
		/// <param name="verts">The vertices.</param>
		/// <returns></returns>
		public Vertices TraceEdge(Vertices verts)
		{
			PolyNode[] nodes = new PolyNode[verts.Count * verts.Count];
			//overkill, but sufficient (order of mag. is right)
			int nNodes = 0;

			//Add base nodes (raw outline)
			for (int i = 0; i < verts.Count; ++i)
			{
				Vector2 pos = new Vector2(verts[i].X, verts[i].Y);
				nodes[i].Position = pos;
				++nNodes;
				int iplus = (i == verts.Count - 1) ? 0 : i + 1;
				int iminus = (i == 0) ? verts.Count - 1 : i - 1;
				nodes[i].AddConnection(nodes[iplus]);
				nodes[i].AddConnection(nodes[iminus]);
			}

			//Process intersection nodes - horribly inefficient
			bool dirty = true;
			int counter = 0;
			while (dirty)
			{
				dirty = false;
				for (int i = 0; i < nNodes; ++i)
				{
					for (int j = 0; j < nodes[i].NConnected; ++j)
					{
						for (int k = 0; k < nNodes; ++k)
						{
							if (k == i || nodes[k] == nodes[i].Connected[j]) continue;
							for (int l = 0; l < nodes[k].NConnected; ++l)
							{
								if (nodes[k].Connected[l] == nodes[i].Connected[j] ||
									nodes[k].Connected[l] == nodes[i]) continue;

								//Check intersection
								Vector2 intersectPt;

								bool crosses = LineTools.LineIntersect(nodes[i].Position, nodes[i].Connected[j].Position,
																	   nodes[k].Position, nodes[k].Connected[l].Position,
																	   out intersectPt);
								if (crosses)
								{
									dirty = true;
									//Destroy and re-hook connections at crossing point
									PolyNode connj = nodes[i].Connected[j];
									PolyNode connl = nodes[k].Connected[l];
									nodes[i].Connected[j].RemoveConnection(nodes[i]);
									nodes[i].RemoveConnection(connj);
									nodes[k].Connected[l].RemoveConnection(nodes[k]);
									nodes[k].RemoveConnection(connl);
									nodes[nNodes] = new PolyNode(intersectPt);
									nodes[nNodes].AddConnection(nodes[i]);
									nodes[i].AddConnection(nodes[nNodes]);
									nodes[nNodes].AddConnection(nodes[k]);
									nodes[k].AddConnection(nodes[nNodes]);
									nodes[nNodes].AddConnection(connj);
									connj.AddConnection(nodes[nNodes]);
									nodes[nNodes].AddConnection(connl);
									connl.AddConnection(nodes[nNodes]);
									++nNodes;
									goto SkipOut;
								}
							}
						}
					}
				}
				SkipOut:
				++counter;
			}

			//Collapse duplicate points
			bool foundDupe = true;
			int nActive = nNodes;
			while (foundDupe)
			{
				foundDupe = false;
				for (int i = 0; i < nNodes; ++i)
				{
					if (nodes[i].NConnected == 0) continue;
					for (int j = i + 1; j < nNodes; ++j)
					{
						if (nodes[j].NConnected == 0) continue;
						Vector2 diff = nodes[i].Position - nodes[j].Position;
						if (diff.LengthSquared <= Settings.Epsilon * Settings.Epsilon)
						{
							if (nActive <= 3)
								return new Vertices();

							//printf("Found dupe, %d left\n",nActive);
							--nActive;
							foundDupe = true;
							PolyNode inode = nodes[i];
							PolyNode jnode = nodes[j];
							//Move all of j's connections to i, and orphan j
							int njConn = jnode.NConnected;
							for (int k = 0; k < njConn; ++k)
							{
								PolyNode knode = jnode.Connected[k];
								Debug.Assert(knode != jnode);
								if (knode != inode)
								{
									inode.AddConnection(knode);
									knode.AddConnection(inode);
								}
								knode.RemoveConnection(jnode);
							}
							jnode.NConnected = 0;
						}
					}
				}
			}

			//Now walk the edge of the list

			//Find node with minimum y value (max x if equal)
			float minY = float.MaxValue;
			float maxX = -float.MaxValue;
			int minYIndex = -1;
			for (int i = 0; i < nNodes; ++i)
			{
				if (nodes[i].Position.Y < minY && nodes[i].NConnected > 1)
				{
					minY = nodes[i].Position.Y;
					minYIndex = i;
					maxX = nodes[i].Position.X;
				}
				else if (nodes[i].Position.Y == minY && nodes[i].Position.X > maxX && nodes[i].NConnected > 1)
				{
					minYIndex = i;
					maxX = nodes[i].Position.X;
				}
			}

			Vector2 origDir = new Vector2(1.0f, 0.0f);
			Vector2[] resultVecs = new Vector2[4 * nNodes];
			// nodes may be visited more than once, unfortunately - change to growable array!
			int nResultVecs = 0;
			PolyNode currentNode = nodes[minYIndex];
			PolyNode startNode = currentNode;
			Debug.Assert(currentNode.NConnected > 0);
			PolyNode nextNode = currentNode.GetRightestConnection(origDir);
			if (nextNode == null)
			{
				Vertices vertices = new Vertices(nResultVecs);

				for (int i = 0; i < nResultVecs; ++i)
				{
					vertices.Add(resultVecs[i]);
				}

				return vertices;
			}

			// Borked, clean up our mess and return
			resultVecs[0] = startNode.Position;
			++nResultVecs;
			while (nextNode != startNode)
			{
				if (nResultVecs > 4 * nNodes)
				{
					Debug.Assert(false);
				}
				resultVecs[nResultVecs++] = nextNode.Position;
				PolyNode oldNode = currentNode;
				currentNode = nextNode;
				nextNode = currentNode.GetRightestConnection(oldNode);
				if (nextNode == null)
				{
					Vertices vertices = new Vertices(nResultVecs);
					for (int i = 0; i < nResultVecs; ++i)
					{
						vertices.Add(resultVecs[i]);
					}
					return vertices;
				}
				// There was a problem, so jump out of the loop and use whatever garbage we've generated so far
			}

			return new Vertices();
		}

		private class PolyNode
		{
			private const int MaxConnected = 32;

			/*
             * Given sines and cosines, tells if A's angle is less than B's on -Pi, Pi
             * (in other words, is A "righter" than B)
             */
			public PolyNode[] Connected = new PolyNode[MaxConnected];
			public int NConnected;
			public Vector2 Position;

			public PolyNode(Vector2 pos)
			{
				this.Position = pos;
				this.NConnected = 0;
			}

			private bool IsRighter(float sinA, float cosA, float sinB, float cosB)
			{
				if (sinA < 0)
				{
					if (sinB > 0 || cosA <= cosB) return true;
					else return false;
				}
				else
				{
					if (sinB < 0 || cosA <= cosB) return false;
					else return true;
				}
			}

			public void AddConnection(PolyNode toMe)
			{
				Debug.Assert(this.NConnected < MaxConnected);

				// Ignore duplicate additions
				for (int i = 0; i < this.NConnected; ++i)
				{
					if (this.Connected[i] == toMe) return;
				}
				this.Connected[this.NConnected] = toMe;
				++this.NConnected;
			}

			public void RemoveConnection(PolyNode fromMe)
			{
				bool isFound = false;
				int foundIndex = -1;
				for (int i = 0; i < this.NConnected; ++i)
				{
					if (fromMe == this.Connected[i])
					{
						//.position == connected[i].position){
						isFound = true;
						foundIndex = i;
						break;
					}
				}
				Debug.Assert(isFound);
				--this.NConnected;
				for (int i = foundIndex; i < this.NConnected; ++i)
				{
					this.Connected[i] = this.Connected[i + 1];
				}
			}

			public PolyNode GetRightestConnection(PolyNode incoming)
			{
				if (this.NConnected == 0) Debug.Assert(false); // This means the connection graph is inconsistent
				if (this.NConnected == 1)
				{
					//b2Assert(false);
					// Because of the possibility of collapsing nearby points,
					// we may end up with "spider legs" dangling off of a region.
					// The correct behavior here is to turn around.
					return incoming;
				}
				Vector2 inDir = this.Position - incoming.Position;

				float inLength = inDir.Length;
				inDir.Normalize();

				Debug.Assert(inLength > Settings.Epsilon);

				PolyNode result = null;
				for (int i = 0; i < this.NConnected; ++i)
				{
					if (this.Connected[i] == incoming) continue;
					Vector2 testDir = this.Connected[i].Position - this.Position;
					float testLengthSqr = testDir.LengthSquared;
					testDir.Normalize();
					Debug.Assert(testLengthSqr >= Settings.Epsilon * Settings.Epsilon);
					float myCos = Vector2.Dot(inDir, testDir);
					float mySin = MathUtils.Cross(inDir, testDir);
					if (result != null)
					{
						Vector2 resultDir = result.Position - this.Position;
						resultDir.Normalize();
						float resCos = Vector2.Dot(inDir, resultDir);
						float resSin = MathUtils.Cross(inDir, resultDir);
						if (IsRighter(mySin, myCos, resSin, resCos))
						{
							result = this.Connected[i];
						}
					}
					else
					{
						result = this.Connected[i];
					}
				}

				Debug.Assert(result != null);

				return result;
			}

			public PolyNode GetRightestConnection(Vector2 incomingDir)
			{
				Vector2 diff = this.Position - incomingDir;
				PolyNode temp = new PolyNode(diff);
				PolyNode res = GetRightestConnection(temp);
				Debug.Assert(res != null);
				return res;
			}
		}

		public override string ToString()
		{
			StringBuilder builder = new StringBuilder();
			for (int i = 0; i < this.Count; i++)
			{
				builder.Append(this[i].ToString());
				if (i < this.Count - 1)
				{
					builder.Append(" ");
				}
			}
			return builder.ToString();
		}

		/// <summary>
		/// Projects to axis.
		/// </summary>
		/// <param name="axis">The axis.</param>
		/// <param name="min">The min.</param>
		/// <param name="max">The max.</param>
		public void ProjectToAxis(ref Vector2 axis, out float min, out float max)
		{
			// To project a point on an axis use the dot product
			float dotProduct = Vector2.Dot(axis, this[0]);
			min = dotProduct;
			max = dotProduct;

			for (int i = 0; i < this.Count; i++)
			{
				dotProduct = Vector2.Dot(this[i], axis);
				if (dotProduct < min)
				{
					min = dotProduct;
				}
				else
				{
					if (dotProduct > max)
					{
						max = dotProduct;
					}
				}
			}
		}

		/// <summary>
		/// Winding number test for a point in a polygon.
		/// </summary>
		/// See more info about the algorithm here: http://softsurfer.com/Archive/algorithm_0103/algorithm_0103.htm
		/// <param name="point">The point to be tested.</param>
		/// <returns>-1 if the winding number is zero and the point is outside
		/// the polygon, 1 if the point is inside the polygon, and 0 if the point
		/// is on the polygons edge.</returns>
		public int PointInPolygon(ref Vector2 point)
		{
			// Winding number
			int wn = 0;

			// Iterate through polygon's edges
			for (int i = 0; i < this.Count; i++)
			{
				// Get points
				Vector2 p1 = this[i];
				Vector2 p2 = this[NextIndex(i)];

				// Test if a point is directly on the edge
				Vector2 edge = p2 - p1;
				float area = MathUtils.Area(ref p1, ref p2, ref point);
				if (area == 0f && Vector2.Dot(point - p1, edge) >= 0f && Vector2.Dot(point - p2, edge) <= 0f)
				{
					return 0;
				}
				// Test edge for intersection with ray from point
				if (p1.Y <= point.Y)
				{
					if (p2.Y > point.Y && area > 0f)
					{
						++wn;
					}
				}
				else
				{
					if (p2.Y <= point.Y && area < 0f)
					{
						--wn;
					}
				}
			}
			return (wn == 0 ? -1 : 1);
		}

		/// <summary>
		/// Compute the sum of the angles made between the test point and each pair of points making up the polygon.
		/// If this sum is 2pi then the point is an interior point, if 0 then the point is an exterior point.
		/// ref: http://ozviz.wasp.uwa.edu.au/~pbourke/geometry/insidepoly/  - Solution 2
		/// </summary>
		public bool PointInPolygonAngle(ref Vector2 point)
		{
			double angle = 0;

			// Iterate through polygon's edges
			for (int i = 0; i < this.Count; i++)
			{
				// Get points
				Vector2 p1 = this[i] - point;
				Vector2 p2 = this[NextIndex(i)] - point;

				angle += MathUtils.VectorAngle(ref p1, ref p2);
			}

			if (Math.Abs(angle) < Math.PI)
			{
				return false;
			}

			return true;
		}
	}
}


text:
- Built using [Crossbuilder](https://github.com/zalmoxisus/crossbuilder) boilerplate.
- Includes [Dan Abramov](https://github.com/gaearon)'s [redux-devtools](https://github.com/gaearon/redux-devtools) and the following monitors:
  - [Log Monitor](https://github.com/gaearon/redux-devtools-log-monitor)
  - [Inspector](https://github.com/alexkuz/redux-devtools-inspector)
  - [Dispatch](https://github.com/YoruNoHikage/redux-devtools-dispatch)
  - [Slider](https://github.com/calesce/redux-slider-monitor)
  - [Chart](https://github.com/romseguy/redux-devtools-chart-monitor)
- [The logo icon](https://github.com/reactjs/redux/issues/151) made by [Keith Yong](https://github.com/keithyong) .
- Examples from [Redux](https://github.com/rackt/redux/tree/master/examples).


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginBottom="5dp"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:background="@drawable/border_gray"
        android:orientation="vertical"
        android:padding="4dp">

        <TextView
            android:id="@+id/dataTextView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="0dp"
            android:layout_marginTop="0dp" />

        <Button
            android:id="@+id/rawDataButton"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="@string/scan_device_viewadvraw"
            />

    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1sp"
        android:layout_marginTop="4dp"
        android:background="#dddddd" />

</LinearLayout>


text:
package charts

import (
	"errors"
	"flag"
	"fmt"
	"log"
	"net/http"
	"net/http/httptest"
	"os"
	"testing"

	"github.com/arschles/assert"
	"github.com/go-openapi/runtime"
	"github.com/kubernetes-helm/monocular/src/api/config"
	"github.com/kubernetes-helm/monocular/src/api/data/helpers"
	"github.com/kubernetes-helm/monocular/src/api/data/pointerto"
	"github.com/kubernetes-helm/monocular/src/api/handlers"
	"github.com/kubernetes-helm/monocular/src/api/mocks"
	"github.com/kubernetes-helm/monocular/src/api/storage"
	"github.com/kubernetes-helm/monocular/src/api/swagger/models"
	chartsapi "github.com/kubernetes-helm/monocular/src/api/swagger/restapi/operations/charts"
	"github.com/kubernetes-helm/monocular/src/api/testutil"
)

func TestMain(m *testing.M) {
	flag.Parse()
	storageDrivers := []string{"redis", "mysql"}
	for _, storageDriver := range storageDrivers {
		err := storage.Init(config.StorageConfig{storageDriver, ""})
		if err != nil {
			fmt.Printf("Failed to initialize storage driver: %v\n", err)
			os.Exit(1)
		}
		returnCode := m.Run()
		if returnCode != 0 {
			os.Exit(returnCode)
		}
	}
	os.Exit(0)
}

var chartsImplementation = mocks.NewMockCharts(mocks.MockedMethods{})

func TestGetChart200(t *testing.T) {
	chart, err := chartsImplementation.ChartFromRepo(testutil.RepoName, testutil.ChartName)
	assert.NoErr(t, err)
	w := httptest.NewRecorder()
	params := chartsapi.GetChartParams{
		Repo:      testutil.RepoName,
		ChartName: testutil.ChartName,
	}
	resp := GetChart(params, chartsImplementation)
	assert.NotNil(t, resp, "GetChart response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusOK, "expect a 200 response code")
	httpBody := new(models.ResourceData)
	assert.NoErr(t, testutil.ResourceDataFromJSON(w.Body, httpBody))
	chartResource := helpers.MakeChartResource(chart)
	testutil.AssertChartResourceBodyData(t, chartResource, httpBody)
}

func TestGetChart404(t *testing.T) {
	w := httptest.NewRecorder()
	bogonParams := chartsapi.GetChartParams{
		Repo:      testutil.BogusRepo,
		ChartName: testutil.ChartName,
	}
	errResp := GetChart(bogonParams, chartsImplementation)
	errResp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusNotFound, "expect a 404 response code")
	var httpBody models.Error
	assert.NoErr(t, testutil.ErrorModelFromJSON(w.Body, &httpBody))
	testutil.AssertErrBodyData(t, http.StatusNotFound, ChartResourceName, httpBody)
}

func TestGetChartVersion200(t *testing.T) {
	chart, err := chartsImplementation.ChartVersionFromRepo(testutil.RepoName, testutil.ChartName, testutil.ChartVersionString)
	assert.NoErr(t, err)
	w := httptest.NewRecorder()
	params := chartsapi.GetChartVersionParams{
		Repo:      testutil.RepoName,
		ChartName: testutil.ChartName,
		Version:   testutil.ChartVersionString,
	}
	resp := GetChartVersion(params, chartsImplementation)
	assert.NotNil(t, resp, "GetChartVersion response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusOK, "expect a 200 response code")
	httpBody := new(models.ResourceData)
	assert.NoErr(t, testutil.ResourceDataFromJSON(w.Body, httpBody))
	chartResource := helpers.MakeChartVersionResource(chart)
	testutil.AssertChartVersionResourceBodyData(t, chartResource, httpBody)
}

func TestGetChartVersion404(t *testing.T) {
	w := httptest.NewRecorder()
	bogonParams := chartsapi.GetChartVersionParams{
		Repo:      testutil.RepoName,
		ChartName: testutil.ChartName,
		Version:   "99.99.99",
	}
	errResp := GetChartVersion(bogonParams, chartsImplementation)
	errResp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusNotFound, "expect a 404 response code")
	var httpBody models.Error
	assert.NoErr(t, testutil.ErrorModelFromJSON(w.Body, &httpBody))
	testutil.AssertErrBodyData(t, http.StatusNotFound, ChartVersionResourceName, httpBody)
}

func TestGetChartVersions200(t *testing.T) {
	charts, err := chartsImplementation.ChartVersionsFromRepo(testutil.RepoName, testutil.ChartName)
	assert.NoErr(t, err)
	w := httptest.NewRecorder()
	params := chartsapi.GetChartVersionsParams{
		Repo:      testutil.RepoName,
		ChartName: testutil.ChartName,
	}
	resp := GetChartVersions(params, chartsImplementation)
	assert.NotNil(t, resp, "GetChartVersions response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusOK, "expect a 200 response code")
	var httpBody models.ResourceArrayData
	assert.NoErr(t, testutil.ResourceArrayDataFromJSON(w.Body, &httpBody))
	assert.Equal(t, len(charts), len(httpBody.Data), "number of charts returned")
}

func TestGetChartVersions404(t *testing.T) {
	w := httptest.NewRecorder()
	params := chartsapi.GetChartVersionsParams{
		Repo:      testutil.BogusRepo,
		ChartName: testutil.ChartName,
	}
	resp := GetChartVersions(params, chartsImplementation)
	assert.NotNil(t, resp, "GetChartVersions response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusNotFound, "expect a 404 response code")
	var httpBody models.Error
	assert.NoErr(t, testutil.ErrorModelFromJSON(w.Body, &httpBody))
	testutil.AssertErrBodyData(t, http.StatusNotFound, ChartVersionResourceName, httpBody)
}

func TestGetAllCharts200(t *testing.T) {
	setupTestRepoCache()
	defer teardownTestRepoCache()
	w := httptest.NewRecorder()
	params := chartsapi.GetAllChartsParams{}
	resp := GetAllCharts(params, chartsImplementation)
	assert.NotNil(t, resp, "GetAllCharts response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusOK, "expect a 200 response code")
	var httpBody models.ResourceArrayData
	assert.NoErr(t, testutil.ResourceArrayDataFromJSON(w.Body, &httpBody))
	charts, err := chartsImplementation.All()
	assert.NoErr(t, err)
	assert.Equal(t, len(helpers.MakeChartResources(charts)), len(httpBody.Data), "number of charts returned")
}

func TestGetAllCharts404(t *testing.T) {
	w := httptest.NewRecorder()
	chImplementation := mocks.NewMockCharts(mocks.MockedMethods{
		All: func() ([]*models.ChartPackage, error) {
			var ret []*models.ChartPackage
			return ret, errors.New("error getting all charts")
		},
	})
	params := chartsapi.GetAllChartsParams{}
	resp := GetAllCharts(params, chImplementation)
	assert.NotNil(t, resp, "GetAllCharts response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusNotFound, "expect a 404 response code")
	var httpBody models.Error
	assert.NoErr(t, testutil.ErrorModelFromJSON(w.Body, &httpBody))
	testutil.AssertErrBodyData(t, http.StatusNotFound, ChartResourceName+"s", httpBody)
}

func TestSearchCharts200(t *testing.T) {
	setupTestRepoCache()
	defer teardownTestRepoCache()
	w := httptest.NewRecorder()
	params := chartsapi.SearchChartsParams{
		Name: "drupal",
	}
	resp := SearchCharts(params, chartsImplementation)
	assert.NotNil(t, resp, "SearchCharts response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusOK, "expect a 200 response code")
	var httpBody models.ResourceArrayData
	assert.NoErr(t, testutil.ResourceArrayDataFromJSON(w.Body, &httpBody))
	charts, err := chartsImplementation.Search(params)
	assert.NoErr(t, err)
	assert.Equal(t, len(helpers.MakeChartResources(charts)), len(httpBody.Data), "number of charts returned")
}

func TestSearchCharts404(t *testing.T) {
	w := httptest.NewRecorder()
	params := chartsapi.SearchChartsParams{
		Name: "drupal",
	}
	chImplementation := mocks.NewMockCharts(mocks.MockedMethods{
		Search: func(params chartsapi.SearchChartsParams) ([]*models.ChartPackage, error) {
			var ret []*models.ChartPackage
			return ret, errors.New("error searching charts")
		},
	})
	resp := SearchCharts(params, chImplementation)
	assert.NotNil(t, resp, "SearchCharts response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusBadRequest, "expect a 400 response code")
	var httpBody models.Error
	assert.NoErr(t, testutil.ErrorModelFromJSON(w.Body, &httpBody))
	assert.Equal(t, *httpBody.Code, int64(400), "response code in HTTP body data")
	assert.Equal(t, *httpBody.Message, "data.Charts Search() error (error searching charts)", "error message in HTTP body data")
}

func TestGetChartsInRepo200(t *testing.T) {
	setupTestRepoCache()
	defer teardownTestRepoCache()
	charts, err := chartsImplementation.AllFromRepo(testutil.RepoName)
	numCharts := len(helpers.MakeChartResources(charts))
	assert.NoErr(t, err)
	w := httptest.NewRecorder()
	params := chartsapi.GetChartsInRepoParams{
		Repo: testutil.RepoName,
	}
	resp := GetChartsInRepo(params, chartsImplementation)
	assert.NotNil(t, resp, "GetChartsInRepo response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusOK, "expect a 200 response code")
	var httpBody models.ResourceArrayData
	assert.NoErr(t, testutil.ResourceArrayDataFromJSON(w.Body, &httpBody))
	assert.Equal(t, numCharts, len(httpBody.Data), "number of charts returned")
}

func TestGetChartsInRepo404(t *testing.T) {
	w := httptest.NewRecorder()
	params := chartsapi.GetChartsInRepoParams{
		Repo: testutil.BogusRepo,
	}
	resp := GetChartsInRepo(params, chartsImplementation)
	assert.NotNil(t, resp, "GetChartsInRepo response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusNotFound, "expect a 404 response code")
	var httpBody models.Error
	assert.NoErr(t, testutil.ErrorModelFromJSON(w.Body, &httpBody))
	testutil.AssertErrBodyData(t, http.StatusNotFound, ChartResourceName+"s", httpBody)
}

func TestChartHTTPBody(t *testing.T) {
	w := httptest.NewRecorder()
	chart, err := chartsImplementation.ChartFromRepo(testutil.RepoName, testutil.ChartName)
	assert.NoErr(t, err)
	chartResource := helpers.MakeChartResource(chart)

	payload := handlers.DataResourceBody(chartResource)
	resp := chartsapi.NewGetChartOK().WithPayload(payload)
	assert.NotNil(t, resp, "chartHTTPBody response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusOK, "expect a 200 response code")
	httpBody := new(models.ResourceData)
	assert.NoErr(t, testutil.ResourceDataFromJSON(w.Body, httpBody))
	testutil.AssertChartResourceBodyData(t, chartResource, httpBody)
}

func TestChartsHTTPBody(t *testing.T) {
	setupTestRepoCache()
	defer teardownTestRepoCache()
	w := httptest.NewRecorder()
	charts, err := chartsImplementation.All()
	assert.NoErr(t, err)
	resources := helpers.MakeChartResources(charts)
	payload := handlers.DataResourcesBody(resources)
	resp := chartsapi.NewGetAllChartsOK().WithPayload(payload)
	assert.NotNil(t, resp, "chartHTTPBody response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusOK, "expect a 200 response code")
	var httpBody models.ResourceArrayData
	assert.NoErr(t, testutil.ResourceArrayDataFromJSON(w.Body, &httpBody))
	assert.Equal(t, len(resources), len(httpBody.Data), "number of charts returned")
}

func TestNotFound(t *testing.T) {
	const resource1 = "chart"
	const resource2 = "repo"
	w := httptest.NewRecorder()
	resp := notFound(resource1)
	assert.NotNil(t, resp, "notFound response")
	resp.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusNotFound, "expect a 404 response code")
	var httpBody1 models.Error
	assert.NoErr(t, testutil.ErrorModelFromJSON(w.Body, &httpBody1))
	testutil.AssertErrBodyData(t, http.StatusNotFound, resource1, httpBody1)
	w = httptest.NewRecorder()
	var httpBody2 models.Error
	resp2 := notFound(resource2)
	assert.NotNil(t, resp2, "notFound response")
	resp2.WriteResponse(w, runtime.JSONProducer())
	assert.Equal(t, w.Code, http.StatusNotFound, "expect a 404 response code")
	assert.NoErr(t, testutil.ErrorModelFromJSON(w.Body, &httpBody2))
	testutil.AssertErrBodyData(t, http.StatusNotFound, resource2, httpBody2)
}

func setupTestRepoCache() {
	repos := []models.Repo{
		{
			Name: pointerto.String("stable"),
			URL:  pointerto.String("http://storage.googleapis.com/kubernetes-charts"),
		},
		{
			Name: pointerto.String("incubator"),
			URL:  pointerto.String("http://storage.googleapis.com/kubernetes-charts-incubator"),
		},
	}
	storage.Driver.MergeRepos(repos)
}

func teardownTestRepoCache() {
	if _, err := storage.Driver.DeleteRepos(); err != nil {
		log.Fatal("Could not clear cache ", err)
	}
}


text:
Imports Kitware.VTK
Public Class Form1
    ' <summary>
    ' Application to load and display a volume
    ' </summary>

    Dim MouseDown1 As Boolean
    Dim Interactor As vtkRenderWindowInteractor
    Dim RenderWindow As vtkRenderWindow
    Dim Renderer As vtkRenderer
    Dim ImageActor As vtkImageActor
    Dim Clip As vtkImageClip
    Dim fileName As String

    ' <summary>
    ' Tell the application when the mouse is being dragged
    ' </summary>
    ' <param name="sender"></param>
    ' <param name="e"></param>
    Private Sub iren_LeftButtonReleaseEvt(ByVal sender As vtkObject, ByVal e As vtkObjectEventArgs)
        Me.MouseDown1 = False
    End Sub

    ' <summary>
    ' Tell the application when the mouse is being dragged
    ' </summary>
    ' <param name="sender"></param>
    ' <param name="e"></param>
    Private Sub iren_LeftButtonPressEvt(ByVal sender As vtkObject, ByVal e As vtkObjectEventArgs)
        Me.MouseDown1 = True
    End Sub

    ' <summary>
    ' Display the render window with the 3D Volume in it
    ' </summary>
    ' <param name="sender"></param>
    ' <param name="e"></param>
    Private Sub RenderWindowControl2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RenderWindowControl2.Load
        'Create all the objects for the pipeline
        Dim spwf As vtkPiecewiseFunction
        Dim gpwf As vtkPiecewiseFunction
        Dim ctf As vtkColorTransferFunction
        Dim vol As vtkVolume
        Dim texMapper As vtkFixedPointVolumeRayCastMapper
        Dim reader As vtkXMLReader
        Dim renderer As vtkRenderer

        renderer = RenderWindowControl2.RenderWindow.GetRenderers().GetFirstRenderer()
        reader = vtkXMLImageDataReader.[New]
        texMapper = vtkFixedPointVolumeRayCastMapper.[New]
        vol = vtkVolume.[New]
        ctf = vtkColorTransferFunction.[New]
        spwf = vtkPiecewiseFunction.[New]
        gpwf = vtkPiecewiseFunction.[New]

        'Read in the file
        reader.SetFileName(fileName)
        reader.Update()

        'Go through the visulizatin pipeline
        texMapper.SetInputConnection(reader.GetOutputPort())

        'Set the color curve for the volume
        ctf.AddHSVPoint(0, 0.67, 0.07, 1)
        ctf.AddHSVPoint(94, 0.67, 0.07, 1)
        ctf.AddHSVPoint(139, 0, 0, 0)
        ctf.AddHSVPoint(160, 0.28, 0.047, 1)
        ctf.AddHSVPoint(254, 0.38, 0.013, 1)

        'Set the opacity curve for the volume
        spwf.AddPoint(84, 0)
        spwf.AddPoint(151, 0.1)
        spwf.AddPoint(255, 1)

        'Set the gradient curve for the volume
        gpwf.AddPoint(0, 0.2)
        gpwf.AddPoint(10, 0.2)
        gpwf.AddPoint(25, 1)

        vol.GetProperty().SetColor(ctf)
        vol.GetProperty().SetScalarOpacity(spwf)
        vol.GetProperty().SetGradientOpacity(gpwf)

        vol.SetMapper(texMapper)

        'Go through the Graphics Pipeline
        renderer.AddVolume(vol)
    End Sub

    ' <summary>
    ' Display the render window with the slice in it
    ' </summary>
    ' <param name="sender"></param>
    ' <param name="e"></param>
    Private Sub RenderWindowControl1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RenderWindowControl1.Load
        'Get the name of the Unsigned Char volume that you want to load
        fileName = "../../../head.vti"

        'Create all the objects for the pipeline
        Dim reader As vtkXMLImageDataReader
        Dim iactor As vtkImageActor
        Dim contour As vtkContourFilter
        Dim mapper As vtkPolyDataMapper
        Dim actor As vtkActor
        Dim style As vtkInteractorStyle
        Dim clip As vtkImageClip
        Dim renderer As vtkRenderer
        Dim iren As vtkRenderWindowInteractor

        reader = vtkXMLImageDataReader.[New]
        iactor = vtkImageActor.[New]
        clip = vtkImageClip.[New]
        contour = vtkContourFilter.[New]
        mapper = vtkPolyDataMapper.[New]
        actor = vtkActor.[New]
        style = vtkInteractorStyleImage.[New]

        renderer = RenderWindowControl1.RenderWindow.GetRenderers().GetFirstRenderer()

        'Read the Image
        reader.SetFileName(fileName)

        'Go through the visulization pipeline
        iactor.SetInput(reader.GetOutput())
        renderer.AddActor(iactor)
        reader.Update()
        Dim extent(6) As Integer
        extent = reader.GetOutput().GetWholeExtent()
        iactor.SetDisplayExtent(extent(0), extent(1), extent(2), extent(3), (extent(4) + extent(5)) / 2, (extent(4) + extent(5)) / 2)

        clip.SetInputConnection(reader.GetOutputPort())
        clip.SetOutputWholeExtent(extent(0), extent(1), extent(2), extent(3), (extent(4) + extent(5)) / 2, (extent(4) + extent(5)) / 2)

        contour.SetInputConnection(Clip.GetOutputPort())
        contour.SetValue(0, 100)

        mapper.SetInputConnection(contour.GetOutputPort())
        mapper.SetScalarVisibility(1)

        'Go through the graphics pipeline
        actor.SetMapper(mapper)
        actor.GetProperty().SetColor(0, 1, 0)

        renderer.AddActor(actor)

        'Give a new style to the interactor
        iren = RenderWindowControl1.RenderWindow.GetInteractor()
        iren.SetInteractorStyle(style)

        'Add new events to the interactor style

        AddHandler style.LeftButtonPressEvt, New vtkObject.vtkObjectEventHandler(AddressOf iren_LeftButtonPressEvt)
        AddHandler style.LeftButtonReleaseEvt, New vtkObject.vtkObjectEventHandler(AddressOf iren_LeftButtonReleaseEvt)
        AddHandler style.MouseMoveEvt, New vtkObject.vtkObjectEventHandler(AddressOf iren_MouseMoveEvt)

        'Update global variables
        Me.TrackBar1.Maximum = extent(5)
        Me.TrackBar1.Minimum = extent(4)
        Me.Interactor = iren
        Me.RenderWindow = RenderWindowControl1.RenderWindow
        Me.Renderer = renderer
        Me.Clip = clip
        Me.ImageActor = iactor
    End Sub

    ' <summary>
    ' Move the slice when the trackbar is moved
    ' </summary>
    ' <param name="sender"></param>
    ' <param name="e"></param>
    Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
        If (ImageActor IsNot Nothing) Then

            Dim dim1(3) As Integer
            Dim lastPos(2) As Integer
            Dim size(2) As Integer

            lastPos = Me.Interactor.GetLastEventPosition()
            Size = Me.RenderWindow.GetSize()
            dim1 = Me.ImageActor.GetInput().GetDimensions()

            Dim newSlice As Integer
            newSlice = TrackBar1.Value

            If newSlice >= 0 And newSlice < dim1(2) Then
                Me.Clip.SetOutputWholeExtent(0, dim1(0) - 1, 0, dim1(1) - 1, newSlice, newSlice)
                Me.ImageActor.SetDisplayExtent(0, dim1(0) - 1, 0, dim1(1) - 1, newSlice, newSlice)
                Me.Renderer.ResetCameraClippingRange()
                Me.RenderWindow.Render()
            End If
        End If
    End Sub

    ' <summary>
    ' Move the slice and the trackbar when the mouse is dragged on the render window
    ' </summary>
    ' <param name="sender"></param>
    ' <param name="e"></param>
    Private Sub iren_MouseMoveEvt(ByVal sender As vtkObject, ByVal e As vtkObjectEventArgs)
        If Me.MouseDown1 And Me.ImageActor IsNot Nothing Then
            Dim dim1(3) As Integer
            Dim lastPos(2) As Integer
            Dim size(2) As Integer

            lastPos = Me.Interactor.GetLastEventPosition()
            size = Me.RenderWindow.GetSize()
            dim1 = Me.ImageActor.GetInput().GetDimensions()

            Dim newSlice As Integer
            newSlice = CType((CType(dim1(2) - 1.0, Double) * CType(lastPos(1), Double) / CType(size(1), Double)), Integer)
            If newSlice >= 0 And newSlice < dim1(2) Then
                Me.TrackBar1.Value = newSlice
                Me.Clip.SetOutputWholeExtent(0, dim1(0) - 1, 0, dim1(1) - 1, newSlice, newSlice)
                Me.ImageActor.SetDisplayExtent(0, dim1(0) - 1, 0, dim1(1) - 1, newSlice, newSlice)
                Me.Renderer.ResetCameraClippingRange()
                Me.RenderWindow.Render()
            End If
        End If
    End Sub
    ' <summary>
    ' Clean Up any global variables that might still be around
    ' </summary>
    ' <param name="sender"></param>
    ' <param name="e"></param>
    Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        If (Me.Interactor IsNot Nothing) Then
            Me.Interactor.Dispose()
        End If
        If (Me.ImageActor IsNot Nothing) Then
            Me.ImageActor.Dispose()
        End If

        If (Me.Clip IsNot Nothing) Then
            Me.Clip.Dispose()
        End If
    End Sub
End Class


text:
(function(exports){

/***

For now, simple Scene JSON input

*/
var Playtime = {

	initialize: function(){

		Screenplay.initialize({
			easel: {
				canvas: document.getElementById("canvas"),
				width:800, height:450,
				fps:30
			},
			scene: {}
		});

	},

	loadProject: function(project){

		Playtime.project = project;

		document.getElementById("textio").style.display = 'none';
		document.getElementById("message").style.display = 'none';

		// GOT TO THAT SCENE
		Asset.load(Playtime.project.assets).done(function(){

			var firstSceneID = Playtime.project.scenes[0];
			var scene = Asset.resources[firstSceneID];

			exports.Global = {};
			Scene.goto(scene);

			Screenplay.paused = false;

		});

	},

	play: function(){
		Screenplay.paused = false;
	},
	stop: function(){
		Screenplay.paused = true;
		Screenplay.scene.destroy();
		Screenplay.stage.removeChild(Screenplay.scene.art);
		Screenplay.scene = null;
	},

	getTextInput: function(label){

		Screenplay.paused = true;
		Key.active = false;
		var overlay = document.getElementById("textio");
		overlay.style.display = 'block';
		document.getElementById("textio_label").innerHTML = label;

		var promise = new Promise();
		document.getElementById("textio_submit").onclick = function(){
			Screenplay.paused = false;
			Key.active = true;
			overlay.style.display = 'none';
			var text = document.getElementById("textio_text").value;
			promise.resolve(text);
		};
		return promise;

	},

	showMessage: function(label){

		Screenplay.paused = true;

		var overlay = document.getElementById("message");
		overlay.style.display = 'block';

		document.getElementById("message_label").innerHTML = label;

		window.addEventListener("keydown",function waitForEnter(event){

			if(event.keyCode!=13) return;

			Screenplay.paused = false;
			overlay.style.display = 'none';

			window.removeEventListener("keydown",waitForEnter);
			event.preventDefault();

		});

	}

};

// SINGLETON
exports.Playtime = Playtime;
Playtime.initialize();

})(window);


text:
import attempt from 'attempt-x';
import isObjectLike from 'is-object-like-x';
import hasToStringTag from 'has-to-string-tag-x';
import toStringTag from 'to-string-tag-x';
import isArrayBuffer from 'is-array-buffer-x';
import call from 'simple-call-x';
import getGetter from 'util-get-getter-x';
var hasDView = typeof DataView === 'function';
var dViewTag = '[object DataView]';

var getDataView = function getDataView(creator) {
  var res = attempt(creator);
  return res.threw === false && isObjectLike(res.value) && res.value;
};

export var legacyCheck1 = function legacyCheck1(object) {
  return toStringTag(object) === dViewTag;
};
export var legacyCheck2 = function legacyCheck2(object) {
  if (isObjectLike(object) === false) {
    return false;
  }

  var isByteLength = typeof object.byteLength === 'number';
  var isByteOffset = typeof object.byteOffset === 'number';
  var isGetFloat32 = typeof object.getFloat32 === 'function';
  var isSetFloat64 = typeof object.setFloat64 === 'function';
  return isByteLength && isByteOffset && isGetFloat32 && isSetFloat64 && isArrayBuffer(object.buffer);
};

var validator = function validator(value) {
  return typeof value === 'number';
};

var creator = function creator() {
  /* eslint-disable-next-line compat/compat */
  return new DataView(new ArrayBuffer(4));
};

var init = function init() {
  if (hasDView) {
    var dataView = getDataView(creator);

    var _byteLength = dataView && hasToStringTag ? getGetter(dataView, 'byteLength', validator) : null;

    return {
      byteLength: _byteLength,
      legacyCheck: _byteLength === null && legacyCheck1(dataView) ? legacyCheck1 : legacyCheck2
    };
  }

  return {
    byteLength: null,
    legacyCheck: null
  };
};

var _init = init(),
    byteLength = _init.byteLength,
    legacyCheck = _init.legacyCheck;
/**
 * Determine if an `object` is an `DataView`.
 *
 * @param {*} object - The object to test.
 * @returns {boolean} `true` if the `object` is a `DataView`, else `false`.
 */

var isDataView = function isDataView(object) {
  if (hasDView === false || isObjectLike(object) === false) {
    return false;
  }

  if (byteLength === null && legacyCheck) {
    return legacyCheck(object);
  }

  var result = attempt(function attemptee() {
    return call(byteLength, object);
  });
  return result.threw === false && validator(result.value);
};

export default isDataView;

//# sourceMappingURL=is-data-view-x.esm.js.map


text:
<!DOCTYPE html>

    <title>get text from html</title>
    <link type="text/css" rel="stylesheet" href="styles/js-console.css" />


text:
#pragma once

#include <QtWidgets/QAbstractItemView>

#include "qrgui/models/details/modelsImplementation/abstractView.h"

namespace qReal {
namespace models {
namespace details {

class LogicalModel;

class GraphicalModelView : public modelsImplementation::AbstractView
{
	Q_OBJECT

public:
	GraphicalModelView(LogicalModel * const model);

protected slots:
	virtual void rowsInserted(const QModelIndex &parent, int start, int end);
	virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight
			, QVector<int> const &roles = QVector<int>());
	virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);

};

}
}
}


text:
default['automagic']['db']['user'] = 'wordpress'
default['automagic']['db']['pass'] = 'unsecurepassword'
default['automagic']['db']['host'] = 'localhost'
default['automagic']['db']['name'] = 'wordpressdb'

normal['mysql']['allow_remote_root']      = true
normal['mysql']['server_root_password']   = node['automagic']['db']['pass']
normal['mysql']['server_debian_password'] = node['automagic']['db']['pass']
normal['mysql']['server_repl_password']   = node['automagic']['db']['pass']


text:
package org.opensplice.common.controller;

import org.opensplice.common.model.table.SampleInfoTableModel;

import java.awt.Component;
import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.table.TableCellRenderer;

import org.opensplice.common.util.Config;

/**
 * Renderer that is capable of rendering cells in a SampleInfoTable.
 *
 */
public class SampleInfoTableCellRenderer extends JLabel implements TableCellRenderer {
    protected static final Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
    private SampleInfoTableModel model;

    /**
     * Constructs a new SampleInfoTableCellRenderer that can be attached to a
     * JTable. This class is meant to render cells in a JTable that holds a
     * SampleInfoModel.
     *
     */
    public SampleInfoTableCellRenderer(SampleInfoTableModel model) {
        super();
        this.model = model;
        setOpaque(true);
        setBorder(noFocusBorder);
    }

    /**
     * Provides a component to display in the table according to the supplied
     * arguments. This function is called by the table when it needs to render a
     * cell.
     *
     * @param table The table in which the cell will be drawn.
     * @param value The value of the cell.
     * @param isSelected Whether or not the cell is selected.
     * @param hasFocus Whether or not the cell has the focus.
     * @param row The row of the cell in the table.
     * @param column The column of the cell in the table.
     */
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value,
            boolean isSelected, boolean hasFocus, int row, int column) {
        if(!table.isEnabled()){
            setToolTipText("Table not enabled.");
            setFont(table.getFont().deriveFont(Font.ITALIC));
            super.setForeground(java.awt.Color.LIGHT_GRAY);
            super.setBackground(table.getBackground());
        } else if (isSelected) {
            super.setForeground(table.getSelectionForeground());
            super.setBackground(table.getSelectionBackground());
        } else {
            super.setForeground(table.getForeground());
            super.setBackground(table.getBackground());
            setFont(table.getFont());
        }

        if (hasFocus) {
            setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
            if (table.isCellEditable(row, column)) {
                super.setForeground(UIManager
                        .getColor("Table.focusCellForeground"));
                super.setBackground(UIManager
                        .getColor("Table.focusCellBackground"));
            }
        } else {
            setBorder(noFocusBorder);
        }

        if (value == null) {
            setText("");
        } else {
            setText(value.toString());
        }
        return this;
    }
}


text:
package com.Easy3.dto;

import java.io.Serializable;
import java.sql.Timestamp;

@SuppressWarnings("serial")
public class EventInfoDto implements Serializable{

	public String userId;
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getEventId() {
		return eventId;
	}
	public void setEventId(String eventId) {
		this.eventId = eventId;
	}
	public String getEventName() {
		return eventName;
	}
	public void setEventName(String eventName) {
		this.eventName = eventName;
	}
	public String getEventPersonnel() {
		return eventPersonnel;
	}
	public void setEventPersonnel(String eventPersonnel) {
		this.eventPersonnel = eventPersonnel;
	}
	public String getEventDatetime() {
		return eventDatetime;
	}
	public void setEventDatetime(String eventDatetime) {
		this.eventDatetime = eventDatetime;
	}
	public String getEventPlace() {
		return eventPlace;
	}
	public void setEventPlace(String eventPlace) {
		this.eventPlace = eventPlace;
	}
	public String getEventStatus() {
		return eventStatus;
	}
	public void setEventStatus(String eventStatus) {
		this.eventStatus = eventStatus;
	}
	public String getEventSummary() {
		return eventSummary;
	}
	public void setEventSummary(String eventSummary) {
		this.eventSummary = eventSummary;
	}
	public String getDeleteFlg() {
		return deleteFlg;
	}
	public void setDeleteFlg(String deleteFlg) {
		this.deleteFlg = deleteFlg;
	}
	public String getCreateUser() {
		return createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	public Timestamp getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}
	public String getUpdateUser() {
		return updateUser;
	}
	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}
	public Timestamp getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(Timestamp updateDate) {
		this.updateDate = updateDate;
	}
	/**
	 *
	 */
	public String eventId;
	/**
	 *
	 */
	public String eventName;
	/**
	 *
	 */
	public String eventPersonnel;
	/**
	 *
	 */
	public String eventDatetime;
	/**
	 *
	 */
	public String eventPlace;
	/**
	 *
	 */
	public String eventStatus;
	/**
	 *
	 */
	public String eventSummary;
	/**
	 *
	 */
	public String deleteFlg;
	/**
	 *
	 */
	public String createUser;
	/**
	 *
	 */
	public Timestamp createDate;
	/**
	 *
	 */
	public String updateUser;
	/**
	 *
	 */
	public Timestamp updateDate;
}


text:
import unittest
from bottle import ConfigDict

class TestConfigDict(unittest.TestCase):
    def test_isadict(self):
        """ ConfigDict should behaves like a normal dict. """
        # It is a dict-subclass, so this kind of pointless, but it doen't hurt.
        d, m = dict(), ConfigDict()
        d['key'], m['key'] = 'value', 'value'
        d['k2'], m['k2'] = 'v1', 'v1'
        d['k2'], m['k2'] = 'v2', 'v2'
        self.assertEqual(d.keys(), m.keys())
        self.assertEqual(list(d.values()), list(m.values()))
        self.assertEqual(d.get('key'), m.get('key'))
        self.assertEqual(d.get('cay'), m.get('cay'))
        self.assertEqual(list(iter(d)), list(iter(m)))
        self.assertEqual([k for k in d], [k for k in m])
        self.assertEqual(len(d), len(m))
        self.assertEqual('key' in d, 'key' in m)
        self.assertEqual('cay' in d, 'cay' in m)
        self.assertRaises(KeyError, lambda: m['cay'])

if __name__ == '__main__': #pragma: no cover
    unittest.main()


text:
<?php

namespace Illuminate\Tests\Foundation;

use Mockery as m;
use PHPUnit\Framework\TestCase;
use Illuminate\Auth\AuthManager;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Foundation\Application;
use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Foundation\Testing\Concerns\InteractsWithAuthentication;

class FoundationAuthenticationTest extends TestCase
{
    use InteractsWithAuthentication;

    /**
     * @var \Mockery
     */
    protected $app;

    /**
     * @return array
     */
    protected $credentials = [
        'email' => 'someone@laravel.com',
        'password' => 'secret_password',
    ];

    /**
     * @var \Mockery
     */
    protected function mockGuard()
    {
        $guard = m::mock(Guard::class);

        $auth = m::mock(AuthManager::class);
        $auth->shouldReceive('guard')
            ->once()
            ->andReturn($guard);

        $this->app = m::mock(Application::class);
        $this->app->shouldReceive('make')
            ->once()
            ->withArgs(['auth'])
            ->andReturn($auth);

        return $guard;
    }

    protected function tearDown(): void
    {
        m::close();
    }

    public function testAssertAuthenticated()
    {
        $this->mockGuard()
            ->shouldReceive('check')
            ->once()
            ->andReturn(true);

        $this->assertAuthenticated();
    }

    public function testAssertGuest()
    {
        $this->mockGuard()
            ->shouldReceive('check')
            ->once()
            ->andReturn(false);

        $this->assertGuest();
    }

    public function testAssertAuthenticatedAs()
    {
        $expected = m::mock(Authenticatable::class);
        $expected->shouldReceive('getAuthIdentifier')
            ->andReturn('1');

        $this->mockGuard()
            ->shouldReceive('user')
            ->once()
            ->andReturn($expected);

        $user = m::mock(Authenticatable::class);
        $user->shouldReceive('getAuthIdentifier')
            ->andReturn('1');

        $this->assertAuthenticatedAs($user);
    }

    protected function setupProvider(array $credentials)
    {
        $user = m::mock(Authenticatable::class);

        $provider = m::mock(UserProvider::class);

        $provider->shouldReceive('retrieveByCredentials')
            ->with($credentials)
            ->andReturn($user);

        $provider->shouldReceive('validateCredentials')
            ->with($user, $credentials)
            ->andReturn($this->credentials === $credentials);

        $this->mockGuard()
            ->shouldReceive('getProvider')
            ->once()
            ->andReturn($provider);
    }

    public function testAssertCredentials()
    {
        $this->setupProvider($this->credentials);

        $this->assertCredentials($this->credentials);
    }

    public function testAssertCredentialsMissing()
    {
        $credentials = [
            'email' => 'invalid',
            'password' => 'credentials',
        ];

        $this->setupProvider($credentials);

        $this->assertInvalidCredentials($credentials);
    }
}


text:
package org.apache.camel.component.etcd3;

import java.time.Duration;
import java.util.HashMap;
import java.util.Map;

import io.etcd.jetcd.ByteSequence;
import io.etcd.jetcd.Client;
import io.etcd.jetcd.ClientBuilder;
import io.netty.handler.ssl.SslContext;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriParams;

import static org.apache.camel.component.etcd3.Etcd3Constants.ETCD_DEFAULT_ENDPOINTS;

@UriParams
public class Etcd3Configuration implements Cloneable {

    @UriParam(label = "common", defaultValue = "Etcd3Constants.ETCD_DEFAULT_ENDPOINTS")
    private String[] endpoints = ETCD_DEFAULT_ENDPOINTS;
    @UriParam(label = "security", secret = true)
    private String userName;
    @UriParam(label = "security", secret = true)
    private String password;
    @UriParam(label = "advanced,security")
    private SslContext sslContext;
    @UriParam(label = "common")
    private String namespace;
    @UriParam(label = "advanced")
    private String loadBalancerPolicy;
    @UriParam(label = "advanced")
    private String authority;
    @UriParam(label = "advanced")
    private Integer maxInboundMessageSize;
    @UriParam(label = "advanced", prefix = "headers.", multiValue = true)
    private Map<String, String> headers = new HashMap<>();
    @UriParam(label = "advanced", prefix = "authHeaders.", multiValue = true)
    private Map<String, String> authHeaders = new HashMap<>();
    @UriParam(label = "advanced", defaultValue = "500")
    private long retryDelay = 500L;
    @UriParam(label = "advanced", defaultValue = "2500")
    private long retryMaxDelay = 2500L;
    @UriParam(label = "advanced", defaultValue = "30 seconds")
    private Duration keepAliveTime = Duration.ofSeconds(30L);
    @UriParam(label = "advanced", defaultValue = "10 seconds")
    private Duration keepAliveTimeout = Duration.ofSeconds(10L);
    @UriParam(label = "advanced")
    private Duration retryMaxDuration;
    @UriParam(label = "advanced")
    private Duration connectionTimeout;
    @UriParam(label = "common", defaultValue = "false")
    private boolean prefix;
    @UriParam(label = "consumer,advanced", defaultValue = "0", description = "The index to watch from")
    private long fromIndex;
    @UriParam(label = "cloud", defaultValue = "/services/")
    private String servicePath = "/services/";
    @UriParam(label = "common", defaultValue = "UTF-8")
    private String keyCharset = "UTF-8";
    @UriParam(label = "producer", defaultValue = "UTF-8")
    private String valueCharset = "UTF-8";

    public String[] getEndpoints() {
        return endpoints;
    }

    /**
     * Configure etcd server endpoints using the IPNameResolver.
     */
    public void setEndpoints(String... endpoints) {
        this.endpoints = endpoints;
    }

    public String getUserName() {
        return userName;
    }

    /**
     * Configure etcd auth user.
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    /**
     * Configure etcd auth password.
     */
    public void setPassword(String password) {
        this.password = password;
    }

    public String getNamespace() {
        return namespace;
    }

    /**
     * Configure the namespace of keys used. "/" will be treated as no namespace.
     */
    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public SslContext getSslContext() {
        return sslContext;
    }

    /**
     * Configure SSL/TLS context to use instead of the system default.
     */
    public void setSslContext(SslContext sslContext) {
        this.sslContext = sslContext;
    }

    public String getLoadBalancerPolicy() {
        return loadBalancerPolicy;
    }

    /**
     * Configure etcd load balancer policy.
     */
    public void setLoadBalancerPolicy(String loadBalancerPolicy) {
        this.loadBalancerPolicy = loadBalancerPolicy;
    }

    public String getAuthority() {
        return authority;
    }

    /**
     * Configure the authority used to authenticate connections to servers.
     */
    public void setAuthority(String authority) {
        this.authority = authority;
    }

    public Integer getMaxInboundMessageSize() {
        return maxInboundMessageSize;
    }

    /**
     * Configure the maximum message size allowed for a single gRPC frame.
     */
    public void setMaxInboundMessageSize(Integer maxInboundMessageSize) {
        this.maxInboundMessageSize = maxInboundMessageSize;
    }

    public Map<String, String> getHeaders() {
        return headers;
    }

    /**
     * Configure the headers to be added to http request headers.
     */
    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    public Map<String, String> getAuthHeaders() {
        return authHeaders;
    }

    /**
     * Configure the headers to be added to auth request headers.
     */
    public void setAuthHeaders(Map<String, String> authHeaders) {
        this.authHeaders = authHeaders;
    }

    public long getRetryDelay() {
        return retryDelay;
    }

    /**
     * Configure the delay between retries in milliseconds.
     */
    public void setRetryDelay(long retryDelay) {
        this.retryDelay = retryDelay;
    }

    public long getRetryMaxDelay() {
        return retryMaxDelay;
    }

    /**
     * Configure the max backing off delay between retries in milliseconds.
     */
    public void setRetryMaxDelay(long retryMaxDelay) {
        this.retryMaxDelay = retryMaxDelay;
    }

    public Duration getKeepAliveTime() {
        return keepAliveTime;
    }

    /**
     * Configure the interval for gRPC keepalives. The current minimum allowed by gRPC is 10 seconds.
     */
    public void setKeepAliveTime(Duration keepAliveTime) {
        this.keepAliveTime = keepAliveTime;
    }

    public Duration getKeepAliveTimeout() {
        return keepAliveTimeout;
    }

    /**
     * Configure the timeout for gRPC keepalives.
     */
    public void setKeepAliveTimeout(Duration keepAliveTimeout) {
        this.keepAliveTimeout = keepAliveTimeout;
    }

    public Duration getRetryMaxDuration() {
        return retryMaxDuration;
    }

    /**
     * Configure the retries max duration.
     */
    public void setRetryMaxDuration(Duration retryMaxDuration) {
        this.retryMaxDuration = retryMaxDuration;
    }

    public Duration getConnectionTimeout() {
        return connectionTimeout;
    }

    /**
     * Configure the connection timeout.
     */
    public void setConnectionTimeout(Duration connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public boolean isPrefix() {
        return prefix;
    }

    /**
     * To apply an action on all the key-value pairs whose key that starts with the target path.
     */
    public void setPrefix(boolean prefix) {
        this.prefix = prefix;
    }

    public long getFromIndex() {
        return fromIndex;
    }

    /**
     * The index to watch from.
     */
    public void setFromIndex(long fromIndex) {
        this.fromIndex = fromIndex;
    }

    public String getServicePath() {
        return servicePath;
    }

    /**
     * The path to look for service discovery.
     */
    public void setServicePath(String servicePath) {
        this.servicePath = servicePath;
    }

    public String getKeyCharset() {
        return keyCharset;
    }

    /**
     * Configure the charset to use for the keys.
     */
    public void setKeyCharset(String keyCharset) {
        this.keyCharset = keyCharset;
    }

    public String getValueCharset() {
        return valueCharset;
    }

    /**
     * Configure the charset to use for the values.
     */
    public void setValueCharset(String valueCharset) {
        this.valueCharset = valueCharset;
    }

    /**
     * @return a {@link Client} instance configured with all parameters set.
     */
    public Client createClient() {
        final ClientBuilder builder = Client.builder()
                .endpoints(endpoints)
                .sslContext(sslContext)
                .authority(authority)
                .maxInboundMessageSize(maxInboundMessageSize)
                .retryDelay(retryDelay)
                .retryMaxDelay(retryMaxDelay)
                .retryMaxDuration(retryMaxDuration)
                .keepaliveTime(keepAliveTime)
                .keepaliveTimeout(keepAliveTimeout)
                .connectTimeout(connectionTimeout);
        if (loadBalancerPolicy != null) {
            builder.loadBalancerPolicy(loadBalancerPolicy);
        }
        if (userName != null) {
            builder.user(ByteSequence.from(userName.getBytes()));
        }
        if (password != null) {
            builder.password(ByteSequence.from(password.getBytes()));
        }
        if (namespace != null) {
            builder.namespace(ByteSequence.from(namespace.getBytes()));
        }
        if (headers != null && !headers.isEmpty()) {
            for (Map.Entry<String, String> entry : headers.entrySet()) {
                builder.header(entry.getKey(), entry.getKey());
            }
        }
        if (authHeaders != null && !authHeaders.isEmpty()) {
            for (Map.Entry<String, String> entry : authHeaders.entrySet()) {
                builder.authHeader(entry.getKey(), entry.getKey());
            }
        }
        return builder.build();
    }

    Etcd3Configuration copy() {
        try {
            Etcd3Configuration configuration = (Etcd3Configuration) super.clone();
            configuration.setHeaders(new HashMap<>(headers));
            configuration.setAuthHeaders(new HashMap<>(authHeaders));
            return configuration;
        } catch (CloneNotSupportedException e) {
            throw new RuntimeCamelException(e);
        }
    }
}


text:
namespace {

// TODO(mcchou): Move these constants to dbus/service_constants.h.
// Bluetooth Media Endpoint service identifier.
const char kBluetoothMediaEndpointInterface[] = "org.bluez.MediaEndpoint1";

// Bluetooth Media Endpoint methods.
const char kSetConfiguration[] = "SetConfiguration";
const char kSelectConfiguration[] = "SelectConfiguration";
const char kClearConfiguration[] = "ClearConfiguration";
const char kRelease[] = "Release";

}  // namespace

namespace chromeos {

// The BluetoothMediaEndopintServiceProvider implementation used in production.
class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl
    : public BluetoothMediaEndpointServiceProvider {
 public:
  BluetoothMediaEndpointServiceProviderImpl(dbus::Bus* bus,
                                            const dbus::ObjectPath& object_path,
                                            Delegate* delegate)
      : origin_thread_id_(base::PlatformThread::CurrentId()),
        bus_(bus),
        delegate_(delegate),
        object_path_(object_path),
        weak_ptr_factory_(this) {
    VLOG(1) << "Creating Bluetooth Media Endpoint: " << object_path_.value();
    DCHECK(bus_);
    DCHECK(delegate_);
    DCHECK(object_path_.IsValid());

    exported_object_ = bus_->GetExportedObject(object_path_);

    exported_object_->ExportMethod(
        kBluetoothMediaEndpointInterface,
        kSetConfiguration,
        base::Bind(
            &BluetoothMediaEndpointServiceProviderImpl::SetConfiguration,
            weak_ptr_factory_.GetWeakPtr()),
        base::Bind(&BluetoothMediaEndpointServiceProviderImpl::OnExported,
                   weak_ptr_factory_.GetWeakPtr()));

    exported_object_->ExportMethod(
        kBluetoothMediaEndpointInterface,
        kSelectConfiguration,
        base::Bind(
            &BluetoothMediaEndpointServiceProviderImpl::SelectConfiguration,
            weak_ptr_factory_.GetWeakPtr()),
        base::Bind(&BluetoothMediaEndpointServiceProviderImpl::OnExported,
                   weak_ptr_factory_.GetWeakPtr()));

    exported_object_->ExportMethod(
        kBluetoothMediaEndpointInterface,
        kClearConfiguration,
        base::Bind(
            &BluetoothMediaEndpointServiceProviderImpl::ClearConfiguration,
            weak_ptr_factory_.GetWeakPtr()),
        base::Bind(&BluetoothMediaEndpointServiceProviderImpl::OnExported,
                   weak_ptr_factory_.GetWeakPtr()));

    exported_object_->ExportMethod(
        kBluetoothMediaEndpointInterface,
        kRelease,
        base::Bind(&BluetoothMediaEndpointServiceProviderImpl::Release,
                   weak_ptr_factory_.GetWeakPtr()),
        base::Bind(&BluetoothMediaEndpointServiceProviderImpl::OnExported,
                   weak_ptr_factory_.GetWeakPtr()));
  }

  ~BluetoothMediaEndpointServiceProviderImpl() override {
    VLOG(1) << "Cleaning up Bluetooth Media Endpoint: "
            << object_path_.value();

    bus_->UnregisterExportedObject(object_path_);
  }

 private:
  // Returns true if the current thread is on the origin thread, false
  // otherwise.
  bool OnOriginThread() const {
    return base::PlatformThread::CurrentId() == origin_thread_id_;
  }

  // Called by dbus:: when a method is exported.
  void OnExported(const std::string& interface_name,
                  const std::string& method_name,
                  bool success) {
    LOG_IF(WARNING, !success) << "Failed to export "
                              << interface_name << "." << method_name;
  }

  // Called by dbus:: when the remote device connects to the Media Endpoint.
  void SetConfiguration(dbus::MethodCall* method_call,
                        dbus::ExportedObject::ResponseSender response_sender) {
    DCHECK(OnOriginThread());
    DCHECK(delegate_);

    dbus::MessageReader reader(method_call);
    dbus::ObjectPath transport_path;
    dbus::MessageReader properties(method_call);
    if (!reader.PopObjectPath(&transport_path) ||
        !reader.PopArray(&properties)) {
      LOG(WARNING) << "SetConfiguration called with incorrect parameters: "
                   << method_call->ToString();
      return;
    }

    delegate_->SetConfiguration(transport_path, properties);

    response_sender.Run(dbus::Response::FromMethodCall(method_call));
  }

  // Called by dbus:: when the remote device receives the configuration for
  // media transport.
  void SelectConfiguration(
      dbus::MethodCall* method_call,
      dbus::ExportedObject::ResponseSender response_sender) {
    DCHECK(OnOriginThread());
    DCHECK(delegate_);

    dbus::MessageReader reader(method_call);
    const uint8_t* capabilities = nullptr;
    size_t length = 0;
    if (!reader.PopArrayOfBytes(&capabilities, &length)) {
      LOG(WARNING) << "SelectConfiguration called with incorrect parameters: "
                   << method_call->ToString();
      return;
    }

    std::vector<uint8_t> configuration(capabilities, capabilities + length);

    // |delegate_| generates the response to |SelectConfiguration| and sends it
    // back via |callback|.
    Delegate::SelectConfigurationCallback callback = base::Bind(
        &BluetoothMediaEndpointServiceProviderImpl::OnConfiguration,
        weak_ptr_factory_.GetWeakPtr(),
        method_call,
        response_sender);

    delegate_->SelectConfiguration(configuration, callback);
  }

  // Called by dbus:: when the remote device is about to close the connection.
  void ClearConfiguration(
      dbus::MethodCall* method_call,
      dbus::ExportedObject::ResponseSender response_sender) {
    DCHECK(OnOriginThread());
    DCHECK(delegate_);

    dbus::MessageReader reader(method_call);
    dbus::ObjectPath transport_path;
    if (!reader.PopObjectPath(&transport_path)) {
      LOG(WARNING) << "ClearConfiguration called with incorrect parameters: "
                   << method_call->ToString();
      return;
    }

    delegate_->ClearConfiguration(transport_path);

    response_sender.Run(dbus::Response::FromMethodCall(method_call));
  }

  // Called by Bluetooth daemon to do the clean up after unregistering the Media
  // Endpoint.
  void Release(dbus::MethodCall* method_call,
               dbus::ExportedObject::ResponseSender response_sender) {
    DCHECK(OnOriginThread());
    DCHECK(delegate_);

    delegate_->Release();

    response_sender.Run(dbus::Response::FromMethodCall(method_call));
  }

  // Called by Delegate to response to a method requiring transport
  // configuration.
  void OnConfiguration(dbus::MethodCall* method_call,
                       dbus::ExportedObject::ResponseSender response_sender,
                       const std::vector<uint8_t>& configuration) {
    DCHECK(OnOriginThread());

    // Generates the response to the method call.
    scoped_ptr<dbus::Response> response(
        dbus::Response::FromMethodCall(method_call));
    dbus::MessageWriter writer(response.get());
    if (configuration.empty()) {
      LOG(WARNING) << "OnConfiguration called with empty configuration.";
      writer.AppendArrayOfBytes(nullptr, 0);
    } else {
      writer.AppendArrayOfBytes(&configuration[0], configuration.size());
    }
    response_sender.Run(response.Pass());
  }

  // Origin thread (i.e. the UI thread in production).
  base::PlatformThreadId origin_thread_id_;

  // D-Bus Bus object is exported on.
  dbus::Bus* bus_;

  // All incoming method calls are passed on to |delegate_|. |callback| passed
  // to |delegate+| will generate the response for those methods whose returns
  // are non-void.
  Delegate* delegate_;

  // D-Bus object path of the object we are exporting, kept so we can unregister
  // again in you destructor.
  dbus::ObjectPath object_path_;

  // D-Bus object we are exporting, owned by this object.
  scoped_refptr<dbus::ExportedObject> exported_object_;

  // Weak pointer factory for generating 'this' printers that might live longer
  // than we do.
  // Note This should remain the last member so it'll be destroyed and
  // invalidate it's weak pointers before any other members are destroyed.
  base::WeakPtrFactory<BluetoothMediaEndpointServiceProviderImpl>
      weak_ptr_factory_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothMediaEndpointServiceProviderImpl);
};

BluetoothMediaEndpointServiceProvider::BluetoothMediaEndpointServiceProvider() {
}

BluetoothMediaEndpointServiceProvider::~BluetoothMediaEndpointServiceProvider()
{}

BluetoothMediaEndpointServiceProvider*
    BluetoothMediaEndpointServiceProvider::Create(
    dbus::Bus* bus,
    const dbus::ObjectPath& object_path,
    Delegate* delegate) {
  // Returns a real implementation.
  if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) {
    return new BluetoothMediaEndpointServiceProviderImpl(
        bus, object_path, delegate);
  }
  // Returns a fake implementation.
  return new FakeBluetoothMediaEndpointServiceProvider(object_path, delegate);
}

}  // namespace chromeos


text:
class NLParser final
{
public:
    bool parse(const DepthAnalyzer::Node& root , InfoOutput& output);
};


text:
if(DEFINED POLLY_CXX11_CMAKE_)
  return()
else()
  set(POLLY_CXX11_CMAKE_ 1)
endif()

# Don't use polly_init (no generator expected)
set(POLLY_TOOLCHAIN_NAME "C++11 support")
set(POLLY_TOOLCHAIN_TAG "cxx11")

include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake")

set(CMAKE_CXX_STANDARD 11)


text:
@interface A0WebAuthentication ()
@property (strong, nonatomic) NSURL *callbackURL;
@property (strong, nonatomic) NSString *strategyName;
@end

@implementation A0WebAuthentication

- (instancetype)initWithApplication:(A0Application *)application strategy:(A0Strategy *)strategy {
    self = [super init];
    if (self) {
        A0Connection *connection = strategy.connections.firstObject;
        NSAssert(application != nil && application.identifier, @"You must supply a valid A0Application");
        NSAssert(strategy != nil && connection.name != nil, @"You must supply a valid strategy with at least 1 connection");
        NSString *connectionName = connection.name;
        NSString *callbackURLString = [NSString stringWithFormat:kCallbackURLString, application.identifier, connectionName].lowercaseString;
        _callbackURL = [NSURL URLWithString:callbackURLString];
        _strategyName = strategy.name;
    }
    return self;
}

- (BOOL)validateURL:(NSURL *)url {
    return [url.scheme.lowercaseString isEqualToString:self.callbackURL.scheme] && [url.host.lowercaseString isEqualToString:self.callbackURL.host];
}

- (A0Token *)tokenFromURL:(NSURL *)url error:(NSError *__autoreleasing *)error {
    NSString *queryString = url.query ?: url.fragment;
    NSDictionary *params = [NSDictionary fromQueryString:queryString];
    Auth0LogDebug(@"Received params %@ from URL %@", params, url);
    NSString *errorMessage = params[@"error"];
    A0Token *token;
    if (errorMessage) {
        Auth0LogError(@"URL contained error message %@", errorMessage);
        *error = [errorMessage isEqualToString:@"access_denied"] ? [A0Errors auth0NotAuthorizedForStrategy:self.strategyName] : [A0Errors auth0InvalidConfigurationForStrategy:self.strategyName];
    } else {
        NSString *accessToken = params[@"access_token"];
        NSString *idToken = params[@"id_token"];
        NSString *tokenType = params[@"token_type"];
        NSString *refreshToken = params[@"refresh_token"];
        if (idToken) {
            token = [[A0Token alloc] initWithAccessToken:accessToken idToken:idToken tokenType:tokenType refreshToken:refreshToken];
            Auth0LogVerbose(@"Obtained token from URL: %@", token);
        } else {
            Auth0LogError(@"Failed to obtain id_token from URL %@", url);
            *error = [A0Errors auth0NotAuthorizedForStrategy:self.strategyName];
        }
    }
    return token;
}

@end


text:
var restify = require('restify');
var config  = require('../config/env');

var client = restify.createJsonClient({
  url: config.fullContactHost
});

/**
* method to search public user information from FullContact service using email
* successful call returns url to the picture
*/
exports.getFullContactData = function(email, callback, res) {
  client.get(config.personApiUri + email, function(err, req, res, data) {
    if(err) {
      callback({
        success: false,
        error: err,
        email: email
      });
    } else {
      if(data.status === 200 && data.photos && data.photos.length > 0) {
        callback({
          success: true,
          email: email,
          profile_pic_url: data.photos[0].url,
          source: data.photos[0].type
        });
      } else {
          callback({
          success: false,
          error: 'results not available at this time',
          email: email
        });
      }
    }
  });
};


text:
System.register(['aurelia-router', './flux-dispatcher'], function (_export) {
  'use strict';

  var Router, RouterConfiguration, FluxDispatcher, RouterManager, FluxLifeCycleStep;

  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

  return {
    setters: [function (_aureliaRouter) {
      Router = _aureliaRouter.Router;
      RouterConfiguration = _aureliaRouter.RouterConfiguration;
    }, function (_fluxDispatcher) {
      FluxDispatcher = _fluxDispatcher.FluxDispatcher;
    }],
    execute: function () {
      RouterManager = (function () {
        function RouterManager() {
          _classCallCheck(this, RouterManager);
        }

        RouterManager.AddFluxPipelineStep = function AddFluxPipelineStep(aurelia) {
          var router = aurelia.container.get(Router);
          var configuration = new RouterConfiguration();

          configuration.addPipelineStep("modelbind", FluxLifeCycleStep);
          router.configure(configuration);
        };

        return RouterManager;
      })();

      _export('RouterManager', RouterManager);

      FluxLifeCycleStep = (function () {
        function FluxLifeCycleStep() {
          _classCallCheck(this, FluxLifeCycleStep);
        }

        FluxLifeCycleStep.prototype.run = function run(context, next) {

          if (context && context.plan && context.plan['default']) {
            FluxDispatcher.instance.strategy = context.plan['default'].strategy;
          }

          return next();
        };

        return FluxLifeCycleStep;
      })();
    }
  };
});


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

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('projects', '0002_auto_20170610_1325'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='project',
            name='members',
        ),
        migrations.AlterField(
            model_name='membership',
            name='role',
            field=models.SmallIntegerField(choices=[(0, 'USER'), (1, 'OWNER'), (2, 'MANAGER')], default=0, help_text='The role of the user.', verbose_name='Role'),
        ),
        migrations.AlterField(
            model_name='membership',
            name='user',
            field=models.ForeignKey(help_text='A member user.', on_delete=django.db.models.deletion.CASCADE, related_name='memberships', to=settings.AUTH_USER_MODEL, verbose_name='User'),
        ),
        migrations.AlterField(
            model_name='project',
            name='public',
            field=models.BooleanField(choices=[(True, 'Yes'), (False, 'No')], default=True, help_text='Set to YES if this project is public.', verbose_name='Public'),
        ),
    ]