text:
/*
 * @test
 * @bug 4241229 4785453
 * @summary Test -classpath option and classpath defaults.
 * @library /tools/javac/lib
 * @build ToolBox
 * @run main ClassPathTest
 */

import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

//original test: test/tools/javac/ClassPathTest/ClassPathTest.sh
public class ClassPathTest {

    private static final String ClassPathTest1Src =
        "import pkg.*;\n" +
        "public class ClassPathTest1 {\n" +
        "    ClassPathTestAux1 x;\n" +
        "}";

    private static final String ClassPathTest2Src =
        "import pkg.*;\n" +
        "public class ClassPathTest2 {\n" +
        "    ClassPathTestAux2 x;\n" +
        "}";

    private static final String ClassPathTest3Src =
        "import pkg.*;\n" +
        "public class ClassPathTest3 {\n" +
        "    ClassPathTestAux3 x;\n" +
        "}";

    private static final String fooPkgClassPathTestAux1Src =
        "package pkg;\n" +
        "public class ClassPathTestAux1 {}";

    private static final String barPkgClassPathTestAux2Src =
        "package pkg;\n" +
        "public class ClassPathTestAux2 {}";

    private static final String pkgClassPathTestAux3Src =
        "package pkg;\n" +
        "public class ClassPathTestAux3 {}";

    ProcessBuilder pb = null;

    public static void main(String[] args) throws Exception {
        new ClassPathTest().test();
    }

    public void test() throws Exception {
        createOutputDirAndSourceFiles();
        checkCompileCommands();
    }

    void createOutputDirAndSourceFiles() throws Exception {
        //dirs and files creation
        ToolBox.createJavaFileFromSource(ClassPathTest1Src);
        ToolBox.createJavaFileFromSource(ClassPathTest2Src);
        ToolBox.createJavaFileFromSource(ClassPathTest3Src);
        ToolBox.createJavaFileFromSource(Paths.get("foo"),
                fooPkgClassPathTestAux1Src);
        ToolBox.createJavaFileFromSource(Paths.get("bar"),
                barPkgClassPathTestAux2Src);
        ToolBox.createJavaFileFromSource(pkgClassPathTestAux3Src);
    }

    void checkCompileCommands() throws Exception {
//        Without the -cp . parameter the command will fail seems like when called
//        from the command line, the current dir is added to the classpath
//        automatically but this is not happening when called using ProcessBuilder

//        testJavac success ClassPathTest3.java
        List<String> mainArgs = new ArrayList<>();
        mainArgs.add(ToolBox.javacBinary.toString());
        if (ToolBox.testToolVMOpts != null) {
            mainArgs.addAll(ToolBox.testToolVMOpts);
        }

        List<String> commonArgs = new ArrayList<>();
        commonArgs.addAll(mainArgs);
        commonArgs.addAll(Arrays.asList("-cp", "."));

        ToolBox.AnyToolArgs successParams = new ToolBox.AnyToolArgs()
                .appendArgs(commonArgs)
                .appendArgs("ClassPathTest3.java");
        ToolBox.executeCommand(successParams);

//        testJavac failure ClassPathTest1.java
        ToolBox.AnyToolArgs failParams =
                new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
                .appendArgs(commonArgs)
                .appendArgs("ClassPathTest1.java");
        ToolBox.executeCommand(failParams);

//        This is done inside the executeCommand method
//        CLASSPATH=bar; export CLASSPATH

        Map<String, String> extVars = new TreeMap<>();
        extVars.put("CLASSPATH", "bar");

//        testJavac success ClassPathTest2.java
        successParams = new ToolBox.AnyToolArgs()
                .appendArgs(mainArgs)
                .appendArgs("ClassPathTest2.java")
                .set(extVars);
        ToolBox.executeCommand(successParams);

//        testJavac failure ClassPathTest1.java
        failParams = new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
                .appendArgs(mainArgs)
                .appendArgs("ClassPathTest1.java")
                .set(extVars);
        ToolBox.executeCommand(failParams);

//        testJavac failure ClassPathTest3.java
        failParams = new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
                .appendArgs(mainArgs)
                .appendArgs("ClassPathTest3.java")
                .set(extVars);
        ToolBox.executeCommand(failParams);

//        testJavac success -classpath foo ClassPathTest1.java

        commonArgs.clear();
        commonArgs.addAll(mainArgs);
        commonArgs.addAll(Arrays.asList("-cp", "foo"));

        successParams = new ToolBox.AnyToolArgs()
                .appendArgs(commonArgs)
                .appendArgs("ClassPathTest1.java")
                .set(extVars);
        ToolBox.executeCommand(successParams);

//        testJavac failure -classpath foo ClassPathTest2.java
        failParams = new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
                .appendArgs(commonArgs)
                .appendArgs("ClassPathTest2.java")
                .set(extVars);
        ToolBox.executeCommand(failParams);

//        testJavac failure -classpath foo ClassPathTest3.java
        failParams = new ToolBox.AnyToolArgs(ToolBox.Expect.FAIL)
                .appendArgs(commonArgs)
                .appendArgs("ClassPathTest3.java")
                .set(extVars);
        ToolBox.executeCommand(failParams);
    }

}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>ca.uhn.hapi.fhir</groupId>
		<artifactId>hapi-deployable-pom</artifactId>
		<version>1.5-SNAPSHOT</version>
		<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
	</parent>

	<artifactId>hapi-fhir-osgi-core</artifactId>
	<packaging>bundle</packaging>

	<url>http://jamesagnew.github.io/hapi-fhir/</url>

	<name>HAPI FHIR - OSGi Bundle</name>

	<dependencies>
		<dependency>
			<groupId>ca.uhn.hapi.fhir</groupId>
			<artifactId>hapi-fhir-base</artifactId>
			<version>1.5-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>ca.uhn.hapi.fhir</groupId>
			<artifactId>hapi-fhir-structures-dstu</artifactId>
			<version>1.5-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>ca.uhn.hapi.fhir</groupId>
			<artifactId>hapi-fhir-structures-dstu2</artifactId>
			<version>1.5-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>ca.uhn.hapi.fhir</groupId>
			<artifactId>hapi-fhir-structures-hl7org-dstu2</artifactId>
			<version>1.5-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>ca.uhn.hapi.fhir</groupId>
			<artifactId>hapi-fhir-structures-dstu3</artifactId>
			<version>1.5-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>ca.uhn.hapi.fhir</groupId>
			<artifactId>hapi-fhir-validation-resources-dstu2</artifactId>
			<version>1.5-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>ca.uhn.hapi.fhir</groupId>
			<artifactId>hapi-fhir-validation-resources-dstu3</artifactId>
			<version>1.5-SNAPSHOT</version>
		</dependency>

		<dependency>
			<groupId>org.thymeleaf</groupId>
			<artifactId>thymeleaf</artifactId>
		</dependency>
		<dependency>
			<groupId>com.phloc</groupId>
			<artifactId>phloc-schematron</artifactId>
		</dependency>
		<dependency>
			<groupId>com.phloc</groupId>
			<artifactId>phloc-commons</artifactId>
		</dependency>

		<dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>javax.servlet-api</artifactId>
         <scope>provided</scope>
      </dependency>

		<!-- Don't force OSGi users to use a newer version of SLF4j than we need -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j_target_version}</version>
		</dependency>

	</dependencies>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<id>copySources</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<copy todir="target/sources">
									<fileset dir="../hapi-fhir-base/src/main/java" />
									<fileset dir="../hapi-fhir-structures-dstu/src/main/java" />
									<fileset dir="../hapi-fhir-structures-dstu/target/generated-sources/tinder" />
									<fileset dir="../hapi-fhir-structures-dstu2/src/main/java" />
									<fileset dir="../hapi-fhir-structures-dstu2/target/generated-sources/tinder" />
									<fileset dir="../hapi-fhir-structures-hl7org-dstu2/src/main/java" />
									<fileset dir="../hapi-fhir-structures-dstu3/src/main/java" />
								</copy>
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>target/sources</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<!--<Export-Package>ca.uhn.fhir</Export-Package> <Export-Package>org.hl7.fhir</Export-Package> -->
						<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
						<!--<Embed-Dependency>*;scope=!provided|test</Embed-Dependency> <Embed-Directory>lib</Embed-Directory> <Embed-Transitive>true</Embed-Transitive> -->
						<_nouses>true</_nouses>
						<_removeheaders>Built-By, Include-Resource, Private-Package</_removeheaders>
						<!-- <Private-Package>org.foo.myproject.*</Private-Package> <Bundle-Activator>org.foo.myproject.impl1.Activator</Bundle-Activator> -->
						<!-- <Embed-Dependency>*;scope=compile|runtime;inline=false;artifactId=hapi-fhir-*</Embed-Dependency> -->
						<Import-Package>
							!ca.uhn.*,
							!org.hl7.*,
							com.ctc.wstx.api;version="4.4";resolution:=optional,
							com.ctc.wstx.*;version="4.4";resolution:=optional,
							com.google.*;resolution:=optional;-remove-attribute:=version,
							com.phloc.commons;resolution:=optional;-remove-attribute:=version,
							com.phloc.*;resolution:=optional;-remove-attribute:=version,
							javax.*;-remove-attribute:=version,
							net.sf.saxon;resolution:=optional,
							org.apache.commons.*;-remove-attribute:=version,
							org.apache.http.client.protocol;version="4.0",
							org.apache.http.*;version="4.0",
							org.codehaus.stax2;resolution:=optional;-remove-attribute:=version,
							org.codehaus.stax2.*;resolution:=optional;-remove-attribute:=version,
							org.oclc.purl.*;-remove-attribute:=version,
							org.slf4j.*;-remove-attribute:=version,
                            org.xmlpull.v1;resolution:=optional,
							*
						</Import-Package>
					</instructions>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>bundle</goal>
						</goals>
						<phase>package</phase>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<configuration>
					<redirectTestOutputToFile>true</redirectTestOutputToFile>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
						<phase>integration-test</phase>
					</execution>
				</executions>
			</plugin>

		</plugins>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
			<resource>
				<directory>../hapi-fhir-base/src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
			<resource>
				<directory>../hapi-fhir-structures-dstu/src/main/resources</directory>
				<filtering>false</filtering>
			</resource>
			<resource>
				<directory>../hapi-fhir-structures-dstu/target/generated-resources/tinder</directory>
				<filtering>false</filtering>
			</resource>
			<resource>
				<directory>../hapi-fhir-structures-dstu2/src/main/resources</directory>
				<filtering>false</filtering>
			</resource>
			<resource>
				<directory>../hapi-fhir-structures-dstu2/target/generated-resources/tinder</directory>
				<filtering>false</filtering>
			</resource>
			<resource>
				<directory>../hapi-fhir-structures-hl7org-dstu2/src/main/resources</directory>
				<filtering>false</filtering>
			</resource>
			<resource>
				<directory>../hapi-fhir-structures-dstu3/src/main/resources</directory>
				<filtering>false</filtering>
			</resource>
			<!--
			<resource>
				<directory>../hapi-fhir-structures-dstu3/target/generated-resources/tinder</directory>
				<filtering>false</filtering>
			</resource>
			-->
			<resource>
				<directory>../hapi-fhir-validation-resources-dstu2/src/main/resources</directory>
				<filtering>false</filtering>
			</resource>
			<resource>
				<directory>../hapi-fhir-validation-resources-dstu3/src/main/resources</directory>
				<filtering>false</filtering>
			</resource>
		</resources>
	</build>

</project>

redpajama_set_name: RedPajamaGithub


text:
class CustomerOrder < ActiveRecord::Base
  ##
  # to submit customer orders
  class CheckoutService
    delegate :errors, to: :validator

    def initialize(user, customer_order, submission_attributes)
      @user = user
      @customer_order = customer_order
      @submission_attributes = submission_attributes
    end

    ##
    # @return [Boolean]
    def save
      valid? && submit_order!
    end

    def valid?
      validator.valid?
    end

    private

    ##
    # @return [Boolean]
    def submit_order!
      submitter.submit_order! && notify_providers!
    end

    def submitter
      Submitter.new(@customer_order)
    end

    def validator
      @validator ||= Validator.new(
        @user,
        @customer_order,
        @submission_attributes
      )
    end

    def notify_providers!
      NotifyProviders.delay.run(@customer_order.id)
    end
  end
end


text:
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/uaccess.h>
#include "ipa_i.h"

#define IPA_NAT_PHYS_MEM_OFFSET  0
#define IPA_NAT_PHYS_MEM_SIZE  IPA_RAM_NAT_SIZE

#define IPA_NAT_SYSTEM_MEMORY  0
#define IPA_NAT_SHARED_MEMORY  1

static int ipa_nat_vma_fault_remap(
	 struct vm_area_struct *vma, struct vm_fault *vmf)
{
	IPADBG("\n");
	vmf->page = NULL;

	return VM_FAULT_SIGBUS;
}

/* VMA related file operations functions */
static struct vm_operations_struct ipa_nat_remap_vm_ops = {
	.fault = ipa_nat_vma_fault_remap,
};

static int ipa_nat_open(struct inode *inode, struct file *filp)
{
	struct ipa_nat_mem *nat_ctx;
	IPADBG("\n");
	nat_ctx = container_of(inode->i_cdev, struct ipa_nat_mem, cdev);
	filp->private_data = nat_ctx;
	IPADBG("return\n");
	return 0;
}

static int ipa_nat_mmap(struct file *filp, struct vm_area_struct *vma)
{
	unsigned long vsize = vma->vm_end - vma->vm_start;
	struct ipa_nat_mem *nat_ctx = (struct ipa_nat_mem *)filp->private_data;
	unsigned long phys_addr;
	int result;

	mutex_lock(&nat_ctx->lock);
	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
	if (nat_ctx->is_sys_mem) {
		IPADBG("Mapping system memory\n");
		if (nat_ctx->is_mapped) {
			IPAERR("mapping already exists, only 1 supported\n");
			result = -EINVAL;
			goto bail;
		}
		IPADBG("map sz=0x%x\n", nat_ctx->size);
		result =
			dma_mmap_coherent(
				 NULL, vma,
				 nat_ctx->vaddr, nat_ctx->dma_handle,
				 nat_ctx->size);

		if (result) {
			IPAERR("unable to map memory. Err:%d\n", result);
			goto bail;
		}
		ipa_ctx->nat_mem.nat_base_address = nat_ctx->vaddr;
	} else {
		IPADBG("Mapping shared(local) memory\n");
		IPADBG("map sz=0x%lx\n", vsize);
		phys_addr = ipa_ctx->ipa_wrapper_base + IPA_REG_BASE_OFST +
			IPA_SRAM_DIRECT_ACCESS_n_OFST(IPA_NAT_PHYS_MEM_OFFSET);

		if (remap_pfn_range(
			 vma, vma->vm_start,
			 phys_addr >> PAGE_SHIFT, vsize, vma->vm_page_prot)) {
			IPAERR("remap failed\n");
			result = -EAGAIN;
			goto bail;
		}
		ipa_ctx->nat_mem.nat_base_address = (void *)vma->vm_start;
	}
	nat_ctx->is_mapped = true;
	vma->vm_ops = &ipa_nat_remap_vm_ops;
	IPADBG("return\n");
	result = 0;
bail:
	mutex_unlock(&nat_ctx->lock);
	return result;
}

static const struct file_operations ipa_nat_fops = {
	.owner = THIS_MODULE,
	.open = ipa_nat_open,
	.mmap = ipa_nat_mmap
};

/**
 * allocate_nat_device() - Allocates memory for the NAT device
 * @mem:	[in/out] memory parameters
 *
 * Called by NAT client driver to allocate memory for the NAT entries. Based on
 * the request size either shared or system memory will be used.
 *
 * Returns:	0 on success, negative on failure
 */
int allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem)
{
	struct ipa_nat_mem *nat_ctx = &(ipa_ctx->nat_mem);
	int gfp_flags = GFP_KERNEL | __GFP_ZERO;
	int result;

	IPADBG("passed memory size %d\n", mem->size);

	mutex_lock(&nat_ctx->lock);
	if (mem->size <= 0 || !strlen(mem->dev_name)
			|| nat_ctx->is_dev_init == true) {
		IPADBG("Invalid Parameters or device is already init\n");
		result = -EPERM;
		goto bail;
	}

	if (mem->size > IPA_NAT_PHYS_MEM_SIZE) {
		IPADBG("Allocating system memory\n");
		nat_ctx->is_sys_mem = true;
		nat_ctx->vaddr =
		   dma_alloc_coherent(NULL, mem->size, &nat_ctx->dma_handle,
				       gfp_flags);
		if (nat_ctx->vaddr == NULL) {
			IPAERR("memory alloc failed\n");
			result = -ENOMEM;
			goto bail;
		}
		nat_ctx->size = mem->size;
	} else {
		IPADBG("using shared(local) memory\n");
		nat_ctx->is_sys_mem = false;
	}

	nat_ctx->class = class_create(THIS_MODULE, mem->dev_name);
	if (IS_ERR(nat_ctx->class)) {
		IPAERR("unable to create the class\n");
		result = -ENODEV;
		goto vaddr_alloc_fail;
	}
	result = alloc_chrdev_region(&nat_ctx->dev_num,
					0,
					1,
					mem->dev_name);
	if (result) {
		IPAERR("alloc_chrdev_region err.\n");
		result = -ENODEV;
		goto alloc_chrdev_region_fail;
	}

	nat_ctx->dev =
	   device_create(nat_ctx->class, NULL, nat_ctx->dev_num, nat_ctx,
			"%s", mem->dev_name);

	if (IS_ERR(nat_ctx->dev)) {
		IPAERR("device_create err:%ld\n", PTR_ERR(nat_ctx->dev));
		result = -ENODEV;
		goto device_create_fail;
	}

	cdev_init(&nat_ctx->cdev, &ipa_nat_fops);
	nat_ctx->cdev.owner = THIS_MODULE;
	nat_ctx->cdev.ops = &ipa_nat_fops;

	result = cdev_add(&nat_ctx->cdev, nat_ctx->dev_num, 1);
	if (result) {
		IPAERR("cdev_add err=%d\n", -result);
		goto cdev_add_fail;
	}
	nat_ctx->is_dev_init = true;
	IPADBG("IPA NAT driver init successfully\n");
	result = 0;
	goto bail;

cdev_add_fail:
	device_destroy(nat_ctx->class, nat_ctx->dev_num);
device_create_fail:
	unregister_chrdev_region(nat_ctx->dev_num, 1);
alloc_chrdev_region_fail:
	class_destroy(nat_ctx->class);
vaddr_alloc_fail:
	if (nat_ctx->vaddr) {
		IPADBG("Releasing system memory\n");
		dma_free_coherent(
			 NULL, nat_ctx->size,
			 nat_ctx->vaddr, nat_ctx->dma_handle);
		nat_ctx->vaddr = NULL;
		nat_ctx->dma_handle = 0;
		nat_ctx->size = 0;
	}
bail:
	mutex_unlock(&nat_ctx->lock);

	return result;
}

/* IOCTL function handlers */
/**
 * ipa_nat_init_cmd() - Post IP_V4_NAT_INIT command to IPA HW
 * @init:	[in] initialization command attributes
 *
 * Called by NAT client driver to post IP_V4_NAT_INIT command to IPA HW
 *
 * Returns:	0 on success, negative on failure
 */
int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init)
{
	struct ipa_desc desc = { 0 };
	struct ipa_ip_v4_nat_init *cmd;
	u16 size = sizeof(struct ipa_ip_v4_nat_init);
	int result;

	IPADBG("\n");
	if (init->tbl_index < 0 || init->table_entries <= 0) {
		IPADBG("Table index or entries is zero\n");
		result = -EPERM;
		goto bail;
	}
	cmd = kmalloc(size, GFP_KERNEL);
	if (!cmd) {
		IPAERR("Failed to alloc immediate command object\n");
		result = -ENOMEM;
		goto bail;
	}
	if (ipa_ctx->nat_mem.vaddr) {
		IPADBG("using system memory for nat table\n");
		cmd->ipv4_rules_addr_type = IPA_NAT_SYSTEM_MEMORY;
		cmd->ipv4_expansion_rules_addr_type = IPA_NAT_SYSTEM_MEMORY;
		cmd->index_table_addr_type = IPA_NAT_SYSTEM_MEMORY;
		cmd->index_table_expansion_addr_type = IPA_NAT_SYSTEM_MEMORY;

		cmd->ipv4_rules_addr =
			ipa_ctx->nat_mem.dma_handle + init->ipv4_rules_offset;
		IPADBG("ipv4_rules_offset:0x%x\n", init->ipv4_rules_offset);

		cmd->ipv4_expansion_rules_addr =
		   ipa_ctx->nat_mem.dma_handle + init->expn_rules_offset;
		IPADBG("expn_rules_offset:0x%x\n", init->expn_rules_offset);

		cmd->index_table_addr =
			ipa_ctx->nat_mem.dma_handle + init->index_offset;
		IPADBG("index_offset:0x%x\n", init->index_offset);

		cmd->index_table_expansion_addr =
		   ipa_ctx->nat_mem.dma_handle + init->index_expn_offset;
		IPADBG("index_expn_offset:0x%x\n", init->index_expn_offset);
	} else {
		IPADBG("using shared(local) memory for nat table\n");
		cmd->ipv4_rules_addr_type = IPA_NAT_SHARED_MEMORY;
		cmd->ipv4_expansion_rules_addr_type = IPA_NAT_SHARED_MEMORY;
		cmd->index_table_addr_type = IPA_NAT_SHARED_MEMORY;
		cmd->index_table_expansion_addr_type = IPA_NAT_SHARED_MEMORY;

		cmd->ipv4_rules_addr =
			init->ipv4_rules_offset + IPA_RAM_NAT_OFST;

		cmd->ipv4_expansion_rules_addr =
			init->expn_rules_offset + IPA_RAM_NAT_OFST;

		cmd->index_table_addr = init->index_offset + IPA_RAM_NAT_OFST;

		cmd->index_table_expansion_addr =
			init->index_expn_offset + IPA_RAM_NAT_OFST;
	}
	cmd->table_index = init->tbl_index;
	IPADBG("Table index:0x%x\n", cmd->table_index);
	cmd->size_base_tables = init->table_entries;
	IPADBG("Base Table size:0x%x\n", cmd->size_base_tables);
	cmd->size_expansion_tables = init->expn_table_entries;
	IPADBG("Expansion Table size:0x%x\n", cmd->size_expansion_tables);
	cmd->public_ip_addr = init->ip_addr;
	IPADBG("Public ip address:0x%x\n", cmd->public_ip_addr);
	desc.opcode = IPA_IP_V4_NAT_INIT;
	desc.type = IPA_IMM_CMD_DESC;
	desc.callback = NULL;
	desc.user1 = NULL;
	desc.user2 = NULL;
	desc.pyld = (void *)cmd;
	desc.len = size;
	IPADBG("posting v4 init command\n");
	if (ipa_send_cmd(1, &desc)) {
		IPAERR("Fail to send immediate command\n");
		result = -EPERM;
		goto free_cmd;
	}

	ipa_ctx->nat_mem.public_ip_addr = init->ip_addr;
	IPADBG("Table ip address:0x%x", ipa_ctx->nat_mem.public_ip_addr);

	ipa_ctx->nat_mem.ipv4_rules_addr =
	 (char *)ipa_ctx->nat_mem.nat_base_address + init->ipv4_rules_offset;
	IPADBG("ipv4_rules_addr: 0x%p\n",
				 ipa_ctx->nat_mem.ipv4_rules_addr);

	ipa_ctx->nat_mem.ipv4_expansion_rules_addr =
	 (char *)ipa_ctx->nat_mem.nat_base_address + init->expn_rules_offset;
	IPADBG("ipv4_expansion_rules_addr: 0x%p\n",
				 ipa_ctx->nat_mem.ipv4_expansion_rules_addr);

	ipa_ctx->nat_mem.index_table_addr =
		 (char *)ipa_ctx->nat_mem.nat_base_address + init->index_offset;
	IPADBG("index_table_addr: 0x%p\n",
				 ipa_ctx->nat_mem.index_table_addr);

	ipa_ctx->nat_mem.index_table_expansion_addr =
	 (char *)ipa_ctx->nat_mem.nat_base_address + init->index_expn_offset;
	IPADBG("index_table_expansion_addr: 0x%p\n",
				 ipa_ctx->nat_mem.index_table_expansion_addr);

	IPADBG("size_base_tables: %d\n", init->table_entries);
	ipa_ctx->nat_mem.size_base_tables  = init->table_entries;

	IPADBG("size_expansion_tables: %d\n", init->expn_table_entries);
	ipa_ctx->nat_mem.size_expansion_tables = init->expn_table_entries;

	IPADBG("return\n");
	result = 0;
free_cmd:
	kfree(cmd);
bail:
	return result;
}

/**
 * ipa_nat_dma_cmd() - Post NAT_DMA command to IPA HW
 * @dma:	[in] initialization command attributes
 *
 * Called by NAT client driver to post NAT_DMA command to IPA HW
 *
 * Returns:	0 on success, negative on failure
 */
int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma)
{
	struct ipa_nat_dma *cmd = NULL;
	struct ipa_desc *desc = NULL;
	u16 size = 0, cnt = 0;
	int ret = 0;

	IPADBG("\n");
	if (dma->entries <= 0) {
		IPADBG("Invalid number of commands\n");
		ret = -EPERM;
		goto bail;
	}
	size = sizeof(struct ipa_desc) * dma->entries;
	desc = kmalloc(size, GFP_KERNEL);
	if (desc == NULL) {
		IPAERR("Failed to alloc memory\n");
		ret = -ENOMEM;
		goto bail;
	}
	size = sizeof(struct ipa_nat_dma) * dma->entries;
	cmd = kmalloc(size, GFP_KERNEL);
	if (cmd == NULL) {
		IPAERR("Failed to alloc memory\n");
		ret = -ENOMEM;
		goto bail;
	}
	for (cnt = 0; cnt < dma->entries; cnt++) {
		cmd[cnt].table_index = dma->dma[cnt].table_index;
		cmd[cnt].base_addr = dma->dma[cnt].base_addr;
		cmd[cnt].offset = dma->dma[cnt].offset;
		cmd[cnt].data = dma->dma[cnt].data;
		desc[cnt].type = IPA_IMM_CMD_DESC;
		desc[cnt].opcode = IPA_NAT_DMA;
		desc[cnt].callback = NULL;
		desc[cnt].user1 = NULL;

		desc[cnt].user2 = NULL;

		desc[cnt].len = sizeof(struct ipa_nat_dma);
		desc[cnt].pyld = (void *)&cmd[cnt];

		ret = ipa_send_cmd(1, &desc[cnt]);
		if (ret == -EPERM)
			IPAERR("Fail to send immediate command %d\n", cnt);
	}

bail:
	kfree(cmd);
	kfree(desc);

	return ret;
}

/**
 * ipa_nat_free_mem_and_device() - free the NAT memory and remove the device
 * @nat_ctx:	[in] the IPA NAT memory to free
 *
 * Called by NAT client driver to free the NAT memory and remove the device
 */
void ipa_nat_free_mem_and_device(struct ipa_nat_mem *nat_ctx)
{
	IPADBG("\n");
	mutex_lock(&nat_ctx->lock);

	if (nat_ctx->is_sys_mem) {
		IPADBG("freeing the dma memory\n");
		dma_free_coherent(
			 NULL, nat_ctx->size,
			 nat_ctx->vaddr, nat_ctx->dma_handle);
		nat_ctx->size = 0;
		nat_ctx->vaddr = NULL;
	}
	nat_ctx->is_mapped = false;
	nat_ctx->is_sys_mem = false;
	cdev_del(&nat_ctx->cdev);
	device_destroy(nat_ctx->class, nat_ctx->dev_num);
	unregister_chrdev_region(nat_ctx->dev_num, 1);
	class_destroy(nat_ctx->class);
	nat_ctx->is_dev_init = false;

	mutex_unlock(&nat_ctx->lock);
	IPADBG("return\n");
	return;
}

/**
 * ipa_nat_del_cmd() - Delete a NAT table
 * @del:	[in] delete table table table parameters
 *
 * Called by NAT client driver to delete the nat table
 *
 * Returns:	0 on success, negative on failure
 */
int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del)
{
	struct ipa_desc desc = { 0 };
	struct ipa_ip_v4_nat_init *cmd;
	u16 size = sizeof(struct ipa_ip_v4_nat_init);
	u8 mem_type = IPA_NAT_SHARED_MEMORY;
	u32 base_addr = IPA_NAT_PHYS_MEM_OFFSET;
	int result;

	IPADBG("\n");
	if (del->table_index < 0 || del->public_ip_addr == 0) {
		IPADBG("Bad Parameter\n");
		result = -EPERM;
		goto bail;
	}
	cmd = kmalloc(size, GFP_KERNEL);
	if (cmd == NULL) {
		IPAERR("Failed to alloc immediate command object\n");
		result = -ENOMEM;
		goto bail;
	}
	cmd->table_index = del->table_index;
	cmd->ipv4_rules_addr = base_addr;
	cmd->ipv4_rules_addr_type = mem_type;
	cmd->ipv4_expansion_rules_addr = base_addr;
	cmd->ipv4_expansion_rules_addr_type = mem_type;
	cmd->index_table_addr = base_addr;
	cmd->index_table_addr_type = mem_type;
	cmd->index_table_expansion_addr = base_addr;
	cmd->index_table_expansion_addr_type = mem_type;
	cmd->size_base_tables = 0;
	cmd->size_expansion_tables = 0;
	cmd->public_ip_addr = del->public_ip_addr;

	desc.opcode = IPA_IP_V4_NAT_INIT;
	desc.type = IPA_IMM_CMD_DESC;
	desc.callback = NULL;
	desc.user1 = NULL;
	desc.user2 = NULL;
	desc.pyld = (void *)cmd;
	desc.len = size;
	if (ipa_send_cmd(1, &desc)) {
		IPAERR("Fail to send immediate command\n");
		result = -EPERM;
		goto free_mem;
	}

	ipa_nat_free_mem_and_device(&ipa_ctx->nat_mem);
	IPADBG("return\n");
	result = 0;
free_mem:
	kfree(cmd);
bail:
	return result;
}


text:
if [ "$CI" = "true" ] && [ "$TRAVIS" = "true" ];
then
  echo "Running on Travis CI"
  PR="$TRAVIS_PULL_REQUEST"
fi

if [ "$PR" != "false" ];
then
  echo "Running on pull request $PR"
  if [ ! -z "$api_key" ];
  then
    echo "Downloading sputnik.properties"
    wget -q "http://sputnik.touk.pl/conf/$TRAVIS_REPO_SLUG/sputnik-properties?key=$api_key" -O sputnik.properties
  fi
  wget "https://philanthropist.touk.pl/nexus/service/local/artifact/maven/redirect?r=snapshots&g=pl.touk&a=sputnik&c=all&v=LATEST" -O sputnik.jar && java -jar sputnik.jar --conf sputnik.properties --pullRequestId $PR
fi


text:
The `counters` module defines a general purpose counter service that
allows to associate counters to database entities.  For example it
can be used to track the number of times a blog post or a wiki page
is accessed.  The `counters` module maintains the counters in a table
on a per-day and per-entity basis.  It allows to update the full counter
in the target database entity table.

## Integration
The `Counter_Module` manages the counters associated with database entities.
To avoid having to update the database each time a counter is incremented,
counters are kept temporarily in a `Counter_Table` protected type.
The table contains only the partial increments and not the real counter
values.  Counters are flushed when the table reaches some limit, or,
when the table is oldest than some limit.  Counters are associated with
a day so that it becomes possible to gather per-day counters.
The table is also flushed when a counter is incremented in a different day.

To be able to use the `Counters` module, you will need to add the
following line in your GNAT project file:

```Ada
with "awa_counters";
```

An instance of the `Counter_Module` must be declared and registered in the
AWA application.  The module instance can be defined as follows:

```Ada
with AWA.Counters.Modules;
...
type Application is new AWA.Applications.Application with record
   Counter_Module : aliased AWA.Counters.Modules.Counter_Module;
end record;
```

And registered in the `Initialize_Modules` procedure by using:

```Ada
Register (App    => App.Self.all'Access,
          Name   => AWA.Counters.Modules.NAME,
          Module => App.Counter_Module'Access);
```

## Configuration
The `counters` module defines the following configuration parameters:

| Name                      | Description                                                    |
|:--------------------------|:---------------------------------------------------------------|
|counters.counter_age_limit|The maximum age limit in seconds for a pending counter increment to stay in the internal table. When a pending counter reaches this age limit, the pending counter increments are flushed and the table is cleared. The default is 5 minutes.|
| |300|
|counters.counter_limit|The maximum number of different counters which can be stored in the internal table before flushing the pending increments to the database. When this limit is reached, the pending counter increments are flushed and the table is cleared.|
| |1000|

## Counter Declaration
Each counter must be declared by instantiating the `Definition` package.
This instantiation serves as identification of the counter and it defines
the database table as well as the column in that table that will hold
the total counter.  The following definition is used for the read counter
of a wiki page.  The wiki page table contains a `read_count` column
and it will be incremented each time the counter is incremented.

```Ada
 with AWA.Counters.Definition;
 ...
 package Read_Counter is
    new AWA.Counters.Definition
       (AWA.Wikis.Models.WIKI_PAGE_TABLE, "read_count");
```

When the database table does not contain any counter column, the column
field name is not given and the counter definition is defined as follows:

```Ada
 with AWA.Counters.Definition;
 ...
 package Login_Counter is
    new AWA.Counters.Definition (AWA.Users.Models.USER_PAGE_TABLE);
```

Sometimes a counter is not associated with any database entity.
Such counters are global and they are assigned a unique name.

```Ada
 with AWA.Counters.Definition;
 ...
 package Start_Counter is
    new AWA.Counters.Definition (null, "startup_counter");
```

## Incrementing the counter
Incrementing the counter is done by calling the `Increment` operation.
When the counter is associated with a database entity, the entity
primary key must be given.  The counter is not immediately incremented
in the database so that several calls to the `Increment` operation will
not trigger a database update.

```Ada
 with AWA.Counters;
 ...
 AWA.Counters.Increment (Counter => Read_Counter.Counter, Key => Id);
```

A global counter is also incremented by using the `Increment` operation.

```Ada
 with AWA.Counters;
 ...
 AWA.Counters.Increment (Counter => Start_Counter.Counter);
```

## Ada Bean
The `Counter_Bean` allows to represent a counter associated with some database
entity and allows its control by the `<awa:counter>` HTML component.
To use it, an instance of the `Counter_Bean` should be defined in a another
Ada bean declaration and configured.  For example, it may be declared
as follows:

```Ada
type Wiki_View_Bean is new AWA.Wikis.Models.Wiki_View_Info
with record
  ...
  Counter : aliased Counter_Bean
     (Of_Type => ADO.Objects.KEY_INTEGER,
      Of_Class => AWA.Wikis.Models.WIKI_PAGE_TABLE);
end record;
```

The counter value is held by the `Value` member of `Counter_Bean` and
it should be initialized programatically when the Ada bean instance
is loaded (for example through a `load` action).
The `Counter_Bean` needs to know the database entity to which it
is associated and its `Object` member must be initialized.
This is necessary for the `<awa:counter>` HTML component to increment
the associated counter when the page is displayed.
Below is an extract of such initialization:

```Ada
procedure Load
  (Bean    : in out Wiki_View_Bean;
   Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
  ...
  Bean.Counter.Value := Bean.Get_Read_Count;
  ADO.Objects.Set_Value (Bean.Counter.Object, Bean.Get_Id);
end Load;

```

The `Stat_List_Bean` allows to retrieve the list of counters per day for
a given database entity.  It needs a special managed bean configuration
that describes the database entity type, the counter name and
SQL query name.

The example below from the [Wikis Module](AWA_Wikis.md) declares the bean
`wikiPageStats`.  The database entity is `awa_wiki_page` which is the
name of the database table that holds wiki page.  The SQL query
to retrieve the result is `page-access-stats`.

 <managed-bean>
```Ada
<description>The counter statistics for a wiki page</description>
<managed-bean-name>wikiPageStats</managed-bean-name>
<managed-bean-class>AWA.Counters.Beans.Stat_List_Bean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
  <property-name>entity_type</property-name>
  <property-class>String</property-class>
  <value>awa_wiki_page</value>
</managed-property>
<managed-property>
  <property-name>counter_name</property-name>
  <property-class>String</property-class>
  <value>read_count</value>
</managed-property>
<managed-property>
  <property-name>query_name</property-name>
  <property-class>String</property-class>
  <value>page-access-stats</value>
</managed-property>
 </managed-bean>
```

A typical XHTML view that wants to use such bean, should call the `load`
action at beginning to load the counter statistics by running the SQL
query.

```Ada
<f:view contentType="application/json; charset=UTF-8"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html">
  <f:metadata>
    <f:viewAction action='#{wikiPageStats.load}'/>
  </f:metadata>
{"data":[<h:list value="#{wikiPageStats.stats}"
  var="stat">["#{stat.date}", #{stat.count}],</h:list>[0,0]]}
</f:view>
```

## HTML components
The `<awa:counter>` component is an [Ada Server Faces](https://github.com/stcarrez/ada-asf) component that
allows to increment and display easily the counter.  The component
works by using the `Counter_Bean` Ada bean object which describes
the counter in terms of counter definition, the
associated database entity, and the current counter value.

```Ada
<awa:counter value="#{wikiPage.counter}"/>
```

When the component is included in a page the `Counter_Bean` instance
associated with the EL `value` attribute is used to increment the counter.
This is similar to calling the `AWA.Counters.Increment` operation
from the Ada code.

## Data model
The `counters` module has a simple database model which needs two tables.
The `Counter_Definition` table is used to keep track of the different
counters used by the application.  A row in that table is created for
each counter declared by instantiating the `Definition` package.
The `Counter` table holds the counters for each database entity
and for each day.  By looking at that table, it becomes possible
to look at the daily access or usage of the counter.

![](images/awa_counters_model.png)


text:
import json
import urllib
import urllib2
from flask import (
    Blueprint, render_template, request, flash,
    current_app, abort, redirect, url_for
)
from flask.ext.login import current_user, login_user, logout_user

from template_maker.users.models import User

blueprint = Blueprint(
    'users', __name__, url_prefix='/users',
    template_folder='../templates'
)

@blueprint.route("/login", methods=["GET"])
def login():
    user = current_user if not current_user.is_anonymous() else dict(email=None)
    return render_template("users/login.html", current_user=user)

@blueprint.route('/logout', methods=['GET', 'POST'])
def logout():
    logout_user()
    if request.args.get('persona', None):
        return 'OK'
    else:
        flash('Logged out successfully!', 'alert-success')
        return render_template('users/logout.html')

@blueprint.route('/auth', methods=['POST'])
def auth():
    data = urllib.urlencode({
        'assertion' : request.form.get('assertion'),
        'audience': current_app.config.get('BROWSERID_URL')
    })
    req = urllib2.Request('https://verifier.login.persona.org/verify', data)

    response = json.loads(urllib2.urlopen(req).read())

    if response.get('status') != 'okay':
        abort(403)

    next_url = request.args.get('next', None)

    email = response.get('email')
    user = User.query.filter(User.email==email).first()
    if user:
        login_user(user)
        flash('Logged in successfully!', 'alert-success')
        return next_url if next_url else '/build/'
    else:
        abort(403)


text:
def feed_catchup(pool, dbi = None):
  from lib import DB

  if dbi is None: _dbi = DB()
  else: _dbi = dbi

  if dbi is None: _dbi.disconnect()

def dispatch_catchup(self, payload):
  """處理 responses 中解析失敗的資料"""
  raise Exception('Not Implemented, yet')


text:
FROM ethereum/client-go

RUN apk add --update git bash nodejs nodejs-npm perl

RUN cd /root &&\
    git clone https://github.com/cubedro/eth-net-intelligence-api &&\
    cd eth-net-intelligence-api &&\
    npm install &&\
    npm install -g pm2

ADD start.sh /root/start.sh
ADD app.json /root/eth-net-intelligence-api/app.json
RUN chmod +x /root/start.sh

ENTRYPOINT /root/start.sh


text:
If you have a usage question pertaining to Mapbox Android Services, or any of our other products, contact us through [our support page](https://www.mapbox.com/contact/).

If you want to contribute code:

1. Please familiarize yourself with the [install process](INSTALL.md).

2. Ensure that existing [pull requests](https://github.com/mapbox/mapbox-java/pulls) and [issues](https://github.com/mapbox/mapbox-java/issues) don't already cover your contribution or question.

3. Pull requests are gladly accepted. If there are any changes that developers should be aware of, please update the [change log](CHANGELOG.md)

4. Mapbox uses checkstyle to enforce good Java code standards, Make sure to read the [wiki entry](https://github.com/mapbox/mapbox-java/wiki/Setting-up-Mapbox-checkstyle) and setup. CI will fail if your PR contains any mistakes.

# Code of conduct
Everyone is invited to participate in Mapbox's open source projects and public discussions: we want to create a welcoming and friendly environment. Harassment of participants or other unethical and unprofessional behavior will not be tolerated in our spaces. The [Contributor Covenant](http://contributor-covenant.org) applies to all projects under the Mapbox organization and we ask that you please read [the full text](http://contributor-covenant.org/version/1/2/0/).

You can learn more about our open source philosophy on [mapbox.com](https://www.mapbox.com/about/open/).


text:
<?php

namespace App\Http\Controllers\Home;

use App\Http\Controllers\MyController;
use App\Http\Logic\NodeLogic;
use App\Http\Logic\TopicLogic;
use App\Http\Logic\UserLogic;
use App\Models\User;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Input;

class TopicController extends MyController
{
    public function index() {

    }

    public function add() {
        // 获取已选择过的分类名称
        $nodeId = Input::get('node_id') ? Input::get('node_id') : 0;
        $data['cate'] = DB::table('nodes')->where('node_id', $nodeId)->first();
        $data['title'] = '发表话题';
        if(!UserLogic::isLogin()) {
            return redirect('user/login');
        }
        $uid = session('uid');
        $user = User::find($uid);
        // 权限判断
        if($nodeId) {
            if(!TopicLogic::isUserPermitted($uid, $nodeId)) {
                $this->showMessage('您无权在此节点发表话题!请重新选择节点');
            }
        }
        $data['category'] = NodeLogic::getAllCates();
        return view('home.topic_add', $data);
    }

    public function checkAddTopic() {

    }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<module>
	<name>blockcategories</name>
	<displayName><![CDATA[Bloco das categorias]]></displayName>
	<version><![CDATA[2.8.6]]></version>
	<description><![CDATA[Adiciona um bloco com categorias de produtos.]]></description>
	<author><![CDATA[PrestaShop]]></author>
	<tab><![CDATA[front_office_features]]></tab>
	<is_configurable>1</is_configurable>
	<need_instance>1</need_instance>
	<limited_countries></limited_countries>
</module>


text:
from django.conf.urls import patterns, include, url

from app.views import Home

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),

    # Pass all the un-caught urls to app.views.Home
    url(r'^', Home.as_view())
)


text:
/**
 * Where everything starts
 * - Register drag and drop.
 * - Clear out all gobal variables and reset them to blank.
 */
function loadGeneprintView(){
    geneprintView.clear_high_dimensional_input('divIndependentVariable');
    geneprintView.register_drag_drop();
}

function loadGeneprintOutput() {

    // Store the currently selected options as global variables;
    window.cancer_study_id_selected = 'coadread_tcga_pub';
    window.case_set_id_selected = 'coadread_tcga_pub_3way_complete';
    window.gene_set_id_selected = 'user-defined-list';
    window.tab_index = 'tab_visualize';
    window.zscore_threshold = '2.0';
    window.rppa_score_threshold = '2.0';

    //  Store the currently selected genomic profiles within an associative array
    window.genomic_profile_id_selected = new Array();
    window.genomic_profile_id_selected['coadread_tcga_pub_mutations']=1;
    window.genomic_profile_id_selected['coadread_tcga_pub_mrna_median_Zscores']=1;
    window.genomic_profile_id_selected['coadread_tcga_pub_gistic']=1;

    window.PortalGlobals = {
        getCases: function() { return ''; } // list of queried case ids
    };

    var oncoprint = OncoprintCore(OncoprintUtils, MemoSort);
    geneprintView.boilerplate = MainBoilerplate(oncoprint, OncoprintUtils);
}

// constructor
var GeneprintView = function () {
    RmodulesView.call(this);
}

// inherit RmodulesView
GeneprintView.prototype = new RmodulesView();

// correct the pointer
GeneprintView.prototype.constructor = GeneprintView;

// submit analysis job
GeneprintView.prototype.submit_job = function () {
    var job = this;

    var actualSubmit = function() {
        // At this point, we will have the node details loaded,
        // so we'll check for matching data types
        var validDataTypes = ['mrna', 'protein', 'acgh', 'vcf'];
        for (var key in highDimensionalData.data) {
            // yes, the keys are the data types
            if (validDataTypes.indexOf(key) == -1) {
                Ext.MessageBox.show({
                    title: "Validation Error",
                    msg: "One of the data types is " + key + ", but Geneprint only supports [" + validDataTypes.join(", ") + "]",
                    buttons: Ext.MessageBox.OK,
                    icon: Ext.MessageBox.ERROR
                });
                return;
            }
        }

        // Check if gene(s) have been selected; this is required for geneprint
        if (!GLOBAL.CurrentPathway) {
            Ext.MessageBox.show({
                title: "Validation Error",
                msg: "Please select genes for the high dimensional data",
                buttons: Ext.MessageBox.OK,
                icon: Ext.MessageBox.ERROR
            });
            return;
        }

        // get formParams
        var formParams = job.get_form_params();

        if (formParams) { // if formParams is not null
            //submitJob(formParams);

            // Set up progress dialog
            $j('.runAnalysisBtn')[0].disabled = true;
            job.showProgress($j('#dataAssociationBody'), true);

            window.formParams = formParams;

            // Immediately render the output; the oncoprint javascript
            // will make the calls to the backend directly.
            var url = pageInfo.basePath + "/geneprint/geneprintOut";
            //Set the results DIV to use the URL from the job.
            Ext.get('analysisOutput').load({url: url, callback: loadGeneprintOutput});
            //Set the flag that says we run an analysis so we can warn the user if they navigate away.
            GLOBAL.AnalysisRun = true;

        }
    }

    // Fetch the node details for the high dimensional data
    var divId = 'divIndependentVariable';
    runAllQueriesForSubsetId(function () {
        highDimensionalData.fetchNodeDetails(divId, function( result ) {
            highDimensionalData.data = JSON.parse(result.responseText);
            highDimensionalData.populate_data();
            actualSubmit();
        });
    }, divId);
}

// get form params
GeneprintView.prototype.get_form_params = function () {
    var formParameters = {}; // init

    //Use a common function to load the High Dimensional Data params.
    loadCommonHighDimFormObjects(formParameters, "divIndependentVariable");

    // instantiate input elements object with their corresponding validations
    var inputArray = this.get_inputs(formParameters);

    // define the validator for this form
    var formValidator = new FormValidator(inputArray);

    if (formValidator.validateInputForm()) { // if input files satisfy the validations

        // get values
        var inputConceptPathVar = readConceptVariables("divIndependentVariable");

        // assign values to form parameters
        formParameters['jobType'] = 'Geneprint';
        formParameters['independentVariable'] = inputConceptPathVar;
        formParameters['variablesConceptPaths'] = inputConceptPathVar;

        // get analysis constraints
        var constraints_json = this.get_analysis_constraints('Geneprint');
        constraints_json['projections'] = ["all_data"];
        constraints_json['mrnaThreshold'] = inputArray[1].el.value;
        constraints_json['proteinThreshold'] = inputArray[2].el.value;

        formParameters['analysisConstraints'] = JSON.stringify(constraints_json);

    } else { // something is not correct in the validation
        // empty form parameters
        formParameters = null;
        // display the error message
        formValidator.display_errors();
    }

    return formParameters;
}

GeneprintView.prototype.get_inputs = function (form_params) {
    return  [
        {
            "label" : "High Dimensional Data",
            "el" : Ext.get("divIndependentVariable"),
            "validations" : [
                {type:"REQUIRED"},
                {
                    type:"HIGH_DIMENSIONAL",
                    high_dimensional_type:form_params["divIndependentVariableType"],
                    high_dimensional_pathway:form_params["divIndependentVariablePathway"]
                }
            ]
        },
        {
            "label" : "mRNA expression z-score threshold",
            "el" : document.getElementById("txtMrnaThreshold"),
            "validations" : [{type:"DECIMAL", min:0.0}]
        },
        {
            "label" : "Protein expression z-score threshold",
            "el" : document.getElementById("txtProteinThreshold"),
            "validations" : [{type:"DECIMAL", min:0.0}]
        }
    ];
}

GeneprintView.prototype.showProgress = function(parentElem, noTitleBar) {
    destroyWorkflowStatus();

    var maskDiv = $j(document.createElement('div')).attr({id: 'mask'});
    maskDiv.css('z-index', 1);
    $j('#dataAssociationBody').append(maskDiv);

    //Add new modal-dialog
    var progressBarDiv = $j(document.createElement('div')).attr({id: 'progress-bar'});
    var progressStatusSpan = $j(document.createElement('span')).attr({id: 'progress-status'});
    progressStatusSpan.html('Running analysis');
    var progressStatusImg = $j(document.createElement('div')).attr({id: 'progress-img'});
    var progressTextDiv = $j(document.createElement('div')).attr({id: 'progress-text'});
    progressTextDiv.append(progressStatusImg);
    progressTextDiv.append(progressStatusSpan);

    var modalDialogDiv = $j(document.createElement('div')).attr({id: 'dialog-modal'});
    modalDialogDiv.append(progressBarDiv);
    modalDialogDiv.append(progressTextDiv);

    parentElem.append(modalDialogDiv);
    $j("#progress-img").attr('class', 'progress-spinner');

    $j("#mask").fadeTo(500, 0.25);

    var d = $j("#dialog-modal").dialog({
        height: 130,
        minHeight: 130,
        maxHeight: 130,
        width: 300,
        minWidth: 250,
        maxWidth: 350,
        closeOnEscape: false,
        show: { effect: 'drop', direction: "up" },
        hide: { effect: 'fade', duration: 200 },
        dialogClass: 'dialog-modal',
        title: 'Workflow Status',
        position: {
            my: 'left top',
            at: 'center',
            of: parentElem
        },
        buttons: {
            "Stop Analysis": this.cancelJob
        },
        //To hide the header of the dialog
        create: function (event, ui) {
            if (noTitleBar) $j(".ui-widget-header", $(ui)).hide();
        },
        close: function (event, ui) {
            $j("#mask").hide();
            $j("#mask").remove();
            $j("#dialog-modal").dialog('destroy');
            //$j('#mask').remove();
        },
        zIndex: 10001,
        //modal: true,
        autoOpen: false
    });
    d.parent('.ui-dialog').appendTo($j('#dataAssociationBody'));
    $j("#dialog-modal").dialog('open');

    $j("#progress-bar").progressbar({
        value: 5
    });
}

GeneprintView.prototype.cancelJob = function() {
    geneprintView.boilerplate.xhr.abort();
}

// init geneprint view instance
var geneprintView = new GeneprintView();


text:
'use strict';

require('chai').should();
require('chai').config.includeStack = true;
var expect = require('chai').expect;

var async = require('..');

describe('raptor-async series' , function() {

    it('should handle empty work', function(done) {

        var work = [];

        async.series(work, function(err, results) {
            expect(results).to.deep.equal([]);
            done();
        });

    });

    it('should return array results in correct order', function(done) {

        this.timeout(2000);

        var work = [];

        work[0] = function(callback) {
            setTimeout(function() {
                callback(null, 0);
            }, 1000);
        };

        work[1] = function(callback) {
            setTimeout(function() {
                callback(null, 1);
            }, 500);
        };

        work[2] = function(callback) {
            setTimeout(function() {
                callback(null, 2);
            }, 0);
        };

        async.series(work, function(err, results) {
            expect(results).to.deep.equal([0, 1, 2]);
            done();
        });

    });

    it('should throw error if callback for job is invoked more than once', function(done) {

        var uncaughtException;

        var mochaExceptionHandler = process.listeners('uncaughtException').pop();
        process.removeListener('uncaughtException', mochaExceptionHandler);

        process.once('uncaughtException', function(err) {
            // errors for invoking callback more than once will be thrown as errors
            // since they fall into the unexpected exception category
            uncaughtException = err;
            process.on('uncaughtException', mochaExceptionHandler);
        });

        this.timeout(2000);

        var work = [];

        work[0] = function(callback) {
            setTimeout(function() {
                callback(null, 0);
            }, 500);
        };

        work[1] = function(callback) {
            setTimeout(function() {
                callback(null, 1);
                callback(null, 'oops!');
            }, 250);
        };

        work[2] = function(callback) {
            setTimeout(function() {
                callback(null, 2);
            }, 0);
        };

        async.series(work, function(err, results) {
            expect(results).to.deep.equal([0, 1, 2]);
            expect(uncaughtException.toString()).to.equal('Error: callback for async operation at index \"1\" invoked after completion. (no error)');
            done();
        });

    });

    it('should include original error if callback is invoked after completion', function(done) {

        var uncaughtException;

        var mochaExceptionHandler = process.listeners('uncaughtException').pop();
        process.removeListener('uncaughtException', mochaExceptionHandler);

        process.once('uncaughtException', function(err) {
            // errors for invoking callback more than once will be thrown as errors
            // since they fall into the unexpected exception category
            uncaughtException = err;
            process.on('uncaughtException', mochaExceptionHandler);
        });

        this.timeout(2000);

        var work = [];

        work[0] = function(callback) {
            setTimeout(function() {
                callback(null, 0);
            }, 500);
        };

        work[1] = function(callback) {
            setTimeout(function() {
                callback(null, 1);
                callback(new Error('Something bad happened'));
            }, 250);
        };

        work[2] = function(callback) {
            setTimeout(function() {
                callback(null, 2);
            }, 0);
        };

        async.series(work, function(err, results) {
            expect(results).to.deep.equal([0, 1, 2]);
            expect(uncaughtException.toString().indexOf('Something bad happened')).to.not.equal(-1);
            done();
        });

    });

    it('should handle errors for arrays as input', function(done) {

        this.timeout(2000);

        var work = [];

        work[0] = function(callback) {
            setTimeout(function() {
                callback(null, 0);
            }, 400);
        };

        work[1] = function(callback) {
            setTimeout(function() {
                callback(null, 1);
            }, 200);
        };

        work[2] = function(callback) {
            setTimeout(function() {
                callback('This throws an error');
            }, 0);
        };

        async.series(work, function(err, results) {
            expect(results == null).to.equal(true);
            expect(err != null).to.equal(true);
            done();
        });

    });

});


text:
package org.springframework.r2dbc.core;

import io.r2dbc.h2.H2ConnectionFactory;
import io.r2dbc.spi.ConnectionFactory;

/**
 * Integration tests for {@link DatabaseClient} against H2.
 *
 * @author Mark Paluch
 */
public class H2TransactionalDatabaseClientIntegrationTests
		extends AbstractTransactionalDatabaseClientIntegrationTests {

	public static String CREATE_TABLE_LEGOSET = "CREATE TABLE legoset (\n" //
			+ "    id          integer CONSTRAINT id PRIMARY KEY,\n" //
			+ "    version     integer NULL,\n" //
			+ "    name        varchar(255) NOT NULL,\n" //
			+ "    manual      integer NULL\n" //
			+ ");";

	@Override
	protected ConnectionFactory createConnectionFactory() {
		return H2ConnectionFactory.inMemory("r2dbc-transactional");
	}

	@Override
	protected String getCreateTableStatement() {
		return CREATE_TABLE_LEGOSET;
	}
}


text:
require 'spec_helper'
module Exlibris
  module Aleph
    module Table
      module Reader
        module Matcher
          describe ItemDisplayMasks do
            let(:string) { 'ITEM-STATUS     Lost/Claimed                                                                     Request ILL' }
            subject(:item_display_masks) { ItemDisplayMasks.new(string) }
            it { should be_a ItemDisplayMasks }
            describe ItemDisplayMasks::REGEXP do
              subject { ItemDisplayMasks::REGEXP }
              it { should eq /^ITEM-STATUS    \s(.{80})\s(.*)$/ }
            end
            describe '#regexp' do
              subject { item_display_masks.regexp }
              it { should be_a Regexp }
              it { should eq /^ITEM-STATUS    \s(.{80})\s(.*)$/ }
            end
            describe '#match_data' do
              subject { item_display_masks.match_data }
              it { should be_a MatchData }
            end
            describe '#matches?' do
              subject { item_display_masks.matches? }
              it { should be_true }
            end
            describe '#matched_data' do
              subject { item_display_masks.matched_data }
              it { should be_an Array }
              it 'should have 2 matches' do
                expect(subject.size).to eq 2
              end
            end
          end
        end
      end
    end
  end
end


text:
using ServiceStack.ServiceInterface.ServiceModel;

#endregion

namespace GridSharedLibs.ServiceModel.Operations
{
    public class JoinTaskResponse : IHasResponseStatus
    {
        public int Res { get; set; }
        public ResponseStatus ResponseStatus { get; set; }
    }
}


text:
package com.chromium.fontinstaller.core;

import android.app.Activity;
import android.content.Context;

import com.chromium.fontinstaller.models.Font;
import com.chromium.fontinstaller.models.FontPackage;
import com.chromium.fontinstaller.util.FileUtils;
import com.nispok.snackbar.Snackbar;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import eu.chainfire.libsuperuser.Shell;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class FontInstaller {
    private static final String MOUNT_SYSTEM = "mount -o rw,remount /system";
    private static final String FONT_INSTALL_DIR = "/system/fonts";

    public static class InstallException extends Exception {
        public InstallException(Exception root) { super(root); }
    }

    public static Observable<Void> install(final FontPackage fontPackage, final Activity context) {
        String cacheDir = context.getExternalCacheDir() + File.separator;
        List<String> copyCommands = new ArrayList<>();
        return Observable.create(subscriber -> {
            for (Font font : fontPackage.getFontList()) {
                String fileName = cacheDir + fontPackage.getNameFormatted() + File.separator + font.getName();
                if (!new File(fileName).exists()) {
                    subscriber.onError(new InstallException(new IOException("File not found!")));
                    return;
                }
                copyCommands.add("cp " + fileName + " " + FONT_INSTALL_DIR);
            }
            copyCommands.add("cp " + FileUtils.getAssetsFile("DroidSansFallback.ttf", context)
                    .getAbsolutePath() + " " + FONT_INSTALL_DIR);
            if (Shell.SU.available()) {
                Shell.SU.run(MOUNT_SYSTEM);
                Shell.SU.run(copyCommands);
                subscriber.onNext(null);
                subscriber.onCompleted();
            }
        });
    }
}


text:
package com.fanlehai.java.compile;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;

class GrandFather {
	void thinking() {
		System.out.println("i am grandfather");
	}
}

class Father extends GrandFather {
//	void thinking() {
//		System.out.println("i am father");
//	}
}

class Son extends Father {

}

 public class InvokeGrandpa extends Father {

	 void thinking() {
			try {
				MethodType mt = MethodType.methodType(void.class);
				MethodHandle mh = MethodHandles.lookup().findSpecial(GrandFather.class, "thinking", mt, getClass());
				mh.invoke(this);
			} catch (Throwable e) {

				System.err.println(e);
			}
		}

	public static void main(String[] args) {
		//((new InvokeGrandpa()).new Son()).thinking();
		new InvokeGrandpa().thinking();
	}

}


text:
<?php

require_once "config.php";

header("Location: ".$CFG->wwwroot."/store");


text:
- [ ] SyncSubscriber and Next for EncodedConn
- [ ] Fast Publisher?
- [ ] pooling for structs used? leaky bucket?
- [ ] Timeout 0 should work as no timeout
- [x] Ping timer
- [x] Name in Connect for gnatsd
- [x] Asynchronous error handling
- [x] Parser rewrite
- [x] Reconnect
- [x] Hide Lock
- [x] Easier encoder interface
- [x] QueueSubscribeSync
- [x] Make nats specific errors prefixed with 'nats:'
- [x] API test for closed connection
- [x] TLS/SSL
- [x] Stats collection
- [x] Disconnect detection
- [x] Optimized Publish (coalescing)
- [x] Do Examples via Go style
- [x] Standardized Errors


text:
/*
 * Device.cpp
 *
 *  Created on: 2016年5月30日
 *      Author: lijing
 */

#include "pola/Device.h"
#ifdef POLA_LINUX_X11
#include "pola/LinuxDevice.h"
#endif

namespace pola {

Device::Device(const DeviceParam& param) : mDeviceParam(param) {
}

Device::~Device() {
}

Device* createDevice(const DeviceParam& param) {
#ifdef POLA_LINUX_X11
	static LinuxDevice* device = new LinuxDevice(param);
	return device;
#else
	return nullptr;
#endif
}

}


text:
"""Creates a complete CMX (v1) component manifest, from a program name and
   manifest fragment file."""

import argparse
import json
import sys

def BuildCmxFromFragment(output_file, fragment_file, program_binary):
  """Reads a CMX fragment specifying e.g. features & sandbox, and a program
     binary's filename, and writes out the full CMX.

     output_file: Build-relative filename at which to write the full CMX.
     fragment_file: Build-relative filename of the CMX fragment to read from.
     program_binary: Package-relative filename of the program binary.
  """

  with open(output_file, 'w') as component_manifest_file:
    component_manifest = json.load(open(fragment_file, 'r'))
    component_manifest.update({
        'program': {
            'binary': program_binary
        },
    })
    json.dump(component_manifest, component_manifest_file)

def main():
  parser = argparse.ArgumentParser()
  parser.add_argument(
      '--cmx-fragment',
      required=True,
      help='Path to the CMX fragment to read from')
  parser.add_argument(
      '--cmx', required=True, help='Path to write the complete CMX file to')
  parser.add_argument(
      '--program',
      required=True,
      help='Package-relative path to the program binary')
  args = parser.parse_args()

  return BuildCmxFromFragment(args.cmx, args.cmx_fragment, args.program)

if __name__ == '__main__':
  sys.exit(main())


text:
package org.pac4j.oauth.credentials.extractor;

import com.github.scribejava.core.model.OAuth1RequestToken;
import com.github.scribejava.core.utils.OAuthEncoder;
import org.pac4j.core.client.IndirectClient;
import org.pac4j.core.context.WebContext;
import org.pac4j.oauth.config.OAuth10Configuration;
import org.pac4j.oauth.credentials.OAuth10Credentials;
import org.pac4j.oauth.exception.OAuthCredentialsException;

/**
 * OAuth 1.0 credentials extractor.
 *
 * @author Jerome Leleu
 * @since 2.0.0
 */
public class OAuth10CredentialsExtractor extends OAuthCredentialsExtractor<OAuth10Credentials, OAuth10Configuration> {

    public OAuth10CredentialsExtractor(final OAuth10Configuration configuration, final IndirectClient client) {
        super(configuration, client);
    }

    @Override
    protected OAuth10Credentials getOAuthCredentials(final WebContext context) {
        final String tokenParameter = context.getRequestParameter(OAuth10Configuration.OAUTH_TOKEN);
        final String verifierParameter = context.getRequestParameter(OAuth10Configuration.OAUTH_VERIFIER);
        if (tokenParameter != null && verifierParameter != null) {
            // get request token from session
            final OAuth1RequestToken tokenSession = (OAuth1RequestToken) context
                .getSessionStore().get(context, configuration.getRequestTokenSessionAttributeName(client.getName()));
            logger.debug("tokenRequest: {}", tokenSession);
            final String token = OAuthEncoder.decode(tokenParameter);
            final String verifier = OAuthEncoder.decode(verifierParameter);
            logger.debug("token: {} / verifier: {}", token, verifier);
            return new OAuth10Credentials(tokenSession, token, verifier);
        } else {
            final String message = "No credential found";
            throw new OAuthCredentialsException(message);
        }
    }
}


text:
//
// NSObject+CrystDB.h
// Copyright (c) 2017年 Chasel. All rights reserved.
// https://github.com/Chasel-Shao/CrystDB.git
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//

#import <Foundation/Foundation.h>
#import "CrystManager.h"

@class CrystManager;
@interface NSObject (CrystDB) <CrystDB>

///----------------------------------
/// @name Insert and Update Operation
///----------------------------------

/**
 Add the current object to database. if the object has been alreadly in
 the database, then update the former one.

 @return Whether operate success
 */
- (BOOL)cs_addOrUpdateToDB;

/**
 Add the current object to database. if the object has been alreadly in
 the database, then ignore this operation, and return `YES`.

 @return Whether adoperated success
 */
- (BOOL)cs_addOrIgnoreToDB;

/**
 Uses an dictioanry to add an object to the  database, the dictioanry must
 contain the primary key, otherwise it will fail. if the object has been in
 the database, then update the former one.

 @param dictioanry The dictioanry to be add or update
 @return Whether operate success
 */
+ (BOOL)cs_addOrUpdateToDBWithDict:(NSDictionary *)dictioanry;

///----------------------
/// @name query Operation
///----------------------

/**
 Querys the object associated with the primary value.

 @param primaryValue The value of the primary key
 @return An object
 */
+ (id)cs_queryObjectOnPrimary:(id)primaryValue;

/**
 Querys all the objects with the conditions.

 @param condition The restricted condition
 @return An array of this kind of object
 */
+ (NSArray*)cs_queryObjectsWithCondition:(NSString *)condition;

/**
 Querys all the objects with the format conditions, this method is
 not supported in Swift.

 @param conditionFromat The restricted condition
 @return An array of this kind of object
 */
+ (NSArray*)cs_queryObjectsWithConditions:(NSString *)conditionFromat,...;

/**
 Querys the number of objects of this kind of object.

 @return An integer
 */
+ (NSInteger)cs_queryObjectCount;

/**
 Querys the update time of this object.

 @return An integer timestamp
 */
- (NSInteger)cs_queryObjectUpdateTime;

/**
  Querys the create time of this object.

 @return An integer timestamp
 */
- (NSInteger)cs_queryObjectCreateTime;

///-----------------------
/// @name delete Operation
///-----------------------

/**
 Deletes the object from database according to the primary key.

 @return Whether delete success
 */
- (BOOL)cs_deleteFromDB;

/**
 Deletes all objects of this kind object with a given condition.

 @param condition restricted condition
 @return Whether delete success
 */
+ (BOOL)cs_deleteFromDBWithCondition:(NSString *)condition;

///----------------------------
/// @name transaction Operation
///----------------------------

/**
 Operates the transaction in a block, and commit after the block is finished.
 If the value of `rollback` is set to `YES`, then rollback the transaction.

 @param block The operations are operated in the block
 */
+ (void)cs_inTransaction:(void (^)(CrystManager *db, BOOL *rollback))block;

@end


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = {
  'border-radius': 'borderRadius',
  'border-image': ['borderImage', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
  flexbox: ['flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexFlow', 'flexShrink', 'flexWrap', 'alignContent', 'alignItems', 'alignSelf', 'justifyContent', 'order'],
  'css-transitions': ['transition', 'transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
  transforms2d: ['transform', 'transformOrigin', 'transformOriginX', 'transformOriginY'],
  transforms3d: ['backfaceVisibility', 'perspective', 'perspectiveOrigin', 'transform', 'transformOrigin', 'transformStyle', 'transformOriginX', 'transformOriginY', 'transformOriginZ'],
  'css-animation': ['animation', 'animationDelay', 'animationDirection', 'animationFillMode', 'animationDuration', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
  'css-appearance': 'appearance',
  'user-select-none': 'userSelect',
  'css-backdrop-filter': 'backdropFilter',
  'css3-boxsizing': 'boxSizing',
  'font-kerning': 'fontKerning',
  'css-exclusions': ['wrapFlow', 'wrapThrough', 'wrapMargin'],
  'css-snappoints': ['scrollSnapType', 'scrollSnapPointsX', 'scrollSnapPointsY', 'scrollSnapDestination', 'scrollSnapCoordinate'],
  'text-emphasis': ['textEmphasisPosition', 'textEmphasis', 'textEmphasisStyle', 'textEmphasisColor'],
  'css-text-align-last': 'textAlignLast',
  'css-boxdecorationbreak': 'boxDecorationBreak',
  'css-clip-path': 'clipPath',
  'css-masks': ['maskImage', 'maskMode', 'maskRepeat', 'maskPosition', 'maskClip', 'maskOrigin', 'maskSize', 'maskComposite', 'mask', 'maskBorderSource', 'maskBorderMode', 'maskBorderSlice', 'maskBorderWidth', 'maskBorderOutset', 'maskBorderRepeat', 'maskBorder', 'maskType'],
  'css-touch-action': 'touchAction',
  'text-size-adjust': 'textSizeAdjust',
  'text-decoration': ['textDecorationStyle', 'textDecorationSkip', 'textDecorationLine', 'textDecorationColor'],
  'css-shapes': ['shapeImageThreshold', 'shapeImageMargin', 'shapeImageOutside'],
  'css3-tabsize': 'tabSize',
  'css-filters': 'filter',
  'css-resize': 'resize',
  'css-hyphens': 'hyphens',
  'css-regions': ['flowInto', 'flowFrom', 'breakBefore', 'breakAfter', 'breakInside', 'regionFragment'],
  'css-grid': ['gridTemplateColumns', 'gridTemplateRows', 'gridTemplateAreas', 'gridTemplate', 'gridAutoColumns', 'gridAutoRows', 'gridAutoFlow', 'grid', 'gridRowStart', 'gridColumnStart', 'gridRowEnd', 'gridRow', 'gridColumn', 'gridColumnEnd', 'gridColumnGap', 'gridRowGap', 'gridArea', 'gridGap'],
  'object-fit': ['objectFit', 'objectPosition'],
  'text-overflow': 'textOverflow',
  'background-img-opts': ['backgroundClip', 'backgroundOrigin', 'backgroundSize'],
  'font-feature': 'fontFeatureSettings',
  'css-boxshadow': 'boxShadow',
  multicolumn: ['breakAfter', 'breakBefore', 'breakInside', 'columnCount', 'columnFill', 'columnGap', 'columnRule', 'columnRuleColor', 'columnRuleStyle', 'columnRuleWidth', 'columns', 'columnSpan', 'columnWidth', 'columnGap'],
  'css-writing-mode': ['writingMode']
};
module.exports = exports['default'];


text:
#region License

#endregion

#region Imports

using System;
using System.Collections;
using System.Reflection;
using System.Reflection.Emit;

using Spring.Util;

#endregion

namespace Spring.Aop.Framework.DynamicProxy
{
    /// <summary>
    /// <see cref="Spring.Proxy.IProxyMethodBuilder"/> implementation
    /// that delegates method calls to the base method.
    /// </summary>
    /// <author>Bruno Baia</author>
    public class BaseAopProxyMethodBuilder : AbstractAopProxyMethodBuilder
    {
        #region Constructor(s) / Destructor

        /// <summary>
        /// Creates a new instance of the method builder.
        /// </summary>
        /// <param name="typeBuilder">The type builder to use.</param>
        /// <param name="aopProxyGenerator">
        /// The <see cref="IAopProxyTypeGenerator"/> implementation to use.
        /// </param>
        /// <param name="targetMethods">
        /// The dictionary to cache the list of target
        /// <see cref="System.Reflection.MethodInfo"/>s.
        /// </param>
        /// <param name="onProxyTargetMethods">
        /// The dictionary to cache the list of target
        /// <see cref="System.Reflection.MethodInfo"/>s defined on the proxy.
        /// </param>
        public BaseAopProxyMethodBuilder(
            TypeBuilder typeBuilder, IAopProxyTypeGenerator aopProxyGenerator,
            IDictionary targetMethods, IDictionary onProxyTargetMethods)
            : base(typeBuilder, aopProxyGenerator, false, targetMethods, onProxyTargetMethods)
        {
        }

        #endregion

        #region Protected Methods

        /// <summary>
        /// Create static field that will cache target method when defined on the proxy.
        /// </summary>
        /// <param name="il">The IL generator to use.</param>
        /// <param name="method">The target method.</param>
        protected override void GenerateOnProxyTargetMethodCacheField(
            ILGenerator il, MethodInfo method)
        {
            if (method.IsVirtual && !method.IsFinal)
            {
                // generate proxy method
                MethodBuilder baseMethod = typeBuilder.DefineMethod("proxy_" + method.Name,
                    MethodAttributes.Public | MethodAttributes.HideBySig,
                    CallingConventions.Standard,
                    method.ReturnType, ReflectionUtils.GetParameterTypes(method));

#if NET_2_0
                DefineGenericParameters(baseMethod, method);
#endif
                //DefineParameters(baseMethod, method);

                ILGenerator localIL = baseMethod.GetILGenerator();

                localIL.Emit(OpCodes.Ldarg_0);
                // setup parameters for call
                for (int i = 0; i < method.GetParameters().Length; i++)
                {
                    localIL.Emit(OpCodes.Ldarg_S, i + 1);
                }
                localIL.EmitCall(OpCodes.Call, method, null);
                localIL.Emit(OpCodes.Ret);

                // create static field that will cache proxy method
                string methodId = GenerateMethodCacheFieldId(method);
                onProxyTargetMethods.Add(methodId, method);

                onProxyTargetMethodCacheField = typeBuilder.DefineField(
                    methodId, typeof(MethodInfo), FieldAttributes.Private | FieldAttributes.Static | FieldAttributes.InitOnly);

#if NET_2_0
                MakeGenericMethod(il, method, onProxyTargetMethodCacheField, genericOnProxyTargetMethod);
#endif
            }
        }

        /// <summary>
        /// Calls target method directly.
        /// </summary>
        /// <param name="il">The IL generator to use.</param>
        /// <param name="method">The method to proxy.</param>
        /// <param name="interfaceMethod">
        /// The interface definition of the method, if applicable.
        /// </param>
        protected override void CallDirectProxiedMethod(
            ILGenerator il, MethodInfo method, MethodInfo interfaceMethod)
        {
            CallDirectBaseMethod(il, method);
        }

        #endregion
    }
}


text:
#ifndef QUICKSTEP_QUERY_OPTIMIZER_RULES_PUSH_DOWN_SEMI_ANTI_JOIN_HPP_
#define QUICKSTEP_QUERY_OPTIMIZER_RULES_PUSH_DOWN_SEMI_ANTI_JOIN_HPP_

#include <string>

#include "query_optimizer/logical/HashJoin.hpp"
#include "query_optimizer/logical/Logical.hpp"
#include "query_optimizer/rules/TopDownRule.hpp"
#include "utility/Macros.hpp"

namespace quickstep {
namespace optimizer {

class PushDownSemiAntiJoin : public TopDownRule<logical::Logical> {
 public:
  PushDownSemiAntiJoin() {}

  std::string getName() const override { return "PushDownSemiAntiJoin"; }

 protected:
  logical::LogicalPtr applyToNode(const logical::LogicalPtr &input) override;

 private:
  logical::LogicalPtr pushDownSemiAntiJoin(const logical::HashJoinPtr &input);

  DISALLOW_COPY_AND_ASSIGN(PushDownSemiAntiJoin);
};

}  // namespace optimizer
}  // namespace quickstep

#endif /* QUICKSTEP_QUERY_OPTIMIZER_RULES_PUSH_DOWN_SEMI_ANTI_JOIN_HPP_ */


text:
using Moq;
using NUnit.Framework;
using SFA.DAS.CommitmentsV2.Data;
using SFA.DAS.CommitmentsV2.Domain.Entities;
using SFA.DAS.CommitmentsV2.Models;
using SFA.DAS.CommitmentsV2.Services;
using SFA.DAS.CommitmentsV2.Types;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace SFA.DAS.CommitmentsV2.UnitTests.Services
{
    [Parallelizable(ParallelScope.None)]
    [TestFixture]
    public class UlnUtilisationServiceTests
    {
        private UlnUtilisationServiceFixture _fixture;

        [SetUp]
        public void SetUp()
        {
            _fixture = new UlnUtilisationServiceFixture();
        }

        [Test]
        public async Task WhenCalculatingOverlapEndDate_AndApprenticeshipCompletedBeforeEndDate_ThenCompletionDateUsed()
        {
            var expectedUln = _fixture.CompletedApprenticeshipBeforeEndDate.Uln;
            var expectedEndDate = _fixture.CompletedApprenticeshipBeforeEndDate.CompletionDate.Value;

            _fixture
                .WithApprenticeshipsInDb();

            var result = await _fixture.Act(expectedUln);

            _fixture.Assert_CorrectEndDateWasUsed(result, expectedUln, expectedEndDate);
        }

        [Test]
        public async Task WhenCalculatingOverlapEndDate_AndApprenticeshipCompletedAfterEndDate_ThenEndDateIsUsed()
        {
            var expectedUln = _fixture.CompletedApprenticeshipAfterEndDate.Uln;
            var expectedEndDate = _fixture.CompletedApprenticeshipAfterEndDate.EndDate.Value;

            _fixture
                .WithApprenticeshipsInDb();

            var result = await _fixture.Act(expectedUln);

            _fixture.Assert_CorrectEndDateWasUsed(result, expectedUln, expectedEndDate);
        }

        [Test]
        public async Task WhenCalculatingOverlapEndDate_AndApprenticeshipWithdrawn_ThenStopDateUsed()
        {
            var expectedUln = _fixture.WithdrawnApprenticeship.Uln;
            var expectedEndDate = _fixture.WithdrawnApprenticeship.StopDate.Value;

            _fixture
                .WithApprenticeshipsInDb();

            var result = await _fixture.Act(expectedUln);

            _fixture.Assert_CorrectEndDateWasUsed(result, expectedUln, expectedEndDate);
        }

        [Test]
        public async Task WhenCalculatingEndDate_AndApprenticeshipLive_ThenEndDateIsUsed()
        {
            var expectedUln = _fixture.LiveApprenticeship.Uln;
            var expectedEndDate = _fixture.LiveApprenticeship.EndDate.Value;

            _fixture
                .WithApprenticeshipsInDb();

            var result = await _fixture.Act(expectedUln);

            _fixture.Assert_CorrectEndDateWasUsed(result, expectedUln, expectedEndDate);
        }

        [Test]
        public async Task WhenGettingApprenticeship_ForOverlap_DraftApprenticeship_With_TransferSender_Are_Included()
        {
            var expectedUln = _fixture.DraftApprenticeshipWithTransferSender.Uln;
            var expectedEndDate = _fixture.DraftApprenticeshipWithTransferSender.EndDate.Value;

            _fixture
                .WithApprenticeshipsInDb();

            var result = await _fixture.Act(expectedUln);

            _fixture.Assert_CorrectEndDateWasUsed(result, expectedUln, expectedEndDate);
        }

        [Test]
        public async Task WhenCalculatingEndDate_AndApprenticeshipStoppedBeforeCompletedAndEndDate_ThenStoppedDateUsed()
        {
            var expectedUln = _fixture.StoppedCompletedApprenticeship.Uln;
            var expectedEndDate = _fixture.StoppedCompletedApprenticeship.StopDate.Value;

            _fixture
                .WithApprenticeshipsInDb();

            var result = await _fixture.Act(expectedUln);

            _fixture.Assert_CorrectEndDateWasUsed(result, expectedUln, expectedEndDate);
        }
    }

    public class UlnUtilisationServiceFixture
    {
        public Apprenticeship CompletedApprenticeshipBeforeEndDate { get; }
        public Apprenticeship CompletedApprenticeshipAfterEndDate { get; }
        public Apprenticeship WithdrawnApprenticeship { get; }
        public Apprenticeship LiveApprenticeship { get; }
        public DraftApprenticeship DraftApprenticeshipWithTransferSender { get; }
        public Apprenticeship StoppedCompletedApprenticeship { get; }

        private readonly ProviderCommitmentsDbContext _dbContext;
        private readonly Mock<IDbContextFactory> _iDbContextFactoryMock;
        private readonly UlnUtilisationService _sut;

        public UlnUtilisationServiceFixture()
        {
            CompletedApprenticeshipBeforeEndDate = new Apprenticeship
            {
                Id = 100,
                Uln = Guid.NewGuid().ToString(),
                PaymentStatus = PaymentStatus.Completed,
                CompletionDate = DateTime.UtcNow.AddMonths(-1),
                StartDate = DateTime.UtcNow.AddYears(-1),
                EndDate = DateTime.UtcNow
            };

            CompletedApprenticeshipAfterEndDate = new Apprenticeship
            {
                Id = 200,
                Uln = Guid.NewGuid().ToString(),
                PaymentStatus = PaymentStatus.Completed,
                CompletionDate = DateTime.UtcNow.AddMonths(1),
                StartDate = DateTime.UtcNow.AddYears(-1),
                EndDate = DateTime.UtcNow
            };

            WithdrawnApprenticeship = new Apprenticeship
            {
                Id = 300,
                Uln = Guid.NewGuid().ToString(),
                PaymentStatus = PaymentStatus.Withdrawn,
                StopDate = DateTime.UtcNow.AddMonths(-1),
                StartDate = DateTime.UtcNow.AddYears(-1),
                EndDate = DateTime.UtcNow
            };

            LiveApprenticeship = new Apprenticeship
            {
                Id = 400,
                Uln = Guid.NewGuid().ToString(),
                PaymentStatus = PaymentStatus.Active,
                StartDate = DateTime.UtcNow.AddYears(-1),
                EndDate = DateTime.UtcNow
            };

            DraftApprenticeshipWithTransferSender = new DraftApprenticeship
            {
                Id = 500,
                Uln = Guid.NewGuid().ToString(),
                PaymentStatus = 0,
                StartDate = DateTime.UtcNow.AddYears(-1),
                Cohort = new Cohort {TransferSenderId = 1, WithParty = Party.TransferSender  },
                EndDate = DateTime.UtcNow
            };

            StoppedCompletedApprenticeship = new Apprenticeship
            {
                Id = 600,
                Uln = Guid.NewGuid().ToString(),
                PaymentStatus = PaymentStatus.Completed,
                StartDate = DateTime.UtcNow.AddYears(-1),
                Cohort = new Cohort { TransferSenderId = 1, WithParty = Party.TransferSender },
                CompletionDate = DateTime.UtcNow.AddMonths(-1),
                EndDate = DateTime.UtcNow,
                StopDate = DateTime.UtcNow.AddMonths(-2)
            };

            _dbContext = TestHelper.GetInMemoryDatabase();

            _iDbContextFactoryMock = new Mock<IDbContextFactory>();
            _iDbContextFactoryMock
                .Setup(x => x.CreateDbContext())
                .Returns(_dbContext);

            _sut = new UlnUtilisationService(_iDbContextFactoryMock.Object);
        }

        public Task<UlnUtilisation[]> Act(string uln) => _sut.GetUlnUtilisations(uln, default(CancellationToken));

        public UlnUtilisationServiceFixture WithApprenticeshipsInDb()
        {
            _dbContext.Apprenticeships.Add(CompletedApprenticeshipBeforeEndDate);
            _dbContext.Apprenticeships.Add(CompletedApprenticeshipAfterEndDate);
            _dbContext.Apprenticeships.Add(WithdrawnApprenticeship);
            _dbContext.Apprenticeships.Add(LiveApprenticeship);
            _dbContext.DraftApprenticeships.Add(DraftApprenticeshipWithTransferSender);
            _dbContext.Apprenticeships.Add(StoppedCompletedApprenticeship);
            _dbContext.SaveChanges();
            return this;
        }

        public void Assert_CorrectEndDateWasUsed(UlnUtilisation[] result, string expectedUln, DateTime expectedEndDate)
        {
            Assert.AreEqual(1, result.Length);
            Assert.AreEqual(expectedUln,result.First().Uln);
            Assert.AreEqual(expectedEndDate, result.First().DateRange.To);
        }
    }
}


text:
var PhantomjsConnection = (function (document, undefined) {
	"use strict";

	var ids = [];
	var current = 0;

	return {
		/**
		 * Return the ids of elements for a given xpath and parent element context, store them for later referance
		 * @param  {string} xpath  xpath string
		 * @param  {integer} parent parent element id
		 * @return {array}        array of ids
		 */
		ids: function (xpath, parent) {
			var context = ids[parent] || document.body,
					result_ids = [],
					item,
					xpath_result,
					i;

			try {
				xpath_result = document.evaluate(xpath, context, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);

				while (item = xpath_result.iterateNext()) {
					for (i = 0; i < ids.length; i++) {
						if (ids[i] === item) {
							result_ids.push(i);
							break;
						}
					}
					if (i === ids.length ) {
						ids.push(item);
						result_ids.push(i);
					}
				}
				return result_ids;
			}
			catch (e)
			{
				return [];
			}
		},

		/**
		 * Return the HTMLElement for a given id, already found
		 * @param  {integer} id element id
		 * @return {HTMLElement}    the actual html element
		 */
		item: function(id) {
			return ids[id];
		},

		/**
		 * Return the HTMLElement for a given id, already found
		 * @param  {integer} id element id
		 * @return {HTMLElement}    the actual html element
		 */
		value: function(id) {
			var item = ids[id], option, values = [];
			if (item.tagName === 'SELECT' && item.hasAttribute('multiple') && item.options.length) {

				for (var i = 0; i < item.options.length; i++) {
					option = item.options[i];

					if (option.selected) {
						values.push(option.value);
					}
				};

				return values;
			} else {
				return item.value;
			}
		},

		/**
		 * Generate a unique selector for any element
		 * @param  {integer} id element id
		 * @return {string}    selector
		 */
		uniqueSelector: function(id) {
			var className = '_PhantomjsConnection_' + (current++);
			ids[id].className = ids[id].className + ' ' + className;
			return '.' + className;
		},

		/**
		 * Set a value on form element, focus and blur the input
		 * @param  {integer} id    element id
		 * @param  {mixed} value the new value
		 */
		setValue: function(id, value) {
			var elem = ids[id];

			elem.focus();
			elem.value = value;
			elem.blur();

			this.fireEvent(elem, 'change');
		},

		/**
		 * Set an option in a select as "selected" or "not selected", focus, blur and fire a changed event
		 * @param  {integer} id    element id
		 * @param  {boolean} value new selected status
		 */
		setSelected: function(id, value) {
			var elem = ids[id],
					select = elem.parentNode.tagName === 'OPTGROUP' ? elem.parentNode.parentNode : elem.parentNode;

			select.focus();
			elem.selected = parseInt(value, 10);
			select.blur();

			this.fireEvent(select, 'change');
		},

		/**
		 * Fire a native html event
		 * @param  {HTMLElement} elem      the dispatcher
		 * @param  {string} eventName event name
		 */
		fireEvent: function(elem, eventName){
			var event = document.createEvent('HTMLEvents');
			event.initEvent(eventName, true, true);
			elem.dispatchEvent(event);
		},

		/**
		 * Check if an element is visible
		 * @param  {integer} id element id
		 * @return {boolean}    is visible?
		 */
		isVisible: function(id) {
			var elem = ids[id];

			return elem.offsetWidth > 0 && elem.offsetHeight > 0;
		}
	};

}(document));


text:
import { shallowMount } from '@vue/test-utils';
import { CancellablePromise } from 'api/cancellablePromise';
import Executor from 'apps/editor/execution/executor';
import dataCatalog from 'catalog/dataCatalog';
import { Ace } from 'ext/ace';
import { INSERT_AT_CURSOR_EVENT } from 'ko/bindings/ace/ko.aceEditor';
import { AutocompleteParser, SqlParserProvider, SyntaxError, SyntaxParser } from 'parse/types';
import { SetOptions, SqlReferenceProvider, UdfCategory } from 'sql/reference/types';
import huePubSub from 'utils/huePubSub';
import AceEditor from './AceEditor.vue';

import impalaSyntaxParser from 'parse/sql/impala/impalaSyntaxParser';
import impalaAutocompleteParser from 'parse/sql/impala/impalaAutocompleteParser';

const sqlParserProvider: SqlParserProvider = {
  async getAutocompleteParser(): Promise<AutocompleteParser> {
    return impalaAutocompleteParser as unknown as AutocompleteParser;
  },

  async getSyntaxParser(): Promise<SyntaxParser> {
    return impalaSyntaxParser as unknown as SyntaxParser;
  }
};

const sqlReferenceProvider: SqlReferenceProvider = {
  getReservedKeywords(): Promise<Set<string>> {
    return Promise.resolve(new Set<string>());
  },
  getSetOptions(): Promise<SetOptions> {
    return Promise.resolve({});
  },
  getUdfCategories(): Promise<UdfCategory[]> {
    return Promise.resolve([]);
  },
  hasUdfCategories(): boolean {
    return false;
  }
};

describe('AceEditor.vue', () => {
  const mockExecutor = {
    connector: ko.observable({
      dialect: 'impala',
      id: 'impala'
    }),
    namespace: ko.observable({
      id: 'foo'
    }),
    compute: ko.observable({
      id: 'foo'
    }),
    database: ko.observable('default')
  } as unknown as Executor;

  let mountedTwice = false;

  const shallowMountForEditor = async (
    initialValue?: string
  ): Promise<{ element: Element; editor: Ace.Editor }> =>
    new Promise(resolve => {
      jest.spyOn(dataCatalog, 'getChildren').mockReturnValue(CancellablePromise.resolve([]));
      const props = {
        initialValue,
        id: 'some-id',
        executor: mockExecutor,
        sqlParserProvider,
        sqlReferenceProvider
      };

      let wrapper = shallowMount(AceEditor, { props });

      if (!mountedTwice) {
        // There seems to be a bug in vue-test-utils where the first mount won't trigger the onMounted hook.
        mountedTwice = true;
        wrapper = shallowMount(AceEditor, { props });
      }

      wrapper.vm.$nextTick(() => {
        expect(wrapper.emitted()['ace-created']).toBeTruthy();
        const editor = (wrapper.emitted()['ace-created'][0] as Ace.Editor[])[0];
        resolve({ element: wrapper.element, editor });
      });
    });

  it('should render', async () => {
    const { element } = await shallowMountForEditor('some query');
    expect(element).toMatchSnapshot();
  });

  it('should handle drag and drop pubsub event targeting this editor', async () => {
    const { editor } = await shallowMountForEditor();

    const draggedText = 'Some dropped text';
    huePubSub.publish(INSERT_AT_CURSOR_EVENT, {
      text: draggedText,
      targetEditor: editor,
      cursorEndAdjust: 0
    });

    expect(editor.getValue()).toEqual(draggedText);
  });

  it('should not handle drag and drop pubsub event targeting another editor', async () => {
    const { editor } = await shallowMountForEditor();

    const draggedText = 'Some dropped text';
    huePubSub.publish(INSERT_AT_CURSOR_EVENT, {
      text: draggedText,
      targetEditor: {}, // Other instance
      cursorEndAdjust: 0
    });

    expect(editor.getValue()).not.toEqual(draggedText);
  });

  it('should adjust parser 1-based parser location to 0-based ace range for syntax errors', async () => {
    const invalidTokenValue = 'slelect';
    const { editor } = await shallowMountForEditor(invalidTokenValue);
    expect(editor.getValue()).toEqual(invalidTokenValue);

    // Add syntax error manually (normally through web socket)
    const token = editor.session.getTokenAt(0, 0);
    expect(token).toBeDefined();
    expect(token!.value).toEqual(invalidTokenValue);
    const syntaxError: SyntaxError = {
      expected: [{ text: 'select', distance: 0 }],
      loc: { first_line: 1, last_line: 1, first_column: 0, last_column: 7 },
      text: invalidTokenValue
    };
    token!.syntaxError = syntaxError;

    // Listen for the dropdown show event
    let syntaxDropdownCalled = false;
    const subscription = huePubSub.subscribe('sql.syntax.dropdown.show', details => {
      expect(details.range.start.row).toEqual(syntaxError.loc.first_line - 1);
      expect(details.range.end.row).toEqual(syntaxError.loc.last_line - 1);
      expect(details.data).toEqual(syntaxError);
      syntaxDropdownCalled = true;
    });

    // Trigger right click in the editor
    editor.container.dispatchEvent(new MouseEvent('contextmenu', { clientX: 1, clientY: 1 }));
    subscription.remove();

    expect(syntaxDropdownCalled).toBeTruthy();
  });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC  "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <meta name="keywords" content="W3C SVG 1.1 2nd Edition Test Suite"/>
      <meta name="description" content="W3C SVG 1.1 2nd Edition SVGWeb Test Suite"/>
      <title>
SVG 1.1 2nd Edition Test (svgweb): animate-elem-10-t.svg
      </title>

      <link rel="prev" href="animate-elem-09-t.html" />
      <link rel="index" href="index.html" />
      <link rel="next" href="animate-elem-11-t.html" />

Specification link: 19.2 Animation elements

    animate-elem-09-t ←
    index
    → animate-elem-11-t

    Tests that contain the draft-watermark are under development and may be incorrectly testing a feature.

animate-elem-10-t.svg

            SVG Image

            PNG Image

              <object data="../../svg/animate-elem-10-t.svg" width="480" height="360" type="image/svg+xml">
FAIL

              </object>

      Operator Script

        Run the test. No interaction required.

    Pass Criteria

        The test is passed if the two orange rects are animated so that the bottom part of each rectangle is at the position
        indicated by the ruler lines at the particular time noted next to each ruler line. Between two noted times the
        bottom part of each rect must be between the two corresponding ruler lines.

    Test Description

        Test possible values for 'calcMode="linear"'.

        Two animations have been defined. For each animation, ruler lines and text are provided to help show what the correct behavior is.
        The black text and ruler lines help show the sizes and movement of the rectangles over time.

        The linear animations change constantly with each keyframe to keyframe section, with the result that the change is faster when there is a larger
        change within a given amount of time.

    animate-elem-09-t ←
    index
    → animate-elem-11-t


text:
#ifndef __ZMQ_RANDOM_HPP_INCLUDED__
#define __ZMQ_RANDOM_HPP_INCLUDED__

#include "stdint.hpp"

namespace zmq
{

    //  Seeds the random number generator.
    void seed_random ();

    //  Generates random value.
    uint32_t generate_random ();

}

#endif