text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />

/**
 * @private
 * Small utility class used internally to represent a Direct method.
 */
Ext.define('Ext.direct.RemotingMethod', {

    constructor: function(config) {
        var me = this,
            params = Ext.isDefined(config.params) ? config.params : config.len,
            name, pLen, p, param;

        me.name = config.name;
        me.formHandler = config.formHandler;

        if (Ext.isNumeric(params)) {
            // given only the number of parameters
            me.len = params;
            me.ordered = true;
        }
        else {
            /*
             * Given an array of either
             * a) String
             * b) Objects with a name property. We may want to encode extra info in here later
             */
            me.params = {};
			pLen = params.length;

            for (p = 0; p < pLen; p++) {
                param = params[p];
                name  = Ext.isObject(param) ? param.name : param;
                me.params[name] = true;
            }
        }
    },

    getArgs: function(params, paramOrder, paramsAsHash) {
        var me = this,
            args = [],
            i, len;

        if (me.ordered) {
            if (me.len > 0) {
                // If a paramOrder was specified, add the params into the argument list in that order.
                if (paramOrder) {
                    for (i = 0, len = paramOrder.length; i < len; i++) {
                        args.push(params[paramOrder[i]]);
                    }
                }
                else if (paramsAsHash) {
                    // If paramsAsHash was specified, add all the params as a single object argument.
                    args.push(params);
                }
            }
        }
        else {
            args.push(params);
        }

        return args;
    },

    /**
     * Takes the arguments for the Direct function and splits the arguments
     * from the scope and the callback.
     *
     * @param {Array} args The arguments passed to the direct call
     *
     * @return {Object} An object with 3 properties: args, callback & scope.
     */
    getCallData: function(args) {
        var me = this,
            data = null,
            len  = me.len,
            params = me.params,
            callback, scope, name, options;

        if (me.ordered) {
            callback = args[len];
            scope    = args[len + 1];
            options  = args[len + 2];

            if (len !== 0) {
                data = args.slice(0, len);
            }
        }
        else {
            data     = Ext.apply({}, args[0]);
            callback = args[1];
            scope    = args[2];
            options  = args[3];

            // filter out any non-existent properties
            for (name in data) {
                if (data.hasOwnProperty(name) && !params[name]) {
                    delete data[name];
                }
            }
        }

        return {
            data: data,
            callback: callback,
            scope: scope,
            options: options
        };
    }
});


text:
#pragma once
#include <aws/ssm/SSM_EXPORTS.h>
#include <aws/ssm/SSMRequest.h>
#include <aws/ssm/model/ResourceTypeForTagging.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/ssm/model/Tag.h>
#include <utility>

namespace Aws
{
namespace SSM
{
namespace Model
{

  /**
   */
  class AWS_SSM_API AddTagsToResourceRequest : public SSMRequest
  {
  public:
    AddTagsToResourceRequest();

    // 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 "AddTagsToResource"; }

    Aws::String SerializePayload() const override;

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

    /**
     *
Specifies the type of resource you are tagging.

The
     * ManagedInstance type for this API operation is for on-premises
     * managed nodes. You must specify the name of the managed node in the following
     * format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline const ResourceTypeForTagging& GetResourceType() const{ return m_resourceType; }

    /**
     *
Specifies the type of resource you are tagging.

The
     * ManagedInstance type for this API operation is for on-premises
     * managed nodes. You must specify the name of the managed node in the following
     * format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline bool ResourceTypeHasBeenSet() const { return m_resourceTypeHasBeenSet; }

    /**
     *
Specifies the type of resource you are tagging.

The
     * ManagedInstance type for this API operation is for on-premises
     * managed nodes. You must specify the name of the managed node in the following
     * format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline void SetResourceType(const ResourceTypeForTagging& value) { m_resourceTypeHasBeenSet = true; m_resourceType = value; }

    /**
     *
Specifies the type of resource you are tagging.

The
     * ManagedInstance type for this API operation is for on-premises
     * managed nodes. You must specify the name of the managed node in the following
     * format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline void SetResourceType(ResourceTypeForTagging&& value) { m_resourceTypeHasBeenSet = true; m_resourceType = std::move(value); }

    /**
     *
Specifies the type of resource you are tagging.

The
     * ManagedInstance type for this API operation is for on-premises
     * managed nodes. You must specify the name of the managed node in the following
     * format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline AddTagsToResourceRequest& WithResourceType(const ResourceTypeForTagging& value) { SetResourceType(value); return *this;}

    /**
     *
Specifies the type of resource you are tagging.

The
     * ManagedInstance type for this API operation is for on-premises
     * managed nodes. You must specify the name of the managed node in the following
     * format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline AddTagsToResourceRequest& WithResourceType(ResourceTypeForTagging&& value) { SetResourceType(std::move(value)); return *this;}

    /**
     *
The resource ID you want to tag.

Use the ID of the resource. Here are
     * some examples:

 MaintenanceWindow:
     * mw-012345abcde

 PatchBaseline:
     * pb-012345abcde

 Automation:
     * example-c160-4567-8519-012345abcde

     * OpsMetadata object: ResourceID for tagging is created
     * from the Amazon Resource Name (ARN) for the object. Specifically,
     * ResourceID is created from the strings that come after the word
     * opsmetadata in the ARN. For example, an OpsMetadata object with an
     * ARN of
     * arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager
     * has a ResourceID of either aws/ssm/MyGroup/appmanager
     * or /aws/ssm/MyGroup/appmanager.

For the
     * Document and Parameter values, use the name of the
     * resource.

 ManagedInstance: mi-012345abcde

     *
The ManagedInstance type for this API operation is only
     * for on-premises managed nodes. You must specify the name of the managed node in
     * the following format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline const Aws::String& GetResourceId() const{ return m_resourceId; }

    /**
     *
The resource ID you want to tag.

Use the ID of the resource. Here are
     * some examples:

 MaintenanceWindow:
     * mw-012345abcde

 PatchBaseline:
     * pb-012345abcde

 Automation:
     * example-c160-4567-8519-012345abcde

     * OpsMetadata object: ResourceID for tagging is created
     * from the Amazon Resource Name (ARN) for the object. Specifically,
     * ResourceID is created from the strings that come after the word
     * opsmetadata in the ARN. For example, an OpsMetadata object with an
     * ARN of
     * arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager
     * has a ResourceID of either aws/ssm/MyGroup/appmanager
     * or /aws/ssm/MyGroup/appmanager.

For the
     * Document and Parameter values, use the name of the
     * resource.

 ManagedInstance: mi-012345abcde

     *
The ManagedInstance type for this API operation is only
     * for on-premises managed nodes. You must specify the name of the managed node in
     * the following format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline bool ResourceIdHasBeenSet() const { return m_resourceIdHasBeenSet; }

    /**
     *
The resource ID you want to tag.

Use the ID of the resource. Here are
     * some examples:

 MaintenanceWindow:
     * mw-012345abcde

 PatchBaseline:
     * pb-012345abcde

 Automation:
     * example-c160-4567-8519-012345abcde

     * OpsMetadata object: ResourceID for tagging is created
     * from the Amazon Resource Name (ARN) for the object. Specifically,
     * ResourceID is created from the strings that come after the word
     * opsmetadata in the ARN. For example, an OpsMetadata object with an
     * ARN of
     * arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager
     * has a ResourceID of either aws/ssm/MyGroup/appmanager
     * or /aws/ssm/MyGroup/appmanager.

For the
     * Document and Parameter values, use the name of the
     * resource.

 ManagedInstance: mi-012345abcde

     *
The ManagedInstance type for this API operation is only
     * for on-premises managed nodes. You must specify the name of the managed node in
     * the following format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline void SetResourceId(const Aws::String& value) { m_resourceIdHasBeenSet = true; m_resourceId = value; }

    /**
     *
The resource ID you want to tag.

Use the ID of the resource. Here are
     * some examples:

 MaintenanceWindow:
     * mw-012345abcde

 PatchBaseline:
     * pb-012345abcde

 Automation:
     * example-c160-4567-8519-012345abcde

     * OpsMetadata object: ResourceID for tagging is created
     * from the Amazon Resource Name (ARN) for the object. Specifically,
     * ResourceID is created from the strings that come after the word
     * opsmetadata in the ARN. For example, an OpsMetadata object with an
     * ARN of
     * arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager
     * has a ResourceID of either aws/ssm/MyGroup/appmanager
     * or /aws/ssm/MyGroup/appmanager.

For the
     * Document and Parameter values, use the name of the
     * resource.

 ManagedInstance: mi-012345abcde

     *
The ManagedInstance type for this API operation is only
     * for on-premises managed nodes. You must specify the name of the managed node in
     * the following format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline void SetResourceId(Aws::String&& value) { m_resourceIdHasBeenSet = true; m_resourceId = std::move(value); }

    /**
     *
The resource ID you want to tag.

Use the ID of the resource. Here are
     * some examples:

 MaintenanceWindow:
     * mw-012345abcde

 PatchBaseline:
     * pb-012345abcde

 Automation:
     * example-c160-4567-8519-012345abcde

     * OpsMetadata object: ResourceID for tagging is created
     * from the Amazon Resource Name (ARN) for the object. Specifically,
     * ResourceID is created from the strings that come after the word
     * opsmetadata in the ARN. For example, an OpsMetadata object with an
     * ARN of
     * arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager
     * has a ResourceID of either aws/ssm/MyGroup/appmanager
     * or /aws/ssm/MyGroup/appmanager.

For the
     * Document and Parameter values, use the name of the
     * resource.

 ManagedInstance: mi-012345abcde

     *
The ManagedInstance type for this API operation is only
     * for on-premises managed nodes. You must specify the name of the managed node in
     * the following format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline void SetResourceId(const char* value) { m_resourceIdHasBeenSet = true; m_resourceId.assign(value); }

    /**
     *
The resource ID you want to tag.

Use the ID of the resource. Here are
     * some examples:

 MaintenanceWindow:
     * mw-012345abcde

 PatchBaseline:
     * pb-012345abcde

 Automation:
     * example-c160-4567-8519-012345abcde

     * OpsMetadata object: ResourceID for tagging is created
     * from the Amazon Resource Name (ARN) for the object. Specifically,
     * ResourceID is created from the strings that come after the word
     * opsmetadata in the ARN. For example, an OpsMetadata object with an
     * ARN of
     * arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager
     * has a ResourceID of either aws/ssm/MyGroup/appmanager
     * or /aws/ssm/MyGroup/appmanager.

For the
     * Document and Parameter values, use the name of the
     * resource.

 ManagedInstance: mi-012345abcde

     *
The ManagedInstance type for this API operation is only
     * for on-premises managed nodes. You must specify the name of the managed node in
     * the following format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline AddTagsToResourceRequest& WithResourceId(const Aws::String& value) { SetResourceId(value); return *this;}

    /**
     *
The resource ID you want to tag.

Use the ID of the resource. Here are
     * some examples:

 MaintenanceWindow:
     * mw-012345abcde

 PatchBaseline:
     * pb-012345abcde

 Automation:
     * example-c160-4567-8519-012345abcde

     * OpsMetadata object: ResourceID for tagging is created
     * from the Amazon Resource Name (ARN) for the object. Specifically,
     * ResourceID is created from the strings that come after the word
     * opsmetadata in the ARN. For example, an OpsMetadata object with an
     * ARN of
     * arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager
     * has a ResourceID of either aws/ssm/MyGroup/appmanager
     * or /aws/ssm/MyGroup/appmanager.

For the
     * Document and Parameter values, use the name of the
     * resource.

 ManagedInstance: mi-012345abcde

     *
The ManagedInstance type for this API operation is only
     * for on-premises managed nodes. You must specify the name of the managed node in
     * the following format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline AddTagsToResourceRequest& WithResourceId(Aws::String&& value) { SetResourceId(std::move(value)); return *this;}

    /**
     *
The resource ID you want to tag.

Use the ID of the resource. Here are
     * some examples:

 MaintenanceWindow:
     * mw-012345abcde

 PatchBaseline:
     * pb-012345abcde

 Automation:
     * example-c160-4567-8519-012345abcde

     * OpsMetadata object: ResourceID for tagging is created
     * from the Amazon Resource Name (ARN) for the object. Specifically,
     * ResourceID is created from the strings that come after the word
     * opsmetadata in the ARN. For example, an OpsMetadata object with an
     * ARN of
     * arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager
     * has a ResourceID of either aws/ssm/MyGroup/appmanager
     * or /aws/ssm/MyGroup/appmanager.

For the
     * Document and Parameter values, use the name of the
     * resource.

 ManagedInstance: mi-012345abcde

     *
The ManagedInstance type for this API operation is only
     * for on-premises managed nodes. You must specify the name of the managed node in
     * the following format: mi-ID_number . For example,
     * mi-1a2b3c4d5e6f.

     */
    inline AddTagsToResourceRequest& WithResourceId(const char* value) { SetResourceId(value); return *this;}

    /**
     *
One or more tags. The value parameter is required.

Don't
     * enter personally identifiable information in this field.

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

    /**
     *
One or more tags. The value parameter is required.

Don't
     * enter personally identifiable information in this field.

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

    /**
     *
One or more tags. The value parameter is required.

Don't
     * enter personally identifiable information in this field.

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

    /**
     *
One or more tags. The value parameter is required.

Don't
     * enter personally identifiable information in this field.

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

    /**
     *
One or more tags. The value parameter is required.

Don't
     * enter personally identifiable information in this field.

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

    /**
     *
One or more tags. The value parameter is required.

Don't
     * enter personally identifiable information in this field.

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

    /**
     *
One or more tags. The value parameter is required.

Don't
     * enter personally identifiable information in this field.

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

    /**
     *
One or more tags. The value parameter is required.

Don't
     * enter personally identifiable information in this field.

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

  private:

    ResourceTypeForTagging m_resourceType;
    bool m_resourceTypeHasBeenSet;

    Aws::String m_resourceId;
    bool m_resourceIdHasBeenSet;

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

} // namespace Model
} // namespace SSM
} // namespace Aws

redpajama_set_name: RedPajamaGithub


text:
#pragma once
#include <aws/cognito-idp/CognitoIdentityProvider_EXPORTS.h>
#include <aws/cognito-idp/model/CodeDeliveryDetailsType.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace CognitoIdentityProvider
{
namespace Model
{
  /**
   *
Respresents the response from the server regarding the request to reset a
   * password.

See Also:
   AWS
   * API Reference

   */
  class AWS_COGNITOIDENTITYPROVIDER_API ForgotPasswordResult
  {
  public:
    ForgotPasswordResult();
    ForgotPasswordResult(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    ForgotPasswordResult& operator=(const AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The code delivery details returned by the server in response to the request
     * to reset a password.

     */
    inline const CodeDeliveryDetailsType& GetCodeDeliveryDetails() const{ return m_codeDeliveryDetails; }

    /**
     *
The code delivery details returned by the server in response to the request
     * to reset a password.

     */
    inline void SetCodeDeliveryDetails(const CodeDeliveryDetailsType& value) { m_codeDeliveryDetails = value; }

    /**
     *
The code delivery details returned by the server in response to the request
     * to reset a password.

     */
    inline void SetCodeDeliveryDetails(CodeDeliveryDetailsType&& value) { m_codeDeliveryDetails = std::move(value); }

    /**
     *
The code delivery details returned by the server in response to the request
     * to reset a password.

     */
    inline ForgotPasswordResult& WithCodeDeliveryDetails(const CodeDeliveryDetailsType& value) { SetCodeDeliveryDetails(value); return *this;}

    /**
     *
The code delivery details returned by the server in response to the request
     * to reset a password.

     */
    inline ForgotPasswordResult& WithCodeDeliveryDetails(CodeDeliveryDetailsType&& value) { SetCodeDeliveryDetails(std::move(value)); return *this;}

  private:
    CodeDeliveryDetailsType m_codeDeliveryDetails;
  };

} // namespace Model
} // namespace CognitoIdentityProvider
} // namespace Aws


text:
/*
 * Copyright (c) 2007 Xilinx, Inc.  All rights reserved.
 *
 * Xilinx, Inc.
 * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
 * COURTESY TO YOU.  BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
 * ONE POSSIBLE   IMPLEMENTATION OF THIS FEATURE, APPLICATION OR
 * STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION
 * IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE
 * FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
 * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
 * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO
 * ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE
 * FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 */

#ifndef __ARCH_CPU_H__
#define __ARCH_CPU_H__

#include "lwipopts.h"

#ifdef PROCESSOR_LITTLE_ENDIAN
#define BYTE_ORDER LITTLE_ENDIAN
#else
#define BYTE_ORDER BIG_ENDIAN
#endif

#endif /* __ARCH_CPU_H__ */


text:
#import <Foundation/Foundation.h>
#import "YapDatabaseExtensionConnection.h"

@class YapDatabaseSecondaryIndex;

@interface YapDatabaseSecondaryIndexConnection : YapDatabaseExtensionConnection

/**
 * Returns the parent instance.
**/
@property (nonatomic, strong, readonly) YapDatabaseSecondaryIndex *secondaryIndex;

/**
 * The queryCache speeds up the transaction methods. (enumerateXMatchingQuery:usingBlock:)
 *
 * In order for a query to be executed, it first has to be compiled by SQLite into an executable routine.
 * The queryCache stores these compiled reusable routines, so that repeated queries can be executed faster.
 *
 * Please note that, in terms of caching, only the queryString matters. The queryParameters do not.
 * That is, if you use the same queryString over and over, but with different parameters,
 * you will get a nice benefit from caching as it will be able to recyle the compiled routine,
 * and simply bind the different parameters each time.
 *
 * By default the queryCache is enabled and has a limit of 10.
 *
 * To disable the cache entirely, set queryCacheEnabled to NO.
 * To use an inifinite cache size, set the queryCacheLimit to ZERO.
**/
@property (atomic, assign, readwrite) BOOL queryCacheEnabled;
@property (atomic, assign, readwrite) NSUInteger queryCacheLimit;

@end


text:
static int vm_cachecall(message *m, int call, void *addr, dev_t dev,
	off_t dev_offset, ino_t ino, off_t ino_offset, u32_t *flags,
	int blocksize, int setflags)
{
    if(blocksize % PAGE_SIZE)
    	panic("blocksize %d should be a multiple of pagesize %d\n",
		blocksize, PAGE_SIZE);

    if(ino_offset % PAGE_SIZE)
    	panic("inode offset %lld should be a multiple of pagesize %d\n",
		ino_offset, PAGE_SIZE);

    if(dev_offset % PAGE_SIZE)
    	panic("dev offset offset %lld should be a multiple of pagesize %d\n",
		dev_offset, PAGE_SIZE);

    memset(m, 0, sizeof(*m));

    assert(dev != NO_DEV);

    m->m_vmmcp.dev_offset = dev_offset;
    m->m_vmmcp.ino_offset = ino_offset;
    m->m_vmmcp.ino = ino;
    m->m_vmmcp.block = addr;
    m->m_vmmcp.flags_ptr = flags;
    m->m_vmmcp.dev = dev;
    m->m_vmmcp.pages = blocksize / PAGE_SIZE;
    m->m_vmmcp.flags = setflags;

    return _taskcall(VM_PROC_NR, call, m);
}

void *vm_map_cacheblock(dev_t dev, off_t dev_offset,
	ino_t ino, off_t ino_offset, u32_t *flags, int blocksize)
{
	message m;

	if(vm_cachecall(&m, VM_MAPCACHEPAGE, NULL, dev, dev_offset,
		ino, ino_offset, flags, blocksize, 0) != OK)
		return MAP_FAILED;

	return m.m_vmmcp_reply.addr;
}

int vm_set_cacheblock(void *block, dev_t dev, off_t dev_offset,
	ino_t ino, off_t ino_offset, u32_t *flags, int blocksize, int setflags)
{
	message m;

	return vm_cachecall(&m, VM_SETCACHEPAGE, block, dev, dev_offset,
		ino, ino_offset, flags, blocksize, setflags);
}

int
vm_clear_cache(dev_t dev)
{
	message m;

	assert(dev != NO_DEV);

	memset(&m, 0, sizeof(m));

	m.m_vmmcp.dev = dev;

	return _taskcall(VM_PROC_NR, VM_CLEARCACHE, &m);
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>eContract Badak NGL</title>

  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

  <link rel="stylesheet" href="../../bootstrap/css/bootstrap.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">

  <link rel="stylesheet" href="../../plugins/jvectormap/jquery-jvectormap-1.2.2.css">

  <link rel="stylesheet" href="../../dist/css/AdminLTE.min.css">

  <link rel="stylesheet" href="../../dist/css/skins/_all-skins.min.css">

  <link rel="stylesheet" href="../../plugins/datatables/dataTables.bootstrap.css">

        eContract

          Toggle navigation

                CE/LCE

                    CE/LCE

                    Profile

                    Sign out

CE/LCE

Menu Process

       Dashboard

      Contract Order

 Contract

 Bidder List

 Prebid Meeting

 Harga Perkiraan Sendiri

 Evaluasi Administrasi

 Evaluasi Teknis

 Evaluasi Komersial

 LoA

 Kick-of-meeting

 LoI

 Kontrak

 CoC

       VO

        new

       Report

        new

       Report

        new

      Letter of Intent

 Contract Order

Letter of Intent

CA-17001

Detail Proyek dan Bidder Pemenang

Nomor PO Service

098776

Judul Pekerjaan

Jasa Pemborongan Pekerjaan Pembuangan Sampah, Drum Bekas, Pemeliharaan Taman dan Kebersihan Lingkungan di Area Zone-I & II di PT Badak NGL Bontang, Paket "B" Tahun 2017"

Nilai PO Service

Rp. 400.000.000,-

Durasi Kontrak

Durasi : 4 Bulan

Mulai : 17 September 2016

Selesai : 10 Januari 2017

Nama Perusahaan

PT Nur Maulana

Alamat Perusahaan

Jl. Anggrek I RT 37 No 43, Bukit Indah, Bontang – Kalimantan Timur

Nama Pimpinan

Setyassid Novian Putra D

          <button type="button" class="btn btn-default btn-sm pull right"> Download</button>
          <button type="button" class="btn btn-success btn-sm pull right"> Cetak</button>

    Version 2.3.12

  Copyright © 2017 PT Badak NGL. All rights reserved.

Apakah anda yakin untuk mencetak dokumen Letter of Intent ini?

						<button type="button" class="btn pull-left" data-dismiss="modal">Tidak</button>
						<button type="submit" class="btn btn-success">Ya</button>


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

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

import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.services.rds.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.StringUtils;

/**
 * Create D B Instance Request Marshaller
 */
public class CreateDBInstanceRequestMarshaller implements Marshaller<Request<CreateDBInstanceRequest>, CreateDBInstanceRequest> {

    public Request<CreateDBInstanceRequest> marshall(CreateDBInstanceRequest createDBInstanceRequest) {
        Request<CreateDBInstanceRequest> request = new DefaultRequest<CreateDBInstanceRequest>(createDBInstanceRequest, "AmazonRDS");
        request.addParameter("Action", "CreateDBInstance");
        request.addParameter("Version", "2010-07-28");
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getDBName() != null) {
                request.addParameter("DBName", StringUtils.fromString(createDBInstanceRequest.getDBName()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getDBInstanceIdentifier() != null) {
                request.addParameter("DBInstanceIdentifier", StringUtils.fromString(createDBInstanceRequest.getDBInstanceIdentifier()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getAllocatedStorage() != null) {
                request.addParameter("AllocatedStorage", StringUtils.fromInteger(createDBInstanceRequest.getAllocatedStorage()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getDBInstanceClass() != null) {
                request.addParameter("DBInstanceClass", StringUtils.fromString(createDBInstanceRequest.getDBInstanceClass()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getEngine() != null) {
                request.addParameter("Engine", StringUtils.fromString(createDBInstanceRequest.getEngine()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getMasterUsername() != null) {
                request.addParameter("MasterUsername", StringUtils.fromString(createDBInstanceRequest.getMasterUsername()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getMasterUserPassword() != null) {
                request.addParameter("MasterUserPassword", StringUtils.fromString(createDBInstanceRequest.getMasterUserPassword()));
            }
        }
        if (createDBInstanceRequest != null) {
            java.util.List<String> dBSecurityGroupsList = createDBInstanceRequest.getDBSecurityGroups();
            int dBSecurityGroupsListIndex = 1;

            for (String dBSecurityGroupsListValue : dBSecurityGroupsList) {
                if (dBSecurityGroupsListValue != null) {
                    request.addParameter("DBSecurityGroups.member." + dBSecurityGroupsListIndex, StringUtils.fromString(dBSecurityGroupsListValue));
                }
                dBSecurityGroupsListIndex++;
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getAvailabilityZone() != null) {
                request.addParameter("AvailabilityZone", StringUtils.fromString(createDBInstanceRequest.getAvailabilityZone()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getPreferredMaintenanceWindow() != null) {
                request.addParameter("PreferredMaintenanceWindow", StringUtils.fromString(createDBInstanceRequest.getPreferredMaintenanceWindow()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getDBParameterGroupName() != null) {
                request.addParameter("DBParameterGroupName", StringUtils.fromString(createDBInstanceRequest.getDBParameterGroupName()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getBackupRetentionPeriod() != null) {
                request.addParameter("BackupRetentionPeriod", StringUtils.fromInteger(createDBInstanceRequest.getBackupRetentionPeriod()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getPreferredBackupWindow() != null) {
                request.addParameter("PreferredBackupWindow", StringUtils.fromString(createDBInstanceRequest.getPreferredBackupWindow()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getPort() != null) {
                request.addParameter("Port", StringUtils.fromInteger(createDBInstanceRequest.getPort()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.isMultiAZ() != null) {
                request.addParameter("MultiAZ", StringUtils.fromBoolean(createDBInstanceRequest.isMultiAZ()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.getEngineVersion() != null) {
                request.addParameter("EngineVersion", StringUtils.fromString(createDBInstanceRequest.getEngineVersion()));
            }
        }
        if (createDBInstanceRequest != null) {
            if (createDBInstanceRequest.isAutoMinorVersionUpgrade() != null) {
                request.addParameter("AutoMinorVersionUpgrade", StringUtils.fromBoolean(createDBInstanceRequest.isAutoMinorVersionUpgrade()));
            }
        }

        return request;
    }
}


text:
package libkb

import (
	"encoding/hex"
	"fmt"

	keybase1 "github.com/keybase/client/go/protocol/keybase1"
	jsonw "github.com/keybase/go-jsonw"
)

// Delegator
//
// Delegates authority to another key.
//

type Delegator struct {
	Contextified

	// Set these fields
	NewKey               GenericKey
	ExistingKey          GenericKey
	EldestKID            keybase1.KID
	Me                   *User
	Expire               int
	Device               *Device
	RevSig               string
	ServerHalf           []byte
	EncodedPrivateKey    string
	Ctime                int64
	DelegationType       DelegationType
	Aggregated           bool // During aggregation we skip some steps (posting, updating some state)
	PerUserKeyGeneration keybase1.PerUserKeyGeneration
	MerkleRoot           *MerkleRoot

	// Optional precalculated values used by KeyProof
	Seqno       keybase1.Seqno // kex2 HandleDidCounterSign needs to sign subkey without a user but we know what the last seqno was
	PrevLinkID  LinkID         // kex2 HandleDidCounterSign calculates previous link id without a user
	SigningUser UserBasic      // kex2 doesn't have a full user, but does have basic user info

	// Internal fields
	proof        *ProofMetadataRes
	sig          string
	sigID        keybase1.SigID
	linkID       LinkID
	merkleTriple MerkleTriple
	postArg      APIArg
}

func (d Delegator) getSigningKID() keybase1.KID { return d.GetSigningKey().GetKID() }

func (d Delegator) getExistingKID() (kid keybase1.KID) {
	if d.ExistingKey == nil {
		return
	}
	return d.ExistingKey.GetKID()
}

func (d Delegator) getMerkleHashMeta() (ret keybase1.HashMeta) {
	if d.MerkleRoot == nil {
		return ret
	}
	return d.MerkleRoot.ShortHash().ExportToHashMeta()
}

func (d Delegator) GetSigningKey() GenericKey {
	if d.ExistingKey != nil {
		return d.ExistingKey
	}
	return d.NewKey
}

func (d Delegator) IsSibkeyOrEldest() bool {
	return d.DelegationType == DelegationTypeSibkey || d.DelegationType == DelegationTypeEldest
}

func (d Delegator) IsEldest() bool { return d.DelegationType == DelegationTypeEldest }

// GetMerkleTriple gets the new MerkleTriple that came about as a result
// of performing the key delegation.
func (d Delegator) GetMerkleTriple() MerkleTriple { return d.merkleTriple }

func (d *Delegator) CheckArgs(m MetaContext) (err error) {

	defer m.Trace("Delegator#CheckArgs", &err)()

	if d.DelegationType == "" {
		err = MissingDelegationTypeError{}
	}

	if d.NewKey == nil {
		err = NoSecretKeyError{}
		return
	}

	if d.ExistingKey != nil {
		m.Debug("| Picked passed-in signing key")
	} else {
		m.Debug("| Picking new key for an eldest self-sig")
		d.DelegationType = DelegationTypeEldest
	}

	if d.EldestKID.Exists() || d.IsEldest() {
	} else if kid := d.Me.GetEldestKID(); kid.IsNil() {
		err = NoSigChainError{}
		return err
	} else {
		d.EldestKID = kid
	}

	m.Debug("| Picked key %s for signing", d.getSigningKID())

	return nil
}

// LoadSigningKey can be called before Run() to load the signing key into
// the delegator. This will check the given key first, then a device Key if we have one,
// and otherwise will leave the signing key unset so that we will set it
// as the eldest key on upload.
// m.LoginContext can be nil.
func (d *Delegator) LoadSigningKey(m MetaContext, ui SecretUI) (err error) {
	defer m.Trace("Delegator#LoadSigningKey", &err)()

	if d.ExistingKey != nil {
		m.Debug("| Was set ahead of time")
		return nil
	}

	if d.Me == nil {
		d.Me, err = LoadMe(NewLoadUserPubOptionalArg(d.G()))
		if err != nil {
			return err
		}
		if d.Me == nil {
			m.Debug("| Me didn't load")
			return nil
		}
	}

	if !d.Me.HasActiveKey() {
		m.Debug("| PGPKeyImportEngine: no active key found, so assuming set of eldest key")
		return nil
	}

	arg := SecretKeyPromptArg{
		Ska: SecretKeyArg{
			Me:      d.Me,
			KeyType: DeviceSigningKeyType,
		},
		SecretUI: ui,
		Reason:   "sign new key",
	}
	d.ExistingKey, err = m.G().Keyrings.GetSecretKeyWithPrompt(m, arg)

	return err
}

// Run the Delegator, performing all necessary internal operations.  Return err
// on failure and nil on success.
func (d *Delegator) Run(m MetaContext) (err error) {
	var jw *jsonw.Wrapper
	defer m.Trace("Delegator#Run", &err)()

	if err = d.CheckArgs(m); err != nil {
		return err
	}

	d.MerkleRoot = m.G().MerkleClient.LastRoot(m)

	// We'll need to generate two proofs, so set the Ctime
	// so that we get the same time both times
	d.Ctime = m.G().Clock().Now().Unix()

	// For a sibkey signature, we first sign the blob with the
	// sibkey, and then embed that signature for the delegating key
	if d.DelegationType == DelegationTypeSibkey {
		if jw, err = KeyProof(m, *d); err != nil {
			m.Debug("| Failure in intermediate KeyProof()")
			return err
		}

		if d.RevSig, _, _, err = SignJSON(jw, d.NewKey); err != nil {
			m.Debug("| Failure in intermediate SignJson()")
			return err
		}
	}

	if m.G().LocalDb == nil {
		panic("should have a local DB")
	}

	proof, err := KeyProof2(m, *d)
	if err != nil {
		m.Debug("| Failure in KeyProof2()")
		return err
	}

	return d.SignAndPost(m, proof)
}

func (d *Delegator) SignAndPost(m MetaContext, proof *ProofMetadataRes) (err error) {
	d.proof = proof
	var sigIDBase keybase1.SigIDBase
	if d.sig, sigIDBase, d.linkID, err = SignJSON(proof.J, d.GetSigningKey()); err != nil {
		m.Debug("| Failure in SignJson()")
		return err
	}
	d.sigID = sigIDBase.ToSigIDLegacy()
	if err = d.post(m); err != nil {
		m.Debug("| Failure in post()")
		return err
	}
	if err = d.updateLocalState(d.linkID); err != nil {
		return err
	}
	return nil
}

func (d *Delegator) isHighDelegator() bool {
	return d.DelegationType == DelegationTypeEldest ||
		d.DelegationType == DelegationTypeSibkey ||
		d.DelegationType == DelegationTypePGPUpdate
}

func (d *Delegator) updateLocalState(linkID LinkID) (err error) {
	d.Me.SigChainBump(linkID, d.sigID, d.isHighDelegator())
	d.merkleTriple = MerkleTriple{LinkID: linkID, SigID: d.sigID.StripSuffix()}
	return d.Me.localDelegateKey(d.NewKey, d.sigID, d.getExistingKID(), d.IsSibkeyOrEldest(), d.IsEldest(), d.getMerkleHashMeta(), keybase1.Seqno(0))
}

func (d *Delegator) post(m MetaContext) (err error) {
	var pub string
	if pub, err = d.NewKey.Encode(); err != nil {
		return
	}

	hargs := HTTPArgs{
		"sig_id_base":     S{Val: d.sigID.StripSuffix().String()},
		"sig_id_short":    S{Val: d.sigID.ToShortID()},
		"sig":             S{Val: d.sig},
		"type":            S{Val: string(d.DelegationType)},
		"is_remote_proof": B{Val: false},
		"public_key":      S{Val: pub},
	}

	if len(string(d.ServerHalf)) > 0 {
		hargs["server_half"] = S{Val: hex.EncodeToString(d.ServerHalf)}
	}

	if d.DelegationType == DelegationTypePGPUpdate {
		hargs["is_update"] = B{Val: true}
	}

	if d.IsEldest() {
		hargs["is_primary"] = I{Val: 1}
		hargs["new_eldest"] = B{Val: true}
		hargs["signing_kid"] = S{Val: d.NewKey.GetKID().String()}
	} else {
		hargs["eldest_kid"] = d.EldestKID
		hargs["signing_kid"] = d.getSigningKID()
	}
	if len(d.EncodedPrivateKey) > 0 {
		hargs["private_key"] = S{Val: d.EncodedPrivateKey}
	}

	arg := APIArg{
		Endpoint:    "key/add",
		SessionType: APISessionTypeREQUIRED,
		Args:        hargs,
	}
	if d.Aggregated {
		d.postArg = arg
		// Don't post to the server. DelegatorAggregator will do that.
		return nil
	}
	_, err = m.G().API.Post(m, arg)
	if err != nil {
		return err
	}
	if d.Me == nil {
		return fmt.Errorf("delegator missing 'me' info")
	}
	if d.proof == nil {
		return fmt.Errorf("delegator missing proof seqno")
	}
	return MerkleCheckPostedUserSig(m, d.Me.GetUID(), d.proof.Seqno, d.linkID)
}


text:
import { Component, Input, OnInit } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { FormGroup, FormControl, FormBuilder, Validators } from '@angular/forms';
import { Hero } from "../../models/hero";
import { HeroService } from "../../services/hero.service";
import 'rxjs/add/operator/switchMap';
import { HeroNameUniqueValidator } from "../../directives/hero-name-unique.validator";

@Component({
  moduleId: module.id,
  selector: 'hero-form',
  templateUrl: 'hero-form.component.html'
})
export class HeroFormComponent implements OnInit{
  @Input()
  hero: Hero;

  public heroForm: FormGroup;
  public submitted: boolean;

  constructor(
    private _fb: FormBuilder,
    private heroService: HeroService,
    private route: ActivatedRoute
  ){}

  ngOnInit(): void {
    /**
     * Create the form
     */
    this.heroForm = this._fb.group({
      id: [-1, <any>Validators.nullValidator],
      name: ['',
        /** Synchronous */
        [ <any>Validators.required ],
        /** Asynchronous @todo Avoid instantiation*/
        new HeroNameUniqueValidator(this.heroService).validator
      ],
      strength:  [0, <any>Validators.nullValidator],
      speed:  [0, <any>Validators.nullValidator],
      stealth:  [0, <any>Validators.nullValidator],
      intelligence:  [0, <any>Validators.nullValidator]
    });
    /**
     * Find the object by id from route
     */
    this.route.params
      .switchMap((params: Params) => this.heroService.getHero(+params['id']))
      .subscribe( hero => {
        if(!!hero){
          /**
           * If we get an object (ie form for add),
           * bind it to the form
           */
          (<FormGroup>this.heroForm).setValue(hero, {onlySelf:true});
        }
      } );
  }

  save(model: HeroInterface, isValid: boolean){
    this.submitted = true;
    console.log(new Hero(model),isValid);
  }
}


text:
package me.st28.flexseries.flexcore.util;

import org.apache.commons.lang.Validate;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

/**
 * Represents a material.
 */
public final class MaterialRef {

    private final Material material;
    private final short damage;

    public MaterialRef(Material material, short damage) {
        Validate.notNull(material, "Material cannot be null.");
        Validate.isTrue(damage >= 0, "Damage value must be 0 or more.");

        this.material = material;
        this.damage = damage;
    }

    public MaterialRef(ItemStack item) {
        Validate.notNull(item, "Item cannot be null.");

        this.material = item.getType();
        this.damage = item.getDurability();
    }

    public final Material getMaterial() {
        return material;
    }

    public final short getDamage() {
        return damage;
    }

    @Override
    public String toString() {
        return material.toString() + ":" + damage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MaterialRef that = (MaterialRef) o;

        return damage == that.damage && material == that.material;
    }

    @Override
    public int hashCode() {
        int result = material.hashCode();
        result = 31 * result + (int) damage;
        return result;
    }

}


text:
package com.bwsw.sj.engine.output.benchmark

import java.io.File

import com.bwsw.sj.common.utils.EngineLiterals
import com.bwsw.sj.common.utils.benchmark.ProcessTerminator
import com.bwsw.sj.engine.output.benchmark.DataFactory._
import com.bwsw.sj.engine.output.benchmark.SjOutputModuleBenchmarkConstants._

/**
  * @author Kseniya Tomskikh
  */
object SjESOutputModuleSetup extends App {
  ProcessTerminator.terminateProcessAfter { () =>
    tempHelperForConfigSetup.setupConfigs()
    val checkpointMode = EngineLiterals.everyNthMode
    val partitions = 4

    val module = new File(pathToESModule)

    println("module upload")
    uploadModule(module)

    println("create providers")
    createProviders()
    println("create services")
    createServices()
    println("create streams")
    createStreams(partitions)
    println("create instance")
    createInstance(
      esInstanceName,
      checkpointMode,
      checkpointInterval,
      esStreamName,
      "com.bwsw.stub.output-bench-test",
      totalInputElements)

    println("prepare a storage")
    createIndex()

    println("create test data")
    createData(countTxns, countElements)

    println("close connections")
    close()
    connectionRepository.close()
  }
}

class SjESOutputModuleSetup


text:
jQuery(function($) {
  window.NestedFormEvents = function() {
    this.addFields = $.proxy(this.addFields, this);
    this.removeFields = $.proxy(this.removeFields, this);
  };

  NestedFormEvents.prototype = {
    addFields: function(e) {
      var link    = e.currentTarget;
      var assoc   = $(link).attr('data-association');            // Name of child
      var content = $('#' + assoc + '_fields_blueprint').html(); // Fields template
      var context = ($(link).closest('.fields').find('input:first').attr('name') || '').replace(new RegExp('\[[a-z]+\]$'), '');

      // Make a unique ID for the new child
      // moved before parent interpolation in case a parent would mungle <object_name>_new_<assoc> to <object_name>_<(new_<parent_timestamp>|<parent_index>)>_<assoc>
      // It happens if object_name.ends_with?(parent_name)
      var regexp  = new RegExp('new_' + assoc, 'g');
      var new_id  = new Date().getTime();
      content     = content.replace(regexp, "new_" + new_id);

      if (context) {
        var parentNames = context.match(/[a-z_]+_attributes/g) || [];
        var parentIds   = context.match(/(new_)?[0-9]+/g) || [];
        for(var i = 0; i < parentNames.length; i++) {
          if(parentIds[i]) {
            content = content.replace(
              new RegExp('(_' + parentNames[i] + ')_.+?_', 'g'),
              '$1_' + parentIds[i] + '_');
            content = content.replace(
              new RegExp('(\\[' + parentNames[i] + '\\])\\[.+?\\]', 'g'),
              '$1[' + parentIds[i] + ']');
          }
        }
      }

      var field = this.insertFields(content, assoc, link);
      $(link).closest("form")
        .trigger({ type: 'nested:fieldAdded', field: field })
        .trigger({ type: 'nested:fieldAdded:' + assoc, field: field });
      return false;
    },
    insertFields: function(content, assoc, link) {
      return $(content).insertBefore(link).hide().show('slow');
    },
    removeFields: function(e) {
      var link = e.currentTarget;
      $(link).toggleClass('important').toggleClass('notice');
      var hiddenField = $(link).prev('input[type=hidden]');
      hiddenField.val(hiddenField.val() === '1' ? '0' : '1');
      $(link).siblings('fieldset').toggle();
      return false;
    }
  };

  window.nestedFormEvents = new NestedFormEvents();
  $('form a.add_nested_fields').live('click', nestedFormEvents.addFields);
  $('form a.remove_nested_fields').live('click', nestedFormEvents.removeFields);
});


text:
(function(angular) {
	'use strict';

	angular.module('xpsui:controllers')
	.controller('xpsui:SecurityLoginCtrl', [
		'$scope', 'xpsui:SecurityService',
		'$rootScope',
		'$location',
		'xpsui:NotificationFactory',
		'xpsui:NavigationService' ,
		function($scope, SecurityService, $rootScope, $location,notificationFactory, navigationService) {
			// FIXME remove this in production
			// $scope.user = 'johndoe';
			// $scope.password = 'johndoe';
			$scope.user = '';
			$scope.password = '';

			/**
			 * Login button click
			 */
			$scope.login = function() {
				SecurityService.getLogin($scope.user, $scope.password).success(function(user) {
					if (user.systemCredentials.profiles.length>1){
						$scope.profiles=user.systemCredentials.profiles;
					}
					else {
						SecurityService.selectProfile(user.systemCredentials.profiles[0].id).success(function(){
							SecurityService.getCurrentUser().success(function(data){
							$rootScope.security.currentUser=data;

							if (!navigationService.back()) {
								$location.path('/personal-page');
							}
							});
						});
					}
				}).error(function(err) {
					if (err){
						console.log(err);
					}
					delete $rootScope.security.currentUser;
					var mes = {translationCode:'login.authentication.failed',time:5000};
					notificationFactory.error(mes);
				});
			};

			$scope.selectProfile=function(){
				if (!$scope.selectedProfile) return;
				SecurityService.selectProfile($scope.selectedProfile.id).success(function(){
					 SecurityService.getCurrentUser().success(function(data){
						$rootScope.security.currentUser=data;
						if (!navigationService.back()) {
							$location.path('/personal-page');
						}
					});
				});
			};

			$scope.resetPassword = function() {
				SecurityService.getResetPassword($scope.user);
			};
		}
	]);

}(window.angular));


text:
{{if .Alert.Message}}

           <button type="button" class="close" data-dismiss="alert">×Close</button>
            {{.Alert.Message}}

{{end}}


text:
package com.asha.vrlib.strategy.display;

import android.app.Activity;
import android.content.Context;

/**
 * Created by hzqiujiadi on 16/3/19.
 * hzqiujiadi ashqalcn@gmail.com
 */
public class NormalStrategy extends AbsDisplayStrategy {

    @Override
    public void on(Activity activity) {}

    @Override
    public void off(Activity activity) {}

    @Override
    public boolean isSupport(Activity activity) {
        return true;
    }

    @Override
    public void onResume(Context context) {

    }

    @Override
    public void onPause(Context context) {

    }

    @Override
    public int getVisibleSize() {
        return 1;
    }
}


text:
// .NAME vtkRungeKutta45 - Integrate an initial value problem using 5th
// order Runge-Kutta method with adaptive stepsize control.

// .SECTION Description
// This is a concrete sub-class of vtkInitialValueProblemSolver.
// It uses a 5th order Runge-Kutta method with stepsize control to obtain
// the values of a set of functions at the next time step. The stepsize
// is adjusted by calculating an estimated error using an embedded 4th
// order Runge-Kutta formula:
// Press, W. H. et al., 1992, Numerical Recipes in Fortran, Second
// Edition, Cambridge University Press
// Cash, J.R. and Karp, A.H. 1990, ACM Transactions on Mathematical
// Software, vol 16, pp 201-222

// .SECTION See Also
// vtkInitialValueProblemSolver vtkRungeKutta4 vtkRungeKutta2 vtkFunctionSet

#ifndef __vtkRungeKutta45_h
#define __vtkRungeKutta45_h

#include "vtkInitialValueProblemSolver.h"

class VTK_COMMON_EXPORT vtkRungeKutta45 : public vtkInitialValueProblemSolver
{
public:
  vtkTypeMacro(vtkRungeKutta45,vtkInitialValueProblemSolver);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Construct a vtkRungeKutta45 with no initial FunctionSet.
  static vtkRungeKutta45 *New();

  // Description:
  // Given initial values, xprev , initial time, t and a requested time
  // interval, delT calculate values of x at t+delTActual (xnext).
  // Possibly delTActual != delT. This may occur
  // because this solver supports adaptive stepsize control. It tries
  // to change to stepsize such that
  // the (estimated) error of the integration is less than maxError.
  // The solver will not set the stepsize smaller than minStep or
  // larger than maxStep (note that maxStep and minStep should both
  // be positive, whereas delT can be negative).
  // Also note that delT is an in/out argument. vtkRungeKutta45
  // will modify delT to reflect the best (estimated) size for the next
  // integration step.
  // An estimated value for the error is returned (by reference) in error.
  // This is the norm of the error vector if there are more than
  // one function to be integrated.
  // This method returns an error code representing the nature of
  // the failure:
  // OutOfDomain = 1,
  // NotInitialized = 2,
  // UnexpectedValue = 3
  virtual int ComputeNextStep(double* xprev, double* xnext, double t,
                              double& delT, double maxError, double& error)
    {
      double minStep = delT;
      double maxStep = delT;
      double delTActual;
      return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
                                   minStep, maxStep, maxError, error);
    }
  virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext,
                              double t, double& delT,
                              double maxError, double& error)
    {
      double minStep = delT;
      double maxStep = delT;
      double delTActual;
      return this->ComputeNextStep(xprev, dxprev, xnext, t, delT, delTActual,
                                   minStep, maxStep, maxError, error);
    }
  virtual int ComputeNextStep(double* xprev, double* xnext,
                              double t, double& delT, double& delTActual,
                              double minStep, double maxStep,
                              double maxError, double& error)
    {
      return this->ComputeNextStep(xprev, 0, xnext, t, delT, delTActual,
                                   minStep, maxStep, maxError, error);
    }
  virtual int ComputeNextStep(double* xprev, double* dxprev, double* xnext,
                              double t, double& delT, double& delTActual,
                              double minStep, double maxStep,
                              double maxError, double& error);

protected:
  vtkRungeKutta45();
  ~vtkRungeKutta45();

  virtual void Initialize();

  // Cash-Karp parameters
  static double A[5];
  static double B[5][5];
  static double C[6];
  static double DC[6];

  double* NextDerivs[6];

  int ComputeAStep(double* xprev, double* dxprev, double* xnext, double t,
                   double& delT,  double& error);

private:
  vtkRungeKutta45(const vtkRungeKutta45&);  // Not implemented.
  void operator=(const vtkRungeKutta45&);  // Not implemented.
};

#endif


text:
@interface NSObject (Xmas)

- (id)xmas_initWithIcon:(id)icon
                message:(id)message
           parentWindow:(id)parentWindow
               duration:(double)duration;

@end


text:
package iso20022

// Identifies the mandate to be cancelled.
type MandateCancellation2 struct {

	// Provides information on the original message.
	OriginalMessageInformation *OriginalMessageInformation1 `xml:"OrgnlMsgInf,omitempty"`

	// Provides detailed information on the cancellation reason.
	CancellationReason *PaymentCancellationReason1 `xml:"CxlRsn"`

	// Provides the original mandate data.
	OriginalMandate *OriginalMandate2Choice `xml:"OrgnlMndt"`
}

func (m *MandateCancellation2) AddOriginalMessageInformation() *OriginalMessageInformation1 {
	m.OriginalMessageInformation = new(OriginalMessageInformation1)
	return m.OriginalMessageInformation
}

func (m *MandateCancellation2) AddCancellationReason() *PaymentCancellationReason1 {
	m.CancellationReason = new(PaymentCancellationReason1)
	return m.CancellationReason
}

func (m *MandateCancellation2) AddOriginalMandate() *OriginalMandate2Choice {
	m.OriginalMandate = new(OriginalMandate2Choice)
	return m.OriginalMandate
}


text:
package LBJ2.infer;

import java.util.Collection;
import java.util.Iterator;
import java.util.Vector;

/**
  * An "at least" quantifier states that the constraint must hold for at least
  * m of the objects in the collection.
  *
  * @author Nick Rizzolo
 **/
public class AtLeastQuantifier extends Quantifier
{
  /** The number of objects for which the constraint must hold. */
  protected int m;

  /**
    * Initializing constructor.
    *
    * @param q    The name of the quantification variable.
    * @param col  The collection of objects to iterate over.
    * @param con  The constraint being quantified.
    * @param m    The number of objects for which the constraint must hold.
   **/
  public AtLeastQuantifier(String q, Collection col, FirstOrderConstraint con,
                           int m) {
    this(q, col, con, m, null);
  }

  /**
    * This constructor specifies a variable setter for when this quantifier is
    * itself quantified.
    *
    * @param q    The name of the quantification variable.
    * @param col  The collection of objects to iterate over.
    * @param con  The constraint being quantified.
    * @param m    The number of objects for which the constraint must hold.
    * @param qar  The variable setter.
   **/
  public AtLeastQuantifier(String q, Collection col, FirstOrderConstraint con,
                           int m, QuantifierArgumentReplacer qar) {
    super(q, col, con, qar);
    this.m = Math.max(m, 0);
  }

  /** Determines whether the constraint is satisfied. */
  public boolean evaluate() {
    int satisfied = 0;

    int index = initialize();
    for (Iterator I = collection.iterator(); I.hasNext() && satisfied < m; ) {
      enclosingQuantificationSettings.set(index, I.next());
      constraint.setQuantificationVariables(enclosingQuantificationSettings);
      if (constraint.evaluate()) ++satisfied;
    }

    enclosingQuantificationSettings.removeElementAt(index);
    return satisfied == m;
  }

  /**
    * This method sets the given quantification variables to the given object
    * references and evaluates the expressions involving those variables in
    * this constraint's children.
    *
    * @param o  The new object references for the enclosing quantification
    *           variables, in order of nesting.
   **/
  public void setQuantificationVariables(Vector o) {
    enclosingQuantificationSettings = o;

    if (replacer != null) {
      replacer.setQuantificationVariables(o);
      if (!replacer.collectionConstant) collection = replacer.getCollection();
      if (!replacer.boundConstant) m = replacer.getBound();
    }
  }

  /**
    * Transforms this first order constraint into a propositional constraint.
    *
    * @return The propositionalized constraint.
   **/
  public PropositionalConstraint propositionalize() {
    if (collection.size() < m) return new PropositionalConstant(false);
    if (m == 0) return new PropositionalConstant(true);

    PropositionalConstraint[] pc =
      new PropositionalConstraint[collection.size()];

    int index = initialize();
    int i = 0;
    for (Iterator I = collection.iterator(); I.hasNext(); ++i) {
      enclosingQuantificationSettings.set(index, I.next());
      constraint.setQuantificationVariables(enclosingQuantificationSettings);
      pc[i] = constraint.propositionalize();
    }

    enclosingQuantificationSettings.removeElementAt(index);
    if (pc.length == 1) return pc[0];

    return new PropositionalAtLeast(pc, m);
  }

  /**
    * The hash code of a AtLeastQuantifier is the sum of the hash
    * codes of its children plus one.
    *
    * @return The hash code for this AtLeastQuantifier.
   **/
  public int hashCode() { return super.hashCode() + m + 1; }

  /**
    * Two AtLeastQuantifiers are equivalent when their children
    * are equivalent.
    *
    * @return true iff the argument is an equivalent
    *         AtLeastQuantifier.
   **/
  public boolean equals(Object o) {
    if (!(o instanceof AtLeastQuantifier)) return false;
    AtLeastQuantifier q = (AtLeastQuantifier) o;
    return super.equals(q) && m == q.m;
  }

  /**
    * Calls the appropriate visit(·) method of the given
    * Inference for this Constraint, as per the
    * visitor pattern.
    *
    * @param infer  The inference visiting this constraint.
   **/
  public void runVisit(Inference infer) { infer.visit(this); }
}


text:
import * as b from 'bobril';
export interface IData {
    content: b.IBobrilChildren;
    isFluid?: boolean;
}
declare var _default: (data?: IData, children?: boolean | string | b.IBobrilNodeWithTag | b.IBobrilNodeWithComponent | b.IBobrilNodeWithChildren | b.IBobrilChildArray) => b.IBobrilNodeWithTag | b.IBobrilNodeWithComponent | b.IBobrilNodeWithChildren;
export default _default;


text:
using Amazon;
using Amazon.Runtime;
using Amazon.S3;
using Storage.Net.Amazon.Aws.Messaging;
using Storage.Net.Amazon.Aws.Blobs;
using Storage.Net.Blobs;
using Storage.Net.Messaging;
using Storage.Net.Amazon.Aws;
using Storage.Net.ConnectionString;
using Amazon.S3.Transfer;

namespace Storage.Net
{
   /// <summary>
   /// Factory class that implement factory methods for Amazon AWS implementation
   /// </summary>
   public static class Factory
   {

      /// <summary>
      /// Register Azure module.
      /// </summary>
      public static IModulesFactory UseAwsStorage(this IModulesFactory factory)
      {
         return factory.Use(new AwsStorageModule());
      }

      /// <summary>
      /// Creates an Amazon S3 storage using assumed role permissions (useful when running the code wform within ECS tasks or lambda where you don't need to provide and manage accessKeys and secrets as the permissions are assumed via the IAM role the lambda or ecs tasks has assigned to it)
      /// </summary>
      /// <param name="factory">Factory reference</param>
      /// <param name="bucketName">Bucket name</param>
      /// <param name="region">Required regional endpoint.</param>
      /// <returns>A reference to the created storage</returns>
      public static IBlobStorage AwsS3(this IBlobStorageFactory factory,
         string bucketName,
         string region)
      {
         return new AwsS3BlobStorage(bucketName, region);
      }

      /// <summary>
      /// Creates an Amazon S3 storage
      /// </summary>
      /// <param name="factory">Factory reference</param>
      /// <param name="accessKeyId">Access key ID</param>
      /// <param name="secretAccessKey">Secret access key</param>
      /// /// <param name="sessionToken">Optional. Only required when using session credentials.</param>
      /// <param name="bucketName">Bucket name</param>
      /// <param name="region">Region endpoint</param>
      /// <param name="serviceUrl">S3-compatible service location</param>
      /// <returns>A reference to the created storage</returns>
      public static IBlobStorage AwsS3(this IBlobStorageFactory factory,
         string accessKeyId,
         string secretAccessKey,
         string sessionToken,
         string bucketName,
         string region,
         string serviceUrl = null)
      {
         return new AwsS3BlobStorage(accessKeyId, secretAccessKey, sessionToken, bucketName, region, serviceUrl);
      }

      /// <summary>
      /// Creates an Amazon S3 storage provider for a custom S3-compatible storage server
      /// </summary>
      /// <param name="factory">Factory reference</param>
      /// <param name="accessKeyId">Access key ID</param>
      /// <param name="secretAccessKey">Secret access key</param>
      /// <param name="sessionToken">Optional. Only required when using session credentials.</param>
      /// <param name="bucketName">Bucket name</param>
      /// <param name="clientConfig">S3 client configuration</param>
      /// <param name="transferUtilityConfig">S3 transfer utility configuration</param>
      /// <returns>A reference to the created storage</returns>
      public static IBlobStorage AwsS3(this IBlobStorageFactory factory,
         string accessKeyId,
         string secretAccessKey,
         string sessionToken,
         string bucketName,
         AmazonS3Config clientConfig,
         TransferUtilityConfig transferUtilityConfig = null)
      {
         return new AwsS3BlobStorage(accessKeyId, secretAccessKey, sessionToken, bucketName, clientConfig, transferUtilityConfig);
      }

#if !NET16

      /// <summary>
      /// Creates an Amazon S3 storage provider using credentials from AWS CLI configuration file (~/.aws/credentials)
      /// </summary>
      /// <param name="factory">Factory reference</param>
      /// <param name="awsCliProfileName"></param>
      /// <param name="bucketName">Bucket name</param>
      /// <param name="region"></param>
      /// <returns>A reference to the created storage</returns>
      public static IBlobStorage AwsS3(this IBlobStorageFactory factory,
         string awsCliProfileName,
         string bucketName,
         string region)
      {
         return AwsS3BlobStorage.FromAwsCliProfile(awsCliProfileName, bucketName, region);
      }

      /// <summary>
      /// Creates an Amazon S3 storage provider using credentials retrieve from SSO
      /// </summary>
      /// <param name="factory">Factory reference</param>
      /// <param name="credentials"></param>
      /// <param name="bucketName">Bucket name</param>
      /// <param name="region"></param>
      /// <returns>A reference to the created storage</returns>
      public static IBlobStorage AwsS3(this IBlobStorageFactory factory,
         AWSCredentials credentials,
         string bucketName,
         string region)
      {
         return AwsS3BlobStorage.FromAwsCredentials(credentials, bucketName, region);
      }
#endif

      /// <summary>
      /// Creates Amazon Simple Queue Service publisher
      /// </summary>
      /// <param name="factory"></param>
      /// <param name="accessKeyId">Access key ID</param>
      /// <param name="secretAccessKey">Secret access key</param>
      /// <param name="serviceUrl"></param>
      /// <param name="regionEndpoint"></param>
      /// <returns></returns>
      public static IMessenger AwsSQS(this IMessagingFactory factory,
         string accessKeyId,
         string secretAccessKey,
         string serviceUrl,
         RegionEndpoint regionEndpoint = null)
      {
         return new AwsSQSMessenger(accessKeyId, secretAccessKey, serviceUrl, regionEndpoint);
      }

      #region [ Connection Strings ]

      /// <summary>
      /// Creates a connection string from AWS CLI profile name
      /// </summary>
      /// <param name="factory"></param>
      /// <param name="profileName"></param>
      /// <param name="bucketName"></param>
      /// <param name="region"></param>
      /// <returns></returns>
      public static StorageConnectionString ForAwsS3FromCliProfile(this IConnectionStringFactory factory,
         string profileName,
         string bucketName,
         string region)
      {
         if(profileName is null)
            throw new System.ArgumentNullException(nameof(profileName));
         if(bucketName is null)
            throw new System.ArgumentNullException(nameof(bucketName));
         if(region is null)
            throw new System.ArgumentNullException(nameof(region));
         var cs = new StorageConnectionString(KnownPrefix.AwsS3 + "://");
         cs[KnownParameter.LocalProfileName] = profileName;
         cs[KnownParameter.BucketName] = bucketName;
         cs[KnownParameter.Region] = region;
         return cs;
      }

      #endregion
   }
}


text:
package com.telefonica.euro_iaas.paasmanager.dao.impl;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Query;

import org.apache.commons.lang.StringUtils;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.telefonica.fiware.commons.dao.AbstractBaseDao;
import com.telefonica.fiware.commons.dao.EntityNotFoundException;
import com.telefonica.euro_iaas.paasmanager.dao.TierDao;
import com.telefonica.euro_iaas.paasmanager.model.Environment;
import com.telefonica.euro_iaas.paasmanager.model.Metadata;
import com.telefonica.euro_iaas.paasmanager.model.ProductRelease;
import com.telefonica.euro_iaas.paasmanager.model.Tier;
import com.telefonica.euro_iaas.paasmanager.model.searchcriteria.TierSearchCriteria;

@Transactional(propagation = Propagation.REQUIRED)
public class TierDaoJpaImpl extends AbstractBaseDao<Tier, String> implements TierDao {
    private static Logger log = LoggerFactory.getLogger(TierDaoJpaImpl.class);

    public List<Tier> findAll() {
        return super.findAll(Tier.class);
    }

    /*
     * public Tier load(String name) throws EntityNotFoundException { TierSearchCriteria criteria = new
     * TierSearchCriteria(); criteria.setName(name); List<Tier> tiers = findByCriteria(criteria); if (tiers.size() != 1)
     * { throw new EntityNotFoundException(Tier.class, "name", name); } Tier tier = tiers.get(0); return tier; }
     */

    public Tier load(String name) throws EntityNotFoundException {
        return null;
    }

    public Tier load(String name, String vdc, String environmentName) throws EntityNotFoundException {
        try {
            return this.findByNameAndVdcAndEnvironment(name, vdc, environmentName);
        } catch (Exception e) {
            return findByNameAndVdcAndEnvironmentNoProduct(name, vdc, environmentName);
        }

    }

    private Tier findByNameAndVdcAndEnvironment(String name, String vdc, String environmentname)
            throws EntityNotFoundException {
        if (vdc == null) {
            vdc = "";
        }
        Query query = getEntityManager().createQuery(
                "select p from Tier p left join " + "fetch p.productReleases where p.name = :name and p.vdc =:vdc "
                        + "and p.environmentname=:environmentname");
        query.setParameter("name", name);
        query.setParameter("vdc", vdc);
        query.setParameter("environmentname", environmentname);
        Tier tier = null;
        try {
            tier = (Tier) query.getResultList().get(0);
        } catch (Exception e) {
            String message = " No Tier found in the database with name: " + name + " vdc " + vdc
                    + " and environmentname " + environmentname + " " + e.getMessage();
            log.warn(message);
            throw new EntityNotFoundException(Tier.class, message, name);
        }

        return tier;
    }

    private Tier findByNameAndVdcAndEnvironmentNoProduct(String name, String vdc, String environmentname)
            throws EntityNotFoundException {
        Query query = getEntityManager().createQuery(
                "select p from Tier p where p.name = :name and p.vdc =:vdc and p.environmentname= :environmentname");
        query.setParameter("name", name);
        query.setParameter("vdc", vdc);
        query.setParameter("environmentname", environmentname);
        Tier tier = null;
        try {
            tier = (Tier) query.getResultList().get(0);
        } catch (Exception e) {
            String message = " No Tier found in the database with name: " + name + " vdc " + vdc
                    + " no products and environmentname " + environmentname + " " + e.getMessage();
            log.warn(message);
            throw new EntityNotFoundException(Tier.class, message, name);
        }
        return tier;
    }

    /**
     * {@inheritDoc}
     */
    @SuppressWarnings("unchecked")
    public List<Tier> findByCriteria(TierSearchCriteria criteria) throws EntityNotFoundException {
        // Session session = (Session) getEntityManager().getDelegate();
        Session session = (Session) getEntityManager().getDelegate();
        Criteria baseCriteria = session.createCriteria(Tier.class);

        if (!StringUtils.isEmpty(criteria.getVdc())) {
            baseCriteria.add(Restrictions.eq(Tier.VDC_FIELD, criteria.getVdc()));
        }
        if (!StringUtils.isEmpty(criteria.getName())) {
            baseCriteria.add(Restrictions.eq(Tier.NAME_FIELD, criteria.getName()));
        }
        if (!StringUtils.isEmpty(criteria.getEnvironmentName())) {
            baseCriteria.add(Restrictions.eq(Tier.ENVIRONMENT_NAME_FIELD, criteria.getEnvironmentName()));
        }

        List<Tier> tiers = setOptionalPagination(criteria, baseCriteria).list();

        if (criteria.getEnvironment() != null) {
            tiers = filterByEnvironment(tiers, criteria.getEnvironment());
        }

        return tiers;
    }

    private List<Tier> filterByEnvironment(List<Tier> tiers, Environment environment) throws EntityNotFoundException {
        List<Tier> filterTiers = new ArrayList();
        for (Tier tier : tiers) {
            if (environment.getTiers().contains(tier))
                filterTiers.add(tier);
        }
        return filterTiers;
    }

    @Override
    public Tier loadTierWithProductReleaseAndMetadata(String tierName, String vdc, String environmentName)
            throws EntityNotFoundException {
        Tier tier = findByNameAndVdcAndEnvironment(tierName, vdc, environmentName);

        for (ProductRelease productRelease : tier.getProductReleases()) {

            for (Metadata metadata : productRelease.getMetadatas()) {
                metadata.getValue();
            }
        }

        return tier;
    }

    @Override
    public Tier loadTierWithNetworks(String name, String vdc, String environmentname) throws EntityNotFoundException {
        Query query = getEntityManager()
                .createQuery(
                        "select p from Tier p left join fetch  p.networks where p.name = :name and p.vdc =:vdc and p.environmentname= :environmentname");
        query.setParameter("name", name);
        query.setParameter("vdc", vdc);
        query.setParameter("environmentname", environmentname);
        Tier tier = null;
        try {
            tier = (Tier) query.getResultList().get(0);
            tier.getNetworks();
            getEntityManager().flush();
        } catch (Exception e) {
            String message = " No Tier found in the database with name: " + name + " vdc " + vdc
                    + " no products and environmentname " + environmentname;
            throw new EntityNotFoundException(Tier.class, message, name);
        }
        return tier;
    }

    @Override
    public String findRegionBySecurityGroup(String idSecurityGroup) throws EntityNotFoundException {

        Query query = getEntityManager().createQuery("select p from Tier p where p.securityGroup= :securityGroupId");
        query.setParameter("securityGroupId", idSecurityGroup);
        Tier tier = null;
        try {
            tier = (Tier) query.getResultList().get(0);
        } catch (Exception e) {
            String message = " No Tier found in the database with security group id: " + idSecurityGroup;
            throw new EntityNotFoundException(Tier.class, message, idSecurityGroup);
        }
        return tier.getRegion();

    }

    public List<Tier> findAllWithNetwork(String networkName) {
        Query query = getEntityManager().createQuery(
                "select tier from Tier tier left join fetch tier.networks nets where nets.name=:net");
        query.setParameter("net", networkName);
        List<Tier> tiers = (List<Tier>) query.getResultList();

        return tiers;
    }

    @Override
    public Tier loadComplete(Tier newTier) throws EntityNotFoundException {
        Query query = getEntityManager().createQuery(
                "select p from Tier p fetch all"
                        + " properties where p.name = :name and p.vdc =:vdc and p.environmentname= :environmentname");
        query.setParameter("name", newTier.getName());
        query.setParameter("vdc", newTier.getVdc());
        query.setParameter("environmentname", newTier.getEnviromentName());
        Tier tier = null;
        try {
            tier = (Tier) query.getResultList().get(0);
            if (tier.getNetworks() != null) {
                tier.getNetworks().size();
            }
            if (tier.getProductReleases() != null) {
                tier.getProductReleases().size();
            }
        } catch (Exception e) {
            String message = " Tier does not exist in database ";
            throw new EntityNotFoundException(Tier.class, message, newTier.getName());
        }
        return tier;
    }
}


text:
title: Code
---

# Code

## Projects
* [ubots](https://ubots.xyz) - smart Slack bots for teams

## Open source projects

* [tesla](http://github.com/monterail/tesla) - Middleware-based Elixir HTTP client
* [mix_docker](http://github.com/recruitee/mix_docker) - Put your Elixir app inside docker
* [rails-assets.org](http://rails-assets.org) - The solution to managing assets in Rails
* [sickle](http://github.com/teamon/sickle) - Ruby library for building complex CLI tools
* [redis-browser](http://github.com/monterail/redis-browser) - Redis Database Browser
* [play-navigator](http://github.com/teamon/play-navigator) - Better router for Play Framework 2.x
* [play-scalaz](http://github.com/teamon/play-scalaz) - Scalaz integration for Play 2.x
* [optparse](http://github.com/teamon/optparse) - Scala CLI parser based on shapeless
* [plan-pwr.pl](http://github.com/teamon/plan-pwr.pl) - Schedule generator for PWR

More at my [GitHub](https://github.com/teamon)

## Experiments

* [elixir sandbox](http://github.com/teamon/sandbox) - Various elixir experiments
* [akka.js](http://github.com/teamon/akka.js) - akka actors for javascript
* [ToDo](/proto/todo/) - Nested ToDo list based on local storage
* [Range](/proto/range/) - rangeapp.com core UI element
* [Composer](/proto/composer/) - Graphical nodes linking


text:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Twilio\Jwt\AccessToken;
use Twilio\Jwt\Grants\IpMessagingGrant;

class TokenController extends Controller
{
    public function generate(Request $request, AccessToken $accessToken, IpMessagingGrant $ipmGrant)
    {
        $appName = "TwilioChat";
        $deviceId = $request->input("device");
        $identity = $request->input("identity");

        $TWILIO_IPM_SERVICE_SID = config('services.twilio')['ipmServiceSid'];

        $endpointId = $appName . ":" . $identity . ":" . $deviceId;

        $accessToken->setIdentity($identity);

        $ipmGrant->setServiceSid($TWILIO_IPM_SERVICE_SID);
        $ipmGrant->setEndpointId($endpointId);

        $accessToken->addGrant($ipmGrant);

        $response = array(
            'identity' => $identity,
            'token' => $accessToken->toJWT()
        );

        return response()->json($response);
    }
}


text:
namespace ShoppingListApp.Domain.Abstract
{
    public interface IRepositoryNameProvider
    {
        string RepositoryName { get; }
    }
}


text:
package edu.agh.copernic.iot.net;

import edu.agh.copernic.iot.net.json.AlarmRequestJson;
import edu.agh.copernic.iot.net.json.AlarmResponseJson;
import edu.agh.copernic.iot.net.json.GcmIdJson;
import edu.agh.copernic.iot.net.json.LightsRequestJson;
import retrofit.client.Response;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.POST;
import rx.Observable;

public interface IoTContract {
    @POST("/device/")
    Observable<Response> sendGCMI(@Body GcmIdJson body);

    @POST("/lights/")
    Observable<Response> sendLightsOperation(@Body LightsRequestJson body);

    @GET("/alarm/")
    Observable<AlarmResponseJson> getAlarmStatus();

    @POST("/alarm/")
    Observable<Response> setAlarmState(@Body AlarmRequestJson body);
}


text:
from __future__ import unicode_literals
from past.builtins import basestring

import os.path

from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler

from httpwatcher.errors import MissingFolderError

from tornado import gen
from tornado.ioloop import PeriodicCallback
from tornado.queues import Queue

import logging
logger = logging.getLogger(__name__)

__all__ = [
    "FileSystemWatcher"
]

class FileSystemWatcher(object):

    def __init__(self, watch_paths, on_changed=None, interval=1.0, recursive=True):
        """Constructor.

        Args:
            watch_paths: A list of filesystem paths to watch for changes.
            on_changed: Callback to call when one or more changes to the watch path are detected.
            interval: The minimum interval at which to notify about changes (in seconds).
            recursive: Should the watch path be monitored recursively for changes?
        """
        if isinstance(watch_paths, basestring):
            watch_paths = [watch_paths]

        watch_paths = [os.path.abspath(path) for path in watch_paths]
        for path in watch_paths:
            if not os.path.exists(path) or not os.path.isdir(path):
                raise MissingFolderError(path)

        self.watch_paths = watch_paths
        self.interval = interval * 1000.0
        self.recursive = recursive
        self.periodic_callback = PeriodicCallback(self.check_fs_events, self.interval)
        self.on_changed = on_changed
        self.observer = Observer()
        for path in self.watch_paths:
            self.observer.schedule(
                WatcherEventHandler(self),
                path,
                self.recursive
            )
        self.started = False
        self.fs_event_queue = Queue()

    def track_event(self, event):
        self.fs_event_queue.put(event)

    @gen.coroutine
    def check_fs_events(self):
        drained_events = []
        while self.fs_event_queue.qsize() > 0:
            drained_events.append(self.fs_event_queue.get_nowait())
        if len(drained_events) > 0 and callable(self.on_changed):
            logger.debug("Detected %d file system change(s) - triggering callback" % len(drained_events))
            self.on_changed(drained_events)

    def start(self):
        if not self.started:
            self.observer.start()
            self.periodic_callback.start()
            self.started = True
            logger.debug("Started file system watcher for paths:\n%s" % "\n".join(self.watch_paths))

    def shutdown(self, timeout=None):
        if self.started:
            self.periodic_callback.stop()
            self.observer.stop()
            self.observer.join(timeout=timeout)
            self.started = False
            logger.debug("Shut down file system watcher for path:\n%s" % "\n".join(self.watch_paths))

class WatcherEventHandler(FileSystemEventHandler):

    def __init__(self, watcher):
        super(WatcherEventHandler, self).__init__()
        self.watcher = watcher

    def on_any_event(self, event):
        logger.debug("WatcherEventHandler detected filesystem event: %s" % event)
        self.watcher.track_event(event)


text:
typedef uint_fast16_t Square;
#define SQUARE(x, y) (((x) << 8) | (y))
#define SQUARE_X(s) ((s) >> 8)
#define SQUARE_Y(s) ((s) & 0xF)

#define NULL_SQUARE ((Square)(~((Square)0)))

// Pieces are represented as shorts, with the MSB used to store the color, and
// the rest equal to one of a bunch of constants for the type of piece.
typedef unsigned short Piece;

typedef enum Player
{
	BLACK = 0,
	WHITE = 1,
} Player;

#define OTHER_PLAYER(p) ((p) == WHITE ? BLACK : WHITE)

// The order of these matters
typedef enum Piece_type
{
	EMPTY,
	PAWN,
	KNIGHT,
	BISHOP,
	ROOK,
	QUEEN,
	KING,
} Piece_type;

#define PIECE_TYPES 6

#define PLAYER(x) ((Player)((x) >> (sizeof(Piece) * 8 - 1)))
#define PIECE_TYPE(x) ((Piece_type)((x) & ~(1 << (sizeof(Piece) * 8 - 1))))
#define PIECE(p, t) ((Piece)(((p) << (sizeof(Piece) * 8 - 1)) | (t)))
#define NULL_PIECE ((unsigned short)-1)

typedef struct Castling
{
	bool kingside;
	bool queenside;
} Castling;

// The board is an array of pieces, plus some other information:
// * Whose turn it is
// * Castling availibility
// * En passant target square (if any)
// * Halfmoves since the last capture or pawn advance
// * Move number
//
// This is similar to FEN.
// The intention behind having all this information in the board object is so
// that no other information is required to determine any necessary information
// about a board position.
//
// However, this structure does not contain information necessary to determine
// if a draw can be claimed by threefold repetition. This is unlikely to
// matter, as the most common case of threefold repetition is perpetual check,
// in which case coming in part-way through does not matter. The other cases
// are rare enough that it doesn't seem worthwhile to overly complicate the
// board representation over them.
typedef struct Board
{
	Player turn;
	Castling castling[PLAYERS];
	Square en_passant;
	uint half_move_clock;
	uint move_number;

	Piece pieces[BOARD_SIZE * BOARD_SIZE];
} Board;

#define PIECE_AT(b, x, y) ((b)->pieces[((y) * BOARD_SIZE) + (x)])
#define PIECE_AT_SQUARE(b, square) PIECE_AT(b, SQUARE_X(square), SQUARE_Y(square))

void copy_board(Board *dst, Board *src);
Piece piece_from_char(char c);
char char_from_piece(Piece p);
bool from_fen(Board *board, const char *fen_str);
void print_board(Board *b);
bool in_check(Board *board, Player p);
bool checkmate(Board *board, Player p);
bool can_castle_kingside(Board *board, Player p);
bool can_castle_queenside(Board *board, Player p);

extern char *start_board_fen;

#endif // include guard


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IPropertyCollection.cs" company="Wild Gums">
//   Copyright (c) 2008 - 2015 Wild Gums. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Orc.FilterBuilder.Models
{
    using System.Collections.Generic;

    public interface IPropertyCollection
    {
        List<IPropertyMetadata> Properties { get; }

        IPropertyMetadata GetProperty(string propertyName);
    }
}


text:
var data =require('./data');

module.exports = function(app){
  return function addTenant(req, res, next){
    var tenant = data.getTenantByIssuer(req.user.iss);
    req.tenantName = tenant.name;
    next();
  };
};


text:
package misc;

public class Misc {

    public static void printInt(int number, final int base) {
        String conversion = "0123456789ABCDEF";
        char digit = (char) (number % base);
        number = number / base;
        if (number != 0) {
            printInt(number, base);
        }
        System.out.print("" + conversion.charAt(digit));
    }

    public static void main(String[] args) {
        printInt(30, 5);
    }
}


text:
class CommentingPolicy
  pattr_initialize :pull_request

  def allowed_for?(violation)
    unreported_violation_messages(violation).any?
  end

  private

  def unreported_violation_messages(violation)
    violation.messages - existing_violation_messages(violation)
  end

  def existing_violation_messages(violation)
    previous_comments_on_line(violation).map(&:body).
      flat_map { |body| body.split("<br>") }
  end

  def previous_comments_on_line(violation)
    existing_comments.select do |comment|
      comment.path == violation.filename && on_same_line?(violation, comment)
    end
  end

  def on_same_line?(violation, comment)
    if comment.position
      comment.position == violation.patch_position
    else
      comment.original_position == violation.patch_position
    end
  end

  def existing_comments
    @existing_comments ||= pull_request.comments
  end
end


text:
[HEADER]

 Desktop Search Status

[$~MESSAGE~$]

 Number of items
 Time of newest item

   Total searchable items
 [TOTAL_COUNT]
 [TOTAL_TIME]

        Emails
 [EMAIL_COUNT]
 [EMAIL_TIME]

        Chats
 [IM_COUNT]
 [IM_TIME]

        Web history
 [WEB_COUNT]
 [WEB_TIME]

        Files
 [FILE_COUNT]
 [FILE_TIME]

[FOOTER]


text:
//#define _XOPEN_SOURCE 600
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/spi/spidev.h>
#include <sys/socket.h>
#include <netdb.h>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include "SPIdev.h"

static const int buffer_length = 1024;

class UBXScanner {
public:
    enum State
    {
        Sync1,
        Sync2,
        Class,
        ID,
        Length1,
        Length2,
        Payload,
        CK_A,
        CK_B,
        Done
    };

    unsigned char message[buffer_length];   // Buffer for UBX message
    unsigned int message_length;    // Length of the received message

private:
    unsigned int position;          // Indicates current buffer offset
    unsigned int payload_length;  // Length of current message payload
    State state;                    // Current scanner state

public:
    UBXScanner();
    unsigned char* getMessage();
    unsigned int getMessageLength();
    unsigned int getPosition();
    void reset();
    int update(unsigned char data);
};

class UBXParser{
private:
    UBXScanner* scanner; // pointer to the scanner, which finds the messages in the data stream
    unsigned char* message; // pointer to the scanner's message buffer
    unsigned int length; // current message length
    unsigned int position; // current message end position

public:
    UBXParser(UBXScanner* ubxsc);
    void updateMessageData();
    int decodeMessage(std::vector<double>& data);
    int checkMessage();
};

class Ublox {
public:
enum message_t
{
    NAV_POSLLH = 0x0102,
    NAV_STATUS = 0x0103
};

private:
    std::string spi_device_name;
    UBXScanner* scanner;
    UBXParser* parser;

public:
    Ublox(std::string name = "/dev/spidev0.0");
    Ublox(std::string name, UBXScanner* scan, UBXParser* pars);
    int enableNAV_POSLLH();
    int enableNAV_STATUS();
    int testConnection();
    int decodeMessages();
    int decodeSingleMessage(message_t msg, std::vector<double>& position_data);
}; // end of ublox class def


text:
class FranchiseSerializer < ActiveModel::Serializer
  embed :ids, include: true

  attributes :id

  has_many :anime, embed_key: :slug
end


text:
using System.Runtime.InteropServices;

namespace guildwars.Extern
{
    [StructLayout(LayoutKind.Sequential)]
    internal struct HardwareInput
    {
        internal int uMsg;
        internal short wParamL;
        internal short wParamH;
    }
}


text:
"""
Manage and query Bower packages
===============================

This module manages the installed packages using Bower.
Note that npm, git and bower must be installed for this module to be
available.

"""

import logging
import shlex

import salt.utils.json
import salt.utils.path
from salt.exceptions import CommandExecutionError
from salt.utils.versions import LooseVersion as _LooseVersion

log = logging.getLogger(__name__)

# Function alias to make sure not to shadow built-in's
__func_alias__ = {"list_": "list"}

def __virtual__():
    """
    Only work when Bower is installed
    """
    if salt.utils.path.which("bower") is None:
        return (False, "The bower module could not be loaded: bower command not found")
    return True

def _check_valid_version():
    """
    Check the version of Bower to ensure this module will work. Currently
    bower must be at least version 1.3.
    """
    # pylint: disable=no-member
    bower_version = _LooseVersion(
        __salt__["cmd.run"]("{} --version".format(salt.utils.path.which("bower")))
    )
    valid_version = _LooseVersion("1.3")
    # pylint: enable=no-member
    if bower_version < valid_version:
        raise CommandExecutionError(
            "'bower' is not recent enough({} < {}). Please Upgrade.".format(
                bower_version, valid_version
            )
        )

def _construct_bower_command(bower_command):
    """
    Create bower command line string
    """
    if not bower_command:
        raise CommandExecutionError("bower_command, e.g. install, must be specified")

    cmd = [salt.utils.path.which("bower")] + shlex.split(bower_command)
    cmd.extend(
        [
            "--config.analytics",
            "false",
            "--config.interactive",
            "false",
            "--allow-root",
            "--json",
        ]
    )
    return cmd

def install(pkg, dir, pkgs=None, runas=None, env=None):
    """
    Install a Bower package.

    If no package is specified, the dependencies (from bower.json) of the
    package in the given directory will be installed.

    pkg
        A package name in any format accepted by Bower, including a version
        identifier

    dir
        The target directory in which to install the package

    pkgs
        A list of package names in the same format as the ``pkg`` parameter

    runas
        The user to run Bower with

    env
        Environment variables to set when invoking Bower. Uses the same ``env``
        format as the :py:func:`cmd.run <salt.modules.cmdmod.run>` execution
        function.

    CLI Example:

    .. code-block:: bash

        salt '*' bower.install underscore /path/to/project

        salt '*' bower.install jquery#2.0 /path/to/project

    """
    _check_valid_version()

    cmd = _construct_bower_command("install")

    if pkg:
        cmd.append(pkg)
    elif pkgs:
        cmd.extend(pkgs)

    result = __salt__["cmd.run_all"](
        cmd, cwd=dir, runas=runas, env=env, python_shell=False
    )

    if result["retcode"] != 0:
        raise CommandExecutionError(result["stderr"])

    # If package is already installed, Bower will emit empty dict to STDOUT
    stdout = salt.utils.json.loads(result["stdout"])
    return stdout != {}

def uninstall(pkg, dir, runas=None, env=None):
    """
    Uninstall a Bower package.

    pkg
        A package name in any format accepted by Bower

    dir
        The target directory from which to uninstall the package

    runas
        The user to run Bower with

    env
        Environment variables to set when invoking Bower. Uses the same ``env``
        format as the :py:func:`cmd.run <salt.modules.cmdmod.run>` execution
        function.

    CLI Example:

    .. code-block:: bash

        salt '*' bower.uninstall underscore /path/to/project

    """
    _check_valid_version()

    cmd = _construct_bower_command("uninstall")
    cmd.append(pkg)

    result = __salt__["cmd.run_all"](
        cmd, cwd=dir, runas=runas, env=env, python_shell=False
    )

    if result["retcode"] != 0:
        raise CommandExecutionError(result["stderr"])

    # If package is not installed, Bower will emit empty dict to STDOUT
    stdout = salt.utils.json.loads(result["stdout"])
    return stdout != {}

def list_(dir, runas=None, env=None):
    """
    List installed Bower packages.

    dir
        The directory whose packages will be listed

    runas
        The user to run Bower with

    env
        Environment variables to set when invoking Bower. Uses the same ``env``
        format as the :py:func:`cmd.run <salt.modules.cmdmod.run>` execution
        function.

    CLI Example:

    .. code-block:: bash

        salt '*' bower.list /path/to/project

    """
    _check_valid_version()

    cmd = _construct_bower_command("list")
    cmd.append("--offline")

    result = __salt__["cmd.run_all"](
        cmd, cwd=dir, runas=runas, env=env, python_shell=False
    )

    if result["retcode"] != 0:
        raise CommandExecutionError(result["stderr"])

    return salt.utils.json.loads(result["stdout"])["dependencies"]

def prune(dir, runas=None, env=None):
    """
    .. versionadded:: 2017.7.0

    Remove extraneous local Bower packages, i.e. those not referenced in bower.json

    dir
        The directory whose packages will be pruned

    runas
        The user to run Bower with

    env
        Environment variables to set when invoking Bower. Uses the same ``env``
        format as the :py:func:`cmd.run <salt.modules.cmdmod.run>` execution
        function.

    CLI Example:

    .. code-block:: bash

        salt '*' bower.prune /path/to/project

    """
    _check_valid_version()

    cmd = _construct_bower_command("prune")

    result = __salt__["cmd.run_all"](
        cmd, cwd=dir, runas=runas, env=env, python_shell=False
    )

    if result["retcode"] != 0:
        raise CommandExecutionError(result["stderr"])

    # Bower returns an empty dictionary if nothing was pruned
    return salt.utils.json.loads(result["stdout"])


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
using SyncTool.Common.Groups;

namespace SyncTool.Common.Test.Groups
{
    public class GroupStorageTest
    {

        [Fact]
        public void Constructor_throws_ArgumentException_if_path_is_null_or_whitespace()
        {
            Assert.Throws<ArgumentException>(() => new GroupStorage(null));
            Assert.Throws<ArgumentException>(() => new GroupStorage(""));
            Assert.Throws<ArgumentException>(() => new GroupStorage(" "));
            Assert.Throws<ArgumentException>(() => new GroupStorage("\t"));
        }

        [Fact]
        public void Constructor_throws_DirectoryNotFoundException_if_path_does_not_exist()
        {
            var randomPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
            Assert.Throws<DirectoryNotFoundException>(() => new GroupStorage(randomPath));
        }

        [Fact]
        public void Constructor_succeeds_for_existing_path()
        {
            var randomPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
            Directory.CreateDirectory(randomPath);

            _ = new GroupStorage(randomPath);

            Directory.Delete(randomPath);
        }

        [Fact]
        public void Constructor_converts_path_to_full_Path()
        {
            var name = Path.GetRandomFileName();
            var fullPath = Path.Combine(Path.GetTempPath(), name);
            Directory.CreateDirectory(fullPath);
            var path = Path.Combine(Path.GetTempPath(), name, "..", name);

            var instance = new GroupStorage(path);
            Assert.Equal(fullPath, instance.Path);

            Directory.Delete(fullPath);
        }

    }
}