text:
<md-dialog aria-label="Consent" ng-cloak>
  <form>
    <md-toolbar>

Consent to Participate in Study

    </md-toolbar>
    <md-dialog-content ng-cloak>

The following information is provided to inform you about the research project and your participation in
          it. Please read this form carefully. You have the opportunity to ask any questions you may have about this study
          and the information given below by contacting study personnel (see contact information below). You are
          welcome to print or save a copy of this information for your future reference.

Your participation in this research study is voluntary. You are also free to withdraw from this study at
          any time. Refusal to participate will involve no penalty or loss of benefits to which you are otherwise
          entitled, and you may discontinue participation at any time without penalty or loss of benefits to which you are
          otherwise entitled. In the event new information becomes available that may affect the risks or benefits
          associated with this research study or your willingness to participate in it, you will be notified so that
          you can make an informed decision whether or not to continue your participation in this study.

Purpose of the study:

The purpose of the study is to evaluate the utility of new user centered design software in collecting
          feedback on software user interface design to support user-centered design. This new software is being
          compared with the current standard for user-centered design, which are participatory design workshops.

You are being asked to participate in a research study because you are a NICU provider, and the example
          application is to help design an EHR-integrated neonatal service handoff list.

Procedures to be followed and approximate duration of the study:

You have been randomized to participate by using the new design software. Using the
          software, you will engage in designing and customizing a neonatal handoff document.

Prior to the session, you will be asked to complete a demographics survey and provide information about
          your
          role requirements. Following the session, we will ask you to complete a short post-activity survey to
          evaluate
          the usability of the process.

For this activity, imagine you are giving or receiving a printed neonatal service list handoff document
          prior
          to covering the intensive care unit overnight. You will be covering the service in your normal role with
          your
          normal support team present as well. You will be presented with a list of hypothetical neonatal patients who
          represent various neonatal conditions. Initially, only the patient name will be visible. As you select
          additional patient information, it will begin to populate the patient list accordingly. You will also be
          able
          to customize how that data is displayed. Once you have the handoff document customized to your preferences,
          click on the save and submit button to send your customizations to the design team.

The goal of this activity is for you to be able to share your specific preferences with a design team who
          is
          creating an EHR-integrated neonatal handoff tool. We will aggregate your individual submission with data
          from
          other neonatal providers to help determine how to create a neonatal handoff document that best supports you
          with the information and format you need to fulfill your specific role.

The estimated time required for participation using this new software is 10-30 minutes, although you may
          take
          as much time as you wish. You may also use the link in your email to return to the software to update or
          complete your selections at a future date.

Expected costs:

There are no expected monetary costs to you for participating in this study. The only cost to you will be
          the
          time required to complete your entry.

Description of the discomforts, inconveniences, and/or risks that can be reasonably expected as a result
          of
          participation in this study:

The risks to you are minimal. This study poses no direct medical risks to you. No invasive testing or
          procedures will be conducted. The research team will make every effort to protect your privacy. You have the
          option to withdraw from the study at any time.

Compensation in case of study-related injury:

If it is determined by Vanderbilt and the Investigator that an injury occurred as a direct result of the
          tests or treatments that are done for research, then you and/or your insurance will not have to pay for the
          cost of immediate medical care provided at Vanderbilt to treat the injury.

There are no plans for Vanderbilt to pay for the costs of any additional care. There are no plans for
          Vanderbilt to give you money for the injury.

Good effects that might result from this study:

The benefits to science and humankind that might result from this study.

The results of this study may assist patients and healthcare providers by better informing how to design
            and evaluate medical software that is used for clinical care. There may be no direct benefits to
            participants.

The benefits you might get from being in this study.

The specific data from the use case in this study may be used to help design a NICU patient handoff list,
            which could potentially be used by participants in this study.

Compensation for participation:

There will not be specific compensation for participation.

Circumstances under which the Principal Investigator may withdraw you from study participation:

The Principal Investigator may withdraw you from the study if you express interest in discontinuing
          participation in the study.

What happens if you choose to withdraw from study participation:

You may choose to withdraw from the study at any time. Nothing will happen to you if you withdraw from the
          study. If you choose not to submit your neonatal handoff to the design team, no data from your design will
          be
          used in the final analysis. If you choose not to participate in the study or to discontinue participation
          early, this decision will not affect the result of this study.

Contact Information.

If you should have any questions about this research study or possibly injury, please feel free to contact Dr.
          Kevin Dufendach at (615)-... or another member of the study team, Dr.
          Christoph Lehmann at (615)-... or Dr.
          Kim Unertl at (615)-....

For additional information about giving consent or your rights as a participant in this study, to discuss
          problems, concerns, and questions, or to offer input, please feel free to contact the Vanderbilt University
          Institutional Review Board Office at (615) 322-2918 or toll free at (866) 224-8273.

Confidentiality:

All efforts, within reason, will be made to keep your personal information in your research record
          confidential but total confidentiality cannot be guaranteed. Your submission will be recorded and stored
          using
          an anonymous ID that is not linked to your email address or other identifying information. Study personnel
          will not attempt to reidentify any individuals.

Privacy:

Your information may be shared with Vanderbilt or the government, such as the Vanderbilt University
          Institutional Review Board, Federal Government Office for Human Research Protections, if you or someone else
          is in danger or if we are required to do so by law.

STATEMENT BY PERSON AGREEING TO PARTICIPATE IN THIS STUDY

I have read this informed consent document and I understand that I have the opportunity to ask any
          questions of the study personnel. I freely and voluntarily choose to participate.

    </md-dialog-content>
    <md-dialog-actions layout="row" layout-align="center center">
      <md-button ng-click="answer('accept')">
        Agree and continue
      </md-button>
      <md-button ng-click="answer('decline')">
        disagree and withdraw from study
      </md-button>
    </md-dialog-actions>
  </form>
</md-dialog>


text:
namespace PaintsNow {
	class StandardLightingTextureEncodedFS : public TReflected<StandardLightingTextureEncodedFS, IShader> {
	public:
		StandardLightingTextureEncodedFS();
		TObject<IReflect>& operator () (IReflect& reflect) override;
		String GetShaderText() override;

		BindTexture lightTexture;
		BindTexture specTexture;
		BindBuffer lightInfoBuffer;
		BindBuffer paramBuffer;

		Float3 screenSpaceColor;
		Float3 viewPosition;
		Float3 viewNormal;
		Float3 baseColor;
		float metallic;
		float roughness;
		float occlusion;
		float shadow;

		enum { MAX_LIGHT_COUNT = 64 };
		std::vector<Float4> lightInfos; // position & color
		uint32_t lightCount;
		MatrixFloat4x4 invWorldNormalMatrix;
		float cubeLevelInv;
		float cubeStrength;

		Float2 rasterCoord; // imported
		Float4 mainColor; // target
	};
}

redpajama_set_name: RedPajamaGithub


text:
/* global JSONFormatter: true, describe: true, it: true, expect:true */
describe('JSONFormatter', function() {
	'use strict';

	/**
	 *  Execute a series of tests
	 */
	function series(description, list, debug) {
		describe(description, function() {
			var json = new JSONFormatter();

			list.forEach(function(item) {
				var title = 'interprets ' + JSON.stringify(item.data) + ' as ' + JSON.stringify(item.expect);

				it(title, function(done) {
					if (debug) {
						console.log(JSON.stringify(json.ast(item.data), null, 2));
					}
					expect(json.prepare(item.data)).toBe(JSON.stringify(item.expect));
					expect(json.parse(item.data)).toEqual(item.expect);

					done();
				});
			});
		});
	}

	it('ignores non-string values', function() {
		var json = new JSONFormatter();

		[1, Math.PI, true, false, [], {}, [1,'a'], {a: 1}].forEach(function(v) {
			expect(json.prepare(v)).toBe('');
			expect(json.parse(v)).toBe(null);
		});
	});

	describe('handles various notations', function() {
		series('parses proper JSON syntax', [
			{data: 'null', expect: null},
			{data: 'true', expect: true},
			{data: '\'true\'', expect: 'true'},
			{data: '"true"', expect: 'true'},
			{data: 'false', expect: false},

			// {data: '\'false\'', expect: 'false'},
			{data: '"false"', expect: 'false'},
			{data: 'hello', expect: 'hello'},
			{data: '123', expect: 123},
			{data: '123.45', expect: 123.45},
			{data: '-123.45', expect: -123.45},
			{data: '[1, 2, 3]', expect: [1, 2, 3]},
			{
				data: '{"int":1, "float": -1.23, "boolfalse": false, "booltrue": true, "string": "string", "array":[1, 2]}',
				expect: {
					int: 1,
					float: -1.23,
					boolfalse: false,
					booltrue: true,
					string: 'string',
					array: [1, 2]
				}
			}
		]);

		series('does not required bracket to differ between array and objects', [
			{data: 'hello, world', expect: ['hello', 'world']},
			{data: 'hello: world', expect: {hello: 'world'}},
			{data: 'foo: bar, baz: true', expect: {foo: 'bar', baz: true}},
			{data: '1, 2, 3', expect: [1, 2, 3]},
			{data: '1, 2,', expect: [1, 2]},
			{data: 'hello: world,', expect: {hello: 'world'}}
		]);

		series('respects quoted values', [
			{data: '"hello:world"', expect: 'hello:world'},
			{data: '"hello,world"', expect: 'hello,world'},
			{data: '"hello,\'world"', expect: 'hello,\'world'},
			{data: '"hello,\'world\'"', expect: 'hello,\'world\''}
		]);

		series('trims keys and values', [
			{data: '     hello     ', expect: 'hello'},
			{data: '     hello     :     world     ', expect: {hello: 'world'}},
			{data: '\t\t\thello:\n\t\tworld', expect: {hello: 'world'}}
		]);

		series('allows keywords and numbers to be used as object keys', [
			{data: 'true:true', expect: {true: true}},
			{data: 'false:false', expect: {false: false}},
			{data: 'null:null', expect: {null: null}},
			{data: '123:456', expect: {123: 456}},
			{data: 'true: true, false: false', expect: {true: true,false: false}}
		]);

		series('escaped nested quotation marks', [
			{data: 'hello"world', expect: 'hello\"world'}
		]);

		series('removes comments from input', [
			{data: 'hello/*world*/', expect: 'hello'},
			{data: '/*hello*/world', expect: 'world'},
			{data: 'a:b,c:d,/*e:f,*/g:h', expect: {a: 'b', c: 'd', g: 'h'}}
		]);

		series('allows for dashes in keys and values', [
			{data: 'foo-bar', expect: 'foo-bar'},
			{data: 'foo-bar: sample-value', expect: {'foo-bar': 'sample-value'}},
			{data: '"[foo-bar=sample-value]"', expect: '[foo-bar=sample-value]'}
		]);

		series('extension use cases', [
			{
				data: 'template: {path: /base/test/data/template.html, selector: \'[data-template=inner-attr]\'}',
				expect: {template: {
					path: '/base/test/data/template.html',
					selector: '[data-template=inner-attr]'
				}}
			}
		]);
	});
});


text:
<?php

namespace Lthrt\ContactBundle\Traits\Controller;

use Lthrt\ContactBundle\Entity\Contact;

/**
 * ContactNotFoundTrait.
 */
trait ContactNotFoundTrait
{
    private function ifNotFound(Contact $contact)
    {
        if (!$contact) {
            throw $this->createNotFoundException('Unable to find Contact entity.');
        }
    }
}


text:
"""The public facing packet creator APIs."""

from typing import List, Union
import warnings

import numpy as np

from google.protobuf import message
from mediapipe.python._framework_bindings import _packet_creator
from mediapipe.python._framework_bindings import image
from mediapipe.python._framework_bindings import image_frame
from mediapipe.python._framework_bindings import packet

create_string = _packet_creator.create_string
create_bool = _packet_creator.create_bool
create_int = _packet_creator.create_int
create_int8 = _packet_creator.create_int8
create_int16 = _packet_creator.create_int16
create_int32 = _packet_creator.create_int32
create_int64 = _packet_creator.create_int64
create_uint8 = _packet_creator.create_uint8
create_uint16 = _packet_creator.create_uint16
create_uint32 = _packet_creator.create_uint32
create_uint64 = _packet_creator.create_uint64
create_float = _packet_creator.create_float
create_double = _packet_creator.create_double
create_int_array = _packet_creator.create_int_array
create_float_array = _packet_creator.create_float_array
create_int_vector = _packet_creator.create_int_vector
create_bool_vector = _packet_creator.create_bool_vector
create_float_vector = _packet_creator.create_float_vector
create_string_vector = _packet_creator.create_string_vector
create_image_vector = _packet_creator.create_image_vector
create_packet_vector = _packet_creator.create_packet_vector
create_string_to_packet_map = _packet_creator.create_string_to_packet_map
create_matrix = _packet_creator.create_matrix

def create_image_frame(data: Union[image_frame.ImageFrame, np.ndarray],
                       *,
                       image_format: image_frame.ImageFormat = None,
                       copy: bool = None) -> packet.Packet:
  """Create a MediaPipe ImageFrame packet.

  A MediaPipe ImageFrame packet can be created from an existing MediaPipe
  ImageFrame object and the data will be realigned and copied into a new
  ImageFrame object inside of the packet.

  A MediaPipe ImageFrame packet can also be created from the raw pixel data
  represented as a numpy array with one of the uint8, uint16, and float data
  types. There are three data ownership modes depending on how the 'copy' arg
  is set.

  i) Default mode
  If copy is not set, mutable data is always copied while the immutable data
  is by reference.

  ii) Copy mode (safe)
  If copy is set to True, the data will be realigned and copied into an
  ImageFrame object inside of the packet regardless the immutablity of the
  original data.

  iii) Reference mode (dangerous)
  If copy is set to False, the data will be forced to be shared. If the data is
  mutable (data.flags.writeable is True), a warning will be raised.

  Args:
    data: A MediaPipe ImageFrame object or the raw pixel data that is
      represnted as a numpy ndarray.
    image_format: One of the image_frame.ImageFormat enum types.
    copy: Indicate if the packet should copy the data from the numpy nparray.

  Returns:
    A MediaPipe ImageFrame Packet.

  Raises:
    ValueError:
      i) When "data" is a numpy ndarray, "image_format" is not provided or
        the "data" array is not c_contiguous in the reference mode.
      ii) When "data" is an ImageFrame object, the "image_format" arg doesn't
        match the image format of the "data" ImageFrame object or "copy" is
        explicitly set to False.
    TypeError: If "image format" doesn't match "data" array's data type.

  Examples:
    np_array = np.random.randint(255, size=(321, 123, 3), dtype=np.uint8)
    # Copy mode by default if the data array is writable.
    image_frame_packet = mp.packet_creator.create_image_frame(
        image_format=mp.ImageFormat.SRGB, data=np_array)

    # Make the array unwriteable to trigger the reference mode.
    np_array.flags.writeable = False
    image_frame_packet = mp.packet_creator.create_image_frame(
        image_format=mp.ImageFormat.SRGB, data=np_array)

    image_frame = mp.ImageFrame(image_format=mp.ImageFormat.SRGB, data=np_array)
    image_frame_packet = mp.packet_creator.create_image_frame(image_frame)

  """
  if isinstance(data, image_frame.ImageFrame):
    if image_format is not None and data.image_format != image_format:
      raise ValueError(
          'The provided image_format doesn\'t match the one from the data arg.')
    if copy is not None and not copy:
      # Taking a reference will make the created packet be mutable since the
      # ImageFrame object can still be manipulated in Python, which voids packet
      # immutability.
      raise ValueError(
          'Creating ImageFrame packet by taking a reference of another ImageFrame object is not supported yet.'
      )
    # pylint:disable=protected-access
    return _packet_creator._create_image_frame_from_image_frame(data)
    # pylint:enable=protected-access
  else:
    if image_format is None:
      raise ValueError('Please provide \'image_format\' with \'data\'.')
    # If copy arg is not set, copying the data if it's immutable. Otherwise,
    # take a reference of the immutable data to avoid data copy.
    if copy is None:
      copy = True if data.flags.writeable else False
    if not copy:
      # TODO: Investigate why the first 2 bytes of the data has data
      # corruption when "data" is not c_contiguous.
      if not data.flags.c_contiguous:
        raise ValueError(
            'Reference mode is unavailable if \'data\' is not c_contiguous.')
      if data.flags.writeable:
        warnings.warn(
            '\'data\' is still writeable. Taking a reference of the data to create ImageFrame packet is dangerous.',
            RuntimeWarning, 2)
    # pylint:disable=protected-access
    return _packet_creator._create_image_frame_from_pixel_data(
        image_format, data, copy)
    # pylint:enable=protected-access

def create_image(data: Union[image.Image, np.ndarray],
                 *,
                 image_format: image_frame.ImageFormat = None,
                 copy: bool = None) -> packet.Packet:
  """Create a MediaPipe Image packet.

  A MediaPipe Image packet can be created from an existing MediaPipe
  Image object and the data will be realigned and copied into a new
  Image object inside of the packet.

  A MediaPipe Image packet can also be created from the raw pixel data
  represented as a numpy array with one of the uint8, uint16, and float data
  types. There are three data ownership modes depending on how the 'copy' arg
  is set.

  i) Default mode
  If copy is not set, mutable data is always copied while the immutable data
  is by reference.

  ii) Copy mode (safe)
  If copy is set to True, the data will be realigned and copied into an
  Image object inside of the packet regardless the immutablity of the
  original data.

  iii) Reference mode (dangerous)
  If copy is set to False, the data will be forced to be shared. If the data is
  mutable (data.flags.writeable is True), a warning will be raised.

  Args:
    data: A MediaPipe Image object or the raw pixel data that is represnted as a
      numpy ndarray.
    image_format: One of the mp.ImageFormat enum types.
    copy: Indicate if the packet should copy the data from the numpy nparray.

  Returns:
    A MediaPipe Image Packet.

  Raises:
    ValueError:
      i) When "data" is a numpy ndarray, "image_format" is not provided or
        the "data" array is not c_contiguous in the reference mode.
      ii) When "data" is an Image object, the "image_format" arg doesn't
        match the image format of the "data" Image object or "copy" is
        explicitly set to False.
    TypeError: If "image format" doesn't match "data" array's data type.

  Examples:
    np_array = np.random.randint(255, size=(321, 123, 3), dtype=np.uint8)
    # Copy mode by default if the data array is writable.
    image_packet = mp.packet_creator.create_image(
        image_format=mp.ImageFormat.SRGB, data=np_array)

    # Make the array unwriteable to trigger the reference mode.
    np_array.flags.writeable = False
    image_packet = mp.packet_creator.create_image(
        image_format=mp.ImageFormat.SRGB, data=np_array)

    image = mp.Image(image_format=mp.ImageFormat.SRGB, data=np_array)
    image_packet = mp.packet_creator.create_image(image)

  """
  if isinstance(data, image.Image):
    if image_format is not None and data.image_format != image_format:
      raise ValueError(
          'The provided image_format doesn\'t match the one from the data arg.')
    if copy is not None and not copy:
      # Taking a reference will make the created packet be mutable since the
      # Image object can still be manipulated in Python, which voids packet
      # immutability.
      raise ValueError(
          'Creating Image packet by taking a reference of another Image object is not supported yet.'
      )
    # pylint:disable=protected-access
    return _packet_creator._create_image_from_image(data)
    # pylint:enable=protected-access
  else:
    if image_format is None:
      raise ValueError('Please provide \'image_format\' with \'data\'.')
    # If copy arg is not set, copying the data if it's immutable. Otherwise,
    # take a reference of the immutable data to avoid data copy.
    if copy is None:
      copy = True if data.flags.writeable else False
    if not copy:
      # TODO: Investigate why the first 2 bytes of the data has data
      # corruption when "data" is not c_contiguous.
      if not data.flags.c_contiguous:
        raise ValueError(
            'Reference mode is unavailable if \'data\' is not c_contiguous.')
      if data.flags.writeable:
        warnings.warn(
            '\'data\' is still writeable. Taking a reference of the data to create Image packet is dangerous.',
            RuntimeWarning, 2)
    # pylint:disable=protected-access
    return _packet_creator._create_image_from_pixel_data(
        image_format, data, copy)
    # pylint:enable=protected-access

def create_proto(proto_message: message.Message) -> packet.Packet:
  """Create a MediaPipe protobuf message packet.

  Args:
    proto_message: A Python protobuf message.

  Returns:
    A MediaPipe protobuf message Packet.

  Raises:
    RuntimeError: If the protobuf message type is not registered in MediaPipe.

  Examples:
    detection = detection_pb2.Detection()
    text_format.Parse('score: 0.5', detection)
    packet = mp.packet_creator.create_proto(detection)
    output_detection = mp.packet_getter.get_proto(packet)
  """
  # pylint:disable=protected-access
  return _packet_creator._create_proto(proto_message.DESCRIPTOR.full_name,
                                       proto_message.SerializeToString())
  # pylint:enable=protected-access

def create_proto_vector(message_list: List[message.Message]) -> packet.Packet:
  raise NotImplementedError('create_proto_vector is not implemented.')


text:
using Azure.Core;
using Azure.ResourceManager.Resources.Models;

namespace Azure.ResourceManager.Compute.Models
{
    /// <summary> The source user image virtual hard disk. Only tags may be updated. </summary>
    public partial class DiskImagePatch : ComputeResourcePatch
    {
        /// <summary> Initializes a new instance of DiskImagePatch. </summary>
        public DiskImagePatch()
        {
        }

        /// <summary> The source virtual machine from which Image is created. </summary>
        internal WritableSubResource SourceVirtualMachine { get; set; }
        /// <summary> Gets or sets Id. </summary>
        public ResourceIdentifier SourceVirtualMachineId
        {
            get => SourceVirtualMachine is null ? default : SourceVirtualMachine.Id;
            set
            {
                if (SourceVirtualMachine is null)
                    SourceVirtualMachine = new WritableSubResource();
                SourceVirtualMachine.Id = value;
            }
        }

        /// <summary> Specifies the storage settings for the virtual machine disks. </summary>
        public ImageStorageProfile StorageProfile { get; set; }
        /// <summary> The provisioning state. </summary>
        public string ProvisioningState { get; }
        /// <summary> Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. </summary>
        public HyperVGeneration? HyperVGeneration { get; set; }
    }
}


text:
package min.bug.tra.domain;

public class Task {
	public static enum TaskType {
		BUG, ENHANCEMENT, NEW_FEATURE;
	}

	public static enum TaskStatus {
		OPEN, CLOSED;
	}

	private Long id;
	private String title;
	private String description;
	private TaskType type;
	private TaskStatus status;

	public Task(Long id, String title, String description, TaskType type,
			TaskStatus status) {
		super();
		this.id = id;
		this.title = title;
		this.description = description;
		this.type = type;
		this.status = status;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public TaskType getType() {
		return type;
	}

	public void setType(TaskType type) {
		this.type = type;
	}

	public TaskStatus getStatus() {
		return status;
	}

	public void setStatus(TaskStatus status) {
		this.status = status;
	}

}


text:
package org.sfs.nodes;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.net.HostAndPort;
import io.vertx.core.Context;
import io.vertx.core.Vertx;
import io.vertx.core.logging.Logger;
import org.sfs.Server;
import org.sfs.SfsVertx;
import org.sfs.VertxContext;
import org.sfs.filesystem.volume.VolumeManager;
import org.sfs.rx.Defer;
import org.sfs.rx.RxHelper;
import org.sfs.rx.Sleep;
import org.sfs.util.HttpClientRequestAndResponse;
import org.sfs.vo.TransientServiceDef;
import rx.Observable;
import rx.exceptions.CompositeException;
import rx.functions.Func1;

import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicReference;

import static com.google.common.base.Charsets.UTF_8;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.ImmutableList.copyOf;
import static io.vertx.core.logging.LoggerFactory.getLogger;
import static java.nio.file.Files.createDirectories;
import static java.nio.file.Files.createFile;
import static java.nio.file.Files.readAllBytes;
import static java.nio.file.Files.write;
import static java.nio.file.Paths.get;
import static org.sfs.rx.Defer.aVoid;

public class Nodes {

    private static final Logger LOGGER = getLogger(Nodes.class);
    private int numberOfObjectReplicas = 0;
    // if true a primary and replica copies of volume data
    // can exist on the same node
    private boolean allowSameNode = false;
    private int maxPoolSize;
    private int connectTimeout;
    private int responseTimeout;
    private VolumeManager volumeManager;
    private boolean dataNode = false;
    private String nodeId;
    private Path nodeIdPath;
    private boolean masterNode;
    private long nodeStatsRefreshInterval;
    private ImmutableList<HostAndPort> clusterHosts;
    private ImmutableList<HostAndPort> publishAddresses;
    private WriteConsistency objectWriteConsistency;

    public Nodes() {
    }

    public Observable<Void> open(
            VertxContext<Server> vertxContext,
            final Iterable<HostAndPort> publicAddresses,
            final Iterable<HostAndPort> clusterHosts,
            final int maxPoolSize,
            final int connectTimeout,
            final int responseTimeout,
            final int numberOfObjectReplicas,
            final long nodeStatsRefreshInterval,
            final boolean dataNode,
            final boolean masterNode,
            WriteConsistency writeConsistency) {

        checkArgument(numberOfObjectReplicas >= 0, "Replicas must be > 0");
        checkArgument(nodeStatsRefreshInterval >= 1000, "RefreshInterval must be greater than 1000");

        this.dataNode = dataNode;
        this.masterNode = masterNode;
        this.numberOfObjectReplicas = numberOfObjectReplicas;
        this.objectWriteConsistency = writeConsistency;
        this.maxPoolSize = maxPoolSize;
        this.connectTimeout = connectTimeout;
        this.responseTimeout = responseTimeout;
        this.nodeIdPath = get(vertxContext.verticle().sfsFileSystem().workingDirectory().toString(), "node", ".nodeId");
        this.volumeManager = new VolumeManager(vertxContext.verticle().sfsFileSystem().workingDirectory());
        this.publishAddresses = copyOf(publicAddresses);
        this.clusterHosts = copyOf(clusterHosts);
        this.nodeStatsRefreshInterval = nodeStatsRefreshInterval;

        return aVoid()
                .flatMap(aVoid -> initNode(vertxContext)
                        .doOnNext(n -> {
                            nodeId = n;
                        }))
                .flatMap(aVoid -> {
                    if (dataNode) {
                        return volumeManager.open(vertxContext);
                    } else {
                        return aVoid();
                    }
                })
                .single()
                .doOnNext(aVoid -> {
                    LOGGER.info("Started node " + nodeId);
                });
    }

    public long getNodeStatsRefreshInterval() {
        return nodeStatsRefreshInterval;
    }

    public List<HostAndPort> getPublishAddresses() {
        return publishAddresses;
    }

    public ImmutableList<HostAndPort> getClusterHosts() {
        return clusterHosts;
    }

    public int getNumberOfObjectReplicas() {
        return numberOfObjectReplicas;
    }

    public Nodes setNumberOfObjectReplicas(int numberOfObjectReplicas) {
        this.numberOfObjectReplicas = numberOfObjectReplicas;
        return this;
    }

    public boolean isAllowSameNode() {
        return allowSameNode;
    }

    public Nodes setAllowSameNode(boolean allowSameNode) {
        this.allowSameNode = allowSameNode;
        return this;
    }

    public boolean isMaster() {
        return masterNode;
    }

    private Observable<String> initNode(VertxContext<Server> vertxContext) {
        SfsVertx sfsVertx = vertxContext.vertx();
        Context context = sfsVertx.getOrCreateContext();
        return RxHelper.executeBlocking(context, sfsVertx.getBackgroundPool(),
                () -> {
                    try {
                        createDirectories(nodeIdPath.getParent());
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                    try {
                        createFile(nodeIdPath);
                        // the write will be skipped if the file already exists
                        write(nodeIdPath, UUID.randomUUID().toString().getBytes(UTF_8));
                    } catch (IOException e) {
                        // do nothing
                    }
                    return (Void) null;
                })
                .flatMap(new Sleep(vertxContext, 1000))
                .flatMap(aVoid -> RxHelper.executeBlocking(context, sfsVertx.getBackgroundPool(), () -> {
                    try {
                        return new String(readAllBytes(nodeIdPath), UTF_8);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }));
    }

    @VisibleForTesting
    public HostAndPort getHostAndPort() {
        return publishAddresses.get(0);
    }

    public WriteConsistency getObjectWriteConsistency() {
        return objectWriteConsistency;
    }

    public int getMaxPoolSize() {
        return maxPoolSize;
    }

    public int getConnectTimeout() {
        return connectTimeout;
    }

    public int getResponseTimeout() {
        return responseTimeout;
    }

    public VolumeManager volumeManager() {
        return volumeManager;
    }

    public boolean isDataNode() {
        return dataNode;
    }

    public String getNodeId() {
        return nodeId;
    }

    public Observable<Void> close(VertxContext<Server> vertxContext) {
        String aNodeId = nodeId;
        return aVoid()
                .flatMap(aVoid -> {
                    VolumeManager v = volumeManager;
                    volumeManager = null;
                    if (v != null) {
                        return v.close(vertxContext)
                                .onErrorResumeNext(throwable -> {
                                    LOGGER.error("Unhandled Exception", throwable);
                                    return aVoid();
                                });
                    }
                    return aVoid();

                })
                .onErrorResumeNext(throwable -> {
                    LOGGER.warn("Handling Exception", throwable);
                    return aVoid();
                })
                .onErrorResumeNext(throwable -> {
                    LOGGER.warn("Handling Exception", throwable);
                    return aVoid();
                })
                .doOnNext(aVoid -> {
                    nodeId = null;
                    LOGGER.info("Stopped node " + aNodeId);
                });
    }

    public Observable<HttpClientRequestAndResponse> connectFirstAvailable(Vertx vertx, Collection<HostAndPort> hostAndPorts, Func1<HostAndPort, Observable<HttpClientRequestAndResponse>> supplier) {
        return Observable.defer(() -> {
            Preconditions.checkArgument(!hostAndPorts.isEmpty(), "hostAndPorts cannot be empty");
            AtomicReference<HttpClientRequestAndResponse> ref = new AtomicReference<>();
            List<Throwable> errors = new ArrayList<>();
            return RxHelper.iterate(
                    vertx,
                    hostAndPorts,
                    hostAndPort ->
                            Defer.aVoid()
                                    .flatMap(aVoid -> RxHelper.onErrorResumeNext(50, () -> supplier.call(hostAndPort)))
                                    .doOnNext(httpClientRequestAndResponseAction1 -> Preconditions.checkState(ref.compareAndSet(null, httpClientRequestAndResponseAction1), "Already set"))
                                    .map(httpClientRequestAndResponse -> false)
                                    .onErrorResumeNext(throwable -> {
                                        LOGGER.warn("Handling connect failure to " + hostAndPort, throwable);
                                        errors.add(throwable);
                                        return Defer.just(true);
                                    }))
                    .flatMap(_continue -> {
                        HttpClientRequestAndResponse httpClientRequestAndResponse = ref.get();
                        if (httpClientRequestAndResponse == null) {
                            Preconditions.checkState(!errors.isEmpty(), "Errors cannot be empty");
                            if (errors.size() == 1) {
                                return Observable.error(errors.get(0));
                            } else {
                                return Observable.error(new CompositeException(errors));
                            }
                        } else {
                            return Observable.just(httpClientRequestAndResponse);
                        }
                    });
        });
    }

    public XNode remoteNode(VertxContext<Server> vertxContext, TransientServiceDef serviceDef) {
        return remoteNode(vertxContext, serviceDef.getPublishAddresses());
    }

    public XNode remoteNode(VertxContext<Server> vertxContext, HostAndPort hostAndPort) {
        return remoteNode(vertxContext, Collections.singletonList(hostAndPort));
    }

    public XNode remoteNode(VertxContext<Server> vertxContext, Collection<HostAndPort> hostAndPorts) {
        return new RemoteNode(vertxContext, responseTimeout, hostAndPorts);
    }

    public MasterNode remoteMasterNode(VertxContext<Server> vertxContext, TransientServiceDef serviceDef) {
        return remoteMasterNode(vertxContext, serviceDef.getPublishAddresses());
    }

    public MasterNode remoteMasterNode(VertxContext<Server> vertxContext, HostAndPort hostAndPort) {
        return remoteMasterNode(vertxContext, Collections.singletonList(hostAndPort));
    }

    public MasterNode remoteMasterNode(VertxContext<Server> vertxContext, Collection<HostAndPort> hostAndPorts) {
        return new RemoteMasterNode(vertxContext, responseTimeout, hostAndPorts);
    }
}


text:
if(!dojo._hasResource["dojox.layout.TableContainer"]){
dojo._hasResource["dojox.layout.TableContainer"]=true;
dojo.experimental("dojox.layout.TableContainer");
dojo.provide("dojox.layout.TableContainer");
dojo.require("dijit.layout._LayoutWidget");
dojo.declare("dojox.layout.TableContainer",dijit.layout._LayoutWidget,{cols:1,labelWidth:"100",showLabels:true,orientation:"horiz",spacing:1,customClass:"",postCreate:function(){
this.inherited(arguments);
this._children=[];
this.connect(this,"set",function(_1,_2){
if(_2&&(_1=="orientation"||_1=="customClass"||_1=="cols")){
this.layout();
}
});
},startup:function(){
if(this._started){
return;
}
this.inherited(arguments);
if(this._initialized){
return;
}
var _3=this.getChildren();
if(_3.length<1){
return;
}
this._initialized=true;
dojo.addClass(this.domNode,"dijitTableLayout");
dojo.forEach(_3,function(_4){
if(!_4.started&&!_4._started){
_4.startup();
}
});
this.resize();
this.layout();
},resize:function(){
dojo.forEach(this.getChildren(),function(_5){
if(typeof _5.resize=="function"){
_5.resize();
}
});
},layout:function(){
if(!this._initialized){
return;
}
var _6=this.getChildren();
var _7={};
var _8=this;
function _9(_a,_b,_c){
if(_8.customClass!=""){
var _d=_8.customClass+"-"+(_b||_a.tagName.toLowerCase());
dojo.addClass(_a,_d);
if(arguments.length>2){
dojo.addClass(_a,_d+"-"+_c);
}
}
};
dojo.forEach(this._children,dojo.hitch(this,function(_e){
_7[_e.id]=_e;
}));
dojo.forEach(_6,dojo.hitch(this,function(_f,_10){
if(!_7[_f.id]){
this._children.push(_f);
}
}));
var _11=dojo.create("table",{"width":"100%","class":"tableContainer-table tableContainer-table-"+this.orientation,"cellspacing":this.spacing},this.domNode);
var _12=dojo.create("tbody");
_11.appendChild(_12);
_9(_11,"table",this.orientation);
var _13=Math.floor(100/this.cols)+"%";
var _14=dojo.create("tr",{},_12);
var _15=(!this.showLabels||this.orientation=="horiz")?_14:dojo.create("tr",{},_12);
var _16=this.cols*(this.showLabels?2:1);
var _17=0;
dojo.forEach(this._children,dojo.hitch(this,function(_18,_19){
var _1a=_18.colspan||1;
if(_1a>1){
_1a=this.showLabels?Math.min(_16-1,_1a*2-1):Math.min(_16,_1a);
}
if(_17+_1a-1+(this.showLabels?1:0)>=_16){
_17=0;
_14=dojo.create("tr",{},_12);
_15=this.orientation=="horiz"?_14:dojo.create("tr",{},_12);
}
var _1b;
if(this.showLabels){
_1b=dojo.create("td",{"class":"tableContainer-labelCell"},_14);
if(_18.spanLabel){
dojo.attr(_1b,this.orientation=="vert"?"rowspan":"colspan",2);
}else{
_9(_1b,"labelCell");
var _1c={"for":_18.get("id")};
var _1d=dojo.create("label",_1c,_1b);
if(Number(this.labelWidth)>-1||String(this.labelWidth).indexOf("%")>-1){
dojo.style(_1b,"width",String(this.labelWidth).indexOf("%")<0?this.labelWidth+"px":this.labelWidth);
}
_1d.innerHTML=_18.get("label")||_18.get("title");
}
}
var _1e;
if(_18.spanLabel&&_1b){
_1e=_1b;
}else{
_1e=dojo.create("td",{"class":"tableContainer-valueCell"},_15);
}
if(_1a>1){
dojo.attr(_1e,"colspan",_1a);
}
_9(_1e,"valueCell",_19);
_1e.appendChild(_18.domNode);
_17+=_1a+(this.showLabels?1:0);
}));
if(this.table){
this.table.parentNode.removeChild(this.table);
}
dojo.forEach(_6,function(_1f){
if(typeof _1f.layout=="function"){
_1f.layout();
}
});
this.table=_11;
this.resize();
},destroyDescendants:function(_20){
dojo.forEach(this._children,function(_21){
_21.destroyRecursive(_20);
});
},_setSpacingAttr:function(_22){
this.spacing=_22;
if(this.table){
this.table.cellspacing=Number(_22);
}
}});
dojo.extend(dijit._Widget,{label:"",title:"",spanLabel:false,colspan:1});
}


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>

  <groupId>org.neo4j.driver</groupId>
  <artifactId>neo4j-java-driver-parent</artifactId>
  <version>5.2-SNAPSHOT</version>

  <packaging>pom</packaging>
  <name>Neo4j Java Driver Project</name>
  <description>A project for building a Java driver for the Neo4j Bolt protocol.</description>
  <url>https://github.com/neo4j/neo4j-java-driver</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.release>17</maven.compiler.release>
    <maven.compiler.xlint.extras/>
    <maven.build.timestamp.format>'v'yyyyMMdd-HHmm</maven.build.timestamp.format>

    <bundle.name>${project.groupId}.${project.artifactId}</bundle.name>

    <rootDir>${project.basedir}</rootDir>
    <parallelizable.it.forkCount>2</parallelizable.it.forkCount>
    <!-- All tests tagged are to be executed in parallel -->
    <parallelizable.it.tags>parallelizableIT</parallelizable.it.tags>
    <surefire.and.failsafe.version>3.0.0-M7</surefire.and.failsafe.version>
    <surefire.jpms.args/>
    <failsafe.parallelizable.jpms.args/>
    <!-- Skip deployment by default for everything in this project. -->
    <maven.deploy.skip>true</maven.deploy.skip>

    <!-- Versions -->
    <reactive-streams.version>1.0.4</reactive-streams.version>
    <!-- Please note that when updating this dependency -->
    <!-- (i.e. due to a security vulnerability or bug) that the -->
    <!-- corresponding server dependency also needs updating.-->
    <netty-bom.version>4.1.84.Final</netty-bom.version>
    <!-- Please note that when updating this dependency -->
    <!-- (i.e. due to a security vulnerability or bug) that the -->
    <!-- corresponding server dependency also needs updating.-->
    <reactor-bom.version>2020.0.24</reactor-bom.version>
    <rxjava.version>2.2.21</rxjava.version>
    <slf4j-api.version>1.7.36</slf4j-api.version>
    <hamcrest-junit.version>2.0.0.0</hamcrest-junit.version>
    <mockito-core.version>4.8.1</mockito-core.version>
    <junit.version>5.9.1</junit.version>
    <testng-engine.version>1.0.4</testng-engine.version>
    <jarchivelib.version>1.2.0</jarchivelib.version>
    <bouncycastle-jdk15on.version>1.70</bouncycastle-jdk15on.version>
    <logback-classic.version>1.4.4</logback-classic.version>
    <jackson.version>2.13.4</jackson.version>
    <lombok.version>1.18.24</lombok.version>
    <svm.version>22.2.0.1</svm.version>
    <micrometer.version>1.9.5</micrometer.version>
    <testcontainers.version>1.17.5</testcontainers.version>
    <build-resources.version>5.1.0</build-resources.version>
    <!-- To be overwritten by child projects -->
    <moduleName/>
  </properties>

  <modules>
    <module>driver</module>
    <module>bundle</module>
    <module>examples</module>
    <module>testkit-backend</module>
    <module>testkit-tests</module>
  </modules>

  <licenses>
    <license>
      <name>Apache License, Version 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>neo4j</id>
      <name>The Neo4j Team</name>
      <url>http://www.neo4j.com/</url>
      <organization>Neo4j Sweden AB</organization>
      <organizationUrl>http://www.neo4j.com/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/neo4j/neo4j-java-driver.git</connection>
    <developerConnection>scm:git:git@github.com:neo4j/neo4j-java-driver.git</developerConnection>
    <url>https://github.com/neo4j/neo4j-java-driver</url>
  </scm>

  <dependencyManagement>
    <dependencies>
      <!-- Compile dependencies -->
      <dependency>
        <groupId>org.reactivestreams</groupId>
        <artifactId>reactive-streams</artifactId>
        <version>${reactive-streams.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-bom</artifactId>
        <version>${netty-bom.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>io.projectreactor</groupId>
        <artifactId>reactor-bom</artifactId>
        <version>${reactor-bom.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!--Compile dependencies only used by Examples-->
      <dependency>
        <groupId>io.reactivex.rxjava2</groupId>
        <artifactId>rxjava</artifactId>
        <version>${rxjava.version}</version>
      </dependency>

      <!-- Optional dependencies -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j-api.version}</version>
      </dependency>
      <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-core</artifactId>
        <version>${micrometer.version}</version>
        <scope>provided</scope>
      </dependency>

      <!-- Test dependencies -->
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-junit</artifactId>
        <version>${hamcrest-junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito-core.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.junit.support</groupId>
        <artifactId>testng-engine</artifactId>
        <version>${testng-engine.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.rauschig</groupId>
        <artifactId>jarchivelib</artifactId>
        <version>${jarchivelib.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>${bouncycastle-jdk15on.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcpkix-jdk15on</artifactId>
        <version>${bouncycastle-jdk15on.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback-classic.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.reactivestreams</groupId>
        <artifactId>reactive-streams-tck</artifactId>
        <version>${reactive-streams.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>${testcontainers.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- Testkit Backend Dependencies -->
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${lombok.version}</version>
        <scope>provided</scope>
      </dependency>

      <!-- Graal VM -->
      <dependency>
        <groupId>org.graalvm.nativeimage</groupId>
        <artifactId>svm</artifactId>
        <version>${svm.version}</version>
        <!-- Provided scope as it is only needed for compiling the SVM substitution classes -->
        <scope>provided</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <!-- If a revision has not been explicitly set, sort it out by looking at git metadata -->
    <profile>
      <id>determine-revision</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>!build.revision</name>
        </property>
      </activation>
      <properties>
        <build.revision>${git.commit.id.abbrev}</build.revision>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>pl.project13.maven</groupId>
            <artifactId>git-commit-id-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Disable parallel execution of integration tests with "-DsequentialITs" -->
    <profile>
      <id>sequentialIntegrationTests</id>
      <activation>
        <property>
          <name>sequentialITs</name>
        </property>
      </activation>
      <properties>
        <parallelizable.it.forkCount>1</parallelizable.it.forkCount>
      </properties>
    </profile>

    <profile>
      <id>skip-docker-tests</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <configuration>
                <systemPropertyVariables>
                  <skipDockerTests>true</skipDockerTests>
                </systemPropertyVariables>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.10.1</version>
          <configuration>
            <showDeprecation>true</showDeprecation>
            <showWarnings>true</showWarnings>
            <compilerArgs>
              <arg>-Xlint:all${maven.compiler.xlint.extras}</arg>
              <arg>-Werror</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefire.and.failsafe.version}</version>
          <configuration>
            <argLine>${surefire.jpms.args}</argLine>
            <trimStackTrace>false</trimStackTrace>
            <classpathDependencyExcludes>
              <classpathDependencyExclude>org.graalvm.nativeimage:svm</classpathDependencyExclude>
            </classpathDependencyExcludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${surefire.and.failsafe.version}</version>
          <configuration>
            <classpathDependencyExcludes>
              <classpathDependencyExclude>org.graalvm.nativeimage:svm</classpathDependencyExclude>
            </classpathDependencyExcludes>
          </configuration>
          <executions>
            <!-- execution 1: execute all ITs that support parallel execution (regular single-instance tests)  -->
            <execution>
              <id>parallelizable-integration-tests</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
              <configuration>
                <argLine>-Dfile.encoding=${project.build.sourceEncoding} -DtestJvmId=${surefire.forkNumber} ${failsafe.parallelizable.jpms.args}</argLine>
                <trimStackTrace>false</trimStackTrace>
                <forkCount>${parallelizable.it.forkCount}</forkCount>
                <reuseForks>true</reuseForks>
                <groups>${parallelizable.it.tags}</groups>
              </configuration>
            </execution>

            <!-- execution 2: execute all ITs that do not support parallel execution (stub server tests, causal cluster tests)  -->
            <execution>
              <id>sequential-integration-tests</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
              <configuration>
                <argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
                <trimStackTrace>false</trimStackTrace>
                <forkCount>1</forkCount>
                <reuseForks>true</reuseForks>
                <excludedGroups>${parallelizable.it.tags}</excludedGroups>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>clirr-maven-plugin</artifactId>
          <version>2.8</version>
          <executions>
            <execution>
              <phase>compile</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>pl.project13.maven</groupId>
          <artifactId>git-commit-id-plugin</artifactId>
          <version>2.2.4</version>
          <executions>
            <execution>
              <goals>
                <goal>revision</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.1</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <archive>
                  <manifestEntries>
                    <Bundle-Name>${project.name} (Source)</Bundle-Name>
                    <Bundle-SymbolicName>${bundle.name}.source</Bundle-SymbolicName>
                    <Bundle-Version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}</Bundle-Version>
                    <Eclipse-SourceBundle>${bundle.name};version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}";roots:="."</Eclipse-SourceBundle>
                  </manifestEntries>
                </archive>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>3.5.0</version>
          <executions>
            <execution>
              <id>bundle-manifest</id>
              <phase>process-classes</phase>
              <goals>
                <goal>manifest</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <instructions>
              <Bundle-SymbolicName>${bundle.name}</Bundle-SymbolicName>
              <Bundle-Version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}</Bundle-Version>
              <_snapshot>${maven.build.timestamp}</_snapshot>
              <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
              <_removeheaders>Bnd-*,Private-Package</_removeheaders>
              <_nouses>true</_nouses>
              <_include>-osgi.bnd</_include>
            </instructions>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>2.23.0</version>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <java>
              <palantirJavaFormat/>
            </java>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0</version>
          <dependencies>
            <dependency>
              <groupId>de.skuzzle.enforcer</groupId>
              <artifactId>restrict-imports-enforcer-rule</artifactId>
              <version>2.0.0</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <goals>
                <goal>enforce</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <rules>
              <RestrictImports>
                <reason>Star imports are not allowed, please configure your editor to substitute them with fully qualified imports.</reason>
                <bannedImport>**.'*'</bannedImport>
              </RestrictImports>
            </rules>
            <fail>true</fail>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>3.0</version>
          <configuration>
            <strictCheck>true</strictCheck>
            <header>${rootDir}/build/license-header.txt</header>
            <mapping>
              <java>SLASHSTAR_STYLE</java>
            </mapping>
            <includes>
              <include>**/*.java</include>
            </includes>
          </configuration>
          <executions>
            <execution>
              <!-- always check license headers -->
              <id>check-licenses</id>
              <phase>initialize</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
            <!-- also available: `mvn license:[cmd]` where cmd could be one of `check`, `format`, or `delete`-->
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.neo4j.build</groupId>
              <artifactId>build-resources</artifactId>
              <version>${build-resources.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.neo4j.build.plugins</groupId>
          <artifactId>licensing-maven-plugin</artifactId>
          <version>1.7.11</version>
          <configuration>
            <failIfDisliked>true</failIfDisliked>
            <failIfMissing>true</failIfMissing>
            <plainTextReport>true</plainTextReport>
            <prependText>licensing/notice-asl-prefix.txt</prependText>
            <excludedGroups>
              ^((org.neo4j.driver){1})$
            </excludedGroups>
            <includedScopes>compile</includedScopes>
          </configuration>
          <executions>
            <execution>
              <id>list-all-licenses</id>
              <phase>compile</phase>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <licensingRequirementFiles>
                  <licensingRequirementFile>licensing/licensing-requirements-base.xml</licensingRequirementFile>
                </licensingRequirementFiles>
                <thirdPartyLicensingFilename>${project.artifactId}-${project.version}-NOTICE.txt
                </thirdPartyLicensingFilename>
                <checkExistingNoticeFile>${project.build.directory}/../NOTICE.txt</checkExistingNoticeFile>
                <listPrependText>licensing/list-prefix.txt</listPrependText>
                <listReport>${project.artifactId}-${project.version}-LICENSES.txt</listReport>
                <checkExistingLicensesFile>${project.build.directory}/../LICENSES.txt</checkExistingLicensesFile>
              </configuration>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.neo4j.build</groupId>
              <artifactId>build-resources</artifactId>
              <version>${build-resources.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.7</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.4.0</version>
          <configuration>
            <charset>UTF-8</charset>
            <docencoding>UTF-8</docencoding>
            <encoding>UTF-8</encoding>
            <top><![CDATA[
            <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/default.min.css">
            <script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js"></script>
            <script>hljs.initHighlightingOnLoad();</script>
          ]]></top>
            <bottom>
              <![CDATA[
                    <script>
                    if (typeof useModuleDirectories !== 'undefined') {
                      useModuleDirectories = false;
                    }
                    </script>
                ]]>
            </bottom>
            <additionalOptions>
              <!-- Required for Java 8u121 or later. See https://github.com/neo4j/neo4j-java-driver/pull/318  -->
              <option>--allow-script-in-comments</option>
            </additionalOptions>
            <sourceFileIncludes>
              <sourceFileInclude>org/neo4j/driver/**/*.java</sourceFileInclude>
            </sourceFileIncludes>
            <excludePackageNames>org.neo4j.driver.internal</excludePackageNames>
            <overview>${rootDir}/build/javadoc/overview.html</overview>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
            <execution>
              <id>aggregate</id>
              <goals>
                <goal>aggregate</goal>
              </goals>
              <phase>site</phase>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.neo4j.build.plugins</groupId>
        <artifactId>licensing-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Explicit deployment override for this artifact only. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <skip>false</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>


text:
'''
optic/orthologs2genes.py -
======================================================

:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python

Purpose
-------

.. todo::

   describe purpose of the script.

Usage
-----

Example::

   python optic/orthologs2genes.py --help

Type::

   python optic/orthologs2genes.py --help

for command line help.

Documentation
-------------

Code
----

'''
import os
import sys
import string
import re
import optparse
import time
import warnings

import CGAT.Experiment as E
import CGAT.Orthologs as Orthologs
import pgdb
import CGAT.Components as Components

# ignore warnings from networkx/matplotlib that a display
# can not be found
with warnings.catch_warnings():
    warnings.simplefilter("ignore")

"""read orthology assignments and re-assign gene
lists.

Overlapping orthologous transcripts are assigned to the same gene.
"""

# ------------------------------------------------------------------------

def GetPrediction2Location(dbhandle, schema,
                           tablename_predictions="predictions"):

    map_transcript2location = {}

    statement = """
    SELECT prediction_id, sbjct_token, sbjct_strand,
    sbjct_genome_from, sbjct_genome_to
    FROM %s.%s
    """ % \
        (schema, tablename_predictions)

    cc = dbhandle.cursor()
    cc.execute(statement)
    rr = cc.fetchall()
    cc.close()

    for prediction_id, sbjct_token, sbjct_strand, sbjct_genome_from, sbjct_genome_to in rr:
        map_transcript2location[str(prediction_id)] = (
            sbjct_token, sbjct_strand, sbjct_genome_from, sbjct_genome_to)

    return map_transcript2location

# ------------------------------------------------------------------------

def GetPrediction2LocationFromFile(infile, options):
    """read exon file to get map of transcript to location."""

    map_transcript2location = {}

    for line in infile:
        if line[0] == "#":
            continue
        id, sbjct_token, sbjct_strand, phase, n, p1, p2, sbjct_genome_from, sbjct_genome_to = line[
            :-1].split("\t")

        sbjct_genome_from, sbjct_genome_to = int(
            sbjct_genome_from), int(sbjct_genome_to)
        schema, prediction_id = id.split(options.separator)[:2]

        if prediction_id not in map_transcript2location:
            map_transcript2location[prediction_id] = (
                sbjct_token, sbjct_strand, sbjct_genome_from, sbjct_genome_to)
        else:
            o_sbjct_token, o_sbjct_strand, o_sbjct_genome_from, o_sbjct_genome_to = map_transcript2location[
                prediction_id]
            map_transcript2location[prediction_id] = (sbjct_token, sbjct_strand,
                                                      min(sbjct_genome_from,
                                                          o_sbjct_genome_from),
                                                      max(sbjct_genome_to, o_sbjct_genome_to))

    return schema, map_transcript2location

# ------------------------------------------------------------------------

def MapTranscripts2Genes(transcripts, map_transcript2location):
    """map all orthologous and overlapping transcripts into genes.

    The new gene is chosen at random.
    """

    graph = Components.SComponents()

    map_id2info = {}
    added = set()
    for transcript in transcripts:
        map_id2info[transcript.mTranscript] = (
            transcript.mSchema, transcript.mQuality)
        token1, strand1, from1, to1 = map_transcript2location[
            transcript.mTranscript]
        # add link to self as otherwise the component is empty
        graph.add(transcript.mTranscript, transcript.mTranscript)
        # add link to overlapping transcripts
        for x in added:
            token2, strand2, from2, to2 = map_transcript2location[x]

            if token1 == token2 and strand1 == strand2 and \
                    min(to1, to2) - max(from1, from2) > 0:
                graph.add(transcript.mTranscript, x)
        added.add(transcript.mTranscript)

    components = graph.getComponents()

    new_genes = {}
    new_transcripts = []
    for component in components:
        g = component[0]
        new_genes[g] = []
        for id in component:
            s, q = map_id2info[id]
            t = Orthologs.Transcript()
            t.mSchema = s
            t.mTranscript = id
            t.mGene = g
            t.mQuality = q
            new_genes[g].append(t)
            new_transcripts.append(t)

    return new_transcripts, new_genes

def Write(old_transcripts, map_transcript2location, fix, options):
    """map transcripts and write output."""

    if fix:
        new_transcripts = old_transcripts
    else:
        new_transcripts, genes = MapTranscripts2Genes(
            old_transcripts, map_transcript2location)

    if options.write_map:
        map_old = {}
        for x in old_transcripts:
            map_old[x.mTranscript] = x
        for x in new_transcripts:
            options.stdout.write("%s\t%s\n" % (map_old[x.mTranscript], x))
    else:
        options.stdout.write("\n".join(map(str, new_transcripts)) + "\n")

def main(argv=None):
    """script main.

    parses command line options in sys.argv, unless *argv* is given.
    """

    if argv is None:
        argv = sys.argv

    parser = E.OptionParser(
        version="%prog version: $Id: optic/orthologs2genes.py 2889 2010-04-07 08:57:57Z andreas $")

    parser.add_option("-s", "--species-regex", dest="species_regex", type="string",
                      help="regular expression to extract species from identifier.")

    parser.add_option("-g", "--gene-regex", dest="gene_regex", type="string",
                      help="regular expression to extract gene from identifier.")

    parser.add_option("-1", "--fix1", dest="fix1", action="store_true",
                      help="do not remap genes for schema1.")

    parser.add_option("-2", "--fix2", dest="fix2", action="store_true",
                      help="do not remap genes for schema2.")

    parser.add_option("-m", "--write-map", dest="write_map", action="store_true",
                      help="write transcript mapping information.")

    parser.add_option("--filename-exons1", dest="filename_exons1", type="string",
                      help="filename with exon information for schema1. If not given, the database will be used.")

    parser.add_option("--filename-exons2", dest="filename_exons2", type="string",
                      help="filename with exon information for schema2. If not given, the database will be used.")

    parser.set_defaults(
        species_regex="^([^|]+)\|",
        gene_regex="^[^|]+\|[^|]+\|([^|]+)\|",
        separator="|",
        tablename_predictions="predictions",
        fix1=False,
        fix2=False,
        write_map=False,
        filename_exons1=None,
        filename_exons2=None,
        schema1=None,
        schema2=None,
    )

    (options, args) = E.Start(parser,
                              add_pipe_options=True,
                              add_database_options=True)

    if not options.filename_exons1 and not options.filename_exons2:
        dbhandle = pgdb.connect(options.psql_connection)

    rs = re.compile(options.species_regex)
    rg = re.compile(options.gene_regex)

    t0 = time.time()

    ninput, noutput, nmissed, nskipped = 0, 0, 0, 0

    orthologs = Orthologs.ReadInterpretation(sys.stdin,
                                             options.separator)

    t1 = time.time()

    E.info("read %i groups in %i seconds" % (len(orthologs), (t1 - t0)))

    if len(orthologs) == 0:
        raise IOError("empty input.")

    orthologs = Orthologs.ClusterOrthologsByGenes(orthologs)

    # map transcripts2genes
    transcripts1, transcripts2, genes1, genes2, weight = orthologs[0]
    schema1 = transcripts1[0].mSchema
    schema2 = transcripts2[0].mSchema

    if options.filename_exons1:
        rschema1, map_transcript2location1 = GetPrediction2LocationFromFile(
            open(options.filename_exons1, "r"), options)
    else:
        map_transcript2location1 = GetPrediction2Location(dbhandle, schema1,
                                                          tablename_predictions=options.tablename_predictions)

    E.info("collected %i for map_transcript2location1" %
           len(map_transcript2location1))

    if options.filename_exons2:
        rschema2, map_transcript2location2 = GetPrediction2LocationFromFile(
            open(options.filename_exons2, "r"), options)
    else:
        map_transcript2location2 = GetPrediction2Location(dbhandle, schema2,
                                                          tablename_predictions=options.tablename_predictions)

    E.info("collected %i for map_transcript2location2" %
           len(map_transcript2location2))

    # swop maps, if schemas have become confused (can happen if files are
    # supplied)
    if rschema2 == schema1 and rschema1 == schema2:
        map_transcript2location1, map_transcript2location2 = map_transcript2location2, map_transcript2location1
    elif schema1 != rschema1 or schema2 != rschema2:
        raise ValueError("mismatch in schemas of orthologs and supplied exons: %s != %s or %s != %s" %
                         (schema1, rschema1, schema2, rschema2))

    t2 = time.time()

    E.info("retrieved locations in %i seconds" % (t2 - t1))

    for transcripts1, transcripts2, genes1, genes2, weight in orthologs:
        ninput += 1
        Write(transcripts1, map_transcript2location1, options.fix1, options)
        Write(transcripts2, map_transcript2location2, options.fix2, options)
        noutput += 1

    E.info("ninput=%i, noutput=%i, nmissed=%i, skipped=%i" %
           (ninput, noutput, nmissed, nskipped))
    E.Stop()

if __name__ == "__main__":
    sys.exit(main(sys.argv))


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
org.apache.poi.hwpf.model (POI API Documentation)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

org.apache.poi.hwpf.model

Interfaces

CharIndexTranslator

FibRgLw

HDFType

Classes

BookmarkFirstDescriptor

BookmarksTables

BytePropertyNode

CHPBinTable

CHPFormattedDiskPage

CHPX

Colorref

ComplexFileTable

DocumentProperties

EscherRecordHolder

FFData

FFDataBase

Ffn

FibBase

FIBFieldHandler

FibRgLw97

FibRgW97

FieldDescriptor

FieldsTables

FileInformationBlock

FontTable

FootnoteReferenceDescriptor

FormattedDiskPage

FSPA

FSPATable

GenericPropertyNode

Grfhic

Hyphenation

LFO

LFOData

ListData

ListFormatOverrideLevel

ListLevel

ListTables

NilPICFAndBinData

NotesTables

OldCHPBinTable

OldComplexFileTable

OldFfn

OldFontTable

OldPAPBinTable

OldSectionTable

OldTextPiece

OldTextPieceTable

PAPBinTable

PAPFormattedDiskPage

PAPX

ParagraphHeight

PICF

PICFAndOfficeArtData

PicturesTable

PieceDescriptor

PlexOfCps

PlexOfField

PlfLfo

PropertyModifier

PropertyNode

PropertyNode.EndComparator

PropertyNode.StartComparator

RevisionMarkAuthorTable

SavedByEntry

SavedByTable

SectionDescriptor

SectionTable

SEPX

SinglentonTextPiece

Sttb

StyleDescription

StyleSheet

TabDescriptor

TextPiece

TextPieceTable

TextPieceTable.FCComparator

UnhandledDataStructure

UPX

Xst

Xstz

Enums

FieldsDocumentPart

FSPADocumentPart

NoteType

SubdocumentType


text:
package main

import (
	"bytes"
	"io/ioutil"
	"log"
	"math"
	"os"
	"path/filepath"
	"sort"
	"strconv"
	"text/template"
)

type site struct {
	Config config
	Posts  []post
}

var blog site

func newSite(cfg config) site {
	blog = site{Config: cfg}
	return blog
}

func (s *site) build() {
	if err := os.RemoveAll(s.Config.Public); err != nil {
		log.Fatalf("error removing site folder: %v\n", err)
	}
	if err := os.Mkdir(s.Config.Public, 0755); err != nil {
		log.Fatalf("error creating site folder: %v\n", err)
	}

	if err := filepath.Walk(s.Config.Posts, readPosts(s)); err != nil {
		log.Fatalf("error reading posts: %v\n", err)
	}

	if err := s.copyTemplateFiles(); err != nil {
		log.Fatalf("error copying tempalte files to site directory: %v\n", err)
	}

	indexPages, err := s.generateIndex()
	if err != nil {
		log.Fatalf("error writing index pages: %v\n", err)
	}

	if err := s.writePosts(); err != nil {
		log.Fatalf("error writing posts pages: %v\n", err)
	}

	if err := s.writeIndex(indexPages); err != nil {
		log.Fatalf("error writing index pages: %v\n", err)
	}
}

func readPosts(s *site) filepath.WalkFunc {
	return func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}

		if info.IsDir() {
			return nil
		}

		p, err := newPost(path)
		if err != nil {
			return err
		}

		s.Posts = append(s.Posts, p)

		return nil
	}
}

func (s *site) writePosts() error {
	for _, p := range s.Posts {
		if err := os.MkdirAll(s.Config.Public+p.Permalink, 0755); err != nil {
			return err
		}
		postHTML, err := p.build(s)
		if err != nil {
			return err
		}
		if err := ioutil.WriteFile(s.Config.Public+p.Permalink+"index.html", []byte(postHTML), 0755); err != nil {
			return err
		}
	}
	return nil
}

func (s *site) copyTemplateFiles() error {
	if err := copyDir(s.Config.Templates+"/css", s.Config.Public+"/css"); err != nil {
		return err
	}
	if err := copyDir(s.Config.Templates+"/js", s.Config.Public+"/js"); err != nil {
		return err
	}
	if err := copyDir(s.Config.Templates+"/fonts", s.Config.Public+"/fonts"); err != nil {
		return err
	}
	if err := copyDir(s.Config.Templates+"/images", s.Config.Public+"/images"); err != nil {
		return err
	}
	if err := copyDir(s.Config.Images, s.Config.Public+"/img"); err != nil {
		return err
	}
	return nil
}

func (s *site) generateIndex() ([]string, error) {
	var htmlPages []string

	// Read the index template
	templateFile := s.Config.Templates + "/index.html"
	layout, err := ioutil.ReadFile(templateFile)
	if err != nil {
		return nil, err
	}
	indexTemplate := template.Must(template.New("index").Parse(string(layout)))

	// Only posts
	var posts []post
	for _, post := range s.Posts {
		if !post.Page {
			posts = append(posts, post)
		}
	}

	sort.Sort(byDate(posts))

	// Group posts in pages
	pages := int(math.Ceil(float64(len(posts)) / float64(s.Config.PostsPerPage)))
	for i := 0; i < pages; i++ {
		st := 0
		ed := len(posts)
		prev := ""
		next := ""
		curr := ""

		if pages > 1 {
			st = i * s.Config.PostsPerPage
			ed = i*s.Config.PostsPerPage + s.Config.PostsPerPage

			prev = ""
			switch {
			case i == 0:
				curr = "/"
			case i > 1:
				prev = "/p/" + strconv.Itoa(i-1)
				curr = "/p/" + strconv.Itoa(i)
			case i == 1:
				prev = "/"
			}
			next = "/p/" + strconv.Itoa(i+1)
			if i == pages-1 {
				ed = len(posts)
				next = ""
			}
		}

		// Build the index pages
		data := struct {
			Site         *site
			Posts        []post
			CurrentPage  string
			PreviousPage string
			NextPage     string
		}{
			s,
			posts[st:ed],
			curr,
			prev,
			next,
		}

		htmlIndex := &bytes.Buffer{}
		if err := indexTemplate.Execute(htmlIndex, data); err != nil {
			return nil, err
		}

		htmlPages = append(htmlPages, htmlIndex.String())
	}

	return htmlPages, nil
}

func (s *site) writeIndex(indexPages []string) error {
	for i, page := range indexPages {
		path := s.Config.Public
		if i > 0 {
			path = s.Config.Public + "/p/" + strconv.Itoa(i)
			if err := os.MkdirAll(path, 0755); err != nil {
				return err
			}
		}

		if err := ioutil.WriteFile(path+"/index.html", []byte(page), 0755); err != nil {
			return err
		}
	}
	return nil
}


text:
package org.springframework.boot.actuate.autoconfigure.integrationtest;

import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.servlet.ServletManagementContextAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration;
import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer;
import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
import org.springframework.web.context.ConfigurableWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;

/**
 * Integration tests for health groups on an additional path on Jersey.
 *
 * @author Madhura Bhave
 */
class JerseyHealthEndpointAdditionalPathIntegrationTests extends
		AbstractHealthEndpointAdditionalPathIntegrationTests<WebApplicationContextRunner, ConfigurableWebApplicationContext, AssertableWebApplicationContext> {

	JerseyHealthEndpointAdditionalPathIntegrationTests() {
		super(new WebApplicationContextRunner(AnnotationConfigServletWebServerApplicationContext::new)
				.withConfiguration(AutoConfigurations.of(JacksonAutoConfiguration.class, JerseyAutoConfiguration.class,
						EndpointAutoConfiguration.class, ServletWebServerFactoryAutoConfiguration.class,
						WebEndpointAutoConfiguration.class, JerseyAutoConfiguration.class,
						ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class,
						HealthEndpointAutoConfiguration.class, DiskSpaceHealthContributorAutoConfiguration.class))
				.withInitializer(new ServerPortInfoApplicationContextInitializer())
				.withClassLoader(new FilteredClassLoader(DispatcherServlet.class)).withPropertyValues("server.port=0"));
	}

}


text:
'use strict';

/**
 * @ngdoc function
 * @name petulantBooApp.controller:AboutCtrl
 * @description
 * # AboutCtrl
 * Controller of the petulantBooApp
 */
angular.module('petulantBooApp')
  .controller('AboutCtrl', function ($scope) {
    $scope.awesomeThings = [
      'HTML5 Boilerplate',
      'AngularJS',
      'Karma'
    ];
  });


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _LocationBox = require("./LocationBox");

Object.keys(_LocationBox).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  if (key in exports && exports[key] === _LocationBox[key]) return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _LocationBox[key];
    }
  });
});
//# sourceMappingURL=index.js.map


text:
using System.Collections.Generic;
using System.Configuration;

namespace NConfig
{
    internal class AppSettingsMerger : NSectionMerger<AppSettingsSection>
    {

        public override AppSettingsSection Merge(IEnumerable<AppSettingsSection> sections)
        {
            AppSettingsSection result = new AppSettingsSection();

            foreach (AppSettingsSection section in sections) // The order of sections should be from most Important to lower
            {
                foreach (KeyValueConfigurationElement element in section.Settings)
                    if (result.Settings[element.Key] == null)
                        result.Settings.Add(element);
            }

            return result;
        }
    }
}


text:
package org.apache.click.examples.page.table;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.apache.cayenne.BaseContext;
import org.apache.click.control.ActionLink;
import org.apache.click.control.Checkbox;
import org.apache.click.control.Column;
import org.apache.click.control.FieldSet;
import org.apache.click.control.Form;
import org.apache.click.control.Submit;
import org.apache.click.control.Table;
import org.apache.click.control.TextField;
import org.apache.click.examples.control.InvestmentSelect;
import org.apache.click.examples.domain.Customer;
import org.apache.click.examples.page.BorderPage;
import org.apache.click.examples.service.CustomerService;
import org.apache.click.extras.control.DateField;
import org.apache.click.extras.control.DoubleField;
import org.apache.click.extras.control.EmailField;
import org.apache.click.extras.control.FieldColumn;
import org.apache.click.extras.control.FormTable;
import org.apache.click.extras.control.LinkDecorator;
import org.apache.click.extras.control.NumberField;
import org.springframework.stereotype.Component;

/**
 * Provides a CRUD demonstration using Form and FormTable.
 * <p/>
 * Note the following:
 *
 * #1. Form child controls are only processed on Form submission. In order to
 * process Form child controls when form is *not* submitted, Form.onProcess
 * must be overridden and the controls explicitly processed.
 *
 * #2. By default FormTable creates an internal Form for submissions. However
 * it is possible to use the FormTable constructor which accepts a Form so that
 * FormTable can be added to this "external" Form.
 */
@Component
public class EditFormTablePage extends BorderPage {

    private static final long serialVersionUID = 1L;

    private static final int NUM_ROWS = 20;

    private FormTable table;

    private ActionLink deleteCustomer = new ActionLink("delete", "Delete", this, "onDeleteClick");

    private Form customerForm = new Form("customerForm");

    private Form form = new Form("form") {

        private static final long serialVersionUID = 1L;

        /**
         * #1. PLEASE NOTE: FormTable will only be processed by form if the
         * Form is submitted. Thus paging and sorting won't work by default.
         *
         * Here we override the default behavior and explicitly process
         * FormTable (table) so that paging and sorting will still work, even
         * if the Form was not submitted.
         */
        @Override
        public boolean onProcess() {
            if (form.isFormSubmission()) {
                return super.onProcess();
            } else {
                deleteCustomer.onProcess();
                return table.onProcess();
            }
        }
    };

    @Resource(name="customerService")
    private CustomerService customerService;

    // Constructor ------------------------------------------------------------

    public EditFormTablePage() {
        // Setup customers form
        FieldSet fieldSet = new FieldSet("customer");
        fieldSet.add(new TextField("name")).setRequired(true);
        fieldSet.add(new EmailField("email")).setRequired(true);
        fieldSet.add(new InvestmentSelect("investments")).setRequired(true);
        fieldSet.add(new DoubleField("holdings"));
        DateField dateJoined = new DateField("dateJoined");
        dateJoined.setDate(new Date());
        fieldSet.add(dateJoined);
        customerForm.add(fieldSet);
        customerForm.add(new Submit("add", "Add Customer", this, "onAddClick"));

        // #2. Create the FormTable and pass in the existing Form into the
        // constructor. FormTable now knows it should not create an internal
        // Form instance.
        table = new FormTable("table", form);

        // Assemble the FormTable columns
        table.setClass(Table.CLASS_SIMPLE);
        table.setWidth("700px");
        table.setPageSize(5);
        table.setShowBanner(true);

        table.addColumn(new Column("id"));

        FieldColumn column = new FieldColumn("name", new TextField());
        column.getField().setRequired(true);
        column.setVerticalAlign("baseline");
        table.addColumn(column);

        column = new FieldColumn("email", new EmailField());
        column.getField().setRequired(true);
        table.addColumn(column);

        column = new FieldColumn("investments", new InvestmentSelect());
        column.getField().setRequired(true);
        table.addColumn(column);

        NumberField numberField = new NumberField();
        numberField.setSize(5);
        column = new FieldColumn("holdings", numberField);
        column.setTextAlign("right");
        table.addColumn(column);

        column = new FieldColumn("dateJoined", new DateField());
        column.setDataStyle("white-space", "nowrap");
        table.addColumn(column);

        column = new FieldColumn("active", new Checkbox());
        column.setTextAlign("center");
        table.addColumn(column);

        Column actionColumn = new Column("Action");
        actionColumn.setSortable(false);
        ActionLink[] links = new ActionLink[]{deleteCustomer};
        actionColumn.setDecorator(new LinkDecorator(table, links, "id"));
        table.addColumn(actionColumn);

        deleteCustomer.setAttribute("onclick", "return window.confirm('Please confirm delete');");

        table.getForm().add(new Submit("update", "Update Customers", this, "onUpdateCustomersClick"));
        table.getForm().add(new Submit("cancel", this, "onCancelClick"));

        table.setSortable(true);

        fieldSet = new FieldSet("customers");
        form.add(fieldSet);

        // Add FormTable to FieldSet which is attached to Form
        fieldSet.add(table);

        addControl(customerForm);
        addControl(form);
    }

    // Event Handlers ---------------------------------------------------------

    @Override
    public boolean onSecurityCheck() {
        String pagePath = getContext().getPagePath(getClass());

        // In this demo we protect against duplicate post submissions
        if (form.onSubmitCheck(this, pagePath)) {
            return true;
        } else {
            getContext().setFlashAttribute("error", getMessage("invalid.form.submit"));
            return false;
        }
    }

    /**
     * @see org.apache.click.Page#onInit()
     */
    @Override
    public void onInit() {
        super.onInit();

        refreshTableCustomers();
    }

    public boolean onUpdateCustomersClick() {
        if (form.isValid()) {
            // Please note with Cayenne ORM this will persist any changes
            // to data objects submitted by the form.
            BaseContext.getThreadObjectContext().commitChanges();
        }
        return true;
    }

    public boolean onCancelClick() {
        // Rollback any changes made to the customers, which are stored in
        // the data context
         BaseContext.getThreadObjectContext().rollbackChanges();

        refreshTableCustomers();

        table.setRenderSubmittedValues(false);

        form.clearErrors();

        return true;
    }

    public boolean onDeleteClick() {
        Integer id = deleteCustomer.getValueInteger();
        customerService.deleteCustomer(id);

        // The FormTable customer were already set in the onInit phase. Because
        // a customer was deleted we refresh the FormTable row list
        refreshTableCustomers();

        return true;
    }

     public boolean onInsertClick() {
        Customer customer = new Customer();
        customer.setName("Alpha");
        customer.setDateJoined(new Date());
        customerService.saveCustomer(customer);

        // The FormTable customer were already set in the onInit phase. Because
        // a customer was deleted we refresh the FormTable row list
        refreshTableCustomers();

        return true;
    }

    public boolean onAddClick() {
        if (customerForm.isValid()) {
            Customer customer = new Customer();
            customerForm.copyTo(customer);
            customerService.saveCustomer(customer);

            // The FormTable customer was set in the onInit phase. Since we just
            // added a new customer we refresh the FormTable row list
            refreshTableCustomers();
        }
        return true;
    }

    // Private Methods --------------------------------------------------------

    private void refreshTableCustomers() {
        List<Customer> allCustomers = customerService.getCustomersSortedBy(Customer.DATE_JOINED_PROPERTY, false);
        if (!allCustomers.isEmpty()) {
            List<Customer> customers = allCustomers.subList(0, NUM_ROWS);
            table.setRowList(customers);
        }
    }
}