text:
<!-- In order for this build file to be referenced by name on import into other build files,
     it's much nicer to have a short name with no spaces. Please don't change it. -->
<project name="Kettle CE Assembly" basedir="." default="dist" xmlns:ivy="antlib:org.apache.ivy.ant">

  <!-- =================================================================================
       Property Defaults
       Any of these properties can be overridden in either assembly.properties or override.properties
       =================================================================================-->

  <!-- Load the properties files in the proper order -->
  <property file="override.properties"
            description="Properties customized for your development environment belong in this file.  This file will never be checked into the SCM." />
  <property file="build.properties"
            description="Properties customized for your particular project belong in this file." />

  <!-- the impl properties are used to create the manifest file -->
  <property name="impl.title" value="Kettle" />
  <property name="impl.version" value="${project.revision}" />
  <property name="impl.vendor" value="Pentaho Corporation" />

  <!-- override the default package-ivy.xml defined in common subfloor.pkg -->
    <property name="package.artifact.ivyfile"
              value="ivy.xml"
              description="The ivy file defining dependencies of the package" />

  <import file="build-res/subfloor-pkg.xml" />

  <target name="dist" depends="init,resolve,resolve-swtlibs,resolve-launcher,resolve-plugins,package" description="Builds and packages the application"/>

  <target name="assemble-full" depends="init,resolve-all,assemble-plugins,assemble" description="Builds the application" />

  <target name="assemble-no-plugins" depends="init,resolve-all,assemble" description="Builds the application" />

  <target name="resolve-all" depends="init,resolve,resolve-swtlibs,resolve-launcher,resolve-plugins"/>

  <target name="assemble" depends="resolve-swtlibs,subfloor-pkg.assemble" description="copy jar files to distribution directory" >
  	<echo>Construct the distribution package...</echo>
    <!-- make JavaApplicationStub executable for OSX -->
    <chmod file="${approot.stage.dir}/Data Integration.app/Contents/MacOS/JavaApplicationStub" perm="ugo+rx"/>

  	<!-- Remove the SWT JAR used for compilation -->
  	<delete quiet="true">
  		<fileset dir="${approot.stage.dir}/lib" includes="swt*.jar" />
  	</delete>

    <antcall target="unzip-swtlibs"/>

    <!-- Insert launcher revision number into batch files -->
    <replace dir="${approot.stage.dir}">
      <include name="**/*.bat"/>
    	<include name="**/*.sh"/>
    	<include name="**/*.plist"/>
      <replacefilter token="launcher.jar" value="pentaho-application-launcher-${dependency.launcher.revision}.jar"/>
    </replace>

    <replace dir="${approot.stage.dir}">
      <include name="*.bat"/>
      <include name="*.sh"/>
      <replacefilter token="@KETTLE_VERSION_STRING@" value="${dependency.kettle.revision}"/>
    </replace>

  	<chmod perm="a+x" dir="${approot.stage.dir}" includes="**/*.sh" />
  </target>

  <!--=======================================================================
      assemble-plugins

      Unzips the non-core plugin packages into the distribution area.
    ====================================================================-->
  <target name="assemble-plugins" depends="install-antcontrib,resolve-plugins" description="Unzip plugins to distribution directory">

  	<for param="plugin">
  	<path id="plugin-list">
  	  <fileset dir="${plugins.dir}">
  		<include name="*.zip"/>
  	  </fileset>
  	</path>
  	 <sequential>
  	 	<unzip src="@{plugin}" dest="${stage.dir}/${package.root.dir}/plugins" overwrite="true"/>
  	 </sequential>
  	</for>

    <delete dir="${plugins.dir}"/>
  </target>

	<!--=======================================================================
	      publish-local

	      Builds and publishes the jar file for this project to the user's
	      local repository for download by other projects currently being
	      executed on the user's system.
	      ====================================================================-->
	  <target name="publish-local"
	          depends="assemble-full, package-zip, publish-local-nojar"
	          description="Builds and publishes the jar file to the local repository">
	  </target>

	  <!--=======================================================================
	        publish

	        Creates and publishes the jar file for this project to a Maven2
	        repository.
	        ====================================================================-->
	 <target name="publish"
	         depends="assemble-full, package-zip, publish-nojar"
	         description="Builds and publishes the jar file to the local repository">
	 </target>

  <!-- Differs from subfloor by publishing the zip instead of jar -->
  <target name="publish-nojar.internal" depends="install-antcontrib,create-pom,ivy.deliver">
    <antcall target="maven-publish-dependencies">
      <param name="publish.groupId" value="${ivy.artifact.group}" />
      <param name="publish.artifactId" value="${ivy.artifact.id}" />
      <param name="publish.version" value="${project.revision}" />
      <param name="publish.file" value="${ivy.artifact.ivypathname}" />
    </antcall>

    <if>
      <equals arg1="${source.publish}" arg2="true" />
        <then>
          <antcall target="maven-publish-sources">
            <param name="publish.groupId" value="${ivy.artifact.group}" />
            <param name="publish.artifactId" value="${ivy.artifact.id}" />
            <param name="publish.version" value="${project.revision}" />
            <param name="publish.file" value="${dist.dir}/${ivy.artifact.id}-${project.revision}-sources.jar" />
          </antcall>
        </then>
    </if>

    <antcall target="maven-publish-artifact">
      <param name="publish.pomFile" value="${ivy.artifact.pomfile}" />
      <param name="publish.file" value="${dist.dir}/${ivy.artifact.id}-${project.revision}.zip" />
    </antcall>

    <antcall target="maven-publish.post"/>

  </target>

	<!--=======================================================================
        resolve-swtlibs

        Resolved the swtlibs configuration from ivy.xml
    =====================================================================-->
  <target name="resolve-swtlibs" depends="install-ivy">
    <delete dir="${swtlib.dir}" />
    <ivy:resolve file="${ivyfile}" conf="test" />
    <ivy:retrieve conf="swtlibs" pattern="${swtlib.dir}/[module]-[revision](-[classifier]).[ext]" />
  </target>

  <target name="package.lib" depends="resolve">
    <jar jarfile="dist/${lib.zip.filename}" basedir="lib" />
  </target>

  <target name="resolve-launcher" depends="install-ivy">
    <ivy:resolve file="${ivyfile}" conf="launcher" />
    <ivy:retrieve conf="launcher" pattern="${stage.dir}/${package.root.dir}/launcher/[module]-[revision](-[classifier]).[ext]" />
  </target>

  <target name="resolve-plugins" depends="install-ivy">
    <ivy:resolve file="${ivyfile}" conf="plugins" />
    <ivy:retrieve conf="plugins" pattern="${plugins.dir}/[module]-[revision](-[classifier]).[ext]" />
  </target>

  <target name="unzip-swtlibs">
	<!-- Unzip the libswt package into the libswt folder of the distribution -->
    <unzip dest="${approot.stage.dir}" overwrite="true">
      <fileset dir="${swtlib.dir}">
        <include name="**/*.zip"/>
      </fileset>
    </unzip>
  </target>
</project>


text:
<?php
    // make an associative array of callers we know, indexed by phone number
    $people= array(
		"+15202508037"=>"Britney",
		);

	// if the caller is known, then greet them by name
	// otherwise, consider them just another monkey
	if(!$name = $people[$_REQUEST['From']])
		$name = "Advocate";

	// now greet the caller
	header("content-type: text/xml");
	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>

<Response>
	<Say>Hello <?php echo $name ?>.</Say>
	<Gather numDigits="1" action="handle-key.php" method="POST">
		<Play>memo.mp3</Play>
	</Gather>
</Response>

redpajama_set_name: RedPajamaGithub


text:
require 'xsd/qname'

# {http://soap.zeus.com/zxtm/1.0/}Catalog.Rule.RuleInfo
#   rule_text - SOAP::SOAPString
#   rule_notes - SOAP::SOAPString
class CatalogRuleRuleInfo
  attr_accessor :rule_text
  attr_accessor :rule_notes

  def initialize(rule_text = nil, rule_notes = nil)
    @rule_text = rule_text
    @rule_notes = rule_notes
  end
end

# {http://soap.zeus.com/zxtm/1.0/}Catalog.Rule.SyntaxCheck
#   valid - SOAP::SOAPBoolean
#   warnings - SOAP::SOAPString
#   errors - SOAP::SOAPString
class CatalogRuleSyntaxCheck
  attr_accessor :valid
  attr_accessor :warnings
  attr_accessor :errors

  def initialize(valid = nil, warnings = nil, errors = nil)
    @valid = valid
    @warnings = warnings
    @errors = errors
  end
end

# {http://soap.zeus.com/zxtm/1.0/}Catalog.Rule.RuleInfoArray
class CatalogRuleRuleInfoArray < ::Array
end

# {http://soap.zeus.com/zxtm/1.0/}Catalog.Rule.SyntaxCheckArray
class CatalogRuleSyntaxCheckArray < ::Array
end

# {http://soap.zeus.com/zxtm/1.0/}StringArray
class StringArray < ::Array
end

# {http://soap.zeus.com/zxtm/1.0/}StringArrayArray
class StringArrayArray < ::Array
end

# {http://soap.zeus.com/zxtm/1.0/}booleanArray
class BooleanArray < ::Array
end

# {http://soap.zeus.com/zxtm/1.0/}booleanArrayArray
class BooleanArrayArray < ::Array
end

# {http://soap.zeus.com/zxtm/1.0/}intArray
class IntArray < ::Array
end

# {http://soap.zeus.com/zxtm/1.0/}unsignedIntArray
class UnsignedIntArray < ::Array
end


text:
using Naru.Concurrency.Scheduler;

namespace Naru.WPF.Scheduler
{
    public interface IDispatcherSchedulerProvider : ISchedulerProvider
    {
        IDispatcherScheduler Dispatcher { get; }
    }
}


text:
from concurrent.futures import ThreadPoolExecutor

from biothings.hub import get_loop

def test_get_loop():
    # Given
    max_workers = 2

    # Action
    loop = get_loop(max_workers=max_workers)

    # Asserts
    assert isinstance(loop._default_executor, ThreadPoolExecutor)
    assert loop._default_executor._max_workers == max_workers


text:
package com.jaamsim.ui;

import java.io.File;

import javax.swing.JFileChooser;
import javax.swing.filechooser.FileNameExtensionFilter;

import com.jaamsim.Commands.DefineCommand;
import com.jaamsim.DisplayModels.ColladaModel;
import com.jaamsim.DisplayModels.ImageModel;
import com.jaamsim.Graphics.DisplayEntity;
import com.jaamsim.basicsim.Entity;
import com.jaamsim.basicsim.JaamSimModel;
import com.jaamsim.controllers.RenderManager;
import com.jaamsim.input.FileInput;
import com.jaamsim.input.InputAgent;
import com.jaamsim.math.AABB;
import com.jaamsim.math.Vec2d;
import com.jaamsim.math.Vec3d;
import com.jaamsim.render.MeshProtoKey;
import com.jaamsim.render.RenderUtils;
import com.jaamsim.units.DimensionlessUnit;
import com.jaamsim.units.DistanceUnit;

/**
 * Creates entities from a 3D asset file (.DAE, .OBJ, etc.) or a image file (.png, .jpg, etc.).
 *
 * @author matt.chudleigh
 *
 */
public class DisplayEntityFactory extends Entity {

	/**
	 * Opens a FileDialog for selecting images to import.
	 *
	 * @param gui - the Control Panel.
	 */
	public static void importImages(GUIFrame gui) {

		// Create a file chooser
		final JFileChooser chooser = new JFileChooser(GUIFrame.getImageFolder());
		chooser.setMultiSelectionEnabled(true);

		// Set the file extension filters
		chooser.setAcceptAllFileFilterUsed(false);
		FileNameExtensionFilter[] imgFilters = FileInput.getFileNameExtensionFilters("Image",
				ImageModel.VALID_FILE_EXTENSIONS, ImageModel.VALID_FILE_DESCRIPTIONS);
		for (int i = 0; i < imgFilters.length; i++) {
			chooser.addChoosableFileFilter(imgFilters[i]);
		}
		chooser.setFileFilter(imgFilters[0]);

		// Show the file chooser and wait for selection
		int returnVal = chooser.showDialog(gui, "Import Images");

		// Create the selected graphics files
		if (returnVal == JFileChooser.APPROVE_OPTION) {
			File[] files = chooser.getSelectedFiles();
			GUIFrame.setImageFolder(files[0].getParent());
			DisplayEntityFactory.importImageFiles(files);
		}
	}

	/**
	 * Opens a FileDialog for selecting 3D assets to import.
	 *
	 * @param gui - the Control Panel.
	 */
	public static void import3D(GUIFrame gui) {

		// Create a file chooser
		final JFileChooser chooser = new JFileChooser(GUIFrame.get3DFolder());
		chooser.setMultiSelectionEnabled(true);

		// Set the file extension filters
		chooser.setAcceptAllFileFilterUsed(false);
		FileNameExtensionFilter[] colFilters = FileInput.getFileNameExtensionFilters("3D",
				ColladaModel.VALID_FILE_EXTENSIONS, ColladaModel.VALID_FILE_DESCRIPTIONS);
		chooser.addChoosableFileFilter(colFilters[0]);
		for (int i = 1; i < colFilters.length; i++) {
			chooser.addChoosableFileFilter(colFilters[i]);
		}
		chooser.setFileFilter(colFilters[0]);

		// Show the file chooser and wait for selection
		int returnVal = chooser.showDialog(gui, "Import 3D Assets");

		// Create the selected graphics files
		if (returnVal == JFileChooser.APPROVE_OPTION) {
			File[] files = chooser.getSelectedFiles();
			GUIFrame.set3DFolder(files[0].getParent());
			DisplayEntityFactory.import3DFiles(files);
		}
	}

	/**
	 * Creates a new thread for creating the imported images.
	 *
	 * @param files - the image files to import
	 */
	private static void importImageFiles(File[] files) {

		final File[] chosenfiles = files;
		new Thread(new Runnable() {
			@Override
			public void run() {
				DisplayEntityFactory.createImages(chosenfiles);
			}
		}).start();
	}

	/**
	 * Creates a new thread for creating the 3D assets.
	 *
	 * @param files - the 3D asset files to import
	 */
	private static void import3DFiles(File[] files) {

		final File[] chosenfiles = files;
		new Thread(new Runnable() {
			@Override
			public void run() {
				DisplayEntityFactory.create3DAssets(chosenfiles);
			}
		}).start();
	}

	/**
	 * Loops through the specified files and creates a new DisplayEntity for each one.
	 *
	 * @param files - the image files
	 */
	private static void createImages(File[] files) {

		if (!RenderManager.isGood()) {
			GUIFrame.invokeErrorDialog("Runtime Error",	"The renderer is not ready.");
			return;
		}

		JaamSimModel simModel = GUIFrame.getJaamSimModel();

		// Loop through the graphics files
		for (File f : files) {

			// Determine the file name and extension
			String fileName = f.getName();
			int i = fileName.lastIndexOf('.');
			if (i <= 0 || i >= fileName.length() - 1) {
				GUIFrame.invokeErrorDialog("Input Error",
						String.format("File name: %s is invalid.", fileName));
				continue;
			}
			String extension = fileName.substring(i+1).toLowerCase();
			if (!ImageModel.isValidExtension(extension)) {
				GUIFrame.invokeErrorDialog("Input Error",
						String.format("The extension for file: %s is invalid for an image.",
								fileName));
				continue;
			}

			// Set the entity name
			i = fileName.indexOf('.');  // first period in the file name
			String entityName = fileName.substring(0, i);
			entityName = entityName.replaceAll(" ", "_"); // Space is not allowed for Entity Name
			entityName = InputAgent.getUniqueName(simModel, entityName, "");

			// Create the ImageModel
			String modelName = InputAgent.getUniqueName(simModel,entityName + "-model", "");
			InputAgent.storeAndExecute(new DefineCommand(simModel, ImageModel.class, modelName));
			ImageModel dm = (ImageModel) simModel.getNamedEntity(modelName);

			// Load the image to the ImageModel
			InputAgent.applyArgs(dm, "ImageFile", f.getPath());

			// Create the DisplayEntity
			InputAgent.storeAndExecute(new DefineCommand(simModel, DisplayEntity.class, entityName));
			DisplayEntity de = (DisplayEntity) simModel.getNamedEntity(entityName);

			// Assign the ImageModel to the new DisplayEntity
			InputAgent.applyArgs(de, "DisplayModel", dm.getName());

			// Set the x-dimension of the image to maintain its aspect ratio
			Vec3d size = new Vec3d(1.0, 1.0, 0.0);
			Vec2d imageDims = RenderManager.inst().getImageDims(f.toURI());
			if (imageDims != null)
				size.x = imageDims.x / imageDims.y;
			InputAgent.apply(de, simModel.formatVec3dInput("Size", size, DistanceUnit.class));
		}
	}

	/**
	 * Loops through the specified files and creates a new DisplayEntity for each one.
	 *
	 * @param files - the 3D asset and/or image files.
	 */
	private static void create3DAssets(File[] files) {

		if (!RenderManager.isGood()) {
			GUIFrame.invokeErrorDialog("Runtime Error",	"The renderer is not ready.");
			return;
		}

		JaamSimModel simModel = GUIFrame.getJaamSimModel();

		// Loop through the graphics files
		for (File f : files) {

			// Determine the file name and extension
			String fileName = f.getName();
			int i = fileName.lastIndexOf('.');
			if (i <= 0 || i >= fileName.length() - 1) {
				GUIFrame.invokeErrorDialog("Input Error",
						String.format("File name: %s is invalid.", fileName));
				continue;
			}
			String extension = fileName.substring(i+1).toLowerCase();
			if (!ColladaModel.isValidExtension(extension)) {
				GUIFrame.invokeErrorDialog("Input Error",
						String.format("The extension for file: %s is invalid for a 3D asset.",
								fileName));
				continue;
			}

			// Set the entity name
			i = fileName.indexOf('.');  // first period in the file name
			String entityName = fileName.substring(0, i);
			entityName = entityName.replaceAll(" ", "_"); // Space is not allowed for Entity Name
			entityName = InputAgent.getUniqueName(simModel, entityName, "");

			// Create the ColladaModel
			String modelName = InputAgent.getUniqueName(simModel, entityName + "-model", "");
			InputAgent.storeAndExecute(new DefineCommand(simModel, ColladaModel.class, modelName));
			ColladaModel dm = (ColladaModel) simModel.getNamedEntity(modelName);

			// Load the 3D content to the ColladaModel
			InputAgent.applyArgs(dm, "ColladaFile", f.getPath());

			// Create the DisplayEntity
			InputAgent.storeAndExecute(new DefineCommand(simModel, DisplayEntity.class, entityName));
			DisplayEntity de = (DisplayEntity) simModel.getNamedEntity(entityName);

			// Assign the ColladaModel to the new DisplayEntity
			InputAgent.applyArgs(de, "DisplayModel", dm.getName());

			// Calculate the DisplayEntity's size and position from the ColladaModel
			MeshProtoKey meshKey = RenderUtils.FileNameToMeshProtoKey(f.toURI());
			AABB modelBounds = RenderManager.inst().getMeshBounds(meshKey, true);
			Vec3d entityPos = modelBounds.center;
			Vec3d modelSize = new Vec3d(modelBounds.radius);
			modelSize.scale3(2);

			// Set the DisplayEntity's position, size, and alignment
			InputAgent.apply(de, simModel.formatVec3dInput("Position", entityPos, DistanceUnit.class));
			InputAgent.apply(de, simModel.formatVec3dInput("Alignment", new Vec3d(), DimensionlessUnit.class));
			InputAgent.apply(de, simModel.formatVec3dInput("Size", modelSize, DistanceUnit.class));
		}
	}

}


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

<meta name="generator" content="JDiff v1.1.0">

<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
android.net.ConnectivityManager
</TITLE>
<link href="../../../../assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../stylesheet-jdiff.css" rel="stylesheet" type="text/css" />

<nobr>Android Developers | Android.com</nobr>

        API Diff Specification

        To Level:
        21

        From Level:
        20

        Generated
        2014.10.15 15:01

        Statistics

Class android.net.ConnectivityManager

  Added Methods

  <nobr>void addDefaultNetworkActiveListener(OnNetworkActiveListener)</nobr>

  <nobr>Network[] getAllNetworks()</nobr>

  <nobr>LinkProperties getLinkProperties(Network)</nobr>

  <nobr>NetworkCapabilities getNetworkCapabilities(Network)</nobr>

  <nobr>NetworkInfo getNetworkInfo(Network)</nobr>

  <nobr>Network getProcessDefaultNetwork()</nobr>

  <nobr>boolean isDefaultNetworkActive()</nobr>

  <nobr>void registerNetworkCallback(NetworkRequest,</nobr> NetworkCallback<nobr><nobr>)</nobr>

  <nobr>void removeDefaultNetworkActiveListener(OnNetworkActiveListener)</nobr>

  <nobr>void reportBadNetwork(Network)</nobr>

  <nobr>void requestNetwork(NetworkRequest,</nobr> NetworkCallback<nobr><nobr>)</nobr>

  <nobr>boolean setProcessDefaultNetwork(Network)</nobr>

  <nobr>void unregisterNetworkCallback(NetworkCallback)</nobr>

  Changed Methods

  <nobr>int getNetworkPreference()  </nobr>

Now deprecated.

  <nobr>boolean requestRouteToHost(int,</nobr> int<nobr><nobr>)  </nobr>

Now deprecated.

  <nobr>void setNetworkPreference(int)  </nobr>

Now deprecated.

  <nobr>int startUsingNetworkFeature(int,</nobr> String<nobr><nobr>)  </nobr>

Now deprecated.

  <nobr>int stopUsingNetworkFeature(int,</nobr> String<nobr><nobr>)  </nobr>

Now deprecated.

  Added Fields

  <nobr>int TYPE_VPN</nobr>

        Except as noted, this content is licensed under
         Creative Commons Attribution 2.5.
        For details and restrictions, see the Content License.

        Site Terms of Service -
        Privacy Policy -
        Brand Guidelines


text:
namespace DotNetXri.Client.Resolve {

	using DotNetXri.Client.Resolve.Exception;
	/**
	 * @author wtan
	 *
	 */
	public class TrustType : Serializable {
		public const string TRUST_NONE = "none";
		public const string TRUST_SAML = "saml";
		public const string TRUST_HTTPS = "https";
		public const string TRUST_SAML_HTTPS = "saml+https";
		public const string TRUST = "trust";

		protected string type = TRUST_NONE;

		/**
		 * Constructor. Creates a TrustType
		 * @param type
		 */
		public TrustType() {
		}

		/**
		 * Constructor. Creates a TrustType
		 * @param type
		 */
		public TrustType(string type)
			//throws IllegalTrustTypeException
		{
			setType(type);
		}

		/**
		 * @return Returns the type as a string.
		 */
		public string getType() {
			return type;
		}

		/**
		 * @return Returns a string representation of the parameter name value pair.
		 */
		public string getParameterPair() {
			string https = (type.Equals(TRUST_HTTPS) || type.Equals(TRUST_SAML_HTTPS)) ? "true" : "false";
			string saml = (type.Equals(TRUST_SAML) || type.Equals(TRUST_SAML_HTTPS)) ? "true" : "false";
			return MimeType.PARAM_HTTPS + "=" + https + ";" + MimeType.PARAM_SAML + "=" + saml;
		}

		public void setParameterPair(bool isHttps, bool isSaml) {
			if (isHttps) {
				if (isSaml)
					type = TRUST_SAML_HTTPS;
				else
					type = TRUST_HTTPS;
			} else {
				if (isSaml)
					type = TRUST_SAML;
				else
					type = TRUST_NONE;
			}
		}

		/**
		 * @param type The type to set.
		 */
		public void setType(string type)
			//throws IllegalTrustTypeException
		{
			type = type.ToLowerInvariant();
			if ((!type.Equals(TRUST_NONE))
					&& !type.Equals(TRUST_SAML)
					&& !type.Equals(TRUST_HTTPS)
					&& !type.Equals(TRUST_SAML_HTTPS)) {
				throw new IllegalTrustTypeException(type);
			}

			this.type = type;
		}

		/**
		 * @return Returns true if the type is https or saml+https, false otherwise.
		 */
		public bool isHTTPS() {
			return (type.Equals(TRUST_HTTPS) || type.Equals(TRUST_SAML_HTTPS));
		}

		/**
		 * @return Returns true if the type is saml or saml+https, false otherwise.
		 */
		public bool isSAML() {
			return (type.Equals(TRUST_SAML) || type.Equals(TRUST_SAML_HTTPS));
		}

		/**
		 * Compares with a string representation of the trust type.
		 * @param trustType
		 */
		public bool Equals(string trustType) {
			return this.type.Equals(trustType, System.StringComparison.OrdinalIgnoreCase);
		}

		public override string ToString() {
			return getType();
		}
	}
}


text:
// Generated by gtkmmproc -- DO NOT MODIFY!

#include <gdkmm/drawable.h>
#include <gdkmm/private/drawable_p.h>

// -*- c++ -*-
/* $Id: drawable.ccg,v 1.2 2004/01/19 19:48:41 murrayc Exp $ */

/* Copyright 1998-2002 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gdkmm/gc.h>
#include <gdkmm/display.h>
#include <gdkmm/pixbuf.h>
#include <gdk/gdk.h>

namespace Gdk
{

void Drawable::draw_points(const Glib::RefPtr<const GC>& gc, const Glib::ArrayHandle<Point>& points)
{
  // Don't assume the reinterpret_cast<> works everywhere.  Gdk::Point is *special*.
  gdk_draw_points(
      gobj(), const_cast<GdkGC*>(Glib::unwrap<Gdk::GC>(gc)),
      reinterpret_cast<GdkPoint*>(const_cast<Point*>(points.data())),
      points.size());
}

void Drawable::draw_lines(const Glib::RefPtr<const GC>& gc, const Glib::ArrayHandle<Point>& points)
{
  // Don't assume the reinterpret_cast<> works everywhere.  Gdk::Point is *special*.
  gdk_draw_lines(
      gobj(), const_cast<GdkGC*>(Glib::unwrap<Gdk::GC>(gc)),
      reinterpret_cast<GdkPoint*>(const_cast<Point*>(points.data())),
      points.size());
}

void Drawable::draw_polygon(const Glib::RefPtr<const GC>& gc, bool filled,
                            const Glib::ArrayHandle<Point>& points)
{
  // Don't assume the reinterpret_cast<> works everywhere.  Gdk::Point is *special*.
  gdk_draw_polygon(
      gobj(), const_cast<GdkGC*>(Glib::unwrap<Gdk::GC>(gc)), filled,
      reinterpret_cast<GdkPoint*>(const_cast<Point*>(points.data())),
      points.size());
}

void Drawable::copy_to_image(const Glib::RefPtr<Image>& image, int src_x, int src_y, int dest_x, int dest_y, int width, int height) const
{
  gdk_drawable_copy_to_image(const_cast<GdkDrawable*>(gobj()), Glib::unwrap(image), src_x, src_y, dest_x, dest_y, width, height);
}

void Drawable::draw_pixbuf(const Glib::RefPtr<Pixbuf>& pixbuf, int src_x, int src_y, int dest_x, int dest_y, int width, int height, RgbDither dither, int x_dither, int y_dither)
{
gdk_draw_pixbuf(gobj(), 0, Glib::unwrap(pixbuf), src_x, src_y, dest_x, dest_y, width, height, ((GdkRgbDither)(dither)), x_dither, y_dither);
}

} // namespace Gdk

namespace
{
} // anonymous namespace

// static
GType Glib::Value<Gdk::RgbDither>::value_type()
{
  return gdk_rgb_dither_get_type();
}

namespace Glib
{

Glib::RefPtr<Gdk::Drawable> wrap(GdkDrawable* object, bool take_copy)
{
  return Glib::RefPtr<Gdk::Drawable>( dynamic_cast<Gdk::Drawable*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */

namespace Gdk
{

/* The *_Class implementation: */

const Glib::Class& Drawable_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &Drawable_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gdk_drawable_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}

void Drawable_Class::class_init_function(void* g_class, void* class_data)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);

}

Glib::ObjectBase* Drawable_Class::wrap_new(GObject* object)
{
  return new Drawable((GdkDrawable*)object);
}

/* The implementation: */

GdkDrawable* Drawable::gobj_copy()
{
  reference();
  return gobj();
}

Drawable::Drawable(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

Drawable::Drawable(GdkDrawable* castitem)
:
  Glib::Object((GObject*)(castitem))
{}

Drawable::~Drawable()
{}

Drawable::CppClassType Drawable::drawable_class_; // initialize static member

GType Drawable::get_type()
{
  return drawable_class_.init().get_type();
}

GType Drawable::get_base_type()
{
  return gdk_drawable_get_type();
}

Drawable::Drawable()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(drawable_class_.init()))
{

}

Glib::RefPtr<Drawable> Drawable::create()
{
  return Glib::RefPtr<Drawable>( new Drawable() );
}
#ifndef GDKMM_DISABLE_DEPRECATED

void Drawable::get_size(int& width, int& height)
{
gdk_drawable_get_size(gobj(), &width, &height);
}

#endif // GDKMM_DISABLE_DEPRECATED

void Drawable::get_size(int& width, int& height) const
{
gdk_drawable_get_size(const_cast<GdkDrawable*>(gobj()), &width, &height);
}

int Drawable::get_depth() const
{
  return gdk_drawable_get_depth(const_cast<GdkDrawable*>(gobj()));
}

void Drawable::set_colormap(const Glib::RefPtr<Colormap>& colormap)
{
gdk_drawable_set_colormap(gobj(), Glib::unwrap(colormap));
}

Glib::RefPtr<Colormap> Drawable::get_colormap()
{

  Glib::RefPtr<Colormap> retvalue = Glib::wrap(gdk_drawable_get_colormap(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<Visual> Drawable::get_visual()
{

  Glib::RefPtr<Visual> retvalue = Glib::wrap(gdk_drawable_get_visual(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

void Drawable::draw_point(const Glib::RefPtr<const GC>& gc, int x, int y)
{
gdk_draw_point(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x, y);
}

void Drawable::draw_line(const Glib::RefPtr<const GC>& gc, int x1, int y1, int x2, int y2)
{
gdk_draw_line(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x1, y1, x2, y2);
}

void Drawable::draw_rectangle(const Glib::RefPtr<const GC>& gc, bool filled, int x, int y, int width, int height)
{
gdk_draw_rectangle(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), static_cast<int>(filled), x, y, width, height);
}

void Drawable::draw_arc(const Glib::RefPtr<const GC>& gc, bool filled, int x, int y, int width, int height, int angle1, int angle2)
{
gdk_draw_arc(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), static_cast<int>(filled), x, y, width, height, angle1, angle2);
}

void Drawable::draw_drawable(const Glib::RefPtr<const GC>& gc, const Glib::RefPtr<const Drawable>& src, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
{
gdk_draw_drawable(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), const_cast<GdkDrawable*>(Glib::unwrap<Drawable>(src)), xsrc, ysrc, xdest, ydest, width, height);
}

void Drawable::draw_image(const Glib::RefPtr<const GC>& gc, const Glib::RefPtr<const Image>& image, int xsrc, int ysrc, int xdest, int ydest, int width, int height)
{
gdk_draw_image(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), const_cast<GdkImage*>(Glib::unwrap<Image>(image)), xsrc, ysrc, xdest, ydest, width, height);
}

void Drawable::draw_segments(const Glib::RefPtr<const GC>& gc, GdkSegment* segs, int nsegs)
{
gdk_draw_segments(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), (segs), nsegs);
}

void Drawable::draw_glyphs(const Glib::RefPtr<const GC>& gc, const Glib::RefPtr<const Pango::Font>& font, int x, int y, const Pango::GlyphString& glyphs)
{
gdk_draw_glyphs(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), const_cast<PangoFont*>(Glib::unwrap<Pango::Font>(font)), x, y, const_cast<PangoGlyphString*>(glyphs.gobj()));
}

void Drawable::draw_layout_line(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::LayoutLine>& line)
{
gdk_draw_layout_line(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x, y, const_cast<PangoLayoutLine*>(Glib::unwrap<Pango::LayoutLine>(line)));
}

void Drawable::draw_layout_line(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::LayoutLine>& line, const Color& foreground, const Color& background)
{
gdk_draw_layout_line_with_colors(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x, y, const_cast<PangoLayoutLine*>(Glib::unwrap<Pango::LayoutLine>(line)), (foreground).gobj(), (background).gobj());
}

void Drawable::draw_layout(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::Layout>& layout)
{
gdk_draw_layout(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x, y, const_cast<PangoLayout*>(Glib::unwrap<Pango::Layout>(layout)));
}

void Drawable::draw_layout(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::Layout>& layout, const Color& foreground, const Color& background)
{
gdk_draw_layout_with_colors(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x, y, const_cast<PangoLayout*>(Glib::unwrap<Pango::Layout>(layout)), (foreground).gobj(), (background).gobj());
}

void Drawable::draw_pixbuf(const Glib::RefPtr<const GC>& gc, const Glib::RefPtr<Pixbuf>& pixbuf, int src_x, int src_y, int dest_x, int dest_y, int width, int height, RgbDither dither, int x_dither, int y_dither)
{
gdk_draw_pixbuf(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), Glib::unwrap(pixbuf), src_x, src_y, dest_x, dest_y, width, height, ((GdkRgbDither)(dither)), x_dither, y_dither);
}

Glib::RefPtr<Image> Drawable::get_image(int x, int y, int width, int height) const
{
  return Glib::wrap(gdk_drawable_get_image(const_cast<GdkDrawable*>(gobj()), x, y, width, height));
}

Region Drawable::get_clip_region() const
{
  return Region(gdk_drawable_get_clip_region(const_cast<GdkDrawable*>(gobj())));
}

Region Drawable::get_visible_region() const
{
  return Region(gdk_drawable_get_visible_region(const_cast<GdkDrawable*>(gobj())));
}

void Drawable::draw_rgb_image(const Glib::RefPtr<const GC>& gc, int x, int y, int width, int height, RgbDither dith, const guchar* rgb_buf, int rowstride)
{
gdk_draw_rgb_image(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x, y, width, height, ((GdkRgbDither)(dith)), rgb_buf, rowstride);
}

void Drawable::draw_rgb_image_dithalign(const Glib::RefPtr<const GC>& gc, int x, int y, int width, int height, RgbDither dith, const guchar* rgb_buf, int rowstride, int xdith, int ydith)
{
gdk_draw_rgb_image_dithalign(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x, y, width, height, ((GdkRgbDither)(dith)), rgb_buf, rowstride, xdith, ydith);
}

void Drawable::draw_rgb_32_image(const Glib::RefPtr<const GC>& gc, int x, int y, int width, int height, RgbDither dith, const guchar* rgb_buf, int rowstride)
{
gdk_draw_rgb_32_image(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x, y, width, height, ((GdkRgbDither)(dith)), rgb_buf, rowstride);
}

void Drawable::draw_rgb_32_image_dithalign(const Glib::RefPtr<const GC>& gc, int x, int y, int width, int height, RgbDither dith, const guchar* buf, int rowstride, int xdith, int ydith)
{
gdk_draw_rgb_32_image_dithalign(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x, y, width, height, ((GdkRgbDither)(dith)), buf, rowstride, xdith, ydith);
}

void Drawable::draw_gray_image(const Glib::RefPtr<const GC>& gc, int x, int y, int width, int height, RgbDither dith, const guchar* rgb_buf, int rowstride)
{
gdk_draw_gray_image(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x, y, width, height, ((GdkRgbDither)(dith)), rgb_buf, rowstride);
}

void Drawable::draw_indexed_image(const Glib::RefPtr<const GC>& gc, int x, int y, int width, int height, RgbDither dith, const guchar* rgb_buf, int rowstride, const RgbCmap& cmap)
{
gdk_draw_indexed_image(gobj(), const_cast<GdkGC*>(Glib::unwrap<GC>(gc)), x, y, width, height, ((GdkRgbDither)(dith)), rgb_buf, rowstride, const_cast<GdkRgbCmap*>(cmap.gobj()));
}

Glib::RefPtr<Screen> Drawable::get_screen()
{

  Glib::RefPtr<Screen> retvalue = Glib::wrap(gdk_drawable_get_screen(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const Screen> Drawable::get_screen() const
{
  return const_cast<Drawable*>(this)->get_screen();
}

Glib::RefPtr<Display> Drawable::get_display()
{

  Glib::RefPtr<Display> retvalue = Glib::wrap(gdk_drawable_get_display(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;

}

Glib::RefPtr<const Display> Drawable::get_display() const
{
  return const_cast<Drawable*>(this)->get_display();
}

Cairo::RefPtr<Cairo::Context> Drawable::create_cairo_context()
{
  return Cairo::RefPtr<Cairo::Context>(new Cairo::Context(gdk_cairo_create(gobj()), true /* has_reference */));
}

} // namespace Gdk


text:
package org.apache.mrql.gen;

import java_cup.runtime.*;
import java.io.*;
import java.util.HashMap;

abstract public class Tree implements Serializable {

    /* the current line number in the parsed file */
    public static int line_number = 0;

    /* the current char position in the parsed file */
    public static int position_number = 0;

    /* true when Trees are parsed rather than processed */
    public static boolean parsed = false;

    /* the line number of the Tree in the parsed file */
    public int line;

    /* the char position of the Tree in the parsed file */
    public int position;

    Tree () { line = line_number; position = position_number; }

    /* deep equality */
    public abstract boolean equals ( Tree e );

    final public boolean is_node () { return (this instanceof Node); }
    final public boolean is_variable () { return (this instanceof VariableLeaf); }
    final public boolean is_long () { return (this instanceof LongLeaf); }
    final public boolean is_string () { return (this instanceof StringLeaf); }
    final public boolean is_double () { return (this instanceof DoubleLeaf); }

    final public String variableValue () { return (this instanceof VariableLeaf) ? ((VariableLeaf)this).value() : ""; }
    final public long longValue () { return (this instanceof LongLeaf) ? ((LongLeaf)this).value() : (long)0; }
    final public String stringValue () { return (this instanceof StringLeaf) ? ((StringLeaf)this).value() : ""; }
    final public double doubleValue () { return (this instanceof DoubleLeaf) ? ((DoubleLeaf)this).value() : (double)0.0; }

    /* size used for pretty() */
    protected abstract int size ();

    /* print the Tree into a string */
    public abstract String toString ();

    /* pretty-print the Tree padded with position space characters */
    public abstract String pretty ( int position );

    private static Tree fix_tree ( Tree e ) {
        if (e instanceof Node) {
            Trees cs = Trees.nil;
            for ( Tree a: ((Node) e).children().tail() )
                cs = cs.append(fix_tree(a));
            return new Node(((VariableLeaf)(((Node) e).children().head())).value(),cs);
        } else return e;
    }

    /* the inverse of toString() */
    final public static synchronized Tree parse ( String s ) throws Exception {
        GenParser.scanner = new GenLex(new StringReader("#<"+s+">"));
        GenParser.out = new PrintStream(new ByteArrayOutputStream());
        new GenParser(GenParser.scanner).parse();
        return fix_tree(GenParser.parse_tree);
    }

    private static HashMap<String,String> names = new HashMap<String,String>(1000);

    public static String add ( String s ) {
        String ns = names.get(s);
        if (ns == null) {
            names.put(s,s);
            return s;
        } else return ns;
    }
}


text:
package org.supercsv.ext.io;

import java.io.IOException;
import java.io.Reader;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

import org.supercsv.cellprocessor.ift.CellProcessor;
import org.supercsv.exception.SuperCSVException;
import org.supercsv.exception.SuperCSVReflectionException;
import org.supercsv.ext.exception.SuperCsvNoMatchColumnSizeException;
import org.supercsv.ext.exception.SuperCsvRowException;
import org.supercsv.ext.localization.CsvExceptionConveter;
import org.supercsv.ext.localization.CsvMessage;
import org.supercsv.io.AbstractCsvReader;
import org.supercsv.io.ICsvBeanReader;
import org.supercsv.prefs.CsvPreference;
import org.supercsv.util.BeanInterfaceProxy;
import org.supercsv.util.CSVContext;
import org.supercsv.util.MethodCache;
import org.supercsv.util.Util;

/**
 *
 * <
 * @author T.TSUCHIE
 *
 */
public class ValidatableCsvBeanReader extends AbstractCsvReader implements ICsvBeanReader {

    /**
     * object used for storing intermediate result of a processing of cell processors and before put into maps/objects etc..
     * due to the typing, we cannot use super.line
     */
    protected List<? super Object> lineResult = new ArrayList<Object>();

    /** cache of methods for mapping from columns to fields */
    protected MethodCache cache = new MethodCache();

    /** exception converter */
    protected final CsvExceptionConveter exceptionConverter = createExceptionConverter();

    /** columns errors */
    private final List<CsvMessage> errors = new ArrayList<CsvMessage>();

    protected CsvExceptionConveter createExceptionConverter() {
        return new CsvExceptionConveter();
    }

    public boolean hasError() {
        return !errors.isEmpty();
    }

    public boolean hasNotError() {
        return errors.isEmpty();
    }

    public List<CsvMessage> getCsvErrors() {
        return errors;
    }

    /**
     *
     * @param reader
     * @param preferences
     */
    public ValidatableCsvBeanReader(final Reader reader, final CsvPreference preferences) {
        setPreferences(preferences);
        setInput(reader);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public <T> T read(final Class<T> clazz, final String... nameMapping) throws IOException, SuperCSVReflectionException {

        if( tokenizer.readStringList(super.line) ) {
            lineResult.clear();
            lineResult.addAll(super.line);
            return fillObject(clazz, nameMapping);
        }
        return null;
    }

    @Override
    public <T> T read(final Class<T> clazz, final String[] nameMapping, final CellProcessor... processors)
            throws IOException, SuperCSVReflectionException, SuperCSVException {

        if( tokenizer.readStringList(super.line) ) {
            try {
//            Util.processStringList(lineResult, super.line, processors, tokenizer.getLineNumber());
            processStringList(lineResult, super.line, processors, tokenizer.getLineNumber());
            return fillObject(clazz, nameMapping);
            } catch(SuperCsvRowException e) {
                throw e;
            } catch(SuperCSVException e) {
                errors.addAll(exceptionConverter.convertCsvError(e, getDefinedHeader()));
                throw e;
            }
        }
        return null; // EOF

    }

    protected <T> T fillObject(final Class<T> clazz, final String[] nameMapping) throws SuperCSVReflectionException {
        try {
            // create a proxy instance if an interface type is provided
            final T resultBean;
            if( clazz.isInterface() ) {
                resultBean = (T) new BeanInterfaceProxy().createProxy(clazz);
            } else {
                resultBean = clazz.newInstance();
            }
            // map results into an object by traversing the list of nameMapping and for each non-null,
            // map that name to an entry in the lineResult
            // map results to the setter methods
            for( int i = 0; i < nameMapping.length; i++ ) {
                // don't call a set-method in the bean, if there is no result to store
                if( nameMapping[i] == null ) {
                    continue;
                }
                try {
                    final Object fieldValue = lineResult.get(i);

                    if(nameMapping[i] == null || fieldValue == null) {
                        continue;
                    }

                    final Method setMethod = cache.getSetMethod(resultBean, nameMapping[i], fieldValue.getClass());
                    setMethod.invoke(resultBean, fieldValue);

                    // System.out.println(String.format("mapping[i]= %s, lR[%d] = %s val '%s'", nameMapping[i], i,
                    // lineResult
                    // .get(i).getClass(), lineResult.get(i)));
//                    cache.getSetMethod(resultBean, nameMapping[i], lineResult.get(i).getClass())//
//                        .invoke(resultBean, lineResult.get(i));
                }
                catch(final IllegalArgumentException e) {
                    throw new SuperCSVException("Method set" + nameMapping[i].substring(0, 1).toUpperCase()
                        + nameMapping[i].substring(1) + "() does not accept input \"" + lineResult.get(i) + "\" of type "
                        + lineResult.get(i).getClass().getName(), null, e);
                }
            }
            return resultBean;
        }
        catch(final InstantiationException e) {
            throw new SuperCSVReflectionException("Error while filling an object", e);
        }
        catch(final IllegalAccessException e) {
            throw new SuperCSVReflectionException("Error while filling an object", e);
        }
        catch(final InvocationTargetException e) {
            throw new SuperCSVReflectionException("Error while filling an object", e);
        }
    }

    /**
     *
     * @see Util#processStringList(List, List, CellProcessor[], int)
     * @param destination
     * @param source
     * @param processors
     * @param lineNo
     * @throws SuperCSVException
     */
    protected void processStringList(final List<? super Object> destination, final List<? extends Object> source,
        final CellProcessor[] processors, final int lineNo) throws SuperCSVException {
        final CSVContext context = new CSVContext();
        context.lineSource = source;
        context.lineNumber = lineNo;
        if( source.size() != processors.length ) {
//                throw new SuperCSVException("The value array (size " + source.size()
//                    + ")  must match the processors array (size " + processors.length + "):"
//                    + " You are probably reading a CSV line with a different number of columns"
//                    + " than the number of cellprocessors specified", context);
            throw new SuperCsvNoMatchColumnSizeException(source.size(), processors.length, context);
        }

        destination.clear();

        // cache row errors
        SuperCsvRowException columnError = new SuperCsvRowException(
                String.format("row (%d) has errros column", lineNo), context);

        for( int i = 0; i < source.size(); i++ ) {
            try {
                // if no processor, just add the string
                if( processors[i] == null ) {
                    destination.add(source.get(i));
                }
                else {
                    context.columnNumber = i;

//                    destination.add(processors[i].execute(source.get(i), context));
                    Object value = source.get(i);
                    if(value.toString().isEmpty()) {
                        destination.add(processors[i].execute(null, context));
                    } else {
                        destination.add(processors[i].execute(value, context)); // add
                    }
                }
            } catch(SuperCSVException e) {
                columnError.addError(e);
                errors.addAll(exceptionConverter.convertCsvError(e, getDefinedHeader()));
            }
        }

        if(columnError.isNotEmptyColumnErrors()) {
            throw columnError;
        }
    }

    /**
     * Get CSV Headers. if has not header, return null.
     * @return
     */
    public String[] getDefinedHeader() {
        return null;
    }

}


text:
--
-- Copyright (C) 2004 - 2014 Brian McCallister
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--

INSERT INTO something(id, name) VALUES (1, 'keith');; ;
INSERT INTO something(id, name) VALUES (2, 'sally;ann') ;INSERT INTO something(id, name) values (3, 'eric');
INSERT INTO something(id, name)
       SELECT id+10, name || ';junior' FROM something WHERE name='sally;ann';
;DELETE FROM something where id=1;UPDATE something set id=1 WHERE NAME ='eric';-- Add a separator
ALTER TABLE something ADD COLUMN separator VARCHAR(1) DEFAULT ';';
/*Call*/
CALL SECURE_RAND(16);

/*
   Function;
*/
CREATE ALIAS P_INT FOR "java.lang.Integer.parseInt";

INSERT INTO something(id, name) VALUES (P_INT('3'), 'bob')


text:
package jodd.vtor.constraint;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

class RangeConstraintTest extends ConstraintTestBase {

    @Test
    void testConstructor1() {
        RangeConstraint rangeConstraint = new RangeConstraint();
        assertEquals(0.0, rangeConstraint.getMin(), 0.01);
        assertEquals(0.0, rangeConstraint.getMax(), 0.01);
    }

    @Test
    void testConstructor2() {
        RangeConstraint rangeConstraint = new RangeConstraint(1.1, 10.1);
        assertEquals(1.1, rangeConstraint.getMin(), 0.01);
        assertEquals(10.1, rangeConstraint.getMax(), 0.01);
    }

    @Test
    void testSetMinMax() {
        RangeConstraint rangeConstraint = new RangeConstraint();
        rangeConstraint.setMin(1.1);
        rangeConstraint.setMax(10.1);
        assertEquals(1.1, rangeConstraint.getMin(), 0.01);
        assertEquals(10.1, rangeConstraint.getMax(), 0.01);
    }

    @Test
    void testConfigure() {
        RangeConstraint rangeConstraint = new RangeConstraint();
        Range annotation = mock(Range.class);
        when(annotation.min()).thenReturn(1.1);
        when(annotation.max()).thenReturn(10.1);

        rangeConstraint.configure(annotation);
        assertEquals(1.1, rangeConstraint.getMin(), 0.01);
        assertEquals(10.1, rangeConstraint.getMax(), 0.01);
    }

    @Test
    void testValidate_WithValIsNull() {
        assertTrue(RangeConstraint.validate(null, 1, 2));
    }

    @Test
    void testIsValid() {
        assertFalse(new RangeConstraint(1.1, 2.0).isValid(mockContext(), "1.0"));
        assertFalse(new RangeConstraint(1.1, 3.0).isValid(mockContext(), "3.1"));
        assertTrue(new RangeConstraint(2.0, 3.0).isValid(mockContext(), "2.8"));
        assertTrue(new RangeConstraint(2.1, 3.0).isValid(mockContext(), "2.1"));
        assertTrue(new RangeConstraint(1.0, 2.1).isValid(mockContext(), "2.1"));
    }
}


text:
var Nightmare = require('nightmare');
var Promise = require("bluebird");
let cheerio = require("cheerio");
let moment = require("moment");
var config = require('config');
var proxM = require('./getProxyIps')

let baseurl = 'http://www.szlcsc.com/so/global.html&global_search_keyword=';

//http://www.szlcsc.com/search/global.html&global_search_keyword=2222&global_current_catalog=&search_type=

module.exports.crawler = async function(q) {
    ////////////////////////////////////start module

    console.log('ickey =' + q.keyword);
    if (!(typeof q.keyword !== 'undefined' && q.keyword)) {
        console.log('q.keyword undefined...' + q.keyword);
        return undefined;
    }

    var data = await getByKeyword(q.keyword);
    // console.log('Final round ===crawler result =====' + JSON.stringify(data));
    return await data;
    ///////////////////////////////////before module
}

async function getOwnerRow($, html) {
    let sup = await $(html);
    let res = { steps: [], prices: [] };

    // console.log("parse roooooow data ====" + sup);
    //制造商零件编号  manufacturer part
    let partCardMpn = sup.find('span.part-card-mpn').text().trim().replace(/\s+/g, "").replace(/\r\n|\n/g, "");
    // let manufacturer = sup.find('td').eq(4).find('a').text().trim().replace(/\s+/g, "").replace(/\r\n|\n/g, "");

    res.partCardMpn = part;
    // res.manufacturer = pro_maf;

    return res;
}

//keyword example STPS20M100SG-TR
async function getAllSuppliers(html) {
    let res = { data: []};
    let $ = await cheerio.load(html);
    let owners = await $('table.serp-cards-table tbody.serp-part-card');

    if (!(typeof owners !== 'undefined' && owners)) {
        console.log('owners undefined...' + owners);
        return res;
    }

    //  console.log('get szlcsc table html ==' + owners);

    //get owners
    await Promise.all(owners.toArray().slice(2).map(async owner => {
        //get suppliers
        let row = await $(owner).find('tr').eq(1);

        // console.log('get szlcsc table row html ==' + row);

        //console.log('row html =' + row);
        let detail = await getOwnerRow($, row);
        // console.log("AAAffftterr........row =" + JSON.stringify(rdata));
        res.data.push(await detail);
    }));

    return res;
}

async function getByKeyword(keyword) {

    let result = { status: 1, keyword: keyword };
    //try{
    var startT = moment().unix();
    var durT = 0;
    console.log("Now start nightmare time is" + startT);

    var nightmare = {};
    //get proxy ip from daxiang.

    var proxyIp = await proxM.getProxyIps();

    if (!proxyIp.found) {
        console.log('get da xiang proxy ip error\n');
        proxyIp.proxyip = undefined;
    } else {
      console.log('get daxing proxy ip=' + proxyIp.proxyip.toString());
    }

    ///useing da xing proxy ip
    nightmare = Nightmare({
        switches: {
            // 'proxy-server': '10.8.11.240:8100' // set the proxy server here ...
            //'proxy-server': proxyIp // set the proxy server here ...
            'proxy-server': await proxyIp.proxyip // set the proxy server here ...
        },
        webPreferences: {
            images: false
        },
        // waitTimeout: 80000,
        show: false
    });

    //not using da xiang proxy ip
    // console.log("Debug mode not undefinedneed proxy.")
    // nightmare = Nightmare({ show: false });

    //http://www.szlcsc.com/search/catalog_603_1_0_1-0-0-3-1_0.html&queryBeginPrice=null&queryEndPrice=null
    // var url = baseurl + keyword + "&global_current_catalog=&search_type=";
    var url = {}
    if (Array.isArray(keyword)) {
        url = keyword[0]
    } else {
       url = keyword;
    }

    console.log("nightmare szcsclist XXX will goto url===.", url);

    await nightmare
        .useragent('Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36')
        .goto(url)
        //.wait('#self_product_list_div table#productTab tbody.product_tbody_cls')
        .wait('.Catalog_right_Details tbody.product_tbody_cls ')
        .wait(1000)
        .evaluate(function() {
            //return document.querySelector('#list1545 td.td-part-number a').innerText.replace(/[^\d\.]/g, '');
            //return document.querySelector('#list1545 tbody').innerText;
            return document.querySelector('.Catalog_right_Details').innerHTML;
        })
        .end()
        .then(async(html) => {
            // console.log('get html==== html =' + html);
            durT = moment().unix() - startT;
            console.log("get rows spendxxx" + durT);

            await getAllSuppliers(html)
                .then(data => {
                    durT = moment().unix() - startT;
                    console.log("nightmare request after parset Html Rows. spendxxx" + durT);
                    // console.log("FFFFFFFFFFFFinall after paserHtml content ===" + JSON.stringify(data));

                    //console.log("nightmare request spendxxx")
                    result.status = 0;
                    result.data = data.data;
                    return result;
                });

        }).catch((e) => {
            console.error(e);
        });

    //   }catch(e) {
    //       console.error(e);
    //       return {status: 1, keyword: keyword, data: undefined};
    //   }

    // console.log("====================after await get result=" + JSON.stringify(result));

    durT = moment().unix() - startT;
    console.log("nightmare request spendxxx" + durT);
    return await result;

}

//tool for map to json convert.
function strMapToObj(strMap) {
    let obj = Object.create(null);
    for (let [k, v] of strMap) {
        // We don't escape the key '__proto__'
        // which can cause problems on older engines
        obj[k] = v;
    }
    return obj;
}

function objToStrMap(obj) {
    let strMap = new Map();
    for (let k of Object.keys(obj)) {
        strMap.set(k, obj[k]);
    }
    return strMap;
}

function strMapToJson(strMap) {
    return JSON.stringify(strMapToObj(strMap));
}

function jsonToStrMap(jsonStr) {
    return objToStrMap(JSON.parse(jsonStr));
}


text:
/* jshint esnext: true */

import OpenStruct from "../open-struct";
import { KeyError } from "../key-error";

describe("OpenStruct", function(){
  var openStruct;
  beforeEach(function(){
    openStruct = OpenStruct({attribute: "value"});
  });

  it("should get an attribute", function(){
    expect(openStruct.attribute).toBe("value");
  });

  it("should be forbidden to assign an attribute", function(){
    openStruct.attribute = "new Value";
    expect(openStruct.attribute).toBe("value");
  });

  it("#fetch should return an attribute value", function(){
    expect(openStruct.fetch("attribute")).toBe("value");
  });

  it("#fetch should throw and error for missing attribute", function(){
    expect(function(){
      openStruct.fetch("other");
    }).toThrowError(KeyError, /other/);
  });

  it("#hasKey should return true for present attribute", function(){
    expect(openStruct.hasKey("attribute")).toBe(true);
  });

  it("#hasKey should return false for absent attribute", function(){
    expect(openStruct.hasKey("other")).toBe(false);
  });

  it("should have all the attributes as keys", function () {
    expect(Object.keys(openStruct)).toEqual(["attribute"]);
  });

  it("should be an instance of OpenStruct", function(){
    expect(openStruct instanceof OpenStruct).toBe(true);
  });

  it("should accept setting a new key", function(){
    var newOpenStruct = openStruct.set("other", "random");
    expect(newOpenStruct.other).toBe("random");
  });

  it("should be the same article if setting an attribute to the current value", function(){
    var newOpenStruct = openStruct.set("attribute", "value");
    expect(newOpenStruct).toBe(openStruct);
  });

  describe("after setting attribute to new value", function(){
    var newOpenStruct;
    beforeEach(function(){
      newOpenStruct = openStruct.set("attribute", "new Value");
    });

    it("should have the new value", function(){
      expect(newOpenStruct.attribute).toBe("new Value");
    });
    it("should leave the original openStruct unchanged", function(){
      expect(openStruct.attribute).toBe("value");
    });
  });

  describe("after merging with new values", function(){
    var newOpenStruct;
    beforeEach(function(){
      newOpenStruct = openStruct.merge({"attribute": "new Value"});
    });

    it("should have the new value", function(){
      expect(newOpenStruct.attribute).toBe("new Value");
    });
    it("should leave the original openStruct unchanged", function(){
      expect(openStruct.attribute).toBe("value");
    });
  });

  it("should be able to update a nonexistant key", function(){
    var newOpenStruct = openStruct.update("other", function(value){ return (value || "") + ":updated"; });
    expect(newOpenStruct.other).toBe(":updated");
  });

  describe("after updating attribute", function(){
    var newOpenStruct;
    beforeEach(function(){
      newOpenStruct = openStruct.update("attribute", function(value){ return value + ":updated"; });
    });

    it("should have the new value", function(){
      expect(newOpenStruct.attribute).toBe("value:updated");
    });
    it("should leave the original struct unchanged", function(){
      expect(openStruct.attribute).toBe("value");
    });
  });

});


text:
require 'rails_helper'

# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# generator.  If you are using any extension libraries to generate different
# controller code, this generated spec may or may not pass.
#
# It only uses APIs available in rails and/or rspec-rails.  There are a number
# of tools you can use to make these specs even more expressive, but we're
# sticking to rails and rspec-rails APIs to keep things simple and stable.
#
# Compared to earlier versions of this generator, there is very limited use of
# stubs and message expectations in this spec.  Stubs are only used when there
# is no simpler way to get a handle on the object needed for the example.
# Message expectations are only used when there is no simpler way to specify
# that an instance is receiving a specific message.

RSpec.describe EntitiesController, type: :controller do

#   # This should return the minimal set of attributes required to create a valid
#   # Entity. As you add validations to Entity, be sure to
#   # adjust the attributes here as well.
#   let(:valid_attributes) {
#     skip("Add a hash of attributes valid for your model")
#   }

#   let(:invalid_attributes) {
#     skip("Add a hash of attributes invalid for your model")
#   }

#   # This should return the minimal set of values that should be in the session
#   # in order to pass any filters (e.g. authentication) defined in
#   # EntitiesController. Be sure to keep this updated too.
#   let(:valid_session) { {} }

#   describe "GET #index" do
#     it "assigns all entities as @entities" do
#       entity = Entity.create! valid_attributes
#       get :index, params: {}, session: valid_session
#       expect(assigns(:entities)).to eq([entity])
#     end
#   end

#   describe "GET #show" do
#     it "assigns the requested entity as @entity" do
#       entity = Entity.create! valid_attributes
#       get :show, params: {id: entity.to_param}, session: valid_session
#       expect(assigns(:entity)).to eq(entity)
#     end
#   end

#   describe "GET #new" do
#     it "assigns a new entity as @entity" do
#       get :new, params: {}, session: valid_session
#       expect(assigns(:entity)).to be_a_new(Entity)
#     end
#   end

#   describe "GET #edit" do
#     it "assigns the requested entity as @entity" do
#       entity = Entity.create! valid_attributes
#       get :edit, params: {id: entity.to_param}, session: valid_session
#       expect(assigns(:entity)).to eq(entity)
#     end
#   end

#   describe "POST #create" do
#     context "with valid params" do
#       it "creates a new Entity" do
#         expect {
#           post :create, params: {entity: valid_attributes}, session: valid_session
#         }.to change(Entity, :count).by(1)
#       end

#       it "assigns a newly created entity as @entity" do
#         post :create, params: {entity: valid_attributes}, session: valid_session
#         expect(assigns(:entity)).to be_a(Entity)
#         expect(assigns(:entity)).to be_persisted
#       end

#       it "redirects to the created entity" do
#         post :create, params: {entity: valid_attributes}, session: valid_session
#         expect(response).to redirect_to(Entity.last)
#       end
#     end

#     context "with invalid params" do
#       it "assigns a newly created but unsaved entity as @entity" do
#         post :create, params: {entity: invalid_attributes}, session: valid_session
#         expect(assigns(:entity)).to be_a_new(Entity)
#       end

#       it "re-renders the 'new' template" do
#         post :create, params: {entity: invalid_attributes}, session: valid_session
#         expect(response).to render_template("new")
#       end
#     end
#   end

#   describe "PUT #update" do
#     context "with valid params" do
#       let(:new_attributes) {
#         skip("Add a hash of attributes valid for your model")
#       }

#       it "updates the requested entity" do
#         entity = Entity.create! valid_attributes
#         put :update, params: {id: entity.to_param, entity: new_attributes}, session: valid_session
#         entity.reload
#         skip("Add assertions for updated state")
#       end

#       it "assigns the requested entity as @entity" do
#         entity = Entity.create! valid_attributes
#         put :update, params: {id: entity.to_param, entity: valid_attributes}, session: valid_session
#         expect(assigns(:entity)).to eq(entity)
#       end

#       it "redirects to the entity" do
#         entity = Entity.create! valid_attributes
#         put :update, params: {id: entity.to_param, entity: valid_attributes}, session: valid_session
#         expect(response).to redirect_to(entity)
#       end
#     end

#     context "with invalid params" do
#       it "assigns the entity as @entity" do
#         entity = Entity.create! valid_attributes
#         put :update, params: {id: entity.to_param, entity: invalid_attributes}, session: valid_session
#         expect(assigns(:entity)).to eq(entity)
#       end

#       it "re-renders the 'edit' template" do
#         entity = Entity.create! valid_attributes
#         put :update, params: {id: entity.to_param, entity: invalid_attributes}, session: valid_session
#         expect(response).to render_template("edit")
#       end
#     end
#   end

#   describe "DELETE #destroy" do
#     it "destroys the requested entity" do
#       entity = Entity.create! valid_attributes
#       expect {
#         delete :destroy, params: {id: entity.to_param}, session: valid_session
#       }.to change(Entity, :count).by(-1)
#     end

#     it "redirects to the entities list" do
#       entity = Entity.create! valid_attributes
#       delete :destroy, params: {id: entity.to_param}, session: valid_session
#       expect(response).to redirect_to(entities_url)
#     end
#   end

end


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"
          type="text/css">
    <link href="assets/stylesheets/example.css" rel="stylesheet" type="text/css">

angular-google-maps example {{version}}

        <ui-gmap-google-map class="col-md-12"
                            center="map.center"
                            zoom="map.zoom"
                            dragging="map.dragging"
                            >

            <ui-gmap-window
                    idKey="map.southCarolina.id"
                    coords="map.southCarolina"
                    show="map.southCarolina.doShow"
                    >

                    Normal Standalone Window

                    using show to open close the window state.

            </ui-gmap-window>

            <ui-gmap-windows
                    models="map.californias"
                    coords="'self'" icon="'icon'"
                    fit="true"
                    show="'doShow'"
                    >

                    Normal Standalone Windows

                    using show to open close the window state.

            </ui-gmap-windows>

            <ui-gmap-marker
                    idKey="map.virginia.id"
                    coords="map.virginia"
                    >
                <ui-gmap-window>

                        Normal Standalone Window (No show state)

                </ui-gmap-window>
            </ui-gmap-marker>

            <ui-gmap-markers
                    models="map.texases"
                    coords="'self'">
                <ui-gmap-windows>

                        Windows Should Open via marker click. NO SHOW state.

                </ui-gmap-windows>
            </ui-gmap-markers>

            <ui-gmap-markers
                    models="map.canadas"
                    coords="'self'"
                    events="map.markerEvents">
            </ui-gmap-markers>

            <ui-gmap-window
                    idKey="map.openedCanadaWindows.id"
                    coords ='map.openedCanadaWindows'
                    show="map.openedCanadaWindows.doShow"
                    closeclick="map.openedCanadaWindows.closeClick">

                    Single Window popped into mem as needed.

                    {{map.openedCanadaWindows.latitude}}, {{map.openedCanadaWindows.longitude}}

            </ui-gmap-window>

        </ui-gmap-google-map>


text:
AudioPlayThread::AudioPlayThread()
{
}

AudioPlayThread::~AudioPlayThread()
{
}

void AudioPlayThread::Run()
{
}


text:
package influxql

import (
	"fmt"
)

var Language = &ParseTree{}

type ParseTree struct {
	Handlers map[Token]func(*Parser) (Statement, error)
	Tokens   map[Token]*ParseTree
	Keys     []string
}

// With passes the current parse tree to a function to allow nested functions.
func (t *ParseTree) With(fn func(*ParseTree)) {
	fn(t)
}

// Group groups together a set of related handlers with a common token prefix.
func (t *ParseTree) Group(tokens ...Token) *ParseTree {
	for _, tok := range tokens {
		// Look for the parse tree for this token.
		if subtree := t.Tokens[tok]; subtree != nil {
			t = subtree
			continue
		}

		// No subtree exists yet. Verify that we don't have a conflicting
		// statement.
		if _, conflict := t.Handlers[tok]; conflict {
			panic(fmt.Sprintf("conflict for token %s", tok))
		}

		// Create the new parse tree and register it inside of this one for
		// later reference.
		newT := &ParseTree{}
		if t.Tokens == nil {
			t.Tokens = make(map[Token]*ParseTree)
		}
		t.Tokens[tok] = newT
		t.Keys = append(t.Keys, tok.String())
		t = newT
	}
	return t
}

// Handle registers a handler to be invoked when seeing the given token.
func (t *ParseTree) Handle(tok Token, fn func(*Parser) (Statement, error)) {
	// Verify that there is no conflict for this token in this parse tree.
	if _, conflict := t.Tokens[tok]; conflict {
		panic(fmt.Sprintf("conflict for token %s", tok))
	}

	if _, conflict := t.Handlers[tok]; conflict {
		panic(fmt.Sprintf("conflict for token %s", tok))
	}

	if t.Handlers == nil {
		t.Handlers = make(map[Token]func(*Parser) (Statement, error))
	}
	t.Handlers[tok] = fn
	t.Keys = append(t.Keys, tok.String())
}

// Parse parses a statement using the language defined in the parse tree.
func (t *ParseTree) Parse(p *Parser) (Statement, error) {
	for {
		tok, pos, lit := p.ScanIgnoreWhitespace()
		if subtree := t.Tokens[tok]; subtree != nil {
			t = subtree
			continue
		}

		if stmt := t.Handlers[tok]; stmt != nil {
			return stmt(p)
		}

		// There were no registered handlers. Return the valid tokens in the order they were added.
		return nil, newParseError(tokstr(tok, lit), t.Keys, pos)
	}
}

func (t *ParseTree) Clone() *ParseTree {
	newT := &ParseTree{}
	if t.Handlers != nil {
		newT.Handlers = make(map[Token]func(*Parser) (Statement, error), len(t.Handlers))
		for tok, handler := range t.Handlers {
			newT.Handlers[tok] = handler
		}
	}

	if t.Tokens != nil {
		newT.Tokens = make(map[Token]*ParseTree, len(t.Tokens))
		for tok, subtree := range t.Tokens {
			newT.Tokens[tok] = subtree.Clone()
		}
	}
	return newT
}

func init() {
	Language.Handle(SELECT, func(p *Parser) (Statement, error) {
		return p.parseSelectStatement(targetNotRequired)
	})
	Language.Handle(DELETE, func(p *Parser) (Statement, error) {
		return p.parseDeleteStatement()
	})
	Language.Group(SHOW).With(func(show *ParseTree) {
		show.Group(CONTINUOUS).Handle(QUERIES, func(p *Parser) (Statement, error) {
			return p.parseShowContinuousQueriesStatement()
		})
		show.Handle(DATABASES, func(p *Parser) (Statement, error) {
			return p.parseShowDatabasesStatement()
		})
		show.Handle(DIAGNOSTICS, func(p *Parser) (Statement, error) {
			return p.parseShowDiagnosticsStatement()
		})
		show.Group(FIELD).With(func(field *ParseTree) {
			field.Handle(KEY, func(p *Parser) (Statement, error) {
				return p.parseShowFieldKeyCardinalityStatement()
			})
			field.Handle(KEYS, func(p *Parser) (Statement, error) {
				return p.parseShowFieldKeysStatement()
			})
		})
		show.Group(GRANTS).Handle(FOR, func(p *Parser) (Statement, error) {
			return p.parseGrantsForUserStatement()
		})
		show.Group(MEASUREMENT).Handle(EXACT, func(p *Parser) (Statement, error) {
			return p.parseShowMeasurementCardinalityStatement(true)
		})
		show.Group(MEASUREMENT).Handle(CARDINALITY, func(p *Parser) (Statement, error) {
			return p.parseShowMeasurementCardinalityStatement(false)
		})
		show.Handle(MEASUREMENTS, func(p *Parser) (Statement, error) {
			return p.parseShowMeasurementsStatement()
		})
		show.Handle(QUERIES, func(p *Parser) (Statement, error) {
			return p.parseShowQueriesStatement()
		})
		show.Group(RETENTION).Handle(POLICIES, func(p *Parser) (Statement, error) {
			return p.parseShowRetentionPoliciesStatement()
		})
		show.Handle(SERIES, func(p *Parser) (Statement, error) {
			return p.parseShowSeriesStatement()
		})
		show.Group(SHARD).Handle(GROUPS, func(p *Parser) (Statement, error) {
			return p.parseShowShardGroupsStatement()
		})
		show.Handle(SHARDS, func(p *Parser) (Statement, error) {
			return p.parseShowShardsStatement()
		})
		show.Handle(STATS, func(p *Parser) (Statement, error) {
			return p.parseShowStatsStatement()
		})
		show.Handle(SUBSCRIPTIONS, func(p *Parser) (Statement, error) {
			return p.parseShowSubscriptionsStatement()
		})
		show.Group(TAG).With(func(tag *ParseTree) {
			tag.Handle(KEY, func(p *Parser) (Statement, error) {
				return p.parseShowTagKeyCardinalityStatement()
			})
			tag.Handle(KEYS, func(p *Parser) (Statement, error) {
				return p.parseShowTagKeysStatement()
			})
			tag.Handle(VALUES, func(p *Parser) (Statement, error) {
				return p.parseShowTagValuesStatement()
			})
		})
		show.Handle(USERS, func(p *Parser) (Statement, error) {
			return p.parseShowUsersStatement()
		})
	})
	Language.Group(CREATE).With(func(create *ParseTree) {
		create.Group(CONTINUOUS).Handle(QUERY, func(p *Parser) (Statement, error) {
			return p.parseCreateContinuousQueryStatement()
		})
		create.Handle(DATABASE, func(p *Parser) (Statement, error) {
			return p.parseCreateDatabaseStatement()
		})
		create.Handle(USER, func(p *Parser) (Statement, error) {
			return p.parseCreateUserStatement()
		})
		create.Group(RETENTION).Handle(POLICY, func(p *Parser) (Statement, error) {
			return p.parseCreateRetentionPolicyStatement()
		})
		create.Handle(SUBSCRIPTION, func(p *Parser) (Statement, error) {
			return p.parseCreateSubscriptionStatement()
		})
	})
	Language.Group(DROP).With(func(drop *ParseTree) {
		drop.Group(CONTINUOUS).Handle(QUERY, func(p *Parser) (Statement, error) {
			return p.parseDropContinuousQueryStatement()
		})
		drop.Handle(DATABASE, func(p *Parser) (Statement, error) {
			return p.parseDropDatabaseStatement()
		})
		drop.Handle(MEASUREMENT, func(p *Parser) (Statement, error) {
			return p.parseDropMeasurementStatement()
		})
		drop.Group(RETENTION).Handle(POLICY, func(p *Parser) (Statement, error) {
			return p.parseDropRetentionPolicyStatement()
		})
		drop.Handle(SERIES, func(p *Parser) (Statement, error) {
			return p.parseDropSeriesStatement()
		})
		drop.Handle(SHARD, func(p *Parser) (Statement, error) {
			return p.parseDropShardStatement()
		})
		drop.Handle(SUBSCRIPTION, func(p *Parser) (Statement, error) {
			return p.parseDropSubscriptionStatement()
		})
		drop.Handle(USER, func(p *Parser) (Statement, error) {
			return p.parseDropUserStatement()
		})
	})
	Language.Handle(EXPLAIN, func(p *Parser) (Statement, error) {
		return p.parseExplainStatement()
	})
	Language.Handle(GRANT, func(p *Parser) (Statement, error) {
		return p.parseGrantStatement()
	})
	Language.Handle(REVOKE, func(p *Parser) (Statement, error) {
		return p.parseRevokeStatement()
	})
	Language.Group(ALTER, RETENTION).Handle(POLICY, func(p *Parser) (Statement, error) {
		return p.parseAlterRetentionPolicyStatement()
	})
	Language.Group(SET, PASSWORD).Handle(FOR, func(p *Parser) (Statement, error) {
		return p.parseSetPasswordUserStatement()
	})
	Language.Group(KILL).Handle(QUERY, func(p *Parser) (Statement, error) {
		return p.parseKillQueryStatement()
	})
}


text:
import mock

from oslo.config import cfg

from neutron.db import api as db
from neutron.extensions import providernet as provider
from neutron.openstack.common import importutils
from neutron.plugins.cisco.common import cisco_constants as const
from neutron.plugins.cisco.common import cisco_exceptions as cisco_exc
from neutron.plugins.cisco.db import network_db_v2 as cdb
from neutron.plugins.cisco.nexus import cisco_nexus_plugin_v2
from neutron.tests import base

NEXUS_IP_ADDRESS = '1.1.1.1'
HOSTNAME1 = 'testhost1'
HOSTNAME2 = 'testhost2'
HOSTNAME3 = 'testhost3'
INSTANCE1 = 'testvm1'
INSTANCE2 = 'testvm2'
INSTANCE3 = 'testvm3'
NEXUS_PORT1 = '1/10'
NEXUS_PORT2 = '1/20'
NEXUS_PC_IP_ADDRESS = '2.2.2.2'
NEXUS_PORTCHANNELS = 'portchannel:2'
PC_HOSTNAME = 'testpchost'
NEXUS_SSH_PORT = '22'
NEXUS_DRIVER = ('neutron.plugins.cisco.nexus.'
                'cisco_nexus_network_driver_v2.CiscoNEXUSDriver')
NET_ATTRS = [const.NET_ID,
             const.NET_NAME,
             const.NET_VLAN_NAME,
             const.NET_VLAN_ID]

class TestCiscoNexusPlugin(base.BaseTestCase):

    def setUp(self):
        """Set up function."""
        super(TestCiscoNexusPlugin, self).setUp()
        self.tenant_id = "test_tenant_cisco1"
        self.net_name = "test_network_cisco1"
        self.net_id = 7
        self.vlan_name = "q-" + str(self.net_id) + "vlan"
        self.vlan_id = 267
        self.second_tenant_id = "test_tenant_2"
        self.second_net_name = "test_network_cisco2"
        self.second_net_id = 5
        self.second_vlan_name = "q-" + str(self.second_net_id) + "vlan"
        self.second_vlan_id = 265
        self._pchostname = PC_HOSTNAME

        self.attachment1 = {
            const.TENANT_ID: self.tenant_id,
            const.INSTANCE_ID: INSTANCE1,
            const.HOST_NAME: HOSTNAME1,
        }
        self.attachment2 = {
            const.TENANT_ID: self.second_tenant_id,
            const.INSTANCE_ID: INSTANCE2,
            const.HOST_NAME: HOSTNAME2,
        }
        self.attachment3 = {
            const.TENANT_ID: self.second_tenant_id,
            const.INSTANCE_ID: INSTANCE3,
            const.HOST_NAME: HOSTNAME3,
        }
        self.network1 = {
            const.NET_ID: self.net_id,
            const.NET_NAME: self.net_name,
            const.NET_VLAN_NAME: self.vlan_name,
            const.NET_VLAN_ID: self.vlan_id,
        }
        self.network2 = {
            const.NET_ID: self.second_net_id,
            const.NET_NAME: self.second_net_name,
            const.NET_VLAN_NAME: self.second_vlan_name,
            const.NET_VLAN_ID: self.second_vlan_id,
        }
        self.network3 = {
            const.NET_ID: 8,
            const.NET_NAME: 'vpc_net',
            const.NET_VLAN_NAME: 'q-268',
            const.NET_VLAN_ID: '268',
        }
        self.providernet = {
            const.NET_ID: 9,
            const.NET_NAME: 'pnet1',
            const.NET_VLAN_NAME: 'p-300',
            const.NET_VLAN_ID: 300,
            provider.NETWORK_TYPE: 'vlan',
            provider.PHYSICAL_NETWORK: self.net_name + '200:299',
            provider.SEGMENTATION_ID: 300,
        }

        def new_nexus_init(self):
            self._client = importutils.import_object(NEXUS_DRIVER)
            self._client.nexus_switches = {
                (NEXUS_IP_ADDRESS, HOSTNAME1): NEXUS_PORT1,
                (NEXUS_IP_ADDRESS, 'ssh_port'): NEXUS_SSH_PORT,
                (NEXUS_IP_ADDRESS, HOSTNAME2): NEXUS_PORT2,
                (NEXUS_IP_ADDRESS, 'ssh_port'): NEXUS_SSH_PORT,
                (NEXUS_PC_IP_ADDRESS, 'ssh_port'): NEXUS_SSH_PORT,
            }
            self._nexus_switches = {
                ('NEXUS_SWITCH', NEXUS_IP_ADDRESS, HOSTNAME1): NEXUS_PORT1,
                ('NEXUS_SWITCH', NEXUS_IP_ADDRESS, HOSTNAME2): NEXUS_PORT2,
                ('NEXUS_SWITCH', NEXUS_PC_IP_ADDRESS, HOSTNAME3):
                NEXUS_PORTCHANNELS,
                ('NEXUS_SWITCH', NEXUS_PC_IP_ADDRESS, 'ssh_port'):
                NEXUS_SSH_PORT,
                ('NEXUS_SWITCH', NEXUS_IP_ADDRESS, HOSTNAME3):
                NEXUS_PORTCHANNELS,
                ('NEXUS_SWITCH', NEXUS_IP_ADDRESS, 'ssh_port'): NEXUS_SSH_PORT,
            }
            self._client.credentials = {
                NEXUS_IP_ADDRESS: {
                    'username': 'admin',
                    'password': 'pass1234'
                },
                NEXUS_PC_IP_ADDRESS: {
                    'username': 'admin',
                    'password': 'password'
                },
            }
            db.configure_db()

        self.addCleanup(db.clear_db)
        # Use a mock netconf client
        self.mock_ncclient = mock.Mock()
        self.patch_obj = mock.patch.dict('sys.modules',
                                         {'ncclient': self.mock_ncclient})
        self.patch_obj.start()

        with mock.patch.object(cisco_nexus_plugin_v2.NexusPlugin,
                               '__init__', new=new_nexus_init):
            self._cisco_nexus_plugin = cisco_nexus_plugin_v2.NexusPlugin()

        self.addCleanup(self.patch_obj.stop)

    def test_create_delete_networks(self):
        """Tests creation of two new Virtual Networks."""
        new_net_dict = self._cisco_nexus_plugin.create_network(
            self.network1, self.attachment1)
        for attr in NET_ATTRS:
            self.assertEqual(new_net_dict[attr], self.network1[attr])

        expected_instance_id = self._cisco_nexus_plugin.delete_port(
            INSTANCE1, self.vlan_id)

        self.assertEqual(expected_instance_id, INSTANCE1)

        new_net_dict = self._cisco_nexus_plugin.create_network(
            self.network2, self.attachment1)
        for attr in NET_ATTRS:
            self.assertEqual(new_net_dict[attr], self.network2[attr])

        expected_instance_id = self._cisco_nexus_plugin.delete_port(
            INSTANCE1, self.second_vlan_id)

        self.assertEqual(expected_instance_id, INSTANCE1)

    def test_create_providernet(self):
        with mock.patch.object(cdb, 'is_provider_vlan',
                               return_value=True) as mock_db:
            new_net_dict = self._cisco_nexus_plugin.create_network(
                self.providernet, self.attachment1)
            mock_db.assert_called_once()
            for attr in NET_ATTRS:
                self.assertEqual(new_net_dict[attr], self.providernet[attr])

    def test_create_provider_vlan_network_cfg_auto_man(self):
        cfg.CONF.set_override('provider_vlan_auto_create', True, 'CISCO')
        cfg.CONF.set_override('provider_vlan_auto_trunk', False, 'CISCO')
        self.addCleanup(cfg.CONF.reset)
        with mock.patch.object(cdb, 'is_provider_vlan', return_value=True):
            new_net_dict = self._cisco_nexus_plugin.create_network(
                self.providernet, self.attachment1)
            for attr in NET_ATTRS:
                self.assertEqual(new_net_dict[attr], self.providernet[attr])

    def test_create_provider_vlan_network_cfg_man_auto(self):
        cfg.CONF.set_override('provider_vlan_auto_create', False, 'CISCO')
        cfg.CONF.set_override('provider_vlan_auto_trunk', True, 'CISCO')
        self.addCleanup(cfg.CONF.reset)
        with mock.patch.object(cdb, 'is_provider_vlan', return_value=True):
            new_net_dict = self._cisco_nexus_plugin.create_network(
                self.providernet, self.attachment1)
            for attr in NET_ATTRS:
                self.assertEqual(new_net_dict[attr], self.providernet[attr])

    def test_create_provider_vlan_network_cfg_man_man(self):
        cfg.CONF.set_override('provider_vlan_auto_create', False, 'CISCO')
        cfg.CONF.set_override('provider_vlan_auto_trunk', False, 'CISCO')
        self.addCleanup(cfg.CONF.reset)
        with mock.patch.object(cdb, 'is_provider_vlan', return_value=True):
            new_net_dict = self._cisco_nexus_plugin.create_network(
                self.providernet, self.attachment1)
            for attr in NET_ATTRS:
                self.assertEqual(new_net_dict[attr], self.providernet[attr])

    def test_create_delete_network_portchannel(self):
        """Tests creation of a network over a portchannel."""
        new_net_dict = self._cisco_nexus_plugin.create_network(
            self.network3, self.attachment3)
        self.assertEqual(new_net_dict[const.NET_ID],
                         self.network3[const.NET_ID])
        self.assertEqual(new_net_dict[const.NET_NAME],
                         self.network3[const.NET_NAME])
        self.assertEqual(new_net_dict[const.NET_VLAN_NAME],
                         self.network3[const.NET_VLAN_NAME])
        self.assertEqual(new_net_dict[const.NET_VLAN_ID],
                         self.network3[const.NET_VLAN_ID])

        self._cisco_nexus_plugin.delete_port(
            INSTANCE3, self.network3[const.NET_VLAN_ID]
        )

    def test_nexus_add_remove_router_interface(self):
        """Tests addition of a router interface."""
        vlan_name = self.vlan_name
        vlan_id = self.vlan_id
        gateway_ip = '10.0.0.1/24'
        router_id = '00000R1'
        subnet_id = '00001'

        result = self._cisco_nexus_plugin.add_router_interface(vlan_name,
                                                               vlan_id,
                                                               subnet_id,
                                                               gateway_ip,
                                                               router_id)
        self.assertTrue(result)
        result = self._cisco_nexus_plugin.remove_router_interface(vlan_id,
                                                                  router_id)
        self.assertEqual(result, router_id)

    def test_nexus_add_router_interface_fail(self):
        """Tests deletion of a router interface."""
        vlan_name = self.vlan_name
        vlan_id = self.vlan_id
        gateway_ip = '10.0.0.1/24'
        router_id = '00000R1'
        subnet_id = '00001'

        self._cisco_nexus_plugin.add_router_interface(vlan_name,
                                                      vlan_id,
                                                      subnet_id,
                                                      gateway_ip,
                                                      router_id)
        try:
            self.assertRaises(
                cisco_exc.SubnetInterfacePresent,
                self._cisco_nexus_plugin.add_router_interface,
                vlan_name, vlan_id, subnet_id, gateway_ip, router_id)
        finally:
            self._cisco_nexus_plugin.remove_router_interface(vlan_id,
                                                             router_id)

    def test_nexus_add_port_after_router_interface(self):
        """Tests creating a port after a router interface.

        Test creating a port after an SVI router interface has
        been created. Only a trunk call should be invoked and the
        plugin should not attempt to recreate the vlan.
        """
        vlan_name = self.vlan_name
        vlan_id = self.vlan_id
        gateway_ip = '10.0.0.1/24'
        router_id = '00000R1'
        subnet_id = '00001'

        self._cisco_nexus_plugin.add_router_interface(vlan_name,
                                                      vlan_id,
                                                      subnet_id,
                                                      gateway_ip,
                                                      router_id)
        # Create a network on the switch
        self._cisco_nexus_plugin.create_network(
            self.network1, self.attachment1)

        # Grab a list of all mock calls from ncclient
        last_cfgs = (self.mock_ncclient.manager.connect().
                     edit_config.mock_calls)

        # The last ncclient call should be for trunking and the second
        # to last call should be creating the SVI interface
        last_cfg = last_cfgs[-1][2]['config']
        self.assertIn('allowed', last_cfg)

        slast_cfg = last_cfgs[-2][2]['config']
        self.assertIn('10.0.0.1/24', slast_cfg)


text:
namespace QFramework
{
    using System;

    public enum BinaryHeapBuildMode
    {
        kNLog = 1,
        kN = 2,
    }

    public enum BinaryHeapSortMode
    {
        kMin = 0,
        kMax = 1,
    }

    //优先队列&二叉堆
    public class BinaryHeap<T> where T : IBinaryHeapElement
    {
        protected T[] mArray;

        protected float mGrowthFactor = 1.6f;
        protected int mLastChildIndex; //最后子节点的位置
        protected BinaryHeapSortMode mSortMode;

        public BinaryHeap(int minSize, BinaryHeapSortMode sortMode)
        {
            mSortMode = sortMode;
            mArray = new T[minSize];
            mLastChildIndex = 0;
        }

        public BinaryHeap(T[] dataArray, BinaryHeapSortMode sortMode)
        {
            mSortMode = sortMode;
            int minSize = 10;
            if (dataArray != null)
            {
                minSize = dataArray.Length + 1;
            }

            mArray = new T[minSize];
            mLastChildIndex = 0;
            Insert(dataArray, BinaryHeapBuildMode.kN);
        }

        #region 公开方法

        #region 清空

        public void Clear()
        {
            mArray = new T[10];
            mLastChildIndex = 0;
        }

        #endregion

        #region 插入

        public void Insert(T[] dataArray, BinaryHeapBuildMode buildMode)
        {
            if (dataArray == null)
            {
                throw new NullReferenceException("BinaryHeap Not Support Insert Null Object");
            }

            int totalLength = mLastChildIndex + dataArray.Length + 1;
            if (mArray.Length < totalLength)
            {
                ResizeArray(totalLength);
            }

            if (buildMode == BinaryHeapBuildMode.kNLog)
            {
                //方式1:直接添加,每次添加都会上浮
                for (int i = 0; i < dataArray.Length; ++i)
                {
                    Insert(dataArray[i]);
                }
            }
            else
            {
                //数量比较大的情况下会快一些
                //方式2:先添加完,然后排序
                for (int i = 0; i < dataArray.Length; ++i)
                {
                    mArray[++mLastChildIndex] = dataArray[i];
                }

                SortAsCurrentMode();
            }
        }

        public void Insert(T element)
        {
            if (element == null)
            {
                throw new NullReferenceException("BinaryHeap Not Support Insert Null Object");
            }

            int index = ++mLastChildIndex;

            if (index == mArray.Length)
            {
                ResizeArray();
            }

            mArray[index] = element;

            ProcolateUp(index);
        }

        #endregion

        #region 弹出

        public T Pop()
        {
            if (mLastChildIndex < 1)
            {
                return default(T);
            }

            T result = mArray[1];
            mArray[1] = mArray[mLastChildIndex--];
            ProcolateDown(1);
            return result;
        }

        public T Top()
        {
            if (mLastChildIndex < 1)
            {
                return default(T);
            }

            return mArray[1];
        }

        #endregion

        #region 重新排序

        public void Sort(BinaryHeapSortMode sortMode)
        {
            if (mSortMode == sortMode)
            {
                return;
            }
            mSortMode = sortMode;
            SortAsCurrentMode();
        }

        public void RebuildAtIndex(int index)
        {
            if (index > mLastChildIndex)
            {
                return;
            }

            //1.首先找父节点,是否比父节点小,如果满足则上浮,不满足下沉
            var element = mArray[index];

            int parentIndex = index >> 1;
            if (parentIndex > 0)
            {
                if (mSortMode == BinaryHeapSortMode.kMin)
                {
                    if (element.SortScore < mArray[parentIndex].SortScore)
                    {
                        ProcolateUp(index);
                    }
                    else
                    {
                        ProcolateDown(index);
                    }
                }
                else
                {
                    if (element.SortScore > mArray[parentIndex].SortScore)
                    {
                        ProcolateUp(index);
                    }
                    else
                    {
                        ProcolateDown(index);
                    }
                }
            }
            else
            {
                ProcolateDown(index);
            }
        }

        private void SortAsCurrentMode()
        {
            int startChild = mLastChildIndex >> 1;
            for (int i = startChild; i > 0; --i)
            {
                ProcolateDown(i);
            }
        }

        #endregion

        #region 指定位置删除

        public void RemoveAt(int index)
        {
            if (index > mLastChildIndex || index < 1)
            {
                return;
            }

            if (index == mLastChildIndex)
            {
                --mLastChildIndex;
                mArray[index] = default(T);
                return;
            }

            mArray[index] = mArray[mLastChildIndex--];
            mArray[index].HeapIndex = index;
            RebuildAtIndex(index);
        }

        #endregion

        #region 索引查找

        //这个索引和大小排序之间没有任何关系
        public T GetElement(int index)
        {
            if (index > mLastChildIndex)
            {
                return default(T);
            }
            return mArray[index];
        }

        #endregion

        #region 判定辅助

        public bool HasValue()
        {
            return mLastChildIndex > 0;
        }

        #endregion

        #region 内部方法

        protected void ResizeArray(int newSize = -1)
        {
            if (newSize < 0)
            {
                newSize = System.Math.Max(mArray.Length + 4, (int) System.Math.Round(mArray.Length * mGrowthFactor));
            }

            if (newSize > 1 << 30)
            {
                throw new System.Exception(
                    "Binary Heap Size really large (2^18). A heap size this large is probably the cause of pathfinding running in an infinite loop. " +
                    "\nRemove this check (in BinaryHeap.cs) if you are sure that it is not caused by a bug");
            }

            T[] tmp = new T[newSize];
            for (int i = 0; i < mArray.Length; i++)
            {
                tmp[i] = mArray[i];
            }

            mArray = tmp;
        }

        //上浮:空穴思想
        protected void ProcolateUp(int index)
        {
            var element = mArray[index];
            if (element == null)
            {
                return;
            }

            float sortScore = element.SortScore;

            int parentIndex = index >> 1;

            if (mSortMode == BinaryHeapSortMode.kMin)
            {
                while (parentIndex >= 1 && sortScore < mArray[parentIndex].SortScore)
                {
                    mArray[index] = mArray[parentIndex];
                    mArray[index].HeapIndex = index;
                    index = parentIndex;
                    parentIndex = index >> 1;
                }
            }
            else
            {
                while (parentIndex >= 1 && sortScore > mArray[parentIndex].SortScore)
                {
                    mArray[index] = mArray[parentIndex];
                    mArray[index].HeapIndex = index;
                    index = parentIndex;
                    parentIndex = index >> 1;
                }
            }
            mArray[index] = element;
            mArray[index].HeapIndex = index;
        }

        protected void ProcolateDown(int index)
        {
            var element = mArray[index];
            if (element == null)
            {
                return;
            }

            int childIndex = index << 1;

            if (mSortMode == BinaryHeapSortMode.kMin)
            {
                while (childIndex <= mLastChildIndex)
                {
                    if (childIndex != mLastChildIndex)
                    {
                        if (mArray[childIndex + 1].SortScore < mArray[childIndex].SortScore)
                        {
                            childIndex = childIndex + 1;
                        }
                    }

                    if (mArray[childIndex].SortScore < element.SortScore)
                    {
                        mArray[index] = mArray[childIndex];
                        mArray[index].HeapIndex = index;
                    }
                    else
                    {
                        break;
                    }

                    index = childIndex;
                    childIndex = index << 1;
                }
            }
            else
            {
                while (childIndex <= mLastChildIndex)
                {
                    if (childIndex != mLastChildIndex)
                    {
                        if (mArray[childIndex + 1].SortScore > mArray[childIndex].SortScore)
                        {
                            childIndex = childIndex + 1;
                        }
                    }

                    if (mArray[childIndex].SortScore > element.SortScore)
                    {
                        mArray[index] = mArray[childIndex];
                        mArray[index].HeapIndex = index;
                    }
                    else
                    {
                        break;
                    }

                    index = childIndex;
                    childIndex = index << 1;
                }
            }

            mArray[index] = element;
            mArray[index].HeapIndex = index;
        }
        #endregion
        #endregion
    }
}