text:
package org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb;

import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.api.records.impl.pb.ResourcePBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ResourceProto;
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.MasterKeyProto;
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.NodeActionProto;
import org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.RegisterNodeManagerResponseProto;
import org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.RegisterNodeManagerResponseProtoOrBuilder;
import org.apache.hadoop.yarn.server.api.protocolrecords.RegisterNodeManagerResponse;
import org.apache.hadoop.yarn.server.api.records.MasterKey;
import org.apache.hadoop.yarn.server.api.records.NodeAction;
import org.apache.hadoop.yarn.server.api.records.impl.pb.MasterKeyPBImpl;

/**
 * PBImpl class for RegisterNodeManagerResponse.
 */
public class RegisterNodeManagerResponsePBImpl
    extends RegisterNodeManagerResponse {
  private RegisterNodeManagerResponseProto proto =
      RegisterNodeManagerResponseProto.getDefaultInstance();
  private RegisterNodeManagerResponseProto.Builder builder = null;
  private boolean viaProto = false;
  private Resource resource = null;

  private MasterKey containerTokenMasterKey = null;
  private MasterKey nmTokenMasterKey = null;

  private boolean rebuild = false;

  public RegisterNodeManagerResponsePBImpl() {
    builder = RegisterNodeManagerResponseProto.newBuilder();
  }

  public RegisterNodeManagerResponsePBImpl(RegisterNodeManagerResponseProto proto) {
    this.proto = proto;
    viaProto = true;
  }

  public RegisterNodeManagerResponseProto getProto() {
    if (rebuild)
      mergeLocalToProto();
    proto = viaProto ? proto : builder.build();
    viaProto = true;
    return proto;
  }

  private void mergeLocalToBuilder() {
    if (this.containerTokenMasterKey != null) {
      builder.setContainerTokenMasterKey(
          convertToProtoFormat(this.containerTokenMasterKey));
    }
    if (this.nmTokenMasterKey != null) {
      builder.setNmTokenMasterKey(
          convertToProtoFormat(this.nmTokenMasterKey));
    }
    if (this.resource != null) {
      builder.setResource(convertToProtoFormat(this.resource));
    }
  }

  private void mergeLocalToProto() {
    if (viaProto)
      maybeInitBuilder();
    mergeLocalToBuilder();
    proto = builder.build();
    rebuild = false;
    viaProto = true;
  }

  private void maybeInitBuilder() {
    if (viaProto || builder == null) {
      builder = RegisterNodeManagerResponseProto.newBuilder(proto);
    }
    viaProto = false;
  }

  @Override
  public Resource getResource() {
    RegisterNodeManagerResponseProtoOrBuilder p = viaProto ? proto : builder;
    if (this.resource != null) {
      return this.resource;
    }
    if (!p.hasResource()) {
      return null;
    }
    this.resource = convertFromProtoFormat(p.getResource());
    return this.resource;
  }

  @Override
  public void setResource(Resource resource) {
    maybeInitBuilder();
    if (resource == null) {
      builder.clearResource();
    }
    this.resource = resource;
  }

  @Override
  public MasterKey getContainerTokenMasterKey() {
    RegisterNodeManagerResponseProtoOrBuilder p = viaProto ? proto : builder;
    if (this.containerTokenMasterKey != null) {
      return this.containerTokenMasterKey;
    }
    if (!p.hasContainerTokenMasterKey()) {
      return null;
    }
    this.containerTokenMasterKey =
        convertFromProtoFormat(p.getContainerTokenMasterKey());
    return this.containerTokenMasterKey;
  }

  @Override
  public void setContainerTokenMasterKey(MasterKey masterKey) {
    maybeInitBuilder();
    if (masterKey == null)
      builder.clearContainerTokenMasterKey();
    this.containerTokenMasterKey = masterKey;
    rebuild = true;
  }

  @Override
  public MasterKey getNMTokenMasterKey() {
    RegisterNodeManagerResponseProtoOrBuilder p = viaProto ? proto : builder;
    if (this.nmTokenMasterKey != null) {
      return this.nmTokenMasterKey;
    }
    if (!p.hasNmTokenMasterKey()) {
      return null;
    }
    this.nmTokenMasterKey =
        convertFromProtoFormat(p.getNmTokenMasterKey());
    return this.nmTokenMasterKey;
  }

  @Override
  public void setNMTokenMasterKey(MasterKey masterKey) {
    maybeInitBuilder();
    if (masterKey == null)
      builder.clearNmTokenMasterKey();
    this.nmTokenMasterKey = masterKey;
    rebuild = true;
  }

  @Override
  public String getDiagnosticsMessage() {
    RegisterNodeManagerResponseProtoOrBuilder p = viaProto ? proto : builder;
    if (!p.hasDiagnosticsMessage()) {
      return null;
    }
    return p.getDiagnosticsMessage();
  }

  @Override
  public void setDiagnosticsMessage(String diagnosticsMessage) {
    maybeInitBuilder();
    if (diagnosticsMessage == null) {
      builder.clearDiagnosticsMessage();
      return;
    }
    builder.setDiagnosticsMessage((diagnosticsMessage));
  }

  @Override
  public String getRMVersion() {
    RegisterNodeManagerResponseProtoOrBuilder p = viaProto ? proto : builder;
    if (!p.hasRmVersion()) {
      return null;
    }
    return p.getRmVersion();
  }

  @Override
  public void setRMVersion(String rmVersion) {
    maybeInitBuilder();
    if (rmVersion == null) {
      builder.clearRmIdentifier();
      return;
    }
    builder.setRmVersion(rmVersion);
  }

  @Override
  public NodeAction getNodeAction() {
    RegisterNodeManagerResponseProtoOrBuilder p = viaProto ? proto : builder;
    if(!p.hasNodeAction()) {
      return null;
    }
    return convertFromProtoFormat(p.getNodeAction());
  }

  @Override
  public void setNodeAction(NodeAction nodeAction) {
    maybeInitBuilder();
    if (nodeAction == null) {
      builder.clearNodeAction();
    } else {
      builder.setNodeAction(convertToProtoFormat(nodeAction));
    }
    rebuild = true;
  }

  @Override
  public long getRMIdentifier() {
    RegisterNodeManagerResponseProtoOrBuilder p = viaProto ? proto : builder;
    return (p.getRmIdentifier());
  }

  @Override
  public void setRMIdentifier(long rmIdentifier) {
    maybeInitBuilder();
    builder.setRmIdentifier(rmIdentifier);
  }

  private NodeAction convertFromProtoFormat(NodeActionProto p) {
    return  NodeAction.valueOf(p.name());
  }

  private NodeActionProto convertToProtoFormat(NodeAction t) {
    return NodeActionProto.valueOf(t.name());
  }

  private MasterKeyPBImpl convertFromProtoFormat(MasterKeyProto p) {
    return new MasterKeyPBImpl(p);
  }

  private MasterKeyProto convertToProtoFormat(MasterKey t) {
    return ((MasterKeyPBImpl)t).getProto();
  }

  private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
    return new ResourcePBImpl(p);
  }

  private ResourceProto convertToProtoFormat(Resource t) {
    return ((ResourcePBImpl)t).getProto();
  }

  @Override
  public boolean getAreNodeLabelsAcceptedByRM() {
    RegisterNodeManagerResponseProtoOrBuilder p =
        this.viaProto ? this.proto : this.builder;
    return p.getAreNodeLabelsAcceptedByRM();
  }

  @Override
  public void setAreNodeLabelsAcceptedByRM(boolean areNodeLabelsAcceptedByRM) {
    maybeInitBuilder();
    this.builder.setAreNodeLabelsAcceptedByRM(areNodeLabelsAcceptedByRM);
  }
}


text:
package org.apache.cassandra.utils;

import java.util.Collection;

import org.apache.cassandra.db.DBConstants;
import org.apache.cassandra.thrift.Column;
import org.apache.cassandra.thrift.ColumnOrSuperColumn;
import org.apache.cassandra.thrift.CounterColumn;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ColumnOrSuperColumnHelper {
    private static final Logger logger = LoggerFactory.getLogger(ColumnOrSuperColumnHelper.class);

    private ColumnOrSuperColumnHelper()
    {
        //don't instantiate this class
    }

    public static void updateTimestamp(ColumnOrSuperColumn cosc, long timestamp)
    {
        if (cosc.isSetColumn()) {
            cosc.column.timestamp = timestamp;
        } else if (cosc.isSetCounter_column()) {
            assert false : "Counter columns don't have timestamps";
        } else if (cosc.isSetSuper_column()) {
            for (Column column : cosc.super_column.columns) {
                column.timestamp = timestamp;
            }
        } else {
            assert cosc.isSetCounter_super_column();
            for (CounterColumn counter_column : cosc.counter_super_column.columns) {
                assert false : "Counter columns don't have timestamps";
            }
        }
    }

    public static class EvtAndLvt{
        private final long earliestValidTime;
        private final long latestValidTime;

        public EvtAndLvt(long earliestValidTime, long latestValidTime)
        {
            this.earliestValidTime = earliestValidTime;
            this.latestValidTime = latestValidTime;
        }

        public long getEarliestValidTime()
        {
            return earliestValidTime;
        }

        public long getLatestValidTime()
        {
            return latestValidTime;
        }

        @Override
        public String toString()
        {
            return earliestValidTime + "," + latestValidTime;
        }
    }

    public static EvtAndLvt extractEvtAndLvt(ColumnOrSuperColumn cosc)
    {
        EvtAndLvt result = null;
        if (cosc.isSetColumn()) {
            result = new EvtAndLvt(cosc.column.earliest_valid_time, cosc.column.latest_valid_time);
        } else if (cosc.isSetCounter_column()) {
            result = new EvtAndLvt(cosc.counter_column.earliest_valid_time, cosc.counter_column.latest_valid_time);
        } else if (cosc.isSetSuper_column()) {
            long maxEarliestValidTime = Long.MIN_VALUE;
            long minLatestValidTime = Long.MAX_VALUE;
            for (Column column : cosc.super_column.columns) {
                maxEarliestValidTime = Math.max(maxEarliestValidTime, column.earliest_valid_time);
                minLatestValidTime = Math.min(minLatestValidTime, column.latest_valid_time);
            }
            result = new EvtAndLvt(maxEarliestValidTime, minLatestValidTime);
        } else {
            long maxEarliestValidTime = Long.MIN_VALUE;
            long minLatestValidTime = Long.MAX_VALUE;
            for (CounterColumn column : cosc.counter_super_column.columns) {
                maxEarliestValidTime = Math.max(maxEarliestValidTime, column.earliest_valid_time);
                minLatestValidTime = Math.min(minLatestValidTime, column.latest_valid_time);
            }
            result = new EvtAndLvt(maxEarliestValidTime, minLatestValidTime);
        }

        logger.trace("extractEVTandLVT(" + toString(cosc) + ")=" + result);
        return result;
    }

    public static EvtAndLvt extractEvtAndLvt(Collection<ColumnOrSuperColumn> coscCollection)
    {
        long maxEarliestValidTime = Long.MIN_VALUE;
        long minLatestValidTime = Long.MAX_VALUE;
        for (ColumnOrSuperColumn cosc : coscCollection) {
            EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(cosc);
            maxEarliestValidTime = Math.max(maxEarliestValidTime, evtAndLvt.getEarliestValidTime());
            minLatestValidTime = Math.min(minLatestValidTime, evtAndLvt.getLatestValidTime());
        }
        return new EvtAndLvt(maxEarliestValidTime, minLatestValidTime);
    }

    public static long findLength(ColumnOrSuperColumn cosc)
    {
        if (cosc.isSetColumn()) {
            return cosc.column.value.remaining();
        } else if (cosc.isSetCounter_column()) {
            return DBConstants.longSize;
        } else if (cosc.isSetSuper_column()) {
            long length = 0;
            for (Column column : cosc.super_column.columns) {
                length += column.value.remaining();
            }
            return length;
        } else {
            assert cosc.isSetCounter_super_column();
            return DBConstants.longSize * cosc.counter_super_column.columns.size();
        }
    }

    public static String toString(ColumnOrSuperColumn cosc)
    {
        if (cosc.isSetColumn()) {
            StringBuilder sb = new StringBuilder(ByteBufferUtil.bytesToHex(cosc.column.name));
            sb.append(":");
            sb.append(cosc.column.isSetValue() ? ByteBufferUtil.bytesToHex(cosc.column.value) : "-");
            sb.append("@");
            sb.append(cosc.column.isSetTimestamp() ? cosc.column.timestamp : "-");
            return sb.toString();
        } else if (cosc.isSetCounter_column()) {
            return ByteBufferUtil.bytesToHex(cosc.counter_column.name) + ":" + cosc.counter_column.value;
        } else if (cosc.isSetSuper_column()) {
            String superColumnString = new String(ByteBufferUtil.bytesToHex(cosc.super_column.name) + "={");
            for (Column column : cosc.super_column.columns) {
                superColumnString += ByteBufferUtil.bytesToHex(column.name) + ":" + ByteBufferUtil.bytesToHex(column.value) + "@" + column.timestamp + ", ";
            }
            return superColumnString.substring(0, superColumnString.length() - 2) + "}";
        } else {
            String superColumnString = new String(ByteBufferUtil.bytesToHex(cosc.super_column.name) + "={");
            for (CounterColumn column : cosc.counter_super_column.columns) {
                superColumnString += ByteBufferUtil.bytesToHex(column.name) + ":" + column.value + ", ";
            }
            return superColumnString.substring(0, superColumnString.length() - 2) + "}";
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     此代码由工具生成。
//     运行时版本:2.0.50727.5444
//     Support: http://www.cnblogs.com/huxj
//     对此文件的更改可能会导致不正确的行为,并且如果
//     重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Data;
using System.Data.Common;
using Hxj.Data;
using Hxj.Data.Common;

namespace entCMS.Models
{

	/// <summary>
	/// 实体类cmsLanguage 。(属性说明自动提取数据库字段的描述信息)
	/// </summary>
	[Serializable]
	public class cmsLanguage : Entity
	{
		public cmsLanguage():base("cmsLanguage") {}

		#region Model
		private long _Id;
		private string _Name;
		private string _ShortName;
        private string _Code;
		private string _HomeUrl;
		private string _Logo;
		private int? _IsEnabled;
		private int? _IsDefault;
		private int? _OrderNo;
		private string _Remark;
		/// <summary>
		///
		/// </summary>
		public long Id
		{
			get{ return _Id; }
			set
			{
				this.OnPropertyValueChange(_.Id,_Id,value);
				this._Id=value;
			}
		}
		/// <summary>
		///
		/// </summary>
		public string Name
		{
			get{ return _Name; }
			set
			{
				this.OnPropertyValueChange(_.Name,_Name,value);
				this._Name=value;
			}
		}
		/// <summary>
		///
		/// </summary>
		public string ShortName
		{
			get{ return _ShortName; }
			set
			{
				this.OnPropertyValueChange(_.ShortName,_ShortName,value);
				this._ShortName=value;
			}
		}
        /// <summary>
        ///
        /// </summary>
        public string Code
        {
            get { return _Code; }
            set
            {
                this.OnPropertyValueChange(_.Code, _Code, value);
                this._Code = value;
            }
        }
		/// <summary>
		///
		/// </summary>
		public string HomeUrl
		{
			get{ return _HomeUrl; }
			set
			{
				this.OnPropertyValueChange(_.HomeUrl,_HomeUrl,value);
				this._HomeUrl=value;
			}
		}
		/// <summary>
		///
		/// </summary>
		public string Logo
		{
			get{ return _Logo; }
			set
			{
				this.OnPropertyValueChange(_.Logo,_Logo,value);
				this._Logo=value;
			}
		}
		/// <summary>
		///
		/// </summary>
		public int? IsEnabled
		{
			get{ return _IsEnabled; }
			set
			{
				this.OnPropertyValueChange(_.IsEnabled,_IsEnabled,value);
				this._IsEnabled=value;
			}
		}
		/// <summary>
		///
		/// </summary>
		public int? IsDefault
		{
			get{ return _IsDefault; }
			set
			{
				this.OnPropertyValueChange(_.IsDefault,_IsDefault,value);
				this._IsDefault=value;
			}
		}
		/// <summary>
		///
		/// </summary>
		public int? OrderNo
		{
			get{ return _OrderNo; }
			set
			{
				this.OnPropertyValueChange(_.OrderNo,_OrderNo,value);
				this._OrderNo=value;
			}
		}
		/// <summary>
		///
		/// </summary>
		public string Remark
		{
			get{ return _Remark; }
			set
			{
				this.OnPropertyValueChange(_.Remark,_Remark,value);
				this._Remark=value;
			}
		}
		#endregion

		#region Method
		/// <summary>
		/// 获取实体中的标识列
		/// </summary>
		public override Field GetIdentityField()
		{
			return _.Id;
		}
		/// <summary>
		/// 获取实体中的主键列
		/// </summary>
		public override Field[] GetPrimaryKeyFields()
		{
			return new Field[] {
				_.Id};
		}
		/// <summary>
		/// 获取列信息
		/// </summary>
		public override Field[] GetFields()
		{
			return new Field[] {
				_.Id,
				_.Name,
				_.ShortName,
                _.Code,
				_.HomeUrl,
				_.Logo,
				_.IsEnabled,
				_.IsDefault,
				_.OrderNo,
				_.Remark};
		}
		/// <summary>
		/// 获取值信息
		/// </summary>
		public override object[] GetValues()
		{
			return new object[] {
				this._Id,
				this._Name,
				this._ShortName,
                this._Code,
				this._HomeUrl,
				this._Logo,
				this._IsEnabled,
				this._IsDefault,
				this._OrderNo,
				this._Remark};
		}
		/// <summary>
		/// 给当前实体赋值
		/// </summary>
		public override void SetPropertyValues(IDataReader reader)
		{
			this._Id = DataUtils.ConvertValue<long>(reader["Id"]);
			this._Name = DataUtils.ConvertValue<string>(reader["Name"]);
            this._ShortName = DataUtils.ConvertValue<string>(reader["ShortName"]);
            this._Code = DataUtils.ConvertValue<string>(reader["Code"]);
			this._HomeUrl = DataUtils.ConvertValue<string>(reader["HomeUrl"]);
			this._Logo = DataUtils.ConvertValue<string>(reader["Logo"]);
			this._IsEnabled = DataUtils.ConvertValue<int?>(reader["IsEnabled"]);
			this._IsDefault = DataUtils.ConvertValue<int?>(reader["IsDefault"]);
			this._OrderNo = DataUtils.ConvertValue<int?>(reader["OrderNo"]);
			this._Remark = DataUtils.ConvertValue<string>(reader["Remark"]);
		}
		/// <summary>
		/// 给当前实体赋值
		/// </summary>
		public override void SetPropertyValues(DataRow row)
		{
			this._Id = DataUtils.ConvertValue<long>(row["Id"]);
			this._Name = DataUtils.ConvertValue<string>(row["Name"]);
            this._ShortName = DataUtils.ConvertValue<string>(row["ShortName"]);
            this._Code = DataUtils.ConvertValue<string>(row["Code"]);
			this._HomeUrl = DataUtils.ConvertValue<string>(row["HomeUrl"]);
			this._Logo = DataUtils.ConvertValue<string>(row["Logo"]);
			this._IsEnabled = DataUtils.ConvertValue<int?>(row["IsEnabled"]);
			this._IsDefault = DataUtils.ConvertValue<int?>(row["IsDefault"]);
			this._OrderNo = DataUtils.ConvertValue<int?>(row["OrderNo"]);
			this._Remark = DataUtils.ConvertValue<string>(row["Remark"]);
		}
		#endregion

		#region _Field
		/// <summary>
		/// 字段信息
		/// </summary>
		public class _
		{
			/// <summary>
			/// *
			/// </summary>
			public readonly static Field All = new Field("*","cmsLanguage");
			/// <summary>
			///
			/// </summary>
			public readonly static Field Id = new Field("Id","cmsLanguage","Id");
			/// <summary>
			///
			/// </summary>
			public readonly static Field Name = new Field("Name","cmsLanguage","Name");
			/// <summary>
			///
			/// </summary>
            public readonly static Field ShortName = new Field("ShortName", "cmsLanguage", "ShortName");
            /// <summary>
            ///
            /// </summary>
            public readonly static Field Code = new Field("Code", "cmsLanguage", "Code");
			/// <summary>
			///
			/// </summary>
			public readonly static Field HomeUrl = new Field("HomeUrl","cmsLanguage","HomeUrl");
			/// <summary>
			///
			/// </summary>
			public readonly static Field Logo = new Field("Logo","cmsLanguage","Logo");
			/// <summary>
			///
			/// </summary>
			public readonly static Field IsEnabled = new Field("IsEnabled","cmsLanguage","IsEnabled");
			/// <summary>
			///
			/// </summary>
			public readonly static Field IsDefault = new Field("IsDefault","cmsLanguage","IsDefault");
			/// <summary>
			///
			/// </summary>
			public readonly static Field OrderNo = new Field("OrderNo","cmsLanguage","OrderNo");
			/// <summary>
			///
			/// </summary>
			public readonly static Field Remark = new Field("Remark","cmsLanguage","Remark");
		}
		#endregion

	}
}


text:
package org.apache.solr.update;

import static org.apache.solr.update.TestInPlaceUpdatesStandalone.addAndAssertVersion;

import org.apache.solr.SolrTestCaseJ4;
import org.junit.BeforeClass;
import org.junit.Test;

public class TestInPlaceUpdatesRequiredField extends SolrTestCaseJ4 {

  @BeforeClass
  public static void beforeClass() throws Exception {
    initCore("solrconfig-tlog.xml", "schema-inplace-required-field.xml");
  }

  @Test
  public void testUpdateFromTlog() throws Exception {
    long version1 =
        addAndGetVersion(sdoc("id", "1", "name", "first", "inplace_updatable_int", 1), null);
    assertU(commit("softCommit", "false"));
    assertQ(req("q", "*:*"), "//*[@numFound='1']");

    // do an in place update that hits off the tlog
    version1 = addAndAssertVersion(version1, "id", "1", "inplace_updatable_int", map("inc", 1));
    version1 = addAndAssertVersion(version1, "id", "1", "inplace_updatable_int", map("inc", 1));
    // new value should be 4
    version1 = addAndAssertVersion(version1, "id", "1", "inplace_updatable_int", map("inc", 1));
    assertU(commit("softCommit", "false"));
    assertQ(
        req("q", "id:1", "fl", "*,[docid]"),
        "//result/doc[1]/int[@name='inplace_updatable_int'][.='4']",
        "//result/doc[1]/long[@name='_version_'][.='" + version1 + "']");
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

        <title>About keytool</title><link rel="stylesheet" href="nbdocs:/org/netbeans/modules/usersguide/ide.css" type="text/css">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

About keytool

            The keytool module allows you to

                    View a keystore file

                    Create a new keystore file

                    Open a keystore file

                    Save the keystore file

                    Change keystore password

                    Create a new keystore entry

                    Delete a keystore entry

                    Create a Certificate Request File

View a keystore file

            Display the content of a keystore in a window.

            You can open the keystore window by selecting Windows|View Keystore, or by clicking
            the icon  in the toolbar.

            The keystore window displays the keystore entries of the currently loaded keystore file.

            The keystore entries are displayed in a table at the bottom of the window.
            The details of a keystore entry are shown at the upper part of the window.
            You can choose to view the keystore entry either in the Verbose, or RFC
            view mode.

            Table of Content

Create a new keystore file

            A new keystore file is opened in the keystore window.

            A wizard guides you through creating a new keystore file. The wizard has following steps:

Select a new file

Specify a keystore password, and retype the keystore password

            Finishing the wizard creates an empty keystore file in the filesystem, and opens the
            empty keystore file in the keystore window.

            Table of Content

Open a keystore file

            A keystore file is opened, its content is displayed in the keystore window.

            You can load a key store file by selecting the open keystore icon in the toolbar.

            Alternatively, you can select a file having the extension
            keystore, or jks in the explorer window,
            opening the context menu and selecting Tools|Load Key Store.

Moreover
you can drag a keystore file to the keystore window, and keystore
filename text field. You either select the dragging keystore file from
within Netbeans explorer view, or from the OS explorer application.

            A wizard guides you through opening a keystore file. The wizard has following steps.

Select a keystore file

Enter the keystore password

            By finishing the wizard the keystore file is loaded,
            and its content is shown in the keystore window.

            Table of Content

Save the keystore file

            The keystore file viewed in the keystore window is saved.

            You must store a keystore explicitly.

If you create a new keystore, it is not saved automatically.

If you create a new keystore entry or if you delete a keystore entry, you have to save the keystore explicitly.

            Table of Content

Change keystore password

            Changes the keystore password of the keystore which is opened.

            A wizard guides you through changing the keystore password. The wizard has following steps:

Confirm the keystore file name which is used for storing the changed keystore password.

Enter the new keystore password, and confirm the new keystore password.

            Finishing the wizard the keystore with the new password is saved on disk.

            The next time opening the keystore file,
            you have to provide the wizard-entered keystore password.

            Table of Content

Create a new keystore entry

            A new keystore entry is creating in the current keystore window.

            A wizard guides you through creating a new key entry. The wizard has following steps:

Enter certificate basic information, like alias, validity of the key, etc.

Enter identity informations, like firstname, lastname, etc.

Confirm informations entered

            By finishing the wizard a new keystore entry is created in the currently opened keystore file.
            The created keystore entry is self-signed automatically.

            You must save the keystore file for making the change persistent.

            Table of Content

Delete a keystore entry

            The current selected keystore entry is deleted from the keystore entry file.

            You must save the keystore file for making the change persistent.

            Table of Content

Create a certificate request file

            Create a certificate request file.

            A wizard guides you through creating the certificate request file.
            The wizard has following steps:

                Select the certificate request file. You must select a new file,
                files already existing are not acceptable.

                        Select the alias for which the certificate request is created.

                        Select the signature algorithm for creating the certificate request.

                        Enter the key password, alternatively you may reuse the store password.

            A dialog window informs you whether the certificate request file
            has been created successfully.

            Usually, you sent the created certificate request file to a certification
            authority for signing it.

            Note: Currently there is no feature in the keytool for importing the
            signed certificate request. You still have to use the traditional
            keytool command.

            Table of Content


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.03.06 at 03:56:57 PM GMT
//

package com.corbo.musicstreaming.model.jaxb;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for artistList complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="artistList">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="artist" type="{}artistCplxType" maxOccurs="unbounded"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "artistList", propOrder = {
    "artist"
})
public class ArtistList {

    @XmlElement(required = true)
    protected List<ArtistCplxType> artist;

    /**
     * Gets the value of the artist property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the artist property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getArtist().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link ArtistCplxType }
     *
     *
     */
    public List<ArtistCplxType> getArtist() {
        if (artist == null) {
            artist = new ArrayList<ArtistCplxType>();
        }
        return this.artist;
    }

}


text:
[![Latest Version](https://img.shields.io/packagist/v/gentle/bitbucket-api.svg?style=flat-square)](https://packagist.org/packages/gentle/bitbucket-api)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://bitbucket.org/gentlero/bitbucket-api/src/master/LICENSE)
[![Build Status](https://img.shields.io/travis/gentlero/bitbucket-api/master.svg?style=flat-square)](https://travis-ci.org/gentlero/bitbucket-api)
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/b/gentlero/bitbucket-api.svg?style=flat-square)](https://scrutinizer-ci.com/b/gentlero/bitbucket-api/?branch=develop)
[![Code quality](https://img.shields.io/scrutinizer/b/gentlero/bitbucket-api.svg?style=flat-square)](https://scrutinizer-ci.com/b/gentlero/bitbucket-api/?branch=develop)

Simple Bitbucket API wrapper for PHP >= 5.4

## Requirements

* PHP >= 5.4.0 with [cURL](http://php.net/manual/en/book.curl.php) extension.
* [Buzz](https://github.com/kriswallsmith/Buzz) library,
* PHPUnit to run tests. ( _optional_ )

## Getting started

Read [Introduction](https://gentlero.bitbucket.io/bitbucket-api/#introduction) and [Installation](https://gentlero.bitbucket.io/bitbucket-api/installation.html) from the documentation.

## Documentation

See [https://gentlero.bitbucket.io/bitbucket-api/](https://gentlero.bitbucket.io/bitbucket-api/) for more detailed documentation.

## License

`bitbucket-api` is licensed under the MIT License - see the LICENSE file for details

## Contribute

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Security

For any security related issues, please send an email at [alex@gentle.ro][maintainer-pgp] instead of using the issue tracker.

[maintainer-pgp]: https://keybase.io/vimishor/key.asc


text:
package org.jboss.resteasy.reactive.server.vertx.test.customproviders;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;
import java.util.function.Supplier;

import javax.annotation.Priority;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Priorities;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;

import org.jboss.resteasy.reactive.server.ServerRequestFilter;
import org.jboss.resteasy.reactive.server.core.BlockingOperationSupport;
import org.jboss.resteasy.reactive.server.vertx.test.framework.ResteasyReactiveUnitTest;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.restassured.RestAssured;
import io.restassured.http.Headers;
import io.smallrye.common.annotation.Blocking;
import io.smallrye.common.annotation.NonBlocking;
import io.smallrye.mutiny.Uni;

public class ValidNonBlockingFiltersTest {

    @RegisterExtension
    static ResteasyReactiveUnitTest test = new ResteasyReactiveUnitTest()
            .setArchiveProducer(new Supplier<>() {
                @Override
                public JavaArchive get() {
                    return ShrinkWrap.create(JavaArchive.class)
                            .addClasses(StandardBlockingRequestFilter.class, AnotherStandardBlockingRequestFilter.class,
                                    StandardNonBlockingRequestFilter.class, DummyResource.class);
                }
            });

    @Test
    public void testBlockingEndpoint() {
        Headers headers = RestAssured.given().get("/dummy/blocking")
                .then().statusCode(200).extract().headers();
        assertEquals(
                "1-custom-non-blocking/2-another-custom-non-blocking/3-standard-non-blocking/4-standard-blocking/5-another-standard-blocking/6-custom-blocking",
                headers.get("filter-request").getValue());
        assertEquals(
                "false/false/false/true/true/true",
                headers.get("thread").getValue());
    }

    @Test
    public void testNonBlockingEndpoint() {
        Headers headers = RestAssured.given().get("/dummy/nonblocking")
                .then().statusCode(200).extract().headers();
        assertEquals(
                "1-custom-non-blocking/2-another-custom-non-blocking/3-standard-non-blocking/4-standard-blocking/5-another-standard-blocking/6-custom-blocking",
                headers.get("filter-request").getValue());
        assertEquals(
                "false/false/false/false/false/false",
                headers.get("thread").getValue());
    }

    @Path("dummy")
    public static class DummyResource {

        @Blocking
        @Path("blocking")
        @GET
        public Response blocking(@Context HttpHeaders headers) {
            return getResponse(headers);
        }

        @Path("nonblocking")
        @GET
        public Uni<Response> nonblocking(@Context HttpHeaders headers) {
            return Uni.createFrom().item(getResponse(headers));
        }

        private Response getResponse(HttpHeaders headers) {
            return Response.ok()
                    .header("filter-request", headers.getHeaderString("filter-request"))
                    .header("thread", headers.getHeaderString("thread"))
                    .build();
        }
    }

    @Provider
    @Priority(Priorities.USER + 100)
    public static class StandardBlockingRequestFilter implements ContainerRequestFilter {

        @Override
        public void filter(ContainerRequestContext requestContext) throws IOException {
            MultivaluedMap<String, String> headers = requestContext.getHeaders();
            String previousFilterHeaderValue = headers.getFirst("filter-request");
            headers.putSingle("filter-request", previousFilterHeaderValue + "/4-standard-blocking");
            String previousThreadHeaderValue = headers.getFirst("thread");
            headers.putSingle("thread", previousThreadHeaderValue + "/" + BlockingOperationSupport.isBlockingAllowed());
        }
    }

    @Provider
    @Priority(Priorities.USER + 200)
    public static class AnotherStandardBlockingRequestFilter implements ContainerRequestFilter {

        @Override
        public void filter(ContainerRequestContext requestContext) throws IOException {
            MultivaluedMap<String, String> headers = requestContext.getHeaders();
            String previousFilterHeaderValue = headers.getFirst("filter-request");
            headers.putSingle("filter-request", previousFilterHeaderValue + "/5-another-standard-blocking");
            String previousThreadHeaderValue = headers.getFirst("thread");
            headers.putSingle("thread", previousThreadHeaderValue + "/" + BlockingOperationSupport.isBlockingAllowed());
        }
    }

    @Provider
    @Priority(Priorities.USER + 50)
    @NonBlocking
    public static class StandardNonBlockingRequestFilter implements ContainerRequestFilter {

        @Override
        public void filter(ContainerRequestContext requestContext) throws IOException {
            MultivaluedMap<String, String> headers = requestContext.getHeaders();
            String previousFilterHeaderValue = headers.getFirst("filter-request");
            headers.putSingle("filter-request", previousFilterHeaderValue + "/3-standard-non-blocking");
            String previousThreadHeaderValue = headers.getFirst("thread");
            headers.putSingle("thread", previousThreadHeaderValue + "/" + BlockingOperationSupport.isBlockingAllowed());
        }
    }

    public static class CustomFilters {

        @ServerRequestFilter(nonBlocking = true)
        public void firstNonBlocking(ContainerRequestContext requestContext) {
            MultivaluedMap<String, String> headers = requestContext.getHeaders();
            String previousFilterHeaderValue = headers.getFirst("filter-request");
            headers.putSingle("filter-request", "1-custom-non-blocking");
            headers.putSingle("thread", "" + BlockingOperationSupport.isBlockingAllowed());
        }

        @ServerRequestFilter(nonBlocking = true, priority = Priorities.USER + 20)
        public void anotherNonBlocking(ContainerRequestContext requestContext) {
            MultivaluedMap<String, String> headers = requestContext.getHeaders();
            String previousFilterHeaderValue = headers.getFirst("filter-request");
            headers.putSingle("filter-request",
                    previousFilterHeaderValue + "/2-another-custom-non-blocking");
            String previousThreadHeaderValue = headers.getFirst("thread");
            headers.putSingle("thread", previousThreadHeaderValue + "/" + BlockingOperationSupport.isBlockingAllowed());
        }

        @ServerRequestFilter(priority = Priorities.USER + 300)
        public void blocking(ContainerRequestContext requestContext) {
            MultivaluedMap<String, String> headers = requestContext.getHeaders();
            String previousFilterHeaderValue = headers.getFirst("filter-request");
            headers.putSingle("filter-request", previousFilterHeaderValue + "/6-custom-blocking");
            String previousThreadHeaderValue = headers.getFirst("thread");
            headers.putSingle("thread", previousThreadHeaderValue + "/" + BlockingOperationSupport.isBlockingAllowed());
        }
    }

}


text:
<!DOCTYPE html>

    <title>Fictional Game Design</title>
    <link href='http://fonts.googleapis.com/css?family=Glass+Antiqua|Press+Start+2P' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="css/fictional.css"/>

Fictional Game Design

if we existed... we'd be awesome!

[ explore with the arrow keys ]

[ hold shift to run ]

[ click to toggle music
                ]

A Game*

                <object width="480" height="360"><param name="movie" value="//www.youtube-nocookie.com/v/2bB5yt5ekl8?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="//www.youtube-nocookie.com/v/2bB5yt5ekl8?version=3&hl=en_US" type="application/x-shockwave-flash" width="480" height="360" allowscriptaccess="always" allowfullscreen="true"></embed></object>

*not by us

hypothetical
                Customer Reviews

                The game they made for me was wonderful! Even I play it!
                Beelzebub

                Fictional Game design made my dreams come true! Finally, I have a Pacman/Gears of War mashup.
                Captain Awesome

                Most companies make 3 D games these days. Fictional Game Design made a 7 D adventure game, and they
                did it at the speed of light!
                Albert Einstein

                Me featuring my favorite companions fictional game design made a game for. Yes, hmmm.
                Minch Yoda

Credit

Design & Development by Frankie Bagnardi

Thanks to Cody Lundquist for 8bit.js


text:
from . import ANY, Mock, patch, unittest

from testtube.helpers import HardTestFailure
from testtube.runner import ResultCollection, TestCollection, SuiteRunner

class ResultCollections(unittest.TestCase):
    """ResultCollections"""
    def setUp(self):
        self.passed_tests = ResultCollection([(Mock(), True), (Mock(), True)])
        self.mixed_result_tests = ResultCollection(
            [(Mock(), True), (Mock(), False)])

    def test_are_an_iterable(self):
        iter(self.passed_tests)

    def test_passed_property_is_true_if_all_tests_passed(self):
        self.assertTrue(self.passed_tests.passed)

    def test_passed_property_is_false_if_any_test_results_indicate_fail(self):
        self.assertFalse(self.mixed_result_tests.passed)

class TestCollectionTests(unittest.TestCase):
    def setUp(self):
        self.fake_passing_test = Mock()
        self.fake_passing_test.return_value = True
        self.fake_failing_test = Mock()
        self.fake_failing_test.return_value = False
        self.tests = [self.fake_passing_test, self.fake_failing_test]

        self.test_collection = TestCollection(
            r'.*', self.tests, {'fail_fast': True})

class TestCollections(TestCollectionTests):
    """TestCollections"""
    def test_instation_sets_conf_attribute(self):
        self.assertEqual(self.test_collection.conf, {'fail_fast': True})

    def test_instantiation_sets_pattern_attribute(self):
        self.assertEqual(self.test_collection.pattern, r'.*')

    def test_instantiation_sets_tests_attribute(self):
        self.assertEqual(self.test_collection.tests, self.tests)

    def test_fail_fast_attribute_returns_true_when_configured_to_true(self):
        """fail_fast attribute returns True when configured that way"""
        self.assertTrue(self.test_collection.fail_fast)

class TestCollectionApplyWhenPatternMatchesAgainstPath(TestCollectionTests):
    """TestCollection.apply() when pattern matches passed path"""
    def setUp(self):
        super(TestCollectionApplyWhenPatternMatchesAgainstPath, self).setUp()

        self.results = self.test_collection.apply('myfile.py')

    def test_runs_all_tests(self):
        for test in self.tests:
            test.assert_called_once_with('myfile.py', ANY)

    def test_returns_result_collection_with_entries_for_all_tests(self):
        self.assertEqual(
            self.results,
            [(self.fake_passing_test, True), (self.fake_failing_test, False)])

class TestCollectionApplyIfPatternDoesntMatchAgainstPath(TestCollectionTests):
    """TestCollection.apply() if pattern doesn't match against passed path"""
    def setUp(self):
        super(TestCollectionApplyIfPatternDoesntMatchAgainstPath, self).setUp()

        # Reconfigure the test collection to only run if the passed file is
        # foo.py
        self.test_collection.pattern = r'foo\.py'

        self.results = self.test_collection.apply('myfile.py')

    def test_returns_empty_result_collection(self):
        self.assertEqual(self.results, ResultCollection())

    def test_doesnt_execute_tests(self):
        for test in self.tests:
            self.assertFalse(test.called)

class TestCollectionApplyIfTestHasHardTestFailure(TestCollectionTests):
    """TestCollection.apply() if a test raises a HardTestFailure"""
    def setUp(self):
        super(TestCollectionApplyIfTestHasHardTestFailure, self).setUp()

        # Add a test that raises a HardTestFailure to the collection
        self.hard_test_failure = Mock()
        self.hard_test_failure.side_effect = HardTestFailure('failing')
        self.tests = [self.hard_test_failure] + self.tests

        self.test_collection.tests = self.tests

        self.results = self.test_collection.apply('myfile.py')

    def test_doesnt_execute_tests_after_the_raising_test(self):
        """doesn't execute tests after the raising test"""
        self.assertTrue(self.hard_test_failure.called)
        self.assertFalse(self.fake_passing_test.called)
        self.assertFalse(self.fake_failing_test.called)

    def test_returns_a_result_collection_with_raisig_test_as_failure(self):
        self.assertEqual(self.results, [(self.hard_test_failure, False)])

class SuiteRunnerTests(unittest.TestCase):
    """SuiteRunner.run()"""
    def setUp(self):
        self.test1, self.test2, self.test3 = Mock(), Mock(), Mock()
        self.test1.return_value = True
        self.test2.return_value = True
        self.test3.return_value = False

        SuiteRunner.renderer = Mock()

        settings_patcher = patch('testtube.runner.Settings')
        self.addCleanup(settings_patcher.stop)
        self.Settings = settings_patcher.start()
        self.Settings.PATTERNS = [
            (r'.*', [self.test1, self.test2]),
            (r'.*', [self.test3], {'fail_fast': True}),
            (r'.*', [])

        ]

        self.runner = SuiteRunner()
        self.runner.run('yay.py')

    def test_renders_a_result_report_with_list_of_result_groupings(self):
        self.runner.renderer.report.assert_called_once_with([
            [(self.test1, True), (self.test2, True)],
            [(self.test3, False)]
        ])

    def test_outputs_fail_fast_messaging_if_ff_test_group_fails(self):
        self.runner.renderer.failure.assert_called_once_with(
            'Aborting subsequent test groups. Fail fast enabled.')


text: Skeleton project for Apigee-127


text:
using GameCore.Rendering;
using GameCore;
using GameCore.IO;
using System.Drawing;
using OpenTK;

namespace ASCIIWorld.UI
{
	public class TextButton : BaseButton
	{
		#region Fields

		private Label _label;
		private Color _labelColor;

		#endregion

		#region Constructors

		public TextButton(IGameWindow window, Camera<OrthographicProjection> camera, Vector2 position, string text)
			: base(window, camera, position)
		{
			Text = text;
		}

		#endregion

		#region Properties

		public string Text { get; private set; }

		#endregion

		#region Methods

		public override void LoadContent(ContentManager content)
		{
			base.LoadContent(content);
			Bounds = new RectangleF(Bounds.X, Bounds.Y, UI_ASCII.Width * (Text.Length + 2), UI_ASCII.Height * 3);
			SetBorderSize(Text.Length + 2, 3);

			_label = new Label(Window, Camera, new Vector2(UI_ASCII.Width, UI_ASCII.Height), Text);
			_label.LoadContent(content);
			_label.CanHaveMouseHover = false;
			_labelColor = _label.TextColor;
		}

		protected override void RenderContent(ITessellator tessellator)
		{
			base.RenderContent(tessellator);

			_label.TextColor = ModifyColorByState(_labelColor);
			_label.Render(tessellator);
		}

		#endregion
	}
}


text:
"use strict";

var Registry = require("./registry"),
    Config = require("./config"),
    _ = require("./utils/helpers");

function testMode() {
  return process.env.NODE_ENV === "test" && Config.testMode;
}

module.exports = function Initializer(type, opts) {
  var mod;

  mod = Registry.findBy(type, opts[type]);

  if (!mod) {
    if (opts.module) {
      Registry.register(opts.module);
    } else {
      Registry.register("cylon-" + opts[type]);
    }

    mod = Registry.findBy(type, opts[type]);
  }

  var obj = mod[type](opts);

  _.each(obj, function(prop, name) {
    if (name === "constructor") {
      return;
    }

    if (_.isFunction(prop)) {
      obj[name] = prop.bind(obj);
    }
  });

  if (testMode()) {
    var test = Registry.findBy(type, "test")[type](opts);

    _.each(obj, function(prop, name) {
      if (_.isFunction(prop) && !test[name]) {
        test[name] = function() { return true; };
      }
    });

    return test;
  }

  return obj;
};


text:
package com.abdullah.threepio.autodata.json;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.List;

/**
 * Utility class to write non primitive data types including arrays, lists and JSON Parsables.
 *
 * You may not need to use this class directly, but if you want to do so to make your life easier
 * go ahead and use it.
 */
public class JsonWriter {
    private final JSONObject json;

    public JsonWriter(JSONObject json) {
        this.json = json;
    }

    public <T extends JsonParsable> void write(String name, T value, boolean optional) throws JSONException {
        Utils.checkValue(name, value, optional);
        json.put(name, value.toJson());
    }

    // <editor-fold desc="Array Methods">
    public void write(String name, int[] value, boolean optional) throws JSONException {
        Utils.checkValue(name, value, optional);
        JSONArray array = new JSONArray();
        for(int i : value) {
            array.put(i);
        }
        json.put(name, array);
    }

    public void write(String name, boolean[] value, boolean optional) throws JSONException {
        Utils.checkValue(name, value, optional);
        JSONArray array = new JSONArray();
        for(boolean i : value) {
            array.put(i);
        }
        json.put(name, array);
    }

    public void write(String name, long[] value, boolean optional) throws JSONException {
        Utils.checkValue(name, value, optional);
        JSONArray array = new JSONArray();
        for(long i : value) {
            array.put(i);
        }
        json.put(name, array);
    }

    public void write(String name, double[] value, boolean optional) throws JSONException {
        Utils.checkValue(name, value, optional);
        JSONArray array = new JSONArray();
        for(double i : value) {
            array.put(i);
        }
        json.put(name, array);
    }

    public void write(String name, String[] value, boolean optional) throws JSONException {
        Utils.checkValue(name, value, optional);
        JSONArray array = new JSONArray();
        for(String i : value) {
            array.put(i);
        }
        json.put(name, array);
    }

    public <T extends JsonParsable> void write(String name, T[] value, boolean optional) throws JSONException {
        Utils.checkValue(name, value, optional);
        JSONArray array = new JSONArray();
        for(JsonParsable i : value) {
            array.put(i.toJson());
        }
        json.put(name, array);
    }
    // </editor-fold>

    // <editor-fold desc="List Methods">
    public void writeStringList(String name, List<String> value, boolean optional) throws JSONException {
        Utils.checkValue(name, value, optional);
        JSONArray array = new JSONArray();
        for(String i : value) {
            array.put(i);
        }
        json.put(name, array);
    }

    public <T extends JsonParsable> void writeJsonParsableList(String name, List<T> value, boolean optional) throws JSONException {
        Utils.checkValue(name, value, optional);
        JSONArray array = new JSONArray();
        for(JsonParsable i : value) {
            array.put(i.toJson());
        }
        json.put(name, array);
    }
    // </editor-fold>
}


text:
<?php
namespace Poll\PollBundle\Tests\Service;

use Poll\PollBundle\Service\ObjectFactory;
use Poll\PollBundle\Service\ServiceImpl\LocalObjectFactory;
use Poll\PollBundle\Exception\QuestionDoesNotExistException;

/**
 *
 * @author jirkovoj
 */
class QuestionServiceTest extends \PHPUnit_Framework_TestCase {

	protected $objectFactory;

	protected $service;

	protected function setUp() {
		$this->objectFactory = new LocalObjectFactory();
		$application = $this->objectFactory->createPollService();
		$poll = $application->create("Prvni anketa", "Testovaci anketa");
		$this->service = $application->getQuestionService($poll);
	}

	public function testImplementation() {
		$this->assertInstanceOf(
			'\Poll\PollBundle\Service\QuestionService',
			$this->service,
			'Trida neimplementuje rozhrani QuestionService'
		);
	}

	public function testGetPoll() {
		$this->assertInstanceOf(
			'\Poll\PollBundle\Entity\Poll',
			$this->service->getPoll(),
			'Pripojena anketa neimplementuje rozhrani Poll'
		);
	}

	public function testCreateQuestion() {
		$this->service->create("Prvni otazka");
		/* @var $poll \Poll\PollBundle\Entity\Poll */
		$question = $this->service->create("Druha otazka");
		$this->service->create("Treti otazka");
		$this->assertSame($this->service->find($question->getId()), $question, 'Vlozena otazka nebyla nasledne nalezena');
	}

	public function testDeleteQuestion() {
		$question = $this->service->create("Prvni otazka");
		$this->service->delete($question);
		try {
			$this->service->find($question->getId());
			$this->fail("Exception expected but none has been thrown.");
		} catch(QuestionDoesNotExistException $e) {}
	}

	public function testOptions() {
		$question = $this->service->create("Prvni otazka",ObjectFactory::SINGLE_CHOICE_QUESTION);
		$o1 = $this->objectFactory->createOption(ObjectFactory::SHARED_OPTION);
		$o1->setOption('Moznost 1');
		$this->service->addSharedOption($question,$o1);
		$o2 = $this->service->addOption($question,'Moznost 2');

		$this->assertEquals($o1,$question->getOption($o1->getId()),'Vlozena moznost nebyla nasledne nalezena');
		$this->assertEquals($o2,$question->getOption($o2->getId()),'Vlozena moznost nebyla nasledne nalezena');

		$this->service->removeOption($question,$o1);
		$this->service->removeOption($question,$o2);

		$this->assertFalse($question->hasOption($o1),'Odstranena moznost je stale v otazce');
		$this->assertFalse($question->hasOption($o2),'Odstranena moznost je stale v otazce');
	}

}


text:
package nl.esciencecenter.e3dchem.knime.pharmacophore;

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

import org.ejml.simple.SimpleMatrix;
import org.junit.Test;

public class PharmacophorePointTest {
	private PharmacophorePoint aPoint() {
		return new PharmacophorePoint("LIPO", 12.3971, 28.8415, 21.9387, 1.0);
	}

	private PharmacophorePoint bPoint() {
		return new PharmacophorePoint("LIPO", 12.3971, 28.8415, 21.9387, 0, 1.234, 2.456, 3.789);
	}

	@Test(expected = IllegalArgumentException.class)
	public void testPharmaCophore_badtype() {
		new PharmacophorePoint("FOOBAR", 12.3971, 28.8415, 21.9387, 1.0);
	}

	@Test
	public void testPharmacophorePointStringArray() {
		String[] cols = new String[] { "LIPO", "12.3971", "28.8415", "21.9387", "1", "0", "0", "0", "0" };
		PharmacophorePoint actual = new PharmacophorePoint(cols);
		PharmacophorePoint expected = aPoint();
		assertEquals(expected, actual);
	}

	@Test
	public void testToString() {
		PharmacophorePoint p = aPoint();
		String actual = p.toString();
		String expected = "LIPO 12.3971 28.8415 21.9387 1 0 0 0 0";
		assertEquals(expected, actual);
	}

	@Test
	public void testGetPointAsMatrix() {
		SimpleMatrix actual = aPoint().getPointAsMatrix();
		SimpleMatrix expected = new SimpleMatrix(new double[][] { { 12.3971, 28.8415, 21.9387 } });
		assertTrue(expected.isIdentical(actual, 0.0001));
	}

	@Test
	public void testDistance_samepoint_distance0() {
		double actual = aPoint().distance(aPoint());
		assertEquals(0.0, actual, 0.0001);
	}

	@Test
	public void testHasNormal() {
		assertFalse(aPoint().hasNormal());
	}

	@Test
	public void testTransform_identity_sameasin() {
		SimpleMatrix matrix = SimpleMatrix.identity(4);

		PharmacophorePoint actual = aPoint().transform(matrix);

		PharmacophorePoint expected = aPoint();
		assertEquals(expected, actual);
	}

	@Test
	public void testTransformWithNormal_identity_sameasin() {
		SimpleMatrix matrix = SimpleMatrix.identity(4);

		PharmacophorePoint point = bPoint();

		PharmacophorePoint actual = point.transform(matrix);

		PharmacophorePoint expected = bPoint();
		assertEquals(expected, actual);
	}

	@Test
	public void test_getDefaultAlpha_AROM() {
		assertEquals(0.7, PharmacophorePoint.getDefaultAlpha("AROM"), 0.0001);
	}

	@Test
	public void test_getDefaultAlpha_HDON() {
		assertEquals(1.0, PharmacophorePoint.getDefaultAlpha("HDON"), 0.0001);
	}

	@Test
	public void test_getDefaultAlpha_HACC() {
		assertEquals(1.0, PharmacophorePoint.getDefaultAlpha("HACC"), 0.0001);
	}

	@Test
	public void test_getDefaultAlpha_LIPO() {
		assertEquals(0.7, PharmacophorePoint.getDefaultAlpha("LIPO"), 0.0001);
	}

	@Test
	public void test_getDefaultAlpha_POSC() {
		assertEquals(1.0, PharmacophorePoint.getDefaultAlpha("POSC"), 0.0001);
	}

	@Test
	public void test_getDefaultAlpha_NEGC() {
		assertEquals(1.0, PharmacophorePoint.getDefaultAlpha("NEGC"), 0.0001);
	}

	@Test
	public void test_getDefaultAlpha_HYBH() {
		assertEquals(1.0, PharmacophorePoint.getDefaultAlpha("HYBH"), 0.0001);
	}

	@Test
	public void test_getDefaultAlpha_HYBL() {
		assertEquals(0.7, PharmacophorePoint.getDefaultAlpha("HYBL"), 0.0001);
	}

	@Test
	public void test_getDefaultAlpha_EXCL() {
		assertEquals(1.7, PharmacophorePoint.getDefaultAlpha("EXCL"), 0.0001);
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
    <resourcetype name="number">100</resourcetype>
</resources>


text:
package eventstreamapi

import (
	"bytes"
	"encoding/base64"
	"encoding/hex"
	"fmt"
	"strings"
	"testing"
	"time"

	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/eventstream"
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/eventstream/eventstreamtest"
)

func TestSignEncoder(t *testing.T) {
	currentTime := time.Date(2019, 1, 27, 22, 37, 54, 0, time.UTC)

	cases := map[string]struct {
		Signer       StreamSigner
		Input        eventstream.Message
		Expect       eventstream.Message
		NestedExpect *eventstream.Message
		Err          string
	}{
		"sign message": {
			Signer: mockChunkSigner{
				signature: "524f1d03d1d81e94a099042736d40bd9681b867321443ff58a4568e274dbd83bff",
			},
			Input: eventstream.Message{
				Headers: eventstream.Headers{
					{
						Name:  "header_name",
						Value: eventstream.StringValue("header value"),
					},
				},
				Payload: []byte("payload"),
			},
			Expect: eventstream.Message{
				Headers: eventstream.Headers{
					{
						Name:  ":date",
						Value: eventstream.TimestampValue(currentTime),
					},
					{
						Name: ":chunk-signature",
						Value: eventstream.BytesValue(mustDecodeBytes(
							hex.DecodeString("524f1d03d1d81e94a099042736d40bd9681b867321443ff58a4568e274dbd83bff"),
						)),
					},
				},
				Payload: mustDecodeBytes(
					base64.StdEncoding.DecodeString(
						`AAAAMgAAABs0pv1jC2hlYWRlcl9uYW1lBwAMaGVhZGVyIHZhbHVlcGF5bG9hZH4tKFg=`,
					),
				),
			},
			NestedExpect: &eventstream.Message{
				Headers: eventstream.Headers{
					{
						Name:  "header_name",
						Value: eventstream.StringValue("header value"),
					},
				},
				Payload: []byte(`payload`),
			},
		},
		"signing error": {
			Signer: mockChunkSigner{err: fmt.Errorf("signing error")},
			Input: eventstream.Message{
				Headers: []eventstream.Header{
					{
						Name:  "header_name",
						Value: eventstream.StringValue("header value"),
					},
				},
				Payload: []byte("payload"),
			},
			Err: "signing error",
		},
	}

	origNowFn := timeNow
	timeNow = func() time.Time { return currentTime }
	defer func() { timeNow = origNowFn }()

	decodeBuf := make([]byte, 1024)
	for name, c := range cases {
		t.Run(name, func(t *testing.T) {
			encoder := &mockEncoder{}
			signer := NewSignEncoder(c.Signer, encoder)

			err := signer.Encode(c.Input)
			if err == nil && len(c.Err) > 0 {
				t.Fatalf("expected error, but got nil")
			} else if err != nil && len(c.Err) == 0 {
				t.Fatalf("expected no error, but got %v", err)
			} else if err != nil && len(c.Err) > 0 && !strings.Contains(err.Error(), c.Err) {
				t.Fatalf("expected %v, but got %v", c.Err, err)
			} else if len(c.Err) > 0 {
				return
			}

			eventstreamtest.AssertMessageEqual(t, c.Expect, encoder.msgs[0], "envelope msg")

			if c.NestedExpect != nil {
				nested := eventstream.NewDecoder(bytes.NewReader(encoder.msgs[0].Payload))
				nestedMsg, err := nested.Decode(decodeBuf)
				if err != nil {
					t.Fatalf("expect no decode error got, %v", err)
				}

				eventstreamtest.AssertMessageEqual(t, *c.NestedExpect, nestedMsg, "nested msg")
			}
		})
	}
}

type mockEncoder struct {
	msgs []eventstream.Message
}

func (m *mockEncoder) Encode(msg eventstream.Message) error {
	m.msgs = append(m.msgs, msg)
	return nil
}


text:
'use strict';

angular.module('ruckApp')
  .directive('bindHtmlCompile', function($compile) {
    return {
      restrict: 'A',
      link: function(scope, element, attrs) {
        scope.$watch(function() {
          return scope.$eval(attrs.bindHtmlCompile);
        }, function(value) {
          element.html(value);
          $compile(element.contents())(scope);
        });
      }
    };
  });