text:
<?php
/**
 * REST API Product Attributes controller
 *
 * Handles requests to the products/attributes endpoint.
 *
 * @author   WooThemes
 * @category API
 * @package  WooCommerce/API
 * @since    2.6.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * REST API Product Attributes controller class.
 *
 * @package WooCommerce/API
 * @extends WC_REST_Controller
 */
class WC_REST_Product_Attributes_Controller extends WC_REST_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = 'wc/v1';

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = 'products/attributes';

	/**
	 * Attribute name.
	 *
	 * @var string
	 */
	protected $attribute = '';

	/**
	 * Register the routes for product attributes.
	 */
	public function register_routes() {
		register_rest_route( $this->namespace, '/' . $this->rest_base, array(
			array(
				'methods'             => WP_REST_Server::READABLE,
				'callback'            => array( $this, 'get_items' ),
				'permission_callback' => array( $this, 'get_items_permissions_check' ),
				'args'                => $this->get_collection_params(),
			),
			array(
				'methods'             => WP_REST_Server::CREATABLE,
				'callback'            => array( $this, 'create_item' ),
				'permission_callback' => array( $this, 'create_item_permissions_check' ),
				'args'                => array_merge( $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), array(
					'name' => array(
						'required' => true,
					),
				) ),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		));

		register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\d]+)', array(
			array(
				'methods'             => WP_REST_Server::READABLE,
				'callback'            => array( $this, 'get_item' ),
				'permission_callback' => array( $this, 'get_item_permissions_check' ),
				'args'                => array(
					'context'         => $this->get_context_param( array( 'default' => 'view' ) ),
				),
			),
			array(
				'methods'             => WP_REST_Server::EDITABLE,
				'callback'            => array( $this, 'update_item' ),
				'permission_callback' => array( $this, 'update_item_permissions_check' ),
				'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
			),
			array(
				'methods'             => WP_REST_Server::DELETABLE,
				'callback'            => array( $this, 'delete_item' ),
				'permission_callback' => array( $this, 'delete_item_permissions_check' ),
				'args'                => array(
					'force' => array(
						'default'     => false,
						'description' => __( 'Required to be true, as resource does not support trashing.', 'woocommerce' ),
					),
				),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		) );

		register_rest_route( $this->namespace, '/' . $this->rest_base . '/batch', array(
			array(
				'methods'             => WP_REST_Server::EDITABLE,
				'callback'            => array( $this, 'batch_items' ),
				'permission_callback' => array( $this, 'batch_items_permissions_check' ),
				'args'                => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
			),
			'schema' => array( $this, 'get_public_batch_schema' ),
		) );
	}

	/**
	 * Check if a given request has access to read the attributes.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_items_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'attributes', 'read' ) ) {
			return new WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check if a given request has access to create a attribute.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function create_item_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'attributes', 'create' ) ) {
			return new WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you cannot create new resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check if a given request has access to read a attribute.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function get_item_permissions_check( $request ) {
		if ( ! $this->get_taxonomy( $request ) ) {
			return new WP_Error( "woocommerce_rest_taxonomy_invalid", __( "Resource doesn't exist.", 'woocommerce' ), array( 'status' => 404 ) );
		}

		if ( ! wc_rest_check_manager_permissions( 'attributes', 'read' ) ) {
			return new WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot view this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check if a given request has access to update a attribute.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function update_item_permissions_check( $request ) {
		if ( ! $this->get_taxonomy( $request ) ) {
			return new WP_Error( "woocommerce_rest_taxonomy_invalid", __( "Resource doesn't exist.", 'woocommerce' ), array( 'status' => 404 ) );
		}

		if ( ! wc_rest_check_manager_permissions( 'attributes', 'edit' ) ) {
			return new WP_Error( 'woocommerce_rest_cannot_update', __( 'Sorry, you cannot update resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check if a given request has access to delete a attribute.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return WP_Error|boolean
	 */
	public function delete_item_permissions_check( $request ) {
		if ( ! $this->get_taxonomy( $request ) ) {
			return new WP_Error( "woocommerce_rest_taxonomy_invalid", __( "Resource doesn't exist.", 'woocommerce' ), array( 'status' => 404 ) );
		}

		if ( ! wc_rest_check_manager_permissions( 'attributes', 'delete' ) ) {
			return new WP_Error( 'woocommerce_rest_cannot_delete', __( 'Sorry, you cannot delete resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Check if a given request has access batch create, update and delete items.
	 *
	 * @param  WP_REST_Request $request Full details about the request.
	 * @return boolean
	 */
	public function batch_items_permissions_check( $request ) {
		if ( ! wc_rest_check_manager_permissions( 'attributes', 'batch' ) ) {
			return new WP_Error( 'woocommerce_rest_cannot_batch', __( 'Sorry, you are not allowed to manipule this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
		}

		return true;
	}

	/**
	 * Get all attributes.
	 *
	 * @param WP_REST_Request $request
	 * @return array
	 */
	public function get_items( $request ) {
		$attributes = wc_get_attribute_taxonomies();
		$data       = array();
		foreach ( $attributes as $attribute_obj ) {
			$attribute = $this->prepare_item_for_response( $attribute_obj, $request );
			$attribute = $this->prepare_response_for_collection( $attribute );
			$data[] = $attribute;
		}

		return rest_ensure_response( $data );
	}

	/**
	 * Create a single attribute.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Request|WP_Error
	 */
	public function create_item( $request ) {
		global $wpdb;

		$args = array(
			'attribute_label'   => $request['name'],
			'attribute_name'    => $request['slug'],
			'attribute_type'    => ! empty( $request['type'] ) ? $request['type'] : 'select',
			'attribute_orderby' => ! empty( $request['order_by'] ) ? $request['order_by'] : 'menu_order',
			'attribute_public'  => true === $request['has_archives'],
		);

		// Set the attribute slug.
		if ( empty( $args['attribute_name'] ) ) {
			$args['attribute_name'] = wc_sanitize_taxonomy_name( stripslashes( $args['attribute_label'] ) );
		} else {
			$args['attribute_name'] = preg_replace( '/^pa\_/', '', wc_sanitize_taxonomy_name( stripslashes( $args['attribute_name'] ) ) );
		}

		$valid_slug = $this->validate_attribute_slug( $args['attribute_name'], true );
		if ( is_wp_error( $valid_slug ) ) {
			return $valid_slug;
		}

		$insert = $wpdb->insert(
			$wpdb->prefix . 'woocommerce_attribute_taxonomies',
			$args,
			array( '%s', '%s', '%s', '%s', '%d' )
		);

		// Checks for errors.
		if ( is_wp_error( $insert ) ) {
			return new WP_Error( 'woocommerce_rest_cannot_create', $insert->get_error_message(), array( 'status' => 400 ) );
		}

		$attribute = $this->get_attribute( $wpdb->insert_id );

		if ( is_wp_error( $attribute ) ) {
			return $attribute;
		}

		$this->update_additional_fields_for_object( $attribute, $request );

		/**
		 * Fires after a single product attribute is created or updated via the REST API.
		 *
		 * @param stdObject       $attribute Inserted attribute object.
		 * @param WP_REST_Request $request   Request object.
		 * @param boolean         $creating  True when creating attribute, false when updating.
		 */
		do_action( 'woocommerce_rest_insert_product_attribute', $attribute, $request, true );

		$request->set_param( 'context', 'edit' );
		$response = $this->prepare_item_for_response( $attribute, $request );
		$response = rest_ensure_response( $response );
		$response->set_status( 201 );
		$response->header( 'Location', rest_url( '/' . $this->namespace . '/' . $this->rest_base . '/' . $attribute->attribute_id ) );

		// Clear transients.
		flush_rewrite_rules();
		delete_transient( 'wc_attribute_taxonomies' );

		return $response;
	}

	/**
	 * Get a single attribute.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Request|WP_Error
	 */
	public function get_item( $request ) {
		global $wpdb;

		$attribute = $this->get_attribute( $request['id'] );

		if ( is_wp_error( $attribute ) ) {
			return $attribute;
		}

		$response = $this->prepare_item_for_response( $attribute, $request );

		return rest_ensure_response( $response );
	}

	/**
	 * Update a single term from a taxonomy.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Request|WP_Error
	 */
	public function update_item( $request ) {
		global $wpdb;

		$id     = (int) $request['id'];
		$format = array( '%s', '%s', '%s', '%s', '%d' );
		$args   = array(
			'attribute_label'   => $request['name'],
			'attribute_name'    => $request['slug'],
			'attribute_type'    => $request['type'],
			'attribute_orderby' => $request['order_by'],
			'attribute_public'  => $request['has_archives'],
		);

		$i = 0;
		foreach ( $args as $key => $value ) {
			if ( empty( $value ) && ! is_bool( $value ) ) {
				unset( $args[ $key ] );
				unset( $format[ $i ] );
			}

			$i++;
		}

		// Set the attribute slug.
		if ( ! empty( $args['attribute_name'] ) ) {
			$args['attribute_name'] = preg_replace( '/^pa\_/', '', wc_sanitize_taxonomy_name( stripslashes( $args['attribute_name'] ) ) );

			$valid_slug = $this->validate_attribute_slug( $args['attribute_name'], true );
			if ( is_wp_error( $valid_slug ) ) {
				return $valid_slug;
			}
		}

		$update = $wpdb->update(
			$wpdb->prefix . 'woocommerce_attribute_taxonomies',
			$args,
			array( 'attribute_id' => $id ),
			$format,
			array( '%d' )
		);

		// Checks for errors.
		if ( false === $update ) {
			return new WP_Error( 'woocommerce_rest_cannot_edit', __( 'Could not edit the attribute', 'woocommerce' ), array( 'status' => 400 ) );
		}

		$attribute = $this->get_attribute( $id );

		if ( is_wp_error( $attribute ) ) {
			return $attribute;
		}

		$this->update_additional_fields_for_object( $attribute, $request );

		/**
		 * Fires after a single product attribute is created or updated via the REST API.
		 *
		 * @param stdObject       $attribute Inserted attribute object.
		 * @param WP_REST_Request $request   Request object.
		 * @param boolean         $creating  True when creating attribute, false when updating.
		 */
		do_action( 'woocommerce_rest_insert_product_attribute', $attribute, $request, false );

		$request->set_param( 'context', 'edit' );
		$response = $this->prepare_item_for_response( $attribute, $request );

		// Clear transients.
		flush_rewrite_rules();
		delete_transient( 'wc_attribute_taxonomies' );

		return rest_ensure_response( $response );
	}

	/**
	 * Delete a single attribute.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return WP_REST_Response|WP_Error
	 */
	public function delete_item( $request ) {
		global $wpdb;

		$force = isset( $request['force'] ) ? (bool) $request['force'] : false;

		// We don't support trashing for this type, error out.
		if ( ! $force ) {
			return new WP_Error( 'woocommerce_rest_trash_not_supported', __( 'Resource does not support trashing.', 'woocommerce' ), array( 'status' => 501 ) );
		}

		$attribute = $this->get_attribute( $request['id'] );

		if ( is_wp_error( $attribute ) ) {
			return $attribute;
		}

		$request->set_param( 'context', 'edit' );
		$response = $this->prepare_item_for_response( $attribute, $request );

		$deleted = $wpdb->delete(
			$wpdb->prefix . 'woocommerce_attribute_taxonomies',
			array( 'attribute_id' => $attribute->attribute_id ),
			array( '%d' )
		);

		if ( false === $deleted ) {
			return new WP_Error( 'woocommerce_rest_cannot_delete', __( 'The resource cannot be deleted.', 'woocommerce' ), array( 'status' => 500 ) );
		}

		$taxonomy = wc_attribute_taxonomy_name( $attribute->attribute_name );

		if ( taxonomy_exists( $taxonomy ) ) {
			$terms = get_terms( $taxonomy, 'orderby=name&hide_empty=0' );
			foreach ( $terms as $term ) {
				wp_delete_term( $term->term_id, $taxonomy );
			}
		}

		/**
		 * Fires after a single attribute is deleted via the REST API.
		 *
		 * @param stdObject        $attribute     The deleted attribute.
		 * @param WP_REST_Response $response The response data.
		 * @param WP_REST_Request  $request  The request sent to the API.
		 */
		do_action( 'woocommerce_rest_delete_product_attribute', $attribute, $response, $request );

		// Fires woocommerce_attribute_deleted hook.
		do_action( 'woocommerce_attribute_deleted', $attribute->attribute_id, $attribute->attribute_name, $taxonomy );

		// Clear transients.
		flush_rewrite_rules();
		delete_transient( 'wc_attribute_taxonomies' );

		return $response;
	}

	/**
	 * Prepare a single product attribute output for response.
	 *
	 * @param obj $item Term object.
	 * @param WP_REST_Request $request
	 * @return WP_REST_Response $response
	 */
	public function prepare_item_for_response( $item, $request ) {
		$data = array(
			'id'           => (int) $item->attribute_id,
			'name'         => $item->attribute_label,
			'slug'         => wc_attribute_taxonomy_name( $item->attribute_name ),
			'type'         => $item->attribute_type,
			'order_by'     => $item->attribute_orderby,
			'has_archives' => (bool) $item->attribute_public,
		);

		$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
		$data    = $this->add_additional_fields_to_object( $data, $request );
		$data    = $this->filter_response_by_context( $data, $context );

		$response = rest_ensure_response( $data );

		$response->add_links( $this->prepare_links( $item ) );

		/**
		 * Filter a attribute item returned from the API.
		 *
		 * Allows modification of the product attribute data right before it is returned.
		 *
		 * @param WP_REST_Response  $response  The response object.
		 * @param object            $item      The original attribute object.
		 * @param WP_REST_Request   $request   Request used to generate the response.
		 */
		return apply_filters( 'woocommerce_rest_prepare_product_attribute', $response, $item, $request );
	}

	/**
	 * Prepare links for the request.
	 *
	 * @param object $attribute Attribute object.
	 * @return array Links for the given attribute.
	 */
	protected function prepare_links( $attribute ) {
		$base  = '/' . $this->namespace . '/' . $this->rest_base;
		$links = array(
			'self' => array(
				'href' => rest_url( trailingslashit( $base ) . $attribute->attribute_id ),
			),
			'collection' => array(
				'href' => rest_url( $base ),
			),
		);

		return $links;
	}

	/**
	 * Get the Attribute's schema, conforming to JSON Schema.
	 *
	 * @return array
	 */
	public function get_item_schema() {
		$schema = array(
			'$schema'              => 'http://json-schema.org/draft-04/schema#',
			'title'                => 'product_attribute',
			'type'                 => 'object',
			'properties'           => array(
				'id' => array(
					'description' => __( 'Unique identifier for the resource.', 'woocommerce' ),
					'type'        => 'integer',
					'context'     => array( 'view', 'edit' ),
					'readonly'    => true,
				),
				'name' => array(
					'description' => __( 'Attribute name.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'arg_options' => array(
						'sanitize_callback' => 'sanitize_text_field',
					),
				),
				'slug' => array(
					'description' => __( 'An alphanumeric identifier for the resource unique to its type.', 'woocommerce' ),
					'type'        => 'string',
					'context'     => array( 'view', 'edit' ),
					'arg_options' => array(
						'sanitize_callback' => 'sanitize_title',
					),
				),
				'type' => array(
					'description' => __( 'Type of attribute.', 'woocommerce' ),
					'type'        => 'string',
					'default'     => 'select',
					'enum'        => array_keys( wc_get_attribute_types() ),
					'context'     => array( 'view', 'edit' ),
				),
				'order_by' => array(
					'description' => __( 'Default sort order.', 'woocommerce' ),
					'type'        => 'string',
					'default'     => 'menu_order',
					'enum'        => array( 'menu_order', 'name', 'name_num', 'id' ),
					'context'     => array( 'view', 'edit' ),
				),
				'has_archives' => array(
					'description' => __( 'Enable/Disable attribute archives.', 'woocommerce' ),
					'type'        => 'boolean',
					'default'     => false,
					'context'     => array( 'view', 'edit' ),
				),
			),
		);

		return $this->add_additional_fields_schema( $schema );
	}

	/**
	 * Get the query params for collections
	 *
	 * @return array
	 */
	public function get_collection_params() {
		$params = array();
		$params['context'] = $this->get_context_param( array( 'default' => 'view' ) );

		return $params;
	}

	/**
	 * Get attribute name.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return string
	 */
	protected function get_taxonomy( $request ) {
		if ( '' !== $this->attribute ) {
			return $this->attribute;
		}

		if ( $request['id'] ) {
			$name = wc_attribute_taxonomy_name_by_id( (int) $request['id'] );

			$this->attribute = $name;
		}

		return $this->attribute;
	}

	/**
	 * Get attribute data.
	 *
	 * @param int $id Attribute ID.
	 * @return stdClass|WP_Error
	 */
	protected function get_attribute( $id ) {
		global $wpdb;

		$attribute = $wpdb->get_row( $wpdb->prepare( "
			SELECT *
			FROM {$wpdb->prefix}woocommerce_attribute_taxonomies
			WHERE attribute_id = %d
		 ", $id ) );

		if ( is_wp_error( $attribute ) || is_null( $attribute ) ) {
			return new WP_Error( 'woocommerce_rest_attribute_invalid', __( "Resource doesn't exist.", 'woocommerce' ), array( 'status' => 404 ) );
		}

		return $attribute;
	}

	/**
	 * Validate attribute slug.
	 *
	 * @param string $slug
	 * @param bool $new_data
	 * @return bool|WP_Error
	 */
	protected function validate_attribute_slug( $slug, $new_data = true ) {
		if ( strlen( $slug ) >= 28 ) {
			return new WP_Error( 'woocommerce_rest_invalid_product_attribute_slug_too_long', sprintf( __( 'Slug "%s" is too long (28 characters max).', 'woocommerce' ), $slug ), array( 'status' => 400 ) );
		} elseif ( wc_check_if_attribute_name_is_reserved( $slug ) ) {
			return new WP_Error( 'woocommerce_rest_invalid_product_attribute_slug_reserved_name', sprintf( __( 'Slug "%s" is not allowed because it is a reserved term.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );
		} elseif ( $new_data && taxonomy_exists( wc_attribute_taxonomy_name( $slug ) ) ) {
			return new WP_Error( 'woocommerce_rest_invalid_product_attribute_slug_already_exists', sprintf( __( 'Slug "%s" is already in use.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );
		}

		return true;
	}
}


text:
// --------------------------------------------------------------------------------
// <copyright file="https://github.com/ddur/DBCL/blob/master/LICENSE" company="DD">
// Copyright © 2013-2016 Dragan Duric. All Rights Reserved.
// </copyright>
// --------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using DD.Diagnostics;

namespace DD.Collections.ICodeSet {

    /// Difference of two sets (Range-Reduce(Set))
    /// <remarks>Cannot be empty, cannot be full, contains at least 3, up to <see cref="Code.MaxCodeCount">Code.MaxCodeCount-1</see> codes</remarks>
    [Serializable]
    public sealed class CodeSetDiff : CodeSet {

        #region Ctor

        public static CodeSetDiff From (ICodeSet a, ICodeSet b) {
            Contract.Requires<ArgumentNullException> (a.IsNot (null));
            Contract.Requires<ArgumentNullException> (b.IsNot (null));

            Contract.Requires<ArgumentEmptyException> (!a.IsEmpty ());
            Contract.Requires<ArgumentEmptyException> (!b.IsEmpty ());

            // a is full range
            Contract.Requires<ArgumentException> (a.Count == a.Length);
            Contract.Requires<ArgumentException> (a is CodeSetFull);

            // b is proper-inner range subset of a
            Contract.Requires<ArgumentException> (a.First < b.First);
            Contract.Requires<ArgumentException> (b.Last CodeSetList.MaxCount)
            Contract.Requires<ArgumentException> ((a.Count - b.Count) > CodeSet.ListMaxCount);

            Contract.Ensures (Contract.Result<CodeSetDiff> ().IsNot (null));

            return new CodeSetDiff (a, b);
        }

        /// Internal Constructor for Reduction
        /// <param name="a">CodeRange</param>
        /// <param name="b">CodeSet</param>
        internal CodeSetDiff (ICodeSet a, ICodeSet b) {
            Contract.Requires<ArgumentNullException> (a.IsNot (null));
            Contract.Requires<ArgumentNullException> (b.IsNot (null));

            Contract.Requires<ArgumentException> (!a.IsEmpty ());
            Contract.Requires<ArgumentException> (!b.IsEmpty ());

            // a is full range
            Contract.Requires<ArgumentException> (a.Count == a.Length);
            Contract.Requires<ArgumentException> (a is CodeSetFull);

            // b is proper-inner range subset of a
            Contract.Requires<ArgumentException> (a.First < b.First);
            Contract.Requires<ArgumentException> (b.Last  Service.ListMaxCount (>CodeSetList.MaxCount)
            Contract.Requires<ArgumentException> ((a.Count - b.Count) > CodeSet.ListMaxCount);

            Contract.Ensures (Theory.Construct (a, b, this));

            this.aSet = a;
            this.bSet = b;
        }

        #endregion

        #region Fields

        private readonly ICodeSet aSet;
        private readonly ICodeSet bSet;

        #endregion

        #region ICodeSet

        [Pure]
        public override bool this[Code code] {
            get {
                return this.aSet[code.Value] && !this.bSet[code.Value];
            }
        }

        [Pure]
        public override bool this[int value] {
            get {
                return this.aSet[value] && !this.bSet[value];
            }
        }

        [Pure]
        public override bool IsEmpty {
            get {
                return false;
            }
        }

        [Pure]
        public override int Count {
            get {
                return aSet.Count - bSet.Count;
            }
        }

        [Pure]
        public override int Length {
            get {
                return this.aSet.Length;
            }
        }

        [Pure]
        public override Code First {
            get {
                return this.aSet.First;
            }
        }

        [Pure]
        public override Code Last {
            get {
                return this.aSet.Last;
            }
        }

        [Pure]
        public override bool IsReduced {
            get {
              	return true; // reduced by Constructor Code-Contracts
            }
        }

        [Pure]
        public override IEnumerator GetEnumerator () {
            foreach (Code code in this.aSet) {
                if (!this.bSet[code]) {
                    yield return code;
                }
            }
        }

        #endregion

        #region Invariant

        [ContractInvariantMethod]
        private void Invariant () {
            Contract.Invariant (Theory.Invariant (this));
        }

        #endregion

        private static class Theory {

            [Pure]
            public static bool Construct (ICodeSet a, ICodeSet b, CodeSetDiff self) {
                Success success = true;

                // input
                success.Assert (!a.Is (null));
                success.Assert (!b.Is (null));
                success.Assert (!a.IsEmpty ());
                success.Assert (!b.IsEmpty ());
                success.Assert (a.Count == a.Length);
                success.Assert (a.First < b.First);
                success.Assert (b.Last  CodeSet.PairCount);

                // input -> private
                success.Assert (self.aSet.Is (a));
                success.Assert (self.bSet.Is (b));

                return success;
            }

            [Pure]
            public static bool Invariant (CodeSetDiff self) {
                Success success = true;

                // private
                success.Assert (!self.aSet.Is (null));
                success.Assert (!self.bSet.Is (null));
                success.Assert (!self.aSet.IsEmpty ());
                success.Assert (!self.bSet.IsEmpty ());
                success.Assert (self.aSet.Count == self.aSet.Length);
                success.Assert (self.aSet.First < self.bSet.First);
                success.Assert (self.bSet.Last < self.aSet.Last);
                success.Assert ((self.aSet.Count - self.bSet.Count) > CodeSet.PairCount);

                // public <- private
                success.Assert (self.Count == self.aSet.Count - self.bSet.Count);
                success.Assert (self.Length == self.aSet.Length);
                success.Assert (self.First == self.aSet.First);
                success.Assert (self.Last == self.aSet.Last);

                // constraints
                success.Assert (self.Count > CodeSet.PairCount);// not Pair
                success.Assert (self.Count < self.Length);				// not Full

                return success;
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
var Thrift = require('thrift').Thrift;
var ttypes = module.exports = {};
ttypes.ResultCode = {
'OK' : 0
,'TRY_LATER' : 1
}
var LogEntry = module.exports.LogEntry = function(args){
  this.category = null
  this.message = null
if( args != null ){  if (null != args.category)
  this.category = args.category
  if (null != args.message)
  this.message = args.message
}}
LogEntry.prototype = {}
LogEntry.prototype.read = function(input){
  var ret = input.readStructBegin()
  while (1)
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP)
      break
    switch(fid)
    {
      case 1:      if (ftype == Thrift.Type.STRING) {
        this.category = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      case 2:      if (ftype == Thrift.Type.STRING) {
        this.message = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

LogEntry.prototype.write = function(output){
  output.writeStructBegin('LogEntry')
  if (null != this.category) {
    output.writeFieldBegin('category', Thrift.Type.STRING, 1)
    output.writeString(this.category)
    output.writeFieldEnd()
  }
  if (null != this.message) {
    output.writeFieldBegin('message', Thrift.Type.STRING, 2)
    output.writeString(this.message)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}


text:
const webpackConfig = require("./webpack.dev.js");

module.exports = (config) => {
  config.set({
    files: [
      "../test/suppressConsoleWarnings.js",
      { pattern: "../test/**/*.spec.js", watched: false },
      { pattern: "../test/**/*.spec.ts", watched: false },
    ],
    preprocessors: {
      "../test/**/*.spec.js": ["webpack"],
      "../test/**/*.spec.ts": ["webpack"],
    },
    browsers: ["ChromeHeadless"],
    frameworks: ["mocha", "chai", "webpack"],
    plugins: [
      require("karma-mocha"),
      require("karma-mocha-reporter"),
      require("karma-chai"),
      require("karma-webpack"),
      require("karma-chrome-launcher"),
    ],
    webpack: webpackConfig,
    reporters: ["mocha"],
    mochaReporter: {
      output: "minimal",
    },
    client: {
      captureConsole: true,
    },
    singleRun: true,
    autoWatch: false,
  });
};


text:
package com.planet_ink.coffee_mud.CharClasses;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

public class Enchanter extends SpecialistMage
{
	@Override public String ID(){return "Enchanter";}
	private final static String localizedStaticName = CMLib.lang()._("Enchanter");
	@Override public String name() { return localizedStaticName; }
	@Override public int domain(){return Ability.DOMAIN_ENCHANTMENT;}
	@Override public int opposed(){return Ability.DOMAIN_ABJURATION;}
	@Override public int availabilityCode(){return Area.THEME_FANTASY;}
	@Override
	public void initializeClass()
	{
		super.initializeClass();
		CMLib.ableMapper().delCharAbilityMapping(ID(),"Spell_ResistMagicMissiles");

		CMLib.ableMapper().addCharAbilityMapping(ID(),8,"Skill_Spellcraft",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),5,"Spell_Fatigue",25,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),7,"Spell_ManaBurn",25,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),10,"Spell_MindLight",25,"",false,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),14,"Spell_Alarm",25,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),16,"Spell_MindFog",25,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),18,"Spell_Enthrall",25,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),20,"Spell_Brainwash",0,"",false,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),21,"Spell_AweOther",0,"",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),23,"Spell_LowerResists",25,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),24,"Spell_MassHold",25,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),25,"Spell_RogueLimb",25,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),30,"Spell_Permanency",true);
	}
}


text:
namespace TelerikAcademy.Data
{
    using System;

    public partial class SalesByCategory_Result
    {
        public string ProductName { get; set; }
        public Nullable<decimal> TotalPurchase { get; set; }
    }
}


text:
errored () {
	errcode=$?
	echo "Deploy encountered errors."
	exit $errcode
}

trap errored ERR

# the folder this script is in (*/bootplate/tools)
TOOLS=$(cd `dirname $0` && pwd)

# application root
SRC="$TOOLS/.."

# enyo location
ENYO="$SRC/enyo"

# deploy script location
DEPLOY="$ENYO/tools/deploy.js"

# check for node, but quietly
if command -v node >/dev/null 2>&1; then
	# use node to invoke deploy with imported parameters
	echo "node $DEPLOY -T -s $SRC -o $SRC/deploy -r $@"
	node "$DEPLOY" -T -s "$SRC" -o "$SRC/deploy" -r $@
else
	echo "No node found in path"
	exit 1
fi

# copy files and package if deploying to cordova webos
while [ "$1" != "" ]; do
	case $1 in
		-w | --cordova-webos )
			# copy appinfo.json and cordova*.js files
			DEST="$TOOLS/../deploy/"${PWD##*/}

			cp "$SRC"/appinfo.json "$DEST" -v
			cp "$SRC"/cordova*.js "$DEST" -v

			# package it up
			mkdir -p "$DEST/bin"
			palm-package "$DEST/bin"
			;;
	esac
	shift
done


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

import { PagetitleService } from '../../../core/pagetitle/pagetitle.service';

@Component({
    selector: 'app-columns',
    templateUrl: './columns.component.html',
    styleUrls: ['./columns.component.scss']
})
export class ColumnsComponent implements OnInit {

    constructor(pt: PagetitleService) {
        pt.setTitle('Columns');
    }

    ngOnInit() {
    }

}


text:
module Engine
  class User < ActiveRecord::Base
  end
end


text:
package pl.info.rkluszczynski.java8.cfuture;

import java.util.concurrent.CompletableFuture;

public class P1Creation {
    public static void main(String[] args) {
        CompletableFuture completableFuture = CompletableFuture.supplyAsync(() -> {
            try {
                Thread.currentThread().sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            finally {
                System.out.println("CFUTURE DONE");
            }
            return "100";
        });

        System.out.println("MAIN DONE");
    }
}


text:
//
//  JBChartInformationView.h
//  JBChartViewDemo
//
//  Created by Terry Worona on 11/11/13.
//
//  Modified by Sonia Casas on 1/5/15.
//  Copyright (c) 2013 Jawbone. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface JBChartInformationView : UIView

/*
 * View must be initialized with a layout type (default = horizontal)
 */
- (id)initWithFrame:(CGRect)frame;

// Content
- (void)setTitleText:(NSString *)titleText;
- (void)setValueText:(NSString *)valueText unitText:(NSString *)unitText;

// Color
- (void)setTitleTextColor:(UIColor *)titleTextColor;
- (void)setValueAndUnitTextColor:(UIColor *)valueAndUnitColor;
- (void)setTextShadowColor:(UIColor *)shadowColor;
- (void)setSeparatorColor:(UIColor *)separatorColor;

// Visibility
- (void)setHidden:(BOOL)hidden animated:(BOOL)animated;

@end


text:
package io.github.resilience4j.bulkhead;

import io.github.resilience4j.core.EventProcessor;
import io.github.resilience4j.core.Registry;
import io.github.resilience4j.core.registry.*;
import io.vavr.Tuple;
import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Test;

import java.time.Duration;
import java.util.*;

import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.BDDAssertions.assertThat;

public class BulkheadRegistryTest {

    private BulkheadConfig config;
    private BulkheadRegistry registry;

    private static Optional<EventProcessor<?>> getEventProcessor(
        Registry.EventPublisher<Bulkhead> ep) {
        return ep instanceof EventProcessor<?> ? Optional.of((EventProcessor<?>) ep)
            : Optional.empty();
    }

    @Before
    public void setUp() {
        registry = BulkheadRegistry.ofDefaults();
        config = BulkheadConfig.custom()
            .maxConcurrentCalls(100)
            .maxWaitDuration(Duration.ofMillis(50))
            .build();
    }

    @Test
    public void shouldInitRegistryTags() {
        BulkheadRegistry registry = BulkheadRegistry.of(config,io.vavr.collection.HashMap.of("Tag1Key","Tag1Value"));
        assertThat(registry.getTags()).isNotEmpty();
        assertThat(registry.getTags()).containsOnly(Tuple.of("Tag1Key","Tag1Value"));
    }

    @Test
    public void shouldReturnCustomConfig() {
        BulkheadRegistry registry = BulkheadRegistry.of(config);

        BulkheadConfig bulkheadConfig = registry.getDefaultConfig();

        assertThat(bulkheadConfig).isSameAs(config);
    }

    @Test
    public void shouldReturnTheCorrectName() {
        Bulkhead bulkhead = registry.bulkhead("test");

        assertThat(bulkhead).isNotNull();
        assertThat(bulkhead.getName()).isEqualTo("test");
        assertThat(bulkhead.getBulkheadConfig().getMaxConcurrentCalls()).isEqualTo(25);
        assertThat(bulkhead.getMetrics().getAvailableConcurrentCalls()).isEqualTo(25);
    }

    @Test
    public void shouldBeTheSameInstance() {
        Bulkhead bulkhead1 = registry.bulkhead("test", config);
        Bulkhead bulkhead2 = registry.bulkhead("test", config);

        assertThat(bulkhead1).isSameAs(bulkhead2);
        assertThat(registry.getAllBulkheads()).hasSize(1);
    }

    @Test
    public void shouldBeNotTheSameInstance() {
        Bulkhead bulkhead1 = registry.bulkhead("test1");
        Bulkhead bulkhead2 = registry.bulkhead("test2");

        assertThat(bulkhead1).isNotSameAs(bulkhead2);
        assertThat(registry.getAllBulkheads()).hasSize(2);
    }

    @Test
    public void noTagsByDefault() {
        Bulkhead retry = registry.bulkhead("testName");
        assertThat(retry.getTags()).hasSize(0);
    }

    @Test
    public void tagsOfRegistryAddedToInstance() {
        BulkheadConfig bulkheadConfig = BulkheadConfig.ofDefaults();
        Map<String, BulkheadConfig> bulkheadConfigs = Collections
            .singletonMap("default", bulkheadConfig);
        io.vavr.collection.Map<String, String> bulkheadTags = io.vavr.collection.HashMap
            .of("key1", "value1", "key2", "value2");
        BulkheadRegistry bulkheadRegistry = BulkheadRegistry.of(bulkheadConfigs, bulkheadTags);
        Bulkhead bulkhead = bulkheadRegistry.bulkhead("testName");

        assertThat(bulkhead.getTags()).containsOnlyElementsOf(bulkheadTags);
    }

    @Test
    public void tagsAddedToInstance() {
        io.vavr.collection.Map<String, String> bulkheadTags = io.vavr.collection.HashMap
            .of("key1", "value1", "key2", "value2");
        Bulkhead bulkhead = registry.bulkhead("testName", bulkheadTags);

        assertThat(bulkhead.getTags()).containsOnlyElementsOf(bulkheadTags);
    }

    @Test
    public void tagsOfRetriesShouldNotBeMixed() {
        BulkheadConfig config = BulkheadConfig.ofDefaults();
        io.vavr.collection.Map<String, String> bulkheadTags = io.vavr.collection.HashMap
            .of("key1", "value1", "key2", "value2");
        Bulkhead bulkhead = registry.bulkhead("testName", config, bulkheadTags);
        io.vavr.collection.Map<String, String> bulkheadTags2 = io.vavr.collection.HashMap
            .of("key3", "value3", "key4", "value4");
        Bulkhead bulkhead2 = registry.bulkhead("otherTestName", config, bulkheadTags2);

        Assertions.assertThat(bulkhead.getTags()).containsOnlyElementsOf(bulkheadTags);
        Assertions.assertThat(bulkhead2.getTags()).containsOnlyElementsOf(bulkheadTags2);
    }

    @Test
    public void tagsOfInstanceTagsShouldOverrideRegistryTags() {
        BulkheadConfig bulkheadConfig = BulkheadConfig.ofDefaults();
        Map<String, BulkheadConfig> bulkheadConfigs = Collections
            .singletonMap("default", bulkheadConfig);
        io.vavr.collection.Map<String, String> registryTags = io.vavr.collection.HashMap
            .of("key1", "value1", "key2", "value2");
        io.vavr.collection.Map<String, String> instanceTags = io.vavr.collection.HashMap
            .of("key1", "value3", "key4", "value4");
        BulkheadRegistry bulkheadRegistry = BulkheadRegistry.of(bulkheadConfigs, registryTags);
        Bulkhead retry = bulkheadRegistry.bulkhead("testName", bulkheadConfig, instanceTags);

        io.vavr.collection.Map<String, String> expectedTags = io.vavr.collection.HashMap
            .of("key1", "value3", "key2", "value2", "key4", "value4");
        Assertions.assertThat(retry.getTags()).containsOnlyElementsOf(expectedTags);
    }

    @Test
    public void testCreateWithConfigurationMap() {
        Map<String, BulkheadConfig> configs = new HashMap<>();
        configs.put("default", BulkheadConfig.ofDefaults());
        configs.put("custom", BulkheadConfig.ofDefaults());

        BulkheadRegistry bulkheadRegistry = BulkheadRegistry.of(configs);

        assertThat(bulkheadRegistry.getDefaultConfig()).isNotNull();
        assertThat(bulkheadRegistry.getConfiguration("custom")).isNotNull();
    }

    @Test
    public void testCreateWithConfigurationMapWithoutDefaultConfig() {
        Map<String, BulkheadConfig> configs = new HashMap<>();
        configs.put("custom", BulkheadConfig.ofDefaults());

        BulkheadRegistry bulkheadRegistry = BulkheadRegistry.of(configs);

        assertThat(bulkheadRegistry.getDefaultConfig()).isNotNull();
        assertThat(bulkheadRegistry.getConfiguration("custom")).isNotNull();
    }

    @Test
    public void testCreateWithSingleRegistryEventConsumer() {
        BulkheadRegistry bulkheadRegistry = BulkheadRegistry
            .of(BulkheadConfig.ofDefaults(), new NoOpBulkheadEventConsumer());

        getEventProcessor(bulkheadRegistry.getEventPublisher())
            .ifPresent(eventProcessor -> assertThat(eventProcessor.hasConsumers()).isTrue());
    }

    @Test
    public void testCreateWithMultipleRegistryEventConsumer() {
        List<RegistryEventConsumer<Bulkhead>> registryEventConsumers = new ArrayList<>();
        registryEventConsumers.add(new NoOpBulkheadEventConsumer());
        registryEventConsumers.add(new NoOpBulkheadEventConsumer());

        BulkheadRegistry bulkheadRegistry = BulkheadRegistry
            .of(BulkheadConfig.ofDefaults(), registryEventConsumers);

        getEventProcessor(bulkheadRegistry.getEventPublisher())
            .ifPresent(eventProcessor -> assertThat(eventProcessor.hasConsumers()).isTrue());
    }

    @Test
    public void testCreateWithConfigurationMapWithSingleRegistryEventConsumer() {
        Map<String, BulkheadConfig> configs = new HashMap<>();
        configs.put("custom", BulkheadConfig.ofDefaults());

        BulkheadRegistry bulkheadRegistry = BulkheadRegistry
            .of(configs, new NoOpBulkheadEventConsumer());

        getEventProcessor(bulkheadRegistry.getEventPublisher())
            .ifPresent(eventProcessor -> assertThat(eventProcessor.hasConsumers()).isTrue());
    }

    @Test
    public void testCreateWithConfigurationMapWithMultiRegistryEventConsumer() {
        Map<String, BulkheadConfig> configs = new HashMap<>();
        configs.put("custom", BulkheadConfig.ofDefaults());

        List<RegistryEventConsumer<Bulkhead>> registryEventConsumers = new ArrayList<>();
        registryEventConsumers.add(new NoOpBulkheadEventConsumer());
        registryEventConsumers.add(new NoOpBulkheadEventConsumer());

        BulkheadRegistry bulkheadRegistry = BulkheadRegistry.of(configs, registryEventConsumers);

        getEventProcessor(bulkheadRegistry.getEventPublisher())
            .ifPresent(eventProcessor -> assertThat(eventProcessor.hasConsumers()).isTrue());
    }

    @Test
    public void testAddConfiguration() {
        BulkheadRegistry bulkheadRegistry = BulkheadRegistry.ofDefaults();
        bulkheadRegistry.addConfiguration("custom", BulkheadConfig.custom().build());

        assertThat(bulkheadRegistry.getDefaultConfig()).isNotNull();
        assertThat(bulkheadRegistry.getConfiguration("custom")).isNotNull();
    }

    private static class NoOpBulkheadEventConsumer implements RegistryEventConsumer<Bulkhead> {

        @Override
        public void onEntryAddedEvent(EntryAddedEvent<Bulkhead> entryAddedEvent) {
        }

        @Override
        public void onEntryRemovedEvent(EntryRemovedEvent<Bulkhead> entryRemoveEvent) {
        }

        @Override
        public void onEntryReplacedEvent(EntryReplacedEvent<Bulkhead> entryReplacedEvent) {
        }
    }

    @Test
    public void testCreateUsingBuilderWithDefaultConfig() {
        BulkheadRegistry bulkheadRegistry =
            BulkheadRegistry.custom().withBulkheadConfig(BulkheadConfig.ofDefaults()).build();
        Bulkhead bulkhead = bulkheadRegistry.bulkhead("testName");
        Bulkhead bulkhead2 = bulkheadRegistry.bulkhead("otherTestName");
        assertThat(bulkhead).isNotSameAs(bulkhead2);

        assertThat(bulkheadRegistry.getAllBulkheads()).hasSize(2);
    }

    @Test
    public void testCreateUsingBuilderWithCustomConfig() {
        int maxConcurrentCalls = 100;
        BulkheadConfig bulkheadConfig = BulkheadConfig.custom()
            .maxConcurrentCalls(maxConcurrentCalls).build();

        BulkheadRegistry bulkheadRegistry =
            BulkheadRegistry.custom().withBulkheadConfig(bulkheadConfig).build();
        Bulkhead bulkhead = bulkheadRegistry.bulkhead("testName");

        assertThat(bulkhead.getBulkheadConfig().getMaxConcurrentCalls())
            .isEqualTo(maxConcurrentCalls);
    }

    @Test
    public void testCreateUsingBuilderWithoutDefaultConfig() {
        int maxConcurrentCalls = 100;
        BulkheadConfig bulkheadConfig = BulkheadConfig.custom()
            .maxConcurrentCalls(maxConcurrentCalls).build();

        BulkheadRegistry bulkheadRegistry =
            BulkheadRegistry.custom().addBulkheadConfig("someSharedConfig", bulkheadConfig).build();

        assertThat(bulkheadRegistry.getDefaultConfig()).isNotNull();
        assertThat(bulkheadRegistry.getDefaultConfig().getMaxConcurrentCalls())
            .isEqualTo(25);
        assertThat(bulkheadRegistry.getConfiguration("someSharedConfig")).isNotEmpty();

        Bulkhead bulkhead = bulkheadRegistry
            .bulkhead("name", "someSharedConfig");

        assertThat(bulkhead.getBulkheadConfig()).isEqualTo(bulkheadConfig);
        assertThat(bulkhead.getBulkheadConfig().getMaxConcurrentCalls())
            .isEqualTo(maxConcurrentCalls);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testAddMultipleDefaultConfigUsingBuilderShouldThrowException() {
        BulkheadConfig bulkheadConfig = BulkheadConfig.custom()
            .maxConcurrentCalls(100).build();
        BulkheadRegistry.custom().addBulkheadConfig("default", bulkheadConfig).build();
    }

    @Test
    public void testCreateUsingBuilderWithDefaultAndCustomConfig() {
        BulkheadConfig bulkheadConfig = BulkheadConfig.custom()
            .maxConcurrentCalls(100).build();
        BulkheadConfig customBulkheadConfig = BulkheadConfig.custom()
            .maxConcurrentCalls(200).build();

        BulkheadRegistry bulkheadRegistry = BulkheadRegistry.custom()
            .withBulkheadConfig(bulkheadConfig)
            .addBulkheadConfig("custom", customBulkheadConfig)
            .build();

        assertThat(bulkheadRegistry.getDefaultConfig()).isNotNull();
        assertThat(bulkheadRegistry.getDefaultConfig().getMaxConcurrentCalls())
            .isEqualTo(100);
        assertThat(bulkheadRegistry.getConfiguration("custom")).isNotEmpty();
    }

    @Test
    public void testCreateUsingBuilderWithNullConfig() {
        assertThatThrownBy(
            () -> BulkheadRegistry.custom().withBulkheadConfig(null).build())
            .isInstanceOf(NullPointerException.class).hasMessage("Config must not be null");
    }

    @Test
    public void testCreateUsingBuilderWithMultipleRegistryEventConsumer() {
        BulkheadRegistry bulkheadRegistry = BulkheadRegistry.custom()
            .withBulkheadConfig(BulkheadConfig.ofDefaults())
            .addRegistryEventConsumer(new NoOpBulkheadEventConsumer())
            .addRegistryEventConsumer(new NoOpBulkheadEventConsumer())
            .build();

        getEventProcessor(bulkheadRegistry.getEventPublisher())
            .ifPresent(eventProcessor -> assertThat(eventProcessor.hasConsumers()).isTrue());
    }

    @Test
    public void testCreateUsingBuilderWithRegistryTags() {
        io.vavr.collection.Map<String, String> bulkheadTags = io.vavr.collection.HashMap
            .of("key1", "value1", "key2", "value2");
        BulkheadRegistry bulkheadRegistry = BulkheadRegistry.custom()
            .withBulkheadConfig(BulkheadConfig.ofDefaults())
            .withTags(bulkheadTags)
            .build();
        Bulkhead bulkhead = bulkheadRegistry.bulkhead("testName");

        assertThat(bulkhead.getTags()).containsOnlyElementsOf(bulkheadTags);
    }

    @Test
    public void testCreateUsingBuilderWithRegistryStore() {
        BulkheadRegistry bulkheadRegistry = BulkheadRegistry.custom()
            .withBulkheadConfig(BulkheadConfig.ofDefaults())
            .withRegistryStore(new InMemoryRegistryStore<>())
            .build();
        Bulkhead bulkhead = bulkheadRegistry.bulkhead("testName");
        Bulkhead bulkhead2 = bulkheadRegistry.bulkhead("otherTestName");

        assertThat(bulkhead).isNotSameAs(bulkhead2);
        assertThat(bulkheadRegistry.getAllBulkheads()).hasSize(2);
    }
}


text:
<component name="libraryTable">
  <library name="constraint-layout-solver-1.0.0-alpha8">
    <CLASSES>
      <root url="jar://C:/android/android-sdk-windows/extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha8/constraint-layout-solver-1.0.0-alpha8.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


text:
#pragma once

#include <string>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>

namespace hku {

inline std::string UUID() {
    static auto rgen = boost::uuids::random_generator();
    return boost::uuids::to_string(rgen());
}

}  // namespace hku


text:
/*	$OpenBSD: macobio.c,v 1.2 2001/09/15 01:42:55 mickey Exp $	*/
/*	$NetBSD: obio.c,v 1.6 1999/05/01 10:36:08 tsubai Exp $	*/

/*-
 * Copyright (C) 1998	Internet Research Institute, Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by
 *	Internet Research Institute, Inc.
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/device.h>

#include <dev/pci/pcivar.h>
#include <dev/pci/pcidevs.h>

#include <dev/ofw/openfirm.h>

#include <machine/bus.h>
#include <machine/autoconf.h>

void macobio_attach __P((struct device *, struct device *, void *));
int macobio_match __P((struct device *, void *, void *));
int macobio_print __P((void *, const char *));
void *undef_mac_establish __P((void * lcv, int irq, int type, int level,
    int (*ih_fun) __P((void *)), void *ih_arg, char *name));
void mac_intr_disestab __P((void *lcp, void *arg));

struct macobio_softc {
	struct device sc_dev;
	int sc_node;
	struct ppc_bus_space sc_membus_space;
};
struct cfdriver macobio_cd = {
	NULL, "macobio", DV_DULL,
};

struct cfattach macobio_ca = {
	sizeof(struct macobio_softc), macobio_match, macobio_attach
};

int
macobio_match(parent, cf, aux)
	struct device *parent;
	void *cf;
	void *aux;
{
	struct pci_attach_args *pa = aux;

	if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_APPLE)
		switch (PCI_PRODUCT(pa->pa_id)) {

		case PCI_PRODUCT_APPLE_GC:
		case PCI_PRODUCT_APPLE_OHARE:
		case PCI_PRODUCT_APPLE_HEATHROW:
		case PCI_PRODUCT_APPLE_PADDINGTON:
		case PCI_PRODUCT_APPLE_KEYLARGO:
		case PCI_PRODUCT_APPLE_PANGEA_MACIO:
			return 1;
		}

	return 0;
}

#define HEATHROW_FCR_OFFSET 0x38
u_int32_t *heathrow_FCR = NULL;

/*
 * Attach all the sub-devices we can find
 */
void
macobio_attach(parent, self, aux)
	struct device *parent, *self;
	void *aux;
{
	struct macobio_softc *sc = (struct macobio_softc *)self;
	struct pci_attach_args *pa = aux;
	struct confargs ca;
	int node, child, namelen;
	u_int32_t reg[20];
	int32_t intr[8];
	char name[32];
	int need_interrupt_controller = 0;

	switch (PCI_PRODUCT(pa->pa_id)) {

	/* XXX should not use name */
	case PCI_PRODUCT_APPLE_GC:
		node = OF_finddevice("/bandit/gc");
		need_interrupt_controller = 1;
		break;

	case PCI_PRODUCT_APPLE_OHARE:
		node = OF_finddevice("/bandit/ohare");
		need_interrupt_controller = 1;
		break;

	case PCI_PRODUCT_APPLE_HEATHROW:
	case PCI_PRODUCT_APPLE_PADDINGTON:
		node = OF_finddevice("mac-io");
		if (node == -1)
			node = OF_finddevice("/pci/mac-io");
		if (OF_getprop(node, "assigned-addresses", reg, sizeof(reg))
			== (sizeof (reg[0]) * 5))
		{
			/* always ??? */
			heathrow_FCR = mapiodev(reg[2] + HEATHROW_FCR_OFFSET,
				4);
		}
		break;
	case PCI_PRODUCT_APPLE_KEYLARGO:
	case PCI_PRODUCT_APPLE_PANGEA_MACIO:
		node = OF_finddevice("mac-io");
		if (node == -1)
			node = OF_finddevice("/pci/mac-io");

		break;
	default:
		printf(": unknown macobio controller\n");
		return;
	}
	sc->sc_node = node;

	if (OF_getprop(node, "assigned-addresses", reg, sizeof(reg)) < 12)
		return;

	ca.ca_baseaddr = reg[2];

	sc->sc_membus_space.bus_base = ca.ca_baseaddr;

	sc->sc_membus_space.bus_reverse = 1;

	ca.ca_iot = &sc->sc_membus_space;
	ca.ca_dmat = pa->pa_dmat;

	printf("\n");

	/*
	 * This might be a hack, but it makes the interrupt controller
	 * attach as expected if a device node existed in the OF tree.
	 */
	if (need_interrupt_controller) {
		/* force attachment of legacy interrupt controllers */
		ca.ca_name = "legacy-interrupt-controller";
		ca.ca_node = 0;

		ca.ca_nreg  = 0;
		ca.ca_nintr = 0;

		ca.ca_reg = 0;
		ca.ca_intr = 0;

		config_found(self, &ca, macobio_print);
	}

	for (child = OF_child(node); child; child = OF_peer(child)) {
		namelen = OF_getprop(child, "name", name, sizeof(name));
		if (namelen < 0)
			continue;
		if (namelen >= sizeof(name))
			continue;

		name[namelen] = 0;
		ca.ca_name = name;
		ca.ca_node = child;

		ca.ca_nreg  = OF_getprop(child, "reg", reg, sizeof(reg));
		ca.ca_nintr = OF_getprop(child, "AAPL,interrupts", intr,
				sizeof(intr));
		if (ca.ca_nintr == -1)
			ca.ca_nintr = OF_getprop(child, "interrupts", intr,
					sizeof(intr));

		ca.ca_reg = reg;
		ca.ca_intr = intr;

		config_found(self, &ca, macobio_print);
	}
}

int
macobio_print(aux, macobio)
	void *aux;
	const char *macobio;
{
#ifdef MACOBIOVERBOSE
	struct confargs *ca = aux;

	if (macobio)
		printf("%s at %s", ca->ca_name, macobio);

	if (ca->ca_nreg > 0)
		printf(" offset 0x%x", ca->ca_reg[0]);

	return UNCONF;
#else
	return QUIET;
#endif
}

void *
undef_mac_establish(lcv, irq, type, level, ih_fun, ih_arg, name)
	void * lcv;
	int irq;
	int type;
	int level;
	int (*ih_fun) __P((void *));
	void *ih_arg;
	char *name;
{
	printf("mac_intr_establish called, not yet inited\n");
	return 0;
}

void
mac_intr_disestab(lcp, arg)
	void *lcp;
	void *arg;
{
	printf("mac_intr_disestablish called, not yet inited\n");
}

intr_establish_t *mac_intr_establish_func = undef_mac_establish;
intr_disestablish_t *mac_intr_disestablish_func = mac_intr_disestab;

void *
mac_intr_establish(lcv, irq, type, level, ih_fun, ih_arg, name)
	void * lcv;
	int irq;
	int type;
	int level;
	int (*ih_fun) __P((void *));
	void *ih_arg;
	char *name;
{
	return (*mac_intr_establish_func)(lcv, irq, type, level, ih_fun,
		ih_arg, name);
}
void
mac_intr_disestablish(lcp, arg)
	void *lcp;
	void *arg;
{
	(*mac_intr_disestablish_func)(lcp, arg);
}


text:
require 'redis'

module RedisDictionary
  class Engine < ::Rails::Engine
    isolate_namespace RedisDictionary

    cattr_accessor :redis
    @@redis = Redis.new

    class << self
      def load!
        I18n.backend = I18n::Backend::Simple.new
        I18n.t('hello')
        translations = I18n.backend.send(:translations)
        keys = extract_i18n_keys(translations)

        Engine.redis.del('system_keys')
        to_resave = {}
        keys.each do |full_key|
          key = full_key.split('.')[1..-1].join('.')
          locale = full_key.split('.')[0]
          Engine.redis.sadd('system_keys', key)
          to_resave[full_key] = I18n.t(key, locale: locale)
        end

        I18n.backend = I18n::Backend::Chain.new(I18n::Backend::KeyValue.new(Engine.redis), I18n.backend)
        to_resave.each do |full_key, value|
          key = full_key.split('.')[1..-1].join('.')
          locale = full_key.split('.')[0]
          I18n.backend.store_translations(locale, {key => value}, :escape => false)
        end

        RedisDictionary::Translation.rehash!
      end

      def extract_i18n_keys(hash, parent_keys = [])
        hash.inject([]) do |keys, (key, value)|
          full_key = parent_keys + [key]
          if value.is_a?(Hash)
            # Nested hash
            keys += extract_i18n_keys(value, full_key)
          elsif value.present?
            # String leaf node
            keys << full_key.join(".")
          end
          keys
        end
      end
    end

  end
end


text:
'use strict';

var path = require('path')
, basename = path.basename(__filename, '.js')
, debug = require('debug')('dm:server:' + basename)
, async = require('async')
, http = require('http')
, merge = require('utils-merge')
, querystring = require('querystring')
;

module.exports = function (options, commands, strm, next) {
  if (commands && Array.isArray(commands)) {
    async.reduce(commands, strm, function (previous, item, callback) {
        var qs = querystring.stringify(item.form);
        var opts = {
          host: options.host,
          port: options.port,
          method: 'PUT',
          path: '/' + item.action + '?' + qs,
          headers: item.headers || {}
        }
        debug('/' + options.id + '/' + item.action + ' -  Query String : ', qs ? qs : 'none.');
        var lreq = http.request(opts, function (lres) {
            debug('/' + options.id + '/' + item.action + ' - Status ' + lres.statusCode);
            if (lres.statusCode === 200) {
              callback(null, lres)
            }
            else {
              var msg = lres.statusCode + ' Error ' + opts.path.link.href;
              callback(new Error(msg), lres);
            }
          }
        );
        lreq.on('error', function (e) {
            debug('/' + options.id + '/' + item.action + ' - Piping error :', e);
            callback(e, previous)
          }
        );
        previous.pipe(lreq);
      }, function (err, lastres) {
        if (err) {
          next(err, strm);
        }
        else {
          next(null, lastres);
        }
      }
    );
  }
  else {
    next(null, strm);
  }
}


text:
package org.eclipse.php.internal.core.ast.nodes;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.eclipse.php.internal.core.PHPVersion;
import org.eclipse.php.internal.core.ast.match.ASTMatcher;
import org.eclipse.php.internal.core.ast.visitor.Visitor;

/**
 * Represents conditional expression
 * Holds the condition, if true expression and if false expression
 * each on e can be any expression
 *
e.g. (bool) $a ? 3 : 4
 * $a > 0 ? $a : -$a
 *

 * The node supports also the new notation introduced in PHP 5.3:
 *

 * $a ? : $b
 */
public class ConditionalExpression extends Expression {

	private Expression condition;
	private Expression ifTrue;
	private Expression ifFalse;

	/**
	 * The "expression" structural property of this node type.
	 */
	public static final ChildPropertyDescriptor CONDITION_PROPERTY =
		new ChildPropertyDescriptor(ConditionalExpression.class, "condition", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
	public static final ChildPropertyDescriptor IF_TRUE_PROPERTY =
		new ChildPropertyDescriptor(ConditionalExpression.class, "ifTrue", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$
	public static final ChildPropertyDescriptor IF_FALSE_PROPERTY =
		new ChildPropertyDescriptor(ConditionalExpression.class, "ifFalse", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$

	/**
	 * A list of property descriptors (element type:
	 * {@link StructuralPropertyDescriptor}),
	 * or null if uninitialized.
	 */
	private static final List<StructuralPropertyDescriptor> PROPERTY_DESCRIPTORS;
	static {
		List<StructuralPropertyDescriptor> list = new ArrayList<StructuralPropertyDescriptor>(3);
		list.add(CONDITION_PROPERTY);
		list.add(IF_TRUE_PROPERTY);
		list.add(IF_FALSE_PROPERTY);
		PROPERTY_DESCRIPTORS = Collections.unmodifiableList(list);
	}

	public ConditionalExpression(AST ast) {
		super(ast);
	}

	public ConditionalExpression(int start, int end, AST ast, Expression condition, Expression ifTrue, Expression ifFalse) {
		super(start, end, ast);

		if (condition == null || (ast.apiLevel().isLessThan(PHPVersion.PHP5_3) && ifTrue == null) || ifFalse == null) {
			throw new IllegalArgumentException();
		}
		setCondition(condition);
		setIfTrue(ifTrue);
		setIfFalse(ifFalse);
	}

	public void accept0(Visitor visitor) {
		final boolean visit = visitor.visit(this);
		if (visit) {
			childrenAccept(visitor);
		}
		visitor.endVisit(this);
	}

	public void childrenAccept(Visitor visitor) {
		condition.accept(visitor);
		if (ifTrue != null) {
			ifTrue.accept(visitor);
		}
		ifFalse.accept(visitor);
	}

	public void traverseTopDown(Visitor visitor) {
		accept(visitor);
		condition.traverseTopDown(visitor);
		if (ifTrue != null) {
			ifTrue.traverseTopDown(visitor);
		}
		ifFalse.traverseTopDown(visitor);
	}

	public void traverseBottomUp(Visitor visitor) {
		condition.traverseBottomUp(visitor);
		ifTrue.traverseBottomUp(visitor);
		ifFalse.traverseBottomUp(visitor);
		accept(visitor);
	}

	public void toString(StringBuffer buffer, String tab) {
		buffer.append(tab).append("<ConditionalExpression"); //$NON-NLS-1$
		appendInterval(buffer);
		buffer.append(">\n"); //$NON-NLS-1$
		buffer.append(TAB).append(tab).append("<Condition>\n"); //$NON-NLS-1$
		condition.toString(buffer, TAB + TAB + tab);
		buffer.append("\n").append(TAB).append(tab).append("</Condition>\n"); //$NON-NLS-1$ //$NON-NLS-2$

		if (ifTrue != null) {
			buffer.append(TAB).append(tab).append("<IfTrue>\n"); //$NON-NLS-1$
			ifTrue.toString(buffer, TAB + TAB + tab);
			buffer.append("\n").append(TAB).append(tab).append("</IfTrue>\n"); //$NON-NLS-1$ //$NON-NLS-2$
		}
		buffer.append(TAB).append(tab).append("<IfFalse>\n"); //$NON-NLS-1$
		ifFalse.toString(buffer, TAB + TAB + tab);
		buffer.append("\n").append(TAB).append(tab).append("</IfFalse>\n"); //$NON-NLS-1$ //$NON-NLS-2$
		buffer.append(tab).append("</ConditionalExpression>"); //$NON-NLS-1$
	}

	public int getType() {
		return ASTNode.CONDITIONAL_EXPRESSION;
	}

	/**
	 * Returns the condition of this conditional expression.
	 *
	 * @return the condition node
	 */
	public Expression getCondition() {
		return this.condition;
	}

	/**
	 * Sets the condition of this conditional expression.
	 *
	 * @param expression the condition node
	 * @exception IllegalArgumentException if:
	 *

	 *
the node belongs to a different AST

	 *
the node already has a parent

	 *
a cycle in would be created

	 *

	 */
	public void setCondition(Expression expression) {
		if (expression == null) {
			throw new IllegalArgumentException();
		}
		ASTNode oldChild = this.condition;
		preReplaceChild(oldChild, expression, CONDITION_PROPERTY);
		this.condition = expression;
		postReplaceChild(oldChild, expression, CONDITION_PROPERTY);
	}

	/**
	 * Returns the "then" part of this conditional expression.
	 *
	 * @return the "then" expression node. This method may return null for PHP 5.3 and greater.
	 */
	public Expression getIfTrue() {
		return ifTrue;
	}

	/**
	 * Sets the "then" part of this conditional expression.
	 *
	 * @param expression the "then" expression node
	 * @exception IllegalArgumentException if:
	 *

	 *
the node belongs to a different AST

	 *
the node already has a parent

	 *
a cycle in would be created

	 *

	 */
	public void setIfTrue(Expression expression) {
		if (ast.apiLevel().isLessThan(PHPVersion.PHP5_3) && expression == null) {
			throw new IllegalArgumentException();
		}
		ASTNode oldChild = this.ifTrue;
		preReplaceChild(oldChild, expression, IF_TRUE_PROPERTY);
		this.ifTrue = expression;
		postReplaceChild(oldChild, expression, IF_TRUE_PROPERTY);
	}

	/**
	 * Returns the "else" part of this conditional expression.
	 *
	 * @return the "else" expression node
	 */
	public Expression getIfFalse() {
		return this.ifFalse;
	}

	/**
	 * Sets the "else" part of this conditional expression.
	 *
	 * @param expression the "else" expression node
	 * @exception IllegalArgumentException if:
	 *

	 *
the node belongs to a different AST

	 *
the node already has a parent

	 *
a cycle in would be created

	 *

	 */
	public void setIfFalse(Expression expression) {
		if (expression == null) {
			throw new IllegalArgumentException();
		}
		ASTNode oldChild = this.ifFalse;
		preReplaceChild(oldChild, expression, IF_FALSE_PROPERTY);
		this.ifFalse = expression;
		postReplaceChild(oldChild, expression, IF_FALSE_PROPERTY);
	}

	/*
	 * Method declared on ASTNode.
	 */
	public boolean subtreeMatch(ASTMatcher matcher, Object other) {
		// dispatch to correct overloaded match method
		return matcher.match(this, other);
	}

	final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
		if (property == CONDITION_PROPERTY) {
			if (get) {
				return getCondition();
			} else {
				setCondition((Expression) child);
				return null;
			}
		}
		if (property == IF_TRUE_PROPERTY) {
			if (get) {
				return getIfTrue();
			} else {
				setIfTrue((Expression) child);
				return null;
			}
		}
		if (property == IF_FALSE_PROPERTY) {
			if (get) {
				return getIfFalse();
			} else {
				setIfFalse((Expression) child);
				return null;
			}
		}
		// allow default implementation to flag the error
		return super.internalGetSetChildProperty(property, get, child);
	}

	@Override
	ASTNode clone0(AST target) {
		final Expression condition = ASTNode.copySubtree(target, this.getCondition());
		final Expression ifTrue = ASTNode.copySubtree(target, this.getIfTrue());
		final Expression ifFalse = ASTNode.copySubtree(target, this.getIfTrue());
		ConditionalExpression result = new ConditionalExpression(this.getStart(), this.getEnd(), target, condition, ifTrue, ifFalse);
		return result;
	}

	@Override
	List<StructuralPropertyDescriptor> internalStructuralPropertiesForType(PHPVersion apiLevel) {
		return PROPERTY_DESCRIPTORS;
	}
}


text:
namespace lldb {

class LLDB_API SBBreakpointLocation
{
public:

    SBBreakpointLocation ();

    SBBreakpointLocation (const lldb::SBBreakpointLocation &rhs);

    ~SBBreakpointLocation ();

    const lldb::SBBreakpointLocation &
    operator = (const lldb::SBBreakpointLocation &rhs);

    break_id_t
    GetID ();

    bool
    IsValid() const;

    lldb::SBAddress
    GetAddress ();

    lldb::addr_t
    GetLoadAddress ();

    void
    SetEnabled(bool enabled);

    bool
    IsEnabled ();

    uint32_t
    GetIgnoreCount ();

    void
    SetIgnoreCount (uint32_t n);

    void
    SetCondition (const char *condition);

    const char *
    GetCondition ();

    void
    SetScriptCallbackFunction (const char *callback_function_name);

    SBError
    SetScriptCallbackBody (const char *script_body_text);

    void
    SetThreadID (lldb::tid_t sb_thread_id);

    lldb::tid_t
    GetThreadID ();

    void
    SetThreadIndex (uint32_t index);

    uint32_t
    GetThreadIndex() const;

    void
    SetThreadName (const char *thread_name);

    const char *
    GetThreadName () const;

    void
    SetQueueName (const char *queue_name);

    const char *
    GetQueueName () const;

    bool
    IsResolved ();

    bool
    GetDescription (lldb::SBStream &description, DescriptionLevel level);

    SBBreakpoint
    GetBreakpoint ();

    SBBreakpointLocation (const lldb::BreakpointLocationSP &break_loc_sp);

private:
    friend class SBBreakpoint;
#ifndef LLDB_DISABLE_PYTHON
    friend class lldb_private::ScriptInterpreterPython;
#endif
    void
    SetLocation (const lldb::BreakpointLocationSP &break_loc_sp);

    lldb::BreakpointLocationSP m_opaque_sp;

};

} // namespace lldb

#endif  // LLDB_SBBreakpointLocation_h_


text:
insert into users (id, email, username, password, name, enabled, account_expired, account_locked, credentials_expired) values (1, 'admin@aol.com', 'admin', '$2a$10$YViIt3pVQU.YJ3bfZDNLPukph6yBWHX6KVScxFvY1lcGGpHQgLi9W', 'Admin', true, false, false, false);
insert into users (id, email, username, password, name, enabled, account_expired, account_locked, credentials_expired) values (2, 'user@aol.com', 'user', '$2a$10$F2a2W8RtbD99xXd9xtwjbuI4zjSYe04kS.s0FyvQcAIDJfh/6jjLW', 'User', true, false, false, false);
insert into users (id, email, username, password, name, enabled, account_expired, account_locked, credentials_expired) values (3, 'keith@aol.com', 'keith', '$2a$10$5XXFOBdlDGnKl4fUUWGSk.6Ldn.9x7ipMpvCXdwWQ.5CjpuV5JwJC', 'Keith', true, false, false, false);
insert into users (id, email, username, password, name, enabled, account_expired, account_locked, credentials_expired) values (4, 'erwin@aol.com', 'erwin', '$2a$10$fu75b5J3fqkpqF.Mz7o7weKSUb5nOL3BcyVdxTXV87TtG0qA6Hw8.', 'Erwin', true, false, false, false);
insert into users (id, email, username, password, name, enabled, account_expired, account_locked, credentials_expired) values (5, 'jeremy@aol.com', 'jeremy', '$2a$10$DDuuuLbcfikHympYff7RA.Uqg1CJO.F0kIwIDF7.nyyRLv..sirCm', 'Jeremy', true, false, false, false);
insert into users (id, email, username, password, name, enabled, account_expired, account_locked, credentials_expired) values (6, 'scott@aol.com', 'scott', '$2a$10$F9WlZNB83SfM07Wk/sNfTuzbnAmQ5rAx9r1PrEFdlEOP23Sbkga/O', 'Scott', true, false, false, false);

------------------------------------------------------------
-- Authorities
------------------------------------------------------------

insert into authorities (id, authority) values (1, 'ROLE_ADMIN');
insert into authorities (id, authority) values (2, 'ROLE_USER');

------------------------------------------------------------
-- User_Authorities
------------------------------------------------------------

insert into user_authorities (user_id, authority_id) values (1, 2);
insert into user_authorities (user_id, authority_id) values (1, 1);
insert into user_authorities (user_id, authority_id) values (2, 2);
insert into user_authorities (user_id, authority_id) values (3, 2);
insert into user_authorities (user_id, authority_id) values (4, 2);
insert into user_authorities (user_id, authority_id) values (5, 2);
insert into user_authorities (user_id, authority_id) values (6, 2);

------------------------------------------------------------
-- PetClinic
------------------------------------------------------------

insert into vets(id, first_name, last_name) values (1, 'James', 'Carter');
insert into vets(id, first_name, last_name) values (2, 'Helen', 'Leary');
insert into vets(id, first_name, last_name) values (3, 'Linda', 'Douglas');
insert into vets(id, first_name, last_name) values (4, 'Rafael', 'Ortega');
insert into vets(id, first_name, last_name) values (5, 'Henry', 'Stevens');
insert into vets(id, first_name, last_name) values (6, 'Sharon', 'Jenkins');

insert into specialties(id, name) values (1, 'radiology');
insert into specialties(id, name) values (2, 'surgery');
insert into specialties(id, name) values (3, 'dentistry');

insert into vet_specialties(vet_id, specialty_id) values (2, 1);
insert into vet_specialties(vet_id, specialty_id) values (3, 2);
insert into vet_specialties(vet_id, specialty_id) values (3, 3);
insert into vet_specialties(vet_id, specialty_id) values (4, 2);
insert into vet_specialties(vet_id, specialty_id) values (5, 1);

insert into pet_types(id, name) values (1, 'cat');
insert into pet_types(id, name) values (2, 'dog');
insert into pet_types(id, name) values (3, 'lizard');
insert into pet_types(id, name) values (4, 'snake');
insert into pet_types(id, name) values (5, 'bird');
insert into pet_types(id, name) values (6, 'hamster');

insert into owners(id, first_name, last_name, address, city, telephone) values (1, 'George', 'Franklin', '110 W. Liberty St.', 'Madison', '6085551023');
insert into owners(id, first_name, last_name, address, city, telephone) values (2, 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', '6085551749');
insert into owners(id, first_name, last_name, address, city, telephone) values (3, 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', '6085558763');
insert into owners(id, first_name, last_name, address, city, telephone) values (4, 'Harold', 'Davis', '563 Friendly St.', 'Windsor', '6085553198');
insert into owners(id, first_name, last_name, address, city, telephone) values (5, 'Peter', 'McTavish', '2387 S. Fair Way', 'Madison', '6085552765');
insert into owners(id, first_name, last_name, address, city, telephone) values (6, 'Jean', 'Coleman', '105 N. Lake St.', 'Monona', '6085552654');
insert into owners(id, first_name, last_name, address, city, telephone) values (7, 'Jeff', 'Black', '1450 Oak Blvd.', 'Monona', '6085555387');
insert into owners(id, first_name, last_name, address, city, telephone) values (8, 'Maria', 'Escobito', '345 Maple St.', 'Madison', '6085557683');
insert into owners(id, first_name, last_name, address, city, telephone) values (9, 'David', 'Schroeder', '2749 Blackhawk Trail', 'Madison', '6085559435');
insert into owners(id, first_name, last_name, address, city, telephone) values (10, 'Carlos', 'Estaban', '2335 Independence La.', 'Waunakee', '6085555487');
insert into owners(id, first_name, last_name, address, city, telephone) values (11, 'Kim', 'Picadilli', '2715 Amanda Way', 'Kissimmee', '7072883864');

insert into pets(id, name, birth_date, pet_type_id, owner_id) values (1, 'Leo', '2010-09-07', 1, 1);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (2, 'Basil', '2012-08-06', 6, 2);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (3, 'Rosy', '2011-04-17', 2, 3);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (4, 'Jewel', '2010-03-07', 2, 3);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (5, 'Iggy', '2010-11-30', 3, 4);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (6, 'George', '2010-01-20', 4, 5);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (7, 'Samantha', '2012-09-04', 1, 6);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (8, 'Max', '2012-09-04', 1, 6);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (9, 'Lucky', '2011-08-06', 5, 7);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (10, 'Mulligan', '2007-02-24', 2, 8);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (11, 'Freddy', '2010-03-09', 5, 9);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (12, 'Lucky', '2010-06-24', 2, 10);
insert into pets(id, name, birth_date, pet_type_id, owner_id) values (13, 'Sly', '2012-06-08', 1, 10);

insert into visits(id, pet_id, visit_date, description) values (1, 7, '2013-01-01', 'rabies shot');
insert into visits(id, pet_id, visit_date, description) values (2, 8, '2013-01-02', 'rabies shot');
insert into visits(id, pet_id, visit_date, description) values (3, 8, '2013-01-03', 'neutered');
insert into visits(id, pet_id, visit_date, description) values (4, 7, '2013-01-04', 'spayed');


text:
YePAutoTabbing
==============

Simple JQuery Auto Tabbing Plugin

This Plugin is helpful to create a autotab feature for Phone #, Created Card # and other fields.

HTML

<input id = "Phone1" class="Length3"/>
-

<input id = "Phone2"  class="Length3"/>
-

<input id = "Phone3"  class="Length4"/>

Java Script

$("#Phone1").YePAutoTabbing({
ID:['Phone1','Phone2','Phone3'],//holds the IDs of the fields
maxLength:[3,3,4]// Holds the maximum length of the Field
});

Refer to the demo html for details

Please leave your comments for any enhancements.


text:
This [Hazelcast](https://hazelcast.org/) Discovery Plugin
will lookup IP addresses of other members by resolving service names against
the Heroku DNS Discovery in [Heroku Private Spaces](https://devcenter.heroku.com/articles/private-spaces).

## Usage

In Maven:

```xml
<dependency>
  <groupId>com.github.jkutner</groupId>
  <artifactId>hazelcast-heroku-discovery</artifactId>
  <version>3.7.0</version>
</dependency>
```

In Gradle:

```groovy
dependencies {
    compile('com.github.jkutner:hazelcast-heroku-discovery:3.7.0')
}
```

A minimal `hazelcast.xml` looks like this:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.7.xsd"
           xmlns="http://www.hazelcast.com/schema/config"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <properties>
    <property name="hazelcast.discovery.enabled">true</property>
  </properties>
  <network>
    <join>
      <!-- deactivate normal discovery -->
      <multicast enabled="false"/>
      <tcp-ip enabled="false" />

      <!-- activate the Heroku DNS Discovery -->
      <discovery-strategies>
        <discovery-strategy
          enabled="true"
          class="com.github.jkutner.hazelcast.HerokuDiscoveryStrategy">
        </discovery-strategy>
      </discovery-strategies>
    </join>
  </network>
</hazelcast>
```

## Hazelcast Discovery SPI

Hazelcast, since 3.6, offers a, so called, Discovery SPI to integrate external discovery mechanisms into the system.
For more information please rely on the official documentation, available [here](http://docs.hazelcast.org/docs/3.6-EA2/manual/html-single/index.html#discovery-spi).

## Configuration

No configuration is required by default. The plugin will detect the service name from the `$HEROKU_DNS_FORMATION_NAME` environment variable set by Heroku.

If you want to configure the `hazelcast.merge.first.run.delay.seconds`, set the following in your `hazelcast.xml`:

```xml
<discovery-strategy
  enabled="true"
  class="com.github.jkutner.hazelcast.HerokuDiscoveryStrategy">
    <properties>
      <property name="mergeDelay">30</property>
    </properties>
</discovery-strategy>
```

If you want to configure the service names (i.e. the process types) that will be discovered, you can set a `;`
delimited list like this:

```xml
<discovery-strategy
  enabled="true"
  class="com.github.jkutner.hazelcast.HerokuDiscoveryStrategy">
    <properties>
      <property name="serviceNames">web;worker;job</property>
    </properties>
</discovery-strategy>
```

## License

MIT


text:
package com.sap.mlt.xliff12.impl.element.header;

import java.util.Collections;
import java.util.List;

import com.sap.mlt.xliff12.api.base.Element;
import com.sap.mlt.xliff12.api.element.header.ExternalFile;
import com.sap.mlt.xliff12.api.element.header.InternalFile;
import com.sap.mlt.xliff12.api.element.header.Reference;
import com.sap.mlt.xliff12.api.exception.ConstraintViolationException;
import com.sap.mlt.xliff12.impl.base.ElementImpl;
import com.sap.mlt.xliff12.impl.base.XliffElementImpl;
import com.sap.mlt.xliff12.impl.util.Assert;
import com.sap.mlt.xliff12.impl.util.NodeIterator;

public class ReferenceImpl extends XliffElementImpl implements Reference {

	public ReferenceImpl(Child child) {
		super(NAME);
		setChild(child);
	}

	public ReferenceImpl(org.w3c.dom.Element elem)
			throws ConstraintViolationException {
		super(NAME, elem);
	}

	private Child child;

	@Override
	protected void assertAttributesValid(org.w3c.dom.Element element)
			throws ConstraintViolationException {
		Assert.xliffAttrRestricted(element, false, false, false);
	}

	@Override
	protected void cloneChildrenFrom(ElementImpl elem) {
		ReferenceImpl source = (ReferenceImpl) elem;
		child = (Child) source.child.clone();
		attach(child);
	}

	@Override
	public List<? extends Element> getChildren() {
		return Collections.singletonList(child);
	}

	@Override
	protected void processChildren(
			List<? extends org.w3c.dom.Node> elementsAndText)
			throws ConstraintViolationException {
		NodeIterator iter = new NodeIterator(elementsAndText, true);
		org.w3c.dom.Element element = iter.getXliffElement(InternalFile.NAME,
				ExternalFile.NAME);
		String name = element.getLocalName();
		if (InternalFile.NAME.equals(name)) {
			child = new InternalFileImpl(element);
		} else {
			child = new ExternalFileImpl(element);
		}
		iter.assertNoMoreNodes();
		attach(child);
	}

	public Child getChild() {
		return child;
	}

	public void setChild(Child child) {
		Assert.notNull(child, "child");
		Assert.isInstance(child, "child", InternalFileImpl.class,
				ExternalFileImpl.class);
		assertNotAttached(child);
		detach(this.child);
		this.child = child;
		attach(this.child);
	}

}


text:
package org.apereo.cas.services;

import org.apereo.cas.configuration.model.support.mfa.BaseMultifactorAuthenticationProviderProperties;
import org.apereo.cas.util.AsciiArtUtils;
import org.apereo.cas.util.ResourceUtils;
import org.apereo.cas.util.scripting.ScriptingUtils;
import org.apereo.cas.util.spring.SpringExpressionLanguageValueResolver;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import lombok.val;

import javax.persistence.Transient;

import java.util.Set;

/**
 * This is {@link GroovyRegisteredServiceMultifactorPolicy}.
 *
 * @author Misagh Moayyed
 * @since 5.3.0
 * @deprecated This component is deprecated as of 6.2.0 and is scheduled to be removed.
 */
@Getter
@Setter
@EqualsAndHashCode
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@Deprecated(since = "6.2.0")
@Slf4j
public class GroovyRegisteredServiceMultifactorPolicy implements RegisteredServiceMultifactorPolicy {
    private static final long serialVersionUID = -3075860754996106437L;

    private String groovyScript;

    @JsonIgnore
    @Transient
    @org.springframework.data.annotation.Transient
    private transient RegisteredServiceMultifactorPolicy groovyPolicyInstance;

    public GroovyRegisteredServiceMultifactorPolicy() {
        AsciiArtUtils.printAsciiArtWarning(LOGGER, getClass().getName() + " is now deprecated and scheduled to be removed in the future.");
    }

    @JsonIgnore
    @Override
    public Set<String> getMultifactorAuthenticationProviders() {
        buildGroovyMultifactorPolicyInstanceIfNeeded();
        return this.groovyPolicyInstance.getMultifactorAuthenticationProviders();
    }

    @JsonIgnore
    @Override
    public BaseMultifactorAuthenticationProviderProperties.MultifactorAuthenticationProviderFailureModes getFailureMode() {
        buildGroovyMultifactorPolicyInstanceIfNeeded();
        return this.groovyPolicyInstance.getFailureMode();
    }

    @JsonIgnore
    @Override
    public String getPrincipalAttributeNameTrigger() {
        buildGroovyMultifactorPolicyInstanceIfNeeded();
        return this.groovyPolicyInstance.getPrincipalAttributeNameTrigger();
    }

    @JsonIgnore
    @Override
    public String getPrincipalAttributeValueToMatch() {
        buildGroovyMultifactorPolicyInstanceIfNeeded();
        return this.groovyPolicyInstance.getPrincipalAttributeValueToMatch();
    }

    @JsonIgnore
    @Override
    public boolean isBypassEnabled() {
        buildGroovyMultifactorPolicyInstanceIfNeeded();
        return this.groovyPolicyInstance.isBypassEnabled();
    }

    @JsonIgnore
    @Override
    public boolean isForceExecution() {
        buildGroovyMultifactorPolicyInstanceIfNeeded();
        return this.groovyPolicyInstance.isForceExecution();
    }

    @JsonIgnore
    @Override
    public boolean isBypassTrustedDeviceEnabled() {
        buildGroovyMultifactorPolicyInstanceIfNeeded();
        return this.groovyPolicyInstance.isBypassTrustedDeviceEnabled();
    }

    @Override
    @JsonIgnore
    public String getBypassPrincipalAttributeName() {
        buildGroovyMultifactorPolicyInstanceIfNeeded();
        return this.groovyPolicyInstance.getBypassPrincipalAttributeName();
    }

    @Override
    @JsonIgnore
    public String getBypassPrincipalAttributeValue() {
        buildGroovyMultifactorPolicyInstanceIfNeeded();
        return this.groovyPolicyInstance.getBypassPrincipalAttributeValue();
    }

    @Override
    @JsonIgnore
    public String getScript() {
        buildGroovyMultifactorPolicyInstanceIfNeeded();
        return this.groovyPolicyInstance.getScript();
    }

    @SneakyThrows
    private void buildGroovyMultifactorPolicyInstanceIfNeeded() {
        if (this.groovyPolicyInstance == null) {
            val groovyResource = ResourceUtils.getResourceFrom(SpringExpressionLanguageValueResolver.getInstance().resolve(this.groovyScript));
            this.groovyPolicyInstance = ScriptingUtils.getObjectInstanceFromGroovyResource(groovyResource, RegisteredServiceMultifactorPolicy.class);
        }
    }

}


text:
/**
 * Module dependencies.
 */

var express = require('express'),
	routes = require('./routes'),
	user = require('./routes/user'),
	app = express(),
	http = require('http'),
	path = require('path'),
	nib = require('nib'),
	server = http.createServer(app).listen(process.env.PORT || 3000, function(){
		console.log('Express server listening on port ' + app.get('port'));
	}),
	socket = require('./routes/socket'),
	io = require('socket.io').listen(server);

// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(express.favicon(__dirname + '/public/images/favicon.ico'));
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);
app.use(require('stylus').middleware(path.join(__dirname, 'public')));
app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' == app.get('env')) {
  app.use(express.errorHandler());
}

app.get('/', routes.index);
app.get('/users', user.list);
app.get('/chat', function(){
	return 'chatting';
});

// io.set('heartbeat timeout', 0);
io.set('heartbeat interval', 100);
//io.set('log', 0);	// turn off debug message

io.sockets.on('connection', socket);

// io.disable('heartbeats');


text:
There are many different command line switches that can be used with Java. This section describes some of the more commonly used switches:

* *-Xms* - Sets the initial heap size for when the JVM starts
* *-Xmx* - Sets the maximum heap size
* *-Xmn* - Sets the size of the Young Generation
* *-XX:PermSize* - Sets the starting size of the Permanent Generation
* *-XX:MaxPermSize* - Sets the maximum size of the Permanent Generation

[Common Heap Related Switches Demo](../labs/lab-heap-usage.md)

# Enable GC log

~~~
-verbose:gc -Xloggc:gc.log
-verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails
-verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps
~~~

## GC Log Example

~~~
2013-03-12T14:47:00.733+0800: 331.682: [Full GC [PSYoungGen: 2064K->0K(14656K)] [PSOldGen: 329172K->331173K(341376K)] 331236K->331173K(356032K) [PSPermGen: 1934K->1934K(16384K)], 0.0040140 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
~~~

* Full GC happened at 2013-03-12T14:47:00.733+0800, after JVM run 331.682 seconds
* Current heap size was changed by GC: 331236K->331173K
* Max heap size: 356032K
* Current permanent size was changed: 1934K->1934K
* Max permanent area size: 16384K
* Full GC took 0.0040140 secs

# Enable heap dump

~~~
-XX:+HeapDumpOnOutOfMemoryError
~~~

# Enable jconsole

* jconsole monitor j2se app(including JMX MBean monitor)

~~~
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
~~~

* jconsole monitor j2se app(Only monitor memory and threads)

~~~
-Dcom.sun.management.jmxremote
~~~


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

namespace TestingPatternsWithDossier.Models
{
    public class Product
    {
        private readonly ICollection<Campaign> _campaigns = new Collection<Campaign>();

        public Product(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
                throw new ArgumentOutOfRangeException("name", "Please specify a name");
            Name = name;
        }

        public string Name { get; protected set; }
        public Campaign LatestCampaign { get; set; }
        public IEnumerable<Campaign> Campaigns { get { return _campaigns; } }

        public virtual void CreateCampaign(DateTime now, Demographic demographic, DateTime start, DateTime end)
        {
            if (LatestCampaign != null && LatestCampaign.GetStatus(now) != CampaignStatus.Ended)
                throw new InvalidOperationException("You can't start a campaign until the existing one has ended.");

            var campaign = new Campaign(demographic, start, end);
            _campaigns.Add(campaign);
            LatestCampaign = campaign;
        }
    }
}


text:
HIDE Ski boot project repository.

##Steps to run
1) Install nodejs on your machine from the following link https://nodejs.org/en/

2) Download or clone the HIDE-Ski-boot repository

3) Go into the HIDE-Ski-boot directory and type

```
npm install
```

4) Once installation is complete type

```
npm install -g gulp
```

5) Finally, to run, type
```
gulp
```


text:
package edu.usu.sdl.openstorefront.core.model;

import edu.usu.sdl.openstorefront.common.util.NetworkUtil;
import edu.usu.sdl.openstorefront.common.util.OpenStorefrontConstant;
import edu.usu.sdl.openstorefront.core.entity.ErrorTypeCode;
import java.io.Serializable;
import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;

/**
 * Used to pass around the error information
 *
 * @author dshurtleff
 */
public class ErrorInfo
		implements Serializable
{

	private static final Logger log = Logger.getLogger(OpenStorefrontConstant.ERROR_LOGGER);

	private Throwable error;
	private String clientIp = "";
	private String requestUrl = "";
	private String requestMethod = "";
	private String inputData = "";
	private String errorTypeCode = ErrorTypeCode.SYSTEM;

	public ErrorInfo(Throwable error, HttpServletRequest request)
	{
		this.error = error;

		if (request != null) {
			requestUrl = request.getRequestURI();
			requestMethod = request.getMethod();
			clientIp = NetworkUtil.getClientIp(request);

			StringBuilder input = new StringBuilder();
			if (StringUtils.isNotBlank(request.getQueryString())) {
				input.append("Query: ").append(request.getQueryString()).append("\n");
			}

			inputData = input.toString();
		}
	}

	public Throwable getError()
	{
		return error;
	}

	public void setError(Throwable error)
	{
		this.error = error;
	}

	public String getClientIp()
	{
		return clientIp;
	}

	public void setClientIp(String clientIp)
	{
		this.clientIp = clientIp;
	}

	public String getRequestUrl()
	{
		return requestUrl;
	}

	public void setRequestUrl(String requestUrl)
	{
		this.requestUrl = requestUrl;
	}

	public String getRequestMethod()
	{
		return requestMethod;
	}

	public void setRequestMethod(String requestMethod)
	{
		this.requestMethod = requestMethod;
	}

	public String getInputData()
	{
		return inputData;
	}

	public void setInputData(String inputData)
	{
		this.inputData = inputData;
	}

	public String getErrorTypeCode()
	{
		return errorTypeCode;
	}

	public void setErrorTypeCode(String errorTypeCode)
	{
		this.errorTypeCode = errorTypeCode;
	}

}


text:
[![Join the chat at https://gitter.im/getconnect/connect-js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/getconnect/connect-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![NPM version](http://img.shields.io/npm/v/connect-js.svg?style=flat)](https://www.npmjs.org/package/connect-js)
![Bower version](http://img.shields.io/bower/v/connect-js.svg?style=flat)
[![Dependency Status](https://david-dm.org/getconnect/connect-js.svg)](https://david-dm.org/getconnect/connect-js)

## Getting Access

Sign up at [https://getconnect.io](https://getconnect.io) to generate and retrieve your API keys so that you can start using the SDK.

## Install using npm

### Core

```ssh
npm install connect-js
```

### Viz

```ssh
npm install connect-js-viz
```

## Install using bower

```ssh
npm install connect-js
```

# CDN
```
https://cdn.getconnect.io/connect-js/{version}/standalone/connect-all.min.js
```

## Module support

The SDK supports CommonJS (node.js/io.js), browserify and global scope.

## Documentation

All of the documentation can be found at [http://docs.getconnect.io](http://docs.getconnect.io).

## Contributing

We love open source, so we are happy to accept pull requests and will endeavor to fix the issues and include the enhancements that the community raise.

## Building

To build, run, and serve the SDK locally run:

```ssh
git clone https://github.com/getconnect/connect-js connect-js
cd connect-js
npm install
gulp serve
```