text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mbean PUBLIC "DCMSCU attributes template extends jboss_xmbean_1_1.dtd" "dcm4chee-scu-xmbean.dtd">

<mbean>
   <description>Move SCU Service to process move orders. Invokes DICOM
   Retrieve requests, typically from the archive's own DICOM
   Query/Retrieve Service (SCP).</description>

   <descriptors>
      <persistence persistPolicy="OnUpdate" />
      <persistence-manager value="org.jboss.mx.persistence.DelegatingPersistenceManager" />
   </descriptors>

   <class>org.dcm4chex.archive.dcm.movescu.MoveScuService</class>

   <constructor>
      <description>The default constructor</description>
      <name>MoveSCUService</name>
   </constructor>

   &defaultAttributes;
   &defaultSCUAttributes;
   <attribute access="read-write"
      getMethod="getCallingAET"
      setMethod="setCallingAET">
      <description>Calling AE title of the Move SCU.
      </description>
      <name>CallingAETitle</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="DCM4CHEE" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getCalledAET"
      setMethod="setCalledAET">
      <description>AE title of the default Move SCP. Only effective, if a
      Move order does not specify a Retrieve AE title or the ForceCalledAET
      flag is set to true.
      </description>
      <name>CalledAETitle</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="DCM4CHEE" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="isForceCalledAET"
      setMethod="setForceCalledAET">
      <description><![CDATA[Specifies whether to ALWAYS use the Called AET
      defined in the Move SCU.  If false, the Retrieve AET of the move
      order, if specified, will be used.]]>
      </description>
      <name>ForceCalledAET</name>
      <type>boolean</type>
      <descriptors>
         <value value="false"/>
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getRetryIntervalls"
      setMethod="setRetryIntervalls">
      <description><![CDATA[Number and interval of retries made for
      failed Move Requests.

Format:

Comma separated list of numberxinterval pairs or NEVER to disable retry for any destinations.

The interval can be specified in seconds (##s),
      minutes (##m), hours (##h) or days (##d).

Optional: Individual settings for specific Destination AETs. e.g. [AET1]3x1m,5x1h

Several AET settings can be seperated with new line or ';'.
      A entry without AET will be treated as default for AETs not listed here.

Example:

5x1m,10x10m means retry a total of 5 times, one minute
      apart for each retry; then retry a total of 10 times, 10 minutes

Example:

[AET1]2x1m,3x10m

[AET2]

5x1m,10x10m

means: for destination AET1 retry a total of 2 times, one minute
      apart for each retry; then retry a total of 3 times, 10 minutes
      apart for each retry.

Retries are disabled for destination AET2!

for all other destinations retry a total of 5 times, one minute
      apart for each retry; then retry a total of 10 times, 10 minutes
      apart for each retry.
      ]]>
      </description>
      <name>RetryIntervals</name>
      <type>java.lang.String</type>
      <descriptors>
         <value value="5x1m,12x5m,24x1h,7x1d" />
      </descriptors>
   </attribute>
   <attribute access="read-write"
      getMethod="getConcurrency"
      setMethod="setConcurrency">
      <description>Maximum number of concurrent invoked Move Requests.
      </description>
      <name>Concurrency</name>
      <type>int</type>
      <descriptors>
         <value value="1" />
      </descriptors>
   </attribute>

   <attribute access="read-write"
      getMethod="getQueueName"
      setMethod="setQueueName">
      <description>Used internally. Do NOT modify.
      </description>
      <name>QueueName</name>
      <type>java.lang.String</type>
   </attribute>

   <attribute access="read-write"
      getMethod="getJmsServiceName"
      setMethod="setJmsServiceName">
      <description>Used internally. Do NOT modify.
      </description>
      <name>JMSServiceName</name>
      <type>javax.management.ObjectName</type>
   </attribute>

   &defaultOperations;
   <operation impact="ACTION">
      <description>Schedule Retrieve</description>
      <name>scheduleMove</name>
      <parameter>
        <description>Retieve AE Title</description>
        <name>retrieveAET</name>
        <type>java.lang.String</type>
      </parameter>
      <parameter>
        <description>Move Destination</description>
        <name>destAET</name>
        <type>java.lang.String</type>
      </parameter>
      <parameter>
        <description>DICOM Priority (0 = MEDIUM, 1 = HIGH, 2 = LOW)</description>
        <name>priority</name>
        <type>int</type>
      </parameter>
      <parameter>
        <description>Patient ID</description>
        <name>pid</name>
        <type>java.lang.String</type>
      </parameter>
      <parameter>
        <description>Study Instance UID</description>
        <name>studyIUID</name>
        <type>java.lang.String</type>
      </parameter>
      <parameter>
        <description>Series Instance UID</description>
        <name>seriesIUID</name>
        <type>java.lang.String</type>
      </parameter>
      <parameter>
        <description>SOP Instance UIDs</description>
        <name>sopIUIDs</name>
        <type>[Ljava.lang.String;</type>
      </parameter>
      <parameter>
        <description>Scheduled Time in ms from 1970-01-01 00:00</description>
        <name>scheduledTime</name>
        <type>long</type>
      </parameter>
      <return-type>void</return-type>
   </operation>

   <operation impact="ACTION">
      <description>Schedule Retrieve</description>
      <name>scheduleMove</name>
      <parameter>
        <description>Retieve AE Title</description>
        <name>retrieveAET</name>
        <type>java.lang.String</type>
      </parameter>
      <parameter>
        <description>Move Destination</description>
        <name>destAET</name>
        <type>java.lang.String</type>
      </parameter>
      <parameter>
        <description>DICOM Priority (0 = MEDIUM, 1 = HIGH, 2 = LOW)</description>
        <name>priority</name>
        <type>int</type>
      </parameter>
      <parameter>
        <description>Patient ID</description>
        <name>pid</name>
        <type>java.lang.String</type>
      </parameter>
      <parameter>
        <description>Study Instance UIDs</description>
        <name>studyIUIDs</name>
        <type>[Ljava.lang.String;</type>
      </parameter>
      <parameter>
        <description>Series Instance UIDs</description>
        <name>seriesIUIDs</name>
        <type>[Ljava.lang.String;</type>
      </parameter>
      <parameter>
        <description>SOP Instance UIDs</description>
        <name>sopIUIDs</name>
        <type>[Ljava.lang.String;</type>
      </parameter>
      <parameter>
        <description>Scheduled Time in ms from 1970-01-01 00:00</description>
        <name>scheduledTime</name>
        <type>long</type>
      </parameter>
      <return-type>void</return-type>
   </operation>

   <operation impact="ACTION">
      <description>Schedule Retrieve</description>
      <name>scheduleMoveOrder</name>
      <parameter>
        <description>SCU Move Order</description>
        <name>order</name>
        <type>org.dcm4chex.archive.dcm.movescu.MoveOrder</type>
      </parameter>
      <parameter>
        <description>Scheduled Time in ms from 1970-01-01 00:00</description>
        <name>scheduledTime</name>
        <type>long</type>
      </parameter>
      <return-type>void</return-type>
   </operation>

</mbean>


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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>fr.ethilvan.bukkit</groupId>
		<artifactId>parent</artifactId>
		<version>1.4.7-dev-SNAPSHOT</version>
	</parent>

	<artifactId>permissions</artifactId>

	<name>Permissions</name>
	<description>Database permissions provider plugin</description>

	<dependencies>
		<dependency>
			<groupId>fr.ethilvan.bukkit</groupId>
			<artifactId>api</artifactId>
		</dependency>
	</dependencies>

</project>

redpajama_set_name: RedPajamaGithub


text:
package net.vicp.milim.ScheduledTask.zaixianwanjia.utils;

import java.math.BigDecimal;

public class MathOp
{
  private static final int DEFINE_DIV_SCALE = 10;

  public static double add(double v1, double v2)
  {
    BigDecimal b1 = new BigDecimal(Double.toString(v1));
    BigDecimal b2 = new BigDecimal(Double.toString(v2));
    return b1.add(b2).doubleValue();
  }

  public static double sub(double v1, double v2)
  {
    BigDecimal b1 = new BigDecimal(Double.toString(v1));
    BigDecimal b2 = new BigDecimal(Double.toString(v2));
    return b1.subtract(b2).doubleValue();
  }

  public static double mul(double v1, double v2)
  {
    BigDecimal b1 = new BigDecimal(Double.toString(v1));
    BigDecimal b2 = new BigDecimal(Double.toString(v2));
    return b1.multiply(b2).doubleValue();
  }

  public static double div(double v1, double v2)
  {
    return div(v1, v2, DEFINE_DIV_SCALE);
  }

  public static String div2(double v1, double v2)
  {
	String d = div(v1, v2, DEFINE_DIV_SCALE)+"";
	if(d.endsWith(".0")){
		d = d.replace(".0", "");
	}
    return d;
  }

  public static double div(double v1, double v2, int scale)
  {
    if (scale < 0) {
      throw new IllegalArgumentException("The scale must be a positive integer or zero");
    }
    BigDecimal b1 = new BigDecimal(Double.toString(v1));
    BigDecimal b2 = new BigDecimal(Double.toString(v2));
    return b1.divide(b2, scale, 4).doubleValue();
  }

  public static double round(double v, int scale)
  {
    if (scale < 0) {
      throw new IllegalArgumentException("The scale must be a positive integer or zero");
    }
    BigDecimal b = new BigDecimal(Double.toString(v));
    BigDecimal one = new BigDecimal("1");
    return b.divide(one, scale, 4).doubleValue();
  }

  public static void main(String[] args) {
	  System.out.println(div(2, 100));

  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
       Copyright (C) 2016 Haruki Hasegawa

       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at

           http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
-->
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recycler_view"
        style="@style/myRecyclerViewStyle"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</FrameLayout>


text:
package org.apache.tika.parser.microsoft;

import static org.apache.tika.parser.microsoft.AbstractPOIContainerExtractionTest.getTestFile;
import static org.junit.Assert.assertEquals;

import org.apache.tika.TikaTest;
import org.apache.tika.detect.DefaultDetector;
import org.apache.tika.detect.Detector;
import org.apache.tika.io.TikaInputStream;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.metadata.TikaCoreProperties;
import org.apache.tika.mime.MediaType;
import org.apache.tika.parser.ParseContext;
import org.apache.tika.sax.BodyContentHandler;
import org.junit.Ignore;
import org.junit.Test;
import org.xml.sax.ContentHandler;

/**
 * Tests for the Old Excel (2-4) parser
 */
public class OldExcelParserTest extends TikaTest {
    private static final String file = "testEXCEL_4.xls";

    @Test
    public void testDetection() throws Exception {
        Detector detector = new DefaultDetector();
        try (TikaInputStream stream = getTestFile(file)) {
            assertEquals(
                    MediaType.application("vnd.ms-excel.sheet.4"),
                    detector.detect(stream, new Metadata()));
        }
    }

    // Disabled, until we can get the POI code to tell us the version
    @Test
    @Ignore
    public void testMetadata() throws Exception {
        TikaInputStream stream = getTestFile(file);

        Metadata metadata = new Metadata();
        ContentHandler handler = new BodyContentHandler();

        OldExcelParser parser = new OldExcelParser();
        parser.parse(stream, handler, metadata, new ParseContext());

        // We can get the content type
        assertEquals("application/vnd.ms-excel.sheet.4", metadata.get(Metadata.CONTENT_TYPE));

        // But no other metadata
        assertEquals(null, metadata.get(TikaCoreProperties.TITLE));
        assertEquals(null, metadata.get(Metadata.SUBJECT));
    }

    /**
     * Check we can get the plain text properly
     */
    @Test
    public void testPlainText() throws Exception {
        ContentHandler handler = new BodyContentHandler();
        Metadata metadata = new Metadata();

        try (TikaInputStream stream = getTestFile(file)) {
            new OldExcelParser().parse(stream, handler, metadata, new ParseContext());
        }

        String text = handler.toString();

        // Check we find a few words we expect in there
        assertContains("Size", text);
        assertContains("Returns", text);

        // Check we find a few numbers we expect in there
        assertContains("11", text);
        assertContains("784", text);
    }

    /**
     * Check the HTML version comes through correctly
     */
    @Test
    public void testHTML() throws Exception {
        XMLResult result = getXML(file);
        String xml = result.xml;

        // Sheet name not found - only 5+ have sheet names
        assertNotContained("
Sheet 1
", xml);

        // String cells
        assertContains("
Table 10 -", xml);
        assertContains("
Tax
", xml);
        assertContains("
N/A
", xml);

        // Number cells
        assertContains("
(1)
", xml);
        assertContains("
5.0
", xml);
    }
}


text:
import random
from django.contrib.webdesign.lorem_ipsum import words, sentence, paragraphs
from django.template.defaultfilters import slugify
from django.test import TestCase
from pressroom.models import Article

class PressroomTests(TestCase):
    def test_environment(self):
        """Just make sure everything is set up correctly."""
        self.assert_(True)

    def test_published(self):

        headline = words(random.randint(5,10), common=False)

        a1, created = Article.objects.get_or_create( headline=headline,
            slug=slugify(headline),
            summary=sentence(),
            author=words(1,common=False),
            body=paragraphs(5),
            publish=True)

        a2, created = Article.objects.get_or_create( headline=headline,
            slug=slugify(headline),
            summary=sentence(),
            author=words(1,common=False),
            body=paragraphs(5),
            publish=False)

        published_articles = Article.objects.get_published()
        self.assertEqual(1, len(published_articles))

    def test_canonical_published(self):

        headline = words(random.randint(5,10), common=False)
        a1, created = Article.objects.get_or_create( headline=headline,
            slug=slugify(headline),
            summary=sentence(),
            author=words(1,common=False),
            body=paragraphs(5),
            publish=True)

        a2, created = Article.objects.get_or_create( headline=headline,
            slug=slugify(headline),
            summary=sentence(),
            author=words(1,common=False),
            body=paragraphs(5),
            publish=True)

        self.assertEqual(2, len(Article.objects.get_published()))

        # set a2 to be a translation of a1
        a2.translation_of = a1
        a2.save()

        # we only expect 1 canonical object now as a2 is a translation of a1
        self.assertEqual(1, len(Article.objects.get_published()))


text:
package org.pitest.util;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;
import org.pitest.classinfo.ClassName;
import org.pitest.functional.Option;

public class FunctionsTest {

  @Test
  public void classToNameShouldReturnClassName() {
    assertEquals(String.class.getName(),
        Functions.classToName().apply(String.class));
  }

  @Test
  public void nameToClassShouldReturnClassWhenKnownToLoader() {
    assertEquals(Option.some(String.class),
        Functions.nameToClass().apply(new ClassName("java.lang.String")));
  }

  @Test
  public void stringToClassShouldReturnNoneWhenClassNotKnownToLoader() {
    assertEquals(Option.none(),
        Functions.nameToClass().apply(new ClassName("org.unknown.Unknown")));
  }

  @Test
  public void startWithShouldReturnTrueIfGivenStringStartsWithParameter() {
    assertTrue(Functions.startsWith("foo").apply("foobar"));
  }

  @Test
  public void startWithShouldReturnFalseIfGivenStringDoesNotStartsWithParameter() {
    assertFalse(Functions.startsWith("foo").apply("barfoo"));
  }

  static enum Foo {
    A, B, C, Bar;
  };

  @Test
  public void stringToEnumShouldConvertStringsToEnumValues() {
    assertEquals(Foo.A, Functions.stringToEnum(Foo.class).apply("A"));
    assertEquals(Foo.Bar, Functions.stringToEnum(Foo.class).apply("Bar"));
  }

  @Test
  public void classNameToJVMClassNameShouldConvertDotsToSlashes() {
    assertEquals("a/b/c", Functions.classNameToJVMClassName().apply("a.b.c"));
  }

  @Test
  public void jvmClassToClassNameShouldConvertSlashesToDots() {
    assertEquals("a.b.c", Functions.jvmClassToClassName().apply("a/b/c"));
  }

}


text:
from __future__ import annotations

import os
from pathlib import Path
from typing import Any, Dict, Optional

import click
from ruamel.yaml import YAML, ScalarNode
from ruamel.yaml.loader import Loader

from asphalt.core.runner import policies, run_application
from asphalt.core.utils import merge_config, qualified_name

def env_constructor(loader: Loader, node: ScalarNode) -> str | None:
    value = loader.construct_scalar(node)
    return os.getenv(value)

def text_file_constructor(loader: Loader, node: ScalarNode) -> str:
    value = loader.construct_scalar(node)
    return Path(value).read_text()

def binary_file_constructor(loader: Loader, node: ScalarNode) -> bytes:
    value = loader.construct_scalar(node)
    return Path(value).read_bytes()

@click.group()
def main() -> None:
    pass  # pragma: no cover

@main.command(help="Read one or more configuration files and start the application.")
@click.argument("configfile", type=click.File(), nargs=-1, required=True)
@click.option(
    "--unsafe",
    is_flag=True,
    default=False,
    help="use unsafe mode when loading YAML (enables markup extensions)",
)
@click.option(
    "-l",
    "--loop",
    type=click.Choice(policies.names),
    help="alternate event loop policy",
)
@click.option(
    "-s",
    "--service",
    type=str,
    help="service to run (if the configuration file contains multiple services)",
)
def run(configfile, unsafe: bool, loop: Optional[str], service: Optional[str]) -> None:
    yaml = YAML(typ="unsafe" if unsafe else "safe")
    yaml.constructor.add_constructor("!Env", env_constructor)
    yaml.constructor.add_constructor("!TextFile", text_file_constructor)
    yaml.constructor.add_constructor("!BinaryFile", binary_file_constructor)

    # Read the configuration from the supplied YAML files
    config: Dict[str, Any] = {}
    for path in configfile:
        config_data = yaml.load(path)
        assert isinstance(
            config_data, dict
        ), "the document root element must be a dictionary"
        config = merge_config(config, config_data)

    # Override the event loop policy if specified
    if loop:
        config["event_loop_policy"] = loop

    services = config.pop("services", {})
    if not isinstance(services, dict):
        raise click.ClickException(
            f'The "services" key must be a dict, not {qualified_name(services)}'
        )

    # If "component" was defined, use that as the default service if one has not been defined yet
    if "component" in config:
        component = config.pop("component")
        services.setdefault("default", dict(component=component))

    # Try to figure out which service to launch
    service = service or os.getenv("ASPHALT_SERVICE")
    if len(services) == 0:
        raise click.ClickException("No services have been defined")
    elif service:
        try:
            service_config = services[service]
        except KeyError:
            raise click.ClickException(
                f"Service {service!r} has not been defined"
            ) from None
    elif len(services) == 1:
        service_config = next(iter(services.values()))
    elif "default" in services:
        service_config = services["default"]
    else:
        raise click.ClickException(
            "Multiple services present in configuration file but no default service has been "
            "defined and no service was explicitly selected with -s / --service"
        )

    # Merge the service-level configuration with the top level one
    config = merge_config(config, service_config)

    # Start the application
    run_application(**config)


text:
package org.springframework.cloud.dataflow.composedtaskrunner;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;

import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobInstance;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.explore.JobExplorer;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
import org.springframework.cloud.dataflow.composedtaskrunner.configuration.ComposedRunnerVisitorConfiguration;
import org.springframework.cloud.task.batch.configuration.TaskBatchAutoConfiguration;
import org.springframework.cloud.task.configuration.SimpleTaskAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * @author Glenn Renfro
 */
public class ComposedRunnerVisitorTests {

	private static final String CLOSE_CONTEXT_ARG = "--spring.cloud.task.closecontext_enable=false";
	private static final String TASK_NAME_ARG = "--spring.cloud.task.name=job";
	private static final String INVALID_FLOW_MSG = "Invalid flow following '*' specifier.";

	private ConfigurableApplicationContext applicationContext;

	@AfterEach
	public void tearDown() {
		if (this.applicationContext != null) {
			this.applicationContext.close();
		}
	}

	@Test
	public void singleTest() {
		setupContextForGraph("AAA");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		assertEquals(1, stepExecutions.size());
		StepExecution stepExecution = stepExecutions.iterator().next();
		assertEquals("AAA_0", stepExecution.getStepName());
	}

	@Test
	public void testFailedGraph() {
		setupContextForGraph("failedStep && AAA");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		assertEquals(1, stepExecutions.size());
		StepExecution stepExecution = stepExecutions.iterator().next();
		assertEquals("failedStep_0", stepExecution.getStepName());
	}

	@Test
	public void testEmbeddedFailedGraph() {
		setupContextForGraph("AAA && failedStep && BBB");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		assertEquals(2, stepExecutions.size());
		List<StepExecution> sortedStepExecution =
				getSortedStepExecutions(stepExecutions);
		assertEquals("AAA_0", sortedStepExecution.get(0).getStepName());
		assertEquals("failedStep_0", sortedStepExecution.get(1).getStepName());
	}

//	@Ignore("Disabling till parser can support duplicate tasks")
//	@Test
	public void duplicateTaskTest() {
		setupContextForGraph("AAA && AAA");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		assertEquals(2, stepExecutions.size());
		List<StepExecution> sortedStepExecution =
				getSortedStepExecutions(stepExecutions);
		assertEquals("AAA_1", sortedStepExecution.get(0).getStepName());
		assertEquals("AAA_0", sortedStepExecution.get(1).getStepName());

	}

	@Test
	public void testSequential() {
		setupContextForGraph("AAA && BBB && CCC");
		List<StepExecution> stepExecutions = getSortedStepExecutions(getStepExecutions());
		assertEquals(3, stepExecutions.size());
		Iterator<StepExecution> iterator = stepExecutions.iterator();
		StepExecution stepExecution = iterator.next();
		assertEquals("AAA_0", stepExecution.getStepName());
		stepExecution = iterator.next();
		assertEquals("BBB_0", stepExecution.getStepName());
		stepExecution = iterator.next();
		assertEquals("CCC_0", stepExecution.getStepName());
	}

	@Test
	public void splitTest() {
		setupContextForGraph("<AAA||BBB||CCC>");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(3, stepExecutions.size());
		assertTrue(stepNames.contains("AAA_0"));
		assertTrue(stepNames.contains("BBB_0"));
		assertTrue(stepNames.contains("CCC_0"));
	}

	@Test
	public void nestedSplit() {
		setupContextForGraph("<<AAA || BBB > && CCC || DDD>", "--splitThreadCorePoolSize=5");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(4, stepExecutions.size());
		assertTrue(stepNames.contains("AAA_0"));
		assertTrue(stepNames.contains("BBB_0"));
		assertTrue(stepNames.contains("CCC_0"));
		assertTrue(stepNames.contains("DDD_0"));
	}

	// @Test re-add later
	public void nestedSplitThreadPoolSize() {
		Throwable exception = assertThrows(BeanCreationException.class, () ->
				setupContextForGraph("<<AAA || BBB > && CCC || <DDD || EEE> && FFF>", "--splitThreadCorePoolSize=1"));
		assertThat(exception.getCause().getCause().getMessage()).isEqualTo("Split thread core pool size 1 should be equal or greater than the " +
				"depth of split flows 3. Try setting the composed task property " +
				"`splitThreadCorePoolSize`");
	}

	@Test
	public void twoSplitTest() {
		setupContextForGraph("<AAA||BBB||CCC> && <DDD||EEE>");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(5, stepExecutions.size());
		assertTrue(stepNames.contains("AAA_0"));
		assertTrue(stepNames.contains("BBB_0"));
		assertTrue(stepNames.contains("CCC_0"));
		assertTrue(stepNames.contains("DDD_0"));
		assertTrue(stepNames.contains("EEE_0"));
	}

	@Test
	public void testSequentialAndSplit() {
		setupContextForGraph("AAA && <BBB||CCC||DDD> && EEE");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(5, stepExecutions.size());
		assertTrue(stepNames.contains("AAA_0"));
		assertTrue(stepNames.contains("BBB_0"));
		assertTrue(stepNames.contains("CCC_0"));
		assertTrue(stepNames.contains("DDD_0"));
		assertTrue(stepNames.contains("EEE_0"));
		List<StepExecution> sortedStepExecution =
				getSortedStepExecutions(stepExecutions);
		assertEquals("AAA_0", sortedStepExecution.get(0).getStepName());
		assertEquals("EEE_0", sortedStepExecution.get(4).getStepName());
	}

	@Test
	public void testSequentialTransitionAndSplit() {
		setupContextForGraph("AAA && FFF 'FAILED' -> EEE && <BBB||CCC> && DDD");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(5, stepExecutions.size());
		assertTrue(stepNames.contains("AAA_0"));
		assertTrue(stepNames.contains("BBB_0"));
		assertTrue(stepNames.contains("CCC_0"));
		assertTrue(stepNames.contains("DDD_0"));
		assertTrue(stepNames.contains("FFF_0"));
		List<StepExecution> sortedStepExecution =
				getSortedStepExecutions(stepExecutions);
		assertEquals("AAA_0", sortedStepExecution.get(0).getStepName());
		assertEquals("DDD_0", sortedStepExecution.get(4).getStepName());
	}

	@Test
	public void testSequentialTransitionAndSplitFailedInvalid() {
		verifyExceptionThrown(INVALID_FLOW_MSG,
				"AAA && failedStep 'FAILED' -> EEE '*' -> FFF && <BBB||CCC> && DDD");
	}

	@Test
	public void testSequentialTransitionAndSplitFailed() {
		setupContextForGraph("AAA && failedStep 'FAILED' -> EEE && FFF && <BBB||CCC> && DDD");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(3, stepExecutions.size());
		assertTrue(stepNames.contains("AAA_0"));
		assertTrue(stepNames.contains("failedStep_0"));
		assertTrue(stepNames.contains("EEE_0"));
	}

	@Test
	public void testSequentialAndFailedSplit() {
		setupContextForGraph("AAA && <BBB||failedStep||DDD> && EEE");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(4, stepExecutions.size());
		assertTrue(stepNames.contains("AAA_0"));
		assertTrue(stepNames.contains("BBB_0"));
		assertTrue(stepNames.contains("DDD_0"));
		assertTrue(stepNames.contains("failedStep_0"));
	}

	@Test
	public void testSequentialAndSplitWithFlow() {
		setupContextForGraph("AAA && <BBB && FFF||CCC||DDD> && EEE");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(6, stepExecutions.size());
		assertTrue(stepNames.contains("AAA_0"));
		assertTrue(stepNames.contains("BBB_0"));
		assertTrue(stepNames.contains("CCC_0"));
		assertTrue(stepNames.contains("DDD_0"));
		assertTrue(stepNames.contains("EEE_0"));
		assertTrue(stepNames.contains("FFF_0"));

		List<StepExecution> sortedStepExecution =
				getSortedStepExecutions(stepExecutions);
		assertEquals("AAA_0", sortedStepExecution.get(0).getStepName());
		assertEquals("EEE_0", sortedStepExecution.get(5).getStepName());
	}

	@Test
	public void testFailedBasicTransition() {
		setupContextForGraph("failedStep 'FAILED' -> AAA * -> BBB");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(2, stepExecutions.size());
		assertTrue(stepNames.contains("failedStep_0"));
		assertTrue(stepNames.contains("AAA_0"));
	}

	@Test
	public void testSuccessBasicTransition() {
		setupContextForGraph("AAA 'FAILED' -> BBB * -> CCC");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(2, stepExecutions.size());
		assertTrue(stepNames.contains("AAA_0"));
		assertTrue(stepNames.contains("CCC_0"));
	}

	@Test
	public void testSuccessBasicTransitionWithSequence() {
		verifyExceptionThrown(INVALID_FLOW_MSG,
				"AAA 'FAILED' -> BBB * -> CCC && DDD && EEE");
	}

	@Test
	public void testSuccessBasicTransitionWithTransition() {
		setupContextForGraph("AAA 'FAILED' -> BBB && CCC 'FAILED' -> DDD '*' -> EEE");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(3, stepExecutions.size());
		assertTrue(stepNames.contains("AAA_0"));
		assertTrue(stepNames.contains("CCC_0"));
		assertTrue(stepNames.contains("EEE_0"));
		List<StepExecution> sortedStepExecution =
				getSortedStepExecutions(stepExecutions);
		assertEquals("AAA_0", sortedStepExecution.get(0).getStepName());
		assertEquals("EEE_0", sortedStepExecution.get(2).getStepName());
	}

	@Test
	public void testSequenceFollowedBySuccessBasicTransitionSequence() {
		verifyExceptionThrown(INVALID_FLOW_MSG,
				"DDD && AAA 'FAILED' -> BBB * -> CCC && EEE");
	}

	@Test
	public void testWildCardOnlyInLastPosition() {
		setupContextForGraph("AAA 'FAILED' -> BBB && CCC * -> DDD ");
		Collection<StepExecution> stepExecutions = getStepExecutions();
		Set<String> stepNames = getStepNames(stepExecutions);
		assertEquals(3, stepExecutions.size());
		assertTrue(stepNames.contains("AAA_0"));
		assertTrue(stepNames.contains("CCC_0"));
		assertTrue(stepNames.contains("DDD_0"));
		List<StepExecution> sortedStepExecution =
				getSortedStepExecutions(stepExecutions);
		assertEquals("AAA_0", sortedStepExecution.get(0).getStepName());
		assertEquals("DDD_0", sortedStepExecution.get(2).getStepName());
	}

	@Test
	public void failedStepTransitionWithDuplicateTaskNameTest() {
		verifyExceptionThrown(
				"Problems found when validating 'failedStep " +
						"'FAILED' -> BBB  && CCC && BBB && EEE': " +
						"[166E:(pos 38): duplicate app name. Use a " +
						"label to ensure uniqueness]",
				"failedStep 'FAILED' -> BBB  && CCC && BBB && EEE");
	}

	@Test
	public void successStepTransitionWithDuplicateTaskNameTest() {
		verifyExceptionThrown(
				"Problems found when validating 'AAA 'FAILED' -> " +
						"BBB  * -> CCC && BBB && EEE': [166E:(pos 33): " +
						"duplicate app name. Use a label to ensure " +
						"uniqueness]", "AAA 'FAILED' -> BBB  * -> CCC && BBB && EEE");
	}

	private Set<String> getStepNames(Collection<StepExecution> stepExecutions) {
		Set<String> result = new HashSet<>();
		for (StepExecution stepExecution : stepExecutions) {
			result.add(stepExecution.getStepName());
		}
		return result;
	}

	private void setupContextForGraph(String graph, String... args) {
		List<String> argsForCtx = new ArrayList<>(Arrays.asList(args));
		argsForCtx.add("--graph=" + graph);
		argsForCtx.add(CLOSE_CONTEXT_ARG);
		argsForCtx.add(TASK_NAME_ARG);
		argsForCtx.add("--spring.batch.initialize-schema=always");
		argsForCtx.add("--spring.main.web-application-type=none");
		setupContextForGraph(argsForCtx.toArray(new String[0]));
	}

	private void setupContextForGraph(String[] args) {
		this.applicationContext = SpringApplication.run(new Class[]{ComposedRunnerVisitorConfiguration.class,
				PropertyPlaceholderAutoConfiguration.class,
				EmbeddedDataSourceConfiguration.class,
				BatchAutoConfiguration.class,
				TaskBatchAutoConfiguration.class,
				SimpleTaskAutoConfiguration.class}, args);
	}

	private Collection<StepExecution> getStepExecutions() {
		JobExplorer jobExplorer = this.applicationContext.getBean(JobExplorer.class);
		List<JobInstance> jobInstances = jobExplorer.findJobInstancesByJobName("job", 0, 1);
		assertEquals(1, jobInstances.size());
		JobInstance jobInstance = jobInstances.get(0);
		List<JobExecution> jobExecutions = jobExplorer.getJobExecutions(jobInstance);
		assertEquals(1, jobExecutions.size());
		JobExecution jobExecution = jobExecutions.get(0);
		return jobExecution.getStepExecutions();
	}

	private List<StepExecution> getSortedStepExecutions(Collection<StepExecution> stepExecutions) {
		List<StepExecution> result = new ArrayList<>(stepExecutions);
		result.sort(Comparator.comparing(StepExecution::getStartTime));
		return result;
	}

	private void verifyExceptionThrown(String message, String graph) {
		Throwable exception = assertThrows(BeanCreationException.class, () -> setupContextForGraph(graph));
		assertThat(exception.getCause().getCause().getMessage()).isEqualTo(message);
	}

}


text:
// Check for the name of the naturaldocs binary
var fs = require('fs');
if (fs.existsSync("/usr/bin/naturaldocs")) {
    naturaldocs = "/usr/bin/naturaldocs";
} else if (fs.existsSync("/usr/lib/bin/natural_docs")) {
    naturaldocs = "/usr/lib/bin/natural_docs";
} else {
    naturaldocs = "naturaldocs";
}

module.exports = function(grunt){
    var pkg = grunt.file.readJSON('package.json');

    grunt.initConfig({
        pkg: pkg,

        clean: {
            "prepare-doc": ["<%= natural_docs.docs.inputs[0] %>", "<%= natural_docs.docs.project %>"],
            "doc": ["<%= natural_docs.docs.output %>"],
            "prepare-release": ["strophejs-<%= pkg.version %>"],
            "release": ["strophejs-<%= pkg.version %>.zip", "strophejs-<%= pkg.version %>.tar.gz"],
            "js": ["<%= concat.dist.dest %>", "strophe.min.js", "strophe.light.js"]
        },

        connect: {
            server: {
                options: {
                    port: 8000,
                    base: '.'
                }
            }
        },

        concat: {
            dist: {
                src: ['src/wrap_header.js', 'src/base64.js', 'src/sha1.js', 'src/md5.js', 'src/utils.js', 'src/polyfills.js', 'src/core.js', 'src/bosh.js', 'src/websocket.js', 'src/wrapper.js', 'src/wrap_footer.js'],
                dest: '<%= pkg.name %>'
            },
            light: {
                // This rule is meant to build a lighter version without Base64 nor Polyfills,
                // by explicitly running `make strophe.light.js` -- The generated file will
                // work in all major browsers, including MSIE starting with version 10
                src: ['src/wrap_header.js', 'src/sha1.js', 'src/md5.js', 'src/utils.js', 'src/core.js', 'src/bosh.js', 'src/websocket.js', 'src/wrapper.js', 'src/wrap_footer.js'],
                dest: 'strophe.light.js',
                options: {
                    process: function(src){
                        return src.replace('@VERSION@', pkg.version)
                            .replace(/Base64\.encode/g, 'btoa')
                            .replace(/Base64\.decode/g, 'atob')
                            .replace(/, (?:root\.)?Base64/g, '')
                            .replace(/ +'strophe-base64',\r?\n/, '')
                            .replace(/,\s+"strophe-polyfill"/, '')
                            .replace(/ +(?:window\.)?Base64\s*[:=].*?Base64[,;]\r?\n/g, '');
                    }
                }
            },
            options: {
                process: function(src){
                    return src.replace('@VERSION@', pkg.version);
                }
            }
        },

        copy: {
            "prepare-release": {
                files:[
                    {
                        expand: true,
                        src:['<%= concat.dist.dest %>', 'strophe.min.js', 'LICENSE.txt', 'README.txt',
                            'contrib/**', 'examples/**', 'plugins/**', 'tests/**', 'doc/**'],
                        dest:"strophejs-<%= pkg.version %>"
                    }
                ]
            },
            "prepare-doc": {
                files:[
                    {
                        src:['<%= concat.dist.dest %>'],
                        dest:"<%= natural_docs.docs.inputs[0] %>"
                    }
                ]
            }
        },

        jshint: {
            files: ['Gruntfile.js', 'src/*.js'],
        },

        shell: {
            tar: {
                command: 'tar czf strophejs-<%= pkg.version %>.tar.gz strophejs-<%= pkg.version %>',
                options: { failOnError: true }
            },
            zip: {
                command: 'zip -qr strophejs-<%= pkg.version %>.zip strophejs-<%= pkg.version %>',
                options: { failOnError: true }
            }
        },

        uglify: {
            options: {
                banner: '/*! <%= pkg.name %> v<%= pkg.version %> - built on <%= grunt.template.today("dd-mm-yyyy") %> */\n'
            },
            dist: {
                files: { 'strophe.min.js': ['<%= concat.dist.dest %>'] }
            }
        },

        watch: {
            files: ['<%= jshint.files %>'],
            tasks: ['concat', 'uglify']
        },

        natural_docs: {
            docs: {
                bin: naturaldocs,
                inputs: [ "doc-tmp/" ],
                project: "ndproj",
                output: "doc"
            },
        },

        mkdir: {
            "prepare-doc": {
                options: {
                    create: ["<%= natural_docs.docs.project %>", "<%= natural_docs.docs.output %>"]
                }
            },
        },
    });

    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks("grunt-contrib-uglify");
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks("grunt-contrib-concat");
    grunt.loadNpmTasks("grunt-contrib-clean");
    grunt.loadNpmTasks('grunt-shell');
    grunt.loadNpmTasks('grunt-natural-docs');
    grunt.loadNpmTasks('grunt-mkdir');
    grunt.loadNpmTasks('grunt-contrib-qunit');

    grunt.registerTask("default", ["jshint", "min"]);
    grunt.registerTask("min", ["concat:dist", "uglify"]);
    grunt.registerTask("prepare-release", ["copy:prepare-release"]);
    grunt.registerTask("doc", ["concat:dist", "copy:prepare-doc", "mkdir:prepare-doc", "natural_docs"]);
    grunt.registerTask("release", ["default", "doc", "copy:prepare-release", "shell:tar", "shell:zip"]);
    grunt.registerTask("all", ["release", "clean"]);

    grunt.registerTask('almond', 'Create an almond build with r.js', function () {
        var done = this.async();
        require('child_process').exec(
                './node_modules/requirejs/bin/r.js -o build.js optimize=none out=strophe.almond.js',
            function (err, stdout, stderr) {
                if (err) {
                    grunt.log.write('build failed with error code '+err.code);
                    grunt.log.write(stderr);
                }
                grunt.log.write(stdout);
                done();
            }
        );
        grunt.task.run('uglify');
    });
};


text:
var conn = require('./conn.js');
var logger = (require('../logging/vip-winston')).Logger;

var endOfLine = require('os').EOL;
var delim = ',';

var makeCSVSafe = function(value){
  value = value && value.toString() || '';
  // the delim is in our value we need to put quotes around our value
  if(value.indexOf(delim)!==-1){

    // if we are putting quotes around our value, we need to escape any existing quotes first
    value = value.replace(/"/g, '""');

    value = '"' + value + '"';
  }

  return value;
}

var makeCSVRow = function(values) {
  return values.map(makeCSVSafe).join(delim) + endOfLine;
}

var header = ["Feed", "Severity", "Scope", "ID", "Error Type", "Error Data"];

var csvFilename = function(feedId, scope) {
  scopeName = scope || "Full";
  return feedId.replace(/ /g, '-') + "-" + scopeName + "ErrorReport.csv";
}

var errorReport = function(innerJoins, where, params, scope) {
  var errorQuery = "SELECT v.* FROM validations v INNER JOIN results r ON r.id = v.results_id " +
      innerJoins +
      " WHERE r.public_id=$1 " +
      (where ? " AND " + where : "") +
      " ORDER BY v.scope, v.identifier";
  return function(req, res) {
    var feedid = decodeURIComponent(req.params.feedid);

    try {
      conn.query(function(client) {
        var queryParams = ['feedid'].concat(params).map(function(param) { return decodeURIComponent(req.params[param]); });

        res.header("Content-Disposition", "attachment; filename=" + csvFilename(feedid, scope));
        res.setHeader('Content-type', 'text/csv');
        res.charset = 'UTF-8';

        res.write(makeCSVRow(header));

        var query = client.query(errorQuery, queryParams);

        query.on("row", function(row, result) {
          res.write(makeCSVRow([feedid, row.severity, row.scope, row.identifier, row.error_type, row.error_data]));
        });

        query.on("end", function(result) {
          res.end();
        });

        query.on("error", function(e) {
          logger.error("Generating an error report for '" + feedid + "' caused " + e.message);
          // If the query doesn't return anything before we hit our connection's
          // timeout, we'll only have added CSV headers to the response.
          res.end();
        });
      });
    }
    catch (e) {}
  }
}

var xmlTreeValidationQuery =
"SELECT v.severity, v.scope, v.path, v.parent_element_id AS identifier, \
        v.error_type, v.error_data \
 FROM xml_tree_validations v \
 INNER JOIN results r ON r.id = v.results_id \
 WHERE r.public_id = $1";

var scopedXmlTreeValidationQuery = function(elementTypes) {
  return "SELECT v.severity, v.scope, v.path, v.parent_element_id AS identifier, \
        v.error_type, v.error_data \
 FROM xml_tree_validations v \
 INNER JOIN results r ON r.id = v.results_id \
 WHERE r.public_id = $1 AND v.path ~ 'VipObject.0." + elementTypes.join("|") + ".*'";
}

var elementTypeAndScopeXmlTreeValidationQuery = function(elementType, scope) {
  return "SELECT v.severity, v.scope, v.path, v.parent_element_id AS identifier, \
        v.error_type, v.error_data \
 FROM xml_tree_validations v \
 INNER JOIN results r ON r.id = v.results_id \
 WHERE r.public_id = $1 AND (v.path ~ 'VipObject.0."+ elementType + ".*' or v.scope like '" + scope + "%')";
}

var elementTypeAndScopeXmlTreeValidationErrorReport = function(elementType, scope) {

  return function(req, res) {
    var header = ["Feed", "Severity", "Scope", "Path", "ID", "Error Type", "Error Data"];
    var feedid = decodeURIComponent(req.params.feedid);

    conn.query(function(client) {
      res.header("Content-Disposition", "attachment; filename=" + csvFilename(feedid, elementType));
      res.setHeader('Content-type', 'text/csv');
      res.charset = 'UTF-8';

      res.write(makeCSVRow(header));

      var query = client.query(elementTypeAndScopeXmlTreeValidationQuery(elementType, scope), [feedid]);

      query.on("row", function(row, result) {
        res.write(makeCSVRow([feedid,
                              row.severity,
                              row.scope,
                              row.path,
                              row.identifier,
                              row.error_type,
                              row.error_data]));
      });

      query.on("end", function(result) {
        res.end();
      });
    });
  };
}

var scopedXmlTreeValidationErrorReport = function() {
  var elementTypes = Array.prototype.slice.call(arguments);

  return function(req, res) {
    var header = ["Feed", "Severity", "Scope", "Path", "ID", "Error Type", "Error Data"];
    var feedid = decodeURIComponent(req.params.feedid);

    conn.query(function(client) {
      res.header("Content-Disposition", "attachment; filename=" + csvFilename(feedid, elementTypes[0]));
      res.setHeader('Content-type', 'text/csv');
      res.charset = 'UTF-8';

      res.write(makeCSVRow(header));

      var query = client.query(scopedXmlTreeValidationQuery(elementTypes), [feedid]);

      query.on("row", function(row, result) {
        res.write(makeCSVRow([feedid,
                              row.severity,
                              row.scope,
                              row.path,
                              row.identifier,
                              row.error_type,
                              row.error_data]));
      });

      query.on("end", function(result) {
        res.end();
      });
    });
  };
}

var xmlTreeValidationErrorReport = function(req, res) {
  var header = ["Feed", "Severity", "Scope", "Path", "ID", "Error Type", "Error Data"];
  var feedid = decodeURIComponent(req.params.feedid);

  conn.query(function(client) {
    res.header("Content-Disposition", "attachment; filename=" + csvFilename(feedid));
    res.setHeader('Content-type', 'text/csv');
    res.charset = 'UTF-8';

    res.write(makeCSVRow(header));

    var query = client.query(xmlTreeValidationQuery, [feedid]);

    query.on("row", function(row, result) {
      res.write(makeCSVRow([feedid,
                            row.severity,
                            row.scope,
                            row.path,
                            row.identifier,
                            row.error_type,
                            row.error_data]));
    });

    query.on("end", function(result) {
      res.end();
    });
  });
}

var xmlTreeLocalityErrorReport = function(req, res) {
  var header = ["Feed", "Severity", "Scope", "Path", "ID", "Error Type", "Error Data"];
  var feedid = decodeURIComponent(req.params.feedid);
  var localityid = decodeURIComponent(req.params.localityId)
  conn.query(function(client) {

    res.header("Content-Disposition", "attachment; filename=" + csvFilename(feedid));
    res.setHeader('Content-type', 'text/csv');
    res.charset = 'UTF-8';

    res.write(makeCSVRow(header));

    var query = client.query('select * from v5_dashboard.locality_error_report($1, $2)', [feedid, localityid]);

    query.on("row", function(row, result) {
      res.write(makeCSVRow([feedid,
                            row.severity,
                            row.scope,
                            row.path,
                            row.identifier,
                            row.error_type,
                            row.error_data]));
    });

    query.on("end", function(result) {
      res.end();
    });
  });

}

var pollingLocationAddressReport = function(req, res) {
  var header = ["Locality Name", "Precinct Name", "Address Location Name", "Address Line 1", "Address Line 2", "Address Line 3", "Address City", "Address State",  "Address Zip", "Polling Location Id"];
  var feedid = decodeURIComponent(req.params.feedid);
  conn.query(function(client) {

    res.header("Content-Disposition", "attachment; filename=" + csvFilename(feedid, 'PollingLocationAddress'));
    res.setHeader('Content-type', 'text/csv');
    res.charset = 'UTF-8';

    res.write(makeCSVRow(header));

    var query = client.query('select * from v3_dashboard.polling_location_readable_report($1)', [feedid]);

    query.on("row", function(row, result) {
      res.write(makeCSVRow([row.locality_name,
                            row.precinct_name,
                            row.address_location_name,
                            row.address_line1,
                            row.address_line2,
                            row.address_line3,
                            row.address_city,
                            row.address_state,
                            row.address_zip,
                            row.polling_location_id]));
    });

    query.on("end", function(result) {
      res.end();
    });
  });
}

var earlyVoteSiteAddressReport = function(req, res) {
  var header = ["Locality Name", "Early Vote Site Name", "Address Location Name", "Address Line 1", "Address Line 2", "Address Line 3", "Address City", "Address State",  "Address Zip", "Polling Location Id"];
  var feedid = decodeURIComponent(req.params.feedid);
  conn.query(function(client) {

    res.header("Content-Disposition", "attachment; filename=" + csvFilename(feedid, 'EarlyVoteSiteAddress'));
    res.setHeader('Content-type', 'text/csv');
    res.charset = 'UTF-8';

    res.write(makeCSVRow(header));

    var query = client.query('select * from v3_dashboard.early_vote_location_address_report($1)', [feedid]);

    query.on("row", function(row, result) {
      res.write(makeCSVRow([row.locality_name,
                            row.early_vote_site_name,
                            row.address_location_name,
                            row.address_line1,
                            row.address_line2,
                            row.address_line3,
                            row.address_city,
                            row.address_state,
                            row.address_zip,
                            row.polling_location_id]));
    });

    query.on("end", function(result) {
      res.end();
    });
  });
}

module.exports = {
  xmlTreeLocalityErrorReport: xmlTreeLocalityErrorReport,
  errorReport: errorReport,
  fullErrorReport: errorReport("", "", []),
  scopedErrorReport: function(scope) {
    return errorReport("", "v.scope = '" + scope + "'", [], scope);
  },
  xmlTreeValidationErrorReport: xmlTreeValidationErrorReport,
  scopedXmlTreeValidationErrorReport: scopedXmlTreeValidationErrorReport,
  pollingLocationAddressReport: pollingLocationAddressReport,
  earlyVoteSiteAddressReport: earlyVoteSiteAddressReport,
  elementTypeAndScopeXmlTreeValidationErrorReport: elementTypeAndScopeXmlTreeValidationErrorReport
}


text:
package apiserver

import (
	"context"
	"fmt"
	"regexp"
	"time"

	g "github.com/onsi/ginkgo/v2"
	o "github.com/onsi/gomega"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/util/wait"
	"k8s.io/client-go/util/retry"
	"k8s.io/kubernetes/test/e2e/framework"
	admissionapi "k8s.io/pod-security-admission/api"

	configv1 "github.com/openshift/api/config/v1"

	exutil "github.com/openshift/origin/test/extended/util"
)

var _ = g.Describe("[Conformance][sig-api-machinery][Feature:APIServer] local kubeconfig", func() {
	defer g.GinkgoRecover()
	oc := exutil.NewCLIWithPodSecurityLevel("apiserver", admissionapi.LevelPrivileged)

	for _, kc := range []string{
		"localhost.kubeconfig",
		"lb-ext.kubeconfig",
		"lb-int.kubeconfig",
		"localhost-recovery.kubeconfig",
	} {
		kubeconfig := kc
		g.It(fmt.Sprintf("%q should be present on all masters and work [apigroup:config.openshift.io]", kubeconfig), func() {
			// external controlplane topology doesn't have master nodes
			controlPlaneTopology, err := exutil.GetControlPlaneTopology(oc)
			o.Expect(err).NotTo(o.HaveOccurred())
			if *controlPlaneTopology == configv1.ExternalTopologyMode {
				g.Skip("ExternalControlPlaneTopology doesn't have master node kubeconfigs")
			}

			masterNodes, err := oc.AdminKubeClient().CoreV1().Nodes().List(context.Background(), metav1.ListOptions{
				LabelSelector: `node-role.kubernetes.io/master`,
			})
			o.Expect(err).NotTo(o.HaveOccurred())
			framework.Logf("Discovered %d master nodes.", len(masterNodes.Items))
			o.Expect(masterNodes.Items).NotTo(o.HaveLen(0))
			for _, master := range masterNodes.Items {
				err := retry.OnError(
					wait.Backoff{
						Duration: 2 * time.Second,
						Steps:    3,
						Factor:   5.0,
						Jitter:   0.1,
					},
					func(err error) bool {
						// retry error when kube-apiserver was temporarily unavailable, this matches oc error coming from:
						// https://github.com/kubernetes/kubernetes/blob/cbb5ea8210596ada1efce7e7a271ca4217ae598e/staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go#L237-L243
						matched, _ := regexp.MatchString("The connection to the server .+ was refused - did you specify the right host or port", err.Error())
						return !matched
					},
					func() error {
						return testNode(oc, kubeconfig, master.Name)
					})
				o.Expect(err).NotTo(o.HaveOccurred())
			}
		})
	}
})

func testNode(oc *exutil.CLI, kubeconfig, masterName string) error {
	g.By("Testing master node " + masterName)
	kubeconfigPath := "/etc/kubernetes/static-pod-resources/kube-apiserver-certs/secrets/node-kubeconfigs/" + kubeconfig
	framework.Logf("Verifying kubeconfig %q on master %q", kubeconfig, masterName)
	out, err := oc.AsAdmin().Run("debug").Args("node/"+masterName, "--", "chroot", "/host", "/bin/bash", "-euxo", "pipefail", "-c",
		fmt.Sprintf(`oc --kubeconfig "%s" get namespace kube-system`, kubeconfigPath)).Output()
	framework.Logf(out)
	if err != nil {
		return fmt.Errorf(out)
	}
	return nil
}


text:
CnC Framework
=============

CnC Framework, version 1.1.x-dev

Released on YYYY-MM-DD

Some basic setup and usage instructions are included in this readme.
More detailed instructions, tutorials, and API documentation are
available online through our GitHub wiki:

https://github.com/habanero-rice/cnc-framework/wiki

Installation prerequisites
--------------------------

You will need the following utilities installed,
most of which should already be present on a standard Linux box:

* GNU make
* gcc or clang
* curl or wget
* python 2.6 or 2.7

You will also need one or more of the supported runtime backends:

* OCR 1.1
* Intel CnC

Setting up the environment for OCR
----------------------------------

If you have a copy of the xstack apps repository, the CnC root directory (which
contains this README) should be in the apps/hll directory. The expected
directory structure is as follows:

   - `xstg/` : the root xstack ("Traleika Glacier") project source directory
   - `xstg/ocr/` : the source root for OCR
   - `xstg/apps/` : the source root for xstack apps, libraries, etc
   - `xstg/apps/hll/` : high-level-languages for OCR
   - `xstg/apps/hll/cnc/` : CnC root directory

If you don't have a copy of the xstack repository, you can still mimic this
directory structure to get the expected behavior. To set the needed environment
variables, navigate to the CnC root directory and source `setup_env.sh`:

    source setup_env.sh

This script sets the `XSTG_ROOT` variable to point to the root xstack project
directory, `UCNC_ROOT` to point to the CnC root, and updates the `PATH` to
include the CnC `bin` directory (which contains the graph translator tool).

OCR is the current default backend runtime for the CnC framework.

Setting up the environment for iCnC
-----------------------------------

Intel CnC (iCnC) comes with its own environment setup script. Locate your iCnC
installation directory, and source the `bin/cncvars.sh` script:

    source /path/to/icnc/bin/cncvars.sh

Detailed installation instructions for iCnC can be found on its GitHub pages:

https://icnc.github.io/

You will also need to set up the environment variables for the CnC framework.
Navigate to the CnC root directory and source `setup_env.sh`:

    source setup_env.sh

This script sets the `UCNC_ROOT` to point to the CnC root, and updates the `PATH`
to include the CnC `bin` directory (which contains the graph translator tool).

To use the iCnC runtime with the CnC framework, you must explicitly specify a
platform when invoking the CnC translator tool:

    ucnc_t --platform=icnc

Verifying the installation
--------------------------

You can verify the installation by running the `$UCNC_ROOT/test/run_tests.sh`
script, or `$UCNC_ROOT/test/run_tests.sh --platform=icnc` if using iCnC.
The script builds, runs, and verifies the results of a few simple CnC
test programs. More interesting example applications can be found in the
`$UCNC_ROOT/examples` directory. Each example has an accompanying README with
instructions on how to build and run the application, a general explanation
of the program structure, and a sample of the expected output.

Creating CnC applications
-------------------------

1. For any CnC application, the first step is to create the CnC graph file
   (`GraphName.cnc`) which will define the steps and item collections, as
   well as the relations among them.

2. The second step is invoking the translator: `ucnc_t GraphName.cnc`

   This will generate a bunch of files. The files generated in the current
   directory should be edited by the application author. The files in the
   `cnc_support` directory interface the user code with the underlying OCR
   runtime and should not need any editing.

   Note that the first time you run the graph translator, it will download
   and install several Python dependencies, which will be saved in
   `${UCNC_ROOT}/py` for future reuse.

3. The third step is editing the code in the project directory to implement the
   graph's init, finalize, and step functions. Additionally, you may need to
   edit `cncMain` (in `Main.c`) to parse command-line arguments and pass them
   to the CnC graph when launched.

4. `make run WORKLOAD_ARGS="arg1 arg2 arg3 ..."`

See the examples (in the `$UCNC_ROOT/examples` directory) for sample code. For
more details on the CnC toolchain, API, workflow, etc., please refer to the
online documentation.

Further documentation and support
---------------------------------

For more in-depth documentation, please visit the CnC wiki on GitHub:

https://github.com/habanero-rice/cnc-framework/wiki

You can also report bugs and other issues on our GitHub page:

https://github.com/habanero-rice/cnc-framework

Acknowledgments
---------------

Partial support for CnC was provided through the CDSC program of
the National Science Foundation with an award in the 2009 Expedition
in Computing Program.

This work is actively supported as part of the DOE-funded Traleika Glacier
X-Stack project (Intel CS1924113).


text:
   /* dont use imports, use require, because errors are coming when we are dynamically using services in the base model*/
let uiTypes = require('../../utils/ui-types');
let authUtils = require('../../utils/auth');
let ObjectID = require('mongodb').ObjectID;

const collection = 'Trips';
module.exports = {
   type: 'form',
   requestType: 'get',
   schemaFields: ['quotes.quotetype', 'quotes.costPerTon', 'quotes.loadingPerTon', 'quotes.unloadingPerTon',
                'quotes.cost', 'quotes.comment', 'quotes.startDate', 'quotes.endDate', 'quotes.defaultQuoteForPeriod',
                  'quotes.payAllLater'], // pick fields configuration from default schema
   schemaOverrideFeilds: {

   },
   get: {
      preValidate: (serviceConfig, req, res, options, cb) => {//on init hook, will get executed on service request - init
         console.log('get prevalidate');
        /*  if (!req.params.id) {
            return cb('Invalid Request');//if error, return as first argument
         }  */
         return cb();
      },
      callback: (schema, serviceConfig, req, res, options, cb) => {//callback hook  - after serving the request - forms & grid
         console.log('get callback', req.params.id);
         const model = require('mongoose').model(collection);
           if (req.params.id) {
            cb(null, {
               data:  {
                  _id: req.params.id
               },
               schema: schema
            });
         } else {
            cb(null, schema);
         }
      }
   },
   post: {
      preValidate: (serviceConfig, req, res, options, cb) => { //on post - validate, will get executed on POST service request
         console.log('post prevalidate');
         /*  if (!req.body._id) {
            return cb('Invalid Request');//if error, return as first argument
         }  */
         return cb();
      },
      callback: (serviceConfig, req, res, options, cb) => { //callback hook  for post request
         console.log('post callback');
         const model = require('mongoose').model(collection);
         let data = req.body;
       /*   let tokenDetails = authUtils.decodeToken(req.headers);
         if (tokenDetails && tokenDetails.username && tokenDetails.role) {
            data.fromUser = tokenDetails.username;  //it should be an unique id
          //  data.quotes.userRole = tokenDetails.role;
         }
         data.itemId = new ObjectID(data.itemId); */

/*
         let tokenDetails = authUtils.decodeToken(req.headers);
         let comment = {
             date: new Date().toLocaleString(),
             commentedby: tokenDetails.username,
             comment: req.body.quotes[0].quote
          };
         data.$push = { comments: comment }; */
         console.log(data);
         data.status = 'Quoted';
         model.addOrEdit(data, null, cb);
      }
   }
};


text:
import warnings
from unittest import TestCase

from pytest import mark

from scrapy.utils.reactor import is_asyncio_reactor_installed, install_reactor

@mark.usefixtures('reactor_pytest')
class AsyncioTest(TestCase):

    def test_is_asyncio_reactor_installed(self):
        # the result should depend only on the pytest --reactor argument
        self.assertEqual(is_asyncio_reactor_installed(), self.reactor_pytest == 'asyncio')

    def test_install_asyncio_reactor(self):
        with warnings.catch_warnings(record=True) as w:
            install_reactor("twisted.internet.asyncioreactor.AsyncioSelectorReactor")
            self.assertEqual(len(w), 0)


text:
/**
 * CUserDao.java	2010/02/25
 */

package com.ycsoft.business.dao.core.user;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.ycsoft.beans.core.user.CUser;
import com.ycsoft.beans.core.user.CUserStb;
import com.ycsoft.beans.core.user.UserResExpDate;
import com.ycsoft.beans.system.SOptr;
import com.ycsoft.business.dto.core.bill.UserBillDto;
import com.ycsoft.business.dto.core.user.ChangedUser;
import com.ycsoft.business.dto.core.user.UserDto;
import com.ycsoft.commons.constants.StatusConstants;
import com.ycsoft.commons.constants.SystemConstants;
import com.ycsoft.commons.helper.CollectionHelper;
import com.ycsoft.commons.helper.StringHelper;
import com.ycsoft.daos.abstracts.BaseEntityDao;
import com.ycsoft.daos.core.JDBCException;
import com.ycsoft.daos.core.Pager;

/**
 * CUserDao -> C_USER table's operator
 */
@Component
public class CUserDao extends BaseEntityDao<CUser> {

	/**
	 *
	 */
	private static final long serialVersionUID = -4250480955592139362L;

	/**
	 * default empty constructor
	 */
	public CUserDao() {}

	public List<CUser> queryUserByDoneCode(Integer done_code)
			throws JDBCException {
		String sql = "SELECT u.* FROM c_done_code_detail d,c_user u WHERE u.user_id=d.user_id AND d.done_code=?";
		return createQuery(sql, done_code).list();
	}

	/**
	 * 欠费达一年及以上的用户
	 * @param countyId
	 * @param ownLongDays
	 * @return
	 * @throws Exception
	 */
	public List<CUser> queryOwnFeeUser(String countyId, String ownLongDays) throws Exception {
		/*String sql = "select distinct u.* from busi.c_prod cp,busi.c_user u"
			+ " where cp.user_id=u.user_id and u.status='ACTIVE' and cp.county_id=u.county_id and cp.county='9005'"
			+ " and cp.prod_id in (select pp.prod_id from busi.p_prod pp where pp.is_base = 'T' and pp.serv_id in ('DTV', 'ATV'))"
			+ " and cp.package_sn is null and cp.status = 'OWESTOP' and cp.status_date < sysdate - 365"
			+ " and not exists"
			+ " (select 1 from busi.c_prod cp1"
			+ " where cp.user_id = cp1.user_id"
			+ " and cp.county_id = cp1.county_id"
			+ " and cp1.prod_id in (select pp.prod_id from busi.p_prod pp where pp.is_base = 'T' and pp.serv_id in ('DTV', 'ATV'))"
			+ " and cp1.prod_sn <> cp.prod_sn"
			+ " and (cp1.status <> 'OWESTOP' or (cp1.status = 'OWESTOP' and cp1.status_date >= sysdate - 365)))";*/
		//当一个数字或者模拟用户的基本包状态是欠费停,且状态变更日期+一年<=当天时,
		//如果不存在相同用户下其他基本包,产品状态是(非欠费停  或者  产品状态欠费停状态变更日期+一年>当天)时,则 该用户为长期欠费用户
		String sql = "select distinct u.* from c_prod cp,c_user u"
			+ " where cp.user_id=u.user_id and u.status=? and cp.county_id=u.county_id and cp.county_id=?"
			+ " and cp.prod_id in (select pp.prod_id from p_prod pp where pp.is_base=? and pp.serv_id in (?,?))"
			+ " and cp.package_sn is null and cp.status=? and cp.status_date < sysdate - ?"
			+ " and not exists"
			+ " (select 1 from c_prod cp1"
			+ " where cp.user_id = cp1.user_id"
			+ " and cp.county_id = cp1.county_id"
			+ " and cp1.prod_id in (select pp.prod_id from p_prod pp where pp.is_base=? and pp.serv_id in (?,?))"
			+ " and cp1.prod_sn <> cp.prod_sn"
			+ " and (cp1.status <> ? or (cp1.status = ? and cp1.status_date >= sysdate - ?))) and rownum <= 1000";
		return this.createQuery(sql, StatusConstants.ACTIVE, countyId,
				SystemConstants.BOOLEAN_TRUE, SystemConstants.PROD_SERV_ID_ATV,
				SystemConstants.PROD_SERV_ID_DTV, StatusConstants.OWESTOP,ownLongDays,
				SystemConstants.BOOLEAN_TRUE, SystemConstants.PROD_SERV_ID_ATV,
				SystemConstants.PROD_SERV_ID_DTV, StatusConstants.OWESTOP,
				StatusConstants.OWESTOP,ownLongDays).list();
	}

	/**
	 * @param custId
	 * @param county_id
	 * @return
	 */
	public List<CUser> queryUserFullInfo(Pager<Map<String ,Object>> p, String county_id) throws Exception{
		return null;
	}

	/**
	 * 用户转户
	 * @param userId 用户ID
	 * @param targetCustId 目标客户
	 * @throws JDBCException
	 */
	public void transferUser( String[] userId, String targetCustId) throws JDBCException{
		String sql = "update c_user cu set cu.cust_id = '"+ targetCustId + "' where cu.user_id = ?";
		this.executeBatch(sql, userId);
	}
	/**
	 * 根据客户ID查询用户
	 * @param custId
	 * @return
	 */
	public List<CUser> queryUserByCustId(String custId) throws JDBCException {
		if (custId == null) return new ArrayList<CUser>();

		String sql = "select * from c_user where cust_id=?";
		return createQuery(sql, custId).list();
	}
	/**
	 * 查询有加挂杂费的用户
	 * @param custId
	 * @return
	 * @throws JDBCException
	 */
	public List<CUser> queryUserByIpAddressFee(String custId)  throws JDBCException {
		String sql = "select * from c_user  where str5 in (select fee_id from t_busi_fee) and str6<>'0' and cust_id=? ";
		return createQuery(sql, custId).list();
	}
	/**
	 * 查询正常和施工中的用户清单
	 * @param custId
	 * @return
	 * @throws JDBCException
	 */
	public List<CUser> queryCanSelectUserByCustId(String custId) throws JDBCException {
		if (custId == null) return new ArrayList<CUser>();

		String sql = "select * from c_user where cust_id=? and status in (?,?)";
		return createQuery(sql, custId,StatusConstants.ACTIVE,StatusConstants.INSTALL).list();
	}

	/**
	 * 根据客户ID查询正常用户,类型
	 * @param custId 客户id
	 * @param userType 用户类型 SystemConstants.USER_TYPE_*
	 * @return
	 */
	public List<CUser> queryUserByCustId(String custId,String userType) throws JDBCException {
		if (custId == null) return new ArrayList<CUser>();

		String sql = "select * from c_user where cust_id=? and user_type=? and status=?";
		return createQuery(sql, custId,userType,StatusConstants.ACTIVE).list();
	}

	/**
	 * 根据客户编号查询用户
	 * @param custNo
	 * @return
	 * @throws JDBCException
	 */
	public List<CUser> queryUserByCustNo(String custNo) throws JDBCException {
		String sql = "select u.* from c_user u,c_cust c where u.cust_id=c.cust_id and c.cust_no=?";
		return createQuery(sql, custNo).list();
	}

	/**
	 * 根据机顶盒号查询用户
	 *
	 * @param stbId
	 * @return
	 */
	public List<CUser> queryUserByStbId(String stbId)
			throws JDBCException {
		String sql = "select * from c_user where stb_id=?";
		return createQuery(sql, stbId).list();
	}

	/**
	 * 根据智能卡号查询用户
	 *
	 * @return
	 */
	public List<CUser> queryUserByCardId(String cardId) throws JDBCException {
		String sql = "select * from c_user where card_id=?";
		return createQuery(sql, cardId).list();
	}

	/**
	 * 根据modem mac查询用户
	 * @return
	 */
	public List<CUser> queryUserByModemId(String modemMac) throws JDBCException {
		String sql = "select * from c_user where modem_mac=?";
		return createQuery(sql, modemMac).list();
	}

	/**
	 * 更新设备
	 * @param userId
	 * @param stbId
	 * @param cardId
	 * @param modemMac
	 * @throws JDBCException
	 */
	public void updateDevice(String userId,String stbId,String cardId,String modemMac) throws JDBCException {
		CUser user = new CUser();
		user.setUser_id(userId);
		user.setStb_id(stbId);
		user.setCard_id(cardId);
		user.setModem_mac(modemMac);
		update(user);
	}

	/**
	 * 用户是客户的第几个用户
	 * @param user_id
	 * @return
	 * @throws JDBCException
	 */
	public Integer queryUserSequence(String custId, String userId) throws JDBCException {
		String sql = "SELECT se FROM (SELECT u.*,ROWNUM se FROM c_user u WHERE u.cust_id=? ORDER BY u.open_time ) t WHERE t.user_id=? ";
		String seq = findUnique(sql, custId, userId);
		return seq==null?0:Integer.parseInt(seq);
	}

	public List<CUserStb> queryUserStbByCustId(String custId) throws JDBCException {
		String sql ="select a.*,d.buy_mode,d.buy_time,nvl(b.real_pay,0) buy_fee,definition_type stb_definition_type,d.change_reason,s.device_model "+
					"  from c_user a,  c_fee b,  c_fee_device c,c_cust_device d,r_stb s,r_stb_model sm "+
					" where a.stb_id = c.device_code(+) and a.stb_id=s.stb_id(+) and s.device_model=sm.device_model(+)"+
					"   and c.fee_sn = b.fee_sn(+) "+
					"   and a.stb_id=d.device_code" +
					"   and a.cust_id=? and d.cust_id= ? ";
		return createQuery(CUserStb.class, sql, custId,custId).list();
	}
	public CUserStb queryUserStbByUserId(String userId) throws JDBCException {
		String sql ="select a.*,d.buy_mode,d.buy_time,nvl(b.real_pay,0) buy_fee,definition_type stb_definition_type,d.change_reason,s.device_model "+
					"  from c_user a,  c_fee b,  c_fee_device c,c_cust_device d,r_stb s,r_stb_model sm "+
					" where a.stb_id = c.device_code(+) and a.stb_id=s.stb_id(+) and s.device_model=sm.device_model(+)"+
					"   and c.fee_sn = b.fee_sn(+) "+
					"   and a.stb_id=d.device_code" +
					"   and a.user_id=?";
		return createQuery(CUserStb.class, sql, userId).first();
	}

	//模拟剪线
	public void saveAtvCustLine(String userId, String countyId) throws Exception {
		String sql = "update c_user t set t.status=? where t.user_id=? and t.county_id=?";
		this.executeUpdate(sql, StatusConstants.REQSTOP, userId, countyId);
	}

	public List<ChangedUser> queryChangedUserInfo(String countyId) throws JDBCException {
		String sql = StringHelper.append("select t1.card_id,t2.cust_name,t2.address,t3.mobile,to_char(t1.open_time,'yyyy-mm-dd') change_time,",
			" case when t3.cert_type='SFZ' then t3.cert_num else '' end id_num,",
			" t1.area_id,t1.county_id from c_user t1,c_cust t2,c_cust_linkman t3",
			" where t1.cust_id=t2.cust_id and t1.cust_id=t3.cust_id and t1.county_id=? and t1.card_id is not null order by t1.open_time");
		return createQuery(ChangedUser.class, sql, countyId).list();
	}

	/**
	 * 查询开始日期到今天之前的销户用户
	 * @param beginDate
	 * @param countyId
	 * @return
	 * @throws JDBCException
	 */
	public List<ChangedUser> queryDeletedUsers(String beginDate,String endDate, String countyId) throws JDBCException {
		String sql = StringHelper.append("select t1.user_id, c.user_id, c.card_id,to_char(c.done_date,'yyyy-mm-dd hh24:mi:ss') change_time,'DELETE' data_type from c_user_his c where c.card_id is not null",
				" and c.county_id=? and c.done_date > to_date(?,'yyyy-mm-dd') and c.done_date < to_date(?,'yyyy-mm-dd')");
		return createQuery(ChangedUser.class, sql, countyId,beginDate,endDate).list();
	}

	/**
	 * 查询开始日期到今天之前的修改用户
	 * @param beginDate
	 * @param countyId
	 * @return
	 * @throws JDBCException
	 */
	public List<ChangedUser> queryModifiedUsers(String beginDate,String endDate,
			String countyId) throws JDBCException {
		String sql = StringHelper.append("select * from (select * from( " ,
		" select t1.user_id, 'UPDATE' data_type, t1.card_id,t2.cust_name,t2.address,t3.mobile,t4.old_value old_card_id,to_char(t4.change_time,'yyyy-mm-dd hh24:mi:ss') change_time, ",
		" case when t3.cert_type = 'SFZ' then t3.cert_num else '' end id_num,t1.area_id,t1.county_id",
		" from c_user t1, c_cust t2, c_cust_linkman t3,c_user_prop_change t4 where t1.cust_id = t2.cust_id",
		" and t1.cust_id = t3.cust_id and t1.card_id is not null and t1.user_id=t4.user_id",
		" and t4.column_name='card_id'  and t1.county_id = :countyId and t4.change_time > to_date(:beginDate,'yyyy-mm-dd') ",
		" and t4.change_time < to_date(:endDate,'yyyy-mm-dd')",
		" union",
		" select t1.user_id, 'UPDATE' data_type,  t1.card_id,t2.cust_name,t2.address,t3.mobile,'' old_card_id,to_char(t4.change_time,'yyyy-mm-dd hh24:mi:ss') change_time, ",
		" case when t3.cert_type = 'SFZ' then t3.cert_num else ''end id_num,t1.area_id,t1.county_id",
		" from c_user t1, c_cust t2, c_cust_linkman t3,c_cust_prop_change t4 where t1.cust_id = t2.cust_id",
		" and t1.cust_id = t3.cust_id and t1.card_id is not null and t1.cust_id=t4.cust_id",
		" and (t4.column_name='address' or t4.column_name='cust_name' or t4.column_name='mobile')",
		" and t1.county_id = :countyId and t4.change_time > to_date(:beginDate,'yyyy-mm-dd') and t4.change_time < to_date(:endDate,'yyyy-mm-dd')" ,
		" union " ,
		" select c.user_id, 'DELETE' data_type,c.card_id,'' cust_name, '' address ,'' mobile, '' old_card_id," ,
		" to_char(c.done_date,'yyyy-mm-dd hh24:mi:ss') change_time,'' id_num,'' area_id,'' county_id " ,
		" from c_user_his c where c.card_id is not null",
		" and c.county_id=:countyId and c.done_date > to_date(:beginDate,'yyyy-mm-dd') and c.done_date < to_date(:endDate,'yyyy-mm-dd')",
		" union ",
		" select t1.user_id, 'ADD' data_type, t1.card_id,t2.cust_name,t2.address,t3.mobile,'' old_card_id,to_char(t1.open_time,'yyyy-mm-dd hh24:mi:ss') change_time,",
		" case when t3.cert_type='SFZ' then t3.cert_num else '' end id_num,",
		" t1.area_id,t1.county_id from c_user t1,c_cust t2,c_cust_linkman t3",
		" where t1.cust_id=t2.cust_id and t1.cust_id=t3.cust_id and t1.card_id is not null and t1.county_id=:countyId" ,
		" and t1.open_time>to_date(:beginDate,'yyyy-mm-dd') and t1.open_time<to_date(:endDate,'yyyy-mm-dd')",
		") a order by a.change_time) where rownum < 10000");

		Map<String,Serializable> params = new HashMap<String, Serializable>();
		params.put("countyId", countyId);
		params.put("beginDate", beginDate);
		params.put("endDate", endDate);

		return createNameQuery(ChangedUser.class, sql, params).list();
	}

	/**
	 * 查询开始日期到今天之前的新增用户
	 * @param beginDate
	 * @param countyId
	 * @return
	 * @throws JDBCException
	 * @throws JDBCException
	 */
	public List<ChangedUser> queryAddedUsers(String beginDate,String endDate, String countyId) throws JDBCException {
		String sql = StringHelper.append("select t1.user_id, 'ADD' data_type, t1.card_id,t2.cust_name,t2.address,t3.mobile,to_char(t1.open_time,'yyyy-mm-dd hh24:mi:ss') change_time,",
				" case when t3.cert_type='SFZ' then t3.cert_num else '' end id_num,",
				" t1.area_id,t1.county_id from c_user t1,c_cust t2,c_cust_linkman t3",
				" where t1.cust_id=t2.cust_id and t1.cust_id=t3.cust_id and t1.card_id is not null and t1.county_id=?" ,
				" and t1.open_time>to_date(?,'yyyy-mm-dd') and t1.open_time<to_date(?,'yyyy-mm-dd') order by t1.open_time");
		return createQuery(ChangedUser.class, sql, countyId,beginDate,endDate).list();
	}

	/**
	 * 查询用户消费清单,包括VOD点播记录和电视营业厅付费记录
	 * @param deviceId
	 * @param returnTvRecordCount
	 * @param returnVodRecordCount
	 * @param countyId
	 * @return
	 * @throws JDBCException
	 */
	public List<UserBillDto> queryUserBill(String deviceId,
			Integer returnTvRecordCount, Integer returnVodRecordCount, String countyId) throws JDBCException {
		//最多返回各1万条
		if(returnTvRecordCount == -1){
			returnTvRecordCount = 10000;
		}
		if(returnVodRecordCount == -1){
			returnVodRecordCount = 10000;
		}

		String sql = StringHelper.append(" select * from ( select * from (select c.prog_name prod_name , 'VOD' prod_type ,c.fee,to_char(fee_time,'yyyy-mm-dd hh24:mi:ss') fee_time",
				" from c_acct_pre_fee c, c_user u where  c.user_id = u.user_id and c.is_valid = 'T' and c.process_flag = 2 ",
          		" and c.status = 'T' AND c.ticket_sn is not null and u.card_id =? and u.county_id=? order by c.done_code desc) a  where rownum <= ?",
          		" union ",
          		" select * from ",
          		" (select t3.prod_name,'TV' prod_type,t.fee ,to_char(t.order_date,'yyyy-mm-dd hh24:mi:ss') fee_time from tv_order t,c_user t2,p_prod t3",
          		"  where t.user_id=t2.user_id and t.prod_id=t3.prod_id and t2.card_id=? and t2.county_id=?  order by t.order_date desc)",
          		" where rownum <= ? ) order by fee_time desc");

		return createQuery(UserBillDto.class, sql, deviceId,countyId,returnVodRecordCount,
					deviceId,countyId,returnTvRecordCount).list();
	}

	public List<CUser> queryUserByUserIds(String[] userIds) throws JDBCException {
		String sql = "SELECT * FROM c_user where "+getSqlGenerator().setWhereInArray("user_id",userIds)+"";
		return createQuery(sql).list();
	}

	public void batchLogoffUser(Integer doneCode,String remark,List<String> userIds,String isReclaimDevice,String deviceStatus, SOptr optr) throws Exception {
		for(String userId :userIds){
			if (StringHelper.isNotEmpty(userId))
			this.getJdbcTemplate().execute("call proc_del_user('"+userId+"', '"+isReclaimDevice+"', '"+deviceStatus+"','"+doneCode+"'," +
					"'"+optr.getOptr_id()+"',"+optr.getCounty_id()+",'"+optr.getArea_id()+"','"+optr.getDept_id()+"','"+remark+"')");
		}

	}

	public List<CUser> queryUserByCustIds(String[] custIds) throws JDBCException {
		String sql = "SELECT * FROM c_user where "+getSqlGenerator().setWhereInArray("cust_id",custIds)+"";
		return createQuery(sql).list();
	}

	public Pager<UserDto> queryUserInfoToCallCenter(Pager<Map<String ,Object>> p, String countyId) throws Exception{
		String cond = "", brandCond = "";
		boolean flag = false;
		Iterator<String> it = p.getParams().keySet().iterator();
		while(it.hasNext()){
			String key = String.valueOf(it.next());
			String value  = p.getParams().get(key).toString();
			if("USER_ID".equals(key)){
				cond += " and u.user_id='"+value+"'";
			}
			if("CUST_NO".equals(key)){
				cond += " and u.cust_id = (select cust_id from c_cust where cust_no='"+value+"' and county_id='"+countyId+"')";
			}
			if("CUST_ID".equals(key)){
				cond += " and u.cust_id='"+value+"'";
			}
			if("CARD_ID".equals(key)){
				cond += " and u.card_id='"+value+"'";
			}
			if("STB_ID".equals(key)){
				cond += " and u.stb_id='"+value+"'";
			}
			if("MODEM_MAC".equals(key)){
				cond += " and u.modem_mac='"+value+"'";
			}
			if("BROAD_NAME".equals(key)){
				flag = true;
				brandCond = " and b.login_name='" + value + "'";
			}
		}
		String sql = "";
		if(flag){
			sql = "select u.*,'' terminal_type,'' serv_type,b.login_name,b.check_type,b.max_connection"
				+ " from c_user u,c_user_broadband b where u.user_id=b.user_id and u.county_id=?" + cond + brandCond;
		}else{
			sql = "select u.*,a.terminal_type,a.serv_type,'' login_name,'' check_type,0 max_connection"
				+ " from c_user u,c_user_atv a where u.user_id=a.user_id and u.county_id='"+countyId+"'" + cond
				+ " union all "
				+ "select u.*,'' terminal_type,'' serv_type,b.login_name,b.check_type,b.max_connection"
				+ " from c_user u,c_user_broadband b where u.user_id=b.user_id and u.county_id='"+countyId+"'" + cond
				+ " union all "
				+ "select u.*,d.terminal_type,d.serv_type,'' login_name,'' check_type,0 max_connection"
				+ " from c_user u,c_user_dtv d where u.user_id=d.user_id and u.county_id=?" + cond;
		}
		return this.createQuery(UserDto.class, sql, countyId).setStart(
				p.getStart()).setLimit(p.getLimit()).page();
	}

	public void updateProdInclude(String oldUserId,String oldCustId,String newUserId,String newCustId) throws Exception {
		String sql = "update c_prod_include set user_id=?,cust_id=? where user_id=? and cust_id=?";
		this.executeUpdate(sql, newUserId, newCustId, oldUserId, oldCustId);
	}

	public void updateAcctId(String userId, String acctId) throws Exception {
		String sql = "update c_user set acct_id=? where user_id=?";
		this.executeUpdate(sql, acctId, userId);
	}
	public String queryMinUserId(String custId) throws Exception {
		final String sql = "select min(user_id) user_id from c_user where cust_id =?";
		return this.createQuery(sql, custId).list().get(0).getUser_id();
	}

	public Integer queryUserCount(String custId) throws Exception {
		String sql = "select count(1) from c_user where cust_id =?";
		return Integer.parseInt(findUnique(sql, custId));
	}
	public void callChangeCust(String userId, String toCustId,Integer doneCode ,String busiCode,SOptr optr){
		this.getJdbcTemplate().execute("call proc_user_change_cust('"+userId+"','"+toCustId+"',"+doneCode+",'"+busiCode+"','"+optr.getOptr_id()+"','"+optr.getDept_id()+"')");
	}

	/**
	 * 查找客户名下不同用户类型的用户数
	 * 状态为:正常或者install的用户
	 */

	public Map<String,Integer> queryUserCountGroupByType(String custId) throws Exception {
		Map<String,Integer> userCountMap = new HashMap<>();
		final String sql = "select user_type,count(1) count from c_user "
				+ "where cust_id =? and status in ('ACTIVE','INSTALL') "
				+ "group by user_type";
		List<Object[]> userTypeList= this.createSQLQuery(sql, custId).list();
		if (CollectionHelper.isNotEmpty(userTypeList)){
			for (Object[] obj:userTypeList){
				userCountMap.put(obj[0].toString(), Integer.parseInt(obj[1].toString()));
			}
		}
		return userCountMap;
	}

	/**
	 * 查找一个用户下所有有效资源的到期日(产品状态是开通状态的)
	 */
	public List<UserResExpDate> queryUserProdResExpDate(String userId) throws Exception{
		String sql =
				StringHelper.append("select c.external_res_id res_id,exp_date ",
						" from c_prod_order a,p_prod_static_res b,t_server_res c ,t_prod_status_openstop op ",
				        " where a.status=op.status_id and  op.open_or_stop=1 ",
				        " and  b.res_id= c.boss_res_id and a.prod_id=b.prod_id ",
				        " and a.user_id=? and a.exp_date>=trunc(sysdate) ");
		return this.createQuery(UserResExpDate.class, sql, userId).list();
	}

	public boolean validAccount(String name) throws Exception {
		String sql = "select count(1) from c_user t where t.login_name=?";
		return this.count(sql, name) > 0;
	}

	public List<String> queryLoginNameByUserType(String custId, String userType) throws Exception {
		String sql = "select t.login_name from c_user t where t.cust_id=? and t.user_type=? and t.login_name is not null"
				+ " union all"
				+ " select t.login_name from c_user_his t where t.cust_id=? and t.user_type=? and t.login_name is not null";
		if(!userType.equals(SystemConstants.USER_TYPE_BAND)){
			sql = "select t.login_name from c_user t where t.cust_id=? and t.user_type in (?,?) and t.login_name is not null"
					+ " union all"
					+ " select t.login_name from c_user_his t where t.cust_id=? and t.user_type in (?,?) and t.login_name is not null";
			return this.findUniques(sql, custId, SystemConstants.USER_TYPE_OTT, SystemConstants.USER_TYPE_OTT_MOBILE,
					custId, SystemConstants.USER_TYPE_OTT, SystemConstants.USER_TYPE_OTT_MOBILE);
		}else{
			return this.findUniques(sql, custId, userType, custId, userType);
		}

	}

	/**
	 * 通过账户查用户
	 * @param loginName
	 * @return
	 * @throws JDBCException
	 */
	public CUser queryUserByLoginName(String loginName) throws JDBCException{
		String sql="select * from c_user where login_name=? ";
		return this.createQuery(sql, loginName).first();
	}

	public int countLikeLoginName(String loginNamePrefix) throws Exception {
		String sql = "select count(1) from c_user where login_name like ?";
		return this.count(sql, loginNamePrefix+"%");
	}

	public int updateUserNameByDeviceCode(CUser user,String custId) throws JDBCException {
		String sql = "update c_user set user_name=? where cust_id=? and ( stb_id=? or card_id=? or modem_mac=? )";
		String deviceCode = user.getStb_id();
		int executeUpdate = executeUpdate(sql, user.getUser_name(),custId,deviceCode,deviceCode,deviceCode);
		return executeUpdate;
	}

	public List<CUser> queryTaskUser(String taskId) throws JDBCException {
		String sql = "select * from c_user a,w_task_user b where a.user_id = b.user_id and b.task_id =?";
		return this.createQuery(sql, taskId).list();
	}

	public CUser queryUserByDeviceCode(String DeviceCode) throws JDBCException{
		String sql="select * from c_user where  stb_id=? or card_id=? or modem_mac=? ";
		return this.createQuery(sql, DeviceCode,DeviceCode,DeviceCode).first();
	}

}


text:
#ifndef ICMPTUNNEL_OPTIONS_H
#define ICMPTUNNEL_OPTIONS_H

struct options
{
    /* interval between keep-alive packets. */
    int keepalive;

    /* number of retries before timing out. */
    int retries;

    /* tunnel mtu. */
    int mtu;

    /* enable windows ping emulation. */
    int emulation;

    /* run as a daemon. */
    int daemon;
};

#endif


text:
package binauld.pierre.musictag.item.impl;

import org.apache.commons.lang3.StringUtils;

import java.io.File;

import binauld.pierre.musictag.item.AudioFile;
import binauld.pierre.musictag.visitor.ItemVisitor;
import binauld.pierre.musictag.tag.Id3Tag;
import binauld.pierre.musictag.tag.SupportedTag;

public class AudioFileImpl extends DecoderItem implements AudioFile {

    private Id3Tag id3Tag;
    private File file;

    private String primaryInformation;
    private String secondaryInformation;

    public AudioFileImpl(File file, Id3Tag id3Tag) {
        this.file = file;
        this.setId3Tag(id3Tag);
    }

    @Override
    public String getPrimaryInformation() {
        return primaryInformation;
    }

    @Override
    public String getSecondaryInformation() {
        return secondaryInformation;
    }

    @Override
    public void accept(ItemVisitor visitor) {
        visitor.visit(this);
    }

    @Override
    public Id3Tag getId3Tag() {
        return id3Tag;
    }

    @Override
    public void setId3Tag(Id3Tag id3Tag) {
        this.id3Tag = id3Tag;

        this.primaryInformation = this.id3Tag.get(SupportedTag.TITLE);
        if(StringUtils.isBlank(primaryInformation)) {
            primaryInformation = file.getName();
        }

        this.secondaryInformation = this.id3Tag.get(SupportedTag.ARTIST);
    }

    @Override
    public File getFile() {
        return file;
    }

    public void setFile(File file) {
        this.file = file;
    }
}