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

import java.io.Serializable;

import com.amazonaws.AmazonWebServiceRequest;

/**
 * Container for the parameters to the {@link com.amazonaws.services.rds.AmazonRDS#describeDBSnapshots(DescribeDBSnapshotsRequest) DescribeDBSnapshots operation}.
 *

 * Returns information about DB snapshots. This API supports pagination.
 *

 *
 * @see com.amazonaws.services.rds.AmazonRDS#describeDBSnapshots(DescribeDBSnapshotsRequest)
 */
public class DescribeDBSnapshotsRequest extends AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     * A DB instance identifier to retrieve the list of DB snapshots for.
     * This parameter cannot be used in conjunction with
     * DBSnapshotIdentifier. This parameter is not
     * case-sensitive.
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

     */
    private String dBInstanceIdentifier;

    /**
     * A specific DB snapshot identifier to describe. This parameter cannot
     * be used in conjunction with DBInstanceIdentifier. This
     * value is stored as a lowercase string.
Constraints:

Must
     * be 1 to 255 alphanumeric characters.

First character must be
     * a letter.

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

If this is the identifier of an automated snapshot,
     * the SnapshotType parameter must also be specified.

     *

     */
    private String dBSnapshotIdentifier;

    /**
     * The type of snapshots that will be returned. You can specify one of
     * the following values:

automated - Return all DB
     * snapshots that have been automatically taken by Amazon RDS for my AWS
     * account.

manual - Return all DB snapshots that
     * have been taken by my AWS account.

shared -
     * Return all manual DB snapshots that have been shared to my AWS
     * account.

public - Return all DB snapshots that
     * have been marked as public.

If you do not specify a
     * SnapshotType, then both automated and manual snapshots
     * are returned. You can include shared snapshots with these results by
     * setting the IncludeShared parameter to true.
     * You can include public snapshots with these results by setting the
     * IncludePublic parameter to true.
The
     * IncludeShared and IncludePublic parameters
     * do not apply for SnapshotType values of
     * manual or automated. The
     * IncludePublic parameter does not apply when
     * SnapshotType is set to shared. the
     * IncludeShared parameter does not apply when
     * SnapshotType is set to public.
     */
    private String snapshotType;

    /**
     * This parameter is not currently supported.
     */
    private com.amazonaws.internal.ListWithAutoConstructFlag<Filter> filters;

    /**
     * The maximum number of records to include in the response. If more
     * records exist than the specified MaxRecords value, a
     * pagination token called a marker is included in the response so that
     * the remaining results can be retrieved.
Default: 100
     *
Constraints: Minimum 20, maximum 100.
     */
    private Integer maxRecords;

    /**
     * An optional pagination token provided by a previous
     * DescribeDBSnapshots request. If this parameter is
     * specified, the response includes only records beyond the marker, up to
     * the value specified by MaxRecords.
     */
    private String marker;

    /**
     * True to include shared manual DB snapshots from other AWS accounts
     * that this AWS account has been given permission to copy or restore;
     * otherwise false. The default is false.
An AWS account is given
     * permission to restore a manual DB snapshot from another AWS account by
     * the ModifyDBSnapshotAttribute API.
     */
    private Boolean includeShared;

    /**
     * True to include manual DB snapshots that are public and can be copied
     * or restored by any AWS account; otherwise false. The default is false.
     *
An manual DB snapshot is shared as public by the
     * ModifyDBSnapshotAttribute API.
     */
    private Boolean includePublic;

    /**
     * Default constructor for a new DescribeDBSnapshotsRequest object.  Callers should use the
     * setter or fluent setter (with...) methods to initialize this object after creating it.
     */
    public DescribeDBSnapshotsRequest() {}

    /**
     * A DB instance identifier to retrieve the list of DB snapshots for.
     * This parameter cannot be used in conjunction with
     * DBSnapshotIdentifier. This parameter is not
     * case-sensitive.
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

     *
     * @return A DB instance identifier to retrieve the list of DB snapshots for.
     *         This parameter cannot be used in conjunction with
     *         DBSnapshotIdentifier. This parameter is not
     *         case-sensitive.
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

     */
    public String getDBInstanceIdentifier() {
        return dBInstanceIdentifier;
    }

    /**
     * A DB instance identifier to retrieve the list of DB snapshots for.
     * This parameter cannot be used in conjunction with
     * DBSnapshotIdentifier. This parameter is not
     * case-sensitive.
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

     *
     * @param dBInstanceIdentifier A DB instance identifier to retrieve the list of DB snapshots for.
     *         This parameter cannot be used in conjunction with
     *         DBSnapshotIdentifier. This parameter is not
     *         case-sensitive.
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

     */
    public void setDBInstanceIdentifier(String dBInstanceIdentifier) {
        this.dBInstanceIdentifier = dBInstanceIdentifier;
    }

    /**
     * A DB instance identifier to retrieve the list of DB snapshots for.
     * This parameter cannot be used in conjunction with
     * DBSnapshotIdentifier. This parameter is not
     * case-sensitive.
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

     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param dBInstanceIdentifier A DB instance identifier to retrieve the list of DB snapshots for.
     *         This parameter cannot be used in conjunction with
     *         DBSnapshotIdentifier. This parameter is not
     *         case-sensitive.
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

     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeDBSnapshotsRequest withDBInstanceIdentifier(String dBInstanceIdentifier) {
        this.dBInstanceIdentifier = dBInstanceIdentifier;
        return this;
    }

    /**
     * A specific DB snapshot identifier to describe. This parameter cannot
     * be used in conjunction with DBInstanceIdentifier. This
     * value is stored as a lowercase string.
Constraints:

Must
     * be 1 to 255 alphanumeric characters.

First character must be
     * a letter.

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

If this is the identifier of an automated snapshot,
     * the SnapshotType parameter must also be specified.

     *

     *
     * @return A specific DB snapshot identifier to describe. This parameter cannot
     *         be used in conjunction with DBInstanceIdentifier. This
     *         value is stored as a lowercase string.
Constraints:

Must
     *         be 1 to 255 alphanumeric characters.

First character must be
     *         a letter.

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

If this is the identifier of an automated snapshot,
     *         the SnapshotType parameter must also be specified.

     *

     */
    public String getDBSnapshotIdentifier() {
        return dBSnapshotIdentifier;
    }

    /**
     * A specific DB snapshot identifier to describe. This parameter cannot
     * be used in conjunction with DBInstanceIdentifier. This
     * value is stored as a lowercase string.
Constraints:

Must
     * be 1 to 255 alphanumeric characters.

First character must be
     * a letter.

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

If this is the identifier of an automated snapshot,
     * the SnapshotType parameter must also be specified.

     *

     *
     * @param dBSnapshotIdentifier A specific DB snapshot identifier to describe. This parameter cannot
     *         be used in conjunction with DBInstanceIdentifier. This
     *         value is stored as a lowercase string.
Constraints:

Must
     *         be 1 to 255 alphanumeric characters.

First character must be
     *         a letter.

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

If this is the identifier of an automated snapshot,
     *         the SnapshotType parameter must also be specified.

     *

     */
    public void setDBSnapshotIdentifier(String dBSnapshotIdentifier) {
        this.dBSnapshotIdentifier = dBSnapshotIdentifier;
    }

    /**
     * A specific DB snapshot identifier to describe. This parameter cannot
     * be used in conjunction with DBInstanceIdentifier. This
     * value is stored as a lowercase string.
Constraints:

Must
     * be 1 to 255 alphanumeric characters.

First character must be
     * a letter.

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

If this is the identifier of an automated snapshot,
     * the SnapshotType parameter must also be specified.

     *

     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param dBSnapshotIdentifier A specific DB snapshot identifier to describe. This parameter cannot
     *         be used in conjunction with DBInstanceIdentifier. This
     *         value is stored as a lowercase string.
Constraints:

Must
     *         be 1 to 255 alphanumeric characters.

First character must be
     *         a letter.

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

If this is the identifier of an automated snapshot,
     *         the SnapshotType parameter must also be specified.

     *

     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeDBSnapshotsRequest withDBSnapshotIdentifier(String dBSnapshotIdentifier) {
        this.dBSnapshotIdentifier = dBSnapshotIdentifier;
        return this;
    }

    /**
     * The type of snapshots that will be returned. You can specify one of
     * the following values:

automated - Return all DB
     * snapshots that have been automatically taken by Amazon RDS for my AWS
     * account.

manual - Return all DB snapshots that
     * have been taken by my AWS account.

shared -
     * Return all manual DB snapshots that have been shared to my AWS
     * account.

public - Return all DB snapshots that
     * have been marked as public.

If you do not specify a
     * SnapshotType, then both automated and manual snapshots
     * are returned. You can include shared snapshots with these results by
     * setting the IncludeShared parameter to true.
     * You can include public snapshots with these results by setting the
     * IncludePublic parameter to true.
The
     * IncludeShared and IncludePublic parameters
     * do not apply for SnapshotType values of
     * manual or automated. The
     * IncludePublic parameter does not apply when
     * SnapshotType is set to shared. the
     * IncludeShared parameter does not apply when
     * SnapshotType is set to public.
     *
     * @return The type of snapshots that will be returned. You can specify one of
     *         the following values:

automated - Return all DB
     *         snapshots that have been automatically taken by Amazon RDS for my AWS
     *         account.

manual - Return all DB snapshots that
     *         have been taken by my AWS account.

shared -
     *         Return all manual DB snapshots that have been shared to my AWS
     *         account.

public - Return all DB snapshots that
     *         have been marked as public.

If you do not specify a
     *         SnapshotType, then both automated and manual snapshots
     *         are returned. You can include shared snapshots with these results by
     *         setting the IncludeShared parameter to true.
     *         You can include public snapshots with these results by setting the
     *         IncludePublic parameter to true.
The
     *         IncludeShared and IncludePublic parameters
     *         do not apply for SnapshotType values of
     *         manual or automated. The
     *         IncludePublic parameter does not apply when
     *         SnapshotType is set to shared. the
     *         IncludeShared parameter does not apply when
     *         SnapshotType is set to public.
     */
    public String getSnapshotType() {
        return snapshotType;
    }

    /**
     * The type of snapshots that will be returned. You can specify one of
     * the following values:

automated - Return all DB
     * snapshots that have been automatically taken by Amazon RDS for my AWS
     * account.

manual - Return all DB snapshots that
     * have been taken by my AWS account.

shared -
     * Return all manual DB snapshots that have been shared to my AWS
     * account.

public - Return all DB snapshots that
     * have been marked as public.

If you do not specify a
     * SnapshotType, then both automated and manual snapshots
     * are returned. You can include shared snapshots with these results by
     * setting the IncludeShared parameter to true.
     * You can include public snapshots with these results by setting the
     * IncludePublic parameter to true.
The
     * IncludeShared and IncludePublic parameters
     * do not apply for SnapshotType values of
     * manual or automated. The
     * IncludePublic parameter does not apply when
     * SnapshotType is set to shared. the
     * IncludeShared parameter does not apply when
     * SnapshotType is set to public.
     *
     * @param snapshotType The type of snapshots that will be returned. You can specify one of
     *         the following values:

automated - Return all DB
     *         snapshots that have been automatically taken by Amazon RDS for my AWS
     *         account.

manual - Return all DB snapshots that
     *         have been taken by my AWS account.

shared -
     *         Return all manual DB snapshots that have been shared to my AWS
     *         account.

public - Return all DB snapshots that
     *         have been marked as public.

If you do not specify a
     *         SnapshotType, then both automated and manual snapshots
     *         are returned. You can include shared snapshots with these results by
     *         setting the IncludeShared parameter to true.
     *         You can include public snapshots with these results by setting the
     *         IncludePublic parameter to true.
The
     *         IncludeShared and IncludePublic parameters
     *         do not apply for SnapshotType values of
     *         manual or automated. The
     *         IncludePublic parameter does not apply when
     *         SnapshotType is set to shared. the
     *         IncludeShared parameter does not apply when
     *         SnapshotType is set to public.
     */
    public void setSnapshotType(String snapshotType) {
        this.snapshotType = snapshotType;
    }

    /**
     * The type of snapshots that will be returned. You can specify one of
     * the following values:

automated - Return all DB
     * snapshots that have been automatically taken by Amazon RDS for my AWS
     * account.

manual - Return all DB snapshots that
     * have been taken by my AWS account.

shared -
     * Return all manual DB snapshots that have been shared to my AWS
     * account.

public - Return all DB snapshots that
     * have been marked as public.

If you do not specify a
     * SnapshotType, then both automated and manual snapshots
     * are returned. You can include shared snapshots with these results by
     * setting the IncludeShared parameter to true.
     * You can include public snapshots with these results by setting the
     * IncludePublic parameter to true.
The
     * IncludeShared and IncludePublic parameters
     * do not apply for SnapshotType values of
     * manual or automated. The
     * IncludePublic parameter does not apply when
     * SnapshotType is set to shared. the
     * IncludeShared parameter does not apply when
     * SnapshotType is set to public.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param snapshotType The type of snapshots that will be returned. You can specify one of
     *         the following values:

automated - Return all DB
     *         snapshots that have been automatically taken by Amazon RDS for my AWS
     *         account.

manual - Return all DB snapshots that
     *         have been taken by my AWS account.

shared -
     *         Return all manual DB snapshots that have been shared to my AWS
     *         account.

public - Return all DB snapshots that
     *         have been marked as public.

If you do not specify a
     *         SnapshotType, then both automated and manual snapshots
     *         are returned. You can include shared snapshots with these results by
     *         setting the IncludeShared parameter to true.
     *         You can include public snapshots with these results by setting the
     *         IncludePublic parameter to true.
The
     *         IncludeShared and IncludePublic parameters
     *         do not apply for SnapshotType values of
     *         manual or automated. The
     *         IncludePublic parameter does not apply when
     *         SnapshotType is set to shared. the
     *         IncludeShared parameter does not apply when
     *         SnapshotType is set to public.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeDBSnapshotsRequest withSnapshotType(String snapshotType) {
        this.snapshotType = snapshotType;
        return this;
    }

    /**
     * This parameter is not currently supported.
     *
     * @return This parameter is not currently supported.
     */
    public java.util.List<Filter> getFilters() {
        if (filters == null) {
              filters = new com.amazonaws.internal.ListWithAutoConstructFlag<Filter>();
              filters.setAutoConstruct(true);
        }
        return filters;
    }

    /**
     * This parameter is not currently supported.
     *
     * @param filters This parameter is not currently supported.
     */
    public void setFilters(java.util.Collection<Filter> filters) {
        if (filters == null) {
            this.filters = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<Filter> filtersCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Filter>(filters.size());
        filtersCopy.addAll(filters);
        this.filters = filtersCopy;
    }

    /**
     * This parameter is not currently supported.
     *

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

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param filters This parameter is not currently supported.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeDBSnapshotsRequest withFilters(Filter... filters) {
        if (getFilters() == null) setFilters(new java.util.ArrayList<Filter>(filters.length));
        for (Filter value : filters) {
            getFilters().add(value);
        }
        return this;
    }

    /**
     * This parameter is not currently supported.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param filters This parameter is not currently supported.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeDBSnapshotsRequest withFilters(java.util.Collection<Filter> filters) {
        if (filters == null) {
            this.filters = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<Filter> filtersCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Filter>(filters.size());
            filtersCopy.addAll(filters);
            this.filters = filtersCopy;
        }

        return this;
    }

    /**
     * The maximum number of records to include in the response. If more
     * records exist than the specified MaxRecords value, a
     * pagination token called a marker is included in the response so that
     * the remaining results can be retrieved.
Default: 100
     *
Constraints: Minimum 20, maximum 100.
     *
     * @return The maximum number of records to include in the response. If more
     *         records exist than the specified MaxRecords value, a
     *         pagination token called a marker is included in the response so that
     *         the remaining results can be retrieved.
Default: 100
     *
Constraints: Minimum 20, maximum 100.
     */
    public Integer getMaxRecords() {
        return maxRecords;
    }

    /**
     * The maximum number of records to include in the response. If more
     * records exist than the specified MaxRecords value, a
     * pagination token called a marker is included in the response so that
     * the remaining results can be retrieved.
Default: 100
     *
Constraints: Minimum 20, maximum 100.
     *
     * @param maxRecords The maximum number of records to include in the response. If more
     *         records exist than the specified MaxRecords value, a
     *         pagination token called a marker is included in the response so that
     *         the remaining results can be retrieved.
Default: 100
     *
Constraints: Minimum 20, maximum 100.
     */
    public void setMaxRecords(Integer maxRecords) {
        this.maxRecords = maxRecords;
    }

    /**
     * The maximum number of records to include in the response. If more
     * records exist than the specified MaxRecords value, a
     * pagination token called a marker is included in the response so that
     * the remaining results can be retrieved.
Default: 100
     *
Constraints: Minimum 20, maximum 100.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param maxRecords The maximum number of records to include in the response. If more
     *         records exist than the specified MaxRecords value, a
     *         pagination token called a marker is included in the response so that
     *         the remaining results can be retrieved.
Default: 100
     *
Constraints: Minimum 20, maximum 100.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeDBSnapshotsRequest withMaxRecords(Integer maxRecords) {
        this.maxRecords = maxRecords;
        return this;
    }

    /**
     * An optional pagination token provided by a previous
     * DescribeDBSnapshots request. If this parameter is
     * specified, the response includes only records beyond the marker, up to
     * the value specified by MaxRecords.
     *
     * @return An optional pagination token provided by a previous
     *         DescribeDBSnapshots request. If this parameter is
     *         specified, the response includes only records beyond the marker, up to
     *         the value specified by MaxRecords.
     */
    public String getMarker() {
        return marker;
    }

    /**
     * An optional pagination token provided by a previous
     * DescribeDBSnapshots request. If this parameter is
     * specified, the response includes only records beyond the marker, up to
     * the value specified by MaxRecords.
     *
     * @param marker An optional pagination token provided by a previous
     *         DescribeDBSnapshots request. If this parameter is
     *         specified, the response includes only records beyond the marker, up to
     *         the value specified by MaxRecords.
     */
    public void setMarker(String marker) {
        this.marker = marker;
    }

    /**
     * An optional pagination token provided by a previous
     * DescribeDBSnapshots request. If this parameter is
     * specified, the response includes only records beyond the marker, up to
     * the value specified by MaxRecords.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param marker An optional pagination token provided by a previous
     *         DescribeDBSnapshots request. If this parameter is
     *         specified, the response includes only records beyond the marker, up to
     *         the value specified by MaxRecords.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeDBSnapshotsRequest withMarker(String marker) {
        this.marker = marker;
        return this;
    }

    /**
     * True to include shared manual DB snapshots from other AWS accounts
     * that this AWS account has been given permission to copy or restore;
     * otherwise false. The default is false.
An AWS account is given
     * permission to restore a manual DB snapshot from another AWS account by
     * the ModifyDBSnapshotAttribute API.
     *
     * @return True to include shared manual DB snapshots from other AWS accounts
     *         that this AWS account has been given permission to copy or restore;
     *         otherwise false. The default is false.
An AWS account is given
     *         permission to restore a manual DB snapshot from another AWS account by
     *         the ModifyDBSnapshotAttribute API.
     */
    public Boolean isIncludeShared() {
        return includeShared;
    }

    /**
     * True to include shared manual DB snapshots from other AWS accounts
     * that this AWS account has been given permission to copy or restore;
     * otherwise false. The default is false.
An AWS account is given
     * permission to restore a manual DB snapshot from another AWS account by
     * the ModifyDBSnapshotAttribute API.
     *
     * @param includeShared True to include shared manual DB snapshots from other AWS accounts
     *         that this AWS account has been given permission to copy or restore;
     *         otherwise false. The default is false.
An AWS account is given
     *         permission to restore a manual DB snapshot from another AWS account by
     *         the ModifyDBSnapshotAttribute API.
     */
    public void setIncludeShared(Boolean includeShared) {
        this.includeShared = includeShared;
    }

    /**
     * True to include shared manual DB snapshots from other AWS accounts
     * that this AWS account has been given permission to copy or restore;
     * otherwise false. The default is false.
An AWS account is given
     * permission to restore a manual DB snapshot from another AWS account by
     * the ModifyDBSnapshotAttribute API.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param includeShared True to include shared manual DB snapshots from other AWS accounts
     *         that this AWS account has been given permission to copy or restore;
     *         otherwise false. The default is false.
An AWS account is given
     *         permission to restore a manual DB snapshot from another AWS account by
     *         the ModifyDBSnapshotAttribute API.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeDBSnapshotsRequest withIncludeShared(Boolean includeShared) {
        this.includeShared = includeShared;
        return this;
    }

    /**
     * True to include shared manual DB snapshots from other AWS accounts
     * that this AWS account has been given permission to copy or restore;
     * otherwise false. The default is false.
An AWS account is given
     * permission to restore a manual DB snapshot from another AWS account by
     * the ModifyDBSnapshotAttribute API.
     *
     * @return True to include shared manual DB snapshots from other AWS accounts
     *         that this AWS account has been given permission to copy or restore;
     *         otherwise false. The default is false.
An AWS account is given
     *         permission to restore a manual DB snapshot from another AWS account by
     *         the ModifyDBSnapshotAttribute API.
     */
    public Boolean getIncludeShared() {
        return includeShared;
    }

    /**
     * True to include manual DB snapshots that are public and can be copied
     * or restored by any AWS account; otherwise false. The default is false.
     *
An manual DB snapshot is shared as public by the
     * ModifyDBSnapshotAttribute API.
     *
     * @return True to include manual DB snapshots that are public and can be copied
     *         or restored by any AWS account; otherwise false. The default is false.
     *
An manual DB snapshot is shared as public by the
     *         ModifyDBSnapshotAttribute API.
     */
    public Boolean isIncludePublic() {
        return includePublic;
    }

    /**
     * True to include manual DB snapshots that are public and can be copied
     * or restored by any AWS account; otherwise false. The default is false.
     *
An manual DB snapshot is shared as public by the
     * ModifyDBSnapshotAttribute API.
     *
     * @param includePublic True to include manual DB snapshots that are public and can be copied
     *         or restored by any AWS account; otherwise false. The default is false.
     *
An manual DB snapshot is shared as public by the
     *         ModifyDBSnapshotAttribute API.
     */
    public void setIncludePublic(Boolean includePublic) {
        this.includePublic = includePublic;
    }

    /**
     * True to include manual DB snapshots that are public and can be copied
     * or restored by any AWS account; otherwise false. The default is false.
     *
An manual DB snapshot is shared as public by the
     * ModifyDBSnapshotAttribute API.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param includePublic True to include manual DB snapshots that are public and can be copied
     *         or restored by any AWS account; otherwise false. The default is false.
     *
An manual DB snapshot is shared as public by the
     *         ModifyDBSnapshotAttribute API.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public DescribeDBSnapshotsRequest withIncludePublic(Boolean includePublic) {
        this.includePublic = includePublic;
        return this;
    }

    /**
     * True to include manual DB snapshots that are public and can be copied
     * or restored by any AWS account; otherwise false. The default is false.
     *
An manual DB snapshot is shared as public by the
     * ModifyDBSnapshotAttribute API.
     *
     * @return True to include manual DB snapshots that are public and can be copied
     *         or restored by any AWS account; otherwise false. The default is false.
     *
An manual DB snapshot is shared as public by the
     *         ModifyDBSnapshotAttribute API.
     */
    public Boolean getIncludePublic() {
        return includePublic;
    }

    /**
     * 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 (getDBInstanceIdentifier() != null) sb.append("DBInstanceIdentifier: " + getDBInstanceIdentifier() + ",");
        if (getDBSnapshotIdentifier() != null) sb.append("DBSnapshotIdentifier: " + getDBSnapshotIdentifier() + ",");
        if (getSnapshotType() != null) sb.append("SnapshotType: " + getSnapshotType() + ",");
        if (getFilters() != null) sb.append("Filters: " + getFilters() + ",");
        if (getMaxRecords() != null) sb.append("MaxRecords: " + getMaxRecords() + ",");
        if (getMarker() != null) sb.append("Marker: " + getMarker() + ",");
        if (isIncludeShared() != null) sb.append("IncludeShared: " + isIncludeShared() + ",");
        if (isIncludePublic() != null) sb.append("IncludePublic: " + isIncludePublic() );
        sb.append("}");
        return sb.toString();
    }

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

        hashCode = prime * hashCode + ((getDBInstanceIdentifier() == null) ? 0 : getDBInstanceIdentifier().hashCode());
        hashCode = prime * hashCode + ((getDBSnapshotIdentifier() == null) ? 0 : getDBSnapshotIdentifier().hashCode());
        hashCode = prime * hashCode + ((getSnapshotType() == null) ? 0 : getSnapshotType().hashCode());
        hashCode = prime * hashCode + ((getFilters() == null) ? 0 : getFilters().hashCode());
        hashCode = prime * hashCode + ((getMaxRecords() == null) ? 0 : getMaxRecords().hashCode());
        hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode());
        hashCode = prime * hashCode + ((isIncludeShared() == null) ? 0 : isIncludeShared().hashCode());
        hashCode = prime * hashCode + ((isIncludePublic() == null) ? 0 : isIncludePublic().hashCode());
        return hashCode;
    }

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

        if (obj instanceof DescribeDBSnapshotsRequest == false) return false;
        DescribeDBSnapshotsRequest other = (DescribeDBSnapshotsRequest)obj;

        if (other.getDBInstanceIdentifier() == null ^ this.getDBInstanceIdentifier() == null) return false;
        if (other.getDBInstanceIdentifier() != null && other.getDBInstanceIdentifier().equals(this.getDBInstanceIdentifier()) == false) return false;
        if (other.getDBSnapshotIdentifier() == null ^ this.getDBSnapshotIdentifier() == null) return false;
        if (other.getDBSnapshotIdentifier() != null && other.getDBSnapshotIdentifier().equals(this.getDBSnapshotIdentifier()) == false) return false;
        if (other.getSnapshotType() == null ^ this.getSnapshotType() == null) return false;
        if (other.getSnapshotType() != null && other.getSnapshotType().equals(this.getSnapshotType()) == false) return false;
        if (other.getFilters() == null ^ this.getFilters() == null) return false;
        if (other.getFilters() != null && other.getFilters().equals(this.getFilters()) == false) return false;
        if (other.getMaxRecords() == null ^ this.getMaxRecords() == null) return false;
        if (other.getMaxRecords() != null && other.getMaxRecords().equals(this.getMaxRecords()) == false) return false;
        if (other.getMarker() == null ^ this.getMarker() == null) return false;
        if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) return false;
        if (other.isIncludeShared() == null ^ this.isIncludeShared() == null) return false;
        if (other.isIncludeShared() != null && other.isIncludeShared().equals(this.isIncludeShared()) == false) return false;
        if (other.isIncludePublic() == null ^ this.isIncludePublic() == null) return false;
        if (other.isIncludePublic() != null && other.isIncludePublic().equals(this.isIncludePublic()) == false) return false;
        return true;
    }

    @Override
    public DescribeDBSnapshotsRequest clone() {

            return (DescribeDBSnapshotsRequest) super.clone();
    }

}


text:
package io.devcon5.misc;

import static io.devcon5.misc.Initializer.init;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

/**
 * Created by Gerald Mücke on 21.09.2015.
 */
public class InitializerTest {

    @Test
    public void double_brace_initialization() throws Exception {
        //prepare
        Collection<String> col = new ArrayList<String>() {{
            add("one");
            add("two");
        }};

        //act

        //assert
        assertNotNull(col);
        assertEquals(2, col.size());
        assertTrue(col.contains("one"));
        assertTrue(col.contains("two"));

    }

    @Test
    public void init_collection() throws Exception {
        //prepare
        Collection target = new ArrayList<>();
        //act
        Collection col = init(target, c -> {
            c.add("one");
            c.add("two");
        });

        //assert
        assertNotNull(col);
        assertEquals(2, col.size());
        assertTrue(col.contains("one"));
        assertTrue(col.contains("two"));

    }

    @Test
    public void init_map() throws Exception {
        //prepare
        Map<String, String> target = new HashMap<>();

        //act
        Map<String, String> map = init(target, m -> m.put("test", "value"));

        //assert
        assertNotNull(map);
        assertTrue(map.containsKey("test"));
        assertEquals("value", map.get("test"));
    }

}

redpajama_set_name: RedPajamaGithub


text:
module DevisePKCS12Authenticatable
  VERSION = '0.1.0'
end


text:
typedef struct _typeobject {
    PyObject_VAR_HEAD
    char *tp_name; /* For printing, in format "<module>.<name>" */
    int tp_basicsize, tp_itemsize; /* For allocation */

    /* Methods to implement standard operations */

    destructor tp_dealloc;
    printfunc tp_print;
    getattrfunc tp_getattr;
    setattrfunc tp_setattr;
    cmpfunc tp_compare;
    reprfunc tp_repr;

    /* Method suites for standard classes */

    PyNumberMethods *tp_as_number;
    PySequenceMethods *tp_as_sequence;
    PyMappingMethods *tp_as_mapping;

    /* More standard operations (here for binary compatibility) */

    hashfunc tp_hash;
    ternaryfunc tp_call;
    reprfunc tp_str;
    getattrofunc tp_getattro;
    setattrofunc tp_setattro;

    /* Functions to access object as input/output buffer */
    PyBufferProcs *tp_as_buffer;

    /* Flags to define presence of optional/expanded features */
    long tp_flags;

    char *tp_doc; /* Documentation string */

    /* Assigned meaning in release 2.0 */
    /* call function for all accessible objects */
    traverseproc tp_traverse;

    /* delete references to contained objects */
    inquiry tp_clear;

    /* Assigned meaning in release 2.1 */
    /* rich comparisons */
    richcmpfunc tp_richcompare;

    /* weak reference enabler */
    long tp_weaklistoffset;

    /* Added in release 2.2 */
    /* Iterators */
    getiterfunc tp_iter;
    iternextfunc tp_iternext;

    /* Attribute descriptor and subclassing stuff */
    struct PyMethodDef *tp_methods;
    struct PyMemberDef *tp_members;
    struct PyGetSetDef *tp_getset;
    struct _typeobject *tp_base;
    PyObject *tp_dict;
    descrgetfunc tp_descr_get;
    descrsetfunc tp_descr_set;
    long tp_dictoffset;
    initproc tp_init;
    allocfunc tp_alloc;
    newfunc tp_new;
    freefunc tp_free; /* Low-level free-memory routine */
    inquiry tp_is_gc; /* For PyObject_IS_GC */
    PyObject *tp_bases;
    PyObject *tp_mro; /* method resolution order */
    PyObject *tp_cache;
    PyObject *tp_subclasses;
    PyObject *tp_weaklist;

} PyTypeObject;


text:
using UnityEngine;
using System.Collections.Generic;
using Pathfinding.Util;

namespace Pathfinding {
	public class RichPath {
		int currentPart;
		readonly List<RichPathPart> parts = new List<RichPathPart>();

		public Seeker seeker;

		/** Use this for initialization.
		 *
		 * \param s Optionally provide in order to take tag penalties into account. May be null if you do not use a Seeker\
		 * \param p Path to follow
		 * \param mergePartEndpoints If true, then adjacent parts that the path is split up in will
		 * try to use the same start/end points. For example when using a link on a navmesh graph
		 * Instead of first following the path to the center of the node where the link is and then
		 * follow the link, the path will be adjusted to go to the exact point where the link starts
		 * which usually makes more sense.
		 * \param simplificationMode The path can optionally be simplified. This can be a bit expensive for long paths.
		 */
		public void Initialize (Seeker s, Path p, bool mergePartEndpoints, RichFunnel.FunnelSimplification simplificationMode) {
			if (p.error) throw new System.ArgumentException("Path has an error");

			List<GraphNode> nodes = p.path;
			if (nodes.Count == 0) throw new System.ArgumentException("Path traverses no nodes");

			seeker = s;
			// Release objects back to object pool
			// Yeah, I know, it's casting... but this won't be called much
			for (int i = 0; i < parts.Count; i++) {
				if (parts[i] is RichFunnel) ObjectPool<RichFunnel>.Release(parts[i] as RichFunnel);
				else if (parts[i] is RichSpecial) ObjectPool<RichSpecial>.Release(parts[i] as RichSpecial);
			}

			parts.Clear();
			currentPart = 0;

			// Initialize new

			//Break path into parts
			for (int i = 0; i < nodes.Count; i++) {
				if (nodes[i] is TriangleMeshNode) {
					var graph = AstarData.GetGraph(nodes[i]);
					RichFunnel f = ObjectPool<RichFunnel>.Claim().Initialize(this, graph);

					f.funnelSimplificationMode = simplificationMode;

					int sIndex = i;
					uint currentGraphIndex = nodes[sIndex].GraphIndex;

					for (; i < nodes.Count; i++) {
						if (nodes[i].GraphIndex != currentGraphIndex && !(nodes[i] is NodeLink3Node)) {
							break;
						}
					}
					i--;

					if (sIndex == 0) {
						f.exactStart = p.vectorPath[0];
					} else {
						f.exactStart = (Vector3)nodes[mergePartEndpoints ? sIndex-1 : sIndex].position;
					}

					if (i == nodes.Count-1) {
						f.exactEnd = p.vectorPath[p.vectorPath.Count-1];
					} else {
						f.exactEnd = (Vector3)nodes[mergePartEndpoints ? i+1 : i].position;
					}

					f.BuildFunnelCorridor(nodes, sIndex, i);

					parts.Add(f);
				} else if (NodeLink2.GetNodeLink(nodes[i]) != null) {
					NodeLink2 nl = NodeLink2.GetNodeLink(nodes[i]);

					int sIndex = i;
					uint currentGraphIndex = nodes[sIndex].GraphIndex;

					for (i++; i < nodes.Count; i++) {
						if (nodes[i].GraphIndex != currentGraphIndex) {
							break;
						}
					}
					i--;

					if (i - sIndex > 1) {
						throw new System.Exception("NodeLink2 path length greater than two (2) nodes. " + (i - sIndex));
					} else if (i - sIndex == 0) {
						//Just continue, it might be the case that a NodeLink was the closest node
						continue;
					}

					RichSpecial rps = ObjectPool<RichSpecial>.Claim().Initialize(nl, nodes[sIndex]);
					parts.Add(rps);
				}
			}
		}

		public bool PartsLeft () {
			return currentPart < parts.Count;
		}

		public void NextPart () {
			currentPart++;
			if (currentPart >= parts.Count) currentPart = parts.Count;
		}

		public RichPathPart GetCurrentPart () {
			return currentPart < parts.Count ? parts[currentPart] : null;
		}
	}

	public abstract class RichPathPart : Pathfinding.Util.IAstarPooledObject {
		public abstract void OnEnterPool ();
	}

	public class RichFunnel : RichPathPart {
		readonly List<Vector3> left;
		readonly List<Vector3> right;
		List<TriangleMeshNode> nodes;
		public Vector3 exactStart;
		public Vector3 exactEnd;
		NavGraph graph;
		int currentNode;
		Vector3 currentPosition;
		int checkForDestroyedNodesCounter;
		RichPath path;
		int[] triBuffer = new int[3];

		/** Different algorithms for simplifying a funnel corridor using linecasting.
		 * This makes the most sense when using tiled navmeshes. A lot of times, the funnel corridor can be improved by using funnel simplification.
		 * You will have to experiment and see which one of these give the best result on your map.
		 * In my own tests, iterative has usually given the best results, closesly followed by RecursiveTrinary which was the fastest one, recursive binary came last with
		 * both the worst quality and slowest execution time. But on other maps, it might be totally different.
		 */
		public enum FunnelSimplification {
			None,
			Iterative,
			RecursiveBinary,
			RecursiveTrinary
		}

		/** How to post process the funnel corridor */
		public FunnelSimplification funnelSimplificationMode = FunnelSimplification.Iterative;

		public RichFunnel () {
			left = Pathfinding.Util.ListPool<Vector3>.Claim();
			right = Pathfinding.Util.ListPool<Vector3>.Claim();
			nodes = new List<TriangleMeshNode>();
			this.graph = null;
		}

		/** Works like a constructor, but can be used even for pooled objects. Returns \a this for easy chaining */
		public RichFunnel Initialize (RichPath path, NavGraph graph) {
			if (graph == null) throw new System.ArgumentNullException("graph");
			if (this.graph != null) throw new System.InvalidOperationException("Trying to initialize an already initialized object. " + graph);

			this.graph = graph;
			this.path = path;
			return this;
		}

		public override void OnEnterPool () {
			left.Clear();
			right.Clear();
			nodes.Clear();
			graph = null;
			currentNode = 0;
			checkForDestroyedNodesCounter = 0;
		}

		/** Build a funnel corridor from a node list slice.
		 * The nodes are assumed to be of type TriangleMeshNode.
		 *
		 * \param nodes Nodes to build the funnel corridor from
		 * \param start Start index in the nodes list
		 * \param end End index in the nodes list, this index is inclusive
		 */
		public void BuildFunnelCorridor (List<GraphNode> nodes, int start, int end) {
			//Make sure start and end points are on the correct nodes
			exactStart = (nodes[start] as MeshNode).ClosestPointOnNode(exactStart);
			exactEnd = (nodes[end] as MeshNode).ClosestPointOnNode(exactEnd);

			left.Clear();
			right.Clear();
			left.Add(exactStart);
			right.Add(exactStart);

			this.nodes.Clear();

			var rcg = graph as IRaycastableGraph;
			if (rcg != null && funnelSimplificationMode != FunnelSimplification.None) {
				List<GraphNode> tmp = Pathfinding.Util.ListPool<GraphNode>.Claim(end-start);

				switch (funnelSimplificationMode) {
				case FunnelSimplification.Iterative:
					SimplifyPath(rcg, nodes, start, end, tmp, exactStart, exactEnd);
					break;
				case FunnelSimplification.RecursiveBinary:
					SimplifyPath2(rcg, nodes, start, end, tmp, exactStart, exactEnd);
					break;
				case FunnelSimplification.RecursiveTrinary:
					SimplifyPath3(rcg, nodes, start, end, tmp, exactStart, exactEnd);
					break;
				}

				if (this.nodes.Capacity < tmp.Count) this.nodes.Capacity = tmp.Count;

				for (int i = 0; i < tmp.Count; i++) {
					//Guaranteed to be TriangleMeshNodes since they are all in the same graph
					var nd = tmp[i] as TriangleMeshNode;
					if (nd != null) this.nodes.Add(nd);
				}

				Pathfinding.Util.ListPool<GraphNode>.Release(tmp);
			} else {
				if (this.nodes.Capacity < end-start) this.nodes.Capacity = (end-start);
				for (int i = start; i <= end; i++) {
					//Guaranteed to be TriangleMeshNodes since they are all in the same graph
					var nd = nodes[i] as TriangleMeshNode;
					if (nd != null) this.nodes.Add(nd);
				}
			}

			for (int i = 0; i < this.nodes.Count-1; i++) {
				/** \todo should use return value in future versions */
				this.nodes[i].GetPortal(this.nodes[i+1], left, right, false);
			}

			left.Add(exactEnd);
			right.Add(exactEnd);
		}

		public static void SimplifyPath3 (IRaycastableGraph rcg, List<GraphNode> nodes, int start, int end, List<GraphNode> result, Vector3 startPoint, Vector3 endPoint, int depth = 0) {
			if (start == end) {
				result.Add(nodes[start]);
				return;
			}
			if (start+1 == end) {
				result.Add(nodes[start]);
				result.Add(nodes[end]);
				return;
			}

			int resCount = result.Count;

			GraphHitInfo hit;
			bool linecast = rcg.Linecast(startPoint, endPoint, nodes[start], out hit, result);
			if (linecast || result[result.Count-1] != nodes[end]) {
				//Debug.DrawLine (startPoint, endPoint, Color.black);
				//Obstacle
				//Refine further
				result.RemoveRange(resCount, result.Count-resCount);

				int maxDistNode = 0;
				float maxDist = 0;
				for (int i = start+1; i < end-1; i++) {
					float dist = VectorMath.SqrDistancePointSegment(startPoint, endPoint, (Vector3)nodes[i].position);
					if (dist > maxDist) {
						maxDistNode = i;
						maxDist = dist;
					}
				}

				int mid1 = (maxDistNode+start)/2;
				int mid2 = (maxDistNode+end)/2;

				if (mid1 == mid2) {
					SimplifyPath3(rcg, nodes, start, mid1, result, startPoint, (Vector3)nodes[mid1].position);
					//Remove start node of next part so that it is not added twice
					result.RemoveAt(result.Count-1);
					SimplifyPath3(rcg, nodes, mid1, end, result, (Vector3)nodes[mid1].position, endPoint, depth+1);
				} else {
					SimplifyPath3(rcg, nodes, start, mid1, result, startPoint, (Vector3)nodes[mid1].position, depth+1);

					//Remove start node of next part so that it is not added twice
					result.RemoveAt(result.Count-1);
					SimplifyPath3(rcg, nodes, mid1, mid2, result, (Vector3)nodes[mid1].position, (Vector3)nodes[mid2].position, depth+1);

					//Remove start node of next part so that it is not added twice
					result.RemoveAt(result.Count-1);
					SimplifyPath3(rcg, nodes, mid2, end, result, (Vector3)nodes[mid2].position, endPoint, depth+1);
				}
			}
		}

		public static void SimplifyPath2 (IRaycastableGraph rcg, List<GraphNode> nodes, int start, int end, List<GraphNode> result, Vector3 startPoint, Vector3 endPoint) {
			int resCount = result.Count;

			if (end <= start+1) {
				result.Add(nodes[start]);
				result.Add(nodes[end]);
				//t--;
				return;
			}

			GraphHitInfo hit;
			if ((rcg.Linecast(startPoint, endPoint, nodes[start], out hit, result) || result[result.Count-1] != nodes[end])) {
				//Obstacle
				//Refine further
				result.RemoveRange(resCount, result.Count-resCount);

				int minDistNode = -1;
				float minDist = float.PositiveInfinity;
				for (int i = start+1; i < end; i++) {
					float dist = VectorMath.SqrDistancePointSegment(startPoint, endPoint, (Vector3)nodes[i].position);
					if (minDistNode == -1 || dist < minDist) {
						minDistNode = i;
						minDist = dist;
					}
				}

				SimplifyPath2(rcg, nodes, start, minDistNode, result, startPoint, (Vector3)nodes[minDistNode].position);
				//Remove start node of next part so that it is not added twice
				result.RemoveAt(result.Count-1);
				SimplifyPath2(rcg, nodes, minDistNode, end, result, (Vector3)nodes[minDistNode].position, endPoint);
			}
		}

		/** Simplifies a funnel path using linecasting.
		 * Running time is roughly O(n^2 log n) in the worst case (where n = end-start)
		 * Actually it depends on how the graph looks, so in theory the actual upper limit on the worst case running time is O(n*m log n) (where n = end-start and m = nodes in the graph)
		 * but O(n^2 log n) is a much more realistic worst case limit.
		 *
		 * Requires #graph to implement IRaycastableGraph
		 */
		public void SimplifyPath (IRaycastableGraph graph, List<GraphNode> nodes, int start, int end, List<GraphNode> result, Vector3 startPoint, Vector3 endPoint) {
			if (graph == null) throw new System.ArgumentNullException("graph");

			if (start > end) {
				throw new System.ArgumentException("start >= end");
			}

			int ostart = start;

			int count = 0;
			while (true) {
				if (count++ > 1000) {
					Debug.LogError("!!!");
					break;
				}

				if (start == end) {
					result.Add(nodes[end]);
					return;
				}

				int resCount = result.Count;

				int mx = end+1;
				int mn = start+1;
				bool anySucceded = false;
				while (mx > mn+1) {
					int mid = (mx+mn)/2;

					GraphHitInfo hit;
					Vector3 sp = start == ostart ? startPoint : (Vector3)nodes[start].position;
					Vector3 ep = mid == end ? endPoint : (Vector3)nodes[mid].position;

					if (graph.Linecast(sp, ep, nodes[start], out hit)) {
						mx = mid;
					} else {
						anySucceded = true;
						mn = mid;
					}
				}

				if (!anySucceded) {
					result.Add(nodes[start]);

					//It is guaranteed that mn = start+1
					start = mn;
				} else {
					//Need to redo the linecast to get the trace
					GraphHitInfo hit;
					Vector3 sp = start == ostart ? startPoint : (Vector3)nodes[start].position;
					Vector3 ep = mn == end ? endPoint : (Vector3)nodes[mn].position;
					graph.Linecast(sp, ep, nodes[start], out hit, result);

					long penaltySum = 0;
					long penaltySum2 = 0;
					for (int i = start; i <= mn; i++) {
						penaltySum += nodes[i].Penalty + (path.seeker != null ? path.seeker.tagPenalties[nodes[i].Tag] : 0);
					}

					for (int i = resCount; i < result.Count; i++) {
						penaltySum2 += result[i].Penalty + (path.seeker != null ? path.seeker.tagPenalties[result[i].Tag] : 0);
					}

					// Allow 40% more penalty on average per node
					if ((penaltySum*1.4*(mn-start+1)) < (penaltySum2*(result.Count-resCount)) || result[result.Count-1] != nodes[mn]) {
						//Debug.Log ((penaltySum*1.4*(mn-start+1)) + " < "+ (penaltySum2*(result.Count-resCount)));
						//Debug.DrawLine ((Vector3)nodes[start].Position, (Vector3)nodes[mn].Position, Color.red);
						//Linecast hit the wrong node
						result.RemoveRange(resCount, result.Count-resCount);

						result.Add(nodes[start]);
						//Debug.Break();
						start = start+1;
					} else {
						//Debug.Log ("!! " + (penaltySum*1.4*(mn-start+1)) + " < "+ (penaltySum2*(result.Count-resCount)));
						//Debug.DrawLine ((Vector3)nodes[start].Position, (Vector3)nodes[mn].Position, Color.green);
						//Debug.Break ();
						//Remove nodes[end]
						result.RemoveAt(result.Count-1);
						start = mn;
					}
				}
			}
		}

		/** Split funnel at node index \a splitIndex and throw the nodes up to that point away and replace with \a prefix.
		 * Used when the AI has happened to get sidetracked and entered a node outside the funnel.
		 */
		public void UpdateFunnelCorridor (int splitIndex, TriangleMeshNode prefix) {
			if (splitIndex > 0) {
				nodes.RemoveRange(0, splitIndex-1);
				//This is a node which should be removed, we replace it with the prefix
				nodes[0] = prefix;
			} else {
				nodes.Insert(0, prefix);
			}

			left.Clear();
			right.Clear();
			left.Add(exactStart);
			right.Add(exactStart);

			for (int i = 0; i < nodes.Count-1; i++) {
				//NOTE should use return value in future versions
				nodes[i].GetPortal(nodes[i+1], left, right, false);
			}

			left.Add(exactEnd);
			right.Add(exactEnd);
		}

		public Vector3 Update (Vector3 position, List<Vector3> buffer, int numCorners, out bool lastCorner, out bool requiresRepath) {
			lastCorner = false;
			requiresRepath = false;
			var i3Pos = (Int3)position;

			if (nodes[currentNode].Destroyed) {
				requiresRepath = true;
				lastCorner = false;
				buffer.Add(position);
				return position;
			}

			// Check if we are in the same node as we were in during the last frame
			if (nodes[currentNode].ContainsPoint(i3Pos)) {
				// Only check for destroyed nodes every 10 frames
				if (checkForDestroyedNodesCounter >= 10) {
					checkForDestroyedNodesCounter = 0;

					// Loop through all nodes and check if they are destroyed
					// If so, we really need a recalculation of our path quickly
					// since there might be an obstacle blocking our path after
					// a graph update or something similar
					for (int i = 0, t = nodes.Count; i < t; i++) {
						if (nodes[i].Destroyed) {
							requiresRepath = true;
							break;
						}
					}
				} else {
					checkForDestroyedNodesCounter++;
				}
			} else {
				// This part of the code is relatively seldom called
				// Most of the time we are still on the same node as during the previous frame

				// Otherwise check the 2 nodes ahead and 2 nodes back
				// If they contain the node in XZ space, then we probably moved into those nodes
				bool found = false;

				// 2 nodes ahead
				for (int i = currentNode+1, t = System.Math.Min(currentNode+3, nodes.Count); i < t && !found; i++) {
					// If the node is destroyed, make sure we recalculate a new path quickly
					if (nodes[i].Destroyed) {
						requiresRepath = true;
						lastCorner = false;
						buffer.Add(position);
						return position;
					}

					// We found a node which contains our current position in XZ space
					if (nodes[i].ContainsPoint(i3Pos)) {
						currentNode = i;
						found = true;
					}
				}

				// 2 nodes behind
				for (int i = currentNode-1, t = System.Math.Max(currentNode-3, 0); i > t && !found; i--) {
					if (nodes[i].Destroyed) {
						requiresRepath = true;
						lastCorner = false;
						buffer.Add(position);
						return position;
					}

					if (nodes[i].ContainsPoint(i3Pos)) {
						currentNode = i;
						found = true;
					}
				}

				if (!found) {
					int closestNodeInPath = 0;
					int closestIsNeighbourOf = 0;
					float closestDist = float.PositiveInfinity;
					bool closestIsInPath = false;
					TriangleMeshNode closestNode = null;

					int containingIndex = nodes.Count-1;

					// If we still couldn't find a good node
					// Check all nodes in the whole path

					// We are checking for if any node is destroyed in the loop
					// So we can reset this counter
					checkForDestroyedNodesCounter = 0;

					for (int i = 0, t = nodes.Count; i < t; i++) {
						if (nodes[i].Destroyed) {
							requiresRepath = true;
							lastCorner = false;
							buffer.Add(position);
							return position;
						}

						Vector3 close = nodes[i].ClosestPointOnNode(position);
						float d = (close-position).sqrMagnitude;
						if (d < closestDist) {
							closestDist = d;
							closestNodeInPath = i;
							closestNode = nodes[i];
							closestIsInPath = true;
						}
					}

					// Loop through all neighbours of all nodes in the path
					// and find the closet point on them
					// We cannot just look on the ones in the path since it is impossible
					// to know if we are outside the navmesh completely or if we have just
					// stepped in to an adjacent node

					// Need to make a copy here, the JIT will move this variable to the heap
					// because it is used inside a delegate, if we didn't make a copy here
					// we would *always* allocate 24 bytes (sizeof(position)) on the heap every time
					// this method was called
					// now we only do it when this IF statement is executed
					var posCopy = position;

					GraphNodeDelegate del = node => {
						// Check so that this neighbour we are processing is neither the node after the current node or the node before the current node in the path
						// This is done for optimization, we have already checked those nodes earlier
						if (!(containingIndex > 0 && node == nodes[containingIndex-1]) && !(containingIndex < nodes.Count-1 && node == nodes[containingIndex+1])) {
							// Check if the neighbour was a mesh node
							var mn = node as TriangleMeshNode;
							if (mn != null) {
								// Find the distance to the closest point on it from our current position
								var close = mn.ClosestPointOnNode(posCopy);
								float d = (close-posCopy).sqrMagnitude;

								// Is that distance better than the best distance seen so far
								if (d < closestDist) {
									closestDist = d;
									closestIsNeighbourOf = containingIndex;
									closestNode = mn;
									closestIsInPath = false;
								}
							}
						}
					};

					// Loop through all the nodes in the path in reverse order
					// The callback needs to know about the index, so we store it
					// in a local variable which it can read
					for (; containingIndex >= 0; containingIndex--) {
						// Loop through all neighbours of the node
						nodes[containingIndex].GetConnections(del);
					}

					// Check if the closest node
					// was on the path already or if we need to adjust it
					if (closestIsInPath) {
						// If we have found a node
						// Snap to the closest point in XZ space (keep the Y coordinate)
						// If we would have snapped to the closest point in 3D space, the agent
						// might slow down when traversing slopes
						currentNode = closestNodeInPath;
						position = nodes[closestNodeInPath].ClosestPointOnNodeXZ(position);
					} else {
						// Snap to the closest point in XZ space on the node
						position = closestNode.ClosestPointOnNodeXZ(position);

						// We have found a node containing the position, but it is outside the funnel
						// Recalculate the funnel to include this node
						exactStart = position;
						UpdateFunnelCorridor(closestIsNeighbourOf, closestNode);

						// Restart from the first node in the updated path
						currentNode = 0;
					}
				}
			}

			currentPosition = position;

			if (!FindNextCorners(position, currentNode, buffer, numCorners, out lastCorner)) {
				Debug.LogError("Oh oh");
				buffer.Add(position);
				return position;
			}

			return position;
		}

		/** Fill wallBuffer with all navmesh wall segments close to the current position.
		 * A wall segment is a node edge which is not shared by any other neighbour node, i.e an outer edge on the navmesh.
		 */
		public void FindWalls (List<Vector3> wallBuffer, float range) {
			FindWalls(currentNode, wallBuffer, currentPosition, range);
		}

		void FindWalls (int nodeIndex, List<Vector3> wallBuffer, Vector3 position, float range) {
			if (range <= 0) return;

			bool negAbort = false;
			bool posAbort = false;

			range *= range;

			position.y = 0;
			//Looping as 0,-1,1,-2,2,-3,3,-4,4 etc. Avoids code duplication by keeping it to one loop instead of two
			for (int i = 0; !negAbort || !posAbort; i = i < 0 ? -i : -i-1) {
				if (i < 0 && negAbort) continue;
				if (i > 0 && posAbort) continue;

				if (i < 0 && nodeIndex+i < 0) {
					negAbort = true;
					continue;
				}

				if (i > 0 && nodeIndex+i >= nodes.Count) {
					posAbort = true;
					continue;
				}

				TriangleMeshNode prev = nodeIndex+i-1 < 0 ? null : nodes[nodeIndex+i-1];
				TriangleMeshNode node = nodes[nodeIndex+i];
				TriangleMeshNode next = nodeIndex+i+1 >= nodes.Count ? null : nodes[nodeIndex+i+1];

				if (node.Destroyed) {
					break;
				}

				if ((node.ClosestPointOnNodeXZ(position)-position).sqrMagnitude > range) {
					if (i < 0) negAbort = true;
					else posAbort = true;
					continue;
				}

				for (int j = 0; j < 3; j++) triBuffer[j] = 0;

				for (int j = 0; j < node.connections.Length; j++) {
					var other = node.connections[j] as TriangleMeshNode;
					if (other == null) continue;

					int va = -1;
					for (int a = 0; a < 3; a++) {
						for (int b = 0; b < 3; b++) {
							if (node.GetVertex(a) == other.GetVertex((b+1) % 3) && node.GetVertex((a+1) % 3) == other.GetVertex(b)) {
								va = a;
								a = 3;
								break;
							}
						}
					}
					if (va == -1) {
						//No direct connection
					} else {
						triBuffer[va] = other == prev || other == next ? 2 : 1;
					}
				}

				for (int j = 0; j < 3; j++) {
					//Tribuffer values
					// 0 : Navmesh border, outer edge
					// 1 : Inner edge, to node inside funnel
					// 2 : Inner edge, to node outside funnel
					if (triBuffer[j] == 0) {
						//Add edge to list of walls
						wallBuffer.Add((Vector3)node.GetVertex(j));
						wallBuffer.Add((Vector3)node.GetVertex((j+1) % 3));
					}
				}
			}
		}

		public bool FindNextCorners (Vector3 origin, int startIndex, List<Vector3> funnelPath, int numCorners, out bool lastCorner) {
			lastCorner = false;

			if (left == null) throw new System.Exception("left list is null");
			if (right == null) throw new System.Exception("right list is null");
			if (funnelPath == null) throw new System.ArgumentNullException("funnelPath");

			if (left.Count != right.Count) throw new System.ArgumentException("left and right lists must have equal length");

			int diagonalCount = left.Count;

			if (diagonalCount == 0) throw new System.ArgumentException("no diagonals");

			if (diagonalCount-startIndex < 3) {
				//Direct path
				funnelPath.Add(left[diagonalCount-1]);
				lastCorner = true;
				return true;
			}

			#if ASTARDEBUG
			for (int i = startIndex; i < left.Count-1; i++) {
				Debug.DrawLine(left[i], left[i+1], Color.red);
				Debug.DrawLine(right[i], right[i+1], Color.magenta);
				Debug.DrawRay(right[i], Vector3.up, Color.magenta);
			}
			for (int i = 0; i < left.Count; i++) {
				Debug.DrawLine(right[i], left[i], Color.cyan);
			}
			#endif

			//Remove identical vertices
			while (left[startIndex+1] == left[startIndex+2] && right[startIndex+1] == right[startIndex+2]) {
				//System.Console.WriteLine ("Removing identical left and right");
				//left.RemoveAt (1);
				//right.RemoveAt (1);
				startIndex++;

				if (diagonalCount-startIndex <= 3) {
					return false;
				}
			}

			Vector3 swPoint = left[startIndex+2];
			if (swPoint == left[startIndex+1]) {
				swPoint = right[startIndex+2];
			}

			//Test
			while (VectorMath.IsColinearXZ(origin, left[startIndex+1], right[startIndex+1]) || VectorMath.RightOrColinearXZ(left[startIndex+1], right[startIndex+1], swPoint) == VectorMath.RightOrColinearXZ(left[startIndex+1], right[startIndex+1], origin)) {
	#if ASTARDEBUG
				Debug.DrawLine(left[startIndex+1], right[startIndex+1], new Color(0, 0, 0, 0.5F));
				Debug.DrawLine(origin, swPoint, new Color(0, 0, 0, 0.5F));
	#endif
				//left.RemoveAt (1);
				//right.RemoveAt (1);
				startIndex++;

				if (diagonalCount-startIndex < 3) {
					//Debug.Log ("#2 " + left.Count + " - " + startIndex + " = " + (left.Count-startIndex));
					//Direct path
					funnelPath.Add(left[diagonalCount-1]);
					lastCorner = true;
					return true;
				}

				swPoint = left[startIndex+2];
				if (swPoint == left[startIndex+1]) {
					swPoint = right[startIndex+2];
				}
			}

			//funnelPath.Add (origin);

			Vector3 portalApex = origin;
			Vector3 portalLeft = left[startIndex+1];
			Vector3 portalRight = right[startIndex+1];

			int apexIndex = startIndex+0;
			int rightIndex = startIndex+1;
			int leftIndex = startIndex+1;

			for (int i = startIndex+2; i < diagonalCount; i++) {
				if (funnelPath.Count >= numCorners) {
					return true;
				}

				if (funnelPath.Count > 2000) {
					Debug.LogWarning("Avoiding infinite loop. Remove this check if you have this long paths.");
					break;
				}

				Vector3 pLeft = left[i];
				Vector3 pRight = right[i];

				/*Debug.DrawLine (portalApex,portalLeft,Color.red);
				 * Debug.DrawLine (portalApex,portalRight,Color.yellow);
				 * Debug.DrawLine (portalApex,left,Color.cyan);
				 * Debug.DrawLine (portalApex,right,Color.cyan);*/

				if (VectorMath.SignedTriangleAreaTimes2XZ(portalApex, portalRight, pRight) >= 0) {
					if (portalApex == portalRight || VectorMath.SignedTriangleAreaTimes2XZ(portalApex, portalLeft, pRight) <= 0) {
						portalRight = pRight;
						rightIndex = i;
					} else {
						funnelPath.Add(portalLeft);
						portalApex = portalLeft;
						apexIndex = leftIndex;

						portalLeft = portalApex;
						portalRight = portalApex;

						leftIndex = apexIndex;
						rightIndex = apexIndex;

						i = apexIndex;

						continue;
					}
				}

				if (VectorMath.SignedTriangleAreaTimes2XZ(portalApex, portalLeft, pLeft) <= 0) {
					if (portalApex == portalLeft || VectorMath.SignedTriangleAreaTimes2XZ(portalApex, portalRight, pLeft) >= 0) {
						portalLeft = pLeft;
						leftIndex = i;
					} else {
						funnelPath.Add(portalRight);
						portalApex = portalRight;
						apexIndex = rightIndex;

						portalLeft = portalApex;
						portalRight = portalApex;

						leftIndex = apexIndex;
						rightIndex = apexIndex;

						i = apexIndex;

						continue;
					}
				}
			}

			lastCorner = true;
			funnelPath.Add(left[diagonalCount-1]);

			return true;
		}
	}

	public class RichSpecial : RichPathPart {
		public NodeLink2 nodeLink;
		public Transform first;
		public Transform second;
		public bool reverse;

		public override void OnEnterPool () {
			nodeLink = null;
		}

		/** Works like a constructor, but can be used even for pooled objects. Returns \a this for easy chaining */
		public RichSpecial Initialize (NodeLink2 nodeLink, GraphNode first) {
			this.nodeLink = nodeLink;
			if (first == nodeLink.StartNode) {
				this.first = nodeLink.StartTransform;
				this.second = nodeLink.EndTransform;
				reverse = false;
			} else {
				this.first = nodeLink.EndTransform;
				this.second = nodeLink.StartTransform;
				reverse = true;
			}
			return this;
		}
	}
}


text:
package com.facebook.infrastructure.locator;

import java.math.BigInteger;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import com.facebook.infrastructure.config.DatabaseDescriptor;
import com.facebook.infrastructure.net.EndPoint;
import com.facebook.infrastructure.service.StorageService;
import com.facebook.infrastructure.utils.LogUtil;

/*
 * This class returns the nodes responsible for a given
 * key but does respects rack awareness. It makes a best
 * effort to get a node from a different data center and
 * a node in a different rack in the same datacenter as
 * the primary.
 */
public class RackAwareStrategy extends AbstractStrategy
{
    public RackAwareStrategy(TokenMetadata tokenMetadata)
    {
        super(tokenMetadata);
    }

    public EndPoint[] getStorageEndPoints(BigInteger token)
    {
        int startIndex = 0 ;
        List<EndPoint> list = new ArrayList<EndPoint>();
        boolean bDataCenter = false;
        boolean bOtherRack = false;
        int foundCount = 0;
        int N = DatabaseDescriptor.getReplicationFactor();
        Map<BigInteger, EndPoint> tokenToEndPointMap = tokenMetadata_.cloneTokenEndPointMap();
        List<BigInteger> tokens = new ArrayList<BigInteger>(tokenToEndPointMap.keySet());
        Collections.sort(tokens);
        int index = Collections.binarySearch(tokens, token);
        if(index < 0)
        {
            index = (index + 1) * (-1);
            if (index >= tokens.size())
                index = 0;
        }
        int totalNodes = tokens.size();
        // Add the node at the index by default
        list.add(tokenToEndPointMap.get(tokens.get(index)));
        foundCount++;
        if( N == 1 )
        {
            return list.toArray(new EndPoint[0]);
        }
        startIndex = (index + 1)%totalNodes;
        IEndPointSnitch endPointSnitch = StorageService.instance().getEndPointSnitch();

        for (int i = startIndex, count = 1; count < totalNodes && foundCount < N; ++count, i = (i+1)%totalNodes)
        {
            try
            {
                // First try to find one in a different data center
                if(!endPointSnitch.isInSameDataCenter(tokenToEndPointMap.get(tokens.get(index)), tokenToEndPointMap.get(tokens.get(i))))
                {
                    // If we have already found something in a diff datacenter no need to find another
                    if( !bDataCenter )
                    {
                        list.add(tokenToEndPointMap.get(tokens.get(i)));
                        bDataCenter = true;
                        foundCount++;
                    }
                    continue;
                }
                // Now  try to find one on a different rack
                if(!endPointSnitch.isOnSameRack(tokenToEndPointMap.get(tokens.get(index)), tokenToEndPointMap.get(tokens.get(i))) &&
                        endPointSnitch.isInSameDataCenter(tokenToEndPointMap.get(tokens.get(index)), tokenToEndPointMap.get(tokens.get(i))))
                {
                    // If we have already found something in a diff rack no need to find another
                    if( !bOtherRack )
                    {
                        list.add(tokenToEndPointMap.get(tokens.get(i)));
                        bOtherRack = true;
                        foundCount++;
                    }
                    continue;
                }
            }
            catch (UnknownHostException e)
            {
                logger_.debug(LogUtil.throwableToString(e));
            }

        }
        // If we found N number of nodes we are good. This loop wil just exit. Otherwise just
        // loop through the list and add until we have N nodes.
        for (int i = startIndex, count = 1; count < totalNodes && foundCount < N; ++count, i = (i+1)%totalNodes)
        {
            if( ! list.contains(tokenToEndPointMap.get(tokens.get(i))))
            {
                list.add(tokenToEndPointMap.get(tokens.get(i)));
                foundCount++;
                continue;
            }
        }
        retrofitPorts(list);
        return list.toArray(new EndPoint[0]);
    }

    public EndPoint[] getStorageEndPoints(BigInteger token, Map<BigInteger, EndPoint> tokenToEndPointMap)
    {
        throw new UnsupportedOperationException("This operation is not currently supported");
    }
}


text:
const struct _mk_load_command_vtable _mk_load_command_dyld_info_class = {
    .base.super                 = &_mk_load_command_class,
    .base.name                  = "LC_DYLD_INFO",
    .base.copy_description      = &_mk_load_command_type_dyld_info_copy_description,
    .command_id                 = LC_DYLD_INFO,
    .command_base_size          = sizeof(struct dyld_info_command)
};

//|++++++++++++++++++++++++++++++++++++|//
uint32_t mk_load_command_dyld_info_id()
{ return LC_DYLD_INFO; }

//|++++++++++++++++++++++++++++++++++++|//
mk_error_t
mk_load_command_dyld_info_copy_native(mk_load_command_ref load_command, struct dyld_info_command *result)
{
    _MK_LOAD_COMMAND_NOT_NULL(load_command, return MK_EINVAL);
    _MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_dyld_info_class, return MK_EINVAL);
    return _mk_load_command_type_dyld_info_copy_native(load_command, result);
}

//|++++++++++++++++++++++++++++++++++++|//
uint32_t
mk_load_command_dyld_info_get_rebase_off(mk_load_command_ref load_command)
{
    _MK_LOAD_COMMAND_NOT_NULL(load_command, return UINT32_MAX);
    _MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_dyld_info_class, return UINT32_MAX);
    return _mk_load_command_type_dyld_info_get_rebase_off(load_command);
}

//|++++++++++++++++++++++++++++++++++++|//
uint32_t
mk_load_command_dyld_info_get_rebase_size(mk_load_command_ref load_command)
{
    _MK_LOAD_COMMAND_NOT_NULL(load_command, return UINT32_MAX);
    _MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_dyld_info_class, return UINT32_MAX);
    return _mk_load_command_type_dyld_info_get_rebase_size(load_command);
}

//|++++++++++++++++++++++++++++++++++++|//
uint32_t
mk_load_command_dyld_info_get_bind_off(mk_load_command_ref load_command)
{
    _MK_LOAD_COMMAND_NOT_NULL(load_command, return UINT32_MAX);
    _MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_dyld_info_class, return UINT32_MAX);
    return _mk_load_command_type_dyld_info_get_bind_off(load_command);
}

//|++++++++++++++++++++++++++++++++++++|//
uint32_t
mk_load_command_dyld_info_get_bind_size(mk_load_command_ref load_command)
{
    _MK_LOAD_COMMAND_NOT_NULL(load_command, return UINT32_MAX);
    _MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_dyld_info_class, return UINT32_MAX);
    return _mk_load_command_type_dyld_info_get_bind_size(load_command);
}

//|++++++++++++++++++++++++++++++++++++|//
uint32_t
mk_load_command_dyld_info_get_weak_bind_off(mk_load_command_ref load_command)
{
    _MK_LOAD_COMMAND_NOT_NULL(load_command, return UINT32_MAX);
    _MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_dyld_info_class, return UINT32_MAX);
    return _mk_load_command_type_dyld_info_get_weak_bind_off(load_command);
}

//|++++++++++++++++++++++++++++++++++++|//
uint32_t
mk_load_command_dyld_info_get_weak_bind_size(mk_load_command_ref load_command)
{
    _MK_LOAD_COMMAND_NOT_NULL(load_command, return UINT32_MAX);
    _MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_dyld_info_class, return UINT32_MAX);
    return _mk_load_command_type_dyld_info_get_weak_bind_size(load_command);
}

//|++++++++++++++++++++++++++++++++++++|//
uint32_t
mk_load_command_dyld_info_get_lazy_bind_off(mk_load_command_ref load_command)
{
    _MK_LOAD_COMMAND_NOT_NULL(load_command, return UINT32_MAX);
    _MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_dyld_info_class, return UINT32_MAX);
    return _mk_load_command_type_dyld_info_get_lazy_bind_off(load_command);
}

//|++++++++++++++++++++++++++++++++++++|//
uint32_t
mk_load_command_dyld_info_get_lazy_bind_size(mk_load_command_ref load_command)
{
    _MK_LOAD_COMMAND_NOT_NULL(load_command, return UINT32_MAX);
    _MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_dyld_info_class, return UINT32_MAX);
    return _mk_load_command_type_dyld_info_get_lazy_bind_size(load_command);
}

//|++++++++++++++++++++++++++++++++++++|//
uint32_t
mk_load_command_dyld_info_get_export_off(mk_load_command_ref load_command)
{
    _MK_LOAD_COMMAND_NOT_NULL(load_command, return UINT32_MAX);
    _MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_dyld_info_class, return UINT32_MAX);
    return _mk_load_command_type_dyld_info_get_export_off(load_command);
}

//|++++++++++++++++++++++++++++++++++++|//
uint32_t
mk_load_command_dyld_info_get_export_size(mk_load_command_ref load_command)
{
    _MK_LOAD_COMMAND_NOT_NULL(load_command, return UINT32_MAX);
    _MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_dyld_info_class, return UINT32_MAX);
    return _mk_load_command_type_dyld_info_get_export_size(load_command);
}


text:
/*
  Include declarations.
*/
#include "magick/studio.h"
#include "magick/property.h"
#include "magick/blob.h"
#include "magick/blob-private.h"
#include "magick/color.h"
#include "magick/color-private.h"
#include "magick/colorspace.h"
#include "magick/constitute.h"
#include "magick/delegate.h"
#include "magick/draw.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/geometry.h"
#include "magick/image.h"
#include "magick/image-private.h"
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/profile.h"
#include "magick/resource_.h"
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
#include "magick/module.h"
#include "magick/token.h"
#include "magick/transform.h"
#include "magick/utility.h"

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   R e a d X P S I m a g e                                                   %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  ReadXPSImage() reads a Printer Control Language image file and returns it.
%  It allocates the memory necessary for the new Image structure and returns a
%  pointer to the new image.
%
%  The format of the ReadXPSImage method is:
%
%      Image *ReadXPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
%
%  A description of each parameter follows:
%
%    o image_info: the image info.
%
%    o exception: return any errors or warnings in this structure.
%
*/
static Image *ReadXPSImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define CropBox  "CropBox"
#define DeviceCMYK  "DeviceCMYK"
#define MediaBox  "MediaBox"
#define RenderXPSText  "  Rendering XPS...  "

  char
    command[MaxTextExtent],
    density[MaxTextExtent],
    filename[MaxTextExtent],
    geometry[MaxTextExtent],
    options[MaxTextExtent],
    input_filename[MaxTextExtent];

  const DelegateInfo
    *delegate_info;

  Image
    *image,
    *next_image;

  ImageInfo
    *read_info;

  MagickBooleanType
    cmyk,
    status;

  PointInfo
    delta;

  RectangleInfo
    bounding_box,
    page;

  register char
    *p;

  register ssize_t
    c;

  SegmentInfo
    bounds;

  size_t
    height,
    width;

  ssize_t
    count;

  assert(image_info != (const ImageInfo *) NULL);
  assert(image_info->signature == MagickSignature);
  if (image_info->debug != MagickFalse)
    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
      image_info->filename);
  assert(exception != (ExceptionInfo *) NULL);
  assert(exception->signature == MagickSignature);
  /*
    Open image file.
  */
  image=AcquireImage(image_info);
  status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
  if (status == MagickFalse)
    {
      image=DestroyImageList(image);
      return((Image *) NULL);
    }
  status=AcquireUniqueSymbolicLink(image_info->filename,input_filename);
  if (status == MagickFalse)
    {
      ThrowFileException(exception,FileOpenError,"UnableToCreateTemporaryFile",
        image_info->filename);
      image=DestroyImageList(image);
      return((Image *) NULL);
    }
  /*
    Set the page density.
  */
  delta.x=DefaultResolution;
  delta.y=DefaultResolution;
  if ((image->x_resolution == 0.0) || (image->y_resolution == 0.0))
    {
      GeometryInfo
        geometry_info;

      MagickStatusType
        flags;

      flags=ParseGeometry(PSDensityGeometry,&geometry_info);
      image->x_resolution=geometry_info.rho;
      image->y_resolution=geometry_info.sigma;
      if ((flags & SigmaValue) == 0)
        image->y_resolution=image->x_resolution;
    }
  (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",
    image->x_resolution,image->y_resolution);
  /*
    Determine page geometry from the XPS media box.
  */
  cmyk=image->colorspace == CMYKColorspace ? MagickTrue : MagickFalse;
  count=0;
  (void) ResetMagickMemory(&bounding_box,0,sizeof(bounding_box));
  (void) ResetMagickMemory(&bounds,0,sizeof(bounds));
  (void) ResetMagickMemory(&page,0,sizeof(page));
  (void) ResetMagickMemory(command,0,sizeof(command));
  p=command;
  for (c=ReadBlobByte(image); c != EOF; c=ReadBlobByte(image))
  {
    if (image_info->page != (char *) NULL)
      continue;
    /*
      Note XPS elements.
    */
    *p++=(char) c;
    if ((c != (int) '/') && (c != '\n') &&
        ((size_t) (p-command) < (MaxTextExtent-1)))
      continue;
    *p='\0';
    p=command;
    /*
      Is this a CMYK document?
    */
    if (LocaleNCompare(DeviceCMYK,command,strlen(DeviceCMYK)) == 0)
      cmyk=MagickTrue;
    if (LocaleNCompare(CropBox,command,strlen(CropBox)) == 0)
      {
        /*
          Note region defined by crop box.
        */
        count=(ssize_t) sscanf(command,"CropBox [%lf %lf %lf %lf",
          &bounds.x1,&bounds.y1,&bounds.x2,&bounds.y2);
        if (count != 4)
          count=(ssize_t) sscanf(command,"CropBox[%lf %lf %lf %lf",
            &bounds.x1,&bounds.y1,&bounds.x2,&bounds.y2);
      }
    if (LocaleNCompare(MediaBox,command,strlen(MediaBox)) == 0)
      {
        /*
          Note region defined by media box.
        */
        count=(ssize_t) sscanf(command,"MediaBox [%lf %lf %lf %lf",
          &bounds.x1,&bounds.y1,&bounds.x2,&bounds.y2);
        if (count != 4)
          count=(ssize_t) sscanf(command,"MediaBox[%lf %lf %lf %lf",
            &bounds.x1,&bounds.y1,&bounds.x2,&bounds.y2);
      }
    if (count != 4)
      continue;
    /*
      Set XPS render geometry.
    */
    width=(size_t) floor(bounds.x2-bounds.x1+0.5);
    height=(size_t) floor(bounds.y2-bounds.y1+0.5);
    if (width > page.width)
      page.width=width;
    if (height > page.height)
      page.height=height;
  }
  (void) CloseBlob(image);
  /*
    Render XPS with the GhostXPS delegate.
  */
  if ((page.width == 0) || (page.height == 0))
    (void) ParseAbsoluteGeometry(PSPageGeometry,&page);
  if (image_info->page != (char *) NULL)
    (void) ParseAbsoluteGeometry(image_info->page,&page);
  (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g",(double)
    page.width,(double) page.height);
  if (image_info->monochrome != MagickFalse)
    delegate_info=GetDelegateInfo("xps:mono",(char *) NULL,exception);
  else
     if (cmyk != MagickFalse)
       delegate_info=GetDelegateInfo("xps:cmyk",(char *) NULL,exception);
     else
       delegate_info=GetDelegateInfo("xps:color",(char *) NULL,exception);
  if (delegate_info == (const DelegateInfo *) NULL)
    return((Image *) NULL);
  *options='\0';
  if ((page.width == 0) || (page.height == 0))
    (void) ParseAbsoluteGeometry(PSPageGeometry,&page);
  if (image_info->page != (char *) NULL)
    (void) ParseAbsoluteGeometry(image_info->page,&page);
  page.width=(size_t) floor(page.width*image->y_resolution/delta.x+0.5);
  page.height=(size_t) floor(page.height*image->y_resolution/delta.y+
    0.5);
  (void) FormatLocaleString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
    page.width,(double) page.height);
  image=DestroyImage(image);
  read_info=CloneImageInfo(image_info);
  *read_info->magick='\0';
  if (read_info->number_scenes != 0)
    {
      if (read_info->number_scenes != 1)
        (void) FormatLocaleString(options,MaxTextExtent,"-dLastPage=%.20g",
          (double) (read_info->scene+read_info->number_scenes));
      else
        (void) FormatLocaleString(options,MaxTextExtent,
          "-dFirstPage=%.20g -dLastPage=%.20g",(double) read_info->scene+1,
          (double) (read_info->scene+read_info->number_scenes));
      read_info->number_scenes=0;
      if (read_info->scenes != (char *) NULL)
        *read_info->scenes='\0';
    }
  if (read_info->authenticate != (char *) NULL)
    (void) FormatLocaleString(options+strlen(options),MaxTextExtent,
      " -sXPSPassword=%s",read_info->authenticate);
  (void) CopyMagickString(filename,read_info->filename,MaxTextExtent);
  (void) AcquireUniqueFilename(read_info->filename);
  (void) FormatLocaleString(command,MaxTextExtent,
    GetDelegateCommands(delegate_info),
    read_info->antialias != MagickFalse ? 4 : 1,
    read_info->antialias != MagickFalse ? 4 : 1,density,options,
    read_info->filename,input_filename);
  status=SystemCommand(MagickFalse,read_info->verbose,command,exception) != 0 ?
    MagickTrue : MagickFalse;
  image=ReadImage(read_info,exception);
  (void) RelinquishUniqueFileResource(read_info->filename);
  (void) RelinquishUniqueFileResource(input_filename);
  read_info=DestroyImageInfo(read_info);
  if (image == (Image *) NULL)
    ThrowReaderException(DelegateError,"XPSDelegateFailed");
  if (LocaleCompare(image->magick,"BMP") == 0)
    {
      Image
        *cmyk_image;

      cmyk_image=ConsolidateCMYKImages(image,&image->exception);
      if (cmyk_image != (Image *) NULL)
        {
          image=DestroyImageList(image);
          image=cmyk_image;
        }
    }
  do
  {
    (void) CopyMagickString(image->filename,filename,MaxTextExtent);
    image->page=page;
    next_image=SyncNextImageInList(image);
    if (next_image != (Image *) NULL)
      image=next_image;
  } while (next_image != (Image *) NULL);
  return(GetFirstImageInList(image));
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   R e g i s t e r X P S I m a g e                                           %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  RegisterXPSImage() adds attributes for the Microsoft XML Paper Specification
%  format to the list of supported formats.  The attributes include the image
%  format tag, a method to read and/or write the format, whether the format
%  supports the saving of more than one frame to the same file or blob,
%  whether the format supports native in-memory I/O, and a brief
%  description of the format.
%
%  The format of the RegisterXPSImage method is:
%
%      size_t RegisterXPSImage(void)
%
*/
ModuleExport size_t RegisterXPSImage(void)
{
  MagickInfo
    *entry;

  entry=SetMagickInfo("XPS");
  entry->decoder=(DecodeImageHandler *) ReadXPSImage;
  entry->adjoin=MagickFalse;
  entry->blob_support=MagickFalse;
  entry->seekable_stream=MagickTrue;
  entry->thread_support=EncoderThreadSupport;
  entry->description=ConstantString("Microsoft XML Paper Specification");
  entry->module=ConstantString("XPS");
  (void) RegisterMagickInfo(entry);
  return(MagickImageCoderSignature);
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   U n r e g i s t e r X P S I m a g e                                       %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  UnregisterXPSImage() removes format registrations made by the XPS module
%  from the list of supported formats.
%
%  The format of the UnregisterXPSImage method is:
%
%      UnregisterXPSImage(void)
%
*/
ModuleExport void UnregisterXPSImage(void)
{
  (void) UnregisterMagickInfo("XPS");
}


text:
package cn.haoyunbang.haocommon.widget.imageload;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import com.facebook.drawee.view.SimpleDraweeView;

import butterknife.Bind;
import butterknife.ButterKnife;
import cn.haoyunbang.common.eventbus.HaoEvent;
import cn.haoyunbang.common.ui.base.BaseHaoFragment;
import cn.haoyunbang.haocommon.R;
import cn.haoyunbang.haocommon.utils.ImageUrlUtils;

/**
 * Created by fangxiao on 15/9/10.
 */
public class ImageListFragment extends BaseHaoFragment {

    @Bind(R.id.recyclerview)
    RecyclerView recyclerview;

    @Override
    protected void onFirstUserVisible() {
        mActivity = getActivity();
    }

    @Override
    protected void onUserVisible() {

    }

    @Override
    protected void onUserInvisible() {

    }

    @Override
    protected View getLoadingTargetView() {
        return recyclerview;
    }

    @Override
    protected void initViewsAndEvents() {
        setupRecyclerView(recyclerview);
    }

    @Override
    protected int getContentViewLayoutID() {
        return R.layout.fragment_image_list;
    }

    @Override
    protected void onEventComming(HaoEvent haoEvent) {

    }

    @Override
    protected boolean isBindEventBusHere() {
        return false;
    }

    private Activity mActivity;

    private void setupRecyclerView(RecyclerView recyclerView) {
        if (ImageListFragment.this.getArguments().getInt("type") == 1) {
            recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));
        } else if (ImageListFragment.this.getArguments().getInt("type") == 2) {
            StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
            recyclerView.setLayoutManager(layoutManager);
        } else {
            GridLayoutManager layoutManager = new GridLayoutManager(recyclerView.getContext(), 3);
            layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
            recyclerView.setLayoutManager(layoutManager);
        }
        recyclerView.setAdapter(new SimpleStringRecyclerViewAdapter(recyclerView, ImageUrlUtils.getImageUrls()));
    }

    public class SimpleStringRecyclerViewAdapter
            extends RecyclerView.Adapter<SimpleStringRecyclerViewAdapter.ViewHolder> {

        private String[] mValues;
        private RecyclerView mRecyclerView;

        public class ViewHolder extends RecyclerView.ViewHolder {
            public final View mView;
            public final SimpleDraweeView mImageView;

            public ViewHolder(View view) {
                super(view);
                mView = view;
                mImageView = (SimpleDraweeView) view.findViewById(R.id.image1);
            }
        }

        public SimpleStringRecyclerViewAdapter(RecyclerView recyclerView, String[] items) {
            mValues = items;
            mRecyclerView = recyclerView;
        }

        @Override
        public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.image_list_item, parent, false);
            return new ViewHolder(view);
        }

        @Override
        public void onBindViewHolder(final ViewHolder holder, final int position) {
            FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) holder.mImageView.getLayoutParams();
            if (mRecyclerView.getLayoutManager() instanceof GridLayoutManager) {
                layoutParams.height = 200;
            } else if (mRecyclerView.getLayoutManager() instanceof StaggeredGridLayoutManager) {
                layoutParams.height = 600;
            } else {
                layoutParams.height = 800;
            }
            Uri uri = Uri.parse(mValues[position]);
            holder.mImageView.setImageURI(uri);
            holder.mImageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent = new Intent(mActivity, ViewPagerActivity.class);
                    intent.putExtra("position", position);
                    mActivity.startActivity(intent);

                }
            });
        }

        @Override
        public int getItemCount() {
            return mValues.length;
        }
    }
}