text:
FROM java:openjdk-8-jdk
MAINTAINER Aaron Walker <a.walker@base2services.com>

ENV DEBIAN_FRONTEND noninteractive
ENV DOCKER_VERSION "17.05.0"
ENV CHEFDK_VERSION "1.2.22-1"
ENV PACKER_VERSION "0.12.2"

# Let's start with some basic stuff.
RUN apt-get update -qq && apt-get install -qqy \
  apt-transport-https \
  gettext-base \
  ca-certificates \
  lxc \
  iptables \
  git \
  git-core \
  git-flow \
  python-pip \
  unzip \
  jq \
  openssh-server \
  sudo \
  groff \
  less \
  zip \
  && apt-get clean -y && rm -rf /var/lib/apt/lists/* \
  && sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd \
  && mkdir -p /var/run/sshd \
  && adduser --quiet jenkins && echo "jenkins:jenkins" | chpasswd \
  && echo "jenkins ALL = NOPASSWD: ALL" > /etc/sudoers.d/jenkins \
  && usermod -a -G root jenkins \
  && curl -kL "https://packages.chef.io/stable/debian/6/chefdk_${CHEFDK_VERSION}_amd64.deb" > /tmp/chefdk.deb \
  && dpkg -i /tmp/chefdk.deb \
  && curl -L "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" > /tmp/packer.zip \
  && unzip -o /tmp/packer.zip -d /opt/packer \
  && pip install awscli

# Install edge docker
RUN curl -o /tmp/docker.tgz https://download.docker.com/linux/static/edge/x86_64/docker-$DOCKER_VERSION-ce.tgz \
    && tar -xf /tmp/docker.tgz \
    && mv docker/* /bin \
    && rm -rf docker /tmp/docker.tgz

# Install git-lfs
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
    apt-get install -y --no-install-recommends git-lfs && \
    git lfs install

EXPOSE 22

COPY jenkins-docker-slave.sh /usr/local/bin
ENTRYPOINT ["/usr/local/bin/jenkins-docker-slave.sh"]
CMD []


text:
using Atomiv.Core.Domain;

namespace Generator.Core.Domain.Orders
{
    public class OrderIdentity : Identity<int>
    {
        public OrderIdentity(int id) : base(id)
        {
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
void ofApp::setup()
{
    ofBackground(255);

    // Each of the following default values was determined experimentally.
    headColor = ofColor::lightBlue;
    headCenterX = 0.0;
    headCenterY = 0.0;
    headWidth = 200.0;
    headHeight = 200.0;

    mouthColor = ofColor::pink;
    mouthCenterX = 0;
    mouthCenterY = 40;
    mouthWidth = 132.0;
    mouthHeight = 20.0;

    noseColor = ofColor::blue;
    noseCenterX = 0.0;
    noseCenterY = 0.0;
    noseWidth = 32.0;
    noseHeight = 42.0;

    eyeXDistance = 66;
    eyeCenterY = -25.0;
    eyeWidth = 40.0;
    eyeHeight = 25.0;

    irisColor = ofColor::red;
    irisCenterOffsetX = 0.0;
    irisCenterOffsetY = 0.0;
    irisWidth = 15.0;
    irisHeight = 15.0;

    pupilColor = ofColor::black;
    pupilRadius = 4.0;

}

void ofApp::update()
{
    float eyeRollAmplitude = 5;
    float elapsedTimeSeconds = ofGetElapsedTimef();

    // Set the offset of the iris.
    irisCenterOffsetX = eyeRollAmplitude * std::sin(elapsedTimeSeconds);
    irisCenterOffsetY = eyeRollAmplitude * std::cos(2.0 * elapsedTimeSeconds);

    // Modulate the mouth width.
    mouthWidth = ofMap(ofNoise(elapsedTimeSeconds), 0, 1, 10, 132);
    mouthHeight = ofMap(ofNoise(elapsedTimeSeconds + 5), 0, 1, 10, 40);
}

void ofApp::draw()
{
    ofPushMatrix();
    ofTranslate(ofGetWidth() * 0.5, ofGetHeight() * 0.5);

    // Draw the head.
    ofFill();
    ofSetColor(headColor);
    ofDrawEllipse(headCenterX,
                  headCenterY,
                  headWidth,
                  headHeight);

    // Draw the mouth.
    ofSetColor(mouthColor);
    ofDrawRectRounded(mouthCenterX - mouthWidth / 2,
                      mouthCenterY - mouthHeight / 2,
                      mouthWidth, mouthHeight,
                      mouthWidth / 2);

    // Calculate the three triangle points for the nose.
    float x0 = noseCenterX;
    float y0 = noseCenterY - noseHeight * 0.5;

    float x1 = noseCenterX + noseWidth * 0.5;
    float y1 = noseCenterY + noseHeight * 0.5;

    float x2 = noseCenterX - noseWidth * 0.5;
    float y2 = noseCenterY + noseHeight * 0.5;

    // Draw the nose.
    ofSetColor(noseColor);
    ofDrawTriangle(x0, y0, x1, y1, x2, y2);

    // Calculate the x / y position of the eyes.
    float eyeXDistanceFromCenter = eyeXDistance * 0.5;
    float rightEyeCenterX = eyeXDistanceFromCenter;
    float rightEyeCenterY = eyeCenterY;

    float leftEyeCenterX = -eyeXDistanceFromCenter;
    float leftEyeCenterY = eyeCenterY;

    // Draw the eye.
    ofSetColor(ofColor::white);
    ofDrawEllipse(rightEyeCenterX, rightEyeCenterY, eyeWidth, eyeHeight);
    ofDrawEllipse(leftEyeCenterX, leftEyeCenterY, eyeWidth, eyeHeight);

    // Calculate the position of the irises.
    float rightIrisCenterX = rightEyeCenterX + irisCenterOffsetX;
    float rightIrisCenterY = rightEyeCenterY + irisCenterOffsetY;

    float leftIrisCenterX = leftEyeCenterX + irisCenterOffsetX;
    float leftIrisCenterY = leftEyeCenterY + irisCenterOffsetY;

    // Draw the irises.
    ofSetColor(irisColor);
    ofDrawEllipse(rightIrisCenterX, rightIrisCenterY, irisWidth, irisHeight);
    ofDrawEllipse(leftIrisCenterX, leftIrisCenterY, irisWidth, irisHeight);

    // Draw the pupils.
    ofSetColor(ofColor::black);
    ofDrawCircle(rightIrisCenterX, rightIrisCenterY, pupilRadius);
    ofDrawCircle(leftIrisCenterX, leftIrisCenterY, pupilRadius);

    ofPopMatrix();

}


text:
package org.restsql.core;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.restsql.core.TableMetaData.TableRole;

/**
 * Encapsulates column (or field) metadata of an SQL Resource.
 *
 * @author Mark Sawers
 * @see SqlResource
 * @see TableMetaData
 */
public interface ColumnMetaData extends Comparable<ColumnMetaData> {

	/**
	 * Compares another column based on the column number of the select clause in the SQL Resource definition query.
	 * Implements Comparable interface.
	 */
	@Override
	public int compareTo(ColumnMetaData column);

	/**
	 * Returns column label, a string identified in double quotes after columns in the select clause in the SQL Resource
	 * definition query.
	 */
	public String getColumnLabel();

	/** Returns column name, as it is known by the database. */
	public String getColumnName();

	/** Returns column number in the select clause in the SQL Resource definition query. */
	public int getColumnNumber();

	/**
	 * Returns column type from java.sql.Types.
	 *
	 * @return java.sql.Types constant
	 * @see java.sql.Types
	 */
	public int getColumnType();

	/** Returns column type name as given by the database JDBC driver. */
	public String getColumnTypeName();

	/** Returns database name. */
	public String getDatabaseName();

	/**
	 * Returns fully qualified column label in database-specific form for use in SQL statements. MySQL uses the form
	 * database.table.label, for example sakila.film.id. PostgreSQL can only use
	 * label and cannot disambiguate by table source.
	 */
	public String getQualifiedColumnLabel();

	/**
	 * Returns fully qualified column name in database-specific form for use in SQL statements. MySQL uses the form
	 * database.table.column, for example sakila.film.film_id. PostgreSQL uses the form
	 * database.schema.table.column, for example sakila.public.film.film_id.
	 */
	public String getQualifiedColumnName();

	/**
	 * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form
	 * database.table, for example sakila.film. PostgreSQL uses the form
	 * database.schema.table, for example sakila.public.film.
	 */
	public String getQualifiedTableName();

	/** Returns object from result set using the column label. */
	public Object getResultByLabel(ResultSet resultSet) throws SQLException;

	/** Returns object from result set using the column number. */
	public Object getResultByNumber(ResultSet resultSet) throws SQLException;

	/** Returns sequence name associated with column or null if none. For MySQL, returns table name. */
	public String getSequenceName();

	/** Returns table name. */
	public String getTableName();

	/** Returns role of table in the SQL Resource. */
	public TableRole getTableRole();

	/** Returns true if type is BINARY, BLOB, JAVA OBJECT or LONGVARBINARY. */
	public boolean isBinaryType();

	/** Returns true if column is a character string or date, time or timestamp. */
	public boolean isCharOrDateTimeType();

	/**
	 * Returns true for foreign key columns not declared in the SQL Resource query but added by the framework. These are
	 * required for writes to child extensions, parent extensions and and one-to-many child tables.
	 */
	public boolean isNonqueriedForeignKey();

	/** Returns true if the column is a primary key. */
	public boolean isPrimaryKey();

	/** Returns true if the column is read-only, for example derived from SQL function or a database view. */
	public boolean isReadOnly();

	/**
	 * Returns true if column is associated with a sequence.
	 *
	 * @see #getSequenceName()
	 */
	public boolean isSequence();

	/**
	 * Converts String value to a numeric Object, Date or UUDecode String into Object if required using the column
	 * metadata.
	 *
	 * @param requestValue parameter or resource identifier
	 * @throws InvalidRequestException if conversion failed
	 */
	public void normalizeValue(final RequestValue requestValue) throws InvalidRequestException;

	/**
	 * Used for all columns declared in the SqlResource select clause.
	 */
	public void setAttributes(final int columnNumber, final String databaseName,
			final String qualifiedTableName, final String tableName, final String columnName,
			final String qualifiedColumnName, final String columnLabel, final String qualifiedColumnLabel,
			final String columnTypeName, final int columnType, final boolean readOnly);

	/**
	 * Used for foreign key columns not declared in the SqlResource select columns. These are required for writes to
	 * child extensions, parent extensions and child tables.
	 */
	public void setAttributes(final String databaseName, final String sqlQualifiedTableName,
			final String tableName, final TableRole tableRole, final String columnName,
			final String qualifiedColumnName, final String columnLabel, final String qualifiedColumnLabel,
			final String columnTypeString);

	/** Sets primary key. */
	public void setPrimaryKey(final boolean primaryKey);

	/** Sets true if column populated with a sequence function (auto increment). */
	public void setSequence(final boolean sequence);

	/** Sets sequence name. */
	public void setSequenceName(final String sequenceName);

	/** Sets table role. */
	public void setTableRole(final TableRole tableRole);
}


text:
import tensorflow as tf

def l_relu(x, leak = 0.2, name='lrelu'):
	# elegant leaky relu formulation inspired by
	# https://github.com/pkmital/tensorflow_tutorials/blob/master/python/libs/activations.py

	with tf.name_scope(name):
		return 0.5 * ( (1 + leak) * x + (1 - leak) * abs(x) )


text:
<?php
/**
*Auto Generated Model
*
*Program created By Sal Santoro sssantoro07@gmail.com
*
**********************************************************************************/

Class tbl_bots extends CActiveRecord
{

	public $id;
	public $name;

	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	public function tableName()
	{
		return 'tbl_bots';
	}

	public function primaryKey()
	{
		return 'id';
	}

	public function rules()
	{
		return array(
			array(
			'id,name,','safe'));
	}

	public function attributeLabels()
	{
		return array(

		'id'=>'Id',
		'name'=>'Name');
	}

}
?>


text:
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**

**Describe the solution you'd like**


text:
import $ from 'jquery'
import Translator from './i18n'
import Modal from './Modal'
import breakpoints from './Breakpoints'

let ChangeList = {
  /**
   * ChangeList component
   *
   * Filtering stuff
   */
  init: function (opts) {
    this._filtersDiv = $('#changelist-filter')
    this.t = new Translator($('html').attr('lang'))
    this.filtersForm = opts.changelistFiltersForm
    this.filtersInModal = opts.changelistFiltersInModal
    this.filtersAlwaysOpen = opts.changelistFiltersAlwaysOpen
    this.initTemplates()
    if (this._filtersDiv.length) {
      var self = this
      setTimeout(function () {
        self.activate()
      }, 200) // select2
      this.fixRangeFilter()
    }
  },
  activate: function () {
    if ($('.changelist-form-container').length) {
      // django >= 3.1
      $('#changelist-filter').appendTo($('.changelist-form-container'))
    }
    let isModal = false
    if (this.filtersAlwaysOpen) {
      $(document.body).addClass(
        'changelist-filter-active changelist-filter-always-open'
      )
    } else {
      // filters active?
      let _activeFilters = /__[^=]+=/.test(location.search)
      // actions ?
      let _activeActions = $('#changelist-form > .actions').length !== 0
      let _changelistForm = $('#changelist-form')
      let _filtersToggler = $('', {
        class:
          'changelist-filter-toggler' +
          (_activeFilters ? ' active' : '') +
          (_activeActions ? ' with-actions' : '')
      }).html(
        ' ' + this.t.get('filter') + ''
      )

      if (this.filtersInModal || parseInt($(window).width()) < breakpoints.lg) {
        let self = this
        isModal = true
        // wait for filters used js to exec
        $('#changelist-filter').prop('id', 'changelist-filter-modal')
        let titleEl = $('#changelist-filter-modal > h2')
        let title = titleEl.html()
        titleEl.remove()
        let content = $('#changelist-filter-modal')
        // remove from dom
        this.modal = new Modal({
          title,
          content,
          size: 'md',
          hideFooter: !this.filtersForm,
          actionBtnLabel: this.t.get('filter'),
          actionBtnCb: function () { self.filter(content) }
        })
        _filtersToggler.click(() => {
          self.modal.toggle()
        })
      } else {
        _filtersToggler.click(() => {
          $(document.body).toggleClass('changelist-filter-active')
          if (parseInt(this._filtersDiv.css('max-width')) === 100) {
            // diff between mobile and lg
            $('html,body').animate({
              scrollTop: this._filtersDiv.offset().top
            })
          }
        })
      }
      _changelistForm.prepend(_filtersToggler)
    }

    if (!isModal && this.filtersForm) {
      // add filters button
      let btn = $('', {'class': 'btn btn-primary'}).html(this.t.get('filter'))
        .on('click', () => this.filter($('#changelist-filter')))
      $('#changelist-filter').append($('
', {'class': 'text-center mb-3'}).append(btn))
    }

    if (/_popup=1/.test(location.href)) {
      $('#changelist-form .results').css('padding-top', '78px')
    }
  },
  getDropdownValue: function (dropdown) {
    let items = $(dropdown).find('option').attr('value').substr(1).split('&')
    let values = $(dropdown).val().substr(1).split('&').filter(item => items.indexOf(item) === -1)
    return values.length ? values.join('&') : null
  },
  filter: function (wrapper) {
    var self = this
    let qs = []

    let dropdowns = wrapper.find('select')
    let textInputs = wrapper.find('input').not('[type=hidden]')

    dropdowns
      .toArray()
      .map(el => self.getDropdownValue(el))
      .filter(v => v !== null)
      .forEach(v => qs.push(v))

    textInputs.each((idx, el) => el.value !== '' ? qs.push(`${el.name}=${el.value}`) : null)

    // console.log(location.pathname + (qs.length ? '?' + qs.filter(q => q !== '').join('&') : ''), qs)
    location.href = location.pathname + (qs.length ? '?' + qs.filter(q => q !== '').join('&') : '')
  },
  initTemplates: function () {
    const positionMap = {
      above: 'before',
      below: 'after',
      top: 'prepend',
      bottom: 'append'
    }

    $('template[data-type=include]').each(function (index, template) {
      let position = positionMap[$(template).attr('data-position')]
      if (position !== undefined) {
        let el = $('#changelist-form')
        el[position]($(template).html())
      } else {
        console.error('Baton: wrong changelist include position detected')
      }
    })

    $('template[data-type=filters-include]').each(function (index, template) {
      let position = positionMap[$(template).attr('data-position')]
      if (
        position !== undefined &&
        position !== 'before' &&
        position !== 'after'
      ) {
        if (position === 'prepend' && $('#changelist-filter-clear').length) {
          $('#changelist-filter-clear').after($(template).html())
        } else if (
          position === 'prepend' &&
          $('#changelist-filter > h2').length
        ) {
          $('#changelist-filter > h2').after($(template).html())
        } else {
          let el = $('#changelist-filter')
          el[position]($(template).html())
        }
      } else {
        console.error(
          'Baton: wrong changelist filters include position detected'
        )
      }
    })

    $('template[data-type=attributes]').each(function (index, template) {
      try {
        let data = JSON.parse($(template).html())

        for (let key in data) {
          if (data.hasOwnProperty(key)) {
            let selector
            let getParent = 'tr'
            if (data[key]['selector']) {
              selector = data[key]['selector']
              delete data[key]['selector']
            } else {
              selector =
                '#result_list tr input[name=_selected_action][value=' +
                key +
                ']'
            }
            if (data[key]['getParent'] !== undefined) {
              getParent = data[key]['getParent']
              delete data[key]['getParent']
            }

            let el = getParent ? $(selector).parents(getParent) : $(selector)
            el.attr(data[key])
          }
        }
      } catch (e) {
        console.error(e)
      }
    })
  },
  fixRangeFilter: function () {
    if (this.filtersForm) {
      $('.admindatefilter .controls').remove()
      $('.admindatefilter form').onSubmit = function () { return false }
    }
  }
}

export default ChangeList


text:
package at.jku.se.eatemup.core.json.messages;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;

import at.jku.se.eatemup.core.json.CastType;
import at.jku.se.eatemup.core.json.MessageType;
import at.jku.se.eatemup.core.json.OutgoingMessage;

public class BattleStartMessage extends OutgoingMessage {

	public void shuffleAnswersArray() {
		if (this.answers == null)
			return;
		List<Integer> list = Arrays.asList(ArrayUtils.toObject(this.answers));
		Collections.shuffle(list);
		Integer[] arr = new Integer[this.answers.length];
		list.toArray(arr);
		this.answers = ArrayUtils.toPrimitive(arr);
	}

	public String opUserId;
	public String opUserName;
	public String question;
	public int timelimit;
	public int[] answers;

	@Override
	public CastType getCastType() {
		return CastType.Multicast;
	}

	@Override
	public MessageType getType() {
		return MessageType.BattleStart;
	}
}


text:
import os from 'os';
import path from 'path';
import fs from 'fs';
import uuid from 'uuid/v4';
//import {Tail} from 'tail';
import Tail from 'always-tail';
import log from 'electron-log';

const tmpDirName = 'trebuchet';

export default class LogManager {

  constructor() {
    this.logMap = new Map();
  }

  /*
   * Each application will have a single text log in tmp on disk.  Various processes
   * That operate on the app will all write to the same log file.  Writing to disk keeps
   * the log out of memory, and helps prevent leaks.
   */
  attachLogger(app, process) {
    return this.createTmpDirIfNotExists()
      .then((tmpdir) => {
        return this.createAppLogIfNotExists(tmpdir, app);
      })
      .then((logEntry) => {
        this.configureLogger(process, logEntry.writeStream);
      })
      .catch((err) => {
        log.error("Error attaching logger to process...");
        log.error(err);
      });
  }

  /*
   * Given a process, attach the appropriate handlers and pipe output to
   * the log file.
   */
  configureLogger(process, writeStream) {
    process.stdout.setEncoding('utf8');
    process.stderr.setEncoding('utf8');
    process.stdout.pipe(writeStream, { end: false });
    process.stderr.pipe(writeStream, { end: false });
  }

  /*
   * Create the tmp dir if it doesn't exist.
   */
  createTmpDirIfNotExists() {
    return new Promise((resolve, reject) => {
      let tmpDir = path.join(os.tmpdir(), tmpDirName);
      log.info('Creating new tmp dir: ' + tmpDir);
      fs.mkdir(tmpDir, (err) => {
        if (err && err.code != "EEXIST") {
          log.error('Error creating new temp dir for logger');
          log.error(err);
          return reject(err);
        } else {
          return resolve(tmpDir);
        }
      });
    });
  }

  /*
   * Create the app log if it doesn't exist.  Returns the a writableStream
   * to a log provisioned for the given app.
   */
  createAppLogIfNotExists(tmpDir, app) {
    return new Promise((resolve, reject) => {

      // check to see if we already have a log for the app
      let logEntry = this.logMap.get(app.name);
      if (logEntry) {
        log.info('App log already exists, returning ' + logEntry.logPath);
        return resolve(logEntry);
      }

      // create the app log file in tmp
      let logPath = path.join(tmpDir, uuid());
      log.info('Creating new log path: ' + logPath);
      let writeStream = fs.createWriteStream(logPath)
        .on('error', (error) => {
          reject(error);
        })

      // make sure to update the map with the new log file
      logEntry = {
        logPath: logPath,
        writeStream: writeStream
      };
      this.logMap.set(app.name, logEntry);
      return resolve(logEntry);
    });
  }

  getAppLog(app) {
    let logEntry = this.logMap.get(app.name);
    if (logEntry) {
      // detach the old watcher first
      if (logEntry.tail) {
        logEntry.tail.unwatch();
      }
      let tail = new Tail(logEntry.logPath, '\n', { start: 0 })
        .on('line', (data) => {
          log.info("LOG: " + data);
        })
        .on("error", (err) => {
          log.error('Error reading from process log file.');
          log.error(err);
        });

      this.logMap.set(app.name, Object.assign(logEntry, { tail: tail }));
      return tail;
    }
    return null;
  }

}


text:
#ifndef _STRING_PARAM_DEF_H
#define _STRING_PARAM_DEF_H

#ifndef __cplusplus
#error This is a C++ include file and cannot be used from plain C
#endif

#include <memory>
#include <string>
#include <vector>
#include <ParamDef.h>

/** @file StringParamDef.h */
using std::string;
using std::vector;
using std::auto_ptr;

namespace Parameters {

	/**
	 * StringParamDef class used to support OFFLINE tasks
	 */
	class StringParamDef: public Parameters::ParamDef
	{
	  public:
	    /**
	     * Constructor
	     */
	    StringParamDef();

	    /**
	     * Constructor.
	     */
	    StringParamDef(const string & nameVal, const string & helpVal, const string & promptVal,
	       bool isRequired, auto_ptr< string > defaultVal, auto_ptr< vector < string > > validVals);

	    /**
	     * Destructor
	     */
	    virtual ~StringParamDef();

	    /*
	     * Accessor for the default value.
	     * @return the default value as an auto_ptr to a string
	     * if defined for this pdef, then the auto_ptr will
	     * point to something meaningful, else null.
	     */
	    auto_ptr<string> getDefault();

	    /*
	     * Accessor for the valid values.
	     * @return the valid values as an auto_ptr to a vector of strings
	     * if defined for this pdef, then the auto_ptr will
	     * point to something meaningful, else null.
	     */
	    auto_ptr< vector< string > > getValidValues();

	    /*
	     * Accessor for the flag indicating if there is a default value.
	     * @return the flag indicating if there is a default value
	     */
	    bool getHasDefault();

	    /*
	     * Accessor for the flag indicating if there is a valid values.
	     * @return the flag indicating if there is a valid values
	     */
	    bool getHasValidValues();

	  private:
	    string defaultValue_m;
	    vector< string > validValues_m;
	    bool hasDefault_m;
	    bool hasValidValues_m;
	};

}
#endif /*!_STRING_PARAM_DEF_H*/


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Environment (JUnit5-Docker 1.0.0-RC5 API)</title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element

com.github.junit5docker

Annotation Type Environment

public @interface Environment

Describes an environment variable to set for a docker container.

Since:

1.0

Required Element Summary

Required Elements

Modifier and Type
Required Element and Description

String
key

String
value

Element Detail

key

public abstract String key

Returns:

the environment's variable name.

value

public abstract String value

Returns:

the environment's variable value.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Field |

Required |

Optional

Detail:

Field |

Element

Copyright © 2017. All rights reserved.


text:
require_relative 'base'

module TestData

  class Person < TestData::Base

    class << self

      def full_name
        "#{first_name} #{last_name}"
      end

      def age
        (1..100).to_a.sample
      end

      def gender
        %w(Male Female).sample
      end

      def gender_short
        %w(M F).sample
      end

      def method_missing(name)
        fetch['person']["#{name}"].sample
      end
    end

  end

end


text:
module MarsPhotos
  VERSION = "0.2.2"
end


text:
package io.github.hapjava.characteristics.impl.humidifier;

import io.github.hapjava.characteristics.ExceptionalConsumer;
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
import io.github.hapjava.characteristics.impl.base.FloatCharacteristic;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Supplier;

/**
 * This characteristic describes the relative humidity dehumidifier threshold on which dehumidifier
 * turns on.
 */
public class HumidityDehumidifierThresholdCharacteristic extends FloatCharacteristic {

  public HumidityDehumidifierThresholdCharacteristic(
      Supplier<CompletableFuture<Double>> getter,
      ExceptionalConsumer<Double> setter,
      Consumer<HomekitCharacteristicChangeCallback> subscriber,
      Runnable unsubscriber) {
    super(
        "000000C9-0000-1000-8000-0026BB765291",
        "humidity threshold dehumidifier",
        0,
        100,
        1,
        "%",
        Optional.of(getter),
        Optional.of(setter),
        Optional.of(subscriber),
        Optional.of(unsubscriber));
  }
}


text:
require 'spec_helper'

describe 'gws_memo_messages', type: :feature, dbscope: :example, js: true do
  let(:site) { gws_site }
  let(:user) { gws_user }
  let!(:folder) { create(:gws_memo_folder, user: user, site: site) }
  let!(:memo) { create(:gws_memo_message, user: user, site: site) }

  before { login_gws_user }

  describe "move_all" do
    it do
      expect(memo.unseen?(gws_user)).to be_truthy

      visit gws_memo_messages_path(site)
      first(".list-item input[type=checkbox]").click
      within ".list-head-action" do
        click_on I18n.t('gws/memo/message.links.move')
        page.accept_confirm do
          click_on folder.name
        end
      end

      within find("#notice", visible: false) do
        expect(page).to have_content(I18n.t('ss.notice.move_all'))
      end

      memo.reload
      expect(memo.path(gws_user)).to eq folder.id.to_s

      within ".gws-memo-folder" do
        click_on folder.name
      end
      expect(page).to have_css(".list-item", text: memo.name)
    end
  end
end


text:
/**
 */
package CIM.IEC61968.Customers.impl;

import CIM.IEC61968.Common.impl.DocumentImpl;

import CIM.IEC61968.Customers.CustomersPackage;
import CIM.IEC61968.Customers.PricingStructure;
import CIM.IEC61968.Customers.Tariff;

import CIM.IEC61968.PaymentMetering.PaymentMeteringPackage;
import CIM.IEC61968.PaymentMetering.TariffProfile;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 *
 * An implementation of the model object 'Tariff'.
 *
 *

 * The following features are implemented:
 *

 *

 *
{@link CIM.IEC61968.Customers.impl.TariffImpl#getTariffProfiles Tariff Profiles}

 *
{@link CIM.IEC61968.Customers.impl.TariffImpl#getPricingStructures Pricing Structures}

 *
{@link CIM.IEC61968.Customers.impl.TariffImpl#getEndDate End Date}

 *
{@link CIM.IEC61968.Customers.impl.TariffImpl#getStartDate Start Date}

 *

 *
 * @generated
 */
public class TariffImpl extends DocumentImpl implements Tariff {
	/**
	 * The cached value of the '{@link #getTariffProfiles() Tariff Profiles}' reference list.
	 *
	 *
	 * @see #getTariffProfiles()
	 * @generated
	 * @ordered
	 */
	protected EList<TariffProfile> tariffProfiles;

	/**
	 * The cached value of the '{@link #getPricingStructures() Pricing Structures}' reference list.
	 *
	 *
	 * @see #getPricingStructures()
	 * @generated
	 * @ordered
	 */
	protected EList<PricingStructure> pricingStructures;

	/**
	 * The default value of the '{@link #getEndDate() End Date}' attribute.
	 *
	 *
	 * @see #getEndDate()
	 * @generated
	 * @ordered
	 */
	protected static final String END_DATE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getEndDate() End Date}' attribute.
	 *
	 *
	 * @see #getEndDate()
	 * @generated
	 * @ordered
	 */
	protected String endDate = END_DATE_EDEFAULT;

	/**
	 * The default value of the '{@link #getStartDate() Start Date}' attribute.
	 *
	 *
	 * @see #getStartDate()
	 * @generated
	 * @ordered
	 */
	protected static final String START_DATE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getStartDate() Start Date}' attribute.
	 *
	 *
	 * @see #getStartDate()
	 * @generated
	 * @ordered
	 */
	protected String startDate = START_DATE_EDEFAULT;

	/**
	 *
	 *
	 * @generated
	 */
	protected TariffImpl() {
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return CustomersPackage.Literals.TARIFF;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public EList<TariffProfile> getTariffProfiles() {
		if (tariffProfiles == null) {
			tariffProfiles = new EObjectWithInverseResolvingEList.ManyInverse<TariffProfile>(TariffProfile.class, this, CustomersPackage.TARIFF__TARIFF_PROFILES, PaymentMeteringPackage.TARIFF_PROFILE__TARIFFS);
		}
		return tariffProfiles;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public EList<PricingStructure> getPricingStructures() {
		if (pricingStructures == null) {
			pricingStructures = new EObjectWithInverseResolvingEList.ManyInverse<PricingStructure>(PricingStructure.class, this, CustomersPackage.TARIFF__PRICING_STRUCTURES, CustomersPackage.PRICING_STRUCTURE__TARIFFS);
		}
		return pricingStructures;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public String getEndDate() {
		return endDate;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setEndDate(String newEndDate) {
		String oldEndDate = endDate;
		endDate = newEndDate;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CustomersPackage.TARIFF__END_DATE, oldEndDate, endDate));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public String getStartDate() {
		return startDate;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setStartDate(String newStartDate) {
		String oldStartDate = startDate;
		startDate = newStartDate;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, CustomersPackage.TARIFF__START_DATE, oldStartDate, startDate));
	}

	/**
	 *
	 *
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case CustomersPackage.TARIFF__TARIFF_PROFILES:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getTariffProfiles()).basicAdd(otherEnd, msgs);
			case CustomersPackage.TARIFF__PRICING_STRUCTURES:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getPricingStructures()).basicAdd(otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case CustomersPackage.TARIFF__TARIFF_PROFILES:
				return ((InternalEList<?>)getTariffProfiles()).basicRemove(otherEnd, msgs);
			case CustomersPackage.TARIFF__PRICING_STRUCTURES:
				return ((InternalEList<?>)getPricingStructures()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CustomersPackage.TARIFF__TARIFF_PROFILES:
				return getTariffProfiles();
			case CustomersPackage.TARIFF__PRICING_STRUCTURES:
				return getPricingStructures();
			case CustomersPackage.TARIFF__END_DATE:
				return getEndDate();
			case CustomersPackage.TARIFF__START_DATE:
				return getStartDate();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CustomersPackage.TARIFF__TARIFF_PROFILES:
				getTariffProfiles().clear();
				getTariffProfiles().addAll((Collection<? extends TariffProfile>)newValue);
				return;
			case CustomersPackage.TARIFF__PRICING_STRUCTURES:
				getPricingStructures().clear();
				getPricingStructures().addAll((Collection<? extends PricingStructure>)newValue);
				return;
			case CustomersPackage.TARIFF__END_DATE:
				setEndDate((String)newValue);
				return;
			case CustomersPackage.TARIFF__START_DATE:
				setStartDate((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case CustomersPackage.TARIFF__TARIFF_PROFILES:
				getTariffProfiles().clear();
				return;
			case CustomersPackage.TARIFF__PRICING_STRUCTURES:
				getPricingStructures().clear();
				return;
			case CustomersPackage.TARIFF__END_DATE:
				setEndDate(END_DATE_EDEFAULT);
				return;
			case CustomersPackage.TARIFF__START_DATE:
				setStartDate(START_DATE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CustomersPackage.TARIFF__TARIFF_PROFILES:
				return tariffProfiles != null && !tariffProfiles.isEmpty();
			case CustomersPackage.TARIFF__PRICING_STRUCTURES:
				return pricingStructures != null && !pricingStructures.isEmpty();
			case CustomersPackage.TARIFF__END_DATE:
				return END_DATE_EDEFAULT == null ? endDate != null : !END_DATE_EDEFAULT.equals(endDate);
			case CustomersPackage.TARIFF__START_DATE:
				return START_DATE_EDEFAULT == null ? startDate != null : !START_DATE_EDEFAULT.equals(startDate);
		}
		return super.eIsSet(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (endDate: ");
		result.append(endDate);
		result.append(", startDate: ");
		result.append(startDate);
		result.append(')');
		return result.toString();
	}

} //TariffImpl


text:
set(DOCUMENTATION "This Module contains helper classes used for the Testing
infrastructure of ITK. As an application developer you should not normally need
any of these classes. However, they are essential for the quality control
system supporting ITK.")

itk_module(ITKTestKernel
  DEPENDS
    ITKIOBioRad
    ITKIOBMP
    ITKIOGDCM
    ITKIOGIPL
    ITKIOJPEG
    ITKIOLSM
    ITKIOMeta
    ITKIONIFTI
    ITKIONRRD
    ITKIOPNG
    ITKIOStimulate
    ITKIOTIFF
    ITKIOVTK
    ITKKWSys
  DESCRIPTION
    "${DOCUMENTATION}"
)


text:
package aurelienribon.gdxsetupui.ui.panels;

import aurelienribon.gdxsetupui.ui.Ctx;
import aurelienribon.gdxsetupui.ui.MainPanel;
import aurelienribon.ui.css.Style;
import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.io.IOException;
import java.util.regex.Pattern;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;

/**
 * @author Aurelien Ribon | http://www.aurelienribon.com/
 */
public class ConfigSetupPanel extends javax.swing.JPanel {
	private boolean clicToShowSettings = true;

    public ConfigSetupPanel(final MainPanel mainPanel) {
        initComponents();

		nameField.setText(Ctx.cfgSetup.projectName);
		packageField.setText(Ctx.cfgSetup.packageName);
		mainClassField.setText(Ctx.cfgSetup.mainClassName);

		try {
			File destDir = new File(Ctx.cfgSetup.destinationPath);
			destinationField.setText(destDir.getCanonicalPath());
		} catch (IOException ex) {
			assert false;
		}

		nameField.addMouseListener(selectOnFocusMouseListener);
		nameField.addKeyListener(updateOnTypeKeyListener);
		nameField.addKeyListener(projectNameKeyListener);
		packageField.addMouseListener(selectOnFocusMouseListener);
		packageField.addKeyListener(updateOnTypeKeyListener);
		packageField.addKeyListener(packageNameKeyListener);
		mainClassField.addMouseListener(selectOnFocusMouseListener);
		mainClassField.addKeyListener(updateOnTypeKeyListener);
		mainClassField.addKeyListener(mainClassNameKeyListener);

		browseBtn.addActionListener(new ActionListener() {@Override public void actionPerformed(ActionEvent e) {browse();}});
		genDesktopPrjChk.addActionListener(new ActionListener() {@Override public void actionPerformed(ActionEvent e) {update();}});
		genAndroidPrjChk.addActionListener(new ActionListener() {@Override public void actionPerformed(ActionEvent e) {update();}});
		genHtmlPrjChk.addActionListener(new ActionListener() {@Override public void actionPerformed(ActionEvent e) {update();}});
                genIosPrjChk.addActionListener(new ActionListener() {@Override public void actionPerformed(ActionEvent e) {update();}});

		advancedSettingsLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		advancedSettingsLabel.addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent e) {
				if (clicToShowSettings && mainPanel.showAdvancedSettings()) {
					clicToShowSettings = false;
					advancedSettingsLabel.setText("< Hide advanced settings");
				} else if (mainPanel.hideAdvancedSettings()) {
					clicToShowSettings = true;
					advancedSettingsLabel.setText("Show advanced settings >");
				}
			}
		});

		update();

		Style.registerCssClasses(headerPanel, ".header");
		Style.registerCssClasses(numberLabel, ".headerNumber");
		Style.registerCssClasses(advancedSettingsLabel, ".linkLabel");
		Style.registerCssClasses(browseBtn, ".center");

		nameField.requestFocusInWindow();
		nameField.selectAll();
    }

	private void browse() {
		String path = Ctx.cfgSetup.destinationPath;
		JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(this);

		JFileChooser chooser = new JFileChooser(new File(path));
		chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
		chooser.setDialogTitle("Select the destination folder");

		if (chooser.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) {
			destinationField.setText(chooser.getSelectedFile().getPath());
			update();
		}
	}

	private void update() {
		Ctx.cfgSetup.projectName = nameField.getText();
		Ctx.cfgSetup.packageName = packageField.getText();
		Ctx.cfgSetup.mainClassName = mainClassField.getText();
		Ctx.cfgSetup.destinationPath = destinationField.getText();
		Ctx.cfgSetup.isDesktopIncluded = genDesktopPrjChk.isSelected();
		Ctx.cfgSetup.isAndroidIncluded = genAndroidPrjChk.isSelected();
		Ctx.cfgSetup.isHtmlIncluded = genHtmlPrjChk.isSelected();
                Ctx.cfgSetup.isIosIncluded = genIosPrjChk.isSelected();
		Ctx.fireCfgSetupChanged();
	}

	private final KeyListener updateOnTypeKeyListener = new KeyAdapter() {
		@Override
		public void keyReleased(KeyEvent e) {
			update();
		}
	};

	private final MouseListener selectOnFocusMouseListener = new MouseAdapter() {
		@Override
		public void mousePressed(MouseEvent e) {
			JTextField field = (JTextField) e.getSource();
			if (!field.isFocusOwner()) field.selectAll();
		}
	};

	private final KeyListener projectNameKeyListener = new KeyAdapter() {
		private String backup;

		@Override
		public void keyPressed(KeyEvent e) {
			JTextField field = (JTextField) e.getSource();
			backup = field.getText();
		}

		@Override
		public void keyReleased(KeyEvent e) {
			JTextField field = (JTextField) e.getSource();
			if (!Pattern.compile("[a-zA-Z0-9_-]*").matcher(field.getText()).matches()) {
				String msg = "Only alphanumeric, '-' and '_' characters are allowed for project name.";
				JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(ConfigSetupPanel.this);
				JOptionPane.showMessageDialog(frame, msg);
				field.setText(backup);
				update();
			}
		}
	};

	private final KeyListener packageNameKeyListener = new KeyAdapter() {
		private String backup;

		@Override
		public void keyPressed(KeyEvent e) {
			JTextField field = (JTextField) e.getSource();
			backup = field.getText();
		}

		@Override
		public void keyReleased(KeyEvent e) {
			JTextField field = (JTextField) e.getSource();
			if (!Pattern.compile("[a-zA-Z0-9_\\.]*").matcher(field.getText()).matches()) {
				String msg = "Only alphanumeric, '_' and '.' characters are allowed for package name.";
				JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(ConfigSetupPanel.this);
				JOptionPane.showMessageDialog(frame, msg);
				field.setText(backup);
				update();
			}
		}
	};

	private final KeyListener mainClassNameKeyListener = new KeyAdapter() {
		private String backup;

		@Override
		public void keyPressed(KeyEvent e) {
			JTextField field = (JTextField) e.getSource();
			backup = field.getText();
		}

		@Override
		public void keyReleased(KeyEvent e) {
			JTextField field = (JTextField) e.getSource();
			if (!Pattern.compile("[a-zA-Z0-9_]*").matcher(field.getText()).matches()) {
				String msg = "Only alphanumeric and '_' characters are allowed for class name.\n";
				JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(ConfigSetupPanel.this);

				JOptionPane.showMessageDialog(frame, msg);
				field.setText(backup);
				update();
			}
		}
	};

	// -------------------------------------------------------------------------
	// Generated stuff
	// -------------------------------------------------------------------------

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        headerPanel = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        numberLabel = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        destinationField = new javax.swing.JTextField();
        nameField = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        packageField = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        mainClassField = new javax.swing.JTextField();
        advancedSettingsLabel = new javax.swing.JLabel();
        browseBtn = new aurelienribon.ui.components.Button();
        genCorePrjChk = new aurelienribon.ui.CompactCheckBox();
        genAndroidPrjChk = new aurelienribon.ui.CompactCheckBox();
        genDesktopPrjChk = new aurelienribon.ui.CompactCheckBox();
        genHtmlPrjChk = new aurelienribon.ui.CompactCheckBox();
        genIosPrjChk = new aurelienribon.ui.CompactCheckBox();

        setLayout(new java.awt.BorderLayout());

        jLabel4.setText("<html> Main parameters defining your project. See the overview panel to know if it suits your needs.");
        jLabel4.setVerticalAlignment(javax.swing.SwingConstants.TOP);

        numberLabel.setText("1");

        javax.swing.GroupLayout headerPanelLayout = new javax.swing.GroupLayout(headerPanel);
        headerPanel.setLayout(headerPanelLayout);
        headerPanelLayout.setHorizontalGroup(
            headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, headerPanelLayout.createSequentialGroup()
                .addComponent(numberLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE))
        );
        headerPanelLayout.setVerticalGroup(
            headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
            .addComponent(numberLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        add(headerPanel, java.awt.BorderLayout.NORTH);

        jPanel1.setOpaque(false);

        destinationField.setEditable(false);

        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel2.setText("Package");

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel1.setText("Name");

        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel3.setText("Destination");

        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel5.setText("Game class");

        advancedSettingsLabel.setText("Show advanced settings >");

        browseBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/gfx/ic_folder.png"))); // NOI18N

        genCorePrjChk.setEnabled(false);
        genCorePrjChk.setSelected(true);
        genCorePrjChk.setText("Generate the core project (required)");

        genAndroidPrjChk.setEnabled(false);
        genAndroidPrjChk.setSelected(true);
        genAndroidPrjChk.setText("Generate the android project (required)");

        genDesktopPrjChk.setSelected(true);
        genDesktopPrjChk.setText("Generate the desktop project");

        genHtmlPrjChk.setSelected(true);
        genHtmlPrjChk.setText("Generate the html project");

        genIosPrjChk.setSelected(true);
        genIosPrjChk.setText("Generate the ios project");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(nameField, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(packageField))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(destinationField, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(browseBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(mainClassField)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(advancedSettingsLabel))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(genCorePrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(genAndroidPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(genDesktopPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(genHtmlPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(genIosPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(nameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(packageField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(mainClassField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(destinationField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(browseBtn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(genCorePrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(genAndroidPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(genDesktopPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(genHtmlPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(genIosPrjChk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(advancedSettingsLabel)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {browseBtn, destinationField, jLabel1, jLabel2, jLabel3, jLabel5, mainClassField, nameField, packageField});

        add(jPanel1, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel advancedSettingsLabel;
    private aurelienribon.ui.components.Button browseBtn;
    private javax.swing.JTextField destinationField;
    private aurelienribon.ui.CompactCheckBox genAndroidPrjChk;
    private aurelienribon.ui.CompactCheckBox genCorePrjChk;
    private aurelienribon.ui.CompactCheckBox genDesktopPrjChk;
    private aurelienribon.ui.CompactCheckBox genHtmlPrjChk;
    private aurelienribon.ui.CompactCheckBox genIosPrjChk;
    private javax.swing.JPanel headerPanel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTextField mainClassField;
    private javax.swing.JTextField nameField;
    private javax.swing.JLabel numberLabel;
    private javax.swing.JTextField packageField;
    // End of variables declaration//GEN-END:variables

}


text:
<?php

final class DrydockSSHCommandInterface extends DrydockCommandInterface {

  private $credential;
  private $connectTimeout;
  private $execTimeout;
  private $remoteKeyFile;

  private function loadCredential() {
    if ($this->credential === null) {
      $credential_phid = $this->getConfig('credentialPHID');

      $this->credential = PassphraseSSHKey::loadFromPHID(
        $credential_phid,
        PhabricatorUser::getOmnipotentUser());
    }

    return $this->credential;
  }

  public function setConnectTimeout($timeout) {
    $this->connectTimeout = $timeout;
    return $this;
  }

  public function setExecTimeout($timeout) {
    $this->execTimeout = $timeout;
    return $this;
  }

  public function getExecFuture($command) {
    $credential = $this->loadCredential();

    $argv = func_get_args();
    $argv = $this->applyWorkingDirectoryToArgv($argv);
    $full_command = call_user_func_array('csprintf', $argv);

    $flags = array();
    $flags[] = '-o';
    $flags[] = 'LogLevel='.(
      $this->getConnectionDebugging() ? 'debug' : 'quiet');

    $flags[] = '-o';
    $flags[] = 'StrictHostKeyChecking=no';

    $flags[] = '-o';
    $flags[] = 'UserKnownHostsFile=/dev/null';

    $flags[] = '-o';
    $flags[] = 'BatchMode=yes';

    if ($this->connectTimeout) {
      $flags[] = '-o';
      $flags[] = 'ConnectTimeout='.$this->connectTimeout;
    }

    $key = $credential->getKeyfileEnvelope();
    if ($this->isSSHProxied()) {
      if ($this->remoteKeyFile === null) {
        $temp_name = '/tmp/'.Filesystem::readRandomCharacters(20).'.proxy';
        $key_future = new ExecFuture(
          'cat %P | %C %s',
          $key,
          $this->getSSHProxyCommand(),
          csprintf(
            'touch %s && chmod 0600 %s && cat - >%s',
            $temp_name,
            $temp_name,
            $temp_name));
        $key_future->resolvex();
        $this->remoteKeyFile = new RemoteTempFile(
          $temp_name,
          new ExecFuture(
            '%C %s',
            $this->getSSHProxyCommand(),
            csprintf('rm %s', $temp_name)));
      }
      $key = new PhutilOpaqueEnvelope((string)$this->remoteKeyFile);
    }

    $escaped_command = csprintf(
      'ssh %Ls -l %P -p %s -i %P %s -- %s',
      $flags,
      $credential->getUsernameEnvelope(),
      $this->getConfig('port'),
      $key,
      $this->getConfig('host'),
      $full_command);

    $proxy_cmd = $this->getSSHProxyCommand();
    if ($proxy_cmd !== '') {
      $future = new ExecFuture(
        '%C %s',
        $proxy_cmd,
        $escaped_command);
    } else {
      $future = new ExecFuture(
        '%C',
        $escaped_command);
    }

    $future->setTimeout($this->execTimeout);
    return $future;
  }
}


text:
      SUBROUTINE ILAVER( VERS_MAJOR, VERS_MINOR, VERS_PATCH )
*
*  -- LAPACK routine (version 3.1.1) --
*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
*     January 2007
*
*     .. Scalar Arguments ..
      INTEGER VERS_MAJOR, VERS_MINOR, VERS_PATCH
*     ..
*
*  Purpose
*  =======
*
*  This subroutine return the Lapack version.
*
*  Arguments
*  =========
*
*  VERS_MAJOR   (output) INTEGER
*      return the lapack major version
*  VERS_MINOR   (output) INTEGER
*      return the lapack minor version from the major version
*  VERS_PATCH   (output) INTEGER
*      return the lapack patch version from the minor version
*
*     .. Executable Statements ..
*
      VERS_MAJOR = 3
      VERS_MINOR = 1
      VERS_PATCH = 1
*  =====================================================================
*
      RETURN
      END


text:
@interface ProfileViewController ()

@end

@implementation ProfileViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"Profile";
}

@end


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE36_Absolute_Path_Traversal__wchar_t_listen_socket_ifstream_52c.cpp
Label Definition File: CWE36_Absolute_Path_Traversal.label.xml
Template File: sources-sink-52c.tmpl.cpp
*/
/*
 * @description
 * CWE: 36 Absolute Path Traversal
 * BadSource: listen_socket Read data using a listen socket (server side)
 * GoodSource: Full path and file name
 * Sink: ifstream
 *    BadSink : Open the file named in data using ifstream::open()
 * Flow Variant: 52 Data flow: data passed as an argument from one function to another to another in three different source files
 *
 * */

#include "std_testcase.h"

#ifndef _WIN32
#include <wchar.h>
#endif

#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#include <direct.h>
#pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */
#define CLOSE_SOCKET closesocket
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#define CLOSE_SOCKET close
#define SOCKET int
#endif

#define TCP_PORT 27015
#define LISTEN_BACKLOG 5

#include <fstream>
using namespace std;

namespace CWE36_Absolute_Path_Traversal__wchar_t_listen_socket_ifstream_52
{

/* all the sinks are the same, we just want to know where the hit originated if a tool flags one */

#ifndef OMITBAD

void badSink_c(wchar_t * data)
{
    {
        ifstream inputFile;
        /* POTENTIAL FLAW: Possibly opening a file without validating the file name or path */
        inputFile.open((char *)data);
        inputFile.close();
    }
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B uses the GoodSource with the BadSink */
void goodG2BSink_c(wchar_t * data)
{
    {
        ifstream inputFile;
        /* POTENTIAL FLAW: Possibly opening a file without validating the file name or path */
        inputFile.open((char *)data);
        inputFile.close();
    }
}

#endif /* OMITGOOD */

} /* close namespace */


text:
<!DOCTYPE html>

    <title>Basic usage</title>
    <meta charset="utf-8">
    <link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet">

        Back

@if (ViewBag.ShowDescription)
{

Description

The Kendo UI chart is a data visualization widget which allows you to output a graphical representation of your data. It is useful when you would like to utilize modern browser technologies such as SVG or Canvas (with a fallback to VML for older IE versions) for interactive data visualizations. The chart supports various chart types such as area, bar, line, scatter, pie and donut, etc. as well as stock (OHLC).

            To instantiate a Kendo UI chart, you need to specify an empty div with an id on the page, select this div with a jQuery selector and invoke the kendoChart() funtion. As a result, the chart is registered as a standard jQuery plugin.

The chart can fetch data for its series from either local or remote data source. It can also use the Kendo UI DataSource as a mediator for processing data.

Additional information about how to use the Kendo UI chart widget can be found in this section of the product documentation.

}


text:
namespace geofeatures_boost {} namespace boost = geofeatures_boost; namespace geofeatures_boost
{
    namespace range_detail
    {

template<class T>
class has_member_size_impl
{
private:
    template<class U, U>
    class check
    {
    };

    template<class C>
    static geofeatures_boost::uint8_t f(check<std::size_t(C::*)(void) const, &C::size>*);

    template<class C>
    static geofeatures_boost::uint16_t f(...);

public:
    static const bool value =
        (sizeof(f<T>(0)) == sizeof(geofeatures_boost::uint8_t));

    typedef typename mpl::if_c<
        (sizeof(f<T>(0)) == sizeof(geofeatures_boost::uint8_t)),
        mpl::true_,
        mpl::false_
    >::type type;
};

template<class T>
struct has_member_size
{
    typedef typename mpl::and_<
        typename is_class<T>::type,
        typename has_member_size_impl<const T>::type
    >::type type;

    static const bool value =
        is_class<T>::value && has_member_size_impl<const T>::value;
};

    } // namespace range_detail
}// namespace geofeatures_boost

#endif // include guard


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical">

    <include layout="@layout/toolbar_title"/>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/blue"
        android:padding="15dp">

        <com.makeramen.roundedimageview.RoundedImageView
            android:id="@+id/riv_head"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_marginRight="10dp"
            android:scaleType="centerCrop"
            android:src="@mipmap/xiaohei"
            app:riv_oval="true"/>

        <TextView
            android:id="@+id/tv_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/riv_head"
            android:text="小黑"
            android:textColor="@color/white"
            android:textSize="16sp"/>

        <TextView
            android:id="@+id/tv_follow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_toRightOf="@id/tv_name"
            android:background="@drawable/person_yellow_selected"
            android:paddingBottom="3dp"
            android:paddingLeft="3dp"
            android:paddingRight="3dp"
            android:text="@string/follow"
            android:textColor="@color/t666666"
            android:textSize="12sp"/>

        <TextView
            android:id="@+id/tv_remark"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/tv_name"
            android:layout_marginTop="5dp"
            android:layout_toLeftOf="@+id/tv_buy"
            android:layout_toRightOf="@id/riv_head"
            android:maxLines="1"
            android:ellipsize="end"
            android:text="的双龙大道是的撒颠三倒四胜多负少的啥地方的撒范德萨发"
            android:textColor="@color/white"
            android:textSize="12dp"/>

        <TextView
            android:id="@+id/tv_hot"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/tv_remark"
            android:layout_marginTop="5dp"
            android:layout_toRightOf="@id/riv_head"
            android:textColor="@color/white"
            android:text="热度15224"
            android:textSize="10dp"/>

        <View
            android:id="@+id/v_line"
            android:layout_width="1dp"
            android:layout_height="12dp"
            android:layout_below="@id/tv_remark"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="5dp"
            android:layout_toRightOf="@+id/tv_hot"
            android:background="@color/white"/>

        <TextView
            android:id="@+id/tv_fans"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/tv_remark"
            android:layout_marginTop="5dp"
            android:layout_toRightOf="@id/v_line"
            android:text="粉丝8521"
            android:textColor="@color/white"
            android:textSize="10dp"/>

        <TextView
            android:id="@+id/tv_buy"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_marginLeft="20dp"
            android:drawablePadding="5dp"
            android:drawableTop="@mipmap/ic_into_buy"
            android:text="购买"
            android:textColor="@color/te7b517"/>
    </RelativeLayout>

    <RadioGroup
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:orientation="horizontal">

        <RadioButton
            android:id="@+id/rb_play"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:button="@null"
            android:drawableBottom="@mipmap/ic_line"
            android:drawablePadding="10dp"
            android:gravity="center"
            android:paddingTop="10dp"
            android:text="直播"
            android:textColor="@color/blue"
            android:textSize="13sp"/>

        <RadioButton
            android:id="@+id/rb_inquire"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:button="@null"
            android:drawablePadding="10dp"
            android:gravity="center"
            android:paddingTop="10dp"
            android:text="问答"
            android:textSize="13sp"/>
    </RadioGroup>

    <View
        android:layout_width="match_parent"
        android:layout_height="0.5dp"
        android:background="@color/line_color"/>

    <FrameLayout
        android:id="@+id/fl_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</LinearLayout>


text:
package org.zstack.sdk;

public class ProtectVmInstanceRecoveryPointResult {

}


text:
class CreateSites < ActiveRecord::Migration
  def change
    create_table :sites do |t|
      t.string :name, :null => false
      t.string :domain, :null => false, :length => 2000
      t.text :note

      t.timestamps
    end

    add_index :sites, :name
    add_index :sites, :domain
  end
end


text:
package com.ruc.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import com.ruc.model.graphite.GraphiteRecord;
import com.ruc.model.influxdb.InfluxdbRecord;
import com.ruc.model.opentsdb.OpentsdbRecord;
import com.ruc.model.tsfile.TsfileRecord;
@XmlRootElement(name="config")
public class Config implements Serializable{
	private static final long serialVersionUID = 1L;
	private List<OpentsdbRecord> opentsdbs=new ArrayList<OpentsdbRecord>();
	private List<InfluxdbRecord> influxdbs=new ArrayList<InfluxdbRecord>();
	private List<GraphiteRecord> graphites=new ArrayList<GraphiteRecord>();
	private List<TsfileRecord> tsfiles=new ArrayList<TsfileRecord>();
	private String mode;
	private String serverUrl;
	private String dbType;
	@XmlElementWrapper(name="opentsdbs")
	@XmlElement(name="opentsdbRecord")
	public List<OpentsdbRecord> getOpentsdbs() {
		return opentsdbs;
	}
	public void setOpentsdbs(List<OpentsdbRecord> opentsdbs) {
		this.opentsdbs = opentsdbs;
	}
	@XmlElementWrapper(name="influxdbs")
	@XmlElement(name="influxdbRecord")
	public List<InfluxdbRecord> getInfluxdbs() {
		return influxdbs;
	}
	public void setInfluxdbs(List<InfluxdbRecord> influxdbs) {
		this.influxdbs = influxdbs;
	}
	@XmlElementWrapper(name="graphites")
	@XmlElement(name="graphiteRecord")
	public List<GraphiteRecord> getGraphites() {
		return graphites;
	}
	public void setGraphites(List<GraphiteRecord> graphites) {
		this.graphites = graphites;
	}
	@XmlElementWrapper(name="tsfiles")
	@XmlElement(name="tsfileRecord")
	public List<TsfileRecord> getTsfiles() {
		return tsfiles;
	}
	public void setTsfiles(List<TsfileRecord> tsfiles) {
		this.tsfiles = tsfiles;
	}
	@XmlAttribute(name="mode")
	public String getMode() {
		return mode;
	}
	public void setMode(String mode) {
		this.mode = mode;
	}
	@XmlAttribute(name="serverUrl")
	public String getServerUrl() {
		return serverUrl;
	}
	public void setServerUrl(String serverUrl) {
		this.serverUrl = serverUrl;
	}
	@Override
	public String toString() {
		return "Config [opentsdbs=" + opentsdbs + ", influxdbs=" + influxdbs
				+ ", graphites=" + graphites + ", mode=" + mode
				+ ", serverUrl=" + serverUrl + "]";
	}
	@XmlAttribute(name="dbtype")
	public String getDbType() {
		return dbType;
	}
	public void setDbType(String dbType) {
		this.dbType = dbType;
	}
}


text:
require 'spec_helper'

describe OmniAuth::Strategies::Foursquare do
  it_should_behave_like "an oauth2 strategy"
  subject{ OmniAuth::Strategies::Foursquare.new(lambda{|env|[200,{},[""]]} , 'abc', 'def')}

  it 'should use the mobile authorize url when :mobile is true' do
    subject.authorize_url(:mobile => true).should be_include("/mobile/")
  end

  it 'should use the authorize endpoint if :sign_in is false' do
    subject.authorize_url(:sign_in => false).should be_include("/authorize")
  end

  it 'should default to the authenticate endpoint' do
    subject.client.authorize_url.should be_include('/authenticate')
  end
end


text:
<?php
/**
 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
 * @version //autogentag//
 * @filesource
 * @package Mail
 * @subpackage Tests
 */

/**
 * @package Mail
 * @subpackage Tests
 */
class ezcMailTest extends ezcTestCase
{
    private $mail;

    protected function setUp()
    {
        $this->mail = new ezcMail();
    }

    public function testProperties()
    {
        $this->assertSetPropertyFails( $this->mail, "does_not_exist", array( 42 ) );
        $this->assertSetProperty( $this->mail, "to", array( array( new ezcMailAddress( 'fh@ez.no' ) ) ) );

        try
        {
            $this->mail->timestamp = 0;
            $this->fail( 'Expected exception not thrown' );
        }
        catch ( ezcBasePropertyPermissionException $e )
        {
            $this->assertEquals( "The property 'timestamp' is read-only.", $e->getMessage() );
        }

        try
        {
            $this->mail->headers = null;
            $this->fail( 'Expected exception not thrown' );
        }
        catch ( ezcBasePropertyPermissionException $e )
        {
            $this->assertEquals( "The property 'headers' is read-only.", $e->getMessage() );
        }
    }

    public function testAddAddresses()
    {
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->addTo( new ezcMailAddress( 'bh@ez.no' ) );
        $this->assertEquals( array( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ),
                                    new ezcMailAddress( 'bh@ez.no' ) ), $this->mail->to );

        $this->mail->addCc( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->addCc( new ezcMailAddress( 'bh@ez.no' ) );
        $this->assertEquals( array( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ),
                                    new ezcMailAddress( 'bh@ez.no' ) ), $this->mail->cc );

        $this->mail->addBcc( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->addBcc( new ezcMailAddress( 'bh@ez.no' ) );
        $this->assertEquals( array( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ),
                                    new ezcMailAddress( 'bh@ez.no' ) ), $this->mail->bcc );

    }

    public function testAddAddresses2()
    {
        $this->mail->from = new ezcMailAddress( 'from@ez.no' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->addTo( new ezcMailAddress( 'bh@ez.no' ) );
        $this->mail->addCc( new ezcMailAddress( 'dr@ez.no', 'Derick Rethans' ) );
        $this->mail->addBcc( new ezcMailAddress( 'amos@ez.no' ) );

        $expected = "From: from@ez.no" . ezcMailTools::lineBreak() .
            "To: Frederik Holljen <fh@ez.no>, bh@ez.no" . ezcMailTools::lineBreak() .
            "Cc: Derick Rethans <dr@ez.no>" . ezcMailTools::lineBreak() .
            "Bcc: amos@ez.no" . ezcMailTools::lineBreak() .
            "Subject: " . ezcMailTools::lineBreak() .
            "MIME-Version: 1.0" . ezcMailTools::lineBreak() .
            "User-Agent: Apache Zeta Components";

        $return = $this->mail->generate();
        // cut away the Date and Message-ID headers as there is no way to predict what they will be
        $return = join( ezcMailTools::lineBreak(), array_slice( explode( ezcMailTools::lineBreak(), $return ), 0, 7 ) );
        $this->assertEquals( $expected, $return );
    }

    public function testSubjectWithCharset7Bit()
    {
        $this->mail->from = new ezcMailAddress( 'from@ez.no' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->subject = "Dette er en test";
        $this->mail->subjectCharset = 'ISO-8859-1';
        $expected = "From: from@ez.no" . ezcMailTools::lineBreak() .
            "To: Frederik Holljen <fh@ez.no>" . ezcMailTools::lineBreak() .
            "Subject: Dette er en test" . ezcMailTools::lineBreak() .
            "MIME-Version: 1.0" . ezcMailTools::lineBreak() .
            "User-Agent: Apache Zeta Components";

        $return = $this->mail->generate();
        // cut away the Date and Message-ID headers as there is no way to predict what they will be
        $return = join( ezcMailTools::lineBreak(), array_slice( explode( ezcMailTools::lineBreak(), $return ), 0, 5 ) );

        $this->assertEquals( $expected, $return );
    }

    public function testSubjectWithCharset8Bit()
    {
        $this->mail->from = new ezcMailAddress( 'from@ez.no' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->subject = "Døtte er en test";
        $this->mail->subjectCharset = 'ISO-8859-1';
        $expected = "From: from@ez.no" . ezcMailTools::lineBreak() .
            "To: Frederik Holljen <fh@ez.no>" . ezcMailTools::lineBreak() .
            "Subject: =?ISO-8859-1?Q?D=F8tte=20er=20en=20test?=" . ezcMailTools::lineBreak() .
            "MIME-Version: 1.0" . ezcMailTools::lineBreak() .
            "User-Agent: Apache Zeta Components";

        $return = $this->mail->generate();
        // cut away the Date and Message-ID headers as there is no way to predict what they will be
        $return = join( ezcMailTools::lineBreak(), array_slice( explode( ezcMailTools::lineBreak(), $return ), 0, 5 ) );

        $this->assertEquals( $expected, $return );
    }

    public function testHeadersWithCharset()
    {
        $this->mail->from = new ezcMailAddress( 'fh@ez.no', 'Fræderik Hølljen', 'ISO-8859-1' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Fræderik Hølljen','ISO-8859-1' ) );
        $this->mail->addCc( new ezcMailAddress( 'fh@ez.no', 'Fræderik Hølljen','ISO-8859-1' ) );
        $this->mail->addBcc( new ezcMailAddress( 'fh@ez.no', 'Fræderik Hølljen','ISO-8859-1' ) );
        $this->mail->subject = "Døtte er en test";
        $this->mail->subjectCharset = 'ISO-8859-1';
        $expected = "From: =?ISO-8859-1?Q?Fr=E6derik=20H=F8lljen?= <fh@ez.no>" . ezcMailTools::lineBreak() .
            "To: =?ISO-8859-1?Q?Fr=E6derik=20H=F8lljen?= <fh@ez.no>" . ezcMailTools::lineBreak() .
            "Cc: =?ISO-8859-1?Q?Fr=E6derik=20H=F8lljen?= <fh@ez.no>" . ezcMailTools::lineBreak() .
            "Bcc: =?ISO-8859-1?Q?Fr=E6derik=20H=F8lljen?= <fh@ez.no>" . ezcMailTools::lineBreak() .
            "Subject: =?ISO-8859-1?Q?D=F8tte=20er=20en=20test?=" . ezcMailTools::lineBreak() .
            "MIME-Version: 1.0" . ezcMailTools::lineBreak() .
            "User-Agent: Apache Zeta Components";

        $return = $this->mail->generate();
        // cut away the Date and Message-ID headers as there is no way to predict what they will be
        $return = join( ezcMailTools::lineBreak(), array_slice( explode( ezcMailTools::lineBreak(), $return ), 0, 7 ) );

        $this->assertEquals( $expected, $return );
    }

    public function testSubjectWithCharset7BitUtf8()
    {
        $this->mail->from = new ezcMailAddress( 'from@ez.no' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->subject = "Dette er en test";
        $this->mail->subjectCharset = 'UTF-8';
        $expected = "From: from@ez.no" . ezcMailTools::lineBreak() .
            "To: Frederik Holljen <fh@ez.no>" . ezcMailTools::lineBreak() .
            "Subject: Dette er en test" . ezcMailTools::lineBreak() .
            "MIME-Version: 1.0" . ezcMailTools::lineBreak() .
            "User-Agent: Apache Zeta Components";

        $return = $this->mail->generate();
        // cut away the Date and Message-ID headers as there is no way to predict what they will be
        $return = join( ezcMailTools::lineBreak(), array_slice( explode( ezcMailTools::lineBreak(), $return ), 0, 5 ) );

        $this->assertEquals( $expected, $return );
    }

    public function testSubjectWithCharset8BitUtf8()
    {
        $this->mail->from = new ezcMailAddress( 'from@ez.no' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->subject = "Døtte er en test";
        $this->mail->subjectCharset = 'UTF-8';
        $expected = "From: from@ez.no" . ezcMailTools::lineBreak() .
            "To: Frederik Holljen <fh@ez.no>" . ezcMailTools::lineBreak() .
            "Subject: =?UTF-8?Q?D=C3=B8tte=20er=20en=20test?=" . ezcMailTools::lineBreak() .
            "MIME-Version: 1.0" . ezcMailTools::lineBreak() .
            "User-Agent: Apache Zeta Components";

        $return = $this->mail->generate();
        // cut away the Date and Message-ID headers as there is no way to predict what they will be
        $return = join( ezcMailTools::lineBreak(), array_slice( explode( ezcMailTools::lineBreak(), $return ), 0, 5 ) );

        $this->assertEquals( $expected, $return );
    }

    public function testHeadersWithCharsetUtf8()
    {
        $this->mail->from = new ezcMailAddress( 'fh@ez.no', 'Fræderik Hølljen', 'UTF-8' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Fræderik Hølljen','UTF-8' ) );
        $this->mail->addCc( new ezcMailAddress( 'fh@ez.no', 'Fræderik Hølljen','UTF-8' ) );
        $this->mail->addBcc( new ezcMailAddress( 'fh@ez.no', 'Fræderik Hølljen','UTF-8' ) );
        $this->mail->subject = "Dätte er en test";
        $this->mail->subjectCharset = 'UTF-8';
        $expected = "From: =?UTF-8?Q?Fr=C3=A6derik=20H=C3=B8lljen?= <fh@ez.no>" . ezcMailTools::lineBreak() .
            "To: =?UTF-8?Q?Fr=C3=A6derik=20H=C3=B8lljen?= <fh@ez.no>" . ezcMailTools::lineBreak() .
            "Cc: =?UTF-8?Q?Fr=C3=A6derik=20H=C3=B8lljen?= <fh@ez.no>" . ezcMailTools::lineBreak() .
            "Bcc: =?UTF-8?Q?Fr=C3=A6derik=20H=C3=B8lljen?= <fh@ez.no>" . ezcMailTools::lineBreak() .
            "Subject: =?UTF-8?Q?D=C3=A4tte=20er=20en=20test?=" . ezcMailTools::lineBreak() .
            "MIME-Version: 1.0" . ezcMailTools::lineBreak() .
            "User-Agent: Apache Zeta Components";

        $return = $this->mail->generate();
        // cut away the Date and Message-ID headers as there is no way to predict what they will be
        $return = join( ezcMailTools::lineBreak(), array_slice( explode( ezcMailTools::lineBreak(), $return ), 0, 7 ) );

        $this->assertEquals( $expected, $return );
    }

    public function testFullMail()
    {
        $this->mail->from = new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->subject = "æøå";
        $this->mail->body = new ezcMailText( "Dette er body ßßæøååå" );
//        echo "\n---------------\n";
//        echo $this->mail->generate();
//        echo "---------------\n";
        // let's try to send the thing
        $transport = new ezcMailMtaTransport();
//        $transport->send( $this->mail );
    }

    public function testFullMailMultipart()
    {
        $this->mail->from = new ezcMailAddress( 'fh@ez.no', 'Fræderik Hølljen', "iso-8859-1" );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Fræderik Hølljeñ', "iso-8859-1" ) );
        $this->mail->subject = "æøå";
        $this->mail->subjectCharset = 'iso-8859-1';
        $this->mail->body = new ezcMailMultipartAlternative( new ezcMailText( "Dette er body ßßæøååå", "iso-8859-1" ),
                                                             $html = new ezcMailText( "<html>Hello</html>" ) );
        $html->subType = "html";

//        echo "\n---------------\n";
//        echo $this->mail->generate();
//        echo "---------------\n";
        // let's try to send the thing
//        $transport = new ezcMailSmtpTransport( "smtp.ez.no" );
//        $transport->send( $this->mail );
    }

    public function testFullMailDigest()
    {
        $digest = new ezcMail();
        $digest->from = new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' );
        $digest->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $digest->subject = "æøå";
        $digest->body = new ezcMailText( "Dette er body ßßæøååå" );

        $this->mail->from = new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->subject = "æøå";
        $this->mail->subjectCharset = 'iso-8859-1';
        $this->mail->body = new ezcMailMultipartMixed( new ezcMailText( "Dette er body ßßæøååå", "iso-8859-1" ),
                                                       new ezcMailRfc822Digest( $digest ) );

//        $transport = new ezcMailSmtpTransport( "smtp.ez.no" );
//        $transport->send( $this->mail );
    }

    public function testFullMailDigest2()
    {
        $digest = new ezcMail();
        $digest->from = new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' );
        $digest->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $digest->subject = "æøå";
        $digest->body = new ezcMailText( "Dette er body ßßæøååå" );

        $this->mail->from = new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->subject = "æøå";
        $this->mail->subjectCharset = 'iso-8859-1';
        $this->mail->body = new ezcMailMultipartMixed( new ezcMailText( "Dette er body ßßæøååå", "iso-8859-1" ),
                                                       new ezcMailMultipartDigest( new ezcMailRfc822Digest( $digest ) ) );

//        $transport = new ezcMailSmtpTransport( "smtp.ez.no" );
//        $transport->send( $this->mail );
    }

    public function testFullMailDigestArray()
    {
        $digest = new ezcMail();
        $digest->from = new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' );
        $digest->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $digest->subject = "æøå";
        $digest->body = new ezcMailText( "Dette er body ßßæøååå" );

        $this->mail->from = new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->subject = "æøå";
        $this->mail->subjectCharset = 'iso-8859-1';
        $this->mail->body = new ezcMailMultipartMixed( new ezcMailText( "Dette er body ßßæøååå", "iso-8859-1" ),
                                                       new ezcMailMultipartDigest( array( new ezcMailRfc822Digest( $digest ) ) ) );

//        $transport = new ezcMailSmtpTransport( "smtp.ez.no" );
//        $transport->send( $this->mail );
    }

    public function testMultipartReport()
    {
        $mail = new ezcMail();
        $mail->from = new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' );
        $mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $mail->subject = "Report";
        $mail->subjectCharset = 'iso-8859-1';
        $delivery = new ezcMailDeliveryStatus();
        $delivery->message["Reporting-MTA"] = "dns; www.brssolutions.com";
        $lastRecipient = $delivery->createRecipient();
        $delivery->recipients[$lastRecipient]["Action"] = "failed";
        $mail->body = new ezcMailMultipartReport(
            new ezcMailText( "Dette er body ßßæøååå", "iso-8859-1" ),
            $delivery,
            new ezcMailText( "The content initially sent" )
            );
    }

    public function testMessageID1()
    {
        $this->mail->from = new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->subject = "æøå";
        $this->mail->body = new ezcMailText( "Dette er body ßßæøååå" );

        $this->mail->generateHeaders();
        $expected = '<'. date( 'YmdGHjs' ) . '.' . getmypid() . '.7@ez.no>';
        $this->assertEquals( $expected, $this->mail->getHeader( 'Message-Id' ) );
    }

    public function testMessageID2()
    {
        $this->mail->from = new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' );
        $this->mail->addTo( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen' ) );
        $this->mail->subject = "æøå";
        $this->mail->body = new ezcMailText( "Dette er body ßßæøååå" );

        $this->mail->messageID = "<test-ezc-message-id@ezc.ez.no>";
        $this->mail->generateHeaders();
        $this->assertEquals( '<test-ezc-message-id@ezc.ez.no>', $this->mail->getHeader( 'Message-Id' ) );
    }

    // test for issue #11174
    public function testMailHeaderFolding76Char()
    {
        $mail = new ezcMail();
        $mail->from = new ezcMailAddress( 'john@example.com', 'John Doe' );
        $mail->addTo( new ezcMailAddress( 'john@example.com', 'John Doe' ) );
        $mail->body = new ezcMailText( 'Text' );

        // test some subject sizes
        for ( $i = 1; $i < 300; $i++ )
        {
            $mail->subject = str_repeat( '1', $i );
            $source = $mail->generate();
            preg_match( '/Subject:\s[0-9]+/', $source, $matches );
            $this->assertEquals( 1, count( $matches ), "Subject is folded incorrectly for length {$i}." );
        }
    }

    // test for issue #12595: the Bcc line would have had an empty line underneath before the fix
    // similar for To and Cc headers
    public function testFoldingAddresses()
    {
        $this->mail->from = new ezcMailAddress( 'from@ez.no' );
        $addresses = array( 'nospam1@ez.no', 'nospam2@ez.no', 'nospam3@ez.no',
            'nospam4@ez.no', 'nospam5@ez.no', 'nospam6@ez.no', 'nospam7@ez.no' );

        foreach ( $addresses as $address )
        {
            $this->mail->addBcc( new ezcMailAddress( $address ) );
        }

        $expected = "From: from@ez.no" . ezcMailTools::lineBreak() .
            "To: " . ezcMailTools::lineBreak() .
            "Bcc: nospam1@ez.no, nospam2@ez.no, nospam3@ez.no, nospam4@ez.no, nospam5@ez.no," . ezcMailTools::lineBreak() .
            " nospam6@ez.no, nospam7@ez.no" . ezcMailTools::lineBreak() .
            "Subject: " . ezcMailTools::lineBreak() .
            "MIME-Version: 1.0" . ezcMailTools::lineBreak() .
            "User-Agent: Apache Zeta Components";

        $return = $this->mail->generate();
        // cut away the Date and Message-ID headers as there is no way to predict what they will be
        $return = join( ezcMailTools::lineBreak(), array_slice( explode( ezcMailTools::lineBreak(), $return ), 0, 7 ) );
        $this->assertEquals( $expected, $return );
    }

    public function testMailAddressToString()
    {
        $addr = new ezcMailAddress( "test@example.com", "John Doe" );

        $this->assertEquals(
            "John Doe <test@example.com>",
            $addr->__toString(),
            "Address not correctly serialized."
        );
    }

    public function testGenerateEmpty()
    {
        $return = $this->mail->generate();
    }

    public function testContentDispositionHeaderSetState()
    {
        $header = ezcMailContentDispositionHeader::__set_state( array(
                        'disposition' => 'inline',
                        'fileName' => 'spacer.gif',
                        'creationDate' => 'Sun, 21 May 2006 16:00:50 +0400',
                        'modificationDate' => 'Sun, 21 May 2006 16:01:50 +0400',
                        'readDate' => 'Sun, 21 May 2006 16:02:50 +0400',
                        'size' => 51,
                        'additionalParameters' => array( 'foo' => 'bar' ),
                        'fileNameLanguage' => 'EN',
                        'fileNameCharSet' => 'ISO-8859-1',
                        // for issue #13038
                        'displayFileName' => null
                ) );
        $this->assertEquals( 'inline', $header->disposition );
        $this->assertEquals( 'spacer.gif', $header->fileName );
        $this->assertEquals( 'Sun, 21 May 2006 16:00:50 +0400', $header->creationDate );
        $this->assertEquals( 'Sun, 21 May 2006 16:01:50 +0400', $header->modificationDate );
        $this->assertEquals( 'Sun, 21 May 2006 16:02:50 +0400', $header->readDate );
        $this->assertEquals( 51, $header->size );
        $this->assertEquals( array( 'foo' => 'bar' ), $header->additionalParameters );
        $this->assertEquals( 'EN', $header->fileNameLanguage );
        $this->assertEquals( 'ISO-8859-1', $header->fileNameCharSet );
    }

    public function testMailAddressSetState()
    {
        $address = ezcMailAddress::__set_state( array(
                         'email' => 'nospam@example.com',
                         'name' => 'No Spam'
                ) );
        $this->assertEquals( 'nospam@example.com', $address->email );
        $this->assertEquals( 'No Spam', $address->name );
    }

    /**
     * Test for issue #16154: Bcc headers are not stripped when using SMTP
     */
    public function testKeepBccHeader()
    {
        $mail = new ezcMail();
        $mail->from = new ezcMailAddress( "nospam@ez.no", "No Spam 1" );
        $mail->addTo( new ezcMailAddress( "alex.stanoi@gmail.com", "No Spam 2" ) );
        $mail->addBcc( new ezcMailAddress( "as@ez.no", "No Spam 3" ) );
        $mail->subject = __FUNCTION__;

        $source = $mail->generate();

        // Assert that the mail source contains the Bcc header
        $this->assertNotEquals( false, strpos( $source, "Bcc: " ) );
    }

    /**
     * Test for issue #16154: Bcc headers are not stripped when using SMTP
     */
    public function testStripBccHeader()
    {
        $options = new ezcMailOptions();
        $options->stripBccHeader = true;
        $mail = new ezcMail( $options );
        $mail->from = new ezcMailAddress( "nospam@ez.no", "No Spam 1" );
        $mail->addTo( new ezcMailAddress( "alex.stanoi@gmail.com", "No Spam 2" ) );
        $mail->addBcc( new ezcMailAddress( "as@ez.no", "No Spam 3" ) );
        $mail->subject = __FUNCTION__;

        $source = $mail->generate();

        // Assert that the mail source doesn't contain the Bcc header
        $this->assertEquals( false, strpos( $source, "Bcc: " ) );
    }

    public function testIsSet()
    {
        $mail = new ezcMail();
        $mail->generateBody();
        $mail->generateHeaders();
        $this->assertEquals( true, isset( $mail->headers ) );
        $this->assertEquals( false, isset( $mail->contentDisposition ) );
        $this->assertEquals( true, isset( $mail->to ) );
        $this->assertEquals( true, isset( $mail->cc ) );
        $this->assertEquals( true, isset( $mail->bcc ) );
        $this->assertEquals( false, isset( $mail->from ) );
        $this->assertEquals( false, isset( $mail->subject ) );
        $this->assertEquals( true, isset( $mail->subjectCharset ) );
        $this->assertEquals( false, isset( $mail->body ) );
        $this->assertEquals( false, isset( $mail->messageId ) );
        $this->assertEquals( false, isset( $mail->messageID ) );
        $this->assertEquals( true, isset( $mail->timestamp ) );
        $this->assertEquals( false, isset( $mail->no_such_property ) );
    }

    public static function suite()
    {
         return new PHPUnit_Framework_TestSuite( "ezcMailTest" );
    }
}
?>


text:
using TypeDataMut = Microsoft.PowerShell.CrossCompatibility.Data.TypeData;

namespace Microsoft.PowerShell.CrossCompatibility.Query
{
    /// <summary>
    /// Readonly query object for metadata on a .NET type.
    /// </summary>
    public class TypeData
    {
        /// <summary>
        /// Create a new type query object from collected .NET type data.
        /// </summary>
        /// <param name="name">The simple (non-namespace qualified) name of the type.</param>
        /// <param name="typeData">Collected type data.</param>
        public TypeData(string name, TypeDataMut typeData)
        {
            Name = name;
            IsEnum = typeData.IsEnum;
            Instance = typeData.Instance == null ? null : new MemberData(typeData.Instance);
            Static = typeData.Static == null ? null : new MemberData(typeData.Static);
        }

        /// <summary>
        /// The simple, non-namespace-qualified name of the type.
        /// </summary>
        public string Name { get; }

        /// <summary>
        /// True if the type is an enum, false otherwise.
        /// </summary>
        public bool IsEnum { get; }

        /// <summary>
        /// All instance members of the type.
        /// </summary>
        public MemberData Instance { get; }

        /// <summary>
        /// All static members of the type.
        /// </summary>
        public MemberData Static { get; }
    }
}