text:
package org.neo4j.concurrent;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/**
 * Constructors for basic {@link Future} types
 */
public class Futures
{
    /**
     * Combine multiple @{link Future} instances into a single Future
     *
     * @param futures the @{link Future} instances to combine
     * @param <V>     The result type returned by this Future's get method
     * @return A new @{link Future} representing the combination
     */
    @SafeVarargs
    public static <V> Future<List<V>> combine( final Future<? extends V>... futures )
    {
        return combine( Arrays.asList( futures ) );
    }

    /**
     * Combine multiple @{link Future} instances into a single Future
     *
     * @param futures the @{link Future} instances to combine
     * @param <V>     The result type returned by this Future's get method
     * @return A new @{link Future} representing the combination
     */
    public static <V> Future<List<V>> combine( final Iterable<? extends Future<? extends V>> futures )
    {
        return new Future<List<V>>()
        {
            @Override
            public boolean cancel( boolean mayInterruptIfRunning )
            {
                boolean result = false;
                for ( Future<? extends V> future : futures )
                {
                    result |= future.cancel( mayInterruptIfRunning );
                }
                return result;
            }

            @Override
            public boolean isCancelled()
            {
                boolean result = false;
                for ( Future<? extends V> future : futures )
                {
                    result |= future.isCancelled();
                }
                return result;
            }

            @Override
            public boolean isDone()
            {
                boolean result = false;
                for ( Future<? extends V> future : futures )
                {
                    result |= future.isDone();
                }
                return result;
            }

            @Override
            public List<V> get() throws InterruptedException, ExecutionException
            {
                List<V> result = new ArrayList<>();
                for ( Future<? extends V> future : futures )
                {
                    result.add( future.get() );
                }
                return result;
            }

            @Override
            public List<V> get( long timeout, TimeUnit unit ) throws InterruptedException, ExecutionException, TimeoutException
            {
                List<V> result = new ArrayList<>();
                for ( Future<? extends V> future : futures )
                {
                    long before = System.nanoTime();
                    result.add( future.get( timeout, unit ) );
                    timeout -= unit.convert( System.nanoTime() - before, TimeUnit.NANOSECONDS );
                }
                return result;
            }
        };
    }
}


text:
import * as express from "express";

export function getExternalPort(request: express.Request): number {
	function defaultPort(): number {
		// Default ports for HTTP and HTTPS
		return request.protocol === "http" ? 80 : 443;
	}

	let host = request.headers.host;
	if (!host || Array.isArray(host)) {
		return defaultPort();
	}

	// IPv6 literal support
	let offset = host[0] === "[" ? host.indexOf("]") + 1 : 0;
	let index = host.indexOf(":", offset);
	if (index !== -1) {
		return parseInt(host.substring(index + 1), 10);
	}
	else {
		return defaultPort();
	}
}

export function createLink(request: express.Request, link: string, proto?: string): string {
	if (!proto) {
		proto = "http";
	}
	if (link[0] === "/") {
		link = link.substring(1);
	}
	if ((request.secure && getExternalPort(request) === 443)
		|| (!request.secure && getExternalPort(request) === 80))
	{
		return `${proto}${request.secure ? "s" : ""}://${request.hostname}/${link}`;
	}
	else {
		return `${proto}${request.secure ? "s" : ""}://${request.hostname}:${getExternalPort(request)}/${link}`;
	}
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

     <title>PhysiLink... </title>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

Inbox

Sent Items

Create New Email

PhysiLink

Name:  {{ result[0]}}

Provider Number: {{ result[1]}}

 Subject: {{ result[2]}}

 {{ result[3]}}

Download attachments

 Attachment: {{ result[5]}}

 Attachments will download to your current working directory.


text:
**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->

- [Overview](#overview)
- [API Design](#api-design)
  - [Standard Finalizers](#standard-finalizers)
  - [OwnerReference](#ownerreference)
  - [DeleteOptions](#deleteoptions)
- [Components changes](#components-changes)
  - [API Server](#api-server)
  - [Garbage Collector](#garbage-collector)
  - [Controllers](#controllers)
- [Handling circular dependencies](#handling-circular-dependencies)
- [Unhandled cases](#unhandled-cases)
- [Implications to existing clients](#implications-to-existing-clients)

<!-- END MUNGE: GENERATED_TOC -->

# Overview

Users of the server-side garbage collection need to determine if the garbage collection is done. For example:
* Currently `kubectl delete rc` blocks until all the pods are terminating. To convert to use server-side garbage collection, kubectl has to be able to determine if the garbage collection is done.
* [#19701](https://github.com/kubernetes/kubernetes/issues/19701#issuecomment-236997077) is a use case where the user needs to wait for all service dependencies garbage collected and their names released, before she recreates the dependencies.

We define the garbage collection as "done" when all the dependents are deleted from the key-value store, rather than merely in the terminating state. There are two reasons: *i)* for `Pod`s, the most usual garbage, only when they are deleted from the key-value store, we know kubelet has released resources they occupy; *ii)* some users need to recreate objects with the same names, they need to wait for the old objects to be deleted from the key-value store. (This limitation is because we index objects by their names in the key-value store today.)

Synchronous Garbage Collection is a best-effort (see [unhandled cases](#unhandled-cases)) mechanism that allows user to determine if the garbage collection is done: after the API server receives a deletion request of an owning object, the object keeps existing in the key-value store until all its dependents are deleted from the key-value store by the garbage collector.

Tracking issue: https://github.com/kubernetes/kubernetes/issues/29891

# API Design

## Standard Finalizers

We will introduce a new standard finalizer:

```go
const GCFinalizer string = "DeletingDependents"
```

This finalizer indicates the object is terminating and is waiting for its dependents whose `OwnerReference.BlockOwnerDeletion` is true get deleted.

## OwnerReference

```go
OwnerReference {
     ...
     // If true, AND if the owner has the "DeletingDependents" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed.
     // Defaults to false.
     // To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.
     BlockOwnerDeletion *bool
}
```

The initial draft of the proposal did not include this field and it had a security loophole: a user who is only authorized to update one resource can set ownerReference to block the synchronous GC of other resources. Requiring users to explicitly set `BlockOwnerDeletion` allows the master to properly authorize the request.

## DeleteOptions

```go
DeleteOptions {
  …
  // Whether and how garbage collection will be performed.
  // Defaults to DeletePropagationDefault
  // Either this field or OrphanDependents may be set, but not both.
  PropagationPolicy *DeletePropagationPolicy
}

type DeletePropagationPolicy string

const (
    // The default depends on the existing finalizers on the object and the type of the object.
    DeletePropagationDefault DeletePropagationPolicy = "DeletePropagationDefault"
    // Orphans the dependents
    DeletePropagationOrphan DeletePropagationPolicy = "DeletePropagationOrphan"
    // Deletes the object from the key-value store, the garbage collector will delete the dependents in the background.
    DeletePropagationBackground DeletePropagationPolicy = "DeletePropagationBackground"
    // The object exists in the key-value store until the garbage collector deletes all the dependents whose ownerReference.blockOwnerDeletion=true from the key-value store.
    // API sever will put the "DeletingDependents" finalizer on the object, and sets its deletionTimestamp.
    // This policy is cascading, i.e., the dependents will be deleted with GarbageCollectionSynchronous.
    DeletePropagationForeground DeletePropagationPolicy = "DeletePropagationForeground"
)
```

The `DeletePropagationForeground` policy represents the synchronous GC mode.

`DeleteOptions.OrphanDependents *bool` will be marked as deprecated and will be removed in 1.7. Validation code will make sure only one of `OrphanDependents` and `PropagationPolicy` may be set. We decided not to add another `DeleteAfterDependentsDeleted *bool`, because together with `OrphanDependents`, it will result in 9 possible combinations and is thus confusing.

The conversion rules are described in the following table:

| 1.5                                      | pre 1.4/1.4              |
|------------------------------------------|--------------------------|
| DeletePropagationDefault                 | OrphanDependents==nil    |
| DeletePropagationOrphan                  | *OrphanDependents==true  |
| DeletePropagationBackground              | *OrphanDependents==false |
| DeletePropagationForeground              | N/A                      |

# Components changes

## API Server

`Delete()` function checks `DeleteOptions.PropagationPolicy`. If the policy is `DeletePropagationForeground`, the API server will update the object instead of deleting it, add the "DeletingDependents" finalizer, remove the "OrphanDependents" finalizer if it's present, and set the `ObjectMeta.DeletionTimestamp`.

When validating the ownerReference, API server needs to query the `Authorizer` to check if the user has "delete" permission of the owner object. It returns 422 if the user does not have the permissions but intends to set `OwnerReference.BlockOwnerDeletion` to true.

## Garbage Collector

**Modifications to processEvent()**

Currently `processEvent()` manages GC's internal owner-dependency relationship graph, `uidToNode`. It updates `uidToNode` according to the Add/Update/Delete events in the cluster. To support synchronous GC, it has to:

* handle Add or Update events where `obj.Finalizers.Has(GCFinalizer) && obj.DeletionTimestamp != nil`. The object will be added into the `dirtyQueue`. The object will be marked as "GC in progress" in `uidToNode`.
* Upon receiving the deletion event of an object, put its owner into the `dirtyQueue` if the owner node is marked as "GC in progress". This is to force the `processItem()` (described next) to re-check if all dependents of the owner is deleted.

**Modifications to processItem()**

Currently `processItem()` consumes the `dirtyQueue`, requests the API server to delete an item if all of its owners do not exist. To support synchronous GC, it has to:

* treat an owner as "not exist" if `owner.DeletionTimestamp != nil && !owner.Finalizers.Has(OrphanFinalizer)`, otherwise synchronous GC will not progress because the owner keeps existing in the key-value store.
* when deleting dependents, if the owner's finalizers include `DeletingDependents`, it should use the `GarbageCollectionSynchronous` as GC policy.
* if an object has multiple owners, some owners still exist while other owners are in the synchronous GC stage, then according to the existing logic of GC, the object wouldn't be deleted. To unblock the synchronous GC of owners, `processItem()` has to remove the ownerReferences pointing to them.

In addition, if an object popped from `dirtyQueue` is marked as "GC in progress", `processItem()` treats it specially:

* To avoid racing with another controller, it requeues the object if `observedGeneration < Generation`. This is best-effort, see [unhandled cases](#unhandled-cases).
* Checks if the object has dependents
  * If not, send a PUT request to remove the `GCFinalizer`;
  * If so, then add all dependents to the `dirtryQueue`; we need bookkeeping to avoid adding the dependents repeatedly if the owner gets in the `synchronousGC queue` multiple times.

## Controllers

To utilize the synchronous garbage collection feature, controllers (e.g., the replicaset controller) need to set `OwnerReference.BlockOwnerDeletion` when creating dependent objects (e.g. pods).

# Handling circular dependencies

SynchronousGC will enter a deadlock in the presence of circular dependencies. The garbage collector can break the circle by lazily breaking circular dependencies: when `processItem()` processes an object, if it finds the object and all of its owners have the `GCFinalizer`, it removes the `GCFinalizer` from the object.

Note that the approach is not rigorous and thus having false positives. For example, if a user first sends a SynchronousGC delete request for an object, then sends the delete request for its owner, then `processItem()` will be fooled to believe there is a circle. We expect user not to do this. We can make the circle detection more rigorous if needed.

Circular dependencies are regarded as user error. If needed, we can add more guarantees to handle such cases later.

# Unhandled cases

* If the GC observes the owning object with the `GCFinalizer` before it observes the creation of all the dependents, GC will remove the finalizer from the owning object before all dependents are gone. Hence, synchronous GC is best-effort, though we guarantee that the dependents will be deleted eventually. We face a similar case when handling OrphanFinalizer, see [GC known issues](https://github.com/kubernetes/kubernetes/issues/26120).

# Implications to existing clients

Finalizer breaks an assumption that many Kubernetes components have: a deletion request with `grace period=0` will immediately remove the object from the key-value store. This is not true if an object has pending finalizers, the object will continue to exist, and currently the API server will not return an error in this case.

**Namespace controller** suffered from this [problem](https://github.com/kubernetes/kubernetes/issues/32519) and was fixed in [#32524](https://github.com/kubernetes/kubernetes/pull/32524) by retrying every 15s if there are objects with pending finalizers to be removed from the key-value store. Object with pending `GCFinalizer` might take arbitrary long time be deleted, so namespace deletion might time out.

**kubelet** deletes the pod from the key-value store after all its containers are terminated ([code](../../pkg/kubelet/status/status_manager.go#L441-L443)). It also assumes that if the API server does not return an error, the pod is removed from the key-value store. Breaking the assumption will not break `kubelet` though, because the `pod` must have already been in the terminated phase, `kubelet` will not care to manage it.

**Node controller** forcefully deletes pod if the pod is scheduled to a node that does not exist ([code](../../pkg/controller/node/nodecontroller.go#L474)). The pod will continue to exist if it has pending finalizers. The node controller will futilely retry the deletion. Also, the `node controller` forcefully deletes pods before deleting the node ([code](../../pkg/controller/node/nodecontroller.go#L592)). If the pods have pending finalizers, the `node controller` will go ahead deleting the node, leaving those pods behind. These pods will be deleted from the key-value store when the pending finalizers are removed.

**Podgc** deletes terminated pods if there are too many of them in the cluster. We need to make sure finalizers on Pods are taken off quickly enough so that the progress of `Podgc` is not affected.

**Deployment controller** adopts existing `ReplicaSet` (RS) if its template matches. If a matching RS has a pending `GCFinalizer`, deployment should adopt it, take its pods into account, but shouldn't try to mutate it, because the RS controller will ignore a RS that's being deleted. Hence, `deployment controller` should wait for the RS to be deleted, and then create a new one.

**Replication controller manager**, **Job controller**, and **ReplicaSet controller** ignore pods in terminated phase, so pods with pending finalizers will not block these controllers.

**StatefulSet controller** will be blocked by a pod with pending finalizers, so synchronous GC might slow down its progress.

**kubectl**: synchronous GC can simplify the **kubectl delete** reapers. Let's take the `deployment reaper` as an example, since it's the most complicated one. Currently, the reaper finds all `RS` with matching labels, scales them down, polls until `RS.Status.Replica` reaches 0, deletes the `RS`es, and finally deletes the `deployment`. If using synchronous GC, `kubectl delete deployment` is as easy as sending a synchronous GC delete request for the deployment, and polls until the deployment is deleted from the key-value store.

Note that this **changes the behavior** of `kubectl delete`. The command will be blocked until all pods are deleted from the key-value store, instead of being blocked until pods are in the terminating state. This means `kubectl delete` blocks for longer time, but it has the benefit that the resources used by the pods are released when the `kubectl delete` returns. To allow kubectl user not waiting for the cleanup, we will add a `--wait` flag. It defaults to true; if it's set to `false`, `kubectl delete` will send the delete request with `PropagationPolicy=DeletePropagationBackground` and return immediately.

To make the new kubectl compatible with the 1.4 and earlier masters, kubectl needs to switch to use the old reaper logic if it finds synchronous GC is not supported by the master.

1.4 `kubectl delete rc/rs` uses `DeleteOptions.OrphanDependents=true`, which is going to be converted to `DeletePropagationBackground` (see [API Design](#api-changes)) by a 1.5 master, so its behavior keeps the same.

Pre 1.4 `kubectl delete` uses `DeleteOptions.OrphanDependents=nil`, so does the 1.4 `kubectl delete` for resources other than rc and rs. The option is going to be converted to `DeletePropagationDefault` (see [API Design](#api-changes)) by a 1.5 master, so these commands behave the same as when working with a 1.4 master.

<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/proposals/synchronous-garbage-collection.md?pixel)]()
<!-- END MUNGE: GENERATED_ANALYTICS -->


text:
package com.amazonaws.services.rds.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 ModifyDBClusterRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The DB cluster identifier for the cluster being modified. This parameter is not case-sensitive.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be the identifier for an existing DB cluster.
     *

     *

     *

     *

     * Must contain from 1 to 63 alphanumeric characters or hyphens.
     *

     *

     *

     *

     * First character must be a letter.
     *

     *

     *

     *

     * Cannot end with a hyphen or contain two consecutive hyphens.
     *

     *

     *

     */
    private String dBClusterIdentifier;
    /**
     *

     * The new DB cluster identifier for the DB cluster when renaming a DB cluster. This value is stored as a lowercase
     * string.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must contain from 1 to 63 alphanumeric characters or hyphens
     *

     *

     *

     *

     * First character must be a letter
     *

     *

     *

     *

     * Cannot end with a hyphen or contain two consecutive hyphens
     *

     *

     *

     *

     * Example: my-cluster2
     *

     */
    private String newDBClusterIdentifier;
    /**
     *

     * A value that specifies whether the modifications in this request and any pending modifications are asynchronously
     * applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB
     * cluster. If this parameter is set to false, changes to the DB cluster are applied during the next
     * maintenance window.
     *

     *

     * The ApplyImmediately parameter only affects the NewDBClusterIdentifier and
     * MasterUserPassword values. If you set the ApplyImmediately parameter value to false,
     * then changes to the NewDBClusterIdentifier and MasterUserPassword values are applied
     * during the next maintenance window. All other changes are applied immediately, regardless of the value of the
     * ApplyImmediately parameter.
     *

     *

     * Default: false
     *

     */
    private Boolean applyImmediately;
    /**
     *

     * The number of days for which automated backups are retained. You must specify a minimum value of 1.
     *

     *

     * Default: 1
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be a value from 1 to 35
     *

     *

     *

     */
    private Integer backupRetentionPeriod;
    /**
     *

     * The name of the DB cluster parameter group to use for the DB cluster.
     *

     */
    private String dBClusterParameterGroupName;
    /**
     *

     * A list of VPC security groups that the DB cluster will belong to.
     *

     */
    private com.amazonaws.internal.SdkInternalList<String> vpcSecurityGroupIds;
    /**
     *

     * The port number on which the DB cluster accepts connections.
     *

     *

     * Constraints: Value must be 1150-65535
     *

     *

     * Default: The same port as the original DB cluster.
     *

     */
    private Integer port;
    /**
     *

     * The new password for the master database user. This password can contain any printable ASCII character except
     * "/", """, or "@".
     *

     *

     * Constraints: Must contain from 8 to 41 characters.
     *

     */
    private String masterUserPassword;
    /**
     *

     * A value that indicates that the DB cluster should be associated with the specified option group. Changing this
     * parameter does not result in an outage except in the following case, and the change is applied during the next
     * maintenance window unless the ApplyImmediately parameter is set to true for this
     * request. If the parameter change results in an option group that enables OEM, this change can cause a brief
     * (sub-second) period during which new connections are rejected but existing connections are not interrupted.
     *

     *

     * Permanent options cannot be removed from an option group. The option group cannot be removed from a DB cluster
     * once it is associated with a DB cluster.
     *

     */
    private String optionGroupName;
    /**
     *

     * The daily time range during which automated backups are created if automated backups are enabled, using the
     * BackupRetentionPeriod parameter.
     *

     *

     * Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time blocks
     * available, see  Adjusting the
     * Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be in the format hh24:mi-hh24:mi.
     *

     *

     *

     *

     * Times should be in Universal Coordinated Time (UTC).
     *

     *

     *

     *

     * Must not conflict with the preferred maintenance window.
     *

     *

     *

     *

     * Must be at least 30 minutes.
     *

     *

     *

     */
    private String preferredBackupWindow;
    /**
     *

     * The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
     *

     *

     * Format: ddd:hh24:mi-ddd:hh24:mi
     *

     *

     * Default: A 30-minute window selected at random from an 8-hour block of time per region, occurring on a random day
     * of the week. To see the time blocks available, see  Adjusting the
     * Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     * Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
     *

     *

     * Constraints: Minimum 30-minute window.
     *

     */
    private String preferredMaintenanceWindow;
    /**
     *

     * A Boolean value that is true to enable mapping of AWS Identity and Access Management (IAM) accounts to database
     * accounts, and otherwise false.
     *

     *

     * Default: false
     *

     */
    private Boolean enableIAMDatabaseAuthentication;

    /**
     *

     * The DB cluster identifier for the cluster being modified. This parameter is not case-sensitive.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be the identifier for an existing DB cluster.
     *

     *

     *

     *

     * Must contain from 1 to 63 alphanumeric characters or hyphens.
     *

     *

     *

     *

     * First character must be a letter.
     *

     *

     *

     *

     * Cannot end with a hyphen or contain two consecutive hyphens.
     *

     *

     *

     *
     * @param dBClusterIdentifier
     *        The DB cluster identifier for the cluster being modified. This parameter is not case-sensitive.

     *

     *        Constraints:
     *

     *

     *

     *

     *        Must be the identifier for an existing DB cluster.
     *

     *

     *

     *

     *        Must contain from 1 to 63 alphanumeric characters or hyphens.
     *

     *

     *

     *

     *        First character must be a letter.
     *

     *

     *

     *

     *        Cannot end with a hyphen or contain two consecutive hyphens.
     *

     *

     */

    public void setDBClusterIdentifier(String dBClusterIdentifier) {
        this.dBClusterIdentifier = dBClusterIdentifier;
    }

    /**
     *

     * The DB cluster identifier for the cluster being modified. This parameter is not case-sensitive.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be the identifier for an existing DB cluster.
     *

     *

     *

     *

     * Must contain from 1 to 63 alphanumeric characters or hyphens.
     *

     *

     *

     *

     * First character must be a letter.
     *

     *

     *

     *

     * Cannot end with a hyphen or contain two consecutive hyphens.
     *

     *

     *

     *
     * @return The DB cluster identifier for the cluster being modified. This parameter is not case-sensitive.

     *

     *         Constraints:
     *

     *

     *

     *

     *         Must be the identifier for an existing DB cluster.
     *

     *

     *

     *

     *         Must contain from 1 to 63 alphanumeric characters or hyphens.
     *

     *

     *

     *

     *         First character must be a letter.
     *

     *

     *

     *

     *         Cannot end with a hyphen or contain two consecutive hyphens.
     *

     *

     */

    public String getDBClusterIdentifier() {
        return this.dBClusterIdentifier;
    }

    /**
     *

     * The DB cluster identifier for the cluster being modified. This parameter is not case-sensitive.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be the identifier for an existing DB cluster.
     *

     *

     *

     *

     * Must contain from 1 to 63 alphanumeric characters or hyphens.
     *

     *

     *

     *

     * First character must be a letter.
     *

     *

     *

     *

     * Cannot end with a hyphen or contain two consecutive hyphens.
     *

     *

     *

     *
     * @param dBClusterIdentifier
     *        The DB cluster identifier for the cluster being modified. This parameter is not case-sensitive.

     *

     *        Constraints:
     *

     *

     *

     *

     *        Must be the identifier for an existing DB cluster.
     *

     *

     *

     *

     *        Must contain from 1 to 63 alphanumeric characters or hyphens.
     *

     *

     *

     *

     *        First character must be a letter.
     *

     *

     *

     *

     *        Cannot end with a hyphen or contain two consecutive hyphens.
     *

     *

     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withDBClusterIdentifier(String dBClusterIdentifier) {
        setDBClusterIdentifier(dBClusterIdentifier);
        return this;
    }

    /**
     *

     * The new DB cluster identifier for the DB cluster when renaming a DB cluster. This value is stored as a lowercase
     * string.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must contain from 1 to 63 alphanumeric characters or hyphens
     *

     *

     *

     *

     * First character must be a letter
     *

     *

     *

     *

     * Cannot end with a hyphen or contain two consecutive hyphens
     *

     *

     *

     *

     * Example: my-cluster2
     *

     *
     * @param newDBClusterIdentifier
     *        The new DB cluster identifier for the DB cluster when renaming a DB cluster. This value is stored as a
     *        lowercase string.

     *

     *        Constraints:
     *

     *

     *

     *

     *        Must contain from 1 to 63 alphanumeric characters or hyphens
     *

     *

     *

     *

     *        First character must be a letter
     *

     *

     *

     *

     *        Cannot end with a hyphen or contain two consecutive hyphens
     *

     *

     *

     *

     *        Example: my-cluster2
     */

    public void setNewDBClusterIdentifier(String newDBClusterIdentifier) {
        this.newDBClusterIdentifier = newDBClusterIdentifier;
    }

    /**
     *

     * The new DB cluster identifier for the DB cluster when renaming a DB cluster. This value is stored as a lowercase
     * string.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must contain from 1 to 63 alphanumeric characters or hyphens
     *

     *

     *

     *

     * First character must be a letter
     *

     *

     *

     *

     * Cannot end with a hyphen or contain two consecutive hyphens
     *

     *

     *

     *

     * Example: my-cluster2
     *

     *
     * @return The new DB cluster identifier for the DB cluster when renaming a DB cluster. This value is stored as a
     *         lowercase string.

     *

     *         Constraints:
     *

     *

     *

     *

     *         Must contain from 1 to 63 alphanumeric characters or hyphens
     *

     *

     *

     *

     *         First character must be a letter
     *

     *

     *

     *

     *         Cannot end with a hyphen or contain two consecutive hyphens
     *

     *

     *

     *

     *         Example: my-cluster2
     */

    public String getNewDBClusterIdentifier() {
        return this.newDBClusterIdentifier;
    }

    /**
     *

     * The new DB cluster identifier for the DB cluster when renaming a DB cluster. This value is stored as a lowercase
     * string.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must contain from 1 to 63 alphanumeric characters or hyphens
     *

     *

     *

     *

     * First character must be a letter
     *

     *

     *

     *

     * Cannot end with a hyphen or contain two consecutive hyphens
     *

     *

     *

     *

     * Example: my-cluster2
     *

     *
     * @param newDBClusterIdentifier
     *        The new DB cluster identifier for the DB cluster when renaming a DB cluster. This value is stored as a
     *        lowercase string.

     *

     *        Constraints:
     *

     *

     *

     *

     *        Must contain from 1 to 63 alphanumeric characters or hyphens
     *

     *

     *

     *

     *        First character must be a letter
     *

     *

     *

     *

     *        Cannot end with a hyphen or contain two consecutive hyphens
     *

     *

     *

     *

     *        Example: my-cluster2
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withNewDBClusterIdentifier(String newDBClusterIdentifier) {
        setNewDBClusterIdentifier(newDBClusterIdentifier);
        return this;
    }

    /**
     *

     * A value that specifies whether the modifications in this request and any pending modifications are asynchronously
     * applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB
     * cluster. If this parameter is set to false, changes to the DB cluster are applied during the next
     * maintenance window.
     *

     *

     * The ApplyImmediately parameter only affects the NewDBClusterIdentifier and
     * MasterUserPassword values. If you set the ApplyImmediately parameter value to false,
     * then changes to the NewDBClusterIdentifier and MasterUserPassword values are applied
     * during the next maintenance window. All other changes are applied immediately, regardless of the value of the
     * ApplyImmediately parameter.
     *

     *

     * Default: false
     *

     *
     * @param applyImmediately
     *        A value that specifies whether the modifications in this request and any pending modifications are
     *        asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow
     *        setting for the DB cluster. If this parameter is set to false, changes to the DB cluster are
     *        applied during the next maintenance window.

     *

     *        The ApplyImmediately parameter only affects the NewDBClusterIdentifier and
     *        MasterUserPassword values. If you set the ApplyImmediately parameter value to
     *        false, then changes to the NewDBClusterIdentifier and MasterUserPassword values
     *        are applied during the next maintenance window. All other changes are applied immediately, regardless of
     *        the value of the ApplyImmediately parameter.
     *

     *

     *        Default: false
     */

    public void setApplyImmediately(Boolean applyImmediately) {
        this.applyImmediately = applyImmediately;
    }

    /**
     *

     * A value that specifies whether the modifications in this request and any pending modifications are asynchronously
     * applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB
     * cluster. If this parameter is set to false, changes to the DB cluster are applied during the next
     * maintenance window.
     *

     *

     * The ApplyImmediately parameter only affects the NewDBClusterIdentifier and
     * MasterUserPassword values. If you set the ApplyImmediately parameter value to false,
     * then changes to the NewDBClusterIdentifier and MasterUserPassword values are applied
     * during the next maintenance window. All other changes are applied immediately, regardless of the value of the
     * ApplyImmediately parameter.
     *

     *

     * Default: false
     *

     *
     * @return A value that specifies whether the modifications in this request and any pending modifications are
     *         asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow
     *         setting for the DB cluster. If this parameter is set to false, changes to the DB cluster are
     *         applied during the next maintenance window.

     *

     *         The ApplyImmediately parameter only affects the NewDBClusterIdentifier and
     *         MasterUserPassword values. If you set the ApplyImmediately parameter value to
     *         false, then changes to the NewDBClusterIdentifier and MasterUserPassword values
     *         are applied during the next maintenance window. All other changes are applied immediately, regardless of
     *         the value of the ApplyImmediately parameter.
     *

     *

     *         Default: false
     */

    public Boolean getApplyImmediately() {
        return this.applyImmediately;
    }

    /**
     *

     * A value that specifies whether the modifications in this request and any pending modifications are asynchronously
     * applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB
     * cluster. If this parameter is set to false, changes to the DB cluster are applied during the next
     * maintenance window.
     *

     *

     * The ApplyImmediately parameter only affects the NewDBClusterIdentifier and
     * MasterUserPassword values. If you set the ApplyImmediately parameter value to false,
     * then changes to the NewDBClusterIdentifier and MasterUserPassword values are applied
     * during the next maintenance window. All other changes are applied immediately, regardless of the value of the
     * ApplyImmediately parameter.
     *

     *

     * Default: false
     *

     *
     * @param applyImmediately
     *        A value that specifies whether the modifications in this request and any pending modifications are
     *        asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow
     *        setting for the DB cluster. If this parameter is set to false, changes to the DB cluster are
     *        applied during the next maintenance window.

     *

     *        The ApplyImmediately parameter only affects the NewDBClusterIdentifier and
     *        MasterUserPassword values. If you set the ApplyImmediately parameter value to
     *        false, then changes to the NewDBClusterIdentifier and MasterUserPassword values
     *        are applied during the next maintenance window. All other changes are applied immediately, regardless of
     *        the value of the ApplyImmediately parameter.
     *

     *

     *        Default: false
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withApplyImmediately(Boolean applyImmediately) {
        setApplyImmediately(applyImmediately);
        return this;
    }

    /**
     *

     * A value that specifies whether the modifications in this request and any pending modifications are asynchronously
     * applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB
     * cluster. If this parameter is set to false, changes to the DB cluster are applied during the next
     * maintenance window.
     *

     *

     * The ApplyImmediately parameter only affects the NewDBClusterIdentifier and
     * MasterUserPassword values. If you set the ApplyImmediately parameter value to false,
     * then changes to the NewDBClusterIdentifier and MasterUserPassword values are applied
     * during the next maintenance window. All other changes are applied immediately, regardless of the value of the
     * ApplyImmediately parameter.
     *

     *

     * Default: false
     *

     *
     * @return A value that specifies whether the modifications in this request and any pending modifications are
     *         asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow
     *         setting for the DB cluster. If this parameter is set to false, changes to the DB cluster are
     *         applied during the next maintenance window.

     *

     *         The ApplyImmediately parameter only affects the NewDBClusterIdentifier and
     *         MasterUserPassword values. If you set the ApplyImmediately parameter value to
     *         false, then changes to the NewDBClusterIdentifier and MasterUserPassword values
     *         are applied during the next maintenance window. All other changes are applied immediately, regardless of
     *         the value of the ApplyImmediately parameter.
     *

     *

     *         Default: false
     */

    public Boolean isApplyImmediately() {
        return this.applyImmediately;
    }

    /**
     *

     * The number of days for which automated backups are retained. You must specify a minimum value of 1.
     *

     *

     * Default: 1
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be a value from 1 to 35
     *

     *

     *

     *
     * @param backupRetentionPeriod
     *        The number of days for which automated backups are retained. You must specify a minimum value of 1.

     *

     *        Default: 1
     *

     *

     *        Constraints:
     *

     *

     *

     *

     *        Must be a value from 1 to 35
     *

     *

     */

    public void setBackupRetentionPeriod(Integer backupRetentionPeriod) {
        this.backupRetentionPeriod = backupRetentionPeriod;
    }

    /**
     *

     * The number of days for which automated backups are retained. You must specify a minimum value of 1.
     *

     *

     * Default: 1
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be a value from 1 to 35
     *

     *

     *

     *
     * @return The number of days for which automated backups are retained. You must specify a minimum value of 1.

     *

     *         Default: 1
     *

     *

     *         Constraints:
     *

     *

     *

     *

     *         Must be a value from 1 to 35
     *

     *

     */

    public Integer getBackupRetentionPeriod() {
        return this.backupRetentionPeriod;
    }

    /**
     *

     * The number of days for which automated backups are retained. You must specify a minimum value of 1.
     *

     *

     * Default: 1
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be a value from 1 to 35
     *

     *

     *

     *
     * @param backupRetentionPeriod
     *        The number of days for which automated backups are retained. You must specify a minimum value of 1.

     *

     *        Default: 1
     *

     *

     *        Constraints:
     *

     *

     *

     *

     *        Must be a value from 1 to 35
     *

     *

     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withBackupRetentionPeriod(Integer backupRetentionPeriod) {
        setBackupRetentionPeriod(backupRetentionPeriod);
        return this;
    }

    /**
     *

     * The name of the DB cluster parameter group to use for the DB cluster.
     *

     *
     * @param dBClusterParameterGroupName
     *        The name of the DB cluster parameter group to use for the DB cluster.
     */

    public void setDBClusterParameterGroupName(String dBClusterParameterGroupName) {
        this.dBClusterParameterGroupName = dBClusterParameterGroupName;
    }

    /**
     *

     * The name of the DB cluster parameter group to use for the DB cluster.
     *

     *
     * @return The name of the DB cluster parameter group to use for the DB cluster.
     */

    public String getDBClusterParameterGroupName() {
        return this.dBClusterParameterGroupName;
    }

    /**
     *

     * The name of the DB cluster parameter group to use for the DB cluster.
     *

     *
     * @param dBClusterParameterGroupName
     *        The name of the DB cluster parameter group to use for the DB cluster.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withDBClusterParameterGroupName(String dBClusterParameterGroupName) {
        setDBClusterParameterGroupName(dBClusterParameterGroupName);
        return this;
    }

    /**
     *

     * A list of VPC security groups that the DB cluster will belong to.
     *

     *
     * @return A list of VPC security groups that the DB cluster will belong to.
     */

    public java.util.List<String> getVpcSecurityGroupIds() {
        if (vpcSecurityGroupIds == null) {
            vpcSecurityGroupIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return vpcSecurityGroupIds;
    }

    /**
     *

     * A list of VPC security groups that the DB cluster will belong to.
     *

     *
     * @param vpcSecurityGroupIds
     *        A list of VPC security groups that the DB cluster will belong to.
     */

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

        this.vpcSecurityGroupIds = new com.amazonaws.internal.SdkInternalList<String>(vpcSecurityGroupIds);
    }

    /**
     *

     * A list of VPC security groups that the DB cluster will belong to.
     *

     *

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

     *
     * @param vpcSecurityGroupIds
     *        A list of VPC security groups that the DB cluster will belong to.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withVpcSecurityGroupIds(String... vpcSecurityGroupIds) {
        if (this.vpcSecurityGroupIds == null) {
            setVpcSecurityGroupIds(new com.amazonaws.internal.SdkInternalList<String>(vpcSecurityGroupIds.length));
        }
        for (String ele : vpcSecurityGroupIds) {
            this.vpcSecurityGroupIds.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of VPC security groups that the DB cluster will belong to.
     *

     *
     * @param vpcSecurityGroupIds
     *        A list of VPC security groups that the DB cluster will belong to.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withVpcSecurityGroupIds(java.util.Collection<String> vpcSecurityGroupIds) {
        setVpcSecurityGroupIds(vpcSecurityGroupIds);
        return this;
    }

    /**
     *

     * The port number on which the DB cluster accepts connections.
     *

     *

     * Constraints: Value must be 1150-65535
     *

     *

     * Default: The same port as the original DB cluster.
     *

     *
     * @param port
     *        The port number on which the DB cluster accepts connections.

     *

     *        Constraints: Value must be 1150-65535
     *

     *

     *        Default: The same port as the original DB cluster.
     */

    public void setPort(Integer port) {
        this.port = port;
    }

    /**
     *

     * The port number on which the DB cluster accepts connections.
     *

     *

     * Constraints: Value must be 1150-65535
     *

     *

     * Default: The same port as the original DB cluster.
     *

     *
     * @return The port number on which the DB cluster accepts connections.

     *

     *         Constraints: Value must be 1150-65535
     *

     *

     *         Default: The same port as the original DB cluster.
     */

    public Integer getPort() {
        return this.port;
    }

    /**
     *

     * The port number on which the DB cluster accepts connections.
     *

     *

     * Constraints: Value must be 1150-65535
     *

     *

     * Default: The same port as the original DB cluster.
     *

     *
     * @param port
     *        The port number on which the DB cluster accepts connections.

     *

     *        Constraints: Value must be 1150-65535
     *

     *

     *        Default: The same port as the original DB cluster.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withPort(Integer port) {
        setPort(port);
        return this;
    }

    /**
     *

     * The new password for the master database user. This password can contain any printable ASCII character except
     * "/", """, or "@".
     *

     *

     * Constraints: Must contain from 8 to 41 characters.
     *

     *
     * @param masterUserPassword
     *        The new password for the master database user. This password can contain any printable ASCII character
     *        except "/", """, or "@".

     *

     *        Constraints: Must contain from 8 to 41 characters.
     */

    public void setMasterUserPassword(String masterUserPassword) {
        this.masterUserPassword = masterUserPassword;
    }

    /**
     *

     * The new password for the master database user. This password can contain any printable ASCII character except
     * "/", """, or "@".
     *

     *

     * Constraints: Must contain from 8 to 41 characters.
     *

     *
     * @return The new password for the master database user. This password can contain any printable ASCII character
     *         except "/", """, or "@".

     *

     *         Constraints: Must contain from 8 to 41 characters.
     */

    public String getMasterUserPassword() {
        return this.masterUserPassword;
    }

    /**
     *

     * The new password for the master database user. This password can contain any printable ASCII character except
     * "/", """, or "@".
     *

     *

     * Constraints: Must contain from 8 to 41 characters.
     *

     *
     * @param masterUserPassword
     *        The new password for the master database user. This password can contain any printable ASCII character
     *        except "/", """, or "@".

     *

     *        Constraints: Must contain from 8 to 41 characters.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withMasterUserPassword(String masterUserPassword) {
        setMasterUserPassword(masterUserPassword);
        return this;
    }

    /**
     *

     * A value that indicates that the DB cluster should be associated with the specified option group. Changing this
     * parameter does not result in an outage except in the following case, and the change is applied during the next
     * maintenance window unless the ApplyImmediately parameter is set to true for this
     * request. If the parameter change results in an option group that enables OEM, this change can cause a brief
     * (sub-second) period during which new connections are rejected but existing connections are not interrupted.
     *

     *

     * Permanent options cannot be removed from an option group. The option group cannot be removed from a DB cluster
     * once it is associated with a DB cluster.
     *

     *
     * @param optionGroupName
     *        A value that indicates that the DB cluster should be associated with the specified option group. Changing
     *        this parameter does not result in an outage except in the following case, and the change is applied during
     *        the next maintenance window unless the ApplyImmediately parameter is set to true
     *        for this request. If the parameter change results in an option group that enables OEM, this change can
     *        cause a brief (sub-second) period during which new connections are rejected but existing connections are
     *        not interrupted.

     *

     *        Permanent options cannot be removed from an option group. The option group cannot be removed from a DB
     *        cluster once it is associated with a DB cluster.
     */

    public void setOptionGroupName(String optionGroupName) {
        this.optionGroupName = optionGroupName;
    }

    /**
     *

     * A value that indicates that the DB cluster should be associated with the specified option group. Changing this
     * parameter does not result in an outage except in the following case, and the change is applied during the next
     * maintenance window unless the ApplyImmediately parameter is set to true for this
     * request. If the parameter change results in an option group that enables OEM, this change can cause a brief
     * (sub-second) period during which new connections are rejected but existing connections are not interrupted.
     *

     *

     * Permanent options cannot be removed from an option group. The option group cannot be removed from a DB cluster
     * once it is associated with a DB cluster.
     *

     *
     * @return A value that indicates that the DB cluster should be associated with the specified option group. Changing
     *         this parameter does not result in an outage except in the following case, and the change is applied
     *         during the next maintenance window unless the ApplyImmediately parameter is set to
     *         true for this request. If the parameter change results in an option group that enables OEM,
     *         this change can cause a brief (sub-second) period during which new connections are rejected but existing
     *         connections are not interrupted.

     *

     *         Permanent options cannot be removed from an option group. The option group cannot be removed from a DB
     *         cluster once it is associated with a DB cluster.
     */

    public String getOptionGroupName() {
        return this.optionGroupName;
    }

    /**
     *

     * A value that indicates that the DB cluster should be associated with the specified option group. Changing this
     * parameter does not result in an outage except in the following case, and the change is applied during the next
     * maintenance window unless the ApplyImmediately parameter is set to true for this
     * request. If the parameter change results in an option group that enables OEM, this change can cause a brief
     * (sub-second) period during which new connections are rejected but existing connections are not interrupted.
     *

     *

     * Permanent options cannot be removed from an option group. The option group cannot be removed from a DB cluster
     * once it is associated with a DB cluster.
     *

     *
     * @param optionGroupName
     *        A value that indicates that the DB cluster should be associated with the specified option group. Changing
     *        this parameter does not result in an outage except in the following case, and the change is applied during
     *        the next maintenance window unless the ApplyImmediately parameter is set to true
     *        for this request. If the parameter change results in an option group that enables OEM, this change can
     *        cause a brief (sub-second) period during which new connections are rejected but existing connections are
     *        not interrupted.

     *

     *        Permanent options cannot be removed from an option group. The option group cannot be removed from a DB
     *        cluster once it is associated with a DB cluster.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withOptionGroupName(String optionGroupName) {
        setOptionGroupName(optionGroupName);
        return this;
    }

    /**
     *

     * The daily time range during which automated backups are created if automated backups are enabled, using the
     * BackupRetentionPeriod parameter.
     *

     *

     * Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time blocks
     * available, see  Adjusting the
     * Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be in the format hh24:mi-hh24:mi.
     *

     *

     *

     *

     * Times should be in Universal Coordinated Time (UTC).
     *

     *

     *

     *

     * Must not conflict with the preferred maintenance window.
     *

     *

     *

     *

     * Must be at least 30 minutes.
     *

     *

     *

     *
     * @param preferredBackupWindow
     *        The daily time range during which automated backups are created if automated backups are enabled, using
     *        the BackupRetentionPeriod parameter.

     *

     *        Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time
     *        blocks available, see  Adjusting
     *        the Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     *        Constraints:
     *

     *

     *

     *

     *        Must be in the format hh24:mi-hh24:mi.
     *

     *

     *

     *

     *        Times should be in Universal Coordinated Time (UTC).
     *

     *

     *

     *

     *        Must not conflict with the preferred maintenance window.
     *

     *

     *

     *

     *        Must be at least 30 minutes.
     *

     *

     */

    public void setPreferredBackupWindow(String preferredBackupWindow) {
        this.preferredBackupWindow = preferredBackupWindow;
    }

    /**
     *

     * The daily time range during which automated backups are created if automated backups are enabled, using the
     * BackupRetentionPeriod parameter.
     *

     *

     * Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time blocks
     * available, see  Adjusting the
     * Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be in the format hh24:mi-hh24:mi.
     *

     *

     *

     *

     * Times should be in Universal Coordinated Time (UTC).
     *

     *

     *

     *

     * Must not conflict with the preferred maintenance window.
     *

     *

     *

     *

     * Must be at least 30 minutes.
     *

     *

     *

     *
     * @return The daily time range during which automated backups are created if automated backups are enabled, using
     *         the BackupRetentionPeriod parameter.

     *

     *         Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time
     *         blocks available, see
     *         Adjusting the Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     *         Constraints:
     *

     *

     *

     *

     *         Must be in the format hh24:mi-hh24:mi.
     *

     *

     *

     *

     *         Times should be in Universal Coordinated Time (UTC).
     *

     *

     *

     *

     *         Must not conflict with the preferred maintenance window.
     *

     *

     *

     *

     *         Must be at least 30 minutes.
     *

     *

     */

    public String getPreferredBackupWindow() {
        return this.preferredBackupWindow;
    }

    /**
     *

     * The daily time range during which automated backups are created if automated backups are enabled, using the
     * BackupRetentionPeriod parameter.
     *

     *

     * Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time blocks
     * available, see  Adjusting the
     * Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     * Constraints:
     *

     *

     *

     *

     * Must be in the format hh24:mi-hh24:mi.
     *

     *

     *

     *

     * Times should be in Universal Coordinated Time (UTC).
     *

     *

     *

     *

     * Must not conflict with the preferred maintenance window.
     *

     *

     *

     *

     * Must be at least 30 minutes.
     *

     *

     *

     *
     * @param preferredBackupWindow
     *        The daily time range during which automated backups are created if automated backups are enabled, using
     *        the BackupRetentionPeriod parameter.

     *

     *        Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time
     *        blocks available, see  Adjusting
     *        the Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     *        Constraints:
     *

     *

     *

     *

     *        Must be in the format hh24:mi-hh24:mi.
     *

     *

     *

     *

     *        Times should be in Universal Coordinated Time (UTC).
     *

     *

     *

     *

     *        Must not conflict with the preferred maintenance window.
     *

     *

     *

     *

     *        Must be at least 30 minutes.
     *

     *

     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withPreferredBackupWindow(String preferredBackupWindow) {
        setPreferredBackupWindow(preferredBackupWindow);
        return this;
    }

    /**
     *

     * The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
     *

     *

     * Format: ddd:hh24:mi-ddd:hh24:mi
     *

     *

     * Default: A 30-minute window selected at random from an 8-hour block of time per region, occurring on a random day
     * of the week. To see the time blocks available, see  Adjusting the
     * Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     * Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
     *

     *

     * Constraints: Minimum 30-minute window.
     *

     *
     * @param preferredMaintenanceWindow
     *        The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).

     *

     *        Format: ddd:hh24:mi-ddd:hh24:mi
     *

     *

     *        Default: A 30-minute window selected at random from an 8-hour block of time per region, occurring on a
     *        random day of the week. To see the time blocks available, see  Adjusting
     *        the Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     *        Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
     *

     *

     *        Constraints: Minimum 30-minute window.
     */

    public void setPreferredMaintenanceWindow(String preferredMaintenanceWindow) {
        this.preferredMaintenanceWindow = preferredMaintenanceWindow;
    }

    /**
     *

     * The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
     *

     *

     * Format: ddd:hh24:mi-ddd:hh24:mi
     *

     *

     * Default: A 30-minute window selected at random from an 8-hour block of time per region, occurring on a random day
     * of the week. To see the time blocks available, see  Adjusting the
     * Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     * Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
     *

     *

     * Constraints: Minimum 30-minute window.
     *

     *
     * @return The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).

     *

     *         Format: ddd:hh24:mi-ddd:hh24:mi
     *

     *

     *         Default: A 30-minute window selected at random from an 8-hour block of time per region, occurring on a
     *         random day of the week. To see the time blocks available, see
     *         Adjusting the Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     *         Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
     *

     *

     *         Constraints: Minimum 30-minute window.
     */

    public String getPreferredMaintenanceWindow() {
        return this.preferredMaintenanceWindow;
    }

    /**
     *

     * The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
     *

     *

     * Format: ddd:hh24:mi-ddd:hh24:mi
     *

     *

     * Default: A 30-minute window selected at random from an 8-hour block of time per region, occurring on a random day
     * of the week. To see the time blocks available, see  Adjusting the
     * Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     * Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
     *

     *

     * Constraints: Minimum 30-minute window.
     *

     *
     * @param preferredMaintenanceWindow
     *        The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).

     *

     *        Format: ddd:hh24:mi-ddd:hh24:mi
     *

     *

     *        Default: A 30-minute window selected at random from an 8-hour block of time per region, occurring on a
     *        random day of the week. To see the time blocks available, see  Adjusting
     *        the Preferred Maintenance Window in the Amazon RDS User Guide.
     *

     *

     *        Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
     *

     *

     *        Constraints: Minimum 30-minute window.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withPreferredMaintenanceWindow(String preferredMaintenanceWindow) {
        setPreferredMaintenanceWindow(preferredMaintenanceWindow);
        return this;
    }

    /**
     *

     * A Boolean value that is true to enable mapping of AWS Identity and Access Management (IAM) accounts to database
     * accounts, and otherwise false.
     *

     *

     * Default: false
     *

     *
     * @param enableIAMDatabaseAuthentication
     *        A Boolean value that is true to enable mapping of AWS Identity and Access Management (IAM) accounts to
     *        database accounts, and otherwise false.

     *

     *        Default: false
     */

    public void setEnableIAMDatabaseAuthentication(Boolean enableIAMDatabaseAuthentication) {
        this.enableIAMDatabaseAuthentication = enableIAMDatabaseAuthentication;
    }

    /**
     *

     * A Boolean value that is true to enable mapping of AWS Identity and Access Management (IAM) accounts to database
     * accounts, and otherwise false.
     *

     *

     * Default: false
     *

     *
     * @return A Boolean value that is true to enable mapping of AWS Identity and Access Management (IAM) accounts to
     *         database accounts, and otherwise false.

     *

     *         Default: false
     */

    public Boolean getEnableIAMDatabaseAuthentication() {
        return this.enableIAMDatabaseAuthentication;
    }

    /**
     *

     * A Boolean value that is true to enable mapping of AWS Identity and Access Management (IAM) accounts to database
     * accounts, and otherwise false.
     *

     *

     * Default: false
     *

     *
     * @param enableIAMDatabaseAuthentication
     *        A Boolean value that is true to enable mapping of AWS Identity and Access Management (IAM) accounts to
     *        database accounts, and otherwise false.

     *

     *        Default: false
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyDBClusterRequest withEnableIAMDatabaseAuthentication(Boolean enableIAMDatabaseAuthentication) {
        setEnableIAMDatabaseAuthentication(enableIAMDatabaseAuthentication);
        return this;
    }

    /**
     *

     * A Boolean value that is true to enable mapping of AWS Identity and Access Management (IAM) accounts to database
     * accounts, and otherwise false.
     *

     *

     * Default: false
     *

     *
     * @return A Boolean value that is true to enable mapping of AWS Identity and Access Management (IAM) accounts to
     *         database accounts, and otherwise false.

     *

     *         Default: false
     */

    public Boolean isEnableIAMDatabaseAuthentication() {
        return this.enableIAMDatabaseAuthentication;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getDBClusterIdentifier() != null)
            sb.append("DBClusterIdentifier: ").append(getDBClusterIdentifier()).append(",");
        if (getNewDBClusterIdentifier() != null)
            sb.append("NewDBClusterIdentifier: ").append(getNewDBClusterIdentifier()).append(",");
        if (getApplyImmediately() != null)
            sb.append("ApplyImmediately: ").append(getApplyImmediately()).append(",");
        if (getBackupRetentionPeriod() != null)
            sb.append("BackupRetentionPeriod: ").append(getBackupRetentionPeriod()).append(",");
        if (getDBClusterParameterGroupName() != null)
            sb.append("DBClusterParameterGroupName: ").append(getDBClusterParameterGroupName()).append(",");
        if (getVpcSecurityGroupIds() != null)
            sb.append("VpcSecurityGroupIds: ").append(getVpcSecurityGroupIds()).append(",");
        if (getPort() != null)
            sb.append("Port: ").append(getPort()).append(",");
        if (getMasterUserPassword() != null)
            sb.append("MasterUserPassword: ").append(getMasterUserPassword()).append(",");
        if (getOptionGroupName() != null)
            sb.append("OptionGroupName: ").append(getOptionGroupName()).append(",");
        if (getPreferredBackupWindow() != null)
            sb.append("PreferredBackupWindow: ").append(getPreferredBackupWindow()).append(",");
        if (getPreferredMaintenanceWindow() != null)
            sb.append("PreferredMaintenanceWindow: ").append(getPreferredMaintenanceWindow()).append(",");
        if (getEnableIAMDatabaseAuthentication() != null)
            sb.append("EnableIAMDatabaseAuthentication: ").append(getEnableIAMDatabaseAuthentication());
        sb.append("}");
        return sb.toString();
    }

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

        if (obj instanceof ModifyDBClusterRequest == false)
            return false;
        ModifyDBClusterRequest other = (ModifyDBClusterRequest) obj;
        if (other.getDBClusterIdentifier() == null ^ this.getDBClusterIdentifier() == null)
            return false;
        if (other.getDBClusterIdentifier() != null && other.getDBClusterIdentifier().equals(this.getDBClusterIdentifier()) == false)
            return false;
        if (other.getNewDBClusterIdentifier() == null ^ this.getNewDBClusterIdentifier() == null)
            return false;
        if (other.getNewDBClusterIdentifier() != null && other.getNewDBClusterIdentifier().equals(this.getNewDBClusterIdentifier()) == false)
            return false;
        if (other.getApplyImmediately() == null ^ this.getApplyImmediately() == null)
            return false;
        if (other.getApplyImmediately() != null && other.getApplyImmediately().equals(this.getApplyImmediately()) == false)
            return false;
        if (other.getBackupRetentionPeriod() == null ^ this.getBackupRetentionPeriod() == null)
            return false;
        if (other.getBackupRetentionPeriod() != null && other.getBackupRetentionPeriod().equals(this.getBackupRetentionPeriod()) == false)
            return false;
        if (other.getDBClusterParameterGroupName() == null ^ this.getDBClusterParameterGroupName() == null)
            return false;
        if (other.getDBClusterParameterGroupName() != null && other.getDBClusterParameterGroupName().equals(this.getDBClusterParameterGroupName()) == false)
            return false;
        if (other.getVpcSecurityGroupIds() == null ^ this.getVpcSecurityGroupIds() == null)
            return false;
        if (other.getVpcSecurityGroupIds() != null && other.getVpcSecurityGroupIds().equals(this.getVpcSecurityGroupIds()) == false)
            return false;
        if (other.getPort() == null ^ this.getPort() == null)
            return false;
        if (other.getPort() != null && other.getPort().equals(this.getPort()) == false)
            return false;
        if (other.getMasterUserPassword() == null ^ this.getMasterUserPassword() == null)
            return false;
        if (other.getMasterUserPassword() != null && other.getMasterUserPassword().equals(this.getMasterUserPassword()) == false)
            return false;
        if (other.getOptionGroupName() == null ^ this.getOptionGroupName() == null)
            return false;
        if (other.getOptionGroupName() != null && other.getOptionGroupName().equals(this.getOptionGroupName()) == false)
            return false;
        if (other.getPreferredBackupWindow() == null ^ this.getPreferredBackupWindow() == null)
            return false;
        if (other.getPreferredBackupWindow() != null && other.getPreferredBackupWindow().equals(this.getPreferredBackupWindow()) == false)
            return false;
        if (other.getPreferredMaintenanceWindow() == null ^ this.getPreferredMaintenanceWindow() == null)
            return false;
        if (other.getPreferredMaintenanceWindow() != null && other.getPreferredMaintenanceWindow().equals(this.getPreferredMaintenanceWindow()) == false)
            return false;
        if (other.getEnableIAMDatabaseAuthentication() == null ^ this.getEnableIAMDatabaseAuthentication() == null)
            return false;
        if (other.getEnableIAMDatabaseAuthentication() != null
                && other.getEnableIAMDatabaseAuthentication().equals(this.getEnableIAMDatabaseAuthentication()) == false)
            return false;
        return true;
    }

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

        hashCode = prime * hashCode + ((getDBClusterIdentifier() == null) ? 0 : getDBClusterIdentifier().hashCode());
        hashCode = prime * hashCode + ((getNewDBClusterIdentifier() == null) ? 0 : getNewDBClusterIdentifier().hashCode());
        hashCode = prime * hashCode + ((getApplyImmediately() == null) ? 0 : getApplyImmediately().hashCode());
        hashCode = prime * hashCode + ((getBackupRetentionPeriod() == null) ? 0 : getBackupRetentionPeriod().hashCode());
        hashCode = prime * hashCode + ((getDBClusterParameterGroupName() == null) ? 0 : getDBClusterParameterGroupName().hashCode());
        hashCode = prime * hashCode + ((getVpcSecurityGroupIds() == null) ? 0 : getVpcSecurityGroupIds().hashCode());
        hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode());
        hashCode = prime * hashCode + ((getMasterUserPassword() == null) ? 0 : getMasterUserPassword().hashCode());
        hashCode = prime * hashCode + ((getOptionGroupName() == null) ? 0 : getOptionGroupName().hashCode());
        hashCode = prime * hashCode + ((getPreferredBackupWindow() == null) ? 0 : getPreferredBackupWindow().hashCode());
        hashCode = prime * hashCode + ((getPreferredMaintenanceWindow() == null) ? 0 : getPreferredMaintenanceWindow().hashCode());
        hashCode = prime * hashCode + ((getEnableIAMDatabaseAuthentication() == null) ? 0 : getEnableIAMDatabaseAuthentication().hashCode());
        return hashCode;
    }

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

}


text:
package net.sf.kerner.utils.pair;

import java.util.Map.Entry;

/**
 *
 * Simple key-value mapping.
 *

 * {@code key} must not be {@code null}; {@code value} may be {@code null}.
 *

 *
 *

 * Example:

 *
 *

 *

 *
 *

 * TODO example
 *

 *
 *

 *

 * Threading:

 *
 *

 *

 *
 *

 * Not thread save.
 *

 *
 *

 *

 * last reviewed: 0000-00-00
 *

 *
 * @author Alexander Kerner
 *
 * @param <K>
 *            type of first object
 * @param <V>
 *            type of second object
 */
public class KeyValue<K, V> implements Entry<K, V>, Pair<K, V> {

    /**
	 *
	 */
    private final K key;

    /**
	 *
	 */
    private volatile V value;

    /**
     * Create a new {@code KeyValue} object, using given key.
     *
     * @param key
     *            key for this key-value-mapping
     * @throws NullPointerException
     *             if given {@code key} is {@code null}
     */
    public KeyValue(final K key) {
        if (key == null)
            throw new NullPointerException("key must not be null");
        this.key = key;
        this.value = null;
    }

    /**
     * Create a new {@code KeyValue} object, using given key and value.
     *
     * @param key
     *            key for this key-value-mapping
     * @param value
     *            value for this key-value-mapping
     * @throws NullPointerException
     *             if given {@code key} is {@code null}
     */
    public KeyValue(final K key, final V value) {
        if (key == null)
            throw new NullPointerException("key must not be null");
        this.key = key;
        this.value = value;
    }

    /**
     * Create a new {@code KeyValue} object, using given {@code KeyValue} as a
     * template.
     *
     * @param template
     *            {@code KeyValue} template
     */
    public KeyValue(final KeyValue<K, V> template) {
        this(template.getKey(), template.getValue());
    }

    @Override
    public KeyValue<K, V> clone() {
        return new KeyValue<K, V>(getKey(), getValue());
    }

    /**
     * In contrast to {@link Pair}, {@code KeyValue(1,2)} does not equal
     * {@code KeyValue(2,1)}.
     *
     */
    @Override
    public boolean equals(final Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (!(obj instanceof KeyValue))
            return false;
        @SuppressWarnings("rawtypes")
        final KeyValue other = (KeyValue) obj;
        if (key == null) {
            if (other.key != null)
                return false;
        } else if (!key.equals(other.key))
            return false;
        if (value == null) {
            if (other.value != null)
                return false;
        } else if (!value.equals(other.value))
            return false;
        return true;
    }

    /**
     * Same as {@link KeyValue#getKey()}.
     */
    public K getFirst() {
        return getKey();
    }

    /**
     * Return the key for this key-value-mapping
     */
    public K getKey() {
        return key;
    }

    /**
     * Same as {@link KeyValue#getValue()}.
     */
    public V getSecond() {
        return getValue();
    }

    /**
     * Return the value for this key-value-mapping
     */
    public V getValue() {
        return value;
    }

    /**
     * In contrast to {@link Pair}, {@code KeyValue(1,2).hashCode()} does
     * not equal {@code KeyValue(2,1).hashCode()}.
     *
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((key == null) ? 0 : key.hashCode());
        result = prime * result + ((value == null) ? 0 : value.hashCode());
        return result;
    }

    public KeyValue<V, K> invert() {
        return new KeyValue<V, K>(getValue(), getKey());
    }

    /**
     * Set the value for this key-value-mapping, return the previous value
     * mapped by this key-value-mapping
     */
    public V setValue(final V value) {
        final V result = this.value;
        this.value = value;
        return result;
    }

    @Override
    public String toString() {
        return key + "=" + value;
    }

}


text:
package mariculture.diving;

import mariculture.core.helpers.PlayerHelper;
import mariculture.core.lib.ArmorSlot;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.entity.player.EntityPlayer;

public class DivingBoots {
    public static void init(EntityPlayer player) {
        if (player.isInWater() && !player.capabilities.isFlying) {
            if (GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindForward)) {
                if (PlayerHelper.hasArmor(player, ArmorSlot.FEET, Diving.divingBoots)) {
                    player.motionX *= 1.13D;
                    player.motionY *= 0.98D;
                    player.motionZ *= 1.13D;
                }
            } else if (player.isSneaking() && PlayerHelper.hasArmor(player, ArmorSlot.FEET, Diving.divingBoots)) {
                player.motionY = -0.55D;
            }
        }
    }
}


text:
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { TestRsInputComponent } from './fields/samples/test-rs-input.component';

import { SampleComponent } from './employees/forms/dynamic-reactive-form/sample.component';

const appRoutes: Routes = [
  { path: '', redirectTo: '/home', pathMatch: 'full' },
  { path: 'test', component: TestRsInputComponent},
  { path: 'DynamicForms', component: SampleComponent},

];

@NgModule({
  imports: [
    RouterModule.forRoot(
      appRoutes
    )
  ],
  exports: [
    RouterModule
  ]
})
export class AppRoutingModule { }


text:
layout: page
title: Hackathons
permalink: /hackathons/
---

Upcoming Hackathon opportunities Spring 2017

    {% for item in site.data.hackathons %}

{{ item[1].name }}

{{ item[1].date }}

{{ item[1].location }}

Register

    {% endfor %}

  Find out more hackathons:

Major League Hacking

Devpost

Hackalist

Hackerearth

WearHacks

If you find out about a hackathon that a UCC student may attend, please feel free to contact any of the DMCS Team Members, or create a Pull Request or Issue.

About Hackathons

What is a Hackathon?

 Hackathon /ˈhakəθɒn/:

An event, typically lasting several days, in which a large number of people meet to engage in collaborative computer programming.

Who is invited?

Any university or high school student at any skill level! If you're a student interested in technology and innovation. Some hackathons require high school students to be 18+ to attend.

Where is it?

At host universities' or organizations' safe hacking space! You will be staying there for the entire hackathon. There will usually be buses running from Toronto, if not, travel reimbursement will be given.

How much does this cost?

Absolutely nothing! Not a dime! There will also be partial or full travel reimbursement. There are also going to be tons of free food, drinks, t-shirts, and swags!

What if I don't have a team?

Don't worry! There will always be team formation sessions for you to find the people you want to work with. Working with new people is always an amazing experience!

What if I don't have an idea?

Find any problems in real life and try to use technologies to solve it! Also, stay tuned for lists of company APIs and hardware at the hackathon to spark some insightful thoughts as well.

Can I work on a past project?

No! All projects need to be worked on from scratch at the event. You'll have enough time to make something you can be proud of. Preparing beforehand defeats the purpose of a hackathon.

What if I'm new to programming?

That's okay! A hackathon is a great place to get some experience and learn something. There will be tutorials, workshops, and mentors to help you along the way to perfection for your project.

What can I create?

Anything you want, whether it's a new mobile app, website, or cool hardware hack, there will be a plethora of possibilities for your hacking wonders!

What should I bring?

Bring whatever you need to hack with: A laptop, laptop charger, sleeping bag, hardware that you need to hack with, valid ID, passport (if international hackathon), change of clothes and a toothbrush.

How will my project be judged?

Industry experts will eagerly be viewing your projects towards during the demo session. They'll have intriguing questions and will choose their favorites, and the winners will be selected from there.

Still have questions? Please feel free to contact any of the DMCS Team Members.


text:
package org.wte4j;

import java.util.List;

public interface FormatterFactory {

	/**
	 * Creates a new formatter instance
	 *
	 * @param name
	 *            - the name of a formatter
	 * @param args
	 *            - a list of args to construct the formatter
	 * @return a new formatter instance
	 * @throws UnknownFormatterException
	 *             - if the formatter with the given name does not exists
	 * @throws InstantiationException
	 *             -if for the given arguments the formatter can not be build
	 */

	Formatter createFormatter(String name, List<String> args) throws UnknownFormatterException, FormatterInstantiationException;

	/**
	 * Creates a new formatter instance for a given type.
	 *
	 * @throws FormatterInstantiationException
	 *             if a new Instance can not be created.
	 */
	Formatter createDefaultFormatter(Class<?> type) throws FormatterInstantiationException;

}


text:
package teetime.util.stage.io.network;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;

import org.slf4j.Logger;

public abstract class AbstractTcpReader implements Runnable {

	@SuppressWarnings("PMD.LoggerIsNotStaticFinal")
	protected final Logger logger;

	private final int port;
	private final int bufferCapacity;

	private volatile boolean terminated;

	public AbstractTcpReader(final int port, final int bufferCapacity, final Logger logger) {
		super();
		this.port = port;
		this.bufferCapacity = bufferCapacity;
		this.logger = logger;
	}

	@Override
	public final void run() {
		ServerSocketChannel serversocket = null;
		try {
			serversocket = ServerSocketChannel.open();
			serversocket.socket().bind(new InetSocketAddress(this.port));
			if (logger.isDebugEnabled()) {
				logger.debug("Listening on port " + this.port);
			}

			final SocketChannel socketChannel = serversocket.accept();
			try {
				final ByteBuffer buffer = ByteBuffer.allocateDirect(bufferCapacity);
				while (socketChannel.read(buffer) != -1 && !terminated) {
					process(buffer);
				}
			} finally {
				socketChannel.close();
			}
		} catch (final IOException ex) {
			logger.error("Error while reading.", ex);
		} finally {
			if (null != serversocket) {
				try {
					serversocket.close();
				} catch (final IOException e) {
					logger.debug("Failed to close TCP connection.", e);
				}
			}
		}
	}

	private void process(final ByteBuffer buffer) {
		buffer.flip();
		try {
			while (buffer.hasRemaining()) {
				buffer.mark();
				boolean success = this.onBufferReceived(buffer);
				if (!success) {
					buffer.reset();
					buffer.compact();
					return;
				}
			}
			buffer.clear();
		} catch (final BufferUnderflowException ex) {
			logger.warn("Unexpected buffer underflow. Resetting and compacting buffer.", ex);
			buffer.reset();
			buffer.compact();
		}
	}

	/**
	 * @param buffer
	 *            to be read from
	 * @return
	 *

	 *
true when there were enough bytes to perform the read operation
	 *
false otherwise. In this case, the buffer is reset, compacted, and filled with new content.
	 *

	 */
	protected abstract boolean onBufferReceived(final ByteBuffer buffer);

	public void terminate() {
		this.terminated = true;
	}

	public int getPort() {
		return port;
	}
}


text:
set -ex

# avoid slow finalization after the script has exited.
source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc

# change to grpc repo root
cd $(dirname $0)/../../..

source tools/internal_ci/helper_scripts/prepare_build_linux_rc

# Build all PHP linux artifacts
tools/run_tests/task_runner.py -f artifact linux php ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x build_artifacts/sponge_log.xml || FAILED="true"

# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
rm -rf input_artifacts
mkdir -p input_artifacts
cp -r artifacts/* input_artifacts/ || true
rm -rf artifacts_from_build_artifacts_step
mv artifacts artifacts_from_build_artifacts_step || true

# This step simply collects php artifacts from subdirectories of input_artifacts/ and copies them to artifacts/
tools/run_tests/task_runner.py -f package linux php -x build_packages/sponge_log.xml || FAILED="true"

# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
# in addition to that, preserve the contents of "artifacts" directory since we want kokoro
# to upload its contents as job output artifacts
rm -rf input_artifacts
mkdir -p input_artifacts
cp -r artifacts/* input_artifacts/ || true

# Run all PHP linux distribtests
# We run the distribtests even if some of the artifacts have failed to build, since that gives
# a better signal about which distribtest are affected by the currently broken artifact builds.
tools/run_tests/task_runner.py -f distribtest linux php ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x distribtests/sponge_log.xml || FAILED="true"

tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh

if [ "$FAILED" != "" ]
then
  exit 1
fi


text:
| master  |  [license](LICENSE) |
|---------|---------------------|
|[![Build Status](https://travis-ci.org/calabash/calabash-ios-example.svg?branch=master)](https://travis-ci.org/calabash/calabash-ios-example)| [![License](https://img.shields.io/badge/licence-MIT-blue.svg)](http://opensource.org/licenses/MIT)|

## LPSimpleExample

This project demonstrates how to integrate Calabash into an existing Xcode
project and provides an introduction to UI testing with Calabash.

If you have any trouble building the app on the command line, please see
the **xcpretty** and **Code Signing** sections for debugging tips.

### Requirements

* MacOS 10.10 or 10.11
* Xcode 6 or 7
* iOS Devices >= 7.1
* iOS Simulators >= 8.0
* ruby >= 2.0 (latest is preferred)

We recommend a managed ruby environment like rbenv or rvm.  If you are
installing gems with sudo, please see our [guide on why you should stop](https://github.com/calabash/calabash-ios/wiki/Best-Practice:--Never-install-gems-with-sudo).

Bundler needs to be installed.

```
$ gem install bundler
```

### Step 1: Install calabash.framework

You can find complete tutorials on the [Tutorial: How to add Calabash to
Xcode](https://github.com/calabash/calabash-ios/wiki/Tutorial%3A-How-to-add-Calabash-to-Xcode)
page of the Calabash iOS wiki.  To get started quickly, we'll use the
_Debug Config_ approach.

```
# Install the necessary gems
$ bundle update

# Make sure you can build the app
$ make app

# Download the last calabash.framework
$ bundle exec calabash-ios download
```

Open Xcode and update the Linker Flags for the Debug Configuration.

![alt text](https://cloud.githubusercontent.com/assets/466104/10670656/c9c97312-78e6-11e5-8214-750a47a065eb.png "Link calabash.framework")

These are the linker flags:

```
-ObjC -force_load "$(SOURCE_ROOT)/calabash.framework/calabash" -framework CFNetwork
```

Try to build and run on an iOS Simulator from Xcode   In the Console you should see
output like this:

```
DEBUG CalabashServer:222 | Creating the server: <LPHTTPServer: 0x7fe97a507ef0>
DEBUG CalabashServer:223 | Calabash iOS server version: CALABASH VERSION: 0.16.4
```

### Step 2: Run cucumber

```
# Generate a features dir
$ bundle exec calabash-ios gen

# Tell Calabash where your app is (see Where is are the .app and ipa? below)
$ export APP=Products/app/LPSimpleExample.app

# Try running cucumber
$ bundle exec cucumber
```

### Step 3: Open a console

```
# The console is a ruby irb
$ bundle exec calabash-ios console

# Launch the app with Calabash.
> start_test_server_in_background

# Type some text
> query("* marked:'Name'")
> touch("* marked:'Name'")
> keyboard_enter_text("Hello!")
```

### Where to go from here?

| Topic | Description |
|-------|-------------|
| [Getting Started](https://github.com/calabash/calabash-ios/wiki/Getting-Started) | A more in-depth tutorial using this app. |
| [Testing on Physical Devices](https://github.com/calabash/calabash-ios/wiki/Testing-on-Physical-Devices) | Everything you need to know about testing on physical devices. |
| [API Docs](http://calabashapi.xamarin.com/ios) | The Calabash iOS ruby API |
| [iOS Smoke Test App](https://github.com/calabash/ios-smoke-test-app) | Demonstrates advanced features, setups, and workflows|
| [iOS WebView Test App](https://github.com/calabash/ios-webview-test-app) | Demonstrates how to interact with UIWebView and WKWebView|
| [Getting Help](https://github.com/calabash/calabash-ios/wiki) | The Calabash iOS Wiki |

### Where are the .app and .ipa?

This project includes a [Run Phase build script](https://github.com/calabash/calabash-ios-example/blob/master/bin/xcode-build-phase/stage-LPSimpleExample-products.sh) that copies binaries built by Xcode to a local `Products/` directory - this is the same directory that the [make rules](https://github.com/calabash/calabash-ios-example/blob/master/Makefile) stage their build products. We encourage you to use this technique to ensure that you are always testing the most recent build of your app - whether it was built with Xcode or from the command line.

## Troubleshooting

### xcpretty

https://github.com/supermarin/xcpretty

We use xcpretty to make builds faster and to reduce the amount of
logging.  Travis CI, for example, has a limit on the number of lines of
logging that can be generated; xcodebuild breaks this limit.

The only problem with xcpretty is that it does not report build errors
very well.  If you encounter an issue with any of the make rules, run
without xcpretty:

```
$ XCPRETTY=0 make ipa
```

### Code Signing

If you have multiple code signing identities, you might need to set the
`CODE_SIGN_IDENTITY` variable for the make scripts.  If you are running
with xcpretty, you might see output like this:

```
$ make ipa
** INSTALL FAILED **

The following build commands failed:
        PhaseScriptExecution Run\ Script\ Add\ Calabash\ dylibs\ to\
Bundle
<snip>/Debug-iphoneos/CalSmoke.build/Script-F51F2E8E1AB359A6002326D0.sh
```

Try again without xpretty to reveal the problem:

```
$ XCPRETTY=0 make ipa
iPhone Developer: ambiguous (matches "iPhone Developer: Some Developer
(89543FK9SZ)" and "iPhone Developer: Some Other Developer (7QJQJFT49Q)"
Command /bin/sh failed with exit code 1

** INSTALL FAILED **
```

Fix this problem by telling Xcode which identity to use:

```
$ export CODE_SIGN_IDENTITY="iPhone Developer: Joshua Moody (7QJQJFT49Q)"
$ make ipa
```


text: import 'antd/lib/time-picker/style/index'


text:
import { Component } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ILuModalContent, LuModal, LuModalModule } from '@lucca-front/ng/modal';
import { Meta, moduleMetadata, Story } from '@storybook/angular';
import { map, shareReplay, timer } from 'rxjs';

@Component({
	selector: 'modal-content',
	standalone: true,
	template: '
General Kenobi
'
})
class ModalContentComponent implements ILuModalContent {
	title = 'Hello there'
	submitAction = () => {};
}

@Component({
	selector: 'modal-content',
	standalone: true,
	template: '
General Kenobi
'
})
class ModalDynamicContentComponent implements ILuModalContent {
	counter$ = timer(0, 1000).pipe(shareReplay({ refCount: true, bufferSize: 1 }))

	title = this.counter$.pipe(map(n => `Title #${n}`));
	submitLabel = this.counter$.pipe(map(n => `Submit #${n}`));
	cancelLabel = this.counter$.pipe(map(n => `Cancel #${n}`));
	submitCounter = this.counter$;
	submitDisabled = this.counter$.pipe(map(n => n % 2 === 0));

	submitAction = () => {};
}

@Component({
	selector: 'modal-stories',
	template: `
		<button type="button" class="button" (click)="openModal()">Open modal</button>
		<button type="button" class="button" (click)="openDynamicContentModal()">Open dynamic modal</button>
	`,
}) class ModalStories {
	constructor(
		private modal: LuModal
	) { }

	public openModal() {
		this.modal.open(ModalContentComponent);
	}

	public openDynamicContentModal() {
		this.modal.open(ModalDynamicContentComponent);
	}
}

export default {
	title: 'Documentation/Overlays/Modal',
	component: ModalStories,
	decorators: [
		moduleMetadata({
			imports: [
				LuModalModule,
				BrowserAnimationsModule,
			]
		})
	],
} as Meta;

const Template: Story<ModalStories> = (args: ModalStories) => ({
	props: args,
});

export const Basic = Template.bind({});
Basic.args = {}
Basic.parameters = {
	docs: {
		source: {
			language: 'ts',
			type: 'code',
			code: `
/* 1. Importer LuModalModule */
import { LuModalModule } from '@lucca-front/ng/modal';

@NgModule({
	imports: [LuModalModule]
})
class ModalStoriesModule {}

/* 2. Créer le composant qui sera inclus dans la modale */
@Component({
	selector: 'modal-content',
	template: '
General Kenobi
'
})
class ModalContentComponent implements ILuModalContent {
	title = 'Hello there';
	submitAction = () => {};
}

/* 3. Se faire injecter LuModal dans le composant qui déclenche l'ouverture de la modale puis appeler la méthode open() */
@Component({
	selector: 'modal-stories',
	template: \`<button type="button" class="button" (click)="openModal()">Open modal</button>\`,
}) class ModalStories {
	constructor(
		private modal: LuModal
	) { }

	public openModal() {
		this.modal.open(ModalContentComponent);
	}
}`
		}
	}
};


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="5dp"
    android:paddingRight="5dp"
    android:paddingBottom="5dp"
    android:background="@drawable/background"
    tools:context="com.hansonsoftware.minecraftify.BuildThisActivity">

    <ListView
        android:id="@+id/listview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="135dp" >
    </ListView>

    <ImageView
        android:layout_width="fill_parent"
        android:layout_height="250dp"
        android:background="@drawable/chest"
        android:layout_alignParentBottom="true" />

</RelativeLayout>


text:
package com.peknight.common.function;

/**
 *
 *
 * @author PeKnight
 *
 * Created by PeKnight on 2017/11/1.
 */
public interface Function<T, R> extends java.util.function.Function<T, R> {
    @Override
    R apply(T t);
}


text:
FILE_NAME=$1
DESTINATION=$2
URL=$3
HEADER=$4

if [ -f "$DESTINATION/$FILE_NAME" ]
then
	echo "$DESTINATION/$FILE_NAME is already present, won't download it again."
elif [ -z "$HEADER" ]; then
	echo "$DESTINATION/$FILE_NAME not found. Downloading without header..."
	wget --no-cookies --no-check-certificate -O "$DESTINATION/$FILE_NAME" $URL
	echo "Downloaded $FILE_NAME"
else
	echo "$DESTINATION/$FILE_NAME not found. Downloading with header..."
	wget --no-cookies --no-check-certificate -O "$DESTINATION/$FILE_NAME" --header "$HEADER" $URL
	echo "Downloaded $FILE_NAME"
fi