text:
package com.amazonaws.services.drs.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateReplicationConfigurationTemplateRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * Whether to associate the default Elastic Disaster Recovery Security group with the Replication Configuration
     * Template.
     *

     */
    private Boolean associateDefaultSecurityGroup;
    /**
     *

     * Configure bandwidth throttling for the outbound data transfer rate of the Source Server in Mbps.
     *

     */
    private Long bandwidthThrottling;
    /**
     *

     * Whether to create a Public IP for the Recovery Instance by default.
     *

     */
    private Boolean createPublicIP;
    /**
     *

     * The data plane routing mechanism that will be used for replication.
     *

     */
    private String dataPlaneRouting;
    /**
     *

     * The Staging Disk EBS volume type to be used during replication.
     *

     */
    private String defaultLargeStagingDiskType;
    /**
     *

     * The type of EBS encryption to be used during replication.
     *

     */
    private String ebsEncryption;
    /**
     *

     * The ARN of the EBS encryption key to be used during replication.
     *

     */
    private String ebsEncryptionKeyArn;
    /**
     *

     * The Point in time (PIT) policy to manage snapshots taken during replication.
     *

     */
    private java.util.List<PITPolicyRule> pitPolicy;
    /**
     *

     * The instance type to be used for the replication server.
     *

     */
    private String replicationServerInstanceType;
    /**
     *

     * The security group IDs that will be used by the replication server.
     *

     */
    private java.util.List<String> replicationServersSecurityGroupsIDs;
    /**
     *

     * The subnet to be used by the replication staging area.
     *

     */
    private String stagingAreaSubnetId;
    /**
     *

     * A set of tags to be associated with all resources created in the replication staging area: EC2 replication
     * server, EBS volumes, EBS snapshots, etc.
     *

     */
    private java.util.Map<String, String> stagingAreaTags;
    /**
     *

     * A set of tags to be associated with the Replication Configuration Template resource.
     *

     */
    private java.util.Map<String, String> tags;
    /**
     *

     * Whether to use a dedicated Replication Server in the replication staging area.
     *

     */
    private Boolean useDedicatedReplicationServer;

    /**
     *

     * Whether to associate the default Elastic Disaster Recovery Security group with the Replication Configuration
     * Template.
     *

     *
     * @param associateDefaultSecurityGroup
     *        Whether to associate the default Elastic Disaster Recovery Security group with the Replication
     *        Configuration Template.
     */

    public void setAssociateDefaultSecurityGroup(Boolean associateDefaultSecurityGroup) {
        this.associateDefaultSecurityGroup = associateDefaultSecurityGroup;
    }

    /**
     *

     * Whether to associate the default Elastic Disaster Recovery Security group with the Replication Configuration
     * Template.
     *

     *
     * @return Whether to associate the default Elastic Disaster Recovery Security group with the Replication
     *         Configuration Template.
     */

    public Boolean getAssociateDefaultSecurityGroup() {
        return this.associateDefaultSecurityGroup;
    }

    /**
     *

     * Whether to associate the default Elastic Disaster Recovery Security group with the Replication Configuration
     * Template.
     *

     *
     * @param associateDefaultSecurityGroup
     *        Whether to associate the default Elastic Disaster Recovery Security group with the Replication
     *        Configuration Template.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withAssociateDefaultSecurityGroup(Boolean associateDefaultSecurityGroup) {
        setAssociateDefaultSecurityGroup(associateDefaultSecurityGroup);
        return this;
    }

    /**
     *

     * Whether to associate the default Elastic Disaster Recovery Security group with the Replication Configuration
     * Template.
     *

     *
     * @return Whether to associate the default Elastic Disaster Recovery Security group with the Replication
     *         Configuration Template.
     */

    public Boolean isAssociateDefaultSecurityGroup() {
        return this.associateDefaultSecurityGroup;
    }

    /**
     *

     * Configure bandwidth throttling for the outbound data transfer rate of the Source Server in Mbps.
     *

     *
     * @param bandwidthThrottling
     *        Configure bandwidth throttling for the outbound data transfer rate of the Source Server in Mbps.
     */

    public void setBandwidthThrottling(Long bandwidthThrottling) {
        this.bandwidthThrottling = bandwidthThrottling;
    }

    /**
     *

     * Configure bandwidth throttling for the outbound data transfer rate of the Source Server in Mbps.
     *

     *
     * @return Configure bandwidth throttling for the outbound data transfer rate of the Source Server in Mbps.
     */

    public Long getBandwidthThrottling() {
        return this.bandwidthThrottling;
    }

    /**
     *

     * Configure bandwidth throttling for the outbound data transfer rate of the Source Server in Mbps.
     *

     *
     * @param bandwidthThrottling
     *        Configure bandwidth throttling for the outbound data transfer rate of the Source Server in Mbps.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withBandwidthThrottling(Long bandwidthThrottling) {
        setBandwidthThrottling(bandwidthThrottling);
        return this;
    }

    /**
     *

     * Whether to create a Public IP for the Recovery Instance by default.
     *

     *
     * @param createPublicIP
     *        Whether to create a Public IP for the Recovery Instance by default.
     */

    public void setCreatePublicIP(Boolean createPublicIP) {
        this.createPublicIP = createPublicIP;
    }

    /**
     *

     * Whether to create a Public IP for the Recovery Instance by default.
     *

     *
     * @return Whether to create a Public IP for the Recovery Instance by default.
     */

    public Boolean getCreatePublicIP() {
        return this.createPublicIP;
    }

    /**
     *

     * Whether to create a Public IP for the Recovery Instance by default.
     *

     *
     * @param createPublicIP
     *        Whether to create a Public IP for the Recovery Instance by default.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withCreatePublicIP(Boolean createPublicIP) {
        setCreatePublicIP(createPublicIP);
        return this;
    }

    /**
     *

     * Whether to create a Public IP for the Recovery Instance by default.
     *

     *
     * @return Whether to create a Public IP for the Recovery Instance by default.
     */

    public Boolean isCreatePublicIP() {
        return this.createPublicIP;
    }

    /**
     *

     * The data plane routing mechanism that will be used for replication.
     *

     *
     * @param dataPlaneRouting
     *        The data plane routing mechanism that will be used for replication.
     * @see ReplicationConfigurationDataPlaneRouting
     */

    public void setDataPlaneRouting(String dataPlaneRouting) {
        this.dataPlaneRouting = dataPlaneRouting;
    }

    /**
     *

     * The data plane routing mechanism that will be used for replication.
     *

     *
     * @return The data plane routing mechanism that will be used for replication.
     * @see ReplicationConfigurationDataPlaneRouting
     */

    public String getDataPlaneRouting() {
        return this.dataPlaneRouting;
    }

    /**
     *

     * The data plane routing mechanism that will be used for replication.
     *

     *
     * @param dataPlaneRouting
     *        The data plane routing mechanism that will be used for replication.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ReplicationConfigurationDataPlaneRouting
     */

    public CreateReplicationConfigurationTemplateRequest withDataPlaneRouting(String dataPlaneRouting) {
        setDataPlaneRouting(dataPlaneRouting);
        return this;
    }

    /**
     *

     * The data plane routing mechanism that will be used for replication.
     *

     *
     * @param dataPlaneRouting
     *        The data plane routing mechanism that will be used for replication.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ReplicationConfigurationDataPlaneRouting
     */

    public CreateReplicationConfigurationTemplateRequest withDataPlaneRouting(ReplicationConfigurationDataPlaneRouting dataPlaneRouting) {
        this.dataPlaneRouting = dataPlaneRouting.toString();
        return this;
    }

    /**
     *

     * The Staging Disk EBS volume type to be used during replication.
     *

     *
     * @param defaultLargeStagingDiskType
     *        The Staging Disk EBS volume type to be used during replication.
     * @see ReplicationConfigurationDefaultLargeStagingDiskType
     */

    public void setDefaultLargeStagingDiskType(String defaultLargeStagingDiskType) {
        this.defaultLargeStagingDiskType = defaultLargeStagingDiskType;
    }

    /**
     *

     * The Staging Disk EBS volume type to be used during replication.
     *

     *
     * @return The Staging Disk EBS volume type to be used during replication.
     * @see ReplicationConfigurationDefaultLargeStagingDiskType
     */

    public String getDefaultLargeStagingDiskType() {
        return this.defaultLargeStagingDiskType;
    }

    /**
     *

     * The Staging Disk EBS volume type to be used during replication.
     *

     *
     * @param defaultLargeStagingDiskType
     *        The Staging Disk EBS volume type to be used during replication.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ReplicationConfigurationDefaultLargeStagingDiskType
     */

    public CreateReplicationConfigurationTemplateRequest withDefaultLargeStagingDiskType(String defaultLargeStagingDiskType) {
        setDefaultLargeStagingDiskType(defaultLargeStagingDiskType);
        return this;
    }

    /**
     *

     * The Staging Disk EBS volume type to be used during replication.
     *

     *
     * @param defaultLargeStagingDiskType
     *        The Staging Disk EBS volume type to be used during replication.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ReplicationConfigurationDefaultLargeStagingDiskType
     */

    public CreateReplicationConfigurationTemplateRequest withDefaultLargeStagingDiskType(
            ReplicationConfigurationDefaultLargeStagingDiskType defaultLargeStagingDiskType) {
        this.defaultLargeStagingDiskType = defaultLargeStagingDiskType.toString();
        return this;
    }

    /**
     *

     * The type of EBS encryption to be used during replication.
     *

     *
     * @param ebsEncryption
     *        The type of EBS encryption to be used during replication.
     * @see ReplicationConfigurationEbsEncryption
     */

    public void setEbsEncryption(String ebsEncryption) {
        this.ebsEncryption = ebsEncryption;
    }

    /**
     *

     * The type of EBS encryption to be used during replication.
     *

     *
     * @return The type of EBS encryption to be used during replication.
     * @see ReplicationConfigurationEbsEncryption
     */

    public String getEbsEncryption() {
        return this.ebsEncryption;
    }

    /**
     *

     * The type of EBS encryption to be used during replication.
     *

     *
     * @param ebsEncryption
     *        The type of EBS encryption to be used during replication.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ReplicationConfigurationEbsEncryption
     */

    public CreateReplicationConfigurationTemplateRequest withEbsEncryption(String ebsEncryption) {
        setEbsEncryption(ebsEncryption);
        return this;
    }

    /**
     *

     * The type of EBS encryption to be used during replication.
     *

     *
     * @param ebsEncryption
     *        The type of EBS encryption to be used during replication.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ReplicationConfigurationEbsEncryption
     */

    public CreateReplicationConfigurationTemplateRequest withEbsEncryption(ReplicationConfigurationEbsEncryption ebsEncryption) {
        this.ebsEncryption = ebsEncryption.toString();
        return this;
    }

    /**
     *

     * The ARN of the EBS encryption key to be used during replication.
     *

     *
     * @param ebsEncryptionKeyArn
     *        The ARN of the EBS encryption key to be used during replication.
     */

    public void setEbsEncryptionKeyArn(String ebsEncryptionKeyArn) {
        this.ebsEncryptionKeyArn = ebsEncryptionKeyArn;
    }

    /**
     *

     * The ARN of the EBS encryption key to be used during replication.
     *

     *
     * @return The ARN of the EBS encryption key to be used during replication.
     */

    public String getEbsEncryptionKeyArn() {
        return this.ebsEncryptionKeyArn;
    }

    /**
     *

     * The ARN of the EBS encryption key to be used during replication.
     *

     *
     * @param ebsEncryptionKeyArn
     *        The ARN of the EBS encryption key to be used during replication.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withEbsEncryptionKeyArn(String ebsEncryptionKeyArn) {
        setEbsEncryptionKeyArn(ebsEncryptionKeyArn);
        return this;
    }

    /**
     *

     * The Point in time (PIT) policy to manage snapshots taken during replication.
     *

     *
     * @return The Point in time (PIT) policy to manage snapshots taken during replication.
     */

    public java.util.List<PITPolicyRule> getPitPolicy() {
        return pitPolicy;
    }

    /**
     *

     * The Point in time (PIT) policy to manage snapshots taken during replication.
     *

     *
     * @param pitPolicy
     *        The Point in time (PIT) policy to manage snapshots taken during replication.
     */

    public void setPitPolicy(java.util.Collection<PITPolicyRule> pitPolicy) {
        if (pitPolicy == null) {
            this.pitPolicy = null;
            return;
        }

        this.pitPolicy = new java.util.ArrayList<PITPolicyRule>(pitPolicy);
    }

    /**
     *

     * The Point in time (PIT) policy to manage snapshots taken during replication.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setPitPolicy(java.util.Collection)} or {@link #withPitPolicy(java.util.Collection)} if you want to
     * override the existing values.
     *

     *
     * @param pitPolicy
     *        The Point in time (PIT) policy to manage snapshots taken during replication.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withPitPolicy(PITPolicyRule... pitPolicy) {
        if (this.pitPolicy == null) {
            setPitPolicy(new java.util.ArrayList<PITPolicyRule>(pitPolicy.length));
        }
        for (PITPolicyRule ele : pitPolicy) {
            this.pitPolicy.add(ele);
        }
        return this;
    }

    /**
     *

     * The Point in time (PIT) policy to manage snapshots taken during replication.
     *

     *
     * @param pitPolicy
     *        The Point in time (PIT) policy to manage snapshots taken during replication.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withPitPolicy(java.util.Collection<PITPolicyRule> pitPolicy) {
        setPitPolicy(pitPolicy);
        return this;
    }

    /**
     *

     * The instance type to be used for the replication server.
     *

     *
     * @param replicationServerInstanceType
     *        The instance type to be used for the replication server.
     */

    public void setReplicationServerInstanceType(String replicationServerInstanceType) {
        this.replicationServerInstanceType = replicationServerInstanceType;
    }

    /**
     *

     * The instance type to be used for the replication server.
     *

     *
     * @return The instance type to be used for the replication server.
     */

    public String getReplicationServerInstanceType() {
        return this.replicationServerInstanceType;
    }

    /**
     *

     * The instance type to be used for the replication server.
     *

     *
     * @param replicationServerInstanceType
     *        The instance type to be used for the replication server.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withReplicationServerInstanceType(String replicationServerInstanceType) {
        setReplicationServerInstanceType(replicationServerInstanceType);
        return this;
    }

    /**
     *

     * The security group IDs that will be used by the replication server.
     *

     *
     * @return The security group IDs that will be used by the replication server.
     */

    public java.util.List<String> getReplicationServersSecurityGroupsIDs() {
        return replicationServersSecurityGroupsIDs;
    }

    /**
     *

     * The security group IDs that will be used by the replication server.
     *

     *
     * @param replicationServersSecurityGroupsIDs
     *        The security group IDs that will be used by the replication server.
     */

    public void setReplicationServersSecurityGroupsIDs(java.util.Collection<String> replicationServersSecurityGroupsIDs) {
        if (replicationServersSecurityGroupsIDs == null) {
            this.replicationServersSecurityGroupsIDs = null;
            return;
        }

        this.replicationServersSecurityGroupsIDs = new java.util.ArrayList<String>(replicationServersSecurityGroupsIDs);
    }

    /**
     *

     * The security group IDs that will be used by the replication server.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setReplicationServersSecurityGroupsIDs(java.util.Collection)} or
     * {@link #withReplicationServersSecurityGroupsIDs(java.util.Collection)} if you want to override the existing
     * values.
     *

     *
     * @param replicationServersSecurityGroupsIDs
     *        The security group IDs that will be used by the replication server.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withReplicationServersSecurityGroupsIDs(String... replicationServersSecurityGroupsIDs) {
        if (this.replicationServersSecurityGroupsIDs == null) {
            setReplicationServersSecurityGroupsIDs(new java.util.ArrayList<String>(replicationServersSecurityGroupsIDs.length));
        }
        for (String ele : replicationServersSecurityGroupsIDs) {
            this.replicationServersSecurityGroupsIDs.add(ele);
        }
        return this;
    }

    /**
     *

     * The security group IDs that will be used by the replication server.
     *

     *
     * @param replicationServersSecurityGroupsIDs
     *        The security group IDs that will be used by the replication server.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withReplicationServersSecurityGroupsIDs(
            java.util.Collection<String> replicationServersSecurityGroupsIDs) {
        setReplicationServersSecurityGroupsIDs(replicationServersSecurityGroupsIDs);
        return this;
    }

    /**
     *

     * The subnet to be used by the replication staging area.
     *

     *
     * @param stagingAreaSubnetId
     *        The subnet to be used by the replication staging area.
     */

    public void setStagingAreaSubnetId(String stagingAreaSubnetId) {
        this.stagingAreaSubnetId = stagingAreaSubnetId;
    }

    /**
     *

     * The subnet to be used by the replication staging area.
     *

     *
     * @return The subnet to be used by the replication staging area.
     */

    public String getStagingAreaSubnetId() {
        return this.stagingAreaSubnetId;
    }

    /**
     *

     * The subnet to be used by the replication staging area.
     *

     *
     * @param stagingAreaSubnetId
     *        The subnet to be used by the replication staging area.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withStagingAreaSubnetId(String stagingAreaSubnetId) {
        setStagingAreaSubnetId(stagingAreaSubnetId);
        return this;
    }

    /**
     *

     * A set of tags to be associated with all resources created in the replication staging area: EC2 replication
     * server, EBS volumes, EBS snapshots, etc.
     *

     *
     * @return A set of tags to be associated with all resources created in the replication staging area: EC2
     *         replication server, EBS volumes, EBS snapshots, etc.
     */

    public java.util.Map<String, String> getStagingAreaTags() {
        return stagingAreaTags;
    }

    /**
     *

     * A set of tags to be associated with all resources created in the replication staging area: EC2 replication
     * server, EBS volumes, EBS snapshots, etc.
     *

     *
     * @param stagingAreaTags
     *        A set of tags to be associated with all resources created in the replication staging area: EC2 replication
     *        server, EBS volumes, EBS snapshots, etc.
     */

    public void setStagingAreaTags(java.util.Map<String, String> stagingAreaTags) {
        this.stagingAreaTags = stagingAreaTags;
    }

    /**
     *

     * A set of tags to be associated with all resources created in the replication staging area: EC2 replication
     * server, EBS volumes, EBS snapshots, etc.
     *

     *
     * @param stagingAreaTags
     *        A set of tags to be associated with all resources created in the replication staging area: EC2 replication
     *        server, EBS volumes, EBS snapshots, etc.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withStagingAreaTags(java.util.Map<String, String> stagingAreaTags) {
        setStagingAreaTags(stagingAreaTags);
        return this;
    }

    /**
     * Add a single StagingAreaTags entry
     *
     * @see CreateReplicationConfigurationTemplateRequest#withStagingAreaTags
     * @returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest addStagingAreaTagsEntry(String key, String value) {
        if (null == this.stagingAreaTags) {
            this.stagingAreaTags = new java.util.HashMap<String, String>();
        }
        if (this.stagingAreaTags.containsKey(key))
            throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
        this.stagingAreaTags.put(key, value);
        return this;
    }

    /**
     * Removes all the entries added into StagingAreaTags.
     *
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest clearStagingAreaTagsEntries() {
        this.stagingAreaTags = null;
        return this;
    }

    /**
     *

     * A set of tags to be associated with the Replication Configuration Template resource.
     *

     *
     * @return A set of tags to be associated with the Replication Configuration Template resource.
     */

    public java.util.Map<String, String> getTags() {
        return tags;
    }

    /**
     *

     * A set of tags to be associated with the Replication Configuration Template resource.
     *

     *
     * @param tags
     *        A set of tags to be associated with the Replication Configuration Template resource.
     */

    public void setTags(java.util.Map<String, String> tags) {
        this.tags = tags;
    }

    /**
     *

     * A set of tags to be associated with the Replication Configuration Template resource.
     *

     *
     * @param tags
     *        A set of tags to be associated with the Replication Configuration Template resource.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }

    /**
     * Add a single Tags entry
     *
     * @see CreateReplicationConfigurationTemplateRequest#withTags
     * @returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest addTagsEntry(String key, String value) {
        if (null == this.tags) {
            this.tags = new java.util.HashMap<String, String>();
        }
        if (this.tags.containsKey(key))
            throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
        this.tags.put(key, value);
        return this;
    }

    /**
     * Removes all the entries added into Tags.
     *
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest clearTagsEntries() {
        this.tags = null;
        return this;
    }

    /**
     *

     * Whether to use a dedicated Replication Server in the replication staging area.
     *

     *
     * @param useDedicatedReplicationServer
     *        Whether to use a dedicated Replication Server in the replication staging area.
     */

    public void setUseDedicatedReplicationServer(Boolean useDedicatedReplicationServer) {
        this.useDedicatedReplicationServer = useDedicatedReplicationServer;
    }

    /**
     *

     * Whether to use a dedicated Replication Server in the replication staging area.
     *

     *
     * @return Whether to use a dedicated Replication Server in the replication staging area.
     */

    public Boolean getUseDedicatedReplicationServer() {
        return this.useDedicatedReplicationServer;
    }

    /**
     *

     * Whether to use a dedicated Replication Server in the replication staging area.
     *

     *
     * @param useDedicatedReplicationServer
     *        Whether to use a dedicated Replication Server in the replication staging area.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateReplicationConfigurationTemplateRequest withUseDedicatedReplicationServer(Boolean useDedicatedReplicationServer) {
        setUseDedicatedReplicationServer(useDedicatedReplicationServer);
        return this;
    }

    /**
     *

     * Whether to use a dedicated Replication Server in the replication staging area.
     *

     *
     * @return Whether to use a dedicated Replication Server in the replication staging area.
     */

    public Boolean isUseDedicatedReplicationServer() {
        return this.useDedicatedReplicationServer;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getAssociateDefaultSecurityGroup() != null)
            sb.append("AssociateDefaultSecurityGroup: ").append(getAssociateDefaultSecurityGroup()).append(",");
        if (getBandwidthThrottling() != null)
            sb.append("BandwidthThrottling: ").append(getBandwidthThrottling()).append(",");
        if (getCreatePublicIP() != null)
            sb.append("CreatePublicIP: ").append(getCreatePublicIP()).append(",");
        if (getDataPlaneRouting() != null)
            sb.append("DataPlaneRouting: ").append(getDataPlaneRouting()).append(",");
        if (getDefaultLargeStagingDiskType() != null)
            sb.append("DefaultLargeStagingDiskType: ").append(getDefaultLargeStagingDiskType()).append(",");
        if (getEbsEncryption() != null)
            sb.append("EbsEncryption: ").append(getEbsEncryption()).append(",");
        if (getEbsEncryptionKeyArn() != null)
            sb.append("EbsEncryptionKeyArn: ").append(getEbsEncryptionKeyArn()).append(",");
        if (getPitPolicy() != null)
            sb.append("PitPolicy: ").append(getPitPolicy()).append(",");
        if (getReplicationServerInstanceType() != null)
            sb.append("ReplicationServerInstanceType: ").append(getReplicationServerInstanceType()).append(",");
        if (getReplicationServersSecurityGroupsIDs() != null)
            sb.append("ReplicationServersSecurityGroupsIDs: ").append(getReplicationServersSecurityGroupsIDs()).append(",");
        if (getStagingAreaSubnetId() != null)
            sb.append("StagingAreaSubnetId: ").append(getStagingAreaSubnetId()).append(",");
        if (getStagingAreaTags() != null)
            sb.append("StagingAreaTags: ").append("***Sensitive Data Redacted***").append(",");
        if (getTags() != null)
            sb.append("Tags: ").append("***Sensitive Data Redacted***").append(",");
        if (getUseDedicatedReplicationServer() != null)
            sb.append("UseDedicatedReplicationServer: ").append(getUseDedicatedReplicationServer());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof CreateReplicationConfigurationTemplateRequest == false)
            return false;
        CreateReplicationConfigurationTemplateRequest other = (CreateReplicationConfigurationTemplateRequest) obj;
        if (other.getAssociateDefaultSecurityGroup() == null ^ this.getAssociateDefaultSecurityGroup() == null)
            return false;
        if (other.getAssociateDefaultSecurityGroup() != null
                && other.getAssociateDefaultSecurityGroup().equals(this.getAssociateDefaultSecurityGroup()) == false)
            return false;
        if (other.getBandwidthThrottling() == null ^ this.getBandwidthThrottling() == null)
            return false;
        if (other.getBandwidthThrottling() != null && other.getBandwidthThrottling().equals(this.getBandwidthThrottling()) == false)
            return false;
        if (other.getCreatePublicIP() == null ^ this.getCreatePublicIP() == null)
            return false;
        if (other.getCreatePublicIP() != null && other.getCreatePublicIP().equals(this.getCreatePublicIP()) == false)
            return false;
        if (other.getDataPlaneRouting() == null ^ this.getDataPlaneRouting() == null)
            return false;
        if (other.getDataPlaneRouting() != null && other.getDataPlaneRouting().equals(this.getDataPlaneRouting()) == false)
            return false;
        if (other.getDefaultLargeStagingDiskType() == null ^ this.getDefaultLargeStagingDiskType() == null)
            return false;
        if (other.getDefaultLargeStagingDiskType() != null && other.getDefaultLargeStagingDiskType().equals(this.getDefaultLargeStagingDiskType()) == false)
            return false;
        if (other.getEbsEncryption() == null ^ this.getEbsEncryption() == null)
            return false;
        if (other.getEbsEncryption() != null && other.getEbsEncryption().equals(this.getEbsEncryption()) == false)
            return false;
        if (other.getEbsEncryptionKeyArn() == null ^ this.getEbsEncryptionKeyArn() == null)
            return false;
        if (other.getEbsEncryptionKeyArn() != null && other.getEbsEncryptionKeyArn().equals(this.getEbsEncryptionKeyArn()) == false)
            return false;
        if (other.getPitPolicy() == null ^ this.getPitPolicy() == null)
            return false;
        if (other.getPitPolicy() != null && other.getPitPolicy().equals(this.getPitPolicy()) == false)
            return false;
        if (other.getReplicationServerInstanceType() == null ^ this.getReplicationServerInstanceType() == null)
            return false;
        if (other.getReplicationServerInstanceType() != null
                && other.getReplicationServerInstanceType().equals(this.getReplicationServerInstanceType()) == false)
            return false;
        if (other.getReplicationServersSecurityGroupsIDs() == null ^ this.getReplicationServersSecurityGroupsIDs() == null)
            return false;
        if (other.getReplicationServersSecurityGroupsIDs() != null
                && other.getReplicationServersSecurityGroupsIDs().equals(this.getReplicationServersSecurityGroupsIDs()) == false)
            return false;
        if (other.getStagingAreaSubnetId() == null ^ this.getStagingAreaSubnetId() == null)
            return false;
        if (other.getStagingAreaSubnetId() != null && other.getStagingAreaSubnetId().equals(this.getStagingAreaSubnetId()) == false)
            return false;
        if (other.getStagingAreaTags() == null ^ this.getStagingAreaTags() == null)
            return false;
        if (other.getStagingAreaTags() != null && other.getStagingAreaTags().equals(this.getStagingAreaTags()) == false)
            return false;
        if (other.getTags() == null ^ this.getTags() == null)
            return false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
            return false;
        if (other.getUseDedicatedReplicationServer() == null ^ this.getUseDedicatedReplicationServer() == null)
            return false;
        if (other.getUseDedicatedReplicationServer() != null
                && other.getUseDedicatedReplicationServer().equals(this.getUseDedicatedReplicationServer()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getAssociateDefaultSecurityGroup() == null) ? 0 : getAssociateDefaultSecurityGroup().hashCode());
        hashCode = prime * hashCode + ((getBandwidthThrottling() == null) ? 0 : getBandwidthThrottling().hashCode());
        hashCode = prime * hashCode + ((getCreatePublicIP() == null) ? 0 : getCreatePublicIP().hashCode());
        hashCode = prime * hashCode + ((getDataPlaneRouting() == null) ? 0 : getDataPlaneRouting().hashCode());
        hashCode = prime * hashCode + ((getDefaultLargeStagingDiskType() == null) ? 0 : getDefaultLargeStagingDiskType().hashCode());
        hashCode = prime * hashCode + ((getEbsEncryption() == null) ? 0 : getEbsEncryption().hashCode());
        hashCode = prime * hashCode + ((getEbsEncryptionKeyArn() == null) ? 0 : getEbsEncryptionKeyArn().hashCode());
        hashCode = prime * hashCode + ((getPitPolicy() == null) ? 0 : getPitPolicy().hashCode());
        hashCode = prime * hashCode + ((getReplicationServerInstanceType() == null) ? 0 : getReplicationServerInstanceType().hashCode());
        hashCode = prime * hashCode + ((getReplicationServersSecurityGroupsIDs() == null) ? 0 : getReplicationServersSecurityGroupsIDs().hashCode());
        hashCode = prime * hashCode + ((getStagingAreaSubnetId() == null) ? 0 : getStagingAreaSubnetId().hashCode());
        hashCode = prime * hashCode + ((getStagingAreaTags() == null) ? 0 : getStagingAreaTags().hashCode());
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
        hashCode = prime * hashCode + ((getUseDedicatedReplicationServer() == null) ? 0 : getUseDedicatedReplicationServer().hashCode());
        return hashCode;
    }

    @Override
    public CreateReplicationConfigurationTemplateRequest clone() {
        return (CreateReplicationConfigurationTemplateRequest) super.clone();
    }

}


text:
A small demo site for showing how to use npm as a build tool

This app has been built while going through the 'Introduction to npm as a Build Tool' course by Marcus Hammarberg on Pluralsight:
https://app.pluralsight.com/library/courses/npm-build-tool-introduction/table-of-contents

Run this to get up and running:

```
npm install
```

redpajama_set_name: RedPajamaGithub


text:
module Bundler
  module Plugin
    class Installer
      class Git < Bundler::Source::Git
        def cache_path
          @cache_path ||= begin
            git_scope = "#{base_name}-#{uri_hash}"

            Plugin.cache.join("bundler", "git", git_scope)
          end
        end

        def install_path
          @install_path ||= begin
            git_scope = "#{base_name}-#{shortref_for_path(revision)}"

            Plugin.root.join("bundler", "gems", git_scope)
          end
        end

        def version_message(spec)
          "#{spec.name} #{spec.version}"
        end

        def root
          Plugin.root
        end

        def generate_bin(spec, disable_extensions = false)
          # Need to find a way without code duplication
          # For now, we can ignore this
        end
      end
    end
  end
end


text:
cask 'retas-studio' do
  version '6.6.0'
  sha256 '387d299ac77dad4a4116605e492e7c69614c463cde2ce5df439caaa55c9befb5'

  # clip-studio.com was verified as official when first introduced to the cask
  url "https://www.clip-studio.com/clip_site/rental/rental_download/rsrental/dl?f=lib/retasstudio/data/#{version.delete('.')}/RS_#{version.delete('.')}_app.dmg"
  name 'RETAS STUDIO'
  homepage 'http://www.retasstudio.net/'
  license :commercial

  app 'RETAS STUDIO.app'
end


text:
// Copyright 2017 Jose Luis Rovira Martin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System.Collections.Generic;

namespace Essence.View.Models
{
    public static class ActionUtils
    {
        public static IEnumerable<IAction> Sort(IEnumerable<IAction> actions)
        {
            return actions;
        }

        public static void NotifyUpdateState(IAction accion)
        {
            if (accion is Action)
            {
                ((Action)accion).NotifyUpdateState();
            }
        }
    }
}


text:
package de.az.antlr.demo.calc;

import de.az.antlr.demo.parser.CalcParser;
import org.antlr.v4.runtime.tree.ParseTree;

import java.io.IOException;

import static de.az.antlr.demo.calc.CalcUtils.createParser;
import static de.az.antlr.demo.calc.CalcUtils.repl;
import static java.lang.String.format;

/**
 * Calculator that walks the parse tree.
 */
public class TreeWalkingCalculator {

    /**
     * Execute the REPL.
     *
     * @param argv command line arguments, ignored
     * @throws IOException if reading stdin or writing stdout fails
     */
    public static void main(String[] argv) throws IOException {
        repl(line -> eval(createParser(line).calc().expr()));
    }

    private static Integer eval(CalcParser.ExprContext ctx) {
        if (ctx.PLUS() != null) {
            return evalLeft(ctx) + evalRight(ctx);
        } else if (ctx.MINUS() != null) {
            return evalLeft(ctx) - evalRight(ctx);
        } else if (ctx.TIMES() != null) {
            return evalLeft(ctx) * evalRight(ctx);
        } else if (ctx.DIV() != null) {
            return evalLeft(ctx) / evalRight(ctx);
        } else if (ctx.number() != null) {
            return Integer.valueOf(ctx.getChild(0).getText());
        } else if (ctx.BR_OPEN() != null) {
            return eval((CalcParser.ExprContext) ctx.getChild(1));
        } else {
            throw new IllegalStateException(format("Unexpected expression variant in \"%s\"", ctx.getText()));
        }
    }

    private static Integer evalLeft(CalcParser.ExprContext ctx){
        return eval((CalcParser.ExprContext) ctx.getChild(0));
    }

    private static Integer evalRight(CalcParser.ExprContext ctx){
        return eval((CalcParser.ExprContext) ctx.getChild(2));
    }

}


text:
package com.andbase.db;

import android.content.Context;

import com.ab.db.orm.AbSDDBHelper;
import com.ab.util.AbFileUtil;
import com.andbase.demo.model.LocalUser;
import com.andbase.demo.model.Stock;
import com.andbase.friend.Friend;
import com.andbase.im.model.IMMessage;
import com.andbase.model.User;

public class DBSDHelper extends AbSDDBHelper {
	// 数据库名
	private static final String DBNAME = "andbasedemo.db";

    // 当前数据库的版本
	private static final int DBVERSION = 1;
	// 要初始化的表
	private static final Class<?>[] clazz = { User.class,LocalUser.class,Stock.class,Friend.class,IMMessage.class};

	public DBSDHelper(Context context) {
		super(context,AbFileUtil.getDbDownloadDir(context), DBNAME, null, DBVERSION, clazz);
	}

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Annls mycol. 38(2/4): 213 (1940)

#### Original name
Clypeotrabutia montserratis Chardón, 1930

### Remarks
null


text:
"""A tool to run croc to generate code coverage, executed by buildbot.

  When this is run, the current directory (cwd) should be the outer build
  directory (e.g., chrome-release/build/).

  For a list of command-line options, call this script with '--help'.
"""

import optparse
import os
import re
import shutil
import subprocess
import sys

from common import chromium_utils
from slave import build_directory

COVERAGE_DIR_POSTFIX = '_coverage'
COVERAGE_INFO = 'coverage.info'

def RunCroc(cov_files, cmdline):
  """Common main() routine.

  Args:
    cov_files: the coverage file we will be working with.
    cmdline: the command line to execute.
  """
  # Print some details which may help debugging.
  for cov_file in cov_files:
    try:
      print os.stat(cov_file)
    except (OSError, IOError), e:
      print 'Stat of %s failed. %s' % (cov_file, e)

  # Croc.
  print 'Running croc:', cmdline
  result = subprocess.call(cmdline)

  # Move aside the coverage file so a deps check always rebuilds it.
  for cov_file in cov_files:
    saved_name = cov_file + '.old'
    print 'Moving %s to %s (if possible)' % (cov_file, saved_name)
    if os.path.exists(saved_name):
      os.remove(saved_name)
    if os.path.exists(cov_file):
      shutil.move(cov_file, saved_name)

  return result

def CrocCommand(platform, cov_files, html_dir):
  cmdline = [
    sys.executable,
    'src/tools/code_coverage/croc.py',
    '-c', 'src/build/common.croc',
    '-c', 'src/build/%s/chrome_%s.croc' % (platform, platform),
    '-r', os.getcwd(),
    '--tree',
    '--html', html_dir]
  for cov_file in cov_files:
    cmdline += ['-i', cov_file]
  return cmdline

def ReplaceCoveragePath(cov_file, build_dir):
  """Replace the coverage path to this system 'src' directory."""
  src_dir = chromium_utils.AbsoluteCanonicalPath(
      os.path.join(build_dir, '..'))
  src_dir = os.path.normpath(src_dir)

  input_file = open(cov_file)
  cov_lines = input_file.readlines()
  input_file.close()

  fhandler = open(cov_file, 'w')
  for line in cov_lines:
    line = re.sub(r'SF:.*[\\/]src[\\/]', 'SF:%s/' % src_dir, line, 1)
    line = line.replace('\\', '/')
    fhandler.write(line)
  fhandler.close()

def FetchCoverageFiles(options):
  """Fetch coverage files from www dir to be processed."""
  target_dir = os.path.join(options.build_dir, options.target)
  for test in options.tests:
    cov_dir = test.replace('_', '') + COVERAGE_DIR_POSTFIX
    output_path = os.path.join(target_dir, cov_dir)
    chromium_utils.MaybeMakeDirectory(output_path)
    cov_src = ('/%s/%s/%s/%s/' % (options.upload_dir, options.platform,
                                  options.build_id, cov_dir))
    if options.sharded_tests and test in options.sharded_tests:
      # Copy all Lvoc files.
      for shard_count in xrange(1, options.browser_total_shards + 1):
        src = cov_src + 'coverage_%s.info' % shard_count
        chromium_utils.CopyFileToDir(src, output_path)
    else:
      chromium_utils.CopyFileToDir(cov_src + COVERAGE_INFO, output_path)

def ProcessCoverage(options, args):
  """Print appropriate size information about built Windows targets.

  Returns the first non-zero exit status of any command it executes,
  or zero on success.
  """
  # Fetch coverage from archive if we're running sharded tests.
  if options.browser_total_shards:
    FetchCoverageFiles(options)

  # Process total coverage.
  coverage_dirs = [x.replace('_', '') + COVERAGE_DIR_POSTFIX for x in
                   options.tests]
  target_dir = os.path.join(options.build_dir, options.target)
  cov_files = []
  for cov in coverage_dirs:
    cov_dir = os.path.join(target_dir, cov)
    if os.path.exists(cov_dir):
      print cov + ' directory exists.'
      for fname in os.listdir(cov_dir):
        if fname.endswith('.info'):
          cov_file = os.path.join(cov_dir, fname)
          cov_files.append(cov_file)
          ReplaceCoveragePath(cov_file, options.build_dir)

  if cov_files:
    total_coverage = os.path.join(target_dir, 'total_coverage')
    chromium_utils.MaybeMakeDirectory(total_coverage)
    html_dir = os.path.join(total_coverage, 'coverage_croc_html')
    cmdline = CrocCommand(options.platform, cov_files, html_dir)
    return RunCroc(cov_files, cmdline)
  else:
    print 'No coverage files found.'
    return 1

def main():
  if sys.platform in ('win32', 'cygwin'):
    default_platform = 'win'
  elif sys.platform.startswith('darwin'):
    default_platform = 'mac'
  elif sys.platform == 'linux2':
    default_platform = 'linux'
  else:
    default_platform = None

  platforms = ['linux', 'mac', 'win']

  option_parser = optparse.OptionParser()
  option_parser.add_option('--target',
                           default='Debug',
                           help='build target (Debug, Release) '
                                '[default: %default]')
  option_parser.add_option('--build-dir', help='ignored')
  option_parser.add_option('--platform',
                           default=default_platform,
                           help='specify platform (%s) [default: %%default]'
                                % ', '.join(platforms))
  option_parser.add_option('--build-id',
                           help='The build number of the tested build.')
  option_parser.add_option('--upload-dir',
                           help='Path coverage file was uploaded to.')

  chromium_utils.AddPropertiesOptions(option_parser)
  options, args = option_parser.parse_args()
  options.build_dir = build_directory.GetBuildOutputDirectory()

  fp = options.factory_properties
  options.tests = fp.get('tests')
  options.sharded_tests = fp.get('sharded_tests')
  options.browser_total_shards = fp.get('browser_total_shards')
  del options.factory_properties
  del options.build_properties

  if options.platform not in platforms:
    sys.stderr.write('Unsupported sys.platform %s.\n' % repr(sys.platform))
    msg = 'Use the --platform= option to specify a supported platform:\n'
    sys.stderr.write(msg + '    ' + ' '.join(platforms) + '\n')
    return 2
  return ProcessCoverage(options, args)

if '__main__' == __name__:
  sys.exit(main())


text:
require 'rails/generators/rails/scaffold_controller/scaffold_controller_generator'

# override rails genarator to switch template directory
module Rails
  module Generators
    class ActionArgsScaffoldControllerGenerator < ::Rails::Generators::ScaffoldControllerGenerator
      argument :attributes, type: :array, default: [], banner: 'field:type field:type'
      source_root File.expand_path('../templates', __FILE__)
    end
  end
end


text:
Optical character recognition for node.js

## Installation

```sh
npm install ocr
```

## Synopsis

```js
ocr
.language('arabic', 'french')
.recognize(path_to_image, function(err, text){
	if ( err ) {
        console.error(err);
    } else {
        console.log(text);
    }
});
```

## Usage

### Custom Font-face

Define a custom font-face of a certain language to improve the accuracy.

```js
ocr
.language('chinese')
.fontFace(path_to_font_file)
.recognize(path_to_image, callback)
```


text:
package com.martensigwart.fakeload.util;

public final class Decrease extends Instruction {

    public Decrease(LoadType loadType, int offSet, long change) {
        super(loadType, offSet, change);
    }

}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

			<title>Docs For Class Zend_Gdata_Calendar_EventQuery</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />

 Zend_Gdata_Calendar_EventQuery

Description

					Description |
													Vars (details)
						|											Methods (details)

											Constants (details)

Assists in constructing queries for Google Calendar events

copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)

link: http://code.google.com/apis/gdata/calendar/

license: New BSD License

			Located in /Gdata/Calendar/EventQuery.php (line 45)

Zend_Gdata_Query
   |
   --Zend_Gdata_Calendar_EventQuery

Class Constant Summary

			Description |
						Constants (details)
												Vars (details)

				|
										|
									Methods (details)

					CALENDAR_FEED_URI = 					 'http://www.google.com/calendar/feeds'

Variable Summary

			Description |
						Vars (details)
							|
									Methods (details)

															Constants (details)

					mixed
					$_comments

					mixed
					$_defaultFeedUri

					mixed
					$_event

					mixed
					$_projection

					mixed
					$_user

					mixed
					$_visibility

Method Summary

			Description |
															Constants (details)

															Vars (details)

				|
						Methods (details)

											Zend_Gdata_Calendar_EventQuery
										__construct
											([string $url = null])

											string
										getComments
										()

											string
										getEvent
										()

											string
										getFutureEvents
										()

											string
										getOrderBy
										()

											string
										getProjection
										()

											string
										getQueryUrl
										()

											string
										getRecurrenceExpansionEnd
										()

											string
										getRecurrenceExpansionStart
										()

											Zend_Gdata_Calendar_EventQuery
										getSingleEvents
											(string $value)

											string
										getSortOrder
										()

											int
										getStartMax
										()

											int
										getStartMin
										()

											string
										getUser
										()

											string
										getVisibility
										()

											Zend_Gdata_Calendar_EventQuery
										setComments
											(string $value)

											Zend_Gdata_Calendar_EventQuery
										setEvent
											(string $value)

											Zend_Gdata_Calendar_EventQuery
										setFutureEvents
											(string $value)

											Zend_Gdata_Calendar_EventQuery
										setOrderBy
											(string $value)

											Zend_Gdata_Calendar_EventQuery
										setProjection
											(string $value)

											string
										setRecurrenceExpansionEnd
											( $value)

											string
										setRecurrenceExpansionStart
											( $value)

											Zend_Gdata_Calendar_EventQuery
										setSingleEvents
											(string $value)

											string
										setSortOrder
											( $value)

											Zend_Gdata_Calendar_EventQuery
										setStartMax
											(int $value)

											Zend_Gdata_Calendar_EventQuery
										setStartMin
											(int $value)

											Zend_Gdata_Calendar_EventQuery
										setUser
											(string $value)

											Zend_Gdata_Calendar_EventQuery
										setVisibility
											(bool $value)

Variables

			Description |
										Vars (details)

												Constants (details)

										|
									Methods (details)

			mixed
			$_comments
			 =  null			(line 60)

The comment ID to retrieve. If null, no specific comment will be  retrieved unless already included in the query URI. The event ID  ($_event) must be set, otherwise this property is ignored.

access: protected

			mixed
			$_defaultFeedUri
			 =  self::CALENDAR_FEED_URI			(line 53)

The default URI used for feeds.

access: protected

Redefinition of:

Zend_Gdata_Query::$_defaultFeedUri

Default URL

			mixed
			$_event
			 =  null			(line 89)

The event ID to retrieve. If null, no specific event will be retrieved  unless already included in the query URI.

access: protected

			mixed
			$_projection
			 =  'full'			(line 83)

Projection to be requested by queries. Defaults to "full". A null value  should be used when the calendar address has already been set as part  of the query URI.

access: protected

			mixed
			$_user
			 =  'default'			(line 69)

The calendar address to be requested by queries. This may be an email

address if requesting the primary calendar for a user. Defaults to  "default" (the currently authenticated user). A null value should be  used when the calendar address has already been set as part of the  query URI.

access: protected

			mixed
			$_visibility
			 =  'public'			(line 76)

access: protected

Inherited Variables

Inherited from Zend_Gdata_Query

								Zend_Gdata_Query::$_category

								Zend_Gdata_Query::$_params

								Zend_Gdata_Query::$_url

Methods

			Description |
															Vars (details)
																			Constants (details)

										Methods (details)

		Constructor __construct (line 105)

Create Gdata_Calendar_EventQuery object.  If a URL is provided,

it becomes the base URL, and additional URL components may be  appended.  For instance, if $url is 'http://www.google.com/calendar',  the default URL constructed will be  'http://www.google.com/calendar/default/public/full'.

If the URL already contains a calendar ID, projection, visibility,  event ID, or comment ID, you will need to set these fields to null  to prevent them from being inserted. See this class's properties for  more information.

access: public

		Zend_Gdata_Calendar_EventQuery

			__construct

					([string $url = null])

				string
				$url: The URL to use as the base path for requests

Redefinition of:

Zend_Gdata_Query::__construct()

Create Gdata_Query object

		getComments (line 169)

return: comments

see: $_comments;

access: public

		string

			getComments

				()

		getEvent (line 178)

return: event

see: $_event;

access: public

		string

			getEvent

				()

		getFutureEvents (line 416)

return: futureevents

access: public

		string

			getFutureEvents

				()

		getOrderBy (line 279)

return: orderby

access: public

		string

			getOrderBy

				()

		getProjection (line 187)

return: projection

see: Zend_Gdata_Calendar_EventQuery::$_projection

access: public

		string

			getProjection

				()

		getQueryUrl (line 465)

return: url

access: public

		string

			getQueryUrl

				()

Redefinition of:

Zend_Gdata_Query::getQueryUrl()

		getRecurrenceExpansionEnd (line 342)

return: recurrence-expansion-end

access: public

		string

			getRecurrenceExpansionEnd

				()

		getRecurrenceExpansionStart (line 316)

return: recurrence-expansion-start

access: public

		string

			getRecurrenceExpansionStart

				()

		getSingleEvents (line 368)

return: Provides a fluent interface

access: public

		Zend_Gdata_Calendar_EventQuery

			getSingleEvents

					(string $value)

				string
				$value: Also accepts bools.

		getSortOrder (line 291)

return: sortorder

access: public

		string

			getSortOrder

				()

		getStartMax (line 255)

return: start-max

access: public

		int

			getStartMax

				()

		getStartMin (line 267)

return: start-min

access: public

		int

			getStartMin

				()

		getUser (line 196)

return: user

see: Zend_Gdata_Calendar_EventQuery::$_user

access: public

		string

			getUser

				()

		getVisibility (line 205)

return: visibility

see: Zend_Gdata_Calendar_EventQuery::$_visibility

access: public

		string

			getVisibility

				()

		setComments (line 115)

return: Provides a fluent interface

see: Zend_Gdata_Calendar_EventQuery::$_comments

access: public

		Zend_Gdata_Calendar_EventQuery

			setComments

					(string $value)

				string
				$value

		setEvent (line 126)

return: Provides a fluent interface

see: Zend_Gdata_Calendar_EventQuery::$_event

access: public

		Zend_Gdata_Calendar_EventQuery

			setEvent

					(string $value)

				string
				$value

		setFutureEvents (line 443)

return: Provides a fluent interface

access: public

		Zend_Gdata_Calendar_EventQuery

			setFutureEvents

					(string $value)

				string
				$value: Also accepts bools. If using a string, must be either "true" or "false" or                       an exception will be thrown on retrieval.

		setOrderBy (line 242)

return: Provides a fluent interface

access: public

		Zend_Gdata_Calendar_EventQuery

			setOrderBy

					(string $value)

				string
				$value

		setProjection (line 137)

return: Provides a fluent interface

see: Zend_Gdata_Calendar_EventQuery::$_projection

access: public

		Zend_Gdata_Calendar_EventQuery

			setProjection

					(string $value)

				string
				$value

		setRecurrenceExpansionEnd (line 354)

return: recurrence-expansion-end

access: public

		string

			setRecurrenceExpansionEnd

					( $value)

				$value

		setRecurrenceExpansionStart (line 328)

return: recurrence-expansion-start

access: public

		string

			setRecurrenceExpansionStart

					( $value)

				$value

		setSingleEvents (line 394)

return: Provides a fluent interface

access: public

		Zend_Gdata_Calendar_EventQuery

			setSingleEvents

					(string $value)

				string
				$value: Also accepts bools. If using a string, must be either "true" or "false".

		setSortOrder (line 303)

return: sortorder

access: public

		string

			setSortOrder

					( $value)

				$value

		setStartMax (line 214)

return: Provides a fluent interface

access: public

		Zend_Gdata_Calendar_EventQuery

			setStartMax

					(int $value)

				int
				$value

		setStartMin (line 228)

return: Provides a fluent interface

access: public

		Zend_Gdata_Calendar_EventQuery

			setStartMin

					(int $value)

				int
				$value

		setUser (line 148)

return: Provides a fluent interface

see: Zend_Gdata_Calendar_EventQuery::$_user

access: public

		Zend_Gdata_Calendar_EventQuery

			setUser

					(string $value)

				string
				$value

		setVisibility (line 159)

return: Provides a fluent interface

see: Zend_Gdata_Calendar_EventQuery::$_visibility

access: public

		Zend_Gdata_Calendar_EventQuery

			setVisibility

					(bool $value)

				bool
				$value

Inherited Methods

Inherited From Zend_Gdata_Query

							Zend_Gdata_Query::__construct()

							Zend_Gdata_Query::getAlt()

							Zend_Gdata_Query::getAuthor()

							Zend_Gdata_Query::getCategory()

							Zend_Gdata_Query::getMaxResults()

							Zend_Gdata_Query::getParam()

							Zend_Gdata_Query::getPublishedMax()

							Zend_Gdata_Query::getPublishedMin()

							Zend_Gdata_Query::getQuery()

							Zend_Gdata_Query::getQueryString()

							Zend_Gdata_Query::getQueryUrl()

							Zend_Gdata_Query::getStartIndex()

							Zend_Gdata_Query::getUpdatedMax()

							Zend_Gdata_Query::getUpdatedMin()

							Zend_Gdata_Query::resetParameters()

							Zend_Gdata_Query::setAlt()

							Zend_Gdata_Query::setAuthor()

							Zend_Gdata_Query::setCategory()

							Zend_Gdata_Query::setMaxResults()

							Zend_Gdata_Query::setParam()

							Zend_Gdata_Query::setPublishedMax()

							Zend_Gdata_Query::setPublishedMin()

							Zend_Gdata_Query::setQuery()

							Zend_Gdata_Query::setStartIndex()

							Zend_Gdata_Query::setUpdatedMax()

							Zend_Gdata_Query::setUpdatedMin()

							Zend_Gdata_Query::__get()

							Zend_Gdata_Query::__set()

Class Constants

			Description |
										Constants (details)

												Vars (details)
														|
									Methods (details)

			CALENDAR_FEED_URI
			 =  'http://www.google.com/calendar/feeds'
			(line 48)

		Documentation generated on Wed, 25 Aug 2010 03:43:49 +0400 by phpDocumentor 1.4.2


text:
layout: default
title: Policies & Programs
attribution: Header image by Daniel Schwen (Own work) [GFDL](http://www.gnu.org/copyleft/fdl.html) or [CC-BY-SA-3.0](http://creativecommons.org/licenses/by-sa/3.0/), via Wikimedia Commons
---

Housing policies and programs can have different income requirements and focus areas. The two frames below provide ways to group housing programs.

Income Eligibility

60%

No AMI Eligibility

                0%

                120%

Housing programs often use percent of "Area Median Income" (AMI) to determine eligibility. What is AMI? The filled bar indicates the maximum AMI that the program covers. Please note that some programs have various eligibility requirements and this is only a summary view.

People or Housing Units

Programs that assist individuals or families try to increase their ability to obtain or maintain housing. Programs that focus on units try to maintain or increase the "supply" of affordable housing. Icons indicate whether people or units are the target of the program.

{% assign sorted_posts = (site.posts | sort: 'order') %}
{% assign i = 0 %}
{% for post in sorted_posts %}
{% assign postdir = post.path | split:"/" %}
{% if postdir[0] == 'policies'%}
{% assign i = i | plus:1 %}
{% assign remainder = i | modulo:2 %}
{% if remainder == 1 %}

{% endif %}

            {{post.title}}

            {{post.summary}}

{{post.ami}}%

No AMI Eligibility

              0%

              120%

{% if remainder == 0 %}

{% endif %}
{% endif %}
{% endfor %}


text:
/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2017 socraticphoenix@gmail.com
 * Copyright (c) 2017 contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
 * associated documentation files (the "Software"), to deal in the Software without restriction,
 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
 * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
package com.gmail.socraticphoenix.shnap.type.natives.num;

import com.gmail.socraticphoenix.collect.Items;
import com.gmail.socraticphoenix.shnap.parse.ShnapLoc;
import com.gmail.socraticphoenix.shnap.program.context.ShnapExecution;
import com.gmail.socraticphoenix.shnap.type.natives.ShnapNativeTypeDescriptor;
import com.gmail.socraticphoenix.shnap.type.natives.ShnapNativeTypeRegistry;
import com.gmail.socraticphoenix.shnap.type.natives.ShnapStringNative;
import com.gmail.socraticphoenix.shnap.type.object.ShnapObject;
import com.gmail.socraticphoenix.shnap.util.ShnapFactory;

import java.math.BigInteger;

import static com.gmail.socraticphoenix.shnap.util.ShnapFactory.inst;
import static com.gmail.socraticphoenix.shnap.util.ShnapFactory.instSimple;
import static com.gmail.socraticphoenix.shnap.util.ShnapFactory.noArg;
import static com.gmail.socraticphoenix.shnap.util.ShnapFactory.param;

public class ShnapBooleanNative extends ShnapObject implements ShnapNumberNative {
    public static final ShnapBooleanNative TRUE = new ShnapBooleanNative(ShnapLoc.BUILTIN, true);
    public static final ShnapBooleanNative FALSE = new ShnapBooleanNative(ShnapLoc.BUILTIN, false);

    private Boolean value;

    private ShnapBooleanNative(ShnapLoc loc, Boolean value) {
        super(loc, "bool");
        this.value = value;
        ShnapNumberNative.implementFunctions(this, this);
        this.set(ShnapObject.AS_STRING, ShnapFactory.noArg(instSimple(() -> new ShnapStringNative(this.getLocation(), String.valueOf(this.value)))));
        this.set("and", ShnapFactory.func(
                Items.buildList(param("arg"), param("order", ShnapNumberNative.ONE)),
                inst((ctx, trc) -> {
                    int order = 1;
                    if (ctx.directlyContains("order")) {
                        ShnapExecution ord = ctx.get("order", trc).mapIfNormal(e -> e.getValue().asNum(trc));
                        if (ord.isAbnormal()) {
                            return ord;
                        } else {
                            order = ((ShnapNumberNative) ord.getValue()).getNumber().intValue();
                        }
                    }

                    return ctx.get("arg", trc).mapIfNormal(e -> e.getValue().asBool(trc).mapIfNormal(be -> {
                        boolean other = ((ShnapBooleanNative) be.getValue()).getValue();
                        return ShnapExecution.normal(ShnapBooleanNative.of(this.value && other), trc, this.getLocation());
                    }));
                })
        ));
        this.set("or", ShnapFactory.func(
                Items.buildList(param("arg"), param("order", ShnapNumberNative.ONE)),
                inst((ctx, trc) -> {
                    int order = 1;
                    if (ctx.directlyContains("order")) {
                        ShnapExecution ord = ctx.get("order", trc).mapIfNormal(e -> e.getValue().asNum(trc));
                        if (ord.isAbnormal()) {
                            return ord;
                        } else {
                            order = ((ShnapNumberNative) ord.getValue()).getNumber().intValue();
                        }
                    }

                    return ctx.get("arg", trc).mapIfNormal(e -> e.getValue().asBool(trc).mapIfNormal(be -> {
                        boolean other = ((ShnapBooleanNative) be.getValue()).getValue();
                        return ShnapExecution.normal(ShnapBooleanNative.of(this.value || other), trc, this.getLocation());
                    }));
                })
        ));
        this.set("not", noArg(instSimple(() -> ShnapBooleanNative.of(!this.value))));
    }

    @Override
    public Number getNumber() {
        return this.value ? BigInteger.ONE : BigInteger.ZERO;
    }

    @Override
    public ShnapObject copyWith(Number n) {
        if (n.doubleValue() == 0) {
            return FALSE;
        } else if (n.doubleValue() == 1) {
            return TRUE;
        }

        return ShnapNumberNative.valueOf(n);
    }

    @Override
    public int castingPrecedence(Number result) {
        return 0;
    }

    public boolean getValue() {
        return this.value;
    }

    public static ShnapBooleanNative of(boolean b) {
        return b ? ShnapBooleanNative.TRUE : ShnapBooleanNative.FALSE;
    }

    @Override
    public Object getJavaBacker() {
        return this.value;
    }

    @Override
    public ShnapNativeTypeDescriptor descriptor() {
        return ShnapNativeTypeRegistry.Descriptor.BOOLEAN;
    }

}


text:
classdef TrialTrackingInstruction < WBTrial

    methods
        function start(this)
            roundn = this.flow.variable(['Block0-RoundNum']);

            % CREATE THE INSTRUCTION SCREEN
            ti = WBTextDisplay('TRACKING TEXT', '', 26);
            %ti.xLoc = 50;
            if (roundn == 0)
                ti.text = {'Now you will practice the dot tracking task.' ...
                           'Your goal is to keep the circle on top of the moving dot.' ...
                           'This is done with the U and I keys. By pressing U you push the dot to the left, and' ...
                           'by pressing I you push the dot to the right.' ...
                           'If the circle goes outside the two moving lines surrounding the dot, it will be too far away,' ...
                           'and the lines will turn red.' ...
                           '' ...
                           'Press Q'};
            else
                ti.text = {'Practice: Tracking' ...
                            };

            end

            this.design.buildScene('TRACKING INSTRUCTIONS', {ti}, '1');

            this.design.loadScene('TRACKING INSTRUCTIONS');
            this.design.findTask('TRACKING TEXT').start();
        end

        function update(this)
            roundn = this.flow.variable(['Block0-RoundNum']);
            if (roundn > 0)
                if (GetSecs - this.startTime > 2)
                    this.flow.trial = TrialTrackingPrac;
                end
            else
                if (this.design.newEvents())
                    e = this.design.findEvents('TRACKING TEXT:keyPressed');

                    if (~isempty(e))
                        key = lower(e{1}.measure('key'));
                        if (strcmp('return', key) | strcmp('q', key))
                            % start practice block
                            this.flow.trial = TrialTrackingPrac;
                        end
                    end
                end
            end

        end
    end
end


text:
/**
 * A module for creating clocks. The core module is simply a constructor that
 * provides a method of receiving a notification roughly every second.
 * @module clock
 */

// There is no integer type, so create one for documentation purposes
type integer = number;

/**
 * An interval of time - sort of like a `Date()` but for different
 * periods of time. Given a number of milliseconds, this calculates the number
 * of weeks, days, hours, minutes, and seconds between the two. Useful for
 * creating a countdown to a given time.
 */
export class Interval {
	/**
	 * Indicates that the interval occurred in the past.
	 */
	isInPast: boolean;
	/**
	 * The number of weeks in the interval. There are no larger spans of time
	 * calculated at present. Months make no sense at this level: how long is a
	 * month? 28 days? Depends on when the interval starts? Years may be added
	 * in the future, but years have a similar problem: How long is a year?
	 * 365 days? What about leap years?
	 */
	weeks: integer = 0;
	/**
	 * The number of days in the interval. For a 10 day interval, this is 3 and
	 * {@linkcode module:timer.Interval#weeks weeks} will be 1.
	 */
	days: integer = 0;
	/**
	 * The number of hours in the interval. For a 1.5 day interval, this is 12.
	 */
	hours: integer = 0;
	/**
	 * The number of minutes in the interval. For a 90 minute interval, this is
	 * 30.
	 */
	minutes: integer = 0;
	/**
	 * The number of milliseconds in the interval. For a 1500ms interval, this
	 * is 500. This is almost never useful but is included anyway.
	 */
	millis: integer;
	/**
	 * The number of seconds in the interval. For a 90 second interval, this is
	 * 30.
	 */
	seconds: integer = 0;
	/**
	 *
	 * @param {Number} interval
	 *         the initial interval in milliseconds
	 * @param {integer|boolean} periods
	 *         number of periods to split the interval into. Defaults to 5:
	 *         include weeks, days, hours, minutes, seconds. Milliseconds is always
	 *         included and values less than 1 are treated as seconds. Decrease
	 *         to reduce the number of fields in that order: 4 omits weeks,
	 *         3 will only return hours, minute, and seconds, etc. `false`
	 *         can be used as a "shortcut" for 4 to treat the parameter as
	 *         "include weeks". Note that the fields not calculated will still be
	 *         present, they'll just be set to 0.
	 */
	constructor(interval: number, periods?: number | boolean) {
		if (arguments.length < 2 || periods === true) {
			periods = 5;
		} else if (periods === false) {
			periods = 4;
		}
		// Step 0: Deal with negative intervals. Intervals only make sense using
		// positive numbers, but include a flag if it's in the past.
		this.isInPast = interval < 0;
		// And make it absolute.
		interval = Math.abs(interval);
		// Step 1: convert to seconds.
		let t = Math.floor(interval / 1000); // 1000 ms = 1 seconds
		this.millis = (interval - (t * 1000));
		if (periods < 2) {
			this.seconds = t;
			return;
		}
		this.seconds = t % 60; // 60 seconds = 1 minute
		t = Math.floor(t / 60);
		if (periods < 3) {
			this.minutes = t;
			return;
		}
		this.minutes = t % 60; // 60 minutes = 1 hour
		t = Math.floor(t / 60);
		if (periods < 4) {
			this.hours = t;
			return;
		}
		this.hours = t % 24; // 24 hours = 1 day
		t = Math.floor(t / 24);
		if (periods < 5) {
			this.days = t;
			return;
		}
		this.days = t % 7; // 7 days = 1 week
		this.weeks = Math.floor(t / 7); // And enough
	}
	toString(): string {
		return '[' + this.weeks + ' weeks ' + this.days + ' days ' + this.hours +
			' hours ' + this.minutes + ' minutes ' + this.seconds + ' seconds]';
	}
};

/**
 * Very basic clock object that receives tick notifications ever second.
 * Override ontick to receive the notification.
 * @constructor
 * @alias module:clock
 */
export class Clock {
	timeout: number | boolean = false;
	/**
	 * The offset in milliseconds from real time to use to send to the clock. This
	 * can be used if you want to make a clock that displays ticks based on when
	 * a user clicked the button (by setting it to the number of milliseconds off
	 * the second) or to make a clock that displays a certain amount of time in
	 * the future or past. Changing this will take effect on the *next* tick.
	 *
	 * The offset is added to the time - positive offsets move the values given by
	 * {@link module:clock#ontick ontick()} into the future, negative values move
	 * it into the past.
	 *
	 * Changing this enough to make a tick appear in the past will also trigger an
	 * {@link module:clock#onbackwards onbackwards()} call, just as if the clock
	 * had moved backwards due to external causes.
	 */
	offset = 0;
	/**
	 * Whether or not the clock is still running.
	 *
	 * If set, starts or stops the clock by using
	 * {@link module:clock#start start()} or {@link module:clock#stop stop()} as
	 * appropriate.
	 */
	get running(): boolean {
		return this.timeout !== false;
	}
	set running(value: boolean) {
		if (value) {
			this.start();
		} else {
			this.stop();
		}
	}
	/**
	 * Start the clock. {@link module:clock#ontick ontick()} will be invoked
	 * nearly immediately with the current time and then invoked every second.
	 */
	start(): void {
		if (this.timeout === false) {
			// I suppose lastTime could also be set to 0 on the assumption that no one
			// is going to be running with a clock set to 1970 Jan 1, but... whatever.
			// Go ahead and support weird time travelers.
			let lastTime = new Date().getTime() - 1000;
			this.timeout = true;
			const tick = () => {
				var now = new Date();
				// Round now up, as the timeout may be called slightly early.
				var t = now.getTime() + this.offset + 500;
				// And chop off the uneven milliseconds - useful for countdown
				// timers.
				t -= t % 1000;
				now.setTime(t);
				if (t < lastTime) {
					// Clock has run backwards.
					this.onbackwards(now);
				}
				lastTime = t;
				this.ontick(now);
				var next = 1000 - ((new Date().getTime() + this.offset) % 1000);
				if (next < 50) {
					// If it's really close, just jump to the next second, as we'll
					// have "rounded" to this second anyway.
					next += 1000;
				}
				// We need to check if we're still going, as stop() may have
				// stopped the timeout.
				if (this.timeout !== false)
					this.timeout = window.setTimeout(tick, next);
			}
			tick();
		}
	}
	/**
	 * Stops the clock. No further {@link module:clock#ontick ontick()}s will
	 * be called until the clock is restarted using
	 * {@linkcode module:clock#start start()}.
	 */
	stop(): void {
		if (this.timeout !== false) {
			// Timeout may be true if the clock was started but instantly stopped in ontick.
			if (typeof this.timeout === 'number')
				clearTimeout(this.timeout);
			this.timeout = false;
		}
	}
	/**
	 * Called once a second with the current time.
	 *
	 * Note that the `Date` object given is the time that the clock is being
	 * "ticked" for, and is **not** going to be the exact same time that
	 * `new Date()` would generate. This is because JavaScript engines may call a
	 * callback set by `setTimeout()` or `setInterval()` slightly early or
	 * slightly late. This class deals with that by rounding to the nearest
	 * second and then passing that rounded time to this function.
	 *
	 * If {@link module:clock#offset} is non-zero, the `Date` given will be
	 * adjusted by that.
	 *
	 * The default implementation does nothing.
	 *
	 * @param date {Date} the current time.
	 */
	ontick(date: Date): void {
		// Stub method: does nothing
	}
	/**
	 * Generally speaking it can be assumed that ticks will only ever increase the
	 * current time. This does not need to be true: it is possible for the clock
	 * to run "backwards." The most likely cause is the clock being fast and the
	 * user correcting it or the clock be synced to an NTP server.
	 *
	 * Changing over to Daylight Saving Time will **not** trigger this callback,
	 * it's only used when an {@link module:clock#ontick ontick()} would have
	 * triggered for an earlier time than a previous one.
	 *
	 * Not all clocks need to handle this case, however some clocks may be written
	 * in such a way that elements that happened "in the past" are removed and may
	 * suddenly be required again.
	 *
	 * The default implementation does nothing.
	 *
	 * @param date {Date} the current time, as would have been passed to
	 *   {@code ontick}.
	 */
	onbackwards(date: Date): void {
		// Stub method: does nothing
	}

	/**
	 * Utility function to 0-pad a two-digit number, since this comes up so often.
	 * This will only add a 0 in front of a single digit number and only works with
	 * positive numbers.
	 * @param {number} d digit
	 */
	static zeropad(d: number): string {
		return d < 10 ? '0' + d : d.toString();
	}

	/**
	 * Returns an interval between two dates.
	 *
	 * @param {Date} firstDate the first date
	 * @param {Date} secondDate the second date
	 * @return {Timer.Interval} interval between the two.
	 */
	static difference(firstDate, secondDate) {
		if (firstDate instanceof Date)
			firstDate = firstDate.getTime();
		if (secondDate instanceof Date)
			secondDate = secondDate.getTime();
		return new Interval(firstDate - secondDate);
	}

	static Interval = Interval;
}

export default Clock;


text:
package com.cc.jcg;

import java.io.File;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import com.cc.jcg.tools.EncodedFileReader;

public final class MJavaFile
	implements MType, MCode<MJavaFile>, MHasImports {

    private final MPackage pckg;
    private final String filePath;
    private final LinkedList<String> lines;
    private final String originalName;
    private final String name;
    private String originalPackage;
    private final Collection<MJavaFile> allJavaFiles;
    private final TreeSet<String> extraImports = new TreeSet<String>();
    private final ConcurrentMap<String, String> replacements = new ConcurrentHashMap<String, String>();
    private MCodeGenerator<MJavaFile> generator;
    private Class<?> javaType;

    MJavaFile(MPackage pckg, File file, Collection<MJavaFile> allJavaFiles) {
	this(pckg, file, file.getName().substring(0, file.getName().length() - ".java".length()), allJavaFiles);
    }

    MJavaFile(MPackage pckg, File file, String name, Collection<MJavaFile> allJavaFiles) {
	super();
	lines = new LinkedList<String>();
	this.pckg = pckg;
	filePath = file.getAbsolutePath();
	this.name = name;
	originalName = name.endsWith(".java") ? name.substring(0, name.length() - ".java".length()) : name;
	generator = this;
	this.allJavaFiles = allJavaFiles;
	javaType = null;
	try {
	    new EncodedFileReader(file) {

		@Override
		protected void onLine(String line) throws Exception {
		    lines.add(line);
		    if (line.startsWith("package ")) {
			String pckg = line.substring("package ".length());
			pckg = pckg.trim();
			pckg = pckg.substring(0, pckg.length() - 1);
			setOriginalPackage(pckg);
		    }
		}
	    }.call();
	} catch (Exception e) {
	    throw new RuntimeException(e.getMessage());
	}
    }

    @Override
    public final MPackage getPckg() {
	return pckg;
    }

    public String getFilePath() {
	return filePath;
    }

    public void setOriginalPackage(String originalPackage) {
	this.originalPackage = originalPackage;
    }

    public String getOriginalPackage() {
	return originalPackage;
    }

    public ConcurrentMap<String, String> getReplacements() {
	return replacements;
    }

    public String getOriginalName() {
	return originalName;
    }

    @Override
    public String getName() {
	return name;
    }

    @Override
    public String getQualifiedName() {
	return pckg.getName() + "." + name;
    }

    @Override
    public String getPackageName() {
	return pckg.getName();
    }

    @Override
    public File getSrcFile() {
	return new File(pckg.getDir(), name.concat(".java"));
    }

    protected void addImport(TreeSet<String> imports, Class<?> type) {
	MFunctions.addImport(imports, type, getPackageName());
    }

    protected void addImport(TreeSet<String> imports, MTypeRef type) {
	MFunctions.addImport(imports, type, getPackageName());
    }

    protected void addImport(TreeSet<String> imports, String fullname) {
	MFunctions.addImport(imports, fullname);
    }

    @Override
    public TreeSet<String> getImports() {
	return extraImports;
    }

    @Override
    public Set<? extends MMethod> getMethods() {
	return Collections.EMPTY_SET;
    }

    private boolean template;

    @Override
    public synchronized MJavaFile setTemplate(boolean boo) {
	template = boo;
	return this;
    }

    @Override
    public synchronized boolean isTemplate() {
	return template;
    }

    @Override
    public final void addImport(Class<?> type) {
	addImport(extraImports, type);
    }

    @Override
    public final void addImport(MTypeRef ref) {
	addImport(extraImports, ref);
    }

    @Override
    public final void addImport(String fullname) {
	addImport(extraImports, fullname);
    }

    @Override
    public MJavaFile addExtraImport(Class<?> type) {
	addImport(extraImports, type);
	return this;
    }

    @Override
    public final void addImport(MType type) {
	addImport(new MTypeRefModel(type));
    }

    @Override
    public MJavaFile addExtraImport(MTypeRef ref) {
	addImport(extraImports, ref);
	return this;
    }

    @Override
    public MJavaFile addExtraImport(String fullname) {
	addImport(extraImports, fullname);
	return this;
    }

    @Override
    public MJavaFile setGenerator(MCodeGenerator<MJavaFile> generator) {
	this.generator = generator;
	return this;
    }

    @Override
    public synchronized MCodeGenerator<MJavaFile> getGenerator() {
	return generator;
    }

    @Override
    public Class<?> getJavaType() throws ClassNotFoundException {
	return javaType != null ? javaType : Class.forName(getQualifiedName());
    }

    public MJavaFile setJavaType(Class<?> javaType) {
	this.javaType = javaType;
	return this;
    }

    @Override
    public MCodeBlock getCodeBlock(MJavaFile element) {
	final MCodeBlock inner = new MCodeBlock(true);
	try {
	    for (String line : lines) {
		if (line.startsWith("package ")) {// replace package
		    inner.addLine("package " + pckg.getName() + ";");
		    if (!extraImports.isEmpty()) {
			inner.addEmptyLine();
		    }
		    for (String imp : extraImports) {
			inner.addLine("import " + imp + ";");
		    }
		} else if (line.startsWith("import ")) {
		    for (MJavaFile jf : allJavaFiles) {
			if (!jf.equals(this)) {
			    if (line.startsWith("import " + jf.getOriginalPackage() + "." + jf.getOriginalName())) {
				line = "import " + jf.getQualifiedName() + ";";
				break;
			    }
			}
		    }
		    inner.addLine(line);
		} else {
		    for (String key : replacements.keySet()) {
			line = line.replace(key, replacements.get(key));
		    }
		    line = replaceOriginalNames(line);
		    inner.addLine(line);
		}
	    }
	} catch (Exception e) {
	    throw new RuntimeException(e.getMessage());
	}
	return inner;
    }

    private String replaceOriginalNames(String line) {
	for (MJavaFile jf : allJavaFiles) {
	    line = line.replace(" " + jf.getOriginalName(), " " + jf.getName());
	    line = line.replace(jf.getOriginalName() + " ", jf.getName() + " ");
	    line = line.replace("\t" + jf.getOriginalName(), "\t" + jf.getName());
	    line = line.replace(jf.getOriginalName() + "\t", jf.getName() + "\t");
	    line = line.replace("(" + jf.getOriginalName() + ")", "(" + jf.getName() + ")");
	    line = line.replace(jf.getOriginalName() + ".class", jf.getName() + ".class");
	}
	return line;
    }

    @Override
    public String toString() {
	StringBuilder builder = new StringBuilder();
	builder.append("MJavaFile [name=");
	builder.append(getQualifiedName());
	builder.append("]");
	return builder.toString();
    }

    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + (name == null ? 0 : name.hashCode());
	result = prime * result + (pckg == null ? 0 : pckg.hashCode());
	return result;
    }

    @Override
    public boolean equals(Object obj) {
	if (this == obj) {
	    return true;
	}
	if (obj == null) {
	    return false;
	}
	if (getClass() != obj.getClass()) {
	    return false;
	}
	MJavaFile other = (MJavaFile) obj;
	if (name == null) {
	    if (other.name != null) {
		return false;
	    }
	} else if (!name.equals(other.name)) {
	    return false;
	}
	if (pckg == null) {
	    if (other.pckg != null) {
		return false;
	    }
	} else if (!pckg.equals(other.pckg)) {
	    return false;
	}
	return true;
    }
}


text:
package curl

import (
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"strings"
	"time"
)

var (
	client = &http.Client{
		Transport: &http.Transport{
			MaxIdleConnsPerHost: 500,
		},
		Timeout: 5 * time.Second,
	}
)

func Do(req *http.Request) ([]byte, error) {
	//
	resp, err := client.Do(req)
	if err != nil {
		return nil, err
	}
	b, err := ioutil.ReadAll(resp.Body)
	resp.Body.Close()
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("(%d) %v", resp.StatusCode, strings.TrimSpace(string(b)))
	}
	return b, nil
}

func Get(url string) ([]byte, error) {
	//
	resp, err := client.Get(url)
	if err != nil {
		return nil, err
	}
	b, err := ioutil.ReadAll(resp.Body)
	resp.Body.Close()
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("(%d) %v", resp.StatusCode, strings.TrimSpace(string(b)))
	}
	return b, nil
}

func Post(url string, bodyType string, body io.Reader) ([]byte, error) {
	//
	resp, err := client.Post(url, bodyType, body)
	if err != nil {
		log.Println(err)
		return nil, err
	}
	defer resp.Body.Close()
	b, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Println(err)
		return nil, err
	}
	if resp.StatusCode != http.StatusOK {
		return b, fmt.Errorf("(%d) %v", resp.StatusCode, strings.TrimSpace(string(b)))
	}
	return b, nil
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>QuTiP: Quantum Toolbox in Python (4.1) — QuTiP 4.1 Documentation</title>

    <link rel="shortcut icon" href="_static/favicon.ico"/>

    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />

        <link rel="index" title="Index"
              href="genindex.html"/>
        <link rel="search" title="Search" href="search.html"/>
    <link rel="top" title="QuTiP 4.1 Documentation" href="#"/>
        <link rel="next" title="Frontmatter" href="frontmatter.html"/>

             QuTiP: Quantum Toolbox in Python

                4.1

  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

Frontmatter

Installation

Users Guide

API documentation

Change Log

Developers

Bibliography

          QuTiP: Quantum Toolbox in Python

Docs »

QuTiP: Quantum Toolbox in Python (4.1)

QuTiP: Quantum Toolbox in Python (4.1)¶

Frontmatter

About This Documentation

Citing This Project

Funding

About QuTiP

Contributing to QuTiP

Installation

General Requirements

Platform-independent Installation

Building your Conda environment

Adding the conda-forge channel

Installing via pip

Installing from Source

Installation on MS Windows

Windows and Python 2.7

Verifying the Installation

Checking Version Information using the About Function

Users Guide

Guide Overview

Organization

Basic Operations on Quantum Objects

First things first

The quantum object class

Functions operating on Qobj class

Manipulating States and Operators

Introduction

State Vectors (kets or bras)

Density matrices

Qubit (two-level) systems

Expectation values

Superoperators and Vectorized Operators

Choi, Kraus, Stinespring and \(\chi\) Representations

Properties of Quantum Maps

Using Tensor Products and Partial Traces

Tensor products

Example: Constructing composite Hamiltonians

Partial trace

Superoperators and Tensor Manipulations

Time Evolution and Quantum System Dynamics

Dynamics Simulation Results

Lindblad Master Equation Solver

Monte Carlo Solver

Bloch-Redfield master equation

Solving Problems with Time-dependent Hamiltonians

Floquet Formalism

Setting Options for the Dynamics Solvers

Solving for Steady-State Solutions

Introduction

Steady State solvers in QuTiP

Using the Steadystate Solver

Additional Solver Arguments

Example: Harmonic Oscillator in Thermal Bath

An Overview of the Eseries Class

Exponential-series representation of time-dependent quantum objects

Applications of exponential series

Two-time correlation functions

Steadystate correlation function

Emission spectrum

Non-steadystate correlation function

Quantum Optimal Control

Introduction

Closed Quantum Systems

The GRAPE algorithm

The CRAB Algorithm

Optimal Quantum Control in QuTiP

Using the pulseoptim functions

Plotting on the Bloch Sphere

Introduction

The Bloch and Bloch3d Classes

Configuring the Bloch sphere

Animating with the Bloch sphere

Visualization of quantum states and processes

Fock-basis probability distribution

Quasi-probability distributions

Visualizing operators

Quantum process tomography

Parallel computation

Parallel map and parallel for-loop

IPython-based parallel_map

Saving QuTiP Objects and Data Sets

Storing and loading QuTiP objects

Storing and loading datasets

Generating Random Quantum States & Operators

Random objects with a given eigen spectrum

Composite random objects

Modifying Internal QuTiP Settings

User Accessible Parameters

Example: Changing Settings

Persistent Settings

API documentation

Classes

Qobj

eseries

Bloch sphere

Cubic Spline

Non-Markovian Solvers

Solver Options and Results

Distribution functions

Quantum information processing

Optimal control

Functions

Manipulation and Creation of States and Operators

Functions acting on states and operators

Dynamics and Time-Evolution

Visualization

Quantum Information Processing

non-Markovian Solvers

Optimal control

Utilitiy Functions

Change Log

Version 4.1.0 (March 10, 2017)

Improvements

Bug Fixes

Version 4.0.2 (January 5, 2017)

Bug Fixes

Version 4.0.0 (December 22, 2016)

Improvements

Bug Fixes

Version 3.2.0 (Never officially released)

New Features

Improvements

Bug Fixes

Version 3.1.0 (January 1, 2015):

New Features

Bug Fixes

Version 3.0.1 (Aug 5, 2014):

Bug Fixes

Version 3.0.0 (July 17, 2014):

New Features

Improvements

Version 2.2.0 (March 01, 2013):

New Features

Bug Fixes:

Version 2.1.0 (October 05, 2012):

New Features

Bug Fixes:

Version 2.0.0 (June 01, 2012):

New Features

Version 1.1.4 (May 28, 2012):

Bug Fixes:

Version 1.1.3 (November 21, 2011):

New Functions:

Bug Fixes:

Version 1.1.2 (October 27, 2011)

Bug Fixes

Version 1.1.1 (October 25, 2011)

New Functions

Bug Fixes

Version 1.1.0 (October 04, 2011)

New Functions

Bug Fixes

Version 1.0.0 (July 29, 2011)

Developers

Lead Developers

Contributors

Bibliography

Indices and tables¶

Index

Module Index

Search Page

        Next

        © Copyright 2011 and later, P.D. Nation, J.R. Johansson, A.J.G. Pitchford, C. Granade, and A.L. Grimsmo.
      Last updated on Jul 14, 2017.

  Built with Sphinx using a theme provided by Read the Docs.


text:
import unittest

from mixbox.vendor.six import u

from cybox.objects.win_waitable_timer_object import WinWaitableTimer
from cybox.test.objects import ObjectTestCase

class TestWinWaitableTimer(ObjectTestCase, unittest.TestCase):
    object_type = "WindowsWaitableTimerObjectType"
    klass = WinWaitableTimer

    _full_dict = {
        'security_attributes': u("timer attributes"),
        'name': u("timer name"),
        'type': u("timer type"),
        'xsi:type': object_type,
    }

if __name__ == "__main__":
    unittest.main()