text:
package com.amazonaws.services.shield;

import javax.annotation.Generated;

import com.amazonaws.services.shield.model.*;

/**
 * Interface for accessing AWS Shield asynchronously. Each asynchronous method will return a Java Future object
 * representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
 * notification when an asynchronous operation completes.
 *

 * Note: Do not directly implement this interface, new methods are added to it regularly. Extend from
 * {@link com.amazonaws.services.shield.AbstractAWSShieldAsync} instead.
 *

 *

 * <fullname>AWS Shield Advanced</fullname>
 *

 * This is the AWS Shield Advanced API Reference. This guide is for developers who need detailed information
 * about the AWS Shield Advanced API actions, data types, and errors. For detailed information about AWS WAF and AWS
 * Shield Advanced features and an overview of how to use the AWS WAF and AWS Shield Advanced APIs, see the AWS WAF and AWS Shield Developer Guide.
 *

 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public interface AWSShieldAsync extends AWSShield {

    /**
     *

     * Authorizes the DDoS Response team (DRT) to access the specified Amazon S3 bucket containing your AWS WAF logs.
     * You can associate up to 10 Amazon S3 buckets with your subscription.
     *

     *

     * To use the services of the DRT and make an AssociateDRTLogBucket request, you must be subscribed to
     * the Business Support plan or the Enterprise Support plan.
     *

     *
     * @param associateDRTLogBucketRequest
     * @return A Java Future containing the result of the AssociateDRTLogBucket operation returned by the service.
     * @sample AWSShieldAsync.AssociateDRTLogBucket
     * @see AWS
     *      API Documentation
     */
    java.util.concurrent.Future<AssociateDRTLogBucketResult> associateDRTLogBucketAsync(AssociateDRTLogBucketRequest associateDRTLogBucketRequest);

    /**
     *

     * Authorizes the DDoS Response team (DRT) to access the specified Amazon S3 bucket containing your AWS WAF logs.
     * You can associate up to 10 Amazon S3 buckets with your subscription.
     *

     *

     * To use the services of the DRT and make an AssociateDRTLogBucket request, you must be subscribed to
     * the Business Support plan or the Enterprise Support plan.
     *

     *
     * @param associateDRTLogBucketRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the AssociateDRTLogBucket operation returned by the service.
     * @sample AWSShieldAsyncHandler.AssociateDRTLogBucket
     * @see AWS
     *      API Documentation
     */
    java.util.concurrent.Future<AssociateDRTLogBucketResult> associateDRTLogBucketAsync(AssociateDRTLogBucketRequest associateDRTLogBucketRequest,
            com.amazonaws.handlers.AsyncHandler<AssociateDRTLogBucketRequest, AssociateDRTLogBucketResult> asyncHandler);

    /**
     *

     * Authorizes the DDoS Response team (DRT), using the specified role, to access your AWS account to assist with DDoS
     * attack mitigation during potential attacks. This enables the DRT to inspect your AWS WAF configuration and create
     * or update AWS WAF rules and web ACLs.
     *

     *

     * You can associate only one RoleArn with your subscription. If you submit an
     * AssociateDRTRole request for an account that already has an associated role, the new
     * RoleArn will replace the existing RoleArn.
     *

     *

     * Prior to making the AssociateDRTRole request, you must attach the AWSShieldDRTAccessPolicy managed policy to the role you will specify in the request. For more information
     * see Attaching and
     * Detaching IAM Policies. The role must also trust the service principal  drt.shield.amazonaws.com
     * . For more information, see IAM JSON
     * Policy Elements: Principal.
     *

     *

     * The DRT will have access only to your AWS WAF and Shield resources. By submitting this request, you authorize the
     * DRT to inspect your AWS WAF and Shield configuration and create and update AWS WAF rules and web ACLs on your
     * behalf. The DRT takes these actions only if explicitly authorized by you.
     *

     *

     * You must have the iam:PassRole permission to make an AssociateDRTRole request. For more
     * information, see Granting a
     * User Permissions to Pass a Role to an AWS Service.
     *

     *

     * To use the services of the DRT and make an AssociateDRTRole request, you must be subscribed to the
     * Business Support plan or the Enterprise Support plan.
     *

     *
     * @param associateDRTRoleRequest
     * @return A Java Future containing the result of the AssociateDRTRole operation returned by the service.
     * @sample AWSShieldAsync.AssociateDRTRole
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<AssociateDRTRoleResult> associateDRTRoleAsync(AssociateDRTRoleRequest associateDRTRoleRequest);

    /**
     *

     * Authorizes the DDoS Response team (DRT), using the specified role, to access your AWS account to assist with DDoS
     * attack mitigation during potential attacks. This enables the DRT to inspect your AWS WAF configuration and create
     * or update AWS WAF rules and web ACLs.
     *

     *

     * You can associate only one RoleArn with your subscription. If you submit an
     * AssociateDRTRole request for an account that already has an associated role, the new
     * RoleArn will replace the existing RoleArn.
     *

     *

     * Prior to making the AssociateDRTRole request, you must attach the AWSShieldDRTAccessPolicy managed policy to the role you will specify in the request. For more information
     * see Attaching and
     * Detaching IAM Policies. The role must also trust the service principal  drt.shield.amazonaws.com
     * . For more information, see IAM JSON
     * Policy Elements: Principal.
     *

     *

     * The DRT will have access only to your AWS WAF and Shield resources. By submitting this request, you authorize the
     * DRT to inspect your AWS WAF and Shield configuration and create and update AWS WAF rules and web ACLs on your
     * behalf. The DRT takes these actions only if explicitly authorized by you.
     *

     *

     * You must have the iam:PassRole permission to make an AssociateDRTRole request. For more
     * information, see Granting a
     * User Permissions to Pass a Role to an AWS Service.
     *

     *

     * To use the services of the DRT and make an AssociateDRTRole request, you must be subscribed to the
     * Business Support plan or the Enterprise Support plan.
     *

     *
     * @param associateDRTRoleRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the AssociateDRTRole operation returned by the service.
     * @sample AWSShieldAsyncHandler.AssociateDRTRole
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<AssociateDRTRoleResult> associateDRTRoleAsync(AssociateDRTRoleRequest associateDRTRoleRequest,
            com.amazonaws.handlers.AsyncHandler<AssociateDRTRoleRequest, AssociateDRTRoleResult> asyncHandler);

    /**
     *

     * Enables AWS Shield Advanced for a specific AWS resource. The resource can be an Amazon CloudFront distribution,
     * Elastic Load Balancing load balancer, AWS Global Accelerator accelerator, Elastic IP Address, or an Amazon Route
     * 53 hosted zone.
     *

     *

     * You can add protection to only a single resource with each CreateProtection request. If you want to add
     * protection to multiple resources at once, use the AWS WAF
     * console. For more information see Getting Started with AWS
     * Shield Advanced and Add AWS Shield
     * Advanced Protection to more AWS Resources.
     *

     *
     * @param createProtectionRequest
     * @return A Java Future containing the result of the CreateProtection operation returned by the service.
     * @sample AWSShieldAsync.CreateProtection
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<CreateProtectionResult> createProtectionAsync(CreateProtectionRequest createProtectionRequest);

    /**
     *

     * Enables AWS Shield Advanced for a specific AWS resource. The resource can be an Amazon CloudFront distribution,
     * Elastic Load Balancing load balancer, AWS Global Accelerator accelerator, Elastic IP Address, or an Amazon Route
     * 53 hosted zone.
     *

     *

     * You can add protection to only a single resource with each CreateProtection request. If you want to add
     * protection to multiple resources at once, use the AWS WAF
     * console. For more information see Getting Started with AWS
     * Shield Advanced and Add AWS Shield
     * Advanced Protection to more AWS Resources.
     *

     *
     * @param createProtectionRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the CreateProtection operation returned by the service.
     * @sample AWSShieldAsyncHandler.CreateProtection
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<CreateProtectionResult> createProtectionAsync(CreateProtectionRequest createProtectionRequest,
            com.amazonaws.handlers.AsyncHandler<CreateProtectionRequest, CreateProtectionResult> asyncHandler);

    /**
     *

     * Activates AWS Shield Advanced for an account.
     *

     *

     * As part of this request you can specify EmergencySettings that automaticaly grant the DDoS response
     * team (DRT) needed permissions to assist you during a suspected DDoS attack. For more information see Authorize the DDoS Response Team
     * to Create Rules and Web ACLs on Your Behalf.
     *

     *

     * To use the services of the DRT, you must be subscribed to the Business Support plan or the Enterprise Support plan.
     *

     *

     * When you initally create a subscription, your subscription is set to be automatically renewed at the end of the
     * existing subscription period. You can change this by submitting an UpdateSubscription request.
     *

     *
     * @param createSubscriptionRequest
     * @return A Java Future containing the result of the CreateSubscription operation returned by the service.
     * @sample AWSShieldAsync.CreateSubscription
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<CreateSubscriptionResult> createSubscriptionAsync(CreateSubscriptionRequest createSubscriptionRequest);

    /**
     *

     * Activates AWS Shield Advanced for an account.
     *

     *

     * As part of this request you can specify EmergencySettings that automaticaly grant the DDoS response
     * team (DRT) needed permissions to assist you during a suspected DDoS attack. For more information see Authorize the DDoS Response Team
     * to Create Rules and Web ACLs on Your Behalf.
     *

     *

     * To use the services of the DRT, you must be subscribed to the Business Support plan or the Enterprise Support plan.
     *

     *

     * When you initally create a subscription, your subscription is set to be automatically renewed at the end of the
     * existing subscription period. You can change this by submitting an UpdateSubscription request.
     *

     *
     * @param createSubscriptionRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the CreateSubscription operation returned by the service.
     * @sample AWSShieldAsyncHandler.CreateSubscription
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<CreateSubscriptionResult> createSubscriptionAsync(CreateSubscriptionRequest createSubscriptionRequest,
            com.amazonaws.handlers.AsyncHandler<CreateSubscriptionRequest, CreateSubscriptionResult> asyncHandler);

    /**
     *

     * Deletes an AWS Shield Advanced Protection.
     *

     *
     * @param deleteProtectionRequest
     * @return A Java Future containing the result of the DeleteProtection operation returned by the service.
     * @sample AWSShieldAsync.DeleteProtection
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<DeleteProtectionResult> deleteProtectionAsync(DeleteProtectionRequest deleteProtectionRequest);

    /**
     *

     * Deletes an AWS Shield Advanced Protection.
     *

     *
     * @param deleteProtectionRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DeleteProtection operation returned by the service.
     * @sample AWSShieldAsyncHandler.DeleteProtection
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<DeleteProtectionResult> deleteProtectionAsync(DeleteProtectionRequest deleteProtectionRequest,
            com.amazonaws.handlers.AsyncHandler<DeleteProtectionRequest, DeleteProtectionResult> asyncHandler);

    /**
     *

     * Removes AWS Shield Advanced from an account. AWS Shield Advanced requires a 1-year subscription commitment. You
     * cannot delete a subscription prior to the completion of that commitment.
     *

     *
     * @param deleteSubscriptionRequest
     * @return A Java Future containing the result of the DeleteSubscription operation returned by the service.
     * @sample AWSShieldAsync.DeleteSubscription
     * @see AWS API
     *      Documentation
     */
    @Deprecated
    java.util.concurrent.Future<DeleteSubscriptionResult> deleteSubscriptionAsync(DeleteSubscriptionRequest deleteSubscriptionRequest);

    /**
     *

     * Removes AWS Shield Advanced from an account. AWS Shield Advanced requires a 1-year subscription commitment. You
     * cannot delete a subscription prior to the completion of that commitment.
     *

     *
     * @param deleteSubscriptionRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DeleteSubscription operation returned by the service.
     * @sample AWSShieldAsyncHandler.DeleteSubscription
     * @see AWS API
     *      Documentation
     */
    @Deprecated
    java.util.concurrent.Future<DeleteSubscriptionResult> deleteSubscriptionAsync(DeleteSubscriptionRequest deleteSubscriptionRequest,
            com.amazonaws.handlers.AsyncHandler<DeleteSubscriptionRequest, DeleteSubscriptionResult> asyncHandler);

    /**
     *

     * Describes the details of a DDoS attack.
     *

     *
     * @param describeAttackRequest
     * @return A Java Future containing the result of the DescribeAttack operation returned by the service.
     * @sample AWSShieldAsync.DescribeAttack
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<DescribeAttackResult> describeAttackAsync(DescribeAttackRequest describeAttackRequest);

    /**
     *

     * Describes the details of a DDoS attack.
     *

     *
     * @param describeAttackRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeAttack operation returned by the service.
     * @sample AWSShieldAsyncHandler.DescribeAttack
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<DescribeAttackResult> describeAttackAsync(DescribeAttackRequest describeAttackRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeAttackRequest, DescribeAttackResult> asyncHandler);

    /**
     *

     * Returns the current role and list of Amazon S3 log buckets used by the DDoS Response team (DRT) to access your
     * AWS account while assisting with attack mitigation.
     *

     *
     * @param describeDRTAccessRequest
     * @return A Java Future containing the result of the DescribeDRTAccess operation returned by the service.
     * @sample AWSShieldAsync.DescribeDRTAccess
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<DescribeDRTAccessResult> describeDRTAccessAsync(DescribeDRTAccessRequest describeDRTAccessRequest);

    /**
     *

     * Returns the current role and list of Amazon S3 log buckets used by the DDoS Response team (DRT) to access your
     * AWS account while assisting with attack mitigation.
     *

     *
     * @param describeDRTAccessRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeDRTAccess operation returned by the service.
     * @sample AWSShieldAsyncHandler.DescribeDRTAccess
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<DescribeDRTAccessResult> describeDRTAccessAsync(DescribeDRTAccessRequest describeDRTAccessRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeDRTAccessRequest, DescribeDRTAccessResult> asyncHandler);

    /**
     *

     * Lists the email addresses that the DRT can use to contact you during a suspected attack.
     *

     *
     * @param describeEmergencyContactSettingsRequest
     * @return A Java Future containing the result of the DescribeEmergencyContactSettings operation returned by the
     *         service.
     * @sample AWSShieldAsync.DescribeEmergencyContactSettings
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeEmergencyContactSettingsResult> describeEmergencyContactSettingsAsync(
            DescribeEmergencyContactSettingsRequest describeEmergencyContactSettingsRequest);

    /**
     *

     * Lists the email addresses that the DRT can use to contact you during a suspected attack.
     *

     *
     * @param describeEmergencyContactSettingsRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeEmergencyContactSettings operation returned by the
     *         service.
     * @sample AWSShieldAsyncHandler.DescribeEmergencyContactSettings
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DescribeEmergencyContactSettingsResult> describeEmergencyContactSettingsAsync(
            DescribeEmergencyContactSettingsRequest describeEmergencyContactSettingsRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeEmergencyContactSettingsRequest, DescribeEmergencyContactSettingsResult> asyncHandler);

    /**
     *

     * Lists the details of a Protection object.
     *

     *
     * @param describeProtectionRequest
     * @return A Java Future containing the result of the DescribeProtection operation returned by the service.
     * @sample AWSShieldAsync.DescribeProtection
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<DescribeProtectionResult> describeProtectionAsync(DescribeProtectionRequest describeProtectionRequest);

    /**
     *

     * Lists the details of a Protection object.
     *

     *
     * @param describeProtectionRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeProtection operation returned by the service.
     * @sample AWSShieldAsyncHandler.DescribeProtection
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<DescribeProtectionResult> describeProtectionAsync(DescribeProtectionRequest describeProtectionRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeProtectionRequest, DescribeProtectionResult> asyncHandler);

    /**
     *

     * Provides details about the AWS Shield Advanced subscription for an account.
     *

     *
     * @param describeSubscriptionRequest
     * @return A Java Future containing the result of the DescribeSubscription operation returned by the service.
     * @sample AWSShieldAsync.DescribeSubscription
     * @see AWS
     *      API Documentation
     */
    java.util.concurrent.Future<DescribeSubscriptionResult> describeSubscriptionAsync(DescribeSubscriptionRequest describeSubscriptionRequest);

    /**
     *

     * Provides details about the AWS Shield Advanced subscription for an account.
     *

     *
     * @param describeSubscriptionRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DescribeSubscription operation returned by the service.
     * @sample AWSShieldAsyncHandler.DescribeSubscription
     * @see AWS
     *      API Documentation
     */
    java.util.concurrent.Future<DescribeSubscriptionResult> describeSubscriptionAsync(DescribeSubscriptionRequest describeSubscriptionRequest,
            com.amazonaws.handlers.AsyncHandler<DescribeSubscriptionRequest, DescribeSubscriptionResult> asyncHandler);

    /**
     *

     * Removes the DDoS Response team's (DRT) access to the specified Amazon S3 bucket containing your AWS WAF logs.
     *

     *

     * To make a DisassociateDRTLogBucket request, you must be subscribed to the Business Support plan or the Enterprise Support plan. However, if you are
     * not subscribed to one of these support plans, but had been previously and had granted the DRT access to your
     * account, you can submit a DisassociateDRTLogBucket request to remove this access.
     *

     *
     * @param disassociateDRTLogBucketRequest
     * @return A Java Future containing the result of the DisassociateDRTLogBucket operation returned by the service.
     * @sample AWSShieldAsync.DisassociateDRTLogBucket
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DisassociateDRTLogBucketResult> disassociateDRTLogBucketAsync(DisassociateDRTLogBucketRequest disassociateDRTLogBucketRequest);

    /**
     *

     * Removes the DDoS Response team's (DRT) access to the specified Amazon S3 bucket containing your AWS WAF logs.
     *

     *

     * To make a DisassociateDRTLogBucket request, you must be subscribed to the Business Support plan or the Enterprise Support plan. However, if you are
     * not subscribed to one of these support plans, but had been previously and had granted the DRT access to your
     * account, you can submit a DisassociateDRTLogBucket request to remove this access.
     *

     *
     * @param disassociateDRTLogBucketRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DisassociateDRTLogBucket operation returned by the service.
     * @sample AWSShieldAsyncHandler.DisassociateDRTLogBucket
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<DisassociateDRTLogBucketResult> disassociateDRTLogBucketAsync(DisassociateDRTLogBucketRequest disassociateDRTLogBucketRequest,
            com.amazonaws.handlers.AsyncHandler<DisassociateDRTLogBucketRequest, DisassociateDRTLogBucketResult> asyncHandler);

    /**
     *

     * Removes the DDoS Response team's (DRT) access to your AWS account.
     *

     *

     * To make a DisassociateDRTRole request, you must be subscribed to the Business Support plan or the Enterprise Support plan. However, if you are
     * not subscribed to one of these support plans, but had been previously and had granted the DRT access to your
     * account, you can submit a DisassociateDRTRole request to remove this access.
     *

     *
     * @param disassociateDRTRoleRequest
     * @return A Java Future containing the result of the DisassociateDRTRole operation returned by the service.
     * @sample AWSShieldAsync.DisassociateDRTRole
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<DisassociateDRTRoleResult> disassociateDRTRoleAsync(DisassociateDRTRoleRequest disassociateDRTRoleRequest);

    /**
     *

     * Removes the DDoS Response team's (DRT) access to your AWS account.
     *

     *

     * To make a DisassociateDRTRole request, you must be subscribed to the Business Support plan or the Enterprise Support plan. However, if you are
     * not subscribed to one of these support plans, but had been previously and had granted the DRT access to your
     * account, you can submit a DisassociateDRTRole request to remove this access.
     *

     *
     * @param disassociateDRTRoleRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the DisassociateDRTRole operation returned by the service.
     * @sample AWSShieldAsyncHandler.DisassociateDRTRole
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<DisassociateDRTRoleResult> disassociateDRTRoleAsync(DisassociateDRTRoleRequest disassociateDRTRoleRequest,
            com.amazonaws.handlers.AsyncHandler<DisassociateDRTRoleRequest, DisassociateDRTRoleResult> asyncHandler);

    /**
     *

     * Returns the SubscriptionState, either Active or Inactive.
     *

     *
     * @param getSubscriptionStateRequest
     * @return A Java Future containing the result of the GetSubscriptionState operation returned by the service.
     * @sample AWSShieldAsync.GetSubscriptionState
     * @see AWS
     *      API Documentation
     */
    java.util.concurrent.Future<GetSubscriptionStateResult> getSubscriptionStateAsync(GetSubscriptionStateRequest getSubscriptionStateRequest);

    /**
     *

     * Returns the SubscriptionState, either Active or Inactive.
     *

     *
     * @param getSubscriptionStateRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the GetSubscriptionState operation returned by the service.
     * @sample AWSShieldAsyncHandler.GetSubscriptionState
     * @see AWS
     *      API Documentation
     */
    java.util.concurrent.Future<GetSubscriptionStateResult> getSubscriptionStateAsync(GetSubscriptionStateRequest getSubscriptionStateRequest,
            com.amazonaws.handlers.AsyncHandler<GetSubscriptionStateRequest, GetSubscriptionStateResult> asyncHandler);

    /**
     *

     * Returns all ongoing DDoS attacks or all DDoS attacks during a specified time period.
     *

     *
     * @param listAttacksRequest
     * @return A Java Future containing the result of the ListAttacks operation returned by the service.
     * @sample AWSShieldAsync.ListAttacks
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<ListAttacksResult> listAttacksAsync(ListAttacksRequest listAttacksRequest);

    /**
     *

     * Returns all ongoing DDoS attacks or all DDoS attacks during a specified time period.
     *

     *
     * @param listAttacksRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the ListAttacks operation returned by the service.
     * @sample AWSShieldAsyncHandler.ListAttacks
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<ListAttacksResult> listAttacksAsync(ListAttacksRequest listAttacksRequest,
            com.amazonaws.handlers.AsyncHandler<ListAttacksRequest, ListAttacksResult> asyncHandler);

    /**
     *

     * Lists all Protection objects for the account.
     *

     *
     * @param listProtectionsRequest
     * @return A Java Future containing the result of the ListProtections operation returned by the service.
     * @sample AWSShieldAsync.ListProtections
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<ListProtectionsResult> listProtectionsAsync(ListProtectionsRequest listProtectionsRequest);

    /**
     *

     * Lists all Protection objects for the account.
     *

     *
     * @param listProtectionsRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the ListProtections operation returned by the service.
     * @sample AWSShieldAsyncHandler.ListProtections
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<ListProtectionsResult> listProtectionsAsync(ListProtectionsRequest listProtectionsRequest,
            com.amazonaws.handlers.AsyncHandler<ListProtectionsRequest, ListProtectionsResult> asyncHandler);

    /**
     *

     * Updates the details of the list of email addresses that the DRT can use to contact you during a suspected attack.
     *

     *
     * @param updateEmergencyContactSettingsRequest
     * @return A Java Future containing the result of the UpdateEmergencyContactSettings operation returned by the
     *         service.
     * @sample AWSShieldAsync.UpdateEmergencyContactSettings
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<UpdateEmergencyContactSettingsResult> updateEmergencyContactSettingsAsync(
            UpdateEmergencyContactSettingsRequest updateEmergencyContactSettingsRequest);

    /**
     *

     * Updates the details of the list of email addresses that the DRT can use to contact you during a suspected attack.
     *

     *
     * @param updateEmergencyContactSettingsRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the UpdateEmergencyContactSettings operation returned by the
     *         service.
     * @sample AWSShieldAsyncHandler.UpdateEmergencyContactSettings
     * @see AWS API Documentation
     */
    java.util.concurrent.Future<UpdateEmergencyContactSettingsResult> updateEmergencyContactSettingsAsync(
            UpdateEmergencyContactSettingsRequest updateEmergencyContactSettingsRequest,
            com.amazonaws.handlers.AsyncHandler<UpdateEmergencyContactSettingsRequest, UpdateEmergencyContactSettingsResult> asyncHandler);

    /**
     *

     * Updates the details of an existing subscription. Only enter values for parameters you want to change. Empty
     * parameters are not updated.
     *

     *
     * @param updateSubscriptionRequest
     * @return A Java Future containing the result of the UpdateSubscription operation returned by the service.
     * @sample AWSShieldAsync.UpdateSubscription
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<UpdateSubscriptionResult> updateSubscriptionAsync(UpdateSubscriptionRequest updateSubscriptionRequest);

    /**
     *

     * Updates the details of an existing subscription. Only enter values for parameters you want to change. Empty
     * parameters are not updated.
     *

     *
     * @param updateSubscriptionRequest
     * @param asyncHandler
     *        Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
     *        implementation of the callback methods in this interface to receive notification of successful or
     *        unsuccessful completion of the operation.
     * @return A Java Future containing the result of the UpdateSubscription operation returned by the service.
     * @sample AWSShieldAsyncHandler.UpdateSubscription
     * @see AWS API
     *      Documentation
     */
    java.util.concurrent.Future<UpdateSubscriptionResult> updateSubscriptionAsync(UpdateSubscriptionRequest updateSubscriptionRequest,
            com.amazonaws.handlers.AsyncHandler<UpdateSubscriptionRequest, UpdateSubscriptionResult> asyncHandler);

}


text:
#ifndef __GRAPH_H
#define __GRAPH_H

#include "collection.h"

typedef struct _Graph{
  int v; /**< Number of vertices in #Graph */
  int e; /**< Number of edges in #Graph */
  Bag *adj;
} Graph;

void Graph_init(Graph* graph, int no_of_vertex);
int Graph_no_of_vertex(Graph* graph);
int Graph_no_of_edge(Graph* graph);
void Graph_add_edge(Graph* graph, int v, int w);
int Graph_degree_of_vertex(Graph* graph, int vertex);
int Graph_max_degree(Graph* graph);
int Graph_average_degree(Graph* graph);
int Graph_no_of_self_loops(Graph* graph);
void Graph_show(Graph* graph);
void Graph_destroy(Graph* graph);

typedef struct _Graph_search_and_path{
  bool* marked;
  int* edge_to;
  int count;
  int source_vertex;
  Graph* graph;
} Graph_path;

typedef enum _Search_method{
  DFS=1,
  BFS=2,
  INVALID=3
} Search_method;

void Graph_path_init(Graph_path* gp, Graph* graph, int source_vertex);
bool Graph_path_has_path_to(Graph_path* gp, int vertex);
int Graph_path_count(Graph_path* gp);
void Graph_path_search(Graph_path* gp, Search_method method);
void Graph_path_show_path(Graph_path* gp, int vertex_to);
void Graph_path_destroy(Graph_path* gp);

typedef struct _Connected_Component{
bool* marked;
int* id;
int count;
Graph* graph;
} CC;

void CC_init(CC* cc, Graph* graph);
void CC_create_id(CC* cc);
int CC_no_of_connected_component(CC* cc);
bool CC_is_connected(CC* cc, int v, int w);
void CC_show_components(CC* cc);
void CC_destroy(CC* cc);

#endif

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 *
 */

namespace Mvc5\Plugins;

use Mvc5\Arg;
use Mvc5\Template\TemplateLayout;
use Mvc5\Template\TemplateModel;

use function constant;
use function defined;

trait View
{
    /**
     * @param array $vars
     * @param string|null $template
     * @param string $model
     * @return TemplateLayout|mixed
     */
    protected function layout(array $vars = [], string $template = null, string $model = Arg::LAYOUT) : TemplateLayout
    {
        return $this->model($vars, $template, $model);
    }

    /**
     * @param array $vars
     * @param string|null $template
     * @param string|null $model
     * @return TemplateModel|mixed
     */
    protected function model(array $vars = [], string $template = null, string $model = null) : TemplateModel
    {
        !$model && $model = defined('static::VIEW_MODEL') ? constant('static::VIEW_MODEL') : Arg::VIEW_MODEL;

        !$template && defined('static::TEMPLATE') && $template = constant('static::TEMPLATE');

        $template && $vars[Arg::TEMPLATE_MODEL] = $template;

        return !$vars ? $this->plugin($model) : $this->plugin($model)->with($vars);
    }

    /**
     * @param string|mixed $plugin
     * @param array $args
     * @param callable|null $callback
     * @return mixed
     */
    protected abstract function plugin($plugin, array $args = [], callable $callback = null);

    /**
     * @param string|null $template
     * @param array $vars
     * @return TemplateModel|mixed
     */
    protected function view(string $template = null, array $vars = []) : TemplateModel
    {
        return $this->model($vars, $template);
    }
}


text:
<?php

use Tygh\BlockManager\SchemesManager;
use Tygh\BlockManager\RenderManager;

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

function smarty_function_render_location($params, &$smarty)
{
    if (!empty($params['dispatch'])) {
        $dispatch = $params['dispatch'];
    } elseif ($smarty->getTemplateVars('exception_status')) {
        $dispatch = 'no_page';
    } else {
        $dispatch = !empty($_REQUEST['dispatch']) ? $_REQUEST['dispatch'] : 'index.index';
    }

    $location_id = 0;
    if (!empty($params['location_id'])) {
        $location_id = $params['location_id'];
    }

    $area = !empty($params['area']) ?  $params['area'] : AREA;

    if (!empty($params['dynamic_object'])) {
        $dynamic_object = $params['dynamic_object'];
    } elseif (!empty($_REQUEST['dynamic_object']) && $area != 'C') {
        $dynamic_object = $_REQUEST['dynamic_object'];
    } else {
        $dynamic_object_scheme = SchemesManager::getDynamicObject($dispatch, $area);
        if (!empty($dynamic_object_scheme) && !empty($_REQUEST[$dynamic_object_scheme['key']])) {
            $dynamic_object['object_type'] = $dynamic_object_scheme['object_type'];
            $dynamic_object['object_id'] = $_REQUEST[$dynamic_object_scheme['key']];
        } else {
            $dynamic_object = array();
        }
    }

    $lang_code = !empty($params['lang_code']) ? $params['lang_code'] : DESCR_SL;

    $br = new RenderManager($dispatch, $area, $dynamic_object, $location_id, $lang_code);

    return $br->render();
}


text:
module Tictactoe
  class RandomPlayer
    def initialize(mark)
      @mark = mark
    end

    def move(board)
      options = board.next_moves(@mark)
      options[rand(options.length)]
    end

    def game_over(board)
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

    class IP
    {
         public string Code { get; set; }

    public int Occurences { get; set; }
    }


text:
<address>
	<?php br_Icon('phone') ?> 01 77 17 43 37
	<?php br_Icon('mail') ?> contact@gilleshoarau.com
</address>


text:
import BaseConfigurator from './BaseConfigurator';
import TriggerConfigurator from './TriggerConfigurator';
import TimerConfigurator from './TimerConfigurator';
import AsyncActionConfigurator from './AsyncActionConfigurator';

export default class StateConfigurator extends BaseConfigurator {
  constructor(parent) {
    super(parent);
    this.config = {
      entryActions: [],
      exitActions: [],
      events: Object.create(null),
      anyEventTrigger: null,
      timers: [],
      asyncActions: [],
      submachine: null,
    };
  }

  onEnter(action) {
    this.config.entryActions.push(action);
    return this;
  }

  onExit(action) {
    this.config.exitActions.push(action);
    return this;
  }

  on(event) {
    if (!this.config.events[event]) {
      this.config.events[event] = new TriggerConfigurator(this);
    }
    return this.config.events[event];
  }

  onAny() {
    if (!this.config.anyEventTrigger) {
      this.config.anyEventTrigger = new TriggerConfigurator(this);
    }
    return this.config.anyEventTrigger;
  }

  onTimeout(timeout) {
    const timerConfigurator = new TimerConfigurator(this, timeout);
    this.config.timers.push(timerConfigurator);
    return timerConfigurator;
  }

  do(asyncAction) {
    const asyncActionConfigurator = new AsyncActionConfigurator(this, asyncAction);
    this.config.asyncActions.push(asyncActionConfigurator);
    return asyncActionConfigurator;
  }

  submachine(submachineConfig) {
    this.config.submachine = submachineConfig;
    return this;
  }
}


text:
const templateUrl = require('~features/output/details.partial.html');

let $http;
let $filter;
let $state;

let error;
let parse;
let prompt;
let resource;
let strings;
let wait;

let vm;

function mapChoices (choices) {
    if (!choices) return {};
    return Object.assign(...choices.map(([k, v]) => ({ [k]: v })));
}

function getStatusDetails (jobStatus) {
    const unmapped = jobStatus || resource.model.get('status');

    if (!unmapped) {
        return null;
    }

    const choices = mapChoices(resource.model.options('actions.GET.status.choices'));
    const label = strings.get('labels.STATUS');

    let icon;
    let value;

    if (unmapped === 'unknown') {
        icon = 'fa icon-job-pending';
        value = strings.get('details.UNKNOWN');
    } else {
        icon = `fa icon-job-${unmapped}`;
        value = choices[unmapped];
    }

    return { label, icon, value };
}

function getStartDetails (started) {
    const unfiltered = started || resource.model.get('started');
    const label = strings.get('labels.STARTED');

    let value;

    if (unfiltered) {
        value = $filter('longDate')(unfiltered);
    } else {
        value = strings.get('details.NOT_STARTED');
    }

    return { label, value };
}

function getFinishDetails (finished) {
    const unfiltered = finished || resource.model.get('finished');
    const label = strings.get('labels.FINISHED');

    let value;

    if (unfiltered) {
        value = $filter('longDate')(unfiltered);
    } else {
        value = strings.get('details.NOT_FINISHED');
    }

    return { label, value };
}

function getModuleArgDetails () {
    const value = resource.model.get('module_args');
    const label = strings.get('labels.MODULE_ARGS');

    if (!value) {
        return null;
    }

    return { label, value };
}

function getJobTypeDetails () {
    const unmapped = resource.model.get('job_type');

    if (!unmapped) {
        return null;
    }

    const choices = mapChoices(resource.model.options('actions.GET.job_type.choices'));

    const label = strings.get('labels.JOB_TYPE');
    const value = choices[unmapped];

    return { label, value };
}

function getVerbosityDetails () {
    const verbosity = resource.model.get('verbosity');

    if (!verbosity) {
        return null;
    }

    const choices = mapChoices(resource.model.options('actions.GET.verbosity.choices'));

    const label = strings.get('labels.VERBOSITY');
    const value = choices[verbosity];

    return { label, value };
}

function getSourceWorkflowJobDetails () {
    const sourceWorkflowJob = resource.model.get('summary_fields.source_workflow_job');

    if (!sourceWorkflowJob) {
        return null;
    }

    const label = strings.get('labels.SOURCE_WORKFLOW_JOB');
    const value = sourceWorkflowJob.name;
    const link = `/#/workflows/${sourceWorkflowJob.id}`;
    const tooltip = strings.get('tooltips.SOURCE_WORKFLOW_JOB');

    return { label, value, link, tooltip };
}

function getSliceJobDetails () {
    const count = resource.model.get('job_slice_count');

    if (!count) {
        return null;
    }

    if (count === 1) {
        return null;
    }

    const number = resource.model.get('job_slice_number');

    if (!number) {
        return null;
    }

    const label = strings.get('labels.SLICE_JOB');
    const offset = `${number}/${count}`;
    const tooltip = strings.get('tooltips.SLICE_JOB_DETAILS');

    if (label && offset && tooltip) {
        return { label, offset, tooltip };
    }
    return null;
}

function getJobTemplateDetails () {
    const jobTemplate = resource.model.get('summary_fields.job_template');

    if (!jobTemplate) {
        return null;
    }

    const label = strings.get('labels.JOB_TEMPLATE');
    const link = `/#/templates/job_template/${jobTemplate.id}`;
    const value = $filter('sanitize')(jobTemplate.name);
    const tooltip = strings.get('tooltips.JOB_TEMPLATE');

    return { label, link, value, tooltip };
}

function getInventorySourceDetails () {
    if (!resource.model.has('summary_fields.inventory_source.source')) {
        return null;
    }

    const { source } = resource.model.get('summary_fields.inventory_source');
    const choices = mapChoices(resource.model.options('actions.GET.source.choices'));

    const label = strings.get('labels.SOURCE');
    const value = choices[source];

    return { label, value };
}

function getOverwriteDetails () {
    if (!resource.model.has('overwrite')) {
        return null;
    }

    const label = strings.get('labels.OVERWRITE');
    const value = resource.model.get('overwrite');

    return { label, value };
}

function getOverwriteVarsDetails () {
    if (!resource.model.has('overwrite_vars')) {
        return null;
    }

    const label = strings.get('labels.OVERWRITE_VARS');
    const value = resource.model.get('overwrite_vars');

    return { label, value };
}

function getLicenseErrorDetails () {
    if (!resource.model.has('license_error')) {
        return null;
    }

    const label = strings.get('labels.LICENSE_ERROR');
    const value = resource.model.get('license_error');

    return { label, value };
}

function getLaunchedByDetails () {
    const createdBy = resource.model.get('summary_fields.created_by');
    const jobTemplate = resource.model.get('summary_fields.job_template');
    const relatedSchedule = resource.model.get('related.schedule');
    const schedule = resource.model.get('summary_fields.schedule');

    if (!createdBy && !schedule) {
        return null;
    }

    const label = strings.get('labels.LAUNCHED_BY');

    let link;
    let tooltip;
    let value;

    if (createdBy) {
        tooltip = strings.get('tooltips.USER');
        link = `/#/users/${createdBy.id}`;
        value = $filter('sanitize')(createdBy.username);
    } else if (relatedSchedule && jobTemplate) {
        tooltip = strings.get('tooltips.SCHEDULE');
        link = `/#/templates/job_template/${jobTemplate.id}/schedules/${schedule.id}`;
        value = $filter('sanitize')(schedule.name);
    } else {
        tooltip = null;
        link = null;
        value = $filter('sanitize')(schedule.name);
    }

    return { label, link, tooltip, value };
}

function getInventoryDetails () {
    const inventory = resource.model.get('summary_fields.inventory');

    if (!inventory) {
        return null;
    }

    const label = strings.get('labels.INVENTORY');
    const tooltip = strings.get('tooltips.INVENTORY');
    const value = $filter('sanitize')(inventory.name);

    let link;

    if (inventory.kind === 'smart') {
        link = `/#/inventories/smart/${inventory.id}`;
    } else {
        link = `/#/inventories/inventory/${inventory.id}`;
    }

    return { label, link, tooltip, value };
}

function getProjectDetails () {
    const project = resource.model.get('summary_fields.project');

    if (!project) {
        return null;
    }

    const label = strings.get('labels.PROJECT');
    const link = `/#/projects/${project.id}`;
    const value = project.name;
    const tooltip = strings.get('tooltips.PROJECT');

    return { label, link, value, tooltip };
}

function getProjectStatusDetails (projectStatus) {
    const project = resource.model.get('summary_fields.project');
    const jobStatus = projectStatus || resource.model.get('summary_fields.project_update.status');

    if (!project) {
        return null;
    }

    return jobStatus;
}

function getProjectUpdateDetails (updateId) {
    const project = resource.model.get('summary_fields.project');
    const jobId = updateId || resource.model.get('summary_fields.project_update.id');

    if (!project) {
        return null;
    }

    const link = `/#/jobs/project/${jobId}`;
    const tooltip = strings.get('tooltips.PROJECT_UPDATE');

    return { link, tooltip };
}

function getSCMRevisionDetails () {
    const label = strings.get('labels.SCM_REVISION');
    const value = resource.model.get('scm_revision');

    if (!value) {
        return null;
    }

    return { label, value };
}

function getPlaybookDetails () {
    const label = strings.get('labels.PLAYBOOK');
    const value = resource.model.get('playbook');

    if (!value) {
        return null;
    }

    return { label, value };
}

function getJobExplanationDetails () {
    const explanation = resource.model.get('job_explanation');

    if (!explanation) {
        return null;
    }

    const limit = 150;
    const label = strings.get('labels.JOB_EXPLANATION');

    let more = explanation;

    if (explanation.split(':')[0] === 'Previous Task Failed') {
        const taskStringIndex = explanation.split(':')[0].length + 1;
        const task = JSON.parse(explanation.substring(taskStringIndex));

        more = `${task.job_type} failed for ${task.job_name} with ID ${task.job_id}`;
    }

    const less = $filter('limitTo')(more, limit);

    const showMore = false;
    const hasMoreToShow = more.length > limit;

    return { label, less, more, showMore, hasMoreToShow };
}

function getResultTracebackDetails () {
    const traceback = resource.model.get('result_traceback');

    if (!traceback) {
        return null;
    }

    const limit = 150;
    const label = strings.get('labels.RESULT_TRACEBACK');

    const more = traceback;
    const less = $filter('limitTo')(more, limit);

    const showMore = false;
    const hasMoreToShow = more.length > limit;

    return { label, less, more, showMore, hasMoreToShow };
}

function getCredentialDetails () {
    let credentials = [];
    let credentialTags = [];

    if (resource.model.get('type') === 'job') {
        credentials = resource.model.get('summary_fields.credentials');
    } else {
        const credential = resource.model.get('summary_fields.credential');
        if (credential) {
            credentials.push(credential);
        }
    }

    if (!credentials || credentials.length < 1) {
        return null;
    }

    credentialTags = credentials.map((cred) => buildCredentialDetails(cred));

    const label = strings.get('labels.CREDENTIAL');
    const value = credentialTags;

    return { label, value };
}

function buildCredentialDetails (credential) {
    const icon = `${credential.kind}`;
    const link = `/#/credentials/${credential.id}`;
    const tooltip = strings.get('tooltips.CREDENTIAL');
    const value = $filter('sanitize')(credential.name);

    return { icon, link, tooltip, value };
}

function getForkDetails () {
    const label = strings.get('labels.FORKS');
    const value = resource.model.get('forks');

    if (!value) {
        return null;
    }

    return { label, value };
}

function getLimitDetails () {
    const label = strings.get('labels.LIMIT');
    const value = resource.model.get('limit');

    if (!value) {
        return null;
    }

    return { label, value };
}

function getInstanceGroupDetails () {
    const instanceGroup = resource.model.get('summary_fields.instance_group');

    if (!instanceGroup) {
        return null;
    }

    const label = strings.get('labels.INSTANCE_GROUP');
    const value = $filter('sanitize')(instanceGroup.name);
    const link = `/#/instance_groups/${instanceGroup.id}`;

    let isolated = null;

    if (instanceGroup.controller_id) {
        isolated = strings.get('details.ISOLATED');
    }

    return { label, value, isolated, link };
}

function getJobTagDetails () {
    const tagString = resource.model.get('job_tags');

    let jobTags;

    if (tagString) {
        jobTags = tagString.split(',').filter(tag => tag !== '');
    } else {
        jobTags = [];
    }

    if (jobTags.length < 1) {
        return null;
    }

    const label = strings.get('labels.JOB_TAGS');
    const more = false;

    const value = jobTags.map($filter('sanitize'));

    return { label, more, value };
}

function getSkipTagDetails () {
    const tagString = resource.model.get('skip_tags');

    let skipTags;

    if (tagString) {
        skipTags = tagString.split(',').filter(tag => tag !== '');
    } else {
        skipTags = [];
    }

    if (skipTags.length < 1) {
        return null;
    }

    const more = false;
    const label = strings.get('labels.SKIP_TAGS');
    const value = skipTags.map($filter('sanitize'));

    return { label, more, value };
}

function getExtraVarsDetails () {
    const extraVars = resource.model.get('extra_vars');

    if (!extraVars) {
        return null;
    }

    const label = strings.get('labels.EXTRA_VARS');
    const tooltip = strings.get('tooltips.EXTRA_VARS');
    const value = parse(extraVars);
    const disabled = true;

    return { label, tooltip, value, disabled };
}

function getLabelDetails () {
    const jobLabels = _.get(resource.model.get('summary_fields.labels'), 'results', []);

    if (jobLabels.length < 1) {
        return null;
    }

    const label = strings.get('labels.LABELS');
    const more = false;
    const value = jobLabels.map(({ name }) => name).map($filter('sanitize'));
    const truncate = true;
    const truncateLength = 5;
    const hasMoreToShow = jobLabels.length > truncateLength;

    return { label, more, hasMoreToShow, value, truncate, truncateLength };
}

function createErrorHandler (path, action) {
    return res => {
        const hdr = strings.get('error.HEADER');
        const msg = strings.get('error.CALL', { path, action, status: res.status });

        error(null, res.data, res.status, null, { hdr, msg });
    };
}

const ELEMENT_LABELS = '#job-results-labels';
const ELEMENT_JOB_TAGS = '#job-results-job-tags';
const ELEMENT_SKIP_TAGS = '#job-results-skip-tags';
const ELEMENT_PROMPT_MODAL = '#prompt-modal';
const TAGS_SLIDE_DISTANCE = 200;

function showLabels () {
    this.labels.truncate = !this.labels.truncate;

    const jobLabelsCount = _.get(resource.model.get('summary_fields.labels'), 'count');
    const maxCount = 50;

    if (this.labels.value.length === jobLabelsCount || this.labels.value.length >= maxCount) {
        return;
    }

    const config = {
        params: {
            page_size: maxCount
        }
    };

    wait('start');
    resource.model.extend('get', 'labels', config)
        .then((model) => {
            const jobLabels = _.get(model.get('related.labels'), 'results', []);
            this.labels.value = jobLabels.map(({ name }) => name).map($filter('sanitize'));
        })
        .catch(createErrorHandler('get labels', 'GET'))
        .finally(() => wait('stop'));
}

function toggleLabels () {
    if (!this.labels.more) {
        $(ELEMENT_LABELS).slideUp(TAGS_SLIDE_DISTANCE);
        this.labels.more = true;
    } else {
        $(ELEMENT_LABELS).slideDown(TAGS_SLIDE_DISTANCE);
        this.labels.more = false;
    }
}

function toggleJobTags () {
    if (!this.jobTags.more) {
        $(ELEMENT_JOB_TAGS).slideUp(TAGS_SLIDE_DISTANCE);
        this.jobTags.more = true;
    } else {
        $(ELEMENT_JOB_TAGS).slideDown(TAGS_SLIDE_DISTANCE);
        this.jobTags.more = false;
    }
}

function toggleSkipTags () {
    if (!this.skipTags.more) {
        $(ELEMENT_SKIP_TAGS).slideUp(TAGS_SLIDE_DISTANCE);
        this.skipTags.more = true;
    } else {
        $(ELEMENT_SKIP_TAGS).slideDown(TAGS_SLIDE_DISTANCE);
        this.skipTags.more = false;
    }
}

function cancelJob () {
    const actionText = strings.get('cancelJob.CANCEL_JOB');
    const hdr = strings.get('cancelJob.HEADER');
    const warning = strings.get('cancelJob.SUBMIT_REQUEST');
    const cancelText = strings.get('cancelJob.RETURN');

    const id = resource.model.get('id');
    const name = $filter('sanitize')(resource.model.get('name'));

    const body = `<div class="Prompt-bodyQuery">${warning}</div>`;
    const resourceName = `#${id} ${name}`;

    const method = 'POST';
    const url = `${resource.model.path}${id}/cancel/`;

    const errorHandler = createErrorHandler('cancel job', method);

    const action = () => {
        wait('start');
        $http({ method, url })
            .catch(errorHandler)
            .finally(() => {
                $(ELEMENT_PROMPT_MODAL).modal('hide');
                wait('stop');
            });
    };

    prompt({ hdr, resourceName, body, actionText, action, cancelText });
}

function deleteJob () {
    const actionText = strings.get('DELETE');
    const hdr = strings.get('deleteResource.HEADER');
    const warning = strings.get('deleteResource.CONFIRM', 'job');

    const id = resource.model.get('id');
    const name = $filter('sanitize')(resource.model.get('name'));

    const body = `<div class="Prompt-bodyQuery">${warning}</div>`;
    const resourceName = `#${id} ${name}`;

    const method = 'DELETE';
    const url = `${resource.model.path}${id}/`;

    const errorHandler = createErrorHandler('delete job', method);

    const action = () => {
        wait('start');
        $http({ method, url })
            .then(() => $state.go('jobs'))
            .catch(errorHandler)
            .finally(() => {
                $(ELEMENT_PROMPT_MODAL).modal('hide');
                wait('stop');
            });
    };

    prompt({ hdr, resourceName, body, actionText, action });
}

function JobDetailsController (
    _$http_,
    _$filter_,
    _$state_,
    _error_,
    _prompt_,
    _strings_,
    _wait_,
    _parse_,
    { subscribe },
) {
    vm = this || {};

    $http = _$http_;
    $filter = _$filter_;
    $state = _$state_;
    error = _error_;

    parse = _parse_;
    prompt = _prompt_;
    strings = _strings_;
    wait = _wait_;

    let unsubscribe;

    vm.$onInit = () => {
        resource = this.resource; // eslint-disable-line prefer-destructuring
        vm.strings = strings;

        vm.status = getStatusDetails();
        vm.started = getStartDetails();
        vm.finished = getFinishDetails();
        vm.moduleArgs = getModuleArgDetails();
        vm.jobType = getJobTypeDetails();
        vm.jobTemplate = getJobTemplateDetails();
        vm.sourceWorkflowJob = getSourceWorkflowJobDetails();
        vm.sliceJobDetails = getSliceJobDetails();
        vm.inventory = getInventoryDetails();
        vm.project = getProjectDetails();
        vm.projectUpdate = getProjectUpdateDetails();
        vm.projectStatus = getProjectStatusDetails();
        vm.scmRevision = getSCMRevisionDetails();
        vm.playbook = getPlaybookDetails();
        vm.resultTraceback = getResultTracebackDetails();
        vm.launchedBy = getLaunchedByDetails();
        vm.jobExplanation = getJobExplanationDetails();
        vm.verbosity = getVerbosityDetails();
        vm.credentials = getCredentialDetails();
        vm.forks = getForkDetails();
        vm.limit = getLimitDetails();
        vm.instanceGroup = getInstanceGroupDetails();
        vm.jobTags = getJobTagDetails();
        vm.skipTags = getSkipTagDetails();
        vm.extraVars = getExtraVarsDetails();
        vm.labels = getLabelDetails();
        vm.inventorySource = getInventorySourceDetails();
        vm.overwrite = getOverwriteDetails();
        vm.overwriteVars = getOverwriteVarsDetails();
        vm.licenseError = getLicenseErrorDetails();

        // Relaunch and Delete Components
        vm.job = angular.copy(_.get(resource.model, 'model.GET', {}));
        vm.canDelete = resource.model.get('summary_fields.user_capabilities.delete');

        vm.cancelJob = cancelJob;
        vm.deleteJob = deleteJob;
        vm.toggleJobTags = toggleJobTags;
        vm.toggleSkipTags = toggleSkipTags;
        vm.toggleLabels = toggleLabels;
        vm.showLabels = showLabels;

        unsubscribe = subscribe(({ status, started, finished, scm }) => {
            vm.started = getStartDetails(started);
            vm.finished = getFinishDetails(finished);
            vm.projectUpdate = getProjectUpdateDetails(scm.id);
            vm.projectStatus = getProjectStatusDetails(scm.status);
            vm.status = getStatusDetails(status);
            vm.job.status = status;
        });
    };

    vm.$onDestroy = () => {
        unsubscribe();
    };
}

JobDetailsController.$inject = [
    '$http',
    '$filter',
    '$state',
    'ProcessErrors',
    'Prompt',
    'OutputStrings',
    'Wait',
    'ParseVariableString',
    'OutputStatusService',
];

export default {
    templateUrl,
    controller: JobDetailsController,
    controllerAs: 'vm',
    bindings: {
        resource: '<'
    },
};


text:
namespace caffe { namespace db {

DB* GetDB(DataParameter::DB backend) {
  switch (backend) {
#ifdef USE_LEVELDB
  case DataParameter_DB_LEVELDB:
    return new LevelDB();
#endif  // USE_LEVELDB
#ifdef USE_LMDB
  case DataParameter_DB_LMDB:
    return new LMDB();
#endif  // USE_LMDB
  default:
    LOG(FATAL) << "Unknown database backend";
  }
}

DB* GetDB(const string& backend) {
#ifdef USE_LEVELDB
  if (backend == "leveldb") {
    return new LevelDB();
  }
#endif  // USE_LEVELDB
#ifdef USE_LMDB
  if (backend == "lmdb") {
    return new LMDB();
  }
#endif  // USE_LMDB
  LOG(FATAL) << "Unknown database backend";
  return NULL;
}

}  // namespace db
}  // namespace caffe


text:
<?php
	session_start();

    // Writes recorded audiofile to the server folder
    $audioName = generateRandomString() . '.wav';
    $file = "../upload/audio/" . $audioName;

	if (move_uploaded_file($_FILES["audio"]["tmp_name"], $file)) {
		echo $audioName;
	}
	chmod($file, 0777);

    // ---

	function generateRandomString($length = 10) {
		$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
		$randomString = '';
		for ($i = 0; $i < $length; $i++) {
			$randomString .= $characters[rand(0, strlen($characters) - 1)];
		}
		return $randomString;
	}
?>


text:
package redis2

import (
	"github.com/chrislusf/seaweedfs/weed/filer"
	"github.com/chrislusf/seaweedfs/weed/util"
	"github.com/go-redis/redis/v8"
)

func init() {
	filer.Stores = append(filer.Stores, &Redis2Store{})
}

type Redis2Store struct {
	UniversalRedis2Store
}

func (store *Redis2Store) GetName() string {
	return "redis2"
}

func (store *Redis2Store) Initialize(configuration util.Configuration, prefix string) (err error) {
	return store.initialize(
		configuration.GetString(prefix+"address"),
		configuration.GetString(prefix+"password"),
		configuration.GetInt(prefix+"database"),
		configuration.GetStringSlice(prefix+"superLargeDirectories"),
	)
}

func (store *Redis2Store) initialize(hostPort string, password string, database int, superLargeDirectories []string) (err error) {
	store.Client = redis.NewClient(&redis.Options{
		Addr:     hostPort,
		Password: password,
		DB:       database,
	})
	store.loadSuperLargeDirectories(superLargeDirectories)
	return
}


text:
// Copyright (C) 2003  Davis E. King (davis@dlib.net)
// License: Boost Software License   See LICENSE.txt for the full license.
#undef DLIB_BIT_STREAM_MULTi_ABSTRACT_
#ifdef DLIB_BIT_STREAM_MULTi_ABSTRACT_

#include "bit_stream_kernel_abstract.h"

namespace dlib
{
    template <
        typename bit_stream_base
        >
    class bit_stream_multi : public bit_stream_base
    {

        /*!
            REQUIREMENTS ON BIT_STREAM_BASE
                it is an implementation of bit_stream/bit_stream_kernel_abstract.h

            WHAT THIS EXTENSION DOES FOR BIT_STREAM
                this gives a bit_stream object the ability to read/write multible bits
                at a time
        !*/

        public:

        void multi_write (
            unsigned long data,
            int num_to_write
        );
        /*!
            requires
                - is_in_write_mode() == true
                - 0 <= num_to_write <= 32
            ensures
                - num_to_write low order bits from data will be written to the ostream
                - object associated with *this
                  example: if data is 10010 then the bits will be written in the
                  order 1,0,0,1,0
        !*/

        int multi_read (
            unsigned long& data,
            int num_to_read
        );
        /*!
            requires
                - is_in_read_mode() == true
                - 0 <= num_to_read <= 32
            ensures
                - tries to read num_to_read bits into the low order end of #data
                  example:  if the incoming bits were 10010 then data would end
                  up with 10010 as its low order bits
                - all of the bits in #data not filled in by multi_read() are zero
                - returns the number of bits actually read into #data
        !*/

    };

    template <
        typename bit_stream_base
        >
    inline void swap (
        bit_stream_multi<bit_stream_base>& a,
        bit_stream_multi<bit_stream_base>& b
    ) { a.swap(b); }
    /*!
        provides a global swap function
    !*/

}

#endif // DLIB_BIT_STREAM_MULTi_ABSTRACT_


text:
using System.Xml;

namespace FatturaElettronica.Ordinaria.FatturaElettronicaBody.DatiGenerali
{
    /// <summary>
    /// Informazioni relative all'ordine di acquisto.
    /// </summary>
    public class DatiOrdineAcquisto : Common.DatiDocumento
    {
        public DatiOrdineAcquisto() { }
        public DatiOrdineAcquisto(XmlReader r) : base(r) { }
    }
}


text:
namespace AngleSharp.Core.Tests.Css
{
    using AngleSharp.Dom.Css;
    using NUnit.Framework;

    [TestFixture]
    public class CssCoordinatePropertyTests : CssConstructionFunctions
    {
        [Test]
        public void CssHeightLegalPercentage()
        {
            var snippet = "height:   28% ";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("height", property.Name);
            Assert.IsTrue(property.HasValue);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssHeightProperty>(property);
            var concrete = (CssHeightProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.AreEqual("28%", concrete.Value);
            //Assert.IsInstanceOf<Percent>(value);
        }

        [Test]
        public void CssHeightLegalLengthInEm()
        {
            var snippet = "height:   0.3em ";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("height", property.Name);
            Assert.IsTrue(property.HasValue);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssHeightProperty>(property);
            var concrete = (CssHeightProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.AreEqual("0.3em", concrete.Value);
            //Assert.IsInstanceOf<Length>(value);
        }

        [Test]
        public void CssHeightLegalLengthInPx()
        {
            var snippet = "height:   144px ";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("height", property.Name);
            Assert.IsTrue(property.HasValue);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssHeightProperty>(property);
            var concrete = (CssHeightProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.AreEqual("144px", concrete.Value);
            //Assert.IsInstanceOf<Length>(value);
        }

        [Test]
        public void CssHeightLegalAutoUppercase()
        {
            var snippet = "height: AUTO ";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("height", property.Name);
            Assert.IsTrue(property.HasValue);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssHeightProperty>(property);
            var concrete = (CssHeightProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.AreEqual("auto", concrete.Value);
        }

        [Test]
        public void CssWidthLegalLengthInCm()
        {
            var snippet = "width:0.5cm";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("width", property.Name);
            Assert.IsTrue(property.HasValue);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssWidthProperty>(property);
            var concrete = (CssWidthProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.AreEqual("0.5cm", concrete.Value);
            //Assert.IsInstanceOf<Length>(value);
        }

        [Test]
        public void CssWidthLegalLengthInMm()
        {
            var snippet = "width:1.5mm";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("width", property.Name);
            Assert.IsTrue(property.HasValue);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssWidthProperty>(property);
            var concrete = (CssWidthProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.AreEqual("1.5mm", concrete.Value);
            //Assert.IsInstanceOf<Length>(value);
        }

        [Test]
        public void CssWidthIllegalLength()
        {
            var snippet = "width:1.5 meter";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("width", property.Name);
            Assert.IsFalse(property.HasValue);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssWidthProperty>(property);
            var concrete = (CssWidthProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsNotNull(concrete);
        }

        [Test]
        public void CssLeftLegalPixel()
        {
            var snippet = "left: 25px";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("left", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssLeftProperty>(property);
            var concrete = (CssLeftProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssTopLegalEm()
        {
            var snippet = "top:  0.7em ";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("top", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssTopProperty>(property);
            var concrete = (CssTopProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssRightLegalMm()
        {
            var snippet = "right:  1.5mm";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("right", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssRightProperty>(property);
            var concrete = (CssRightProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssBottomLegalPercent()
        {
            var snippet = "bottom:  50%";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("bottom", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssBottomProperty>(property);
            var concrete = (CssBottomProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssHeightZeroLegal()
        {
            var snippet = "height:0";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("height", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssHeightProperty>(property);
            var concrete = (CssHeightProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssWidthZeroLegal()
        {
            var snippet = "width  :  0";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("width", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssWidthProperty>(property);
            var concrete = (CssWidthProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssWidthPercentLegal()
        {
            var snippet = "width  :  20.5%";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("width", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssWidthProperty>(property);
            var concrete = (CssWidthProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssWidthPercentInLegal()
        {
            var snippet = "width  :  3in";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("width", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssWidthProperty>(property);
            var concrete = (CssWidthProperty)property;
            Assert.IsFalse(concrete.IsInherited);
        }

        [Test]
        public void CssHeightAngleIllegal()
        {
            var snippet = "height  :  3deg";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("height", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssHeightProperty>(property);
            var concrete = (CssHeightProperty)property;
            Assert.IsFalse(concrete.HasValue);
            Assert.IsFalse(concrete.IsInherited);
        }

        [Test]
        public void CssHeightResolutionIllegal()
        {
            var snippet = "height  :  3dpi";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("height", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssHeightProperty>(property);
            var concrete = (CssHeightProperty)property;
            Assert.IsFalse(concrete.HasValue);
            Assert.IsFalse(concrete.IsInherited);
        }

        [Test]
        public void CssTopLegalRem()
        {
            var snippet = "top:  1.2rem ";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("top", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssTopProperty>(property);
            var concrete = (CssTopProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssRightLegalCm()
        {
            var snippet = "right:  0.5cm";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("right", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssRightProperty>(property);
            var concrete = (CssRightProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssBottomLegalPercentTwo()
        {
            var snippet = "bottom:  0.50%";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("bottom", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssBottomProperty>(property);
            var concrete = (CssBottomProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssBottomLegalZero()
        {
            var snippet = "bottom:  0";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("bottom", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssBottomProperty>(property);
            var concrete = (CssBottomProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssBottomIllegalNumber()
        {
            var snippet = "bottom:  20";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("bottom", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssBottomProperty>(property);
            var concrete = (CssBottomProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsFalse(concrete.HasValue);
        }

        [Test]
        public void CssMinHeightLegalZero()
        {
            var snippet = "min-height:  0";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("min-height", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssMinHeightProperty>(property);
            var concrete = (CssMinHeightProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
        }

        [Test]
        public void CssMaxHeightIllegalAuto()
        {
            var snippet = "max-height:  auto";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("max-height", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssMaxHeightProperty>(property);
            var concrete = (CssMaxHeightProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsFalse(concrete.HasValue);
        }

        [Test]
        public void CssMaxWidthLegalNone()
        {
            var snippet = "max-width:  none";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("max-width", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssMaxWidthProperty>(property);
            var concrete = (CssMaxWidthProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
            Assert.AreEqual("none", concrete.Value);
        }

        [Test]
        public void CssMaxWidthLegalLength()
        {
            var snippet = "max-width:  15px";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("max-width", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssMaxWidthProperty>(property);
            var concrete = (CssMaxWidthProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
            Assert.AreEqual("15px", concrete.Value);
        }

        [Test]
        public void CssMinWidthLegalPercent()
        {
            var snippet = "min-width:  15%";
            var property = ParseDeclaration(snippet);
            Assert.AreEqual("min-width", property.Name);
            Assert.IsFalse(property.IsImportant);
            Assert.IsInstanceOf<CssMinWidthProperty>(property);
            var concrete = (CssMinWidthProperty)property;
            Assert.IsFalse(concrete.IsInherited);
            Assert.IsTrue(concrete.HasValue);
            Assert.AreEqual("15%", concrete.Value);
        }
    }
}


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
LocatorURL (Jena Framework)
</TITLE>

<META NAME="date" CONTENT="2010-06-01">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

com.hp.hpl.jena.util

Class LocatorURL

java.lang.Object
  com.hp.hpl.jena.util.LocatorURL

All Implemented Interfaces:
Locator

public class LocatorURL
extends java.lang.Object
implements Locator

Location files named by a URL

Version:

$Id: LocatorURL.java,v 1.1 2009/06/29 08:55:47 castagna Exp $

Author:

Andy Seaborne

Constructor Summary

LocatorURL()

Method Summary

 boolean
equals(java.lang.Object other)

 java.lang.String
getName()

 int
hashCode()

 TypedStream
open(java.lang.String filenameOrURI)

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

LocatorURL

public LocatorURL()

Method Detail

open

public TypedStream open(java.lang.String filenameOrURI)

Specified by:
open in interface Locator

equals

public boolean equals(java.lang.Object other)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

getName

public java.lang.String getName()

Specified by:
getName in interface Locator

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP


text:
package io.spotnext.core.management.service.impl;

import java.util.Comparator;
import java.util.List;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import io.spotnext.core.constant.CoreConstants;
//import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.spotnext.core.infrastructure.annotation.logging.Log;
import io.spotnext.core.infrastructure.http.DataResponse;
import io.spotnext.core.infrastructure.http.HttpResponse;
import io.spotnext.core.infrastructure.service.ConfigurationService;
import io.spotnext.core.infrastructure.support.LogLevel;
import io.spotnext.core.infrastructure.support.MimeType;
import io.spotnext.core.management.annotation.Handler;
import io.spotnext.core.management.annotation.RemoteEndpoint;
import io.spotnext.core.management.support.BasicAuthenticationFilter;
import io.spotnext.core.management.support.data.PageablePayload;
import io.spotnext.core.management.transformer.JsonResponseTransformer;
import io.spotnext.core.persistence.query.Pageable;
import io.spotnext.support.util.MiscUtil;
import spark.Request;
import spark.Response;
import spark.route.HttpMethod;

/**
 * The /model REST endpoint.
 *
 * @author mojo2012
 * @version 1.0
 * @since 1.0
 */
@RemoteEndpoint(portConfigKey = "service.typesystem.rest.port", port = 19000, pathMapping = "/v1/configuration", authenticationFilter = BasicAuthenticationFilter.class)
public class ConfigurationRestEndpoint extends AbstractRestEndpoint {

	@Autowired
	protected ConfigurationService configurationService;

	/**
	 * Returns all the configuration properties starting with the given prefix.
	 *
	 * @param request  a {@link spark.Request} object.
	 * @param response a {@link spark.Response} object.
	 * @return the response object
	 */
	@Log(logLevel = LogLevel.DEBUG, measureExecutionTime = true)
	@Handler(method = HttpMethod.get, pathMapping = { "", "/",
			"/:propertyPrefix" }, mimeType = MimeType.JSON, responseTransformer = JsonResponseTransformer.class)
	public HttpResponse getPropertyWithPrefix(final Request request, final Response response) {
		return DataResponse.ok().withPayload(getPaginatedProperties(request));
	}

	/**
	 * Creates or updates a configuration property.
	 *
	 * @param request  a {@link spark.Request} object.
	 * @param response a {@link spark.Response} object.
	 * @return the response object
	 */
	@Log(logLevel = LogLevel.DEBUG, measureExecutionTime = true)
	@Handler(method = HttpMethod.put, pathMapping = "/:property", mimeType = MimeType.JSON, responseTransformer = JsonResponseTransformer.class)
	public HttpResponse setProperty(final Request request, final Response response) {

		final String property = request.params(":property");
		final String value = request.body();

		if (StringUtils.isNotBlank(property)) {
			configurationService.setProperty(property, value);

			return DataResponse.ok();
		} else {
			return DataResponse.badRequest().withError("error.rest.configuration.update.", "Property cannot be empty");
		}
	}

	/**
	 * Returns the configuration properties with the given prefix.
	 *
	 * @param request containing the pagination settings and property key
	 * @return the the configuration entries, never null
	 */
	private Pageable<Entry<Object, Object>> getPaginatedProperties(final Request request) {
		final int page = MiscUtil.positiveIntOrDefault(request.queryParams("page"), CoreConstants.REQUEST_DEFAULT_PAGE);
		final int pageSize = MiscUtil.intOrDefault(request.queryParams("pageSize"), CoreConstants.REQUEST_DEFAULT_PAGE_SIZE);
		final String propertyPrefix = StringUtils.defaultString(request.params(":propertyPrefix"), "");

		final Properties properties = configurationService.getProperties(propertyPrefix);

		final List<Entry<Object, Object>> entries = properties.entrySet().stream() //
				.skip(MiscUtil.positiveIntOrDefault(page - 1, 1) * pageSize) //
				.limit(pageSize > 0 ? pageSize : Long.MAX_VALUE) //
				.sorted(new Comparator<Entry<Object, Object>>() {
					@Override
					public int compare(Entry<Object, Object> o1, Entry<Object, Object> o2) {
						if (o1.getKey() instanceof String && o2.getKey() instanceof String) {
							return ((String) o1.getKey()).compareTo((String) o2.getKey());
						}

						throw new IllegalStateException("Can only compare property keys of type 'String'");
					}
				}) //
				.collect(Collectors.toList());

		final var pageableData = new PageablePayload<Entry<Object, Object>>(entries, page, pageSize, (long) entries.size());

		return pageableData;
	}
}


text:
    || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x531))

// Recall that in general, compilers without partial specialization
// can't strip constness.  Consider counting_iterator, which normally
// passes a const Value to iterator_facade.  As a result, any code
// which makes a std::vector of the iterator's value_type will fail
// when its allocator declares functions overloaded on reference and
// const_reference (the same type).
//
// Furthermore, Borland 5.5.1 drops constness in enough ways that we
// end up using a proxy for operator[] when we otherwise shouldn't.
// Using reference constness gives it an extra hint that it can
// return the value_type from operator[] directly, but is not
// strictly necessary.  Not sure how best to resolve this one.

# define BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY 1

#endif

#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x5A0))                      \
    || (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \
    || BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))                \
    || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))

# define BOOST_NO_LVALUE_RETURN_DETECTION

# if 0 // test code
  struct v  {};

  typedef  char (&no)[3];

  template <class T>
  no foo(T const&, ...);

  template <class T>
  char foo(T&, int);

  struct value_iterator
  {
      v operator*() const;
  };

  template <class T>
  struct lvalue_deref_helper
  {
      static T& x;
      enum { value = (sizeof(foo(*x,0)) == 1) };
  };

  int z2[(lvalue_deref_helper<v*>::value == 1) ? 1 : -1];
  int z[(lvalue_deref_helper<value_iterator>::value) == 1 ? -1 : 1 ];
# endif

#endif

#if BOOST_WORKAROUND(__MWERKS__, <=0x2407)
#  define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't work for simple types"
#endif

#if BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, < 4) && !defined(__EDG_VERSION__)   \
    || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
#  define BOOST_NO_IS_CONVERTIBLE_TEMPLATE // The following program fails to compile:

#  if 0 // test code
    #include <boost/type_traits/is_convertible.hpp>
    template <class T>
    struct foo
    {
        foo(T);

        template <class U>
        foo(foo<U> const& other) : p(other.p) { }

        T p;
    };

    bool x = boost::is_convertible<foo<int const*>, foo<int*> >::value;
#  endif

#endif

#if !defined(BOOST_MSVC) && (defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_IS_CONVERTIBLE_TEMPLATE))
# define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
#endif

# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))

// GCC-2.95 (obsolete) eagerly instantiates templated constructors and conversion
// operators in convertibility checks, causing premature errors.
//
// Borland's problems are harder to diagnose due to lack of an
// instantiation stack backtrace.  They may be due in part to the fact
// that it drops cv-qualification willy-nilly in templates.
#  define BOOST_NO_ONE_WAY_ITERATOR_INTEROP
# endif

// no include guard; multiple inclusion intended


text:
namespace peloton {

namespace expression {
class AbstractExpression;
}  // namespace expression

namespace planner {
class AbstractPlan;
}  // namespace planner

namespace codegen {

// Forward declare these guys so CompilationContext can include this file
class CompilationContext;
class ExpressionTranslator;
class OperatorTranslator;
class Pipeline;

//===----------------------------------------------------------------------===//
// An factory interface that creates the appropriate translator for a given
// query operator or expression.
//===----------------------------------------------------------------------===//
class TranslatorFactory {
 public:
  // Return a new unique translator for the given operator
  virtual std::unique_ptr<OperatorTranslator> CreateTranslator(
      const planner::AbstractPlan &plan, CompilationContext &context,
      Pipeline &pipeline) const;

  // Return a new unique translator for the given expression
  virtual std::unique_ptr<ExpressionTranslator> CreateTranslator(
      const expression::AbstractExpression &exp,
      CompilationContext &context) const;
};

}  // namespace codegen
}  // namespace peloton


text:
package cn.org.eshow.demo.network;

import android.content.Context;

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

/**
 * 自定义网络请求回调接口
 * Created by daikting on 15/9/29.
 */
public abstract class AMapResponseListener extends cn.org.eshow.framwork.http.AbStringHttpResponseListener {
    private Context mContext;

    public AMapResponseListener(Context context) {
        super();
        mContext = context;
    }

    @Override
    public void onSuccess(final int statusCode, String content) {

        try {
            final JSONObject jsonObject = new JSONObject(content);
            final int status = jsonObject.getInt("status");
            if(status == 1){
                int count = jsonObject.getInt("count");
                if(count > 0){
                    onAMapSucess(jsonObject);
                }else{
                    onAMapNoData();
                }
            }else{
                onAMapNotify("获取失败,错误码:" + jsonObject.getInt("infocode"));
            }
        } catch (JSONException e) {
            onAMapNotify("接口数据出错JSONException");
            e.printStackTrace();
        }
    }

    /**
     * 接口请求成功
     *
     * @param resultJson
     */
    public abstract void onAMapSucess(JSONObject resultJson);

    /**
     * 没有请求到数据
     */
    public abstract void onAMapNoData();

    /**
     * 网络请求成功,由于请求数据不对,接口数据请求失败
     *
     */
    public abstract void onAMapNotify(String notify);

    OnErrorListener onErrorListener;

    public void setOnErrorListener(OnErrorListener onErrorListener) {
        this.onErrorListener = onErrorListener;
    }

    public interface OnErrorListener {
        void onErrorListener(String bgMsg);
    }

}


text:
from collections import namedtuple
import logging
import os.path
import tempfile
import uuid

import rdflib
import requests
import stomp

from minecart.archive import archive

PCDMFile = namedtuple('PCDMFile', ['uri', 'mimetype'])
PCDM = rdflib.namespace.Namespace('http://pcdm.org/models#')
EBU = rdflib.namespace.Namespace(
        'http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#')

def document_set(url, session=None, fedora=None):
    session = session or requests.Session()
    r = session.get(url)
    r.raise_for_status()
    for m in r.json().get('members'):
        doc = get_item_meta(fedora + m['ref'], session=session)
        yield Document(m['ref'], doc)

class Document:
    def __init__(self, name, graph):
        self.g = rdflib.Graph()
        self.g.parse(data=graph, format='n3')
        self.name = name

    @property
    def files(self):
        for o in self.g.objects(subject=None, predicate=PCDM.hasFile):
            mimetype = self.g.value(subject=o, predicate=EBU.hasMimeType,
                                    object=None, any=False)
            yield PCDMFile(uri=str(o), mimetype=str(mimetype))

def get_item_meta(url, session=None):
    session = session or requests.Session()
    headers = {
        'Accept': 'text/n3',
        'Prefer': 'return=representation; '
                  'include="http://fedora.info/definitions/v4/repository'
                  '#EmbedResources"',
    }
    r = session.get(url, headers=headers)
    r.raise_for_status()
    return r.text

def create_package(url, session=None, fedora=None):
    session = session or requests.Session()
    tmp = tempfile.gettempdir()
    archive_name = os.path.join(tmp, uuid.uuid4().hex) + '.zip'
    with archive(archive_name) as arxv:
        for doc in document_set(url, session, fedora):
            for f in doc.files:
                if f.mimetype == 'application/pdf':
                    r = session.get(f.uri, stream=True)
                    r.raise_for_status()
                    with tempfile.NamedTemporaryFile() as f:
                        for chunk in r.iter_content(chunk_size=1024):
                            f.write(chunk)
                        arxv.write(f.name, doc.name + '.pdf')
    return archive_name

class ApiListener(stomp.ConnectionListener):
    def __init__(self, fedora, bucket, conn):
        self.fedora = fedora
        self.bucket = bucket
        self.conn = conn

    def on_message(self, headers, message):
        logger = logging.getLogger(__name__)
        docset = message.strip()
        docset_id = docset.split('/')[-1].split('?')[0]
        queue = '/queue/package/' + docset_id
        self.conn.send(queue, 'Accepted.')
        try:
            arxv = create_package(docset, fedora=self.fedora)
        except Exception as e:
            logger.error('Error creating package for docset {}: {}'
                         .format(docset, e))
            return
        try:
            size = os.stat(arxv).st_size
            blob = self.bucket.create(os.path.basename(arxv))
            blob.upload(arxv)
            self.conn.send(queue,
                           'Complete: {}\nSize: {}'.format(blob.url, size))
        except Exception as e:
            logger.error('Error uploading package for docset {}: {}'
                         .format(docset, e))
        finally:
            os.remove(arxv)


text:
(function($) {
  $(document).ready(function() {
    /* IF YOU WANT TO APPLY SOME BASIC JQUERY TO REMOVE THE VIDEO BACKGROUND ON A SPECIFIC VIEWPORT MANUALLY
     var is_mobile = false;
    if( $('.player').css('display')=='none') {
        is_mobile = true;
    }
    if (is_mobile == true) {
        //Conditional script here
        $('.big-background, .small-background-section').addClass('big-background-default-image');
    }else{
        $(".player").mb_YTPlayer();
    }
    });
*/
    /*  IF YOU WANT TO USE DEVICE.JS TO DETECT THE VIEWPORT AND MANIPULATE THE OUTPUT  */

    //Device.js will check if it is Tablet or Mobile - http://matthewhudson.me/projects/device.js/
    if (!device.tablet() && !device.mobile()) {
      $(".player").YTPlayer();
    } else {
      //jQuery will add the default background to the preferred class
      $('.video-background').addClass('video-background-default-image');
      $('.video-background-xmas').addClass('video-background-default-image-xmas');
      $('.video-background-ppt').addClass('video-background-default-image-ppt');
      $('.overlay').addClass('blur');
    }
  });
})(jQuery);