text:
#pragma once
#include <aws/gamelift/GameLift_EXPORTS.h>
#include <aws/gamelift/GameLiftRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/gamelift/model/PlayerLatencyPolicy.h>
#include <aws/gamelift/model/GameSessionQueueDestination.h>
#include <aws/gamelift/model/Tag.h>
#include <utility>

namespace Aws
{
namespace GameLift
{
namespace Model
{

  /**
   *
Represents the input for a request operation.

See Also:
   AWS
   * API Reference

   */
  class AWS_GAMELIFT_API CreateGameSessionQueueRequest : public GameLiftRequest
  {
  public:
    CreateGameSessionQueueRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "CreateGameSessionQueue"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
A descriptive label that is associated with game session queue. Queue names
     * must be unique within each Region.

     */
    inline const Aws::String& GetName() const{ return m_name; }

    /**
     *
A descriptive label that is associated with game session queue. Queue names
     * must be unique within each Region.

     */
    inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }

    /**
     *
A descriptive label that is associated with game session queue. Queue names
     * must be unique within each Region.

     */
    inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }

    /**
     *
A descriptive label that is associated with game session queue. Queue names
     * must be unique within each Region.

     */
    inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }

    /**
     *
A descriptive label that is associated with game session queue. Queue names
     * must be unique within each Region.

     */
    inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }

    /**
     *
A descriptive label that is associated with game session queue. Queue names
     * must be unique within each Region.

     */
    inline CreateGameSessionQueueRequest& WithName(const Aws::String& value) { SetName(value); return *this;}

    /**
     *
A descriptive label that is associated with game session queue. Queue names
     * must be unique within each Region.

     */
    inline CreateGameSessionQueueRequest& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}

    /**
     *
A descriptive label that is associated with game session queue. Queue names
     * must be unique within each Region.

     */
    inline CreateGameSessionQueueRequest& WithName(const char* value) { SetName(value); return *this;}

    /**
     *
The maximum time, in seconds, that a new game session placement request
     * remains in the queue. When a request exceeds this time, the game session
     * placement changes to a TIMED_OUT status.

     */
    inline int GetTimeoutInSeconds() const{ return m_timeoutInSeconds; }

    /**
     *
The maximum time, in seconds, that a new game session placement request
     * remains in the queue. When a request exceeds this time, the game session
     * placement changes to a TIMED_OUT status.

     */
    inline bool TimeoutInSecondsHasBeenSet() const { return m_timeoutInSecondsHasBeenSet; }

    /**
     *
The maximum time, in seconds, that a new game session placement request
     * remains in the queue. When a request exceeds this time, the game session
     * placement changes to a TIMED_OUT status.

     */
    inline void SetTimeoutInSeconds(int value) { m_timeoutInSecondsHasBeenSet = true; m_timeoutInSeconds = value; }

    /**
     *
The maximum time, in seconds, that a new game session placement request
     * remains in the queue. When a request exceeds this time, the game session
     * placement changes to a TIMED_OUT status.

     */
    inline CreateGameSessionQueueRequest& WithTimeoutInSeconds(int value) { SetTimeoutInSeconds(value); return *this;}

    /**
     *
A collection of latency policies to apply when processing game sessions
     * placement requests with player latency information. Multiple policies are
     * evaluated in order of the maximum latency value, starting with the lowest
     * latency values. With just one policy, the policy is enforced at the start of the
     * game session placement for the duration period. With multiple policies, each
     * policy is enforced consecutively for its duration period. For example, a queue
     * might enforce a 60-second policy followed by a 120-second policy, and then no
     * policy for the remainder of the placement. A player latency policy must set a
     * value for MaximumIndividualPlayerLatencyMilliseconds. If none is
     * set, this API request fails.

     */
    inline const Aws::Vector<PlayerLatencyPolicy>& GetPlayerLatencyPolicies() const{ return m_playerLatencyPolicies; }

    /**
     *
A collection of latency policies to apply when processing game sessions
     * placement requests with player latency information. Multiple policies are
     * evaluated in order of the maximum latency value, starting with the lowest
     * latency values. With just one policy, the policy is enforced at the start of the
     * game session placement for the duration period. With multiple policies, each
     * policy is enforced consecutively for its duration period. For example, a queue
     * might enforce a 60-second policy followed by a 120-second policy, and then no
     * policy for the remainder of the placement. A player latency policy must set a
     * value for MaximumIndividualPlayerLatencyMilliseconds. If none is
     * set, this API request fails.

     */
    inline bool PlayerLatencyPoliciesHasBeenSet() const { return m_playerLatencyPoliciesHasBeenSet; }

    /**
     *
A collection of latency policies to apply when processing game sessions
     * placement requests with player latency information. Multiple policies are
     * evaluated in order of the maximum latency value, starting with the lowest
     * latency values. With just one policy, the policy is enforced at the start of the
     * game session placement for the duration period. With multiple policies, each
     * policy is enforced consecutively for its duration period. For example, a queue
     * might enforce a 60-second policy followed by a 120-second policy, and then no
     * policy for the remainder of the placement. A player latency policy must set a
     * value for MaximumIndividualPlayerLatencyMilliseconds. If none is
     * set, this API request fails.

     */
    inline void SetPlayerLatencyPolicies(const Aws::Vector<PlayerLatencyPolicy>& value) { m_playerLatencyPoliciesHasBeenSet = true; m_playerLatencyPolicies = value; }

    /**
     *
A collection of latency policies to apply when processing game sessions
     * placement requests with player latency information. Multiple policies are
     * evaluated in order of the maximum latency value, starting with the lowest
     * latency values. With just one policy, the policy is enforced at the start of the
     * game session placement for the duration period. With multiple policies, each
     * policy is enforced consecutively for its duration period. For example, a queue
     * might enforce a 60-second policy followed by a 120-second policy, and then no
     * policy for the remainder of the placement. A player latency policy must set a
     * value for MaximumIndividualPlayerLatencyMilliseconds. If none is
     * set, this API request fails.

     */
    inline void SetPlayerLatencyPolicies(Aws::Vector<PlayerLatencyPolicy>&& value) { m_playerLatencyPoliciesHasBeenSet = true; m_playerLatencyPolicies = std::move(value); }

    /**
     *
A collection of latency policies to apply when processing game sessions
     * placement requests with player latency information. Multiple policies are
     * evaluated in order of the maximum latency value, starting with the lowest
     * latency values. With just one policy, the policy is enforced at the start of the
     * game session placement for the duration period. With multiple policies, each
     * policy is enforced consecutively for its duration period. For example, a queue
     * might enforce a 60-second policy followed by a 120-second policy, and then no
     * policy for the remainder of the placement. A player latency policy must set a
     * value for MaximumIndividualPlayerLatencyMilliseconds. If none is
     * set, this API request fails.

     */
    inline CreateGameSessionQueueRequest& WithPlayerLatencyPolicies(const Aws::Vector<PlayerLatencyPolicy>& value) { SetPlayerLatencyPolicies(value); return *this;}

    /**
     *
A collection of latency policies to apply when processing game sessions
     * placement requests with player latency information. Multiple policies are
     * evaluated in order of the maximum latency value, starting with the lowest
     * latency values. With just one policy, the policy is enforced at the start of the
     * game session placement for the duration period. With multiple policies, each
     * policy is enforced consecutively for its duration period. For example, a queue
     * might enforce a 60-second policy followed by a 120-second policy, and then no
     * policy for the remainder of the placement. A player latency policy must set a
     * value for MaximumIndividualPlayerLatencyMilliseconds. If none is
     * set, this API request fails.

     */
    inline CreateGameSessionQueueRequest& WithPlayerLatencyPolicies(Aws::Vector<PlayerLatencyPolicy>&& value) { SetPlayerLatencyPolicies(std::move(value)); return *this;}

    /**
     *
A collection of latency policies to apply when processing game sessions
     * placement requests with player latency information. Multiple policies are
     * evaluated in order of the maximum latency value, starting with the lowest
     * latency values. With just one policy, the policy is enforced at the start of the
     * game session placement for the duration period. With multiple policies, each
     * policy is enforced consecutively for its duration period. For example, a queue
     * might enforce a 60-second policy followed by a 120-second policy, and then no
     * policy for the remainder of the placement. A player latency policy must set a
     * value for MaximumIndividualPlayerLatencyMilliseconds. If none is
     * set, this API request fails.

     */
    inline CreateGameSessionQueueRequest& AddPlayerLatencyPolicies(const PlayerLatencyPolicy& value) { m_playerLatencyPoliciesHasBeenSet = true; m_playerLatencyPolicies.push_back(value); return *this; }

    /**
     *
A collection of latency policies to apply when processing game sessions
     * placement requests with player latency information. Multiple policies are
     * evaluated in order of the maximum latency value, starting with the lowest
     * latency values. With just one policy, the policy is enforced at the start of the
     * game session placement for the duration period. With multiple policies, each
     * policy is enforced consecutively for its duration period. For example, a queue
     * might enforce a 60-second policy followed by a 120-second policy, and then no
     * policy for the remainder of the placement. A player latency policy must set a
     * value for MaximumIndividualPlayerLatencyMilliseconds. If none is
     * set, this API request fails.

     */
    inline CreateGameSessionQueueRequest& AddPlayerLatencyPolicies(PlayerLatencyPolicy&& value) { m_playerLatencyPoliciesHasBeenSet = true; m_playerLatencyPolicies.push_back(std::move(value)); return *this; }

    /**
     *
A list of fleets that can be used to fulfill game session placement requests
     * in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN.
     * Destinations are listed in default preference order.

     */
    inline const Aws::Vector<GameSessionQueueDestination>& GetDestinations() const{ return m_destinations; }

    /**
     *
A list of fleets that can be used to fulfill game session placement requests
     * in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN.
     * Destinations are listed in default preference order.

     */
    inline bool DestinationsHasBeenSet() const { return m_destinationsHasBeenSet; }

    /**
     *
A list of fleets that can be used to fulfill game session placement requests
     * in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN.
     * Destinations are listed in default preference order.

     */
    inline void SetDestinations(const Aws::Vector<GameSessionQueueDestination>& value) { m_destinationsHasBeenSet = true; m_destinations = value; }

    /**
     *
A list of fleets that can be used to fulfill game session placement requests
     * in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN.
     * Destinations are listed in default preference order.

     */
    inline void SetDestinations(Aws::Vector<GameSessionQueueDestination>&& value) { m_destinationsHasBeenSet = true; m_destinations = std::move(value); }

    /**
     *
A list of fleets that can be used to fulfill game session placement requests
     * in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN.
     * Destinations are listed in default preference order.

     */
    inline CreateGameSessionQueueRequest& WithDestinations(const Aws::Vector<GameSessionQueueDestination>& value) { SetDestinations(value); return *this;}

    /**
     *
A list of fleets that can be used to fulfill game session placement requests
     * in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN.
     * Destinations are listed in default preference order.

     */
    inline CreateGameSessionQueueRequest& WithDestinations(Aws::Vector<GameSessionQueueDestination>&& value) { SetDestinations(std::move(value)); return *this;}

    /**
     *
A list of fleets that can be used to fulfill game session placement requests
     * in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN.
     * Destinations are listed in default preference order.

     */
    inline CreateGameSessionQueueRequest& AddDestinations(const GameSessionQueueDestination& value) { m_destinationsHasBeenSet = true; m_destinations.push_back(value); return *this; }

    /**
     *
A list of fleets that can be used to fulfill game session placement requests
     * in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN.
     * Destinations are listed in default preference order.

     */
    inline CreateGameSessionQueueRequest& AddDestinations(GameSessionQueueDestination&& value) { m_destinationsHasBeenSet = true; m_destinations.push_back(std::move(value)); return *this; }

    /**
     *
A list of labels to assign to the new game session queue resource. Tags are
     * developer-defined key-value pairs. Tagging AWS resources are useful for resource
     * management, access management and cost allocation. For more information, see  Tagging
     * AWS Resources in the AWS General Reference. Once the resource is
     * created, you can use TagResource, UntagResource, and
     * ListTagsForResource to add, remove, and view tags. The maximum tag limit
     * may be lower than stated. See the AWS General Reference for actual tagging
     * limits.

     */
    inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }

    /**
     *
A list of labels to assign to the new game session queue resource. Tags are
     * developer-defined key-value pairs. Tagging AWS resources are useful for resource
     * management, access management and cost allocation. For more information, see  Tagging
     * AWS Resources in the AWS General Reference. Once the resource is
     * created, you can use TagResource, UntagResource, and
     * ListTagsForResource to add, remove, and view tags. The maximum tag limit
     * may be lower than stated. See the AWS General Reference for actual tagging
     * limits.

     */
    inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }

    /**
     *
A list of labels to assign to the new game session queue resource. Tags are
     * developer-defined key-value pairs. Tagging AWS resources are useful for resource
     * management, access management and cost allocation. For more information, see  Tagging
     * AWS Resources in the AWS General Reference. Once the resource is
     * created, you can use TagResource, UntagResource, and
     * ListTagsForResource to add, remove, and view tags. The maximum tag limit
     * may be lower than stated. See the AWS General Reference for actual tagging
     * limits.

     */
    inline void SetTags(const Aws::Vector<Tag>& value) { m_tagsHasBeenSet = true; m_tags = value; }

    /**
     *
A list of labels to assign to the new game session queue resource. Tags are
     * developer-defined key-value pairs. Tagging AWS resources are useful for resource
     * management, access management and cost allocation. For more information, see  Tagging
     * AWS Resources in the AWS General Reference. Once the resource is
     * created, you can use TagResource, UntagResource, and
     * ListTagsForResource to add, remove, and view tags. The maximum tag limit
     * may be lower than stated. See the AWS General Reference for actual tagging
     * limits.

     */
    inline void SetTags(Aws::Vector<Tag>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }

    /**
     *
A list of labels to assign to the new game session queue resource. Tags are
     * developer-defined key-value pairs. Tagging AWS resources are useful for resource
     * management, access management and cost allocation. For more information, see  Tagging
     * AWS Resources in the AWS General Reference. Once the resource is
     * created, you can use TagResource, UntagResource, and
     * ListTagsForResource to add, remove, and view tags. The maximum tag limit
     * may be lower than stated. See the AWS General Reference for actual tagging
     * limits.

     */
    inline CreateGameSessionQueueRequest& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}

    /**
     *
A list of labels to assign to the new game session queue resource. Tags are
     * developer-defined key-value pairs. Tagging AWS resources are useful for resource
     * management, access management and cost allocation. For more information, see  Tagging
     * AWS Resources in the AWS General Reference. Once the resource is
     * created, you can use TagResource, UntagResource, and
     * ListTagsForResource to add, remove, and view tags. The maximum tag limit
     * may be lower than stated. See the AWS General Reference for actual tagging
     * limits.

     */
    inline CreateGameSessionQueueRequest& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;}

    /**
     *
A list of labels to assign to the new game session queue resource. Tags are
     * developer-defined key-value pairs. Tagging AWS resources are useful for resource
     * management, access management and cost allocation. For more information, see  Tagging
     * AWS Resources in the AWS General Reference. Once the resource is
     * created, you can use TagResource, UntagResource, and
     * ListTagsForResource to add, remove, and view tags. The maximum tag limit
     * may be lower than stated. See the AWS General Reference for actual tagging
     * limits.

     */
    inline CreateGameSessionQueueRequest& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; }

    /**
     *
A list of labels to assign to the new game session queue resource. Tags are
     * developer-defined key-value pairs. Tagging AWS resources are useful for resource
     * management, access management and cost allocation. For more information, see  Tagging
     * AWS Resources in the AWS General Reference. Once the resource is
     * created, you can use TagResource, UntagResource, and
     * ListTagsForResource to add, remove, and view tags. The maximum tag limit
     * may be lower than stated. See the AWS General Reference for actual tagging
     * limits.

     */
    inline CreateGameSessionQueueRequest& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; }

  private:

    Aws::String m_name;
    bool m_nameHasBeenSet;

    int m_timeoutInSeconds;
    bool m_timeoutInSecondsHasBeenSet;

    Aws::Vector<PlayerLatencyPolicy> m_playerLatencyPolicies;
    bool m_playerLatencyPoliciesHasBeenSet;

    Aws::Vector<GameSessionQueueDestination> m_destinations;
    bool m_destinationsHasBeenSet;

    Aws::Vector<Tag> m_tags;
    bool m_tagsHasBeenSet;
  };

} // namespace Model
} // namespace GameLift
} // namespace Aws


text:
package com.orange.atk.manageListener;

import java.util.Date;

import javax.swing.SwingUtilities;

import org.apache.log4j.Logger;

import com.orange.atk.phone.PhoneInterface;
import com.orange.atk.results.logger.log.ResultLogger;

public class MyListener {

private	ResultLogger logger;
private IMeasureListener listener=null;
private	PhoneInterface phone;

	public MyListener(ResultLogger logger){
	this.logger=logger;
	this.phone = logger.getPhoneInterface();
	}

public void addMyListeners()
{

	  listener=(new MeasurmentAdapter() {

        @Override public void LongValueChangee(final long newValue,final String cle) {
            // exécution dans l'EDT
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                	if(!logger.isStopATK())
                	{
                		//Logger.getLogger(this.getClass() ).debug(cle+","+newValue);
                		logger.addToDocumentLogger(newValue,cle);
                	}
                }
            });
        }

        @Override public void StdOutputChangee(final String Stdoutput) {
            // ex�cution dans l'EDT
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                	if(!logger.isStopATK())
                	logger.addInfotoActionLogger("Standard Out/Err",Stdoutput, new Date(),new Date());

                }
            });
        }

        @Override public void FloatValueChangee(final float newValue,final String cle) {
            // exécution dans l'EDT
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                	if(!logger.isStopATK())
                    logger.addToDocumentLogger(newValue,cle);
                }
            });
        }
    });

	  phone.addPerfListener(listener);
    /*
    //Monitor logger Class
    logger.addPerfListener(new MeasurmentAdapter() {
        @Override public void addactionChangee(final String newValue) {
            // exécution dans l'EDT
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    // à chaque fois que l'action change, on met � jour le textfield
                //	if(lauchIHM&&isRunning)
                //	WJATJ.settextAreaJATKExec(""+String.valueOf(newValue));
                }
            });
        }

        @Override public void addOutputChangee(final String newValue) {
            // exécution dans l'EDT
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    // à chaque fois que l'output change, on met à jour le textfield
                //	if(lauchIHM&&isRunning)
                //	WJATJ.settextAreaJATKOutput(""+String.valueOf(newValue));
                }
            });
        }
    });

    //Monitor Loop

    IMeasureListener listener=new MeasurmentAdapter() {

        @Override public void addLoopChangee(final String newValue) {
            // exécution dans l'EDT
            SwingUtilities.invokeLater(new Runnable() {

                public void run() {

                    // à chaque fois que le loop change, on met à jour le textfield

                	//if(lauchIHM&&isRunning)
                	//	WJATJ.settextAreaJATKLoop(newValue);
                }
            });
        }

    };
    JATKInterpreterInternalState.addPerfListener(listener);
	*/
}

public void removeMylistener()
{
	try {
		Thread.sleep(5000);
	} catch (InterruptedException e) {
	}
	phone.removePerfListener(listener);
	Logger.getLogger(this.getClass() ).debug("Remove listener ");
}

}

redpajama_set_name: RedPajamaGithub


text:
$_QE.prototype.AssetBatch = function() {
    this.layers = [[]];

    this.get_layer_needed_for_asset = function(asset) {
        let depth = 0;
        let current_asset = asset;
        while (current_asset.depends_on != null) {
            depth += 1;
            current_asset = current_asset.depends_on;
        }
        if (this.layers.length === depth) {
            this.layers.push([]);
        }
        return depth;
    };

    this.add_asset = function(asset) {
        let layer_needed = this.get_layer_needed_for_asset(asset);
        if (layer_needed > this.layers.length) {
            this.layers.push([asset]);
        } else {
            if (this.layers[layer_needed].indexOf(asset) !== NOT_FOUND) {
                l('Asset {' + asset.name + '} already added to load batch!');
            } else {
                this.layers[layer_needed].push(asset);
            }
        }
        return asset;
    };

    this.load_batch = function() {
        let layer_promises = [];
        let pl;
        for (pl = 0; pl < this.layers.length; pl++) {
            layer_promises.push(this.load_layer.bind(this, this.layers[pl]));
        }

        // Solution from : https://stackoverflow.com/questions/30853265/dynamic-chaining-in-javascript-promises
        return new Promise(function(resolve, reject) {
            layer_promises.reduce(function(prev, curr) {
                return prev.then(curr);
            }, Promise.resolve(1)).then(function() {
                resolve();
            }).catch(function(error) {
                reject(error);
            });
        });
    };

    this.load_layer = function(layer) {
        let a;
        let promises = [];
        for (a = 0; a < layer.length; a++) {
            promises.push(layer[a].load_asset());
        }
        return Promise.all(promises);
    };
};

$_QE.prototype.AssetBatch.prototype = {

    add_asset_texture: function(asset_key, depends_on=null) {
        return this.add_asset(new $_QE.prototype.AssetFile(asset_key, ASSET_TYPE_TEXTURE, depends_on));
    },

    add_asset_shader: function(asset_key, depends_on=null) {
        return this.add_asset(new $_QE.prototype.AssetFile(asset_key, ASSET_TYPE_SHADER_MATERIAL, depends_on));
    },

};


text:
/*
 * string.h
 */

#ifndef _STRING_H
#define _STRING_H

#include <extern.h>
#include <stddef.h>

__extern void *memccpy(void *, const void *, int, size_t);
__extern void *memchr(const void *, int, size_t);
__extern void *memrchr(const void *, int, size_t);
__extern int memcmp(const void *, const void *, size_t);
__extern void *memcpy(void *, const void *, size_t);
__extern void *memmove(void *, const void *, size_t);
__extern void *memset(void *, int, size_t);
__extern void *memmem(const void *, size_t, const void *, size_t);
__extern void memswap(void *, void *, size_t);
__extern void bzero(void *, size_t);
__extern int strcasecmp(const char *, const char *);
__extern int strncasecmp(const char *, const char *, size_t);
__extern char *strcat(char *, const char *);
__extern char *strchr(const char *, int);
__extern char *strrchr(const char *, int);
__extern int strcmp(const char *, const char *);
__extern char *strcpy(char *, const char *);
__extern size_t strcspn(const char *, const char *);
__extern size_t strlen(const char *);
__extern size_t strnlen(const char *, size_t);
__extern char *strncat(char *, const char *, size_t);
__extern size_t strlcat(char *, const char *, size_t);
__extern int strncmp(const char *, const char *, size_t);
__extern char *strncpy(char *, const char *, size_t);
__extern size_t strlcpy(char *, const char *, size_t);
__extern char *strpbrk(const char *, const char *);
__extern char *strsep(char **, const char *);
__extern size_t strspn(const char *, const char *);
__extern char *strstr(const char *, const char *);
__extern char *strtok(char *, const char *);
__extern char *strtok_r(char *, const char *, char **);
char *index(const char *s, int c);

#endif				/* _STRING_H */


text:
require 'background_worker/version'
require 'background_worker/config'
require 'background_worker/base'

module BackgroundWorker
  # Configure worker
  #
  # eg:
  # BackgroundWorker.configure(
  #   logger: Rails.logger,
  #   enqueue_with: -> klass, opts { Resque.enqueue(klass, opts) },
  #   after_exception: -> e { Airbrake.notify(e) }
  # )
  def self.configure(options)
    @config = Config.new(options)
  end

  def self.enqueue(klass, options)
    config.enqueue_with.call(klass, options)
  end

  def self.logger
    config.logger
  end

  def self.verify_active_connections!
    if defined?(Rails)
      Rails.cache.reconnect if Rails.cache.respond_to?(:reconnect)
      Rails.cache.redis.close if Rails.cache.respond_to?(:redis)
    end
  end

  def self.release_connections!
    ActiveRecord::Base.clear_all_connections!
  end

  def self.after_exception(e)
    config.after_exception(e)
  end

  def self.config
    fail 'Not configured!' unless @config
    @config
  end

end


text:
package org.xforth.config.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xforth.config.client.ConfigBundle;
@Aspect
public class DynamicPropertyAspect {
    private static final Logger logger = LoggerFactory.getLogger(DynamicPropertyAspect.class);
    private ConfigBundle configBundle;

    @Around("execution(public * get*()) && @annotation(org.xforth.config.aop.DynamicValue)")
    public Object dynamicValueSet(ProceedingJoinPoint pjp) throws Throwable {
        final MethodSignature signature = (MethodSignature) pjp.getSignature();
        DynamicValue valueAno = signature.getMethod().getAnnotation(DynamicValue.class);
        if(valueAno!=null){
            String propKey = valueAno.value();
            if(logger.isDebugEnabled()){
                logger.debug("xforth dynamicValueSet propKey key:"+propKey+" value:"+configBundle.get(propKey));
            }
            try {
                return configBundle.get(propKey);
            }catch (Throwable e){
                logger.error("Method name:{} dynamicValueSet error:{}",signature.getMethod().getName(),e);
            }
        }
        Object result = pjp.proceed();
        return result;
    }

    public ConfigBundle getConfigBundle() {
        return configBundle;
    }

    public void setConfigBundle(ConfigBundle configBundle) {
        this.configBundle = configBundle;
    }
}


text:
package "libapache2-svn" do
  case node['platform']
  when "centos","redhat","scientific","fedora","suse","amazon"
    package_name "mod_dav_svn"
  else
    package_name "libapache2-svn"
  end
end

apache_module "dav_svn"


text:
var PORT = 33333;
var HOST = '127.0.0.1';

var dgram = require('dgram');
var server = dgram.createSocket('udp4');

server.on('listening', function () {
    var address = server.address();
    console.log('UDP Server listening on ' + address.address + ":" + address.port);
});

server.on('message', function (message, remote) {
    console.log(remote.address + ':' + remote.port +' - ' + message);

});

server.bind(PORT, HOST);


text:
import json
from datetime import datetime

import azurelinuxagent.common.logger as logger
from azurelinuxagent.common.event import add_log_event
from azurelinuxagent.common.version import CURRENT_AGENT, CURRENT_VERSION

from tests.tools import *

_MSG = "This is our test logging message {0} {1}"
_DATA = ["arg1", "arg2"]

class TestLogger(AgentTestCase):
    @patch('azurelinuxagent.common.logger.Logger.info')
    def test_periodic_emits_if_not_previously_sent(self, mock_info):
        logger.reset_periodic()

        logger.periodic(logger.EVERY_DAY, _MSG, *_DATA)
        self.assertEqual(1, mock_info.call_count)

    @patch('azurelinuxagent.common.logger.Logger.info')
    def test_periodic_does_not_emit_if_previously_sent(self, mock_info):
        logger.reset_periodic()

        logger.periodic(logger.EVERY_DAY, _MSG, *_DATA)
        self.assertEqual(1, mock_info.call_count)

        logger.periodic(logger.EVERY_DAY, _MSG, *_DATA)
        self.assertEqual(1, mock_info.call_count)

    @patch('azurelinuxagent.common.logger.Logger.info')
    def test_periodic_emits_after_elapsed_delta(self, mock_info):
        logger.reset_periodic()

        logger.periodic(logger.EVERY_DAY, _MSG, *_DATA)
        self.assertEqual(1, mock_info.call_count)

        logger.periodic(logger.EVERY_DAY, _MSG, *_DATA)
        self.assertEqual(1, mock_info.call_count)

        logger.DEFAULT_LOGGER.periodic_messages[hash(_MSG)] = \
            datetime.now() - logger.EVERY_DAY - logger.EVERY_HOUR
        logger.periodic(logger.EVERY_DAY, _MSG, *_DATA)
        self.assertEqual(2, mock_info.call_count)

    @patch('azurelinuxagent.common.logger.Logger.info')
    def test_periodic_forwards_message_and_args(self, mock_info):
        logger.reset_periodic()

        logger.periodic(logger.EVERY_DAY, _MSG, *_DATA)
        mock_info.assert_called_once_with(_MSG, *_DATA)

    def test_telemetry_logger(self):
        mock = MagicMock()
        appender = logger.TelemetryAppender(logger.LogLevel.WARNING, mock)
        appender.write(logger.LogLevel.WARNING, "--unit-test--")

        mock.assert_called_once_with(logger.LogLevel.WARNING, "--unit-test--")

    @patch('azurelinuxagent.common.event.EventLogger.save_event')
    def test_telemetry_logger1(self, mock_save):
        appender = logger.TelemetryAppender(logger.LogLevel.WARNING, add_log_event)
        appender.write(logger.LogLevel.WARNING, "--unit-test--")

        self.assertEqual(1, mock_save.call_count)
        telemetry_json = json.loads(mock_save.call_args[0][0])

        self.assertEqual('FFF0196F-EE4C-4EAF-9AA5-776F622DEB4F', telemetry_json['providerId'])
        self.assertEqual(7, telemetry_json['eventId'])

        self.assertEqual(5, len(telemetry_json['parameters']))
        for x in telemetry_json['parameters']:
            if x['name'] == 'EventName':
                self.assertEqual(x['value'], 'Log')

            elif x['name'] == 'CapabilityUsed':
                self.assertEqual(x['value'], 'WARNING')

            elif x['name'] == 'Context1':
                self.assertEqual(x['value'], '--unit-test--')

            elif x['name'] == 'Context2':
                self.assertEqual(x['value'], '')

            elif x['name'] == 'Context3':
                self.assertEqual(x['value'], '')


text:
My Stacks

            <input type="text" class="search-bar" placeholder="" ng-model="data.search" ng-init="checkSearch()" ng-change="searchFile()">

                x

         Submit a Stackfile
         Submit a Stackfile

    <svg class="spinner" width="65px" height="65px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
        <circle class="path" fill="none" stroke-width="4" stroke-linecap="round" cx="33" cy="33" r="25"></circle>
    </svg>

<modal title="Embed" visible="showModal">

You can embed a Stackfile in any text field that supports Javascript, such as a blog post. Copy the Embed Script below.

    <form role="form">

Embed Script Copied!

            <input type="text" onClick="this.setSelectionRange(0, this.value.length)" id="embed" placeholder="script"  ng-model="embedScript" />

    </form>
</modal>

                    {{result._source.title}}
{{result._source.tags.length}} ServicesBy {{result._source.user}}

                    Deploy to Tutum

                      <svg ng-controller="FavController" ng-click="toggleStatus(result); increment(results._source)" ng-class="{'btn-off':!isSelected(result), 'btn-on':isSelected(result)}" class="star"  width="24px" height="24px" viewBox="0 0 48 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
                          <g id="Stackfiles.io" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
                              <g id="-star" sketch:type="MSArtboardGroup" fill="#FFF3CC">
                                  <g id="star" sketch:type="MSLayerGroup" transform="translate(4.000000, 4.000000)">
                                      <path d="M40,14.48 L25.62,13.24 L20,0 L14.38,13.26 L0,14.48 L10.92,23.94 L7.64,38 L20,30.54 L32.36,38 L29.1,23.94 L40,14.48 L40,14.48 Z M20,26.8 L12.48,31.34 L14.48,22.78 L7.84,17.02 L16.6,16.26 L20,8.2 L23.42,16.28 L32.18,17.04 L25.54,22.8 L27.54,31.36 L20,26.8 L20,26.8 Z" id="Shape" sketch:type="MSShapeGroup"></path>
                                  </g>
                              </g>
                          </g>
                      </svg>
{{result._source.stars}}

No result

No Stackfiles submitted

Oops! Something bad happened!

                    {{file.title}}
{{file.tags.length}} Services By {{file.user}}

                    Deploy to Tutum

                      <svg ng-controller="FavController" ng-click="toggleStatus(file); increment(file)"" ng-class="{'btn-off':!isSelected(file), 'btn-on':isSelected(file)}" class="star"  width="24px" height="24px" viewBox="0 0 48 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
                          <g id="Stackfiles.io" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
                              <g id="-star" sketch:type="MSArtboardGroup" fill="#FFF3CC">
                                  <g id="star" sketch:type="MSLayerGroup" transform="translate(4.000000, 4.000000)">
                                      <path d="M40,14.48 L25.62,13.24 L20,0 L14.38,13.26 L0,14.48 L10.92,23.94 L7.64,38 L20,30.54 L32.36,38 L29.1,23.94 L40,14.48 L40,14.48 Z M20,26.8 L12.48,31.34 L14.48,22.78 L7.84,17.02 L16.6,16.26 L20,8.2 L23.42,16.28 L32.18,17.04 L25.54,22.8 L27.54,31.36 L20,26.8 L20,26.8 Z" id="Shape" sketch:type="MSShapeGroup"></path>
                                  </g>
                              </g>
                          </g>
                      </svg>
{{file.stars}}


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

#import <XCTest/XCTest.h>

#import <UIKit/UIGestureRecognizerSubclass.h>

#import "MaterialRipple.h"

@interface FakeMDCRippleTouchControllerDelegate : NSObject <MDCRippleTouchControllerDelegate>
@property(nonatomic, strong) MDCRippleTouchController *rippleTouchController;
@property(nonatomic, assign) BOOL insertRippleViewCalled;
@property(nonatomic, assign) BOOL didProcessRippleViewCalled;
@property(nonatomic, assign) BOOL shouldProcessRippleTouchesAtTouchLocation;

@end

@interface FakeGestureRecognizer : UILongPressGestureRecognizer
@end

@implementation FakeGestureRecognizer

- (CGPoint)locationInView:(nullable UIView *)view {
  return view.center;
}

@end

@implementation FakeMDCRippleTouchControllerDelegate

- (void)rippleTouchController:(MDCRippleTouchController *)rippleTouchController
             insertRippleView:(MDCRippleView *)rippleView
                     intoView:(UIView *)view {
  _insertRippleViewCalled = YES;
  [view insertSubview:rippleView atIndex:0];
}

- (void)rippleTouchController:(MDCRippleTouchController *)rippleTouchController
         didProcessRippleView:(MDCRippleView *)rippleView
              atTouchLocation:(CGPoint)location {
  _didProcessRippleViewCalled = YES;
}

- (BOOL)rippleTouchController:(MDCRippleTouchController *)rippleTouchController
    shouldProcessRippleTouchesAtTouchLocation:(CGPoint)location {
  return _shouldProcessRippleTouchesAtTouchLocation;
}

@end

@interface MDCRippleTouchController (UnitTests)
- (void)handleRippleGesture:(UILongPressGestureRecognizer *)recognizer;
@end

/** Unit tests for MDCRippleTouchController. */
@interface MDCRippleTouchControllerTests : XCTestCase

@end

@implementation MDCRippleTouchControllerTests

- (void)testInit {
  // When
  MDCRippleTouchController *touchController = [[MDCRippleTouchController alloc] init];

  // Then
  XCTAssertNil(touchController.view);
  XCTAssertNotNil(touchController.rippleView);
  XCTAssertTrue(touchController.shouldProcessRippleWithScrollViewGestures);
  XCTAssertNotNil(touchController.gestureRecognizer);
}

- (void)testInitWithView {
  // Given
  UIView *parentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
  MDCRippleTouchController *touchController =
      [[MDCRippleTouchController alloc] initWithView:parentView];

  // Then
  XCTAssertEqualObjects(parentView, touchController.view);
  XCTAssertNotNil(touchController.rippleView);
  XCTAssertEqualObjects(touchController.rippleView.superview, parentView);
  XCTAssertTrue(touchController.shouldProcessRippleWithScrollViewGestures);
  XCTAssertNotNil(touchController.gestureRecognizer);
  XCTAssertTrue(CGRectEqualToRect(touchController.rippleView.frame, parentView.bounds),
                @"(%@) is not equal to (%@)", NSStringFromCGRect(touchController.rippleView.frame),
                NSStringFromCGRect(parentView.bounds));
}

- (void)testInitWithViewDeferred {
  // Given
  UIView *parentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
  MDCRippleTouchController *touchController =
      [[MDCRippleTouchController alloc] initWithView:parentView deferred:YES];

  // Then
  XCTAssertEqualObjects(parentView, touchController.view);
  XCTAssertNotNil(touchController.rippleView);
  XCTAssertNil(touchController.rippleView.superview);
  XCTAssertNotNil(touchController.gestureRecognizer);
}

- (void)testAddRippleToView {
  // Given
  UIView *parentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
  MDCRippleTouchController *touchController = [[MDCRippleTouchController alloc] init];

  // When
  [touchController addRippleToView:parentView];

  // Then
  XCTAssertEqualObjects(parentView, touchController.view);
  XCTAssertNotNil(touchController.rippleView);
  XCTAssertEqualObjects(touchController.rippleView.superview, parentView);
  XCTAssertTrue(touchController.shouldProcessRippleWithScrollViewGestures);
  XCTAssertNotNil(touchController.gestureRecognizer);
  XCTAssertTrue(CGRectEqualToRect(touchController.rippleView.frame, parentView.bounds),
                @"(%@) is not equal to (%@)", NSStringFromCGRect(touchController.rippleView.frame),
                NSStringFromCGRect(parentView.bounds));
}

- (void)testDeferredAddingOfRippleView {
  // Given
  UIView *parentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
  MDCRippleTouchController *touchController =
      [[MDCRippleTouchController alloc] initWithView:parentView deferred:YES];

  // Given
  touchController.gestureRecognizer.state = UIGestureRecognizerStateBegan;
  [touchController handleRippleGesture:touchController.gestureRecognizer];

  // Then
  XCTAssertEqualObjects(touchController.rippleView.superview, parentView);
  XCTAssertTrue(touchController.shouldProcessRippleWithScrollViewGestures);
  XCTAssertNotNil(touchController.gestureRecognizer);
  XCTAssertTrue(CGRectEqualToRect(touchController.rippleView.frame, parentView.bounds),
                @"(%@) is not equal to (%@)", NSStringFromCGRect(touchController.rippleView.frame),
                NSStringFromCGRect(parentView.bounds));
}

- (void)testCallsInsertRippleViewDelegateMethodWhenAddedToView {
  // Given
  UIView *parentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
  MDCRippleTouchController *touchController = [[MDCRippleTouchController alloc] init];
  FakeMDCRippleTouchControllerDelegate *delegate =
      [[FakeMDCRippleTouchControllerDelegate alloc] init];
  touchController.delegate = delegate;
  delegate.rippleTouchController = touchController;

  // When
  [parentView addSubview:[[UIView alloc] init]];
  [touchController addRippleToView:parentView];

  // Then
  XCTAssertEqualObjects(parentView.subviews[0], touchController.rippleView);
  XCTAssertTrue(delegate.insertRippleViewCalled);
}

- (void)testCallsDidProcessRippleViewDelegateMethod {
  // Given
  UIView *parentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
  MDCRippleTouchController *touchController = [[MDCRippleTouchController alloc] init];
  FakeMDCRippleTouchControllerDelegate *delegate =
      [[FakeMDCRippleTouchControllerDelegate alloc] init];
  touchController.delegate = delegate;
  delegate.rippleTouchController = touchController;
  delegate.shouldProcessRippleTouchesAtTouchLocation = YES;

  // When
  [parentView addSubview:[[UIView alloc] init]];
  [touchController addRippleToView:parentView];
  FakeGestureRecognizer *gestureRecognizer = [[FakeGestureRecognizer alloc] initWithTarget:nil
                                                                                action:nil];
  gestureRecognizer.state = UIGestureRecognizerStateBegan;
  [touchController handleRippleGesture:gestureRecognizer];

  // Then
  XCTAssertTrue(delegate.didProcessRippleViewCalled);
}

- (void)testCallsShouldProcessRippleViewDelegateMethodWhenProcessRippleIsDisabled {
  // Given
  UIView *parentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
  MDCRippleTouchController *touchController = [[MDCRippleTouchController alloc] init];
  FakeMDCRippleTouchControllerDelegate *delegate =
      [[FakeMDCRippleTouchControllerDelegate alloc] init];
  touchController.delegate = delegate;
  delegate.rippleTouchController = touchController;
  delegate.shouldProcessRippleTouchesAtTouchLocation = NO;

  // When
  [parentView addSubview:[[UIView alloc] init]];
  [touchController addRippleToView:parentView];
  FakeGestureRecognizer *gestureRecognizer =
      [[FakeGestureRecognizer alloc] initWithTarget:touchController
                                             action:@selector(handleRippleGesture:)];
  gestureRecognizer.delegate = touchController;
  gestureRecognizer.minimumPressDuration = 0;
  gestureRecognizer.cancelsTouchesInView = NO;
  gestureRecognizer.delaysTouchesEnded = NO;
  [parentView addGestureRecognizer:gestureRecognizer];
  gestureRecognizer.state = UIGestureRecognizerStateBegan;
  [touchController handleRippleGesture:gestureRecognizer];

  // Then
  XCTAssertFalse(delegate.didProcessRippleViewCalled);
}

@end


text:
import { fetchApi } from '../utils'
import * as websocketActions from './websocket'
import * as msgQueueActions from './msgQueue'

export const MSG_TYPE = 'UPDATE_SETTINGS'
export const DATA_URL = '/settings'

export const RECEIVE        = 'RECEIVE'
export const UPDATE         = 'UPDATE'
export const REQUEST_UPDATE = 'REQUEST_UPDATE'
export const UNKNOWN_CMD    = 'SETTINGS_UNKNOWN_CMD'

const defaultState = {

}

export default function reducer(state = defaultState, action) {
    switch (action.type) {

        case RECEIVE:
            return action.settings

        case UPDATE:
            return {
                ...state,
                ...action.settings,
            }

        default:
            return state
    }
}

/**
 * @public msgQueue
 */
export function handleWsMsg(msg) {
    switch (msg.cmd) {

        case websocketActions.CMD_UPDATE:
            return updateSettings(msg.data)

        default:
            console.error('unknown settings update', msg)
            return { type: UNKNOWN_CMD, msg }
    }
}

/**
 * @public
 */
export function update(settings) {
    fetchApi.put('/settings', settings)
    return { type: REQUEST_UPDATE }
}

/**
 * @public websocket
 */
export function fetchData() {
    return msgQueueActions.fetchData(MSG_TYPE)
}

/**
 * @public msgQueue
 */
export function receiveData(settings) {
    return { type: RECEIVE, settings }
}

/**
 * @private
 */
export function updateSettings(settings) {
    return { type: UPDATE, settings }
}


text:
package com.vangent.hieos.services.xca.gateway.transactions;

import com.vangent.hieos.services.xca.gateway.controller.XCARequestController;

import com.vangent.hieos.subjectmodel.DeviceInfo;
import com.vangent.hieos.xutil.atna.ATNAAuditEvent;
import com.vangent.hieos.xutil.atna.ATNAAuditEvent.ActorType;

import com.vangent.hieos.xutil.services.framework.XBaseTransaction;
import com.vangent.hieos.xutil.metadata.structure.MetadataSupport;
import com.vangent.hieos.xutil.xlog.client.XLogMessage;
import com.vangent.hieos.xutil.response.Response;
import com.vangent.hieos.xutil.xconfig.XConfig;
import com.vangent.hieos.xutil.xconfig.XConfigActor;
import com.vangent.hieos.xutil.exception.SchemaValidationException;
import com.vangent.hieos.xutil.exception.XdsException;
import com.vangent.hieos.xutil.exception.XdsInternalException;

import org.apache.log4j.Logger;
import java.util.ArrayList;
import org.apache.axiom.om.OMElement;

/**
 *
 * @author Bernie Thuman
 */
public abstract class XCAAbstractTransaction extends XBaseTransaction {

    private final static Logger logger = Logger.getLogger(XCAAbstractTransaction.class);
    //private XConfigActor gatewayConfig = null;
    private XCARequestController requestController = null;
    private boolean errorDetected = false;
    private ATNAAuditEvent.ActorType gatewayActorType;

    /**
     *
     */
    public enum XCAResponseStatusType {

        /**
         *
         */
        Success,
        /**
         *
         */
        PartialSuccess,
        /**
         *
         */
        Failure
    };

    // Subclass responsibilities:
    /**
     *
     * @param request
     * @throws XdsInternalException
     */
    abstract void prepareValidRequests(OMElement request) throws XdsInternalException;

    /**
     *
     * @param request
     */
    abstract void validateRequest(OMElement request);

    /**
     *
     * @param allResponses
     * @return
     * @throws XdsInternalException
     */
    abstract XCAResponseStatusType consolidateResponses(ArrayList<OMElement> allResponses) throws XdsInternalException;

    /**
     *
     * @return
     */
    protected XConfigActor getGatewayConfig() {
        return this.getConfigActor();
    }

    /**
     *
     * @param log_message
     * @param response
     */
    protected void init(XLogMessage log_message, Response response) {
        this.log_message = log_message;
        this.requestController = new XCARequestController(response, this.log_message);
        super.init(response); // Initialize superclass whole.
    }

    /**
     * Return the homeCommunityId for the local community.
     *
     * @return The homeCommunityId for the local community.
     */
    protected String getLocalHomeCommunityId() {
        String localHomeCommunityId = null;
        try {
            XConfig xconfig = XConfig.getInstance();
            localHomeCommunityId = xconfig.getHomeCommunityConfig().getUniqueId();
        } catch (XdsInternalException e) {
            logger.fatal(logger_exception_details(e));
            log_message.addErrorParam("Internal Error", "Could not find local homeCommunityId in XConfig");
        }
        return localHomeCommunityId;
    }

    /**
     *
     * @param request
     * @return
     * @throws SchemaValidationException
     * @throws XdsInternalException
     */
    public OMElement run(OMElement request) throws SchemaValidationException, XdsInternalException {
        try {
            validateRequest(request);     // Concrete class responsibility.
            if (response.has_errors()) {
                return response.getResponse();      // Get out early.
            }
            runInternal(request);  // Do the real work.
        } catch (XdsException e) {
            // FIXME (Repository/Registry).
            response.add_error(MetadataSupport.XDSRepositoryError, e.getMessage(),
                    this.getClass().getName(), log_message);
            logger.fatal(logger_exception_details(e));
        }

        OMElement finalResponse = null;
        try {
            finalResponse = response.getResponse();  // This should only be called once.
        } catch (XdsInternalException e) {
            logger.fatal(logger_exception_details(e));
            log_message.addErrorParam("Internal Error", "Error generating response from XCA");
        }
        this.log_response();
        if (this.errorDetected == true) {
            log_message.setPass(false);  // Force this for internal errors detected.
        }
        return finalResponse;
    }

    /**
     *
     * @param request
     * @throws XdsInternalException
     */
    private void runInternal(OMElement request) throws XdsInternalException {
        prepareValidRequests(request);
        ArrayList<OMElement> allResponses = requestController.sendRequests();
        XCAResponseStatusType status = consolidateResponses(allResponses);
        if (XCAResponseStatusType.PartialSuccess.equals(status)) {
            // This implies that we were able to successfully make at least one request.
            response.forcePartialSuccessStatus();
        }
    }

    /**
     *
     * @return
     */
    protected DeviceInfo getSenderDeviceInfo() {
        return this.getDeviceInfo(this.getGatewayConfig());
    }

    /**
     *
     * @param actorConfig
     * @return
     */
    protected DeviceInfo getDeviceInfo(XConfigActor actorConfig) {
        DeviceInfo deviceInfo = new DeviceInfo(actorConfig);
        return deviceInfo;
    }

    /**
     *
     * @param errorString
     */
    protected void logError(String errorString) {
        this.errorDetected = true;  // Make note of a problem.
        try {
            log_message.addErrorParam("Errors", errorString);
            logger.error(errorString);
        } catch (Exception e) {
            // We really need to ignore this exception to avoid indirect recursion.
            logger.error("XCA ERROR: Could not log info", e);
        }
    }

    /**
     *
     * @param logLabel
     * @param infoString
     */
    protected void logInfo(String logLabel, String infoString) {
        try {
            log_message.addOtherParam(logLabel, infoString);
            logger.info(logLabel + " : " + infoString);
        } catch (Exception e) {
            logger.error("XCA ERROR: Could not log info", e);
        }
    }

    /**
     *
     * @return
     */
    protected XCARequestController getRequestController() {
        return this.requestController;
    }

    /**
     *
     * @return
     */
    public ActorType getGatewayActorType() {
        return gatewayActorType;
    }

    /**
     *
     * @param gatewayActorType
     */
    public void setGatewayActorType(ActorType gatewayActorType) {
        this.gatewayActorType = gatewayActorType;
    }
}


text:
tools
=====

Some little tools and things


text:
void test_assemble_rc(void){

}
void test_assemble_all(void){

}


text:
#if !defined(Filter_H) /* FILT Header File */
#define Filter_H

#include "cyfitter.h"
#include "CyLib.h"

extern uint8 Filter_initVar;

/***************************************
*   Conditional Compilation Parameters
***************************************/
#define Filter_DA_RAM_SIZE_CUR        (0x200u)
#define Filter_DB_RAM_SIZE_CUR        (0x200u)
#define Filter_CSA_RAM_SIZE_CUR       (0x100u)
#define Filter_CSB_RAM_SIZE_CUR       (0x100u)
#define Filter_CFSM_RAM_SIZE_CUR      (0x100u)
#define Filter_ACU_RAM_SIZE_CUR       (0x40u)

#define Filter_FIR_A_SIZE       (340u)

extern const uint8 CYCODE Filter_ChannelAFirCoefficients[Filter_FIR_A_SIZE];

/***************************************
*     Data Struct Definition
***************************************/

/* Low power Mode API Support */
typedef struct
{
    uint8 enableState;
    uint8 cr;
    uint8 sr;
    uint8 sema;
    uint8 saveAcu[Filter_ACU_RAM_SIZE_CUR];
}   Filter_backupStruct;

/***************************************
* FILT component function prototypes.
****************************************/

void   Filter_Start(void) ;
void   Filter_Stop(void) ;
uint8 Filter_Read8(uint8 channel) ;
uint16 Filter_Read16(uint8 channel) ;
uint32 Filter_Read24(uint8 channel) ;
void Filter_Write8(uint8 channel, uint8 sample) ;
void Filter_Write16(uint8 channel, uint16 sample) ;
void Filter_Write24(uint8 channel, uint32 sample) ;
void Filter_Sleep(void) ;
void Filter_Wakeup(void) ;
void Filter_SaveConfig(void) ;
void Filter_RestoreConfig(void) ;
void Filter_Init(void) ;
void Filter_Enable(void) ;
void Filter_SetCoherency(uint8 channel, uint8 byteSelect) ;
void Filter_SetCoherencyEx(uint8 regSelect, uint8 key) ;
void Filter_SetDalign(uint8 regSelect, uint8 state) ;

/*****************************************
* FILT component API Constants.
******************************************/

/* Channel Definitions */
#define Filter_CHANNEL_A             (0u)
#define Filter_CHANNEL_B             (1u)

#define Filter_CHANNEL_A_INTR        (0x08u)
#define Filter_CHANNEL_B_INTR        (0x10u)

#define Filter_ALL_INTR              (0xf8u)

#define Filter_SIGN_BIT              ((uint32)0x00800000u)
#define Filter_SIGN_BYTE             ((uint32)0xFF000000u)

/* Component's enable/disable state */
#define Filter_ENABLED               (0x01u)
#define Filter_DISABLED              (0x00u)

/* SetCoherency API constants */
#define Filter_KEY_LOW               (0x00u)
#define Filter_KEY_MID               (0x01u)
#define Filter_KEY_HIGH              (0x02u)

/*******************************************************************************
* FILT component macros.
*******************************************************************************/

#define Filter_ClearInterruptSource() \
   (Filter_SR_REG = Filter_ALL_INTR )

#define Filter_IsInterruptChannelA() \
    (Filter_SR_REG & Filter_CHANNEL_A_INTR)

#define Filter_IsInterruptChannelB() \
    (Filter_SR_REG & Filter_CHANNEL_B_INTR)

/*******************************************************************************
* FILT component DFB registers.
*******************************************************************************/

/* DFB Status register */
#define Filter_SR_REG             (* (reg8 *) Filter_DFB__SR)
#define Filter_SR_PTR             (  (reg8 *) Filter_DFB__SR)

/* DFB Control register */
#define Filter_CR_REG             (* (reg8 *) Filter_DFB__CR)
#define Filter_CR_PTR             (  (reg8 *) Filter_DFB__CR)

/*******************************************************************************
* DFB.COHER bit field defines.
*******************************************************************************/

/* STAGEA key coherency mask */
#define Filter_STAGEA_COHER_MASK    (0x03u)
#define Filter_STAGEA_COHER         Filter_STAGEA_COHER_MASK

/* HOLDA key coherency mask */
#define Filter_HOLDA_COHER_MASK     ((uint8)((uint8)0x03u << 4u))
#define Filter_HOLDA_COHER          Filter_HOLDA_COHER_MASK

/* STAGEB key coherency mask */
#define Filter_STAGEB_COHER_MASK    (0x0Cu)
#define Filter_STAGEB_COHER         Filter_STAGEB_COHER_MASK

/* HOLDB key coherency mask */
#define Filter_HOLDB_COHER_MASK     ((uint8)((uint8)0x0Cu << 4u))
#define Filter_HOLDB_COHER          Filter_HOLDB_COHER_MASK

/*******************************************************************************
* DFB.DALIGN bit field defines.
*******************************************************************************/

/* STAGEA dalign mask */
#define Filter_STAGEA_DALIGN    (0x01u)

/* HOLDA dalign mask */
#define Filter_HOLDA_DALIGN     (0x04u)

/* STAGEB dalign mask */
#define Filter_STAGEB_DALIGN    (0x02u)

/* HOLDB dalign mask */
#define Filter_HOLDB_DALIGN     (0x08u)

#endif /* End FILT Header File */

/* [] END OF FILE */


text:
package smpl.quote.repository.model;

import java.util.List;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import smpl.quote.model.Quote;
import smpl.quote.model.QuoteItemInfo;

@Document(collection = "quotes")
public class QuoteDetails
{
    @Id
    private String id;
    @Indexed
    private String quoteId;
    private String validUntil;
    @Indexed
    private String customerName;
    @Indexed
    private String dealerName;
    private QuoteItemInfo[] quoteItems;
//    Front end
    private QuoteItemInfo[] additionalItems;
    private String comments;
    private String terms;
    private String unitDescription;
    private double unitCost;
    private double height;
    private double width;
    private double depth;
    private int unit;
    private String purpose;
    private double ambientPeak;
    private double ambientAverage;
    private boolean buildOnSite;
  //End
    private double totalCost;
    private double discount;
    private String city;
    private String postalCode;
    private String state;

    public QuoteDetails()
    {
    }

    public QuoteDetails(Quote from)
    {
        this.quoteId = from.getQuoteId();
        this.validUntil = from.getValidUntil();
        this.customerName = from.getCustomerName();
        this.dealerName = from.getDealerName();
        this.totalCost = from.getTotalCost();
        this.discount = from.getDiscount();
        this.city = from.getCity();
        this.postalCode = from.getPostalCode();
        this.state = from.getState();

        List<QuoteItemInfo> qi = from.getQuoteItems();
        this.quoteItems = (qi != null && !qi.isEmpty()) ?
        qi.toArray(new QuoteItemInfo[qi.size()]) : new QuoteItemInfo[0];

//        		Front end
        List<QuoteItemInfo> ai = from.getAdditionalItems();
        this.additionalItems = (ai != null && !ai.isEmpty()) ?
        ai.toArray(new QuoteItemInfo[ai.size()]) : new QuoteItemInfo[0];

        this.comments = from.getComments();
        this.terms = from.getTerms();
        this.unitDescription = from.getUnitDescription();
        this.unitCost = from.getUnitCost();
        this.height = from.getHeight();
        this.width = from.getWidth();
        this.depth = from.getDepth();
        this.unit = from.getUnit();
        this.purpose = from.getPurpose();
        this.ambientPeak = from.getAmbientPeak();
        this.ambientAverage = from.getAmbientAverage();
        this.buildOnSite=from.isBuildOnSite();
//        end

    }

    public Quote toQuote()
    {
        Quote result = new Quote();
        result.setQuoteId(quoteId);
        result.setValidUntil(validUntil);
        result.setCustomerName(customerName);
        result.setDealerName(dealerName);
        result.setTotalCost(totalCost);
        result.setDiscount(discount);
        result.setCity(city);
        result.setPostalCode(postalCode);
        result.setState(state);
        if (quoteItems != null)
        {
            for (QuoteItemInfo item : quoteItems)
            {
                result.addQuoteItem(item.getSkuNumber(), item.getAmount());
            }
        }
//        Front End
        if (additionalItems != null)
        {
            for (QuoteItemInfo item : additionalItems)
            {
                result.addAdditionalItem(item.getSkuNumber(), item.getAmount());
            }
        }
        result.setComments(comments);
        result.setTerms(terms);
        result.setUnitDescription(unitDescription);
        result.setUnitCost(unitCost);
        result.setWidth(width);
        result.setHeight(height);
        result.setDepth(depth);
        result.setUnit(unit);
        result.setPurpose(purpose);
        result.setAmbientPeak(ambientPeak);
        result.setAmbientAverage(ambientAverage);
        result.setBuildOnSite(buildOnSite);
//        End

        return result;
    }

    public String getQuoteId()
    {
        return quoteId;
    }

    public String getDealerName()
    {
        return dealerName;
    }

    public String getCustomerName()
    {
        return customerName;
    }

    public String getId()
    {
        return id;
    }

    public void setId(String id)
    {
        this.id = id;
    }

	public String getValidUntil() {
		return validUntil;
	}
	public double getTotalCost() {
		return totalCost;
	}

	public double getDiscount() {
		return discount;
	}

	public String getCity() {
		return city;
	}

	public String getPostalCode() {
		return postalCode;
	}

	public String getState() {
		return state;
	}

	public String getComments() {
		return comments;
	}

	public String getTerms() {
		return terms;
	}

	public String getUnitDescription() {
		return unitDescription;
	}

	public double getUnitCost() {
		return unitCost;
	}

	public double getHeight() {
		return height;
	}

	public double getWidth() {
		return width;
	}

	public double getDepth() {
		return depth;
	}

	public int getUnit() {
		return unit;
	}

	public String getPurpose() {
		return purpose;
	}

	public double getAmbientPeak() {
		return ambientPeak;
	}

	public double getAmbientAverage() {
		return ambientAverage;
	}

	public boolean isBuildOnSite() {
		return buildOnSite;
	}

}


text:
module PayrollHero
  module Api
    module V3

      # Employees Endpoint
      class Employees < BaseGroup
        # implements the interface to get a single Employee record
        #
        # @return [Hashie::Mash]
        # @param [Fixnum|String] id
        # @param [TrueClass|FalseClass] show_tags
        def get(id, show_tags: false)
          params = {
            show_tags: show_tags,
          }
          remove_nil_values_from!(params)
          client.get("/api/v3/employees/#{id}", params)
        end
      end
    end
  end
end


text:
[![Version npm](https://img.shields.io/npm/v/shingle.svg?style=flat-square)](https://www.npmjs.com/package/shingle)[![npm Downloads](https://img.shields.io/npm/dm/shingle.svg?style=flat-square)](https://www.npmjs.com/package/shingle)[![Build Status](https://img.shields.io/travis/tellnes/shingle/master.svg?style=flat-square)](https://travis-ci.org/tellnes/shingle)[![Coverage Status](https://img.shields.io/coveralls/tellnes/shingle/master.svg?style=flat-square)](https://coveralls.io/r/tellnes/shingle?branch=master)[![Dependencies](https://img.shields.io/david/tellnes/shingle.svg?style=flat-square)](https://david-dm.org/tellnes/shingle)[![Tips](http://img.shields.io/gratipay/tellnes.png?style=flat-square)](https://gratipay.com/~tellnes/)

Shingle text

## Usage

```js
var shingle = require('shingle')

console.log( shingle('foo bar baz') )
// outputs [ 'foo', 'foo bar', 'bar', 'bar baz', 'baz' ]
```

Please see `test/simple.js` for more examples.

## Install

    npm install shingle

## License

MIT


text:
from ..scenario_runner import MonotonicScenarioRunner, ScenarioRunner

__all__ = ("ScenarioRunner", "MonotonicScenarioRunner",)


text:
<?xml version="1.0" encoding="UTF-8"?>
<dds xmlns="http://www.omg.org/dds/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="file:DDS_QoSProfile.xsd">
<qos_profile name="DDS GetSetQosProfile">
     <domainparticipant_qos>
          <user_data>
               <value></value>
          </user_data>
          <entity_factory>
               <autoenable_created_entities>true</autoenable_created_entities>
          </entity_factory>
     </domainparticipant_qos>
     <subscriber_qos name="subscriber1">
          <presentation>
               <access_scope>INSTANCE_PRESENTATION_QOS</access_scope>
               <coherent_access>false</coherent_access>
               <ordered_access>false</ordered_access>
          </presentation>
          <partition>
               <name>
                    <element>
						partition1
					</element>
					<element>
						partition2
					</element>
               </name>
          </partition>
          <group_data>
               <value></value>
          </group_data>
          <entity_factory>
               <autoenable_created_entities>true</autoenable_created_entities>
          </entity_factory>
     </subscriber_qos>
     <subscriber_qos name="subscriber2">
          <presentation>
               <access_scope>INSTANCE_PRESENTATION_QOS</access_scope>
               <coherent_access>true</coherent_access>
               <ordered_access>true</ordered_access>
          </presentation>
          <partition>
               <name></name>
          </partition>
          <group_data>
               <value></value>
          </group_data>
          <entity_factory>
               <autoenable_created_entities>true</autoenable_created_entities>
          </entity_factory>
     </subscriber_qos>
     <publisher_qos>
          <presentation>
               <access_scope>INSTANCE_PRESENTATION_QOS</access_scope>
               <coherent_access>true</coherent_access>
               <ordered_access>false</ordered_access>
          </presentation>
			<partition>
				<name>
					<element>
						partition1
					</element>
					<element>
						partition2
					</element>
				</name>
			</partition>
          <group_data>
               <value></value>
          </group_data>
          <entity_factory>
               <autoenable_created_entities>true</autoenable_created_entities>
          </entity_factory>
     </publisher_qos>
</qos_profile>
</dds>


text:
import CodeBlockWriter from "code-block-writer";

export class FunctionBodyWriteableDefinition {
    onWriteFunctionBody: ((writer: CodeBlockWriter) => void) | null;
}


text:
package club.texasholdem.texas.evaluation;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;
import junit.framework.TestCase;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import club.texasholdem.GameLogicException;
import club.texasholdem.card.Card;
import club.texasholdem.texas.Board;
import club.texasholdem.texas.Hand;
import club.texasholdem.texas.HandCombination;

public class HandEvaluatorTest extends TestCase {

	private Hand hand, straightHand, highStraightHand, lowStraightHand, straightWithRiverHighHand, straightWithRiverHand;

	private Board emptyBoard,

	highCardBoard,

	pairBoard,

	twoPairsBoard,

	threeOfAKindBoard,

	straightBoard, highStraightBoard, lowStraightBoard, straightWithRiverHighBoard, straightWithRiverBoard,

	flushBoard,

	fullHouseBoard,

	fourOfAKindBoard,

	straightFlushBoard,

	royalFlushBoard
	;

	@Before
	public void setUp() throws Exception {
		hand = new Hand(Card.EIGHT_OF_SPADES, Card.KING_OF_DIAMONDS);
		straightHand = new Hand(Card.EIGHT_OF_SPADES, Card.JACK_OF_SPADES);
		highStraightHand = new Hand(Card.QUEEN_OF_CLUBS, Card.JACK_OF_SPADES);
		lowStraightHand = new Hand(Card.THREE_OF_CLUBS, Card.FIVE_OF_DIAMONDS);
		straightWithRiverHighHand = new Hand(Card.KING_OF_HEARTS, Card.SIX_OF_HEARTS);
		straightWithRiverHand = new Hand(Card.KING_OF_HEARTS, Card.NINE_OF_DIAMONDS);
		emptyBoard = new Board();
		highCardBoard = Board.unmarshal("Jc,2c,Td");
		pairBoard = Board.unmarshal("8d,7h,2h");
		twoPairsBoard = Board.unmarshal("8d,7h,Ks");
		threeOfAKindBoard = Board.unmarshal("Kc,7h,Ks");
		straightBoard = Board.unmarshal("Ts,Qd,9c");
		highStraightBoard = Board.unmarshal("Ts,Ah,Kd");
		lowStraightBoard = Board.unmarshal("4h,Ac,2s");
		straightWithRiverHighBoard = Board.unmarshal("Jd,3c,Th,Ad,Qs"); // 3c,6h,Th,Jd,Qs,Kh,Ad
		straightWithRiverBoard = Board.unmarshal("Jd,3c,Th,6d,Qs");
		flushBoard = Board.unmarshal("Jd,3d,Th,6d,Qd"); // 8s,Kd,Jd,3d,Th,6d,Qd
		fullHouseBoard = Board.unmarshal("Kc,8h,Ks");
		fourOfAKindBoard = Board.unmarshal("Kc,Kh,Ks");
		straightFlushBoard = Board.unmarshal("6s,9s,7c,7s,Ts"); // 6s, 7s, 7c, 8s, 9s, Ts, Kd
		royalFlushBoard = Board.unmarshal("Qd,Ad,Jd,Jc,Td"); // 8s, Td, Jd, Jc Qd, Kd, Ad
	}

	@Test
	public void testThrowsWithNullHand() {
		try {
			new HandEvaluator(null, highCardBoard);
			fail("Must throw excpetion");
		} catch (Exception e) {
			assertThat(e, instanceOf(GameLogicException.class));
		}
	}

	@Test
	public void testThrowsWithNullBoard() {
		try {
			new HandEvaluator(hand, null);
			fail("Must throw excpetion");
		} catch (Exception e) {
			assertThat(e, instanceOf(GameLogicException.class));
		}
	}

	@Test
	public void testThrowsIfFlopNotDealt() {
		try {
			new HandEvaluator(hand, emptyBoard);
			fail("Must throw excpetion");
		} catch (Exception e) {
			assertThat(e, instanceOf(GameLogicException.class));
		}
	}

	@Test
	public void testHighCard() {
		HandEvaluator evaluator = new HandEvaluator(hand, highCardBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.HIGH_CARD, handRank);
	}

	@Test
	public void testPair() {
		HandEvaluator evaluator = new HandEvaluator(hand, pairBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.PAIR, handRank);
	}

	// TODO two pairs comparison needs to take into account three pairs
	// situation
	@Test
	public void testTwoPairs() {
		HandEvaluator evaluator = new HandEvaluator(hand, twoPairsBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.TWO_PAIRS, handRank);
	}

	@Test
	public void testThreeOfAKind() {
		HandEvaluator evaluator = new HandEvaluator(hand, threeOfAKindBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.THREE_OF_A_KIND, handRank);
	}

	@Test
	public void testStraight() {
		HandEvaluator evaluator = new HandEvaluator(straightHand, straightBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.STRAIGHT, handRank);
	}

	@Test
	public void testLowStraight() {
		HandEvaluator evaluator = new HandEvaluator(lowStraightHand, lowStraightBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.STRAIGHT, handRank);
	}

	@Test
	public void testHighStraight() {
		HandEvaluator evaluator = new HandEvaluator(highStraightHand, highStraightBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.STRAIGHT, handRank);
	}

	@Test
	public void testStraightWithRiverHigh() {
		HandEvaluator evaluator = new HandEvaluator(straightWithRiverHighHand, straightWithRiverHighBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.STRAIGHT, handRank);
	}

	@Test
	public void testStraightWithRiver() {
		HandEvaluator evaluator = new HandEvaluator(straightWithRiverHand, straightWithRiverBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.STRAIGHT, handRank);
	}

	@Test
	public void testFlush() {
		HandEvaluator evaluator = new HandEvaluator(hand, flushBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.FLUSH, handRank);
	}

	@Test
	public void testFullHouse() {
		HandEvaluator evaluator = new HandEvaluator(hand, fullHouseBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.FULL_HOUSE, handRank);
	}

	@Test
	public void testFourOfAKindBoard() {
		HandEvaluator evaluator = new HandEvaluator(hand, fourOfAKindBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.FOUR_OF_A_KIND, handRank);
	}

	@Test
	public void testStraightFlush() {
		HandEvaluator evaluator = new HandEvaluator(hand, straightFlushBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.STRAIGHT_FLUSH, handRank);
	}

	@Test
	public void testRoyalFlush() {
		HandEvaluator evaluator = new HandEvaluator(hand, royalFlushBoard);
		HandCombination handRank = evaluator.getBestCombination();
		assertEquals(HandCombination.ROYAL_FLUSH, handRank);
	}

}


text:
package org.apache.camel.util;

import java.util.Comparator;

import org.apache.camel.Exchange;
import org.apache.camel.Expression;

/**
 * An implementation of {@link Comparator} which takes an {@link Expression} which is evaluated
 * on each exchange to compare
 *
 * @version
 */
public class ExpressionComparator implements Comparator<Exchange> {
    private final Expression expression;

    public ExpressionComparator(Expression expression) {
        this.expression = expression;
    }

    public int compare(Exchange e1, Exchange e2) {
        Object o1 = expression.evaluate(e1, Object.class);
        Object o2 = expression.evaluate(e2, Object.class);
        return ObjectHelper.compare(o1, o2);
    }
}


text:
<?php
/**
 *
 * @author Dirk Merten
 */

namespace tests\dmerten\MessageQueue\Worker;

use dmerten\MessageQueue\Worker\Worker;

class WorkerTest extends \PHPUnit_Framework_TestCase
{

	public function testDispatch()
	{
		$connection = $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPStreamConnection')->disableOriginalConstructor()->getMock();
		$channel = $this->getMockBuilder('\PhpAmqpLib\Channel\AMQPChannel')->disableOriginalConstructor()->getMock();

		$connection->expects($this->once())->method('channel')->will($this->returnValue($channel));
		$dispatcher = $this->getMockBuilder('\dmerten\MessageQueue\Worker\Dispatcher\Dispatcher')->disableOriginalConstructor()->getMock();
		$dispatcher->expects($this->once())->method('dispatch');
		$worker = new Worker($connection, $dispatcher);

		$message = $this->getMockBuilder('\PhpAmqpLib\Message\AMQPMessage')->disableOriginalConstructor()->getMock();

		$message->delivery_info['channel'] = new Foo();
		$message->delivery_info['delivery_tag'] = 'foo';

		$worker->dispatch($message);
	}

	public function testDispatchFailed()
	{
		$connection = $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPStreamConnection')->disableOriginalConstructor()->getMock();
		$channel = $this->getMockBuilder('\PhpAmqpLib\Channel\AMQPChannel')->disableOriginalConstructor()->getMock();

		$connection->expects($this->once())->method('channel')->will($this->returnValue($channel));
		$dispatcher = $this->getMockBuilder('\dmerten\MessageQueue\Worker\Dispatcher\Dispatcher')->disableOriginalConstructor()->getMock();
		$dispatcher->expects($this->once())->method('dispatch')->will($this->throwException(new \RuntimeException()));
		$worker = new Worker($connection, $dispatcher);

		$message = $this->getMockBuilder('\PhpAmqpLib\Message\AMQPMessage')->disableOriginalConstructor()->getMock();

		$message->delivery_info['channel'] = new Foo();
		$message->delivery_info['delivery_tag'] = 'foo';

		$worker->dispatch($message);
	}

}

Class Foo
{
	public function basic_ack()
	{
	}
}


text:
<% include ./template/header.html %>

Index Page

Session Information:

<%- JSON.stringify(session, null, '  ') %>

<% include ./template/footer.html %>


text:
import { Component } from '@angular/core';
import { NavController, NavParams, ToastController, ViewController } from 'ionic-angular';
import { ProdutosClienteService } from '../../providers/produtos-cliente-service';

@Component({
  selector: 'page-produto-detalhes',
  templateUrl: 'produto-detalhes.html'
})
export class ProdutoDetalhesPage {

    produto: any;

  constructor(public navCtrl: NavController,
              public navParams: NavParams,
              public viewCtrl: ViewController,
              public produtosClienteService :ProdutosClienteService,
              public toastCtrl: ToastController) {
    this.produto = navParams;
    this.produto = this.produto.data;
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad ProdutoDetalhesPage');
  }

  addProdutoCesta(produto) : void {

    this.produtosClienteService.get(produto.prod_id).then((res) => {

      if (res !=null) {
        let toast = this.toastCtrl.create({
        message: 'Produto já esta na cesta de compras.',
        duration: 3000
        });
        toast.present();

      } else {
        this.produtosClienteService.addProduto(produto);
        let toast = this.toastCtrl.create({
          message: ''+ produto.prod_nome +' adicionado a cesta de compras.',
          duration: 3000
        });
        toast.present();
      }

      }).catch((err) => {
        console.log(err);
        return false;
      });

  }

  decrementaQtd(produto) : void {
    if (produto.quantidade > 1) {
      this.produto.quantidade = produto.quantidade-1;
    }

  }

  incrementaQtd(produto) : void {
    this.produto.quantidade = produto.quantidade+1;
  }

}


text:
var DROPBOX_APP_KEY = 'bd9wi7q5rooz5gp',
	dropbox = new Dropbox.Client({key: DROPBOX_APP_KEY});


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<title>Class WeeDispatcher | WeePHP API</title>

	<link rel="stylesheet" href="resources/style.css?e99947befd7bf673c6b43ff75e9e0f170c88a60e">

		Overview

Packages

						None

						WeePHP

						Core

						UserLibraries

Classes

WeeController

WeeDispatcher

WeeHooks

WeeModel

WeeReporting

WeeSession

WeeTemplate

WeeTranslator

	<form id="search">
		<input type="hidden" name="cx" value="">
		<input type="hidden" name="ie" value="UTF-8">
		<input type="text" name="q" class="text" placeholder="Search">
	</form>

				Overview

Package

Class

Class WeeDispatcher

WeeDispatcher

Core libray to handle incoming url request

		Package: WeePHP\Core

				Author:
				Hugues Polaert hugues.polaert@gmail.com

				Version:
				0.1

			Located at WeeDispatcher.php

Methods summary

			 public

			WeeDispatcher

		#
		__construct( boolean <var>$internalErrorHandler</var> = FALSE )

Class constructor
Optional argument to use the class externally (internal error handler)

Class constructor
Optional argument to use the class externally (internal error handler)

Parameters

<var>$internalErrorHandler</var>

True when used outside the framework

Returns

					WeeDispatcher

			 public

		#
		attachUrl( string <var>$name</var>, string <var>$uri</var>, string <var>$controller</var>, string <var>$method</var>, string <var>$lang</var> = '' )

Attach URL function
Create a link between an url and its controller/method

Attach URL function
Create a link between an url and its controller/method

Parameters

<var>$name</var>

Route Name

<var>$uri</var>

Url to be catched

<var>$controller</var>

Controller to be called

<var>$method</var>

Method to be called

<var>$lang</var>

(Optional) Lang associated with the route

			 public

		#
		attach404( string <var>$name</var>, string <var>$controller</var>, string <var>$method</var>, string <var>$lang</var> = '' )

Attach 404 URL
Create a link between a 404 page and its controller/method (otherwise throws exception)

Attach 404 URL
Create a link between a 404 page and its controller/method (otherwise throws exception)

Parameters

<var>$name</var>

Route Name

<var>$controller</var>

Controller to be called

<var>$method</var>

Method to be called

<var>$lang</var>

(Optional) Lang associated with the route

			 public

			string

		#
		refresh( string <var>$location</var>, boolean <var>$external</var> = FALSE )

Refresh
To use when content has already been sent

Refresh
To use when content has already been sent

Parameters

<var>$location</var>

Target Location

<var>$external</var>

External or internal redirection

Returns

					string

			 public

			string

		#
		redirect( string <var>$location</var>, boolean <var>$external</var> = FALSE )

Redirect
To use when content has not already been sent

Redirect
To use when content has not already been sent

Parameters

<var>$location</var>

Target Location

<var>$external</var>

External or internal redirection

Returns

					string

			 public

		#
		dispatch( string <var>$url</var> )

Dispatcher
Checks registered routes against the given url

Dispatcher
Checks registered routes against the given url

Parameters

<var>$url</var>

URL to be dispatched

			 public

		#
		instantiate( )

Instantiator
Instantiate the target controller to allow user libs integration

Instantiator
Instantiate the target controller to allow user libs integration

			 public

		#
		run( )

Launcher
Run the application by calling selected controller and method

Launcher
Run the application by calling selected controller and method

			 public

		#
		setInternalErrorHandler( boolean <var>$internalErrorHandler</var> )

Setter error handling mode (either true or false)

Setter error handling mode (either true or false)

Parameters

<var>$internalErrorHandler</var>

Internal Error Handler

			 public

			boolean

		#
		getInternalErrorHandler( )

Getter error handling mode (either true or false)

Getter error handling mode (either true or false)

Returns

					boolean

			 public

		#
		setAppUrl( string <var>$appUrl</var> )

Setter application Url

Setter application Url

Parameters

<var>$appUrl</var>

Application base Url

			 public

			string

		#
		getAppUrl( )

Getter application Url

Getter application Url

Returns

					string

			 public

			string

		#
		getRequestUrl( )

Getter requestUrl

Getter requestUrl

Returns

					string

			 public

		#
		setControllerDir( string <var>$controllerDir</var> )

Setter controllers directory

Setter controllers directory

Parameters

<var>$controllerDir</var>

Controllers  directory

			 public

			string

		#
		getControllerDir( )

Getter controllers directory

Getter controllers directory

Returns

					string

			 public

			array

		#
		getFinalResponse( )

Getter final response

Getter final response

Returns

					array

			 public

			string

		#
		getCurrentRouteLang( )

Getter current route Lang

Getter current route Lang

Returns

					string

			 public

			string

		#
		getCurrentRouteName( )

Getter current route name

Getter current route name

Returns

					string

			 public

			string

		#
		getCurrentRouteController( )

Getter current route controller

Getter current route controller

Returns

					string

			 public

			string

		#
		getCurrentRouteMethod( )

Getter current route method

Getter current route method

Returns

					string

Properties summary

			protected
			array

				<var>$_errors</var>

Array of error codes

Array of error codes

				#
				array()

			protected
			boolean

				<var>$_internalErrorHandler</var>

Internal error handler

Internal error handler

				#

			protected
			string

				<var>$_controllerDir</var>

Controllers Directory

Controllers Directory

				#

			protected
			string

				<var>$_appUrl</var>

Application URL

Application URL

				#

			protected
			array

				<var>$_varTypes</var>

Routes accepted var types

Routes accepted var types

				#
				array()

			protected
			array

				<var>$_finalResponse</var>

Array of the final response (Lang, Controller, Methods, Args, RouteName)

Array of the final response (Lang, Controller, Methods, Args, RouteName)

				#
				array()

			protected
			object

				<var>$_controllerInstance</var>

Instantiated controller

Instantiated controller

				#

			protected
			string

				<var>$_requestUrl</var>

Request url without get var

Request url without get var

				#

			protected
			array

				<var>$_staticRoutes</var>

Static routes (without any dynamic elements

Static routes (without any dynamic elements

				#
				array()

			protected
			array

				<var>$_dynamicRoutes</var>

Array (nbOfElements, array(element1, element2))

Array (nbOfElements, array(element1, element2))

				#
				array()

			protected
			array

				<var>$_routeParams</var>

Store controller (1), method (2), optional lang (3)

Store controller (1), method (2), optional lang (3)

				#
				array()

			protected
			array

				<var>$_routes</var>

Routes name array

Routes name array

				#
				array()

			protected
			array

				<var>$_404</var>

404 Page storage

404 Page storage

				#
				array()

		WeePHP API API documentation generated by ApiGen


text:
<?php

declare(strict_types=1);

namespace Contentful\ContentfulBundle\Command\Delivery;

use Contentful\Core\Resource\ResourceArray;
use Contentful\Delivery\Client;
use Contentful\Delivery\Query;
use Contentful\Delivery\Resource\ContentType;
use Contentful\Delivery\Resource\Locale;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

class DebugCommand extends Command
{
    /**
     * @var Client[]
     */
    private $clients;

    /**
     * DebugCommand constructor.
     *
     * @param Client[] $clients        This is actually a Generator, but it behaves as an array of Client objects
     * @param array    $configurations
     */
    public function __construct($clients, $configurations = [])
    {
        parent::__construct();

        $availableNames = \array_keys($configurations);
        foreach ($clients as $index => $client) {
            $name = \array_shift($availableNames);
            $this->clients[$name] = $client;
        }

        $this->setName('contentful:delivery:debug');
        $this->setDescription('Shows information about data coming from a certain client');
        $this->addArgument(
            'client-name',
            \is_array($this->clients) && \count($this->clients) > 1 ? InputArgument::REQUIRED : InputArgument::OPTIONAL,
            'The name of the client to use'
        );
    }

    /**
     * {@inheritdoc}
     */
    public function execute(InputInterface $input, OutputInterface $output): int
    {
        $io = new SymfonyStyle($input, $output);

        $name = $input->getArgument('client-name');
        if (!$name && 1 === \count($this->clients)) {
            $name = \array_keys($this->clients)[0];
        }

        if (!isset($this->clients[$name])) {
            throw new InvalidArgumentException(\sprintf('Could not find the requested client "%s", use "contentful:delivery:info" to check the configured clients.', $name));
        }

        $client = $this->clients[$name];

        try {
            $space = $client->getSpace();
            $environment = $client->getEnvironment();
            $query = (new Query())
                ->setLimit(1000)
            ;
            /** @var ContentType[]|ResourceArray $contentTypes */
            $contentTypes = $client->getContentTypes($query);
            $entries = [];
            foreach ($contentTypes as $contentType) {
                $query = (new Query())
                    ->setLimit(1)
                    ->setContentType($contentType->getId())
                ;
                $entries[$contentType->getId()] = $client->getEntries($query)->getTotal();
            }
        } catch (\Exception $exception) {
            throw new RuntimeException('Requested service was found, but data could not be loaded. Try checking client credentials.', 0, $exception);
        }

        $io->title('Debug client');
        $io->text('Full service ID: contentful.delivery.'.$name.'_client');

        $io->section('Space');
        $io->text($space->getName());
        $io->comment('https://app.contentful.com/spaces/'.$space->getId().'/environments/'.$environment->getId());

        $io->section(\sprintf(
            'Locales (%d)',
            \count($environment->getLocales())
        ));
        $data = \array_map(function (Locale $locale) {
            return [
                $locale->getId(),
                $locale->getName(),
                $locale->getCode(),
                $locale->getFallbackCode(),
            ];
        }, $environment->getLocales());
        $io->table(
            ['ID', 'Name', 'Code', 'Fallback Code'],
            $data
        );
        $io->comment('https://app.contentful.com/spaces/'.$space->getId().'/environments/'.$environment->getId().'/locales');

        $io->section(\sprintf(
            'Content types (%d)',
            \count($contentTypes)
        ));
        $data = \array_map(function (ContentType $contentType) use ($entries) {
            return [
                $contentType->getId(),
                $contentType->getName(),
                \count($contentType->getFields()),
                $entries[$contentType->getId()],
                $contentType->getDescription(),
            ];
        }, $contentTypes->getItems());
        $io->table(
            ['ID', 'Name', 'Fields', 'Entries', 'Description'],
            $data
        );
        $io->comment('https://app.contentful.com/spaces/'.$space->getId().'/environments/'.$environment->getId().'/content_types');

        return 0;
    }
}


text:
package com.github.florent37.expectanim.core.rotation;

import androidx.annotation.Nullable;
import android.view.View;

/**
 * Created by Christian Ringshofer on 17/02/2017.
 * <p>
 * A container for storing the rotation values for the flip animation
 */
public class RotationFlipExpectationValue extends RotationExpectation {

    private final float mRotationX, mRotationY;

    /**
     * a new flip expectation value which can be used to flip the view on the x- and y- axis
     * at the same time
     *
     * @param rotationX the x-rotation value around the x axis in degrees
     * @param rotationY the y-rotation value around the y axis in degrees
     */
    public RotationFlipExpectationValue(float rotationX, float rotationY) {
        mRotationX = rotationX;
        mRotationY = rotationY;
    }

    @Override
    public Float getCalculatedRotation(View viewToMove) {
        return null;
    }

    @Override
    @Nullable
    public Float getCalculatedRotationX(View viewToMove) {
        return mRotationX;
    }

    @Override
    @Nullable
    public Float getCalculatedRotationY(View viewToMove) {
        return mRotationY;
    }

}


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateEmployeeInformationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        if (!Schema::hasTable('employee_information')) {
            Schema::create('employee_information', function (Blueprint $table) {
                $table->increments('id');
                $table->string('employee_number', 32);
                $table->string('last_name', 32);
                $table->string('first_name', 32);
                $table->string('middle_name', 32);
                $table->enum('gender', ['Male', 'Female']);
                $table->enum('marital_status', ['Single', 'Married', 'Separated', 'Widowed']);
                $table->date('birthdate');
                $table->enum('employee_status', [
                    'Trainee',
                    'Probationary',
                    'Regular',
                    'Officer',
                    'Freelance',
                    'Terminated',
                    'Resigned',
                    'Contractual',
                    'Retired',
                    'End of Contract',
                    'Consultant',
                    'Project',
                    'Transferred',
                    'Deceased'
                ]);
                $table->date('date_hired');
                $table->date('date_regularized')->nullable();
                $table->integer('department_id');
                $table->integer('team_id');
                $table->string('created_by', 32);
                $table->timestamps();
                $table->index(['last_name']);
                $table->index(['department_id']);
                $table->index(['team_id']);
                $table->unique(['last_name', 'first_name', 'middle_name']);
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('employee_information');
    }
}


text:
class Engine {
public:
    virtual int bind() = 0;
	virtual ~Engine() {};
};