text:
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Compiler.Framework;

namespace Mosa.Platform.x86.Stages
{
	/// <summary>
	/// This stages converts generic x86 instructions to specific load/store-type instructions.
	/// This is a temporary stage until all the previous stages use the load/store-type instructions
	/// </summary>
	public sealed class ConversionPhaseStage : BaseTransformationStage
	{
		protected override void PopulateVisitationDictionary()
		{
			visitationDictionary[X86.Mov] = Mov;
			visitationDictionary[X86.Movsx] = Movsx;
			visitationDictionary[X86.Movzx] = Movzx;
			visitationDictionary[X86.Movsd] = Movsd;
			visitationDictionary[X86.Movss] = Movss;
			visitationDictionary[X86.Movups] = Movups;
			visitationDictionary[X86.Movaps] = Movaps;
		}

		#region Visitation Methods

		/// <summary>
		/// Visitation function for <see cref="IX86Visitor.Mov"/> instructions.
		/// </summary>
		/// <param name="context">The context.</param>
		public void Mov(Context context)
		{
			if (context.Result.IsCPURegister && context.Operand1.IsMemoryAddress)
			{
				context.SetInstruction(X86.MovLoad,

					//context.Size,
					context.Result,
					(context.Operand1.IsLabel || context.Operand1.IsSymbol || context.Operand1.IsField)
						? context.Operand1
						: Operand.CreateCPURegister(context.Operand1.Type, context.Operand1.EffectiveOffsetBase),
					Operand.CreateConstant(MethodCompiler.TypeSystem, (int)context.Operand1.Displacement)
				);
			}

			if (context.Result.IsMemoryAddress && (context.Operand1.IsCPURegister /*|| context.Operand1.IsConstant*/))
			{
				context.SetInstruction(X86.MovStore,

					//InstructionSize.Size32,
					null,
					(context.Result.IsLabel || context.Result.IsSymbol || context.Result.IsField)
						? context.Result
						: Operand.CreateCPURegister(context.Result.Type, context.Result.EffectiveOffsetBase),
					Operand.CreateConstant(MethodCompiler.TypeSystem, (int)context.Result.Displacement),
					context.Operand1
				);
			}
		}

		/// <summary>
		/// Visitation function for <see cref="IX86Visitor.Movzx"/> instructions.
		/// </summary>
		/// <param name="context">The context.</param>
		public void Movzx(Context context)
		{
			if (context.Result.IsCPURegister && context.Operand1.IsMemoryAddress)
			{
				context.SetInstruction(X86.MovzxLoad,
					context.Size,
					context.Result,
					(context.Operand1.IsLabel || context.Operand1.IsSymbol || context.Operand1.IsField)
						? context.Operand1
						: Operand.CreateCPURegister(context.Operand1.Type, context.Operand1.EffectiveOffsetBase),
					Operand.CreateConstant(MethodCompiler.TypeSystem, (int)context.Operand1.Displacement)
				);
			}
		}

		/// <summary>
		/// Visitation function for <see cref="IX86Visitor.Movsx"/> instructions.
		/// </summary>
		/// <param name="context">The context.</param>
		public void Movsx(Context context)
		{
			if (context.Result.IsCPURegister && context.Operand1.IsMemoryAddress)
			{
				context.SetInstruction(X86.MovsxLoad,
					context.Size,
					context.Result,
					(context.Operand1.IsLabel || context.Operand1.IsSymbol || context.Operand1.IsField)
						? context.Operand1
						: Operand.CreateCPURegister(context.Operand1.Type, context.Operand1.EffectiveOffsetBase),
					Operand.CreateConstant(MethodCompiler.TypeSystem, (int)context.Operand1.Displacement)
				);
			}
		}

		/// <summary>
		/// Visitation function for <see cref="IX86Visitor.Movsd"/> instructions.
		/// </summary>
		/// <param name="context">The context.</param>
		public void Movsd(Context context)
		{
			if (context.Result.IsCPURegister && context.Operand1.IsMemoryAddress)
			{
				context.SetInstruction(X86.MovsdLoad,
					context.Result,
					(context.Operand1.IsLabel || context.Operand1.IsSymbol || context.Operand1.IsField)
						? context.Operand1
						: Operand.CreateCPURegister(context.Operand1.Type, context.Operand1.EffectiveOffsetBase),
					Operand.CreateConstant(MethodCompiler.TypeSystem, (int)context.Operand1.Displacement)
				);
			}

			if (context.Result.IsMemoryAddress && (context.Operand1.IsCPURegister /*|| context.Operand1.IsConstant*/))
			{
				context.SetInstruction(X86.MovsdStore,
					null,
					(context.Result.IsLabel || context.Result.IsSymbol || context.Result.IsField)
						? context.Result
						: Operand.CreateCPURegister(context.Result.Type, context.Result.EffectiveOffsetBase),
					Operand.CreateConstant(MethodCompiler.TypeSystem, (int)context.Result.Displacement),
					context.Operand1
				);
			}
		}

		/// <summary>
		/// Visitation function for <see cref="IX86Visitor.Movss" /> instructions.
		/// </summary>
		/// <param name="context">The context.</param>
		public void Movss(Context context)
		{
			if (context.Result.IsCPURegister && context.Operand1.IsMemoryAddress)
			{
				context.SetInstruction(X86.MovssLoad,
					context.Result,
					(context.Operand1.IsLabel || context.Operand1.IsSymbol || context.Operand1.IsField)
						? context.Operand1
						: Operand.CreateCPURegister(context.Operand1.Type, context.Operand1.EffectiveOffsetBase),
					Operand.CreateConstant(MethodCompiler.TypeSystem, (int)context.Operand1.Displacement)
				);
			}

			if (context.Result.IsMemoryAddress && (context.Operand1.IsCPURegister /*|| context.Operand1.IsConstant*/))
			{
				context.SetInstruction(X86.MovssStore,
					null,
					(context.Result.IsLabel || context.Result.IsSymbol || context.Result.IsField)
						? context.Result
						: Operand.CreateCPURegister(context.Result.Type, context.Result.EffectiveOffsetBase),
					Operand.CreateConstant(MethodCompiler.TypeSystem, (int)context.Result.Displacement),
					context.Operand1
				);
			}
		}

		/// <summary>
		/// Visitation function for <see cref="IX86Visitor.Movups" /> instructions.
		/// </summary>
		/// <param name="context">The context.</param>
		public void Movaps(Context context)
		{
			if (context.Result.IsCPURegister && context.Operand1.IsMemoryAddress)
			{
				context.SetInstruction(X86.MovapsLoad,
					context.Result,
					(context.Operand1.IsLabel || context.Operand1.IsSymbol || context.Operand1.IsField)
						? context.Operand1
						: Operand.CreateCPURegister(context.Operand1.Type, context.Operand1.EffectiveOffsetBase),
					Operand.CreateConstant(MethodCompiler.TypeSystem, (int)context.Operand1.Displacement)
				);
			}
		}

		/// <summary>
		/// Visitation function for <see cref="IX86Visitor.Movups" /> instructions.
		/// </summary>
		/// <param name="context">The context.</param>
		public void Movups(Context context)
		{
			if (context.Result.IsCPURegister && context.Operand1.IsMemoryAddress)
			{
				context.SetInstruction(X86.MovupsLoad,
					InstructionSize.Size128,
					context.Result,
					(context.Operand1.IsLabel || context.Operand1.IsSymbol || context.Operand1.IsField)
						? context.Operand1
						: Operand.CreateCPURegister(context.Operand1.Type, context.Operand1.EffectiveOffsetBase),
					Operand.CreateConstant(MethodCompiler.TypeSystem, (int)context.Operand1.Displacement)
				);
			}

			if (context.Result.IsMemoryAddress && (context.Operand1.IsCPURegister /*|| context.Operand1.IsConstant*/))
			{
				context.SetInstruction(X86.MovupsStore,
					InstructionSize.Size128,
					null,
					(context.Result.IsLabel || context.Result.IsSymbol || context.Result.IsField)
						? context.Result
						: Operand.CreateCPURegister(context.Result.Type, context.Result.EffectiveOffsetBase),
					Operand.CreateConstant(MethodCompiler.TypeSystem, (int)context.Result.Displacement),
					context.Operand1
				);
			}
		}

		#endregion Visitation Methods
	}
}


text:
package org.apache.axis2.schema.restriction;

import junit.framework.TestCase;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.util.StAXUtils;
import org.tempuri.Address;
import org.tempuri.ComplexRestrictionTypeTestElement;
import org.tempuri.EnumerationSimpleTypeElement;
import org.tempuri.HairColor_type1;
import org.tempuri.NormalSimpleTypeElement;
import org.tempuri.ParentEnumerationSimpleType;
import org.tempuri.ParentNormalSimpleType;
import org.tempuri.ParentRestrictionType;
import org.tempuri.ParentSimpleType;
import org.tempuri.Person;
import org.tempuri.PersonElement;
import org.tempuri.TestSimpleAttribute;
import org.tempuri.TestSimpleAttributeElement;
import org.tempuri.Zip_type1;

import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamReader;
import java.io.ByteArrayInputStream;
import java.util.Date;

public class SimpleRestrictionTest extends TestCase {

    public void testSimpleAttribute() {

        TestSimpleAttributeElement testSimpleAttributeElement = new TestSimpleAttributeElement();

        TestSimpleAttribute testSimpleAttribute = new TestSimpleAttribute();
        testSimpleAttributeElement.setTestSimpleAttributeElement(testSimpleAttribute);
        testSimpleAttribute.setTestElement1(new QName("http://wso2.com", "test1"));
        testSimpleAttribute.setTestElement2(new QName("http://wso2.com", "test2"));
        testSimpleAttribute.setTestElement3(new QName("http://wso2.com", "test3"));

        ParentSimpleType parentSimpleType1 = new ParentSimpleType();
        parentSimpleType1.setChildSimpleType("test simple type 1");

        ParentSimpleType parentSimpleType2 = new ParentSimpleType();
        parentSimpleType2.setChildSimpleType("test simple type 2");

        testSimpleAttribute.setAttrib1(parentSimpleType1);
        testSimpleAttribute.setAttrib2(parentSimpleType2);

         try {
             OMElement omElement = testSimpleAttributeElement.getOMElement(TestSimpleAttributeElement.MY_QNAME, OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM String ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestSimpleAttributeElement result = TestSimpleAttributeElement.Factory.parse(xmlReader);
            assertEquals(result.getTestSimpleAttributeElement().getTestElement1(), testSimpleAttribute.getTestElement1());
            assertEquals(result.getTestSimpleAttributeElement().getTestElement2(), testSimpleAttribute.getTestElement2());
            assertEquals(result.getTestSimpleAttributeElement().getTestElement3(), testSimpleAttribute.getTestElement3());
            assertEquals(result.getTestSimpleAttributeElement().getAttrib1().getChildSimpleType(), parentSimpleType1.getChildSimpleType());
            assertEquals(result.getTestSimpleAttributeElement().getAttrib2().getChildSimpleType(), parentSimpleType2.getChildSimpleType());
        } catch (Exception e) {
            assertFalse(true);
        }

    }

    public void testNormalSimpleTypeElement() {

        NormalSimpleTypeElement normalSimpleTypeElement = new NormalSimpleTypeElement();
        ParentNormalSimpleType parentNormalSimpleType = new ParentNormalSimpleType();
        normalSimpleTypeElement.setNormalSimpleTypeElement(parentNormalSimpleType);
        parentNormalSimpleType.setNormalSimpleType(new QName("http://wso2.com", "test"));

        try {
            OMElement omElement = normalSimpleTypeElement.getOMElement(NormalSimpleTypeElement.MY_QNAME, OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            NormalSimpleTypeElement result = NormalSimpleTypeElement.Factory.parse(xmlReader);
            assertEquals(result.getNormalSimpleTypeElement().getNormalSimpleType(), parentNormalSimpleType.getNormalSimpleType());
        } catch (Exception e) {
            assertFalse(true);
        }

    }

    public void testEnumerationSimpleTypeElement() {

        EnumerationSimpleTypeElement enumerationSimpleTypeElement = new EnumerationSimpleTypeElement();
        enumerationSimpleTypeElement.setEnumerationSimpleTypeElement(ParentEnumerationSimpleType.value1);

        try {
            OMElement omElement = enumerationSimpleTypeElement.getOMElement(EnumerationSimpleTypeElement.MY_QNAME, OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            EnumerationSimpleTypeElement result = EnumerationSimpleTypeElement.Factory.parse(xmlReader);
            assertEquals(result.getEnumerationSimpleTypeElement().getValue(), ParentEnumerationSimpleType.value1.getValue());
        } catch (Exception e) {
            assertFalse(true);
        }

    }

    public void testComplexRestrictionType() {

        ComplexRestrictionTypeTestElement complexRestrictionTypeTestElement = new ComplexRestrictionTypeTestElement();
        ParentRestrictionType parentRestrictionType = new ParentRestrictionType();
        complexRestrictionTypeTestElement.setComplexRestrictionTypeTestElement(parentRestrictionType);
        parentRestrictionType.setBaseTypeElement1("test 1");
        parentRestrictionType.setBaseTypeElement2(5);

         try {
            OMElement omElement = complexRestrictionTypeTestElement.getOMElement(ComplexRestrictionTypeTestElement.MY_QNAME, OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            ComplexRestrictionTypeTestElement result = ComplexRestrictionTypeTestElement.Factory.parse(xmlReader);
            assertEquals(result.getComplexRestrictionTypeTestElement().getBaseTypeElement1(), parentRestrictionType.getBaseTypeElement1());
            assertEquals(result.getComplexRestrictionTypeTestElement().getBaseTypeElement2(), parentRestrictionType.getBaseTypeElement2());
        } catch (Exception e) {
            e.printStackTrace();
            assertFalse(true);
        }

    }

    public void testPersonElement() {
        PersonElement personElement = new PersonElement();
        Person person = new Person();
        personElement.setPersonElement(person);
        person.setName("amila");
        person.setAge(23);
        person.setHairColor(HairColor_type1.black);
        Date date = new Date();
        person.setBirthDate(date);
        Address address = new Address();
        person.setAddress(address);
        address.setCity("Galle");
        address.setLine1("line1");
        address.setLine2("line2");
        address.setState("state");
        Zip_type1 ziptype = new Zip_type1();
        address.setZip(ziptype);
        ziptype.setZip_type0("C");

        try {
            OMElement omElement = personElement.getOMElement(ComplexRestrictionTypeTestElement.MY_QNAME, OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            PersonElement result = PersonElement.Factory.parse(xmlReader);
            assertEquals(result.getPersonElement().getName(),"amila");
            assertEquals(result.getPersonElement().getAge(),23);
            assertEquals(result.getPersonElement().getHairColor(),HairColor_type1.black);
            Address resultAddress = result.getPersonElement().getAddress();
            assertEquals(resultAddress.getCity(),"Galle");
            assertEquals(resultAddress.getLine1(),"line1");
            assertEquals(resultAddress.getLine2(),"line2");
            assertEquals(resultAddress.getState(),"state");
            assertEquals(resultAddress.getZip().getZip_type0(),"C");
        } catch (Exception e) {
            e.printStackTrace();
            assertFalse(true);
        }

    }

}

redpajama_set_name: RedPajamaGithub


text:
module Nucleus
  module API
    # The {ErrorResponses} module groups error response that are returned by the RESTful API.
    module ErrorResponses
      # Return all error messages that can be expected to be returned by the RESTful API.
      # @return [Array<Array>] list of rack compatible error messages that the API can be expected to return
      def self.standard_responses
        [[400, 'Bad Request', Nucleus::API::Models::Error],
         [401, 'Unauthorized', Nucleus::API::Models::Error],
         [403, 'Forbidden', Nucleus::API::Models::Error],
         [404, 'Resource not found', Nucleus::API::Models::Error],
         [406, 'API vendor or version not found', Nucleus::API::Models::Error],
         [422, 'Unprocessable Entity due to invalid parameters', Nucleus::API::Models::Error],
         [500, 'Internal processing error', Nucleus::API::Models::Error],
         [501, 'Feature not implemented in the adapter', Nucleus::API::Models::Error],
         [503, 'Destination service temporarily unavailable', Nucleus::API::Models::Error],
         [504, 'Gateway Time-out', Nucleus::API::Models::Error]]
      end
    end
  end
end


text:
package org.kie.workbench.common.forms.jbpm.model.authoring;

import java.util.List;

import org.jboss.errai.common.client.api.annotations.MapsTo;
import org.jboss.errai.common.client.api.annotations.Portable;
import org.kie.workbench.common.forms.jbpm.model.authoring.process.BusinessProcessFormModel;
import org.kie.workbench.common.forms.jbpm.model.authoring.task.TaskFormModel;

@Portable
public class JBPMProcessModel {

    protected BusinessProcessFormModel processFormModel;

    protected List<TaskFormModel> taskFormModels;

    public JBPMProcessModel(@MapsTo("processFormModel") BusinessProcessFormModel processFormModel,
                            @MapsTo("taskFormModels") List<TaskFormModel> taskFormModels) {
        this.processFormModel = processFormModel;
        this.taskFormModels = taskFormModels;
    }

    public BusinessProcessFormModel getProcessFormModel() {
        return processFormModel;
    }

    public void setProcessFormModel(BusinessProcessFormModel processFormModel) {
        this.processFormModel = processFormModel;
    }

    public List<TaskFormModel> getTaskFormModels() {
        return taskFormModels;
    }

    public void setTaskFormModels(List<TaskFormModel> taskFormModels) {
        this.taskFormModels = taskFormModels;
    }
}


text:
/**
 * A pausable parser that consumes template text
 * and provides annotations that make clear the
 * structure of the strings produced by the template.
 *
 *
Example

 *
For an HTML template:
 *

 *   Hello, <a href="{$world}">World</a>!
 *

 * The parser might get two chunks of input:
 *

 *
"Hello, <a href=\""
 *
"\">World</a>!"
 *

 * and provide an annotated output like
 *

 *
String: "Hello, "

 *
Tag:

 *
String: "<a "

 *
Attribute :

 *
String: "href=\""

 *
Embedded URL

Pause

 *
String: "\"

 *

 *
String: ">"

 *

 *
String: "World"
 *
Tag:

String: "</a>"

 *
String: "!"

 *

 *

 * This structure provides enough information to decide how
 * to safely escape {$world} to preserve
 * template author intent and security even if the value of
 * $world is controlled by an attacker.
 *

 *
 *
Starting Points

 *

 *
{@link com.google.template.autoesc.Parser} -
 *   actually performs a parse.

 *
{@link com.google.template.autoesc.Language} - defines a grammar

 *
{@link com.google.template.autoesc.Combinators} -
 *   useful for defining grammars.
 *   See also {@link com.google.template.autoesc.grammars grammars}
 *   sub-package.

 *
{@link com.google.template.autoesc.demo.DemoServer} -
 *   for debugging and visualizing parses.

 *

 *
 *

 * The parser is pausable meaning it does not require
 * the entire input.  Parses can be forked and joined to allow
 * static analysis of templates.
 *

 *
 *

 * The parser is analytic meaning it does not simultaneously
 * follow all paths through the grammar.  Instead, branches are tried
 * in-order.
 *

 *
 *

 * The parser is side-effect free.  It produces an output stream
 * that can be replayed after a consistent end state is reached
 * to achieve the desired side-effects.
 *

 *
 *

 * The parser is based on combinators but not in the traditional
 * way.  Each step in a parse maps more closely to a function call, function
 * exit, consume of an input character, or append to an output buffer so
 * mirrors the way a recursive-descent parser operates in practice.
 *

 *
 *

 * Parses can be forked and joined.  When a template
 * branches, for example due to an <tt>if</tt> or sub-template call,
 * the parse state can be forked and each alternative followed.
 * Once all alternatives have been analyzed, their end states can be
 * joined on the other side of the branching construct.
 *

 *
 * @author Mike Samuel (mikesamuel@gmail.com)
 */
@javax.annotation.ParametersAreNonnullByDefault
//@org.eclipse.jdt.annotation.NonnullByDefault
package com.google.template.autoesc;


text:
/**
 * @file /cost_map_core/include/cost_map_core/submap_geometry.hpp
 */

#pragma once

#include "common.hpp"

namespace cost_map {

class CostMap;

/*!
 * This class holds information about the geometry of submap
 * region of a grid map. Note that, this class does NOT hold
 * the any data of the grid map.
 */
class SubmapGeometry
{
 public:

  /*!
   * Constructor. Note that the requested position and length
   * of the submap is adapted to fit the geometry of the parent
   * grid map.
   * @param[in] gridMap the parent grid map containing the submap.
   * @param[in] position the requested submap position (center).
   * @param[in] length the requested submap length.
   * @param[out] isSuccess true if successful, false otherwise.
   */
  SubmapGeometry(const CostMap& gridMap, const Position& position, const Length& length,
                 bool& isSuccess);

  virtual ~SubmapGeometry();

  const CostMap& getGridMap() const;
  const Length& getLength() const;
  const Position& getPosition() const;
  const Index& getRequestedIndexInSubmap() const;
  const Size& getSize() const;
  double getResolution() const;
  const Index& getStartIndex() const;

 private:

  //! Parent grid map of the submap.
  const CostMap& gridMap_;

  //! Start index (typically top left) index of the submap.
  Index startIndex_;

  //! Size of the submap.
  Size size_;

  //! Position (center) of the submap.
  Position position_;

  //! Length of the submap.
  Length length_;

  //! Index in the submap that corresponds to the requested
  //! position of the submap.
  Index requestedIndexInSubmap_;
};

} /* namespace cost_map */


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>Weatherreport</title>

	<link href="style/weather.css" rel=stylesheet>

Loading required information...

	<canvas id=stars></canvas>

	<canvas id=rain width="100%" height="100%"></canvas>

This website utilizes data from Google Maps API, freegeoip.net and Open Weather Map


text:
package ua.com.fielden.platform.reflection.asm.impl.entities;

import ua.com.fielden.platform.entity.AbstractEntity;
import ua.com.fielden.platform.entity.annotation.IsProperty;
import ua.com.fielden.platform.entity.annotation.KeyType;
import ua.com.fielden.platform.entity.annotation.Observable;

/**
 * A test entity, which gets modified by replacing the type of property prop1.
 *
 * @author TG Team
 *
 */
@KeyType(String.class)
public class CircularParent extends AbstractEntity<String> {
    private static final long serialVersionUID = 1L;

    @IsProperty
    private CircularChild prop1;

    public CircularChild getProp1() {
        return prop1;
    }

    @Observable
    public void setProp1(final CircularChild prop1) {
        this.prop1 = prop1;
    }

}


text:
#ifndef __TestLocation_h__
#define __TestLocation_h__

#include "../TestBasic.h"

class TestLocation : public TestBasic
{
	public :

		CREATE_FUNC ( TestLocation );

	protected :

		virtual	KDvoid			onEnter	 ( KDvoid );
		virtual KDvoid			onExit   ( KDvoid );

		virtual KDuint			count	 ( KDvoid );
		virtual const KDchar*	subtitle ( KDvoid );

		virtual	KDvoid			onEvent ( const KDEvent* pEvent );

		KDvoid					onRefresh ( KDbool bFromGPS );

		KDvoid					onReadFile ( KDfloat fDelta );

	protected :

		CCLabelTTF*				m_pLabel;
		KDFile*					m_pFile;
};

#endif	// __TestLocation_h__


text:
using System;
using OpenTK.Input;

namespace Duality
{
	/// <summary>
	/// Base interface for describing a source of user input.
	/// </summary>
	public interface IUserInputSource
	{
		/// <summary>
		/// [GET] A string containing a unique description for this instance.
		/// </summary>
		string Description { get; }
		/// <summary>
		/// [GET] Returns whether this input is currently available.
		/// </summary>
		bool IsAvailable { get; }

		/// <summary>
		/// Updates the sources current state.
		/// </summary>
		void UpdateState();
	}
}


text:
class AuthorSessionsController < ApplicationController
  def new
  end

  def create
    if login(params[:email], params[:password])
      redirect_back_or_to(articles_path, notice: 'Logged in successfully')
    else
      flash.notice = 'Login failed'
      render :new
    end
  end

  def destroy
    logout
    redirect_to(root_path, notice: 'Logged out')
  end
end


text:
from lib.action import PyraxBaseAction

__all__ = [
    'DeleteDNSZoneAction'
]

class DeleteDNSZoneAction(PyraxBaseAction):
    def run(self, zone_id):
        cdns = self.pyrax.cloud_dns
        zone = cdns.get(zone_id)

        zone.delete()
        return True


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="github.nisrulz.using_expansionpanel">
    <!-- The INTERNET permission is required for development. Specifically,
         the Flutter tool needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>


text:
<?php

namespace \Config\Envirnoment\Production;

use \Config\Application as BaseApplication;

class Application extends BaseApplication {

    public function __construct() {
        parent::__construct();
    }

}


text:
<?php
/**
 * Base class and functions for profiling.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @file
 * @ingroup Profiler
 * This file is only included if profiling is enabled
 */

/**
 * @defgroup Profiler Profiler
 */

/**
 * Begin profiling of a function
 * @param string $functionname name of the function we will profile
 */
function wfProfileIn( $functionname ) {
	if ( Profiler::$__instance === null ) { // use this directly to reduce overhead
		Profiler::instance();
	}
	if ( !( Profiler::$__instance instanceof ProfilerStub ) ) {
		Profiler::$__instance->profileIn( $functionname );
	}
}

/**
 * Stop profiling of a function
 * @param string $functionname name of the function we have profiled
 */
function wfProfileOut( $functionname = 'missing' ) {
	if ( Profiler::$__instance === null ) { // use this directly to reduce overhead
		Profiler::instance();
	}
	if ( !( Profiler::$__instance instanceof ProfilerStub ) ) {
		Profiler::$__instance->profileOut( $functionname );
	}
}

/**
 * Class for handling function-scope profiling
 *
 * @since 1.22
 */
class ProfileSection {
	protected $name; // string; method name
	protected $enabled = false; // boolean; whether profiling is enabled

	/**
	 * Begin profiling of a function and return an object that ends profiling of
	 * the function when that object leaves scope. As long as the object is not
	 * specifically linked to other objects, it will fall out of scope at the same
	 * moment that the function to be profiled terminates.
	 *
	 * This is typically called like:
	 * <code>$section = new ProfileSection( __METHOD__ );</code>
	 *
	 * @param string $name Name of the function to profile
	 */
	public function __construct( $name ) {
		$this->name = $name;
		if ( Profiler::$__instance === null ) { // use this directly to reduce overhead
			Profiler::instance();
		}
		if ( !( Profiler::$__instance instanceof ProfilerStub ) ) {
			$this->enabled = true;
			Profiler::$__instance->profileIn( $this->name );
		}
	}

	function __destruct() {
		if ( $this->enabled ) {
			Profiler::$__instance->profileOut( $this->name );
		}
	}
}

/**
 * @ingroup Profiler
 * @todo document
 */
class Profiler {
	protected $mStack = array(), $mWorkStack = array(), $mCollated = array(),
		$mCalls = array(), $mTotals = array(), $mPeriods = array();
	protected $mTimeMetric = 'wall';
	protected $mProfileID = false, $mCollateDone = false, $mTemplated = false;

	protected $mDBLockThreshold = 5.0; // float; seconds
	/** @var Array DB/server name => (active trx count,timestamp) */
	protected $mDBTrxHoldingLocks = array();
	/** @var Array DB/server name => list of (method, elapsed time) */
	protected $mDBTrxMethodTimes = array();

	/** @var Profiler */
	public static $__instance = null; // do not call this outside Profiler and ProfileSection

	function __construct( $params ) {
		if ( isset( $params['timeMetric'] ) ) {
			$this->mTimeMetric = $params['timeMetric'];
		}
		if ( isset( $params['profileID'] ) ) {
			$this->mProfileID = $params['profileID'];
		}

		$this->addInitialStack();
	}

	/**
	 * Singleton
	 * @return Profiler
	 */
	public static function instance() {
		if ( self::$__instance === null ) {
			global $wgProfiler;
			if ( is_array( $wgProfiler ) ) {
				if ( !isset( $wgProfiler['class'] ) ) {
					$class = 'ProfilerStub';
				} else {
					$class = $wgProfiler['class'];
				}
				self::$__instance = new $class( $wgProfiler );
			} elseif ( $wgProfiler instanceof Profiler ) {
				self::$__instance = $wgProfiler; // back-compat
			} else {
				self::$__instance = new ProfilerStub( $wgProfiler );
			}
		}
		return self::$__instance;
	}

	/**
	 * Set the profiler to a specific profiler instance. Mostly for dumpHTML
	 * @param $p Profiler object
	 */
	public static function setInstance( Profiler $p ) {
		self::$__instance = $p;
	}

	/**
	 * Return whether this a stub profiler
	 *
	 * @return Boolean
	 */
	public function isStub() {
		return false;
	}

	/**
	 * Return whether this profiler stores data
	 *
	 * @see Profiler::logData()
	 * @return Boolean
	 */
	public function isPersistent() {
		return true;
	}

	public function setProfileID( $id ) {
		$this->mProfileID = $id;
	}

	public function getProfileID() {
		if ( $this->mProfileID === false ) {
			return wfWikiID();
		} else {
			return $this->mProfileID;
		}
	}

	/**
	 * Add the inital item in the stack.
	 */
	protected function addInitialStack() {
		// Push an entry for the pre-profile setup time onto the stack
		$initial = $this->getInitialTime();
		if ( $initial !== null ) {
			$this->mWorkStack[] = array( '-total', 0, $initial, 0 );
			$this->mStack[] = array( '-setup', 1, $initial, 0, $this->getTime(), 0 );
		} else {
			$this->profileIn( '-total' );
		}
	}

	/**
	 * Called by wfProfieIn()
	 *
	 * @param $functionname String
	 */
	public function profileIn( $functionname ) {
		global $wgDebugFunctionEntry;
		if ( $wgDebugFunctionEntry ) {
			$this->debug( str_repeat( ' ', count( $this->mWorkStack ) ) . 'Entering ' . $functionname . "\n" );
		}

		$this->mWorkStack[] = array( $functionname, count( $this->mWorkStack ), $this->getTime(), memory_get_usage() );
	}

	/**
	 * Called by wfProfieOut()
	 *
	 * @param $functionname String
	 */
	public function profileOut( $functionname ) {
		global $wgDebugFunctionEntry;
		$memory = memory_get_usage();
		$time = $this->getTime();

		if ( $wgDebugFunctionEntry ) {
			$this->debug( str_repeat( ' ', count( $this->mWorkStack ) - 1 ) . 'Exiting ' . $functionname . "\n" );
		}

		$bit = array_pop( $this->mWorkStack );

		if ( !$bit ) {
			$this->debugGroup( 'profileerror', "Profiling error, !\$bit: $functionname" );
		} else {
			if ( $functionname == 'close' ) {
				if ( $bit[0] != '-total' ) {
					$message = "Profile section ended by close(): {$bit[0]}";
					$this->debugGroup( 'profileerror', $message );
					$this->mStack[] = array( $message, 0, 0.0, 0, 0.0, 0 );
				}
			} elseif ( $bit[0] != $functionname ) {
				$message = "Profiling error: in({$bit[0]}), out($functionname)";
				$this->debugGroup( 'profileerror', $message );
				$this->mStack[] = array( $message, 0, 0.0, 0, 0.0, 0 );
			}
			$bit[] = $time;
			$bit[] = $memory;
			$this->mStack[] = $bit;
			$this->updateTrxProfiling( $functionname, $time );
		}
	}

	/**
	 * Close opened profiling sections
	 */
	public function close() {
		while ( count( $this->mWorkStack ) ) {
			$this->profileOut( 'close' );
		}
	}

	/**
	 * Mark a DB as in a transaction with one or more writes pending
	 *
	 * Note that there can be multiple connections to a single DB.
	 *
	 * @param string $server DB server
	 * @param string $db DB name
	 */
	public function transactionWritingIn( $server, $db ) {
		$name = "{$server} ({$db})";
		if ( isset( $this->mDBTrxHoldingLocks[$name] ) ) {
			++$this->mDBTrxHoldingLocks[$name]['refs'];
		} else {
			$this->mDBTrxHoldingLocks[$name] = array( 'refs' => 1, 'start' => microtime( true ) );
			$this->mDBTrxMethodTimes[$name] = array();
		}
	}

	/**
	 * Register the name and time of a method for slow DB trx detection
	 *
	 * @param string $method Function name
	 * @param float $realtime Wal time ellapsed
	 */
	protected function updateTrxProfiling( $method, $realtime ) {
		if ( !$this->mDBTrxHoldingLocks ) {
			return; // short-circuit
		// @TODO: hardcoded check is a tad janky (what about FOR UPDATE?)
		} elseif ( !preg_match( '/^query-m: (?!SELECT)/', $method )
			&& $realtime < $this->mDBLockThreshold
		) {
			return; // not a DB master query nor slow enough
		}
		$now = microtime( true );
		foreach ( $this->mDBTrxHoldingLocks as $name => $info ) {
			// Hacky check to exclude entries from before the first TRX write
			if ( ( $now - $realtime ) >= $info['start'] ) {
				$this->mDBTrxMethodTimes[$name][] = array( $method, $realtime );
			}
		}
	}

	/**
	 * Mark a DB as no longer in a transaction
	 *
	 * This will check if locks are possibly held for longer than
	 * needed and log any affected transactions to a special DB log.
	 * Note that there can be multiple connections to a single DB.
	 *
	 * @param string $server DB server
	 * @param string $db DB name
	 */
	public function transactionWritingOut( $server, $db ) {
		$name = "{$server} ({$db})";
		if ( --$this->mDBTrxHoldingLocks[$name]['refs'] <= 0 ) {
			$slow = false;
			foreach ( $this->mDBTrxMethodTimes[$name] as $info ) {
				list( $method, $realtime ) = $info;
				if ( $realtime >= $this->mDBLockThreshold ) {
					$slow = true;
					break;
				}
			}
			if ( $slow ) {
				$dbs = implode( ', ', array_keys( $this->mDBTrxHoldingLocks ) );
				$msg = "Sub-optimal transaction on DB(s) {$dbs}:\n";
				foreach ( $this->mDBTrxMethodTimes[$name] as $i => $info ) {
					list( $method, $realtime ) = $info;
					$msg .= sprintf( "%d\t%.6f\t%s\n", $i, $realtime, $method );
				}
				$this->debugGroup( 'DBPerformance', $msg );
			}
			unset( $this->mDBTrxHoldingLocks[$name] );
			unset( $this->mDBTrxMethodTimes[$name] );
		}
	}

	/**
	 * Mark this call as templated or not
	 *
	 * @param $t Boolean
	 */
	function setTemplated( $t ) {
		$this->mTemplated = $t;
	}

	/**
	 * Returns a profiling output to be stored in debug file
	 *
	 * @return String
	 */
	public function getOutput() {
		global $wgDebugFunctionEntry, $wgProfileCallTree;
		$wgDebugFunctionEntry = false;

		if ( !count( $this->mStack ) && !count( $this->mCollated ) ) {
			return "No profiling output\n";
		}

		if ( $wgProfileCallTree ) {
			return $this->getCallTree();
		} else {
			return $this->getFunctionReport();
		}
	}

	/**
	 * Returns a tree of function call instead of a list of functions
	 * @return string
	 */
	function getCallTree() {
		return implode( '', array_map( array( &$this, 'getCallTreeLine' ), $this->remapCallTree( $this->mStack ) ) );
	}

	/**
	 * Recursive function the format the current profiling array into a tree
	 *
	 * @param array $stack profiling array
	 * @return array
	 */
	function remapCallTree( $stack ) {
		if ( count( $stack ) < 2 ) {
			return $stack;
		}
		$outputs = array();
		for ( $max = count( $stack ) - 1; $max > 0; ) {
			/* Find all items under this entry */
			$level = $stack[$max][1];
			$working = array();
			for ( $i = $max -1; $i >= 0; $i-- ) {
				if ( $stack[$i][1] > $level ) {
					$working[] = $stack[$i];
				} else {
					break;
				}
			}
			$working = $this->remapCallTree( array_reverse( $working ) );
			$output = array();
			foreach ( $working as $item ) {
				array_push( $output, $item );
			}
			array_unshift( $output, $stack[$max] );
			$max = $i;

			array_unshift( $outputs, $output );
		}
		$final = array();
		foreach ( $outputs as $output ) {
			foreach ( $output as $item ) {
				$final[] = $item;
			}
		}
		return $final;
	}

	/**
	 * Callback to get a formatted line for the call tree
	 * @return string
	 */
	function getCallTreeLine( $entry ) {
		list( $fname, $level, $start, /* $x */, $end ) = $entry;
		$delta = $end - $start;
		$space = str_repeat( ' ', $level );
		# The ugly double sprintf is to work around a PHP bug,
		# which has been fixed in recent releases.
		return sprintf( "%10s %s %s\n", trim( sprintf( "%7.3f", $delta * 1000.0 ) ), $space, $fname );
	}

	/**
	 * Get the initial time of the request, based either on $wgRequestTime or
	 * $wgRUstart. Will return null if not able to find data.
	 *
	 * @param string|false $metric metric to use, with the following possibilities:
	 *   - user: User CPU time (without system calls)
	 *   - cpu: Total CPU time (user and system calls)
	 *   - wall (or any other string): elapsed time
	 *   - false (default): will fall back to default metric
	 * @return float|null
	 */
	function getTime( $metric = false ) {
		if ( $metric === false ) {
			$metric = $this->mTimeMetric;
		}

		if ( $metric === 'cpu' || $this->mTimeMetric === 'user' ) {
			if ( !function_exists( 'getrusage' ) ) {
				return 0;
			}
			$ru = getrusage();
			$time = $ru['ru_utime.tv_sec'] + $ru['ru_utime.tv_usec'] / 1e6;
			if ( $metric === 'cpu' ) {
				# This is the time of system calls, added to the user time
				# it gives the total CPU time
				$time += $ru['ru_stime.tv_sec'] + $ru['ru_stime.tv_usec'] / 1e6;
			}
			return $time;
		} else {
			return microtime( true );
		}
	}

	/**
	 * Get the initial time of the request, based either on $wgRequestTime or
	 * $wgRUstart. Will return null if not able to find data.
	 *
	 * @param string|false $metric metric to use, with the following possibilities:
	 *   - user: User CPU time (without system calls)
	 *   - cpu: Total CPU time (user and system calls)
	 *   - wall (or any other string): elapsed time
	 *   - false (default): will fall back to default metric
	 * @return float|null
	 */
	protected function getInitialTime( $metric = false ) {
		global $wgRequestTime, $wgRUstart;

		if ( $metric === false ) {
			$metric = $this->mTimeMetric;
		}

		if ( $metric === 'cpu' || $this->mTimeMetric === 'user' ) {
			if ( !count( $wgRUstart ) ) {
				return null;
			}

			$time = $wgRUstart['ru_utime.tv_sec'] + $wgRUstart['ru_utime.tv_usec'] / 1e6;
			if ( $metric === 'cpu' ) {
				# This is the time of system calls, added to the user time
				# it gives the total CPU time
				$time += $wgRUstart['ru_stime.tv_sec'] + $wgRUstart['ru_stime.tv_usec'] / 1e6;
			}
			return $time;
		} else {
			if ( empty( $wgRequestTime ) ) {
				return null;
			} else {
				return $wgRequestTime;
			}
		}
	}

	protected function collateData() {
		if ( $this->mCollateDone ) {
			return;
		}
		$this->mCollateDone = true;

		$this->close();

		$this->mCollated = array();
		$this->mCalls = array();
		$this->mMemory = array();

		# Estimate profiling overhead
		$profileCount = count( $this->mStack );
		self::calculateOverhead( $profileCount );

		# First, subtract the overhead!
		$overheadTotal = $overheadMemory = $overheadInternal = array();
		foreach ( $this->mStack as $entry ) {
			$fname = $entry[0];
			$start = $entry[2];
			$end = $entry[4];
			$elapsed = $end - $start;
			$memory = $entry[5] - $entry[3];

			if ( $fname == '-overhead-total' ) {
				$overheadTotal[] = $elapsed;
				$overheadMemory[] = $memory;
			} elseif ( $fname == '-overhead-internal' ) {
				$overheadInternal[] = $elapsed;
			}
		}
		$overheadTotal = $overheadTotal ? array_sum( $overheadTotal ) / count( $overheadInternal ) : 0;
		$overheadMemory = $overheadMemory ? array_sum( $overheadMemory ) / count( $overheadInternal ) : 0;
		$overheadInternal = $overheadInternal ? array_sum( $overheadInternal ) / count( $overheadInternal ) : 0;

		# Collate
		foreach ( $this->mStack as $index => $entry ) {
			$fname = $entry[0];
			$start = $entry[2];
			$end = $entry[4];
			$elapsed = $end - $start;

			$memory = $entry[5] - $entry[3];
			$subcalls = $this->calltreeCount( $this->mStack, $index );

			if ( !preg_match( '/^-overhead/', $fname ) ) {
				# Adjust for profiling overhead (except special values with elapsed=0
				if ( $elapsed ) {
					$elapsed -= $overheadInternal;
					$elapsed -= ( $subcalls * $overheadTotal );
					$memory -= ( $subcalls * $overheadMemory );
				}
			}

			if ( !array_key_exists( $fname, $this->mCollated ) ) {
				$this->mCollated[$fname] = 0;
				$this->mCalls[$fname] = 0;
				$this->mMemory[$fname] = 0;
				$this->mMin[$fname] = 1 << 24;
				$this->mMax[$fname] = 0;
				$this->mOverhead[$fname] = 0;
				$this->mPeriods[$fname] = array();
			}

			$this->mCollated[$fname] += $elapsed;
			$this->mCalls[$fname]++;
			$this->mMemory[$fname] += $memory;
			$this->mMin[$fname] = min( $this->mMin[$fname], $elapsed );
			$this->mMax[$fname] = max( $this->mMax[$fname], $elapsed );
			$this->mOverhead[$fname] += $subcalls;
			$this->mPeriods[$fname][] = compact( 'start', 'end', 'memory', 'subcalls' );
		}

		$this->mCalls['-overhead-total'] = $profileCount;
		arsort( $this->mCollated, SORT_NUMERIC );
	}

	/**
	 * Returns a list of profiled functions.
	 *
	 * @return string
	 */
	function getFunctionReport() {
		$this->collateData();

		$width = 140;
		$nameWidth = $width - 65;
		$format = "%-{$nameWidth}s %6d %13.3f %13.3f %13.3f%% %9d  (%13.3f -%13.3f) [%d]\n";
		$titleFormat = "%-{$nameWidth}s %6s %13s %13s %13s %9s\n";
		$prof = "\nProfiling data\n";
		$prof .= sprintf( $titleFormat, 'Name', 'Calls', 'Total', 'Each', '%', 'Mem' );

		$total = isset( $this->mCollated['-total'] ) ? $this->mCollated['-total'] : 0;

		foreach ( $this->mCollated as $fname => $elapsed ) {
			$calls = $this->mCalls[$fname];
			$percent = $total ? 100. * $elapsed / $total : 0;
			$memory = $this->mMemory[$fname];
			$prof .= sprintf( $format,
				substr( $fname, 0, $nameWidth ),
				$calls,
				(float)( $elapsed * 1000 ),
				(float)( $elapsed * 1000 ) / $calls,
				$percent,
				$memory,
				( $this->mMin[$fname] * 1000.0 ),
				( $this->mMax[$fname] * 1000.0 ),
				$this->mOverhead[$fname]
			);
		}
		$prof .= "\nTotal: $total\n\n";

		return $prof;
	}

	/**
	 * @return array
	 */
	public function getRawData() {
		$this->collateData();

		$profile = array();
		$total = isset( $this->mCollated['-total'] ) ? $this->mCollated['-total'] : 0;
		foreach ( $this->mCollated as $fname => $elapsed ) {
			$periods = array();
			foreach ( $this->mPeriods[$fname] as $period ) {
				$period['start'] *= 1000;
				$period['end'] *= 1000;
				$periods[] = $period;
			}
			$profile[] = array(
				'name' => $fname,
				'calls' => $this->mCalls[$fname],
				'elapsed' => $elapsed * 1000,
				'percent' => $total ? 100. * $elapsed / $total : 0,
				'memory' => $this->mMemory[$fname],
				'min' => $this->mMin[$fname] * 1000,
				'max' => $this->mMax[$fname] * 1000,
				'overhead' => $this->mOverhead[$fname],
				'periods' => $periods,
			);
		}

		return $profile;
	}

	/**
	 * Dummy calls to wfProfileIn/wfProfileOut to calculate its overhead
	 */
	protected static function calculateOverhead( $profileCount ) {
		wfProfileIn( '-overhead-total' );
		for ( $i = 0; $i < $profileCount; $i++ ) {
			wfProfileIn( '-overhead-internal' );
			wfProfileOut( '-overhead-internal' );
		}
		wfProfileOut( '-overhead-total' );
	}

	/**
	 * Counts the number of profiled function calls sitting under
	 * the given point in the call graph. Not the most efficient algo.
	 *
	 * @param $stack Array:
	 * @param $start Integer:
	 * @return Integer
	 * @private
	 */
	function calltreeCount( $stack, $start ) {
		$level = $stack[$start][1];
		$count = 0;
		for ( $i = $start -1; $i >= 0 && $stack[$i][1] > $level; $i-- ) {
			$count ++;
		}
		return $count;
	}

	/**
	 * Log the whole profiling data into the database.
	 */
	public function logData() {
		global $wgProfilePerHost, $wgProfileToDatabase;

		# Do not log anything if database is readonly (bug 5375)
		if ( wfReadOnly() || !$wgProfileToDatabase ) {
			return;
		}

		$dbw = wfGetDB( DB_MASTER );
		if ( !is_object( $dbw ) ) {
			return;
		}

		if ( $wgProfilePerHost ) {
			$pfhost = wfHostname();
		} else {
			$pfhost = '';
		}

		try {
			$this->collateData();

			foreach ( $this->mCollated as $name => $elapsed ) {
				$eventCount = $this->mCalls[$name];
				$timeSum = (float)( $elapsed * 1000 );
				$memorySum = (float)$this->mMemory[$name];
				$name = substr( $name, 0, 255 );

				// Kludge
				$timeSum = $timeSum >= 0 ? $timeSum : 0;
				$memorySum = $memorySum >= 0 ? $memorySum : 0;

				$dbw->update( 'profiling',
					array(
						"pf_count=pf_count+{$eventCount}",
						"pf_time=pf_time+{$timeSum}",
						"pf_memory=pf_memory+{$memorySum}",
					),
					array(
						'pf_name' => $name,
						'pf_server' => $pfhost,
					),
					__METHOD__ );

				$rc = $dbw->affectedRows();
				if ( $rc == 0 ) {
					$dbw->insert( 'profiling', array( 'pf_name' => $name, 'pf_count' => $eventCount,
						'pf_time' => $timeSum, 'pf_memory' => $memorySum, 'pf_server' => $pfhost ),
						__METHOD__, array( 'IGNORE' ) );
				}
				// When we upgrade to mysql 4.1, the insert+update
				// can be merged into just a insert with this construct added:
				//     "ON DUPLICATE KEY UPDATE ".
				//     "pf_count=pf_count + VALUES(pf_count), ".
				//     "pf_time=pf_time + VALUES(pf_time)";
			}
		} catch ( DBError $e ) {}
	}

	/**
	 * Get the function name of the current profiling section
	 * @return
	 */
	function getCurrentSection() {
		$elt = end( $this->mWorkStack );
		return $elt[0];
	}

	/**
	 * Add an entry in the debug log file
	 *
	 * @param string $s to output
	 */
	function debug( $s ) {
		if ( function_exists( 'wfDebug' ) ) {
			wfDebug( $s );
		}
	}

	/**
	 * Add an entry in the debug log group
	 *
	 * @param string $group Group to send the message to
	 * @param string $s to output
	 */
	function debugGroup( $group, $s ) {
		if ( function_exists( 'wfDebugLog' ) ) {
			wfDebugLog( $group, $s );
		}
	}

	/**
	 * Get the content type sent out to the client.
	 * Used for profilers that output instead of store data.
	 * @return string
	 */
	protected function getContentType() {
		foreach ( headers_list() as $header ) {
			if ( preg_match( '#^content-type: (\w+/\w+);?#i', $header, $m ) ) {
				return $m[1];
			}
		}
		return null;
	}
}


text:
using Warden.Services.Storage.Providers;
using Warden.Services.Storage.ServiceClients.Queries;
using Warden.Services.Storage.Models.Users;

namespace Warden.Services.Storage.Modules
{
    public class ApiKeyModule : ModuleBase
    {
        public ApiKeyModule(IApiKeyProvider apiKeyProvider)
        {
            Get("api-keys", async args => await FetchCollection<BrowseApiKeys, ApiKey>
                (async x => await apiKeyProvider.BrowseAsync(x)).HandleAsync());

            Get("users/{userId}/api-keys", async args => await FetchCollection<BrowseApiKeys, ApiKey>
                (async x => await apiKeyProvider.BrowseAsync(x)).HandleAsync());

            Get("users/{userId}/api-keys/{name}", async args => await Fetch<GetApiKey, ApiKey>
                (async x => await apiKeyProvider.GetAsync(x.UserId, x.Name)).HandleAsync());
        }
    }
}


text:
// Copyright 2007-2018 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// 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.
namespace MassTransit.HttpTransport.Transport
{
    using System;
    using System.Threading.Tasks;
    using Configuration;
    using Clients;
    using MassTransit.Context;
    using MassTransit.Pipeline;
    using Transports;

    public class HttpSendTransportProvider :
        ISendTransportProvider
    {
        readonly IReceiveObserver _receiveObserver;
        readonly IHttpBusConfiguration _busConfiguration;
        readonly IReceivePipe _receivePipe;
        readonly ReceiveEndpointContext _topology;

        public HttpSendTransportProvider(IHttpBusConfiguration busConfiguration, IReceivePipe receivePipe, IReceiveObserver receiveObserver,
            ReceiveEndpointContext topology)
        {
            _busConfiguration = busConfiguration;
            _receivePipe = receivePipe;
            _receiveObserver = receiveObserver;
            _topology = topology;
        }

        public Task<ISendTransport> GetSendTransport(Uri address)
        {
            if (!_busConfiguration.TryGetHost(address, out var hostConfiguration))
                throw new EndpointNotFoundException($"The host was not found for the specified address: {address}");

            var clientCache = new HttpClientCache(_receivePipe);

            var sendSettings = address.GetSendSettings();

            return Task.FromResult<ISendTransport>(new HttpSendTransport(clientCache, sendSettings, _receiveObserver, _topology));
        }
    }
}


text:
namespace ray {

/// \return The portable directory separator (slash on all OSes).
static inline char GetAltDirSep() { return '/'; }

/// Equivalent to Python's os.path.basename() for file system paths.
std::string GetFileName(const std::string &path);

/// \return The non-volatile temporary directory for the current user (often /tmp).
std::string GetUserTempDir();

/// \return Whether or not the given character is a directory separator on this platform.
static inline bool IsDirSep(char ch) {
  bool result = ch == std::filesystem::path::preferred_separator;
#ifdef _WIN32
  result |= ch == GetAltDirSep();
#endif
  return result;
}

/// \return The result of joining multiple path components.
template <class... Paths>
std::string JoinPaths(std::string base, const Paths &...components) {
  auto join = [](auto &joined_path, const auto &component) {
    // if the components begin with "/" or "////", just get the path name.
    if (!component.empty() &&
        component.front() == std::filesystem::path::preferred_separator) {
      joined_path = std::filesystem::path(joined_path)
                        .append(std::filesystem::path(component).filename().string())
                        .string();
    } else {
      joined_path = std::filesystem::path(joined_path).append(component).string();
    }
  };
  (join(base, std::string_view(components)), ...);
  return base;
}
}  // namespace ray


text:
module ActsAsBlockable

  extend ActiveSupport::Concern

  class_methods do
    def blockable_by( user_id_finder, options = {} )
      validate do
        blocking_user_id = user_id_finder.call( self )
        blocking_user_id = blocking_user_id.id if blocking_user_id.is_a?( User )
        blockable_user_id = if options[:blockable_user_id]
          options[:blockable_user_id].call( self )
        else
          try(:user_id) || try(:user).try(:id)
        end
        if !blockable_user_id || !blocking_user_id
          true
        elsif UserBlock.where( user_id: [blocking_user_id, blockable_user_id], blocked_user_id: [blocking_user_id, blockable_user_id] ).exists?
          errors.add( :base, I18n.t( :you_dont_have_permission_to_do_that ) )
        end
        true
      end
    end
  end
end

ActiveRecord::Base.send(:include, ActsAsBlockable)


text:
const spawnSync = require('child_process').spawnSync;
const path = require('path');
const JEST_PATH = path.resolve(__dirname, '../packages/jest-cli/bin/jest.js');

// return the result of the spawned proccess:
//  [ 'status', 'signal', 'output', 'pid', 'stdout', 'stderr',
//    'envPairs', 'options', 'args', 'file' ]
function runJest(dir, args) {
  return spawnSync(JEST_PATH, args || [], {
    cwd: path.resolve(__dirname, dir),
  });
}

// Runs `jest` with `--json` option and adds `json` property to the result obj.
//   'success', 'startTime', 'numTotalTests', 'numTotalTestSuites',
//   'numRuntimeErrorTestSuites', 'numPassedTests', 'numFailedTests',
//   'numPendingTests', 'testResults', 'postSuiteHeaders'
runJest.json = function(dir, args) {
  args = Array.prototype.concat(args || [], '--json');
  const result = runJest(dir, args);
  result.json = JSON.parse((result.stdout || '').toString());
  return result;
};

module.exports = runJest;


text:
package com.github.avarabyeu.jashing.integration.jira.model;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

import java.net.URI;

/**
 * @author Andrei Varabyeo
 */
public class BasicIssue {

    private URI self;

    private String key;

    /**
     * @return URI of this issue
     */
    public URI getSelf() {
        return self;
    }

    /**
     * @return issue key
     */
    public String getKey() {
        return key;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this).
                add("self", self).
                add("key", key).
                toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof BasicIssue) {
            BasicIssue that = (BasicIssue) obj;
            return Objects.equal(this.self, that.self)
                    && Objects.equal(this.key, that.key);
        }
        return false;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(self, key);
    }
}


text:
package org.elasticsearch.search.aggregations.metrics;

import org.elasticsearch.search.aggregations.Aggregation;

import java.util.List;

public interface MultiValueAggregation extends Aggregation {

    /**
     * Return an iterable over all value names this multi value aggregation provides.
     *
     * The iterable might be created on the fly, if you need to call this multiple times, please
     * cache the result in a variable on caller side..
     *
     * @return iterable over all value names
     */
    Iterable<String> valueNames();

    /**
     * Return a list of all results with the specified name
     *
     * @param name of the value
     * @return list of all values formatted as string
     */
    List<String> getValuesAsStrings(String name);
}


text:
var mongoClient;
function mongoCol(collection) {
    this.collection = collection;
    mongoClient = new mongodb();
}

mongoCol.prototype = {
    getCollection: function (callback) {
        mongoClient.getCollection(this.collection, callback);
    },
    convertToObjectID: function (id) {
        return mongoClient.convertToObjectID(id);
    },
    findByObjectID: function (id, callback) {
        this.getCollection(function (err, col) {
            if (err)
                callback(err, null);
            else
                col.find({ _id: typeof (id) == "object" ? id : mongoClient.convertToObjectID(id) }).toArray(callback);
        });
    },
    insert: function (doc, callback) {

        if (!doc.createdOn) doc.createdOn = new Date();
        if (!doc.lastUpdated) doc.lastUpdated = new Date();

        this.getCollection(function (err, col) {
            if (err)
                callback(err, null);
            else {
                col.insert(doc, function (error, result) {
                    if (error)
                        callback(error, null);
                    else
                        callback(null, result)
                });
            }
        })
    },
    update: function (doc, options, callback) {
        if (!callback && typeof (options) == 'function') {
            callback = options;
            options = {};
        }

        this.getCollection(function (err, col) {
            if (err) {
                callback(err, null);
            }
            else {
                var query = undefined;
                if (doc._id) {
                    query = { _id: mongoClient.convertToObjectID(doc._id) };
                    delete doc._id;
                }
                else {
                    var extend = require('util')._extend;
                    delete doc._id;
                    query = extend({}, doc);
                }

                if (!doc.createdOn) doc.createdOn = new Date();
                if (!doc.lastUpdated) doc.lastUpdated = new Date();

                var updateQuery = undefined;
                if (options && options.$inc) {
                    updateQuery = { $inc: options.$inc };
                }
                else if (options && options.$set) {
                    updateQuery = { $set: options.$set };
                }
                else {
                    updateQuery = { $set: doc };
                }

                if (options && options.$unset) {
                    updateQuery.$unset = options.$unset;
                }

                col.update(query, updateQuery, { multi: true }, function (error, result) {
                    if (error)
                        callback(error, null);
                    else
                        callback(null, result)
                });
            }
        })
    },
    save: function (doc, options, callback) {

        if (!callback && typeof (options) == 'function') {
            callback = options;
            options = {};
        }

        if (!doc.createdOn) doc.createdOn = new Date();
        if (!doc.lastUpdated) doc.lastUpdated = new Date();

        this.getCollection(function (err, col) {
            if (err)
                callback(err, null);
            else {
                col.save(doc, options, callback);
            }
        })
    },
    get: function (id, callback) {
        var selector = { _id: mongoClient.convertToObjectID(id) };
        this.find(selector, null, callback);
    },
    find: function (selector, options, callback) {

        if (!callback && typeof (options) == 'function') {
            callback = options;
            options = {};
        }

        if (options == null) options = {};
        if (!selector) selector = {};

        if (!options.includeDeleted || options.includeDeleted == false)
            selector.deletedOn = {$exists: false};//if can be ({$or: [{deleted:{$exists:false}}, {deleted:false}]})

        this.getCollection(function (err, col) {
            if (err)
                callback(err, null);
            else
                col.find(selector, options).toArray(callback);
        });
    },
    remove: function (selector, callback) {
        if (!callback) callback = function () {
        };
        this.getCollection(function (err, col) {
            if (err)
                callback(err, null);
            else
                col.remove(selector, callback);
        });
    },
    findAndRemove: function (selector, options, callback) {
        if (!callback && typeof (options) == 'function') {
            callback = options;
        }
        if (!callback) callback = function () {
        };
        this.getCollection(function (err, col) {
            if (err) {
                callback(err, null);
            }
            else {
                var updateQuery = { $set: { deletedOn: new Date() } };
                selector.deletedOn = { $exists: false };
                col.update(selector, updateQuery, function (error, result) {
                    if (error)
                        callback(error, null);
                    else
                        callback(null, result)
                });
            }
        });
    },
    findByPage: function (selector, pagination, callback) {
        if (!callback && typeof (pagination) == 'function') {
            callback = pagination;
            pagination = {};
        }

        if (pagination == null) pagination = {};
        if (!selector) selector = {};

        selector.deletedOn = { $exists: false };
        this.getCollection(function (err, col) {
            if (err)
                callback(err, null);
            else {
                col.find(selector).sort({ lastUpdated: -1 }).skip((pagination.pageNumber - 1) * pagination.pageSize).limit(pagination.pageSize).toArray(callback);
            }
        });
    },
    findCount: function (selector, callback) {
        if (!selector) selector = {};

        //selector.deletedOn = {$exists: false};
        this.getCollection(function (err, col) {
            if (err) {
                callback(err, null);
            }
            else {
                col.count(selector, callback);
            }
        });
    },
    findLastRecords: function (selector, callback) {
        var self = this;
        this.getCollection(function (err, col) {
            if (err)
                callback(err, null);
            else
                col.find(selector).sort({ lastUpdated: -1 }).limit(self.lastSentNotificationsNumber).toArray(callback);
        });
    },
    group: function (keys, condition, initial, reduce, callback) {
        this.getCollection(function (err, col) {
            if (err)
                callback(err, null);
            else
                col.group(keys, condition, initial, reduce, callback);
        });
    }
};

module.exports = mongoCol;


text:
subtitle: 'Tutorial: Baseline Migrations'
redirect_from: Tutorials/stateScripts
---
# Tutorial: Baseline Migrations
{% include teams.html %}

This brief tutorial will teach you **how to use baseline migrations**.

## Introduction

Over the lifetime of a project, many database objects may be created and destroyed across many migrations which leaves behind a lengthy history of migrations that need to be applied in order to bring a new environment up to speed.

Instead, you might wish to add a single, cumulative migration that represents the state of your database after all of those migrations have been applied without disrupting existing environments.

[Baseline migrations](Concepts/Baseline Migrations) let you achieve just that. These are a new type of migration, similar to [versioned migrations](Concepts/migrations#versioned-migrations) except with `B` as their prefix.

In existing deployments they have no effect as your database is already where it needs to be. In new environments, the baseline migration with the latest version is applied first in order to bring your database up to speed before applying later migrations. Any migrations with a version older than the latest baseline migration's version are not applied and are treated as being [ignored](Concepts/migrations#migration-states). <br/>
Note that repeatable migrations are executed as normal.

## Example

Let's say we have the following 3 migrations:

```
V1__create_two_tables.sql
V2__drop_one_table.sql
V3__alter_column.sql
```

If we execute these migrations in order we will have gone through the process of creating two tables, dropping one of them and finally altering a column in the remaining table.

Instead of going through this process for every one of our environments, we might decide that it is easier to create the final table as it would be at the end of applying these 3 migrations in order to simplify the SQL we execute as well as our migration history.

To achieve this, we need only create the following migration:

```
B3__create_table.sql
```

This should contain the SQL that represents our environment after the original 3 migrations are applied. After adding this migration to our existing environment, we will notice no difference as shown in the below output after running `flyway info`:

```
+-----------+---------+-------------------+------+---------------------+---------+----------+
| Category  | Version | Description       | Type | Installed On        | State   | Undoable |
+-----------+---------+-------------------+------+---------------------+---------+----------+
| Versioned | 1       | create two tables | SQL  |         ...         | Success | No       |
| Versioned | 2       | drop one table    | SQL  |         ...         | Success | No       |
| Versioned | 3       | alter column      | SQL  |         ...         | Success | No       |
+-----------+---------+-------------------+------+---------------------+---------+----------+
```

However, when we come to apply our migrations in a new environment, `flyway info` will show the following output:

```
+-----------+---------+--------------+------------------+--------------+---------+----------+
| Category  | Version | Description  | Type             | Installed On | State   | Undoable |
+-----------+---------+--------------+------------------+--------------+---------+----------+
| Versioned | 3       | create table |   SQL_BASELINE   |              | Pending | No       |
+-----------+---------+--------------+------------------+--------------+---------+----------+
```

Migrations with a version less than or equal to the latest baseline migration's version are ignored. Running `flyway migrate` will cause just the `B3` script to be applied, and the history table will show this as a result:

```
+-----------+---------+--------------+------------------+---------------------+----------+----------+
| Category  | Version | Description  | Type             | Installed On        | State    | Undoable |
+-----------+---------+--------------+------------------+---------------------+----------+----------+
| Versioned | 3       | create table |   SQL_BASELINE   |         ...         | Baseline | No       |
+-----------+---------+--------------+------------------+---------------------+----------+----------+
```

## Summary

In this brief tutorial we saw how to:

- Use baseline migrations to signal a new baseline in new environments


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using TelegramBot.TelegramSubject;
using static TelegramBot.EventTypes.EventType;

namespace TelegramBot
{
    class Program
    {
        static void Main(string[] args)
        {
            TelegramRequest Tr = new TelegramRequest(Settings.Default.Token);
            #region Events
            Tr.MessageText += Tr_MessageText;
            Tr.MessageSticker += Tr_MessageSticker;
            Tr.MessagePhoto += Tr_MessagePhoto;
            Tr.MessageVideo += Tr_MessageVideo;
            Tr.MessageDocument += Tr_MessageDocument;
            Tr.MessageLocation += Tr_MessageLocation;
            Tr.MessageContact += Tr_MessageContact;
            Tr.MessageVoice += Tr_MessageVoice;
            #endregion

            Task taskcompleatemsg = new Task( ()=>Tr.GetUpdates());
            taskcompleatemsg.Start();
            MethodBot mb = new MethodBot(Settings.Default.Token);
            Console.ReadKey();
        }

        private static void Tr_MessageText(object sendr, MessageText<User, Chat> e)
        {

            Console.WriteLine("ID сообщения:{0}\nID отправителя:{1}\nНик отправителя:{2}\nИмя:{3} Фамилия:{4}\nДата:{5}\nТекст сообщения:{6}",
               e.DefaultMessageInfo.MessageId, e.DefaultMessageInfo.From.Id, e.DefaultMessageInfo.From.Username,
               e.DefaultMessageInfo.From.First_name, e.DefaultMessageInfo.From.Last_name,
               e.DefaultMessageInfo.DateReveiver, e.Text);
        }
        private static void Tr_MessageSticker(object sendr, MessageSticker<User, Chat> e)
        {

        }
        private static void Tr_MessagePhoto(object sendr, MessagePhoto<User, Chat> e)
        {

        }
        private static void Tr_MessageVideo(object sendr, MessageVideo<User, Chat> e)
        {

        }
        private static void Tr_MessageDocument(object sendr, MessageDocument<User, Chat> e)
        {

        }
        private static void Tr_MessageLocation(object sendr, MessageLocation<User, Chat> e)
        {

        }
        private static void Tr_MessageContact(object sendr, MessageContact<User, Chat> e)
        {

        }
        private static void Tr_MessageVoice(object sendr, MessageVoice<User, Chat> e)
        {

        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FredrikScript.Core.Types;

namespace FredrikScript.Core.Expressions
{
    public class ReturnValueExpression : UnaryExpression
    {
        public ReturnValueExpression(Context context, SourceInformation sourceInformation, Expression value) : base(context, sourceInformation, value)
        {
        }

        public override IType ExpressionType => Context?.Types["void"];
        public virtual IType ValueType => Value.ExpressionType;
    }
}


text:
namespace base {
class FilePath;
}

namespace net {
namespace test_server {
class EmbeddedTestServer;
struct HttpRequest;
}
}

namespace web {
class ResponseProvider;
}

namespace web {
namespace test {

// A convience class for wrapping a ResponseProvider so that it can be used
// inside data structures that operate on ref counted objects. This class is a
// ref counted container for a ResponseProvider.
// This object exists for legacy reasons since a large part of the code base
// still uses ResponseProviders that are not ref counted.
class RefCountedResponseProviderWrapper
    : public base::RefCounted<RefCountedResponseProviderWrapper> {
 public:
  // Main constructor.
  explicit RefCountedResponseProviderWrapper(
      std::unique_ptr<ResponseProvider> response_provider);
  // Returns the ResponseProvider that backs this object.
  ResponseProvider* GetResponseProvider() { return response_provider_.get(); }

 private:
  friend class base::RefCounted<RefCountedResponseProviderWrapper>;
  // The ResponseProvider that backs this object.
  std::unique_ptr<ResponseProvider> response_provider_;
  virtual ~RefCountedResponseProviderWrapper();
};

// The HttpServer is an in-process web server that is used to service requests.
// It is a singleton and backed by a EmbeddedTestServer.
// HttpServer can be configured to serve requests by registering
// web::ResponseProviders.
// This class is not thread safe on the whole and only certain methods are
// thread safe.
class HttpServer : public base::RefCountedThreadSafe<HttpServer> {
 public:
  typedef std::vector<std::unique_ptr<ResponseProvider>> ProviderList;

  // Returns the shared HttpServer instance. Thread safe.
  static HttpServer& GetSharedInstance();
  // Returns the shared HttpServer instance and registers the response providers
  // as well. Takes ownership of the response providers. Must be called from the
  // main thread.
  static HttpServer& GetSharedInstanceWithResponseProviders(
      ProviderList response_providers);

  HttpServer(const HttpServer&) = delete;
  HttpServer& operator=(const HttpServer&) = delete;

  // A convenience method for the longer form of
  // |web::test::HttpServer::GetSharedInstance().MakeUrlForHttpServer|
  static GURL MakeUrl(const std::string& url);
  // Starts the server on the default port 8080. CHECKs if the server can not be
  // started.
  // Must be called from the main thread.
  void StartOrDie(const base::FilePath& files_path);
  // Stops the server and prevents it from accepting new requests.
  // Must be called from the main thread.
  void Stop();
  // Sets the server to hang and return no response.
  void SetSuspend(bool suspended);
  // Returns true if the server is running.
  // Must be called from the main thread.
  bool IsRunning() const;

  // Returns the port that the server is running on. Thread Safe
  NSUInteger GetPort() const;

  // Adds a ResponseProvider. Takes ownership of the ResponseProvider.
  // Note for using URLs inside of the |response_provider|:
  // The HttpServer cannot run on default HTTP port 80, so URLs used in
  // ResponseProviders must be converted at runtime after the HttpServer's port
  // is determined. Please use |MakeUrl| to handle converting URLs.
  // Must be called from the main thread.
  void AddResponseProvider(std::unique_ptr<ResponseProvider> response_provider);
  // Removes the |response_provider|. Must be called from the main thread.
  void RemoveResponseProvider(ResponseProvider* response_provider);
  // Removes all the response providers. Must be called from the main thread.
  void RemoveAllResponseProviders();

 private:
  friend class base::RefCountedThreadSafe<HttpServer>;
  HttpServer();
  ~HttpServer();

  // Sets the port that the server is running on. Thread Safe
  void SetPort(NSUInteger port);

  // Creates a GURL that the server can service based on the |url|
  // passed in.
  // It does not rewrite URLs if the |url| can already be serviced by the
  // server.
  // |url| must be a valid URL. Thread safe.
  GURL MakeUrlForHttpServer(const std::string& url) const;

  // Returns the response provider that can handle the |request|.
  // Note: No more than one response provider can handle the request.
  // Thread safe.
  scoped_refptr<RefCountedResponseProviderWrapper>
  GetResponseProviderForRequest(const web::ResponseProvider::Request& request);

  // Lock for serializing access to |provider_|.
  mutable base::Lock provider_list_lock_;
  // Lock for serializing access to |port_|.
  mutable base::Lock port_lock_;
  // The port that the server is running on. 0 if the server is not running.
  NSUInteger port_;
  // The EmbeddedTestServer backing the HttpServer.
  std::unique_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_;
  // The list of providers to service a request.
  std::vector<scoped_refptr<RefCountedResponseProviderWrapper>> providers_;
  // Returns the response providers for a request.
  ResponseProvider* GetResponseProviderForProviderRequest(
      const web::ResponseProvider::Request& request);
  // Provides a shim between EmbeddedTestServer and ResponseProvider. This
  // handler converts an EmbeddedTestServer request to ResponseProvider
  // request, look up the corresponding providers, and then converts the
  // ResponseProvider response back to EmbeddedTestServer response.
  std::unique_ptr<net::test_server::HttpResponse> GetResponse(
      const net::test_server::HttpRequest& request);
  // Status tracking if the server is hung.
  bool isSuspended;
};

}  // namespace test
}  // namspace web

#endif  // IOS_WEB_PUBLIC_TEST_HTTP_SERVER_HTTP_SERVER_H_


text:
package in.mused.api.service;

public class UserConnectionServiceImpl implements UserConnectionService {
}


text:
import { Aggregator } from "../../aggregator";
import { Options } from "../../core";
import { compose, Iterator, Lazy } from "../../lazy";
import { RawObject } from "../../types";
import { isString } from "../../util";

interface InputExpr {
  readonly coll: RawObject[];
  readonly pipeline?: RawObject[];
}

/**
 * Performs a union of two collections.
 *
 * @param collection
 * @param expr
 * @param opt
 */
export function $unionWith(
  collection: Iterator,
  expr: InputExpr,
  options?: Options
): Iterator {
  const array = isString(expr.coll)
    ? options?.collectionResolver(expr.coll)
    : expr.coll;

  const iterators = [collection];
  iterators.push(
    expr.pipeline
      ? new Aggregator(expr.pipeline, options).stream(array)
      : Lazy(array)
  );

  return compose(...iterators);
}


text:
#ifndef AsdkCurveText_H
#define AsdkCurveText_H

#include "stdafx.h"
#include <dbcurve.h>

//CURVETEXTDBX is defined in the curveText DB project
//export or import the class depending on the
//CURVETEXTDBX symbol
class
#ifdef CURVETEXTDBX
_declspec(dllexport)
#endif
AsdkCurveText : public AcDbCurve
{
public:
	// constructors / destructor
    AsdkCurveText();
	AsdkCurveText(AcDbCurve *pCurve);
	AsdkCurveText(AcDbCurve *pCurve, const AsdkCurveText *pCurveText);
    ~AsdkCurveText();

	// AcRxObject methods
    ACRX_DECLARE_MEMBERS(AsdkCurveText);

	// AcDbEntity methods
	Acad::ErrorStatus	setLayer			(AcDbObjectId newVal,
											 Adesk::Boolean doSubents = Adesk::kTrue);
	Acad::ErrorStatus	setLayer			(const char* newVal,
											 Adesk::Boolean doSubents = Adesk::kTrue);

	Acad::ErrorStatus	setLinetype			(AcDbObjectId newVal,
											 Adesk::Boolean doSubents = Adesk::kTrue);
	Acad::ErrorStatus	setLinetype			(const char* newVal,
											 Adesk::Boolean doSubents = Adesk::kTrue);

	Acad::ErrorStatus	setColor			(const AcCmColor& color,
											 Adesk::Boolean doSubents = Adesk::kTrue);

	Acad::ErrorStatus	setLinetypeScale	(double ltscale,
											 Adesk::Boolean doSubents = Adesk::kTrue);

	Acad::ErrorStatus	setLineWeight		(AcDb::LineWeight newVal,
											 Adesk::Boolean doSubents = Adesk::kTrue);

	Adesk::Boolean		worldDraw			(AcGiWorldDraw* pMode);

    Acad::ErrorStatus	dxfInFields			(AcDbDxfFiler* filer);

    Acad::ErrorStatus	dxfOutFields		(AcDbDxfFiler* filer) const;

    Acad::ErrorStatus	dwgInFields			(AcDbDwgFiler* filer);

    Acad::ErrorStatus	dwgOutFields		(AcDbDwgFiler* filer) const;

	Acad::ErrorStatus	transformBy			(const AcGeMatrix3d& xform);

	void				getEcs				(AcGeMatrix3d& retVal) const;

	AcDbEntity*			subentPtr			(const AcDbFullSubentPath& path) const;

	void				saveAs				(AcGiWorldDraw* wd, AcDb::SaveType st);

	Acad::ErrorStatus	getGripPoints		(AcGePoint3dArray& gripPoints,
											 AcDbIntArray&     osnapModes,
											 AcDbIntArray&     geomIds) const;

	Acad::ErrorStatus	getStretchPoints	(AcGePoint3dArray& stretchPoints) const;

	Acad::ErrorStatus	getOsnapPoints		(AcDb::OsnapMode   osnapMode,
											 int gsSelectionMark,
											 const AcGePoint3d& pickPoint,
											 const AcGePoint3d& lastPoint,
											 const AcGeMatrix3d& viewXform,
											 AcGePoint3dArray& snapPoints,
											 AcDbIntArray&     geomIds) const;

	Acad::ErrorStatus	moveGripPointsAt	(const AcDbIntArray& indices,
											 const AcGeVector3d& offset);
	Acad::ErrorStatus	moveStretchPointsAt	(const AcDbIntArray& indices,
											 const AcGeVector3d& offset);
	Acad::ErrorStatus   getTransformedCopy	(const AcGeMatrix3d& xform,
										     AcDbEntity*&  pEnt) const;
	Acad::ErrorStatus	getGeomExtents		(AcDbExtents& extents) const;

	Acad::ErrorStatus	explode				(AcDbVoidPtrArray& entitySet) const;

	Acad::ErrorStatus getGsMarkersAtSubentPath(const AcDbFullSubentPath& subPath,
											   AcDbIntArray&       gsMarkers) const;

	Acad::ErrorStatus getSubentPathsAtGsMarker(AcDb::SubentType    type,
											   int                 gsMark,
											   const AcGePoint3d&  pickPoint,
											   const AcGeMatrix3d& viewXform,
											   int&                numPaths,
											   AcDbFullSubentPath* subentPaths,
											   int                 numInserts = 0,
											   AcDbObjectId*       entAndInsertStack = NULL) const;

	Acad::ErrorStatus boundingBoxIntersectWith(const AcDbEntity* pEnt,
											   AcDb::Intersect   intType,
											   AcGePoint3dArray& points,
											   int               thisGsMarker,
											   int               otherGsMarker) const;

	Acad::ErrorStatus boundingBoxIntersectWith	(const AcDbEntity*	pEnt,
												 AcDb::Intersect	intType,
												 const AcGePlane&	projPlane,
												 AcGePoint3dArray&	points,
												 int				thisGsMarker,
												 int				otherGsMarker) const;

	Acad::ErrorStatus intersectWith				(const AcDbEntity* pEnt,
												 AcDb::Intersect   intType,
												 AcGePoint3dArray& points,
												 int               thisGsMarker = 0,
												 int               otherGsMarker= 0) const;

	Acad::ErrorStatus intersectWith(const AcDbEntity* pEnt,
									AcDb::Intersect   intType,
									const AcGePlane&  projPlane,
									AcGePoint3dArray& points,
									int               thisGsMarker = 0,
									int               otherGsMarker= 0) const;

	void				list() const;

	// AcDbCurve methods
	DBCURVE_METHODS

	// AsdkCurveText specific methods
	Adesk::Boolean		AcGiFiler			(AcGiWorldDraw* wd, AcDb::SaveType st, AcDbVoidPtrArray&) const ;

	AcGeVector3d		getNormal()		const {assertReadEnabled(); return m_normal;}
	CString				getString()		const {assertReadEnabled(); return m_string;}
	Acad::ErrorStatus	getStyle(CString styleName)	const;
	AcDbObjectId		getStyle()		const {assertReadEnabled(); return m_styleId;}
	double				getSize()		const {assertReadEnabled(); return m_size;}
	double				getSpace()		const {assertReadEnabled(); return m_space;}
	bool				isCurveShown()	const {assertReadEnabled(); return m_showCurve;}
	bool				isTextShown()	const {assertReadEnabled(); return m_showText;}
	bool				isFit()			const {assertReadEnabled(); return m_fit;}
	bool				isRepeatText()	const {assertReadEnabled(); return m_repeat;}
	double				getStartDist()	const {assertReadEnabled(); return m_startDist;}
	double				getLength()		const {assertReadEnabled(); return m_length; }
	Adesk::Int8			getPosition()	const {assertReadEnabled(); return m_position; }
	bool				isReversed()	const {assertReadEnabled(); return m_reverse; }

	void				setNormal(AcGeVector3d normal)	{assertWriteEnabled(); m_normal = normal;}
	void				setString(CString string)		{assertWriteEnabled(); m_string = string;}
	void				setStyle(AcDbObjectId styleId)	{assertWriteEnabled(); m_styleId = styleId;}
	void				setStyle(CString stylerName);
	void				setSize(double size)			{assertWriteEnabled(); m_size = size;}
	void				setSpace(double space)			{assertWriteEnabled(); m_space = space;}
	void				showCurve(bool show)			{assertWriteEnabled(); m_showCurve = show;}
	void				showText(bool show)				{assertWriteEnabled(); m_showText = show;}
	void				setFit(bool fit)				{assertWriteEnabled(); m_fit = fit;}
	void				setRepeatText(bool repeat)		{assertWriteEnabled(); m_repeat = repeat;}
	void				setRepeatText(BOOL repeat)		{assertWriteEnabled(); m_repeat = repeat? true : false;}
	void				setReverse(BOOL reverse)		{assertWriteEnabled(); m_reverse = reverse? true : false;}
	void				setReverse(bool reverse)		{assertWriteEnabled(); m_reverse = reverse;}
	void				setStartDist(double dist)		{assertWriteEnabled(); m_startDist = dist;}
	void				setLength(double dist)			{assertWriteEnabled(); m_length = dist;}
	void				setPosition(Adesk::Int8 pos)	{assertWriteEnabled(); m_position = pos;}
	void				setCurvePtr(AcDbCurve *pCurve);
	void				setProperties();
	void				setInJig(bool isInJig)			{m_isInJig = isInJig;}

private:

	AcGeVector3d		m_normal;
	CString				m_string;
	AcDbHardPointerId	m_styleId;
	bool				m_showCurve;
	bool				m_showText;
	bool				m_fit;
	bool				m_reverse;
	bool				m_repeat;
	double				m_size;
	double				m_space;
	double				m_startDist;
	double				m_length;
	Adesk::Int8			m_position;
	AcDbCurve*			m_pCurve;
	bool				m_isInJig;
};

#endif


text:
package br.ita.bditac.mobile.alertas;

import android.app.Activity;
import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import java.util.HashMap;
import java.util.Map;

import br.ita.bditac.ws.model.Alerta;

public class AlertaDetailFragment extends Fragment {

    public static final String ARG_ITEM_ID="item_id";

    private Alerta mItem;

    public AlertaDetailFragment() {
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if(getArguments().containsKey(ARG_ITEM_ID)) {
            // Load the dummy content specified by the fragment
            // arguments. In a real-world scenario, use a Loader
            // to load content from a content provider.
            Map<String, Alerta> alertaMap = new HashMap<>();
            for(Alerta alerta : AlertaListActivity.ALERTAS_LIST) alertaMap.put(new Integer(alerta.getId()).toString(), alerta);
            String argItem = getArguments().getString(ARG_ITEM_ID);
            mItem = alertaMap.get(argItem);

            Activity activity=this.getActivity();
            CollapsingToolbarLayout appBarLayout=(CollapsingToolbarLayout) activity.findViewById(R.id.toolbar_layout);
            if(appBarLayout != null) {
                appBarLayout.setTitle(mItem.getDescricaoResumida());
            }
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView=inflater.inflate(R.layout.alerta_detail, container, false);

        // Show the dummy content as text in a TextView.
        if(mItem != null) {
            ((TextView) rootView.findViewById(R.id.alerta_detail)).setText(mItem.getDescricaoCompleta());
        }

        return rootView;
    }
}


text:
class RawString2JavaStringHolder {
private:
    JNIEnv *mJNIEnv;
    jstring mJString;
public:
    RawString2JavaStringHolder(JNIEnv *mJNIEnv, const Text &);

    jstring toJstring();

    ~RawString2JavaStringHolder();
};

#endif //MULANANDROID_RAWSTRING2JAVASTRINGHOLDER_H


text:
#pragma once
#include <aws/elasticmapreduce/EMR_EXPORTS.h>
#include <aws/elasticmapreduce/EMRRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace EMR
{
namespace Model
{

  /**
   *
This input determines which cluster to describe.

See Also:

   * AWS
   * API Reference

   */
  class AWS_EMR_API DescribeClusterRequest : public EMRRequest
  {
  public:
    DescribeClusterRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "DescribeCluster"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The identifier of the cluster to describe.

     */
    inline const Aws::String& GetClusterId() const{ return m_clusterId; }

    /**
     *
The identifier of the cluster to describe.

     */
    inline void SetClusterId(const Aws::String& value) { m_clusterIdHasBeenSet = true; m_clusterId = value; }

    /**
     *
The identifier of the cluster to describe.

     */
    inline void SetClusterId(Aws::String&& value) { m_clusterIdHasBeenSet = true; m_clusterId = std::move(value); }

    /**
     *
The identifier of the cluster to describe.

     */
    inline void SetClusterId(const char* value) { m_clusterIdHasBeenSet = true; m_clusterId.assign(value); }

    /**
     *
The identifier of the cluster to describe.

     */
    inline DescribeClusterRequest& WithClusterId(const Aws::String& value) { SetClusterId(value); return *this;}

    /**
     *
The identifier of the cluster to describe.

     */
    inline DescribeClusterRequest& WithClusterId(Aws::String&& value) { SetClusterId(std::move(value)); return *this;}

    /**
     *
The identifier of the cluster to describe.

     */
    inline DescribeClusterRequest& WithClusterId(const char* value) { SetClusterId(value); return *this;}

  private:

    Aws::String m_clusterId;
    bool m_clusterIdHasBeenSet;
  };

} // namespace Model
} // namespace EMR
} // namespace Aws


text:
<?php

namespace Katana\Sdk\Schema;

class ParamValidation
{
    /**
     * Defines an ECMA 262 compliant regular expression to validate the value.
     *
     * @var string
     */
    private $pattern = '';

    /**
     * Defines the maximum value allowed for the given parameter.
     *
     * @var int
     */
    private $maximum = PHP_INT_MAX;

    /**
     * Defines that the value of the parameter MUST be less than maximum.
     *
     * @var bool
     */
    private $exclusiveMaximum = false;

    /**
     * Defines the minimum value allowed for the given parameter.
     *
     * @var int
     */
    private $minimum = ~PHP_INT_MAX;

    /**
     * Defines that the value of the parameter MUST be greater than minimum.
     *
     * @var bool
     */
    private $exclusiveMinimum = false;

    /**
     * Defines the maximum length of the parameter if type is set to string.
     *
     * @var int
     */
    private $maximumLength = -1;

    /**
     * Defines the minimum length of the parameter if type is set to string.
     *
     * @var int
     */
    private $minimumLength = -1;

    /**
     * Defines the maximum size of the parameter if type is set to array.
     *
     * @var int
     */
    private $maximumItems = -1;

    /**
     * Defines the minimum size of the parameter if type is set to array.
     *
     * @var int
     */
    private $minimumItems = -1;

    /**
     * Defines that a parameter MUST contain a set of unique elements.
     *
     * @var bool
     */
    private $uniqueItems = false;

    /**
     * Defines a list of unique values that the value of the parameter MUST equal.
     *
     * @var array
     */
    private $enum = [];

    /**
     * Defines that the division of the parameter by this value MUST be an integer.
     *
     * @var int
     */
    private $multipleOf = -1;

    /**
     * @param string $pattern
     * @param int $maximum
     * @param bool $exclusiveMaximum
     * @param int $minimum
     * @param bool $exclusiveMinimum
     * @param int $maximumLength
     * @param int $minimumLength
     * @param int $maximumItems
     * @param int $minimumItems
     * @param bool $uniqueItems
     * @param array $enum
     * @param int $multipleOf
     */
    public function __construct(
        $pattern,
        $maximum,
        $exclusiveMaximum,
        $minimum,
        $exclusiveMinimum,
        $maximumLength,
        $minimumLength,
        $maximumItems,
        $minimumItems,
        $uniqueItems,
        array $enum,
        $multipleOf
    ) {
        $this->pattern = $pattern;
        $this->maximum = $maximum;
        $this->exclusiveMaximum = $exclusiveMaximum;
        $this->minimum = $minimum;
        $this->exclusiveMinimum = $exclusiveMinimum;
        $this->maximumLength = $maximumLength;
        $this->minimumLength = $minimumLength;
        $this->maximumItems = $maximumItems;
        $this->minimumItems = $minimumItems;
        $this->uniqueItems = $uniqueItems;
        $this->enum = $enum;
        $this->multipleOf = $multipleOf;
    }

    /**
     * @return string
     */
    public function getPattern()
    {
        return $this->pattern;
    }

    /**
     * @return int
     */
    public function getMax()
    {
        return $this->maximum;
    }

    /**
     * @return boolean
     */
    public function isExclusiveMax()
    {
        return $this->exclusiveMaximum;
    }

    /**
     * @return int
     */
    public function getMin()
    {
        return $this->minimum;
    }

    /**
     * @return boolean
     */
    public function isExclusiveMin()
    {
        return $this->exclusiveMinimum;
    }

    /**
     * @return int
     */
    public function getMaxLength()
    {
        return $this->maximumLength;
    }

    /**
     * @return int
     */
    public function getMinLength()
    {
        return $this->minimumLength;
    }

    /**
     * @return int
     */
    public function getMaxItems()
    {
        return $this->maximumItems;
    }

    /**
     * @return int
     */
    public function getMinItems()
    {
        return $this->minimumItems;
    }

    /**
     * @return boolean
     */
    public function hasUniqueItems()
    {
        return $this->uniqueItems;
    }

    /**
     * @return array
     */
    public function getEnum()
    {
        return $this->enum;
    }

    /**
     * @return int
     */
    public function getMultipleOf()
    {
        return $this->multipleOf;
    }

}


text:
package com.amazonaws.services.opsworks.model;

import java.io.Serializable;

/**
 *

 * Describes the configuration manager.
 *

 */
public class StackConfigurationManager implements Serializable, Cloneable {

    /**
     * The name. This parameter must be set to "Chef".
     */
    private String name;

    /**
     * The Chef version. This parameter must be set to 0.9, 11.4, or 11.10.
     * The default value is 11.4.
     */
    private String version;

    /**
     * The name. This parameter must be set to "Chef".
     *
     * @return The name. This parameter must be set to "Chef".
     */
    public String getName() {
        return name;
    }

    /**
     * The name. This parameter must be set to "Chef".
     *
     * @param name The name. This parameter must be set to "Chef".
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * The name. This parameter must be set to "Chef".
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param name The name. This parameter must be set to "Chef".
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public StackConfigurationManager withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * The Chef version. This parameter must be set to 0.9, 11.4, or 11.10.
     * The default value is 11.4.
     *
     * @return The Chef version. This parameter must be set to 0.9, 11.4, or 11.10.
     *         The default value is 11.4.
     */
    public String getVersion() {
        return version;
    }

    /**
     * The Chef version. This parameter must be set to 0.9, 11.4, or 11.10.
     * The default value is 11.4.
     *
     * @param version The Chef version. This parameter must be set to 0.9, 11.4, or 11.10.
     *         The default value is 11.4.
     */
    public void setVersion(String version) {
        this.version = version;
    }

    /**
     * The Chef version. This parameter must be set to 0.9, 11.4, or 11.10.
     * The default value is 11.4.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param version The Chef version. This parameter must be set to 0.9, 11.4, or 11.10.
     *         The default value is 11.4.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public StackConfigurationManager withVersion(String version) {
        this.version = version;
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getName() != null) sb.append("Name: " + getName() + ",");
        if (getVersion() != null) sb.append("Version: " + getVersion() );
        sb.append("}");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;

        if (obj instanceof StackConfigurationManager == false) return false;
        StackConfigurationManager other = (StackConfigurationManager)obj;

        if (other.getName() == null ^ this.getName() == null) return false;
        if (other.getName() != null && other.getName().equals(this.getName()) == false) return false;
        if (other.getVersion() == null ^ this.getVersion() == null) return false;
        if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) return false;
        return true;
    }

    @Override
    public StackConfigurationManager clone() {
        try {
            return (StackConfigurationManager) super.clone();

        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }

    }

}


text:
<?php
/**
 * 客户端 图片轮换 生成类
 * @category iCMS
 * @package iCMS_FrameWork1_RuleClass_Gen_Document
 * @author zhangchi
 */
class PicSliderClientGen extends BaseClientGen implements IBaseClientGen {

    /**
     * 引导方法
     * @return string 返回执行结果
     */
    public function GenClient(){
        $result = "";
        $function = Control::GetRequest("f", "");
        switch ($function) {

            case "list":
                $result = self::GenList();
                break;

        }
        $result = str_ireplace("{function}", $function, $result);
        return $result;
    }

    /**
     * 返回列表数据集
     * @return string
     */
    public function GenList(){

        $result = "[{}]";
        $resultCode = 0;

        $channelId = Control::GetRequest("channel_id", 0);

        if($channelId>0){
            $topCount = Control::GetRequest("top", 5);
            $state = Control::GetRequest("state", 30);
            $orderBy = Control::GetRequest("order", 0);

            $picSliderClientData = new PicSliderClientData();
            $arrList = $picSliderClientData->GetList(
                $channelId,
                $topCount,
                $state,
                $orderBy
            );
            if (count($arrList) > 0) {
                $resultCode = 1;
                $result = Format::FixJsonEncode($arrList);
            }else{
                $resultCode = -2;
            }
        }else{
            $resultCode = -1;
        }

        return '{"result_code":"'.$resultCode.'","pic_slider":{"pic_slider_list":' . $result . '}}';
    }

}


text:
package VMOMI::SoftwarePackageConstraint;
use parent 'VMOMI::SimpleType';

use strict;
use warnings;

1;