text:
#include "tensorflow/lite/kernels/internal/reference/integer_ops/depthwise_conv.h"

#include "arm_nnfunctions.h"
#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/internal/common.h"
#include "tensorflow/lite/kernels/internal/quantization_util.h"
#include "tensorflow/lite/kernels/internal/reference/depthwiseconv_float.h"
#include "tensorflow/lite/kernels/internal/reference/depthwiseconv_uint8.h"
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/lite/kernels/padding.h"
#include "tensorflow/lite/micro/kernels/cmsis-nn/scratch_buffer.h"

namespace tflite {
namespace ops {
namespace micro {
namespace depthwise_conv {
namespace {

constexpr int kInputTensor = 0;
constexpr int kFilterTensor = 1;
constexpr int kBiasTensor = 2;
constexpr int kOutputTensor = 0;
constexpr int kMaxChannels = 256;

// Depthwise conv is quantized along dimension 3:
// https://www.tensorflow.org/lite/performance/quantization_spec
constexpr int kDepthwiseConvQuantizedDimension = 3;

struct OpData {
  TfLitePaddingValues padding;
  // The scaling factor from input to output (aka the 'real multiplier') can
  // be represented as a fixed point multiplier plus a left shift.
  int32_t output_multiplier;
  int output_shift;

  // Per channel output multiplier and shift.
  // TODO(b/141139247): Allocate these dynamically when possible.
  int32_t per_channel_output_multiplier[kMaxChannels];
  int32_t per_channel_output_shift[kMaxChannels];

  // The range of the fused activation layer. For example for kNone and
  // uint8_t these would be 0 and 255.
  int32_t output_activation_min;
  int32_t output_activation_max;
};

TfLiteStatus CalculateOpData(TfLiteContext* context, TfLiteNode* node,
                             TfLiteDepthwiseConvParams* params, int width,
                             int height, int filter_width, int filter_height,
                             const TfLiteType data_type, OpData* data) {
  bool has_bias = node->inputs->size == 3;
  // Check number of inputs/outputs
  TF_LITE_ENSURE(context, has_bias || node->inputs->size == 2);
  TF_LITE_ENSURE_EQ(context, node->outputs->size, 1);

  int unused_output_height, unused_output_width;
  data->padding = ComputePaddingHeightWidth(
      params->stride_height, params->stride_width, 1, 1, height, width,
      filter_height, filter_width, params->padding, &unused_output_height,
      &unused_output_width);

  // Note that quantized inference requires that all tensors have their
  // parameters set. This is usually done during quantized training.
  if (data_type != kTfLiteFloat32) {
    const TfLiteTensor* input = GetInput(context, node, kInputTensor);
    const TfLiteTensor* filter = GetInput(context, node, kFilterTensor);
    const TfLiteTensor* bias =
        GetOptionalInputTensor(context, node, kBiasTensor);
    TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
    int num_channels = filter->dims->data[kDepthwiseConvQuantizedDimension];

    TF_LITE_ENSURE_STATUS(tflite::PopulateConvolutionQuantizationParams(
        context, input, filter, bias, output, params->activation,
        &data->output_multiplier, &data->output_shift,
        &data->output_activation_min, &data->output_activation_max,
        data->per_channel_output_multiplier,
        reinterpret_cast<int*>(data->per_channel_output_shift), num_channels));
  }
  return kTfLiteOk;
}

}  // namespace

void* Init(TfLiteContext* context, const char* buffer, size_t length) {
  return nullptr;
}

void Free(TfLiteContext* context, void* buffer) {}

TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
  return kTfLiteOk;
}

TfLiteStatus EvalFloat(TfLiteContext* context, TfLiteNode* node,
                       TfLiteDepthwiseConvParams* params, OpData* data,
                       const TfLiteTensor* input, const TfLiteTensor* filter,
                       const TfLiteTensor* bias, TfLiteTensor* output) {
  float output_activation_min, output_activation_max;
  CalculateActivationRange(params->activation, &output_activation_min,
                           &output_activation_max);

  tflite::DepthwiseParams op_params;
  // Padding type is ignored, but still set.
  op_params.padding_type = PaddingType::kSame;
  op_params.padding_values.width = data->padding.width;
  op_params.padding_values.height = data->padding.height;
  op_params.stride_width = params->stride_width;
  op_params.stride_height = params->stride_height;
  op_params.dilation_width_factor = 1;
  op_params.dilation_height_factor = 1;
  op_params.depth_multiplier = params->depth_multiplier;
  op_params.float_activation_min = output_activation_min;
  op_params.float_activation_max = output_activation_max;

  tflite::reference_ops::DepthwiseConv(
      op_params, GetTensorShape(input), GetTensorData<float>(input),
      GetTensorShape(filter), GetTensorData<float>(filter),
      GetTensorShape(bias), GetTensorData<float>(bias), GetTensorShape(output),
      GetTensorData<float>(output));
  return kTfLiteOk;
}

TfLiteStatus EvalQuantizedPerChannel(TfLiteContext* context, TfLiteNode* node,
                                     TfLiteDepthwiseConvParams* params,
                                     OpData* data, const TfLiteTensor* input,
                                     const TfLiteTensor* filter,
                                     const TfLiteTensor* bias,
                                     TfLiteTensor* output) {
  DepthwiseParams op_params;
  op_params.padding_type = PaddingType::kSame;
  op_params.padding_values.width = data->padding.width;
  op_params.padding_values.height = data->padding.height;
  op_params.stride_width = params->stride_width;
  op_params.stride_height = params->stride_height;
  op_params.dilation_width_factor = params->dilation_width_factor;
  op_params.dilation_height_factor = params->dilation_height_factor;
  op_params.depth_multiplier = params->depth_multiplier;
  op_params.input_offset = -input->params.zero_point;
  op_params.weights_offset = 0;
  op_params.output_offset = output->params.zero_point;
  // TODO(b/130439627): Use calculated value for clamping.
  op_params.quantized_activation_min = std::numeric_limits<int8_t>::min();
  op_params.quantized_activation_max = std::numeric_limits<int8_t>::max();

#if defined(__ARM_FEATURE_DSP)
  RuntimeShape filter_shape = GetTensorShape(filter);
  const int filter_height = filter_shape.Dims(1);
  const int filter_width = filter_shape.Dims(2);
  RuntimeShape input_shape = GetTensorShape(input);
  const int input_height = input_shape.Dims(1);
  const int input_width = input_shape.Dims(2);
  const int input_depth = input_shape.Dims(3);
  RuntimeShape output_shape = GetTensorShape(output);
  const int output_height = output_shape.Dims(1);
  const int output_width = output_shape.Dims(2);
  RuntimeShape bias_shape = GetTensorShape(bias);

  if (op_params.depth_multiplier == 1) {
    int16_t* buf = nullptr;
    const int32_t buf_size = arm_depthwise_conv_s8_opt_get_buffer_size(
        input_depth, filter_width, filter_height);
    TF_LITE_ENSURE_OK(context,
                      get_cmsis_scratch_buffer(context, &buf, buf_size));
    TF_LITE_ENSURE_EQ(
        context,
        arm_depthwise_conv_s8_opt(
            GetTensorData<int8_t>(input), input_width, input_height,
            input_depth, GetTensorData<int8_t>(filter), input_depth,
            filter_width, filter_height, op_params.padding_values.width,
            op_params.padding_values.height, op_params.stride_width,
            op_params.stride_height, GetTensorData<int32>(bias),
            GetTensorData<int8_t>(output), data->per_channel_output_shift,
            data->per_channel_output_multiplier, output_width, output_height,
            op_params.output_offset, op_params.input_offset,
            op_params.quantized_activation_min,
            op_params.quantized_activation_max, op_params.dilation_width_factor,
            op_params.dilation_height_factor, buf),
        ARM_MATH_SUCCESS);
  } else {
    TF_LITE_ENSURE_EQ(
        context,
        arm_depthwise_conv_s8(
            GetTensorData<int8_t>(input), input_width, input_height,
            input_depth, GetTensorData<int8_t>(filter),
            op_params.depth_multiplier * input_depth,
            op_params.depth_multiplier, filter_width, filter_height,
            op_params.padding_values.width, op_params.padding_values.height,
            op_params.stride_width, op_params.stride_height,
            GetTensorData<int32>(bias), GetTensorData<int8_t>(output),
            data->per_channel_output_shift, data->per_channel_output_multiplier,
            output_width, output_height, op_params.output_offset,
            op_params.input_offset, op_params.quantized_activation_min,
            op_params.quantized_activation_max, op_params.dilation_width_factor,
            op_params.dilation_height_factor, nullptr),
        ARM_MATH_SUCCESS);
  }
#else
#pragma message( \
    "CMSIS-NN optimization for depthwise_conv not available for this target. Using reference kernel.")

  reference_integer_ops::DepthwiseConvPerChannel(
      op_params, data->per_channel_output_multiplier,
      data->per_channel_output_shift, GetTensorShape(input),
      GetTensorData<int8>(input), GetTensorShape(filter),
      GetTensorData<int8>(filter), GetTensorShape(bias),
      GetTensorData<int32>(bias), GetTensorShape(output),
      GetTensorData<int8>(output));

#endif
  return kTfLiteOk;
}

TfLiteStatus EvalQuantized(TfLiteContext* context, TfLiteNode* node,
                           TfLiteDepthwiseConvParams* params, OpData* data,
                           const TfLiteTensor* input,
                           const TfLiteTensor* filter, const TfLiteTensor* bias,
                           TfLiteTensor* output) {
  const int32_t input_offset = -input->params.zero_point;
  const int32_t filter_offset = -filter->params.zero_point;
  const int32_t output_offset = output->params.zero_point;

  tflite::DepthwiseParams op_params;
  // Padding type is ignored, but still set.
  op_params.padding_type = PaddingType::kSame;
  op_params.padding_values.width = data->padding.width;
  op_params.padding_values.height = data->padding.height;
  op_params.stride_width = params->stride_width;
  op_params.stride_height = params->stride_height;
  op_params.dilation_width_factor = 1;
  op_params.dilation_height_factor = 1;
  op_params.depth_multiplier = params->depth_multiplier;
  op_params.quantized_activation_min = data->output_activation_min;
  op_params.quantized_activation_max = data->output_activation_max;
  op_params.input_offset = input_offset;
  op_params.weights_offset = filter_offset;
  op_params.output_offset = output_offset;
  op_params.output_multiplier = data->output_multiplier;
  // Legacy ops used mixed left and right shifts. Now all are +ve-means-left.
  op_params.output_shift = -data->output_shift;

#if defined(__ARM_FEATURE_DSP)
  // optimizations utilize loop unrolling which requires the following power
  // of two kernel dimensions
  RuntimeShape filter_shape = GetTensorShape(filter);
  const int filter_height = filter_shape.Dims(1);
  const int filter_width = filter_shape.Dims(2);
  if (0 == op_params.depth_multiplier % 2 && 0 == filter_width % 2) {
    RuntimeShape input_shape = GetTensorShape(input);
    const int input_height = input_shape.Dims(1);
    const int input_width = input_shape.Dims(2);
    const int input_depth = input_shape.Dims(3);
    RuntimeShape output_shape = GetTensorShape(output);
    const int output_height = output_shape.Dims(1);
    const int output_width = output_shape.Dims(2);
    arm_depthwise_conv_u8_basic_ver1(
        GetTensorData<uint8_t>(input), input_width, input_height, input_depth,
        GetTensorData<uint8_t>(filter), filter_width, filter_height,
        op_params.depth_multiplier, op_params.padding_values.width,
        op_params.padding_values.height, op_params.stride_width,
        op_params.stride_height, op_params.dilation_width_factor,
        op_params.dilation_height_factor, GetTensorData<int32_t>(bias),
        op_params.input_offset, op_params.weights_offset,
        op_params.output_offset, GetTensorData<uint8_t>(output), output_width,
        output_height, op_params.quantized_activation_min,
        op_params.quantized_activation_max, op_params.output_shift,
        op_params.output_multiplier);
  } else
#endif

  {
    tflite::reference_ops::DepthwiseConv(
        op_params, GetTensorShape(input), GetTensorData<uint8_t>(input),
        GetTensorShape(filter), GetTensorData<uint8_t>(filter),
        GetTensorShape(bias), GetTensorData<int32_t>(bias),
        GetTensorShape(output), GetTensorData<uint8_t>(output));
  }
  return kTfLiteOk;
}

TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
  auto* params =
      reinterpret_cast<TfLiteDepthwiseConvParams*>(node->builtin_data);

  TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
  const TfLiteTensor* input = GetInput(context, node, kInputTensor);
  const TfLiteTensor* filter = GetInput(context, node, kFilterTensor);
  const TfLiteTensor* bias =
      (NumInputs(node) == 3) ? GetInput(context, node, kBiasTensor) : nullptr;

  const TfLiteType data_type = input->type;
  int width = SizeOfDimension(input, 2);
  int height = SizeOfDimension(input, 1);
  int filter_width = SizeOfDimension(filter, 2);
  int filter_height = SizeOfDimension(filter, 1);

  OpData data;

  // All per-channel quantized tensors need valid zero point and scale arrays.
  if (input->type == kTfLiteInt8) {
    TF_LITE_ENSURE_EQ(context, filter->quantization.type,
                      kTfLiteAffineQuantization);

    const auto* affine_quantization =
        reinterpret_cast<TfLiteAffineQuantization*>(
            filter->quantization.params);
    TF_LITE_ENSURE(context, affine_quantization);
    TF_LITE_ENSURE(context, affine_quantization->scale);
    TF_LITE_ENSURE(context, affine_quantization->zero_point);
    TF_LITE_ENSURE(
        context, affine_quantization->scale->size == 1 ||
                     affine_quantization->scale->size ==
                         filter->dims->data[kDepthwiseConvQuantizedDimension]);
    TF_LITE_ENSURE_EQ(context, affine_quantization->scale->size,
                      affine_quantization->zero_point->size);
  }

  TF_LITE_ENSURE_STATUS(CalculateOpData(context, node, params, width, height,
                                        filter_width, filter_height, data_type,
                                        &data));

  // TODO(aselle): Consider whether float conv and quantized conv should be
  // separate ops to avoid dispatch overhead here.
  switch (input->type) {  // Already know in/out types are same.
    case kTfLiteFloat32:
      return EvalFloat(context, node, params, &data, input, filter, bias,
                       output);
      break;
    case kTfLiteInt8:
      return EvalQuantizedPerChannel(context, node, params, &data, input,
                                     filter, bias, output);
      break;
    case kTfLiteUInt8:
      return EvalQuantized(context, node, params, &data, input, filter, bias,
                           output);
      break;
    default:
      TF_LITE_KERNEL_LOG(context, "Type %s (%d) not supported.",
                         TfLiteTypeGetName(input->type), input->type);
      return kTfLiteError;
  }
  return kTfLiteOk;
}

}  // namespace depthwise_conv

TfLiteRegistration* Register_DEPTHWISE_CONV_2D() {
  static TfLiteRegistration r = {depthwise_conv::Init, depthwise_conv::Free,
                                 depthwise_conv::Prepare, depthwise_conv::Eval};
  return &r;
}

}  // namespace micro
}  // namespace ops
}  // namespace tflite


text:
package gov.nih.nci.caintegrator.analysis.messaging;

import java.util.HashMap;

import gov.nih.nci.caintegrator.analysis.messaging.SampleGroup;

public class GLMSampleGroup extends SampleGroup {

	//[sid] => map of annotations ( [age] => 35, [gender] => M , ...)
	public HashMap<String, HashMap> annotationMap;

	public GLMSampleGroup(String groupName) {
		super(groupName, 50);
		annotationMap = new HashMap();

	}

	public void addPatientData(String sid, HashMap<String, String> am){
		setPatientInAnnotationMap(sid, am);
	}

	public HashMap getPatientFromAnnotationMap(String sid)	{
		return annotationMap.get(sid);
	}

	public void setPatientInAnnotationMap(String key, HashMap value)	{
		annotationMap.put(key, value);
	}

	public HashMap<String, HashMap> getAnnotationMap() {
		return annotationMap;
	}

	public void setAnnotationMap(HashMap<String, HashMap> annotationMap) {
		this.annotationMap = annotationMap;
	}
}

redpajama_set_name: RedPajamaGithub


text:
// Generated by xsd compiler for android/java
// DO NOT CHANGE!
package com.ebay.marketplace.search.v1.services;

import java.io.Serializable;
import com.leansoft.nano.annotation.*;
import java.util.List;

/**
 *
 * Searches for items based on a keyword query and returns details for matching
 * items. Item filters can be used to restrict search results. Aspect filters
 * can be used to further refine results. Use outputSelector to expand the
 * amount of data returned for each matching item.
 *
 */
@RootElement(name = "findItemsByKeywordsRequest", namespace = "http://www.ebay.com/marketplace/search/v1/services")
public class FindItemsByKeywordsRequest extends BaseFindingServiceRequest implements Serializable {

    private static final long serialVersionUID = -1L;

	@Element
	private String keywords;

	@Element
	private List<ItemFilter> itemFilter;

	@Element
	private List<AspectFilter> aspectFilter;

	@Element
	private List<OutputSelectorType> outputSelector;

	@Element
	private List<DomainFilter> domainFilter;

	/**
     * public getter
     *
     *
     * Specify one or more words to use in a search query for finding items
     * on eBay. By default, queries search item titles only. When running
     * queries, it is best to include complete keywords values--eBay checks
     * words in context with each other. If you are using a URL request and
     * your keyword query consists of multiple words, use "%20" to separate
     * the words. For example, use "Harry%20Potter" to search for items
     * containing those words in any order. Queries aren't case-sensitive,
     * so it doesn't matter whether you use uppercase or lowercase letters.
     *

     * You can incorporate wildcards in a multi-word search. For example,
     * "ap*%20ip*" returns results for "apple ipod" among other matches. The
     * words "and" and "or" are treated like any other word (and not their
     * logical connotation). Only use "and", "or", or "the" if you are
     * searching for listings containing those specific words.
     *
     *
     * @returns java.lang.String
	 */
	public String getKeywords() {
	    return this.keywords;
	}

	/**
	 * public setter
	 *
     *
     * Specify one or more words to use in a search query for finding items
     * on eBay. By default, queries search item titles only. When running
     * queries, it is best to include complete keywords values--eBay checks
     * words in context with each other. If you are using a URL request and
     * your keyword query consists of multiple words, use "%20" to separate
     * the words. For example, use "Harry%20Potter" to search for items
     * containing those words in any order. Queries aren't case-sensitive,
     * so it doesn't matter whether you use uppercase or lowercase letters.
     *

     * You can incorporate wildcards in a multi-word search. For example,
     * "ap*%20ip*" returns results for "apple ipod" among other matches. The
     * words "and" and "or" are treated like any other word (and not their
     * logical connotation). Only use "and", "or", or "the" if you are
     * searching for listings containing those specific words.
     *
     *
     * @param java.lang.String
	 */
	public void setKeywords(String keywords) {
	    this.keywords = keywords;
	}
	/**
     * public getter
     *
     *
     * Reduce the number of items returned by a find request using item
     * filters. Use itemFilter to specify
     * name/value pairs. You can include multiple item filters in a single
     * request.
     *
     *
     * @returns java.util.List<com.ebay.marketplace.search.v1.services.ItemFilter>
	 */
	public List<ItemFilter> getItemFilter() {
	    return this.itemFilter;
	}

	/**
	 * public setter
	 *
     *
     * Reduce the number of items returned by a find request using item
     * filters. Use itemFilter to specify
     * name/value pairs. You can include multiple item filters in a single
     * request.
     *
     *
     * @param java.util.List<com.ebay.marketplace.search.v1.services.ItemFilter>
	 */
	public void setItemFilter(List<ItemFilter> itemFilter) {
	    this.itemFilter = itemFilter;
	}
	/**
     * public getter
     *
     *
     * Aspect filters refine (limit) the number of items returned by a find
     * request. Obtain input values for aspectFilter fields from an
     * aspectHistogramContainer returned in the response of a previous
     * query.
     *

     * By issuing a series of find queries,
     * you can continually refine the items returned in your responses. Do
     * this by repeating a query using the aspect values returned in one
     * response as the input values to your next query.
     *

     * For example, the aspectHistogramContainer in a response on
     * Men's Shoes could contain an aspect of Size, along with "aspect
     * values" for the different sizes currently available in Men's Shoes.
     * By populating aspectFilter fields with the values returned in an
     * aspectHistogramContainer, you can refine the item results returned by
     * your new query.
     *

     *
     * Note: If a call that specifies an
     * outputSelector value of
     * AspectHistogram returns
     * aspectHistogramContainer.domainName, this is a sign
     * that aspect histogram data might not be returned if you also specify an
     * aspectFilter in the next call. To ensure that
     * aspect histogram data is returned for the next call, add a
     * domainFilter to the call as well.
     *
     *
     *
     * @returns java.util.List<com.ebay.marketplace.search.v1.services.AspectFilter>
	 */
	public List<AspectFilter> getAspectFilter() {
	    return this.aspectFilter;
	}

	/**
	 * public setter
	 *
     *
     * Aspect filters refine (limit) the number of items returned by a find
     * request. Obtain input values for aspectFilter fields from an
     * aspectHistogramContainer returned in the response of a previous
     * query.
     *

     * By issuing a series of find queries,
     * you can continually refine the items returned in your responses. Do
     * this by repeating a query using the aspect values returned in one
     * response as the input values to your next query.
     *

     * For example, the aspectHistogramContainer in a response on
     * Men's Shoes could contain an aspect of Size, along with "aspect
     * values" for the different sizes currently available in Men's Shoes.
     * By populating aspectFilter fields with the values returned in an
     * aspectHistogramContainer, you can refine the item results returned by
     * your new query.
     *

     *
     * Note: If a call that specifies an
     * outputSelector value of
     * AspectHistogram returns
     * aspectHistogramContainer.domainName, this is a sign
     * that aspect histogram data might not be returned if you also specify an
     * aspectFilter in the next call. To ensure that
     * aspect histogram data is returned for the next call, add a
     * domainFilter to the call as well.
     *
     *
     *
     * @param java.util.List<com.ebay.marketplace.search.v1.services.AspectFilter>
	 */
	public void setAspectFilter(List<AspectFilter> aspectFilter) {
	    this.aspectFilter = aspectFilter;
	}
	/**
     * public getter
     *
     *
     * Specifies what item data to return in a response in addition to the
     * default set of data.
     *

     * If you don't specify this field, eBay returns a default set of item
     * fields. Use outputSelector to include more item information in the
     * response. The additional data is grouped into discrete nodes. You can
     * specify multiple nodes by including this field multiple times, as
     * needed, in the request.
     *

     * If you specify this field, the additional fields returned can affect
     * the call's performance (response time), as is the case with including
     * seller feedback data.
     *
     *
     * @returns java.util.List<com.ebay.marketplace.search.v1.services.OutputSelectorType>
	 */
	public List<OutputSelectorType> getOutputSelector() {
	    return this.outputSelector;
	}

	/**
	 * public setter
	 *
     *
     * Specifies what item data to return in a response in addition to the
     * default set of data.
     *

     * If you don't specify this field, eBay returns a default set of item
     * fields. Use outputSelector to include more item information in the
     * response. The additional data is grouped into discrete nodes. You can
     * specify multiple nodes by including this field multiple times, as
     * needed, in the request.
     *

     * If you specify this field, the additional fields returned can affect
     * the call's performance (response time), as is the case with including
     * seller feedback data.
     *
     *
     * @param java.util.List<com.ebay.marketplace.search.v1.services.OutputSelectorType>
	 */
	public void setOutputSelector(List<OutputSelectorType> outputSelector) {
	    this.outputSelector = outputSelector;
	}
	/**
     * public getter
     *
     *
     * Restricts results to items listed within the specified domain.
     * Domains are a buy-side grouping of items, such as shoes or digital
     * cameras. A domain can span multiple eBay categories.
     *
     *
     * @returns java.util.List<com.ebay.marketplace.search.v1.services.DomainFilter>
	 */
	public List<DomainFilter> getDomainFilter() {
	    return this.domainFilter;
	}

	/**
	 * public setter
	 *
     *
     * Restricts results to items listed within the specified domain.
     * Domains are a buy-side grouping of items, such as shoes or digital
     * cameras. A domain can span multiple eBay categories.
     *
     *
     * @param java.util.List<com.ebay.marketplace.search.v1.services.DomainFilter>
	 */
	public void setDomainFilter(List<DomainFilter> domainFilter) {
	    this.domainFilter = domainFilter;
	}

}


text:
<?php
use \Kondrat\DesignPatterns\Factory\FactoryMethod\NewYorkStore\NYStylePepperoniPizza;

class NYStylePepperoniPizzaTest extends PHPUnit_Framework_TestCase
{
    protected $pizza;

    protected function setUp()
    {
        $this->pizza = new NYStylePepperoniPizza();
    }

    public function testGetName()
    {
        $expected = "pepperoni (NY style)";
        $this->assertEquals($expected, $this->pizza->getName());
    }
}


text:
#include "OgreStableHeaders.h"
#include "OgreShaderExTextureAtlasSampler.h"

#ifdef RTSHADER_SYSTEM_BUILD_EXT_SHADERS
#include "OgreShaderFFPRenderState.h"
#include "OgreShaderProgram.h"
#include "OgreShaderParameter.h"
#include "OgreShaderProgramSet.h"
#include "OgreTechnique.h"

#define SGX_LIB_TEXTURE_ATLAS "SGXLib_TextureAtlas"

#define SGX_FUNC_ATLAS_SAMPLE_AUTO_ADJUST "SGX_Atlas_Sample_Auto_Adjust"
#define SGX_FUNC_ATLAS_SAMPLE_NORMAL "SGX_Atlas_Sample_Normal"

#define SGX_FUNC_ATLAS_WRAP "SGX_Atlas_Wrap"
#define SGX_FUNC_ATLAS_MIRROR "SGX_Atlas_Mirror"
#define SGX_FUNC_ATLAS_CLAMP "SGX_Atlas_Clamp"
#define SGX_FUNC_ATLAS_BORDER "SGX_Atlas_Border"
#define TAS_MAX_SAFE_ATLASED_TEXTURES 250

namespace Ogre {
template<> RTShader::TextureAtlasSamplerFactory* Singleton<RTShader::TextureAtlasSamplerFactory>::msSingleton = 0;

namespace RTShader {

void operator<<(std::ostream& o, const TextureAtlasSamplerFactory::TextureAtlasAttib& tai)
{
	o << tai.autoBorderAdjust << tai.positionMode << tai.positionOffset;
}

const TextureAtlasTablePtr c_BlankAtlasTable;
const String c_ParamTexel("texel_");
String TextureAtlasSampler::Type = "SGX_TextureAtlasSampler";
String c_RTAtlasKey = "RTAtlas";

//-----------------------------------------------------------------------
TextureAtlasSampler::TextureAtlasSampler() :
	mAtlasTexcoordPos(0),
	mIsTableDataUpdated(false),
	mAutoAdjustPollPosition(true)
{
	memset(mIsAtlasTextureUnits, 0, sizeof(bool) * TAS_MAX_TEXTURES);
}

//-----------------------------------------------------------------------
const String& TextureAtlasSampler::getType() const
{
	return Type;
}

//-----------------------------------------------------------------------
int	TextureAtlasSampler::getExecutionOrder() const
{
	return FFP_TEXTURING + 25;
}

//-----------------------------------------------------------------------
bool TextureAtlasSampler::resolveParameters(ProgramSet* programSet)
{
	Program* vsProgram = programSet->getCpuVertexProgram();
	Program* psProgram = programSet->getCpuFragmentProgram();
	Function* vsMain   = vsProgram->getEntryPointFunction();
	Function* psMain   = psProgram->getEntryPointFunction();

	//
	// Define vertex shader parameters used to find the position of the textures in the atlas
	//
	Parameter::Content indexContent = (Parameter::Content)((int)Parameter::SPC_TEXTURE_COORDINATE0 + mAtlasTexcoordPos);
	GpuConstantType indexType = GCT_FLOAT4;

	mVSInpTextureTableIndex = vsMain->resolveInputParameter(Parameter::SPS_TEXTURE_COORDINATES,
				mAtlasTexcoordPos, indexContent, indexType);

	//
	// Define parameters to carry the information on the location of the texture from the vertex to
	// the pixel shader
	//
	for(ushort i = 0 ; i < TAS_MAX_TEXTURES ; ++ i)
	{
		if (mIsAtlasTextureUnits[i] == true)
		{
			mVSTextureTable[i] = vsProgram->resolveParameter(GCT_FLOAT4, -1, (uint16)GPV_GLOBAL, "AtlasData", mAtlasTableDatas[i]->size());
			mVSOutTextureDatas[i] = vsMain->resolveOutputParameter(Parameter::SPS_TEXTURE_COORDINATES,
					-1, Parameter::SPC_UNKNOWN, GCT_FLOAT4);
			mPSInpTextureDatas[i] = psMain->resolveInputParameter(Parameter::SPS_TEXTURE_COORDINATES,
				mVSOutTextureDatas[i]->getIndex(), Parameter::SPC_UNKNOWN, GCT_FLOAT4);
			mPSTextureSizes[i] = psProgram->resolveParameter(GCT_FLOAT2,-1, (uint16)GPV_PER_OBJECT, "AtlasSize");
		}
	}
	return true;
}

//-----------------------------------------------------------------------
bool TextureAtlasSampler::resolveDependencies(ProgramSet* programSet)
{
	Program* vsProgram = programSet->getCpuVertexProgram();
	Program* psProgram = programSet->getCpuFragmentProgram();
	vsProgram->addDependency(FFP_LIB_COMMON);
	psProgram->addDependency(SGX_LIB_TEXTURE_ATLAS);

	return true;
}

//-----------------------------------------------------------------------
bool TextureAtlasSampler::addFunctionInvocations(ProgramSet* programSet)
{
	Program* vsProgram = programSet->getCpuVertexProgram();
	Function* vsMain   = vsProgram->getEntryPointFunction();
	Program* psProgram = programSet->getCpuFragmentProgram();
	Function* psMain   = psProgram->getEntryPointFunction();
	FunctionInvocation* curFuncInvocation = NULL;

	//
	// Calculate the position and size of the texture in the atlas in the vertex shader
	//
	int groupOrder = (FFP_VS_TEXTURING - FFP_VS_LIGHTING) / 2;
	int internalCounter = 0;

	for(ushort i = 0 ; i <  TAS_MAX_TEXTURES; ++i)
	{
		if (mIsAtlasTextureUnits[i] == true)
		{
			Operand::OpMask textureIndexMask = Operand::OPM_X;
			switch (i)
			{
			case 1: textureIndexMask = Operand::OPM_Y; break;
			case 2: textureIndexMask = Operand::OPM_Z; break;
			case 3: textureIndexMask = Operand::OPM_W; break;
			}

			curFuncInvocation = OGRE_NEW FunctionInvocation(FFP_FUNC_ASSIGN, groupOrder, internalCounter++);
			curFuncInvocation->pushOperand(mVSTextureTable[i], Operand::OPS_IN);
			curFuncInvocation->pushOperand(mVSInpTextureTableIndex, Operand::OPS_IN, textureIndexMask, 1);
			curFuncInvocation->pushOperand(mVSOutTextureDatas[i], Operand::OPS_OUT);
			vsMain->addAtomInstance(curFuncInvocation);
		}
	}

	//
	// sample the texture in the fragment shader given the extracted data in the pixel shader
	//

	groupOrder = (FFP_PS_SAMPLING + FFP_PS_TEXTURING) / 2;

	internalCounter = 0;

	const ShaderParameterList& inpParams = psMain->getInputParameters();
	const ShaderParameterList& localParams = psMain->getLocalParameters();

	ParameterPtr psAtlasTextureCoord = psMain->resolveLocalParameter(Parameter::SPS_UNKNOWN,
		-1, "atlasCoord", GCT_FLOAT2);

	for(ushort j = 0 ; j <  TAS_MAX_TEXTURES; ++j)
	{
		if (mIsAtlasTextureUnits[j] == true)
		{
			//Find the texture coordinates texel and sampler from the original FFPTexturing
			ParameterPtr texcoord = psMain->getParameterByContent(inpParams, (Parameter::Content)(Parameter::SPC_TEXTURE_COORDINATE0 + j), GCT_FLOAT2);
			ParameterPtr texel = psMain->getParameterByName(localParams, c_ParamTexel + Ogre::StringConverter::toString(j));
			UniformParameterPtr sampler = psProgram->getParameterByType(GCT_SAMPLER2D, j);

			const char* addressUFuncName = getAdressingFunctionName(mTextureAddressings[j].u);
			const char* addressVFuncName = getAdressingFunctionName(mTextureAddressings[j].v);

			//Create a function which will replace the texel with the texture texel
			if ((texcoord.isNull() == false) && (texel.isNull() == false) &&
				(sampler.isNull() == false) && (addressUFuncName != NULL) && (addressVFuncName != NULL))
			{
				//calculate the U value due to addressing mode
				curFuncInvocation = OGRE_NEW FunctionInvocation(addressUFuncName, groupOrder, internalCounter++);
				curFuncInvocation->pushOperand(texcoord, Operand::OPS_IN, Operand::OPM_X);
				curFuncInvocation->pushOperand(psAtlasTextureCoord, Operand::OPS_OUT, Operand::OPM_X);
				psMain->addAtomInstance(curFuncInvocation);

				//calculate the V value due to addressing mode
				curFuncInvocation = OGRE_NEW FunctionInvocation(addressVFuncName, groupOrder, internalCounter++);
				curFuncInvocation->pushOperand(texcoord, Operand::OPS_IN, Operand::OPM_Y);
				curFuncInvocation->pushOperand(psAtlasTextureCoord, Operand::OPS_OUT, Operand::OPM_Y);
				psMain->addAtomInstance(curFuncInvocation);

				//sample the texel color
				curFuncInvocation = OGRE_NEW FunctionInvocation(
					mAutoAdjustPollPosition ? SGX_FUNC_ATLAS_SAMPLE_AUTO_ADJUST : SGX_FUNC_ATLAS_SAMPLE_NORMAL, groupOrder, internalCounter++);
				curFuncInvocation->pushOperand(sampler, Operand::OPS_IN);
				curFuncInvocation->pushOperand(texcoord, Operand::OPS_IN, Operand::OPM_X | Operand::OPM_Y);
				curFuncInvocation->pushOperand(psAtlasTextureCoord, Operand::OPS_IN);
				curFuncInvocation->pushOperand(mPSInpTextureDatas[j], Operand::OPS_IN);
				curFuncInvocation->pushOperand(mPSTextureSizes[j], Operand::OPS_IN);
				curFuncInvocation->pushOperand(texel, Operand::OPS_OUT);
				psMain->addAtomInstance(curFuncInvocation);

			}
		}
	}
	return true;
}

//-----------------------------------------------------------------------
const char* TextureAtlasSampler::getAdressingFunctionName(TextureUnitState::TextureAddressingMode mode)
{
	switch (mode)
	{
	case TextureUnitState::TAM_WRAP: return SGX_FUNC_ATLAS_WRAP;
	case TextureUnitState::TAM_MIRROR: return SGX_FUNC_ATLAS_MIRROR;
	case TextureUnitState::TAM_CLAMP: return SGX_FUNC_ATLAS_CLAMP;
	case TextureUnitState::TAM_BORDER: return SGX_FUNC_ATLAS_BORDER;
	}
	return NULL;
}

//-----------------------------------------------------------------------
void TextureAtlasSampler::copyFrom(const SubRenderState& rhs)
{
	const TextureAtlasSampler& rhsColour = static_cast<const TextureAtlasSampler&>(rhs);

	mAtlasTexcoordPos = rhsColour.mAtlasTexcoordPos;
	for(ushort j = 0 ; j < TAS_MAX_TEXTURES ; ++j)
	{
		mIsAtlasTextureUnits[j] = rhsColour.mIsAtlasTextureUnits[j];
		mTextureAddressings[j] = rhsColour.mTextureAddressings[j];
		mAtlasTableDatas[j] = rhsColour.mAtlasTableDatas[j];
		mIsAtlasTextureUnits[j] = rhsColour.mIsAtlasTextureUnits[j];
	}
}

//-----------------------------------------------------------------------
void TextureAtlasSampler::updateGpuProgramsParams(Renderable* rend, Pass* pass,  const AutoParamDataSource* source, const LightList* pLightList)
{
	if (mIsTableDataUpdated == false)
	{
		mIsTableDataUpdated = true;
		for(ushort j = 0 ; j < TAS_MAX_TEXTURES ; ++j)
		{
			if (mIsAtlasTextureUnits[j] == true)
			{
				//
				// Update the information of the size of the atlas textures
				//
				std::pair< size_t, size_t > texSizeInt = pass->getTextureUnitState(j)->getTextureDimensions();
				Vector2 texSize(texSizeInt.first, texSizeInt.second);
				mPSTextureSizes[j]->setGpuParameter(texSize);

				//
				//Update the information of which texture exist where in the atlas
				//
				GpuProgramParametersSharedPtr vsGpuParams = pass->getVertexProgramParameters();
				vector<float>::type buffer(mAtlasTableDatas[j]->size() * 4);
				for(size_t i = 0 ; i < mAtlasTableDatas[j]->size() ; ++i)
				{
					buffer[i*4] = (*(mAtlasTableDatas[j]))[i].posU;
					buffer[i*4 + 1] = (*(mAtlasTableDatas[j]))[i].posV;
					buffer[i*4 + 2] = (float)Ogre::Math::Log2((*(mAtlasTableDatas[j]))[i].width * texSize.x);
					buffer[i*4 + 3] = (float)Ogre::Math::Log2((*(mAtlasTableDatas[j]))[i].height * texSize.y);
				}
				vsGpuParams->setNamedConstant(mVSTextureTable[j]->getName(), (const float*)(&(buffer[0])), (mAtlasTableDatas[j])->size());
			}
		}
	}
}

//-----------------------------------------------------------------------
bool TextureAtlasSampler::preAddToRenderState(const RenderState* renderState, Pass* srcPass, Pass* dstPass)
{
	mAtlasTexcoordPos = 0;

	const TextureAtlasSamplerFactory& factory = TextureAtlasSamplerFactory::getSingleton();

	bool hasAtlas = false;
	unsigned short texCount = srcPass->getNumTextureUnitStates();
	for(unsigned short i = 0 ; i < texCount ; ++i)
	{
		TextureUnitState* pState = srcPass->getTextureUnitState(i);

		const TextureAtlasTablePtr& table = factory.getTextureAtlasTable(pState->getTextureName());
		if (table.isNull() == false)
		{
			if (table->size() > TAS_MAX_SAFE_ATLASED_TEXTURES)
			{
				LogManager::getSingleton().logMessage(LML_CRITICAL,
					"Warning : Compiling atlas texture has to many internally defined textures. Shader may fail to compile.");
			}
			if (i >= TAS_MAX_TEXTURES)
			{
				OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS,
					"Texture atlas sub-render does not support more than TAS_MAX_TEXTURES (4) atlas textures",
					"TextureAtlasSampler::preAddToRenderState" );
			}
			if (pState->getTextureType() != TEX_TYPE_2D)
			{
				OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS,
					"Texture atlas sub-render state only supports 2d textures.",
					"TextureAtlasSampler::preAddToRenderState" );

			}

			mAtlasTableDatas[i] = table;
			mTextureAddressings[i] = pState->getTextureAddressingMode();
			mIsAtlasTextureUnits[i] = true;
			hasAtlas = true;
		}
	}

	//gather the materials atlas processing attributes
	//and calculate the position of the indexes
	TextureAtlasSamplerFactory::TextureAtlasAttib attrib;
	factory.hasMaterialAtlasingAttributes(srcPass->getParent()->getParent(), &attrib);

	mAutoAdjustPollPosition = attrib.autoBorderAdjust;
	mAtlasTexcoordPos = attrib.positionOffset;
	if (attrib.positionMode == TextureAtlasSamplerFactory::ipmRelative)
	{
		mAtlasTexcoordPos += texCount - 1;
	}

	return hasAtlas;
}

TextureAtlasSamplerFactory::TextureAtlasSamplerFactory()
{

}

TextureAtlasSamplerFactory* TextureAtlasSamplerFactory::getSingletonPtr(void)
{
	return msSingleton;
}
TextureAtlasSamplerFactory& TextureAtlasSamplerFactory::getSingleton(void)
{
	assert( msSingleton );  return ( *msSingleton );
}

//-----------------------------------------------------------------------
const String& TextureAtlasSamplerFactory::getType() const
{
	return TextureAtlasSampler::Type;
}

//-----------------------------------------------------------------------
SubRenderState*	TextureAtlasSamplerFactory::createInstance(ScriptCompiler* compiler,
													PropertyAbstractNode* prop, Pass* pass, SGScriptTranslator* translator)
{
	return NULL;
}

//-----------------------------------------------------------------------
void TextureAtlasSamplerFactory::writeInstance(MaterialSerializer* ser, SubRenderState* subRenderState,
										Pass* srcPass, Pass* dstPass)
{
}

//-----------------------------------------------------------------------
bool TextureAtlasSamplerFactory::addTexutreAtlasDefinition( const Ogre::String& filename, TextureAtlasTablePtr textureAtlasTable )
{
	std::ifstream inp;
	inp.open(filename.c_str(), std::ios::in | std::ios::binary);
	if(!inp)
	{
		OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND, "'" + filename + "' file not found!",
			"TextureAtlasSamplerFactory::addTexutreAtlasDefinition" );
	}
	DataStreamPtr stream(OGRE_NEW FileStreamDataStream(filename, &inp, false));
	return addTexutreAtlasDefinition(stream, textureAtlasTable);

}
//-----------------------------------------------------------------------
bool TextureAtlasSamplerFactory::addTexutreAtlasDefinition( DataStreamPtr stream, TextureAtlasTablePtr textureAtlasTable )
{
	stream->seek(0);

	bool isSuccess = false;
	if (stream->isReadable() == true)
	{
		TextureAtlasMap tmpMap;

		while (stream->eof() == false)
		{
			String line = stream->getLine(true);
			size_t nonWhiteSpacePos = line.find_first_not_of(" \t\r\n");
			//check this is a line with information
			if ((nonWhiteSpacePos != String::npos) && (line[nonWhiteSpacePos] != '#'))
			{
				//parse the line
				vector<String>::type strings = StringUtil::split(line, ",\t");

				if (strings.size() > 8)
				{
					String textureName = strings[1];

					TextureAtlasMap::iterator it = tmpMap.find(textureName);
					if (tmpMap.find(textureName) == tmpMap.end())
					{
						it = tmpMap.insert(TextureAtlasMap::value_type(textureName, TextureAtlasTablePtr(new TextureAtlasTable))).first;
					}

					// file line format:  <original texture filename>/t/t<atlas filename>, <atlas idx>, <atlas type>, <woffset>, <hoffset>, <depth offset>, <width>, <height>
					//                              0                           1              2            3             4          5          6               7        8
					TextureAtlasRecord newRecord(
						strings[0], // original texture filename
						strings[1], // atlas filename
						(float)StringConverter::parseReal(strings[4]), // woffset
						(float)StringConverter::parseReal(strings[5]), // hoffset
						(float)StringConverter::parseReal(strings[7]), // width
						(float)StringConverter::parseReal(strings[8]), // height
						it->second->size() // texture index in atlas texture
						);

					it->second->push_back(newRecord);
					if (!textureAtlasTable.isNull())
					{
						textureAtlasTable->push_back(newRecord);
					}

					isSuccess = true;
				}
			}
		}

		//place the information in the main texture
		size_t maxTextureCount = 0;
		TextureAtlasMap::const_iterator it = tmpMap.begin();
		TextureAtlasMap::const_iterator itEnd = tmpMap.end();
		for(;it != itEnd; ++it)
		{
			setTextureAtlasTable(it->first, it->second);
			maxTextureCount = std::max<size_t>(maxTextureCount, it->second->size());
		}

		if (maxTextureCount > TAS_MAX_SAFE_ATLASED_TEXTURES)
		{
			LogManager::getSingleton().logMessage(LML_CRITICAL,
				("Warning : " + stream->getName() +
				" atlas texture has to many internally defined textures. Shader may fail to compile."));
		}
	}
	return isSuccess;
}

//-----------------------------------------------------------------------
void TextureAtlasSamplerFactory::setTextureAtlasTable(const String& textureName, const TextureAtlasTablePtr& atlasData, bool autoBorderAdjust)
{
	if ((atlasData.isNull() == true) || (atlasData->empty()))
		removeTextureAtlasTable(textureName);
	else mAtlases.insert(TextureAtlasMap::value_type(textureName, atlasData));
}

//-----------------------------------------------------------------------
void TextureAtlasSamplerFactory::removeTextureAtlasTable(const String& textureName)
{
	mAtlases.erase(textureName);
}

//-----------------------------------------------------------------------
void TextureAtlasSamplerFactory::removeAllTextureAtlasTables()
{
	mAtlases.clear();
}

//-----------------------------------------------------------------------
const TextureAtlasTablePtr& TextureAtlasSamplerFactory::getTextureAtlasTable(const String& textureName) const
{
	TextureAtlasMap::const_iterator it = mAtlases.find(textureName);
	if (it != mAtlases.end())
	{
		return it->second;
	}
	else return c_BlankAtlasTable;
}

//-----------------------------------------------------------------------
void TextureAtlasSamplerFactory::setDefaultAtlasingAttributes(IndexPositionMode mode, ushort offset, bool autoAdjustBorders)
{
	mDefaultAtlasAttrib = TextureAtlasAttib(mode, offset, autoAdjustBorders);
}

//-----------------------------------------------------------------------
const TextureAtlasSamplerFactory::TextureAtlasAttib& TextureAtlasSamplerFactory::getDefaultAtlasingAttributes() const
{
	return mDefaultAtlasAttrib;
}

//-----------------------------------------------------------------------
void TextureAtlasSamplerFactory::setMaterialAtlasingAttributes(Ogre::Material* material,
		IndexPositionMode mode, ushort offset, bool autoAdjustBorders)
{
	if ((material) && (material->getNumTechniques()))
	{
		material->getTechnique(0)->getUserObjectBindings().setUserAny(c_RTAtlasKey,
			Ogre::Any(TextureAtlasAttib(mode, offset, autoAdjustBorders)));
	}
}

//-----------------------------------------------------------------------
bool TextureAtlasSamplerFactory::hasMaterialAtlasingAttributes(Ogre::Material* material,
																 TextureAtlasAttib* attrib) const
{
	bool isMaterialSpecific = false;
	if ((material) && (material->getNumTechniques()))
	{
		const Ogre::Any& anyAttrib =
			//find if the "IsTerrain" flag exists in the first technique
			material->getTechnique(0)->getUserObjectBindings().getUserAny(c_RTAtlasKey);
		isMaterialSpecific = (anyAttrib.isEmpty() == false);
		if ((isMaterialSpecific) && (attrib))
		{
			*attrib = Ogre::any_cast<TextureAtlasAttib>(anyAttrib);
		}
	}
	if ((!isMaterialSpecific) && (attrib))
	{
		*attrib = mDefaultAtlasAttrib;
	}
	return isMaterialSpecific;
}

//-----------------------------------------------------------------------
SubRenderState*	TextureAtlasSamplerFactory::createInstanceImpl()
{
	return OGRE_NEW TextureAtlasSampler;
}

}
}

#endif


text:
import {ButtonTone, DialogProps, Placement} from '@sanity/ui'

export const POPOVER_FALLBACK_PLACEMENTS: Placement[] = ['left', 'bottom']

export const LEGACY_DIALOG_TO_UI_COLOR: {[key: string]: ButtonTone | undefined} = {
  info: 'primary',
  success: 'positive',
  danger: 'critical',
  warning: 'caution',
}

export const DIALOG_WIDTH_TO_UI_WIDTH: {[key: string]: DialogProps['width']} = {
  small: 0,
  medium: 1,
  large: 2,
  full: 'auto',
}


text:
#ifndef DGLPROJECT_ATTACH_H
#define DGLPROJECT_ATTACH_H

#include <memory>

#include <QWidget>

#include "dglproject_base.h"

#include "ui_dglprojproperties_attach.h"

#include <boost/serialization/nvp.hpp>

class DGLAttachProject : public DGLProject {
   public:
    DGLAttachProject(std::string address, std::string port);
    DGLAttachProject();
    const std::string& getAddress() const;
    const std::string& getPort() const;

    template<class Archive>
    void serialize(Archive & ar, const unsigned int /* version */) {
        ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(DGLProject);
        ar & BOOST_SERIALIZATION_NVP(m_address);
        ar & BOOST_SERIALIZATION_NVP(m_port);
    }

   private:
    virtual void startDebugging() override;
    virtual bool shouldTerminateOnStop() override;

    std::string m_address, m_port;
};

class DGLAttachProjectFactory : public DGLProjectFactory {
   public:
    DGLAttachProjectFactory();

   private:
    virtual std::shared_ptr<DGLProject> createProject() override;

    virtual bool valid(QString&);
    virtual bool loadPropertiesFromProject(const DGLProject*);
    virtual QString getName() override;
    virtual QWidget* getGUI() override;
    Ui::DGLProjPropertiesAttachClass m_ui;
    QWidget m_gui;
};

#endif


text:
package com.example.tests;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import org.testng.annotations.Test;

import com.example.utils.SortedListOf;

public class RemoveFolder extends BasicClass {

	@Test
	public void removeFolderTest(){
		SortedListOf<String> oldList = controlManager.getFolderHelp().getFolder();
		String fold = new String();
		fold = oldList.get(1);
		controlManager.getFolderHelp().removeFolderCombo(fold);
		SortedListOf<String> newList = controlManager.getFolderHelp().getFolder();
	    assertThat(newList,equalTo(oldList.without(fold)));
	}

}


text:
YUI.add('aui-form-validator-tests', function(Y) {

    //--------------------------------------------------------------------------
    // AUI Form Validator Unit Tests
    //--------------------------------------------------------------------------

    var suite = new Y.Test.Suite('aui-form-validator'),
        formValidator;

    var isImageURL = function(val) {
        var regex = /(https?:\/\/.*\.(?:png|jpg|jpeg|gif))/i;
        return regex.test(val);
    };

    Y.FormValidator.addCustomRules(
        {
            'imageURL': {
                condition: isImageURL,
                errorMessage: 'Please enter a valid URL that points to an image (jpg, jpeg, png, or gif).'
            }
        }
    );

    formValidator = new Y.FormValidator({
        boundingBox: '#myForm',
        fieldStrings: {
            email: {
                required: 'Type your email in this field.'
            },
            name: {
                required: 'Please provide your name.'
            }
        },
        rules: {
            age: {
                required: true
            },
            email: {
                email: true,
                required: true
            },
            emailConfirmation: {
                email: true,
                equalTo: '#email',
                required: true
            },
            gender: {
                required: true
            },
            'image-url': {
                custom: true,
                imageURL: true,
                required: true
            },
            name: {
                rangeLength: [2, 50],
                required: true
            },
            picture: {
                acceptFiles: 'jpg, gif, png',
                required: true
            },
            read: {
                required: true
            },
            url: {
                required: true,
                url: true
            }
        },
        showAllMessages: true
    });

    //--------------------------------------------------------------------------
    // Test Case for invalid fields
    //--------------------------------------------------------------------------

    suite.add(new Y.Test.Case({

        name: 'AUI Form Submit Form Tests',

        /*
         * Check if on submit all fields are marked as invalid
         * Tests: AUI-965
         */
        'test submit form': function() {
            var elementWithoutError,
                forms;

            forms = Y.all('form');
            forms.each(function (form) {
                form.simulate('submit');
            });

            elementWithoutError = Y.one('.form-group:not(.has-error)');

            Y.Assert.isNull(elementWithoutError, 'There shouldn\'t be any element without class error');
        },

        /*
         * Check if validator nodes render after the input and lable's textNode
         * Tests: AUI-965
         */
        'test error message displayed after label': function() {
            var instance = this;

            instance._assertValidatorNextLabel('input[value=male]');

            instance._assertValidatorNextLabel('input[name=read]');
        },

        /*
         * Check if validator correctly validates <select> html fields
         * Tests: AUI-1204
         */
        'test submit empty select': function() {
            var form = Y.Node.create('<form><select name="gender"></select></form>'),
                select = form.one('select'),
                validOption,
                validator;

            Y.Node.create('<option value=""></option>').appendTo(select);
            validOption = Y.Node.create('<option value=\"male\">Male</option>').appendTo(select);

            validator = new Y.FormValidator({
                boundingBox: form,
                rules: {
                    gender: {
                        required: true
                    }
                }
            });

            form.simulate('submit');

            Y.Assert.isTrue(validator.hasErrors());

            validOption.attr('selected', 'selected');

            form.simulate('submit');

            Y.Assert.isFalse(validator.hasErrors());
        },

        /*
         * Check if validator correctly validates fields with custom rules
         * @tests AUI-1654
         */
        'test custom rules': function() {
            var form = Y.Node.create('<form><input name="gt50" id="gt50" type="text"></form>'),
                input = form.one('input'),
                validator;

            var gt50 = function(val) {
                return (val >= 50);
            };

            Y.FormValidator.addCustomRules(
                {
                    'greaterThan50': {
                        condition: gt50,
                        errorMessage: 'The digit should be >=50'
                    }
                }
            );

            validator = new Y.FormValidator({
                boundingBox: form,
                rules: {
                    gt50: {
                        custom: true,
                        greaterThan50: true,
                        required: true
                    }
                }
            });

            form.simulate('submit');

            Y.Assert.isTrue(validator.hasErrors());

            input.attr('value', '42');

            form.simulate('submit');

            Y.Assert.isTrue(validator.hasErrors());

            input.attr('value', '100');

            form.simulate('submit');

            Y.Assert.isFalse(validator.hasErrors());
        },

        /*
         * Check if validator correctly validates fields with optional custom rules
         * @tests AUI-1958
         */
        'test custom optional rules': function() {
            var form = Y.Node.create('<form><input name="always-fails" id="always-fails" type="text"></form>'),
                input = form.one('input'),
                validator;

            Y.FormValidator.addCustomRules(
                {
                    'alwaysFailsValidation': {
                        condition: function() {
                            return false;
                        },
                        errorMessage: 'Give up, there\'s nothing you can do to pass this validation.'
                    }
                }
            );

            validator = new Y.FormValidator({
                boundingBox: form,
                rules: {
                    'always-fails': {
                        alwaysFailsValidation: true,
                        custom: true
                    }
                }
            });

            form.simulate('submit');

            Y.Assert.isFalse(validator.hasErrors());

            input.attr('value', 'anything');

            form.simulate('submit');

            Y.Assert.isTrue(validator.hasErrors());
        },

        _assertValidatorNextLabel: function(input) {
            var inputNode,
                textNode;

            inputNode = Y.one(input);

            textNode = inputNode.get('nextSibling');

            Y.Assert.isTrue(textNode.get('nodeType') === 3, 'Next to the input should be a text node');

            if (Y.FormValidator.isCheckable(inputNode)) {
                textNode = inputNode.ancestor('.form-group').get('lastChild').previous();
            }

            Y.Assert.isTrue(
                textNode.next().hasClass('form-validator-stack'),
                'Next to the input should be form validator');
        }
    }));

    Y.Test.Runner.add(suite);

}, '', {
    requires: ['test', 'aui-form-validator', 'node-event-simulate']
});


text:
package com.brein.domain.results;

import com.brein.domain.BreinResult;
import com.brein.domain.results.recommendationparts.RecommendedItem;

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

public class BreinRecommendationResult extends BreinResult {
    private static final String RESULT_FIELD = "result";
    private final List<RecommendedItem> items;

    public BreinRecommendationResult(final Map<String, Object> json) {
        super(json);

        items = new ArrayList<>();
        //noinspection unchecked
        for (final Map<String, Object> inner :
                (List<Map<String, Object>>) json.getOrDefault(RESULT_FIELD, Collections.emptyList())) {
            items.add(new RecommendedItem(inner));
        }
    }

    public List<RecommendedItem> getRecommendedItems() {
        return items;
    }
}


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ricardo Sahade | Leonardo A. Saravia</title>
    <link>https://lsaravia.github.io/authors/ricardo-sahade/</link>
      <atom:link href="https://lsaravia.github.io/authors/ricardo-sahade/index.xml" rel="self" type="application/rss+xml" />
    <description>Ricardo Sahade</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><copyright>Esta obra está bajo una Licencia Creative Commons Atribución 4.0 Internacional.</copyright><lastBuildDate>Fri, 05 Jan 2018 00:00:00 +0000</lastBuildDate>
    <image>
      <url>https://lsaravia.github.io/img/bio-photo.jpg</url>
      <title>Ricardo Sahade</title>
      <link>https://lsaravia.github.io/authors/ricardo-sahade/</link>
    </image>

    <item>
      <title>The Food Web of Potter Cove (Antarctica): Complexity, Structure and Function</title>
      <link>https://lsaravia.github.io/publication/marina-2018/</link>
      <pubDate>Fri, 05 Jan 2018 00:00:00 +0000</pubDate>
      <guid>https://lsaravia.github.io/publication/marina-2018/</guid>
      <description></description>
    </item>

  </channel>
</rss>


text:
Harbor::View.cache_templates!

Harbor.serve_public_files! config.root + 'public'
config.assets.compile = true

DB = Sequel.connect("jdbc:h2:mem:")

Sequel.extension :migration
Sequel::Migrator.run(DB, config.root + "db")


text:
package com.marcobehler.saito.core.files;

import java.io.IOException;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.marcobehler.saito.core.rendering.Model;
import com.marcobehler.saito.core.util.PathUtils;

import lombok.extern.slf4j.Slf4j;

/**
 * @author Marco Behler <marco@marcobehler.com>
 */
@Slf4j
public class DataFile extends SaitoFile {

    private static final String DATA_FILE_EXTENSION = ".json";

    public DataFile(Path sourceDirectory, Path relativePath) {
        super(sourceDirectory, relativePath);
    }

    /**
     * Parses the .json file and return its content as a map.
     * <p>
     * If the data file has the following path /data/my/dear/friends.json , the resulting map will look like
     * { my :{ dear: { friends: [content]}}}
     *
     * @return
     */
    public Map<String, Object> parse() {
        Map<String, Object> result = new HashMap<>();
        try {
            Iterator<String> it = stripAndSplit(getRelativePath());
            Map<String, Object> currentMap = result;
            while (it.hasNext()) {
                String key = it.next();
                if (it.hasNext()) {
                    currentMap.put(key, currentMap = new HashMap<>());
                } else {
                    ObjectMapper mapper = new ObjectMapper();

                    String json = getDataAsString().trim();
                    if (json.startsWith("[")) {
                        List<Object> myObjects = mapper.readValue(json, new TypeReference<List<Object>>(){});
                        currentMap.put(key, myObjects);
                    } else if (json.startsWith("{")) {
                        Map<? extends String, ?> dataAsMap = mapper.readValue(json, new TypeReference<HashMap<String, Object>>() {});
                        currentMap.put(key, dataAsMap);
                    } else {
                        throw new IllegalStateException("Json does not start with [ or { =>" + json.substring(0, 20) + "...");
                    }
                }
            }
        } catch (IOException e) {
            log.error("Error parsing data file", e);
        }
        return result;
    }

    private Iterator<String> stripAndSplit(Path path) {
        String strippedPath = PathUtils.stripExtension(path, DATA_FILE_EXTENSION);
        return PathUtils.splitByFileSeparator(strippedPath).iterator();
    }

}


text:
package com.Netzwerk.de;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Hashtable;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;

import org.apache.log4j.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

/**
 * This class describe a interpreter of the XML file. The content of the XML
 * file would be sort and store informations of the server in a TSInfo object.
 *
 * @author Pascal Schäfer
 * @version 0.0.1
 */

public class XMLInterpreter extends Object
{

	/**
	 * A object of a chosen strategy to take a server
	 */
	private IStrategy strategy = null;

	/**
	 * A table to store the lists in order of types of the servers
	 */
	private Hashtable<String, ArrayList<TSInfo>> table = new Hashtable<String, ArrayList<TSInfo>>();

	/**
	 * Document for the XML file
	 */
	private Document doc = null;

	/**
	 * A object of a logger
	 */
	private static Logger logger = Logger.getLogger(XMLInterpreter.class);

	/**
	 * The public constructor of this class
	 */
	public XMLInterpreter()
	{
		logger.info("Anfang / Ende des Konstruktors Auswerten");
	}

	/**
	 * This method read a XML file and validate this file with a XSD file

	 * and sort the TSInfo object in a list

	 * The lists are sorted by type

	 *
	 * @param psXMLPath as String
	 * @param psXSDPath as String
	 */
	public void readXMLFileWithXSD(String psXMLPath, String psXSDPath)
	{
		logger.info("Beginn der Methode dateiAuslesen");

		try
		{
			logger.debug("Versuche XSD zu Laden");
			SchemaFactory schemafactory = SchemaFactory
					.newInstance("http://www.w3.org/2001/XMLSchema");

			File schemaLocation = new File(psXSDPath);
			Schema schema = schemafactory.newSchema(schemaLocation);

			Validator validator = schema.newValidator();

			DocumentBuilderFactory factory = DocumentBuilderFactory
					.newInstance();
			factory.setNamespaceAware(true);

			DocumentBuilder builder = factory.newDocumentBuilder();
			doc = builder.parse(new File(psXMLPath));

			DOMSource source = new DOMSource(doc);
			DOMResult result = new DOMResult();

			validator.validate(source, result);

			logger.debug("");
			logger.debug("Validation war erfolgreich");

			Node rootNode = doc.getDocumentElement();

			logger.debug("Root Knoten: " + rootNode.getNodeName());
			logger.debug("");
			logger.debug("\nhat Kinder Knoten: " + rootNode.hasChildNodes());

			NodeList children = rootNode.getChildNodes();

			for (int i = 0; i < children.getLength(); i++)
			{
				NamedNodeMap nnm = children.item(i).getAttributes();
				if (nnm != null)
				{
					NodeList childrensChildren = children.item(i)
							.getChildNodes();

					String sIp = childrensChildren.item(1).getTextContent();
					String sType = childrensChildren.item(3).getTextContent();
					int iTyp = Integer.parseInt(sType);
					String sUsageRate = childrensChildren.item(5)
							.getTextContent();
					int iAuslastung = Integer.parseInt(sUsageRate);

					String sName = childrensChildren.item(7).getTextContent();

					if (iTyp >= 0)
					{
						if (table.containsKey(sType))
						{
							table.get(sType).add(
									new TSInfo(iAuslastung, iTyp, sIp, sName));
						}
						else
						{
							table.put(sType, new ArrayList<TSInfo>());
							table.get(sType).add(
									new TSInfo(iAuslastung, iTyp, sIp, sName));
						}
					}
					else
					{
						logger.warn("Typ must be in the positive range Server: ");
						logger.warn("Server: ;Type: " + sType + "; IP: " + sIp
								+ ";usage rate: " + sUsageRate + "; Name: "
								+ sName);
					}
				}
			}
		}
		catch (SAXException e)
		{
			e.printStackTrace();
			logger.error(e.getMessage());
		}
		catch (IOException e)
		{
			e.printStackTrace();
			logger.error(e.getMessage());
		}
		catch (ParserConfigurationException e)
		{
			e.printStackTrace();
			logger.error(e.getMessage());
		}

		logger.debug("Lists of the server sorted by type");

		int i = 1;
		int iCount = 0;
		for (String elem : table.keySet())
		{
			ArrayList<TSInfo> list = table.get(elem);
			logger.debug("\n\n");
			logger.debug("Typ : " + elem + "\n\n");
			i = 1;
			if (table.get(elem).size() < 3)
			{
				logger.warn("< 3 Server of type " + elem);
			}
			for (TSInfo act : list)
			{
				logger.debug("TSInfo Object " + i + ": IP:" + act.getIP()
						+ " ;usage rate: " + act.getUsageRate() + " ;Type: "
						+ act.getType() + " ;Name: " + act.getName());
				i++;
				iCount++;
			}
		}

		logger.info("\n\n");
		logger.info("Number of TSInfo Objects: " + iCount);

		logger.info("End of this method to read the XML file");
		logger.info("");
	}

	/**
	 * Read the available types and return the types
	 *
	 * @return the types as String array
	 */
	public String[] getKeys()
	{
		logger.info("Starts the method XMLInterpreter.getKeys");
		logger.debug("Size of the table: " + table.size());
		logger.debug("Keyset of the table: " + table.keySet());
		String[] tmp = null;
		if (table.size() != 0) tmp = new String[table.size()];
		if (table.size() == 0)
		{
			tmp = new String[1];
			tmp[0] = "type unavailable";
		}

		int i = 0;
		for (String elem : table.keySet())
		{
			tmp[i++] = elem;
			System.out.println(tmp[i++]);
		}
		logger.info("End of the method XMLInterpreter.getKeys");
		logger.info("");

		return tmp;
	}

	/**
	 * This method checks if the type available
	 *
	 * @param psKey as String
	 * @return a boolean
	 */
	public boolean checkKey(String psKey)
	{
		logger.info("Anfang der Methode Auswerten.checkKey");
		logger.info("Ende der Methode Auswerten.checkKey");
		logger.info("");
		logger.debug("Uebergebener Key Wert: " + psKey);
		logger.debug("return: " + table.containsKey(psKey));
		return table.containsKey(psKey);
	}

	/**
	 * Search a server with the name of the server
	 *
	 * @param psName as String
	 * @return sErgebnis as String
	 */
	public String getIPbyName(String psName)
	{
		logger.info("Start of the method XMLInterpreter.getIPbyName");
		logger.debug("Name: " + psName);
		String sErgebnis = "not found";
		for (String key : table.keySet())
		{
			ArrayList<TSInfo> list = table.get(key);
			for (TSInfo akt : list)
			{
				if (akt.getName().equals(psName))
				{
					sErgebnis = akt.getIP();
				}
			}
		}
		logger.debug(sErgebnis);
		logger.info("Ende of the method XMLInterpreter.getIPbyName");
		logger.info("");
		return sErgebnis;
	}

	/**
	 * Search a server by his name and his type
	 *
	 * @param psName as String
	 * @param psType as String
	 * @return sErgebnis as String
	 */
	public String getIPbyNameTyp(String psName, String psType)
	{
		logger.info("Start of the method XMLInterpreter.getIPbyNameTyp");
		logger.debug("Name: " + psName);
		logger.debug("Type: " + psType);
		String sErgebnis = "not found";
		try
		{
			int piTyp = Integer.parseInt(psType);
			for (String key : table.keySet())
			{
				ArrayList<TSInfo> list = table.get(key);
				for (TSInfo akt : list)
				{
					if (akt.getName().equals(psName) && akt.getType() == piTyp)
					{
						sErgebnis = akt.getIP();
					}
				}
			}
		}
		catch (NumberFormatException e)
		{
			logger.debug("cant parse from String to int...");
			return ("the typ must be a number");
		}
		logger.debug(sErgebnis);
		logger.info("End of the method XMLInterpreter.getIPbyNameTyp");
		logger.info("");
		return sErgebnis;
	}

	/**
	 * Set the actual strategy algorithm
	 *
	 * @param strategy as IStrategy
	 */
	public void setStrategy(IStrategy strategy)
	{
		this.strategy = strategy;
	}

	/**
	 * Choose a server with the actual strategy algorithm
	 *
	 * @return the IPv4 address of the choosen server as String
	 */
	public String chooseServer()
	{
		return this.strategy.chooseServer(table);
	}
}


text:
#ifndef FUSION_VECTOR_FORWARD_11052014_1626
#define FUSION_VECTOR_FORWARD_11052014_1626

#include <boost/config.hpp>
#include <boost/fusion/support/config.hpp>

///////////////////////////////////////////////////////////////////////////////
// With no variadics, we will use the C++03 version
///////////////////////////////////////////////////////////////////////////////
# include <boost/fusion/container/vector/detail/cpp03/vector_fwd.hpp>

#endif


text:
// see monacoCreator.js/setupDefinitionWorker

// monaco is using 'define' for module dependencies and service lookup.
// hopefully typescript is self-contained
var ts = null;
var define = (id, dependencies, callback) => ts = callback();

importScripts("https://unpkg.com/monaco-editor@0.20.0/dev/vs/language/typescript/lib/typescriptServices.js");

const supportedTags = new Set(['deprecated', 'beta', 'experimental']);
var tagCandidates = [];

// optimize syntaxtree visitor, we don't care about non documented nodes
function canHaveJsDoc(node) {
    const kind = node.kind;
    switch (kind) {
        case ts.SyntaxKind.Parameter:
        case ts.SyntaxKind.CallSignature:
        case ts.SyntaxKind.ConstructSignature:
        case ts.SyntaxKind.MethodSignature:
        case ts.SyntaxKind.PropertySignature:
        case ts.SyntaxKind.ArrowFunction:
        case ts.SyntaxKind.ParenthesizedExpression:
        case ts.SyntaxKind.SpreadAssignment:
        case ts.SyntaxKind.ShorthandPropertyAssignment:
        case ts.SyntaxKind.PropertyAssignment:
        case ts.SyntaxKind.FunctionExpression:
        case ts.SyntaxKind.FunctionDeclaration:
        case ts.SyntaxKind.LabeledStatement:
        case ts.SyntaxKind.ExpressionStatement:
        case ts.SyntaxKind.VariableStatement:
        case ts.SyntaxKind.Constructor:
        case ts.SyntaxKind.MethodDeclaration:
        case ts.SyntaxKind.PropertyDeclaration:
        case ts.SyntaxKind.GetAccessor:
        case ts.SyntaxKind.SetAccessor:
        case ts.SyntaxKind.ClassDeclaration:
        case ts.SyntaxKind.ClassExpression:
        case ts.SyntaxKind.InterfaceDeclaration:
        case ts.SyntaxKind.TypeAliasDeclaration:
        case ts.SyntaxKind.EnumMember:
        case ts.SyntaxKind.EnumDeclaration:
        case ts.SyntaxKind.ModuleDeclaration:
        case ts.SyntaxKind.ImportEqualsDeclaration:
        case ts.SyntaxKind.IndexSignature:
        case ts.SyntaxKind.FunctionType:
        case ts.SyntaxKind.ConstructorType:
        case ts.SyntaxKind.JSDocFunctionType:
        case ts.SyntaxKind.EndOfFileToken:
        case ts.SyntaxKind.ExportDeclaration:
            return true;
        default:
            return false;
    }
}

function onFindCandidate(node, tag) {
    const name = relatedName(node);
    if (name)
        tagCandidates.push({name: name, tagName: tag.tagName.escapedText});
}

function relatedName(node) {
    if (canHaveJsDoc(node) && node.name)
        return node.name.escapedText;

    if (node.parent)
        return relatedName(node.parent);

    return undefined;
}

function visit(node) {

    if (node.jsDoc) {
        for (const jsDocEntry of node.jsDoc) {
            if (jsDocEntry.tags) {
                for (const tag of jsDocEntry.tags) {
                    if (isCandidate(tag))
                        onFindCandidate(node, tag);
                }
            }
        }
    }

    ts.forEachChild(node, visit);
}

function isCandidate(tag) {
    return tag.tagName && supportedTags.has(tag.tagName.escapedText);
}

function processDefinition(code) {
    if (tagCandidates.length == 0) {
        const sourceFile = ts.createSourceFile('babylon.js', code, ts.ScriptTarget.ESNext, true);
        ts.forEachChild(sourceFile, visit);
    }

    self.postMessage({ result: tagCandidates });
}

self.addEventListener('message', event => {
    const { code } = event.data;
    processDefinition(code);
});