text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace OnLine.Pages {

    public partial class createPotential {

        /// <summary>
        /// form1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlForm form1;

        /// <summary>
        /// Panel2 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel Panel2;

        /// <summary>
        /// ScriptManager1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.ScriptManager ScriptManager1;

        /// <summary>
        /// Panel_Prod_Service_Det control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel Panel_Prod_Service_Det;

        /// <summary>
        /// UpdatePanel1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UpdatePanel UpdatePanel1;

        /// <summary>
        /// Panel3 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel Panel3;

        /// <summary>
        /// DropDownList_Level1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Level1;

        /// <summary>
        /// DropDownList_Level2 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Level2;

        /// <summary>
        /// DropDownList_Level3 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Level3;

        /// <summary>
        /// Buttin_Show_Spec_List control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Button Buttin_Show_Spec_List;

        /// <summary>
        /// Label_Extra_Spec control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label_Extra_Spec;

        /// <summary>
        /// TextBox_Spec control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_Spec;

        /// <summary>
        /// Label_Extra_Spec_upload control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label_Extra_Spec_upload;

        /// <summary>
        /// FileUpload_Extra_Spec control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.FileUpload FileUpload_Extra_Spec;

        /// <summary>
        /// GridView1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.GridView GridView1;

        /// <summary>
        /// UpdatePanel4 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UpdatePanel UpdatePanel4;

        /// <summary>
        /// Panel_Prod_Srv_Qnty control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel Panel_Prod_Srv_Qnty;

        /// <summary>
        /// TextBox_Prod_Qnty_From control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_Prod_Qnty_From;

        /// <summary>
        /// RequiredFieldValidator_Qty_From control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator_Qty_From;

        /// <summary>
        /// RegularExpressionValidator1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator1;

        /// <summary>
        /// TextBox_Prod_Qnty_To control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_Prod_Qnty_To;

        /// <summary>
        /// RequiredFieldValidator_Qty_To control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator_Qty_To;

        /// <summary>
        /// RegularExpressionValidator2 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator2;

        /// <summary>
        /// DropDownList_Unit_Of_Msrmnt control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Unit_Of_Msrmnt;

        /// <summary>
        /// UpdatePanel2 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UpdatePanel UpdatePanel2;

        /// <summary>
        /// Panel_Price_Range control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel Panel_Price_Range;

        /// <summary>
        /// TextBox_Price_Range_From control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_Price_Range_From;

        /// <summary>
        /// RequiredFieldValidator_Price_From control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator_Price_From;

        /// <summary>
        /// RegularExpressionValidator3 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator3;

        /// <summary>
        /// TextBox_Price_Range_To control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_Price_Range_To;

        /// <summary>
        /// RequiredFieldValidator_Price_To control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator_Price_To;

        /// <summary>
        /// RegularExpressionValidator4 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator4;

        /// <summary>
        /// DropDownList_Curr control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Curr;

        /// <summary>
        /// Label_Per_Unit control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label_Per_Unit;

        /// <summary>
        /// UpdatePanel5 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UpdatePanel UpdatePanel5;

        /// <summary>
        /// Panel_Quote control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel Panel_Quote;

        /// <summary>
        /// TextBox_Prod_Name control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_Prod_Name;

        /// <summary>
        /// DropDownList_Prod_List control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Prod_List;

        /// <summary>
        /// TextBox_Quote_Amnt control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_Quote_Amnt;

        /// <summary>
        /// RegularExpressionValidator5 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator5;

        /// <summary>
        /// UpdatePanel3 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UpdatePanel UpdatePanel3;

        /// <summary>
        /// Panel_Location control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel Panel_Location;

        /// <summary>
        /// DropDownList_Country control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Country;

        /// <summary>
        /// DropDownList_State control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_State;

        /// <summary>
        /// DropDownList_City control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_City;

        /// <summary>
        /// DropDownList_Locality control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Locality;

        /// <summary>
        /// TextBox_Street_Name control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_Street_Name;

        /// <summary>
        /// UpdatePanel6 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UpdatePanel UpdatePanel6;

        /// <summary>
        /// Panel_Contacts control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel Panel_Contacts;

        /// <summary>
        /// DropDownList_Contacts control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Contacts;

        /// <summary>
        /// LinkButton1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.LinkButton LinkButton1;

        /// <summary>
        /// Button_Refresh control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Button Button_Refresh;

        /// <summary>
        /// Panel_Pot_State control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel Panel_Pot_State;

        /// <summary>
        /// DropDownList_Pot_Stage control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Pot_Stage;

        /// <summary>
        /// DropDownList_Pot_State control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Pot_State;

        /// <summary>
        /// Label6 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label6;

        /// <summary>
        /// TextBox_Within_Date control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_Within_Date;

        /// <summary>
        /// TextBox_Within_Date_CalendarExtender control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::AjaxControlToolkit.CalendarExtender TextBox_Within_Date_CalendarExtender;

        /// <summary>
        /// ImageButton1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.ImageButton ImageButton1;

        /// <summary>
        /// Label_Fwp_Date control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label_Fwp_Date;

        /// <summary>
        /// TextBox_Fwp_Date control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_Fwp_Date;

        /// <summary>
        /// TextBox_Fwp_Date_CalendarExtender control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::AjaxControlToolkit.CalendarExtender TextBox_Fwp_Date_CalendarExtender;

        /// <summary>
        /// ImageButton2 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.ImageButton ImageButton2;

        /// <summary>
        /// DropDownList_Users control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList DropDownList_Users;

        /// <summary>
        /// TextBox_Reqr_Name control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_Reqr_Name;

        /// <summary>
        /// RequiredFieldValidator_Pot_Name control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator_Pot_Name;

        /// <summary>
        /// Panel_Terms_Conds control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel Panel_Terms_Conds;

        /// <summary>
        /// FileUpload1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.FileUpload FileUpload1;

        /// <summary>
        /// TextBox_TnC control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox TextBox_TnC;

        /// <summary>
        /// Button_Submit_Pot control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Button Button_Submit_Pot;

        /// <summary>
        /// Button_Submit_Extra_Prd_Srv control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Button Button_Submit_Extra_Prd_Srv;

        /// <summary>
        /// Button_Submit_Next control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Button Button_Submit_Next;

        /// <summary>
        /// Label_Status control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label_Status;

        /// <summary>
        /// Label_Selected_List control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label_Selected_List;
    }
}


text:
/**
 * @author Markus Kroetzsch, Aug 8, 2011
 */
package org.semanticweb.elk.owl.interfaces;

import org.semanticweb.elk.owl.visitors.ElkObjectHasValueVisitor;

/**
 * Corresponds to an <a href=
 * "http://www.w3.org/TR/owl2-syntax/#Individual_Value_Restriction">Individual
 * Value Restriction for Object Properties<a> in the OWL 2 specification.
 *
 * @author Markus Kroetzsch
 */
public interface ElkObjectHasValue
		extends
		ElkPropertyRestrictionQualified<ElkObjectPropertyExpression, ElkIndividual> {

	/**
	 * Accept an {@link ElkObjectHasValueVisitor}.
	 *
	 * @param visitor
	 *            the visitor that can work with this object type
	 * @return the output of the visitor
	 */
	public <O> O accept(ElkObjectHasValueVisitor<O> visitor);

}

redpajama_set_name: RedPajamaGithub


text:
package xyz.hyperreal.lia

import java.math.{RoundingMode, MathContext}
import java.{lang => boxed}

import collection.mutable.HashMap

import xyz.hyperreal.numbers._

import Util._

class LIA( implicit var bdmath: BigDecimalMath )
{
	protected val operations = new HashMap[Symbol, FunctionMap]

	protected val specials = new HashMap[(String, String), String]

	protected def special( s: ((String, String), String) ) = {
		specials(s._1) = s._2
		specials((s._1._2, s._1._1)) = s._2
	}

	def bisqrt( n: BigInt ) =
	{
	val dr = BigDecimalMath.sqrt( bigDecimal(n) )
	val ir = dr.toBigInt

		if (ir*ir == n)
			Left( ir )
		else
			Right( dr )
	}

	def bigDecimal( n: Int ): BigDecimal = BigDecimal( n, bdmath.mc )

	def bigDecimal( n: Double ): BigDecimal = BigDecimal( n, bdmath.mc )

	def bigDecimal( r: Rational ): BigDecimal = r.decimalValue( bdmath.mc )
// 	{
// 	val quo = bigDecimal( r.n )/bigDecimal( r.d )
//
// 	  if (quo.precision > mc.getPrecision) quo.round( mc ) else quo
// 	}

	def bigDecimal( n: BigInt ): BigDecimal =
	{
	val len = digits( n )
	val m = if (len >= bdmath.mc.getPrecision) mathContext(len + 5) else bdmath.mc

	  BigDecimal( n, m )
	}

	def decimal( s: String ) =
	{
	val res = BigDecimal( s, bdmath.mc )

		if (res.isExactDouble)//isValidDouble)
			res.toDouble
		else
			res
	}

	def toBigDecimal( a: Number ): BigDecimal =
		a match
		{
			case bd: BigDecimal => bd
			case i: boxed.Integer => bigDecimal( i )
			case d: boxed.Double => bigDecimal( d )
			case r: Rational => bigDecimal( r )
			case bi: BigInt => bigDecimal( bi )
			case _ => sys.error( "can't convert from " + a )
		}

	def toComplexDouble( a: Number ): ComplexDouble =
		a match
		{
			case cd: ComplexDouble => cd
			case i: boxed.Integer => ComplexDouble( i.doubleValue )
			case d: boxed.Double => ComplexDouble( d )
			case r: Rational => ComplexDouble( r.doubleValue )
			case bi: BigInt => ComplexDouble( bi.doubleValue )
			case cbi: ComplexBigInt => ComplexDouble( cbi.re.doubleValue, cbi.im.doubleValue )
			case _ => sys.error( "can't convert from " + a )
		}

	def toComplexBigDecimal( a: Number ): ComplexBigDecimal =
		a match
		{
			case cd: ComplexBigDecimal => cd
			case bd: BigDecimal => new ComplexBigDecimal( bd, 0 )
			case i: boxed.Integer => new ComplexBigDecimal( i.asInstanceOf[Int], 0 )
			case d: boxed.Double => new ComplexBigDecimal( d.asInstanceOf[Double], 0 )
			case Rational( n, d ) =>
				val quo = toBigDecimal( n )/toBigDecimal( d )

				new ComplexBigDecimal( if (quo.precision > bdmath.mc.getPrecision) quo.round( bdmath.mc ) else quo, 0 )
			case bi: BigInt =>
				val len = digits( bi )
				val m = if (len >= bdmath.mc.getPrecision) mathContext(len + 5) else bdmath.mc

				new ComplexBigDecimal( BigDecimal(bi, m), 0 )
			case _ => sys.error( "can't convert from " + a )
		}

	def toComplexBigInt( a: Number ): ComplexBigInt =
		a match
		{
			case bi: BigInt => ComplexBigInt( bi )
			case i: boxed.Integer => ComplexBigInt( toBigInt(i) )
			case cbi: ComplexBigInt => cbi
			case _ => sys.error( "can't convert from " + a )
		}

	def toComplexRational( a: Number ): ComplexRational =
		a match
		{
			case bi: BigInt => ComplexRational( toRational(bi) )
			case i: boxed.Integer => ComplexRational( toRational(i) )
			case r: Rational => ComplexRational( r )
			case cbi: ComplexBigInt => ComplexRational( toRational(cbi.re), toRational(cbi.im) )
			case cr: ComplexRational => cr
			case _ => sys.error( "can't convert from " + a )
		}

	def toBigInt( a: Number ): BigInt =
		a match
		{
			case bi: BigInt => bi
			case i: boxed.Integer => BigInt( i )
			case _ => sys.error( "can't convert from " + a )
		}

	def toRational( a: Number ) =
		a match
		{
			case r: Rational => r
			case bi: BigInt => Rational( bi )
			case i: boxed.Integer => Rational( i )
			case _ => sys.error( "can't convert from " + a )
		}

	def maybeDemote( n: BigInt ): Number =
	  if (n.isValidInt)
	    n.toInt.asInstanceOf[Number]
	  else
	    n

	def maybeDemote( n: ComplexBigInt ): Number =
		if (n.im == 0)
			maybeDemote( n.re )
		else
			n

	def maybeDemote( n: ComplexRational ): Number =
		if (n.im.isZero)
			n.re.maybeDemote
		else
			n

	def maybePromote( n: Long ) =
		if (n.isValidInt)
			n.toInt.asInstanceOf[Number]
		else
			BigInt( n )

	protected def binary[A, B]( args: Seq[AnyRef], f: (A, B) => Any ) = f( args(0).asInstanceOf[A], args(1).asInstanceOf[B] ).asInstanceOf[AnyRef]

	protected def unary[A]( args: Seq[AnyRef], f: A => Any ) = f( args(0).asInstanceOf[A] ).asInstanceOf[AnyRef]

	protected def identity[A]( args: Seq[AnyRef] ) = args(0).asInstanceOf[A].asInstanceOf[AnyRef]

	protected def binary[N <: Number]( types: (String, (N, N) => Any)* ): Seq[(List[String], Seq[AnyRef] => AnyRef)] =
	{
	val ts = types map (_._1) zipWithIndex
	val fs = types map (_._2)

		def index( i: (String, Int), j: (String, Int) ) =
			specials.get( (i._1, j._1) ) match
			{
				case None => i._2 max j._2
				case Some( t ) => ts.find( _._1 == t ).get._2
			}

		for (i <- ts; j <- ts)
			yield
				List( i._1, j._1 ) -> (binary( (_: Seq[AnyRef]), fs(index(i, j)) ))
	}

	protected def unary[N <: Number]( types: (String, N => Any)* ): Seq[(List[String], Seq[AnyRef] => AnyRef)] =
		for ((t, f) <- types)
			yield
				List( t ) -> (unary( (_: Seq[AnyRef]), f ))

	protected def operation( sym: Symbol, maps: Seq[(List[String], Seq[AnyRef] => AnyRef)] ) =
	{
		def classForName( name: String ) =
			try
			{
				Class.forName( name )
			}
			catch
			{
				case _: Exception =>
					try
					{
						Class.forName( "java.lang." + name )
					}
					catch
					{
						case _: Exception =>
							try
							{
								Class.forName( "scala.math." + name )
							}
							catch
							{
								case _: Exception => sys.error( "number type unknown: " + name )
							}
					}
			}

		operations(sym) = Map( maps map (op => (op._1 map (classForName(_)), op._2)): _* )
	}

	def round( a: BigDecimal ) = a.setScale( 0, BigDecimal.RoundingMode.HALF_EVEN )

	def nearly( a: BigDecimal, b: BigDecimal ) = (a - b).abs < 1e-30

	def nearlyZero( a: BigDecimal ) = a.abs < 1e-30

	protected def mathContext( p: Int ) = new MathContext( p, RoundingMode.HALF_EVEN )

// 	def precision( p: Int )
// 	{
// 		require( p > 0, "precision is positive" )
// 		mc = mathContext( p )
// 	}

	def lookup( operation: Symbol ) = operations( operation )

	def apply( operation: Symbol, operands: Any* ) =
	{
		operations( operation )( operands map (_.getClass) )( operands.asInstanceOf[Seq[AnyRef]] )
	}

	def apply( operation: FunctionMap, operands: Any* ) =
	{
		operation( operands map (_.getClass) )( operands.asInstanceOf[Seq[AnyRef]] )
	}

	def predicate( operation: Symbol, operands: Any* ) = apply( operation, operands: _* ).asInstanceOf[Boolean]

	def predicate( operation: FunctionMap, operands: Any* ) = apply( operation, operands: _* ).asInstanceOf[Boolean]
}


text:
import os
import sys
import linecache
import time

class GroFile(object):

    def __init__(self, filename):

        self.filename=filename
        self.natoms=self.get_natoms()
        self.nlines_per_run=self.natoms+3
        self.nlines=self.get_nlines()
        self.nruns=self.get_nruns()

    def get_natoms(self):
        natoms=int(linecache.getline(self.filename, 2))
        return natoms

    def get_nlines(self):
        with open(self.filename, 'r') as file:
            nlines = sum(1 for line in file)
        print nlines
        return nlines

    def get_nruns(self):
        assert self.nlines%(self.nlines_per_run)==0, "number of lines in %s is not a multiple of natoms+3" %self.filename
        nruns=self.nlines/self.nlines_per_run
        return nruns


text:
package org.springframework.boot.build;

import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.plugins.JavaPlatformPlugin;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.publish.PublishingExtension;
import org.gradle.api.publish.maven.MavenPublication;
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin;
import org.gradle.api.tasks.bundling.Jar;

/**
 * A plugin applied to a project that should be deployed.
 *
 * @author Andy Wilkinson
 */
public class DeployedPlugin implements Plugin<Project> {

	/**
	 * Name of the task that generates the deployed pom file.
	 */
	public static final String GENERATE_POM_TASK_NAME = "generatePomFileForMavenPublication";

	@Override
	@SuppressWarnings("deprecation")
	public void apply(Project project) {
		project.getPlugins().apply(MavenPublishPlugin.class);
		project.getPlugins().apply(MavenRepositoryPlugin.class);
		PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
		MavenPublication mavenPublication = publishing.getPublications().create("maven", MavenPublication.class);
		project.afterEvaluate((evaluated) -> project.getPlugins().withType(JavaPlugin.class).all((javaPlugin) -> {
			if (((Jar) project.getTasks().getByName(JavaPlugin.JAR_TASK_NAME)).isEnabled()) {
				project.getComponents().matching((component) -> component.getName().equals("java"))
						.all(mavenPublication::from);
			}
		}));
		project.getPlugins().withType(JavaPlatformPlugin.class).all((javaPlugin) -> project.getComponents()
				.matching((component) -> component.getName().equals("javaPlatform")).all(mavenPublication::from));
	}

}


text:
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`

function msg
{
  local color=$1
  local message=$@
  echo "${color}$message in ${BASH_SOURCE[1]}.${reset}" >&2
}

warn() { msg $red $@; }
info() { msg $green $@; }

if ! [ -n "$IMAGE_NAME" ]; then
  warn "No IMAGE_NAME environment variable"
  exit -1
fi

DOCKER_REGISTRY="${DOCKER_REGISTRY:-{{default .Env.DOCKER_REGISTRY "hub.docker.com" -}} }"
# IMAGE_NAME="${IMAGE_NAME}"
# Looking at git isn't always correct to find current branch
# https://graysonkoonce.com/getting-the-current-branch-name-during-a-pull-request-in-travis-ci/
BUILD_BRANCH="${BUILD_BRANCH:-$(git rev-parse --abbrev-ref HEAD)}"
info "Build branch is $BUILD_BRANCH"

function tag_and_push() {
	local repo=$1
	local images=$2
	local tag=$3

	for i in $images; do
	  docker tag $i $repo/$i:$tag
	  docker push $repo/$i:$tag
	done
}

# If a build is non master, then we will only push
# if there is a tag on the branch that includes the branch name
# Orgininally I thoguht any tag, but then if there was a 0.1 on master
# before the branch, we'd still see it

ON_BRANCH=false
REMOTE_ID=""

# Grab the tag if it exists.
# If on master (head on build machiones) Always push to latest
if [ $BUILD_BRANCH = "master" ] || [ $BUILD_BRANCH = "HEAD"  ]; then
	REMOTE_ID=latest
else
  ON_BRANCH=true
	REMOTE_ID=$BUILD_BRANCH
fi
tag_and_push $DOCKER_REGISTRY "$IMAGE_NAME" $REMOTE_ID

# used for major version numbers for instance
# use only if this new commit has a tag
TAG=$(git describe --exact-match 2>/dev/null)

# We don't want branches overwriting versions like v.0.1
# so we'll only include tags if on master.  Branches should
# be short lived anyway
if [ -n "${TAG}" ] &&  [ "$ON_BRANCH" != true ] ; then
	tag_and_push $DOCKER_REGISTRY "$IMAGE_NAME" $TAG
fi
if [ -n "$BUILD_NUMBER" ]; then
	tag_and_push $DOCKER_REGISTRY "$IMAGE_NAME" ${REMOTE_ID}-${BUILD_NUMBER}
fi


text: SELECT rowid FROM email WHERE email MATCH 'susan mark'


text:
import java.util.function.Function;
import static java.util.function.Function.identity;

class FunctionExample {
  public static void main(String [] args) throws Exception {
    Function f = Function.identity();
  }
}


text:
#ifndef TCPKIT_LUA_H
#define TCPKIT_LUA_H

#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>

lua_State *lua_state_create(const char *file, char *err);
void lua_table_push_boolean(lua_State *state, const char *key, int bool);
void lua_table_push_int(lua_State *state, const char *key, long value);
void lua_table_push_string(lua_State *state, const char *key, char *value);
void lua_table_push_cstring(lua_State *state, const char *key, const char *value, int size);
void lua_need_gc(lua_State* state);
void lua_close(lua_State *state);
#endif


text:
using System;
using LightBDD.NUnit3.Implementation;
using NUnit.Framework;
using NUnit.Framework.Interfaces;

namespace LightBDD.NUnit3
{
    ///
    /// Attribute that should be applied to all test classes representing feature tests.
    /// It is required for running LightBDD tests with NUnit testing framework.
    ///
    [AttributeUsage(AttributeTargets.Class)]
    public class FeatureFixtureAttribute : Attribute, ITestAction
    {
        /// Executed before each test is run
        /// <param name="test">The test that is going to be run.</param>
        public void BeforeTest(ITest test)
        {
            TestContextProvider.Initialize(test.Method.MethodInfo, test.Arguments);
        }

        /// Executed after each test is run
        /// <param name="test">The test that has just been run.</param>
        public void AfterTest(ITest test)
        {
            TestContextProvider.Clear();
        }

        /// Provides the target for the action attribute
        /// <returns>The target for the action attribute</returns>
        public ActionTargets Targets => ActionTargets.Test;
    }
}