text:
from testing.test_interpreter import BaseTestInterpreter, hippy_fail

class TestArrayAccess(BaseTestInterpreter):

    def test_arrayaccess_interface(self):
        with self.warnings([
            'Fatal error: Class X contains 4 abstract methods and must '
            'therefore be declared abstract or implement the remaining '
            'methods (ArrayAccess::offsetExists, ArrayAccess::offsetGet, '
            'ArrayAccess::offsetSet, ...)'
            ]):
            self.run('''
            class X implements ArrayAccess {}
            ''')

    def test_arrayaccess_basic_usage(self):
        output = self.run('''
        class obj implements ArrayAccess {
            private $container = array();
            public function __construct() {
                $this->container = array(
                    "one" => 1,
                    "two" => 2,
                    "three" => 3,
                );
            }
            public function offsetSet($offset, $value) {
                if (is_null($offset)) {
                    $this->container[] = $value;
                } else {
                    $this->container[$offset] = $value;
                }
            }
            public function offsetExists($offset) {
                return isset($this->container[$offset]);
            }
            public function offsetUnset($offset) {
                unset($this->container[$offset]);
            }
            public function offsetGet($offset) {
                return isset($this->container[$offset]) ? $this->container[$offset] : null;
            }
        }

        $obj = new obj;

        echo isset($obj["two"]);
        echo $obj["two"];
        unset($obj["two"]);
        echo isset($obj["two"]);
        $obj["two"] = "A value";
        echo $obj["two"];
        $obj[] = "Append 1";
        $obj[] = "Append 2";
        echo $obj[0];
        echo $obj[1];
        ''')
        assert self.space.is_true(output[0])
        assert self.space.int_w(output[1]) == 2
        assert not self.space.is_true(output[2])
        assert self.space.str_w(output[3]) == "A value"
        assert self.space.str_w(output[4]) == "Append 1"
        assert self.space.str_w(output[5]) == "Append 2"

    def test_empty(self):
        output = self.run('''
        class object implements ArrayAccess {

                public $a = array('1st', 1, 2=>'3rd', '4th'=>4);

                function offsetExists($index) {
                        echo __METHOD__ . "($index)";
                        return array_key_exists($index, $this->a);
                }
                function offsetGet($index) {
                        echo __METHOD__ . "($index)";
                        return $this->a[$index];
                }
                function offsetSet($index, $newval) {
                        echo __METHOD__ . "($index,$newval)";
                        return $this->a[$index] = $newval;
                }
                function offsetUnset($index) {
                        echo __METHOD__ . "($index)";
                        unset($this->a[$index]);
                }
        }
        $obj = new Object;
        echo empty($obj[0]);
        echo empty($obj[2]);
        echo empty($obj['4th']);
        echo empty($obj['5th']);
        ''')
        assert len(output) == 11
        assert self.space.str_w(output[0]) == 'object::offsetExists(0)'
        assert self.space.str_w(output[1]) == 'object::offsetGet(0)'
        assert output[2] == self.space.w_False
        assert self.space.str_w(output[3]) == 'object::offsetExists(2)'
        assert self.space.str_w(output[4]) == 'object::offsetGet(2)'
        assert output[5] == self.space.w_False
        assert self.space.str_w(output[6]) == 'object::offsetExists(4th)'
        assert self.space.str_w(output[7]) == 'object::offsetGet(4th)'
        assert output[8] == self.space.w_False
        assert self.space.str_w(output[9]) == 'object::offsetExists(5th)'
        assert output[10] == self.space.w_True

    def test_isset(self):
        output = self.run('''
        class object implements ArrayAccess {

                public $a = array('1st', 1, 2=>'3rd', '4th'=>4);

                function offsetExists($index) {
                        echo __METHOD__ . "($index)";
                        return array_key_exists($index, $this->a);
                }
                function offsetGet($index) {
                        echo __METHOD__ . "($index)";
                        return $this->a[$index];
                }
                function offsetSet($index, $newval) {
                        echo __METHOD__ . "($index,$newval)";
                        return $this->a[$index] = $newval;
                }
                function offsetUnset($index) {
                        echo __METHOD__ . "($index)";
                        unset($this->a[$index]);
                }
        }
        $obj = new Object;
        echo isset($obj[0]);
        echo isset($obj[2]);
        echo isset($obj['4th']);
        echo isset($obj['5th']);
        ''')
        assert len(output) == 8
        assert self.space.str_w(output[0]) == 'object::offsetExists(0)'
        assert output[1] == self.space.w_True
        assert self.space.str_w(output[2]) == 'object::offsetExists(2)'
        assert output[3] == self.space.w_True
        assert self.space.str_w(output[4]) == 'object::offsetExists(4th)'
        assert output[5] == self.space.w_True
        assert self.space.str_w(output[6]) == 'object::offsetExists(5th)'
        assert output[7] == self.space.w_False

    @hippy_fail(reason='Both STORE and SUFFIX_PLUSPLUS call pointer '
                        'store in the same way, there is no way to separate '
                        'implementation of the ++ case to raise a notice')
    def test_inplace_modification(self):
        with self.warnings([
                'Notice: Indirect modification of overloaded element of '
                'object has no effect']):
            output = self.run('''
            class object implements ArrayAccess {

                    public $a = array('1st', 1, 2=>'3rd', '4th'=>4);

                    function offsetExists($index) {
                            echo __METHOD__ . "($index)";
                            return array_key_exists($index, $this->a);
                    }
                    function offsetGet($index) {
                            echo __METHOD__ . "($index)";
                            static $a=1;
                            return $a;
                    }
                    function offsetSet($index, $newval) {
                            echo __METHOD__ . "($index,$newval)";
                            return $this->a[$index] = $newval;
                    }
                    function offsetUnset($index) {
                            echo __METHOD__ . "($index)";
                            unset($this->a[$index]);
                    }
            }

            $obj = new Object;

            var_dump($obj[2]);
            echo $obj[2]++;
            var_dump($obj[2]);
            ''')
        assert len(output) == 6
        assert self.space.str_w(output[0]) == 'object::offsetGet(2)'
        assert self.space.int_w(output[1]) == 1
        assert self.space.str_w(output[2]) == 'object::offsetGet(2)'
        assert self.space.int_w(output[3]) == 1
        assert self.space.str_w(output[4]) == 'object::offsetGet(2)'
        assert self.space.int_w(output[5]) == 1

    def test_notice_indirect_modification(self):
        with self.warnings([
            'Notice: Indirect modification of overloaded element of object has'
            ' no effect']):
            output = self.run('''
            class object implements ArrayAccess {
                    function offsetExists($index) { echo __METHOD__; }
                    function offsetGet($index) { return 1; }
                    function offsetSet($index, $newval) { }
                    function offsetUnset($index) { }
            }
            $obj = new Object;
            $x =& $obj[2];
            ''')
        assert not output

    def test_array_proxy(self):
        output = self.run('''
        interface ArrayProxyAccess extends ArrayAccess
        {
            function proxyGet($element);
            function proxySet($element, $index, $value);
            function proxyUnset($element, $index);
        }

        class ArrayProxy implements ArrayAccess
        {
            private $object;
            private $element;
            function __construct(ArrayProxyAccess $object, $element)
            {
                if (!$object->offsetExists($element))
                {
                    $object[$element] = array();
                }
                $this->object = $object;
                $this->element = $element;
            }

            function offsetExists($index) {
                echo __METHOD__ . "($this->element, $index)";
                return array_key_exists($index, $this->object->proxyGet($this->element));
            }

            function offsetGet($index) {
                echo __METHOD__ . "($this->element, $index)";
                $tmp = $this->object->proxyGet($this->element);
                return isset($tmp[$index]) ? $tmp[$index] : NULL;
            }

            function offsetSet($index, $value) {
                echo __METHOD__ . "($this->element, $index, $value)";
                $this->object->proxySet($this->element, $index, $value);
            }

            function offsetUnset($index) {
                echo __METHOD__ . "($this->element, $index)";
                $this->object->proxyUnset($this->element, $index);
            }
        }

        class Peoples implements ArrayProxyAccess
        {
            public $person;

            function __construct()
            {
                $this->person = array(array('name'=>'Foo'));
            }

            function offsetExists($index)
            {
                return array_key_exists($index, $this->person);
            }

            function offsetGet($index)
            {
                return new ArrayProxy($this, $index);
            }

            function offsetSet($index, $value)
            {
                $this->person[$index] = $value;
            }

            function offsetUnset($index)
            {
                unset($this->person[$index]);
            }

            function proxyGet($element)
            {
                return $this->person[$element];
            }

            function proxySet($element, $index, $value)
            {
                $this->person[$element][$index] = $value;
            }

            function proxyUnset($element, $index)
            {
                unset($this->person[$element][$index]);
            }
        }

        $people = new Peoples;

        echo $people->person[0]['name'];
        $people->person[0]['name'] = $people->person[0]['name'] . 'Bar';
        echo $people->person[0]['name'];
        $people->person[0]['name'] .= 'Baz';
        echo $people->person[0]['name'];

        $people = new Peoples;

        echo get_class($people[0]);
        echo $people[0]['name'];
        $people[0]['name'] = 'FooBar';
        echo $people[0]['name'];
        $people[0]['name'] = $people->person[0]['name'] . 'Bar';
        echo $people[0]['name'];
        $people[0]['name'] .= 'Baz';
        echo $people[0]['name'];
        unset($people[0]['name']);
        echo $people[0]['name'];
        $people[0]['name'] = 'BlaBla';
        echo $people[0]['name'];
        ''')
        assert len(output) == 22
        assert self.space.str_w(output[0]) == 'Foo'
        assert self.space.str_w(output[1]) == 'FooBar'
        assert self.space.str_w(output[2]) == 'FooBarBaz'
        assert self.space.str_w(output[3]) == 'ArrayProxy'
        assert self.space.str_w(output[4]) == 'ArrayProxy::offsetGet(0, name)'
        assert self.space.str_w(output[5]) == 'Foo'
        assert self.space.str_w(output[6]) == 'ArrayProxy::offsetSet(0, name, FooBar)'
        assert self.space.str_w(output[7]) == 'ArrayProxy::offsetGet(0, name)'
        assert self.space.str_w(output[8]) == 'FooBar'
        assert self.space.str_w(output[9]) == 'ArrayProxy::offsetSet(0, name, FooBarBar)'
        assert self.space.str_w(output[10]) == 'ArrayProxy::offsetGet(0, name)'
        assert self.space.str_w(output[11]) == 'FooBarBar'
        assert self.space.str_w(output[12]) == 'ArrayProxy::offsetGet(0, name)'
        assert self.space.str_w(output[13]) == 'ArrayProxy::offsetSet(0, name, FooBarBarBaz)'
        assert self.space.str_w(output[14]) == 'ArrayProxy::offsetGet(0, name)'
        assert self.space.str_w(output[15]) == 'FooBarBarBaz'
        assert self.space.str_w(output[16]) == 'ArrayProxy::offsetUnset(0, name)'
        assert self.space.str_w(output[17]) == 'ArrayProxy::offsetGet(0, name)'
        assert output[18] == self.space.w_Null
        assert self.space.str_w(output[19]) == 'ArrayProxy::offsetSet(0, name, BlaBla)'
        assert self.space.str_w(output[20]) == 'ArrayProxy::offsetGet(0, name)'
        assert self.space.str_w(output[21]) == 'BlaBla'

    @hippy_fail(reason="There's an extra call to __construct() we "
                       "haven't fully investigated yet.")
    def test_construct(self):
        output = self.run('''
        interface ArrayProxyAccess extends ArrayAccess
        {
            function proxyGet($element);
            function proxySet($element, $index, $value);
            function proxyUnset($element, $index);
        }

        class ArrayProxy implements ArrayAccess
        {
            private $object;
            private $element;
            function __construct(ArrayProxyAccess $object, $element)
            {
                echo __METHOD__ . "($element)";
                if (!$object->offsetExists($element))
                {
                    $object[$element] = array();
                }
                $this->object = $object;
                $this->element = $element;
            }

            function offsetExists($index) {
                return array_key_exists($index, $this->object->proxyGet($this->element));
            }

            function offsetGet($index) {
                $tmp = $this->object->proxyGet($this->element);
                return isset($tmp[$index]) ? $tmp[$index] : NULL;
            }

            function offsetSet($index, $value) {
                $this->object->proxySet($this->element, $index, $value);
            }

            function offsetUnset($index) {
                $this->object->proxyUnset($this->element, $index);
            }
        }

        class Peoples implements ArrayProxyAccess
        {
            public $person;

            function __construct()
            {
                $this->person = array(array('name'=>'Foo'));
            }

            function offsetExists($index)
            {
                return array_key_exists($index, $this->person);
            }

            function offsetGet($index)
            {
                return new ArrayProxy($this, $index);
            }

            function offsetSet($index, $value)
            {
                $this->person[$index] = $value;
            }

            function offsetUnset($index)
            {
                unset($this->person[$index]);
            }

            function proxyGet($element)
            {
                return $this->person[$element];
            }

            function proxySet($element, $index, $value)
            {
                $this->person[$element][$index] = $value;
            }

            function proxyUnset($element, $index)
            {
                unset($this->person[$element][$index]);
            }
        }

        $people = new Peoples;
        echo get_class($people[0]);
        echo $people[0]['name'];
        $people[0]['name'] = 'FooBar';
        echo $people[0]['name'];
        $people[0]['name'] = $people->person[0]['name'] . 'Bar';
        echo $people[0]['name'];
        $people[0]['name'] .= 'Baz';
        ''')
        assert len(output) == 11
        assert self.space.str_w(output[0]) == 'ArrayProxy::__construct(0)'
        assert self.space.str_w(output[1]) == 'ArrayProxy'
        assert self.space.str_w(output[2]) == 'ArrayProxy::__construct(0)'
        assert self.space.str_w(output[3]) == 'Foo'
        assert self.space.str_w(output[4]) == 'ArrayProxy::__construct(0)'
        assert self.space.str_w(output[5]) == 'ArrayProxy::__construct(0)'
        assert self.space.str_w(output[6]) == 'FooBar'
        assert self.space.str_w(output[7]) == 'ArrayProxy::__construct(0)'
        assert self.space.str_w(output[8]) == 'ArrayProxy::__construct(0)'
        assert self.space.str_w(output[9]) == 'FooBarBar'
        assert self.space.str_w(output[10]) == 'ArrayProxy::__construct(0)'


text:
package org.springframework.beans.annotation;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import org.springframework.beans.BeanWrapper;
import org.springframework.beans.PropertyAccessorFactory;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringValueResolver;

/**
 * General utility methods for working with annotations in JavaBeans style.
 *
 * @author Rob Harrop
 * @author Juergen Hoeller
 * @since 2.0
 */
public abstract class AnnotationBeanUtils {

	/**
	 * Copy the properties of the supplied {@link Annotation} to the supplied target bean.
	 * Any properties defined in {@code excludedProperties} will not be copied.
	 * @param ann the annotation to copy from
	 * @param bean the bean instance to copy to
	 * @param excludedProperties the names of excluded properties, if any
	 * @see org.springframework.beans.BeanWrapper
	 */
	public static void copyPropertiesToBean(Annotation ann, Object bean, String... excludedProperties) {
		copyPropertiesToBean(ann, bean, null, excludedProperties);
	}

	/**
	 * Copy the properties of the supplied {@link Annotation} to the supplied target bean.
	 * Any properties defined in {@code excludedProperties} will not be copied.
	 * <p>A specified value resolver may resolve placeholders in property values, for example.
	 * @param ann the annotation to copy from
	 * @param bean the bean instance to copy to
	 * @param valueResolver a resolve to post-process String property values (may be {@code null})
	 * @param excludedProperties the names of excluded properties, if any
	 * @see org.springframework.beans.BeanWrapper
	 */
	public static void copyPropertiesToBean(Annotation ann, Object bean, StringValueResolver valueResolver, String... excludedProperties) {
		Set<String> excluded = new HashSet<String>(Arrays.asList(excludedProperties));
		Method[] annotationProperties = ann.annotationType().getDeclaredMethods();
		BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(bean);
		for (Method annotationProperty : annotationProperties) {
			String propertyName = annotationProperty.getName();
			if (!excluded.contains(propertyName) && bw.isWritableProperty(propertyName)) {
				Object value = ReflectionUtils.invokeMethod(annotationProperty, ann);
				if (valueResolver != null && value instanceof String) {
					value = valueResolver.resolveStringValue((String) value);
				}
				bw.setPropertyValue(propertyName, value);
			}
		}
	}

}

redpajama_set_name: RedPajamaGithub


text:
#ifndef _TESTMSG_H_
#define _TESTMSG_H_

extern ROMCONST struct testcase * ROMCONST patternmsg[];

#endif /* _TESTMSG_H_ */


text:
class C_Custom : public C_Control
{
#ifdef USE_SH_POOLS
	public:
		// Overload new/delete to use a SmartHeap pool
		void *operator new(size_t size) { return MemAllocPtr(UI_Pools[UI_CONTROL_POOL],size,FALSE);	};
		void operator delete(void *mem) { if (mem) MemFreePtr(mem); };
#endif
	private:
		long		DefaultFlags_;

		long		*ItemValues_;
		O_Output	*Items_;

		short		Section_;

		short		Count_;
		short		Last_;

	public:
		C_Custom();
		C_Custom(char **stream);
		C_Custom(FILE *fp);
		~C_Custom();
		long Size();
		void Save(char **)	{ ; }
		void Save(FILE *)	{ ; }
		void Setup(long ID,short Type,short NumCtrls);
		void Cleanup(void);

		O_Output *GetItem(long idx);

		void SetValue(long idx,long value);
		long GetValue(long idx);

		long CheckHotSpots(long relX,long relY);
		BOOL Process(long ID,short HitType);

		void SetDefaultFlags() { SetFlags(DefaultFlags_); }
		long GetDefaultFlags() { return(DefaultFlags_); }

		void Refresh();
		void Draw(SCREEN *surface,UI95_RECT *cliprect);
};

#endif


text:
package org.ovirt.engine.core.bll;

import java.util.List;

import org.ovirt.engine.core.common.AuditLogType;
import org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters;
import org.ovirt.engine.core.common.businessentities.VmInterfaceType;
import org.ovirt.engine.core.common.businessentities.VmNetworkInterface;
import org.ovirt.engine.core.common.validation.group.UpdateEntity;
import org.ovirt.engine.core.compat.StringHelper;
import org.ovirt.engine.core.dal.VdcBllMessages;
import org.ovirt.engine.core.dal.dbbroker.DbFacade;
import org.ovirt.engine.core.dal.dbbroker.auditloghandling.CustomLogField;
import org.ovirt.engine.core.dal.dbbroker.auditloghandling.CustomLogFields;
import org.ovirt.engine.core.utils.linq.LinqUtils;
import org.ovirt.engine.core.utils.linq.Predicate;

@CustomLogFields({ @CustomLogField("NetworkName"), @CustomLogField("InterfaceName") })
public class UpdateVmTemplateInterfaceCommand<T extends AddVmTemplateInterfaceParameters> extends VmTemplateCommand<T> {
    public UpdateVmTemplateInterfaceCommand(T parameters) {
        super(parameters);
    }

    public String getInterfaceName() {
        return getParameters().getInterface().getName();
    }

    @Override
    protected void executeCommand() {
        AddCustomValue("InterfaceType", (VmInterfaceType.forValue(getParameters().getInterface().getType()).getInterfaceTranslation()).toString());
        DbFacade.getInstance()
                .getVmNetworkInterfaceDao()
                .update(getParameters().getInterface());
        setSucceeded(true);
    }

    @Override
    protected boolean canDoAction() {
        if (getParameters().getInterface().getVmId() != null) {
            addCanDoActionMessage(VdcBllMessages.NETWORK_INTERFACE_VM_CANNOT_BE_SET);
            return false;
        }

        List<VmNetworkInterface> interfaces = DbFacade.getInstance().getVmNetworkInterfaceDao()
                    .getAllForTemplate(getParameters().getVmTemplateId());

        if (getVmTemplate() == null) {
            addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST);
            return false;
        }

        // Interface oldIface = interfaces.First(i => i.id ==
        // AddVmInterfaceParameters.Interface.id);
        VmNetworkInterface oldIface = LinqUtils.firstOrNull(interfaces, new Predicate<VmNetworkInterface>() {
            @Override
            public boolean eval(VmNetworkInterface i) {
                return i.getId().equals(getParameters().getInterface().getId());
            }
        });

        if (!StringHelper.EqOp(oldIface.getName(), getParameters().getInterface().getName())) {
            if (!VmHandler.IsNotDuplicateInterfaceName(interfaces,
                            getParameters().getInterface().getName(),
                            getReturnValue().getCanDoActionMessages())) {
                return false;
            }
        }

        return true;
    }

    @Override
    protected List<Class<?>> getValidationGroups() {
        addValidationGroup(UpdateEntity.class);
        return super.getValidationGroups();
    }

    /**
     * Set the parameters for bll messages, such as type and action,
     */
    @Override
    protected void setActionMessageParameters()
    {
        addCanDoActionMessage(VdcBllMessages.VAR__ACTION__UPDATE);
        addCanDoActionMessage(VdcBllMessages.VAR__TYPE__INTERFACE);
    }

    @Override
    public AuditLogType getAuditLogTypeValue() {
        return getSucceeded() ? AuditLogType.NETWORK_UPDATE_TEMPLATE_INTERFACE
                : AuditLogType.NETWORK_UPDATE_TEMPLATE_INTERFACE_FAILED;
    }
}


text:
package org.openhome.net.controlpoint;

import java.util.LinkedList;
import java.util.List;

import org.openhome.net.core.Action;

/**
 * Utility class used to execute a single action. Only intended for use by
 * auto-generated proxies.
 */
public class Invocation
{

	private native long CpServiceInvocation(long aService, long aAction);
	private static native void CpInvocationAddInput(long aInvocation, long aArgument);
	private static native void CpInvocationAddOutput(long aInvocation, long aArgument);
	private static native ProxyError CpInvocationError(long aInvocation);
	private static native int CpInvocationOutputInt(long aInvocation, int aIndex);
	private static native long CpInvocationOutputUint(long aInvocation, int aIndex);
	private static native int CpInvocationOutputBool(long aInvocation, int aIndex);
	private static native String CpInvocationOutputString(long aInvocation, int aIndex);
	private static native byte[] CpInvocationGetOutputBinary(long aInvocation, int aIndex);

	static
    {
        System.loadLibrary("ohNet");
        System.loadLibrary("ohNetJni");
    }

	private ICpProxyListener iAsyncComplete;
	private CpService iService;
	private long iHandle;
	private List<Argument> iInputArgs;
	private List<Argument> iOutputArgs;

	/**
	 * Constructor.  Not intended for external use (use <tt>CpService.getInvocation()</tt>
	 * instead).
	 *
	 * @param aService		service the action is being invoked on.
	 * @param aAction		handle to the action being invoked.
	 * @param aCallback		callback to run when the action completes.
	 */
	public Invocation(CpService aService, Action aAction, ICpProxyListener aCallback)
	{
		iService = aService;
		iInputArgs = new LinkedList<Argument>();
		iOutputArgs = new LinkedList<Argument>();
		iAsyncComplete = aCallback;

		iHandle = CpServiceInvocation(aService.getHandle(), aAction.getHandle());
	}

	/**
	 * Get the handle to the underlying native invocation.
	 *
	 * @return	handle to the native invocation.
	 */
	protected long getHandle()
	{
		return iHandle;
	}

	/**
	 * Add an input argument to an invocation.
	 *
	 * @param aArgument	input argument being added. Ownership passes to the invocation.
	 */
	public void addInput(Argument aArgument)
    {
        iInputArgs.add(aArgument);
        CpInvocationAddInput(iHandle, aArgument.getHandle());
    }

	/**
	 * Add an output argument to an invocation.
	 *
	 * @param aArgument	output argument being added. Ownership passes to the invocation.
	 */
	public void addOutput(Argument aArgument)
    {
        iOutputArgs.add(aArgument);
        CpInvocationAddOutput(iHandle, aArgument.getHandle());
    }

	/**
	 * Check whether the invocation failed.
	 *
	 *
Only intended for use in the invocation complete callback.
	 *
	 * @param aHandle	invocation to check for errors.
	 * @return			a ProxyError object if the invocation failed; <tt>null</tt> if it succeeded.
	 */
	public static ProxyError error(long aHandle)
    {
        return CpInvocationError(aHandle);
    }

	/**
	 * Utility to retrieve the value of an integer type output argument.
	 *
	 * @param aHandle	invocation handle.
	 * @param aIndex	zero-based index into array of output arguments.
	 * 					Must refer to an <tt>ArgumentInt</tt>.
	 * @return			value of the integer output argument.
	 */
	public static int getOutputInt(long aHandle, int aIndex)
    {
        return CpInvocationOutputInt(aHandle, aIndex);
    }

	/**
	 * Utility to retrieve the value of an unsigned integer type output argument.
	 *
	 * @param aHandle	invocation handle.
	 * @param aIndex	zero-based index into array of output arguments.
	 * 					Must refer to an <tt>ArgumentUint</tt>.
	 * @return			value of the unsigned integer output argument.
	 */
	public static long getOutputUint(long aHandle, int aIndex)
    {
        return CpInvocationOutputUint(aHandle, aIndex);
    }

	/**
	 * Utility to retrieve the value of a boolean type output argument.
	 *
	 * @param aHandle	invocation handle.
	 * @param aIndex	zero-based index into array of output arguments.
	 * 					Must refer to an <tt>ArgumentBool</tt>.
	 * @return			value of the boolean output argument.
	 */
	public static boolean getOutputBool(long aHandle, int aIndex)
    {
        int val = CpInvocationOutputBool(aHandle, aIndex);

        return (val != 0);
    }

	/**
	 * Utility to retrieve the value of a string type output argument.
	 *
	 *
Must only be called once per output argument. (The first call
	 * extracts the string data from the underlying native object so later
	 * calls would return an empty string.)
	 *
	 * @param aHandle	invocation handle.
	 * @param aIndex	zero-based index into array of output arguments.
	 * 					Must refer to an <tt>ArgumentString</tt>.
	 * @return			value of the string output argument.
	 */
	public static String getOutputString(long aHandle, int aIndex)
	{
		return CpInvocationOutputString(aHandle, aIndex);
	}

	/**
	 * Utility to retrieve the value of a binary type output argument.
	 *
	 *
Must only be called once per output argument.  (The first call
	 * extracts the binary data from the underlying native object so later
	 * calls would return an empty string.)
	 *
	 * @param aHandle	invocation handle.
	 * @param aIndex	zero-based index into array of output arguments.
	 * 					Must refer to an <tt>ArgumentBinary</tt>.
	 * @return			value of the string output argument.
	 */
	public static byte[] getOutputBinary(long aHandle, int aIndex)
	{
		return CpInvocationGetOutputBinary(aHandle, aIndex);
	}

	/**
	 * Asynchronous callback used for notification that an invocation has
	 * successfully completed.
	 *
	 * @param aPtr			custom data used for callback purposes.
	 * @param aAsyncHandle	asynchronous handle.
	 */
	public void asyncComplete(long aPtr, long aAsyncHandle)
    {
        try
        {
//		iAsyncComplete.callbackActionComplete(aPtr, aAsyncHandle);
		iAsyncComplete.callbackAsyncComplete(aAsyncHandle);
        }
        catch (ProxyError pe)
        {
        }
        catch (Throwable e)
        {
            System.err.println("ERROR: unexpected exception thrown: " + e);
            System.err.println("       Only ProxyError can be thrown by action complete delegates");
            e.printStackTrace();
        }
		iService.invocationComplete(this);
    }
}


text:
call mvnw release:prepare -Dresume=false
call mvnw release:perform


text:
package com.zzf.zzweather.zzweather;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class CityList extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_city_list);
    }
}


text:
import React, { Component } from 'react';
import { StyleSheet, View } from 'react-native';

const styles = StyleSheet.create({
  container: {
    borderRadius: 2,
    borderColor: '#000',
    backgroundColor: '#212121',
    borderBottomWidth: 0,
    margin: 10,
    height: 150,
    width: 100,
    shadowColor: '#000',
    shadowOffset: { width: 0, height: 2 },
    shadowOpacity: 0.1,
    shadowRadius: 2,
    elevation: 3,
    overflow: 'hidden',
  }
});

class SizedTile extends Component {
  render() {
    return (
    <View style={[styles.container]}>
      {this.props.children}
    </View>
  );
  }
}

export { SizedTile }


text:
<?php

session_start();
$pathpre = '../';
if(!isset($_SESSION['userid']))
{
    header('Location: '.$pathpre.'index.php?message=1');
}
if($_SESSION["type"]==0)
{
    header('Location: problem_error.php?message=1');
}
include $pathpre.'authentication/dbconnection.php';
if(isset($_POST["probid"]))
{
    $probid = $_POST["probid"];
    $probstate = $_POST["probstate"];
    $comment = $_POST["comment"];
    $probname = $_POST["probname"];
    $query = "UPDATE `taj_problems` SET `statement`='$probstate', `name`='$probname',`comment`='$comment' WHERE `id`='$probid'";
    mysql_query($query);
    header('Location: index.php?message=2');
}
else if(isset($_REQUEST["pid"]))
{
    $pid = mysql_real_escape_string($_REQUEST["pid"]);
    $query = "SELECT * FROM `taj_problems` WHERE `id`='$pid'";
    $result = mysql_query($query);
    if(mysql_num_rows($result)==0)
    {
        //header('Location: problem_error.php?message=3');
    }
    $row=  mysql_fetch_array($result);
}
else
{
    header('Location: problem_error.php?message=2');
}
?>

        <meta charset="UTF-8">
        <link rel="icon" type="image/png"  href="items/crown250.png">
        <link rel="stylesheet" href="<?php echo $pathpre; ?>style/templates.css">
        <link rel="stylesheet" href="<?php echo $pathpre; ?>style/inside.css">
        <link rel="stylesheet" href="<?php echo $pathpre; ?>style/problem.css">
        <title>TAJ - Edit Problem</title>

        <?php
            include $pathpre.'templates/header.php';
            include $pathpre.'templates/sidebar.php';
        ?>

                Edit Problem

            <form method="post" id="taj_edit_problem_form" name="taj_edit_problem_form" action="" onsubmit="return check_form()">
                <input type="hidden" name="probid" id="probid" value="<?php echo $row["id"]; ?>">

                        Problem ID :
                        <?php echo $row["id"]; ?>

                        Problem Name :
                        <input type="text" name="probname" id="probname" placeholder="Full problem name" value="<?php echo $row["name"]; ?>" >

                        Statement :
                        <textarea rows="7" cols="50" id="probstate" name="probstate" placeholder="Enter the problem statement here"><?php echo $row["statement"]; ?></textarea>

                        Comment :
                        <input type="text" name="comment" id="comment" placeholder="Any Special Comment" value="<?php echo $row["comment"]; ?>" >

                        <input type='submit'>

            </form>


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */
	 /*
		status: 2->in process
		status: 1->close
		status: 0->yet to assign
	 */
	public function __construct()
	{
		parent::__construct();
		$this->load->helper(array('form', 'url'));
		$this->load->library('form_validation');
		$this->load->model('ComplainModel');
	}
	public function index()
	{
		$this->load->view('admin/login');
	}
	public function userLogin()
	{
		$this->load->database();
		$email=$this->input->post('email');
		$password=$this->input->post('password');
		$this->db->where('email',$email);
		$chkEmail=$this->db->get('user_mst')->result_array();
		if(!empty($chkEmail)){
			if($chkEmail[0]['password']==$password)
			{
				$this->session->set_userdata('user_id',$chkEmail[0]['user_id']);
				$this->session->set_userdata('email',$chkEmail[0]['email']);
				$this->session->set_userdata('user_name',$chkEmail[0]['fname']." ".$chkEmail[0]['lname']);

				redirect(base_url().'/index.php/welcome/bookingMaster');
			}
			else
			{
				$this->session->set_flashdata('pass_notexist','password not match with your email');
				redirect(base_url());
			}
		}else{
			$this->session->set_flashdata('email_notexist','email not exist');
			redirect(base_url());
		}

	}
	public function logout()
	{
		$this->session->unset_userdata('user_id',$chkEmail[0]['user_id']);
		$this->session->unset_userdata('user_id',$chkEmail[0]['email']);
		$this->session->unset_userdata('user_id',$chkEmail[0]['user_name']);
		redirect(base_url());
	}
	public function bookingMaster($id="")
	{
		if($this->session->userdata('user_id'))
		{

		if($id !="")
		{
			$mydata = $this->ComplainModel->getDataById($id);
			$data['selected_data']=$mydata;
		}

		$data['data']=$this->ComplainModel->getData();
		$data['allStates'] = $this->ComplainModel->getAllStates();
		$this->load->view('admin/header');
		$this->load->view('admin/dashboard',$data);
		$this->load->view('admin/footer');
		}
		else{
			redirect(base_url());
		}
	}
	public function book_complain()
	{

         //$this->load->library('form_validation');

		 $this->form_validation->set_rules('phoneNo', 'Phone Number', 'required|min_length[10]|max_length[10]');
		 $this->form_validation->set_rules('city', 'City', 'required');
		 $this->form_validation->set_rules('site', 'Site', 'required');
		 $this->form_validation->set_rules('issueDesc', 'Issue-Description', 'required');

		if ($this->form_validation->run() == FALSE)
		{
			$this->load->view('admin/header');
			$this->load->view('admin/dashboard');
			$this->load->view('admin/footer');
		}
		else
		{
			$status=$this->ComplainModel->insertUserData();
			if($status>0){
				 $this->session->set_flashdata('ticket_success','Records Inserted Sucessfully');
			}
			else
			{
				 $this->session->set_flashdata('ticket_error','Oops Something goes wrong');
			}
			redirect('/welcome/index/');
		}
	}
	public function site_view(){
		$data['allStates'] = $this->ComplainModel->getAllStates();
		$this->load->view('admin/header');
		$this->load->view('admin/site',$data);
		$this->load->view('admin/footer');
	}
	public function getCitiesByStateId(){
		$cities = $this->ComplainModel->getCitiesByStateId();
		die(json_encode(array('msg'=>$cities,'status'=>'success')));
	}
	public function getSitesByCityId()
	{
		$sites=$this->ComplainModel->getSiteByCityId();
		die(json_encode(array('msg'=>$sites,'status'=>'success')));
	}
	public function getTicketsBySiteId()
	{
		$tickets=$this->ComplainModel->getTicketsBySiteId();
		die(json_encode(array('msg'=>$tickets,'status'=>'success')));
	}
	public function getSupervisorByTicketId()
	{
		$supervisor=$this->ComplainModel->getSupervisorByTicketId();
		die(json_encode(array('msg'=>$supervisor,'status'=>'success')));
	}
	public function getTechnicianByTicketId()
	{
		$technician=$this->ComplainModel->getTechnicianByTicketId();
		die(json_encode(array('msg'=>$technician,'status'=>'success')));
	}
	public function add_site()
	{
		$this->ComplainModel->insertSite();
		header("Location:".base_url('index.php/welcome/area_view'));

	}
	public function supervisor_view()
	{
			$this->load->view('admin/header');
			$this->load->view('admin/supervisor');
			$this->load->view('admin/footer');
	}
	public function add_supervisor()
	{
		$this->ComplainModel->insertSupervisor();
		header("Location:".base_url('index.php/welcome/supervisor_view'));

	}
	public function allocate_supervisor_view()
	{
		$data['allSupervisors'] = $this->ComplainModel->getAllSupervisors();
		$data['alltickets']=$this->ComplainModel->getAllTickets();
		$data['allStates'] = $this->ComplainModel->getAllStates();
		$this->load->view('admin/header');
		$this->load->view('admin/allocate_supervisor',$data);
		$this->load->view('admin/footer');
	}
	public function add_allocate_supervisor()
	{
		$success_status = $this->ComplainModel->allocateSupervisor();
		if($success_status>0){
				 $this->session->set_flashdata('allocate_msg','Ticket Assign Successfully');
			}
			else
			{
				 $this->session->set_flashdata('allocate_msg_error','Ticket Already Assigned');
			}
	//	header("Location:".base_url('index.php/welcome/allocate_supervisor_view'));
	redirect('/welcome/allocate_supervisor_view/');
	}
	public function technician_view()
	{
			$this->load->view('admin/header');
			$this->load->view('admin/technician');
			$this->load->view('admin/footer');
	}
	public function add_technician()
	{
		$this->ComplainModel->insertTechnician();
		header("Location:".base_url('index.php/welcome/technician_view'));

	}
	public function allocate_technician_view()
	{
		$data['allTechnicians'] = $this->ComplainModel->getAllTechnicians();
		$data['allTickets']=$this->ComplainModel->getAllTicketsTech();
		$data['allStates'] = $this->ComplainModel->getAllStates();
		$this->load->view('admin/header');
		$this->load->view('admin/allocate_technician',$data);
		$this->load->view('admin/footer');
	}
	public function add_allocate_technician()
	{
		$success_status_tech = $this->ComplainModel->allocateTechnician();
		if($success_status_tech>0){
				 $this->session->set_flashdata('allocate_msg_tech','Ticket Assign Successfully');
			}
			else
			{
				 $this->session->set_flashdata('allocate_msg_error_tech','Ticket Already Assigned');
			}
	//	header("Location:".base_url('index.php/welcome/allocate_supervisor_view'));
	redirect('/welcome/allocate_technician_view/');
	}
	public function techComment_view()
	{
			$data['allTickets']=$this->ComplainModel->getAllTicketsTechComment();
			$this->load->view('admin/header');
			$this->load->view('admin/techComment',$data);
			$this->load->view('admin/footer');
	}
	public function add_comment()
	{
		$success_status_issue = $this->ComplainModel->insertComment();
		if($success_status_issue>0){
				 $this->session->set_flashdata('allocate_msg_issue','Issue Comment inserted successfully Successfully');
			}
			else
			{
				 $this->session->set_flashdata('allocate_msg_error_issue','Oops issue_comment cant be insert');
			}
	//	header("Location:".base_url('index.php/welcome/allocate_supervisor_view'));
	redirect('/welcome/techComment_view/');
	}
	public function supervisorComment_view()
	{
			$data['allTickets']=$this->ComplainModel->getAllTicketsSupervisorComment();
			$data['allSupervisors'] = $this->ComplainModel->getAllSupervisors();
			$this->load->view('admin/header');
			$this->load->view('admin/supervisorComment',$data);
			$this->load->view('admin/footer');
	}
	public function add_supervisor_comment()
	{
		$sucess_status_issue_supervisor = $this->ComplainModel->insertCommentSupervisor();
		if($sucess_status_issue_supervisor>0){
				 $this->session->set_flashdata('allocate_msg_issue_supervisor','Issue Comment inserted successfully Successfully');
			}
			else
			{
				 $this->session->set_flashdata('allocate_msg_error_issue_supervisor','Oops issue_comment cant be insert');
			}
	//	header("Location:".base_url('index.php/welcome/allocate_supervisor_view'));
	//redirect('/welcome/supervisorComment_view/');
	}
	public function ticket_report()
	{
		$data['closingReport']=$this->ComplainModel->getClosingReport();
		//echo "<pre>";
		//print_r($report);
		$this->load->view('admin/header');
		$this->load->view('admin/ticket_report',$data);
		$this->load->view('admin/footer');
	}
	public function update_data(){
		$this->ComplainModel->updateUserData();
		header("Location:".base_url('/index.php/welcome/'));
	}

}


text:
<?php

namespace Google\Service\Testing;

class Orientation extends \Google\Collection
{
  protected $collection_key = 'tags';
  /**
   * @var string
   */
  public $id;
  /**
   * @var string
   */
  public $name;
  /**
   * @var string[]
   */
  public $tags;

  /**
   * @param string
   */
  public function setId($id)
  {
    $this->id = $id;
  }
  /**
   * @return string
   */
  public function getId()
  {
    return $this->id;
  }
  /**
   * @param string
   */
  public function setName($name)
  {
    $this->name = $name;
  }
  /**
   * @return string
   */
  public function getName()
  {
    return $this->name;
  }
  /**
   * @param string[]
   */
  public function setTags($tags)
  {
    $this->tags = $tags;
  }
  /**
   * @return string[]
   */
  public function getTags()
  {
    return $this->tags;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Orientation::class, 'Google_Service_Testing_Orientation');


text:
.class final Lo/Ḟ;
.super Ljava/lang/Object;

# interfaces
.implements Lo/ᒮ$If;

# annotations
.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;Lo/\u14ae$If<Lo/nB;Lo/\u14ae$if$\u02ca;>;"
    }
.end annotation

# direct methods
.method constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public ˊ()I
    .locals 1

    const v0, 0x7fffffff

    return v0
.end method

.method public ˊ(Landroid/content/Context;Landroid/os/Looper;Lcom/google/android/gms/internal/jg;Lo/ᒮ$if$ˊ;Lo/ᓖ$ˊ;Lo/ᓖ$If;)Lo/nB;
    .locals 8

    invoke-virtual {p3}, Lcom/google/android/gms/internal/jg;->ˏ()Ljava/util/List;

    move-result-object v0

    invoke-static {v0}, Lo/Ὺ;->ˊ(Ljava/util/List;)[Ljava/lang/String;

    move-result-object v7

    new-instance v0, Lo/nC;

    invoke-virtual {p3}, Lcom/google/android/gms/internal/jg;->ˋ()Ljava/lang/String;

    move-result-object v5

    move-object v1, p1

    move-object v2, p2

    move-object v3, p5

    move-object v4, p6

    move-object v6, v7

    invoke-direct/range {v0 .. v6}, Lo/nC;-><init>(Landroid/content/Context;Landroid/os/Looper;Lo/ᓖ$ˊ;Lo/ᓖ$If;Ljava/lang/String;[Ljava/lang/String;)V

    return-object v0
.end method

.method public synthetic ˊ(Landroid/content/Context;Landroid/os/Looper;Lcom/google/android/gms/internal/jg;Ljava/lang/Object;Lo/ᓖ$ˊ;Lo/ᓖ$If;)Lo/ᒮ$ˊ;
    .locals 7

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move-object v4, p4

    check-cast v4, Lo/ᒮ$if$ˊ;

    move-object v5, p5

    move-object v6, p6

    invoke-virtual/range {v0 .. v6}, Lo/Ḟ;->ˊ(Landroid/content/Context;Landroid/os/Looper;Lcom/google/android/gms/internal/jg;Lo/ᒮ$if$ˊ;Lo/ᓖ$ˊ;Lo/ᓖ$If;)Lo/nB;

    move-result-object v0

    return-object v0
.end method


text:
import ujson as json

from oslo_log import log

from monasca_persister.repositories.influxdb import abstract_repository
from monasca_persister.repositories.influxdb import line_utils
from monasca_persister.repositories.utils import parse_alarm_state_hist_message

LOG = log.getLogger(__name__)

class AlarmStateHistInfluxdbRepository(
        abstract_repository.AbstractInfluxdbRepository):

    def __init__(self):

        super(AlarmStateHistInfluxdbRepository, self).__init__()

    def process_message(self, message):

        (alarm_id, metrics, new_state, old_state, link,
         lifecycle_state, state_change_reason,
         sub_alarms_json_snake_case, tenant_id,
         time_stamp) = parse_alarm_state_hist_message(
            message)

        name = u'alarm_state_history'
        fields = []
        fields.append(u'tenant_id=' + line_utils.escape_value(tenant_id))
        fields.append(u'alarm_id=' + line_utils.escape_value(alarm_id))
        fields.append(u'metrics=' + line_utils.escape_value(
            json.dumps(metrics, ensure_ascii=False)))
        fields.append(u'new_state=' + line_utils.escape_value(new_state))
        fields.append(u'old_state=' + line_utils.escape_value(old_state))
        fields.append(u'link=' + line_utils.escape_value(link))
        fields.append(u'lifecycle_state=' + line_utils.escape_value(
            lifecycle_state))
        fields.append(u'reason=' + line_utils.escape_value(
            state_change_reason))
        fields.append(u'reason_data=' + line_utils.escape_value("{}"))
        fields.append(u'sub_alarms=' + line_utils.escape_value(
            sub_alarms_json_snake_case))

        line = name + u',tenant_id=' + line_utils.escape_tag(tenant_id)
        line += u' ' + u','.join(fields)
        line += u' ' + str(int(time_stamp))

        LOG.debug(line)

        return line


text:
package io.eels.component.parquet

import java.io.File
import java.nio.file.Paths

import io.eels.Row
import io.eels.component.parquet.avro.{AvroParquetSink, AvroParquetSource}
import io.eels.datastream.DataStream
import io.eels.schema._
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
import org.scalatest.{Matchers, WordSpec}

class AvroParquetComponentTest extends WordSpec with Matchers {

  private implicit val conf = new Configuration()
  private implicit val fs = FileSystem.get(new Configuration())

  "AvroParquet" should {
    "write and read parquet files" in {

      val path = new Path("test.pq")
      if (fs.exists(path))
        fs.delete(path, false)

      val structType = StructType(
        Field("name", StringType, nullable = false),
        Field("job", StringType, nullable = false),
        Field("location", StringType, nullable = false)
      )

      val ds = DataStream.fromValues(
        structType,
        Seq(
          Vector("clint eastwood", "actor", "carmel"),
          Vector("elton john", "musician", "pinner")
        )
      )

      ds.to(AvroParquetSink(path))

      val actual = AvroParquetSource(path).toDataStream().collect
      actual shouldBe Vector(
        Row(structType, "clint eastwood", "actor", "carmel"),
        Row(structType, "elton john", "musician", "pinner")
      )
    }
    "read multiple parquet files using file expansion" in {

      val file1 = new File("test1.pq")
      val file2 = new File("test2.pq")
      file1.deleteOnExit()
      file2.deleteOnExit()

      val path1 = new Path(file1.getAbsolutePath)
      if (fs.exists(path1))
        fs.delete(path1, false)

      val path2 = new Path(file2.getAbsolutePath)
      if (fs.exists(path2))
        fs.delete(path2, false)

      val structType = StructType(
        Field("name", StringType, nullable = false),
        Field("location", StringType, nullable = false)
      )

      val frame = DataStream.fromValues(
        structType,
        Seq(
          Vector("clint eastwood", "carmel"),
          Vector("elton john", "pinner")
        )
      )

      frame.to(AvroParquetSink(path1))
      frame.to(AvroParquetSink(path2))

      val actual = AvroParquetSource(s"${path1.toUri.toString}/*").toDataStream().toSet
      actual shouldBe Set(
        Row(structType, "clint eastwood", "carmel"),
        Row(structType, "elton john", "pinner"),
        Row(structType, "clint eastwood", "carmel"),
        Row(structType, "elton john", "pinner")
      )
    }
    "support collections of strings" in {

      val structType = StructType(
        Field("system", StringType),
        Field("planets", ArrayType(StringType))
      )

      val sol = Vector("sol", Vector("earth", "mars", "saturn"))
      val algeron = Vector("algeron", Vector("algeron-i", "algeron-ii", "algeron-iii"))
      val frame = DataStream.fromValues(structType, Seq(sol, algeron))

      val path = new Path("array.pq")
      if (fs.exists(path))
        fs.delete(path, false)

      frame.to(AvroParquetSink(path))

      val rows = AvroParquetSource(path).toDataStream().collect
      rows.head.schema shouldBe structType
      rows.head.values(1).asInstanceOf[Seq[String]].toVector shouldBe sol.last
      rows.last.values(1).asInstanceOf[Seq[String]].toVector shouldBe algeron.last

      fs.delete(path, false)
    }
    "support collections of doubles" in {

      val structType = StructType(
        Field("name", StringType),
        Field("doubles", ArrayType(DoubleType))
      )

      val values1 = Vector("a", Vector(0.1, 0.2, 0.3))
      val values2 = Vector("b", Vector(0.3, 0.4, 0.5))
      val frame = DataStream.fromValues(structType, Seq(values1, values2))

      val path = new Path("array.pq")
      if (fs.exists(path))
        fs.delete(path, false)

      frame.to(AvroParquetSink(path))

      val rows = AvroParquetSource(path).toDataStream().collect
      rows.head.schema shouldBe structType
      rows shouldBe Vector(
        Row(structType, values1),
        Row(structType, values2)
      )

      fs.delete(path, false)
    }
    "support nested structs" in {

      val structType = StructType(
        Field("name", StringType),
        Field("homeworld", StructType(
          Field("name", StringType, false),
          Field("x", IntType.Signed, false),
          Field("y", IntType.Signed, false),
          Field("z", IntType.Signed, false)
        ))
      )

      val ds = DataStream.fromValues(
        structType,
        Seq(
          Vector("federation", Vector("sol", 0, 0, 0)),
          Vector("empire", Vector("andromeda", 914, 735, 132))
        )
      )

      val path = new Path("struct.pq")
      if (fs.exists(path))
        fs.delete(path, false)

      ds.to(AvroParquetSink(path))

      val rows = AvroParquetSource(path).toDataStream().collect
      rows.head.schema shouldBe structType
      rows shouldBe Vector(
        Row(structType, Vector("federation", Vector("sol", 0, 0, 0))),
        Row(structType, Vector("empire", Vector("andromeda", 914, 735, 132)))
      )

      fs.delete(path, false)
    }
    "support maps" in {

      val structType = StructType(
        Field("name", StringType),
        Field("map", MapType(StringType, BooleanType))
      )

      val ds = DataStream.fromValues(structType, Seq(Vector("abc", Map("a" -> true, "b" -> false))))

      val path = new Path("maps.pq")
      if (fs.exists(path))
        fs.delete(path, false)

      ds.to(AvroParquetSink(path))

      val rows = AvroParquetSource(path).toDataStream().collect
      rows shouldBe Seq(Row(structType, Vector("abc", Map("a" -> true, "b" -> false))))

      fs.delete(path, false)
    }
  }
}


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit7d64287def1cfa560e269147fd758367::getLoader();


text:
{% assign images = include.images | split: ',' %}

{% if include.column == "auto" %}
{% assign column = 100.0 | divided_by: images.size %}
{% elsif include.column > 0 %}
{% assign column = 100.0 | divided_by: include.column %}
{% endif %}

<div class="row">
    {% for image in images %}
    <div {% if column %} style="flex: {{ column }}%" {% else %} class="column" {% endif %}  >
        <img {% if images.size == 1 %}class="single"{% endif %}
             src="{{ image | prepend: 'assets/img/' | relative_url }}"
             alt="{{ image | prepend: '/' | split: '/' | last }}">
    </div>
    {% endfor %}
</div>

{% assign column = false %}


text:
package controllers

import (
	"fmt"
	"github.com/Sirupsen/logrus"
	"github.com/labstack/echo"
	"github.com/mikerjacobi/poker/server/models"
	"gopkg.in/mgo.v2"
)

type MathMessage struct {
	models.Message
	Count int `json:"count"`
}

func newMathMessage(action string, count int) MathMessage {
	return MathMessage{
		Message: models.Message{Type: action},
		Count:   count,
	}
}

func HandleIncrement(msg models.Message) error {
	db := msg.Context.Get("db").(*mgo.Database)

	count, err := models.IncrementCounter(db)
	if err != nil {
		models.SendError(msg.Sender.AccountID, "increment error")
		return fmt.Errorf("failed to increment: %+v", err)
	}

	if err := models.SendAll(newMathMessage(msg.Type, count)); err != nil {
		return fmt.Errorf("sendall error: %+v", err)
	}
	return nil
}

func HandleDecrement(msg models.Message) error {
	db := msg.Context.Get("db").(*mgo.Database)
	count, err := models.DecrementCounter(db)
	if err != nil {
		models.SendError(msg.Sender.AccountID, "decrement error")
		return fmt.Errorf("failed to decrement: %+v", err)
	}
	if err := models.SendAll(newMathMessage(msg.Type, count)); err != nil {
		return fmt.Errorf("sendall error: %+v", err)
	}
	return nil
}

func HandleSquare(msg models.Message) error {
	db := msg.Context.Get("db").(*mgo.Database)
	count, err := models.SquareCounter(db)
	if err != nil {
		models.SendError(msg.Sender.AccountID, "square error")
		return fmt.Errorf("failed to square: %+v", err)
	}
	if err := models.SendAll(newMathMessage(msg.Type, count)); err != nil {
		return fmt.Errorf("sendall error: %+v", err)
	}
	return nil
}

func HandleSqrt(msg models.Message) error {
	db := msg.Context.Get("db").(*mgo.Database)
	count, err := models.SqrtCounter(db)
	if err != nil {
		models.SendError(msg.Sender.AccountID, "sqrt error")
		return fmt.Errorf("failed to sqrt: %+v", err)
	}
	if err := models.SendAll(newMathMessage(msg.Type, count)); err != nil {
		return fmt.Errorf("sendall error: %+v", err)
	}
	return nil
}

func GetMathCount(c *echo.Context) error {
	db := c.Get("db").(*mgo.Database)
	counter, err := models.LoadMathCount(db)
	if err != nil {
		logrus.Errorf("failed to get math count: %s", err.Error())
		c.JSON(500, Response{})
		return nil
	}
	c.JSON(200, Response{true, counter})
	return nil
}


text:
class BackfillStackIdOnStatuses < ActiveRecord::Migration[5.0]
  def up
    Shipit::Commit.order(stack_id: :asc).find_in_batches do |commits|
      commits.group_by(&:stack_id).each do |stack_id, stack_commits|
        Shipit::Status.where(commit_id: stack_commits.map(&:id)).update_all(stack_id: stack_id)
      end
      print '.'
    end
  end

  def down
  end
end


text:
<?php

declare(strict_types=1);

namespace PhlySimplePage;

use Laminas\Cache\Storage\Adapter\AbstractAdapter;
use Laminas\Cache\Storage\FlushableInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use function sprintf;

class ClearCacheCommand extends Command
{
    /** @var AbstractAdapter */
    private $cache;

    public function __construct(AbstractAdapter $cache)
    {
        $this->cache = $cache;
        parent::__construct();
    }

    protected function configure(): void
    {
        $this->setName('cache:clear');
        $this->addOption(
            'page',
            'p',
            InputOption::VALUE_REQUIRED,
            'Specific page for which to clear the cache, as matched by routing'
        );
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $page = $input->getOption('page');
        if (! $page) {
            return $this->clearAllPages($output);
        }

        return $this->clearPage($page, $output);
    }

    private function clearAllPages(OutputInterface $output): int
    {
        $output->writeln('<info>Clearing caches for all static pages</info>');

        if (! $this->cache instanceof FlushableInterface) {
            $output->writeln('<error>Cache does not support flushing!</error>');
            return 1;
        }

        $this->cache->flush();

        $output->writeln('<info>Cache operation complete</info>');

        return 0;
    }

    private function clearPage(string $page, OutputInterface $output): int
    {
        $output->writeln(sprintf('<info>Clearing cache for page "%s"</info>', $page));

        $key = Module::normalizeCacheKey($page);
        if (! $this->cache->hasItem($key)) {
            $output->writeln('<info>Page is not in cache</info>');
            return 0;
        }

        $this->cache->removeItem($key);

        $output->writeLine('<info>Cache operation complete</info>');

        return 0;
    }
}


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-comp-3402',
  templateUrl: './comp-3402.component.html',
  styleUrls: ['./comp-3402.component.css']
})
export class Comp3402Component implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}


text:
<?php

namespace SiteBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;

class MainController extends Controller
{
    /**
     * @Route("/")
     * @Template(engine="php")
     */
    public function indexAction()
    {
        echo('<meta charset="UTF-8" />');
        $xss = (empty($_GET['xss']))?'':$_GET['xss'];
        echo('

 Тестирование передаваемого параметра 1: ' . $xss . '

');

        $sql = (empty($_GET['sql']))?'':$_GET['sql'];
        echo('
 Тестирование передаваемого параметра 2:

Исходный запрос: SELECT id FROM users WHERE
                                login = "' . $sql . '"

');

        return $this->render('SiteBundle:Main:site.html.php');
    }
}


text:
<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Properties extends CI_Controller {
/**
 * ark Admin Panel for Codeigniter
 * Author: Chirag A. Boghani
 * downloaded from http://devzone.co.in
 *
 */
    public function __construct() {
        parent::__construct();
        $this->load->model('admin/propertiesmodel');
        $this->load->model('admin/categorymodel');
        $this->load->model('admin/citystatemodel');
        $this->load->model('admin/property_typemodel');
        if (!$this->session->userdata('is_admin_login')) {
            redirect('admin/home');
        }
    }

    public function index() {
        $data['page'] = 'properties';

        $this->load->view('admin/templates/header', $data);
        $this->load->view('admin/templates/leftside', $data);
        $this->load->view('admin/properties', $data);
        $this->load->view('admin/templates/footer', $data);
    }
    public function properties_image($id) {
        $data['page'] = 'properties';
        $data['properties_id'] = $id;
        $this->load->view('admin/templates/header', $data);
        $this->load->view('admin/templates/leftside', $data);
        $this->load->view('admin/properties_image', $data);
        $this->load->view('admin/templates/footer', $data);
    }
    public function add_properties_image($id) {
        $data['page'] = 'add_properties';

        $data['id'] = '';
        $data['properties_id'] = $id;
        $data['image'] = '';

        $this->load->view('admin/templates/header', $data);
        $this->load->view('admin/templates/leftside', $data);
        $this->load->view('admin/add_properties_image', $data);
        $this->load->view('admin/templates/footer', $data);
    }

     public function edit_properties_image($id) {
        $data['page'] = 'edit_properties';
        $data['id'] = $id;
        $data['image'] = $this->propertiesmodel->get_image_properties_by_id($id);

        $this->load->view('admin/templates/header', $data);
        $this->load->view('admin/templates/leftside', $data);
        $this->load->view('admin/edit_properties_image', $data);
        $this->load->view('admin/templates/footer', $data);
    }

    function image_list($properties_id) {
        $results = $this->propertiesmodel->get_image_list($properties_id);
        echo json_encode($results);
    }

    public function update_properties_image()
    {
        $data['id'] = $this->input->post('id');
        $data['properties_id'] = $this->input->post('properties_id');
        $data['title'] = $this->input->post('title');
        $data['sequence'] = $this->input->post('sequence');
        $data['status'] = $this->input->post('status');

        if($this->input->post('id')){
            $old_data = $this->propertiesmodel->get_image_properties_by_id($this->input->post('id'));
        }

        $config =  array(
            'upload_path'     => "./upload/properties/",
            'allowed_types'   => "jpg|png|jpeg",
            'max_size'        => "2048000",  // Can be set to particular file size
            'max_height'      => "",
            'max_width'       => "",
            'file_name'       => $this->input->post('properties_id').'-'.time().'-properties',
            'overwrite'       => TRUE,
            'remove_spaces'   => TRUE
         );
        $this->load->library('upload', $config);
        //$this->upload->initialize($config);

        if($this->upload->do_upload('image'))
        {
            $upload_data = $this->upload->data();
            if($upload_data['file_name'] != ''){
                unlink("./upload/properties/".$old_data['image']);
            }
            $data['image'] = $upload_data['file_name'];
        }else{
            $data['image'] = $this->input->post('old_image');
        }
        $result = $this->propertiesmodel->get_properties_image_save($data);

        if($result){
            redirect('admin/properties/properties_image/'.$this->input->post('properties_id'));
        }else{
            $messge = array('message' => 'Properties Image Add/Edit Something Wrong','message_type' => 'error');
            $this->session->set_flashdata('item', $messge);
            if($this->input->post('id')){
                $id= $this->input->post('id');
                redirect('admin/properties/edit_properties_image/'.$id);
            }else{
                redirect('admin/properties/add_properties_image/'.$this->input->post('properties_id'));
            }
        }
    }

    public function delete_image() {
        // Code goes here
        $id = $this->input->post('id');
        $provide = $this->propertiesmodel->get_image_properties_by_id($id);
        unlink("./upload/properties/".$provide['image']);

        $this->db->where('id', $this->input->post('id'));
        if($this->db->delete('properties_image')){
            $messge = array('message' => 'Properties Image Delete Successful','message_type' => 'error');
            $this->session->set_flashdata('item', $messge);
            $array = array();
            echo json_encode($array);
        }else{
            $messge = array('message' => 'Properties Image Delete Something Wrong','message_type' => 'error');
            $this->session->set_flashdata('item', $messge);
            $array = array();
            echo json_encode($array);
        }
    }

    public function status_image() {
        // Code goes here
        $id = $this->input->post('id');
        $provide = $this->propertiesmodel->get_image_properties_by_id($id);

        $status = $provide['status'];
        if($status =='1'){
            $messge = array('message' => 'Properties Image Inactive Successful','message_type' => 'error');
            $this->session->set_flashdata('item', $messge);
            $up_status = '0';
        }else{
            $messge = array('message' => 'Properties Image Active Successful','message_type' => 'success');
            $this->session->set_flashdata('item', $messge);
            $up_status = '1';
        }
        $this->db->where('id', $id);
        if($this->db->update('properties_image', array('status' => $up_status))){
            $array = array();
            $array['id'] = $id;
            $array['status'] = $up_status;
            echo json_encode($array);
            exit;
        }else{
            $array = array();
            $array['id'] = $id;
            $array['status'] = $up_status;
            echo json_encode($array);
            exit;
        }
    }

    function properties_list() {
        $results = $this->propertiesmodel->get_list();
        echo json_encode($results);
    }
    public function view_city(){
        $id = $this->input->post('id');
        $result = $this->citystatemodel->get_city($id);
        $array = '<option value=""> --- Select City --- </option>';
        foreach($result as $city){
            $array .= '<option value="'.$city->id.'">'.$city->city.'</option>';
        }
        header('Content-Type: application/json');
        $jsonWrite = json_encode(array('city'=>$array)); //encode that search data
        print $jsonWrite;
    }

    public function add_properties() {
        $data['page'] = 'add_properties';

        $data['id'] = '';
        $data['properties'] = '';
        $data['category'] = $this->categorymodel->get_categories();
        $data['property'] = $this->property_typemodel->get_property_type();
        $data['state'] = $this->citystatemodel->get_state();

        $this->load->view('admin/templates/header', $data);
        $this->load->view('admin/templates/leftside', $data);
        $this->load->view('admin/add_properties', $data);
        $this->load->view('admin/templates/footer', $data);
    }

     public function edit_properties($id) {
        $data['page'] = 'edit_properties';
        $data['id'] = $id;
        $data['properties'] = $this->propertiesmodel->get_properties_by_id($id);
        $data['category'] = $this->categorymodel->get_categories();
        $data['property'] = $this->property_typemodel->get_property_type();
        $data['state'] = $this->citystatemodel->get_state();
        $data['city'] = $this->citystatemodel->get_city($data['properties']['state']);

        $this->load->view('admin/templates/header', $data);
        $this->load->view('admin/templates/leftside', $data);
        $this->load->view('admin/edit_properties', $data);
        $this->load->view('admin/templates/footer', $data);
    }

    public function update_properties()
    {
        $data['id'] = $this->input->post('id');
        $data['categories_id'] = $this->input->post('categories_id');
        $data['property_type_id'] = $this->input->post('property_type_id');
        $data['properties_name'] = $this->input->post('properties_name');
        $data['state'] = $this->input->post('state');
        $data['city'] = $this->input->post('city');
        $data['description'] = $this->input->post('description');
        $data['image_alt'] = $this->input->post('image_alt');
        $data['image_title'] = $this->input->post('image_title');

        $data['sequence'] = $this->input->post('sequence');
        $data['status'] = $this->input->post('status');

        if($this->input->post('id')){
            $old_data = $this->propertiesmodel->get_properties_by_id($this->input->post('id'));
        }

        $config =  array(
            'upload_path'     => "./upload/properties/",
            'allowed_types'   => "jpg|png|jpeg",
            'max_size'        => "2048000",  // Can be set to particular file size
            'max_height'      => "",
            'max_width'       => "",
            'file_name'       => time().'-properties',
            'overwrite'       => TRUE,
            'remove_spaces'   => TRUE
         );
        $this->load->library('upload', $config);
        //$this->upload->initialize($config);

        if($this->upload->do_upload('properties_image'))
        {
            $upload_data = $this->upload->data();
            if($upload_data['file_name'] != ''){
                unlink("./upload/properties/".$old_data['properties_image']);
            }
            $data['properties_image'] = $upload_data['file_name'];
        }else{
            $data['properties_image'] = $this->input->post('old_image');
        }

        $result = $this->propertiesmodel->get_properties_save($data);

        if($result){
            redirect('admin/properties');
        }else{
            $messge = array('message' => 'Properties Add/Edit Something Wrong','message_type' => 'error');
            $this->session->set_flashdata('item', $messge);
            if($this->input->post('id')){
                $id= $this->input->post('id');
                redirect('admin/properties/edit_properties/'.$id);
            }else{
                redirect('admin/properties/add_properties');
            }
        }
    }

    public function delete_user() {
        // Code goes here
        $this->db->where('id', $this->input->post('id'));
        if($this->db->delete('properties')){
            $messge = array('message' => 'Properties Delete Successful','message_type' => 'error');
            $this->session->set_flashdata('item', $messge);
            $array = array();
            echo json_encode($array);
        }else{
            $messge = array('message' => 'Properties Delete Something Wrong','message_type' => 'error');
            $this->session->set_flashdata('item', $messge);
            $array = array();
            echo json_encode($array);
        }
    }

    public function status_user() {
        // Code goes here
        $id = $this->input->post('id');
        $provide = $this->propertiesmodel->get_properties_by_id($id);

        $status = $provide['status'];
        if($status =='1'){
            $messge = array('message' => 'Properties Inactive Successful','message_type' => 'error');
            $this->session->set_flashdata('item', $messge);
            $up_status = '0';
        }else{
            $messge = array('message' => 'Properties Active Successful','message_type' => 'success');
            $this->session->set_flashdata('item', $messge);
            $up_status = '1';
        }
        $this->db->where('id', $id);
        if($this->db->update('properties', array('status' => $up_status))){
            $array = array();
            $array['id'] = $id;
            $array['status'] = $up_status;
            echo json_encode($array);
            exit;
        }else{
            $array = array();
            $array['id'] = $id;
            $array['status'] = $up_status;
            echo json_encode($array);
            exit;
        }
    }
}


text:
/**
@file NGUIInfrastructure.cs
@author NDark
@date 20170402 file started.

*/
#define NDU_INFRASTRUCTURE_USE_NGUI
using UnityEngine;

public static partial class NGUIInfrastructure
{

	public static void SetNGUILocalization( string _Language )
	{
		#if NDU_INFRASTRUCTURE_USE_NGUI
		Localization.language = _Language ;
		#endif // NDU_INFRASTRUCTURE_USE_NGUI
	}

}


text:
require "tictactoe_core/version"
require "tictactoe_core/game"
require "tictactoe_core/ai_negamax"
require "tictactoe_core/player"
require "tictactoe_core/player_factory"
require "tictactoe_core/board"


text:
namespace SignalR.ServiceBus
{
    using System;
    using System.Threading;

    sealed class CompletedAsyncResult<TResult> : IAsyncResult
    {
        readonly ManualResetEvent asyncWaitHandle;
        readonly object asyncState;
        readonly TResult result;

        public CompletedAsyncResult(TResult result, AsyncCallback callback, object state)
        {
            this.result = result;
            this.asyncWaitHandle = new ManualResetEvent(true);
            this.asyncState = state;

            if (callback != null)
            {
                callback(this);
            }
        }

        public TResult Result
        {
            get { return this.result; }
        }

        public object AsyncState
        {
            get { return this.asyncState; }
        }

        public WaitHandle AsyncWaitHandle
        {
            get { return this.asyncWaitHandle; }
        }

        public bool CompletedSynchronously
        {
            get { return true; }
        }

        public bool IsCompleted
        {
            get { return true; }
        }

        public static TResult End(IAsyncResult asyncResult)
        {
            CompletedAsyncResult<TResult> completedAsyncResult = (CompletedAsyncResult<TResult>)asyncResult;
            completedAsyncResult.AsyncWaitHandle.Close();
            return completedAsyncResult.Result;
        }
    }
}


text:
package com.taobao.weex.utils;

import android.graphics.Paint;
import android.graphics.Typeface;
import com.taobao.weappplus_sdk.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;

import static org.junit.Assert.*;

/**
 * Created by sospartan on 8/2/16.
 */
@RunWith(RobolectricGradleTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 19)
@PowerMockIgnore({ "org.mockito.*", "org.robolectric.*", "android.*" })
public class TypefaceUtilTest {

  @Test
  public void testPutFontDO() throws Exception {
    FontDO font = new FontDO("test","url('test')");
    TypefaceUtil.putFontDO(font);
    assertEquals(TypefaceUtil.getFontDO("test").getUrl(),"test");

  }

}


text:
namespace SDB.grammar {
using Antlr4.Runtime.Misc;
using Antlr4.Runtime.Tree;
using IToken = Antlr4.Runtime.IToken;

/// <summary>
/// This interface defines a complete generic visitor for a parse tree produced
/// by <see cref="SDBParser"/>.
/// </summary>
/// <typeparam name="Result">The return type of the visit operation.</typeparam>
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.5.1")]
[System.CLSCompliant(false)]
public interface ISDBVisitor<Result> : IParseTreeVisitor<Result> {
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.prog"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitProg([NotNull] SDBParser.ProgContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.stmt"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitStmt([NotNull] SDBParser.StmtContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.genTable"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitGenTable([NotNull] SDBParser.GenTableContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.hash"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitHash([NotNull] SDBParser.HashContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>hashDataTail</c>
	/// labeled alternative in <see cref="SDBParser.hashData"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitHashDataTail([NotNull] SDBParser.HashDataTailContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>hashDataReq</c>
	/// labeled alternative in <see cref="SDBParser.hashData"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitHashDataReq([NotNull] SDBParser.HashDataReqContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.hashSet"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitHashSet([NotNull] SDBParser.HashSetContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.instr"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitInstr([NotNull] SDBParser.InstrContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.dbAdd"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDbAdd([NotNull] SDBParser.DbAddContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.dbInsert"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDbInsert([NotNull] SDBParser.DbInsertContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.dbQuery"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDbQuery([NotNull] SDBParser.DbQueryContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.dbShow"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDbShow([NotNull] SDBParser.DbShowContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.dbRollBack"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDbRollBack([NotNull] SDBParser.DbRollBackContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.dbDelete"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDbDelete([NotNull] SDBParser.DbDeleteContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.dbUpdate"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDbUpdate([NotNull] SDBParser.DbUpdateContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.dbUInput"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDbUInput([NotNull] SDBParser.DbUInputContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.deleteParam"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDeleteParam([NotNull] SDBParser.DeleteParamContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>deleteByQuery</c>
	/// labeled alternative in <see cref="SDBParser.deleteSet"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDeleteByQuery([NotNull] SDBParser.DeleteByQueryContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>deleteByPid</c>
	/// labeled alternative in <see cref="SDBParser.deleteSet"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDeleteByPid([NotNull] SDBParser.DeleteByPidContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>deleteAll</c>
	/// labeled alternative in <see cref="SDBParser.deleteSet"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDeleteAll([NotNull] SDBParser.DeleteAllContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.rollBackParam"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitRollBackParam([NotNull] SDBParser.RollBackParamContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.queryParam"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitQueryParam([NotNull] SDBParser.QueryParamContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>queryMapTail</c>
	/// labeled alternative in <see cref="SDBParser.queryMap"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitQueryMapTail([NotNull] SDBParser.QueryMapTailContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>queryMapReq</c>
	/// labeled alternative in <see cref="SDBParser.queryMap"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitQueryMapReq([NotNull] SDBParser.QueryMapReqContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.querySet"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitQuerySet([NotNull] SDBParser.QuerySetContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>updateMapTail</c>
	/// labeled alternative in <see cref="SDBParser.updateMap"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitUpdateMapTail([NotNull] SDBParser.UpdateMapTailContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>updateMapReq</c>
	/// labeled alternative in <see cref="SDBParser.updateMap"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitUpdateMapReq([NotNull] SDBParser.UpdateMapReqContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>updateSetOne</c>
	/// labeled alternative in <see cref="SDBParser.updateSet"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitUpdateSetOne([NotNull] SDBParser.UpdateSetOneContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>updateSetLst</c>
	/// labeled alternative in <see cref="SDBParser.updateSet"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitUpdateSetLst([NotNull] SDBParser.UpdateSetLstContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.insertParam"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitInsertParam([NotNull] SDBParser.InsertParamContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>insertMapTail</c>
	/// labeled alternative in <see cref="SDBParser.insertMap"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitInsertMapTail([NotNull] SDBParser.InsertMapTailContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>insertMapReq</c>
	/// labeled alternative in <see cref="SDBParser.insertMap"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitInsertMapReq([NotNull] SDBParser.InsertMapReqContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.insertSet"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitInsertSet([NotNull] SDBParser.InsertSetContext context);
	/// <summary>
	/// Visit a parse tree produced by <see cref="SDBParser.paramList"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitParamList([NotNull] SDBParser.ParamListContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>Dlist_tail</c>
	/// labeled alternative in <see cref="SDBParser.dlist"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDlist_tail([NotNull] SDBParser.Dlist_tailContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>Dlist_recu</c>
	/// labeled alternative in <see cref="SDBParser.dlist"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitDlist_recu([NotNull] SDBParser.Dlist_recuContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>Type_int</c>
	/// labeled alternative in <see cref="SDBParser.dataTypes"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitType_int([NotNull] SDBParser.Type_intContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>Type_float</c>
	/// labeled alternative in <see cref="SDBParser.dataTypes"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitType_float([NotNull] SDBParser.Type_floatContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>Type_text</c>
	/// labeled alternative in <see cref="SDBParser.dataTypes"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitType_text([NotNull] SDBParser.Type_textContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>Type_null</c>
	/// labeled alternative in <see cref="SDBParser.dataTypes"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitType_null([NotNull] SDBParser.Type_nullContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>Type_cid</c>
	/// labeled alternative in <see cref="SDBParser.dataTypes"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitType_cid([NotNull] SDBParser.Type_cidContext context);
	/// <summary>
	/// Visit a parse tree produced by the <c>Type_call</c>
	/// labeled alternative in <see cref="SDBParser.dataTypes"/>.
	/// </summary>
	/// <param name="context">The parse tree.</param>
	/// <return>The visitor result.</return>
	Result VisitType_call([NotNull] SDBParser.Type_callContext context);
}
} // namespace SDB.grammar


text:
package org.apache.nifi.distributed.cache.server.map;

import java.io.File;
import java.io.IOException;
import java.nio.channels.OverlappingFileLockException;
import org.apache.nifi.distributed.cache.server.EvictionPolicy;
import static org.junit.Assert.fail;
import org.junit.Test;

public class TestPersistentMapCache {

    /**
     * Test OverlappingFileLockException is caught when persistent path is duplicated.
     */
    @Test(expected=OverlappingFileLockException.class)
    public void testDuplicatePersistenceDirectory() {
        try {
            File duplicatedFilePath = new File("/tmp/path1");
            final MapCache cache = new SimpleMapCache("simpleCache", 2, EvictionPolicy.FIFO);
            PersistentMapCache pmc1 = new PersistentMapCache("id1", duplicatedFilePath, cache);
            PersistentMapCache pmc2 = new PersistentMapCache("id2", duplicatedFilePath, cache);
        } catch (IOException ex) {
            fail("Unexpected IOException thrown: " + ex.getMessage());
        }
    }
}


text:
module Capistrano
  module SlackNotification
    VERSION = '0.3.1'
  end
end


text:
/************************************************************************************
* (Combine files GUI) Rewrite Exercise 17.12 with a GUI, as shown in Figure 17.21b. *
************************************************************************************/
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.BorderPane;
import javafx.geometry.Pos;
import javafx.geometry.Insets;
import java.io.*;

public class Exercise_17_13 extends Application {
	protected TextField tfFileName = new TextField();
	protected TextField tfNumberOfFiles = new TextField();

	@Override // Override the start method in the Application class
	public void start(Stage primaryStage) {
		// Create a label
		Label lblText = new Label(
			"If the base file is named temp.txt wth three pieces,\n" +
			"temp.txt.1, temp.txt.2, and temp.txt.3 are combined into temp.txt.");

		// Create a grid pane, place labels and text fields
		// into it and set its padding an horizontal gaps
		GridPane paneForFields = new GridPane();
		paneForFields.setHgap(5);
		paneForFields.add(new Label("Enter a file"), 0, 0);
		paneForFields.add(tfFileName, 1, 0);
		paneForFields.add(new Label("Specify the number of smaller files"), 0, 1);
		paneForFields.add(tfNumberOfFiles, 1, 1);
		paneForFields.setPadding(new Insets(5, 20, 5, 0));

		// Create a button
		Button btStart = new Button("Start");

		// Create a border pane and place node into it
		BorderPane pane = new BorderPane();
		pane.setTop(lblText);
		pane.setCenter(paneForFields);
		pane.setBottom(btStart);
		pane.setAlignment(btStart, Pos.CENTER);

		// Create and register handler
		btStart.setOnAction(e -> start());

		// Create a scene and place it in the stage
		Scene scene = new Scene(pane);
		primaryStage.setTitle("Exercise_17_13"); // Set the stage title
		primaryStage.setScene(scene); // Place the scene in the stage
		primaryStage.show(); // Display the stage
	}

	/* Combines the specified files */
	private void start() {
		// Get the number of smaller files
		int n = Integer.parseInt(tfNumberOfFiles.getText());

		// Create a array of random access files of length n
		RandomAccessFile[] source = new RandomAccessFile[n];

		try ( // Create a random access file
			RandomAccessFile target =
				new RandomAccessFile(tfFileName.getText(), "rw");
		) {
			// Place the smaller files into the array
			for (int i = 0; i < source.length; i++) {
				source[i] = new RandomAccessFile(
					tfFileName.getText() + "." + (i + 1), "rw");
			}

			// Read the smaller files in accending order
			// and write each into the target file
			for (int i = 0; i < source.length; i++) {
				byte[] b = new byte[(int)source[i].length()];
				source[i].seek(0);
				source[i].read(b);
				target.seek(target.length());
				target.write(b);
			}
		}
		catch (IOException ex) {
			System.out.println("IO exception");
		}
	}
}


text:
file(REMOVE_RECURSE
  "CMakeFiles/compile_HouseholderSequence_HouseholderSequence.dir/compile_HouseholderSequence_HouseholderSequence.cpp.o"
  "compile_HouseholderSequence_HouseholderSequence.pdb"
  "compile_HouseholderSequence_HouseholderSequence"
)

# Per-language clean rules from dependency scanning.
foreach(lang CXX)
  include(CMakeFiles/compile_HouseholderSequence_HouseholderSequence.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()


text:
define(['footwork', 'lodash', 'fetch-mock'],
  function(fw, _, fetchMock) {
    describe('ajax', function() {
      beforeEach(prepareTestEnv);
      afterEach(cleanTestEnv);

      it('sync throws error when not passed a dataModel or collection', function() {
        expect(function() { fw.sync('get', null) }).toThrow();
      });

      it('sync throws error when passed an invalid action', function() {
        expect(function() { fw.sync('invalid-action', fw.collection()) }).toThrow();
      });

      it('sync throws error when attempting to request using an invalid URL', function() {
        var testDataModel = new (function () {
          fw.dataModel.boot(this, {
            url: null
          });
        });
        expect(function() { fw.sync('get', testDataModel) }).toThrow();
      });

      it('sync throws error when attempting to request using an invalid action', function() {
        var testDataModel = new (function () {
          fw.dataModel.boot(this, {
            url: '/fetch/url',
          });
        });
        expect(function() { fw.sync('INVALID-ACTION', testDataModel) }).toThrow();
      });
    });
  }
);


text:
use Search::Kino03::KinoSearch;

1;

__END__

__AUTO_XS__

my $synopsis = <<'END_SYNOPSIS';
    package MyArchitecture;
    use base qw( Search::Kino03::KinoSearch::Architecture );

    use Search::Kino03::KSx::Index::ZlibDocWriter;
    use Search::Kino03::KSx::Index::ZlibDocReader;

    sub register_doc_writer {
        my ( $self, $seg_writer ) = @_;
        my $doc_writer = Search::Kino03::KSx::Index::ZlibDocWriter->new(
            snapshot   => $seg_writer->get_snapshot,
            segment    => $seg_writer->get_segment,
            polyreader => $seg_writer->get_polyreader,
        );
        $seg_writer->register(
            api       => "Search::Kino03::KinoSearch::Index::DocReader",
            component => $doc_writer,
        );
        $seg_writer->add_writer($doc_writer);
    }

    sub register_doc_reader {
        my ( $self, $seg_reader ) = @_;
        my $doc_reader = Search::Kino03::KSx::Index::ZlibDocReader->new(
            schema   => $seg_reader->get_schema,
            folder   => $seg_reader->get_folder,
            segments => $seg_reader->get_segments,
            seg_tick => $seg_reader->get_seg_tick,
            snapshot => $seg_reader->get_snapshot,
        );
        $seg_reader->register(
            api       => 'Search::Kino03::KinoSearch::Index::DocReader',
            component => $doc_reader,
        );
    }

    package MySchema;
    use base qw( Search::Kino03::KinoSearch::Schema );

    sub architecture {
        shift;
        return MyArchitecture->new(@_);
    }
END_SYNOPSIS

{   "Search::Kino03::KinoSearch::Architecture" => {
        bind_methods => [
            qw(
                Index_Interval
                Skip_Interval
                Init_Seg_Reader
                Register_Doc_Writer
                Register_Doc_Reader
                Register_Deletions_Writer
                Register_Deletions_Reader
                Register_Lexicon_Reader
                Register_Postings_Writer
                Register_Postings_Reader
                Register_Sort_Writer
                Register_Sort_Reader
                Register_Highlight_Writer
                Register_Highlight_Reader
                Make_Similarity
                )
        ],
        make_constructors => ["new"],
        make_pod          => {
            synopsis => $synopsis,
            methods  => [
                qw(
                    register_doc_writer
                    register_doc_reader
                    )
            ],
        }
    }
}

__COPYRIGHT__

Copyright 2005-2009 Marvin Humphrey

This program is free software; you can redistribute it and/or modify
under the same terms as Perl itself.


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:paddingLeft="24dp" >

	<Button
		android:id="@+id/deleteButton"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_alignParentRight="true"
		android:layout_centerVertical="true"
		android:background="@null"
		android:focusable="false"
		android:focusableInTouchMode="false"
		android:text="X" />

	<TextView
		android:id="@+id/text"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:layout_centerVertical="true"
		android:layout_toLeftOf="@id/deleteButton"
		android:focusable="false"
		android:focusableInTouchMode="false"
		android:text="Hello, World!"
		android:textSize="18sp" />

</RelativeLayout>


text:
package seedu.task.logic.parser;

import static seedu.task.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;

import java.util.Optional;

import seedu.task.logic.commands.Command;
import seedu.task.logic.commands.IncorrectCommand;
import seedu.task.logic.commands.PinCommand;

public class PinParser extends BaseParser {
    @Override
    public Command parse(String command, String arguments) {
        this.extractArguments(arguments);

        Optional<Integer> index = parseIndex();
        if (!index.isPresent()) {
            return new IncorrectCommand(String.format(MESSAGE_INVALID_COMMAND_FORMAT, PinCommand.MESSAGE_USAGE));
        }
        return new PinCommand(index.get());
    }
}