text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace NLight.Resources {
    using System;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class ExceptionMessages {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal ExceptionMessages() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NLight.Resources.ExceptionMessages", typeof(ExceptionMessages).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to The source argument contains duplicate keys..
        /// </summary>
        internal static string Collections_SourceCannotContainDuplicateKey {
            get {
                return ResourceManager.GetString("Collections_SourceCannotContainDuplicateKey", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Cannot fill a buffer and keep all its elements at the same time..
        /// </summary>
        internal static string Core_CannotKeepAllBufferElements {
            get {
                return ResourceManager.GetString("Core_CannotKeepAllBufferElements", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to The member access expression does not access a property..
        /// </summary>
        internal static string Core_ExpressionDoesNotAccessProperty {
            get {
                return ResourceManager.GetString("Core_ExpressionDoesNotAccessProperty", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to '{0}' is not a valid enumeration value..
        /// </summary>
        internal static string Core_InvalidEnumArgument {
            get {
                return ResourceManager.GetString("Core_InvalidEnumArgument", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to '{0}' is not an Enum type..
        /// </summary>
        internal static string Core_NotAnEnumType {
            get {
                return ResourceManager.GetString("Core_NotAnEnumType", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to The expression is not a member access expression..
        /// </summary>
        internal static string Core_NotMemberAccessExpression {
            get {
                return ResourceManager.GetString("Core_NotMemberAccessExpression", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Cannot move to a previous record in forward-only mode..
        /// </summary>
        internal static string IO_CannotMovePreviousRecordInForwardOnly {
            get {
                return ResourceManager.GetString("IO_CannotMovePreviousRecordInForwardOnly", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to A column named '{0}' was not found..
        /// </summary>
        internal static string IO_ColumnNotFound {
            get {
                return ResourceManager.GetString("IO_ColumnNotFound", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to A column with the name '{0}' already exists..
        /// </summary>
        internal static string IO_DuplicateColumnName {
            get {
                return ResourceManager.GetString("IO_DuplicateColumnName", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to The record at index '{0}' appears to be corrupt. Current column index: '{1}'. Current position: '{2}'. Current raw data : '{3}'..
        /// </summary>
        internal static string IO_MalformedRecordException {
            get {
                return ResourceManager.GetString("IO_MalformedRecordException", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to At least one column must exists in the column collection. Columns may be added to the collection using the Columns property and its Add method..
        /// </summary>
        internal static string IO_NoColumnDefined {
            get {
                return ResourceManager.GetString("IO_NoColumnDefined", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to No current record..
        /// </summary>
        internal static string IO_NoCurrentRecord {
            get {
                return ResourceManager.GetString("IO_NoCurrentRecord", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to The number of fields in the record is greater than the available space from index to the end of the destination array..
        /// </summary>
        internal static string IO_NotEnoughSpaceInArray {
            get {
                return ResourceManager.GetString("IO_NotEnoughSpaceInArray", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to '{0}' is not a valid ParseErrorAction while inside a ParseError event..
        /// </summary>
        internal static string IO_ParseErrorActionInvalidInsideParseErrorEvent {
            get {
                return ResourceManager.GetString("IO_ParseErrorActionInvalidInsideParseErrorEvent", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to '{0}' is not a supported ParseErrorAction..
        /// </summary>
        internal static string IO_ParseErrorActionNotSupported {
            get {
                return ResourceManager.GetString("IO_ParseErrorActionNotSupported", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to There is no interface in the same network of the target IP address ({0}:{1}) for UDP listening..
        /// </summary>
        internal static string Net_NoInterfaceInSameNetwork {
            get {
                return ResourceManager.GetString("Net_NoInterfaceInSameNetwork", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Sequence already completed..
        /// </summary>
        internal static string Reactive_SequenceAlreadyCompleted {
            get {
                return ResourceManager.GetString("Reactive_SequenceAlreadyCompleted", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Sequence already completed with an error..
        /// </summary>
        internal static string Reactive_SequenceAlreadyCompletedWithError {
            get {
                return ResourceManager.GetString("Reactive_SequenceAlreadyCompletedWithError", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Could not convert '{0}' to type '{1}'..
        /// </summary>
        internal static string Text_CannotConvertToDataType {
            get {
                return ResourceManager.GetString("Text_CannotConvertToDataType", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to The conversion from type '{0}' to '{1}' is not supported..
        /// </summary>
        internal static string Text_ConversionNotSupported {
            get {
                return ResourceManager.GetString("Text_ConversionNotSupported", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to The underlying thread (Name = '{0}', ManagedThreadId = '{1}') is no longer alive..
        /// </summary>
        internal static string Threading_UnderlyingThreadNotAlive {
            get {
                return ResourceManager.GetString("Threading_UnderlyingThreadNotAlive", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to The requested transaction context state transition to '{1}' is not coherent with the current state '{0}'..
        /// </summary>
        internal static string Transactions_IncoherentContextTransition {
            get {
                return ResourceManager.GetString("Transactions_IncoherentContextTransition", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to The transaction context should be in one of the following states: {0}..
        /// </summary>
        internal static string Transactions_InvalidTransactionContextState {
            get {
                return ResourceManager.GetString("Transactions_InvalidTransactionContextState", resourceCulture);
            }
        }
    }
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Heteroacanthella variabile Oberw. & Langer

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
class Glfw3 < Formula
  desc "Multi-platform library for OpenGL applications"
  homepage "http://www.glfw.org/"
  url "https://github.com/glfw/glfw/archive/3.2.tar.gz"
  sha256 "cb3aab46757981a39ae108e5207a1ecc4378e68949433a2b040ce2e17d8f6aa6"

  bottle do
    cellar :any
    sha256 "753dbb80f0202b991aa295902f6856b15519c099d46accddd85358e4d7260b63" => :el_capitan
    sha256 "28d8a548c506afc1be463a76e4022f4dc9a38677aa3e00d8710b8bc75b2697b8" => :yosemite
    sha256 "b4285762307f7acc1def7e07f4a4c68ad4f6c87b83f130b4716a80f8eea41fbe" => :mavericks
  end

  option :universal
  option "without-shared-library", "Build static library only (defaults to building dylib only)"
  option "with-examples", "Build examples"
  option "with-test", "Build test programs"

  depends_on "cmake" => :build

  deprecated_option "build-examples" => "with-examples"
  deprecated_option "static" => "without-shared-library"
  deprecated_option "build-tests" => "with-test"
  deprecated_option "with-tests" => "with-test"

  def install
    ENV.universal_binary if build.universal?

    # make library name consistent
    inreplace "CMakeLists.txt", /set\(GLFW_LIB_NAME\sglfw\)\n.*else\(\)\n/, ""

    args = std_cmake_args + %W[
      -DGLFW_USE_CHDIR=TRUE
      -DGLFW_USE_MENUBAR=TRUE
    ]
    args << "-DGLFW_BUILD_UNIVERSAL=TRUE" if build.universal?
    args << "-DBUILD_SHARED_LIBS=TRUE" if build.with? "shared-library"
    args << "-DGLFW_BUILD_EXAMPLES=TRUE" if build.with? "examples"
    args << "-DGLFW_BUILD_TESTS=TRUE" if build.with? "test"
    args << "."

    system "cmake", *args
    system "make", "install"
    libexec.install Dir["examples/*"] if build.with? "examples"
    libexec.install Dir["tests/*"] if build.with? "tests"
  end

  test do
    (testpath/"test.c").write <<-EOS.undent
      #define GLFW_INCLUDE_GLU
      #include <GLFW/glfw3.h>
      #include <stdlib.h>
      int main()
      {
        if (!glfwInit())
          exit(EXIT_FAILURE);
        glfwTerminate();
        return 0;
      }
    EOS
    system ENV.cc, "-I#{include}", "-L#{lib}", "-lglfw3",
           testpath/"test.c", "-o", "test"
    system "./test"
  end
end


text:
module YakovenkoRiverbattle
  VERSION = "0.1.5"
end


text:
int main(void)
{
	mongo_servers *servers;
	mongo_con_manager *manager;
	char *error_message;

	manager = mongo_init();
	manager->log_function = mongo_log_printf;

	servers = mongo_parse_init();
	mongo_parse_server_spec(manager, servers, "mongodb://whisky:13002,whisky:13000,whisky:13001/demo?replicaSet=seta", (char **) &error_message);
	mongo_servers_dump(manager, servers);
	servers->read_pref.type = MONGO_RP_PRIMARY_PREFERRED;
	mongo_get_read_write_connection(manager, servers, MONGO_CON_FLAG_READ, (char**) &error_message);
	if (error_message) {
		printf("ERROR: %s\n", error_message);
	}
	mongo_servers_dtor(servers);

	mongo_deinit(manager);

	return 0;
}


text:
package com.amazonaws.services.cloudwatch;

import com.amazonaws.services.cloudwatch.model.*;
import com.amazonaws.annotation.ThreadSafe;

/**
 * Interface for accessing CloudWatch 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.
 *

 *

 * Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the
 * applications you run on AWS in real-time. You can use CloudWatch to collect
 * and track metrics, which are the variables you want to measure for your
 * resources and applications.
 *

 *

 * CloudWatch alarms send notifications or automatically make changes to the
 * resources you are monitoring based on rules that you define. For example, you
 * can monitor the CPU usage and disk reads and writes of your Amazon Elastic
 * Compute Cloud (Amazon EC2) instances and then use this data to determine
 * whether you should launch additional instances to handle increased load. You
 * can also use this data to stop under-used instances to save money.
 *

 *

 * In addition to monitoring the built-in metrics that come with AWS, you can
 * monitor your own custom metrics. With CloudWatch, you gain system-wide
 * visibility into resource utilization, application performance, and
 * operational health.
 *

 */
@ThreadSafe
public class AmazonCloudWatchAsyncClient extends AmazonCloudWatchClient
        implements AmazonCloudWatchAsync {

    private static final int DEFAULT_THREAD_POOL_SIZE = 50;

    private final java.util.concurrent.ExecutorService executorService;

    /**
     * Constructs a new asynchronous client to invoke service methods on
     * CloudWatch. A credentials provider chain will be used that searches for
     * credentials in this order:
     *

     *
Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY

     *
Java System Properties - aws.accessKeyId and aws.secretKey

     *
Credential profiles file at the default location (~/.aws/credentials)
     * shared by all AWS SDKs and the AWS CLI

     *
Instance profile credentials delivered through the Amazon EC2
     * metadata service

     *

     *

     * Asynchronous methods are delegated to a fixed-size thread pool containing
     * 50 threads (to match the default maximum number of concurrent connections
     * to the service).
     *
     * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
     * @see java.util.concurrent.Executors#newFixedThreadPool(int)
     */
    public AmazonCloudWatchAsyncClient() {
        this(new com.amazonaws.auth.DefaultAWSCredentialsProviderChain());
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on
     * CloudWatch. A credentials provider chain will be used that searches for
     * credentials in this order:
     *

     *
Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY

     *
Java System Properties - aws.accessKeyId and aws.secretKey

     *
Credential profiles file at the default location (~/.aws/credentials)
     * shared by all AWS SDKs and the AWS CLI

     *
Instance profile credentials delivered through the Amazon EC2
     * metadata service

     *

     *

     * Asynchronous methods are delegated to a fixed-size thread pool containing
     * a number of threads equal to the maximum number of concurrent connections
     * configured via {@code ClientConfiguration.getMaxConnections()}.
     *
     * @param clientConfiguration
     *        The client configuration options controlling how this client
     *        connects to CloudWatch (ex: proxy settings, retry counts, etc).
     *
     * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
     * @see java.util.concurrent.Executors#newFixedThreadPool(int)
     */
    public AmazonCloudWatchAsyncClient(
            com.amazonaws.ClientConfiguration clientConfiguration) {
        this(new com.amazonaws.auth.DefaultAWSCredentialsProviderChain(),
                clientConfiguration, java.util.concurrent.Executors
                        .newFixedThreadPool(clientConfiguration
                                .getMaxConnections()));
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on
     * CloudWatch using the specified AWS account credentials.
     *

     * Asynchronous methods are delegated to a fixed-size thread pool containing
     * 50 threads (to match the default maximum number of concurrent connections
     * to the service).
     *
     * @param awsCredentials
     *        The AWS credentials (access key ID and secret key) to use when
     *        authenticating with AWS services.
     * @see java.util.concurrent.Executors#newFixedThreadPool(int)
     */
    public AmazonCloudWatchAsyncClient(
            com.amazonaws.auth.AWSCredentials awsCredentials) {
        this(awsCredentials, java.util.concurrent.Executors
                .newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on
     * CloudWatch using the specified AWS account credentials and executor
     * service. Default client settings will be used.
     *
     * @param awsCredentials
     *        The AWS credentials (access key ID and secret key) to use when
     *        authenticating with AWS services.
     * @param executorService
     *        The executor service by which all asynchronous requests will be
     *        executed.
     */
    public AmazonCloudWatchAsyncClient(
            com.amazonaws.auth.AWSCredentials awsCredentials,
            java.util.concurrent.ExecutorService executorService) {

        this(awsCredentials, configFactory.getConfig(), executorService);
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on
     * CloudWatch using the specified AWS account credentials, executor service,
     * and client configuration options.
     *
     * @param awsCredentials
     *        The AWS credentials (access key ID and secret key) to use when
     *        authenticating with AWS services.
     * @param clientConfiguration
     *        Client configuration options (ex: max retry limit, proxy settings,
     *        etc).
     * @param executorService
     *        The executor service by which all asynchronous requests will be
     *        executed.
     */
    public AmazonCloudWatchAsyncClient(
            com.amazonaws.auth.AWSCredentials awsCredentials,
            com.amazonaws.ClientConfiguration clientConfiguration,
            java.util.concurrent.ExecutorService executorService) {

        super(awsCredentials, clientConfiguration);
        this.executorService = executorService;
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on
     * CloudWatch using the specified AWS account credentials provider. Default
     * client settings will be used.
     *

     * Asynchronous methods are delegated to a fixed-size thread pool containing
     * 50 threads (to match the default maximum number of concurrent connections
     * to the service).
     *
     * @param awsCredentialsProvider
     *        The AWS credentials provider which will provide credentials to
     *        authenticate requests with AWS services.
     * @see java.util.concurrent.Executors#newFixedThreadPool(int)
     */
    public AmazonCloudWatchAsyncClient(
            com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider) {
        this(awsCredentialsProvider, java.util.concurrent.Executors
                .newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on
     * CloudWatch using the provided AWS account credentials provider and client
     * configuration options.
     *

     * Asynchronous methods are delegated to a fixed-size thread pool containing
     * a number of threads equal to the maximum number of concurrent connections
     * configured via {@code ClientConfiguration.getMaxConnections()}.
     *
     * @param awsCredentialsProvider
     *        The AWS credentials provider which will provide credentials to
     *        authenticate requests with AWS services.
     * @param clientConfiguration
     *        Client configuration options (ex: max retry limit, proxy settings,
     *        etc).
     *
     * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
     * @see java.util.concurrent.Executors#newFixedThreadPool(int)
     */
    public AmazonCloudWatchAsyncClient(
            com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
            com.amazonaws.ClientConfiguration clientConfiguration) {

        this(awsCredentialsProvider, clientConfiguration,
                java.util.concurrent.Executors
                        .newFixedThreadPool(clientConfiguration
                                .getMaxConnections()));
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on
     * CloudWatch using the specified AWS account credentials provider and
     * executor service. Default client settings will be used.
     *
     * @param awsCredentialsProvider
     *        The AWS credentials provider which will provide credentials to
     *        authenticate requests with AWS services.
     * @param executorService
     *        The executor service by which all asynchronous requests will be
     *        executed.
     */
    public AmazonCloudWatchAsyncClient(
            com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
            java.util.concurrent.ExecutorService executorService) {

        this(awsCredentialsProvider, configFactory.getConfig(), executorService);
    }

    /**
     * Constructs a new asynchronous client to invoke service methods on
     * CloudWatch using the specified AWS account credentials provider, executor
     * service, and client configuration options.
     *
     * @param awsCredentialsProvider
     *        The AWS credentials provider which will provide credentials to
     *        authenticate requests with AWS services.
     * @param clientConfiguration
     *        Client configuration options (ex: max retry limit, proxy settings,
     *        etc).
     * @param executorService
     *        The executor service by which all asynchronous requests will be
     *        executed.
     */
    public AmazonCloudWatchAsyncClient(
            com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
            com.amazonaws.ClientConfiguration clientConfiguration,
            java.util.concurrent.ExecutorService executorService) {

        super(awsCredentialsProvider, clientConfiguration);
        this.executorService = executorService;
    }

    /**
     * Returns the executor service used by this client to execute async
     * requests.
     *
     * @return The executor service used by this client to execute async
     *         requests.
     */
    public java.util.concurrent.ExecutorService getExecutorService() {
        return executorService;
    }

    @Override
    public java.util.concurrent.Future<DeleteAlarmsResult> deleteAlarmsAsync(
            DeleteAlarmsRequest request) {

        return deleteAlarmsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DeleteAlarmsResult> deleteAlarmsAsync(
            final DeleteAlarmsRequest request,
            final com.amazonaws.handlers.AsyncHandler<DeleteAlarmsRequest, DeleteAlarmsResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<DeleteAlarmsResult>() {
                    @Override
                    public DeleteAlarmsResult call() throws Exception {
                        DeleteAlarmsResult result;

                        try {
                            result = deleteAlarms(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<DescribeAlarmHistoryResult> describeAlarmHistoryAsync(
            DescribeAlarmHistoryRequest request) {

        return describeAlarmHistoryAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeAlarmHistoryResult> describeAlarmHistoryAsync(
            final DescribeAlarmHistoryRequest request,
            final com.amazonaws.handlers.AsyncHandler<DescribeAlarmHistoryRequest, DescribeAlarmHistoryResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<DescribeAlarmHistoryResult>() {
                    @Override
                    public DescribeAlarmHistoryResult call() throws Exception {
                        DescribeAlarmHistoryResult result;

                        try {
                            result = describeAlarmHistory(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    /**
     * Simplified method form for invoking the DescribeAlarmHistory operation.
     *
     * @see #describeAlarmHistoryAsync(DescribeAlarmHistoryRequest)
     */
    @Override
    public java.util.concurrent.Future<DescribeAlarmHistoryResult> describeAlarmHistoryAsync() {

        return describeAlarmHistoryAsync(new DescribeAlarmHistoryRequest());
    }

    /**
     * Simplified method form for invoking the DescribeAlarmHistory operation
     * with an AsyncHandler.
     *
     * @see #describeAlarmHistoryAsync(DescribeAlarmHistoryRequest,
     *      com.amazonaws.handlers.AsyncHandler)
     */
    public java.util.concurrent.Future<DescribeAlarmHistoryResult> describeAlarmHistoryAsync(
            com.amazonaws.handlers.AsyncHandler<DescribeAlarmHistoryRequest, DescribeAlarmHistoryResult> asyncHandler) {

        return describeAlarmHistoryAsync(new DescribeAlarmHistoryRequest(),
                asyncHandler);
    }

    @Override
    public java.util.concurrent.Future<DescribeAlarmsResult> describeAlarmsAsync(
            DescribeAlarmsRequest request) {

        return describeAlarmsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeAlarmsResult> describeAlarmsAsync(
            final DescribeAlarmsRequest request,
            final com.amazonaws.handlers.AsyncHandler<DescribeAlarmsRequest, DescribeAlarmsResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<DescribeAlarmsResult>() {
                    @Override
                    public DescribeAlarmsResult call() throws Exception {
                        DescribeAlarmsResult result;

                        try {
                            result = describeAlarms(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    /**
     * Simplified method form for invoking the DescribeAlarms operation.
     *
     * @see #describeAlarmsAsync(DescribeAlarmsRequest)
     */
    @Override
    public java.util.concurrent.Future<DescribeAlarmsResult> describeAlarmsAsync() {

        return describeAlarmsAsync(new DescribeAlarmsRequest());
    }

    /**
     * Simplified method form for invoking the DescribeAlarms operation with an
     * AsyncHandler.
     *
     * @see #describeAlarmsAsync(DescribeAlarmsRequest,
     *      com.amazonaws.handlers.AsyncHandler)
     */
    public java.util.concurrent.Future<DescribeAlarmsResult> describeAlarmsAsync(
            com.amazonaws.handlers.AsyncHandler<DescribeAlarmsRequest, DescribeAlarmsResult> asyncHandler) {

        return describeAlarmsAsync(new DescribeAlarmsRequest(), asyncHandler);
    }

    @Override
    public java.util.concurrent.Future<DescribeAlarmsForMetricResult> describeAlarmsForMetricAsync(
            DescribeAlarmsForMetricRequest request) {

        return describeAlarmsForMetricAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DescribeAlarmsForMetricResult> describeAlarmsForMetricAsync(
            final DescribeAlarmsForMetricRequest request,
            final com.amazonaws.handlers.AsyncHandler<DescribeAlarmsForMetricRequest, DescribeAlarmsForMetricResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<DescribeAlarmsForMetricResult>() {
                    @Override
                    public DescribeAlarmsForMetricResult call()
                            throws Exception {
                        DescribeAlarmsForMetricResult result;

                        try {
                            result = describeAlarmsForMetric(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<DisableAlarmActionsResult> disableAlarmActionsAsync(
            DisableAlarmActionsRequest request) {

        return disableAlarmActionsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<DisableAlarmActionsResult> disableAlarmActionsAsync(
            final DisableAlarmActionsRequest request,
            final com.amazonaws.handlers.AsyncHandler<DisableAlarmActionsRequest, DisableAlarmActionsResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<DisableAlarmActionsResult>() {
                    @Override
                    public DisableAlarmActionsResult call() throws Exception {
                        DisableAlarmActionsResult result;

                        try {
                            result = disableAlarmActions(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<EnableAlarmActionsResult> enableAlarmActionsAsync(
            EnableAlarmActionsRequest request) {

        return enableAlarmActionsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<EnableAlarmActionsResult> enableAlarmActionsAsync(
            final EnableAlarmActionsRequest request,
            final com.amazonaws.handlers.AsyncHandler<EnableAlarmActionsRequest, EnableAlarmActionsResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<EnableAlarmActionsResult>() {
                    @Override
                    public EnableAlarmActionsResult call() throws Exception {
                        EnableAlarmActionsResult result;

                        try {
                            result = enableAlarmActions(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<GetMetricStatisticsResult> getMetricStatisticsAsync(
            GetMetricStatisticsRequest request) {

        return getMetricStatisticsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<GetMetricStatisticsResult> getMetricStatisticsAsync(
            final GetMetricStatisticsRequest request,
            final com.amazonaws.handlers.AsyncHandler<GetMetricStatisticsRequest, GetMetricStatisticsResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<GetMetricStatisticsResult>() {
                    @Override
                    public GetMetricStatisticsResult call() throws Exception {
                        GetMetricStatisticsResult result;

                        try {
                            result = getMetricStatistics(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<ListMetricsResult> listMetricsAsync(
            ListMetricsRequest request) {

        return listMetricsAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<ListMetricsResult> listMetricsAsync(
            final ListMetricsRequest request,
            final com.amazonaws.handlers.AsyncHandler<ListMetricsRequest, ListMetricsResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<ListMetricsResult>() {
                    @Override
                    public ListMetricsResult call() throws Exception {
                        ListMetricsResult result;

                        try {
                            result = listMetrics(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    /**
     * Simplified method form for invoking the ListMetrics operation.
     *
     * @see #listMetricsAsync(ListMetricsRequest)
     */
    @Override
    public java.util.concurrent.Future<ListMetricsResult> listMetricsAsync() {

        return listMetricsAsync(new ListMetricsRequest());
    }

    /**
     * Simplified method form for invoking the ListMetrics operation with an
     * AsyncHandler.
     *
     * @see #listMetricsAsync(ListMetricsRequest,
     *      com.amazonaws.handlers.AsyncHandler)
     */
    public java.util.concurrent.Future<ListMetricsResult> listMetricsAsync(
            com.amazonaws.handlers.AsyncHandler<ListMetricsRequest, ListMetricsResult> asyncHandler) {

        return listMetricsAsync(new ListMetricsRequest(), asyncHandler);
    }

    @Override
    public java.util.concurrent.Future<PutMetricAlarmResult> putMetricAlarmAsync(
            PutMetricAlarmRequest request) {

        return putMetricAlarmAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<PutMetricAlarmResult> putMetricAlarmAsync(
            final PutMetricAlarmRequest request,
            final com.amazonaws.handlers.AsyncHandler<PutMetricAlarmRequest, PutMetricAlarmResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<PutMetricAlarmResult>() {
                    @Override
                    public PutMetricAlarmResult call() throws Exception {
                        PutMetricAlarmResult result;

                        try {
                            result = putMetricAlarm(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<PutMetricDataResult> putMetricDataAsync(
            PutMetricDataRequest request) {

        return putMetricDataAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<PutMetricDataResult> putMetricDataAsync(
            final PutMetricDataRequest request,
            final com.amazonaws.handlers.AsyncHandler<PutMetricDataRequest, PutMetricDataResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<PutMetricDataResult>() {
                    @Override
                    public PutMetricDataResult call() throws Exception {
                        PutMetricDataResult result;

                        try {
                            result = putMetricData(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    @Override
    public java.util.concurrent.Future<SetAlarmStateResult> setAlarmStateAsync(
            SetAlarmStateRequest request) {

        return setAlarmStateAsync(request, null);
    }

    @Override
    public java.util.concurrent.Future<SetAlarmStateResult> setAlarmStateAsync(
            final SetAlarmStateRequest request,
            final com.amazonaws.handlers.AsyncHandler<SetAlarmStateRequest, SetAlarmStateResult> asyncHandler) {

        return executorService
                .submit(new java.util.concurrent.Callable<SetAlarmStateResult>() {
                    @Override
                    public SetAlarmStateResult call() throws Exception {
                        SetAlarmStateResult result;

                        try {
                            result = setAlarmState(request);
                        } catch (Exception ex) {
                            if (asyncHandler != null) {
                                asyncHandler.onError(ex);
                            }
                            throw ex;
                        }

                        if (asyncHandler != null) {
                            asyncHandler.onSuccess(request, result);
                        }
                        return result;
                    }
                });
    }

    /**
     * Shuts down the client, releasing all managed resources. This includes
     * forcibly terminating all pending asynchronous service calls. Clients who
     * wish to give pending asynchronous service calls time to complete should
     * call {@code getExecutorService().shutdown()} followed by
     * {@code getExecutorService().awaitTermination()} prior to calling this
     * method.
     */
    @Override
    public void shutdown() {
        super.shutdown();
        executorService.shutdownNow();
    }
}


text: @class AudioContent, AudioFormat;


text:
module Capistrano
  module Version #:nodoc:
    # A method for comparing versions of required modules. It expects two
    # arrays of integers as parameters, the first being the minimum version
    # required, and the second being the actual version available. It returns
    # true if the actual version is at least equal to the required version.
    def self.check(required, actual) #:nodoc:
      required = required.map { |v| "%06d" % v }.join(".")
      actual   = actual.map { |v| "%06d" % v }.join(".")
      return actual >= required
    end

    MAJOR = 2
    MINOR = 2
    TINY  = 0

    STRING = [MAJOR, MINOR, TINY].join(".")

    SSH_REQUIRED = [1,0,10]
    SFTP_REQUIRED = [1,1,0]
  end
end


text:
#include "s2n_test.h"

#include "testlib/s2n_testlib.h"

#include <sys/poll.h>
#include <sys/wait.h>
#include <unistd.h>
#include <signal.h>
#include <stdint.h>
#include <fcntl.h>

#include <s2n.h>

#include "utils/s2n_random.h"

#include "tls/s2n_connection.h"
#include "tls/s2n_handshake.h"

#define MAX_BUF_SIZE 10000

int buffer_read(void *io_context, uint8_t *buf, uint32_t len)
{
    struct s2n_stuffer *in_buf;
    int n_read, n_avail;

    if (buf == NULL) {
        return 0;
    }

    in_buf = (struct s2n_stuffer *) io_context;
    if (in_buf == NULL) {
        errno = EINVAL;
        return -1;
    }

    // read the number of bytes requested or less if it isn't available
    n_avail = s2n_stuffer_data_available(in_buf);
    n_read = (len < n_avail) ? len : n_avail;

    if (n_read == 0) {
        errno = EAGAIN;
        return -1;
    }

    s2n_stuffer_read_bytes(in_buf, buf, n_read);
    return n_read;
}

int buffer_write(void *io_context, const uint8_t *buf, uint32_t len)
{
    struct s2n_stuffer *out;

    if (buf == NULL) {
        return 0;
    }

    out = (struct s2n_stuffer *) io_context;
    if (out == NULL) {
        errno = EINVAL;
        return -1;
    }

    if (s2n_stuffer_write_bytes(out, buf, len) < 0) {
        errno = EAGAIN;
        return -1;
    }

    return len;
}

int mock_client(int writefd, int readfd)
{
    struct s2n_connection *conn;
    struct s2n_config *client_config;
    s2n_blocked_status blocked;
    int result = 0;

    conn = s2n_connection_new(S2N_CLIENT);
    client_config = s2n_config_new();
    s2n_config_disable_x509_verification(client_config);
    s2n_connection_set_config(conn, client_config);

    // Unlike the server, the client just passes ownership of I/O to s2n
    s2n_connection_set_read_fd(conn, readfd);
    s2n_connection_set_write_fd(conn, writefd);

    result = s2n_negotiate(conn, &blocked);
    if (result < 0) {
        _exit(1);
    }

    s2n_shutdown(conn, &blocked);
    s2n_connection_free(conn);
    s2n_config_free(client_config);
    s2n_cleanup();

    _exit(0);
}

/**
 * This test creates a server, client, and a pair of pipes. The client uses the
 * pipes directly for I/O in s2n. The server copies data from the pipes into
 * stuffers and manages s2n I/O with a set of I/O callbacks that read and write
 * from the stuffers.
 */
int main(int argc, char **argv)
{
    struct s2n_connection *conn;
    struct s2n_config *config;
    s2n_blocked_status blocked;
    int status;
    pid_t pid;
    int server_to_client[2];
    int client_to_server[2];
    char *cert_chain_pem;
    char *private_key_pem;
    char *dhparams_pem;
    struct s2n_cert_chain_and_key *chain_and_key;
    struct s2n_stuffer in, out;

    BEGIN_TEST();

    EXPECT_SUCCESS(setenv("S2N_ENABLE_CLIENT_MODE", "1", 0));

    EXPECT_NOT_NULL(config = s2n_config_new());
    EXPECT_NOT_NULL(cert_chain_pem = malloc(S2N_MAX_TEST_PEM_SIZE));
    EXPECT_NOT_NULL(private_key_pem = malloc(S2N_MAX_TEST_PEM_SIZE));
    EXPECT_NOT_NULL(dhparams_pem = malloc(S2N_MAX_TEST_PEM_SIZE));
    EXPECT_SUCCESS(s2n_read_test_pem(S2N_DEFAULT_TEST_CERT_CHAIN, cert_chain_pem, S2N_MAX_TEST_PEM_SIZE));
    EXPECT_SUCCESS(s2n_read_test_pem(S2N_DEFAULT_TEST_PRIVATE_KEY, private_key_pem, S2N_MAX_TEST_PEM_SIZE));
    EXPECT_SUCCESS(s2n_read_test_pem(S2N_DEFAULT_TEST_DHPARAMS, dhparams_pem, S2N_MAX_TEST_PEM_SIZE));
    EXPECT_NOT_NULL(chain_and_key = s2n_cert_chain_and_key_new());
    EXPECT_SUCCESS(s2n_cert_chain_and_key_load_pem(chain_and_key, cert_chain_pem, private_key_pem));
    EXPECT_SUCCESS(s2n_config_add_cert_chain_and_key_to_store(config, chain_and_key));
    EXPECT_SUCCESS(s2n_config_add_dhparams(config, dhparams_pem));

    /* For convenience, this test will intentionally try to write to closed pipes during shutdown. Ignore the signal to
     * avoid exiting the process on SIGPIPE.
     */
    signal(SIGPIPE, SIG_IGN);

    /* Create a pipe */
    EXPECT_SUCCESS(pipe(server_to_client));
    EXPECT_SUCCESS(pipe(client_to_server));

    /* Create a child process */
    pid = fork();
    if (pid == 0) {
        /* This is the child process, close the read end of the pipe */
        EXPECT_SUCCESS(close(client_to_server[0]));
        EXPECT_SUCCESS(close(server_to_client[1]));

        /* Free the config */
        EXPECT_SUCCESS(s2n_config_free(config));
        free(cert_chain_pem);
        free(private_key_pem);
        free(dhparams_pem);

        /* Run the client */
        mock_client(client_to_server[1], server_to_client[0]);
    }

    /* This is the parent, close the write end of the pipe */
    EXPECT_SUCCESS(close(client_to_server[1]));
    EXPECT_SUCCESS(close(server_to_client[0]));

    EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER));
    EXPECT_SUCCESS(s2n_connection_set_config(conn, config));

    EXPECT_FAILURE(s2n_connection_use_corked_io(conn));

    /* Set up our I/O callbacks. Use stuffers for the "I/O context" */
    EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&in, 0));
    EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&out, 0));

    EXPECT_SUCCESS(s2n_connection_set_recv_cb(conn, &buffer_read));
    EXPECT_SUCCESS(s2n_connection_set_send_cb(conn, &buffer_write));
    EXPECT_SUCCESS(s2n_connection_set_recv_ctx(conn, &in));
    EXPECT_SUCCESS(s2n_connection_set_send_ctx(conn, &out));

    /* Make our pipes non-blocking */
    EXPECT_NOT_EQUAL(fcntl(client_to_server[0], F_SETFL, fcntl(client_to_server[0], F_GETFL) | O_NONBLOCK), -1);
    EXPECT_NOT_EQUAL(fcntl(server_to_client[1], F_SETFL, fcntl(server_to_client[1], F_GETFL) | O_NONBLOCK), -1);

    /* Negotiate the handshake. */
    do {
        int ret;

        ret = s2n_negotiate(conn, &blocked);
        EXPECT_TRUE(ret == 0 || (blocked && (errno == EAGAIN || errno == EWOULDBLOCK)));

        // check to see if we need to copy more over from the pipes to the buffers
        // to continue the handshake
        s2n_stuffer_recv_from_fd(&in, client_to_server[0], MAX_BUF_SIZE);
        s2n_stuffer_send_to_fd(&out, server_to_client[1], s2n_stuffer_data_available(&out));
    } while (blocked);

    /* Shutdown after negotiating */
    uint8_t server_shutdown=0;
    do {
        int ret;

        ret = s2n_shutdown(conn, &blocked);
        EXPECT_TRUE(ret == 0 || (blocked && (errno == EAGAIN || errno == EWOULDBLOCK)));
        if (ret == 0) {
            server_shutdown = 1;
        }

        s2n_stuffer_recv_from_fd(&in, client_to_server[0], MAX_BUF_SIZE);
        s2n_stuffer_send_to_fd(&out, server_to_client[1], s2n_stuffer_data_available(&out));
    } while (!server_shutdown);

    EXPECT_SUCCESS(s2n_connection_free(conn));

    /* Clean up */
    EXPECT_SUCCESS(s2n_stuffer_free(&in));
    EXPECT_SUCCESS(s2n_stuffer_free(&out));
    EXPECT_EQUAL(waitpid(-1, &status, 0), pid);
    EXPECT_EQUAL(status, 0);
    EXPECT_SUCCESS(s2n_config_free(config));
    EXPECT_SUCCESS(s2n_cert_chain_and_key_free(chain_and_key));
    free(cert_chain_pem);
    free(private_key_pem);
    free(dhparams_pem);

    s2n_cleanup();

    END_TEST();

    return 0;
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Leap Motion C# API Reference: Namespace List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

Leap Motion C# API Reference
    0.8.1

Namespace List

Here is a list of all documented namespaces with brief descriptions:

Leap

Generated on Fri Jun 28 2013 18:02:35 for Leap Motion C# API Reference by

     1.8.2


text:
from dogapi.common import is_p3k

__all__ = [
    'SnapshotApi',
]

if is_p3k():
    from urllib.parse import urlparse
else:
    from urlparse import urlparse

class SnapshotApi(object):

    def graph_snapshot(self, metric_query, start, end, event_query=None):
        """
        Take a snapshot of a graph, returning the full url to the snapshot.
        Values for `start` and `end` are given in seconds since the epoch.
        An optional event query can be provided to overlay events on the graph.

        >>> end = int(time.time())
        >>> start = end - 60 * 60
        >>> dog_http_api.snapshot("system.load.1{*}", start, end)
        """
        query_params = {
            'metric_query': metric_query,
            'start': start,
            'end': end
        }

        if event_query:
            query_params['event_query'] = event_query

        return self.http_request('GET', '/graph/snapshot', **query_params)

    def graph_snapshot_from_def(self, graph_def, start, end):
        """
        Take a snapshot of a graph from a graph definition, returning the
        full url to the snapshot. Values for `start` and `end` are given in
        seconds since the epoch.

        >>> end = int(time.time())
        >>> start = end - 60 * 60
        >>> graph_def = json.dumps({
            "requests": [{
                "q": "system.load.1{*}"
            }, {
                "q": "system.load.5{*}"
            }],
            "viz": "timeseries",
            "events": [{
                "q": "*"
            }]
        })
        >>> dog_http_api.snapshot(graph_def, start, end)
        """
        query_params = {
            'graph_def': graph_def,
            'start': start,
            'end': end
        }

        return self.http_request('GET', '/graph/snapshot', **query_params)

    def snapshot_status(self, snapshot_url):
        """
        Returns the status code of snapshot. Can be used to know when the
        snapshot is ready for download.

        Example usage:

        >> snap = dog_http_api.snapshot(metric_query, start, end)
        >> snapshot_url = snap['snapshot_url']
        >> while snapshot_status(snapshot_url) != 200:
        >>     time.sleep(1)
        >> img = urllib.urlopen(snapshot_url)
        """
        snap_path = urlparse(snapshot_url).path
        snap_path = snap_path.split('/snapshot/view/')[1].split('.png')[0]
        snapshot_status_url = '/graph/snapshot_status/{0}'.format(snap_path)
        get_status_code = lambda x: int(x['status_code'])
        return self.http_request('GET', snapshot_status_url,
                            response_formatter=get_status_code)


text:
import { dirname, extname } from 'path';

const FileLoader = Jymfony.Component.Config.Loader.FileLoader;
const FileResource = Jymfony.Component.Config.Resource.FileResource;

/**
 * JsonFileLoader loads configurations from a JSON file.
 *
 * @memberOf Jymfony.Component.DependencyInjection.Loader
 */
export default class JsonFileLoader extends FileLoader {
    /**
     * Constructor.
     *
     * @param {Jymfony.Component.DependencyInjection.ContainerBuilder} container A ContainerBuilder instance
     * @param {Jymfony.Component.Config.FileLocatorInterface} locator A FileLocator instance
     */
    __construct(container, locator) {
        /**
         * @type {Jymfony.Component.DependencyInjection.ContainerBuilder}
         *
         * @private
         */
        this._container = container;

        super.__construct(locator);
    }

    /**
     * @inheritdoc
     */
    load(resource) {
        const filePath = this._locator.locate(resource);
        this.currentDir = dirname(filePath);
        this._container.addResource(new FileResource(filePath));

        const content = require(filePath);

        // Parameters
        if (undefined !== content.parameters) {
            if (! isObjectLiteral(content.parameters)) {
                throw new InvalidArgumentException(__jymfony.sprintf('The "parameters" key should contain a key-value object in %s.', filePath));
            }

            for (const [ key, value ] of __jymfony.getEntries(content.parameters)) {
                this._container.setParameter(key, value);
            }
        }

        this._loadFromExtensions(content);
    }

    /**
     * @inheritdoc
     */
    supports(resource, type = undefined) {
        if (! isString(resource)) {
            return false;
        }

        if (undefined === type && '.json' === extname(resource)) {
            return true;
        }

        return 'json' === type;
    }

    /**
     * @param {string} content
     *
     * @private
     */
    _loadFromExtensions(content) {
        for (const [ name, values ] of __jymfony.getEntries(content)) {
            if (0 < [ 'imports', 'parameters', 'services' ].indexOf(name)) {
                continue;
            }

            this._container.loadFromExtension(name, values);
        }
    }
}


text:
class Fighter(object):
    """
    this is a fighter for an RPG. they start
    with a specific hp, and can get damaged.
    """

    def __init__(self, name, starting_hp):
        """
        name (str): the name of the fighter.

        starting_hp (int): the starting hp of
        the fighter.
        """

    def damage(self, damage):
        """
        damage (int): the amount of damage to deal.

        reduces the hp of the fighter for <damage> amount. HP
        can not be negative: if more damage is dealt to bring the
        fighter below 0, hp should be 0
        """
        pass

    def get_hp(self):
        """
        returns the current hp of the fighter
        """

    def is_dead(self):
        """
        returns True if the fighter's hp is below 0, otherwise
        returns False
        """

class Party(object):

    def __init__(self, members):
        """
        members ([Fighter]): a list of fighters in the party.
        """

    def damage(self, member_name, damage):
        """
        member_name (str): the name of the party member to damage.
        damage (int): the amount of damage to deal.

        damages the member of the party with the name <member_name> for
        <damage> damage.
        """

    def get_hp(self, member_name):
        """
        member_name (str)

        returns the hp for the party member with name <member_name>
        """
        pass

    def is_party_dead(self):
        """
        returns True if all party memmbers are dead, else False
        """

cecil = Fighter("cecil", 100)
rosa = Fighter("rosa", 70)

party = Party([cecil, rosa])

assert party.get_hp("cecil") == 100
assert party.get_hp("rosa") == 70
party.damage("rosa", 30)
assert party.is_party_dead() is False
party.damage("rosa", 50)
assert party.is_party_dead() is False
# hp can't go below 0.
assert party.get_hp("rosa") == 0
assert party.damage("cecil", 30)
assert party.get_hp("cecil") == 70
party.damage("cecil", 100)
assert party.is_party_dead() is True


text:
layout: "docs"
page_title: "Internals"
sidebar_current: "docs-internals"
description: |-
  This section covers some of the internals of Consul, such as the architecture, consensus and gossip protocols, and security model.
---

# Consul Internals

This section covers some of the internals of Consul, such as the architecture,
consensus and gossip protocols, and security model.

-> **Note:** Knowing about the internals of Consul is not necessary to successfully
use it. We document it here to be completely transparent about how Consul works.


text:
using System;
using System.Diagnostics;

namespace SharpRemote.Test.Types.Interfaces.PrimitiveTypes
{
	public interface IGetInt64Property
	{
		Int64 Value { get; }
	}
}


text:
package controllers;

import org.junit.Before;
import org.junit.Test;
import play.mvc.Result;
import play.test.WithApplication;

import java.util.HashMap;
import java.util.Map;

import static org.junit.Assert.*;
import static play.mvc.Http.Status.*;
import static play.test.Helpers.*;

/**
 * Tests for Login
 */
public class ApplicationTest extends WithApplication {

    @Before
    public void setUp() {
        start(fakeApplication());
    }

    @Test
    public void testLoginFailWithNoParameters() {
        Result result = route(fakeRequest("POST", routes.Application.authenticate().toString()));
        assertEquals(BAD_REQUEST, result.status());
    }

    @Test
    public void testLoginSuccessWithCorrectPassword() {
        Map<String, String> data = new HashMap<>();
        data.put("email", "admin@gmail.com");
        data.put("password", "123456");
        Result result = route(fakeRequest("POST", routes.Application.authenticate().toString()).bodyForm(data));
        assertEquals(SEE_OTHER, result.status());
        assertEquals(routes.Dashboard.index().toString(), result.redirectLocation());
    }

    @Test
    public void testLoginFailWithIncorrectPassword() {
        Map<String, String> data = new HashMap<>();
        data.put("email", "admin@gmail.com");
        data.put("password", "wrongPassword");
        Result result = route(fakeRequest("POST", routes.Application.authenticate().toString()).bodyForm(data));
        assertEquals(BAD_REQUEST, result.status());
    }

    @Test
    public void testLoginFailWithIncorrectUsername() {
        Map<String, String> data = new HashMap<>();
        data.put("email", "admin2222@gmail.com");
        data.put("password", "123456");
        Result result = route(fakeRequest("POST", routes.Application.authenticate().toString()).bodyForm(data));
        assertEquals(BAD_REQUEST, result.status());
    }

    @Test
    public void testLoginFailWithEmptyUsername() {
        Map<String, String> data = new HashMap<>();
        data.put("email", "");
        data.put("password", "123456");
        Result result = route(fakeRequest("POST", routes.Application.authenticate().toString()).bodyForm(data));
        assertEquals(BAD_REQUEST, result.status());
    }

    @Test
    public void testLoginFailWithEmptyPassword() {
        Map<String, String> data = new HashMap<>();
        data.put("email", "admin@gmail.com");
        data.put("password", "");
        Result result = route(fakeRequest("POST", routes.Application.authenticate().toString()).bodyForm(data));
        assertEquals(BAD_REQUEST, result.status());
    }

}


text:
package com.google.gwt.dev.generator.ast;

import java.util.List;

/**
 * A Node that represents a Java while loop.
 */
public class WhileLoop implements Statements {

  private final StatementsList body = new StatementsList();

  private final String test;

  /**
   * Creates a new while loop with test as the test
   * {@link Expression}. The WhileLoop has an empty body.
   *
   * @param test A textual boolean {@link Expression}. Must not be
   * null.
   */
  public WhileLoop(String test) {
    this.test = test;
  }

  public List<Statements> getStatements() {
    return body.getStatements();
  }

  public String toCode() {
    return "while ( " + test + " ) {\n" +
        body.toCode() + "\n" +
        "}\n";
  }
}


text:
Rails.application.routes.draw do
  scope "(:locale)", locale: /en/ do
    devise_for :users, controllers: { registrations: "users/registrations" }

    root "pages#index"

    namespace :backend do
      resources :users

      resources :leave_applications, except: [:show, :destroy] do
        get :verify, on: :member
        get :statistics, on: :collection
      end

      resources :leave_times, except: [:edit, :update, :destroy] do
        post :append_quota, on: :collection
        get :batch_new, on: :collection
        post :batch_create, on: :collection
      end

      resources :bonus_leave_time_logs, only: [:index, :update]
    end

    resources :leave_applications, except: [:destroy] do
      member do
        put "cancel"
      end

      collection do
        get "/:status", to: "leave_applications#index",
                        constraints: { status: /pending|approved|rejected|canceled/ }
      end
    end

    resources :leave_times, only: [:index, :show]
    resources :remote, only: [:new, :create, :update, :edit]

    authenticate :user, lambda { |u| u.is_manager? } do
      mount Crono::Web, at: '/crono'
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<folder exportedWithPermissions="true">
    <parent>/public/audit</parent>
    <name>domains</name>
    <label>Audit Domains</label>
    <description>Audit Domains</description>
    <creationDate>2014-06-19T13:08:19.119+02:00</creationDate>
    <updateDate>2014-05-28T03:46:46.176+02:00</updateDate>
    <resource>AuditArchiveDomain</resource>
    <resource>AuditDomain</resource>
</folder>


text:
package com.webianks.exp.crimson.reports;

import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.support.annotation.RequiresApi;

public class GetFilePathFromDevice {

    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    public static String getPath(final Context context, final Uri uri) {
        final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
        // DocumentProvider
        if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
            // ExternalStorageProvider
            if (isExternalStorageDocument(uri)) {
                final String docId = DocumentsContract.getDocumentId(uri);
                final String[] split = docId.split(":");
                final String type = split[0];
                if ("primary".equalsIgnoreCase(type)) {
                    return Environment.getExternalStorageDirectory() + "/" + split[1];
                }
            }
            // DownloadsProvider
            else if (isDownloadsDocument(uri)) {
                final String id = DocumentsContract.getDocumentId(uri);
                final Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
                return getDataColumn(context, contentUri, null, null);
            }
            // MediaProvider
            else if (isMediaDocument(uri)) {
                final String docId = DocumentsContract.getDocumentId(uri);
                final String[] split = docId.split(":");
                final String type = split[0];
                Uri contentUri = null;
                if ("image".equals(type)) {
                    contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
                } else if ("video".equals(type)) {
                    contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
                } else if ("audio".equals(type)) {
                    contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
                }
                final String selection = "_id=?";
                final String[] selectionArgs = new String[]{split[1]};
                return getDataColumn(context, contentUri, selection, selectionArgs);
            }
        }
        // MediaStore (and general)
        else if ("content".equalsIgnoreCase(uri.getScheme())) {
            // Return the remote address
            if (isGooglePhotosUri(uri))
                return uri.getLastPathSegment();
            return getDataColumn(context, uri, null, null);
        }
        // File
        else if ("file".equalsIgnoreCase(uri.getScheme())) {
            return uri.getPath();
        }
        return null;
    }

    public static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) {
        Cursor cursor = null;
        final String column = "_data";
        final String[] projection = {column};
        try {
            cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null);
            if (cursor != null && cursor.moveToFirst()) {
                final int index = cursor.getColumnIndexOrThrow(column);
                return cursor.getString(index);
            }
        } finally {
            if (cursor != null)
                cursor.close();
        }
        return null;
    }

    public static boolean isExternalStorageDocument(Uri uri) {
        return "com.android.externalstorage.documents".equals(uri.getAuthority());
    }

    public static boolean isDownloadsDocument(Uri uri) {
        return "com.android.providers.downloads.documents".equals(uri.getAuthority());
    }

    public static boolean isMediaDocument(Uri uri) {
        return "com.android.providers.media.documents".equals(uri.getAuthority());
    }

    public static boolean isGooglePhotosUri(Uri uri) {
        return "com.google.android.apps.photos.content".equals(uri.getAuthority());
    }
}


text:
@implementation SpeakerInfoPresenterStateStorage

@end


text:
namespace cc {

// IMPORTANT: new fields must be added to Equal() and Unite()
LayerTreeDebugState::LayerTreeDebugState() = default;

LayerTreeDebugState::LayerTreeDebugState(const LayerTreeDebugState& other) =
    default;

LayerTreeDebugState::~LayerTreeDebugState() = default;

void LayerTreeDebugState::SetRecordRenderingStats(bool enabled) {
  record_rendering_stats_ = enabled;
}

bool LayerTreeDebugState::RecordRenderingStats() const {
  return record_rendering_stats_;
}

bool LayerTreeDebugState::ShouldCreateHudLayer() const {
  return ShowDebugRects() || ShouldDrawHudInfo();
}

bool LayerTreeDebugState::ShowDebugRects() const {
  return show_paint_rects || show_property_changed_rects ||
         show_surface_damage_rects || show_screen_space_rects ||
         show_touch_event_handler_rects || show_wheel_event_handler_rects ||
         show_scroll_event_handler_rects || show_non_fast_scrollable_rects ||
         show_main_thread_scrolling_reason_rects ||
         show_layer_animation_bounds_rects || show_layout_shift_regions;
}

bool LayerTreeDebugState::ShowMemoryStats() const {
  return show_fps_counter;
}

bool LayerTreeDebugState::ShouldDrawHudInfo() const {
  return show_fps_counter || show_web_vital_metrics || show_smoothness_metrics;
}

void LayerTreeDebugState::TurnOffHudInfoDisplay() {
  // Turn off all types of HUD info display. ShouldDrawHudInfo() would return
  // false after this function.
  show_fps_counter = false;
  show_web_vital_metrics = false;
  show_smoothness_metrics = false;
}

bool LayerTreeDebugState::Equal(const LayerTreeDebugState& a,
                                const LayerTreeDebugState& b) {
  return (
      a.show_fps_counter == b.show_fps_counter &&
      a.show_debug_borders == b.show_debug_borders &&
      a.show_layout_shift_regions == b.show_layout_shift_regions &&
      a.show_paint_rects == b.show_paint_rects &&
      a.show_property_changed_rects == b.show_property_changed_rects &&
      a.show_surface_damage_rects == b.show_surface_damage_rects &&
      a.show_screen_space_rects == b.show_screen_space_rects &&
      a.show_touch_event_handler_rects == b.show_touch_event_handler_rects &&
      a.show_wheel_event_handler_rects == b.show_wheel_event_handler_rects &&
      a.show_scroll_event_handler_rects == b.show_scroll_event_handler_rects &&
      a.show_non_fast_scrollable_rects == b.show_non_fast_scrollable_rects &&
      a.show_main_thread_scrolling_reason_rects ==
          b.show_main_thread_scrolling_reason_rects &&
      a.show_layer_animation_bounds_rects ==
          b.show_layer_animation_bounds_rects &&
      a.slow_down_raster_scale_factor == b.slow_down_raster_scale_factor &&
      a.rasterize_only_visible_content == b.rasterize_only_visible_content &&
      a.highlight_non_lcd_text_layers == b.highlight_non_lcd_text_layers &&
      a.show_web_vital_metrics == b.show_web_vital_metrics &&
      a.record_rendering_stats_ == b.record_rendering_stats_);
}

}  // namespace cc


text:
class TSheets::Models::Notification < TSheets::Model
  field :id, :integer
  field :user_id, :integer
  field :msg_tracking_id, :string
  field :message, :string
  field :method, :string
  field :precheck, :string
  field :delivery_time, :datetime
  field :created, :date

end