text:
namespace Microsoft.Azure.Management.ServiceFabric
{
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Models;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Extension methods for ApplicationTypesOperations.
    /// </summary>
    public static partial class ApplicationTypesOperationsExtensions
    {
            /// <summary>
            /// Gets a Service Fabric application type name resource.
            /// </summary>
            /// <remarks>
            /// Get a Service Fabric application type name resource created or in the
            /// process of being created in the Service Fabric cluster resource.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='clusterName'>
            /// The name of the cluster resource.
            /// </param>
            /// <param name='applicationTypeName'>
            /// The name of the application type name resource.
            /// </param>
            public static ApplicationTypeResource Get(this IApplicationTypesOperations operations, string resourceGroupName, string clusterName, string applicationTypeName)
            {
                return operations.GetAsync(resourceGroupName, clusterName, applicationTypeName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets a Service Fabric application type name resource.
            /// </summary>
            /// <remarks>
            /// Get a Service Fabric application type name resource created or in the
            /// process of being created in the Service Fabric cluster resource.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='clusterName'>
            /// The name of the cluster resource.
            /// </param>
            /// <param name='applicationTypeName'>
            /// The name of the application type name resource.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ApplicationTypeResource> GetAsync(this IApplicationTypesOperations operations, string resourceGroupName, string clusterName, string applicationTypeName, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, clusterName, applicationTypeName, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Creates or updates a Service Fabric application type name resource.
            /// </summary>
            /// <remarks>
            /// Create or update a Service Fabric application type name resource with the
            /// specified name.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='clusterName'>
            /// The name of the cluster resource.
            /// </param>
            /// <param name='applicationTypeName'>
            /// The name of the application type name resource.
            /// </param>
            /// <param name='parameters'>
            /// The application type name resource.
            /// </param>
            public static ApplicationTypeResource CreateOrUpdate(this IApplicationTypesOperations operations, string resourceGroupName, string clusterName, string applicationTypeName, ApplicationTypeResource parameters)
            {
                return operations.CreateOrUpdateAsync(resourceGroupName, clusterName, applicationTypeName, parameters).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Creates or updates a Service Fabric application type name resource.
            /// </summary>
            /// <remarks>
            /// Create or update a Service Fabric application type name resource with the
            /// specified name.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='clusterName'>
            /// The name of the cluster resource.
            /// </param>
            /// <param name='applicationTypeName'>
            /// The name of the application type name resource.
            /// </param>
            /// <param name='parameters'>
            /// The application type name resource.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ApplicationTypeResource> CreateOrUpdateAsync(this IApplicationTypesOperations operations, string resourceGroupName, string clusterName, string applicationTypeName, ApplicationTypeResource parameters, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, applicationTypeName, parameters, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Deletes a Service Fabric application type name resource.
            /// </summary>
            /// <remarks>
            /// Delete a Service Fabric application type name resource with the specified
            /// name.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='clusterName'>
            /// The name of the cluster resource.
            /// </param>
            /// <param name='applicationTypeName'>
            /// The name of the application type name resource.
            /// </param>
            public static void Delete(this IApplicationTypesOperations operations, string resourceGroupName, string clusterName, string applicationTypeName)
            {
                operations.DeleteAsync(resourceGroupName, clusterName, applicationTypeName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Deletes a Service Fabric application type name resource.
            /// </summary>
            /// <remarks>
            /// Delete a Service Fabric application type name resource with the specified
            /// name.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='clusterName'>
            /// The name of the cluster resource.
            /// </param>
            /// <param name='applicationTypeName'>
            /// The name of the application type name resource.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task DeleteAsync(this IApplicationTypesOperations operations, string resourceGroupName, string clusterName, string applicationTypeName, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, applicationTypeName, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Gets the list of application type name resources created in the specified
            /// Service Fabric cluster resource.
            /// </summary>
            /// <remarks>
            /// Gets all application type name resources created or in the process of being
            /// created in the Service Fabric cluster resource.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='clusterName'>
            /// The name of the cluster resource.
            /// </param>
            public static ApplicationTypeResourceList List(this IApplicationTypesOperations operations, string resourceGroupName, string clusterName)
            {
                return operations.ListAsync(resourceGroupName, clusterName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets the list of application type name resources created in the specified
            /// Service Fabric cluster resource.
            /// </summary>
            /// <remarks>
            /// Gets all application type name resources created or in the process of being
            /// created in the Service Fabric cluster resource.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='clusterName'>
            /// The name of the cluster resource.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ApplicationTypeResourceList> ListAsync(this IApplicationTypesOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Deletes a Service Fabric application type name resource.
            /// </summary>
            /// <remarks>
            /// Delete a Service Fabric application type name resource with the specified
            /// name.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='clusterName'>
            /// The name of the cluster resource.
            /// </param>
            /// <param name='applicationTypeName'>
            /// The name of the application type name resource.
            /// </param>
            public static void BeginDelete(this IApplicationTypesOperations operations, string resourceGroupName, string clusterName, string applicationTypeName)
            {
                operations.BeginDeleteAsync(resourceGroupName, clusterName, applicationTypeName).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Deletes a Service Fabric application type name resource.
            /// </summary>
            /// <remarks>
            /// Delete a Service Fabric application type name resource with the specified
            /// name.
            /// </remarks>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='resourceGroupName'>
            /// The name of the resource group.
            /// </param>
            /// <param name='clusterName'>
            /// The name of the cluster resource.
            /// </param>
            /// <param name='applicationTypeName'>
            /// The name of the application type name resource.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task BeginDeleteAsync(this IApplicationTypesOperations operations, string resourceGroupName, string clusterName, string applicationTypeName, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, applicationTypeName, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

    }
}


text:
#pragma once
#include <aws/ec2/EC2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/ec2/model/InstanceStateName.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Xml
{
  class XmlNode;
} // namespace Xml
} // namespace Utils
namespace EC2
{
namespace Model
{

  /**
   *
Describes the current state of an instance.

See Also:
   AWS
   * API Reference

   */
  class AWS_EC2_API InstanceState
  {
  public:
    InstanceState();
    InstanceState(const Aws::Utils::Xml::XmlNode& xmlNode);
    InstanceState& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

    void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
    void OutputToStream(Aws::OStream& oStream, const char* location) const;

    /**
     *
The low byte represents the state. The high byte is an opaque internal value
     * and should be ignored.

 0 : pending
     *

 16 : running

     * 32 : shutting-down

 48
     * : terminated

 64 :
     * stopping

 80 : stopped
     *

     */
    inline int GetCode() const{ return m_code; }

    /**
     *
The low byte represents the state. The high byte is an opaque internal value
     * and should be ignored.

 0 : pending
     *

 16 : running

     * 32 : shutting-down

 48
     * : terminated

 64 :
     * stopping

 80 : stopped
     *

     */
    inline void SetCode(int value) { m_codeHasBeenSet = true; m_code = value; }

    /**
     *
The low byte represents the state. The high byte is an opaque internal value
     * and should be ignored.

 0 : pending
     *

 16 : running

     * 32 : shutting-down

 48
     * : terminated

 64 :
     * stopping

 80 : stopped
     *

     */
    inline InstanceState& WithCode(int value) { SetCode(value); return *this;}

    /**
     *
The current state of the instance.

     */
    inline const InstanceStateName& GetName() const{ return m_name; }

    /**
     *
The current state of the instance.

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

    /**
     *
The current state of the instance.

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

    /**
     *
The current state of the instance.

     */
    inline InstanceState& WithName(const InstanceStateName& value) { SetName(value); return *this;}

    /**
     *
The current state of the instance.

     */
    inline InstanceState& WithName(InstanceStateName&& value) { SetName(std::move(value)); return *this;}

  private:
    int m_code;
    bool m_codeHasBeenSet;
    InstanceStateName m_name;
    bool m_nameHasBeenSet;
  };

} // namespace Model
} // namespace EC2
} // namespace Aws

redpajama_set_name: RedPajamaGithub


text:
#ifndef CHARACTERPERFORMERCOMPONENT_H
#define CHARACTERPERFORMERCOMPONENT_H

#include <stack>
#include <vector>

#include "irrlicht.h"
#include "NREntitySystem.h"

#include "BaseComponent.h"
#include "CharacterObjective.h"
#include "ComponentSerializer.h"

/*
Includes only data about what the character is doing at any one time
TODO: add support for doing multiple things at once
*/
class CharacterTask;
class CharacterPerformerComponent : public BaseComponent {
public:
	struct TaskLayer {
		TaskLayer(CharacterTask* const task);

		CharacterTask* const task;
		std::vector<CharacterTaskCondition*> continuousConditions;
	};
public:
	CharacterObjective currentObjective; // Objective
	std::stack<TaskLayer> taskLayers; // Big stack of tasks
	CharacterTaskCondition* waitingFor = 0; // Waiting for this to be fulfilled first
	irr::f32 timeWaiting = 0; // How long we have been waiting for

	bool isBusy() const;

	CharacterPerformerComponent();
	virtual CharacterPerformerComponent* clone() const;
	virtual ~CharacterPerformerComponent();
};

class CharacterPerformerSerializer : public ComponentSerializer {
public:
	virtual nres::ComponentData* read(const Json::Value& data);
	virtual Json::Value write(const nres::ComponentData* data);
};

#endif // CHARACTERPERFORMERCOMPONENT_H


text:
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.conf import settings
from django.views.decorators.cache import cache_page
from .models import DocumentGroup, Document
from phoenix.decorators import specific_verified_email_required

# Create your views here.
@cache_page(60 * 15)
@specific_verified_email_required(domains=settings.ALLOWED_DOMAINS)
def documents(request):
    documentgroup_list = DocumentGroup.objects.all().order_by('title')
    context = {
        "entries": documentgroup_list
    }
    return render(request, "documents.html", context)

@specific_verified_email_required(domains=settings.ALLOWED_DOMAINS)
def document(request, uuid):
    document_obj = get_object_or_404(Document, pk=uuid)
    document_obj.downloads += 1
    document_obj.save()
    return HttpResponseRedirect(document_obj.filename.url)


text:
layout: page
title: Sponsors
description: SST is a free open source guide. Show your support by sponsoring SST.
---

[SST](https://sst.dev) is a free open source 1000+ page guide for building full-stack apps using Serverless and React on AWS. It attracts over 3.5K daily and 60K monthly visitors with over 230K page views per month. And we have over 20K email subscribers.

Learn to create a note taking app from scratch using Serverless and React. Follow our step-by-step tutorials with screenshots and code samples. And use [our forums](https://discourse.sst.dev) to ask us any questions.

SST is written and maintained by [Frank Wang](https://github.com/fwang) & [Jay V](https://github.com/jayair). It takes considerable effort to create and maintain such a detailed tutorial. We spend our spare time (and more) working on the tutorial and helping folks work through the steps. If you've found this guide useful or would like to support our work, please consider sponsoring SST. Your sponsorship helps us:

1. Create the most comprehensive serverless resource on the web
2. Build tools to help with the development process
3. Add additional chapters on advanced topics
4. Keep it up to date with screenshots and code samples
5. Help people resolve their issues in the comments
6. Keep our readers updated with our newsletter

Sponsor us on GitHub

---

## Backers

- [Nikos Katsikanis](http://quantumjs.com/)
- [Andrey Povazhnyi](https://www.tradingview.com)
- [Matthew Garmeson](https://www.patreon.com/user/creators?u=8250522)
- [Joseph Astrahan](https://poolservice123.com)
- [Leon Gilyadov](https://www.linkedin.com/in/leongilyadov/)
- [Zoran Maravic](https://www.patreon.com/user/creators?u=10942419)
- [Darryl Taylor](http://www.reversetelephonedirectoryinfo.com/)
- [Matthew Pick](https://www.patreon.com/user?u=12157649)
- [ArtificialChat](https://twitter.com/artificialchat)
- [Sasha Klien](https://sashafklein.com)
- [Alex Vainberg](https://www.youtube.com/arooly)
- [Klete Rittger](https://www.patreon.com/user/creators?u=14067972)
- [Malcolm Taylor](https://www.patreon.com/user/creators?u=17550173)
- [Matt Welke](https://mattwelke.com)
- [Jamie Peebles](https://www.patreon.com/user/creators?u=19140426)
- [Bernie Camus](https://www.lernard.com)
- [Tekeste Kidanu](https://cleanmock.com)
- [WiSEO](https://www.whatisseo.com)
- [Trevor Dorsey](https://www.foyyay.com/)
- [Cuspy Software](https://cuspy.io)
- [humanoit](https://github.com/humanoit)
- [Amir Arafat](https://github.com/amir5000)
- [Vince Fulco](https://github.com/weisisheng)
- [Peter Miller](https://github.com/phm200)
- [marxtrader](https://www.chrisranni.com)
- [Luis Ocasio](https://github.com/LuisOcasio)
- [Ryan Jackson](https://github.com/ryanauj)
- [Dynobase](https://dynobase.dev/)
- [Tim Shnaider](https://twitter.com/TimShnaider)
- [MichaelGMalek](https://github.com/MichaelGMalek)
- [Craig Barr](https://github.com/m0un10)
- [Dale Jacques](https://www.patreon.com/user/creators?u=43900227)
- [AppsGB](https://appsgb.com/)
- [Bill Bond](http://cerfing.net/)

We'd like thank our sponsors and backers for supporting us!


text:
<!DOCTYPE html>

    <title>Problem 3. Typeof variables</title>
    <link href="styles/js-console.css" rel="stylesheet" />


text:
FOUNDATION_EXPORT double RestKitVersionNumber;
FOUNDATION_EXPORT const unsigned char RestKitVersionString[];


text:
package br.puc_rio.ele.lvc.interimage.common;

import org.junit.Test;

import br.puc_rio.ele.lvc.interimage.common.WebMercatorLatLongConverter;

import com.vividsolutions.jts.geom.Coordinate;

import junit.framework.TestCase;

public class TestWebMercatorLatLongConverter extends TestCase {

	@Test
	public void testWebMercatorLatLongConverter() {
		WebMercatorLatLongConverter converter = new WebMercatorLatLongConverter();
		assertEquals(true, converter.hasDatum("WGS84"));
		assertEquals(6378137.0, converter.getDatum("WGS84")[0]);
		assertEquals(298.257223563, converter.getDatum("WGS84")[1]);
	}

	@Test
	public void testSetDatum() {
		WebMercatorLatLongConverter converter = new WebMercatorLatLongConverter();
		converter.setDatum("WGS84");
		assertEquals(6378137.0, converter.getEquatorialRadius());
	}

	@Test
	public void testLatLongToWebMercator() {	//data got from http://spatialreference.org
		WebMercatorLatLongConverter converter = new WebMercatorLatLongConverter();
		converter.setDatum("WGS84");
		Coordinate coord = new Coordinate(-50.39428710937, -11.810302734375);
		converter.LatLongToWebMercator(coord);
		assertEquals(-5609866.379905, coord.x, 1E-3);
		assertEquals(-1324127.19247, coord.y, 1E-3);
	}

	@Test
	public void testWebMercatorToLatLong() { // data got from http://spatialreference.org
		WebMercatorLatLongConverter converter = new WebMercatorLatLongConverter();
		converter.setDatum("WGS84");
		Coordinate coord = new Coordinate(-5609866.379905, -1324127.19247);
		converter.WebMercatorToLatLong(coord);
		assertEquals(-50.39428710937, coord.x, 1E-10);
		assertEquals(-11.810302734375, coord.y, 1E-10);
	}

}


text:
	<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">

	<link href='style/style.css' rel='stylesheet' />

hi

Proficiencies

Projects

Work

Education

Proficiencies

Projects

Work Experience

GrabCAD    Android Dev

						May 2013 - September 2013

Worked on a 3-person international team within the agile framework of scrum

Collaborated daily with both product and design departments to rapidly produce high quality features

Interfaced with Ruby on Rails API to show and organize content relating to collaborative CAD projects including the first 3D CAD file viewer on Android in history

Contributed over 23,000 lines of code through git source control management

Managed Alpha and Beta versions of app to elicit quick user feedback to rapidly fix issues and provide most useful features

Android app is currently live on  Google Play

Education

Olin College  of Engineering

						September 2012 - present

Majoring in Electrical and Computer Engineering

Project and team oriented culture that focuses on creating well rounded engineers for the real world

Emphasizes solving real problems

Recognizes that technology is progressing at a rate that makes learning specific technologies impractical and instead teaches students to pick up and learn system quickly and efficiently

Incredibly small size of 80 students per year allows for personalized education and strong sense of community

Ranked #6 Best Undergraduate Engineering Program by US News & World Report in 2012

See my transcript here

TOP


text:
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { RouterModule } from '@angular/router';

import { DemoSharedModule } from 'app/shared';
import { StarService, StarComponent, StarDetailComponent, starRoute } from './';

const ENTITY_STATES = [...starRoute];

@NgModule({
    imports: [DemoSharedModule, RouterModule.forChild(ENTITY_STATES)],
    declarations: [StarComponent, StarDetailComponent],
    entryComponents: [StarComponent],
    schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class DemoStarModule {}


text:
#include <assert.h>
#include <stdlib.h>

#include <dom/core/element.h>
#include <dom/core/node.h>
#include <dom/core/string.h>

#include "core/document.h"
#include "core/element.h"
#include "core/namednodemap.h"
#include "core/node.h"

#include "utils/utils.h"

/**
 * DOM named node map
 */
struct dom_namednodemap {
	dom_document *owner;	/**< Owning document */

	void *priv;			/**< Private data */

	struct nnm_operation *opt;	/**< The underlaid operation
		 			 * implementations */

	uint32_t refcnt;		/**< Reference count */
};

/**
 * Create a namednodemap
 *
 * \param doc   The owning document
 * \param priv  The private data of this dom_namednodemap
 * \param opt   The operation function pointer
 * \param map   Pointer to location to receive created map
 * \return DOM_NO_ERR on success, DOM_NO_MEM_ERR on memory exhaustion
 *
 * ::head must be a node owned by ::doc and must be either an Element or
 * DocumentType node.
 *
 * If ::head is of type Element, ::type must be DOM_ATTRIBUTE_NODE
 * If ::head is of type DocumentType, ::type may be either
 * DOM_ENTITY_NODE or DOM_NOTATION_NODE.
 *
 * The returned map will already be referenced, so the client need not
 * explicitly reference it. The client must unref the map once it is
 * finished with it.
 */
dom_exception _dom_namednodemap_create(dom_document *doc,
		void *priv, struct nnm_operation *opt,
		dom_namednodemap **map)
{
	dom_namednodemap *m;

	m = malloc(sizeof(dom_namednodemap));
	if (m == NULL)
		return DOM_NO_MEM_ERR;

	m->owner = doc;

	m->priv = priv;
	m->opt = opt;

	m->refcnt = 1;

	*map = m;

	return DOM_NO_ERR;
}

/**
 * Claim a reference on a DOM named node map
 *
 * \param map  The map to claim a reference on
 */
void dom_namednodemap_ref(dom_namednodemap *map)
{
	assert(map != NULL);
	map->refcnt++;
}

/**
 * Release a reference on a DOM named node map
 *
 * \param map  The map to release the reference from
 *
 * If the reference count reaches zero, any memory claimed by the
 * map will be released
 */
void dom_namednodemap_unref(dom_namednodemap *map)
{
	if (map == NULL)
		return;

	if (--map->refcnt == 0) {
		/* Call the implementation specific destroy */
		map->opt->namednodemap_destroy(map->priv);

		/* Destroy the map object */
		free(map);
	}
}

/**
 * Retrieve the length of a named node map
 *
 * \param map     Map to retrieve length of
 * \param length  Pointer to location to receive length
 * \return DOM_NO_ERR.
 */
dom_exception dom_namednodemap_get_length(dom_namednodemap *map,
		uint32_t *length)
{
	assert(map->opt != NULL);
	return map->opt->namednodemap_get_length(map->priv, length);
}

/**
 * Retrieve an item by name from a named node map
 *
 * \param map   The map to retrieve the item from
 * \param name  The name of the item to retrieve
 * \param node  Pointer to location to receive item
 * \return DOM_NO_ERR.
 *
 * The returned node will have had its reference count increased. The client
 * should unref the node once it has finished with it.
 */
dom_exception _dom_namednodemap_get_named_item(dom_namednodemap *map,
		dom_string *name, dom_node **node)
{
	assert(map->opt != NULL);
	return map->opt->namednodemap_get_named_item(map->priv, name, node);
}

/**
 * Add a node to a named node map, replacing any matching existing node
 *
 * \param map   The map to add to
 * \param arg   The node to add
 * \param node  Pointer to location to receive replaced node
 * \return DOM_NO_ERR                      on success,
 *         DOM_WRONG_DOCUMENT_ERR          if ::arg was created from a
 *                                         different document than ::map,
 *         DOM_NO_MODIFICATION_ALLOWED_ERR if ::map is readonly,
 *         DOM_INUSE_ATTRIBUTE_ERR         if ::arg is an Attr that is
 *                                         already an attribute on another
 *                                         Element,
 *         DOM_HIERARCHY_REQUEST_ERR       if the type of ::arg is not
 *                                         permitted as a member of ::map.
 *
 * ::arg's nodeName attribute will be used to store it in ::map. It will
 * be accessible using the nodeName attribute as the key for lookup.
 *
 * Replacing a node by itself has no effect.
 *
 * The returned node will have had its reference count increased. The client
 * should unref the node once it has finished with it.
 */
dom_exception _dom_namednodemap_set_named_item(dom_namednodemap *map,
		dom_node *arg, dom_node **node)
{
	assert(map->opt != NULL);
	return map->opt->namednodemap_set_named_item(map->priv, arg, node);
}

/**
 * Remove an item by name from a named node map
 *
 * \param map   The map to remove from
 * \param name  The name of the item to remove
 * \param node  Pointer to location to receive removed item
 * \return DOM_NO_ERR                      on success,
 *         DOM_NOT_FOUND_ERR               if there is no node named ::name
 *                                         in ::map,
 *         DOM_NO_MODIFICATION_ALLOWED_ERR if ::map is readonly.
 *
 * The returned node will have had its reference count increased. The client
 * should unref the node once it has finished with it.
 */
dom_exception _dom_namednodemap_remove_named_item(
		dom_namednodemap *map, dom_string *name,
		dom_node **node)
{
	assert(map->opt != NULL);
	return map->opt->namednodemap_remove_named_item(map->priv, name, node);
}

/**
 * Retrieve an item from a named node map
 *
 * \param map    The map to retrieve the item from
 * \param index  The map index to retrieve
 * \param node   Pointer to location to receive item
 * \return DOM_NO_ERR.
 *
 * ::index is a zero-based index into ::map.
 * ::index lies in the range [0, length-1]
 *
 * The returned node will have had its reference count increased. The client
 * should unref the node once it has finished with it.
 */
dom_exception _dom_namednodemap_item(dom_namednodemap *map,
		uint32_t index, dom_node **node)
{
	assert(map->opt != NULL);
	return map->opt->namednodemap_item(map->priv, index, node);
}

/**
 * Retrieve an item by namespace/localname from a named node map
 *
 * \param map        The map to retrieve the item from
 * \param namespace  The namespace URI of the item to retrieve
 * \param localname  The local name of the node to retrieve
 * \param node       Pointer to location to receive item
 * \return DOM_NO_ERR            on success,
 *         DOM_NOT_SUPPORTED_ERR if the implementation does not support the
 *                               feature "XML" and the language exposed
 *                               through the Document does not support
 *                               Namespaces.
 *
 * The returned node will have had its reference count increased. The client
 * should unref the node once it has finished with it.
 */
dom_exception _dom_namednodemap_get_named_item_ns(
		dom_namednodemap *map, dom_string *namespace,
		dom_string *localname, dom_node **node)
{
	assert(map->opt != NULL);
	return map->opt->namednodemap_get_named_item_ns(map->priv, namespace,
			localname, node);
}

/**
 * Add a node to a named node map, replacing any matching existing node
 *
 * \param map   The map to add to
 * \param arg   The node to add
 * \param node  Pointer to location to receive replaced node
 * \return DOM_NO_ERR                      on success,
 *         DOM_WRONG_DOCUMENT_ERR          if ::arg was created from a
 *                                         different document than ::map,
 *         DOM_NO_MODIFICATION_ALLOWED_ERR if ::map is readonly,
 *         DOM_INUSE_ATTRIBUTE_ERR         if ::arg is an Attr that is
 *                                         already an attribute on another
 *                                         Element,
 *         DOM_HIERARCHY_REQUEST_ERR       if the type of ::arg is not
 *                                         permitted as a member of ::map.
 *         DOM_NOT_SUPPORTED_ERR if the implementation does not support the
 *                               feature "XML" and the language exposed
 *                               through the Document does not support
 *                               Namespaces.
 *
 * ::arg's namespaceURI and localName attributes will be used to store it in
 * ::map. It will be accessible using the namespaceURI and localName
 * attributes as the keys for lookup.
 *
 * Replacing a node by itself has no effect.
 *
 * The returned node will have had its reference count increased. The client
 * should unref the node once it has finished with it.
 */
dom_exception _dom_namednodemap_set_named_item_ns(
		dom_namednodemap *map, dom_node *arg,
		dom_node **node)
{
	assert(map->opt != NULL);
	return map->opt->namednodemap_set_named_item_ns(map->priv, arg, node);
}

/**
 * Remove an item by namespace/localname from a named node map
 *
 * \param map        The map to remove from
 * \param namespace  The namespace URI of the item to remove
 * \param localname  The local name of the item to remove
 * \param node       Pointer to location to receive removed item
 * \return DOM_NO_ERR                      on success,
 *         DOM_NOT_FOUND_ERR               if there is no node named ::name
 *                                         in ::map,
 *         DOM_NO_MODIFICATION_ALLOWED_ERR if ::map is readonly.
 *         DOM_NOT_SUPPORTED_ERR if the implementation does not support the
 *                               feature "XML" and the language exposed
 *                               through the Document does not support
 *                               Namespaces.
 *
 * The returned node will have had its reference count increased. The client
 * should unref the node once it has finished with it.
 */
dom_exception _dom_namednodemap_remove_named_item_ns(
		dom_namednodemap *map, dom_string *namespace,
		dom_string *localname, dom_node **node)
{
	assert(map->opt != NULL);
	return map->opt->namednodemap_remove_named_item_ns(map->priv, namespace,
			localname, node);
}

/**
 * Compare whether two NamedNodeMap are equal.
 *
 */
bool _dom_namednodemap_equal(dom_namednodemap *m1,
		dom_namednodemap *m2)
{
	assert(m1->opt != NULL);
	return (m1->opt == m2->opt && m1->opt->namednodemap_equal(m1->priv,
			m2->priv));
}

/**
 * Update the dom_namednodemap to make it as a proxy of another object
 *
 * \param map	The dom_namednodemap
 * \param priv	The private data to change to
 */
void _dom_namednodemap_update(dom_namednodemap *map, void *priv)
{
	map->priv = priv;
}


text:
/*
 * index.js
 */

var Q = require('q'),
    qstart = require('qstart'),
    IScroll = require('iscroll'),
    MButton = require('../../../lib/index.js');

function main() {
    var h1 = document.querySelector('h1'),
        scrollView = new IScroll('#wrapper', {
            mouseWheel: true
        }),
        backBtn = new MButton.Touchend({
            el : document.getElementById('back'),
            monotouchable: true,
            f : function () {
                window.location = '../../index.html';
            }
        }),
        btn1 = new MButton.ScrollableY.Touchend({
            tolerance: 10,
            monotouchable: true,
            el : document.getElementById('btn1'),
            f : function () {
                h1.style.color = 'rgb(219, 96, 96)';
            }
        }),
        btn2 = new MButton.ScrollableY.Touchend({
            tolerance: 10,
            monotouchable: true,
            el : document.getElementById('btn2'),
            f : function () {
                 h1.style.color = 'rgb(77, 158, 77)';
            }
        }),
        btn3 = new MButton.ScrollableY.Touchend({
            tolerance: 10,
            monotouchable: true,
            el : document.getElementById('btn3'),
            f : function () {
                h1.style.color = 'rgb(77, 136, 182)';
            }
        });
}

qstart.then(main).done();


text:
<?php

namespace Banckle\Bundle\HelpdeskBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class BanckleHelpdeskBundle extends Bundle
{
}


text:
package padroesprojeto.criacional.factorymethod.sem.model;

/**
 * Created by felansu on 28/05/2015.
 */
public class DesenvolvedorPleno implements IDesenvolvedor {

    @Override
    public int getAnosExperiencia() {
        return 4;
    }

}


text:
<html>
<head>
<title>MolScript v2.1: Ras p21 VRML example</title>
  <link href="style.css" type="text/css" rel="stylesheet"></link>
</head>
<frameset rows="20%,*">
  <frame src="ras_top_text.html" name="text">
  <frame src="ras_min_vrml.wrl" name="vrml">
<noframes>
Sorry, this document requires a frames-enabled HTML browser.
<br>
Use the non-frames organization instead to view these VRML files.
</noframes>
</frameset>
</html>


text:
Required preparation
=========================

Prepare `$HOME/.ocamltter_auths`:

```
[ ("ocamlbot",
   { consumer= { key= "YOUR APP KEY";
                 secret= "YOUR APP SECRET" };
     users= []
   }
  )
]
```

What is APP KEY/SECRET and USER KEY/SECRET? Read Twitter API documentation!

If you want to write your own Twitter bot, start changing `"ocamlbot"` names in `bot.ml`.

How to run
=================

```
$ ./ocamlbot
```


text:
<?xml version="1.0" encoding="UTF-8"?>
<MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Document uuid="157d7cf9-7e60-4b74-be70-949b478d9d07">
		<InternalInfo>
			<xr:GeneratedType name="DocumentObject.ОперацияПоПлатежнойКарте" category="Object">
				<xr:TypeId>017982fc-ba97-409d-b037-d381ae02838f</xr:TypeId>
				<xr:ValueId>5df4decf-ffb0-4fee-bc08-11dd9c35d4ad</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="DocumentRef.ОперацияПоПлатежнойКарте" category="Ref">
				<xr:TypeId>180f5bb1-0350-4d6f-9ebd-f05f0482d2d7</xr:TypeId>
				<xr:ValueId>70884a53-53f4-4eb3-8aed-c62ed806d8ac</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="DocumentSelection.ОперацияПоПлатежнойКарте" category="Selection">
				<xr:TypeId>700681da-abd6-48a8-ad0f-8a4182193a0a</xr:TypeId>
				<xr:ValueId>9dde2911-9301-4767-96ae-9c57803b20e3</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="DocumentList.ОперацияПоПлатежнойКарте" category="List">
				<xr:TypeId>30137abd-6147-4fea-82f3-76198c4260fa</xr:TypeId>
				<xr:ValueId>fd1bb6e6-32d2-45e3-86ec-2e734266d7f3</xr:ValueId>
			</xr:GeneratedType>
			<xr:GeneratedType name="DocumentManager.ОперацияПоПлатежнойКарте" category="Manager">
				<xr:TypeId>8da32640-8775-4f86-b828-1748a51faec1</xr:TypeId>
				<xr:ValueId>3ce06be1-e2cd-4d1e-a2a2-00249e2dd9b4</xr:ValueId>
			</xr:GeneratedType>
		</InternalInfo>
		<Properties>
			<Name>ОперацияПоПлатежнойКарте</Name>
			<Synonym>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Операция по платежной карте</v8:content>
				</v8:item>
			</Synonym>
			<Comment/>
			<UseStandardCommands>true</UseStandardCommands>
			<Numerator/>
			<NumberType>String</NumberType>
			<NumberLength>11</NumberLength>
			<NumberAllowedLength>Fixed</NumberAllowedLength>
			<NumberPeriodicity>Year</NumberPeriodicity>
			<CheckUnique>true</CheckUnique>
			<Autonumbering>true</Autonumbering>
			<StandardAttributes>
				<xr:StandardAttribute name="Posted">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="Ref">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="DeletionMark">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip/>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:nil="true"/>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="Date">
					<xr:LinkByType/>
					<xr:FillChecking>ShowError</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Дата операции по платежной карте</v8:content>
						</v8:item>
					</xr:ToolTip>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:type="xs:dateTime">0001-01-01T00:00:00</xr:FillValue>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
				<xr:StandardAttribute name="Number">
					<xr:LinkByType/>
					<xr:FillChecking>DontCheck</xr:FillChecking>
					<xr:MultiLine>false</xr:MultiLine>
					<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
					<xr:CreateOnInput>Auto</xr:CreateOnInput>
					<xr:MaxValue xsi:nil="true"/>
					<xr:ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Номер документа</v8:content>
						</v8:item>
					</xr:ToolTip>
					<xr:ExtendedEdit>false</xr:ExtendedEdit>
					<xr:Format/>
					<xr:ChoiceForm/>
					<xr:QuickChoice>Auto</xr:QuickChoice>
					<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
					<xr:EditFormat/>
					<xr:PasswordMode>false</xr:PasswordMode>
					<xr:MarkNegatives>false</xr:MarkNegatives>
					<xr:MinValue xsi:nil="true"/>
					<xr:Synonym/>
					<xr:Comment/>
					<xr:FullTextSearch>Use</xr:FullTextSearch>
					<xr:ChoiceParameterLinks/>
					<xr:FillValue xsi:type="xs:string">         </xr:FillValue>
					<xr:Mask/>
					<xr:ChoiceParameters/>
				</xr:StandardAttribute>
			</StandardAttributes>
			<Characteristics>
				<xr:Characteristic>
					<xr:CharacteristicTypes from="Catalog.НаборыДополнительныхРеквизитовИСведений.TabularSection.ДополнительныеСведения">
						<xr:KeyField>Catalog.НаборыДополнительныхРеквизитовИСведений.TabularSection.ДополнительныеСведения.Attribute.Свойство</xr:KeyField>
						<xr:TypesFilterField>Catalog.НаборыДополнительныхРеквизитовИСведений.TabularSection.ДополнительныеСведения.StandardAttribute.Ref</xr:TypesFilterField>
						<xr:TypesFilterValue xsi:type="xr:DesignTimeRef">Catalog.НаборыДополнительныхРеквизитовИСведений.Документ_ОперацияПоПлатежнойКарте</xr:TypesFilterValue>
					</xr:CharacteristicTypes>
					<xr:CharacteristicValues from="InformationRegister.ДополнительныеСведения">
						<xr:ObjectField>InformationRegister.ДополнительныеСведения.Dimension.Объект</xr:ObjectField>
						<xr:TypeField>InformationRegister.ДополнительныеСведения.Dimension.Свойство</xr:TypeField>
						<xr:ValueField>InformationRegister.ДополнительныеСведения.Resource.Значение</xr:ValueField>
					</xr:CharacteristicValues>
				</xr:Characteristic>
			</Characteristics>
			<BasedOn>
				<xr:Item xsi:type="xr:MDObjectRef">Document.ЗаказКлиента</xr:Item>
				<xr:Item xsi:type="xr:MDObjectRef">Document.СчетНаОплатуКлиенту</xr:Item>
				<xr:Item xsi:type="xr:MDObjectRef">Document.ЗаявкаНаРасходованиеДенежныхСредств</xr:Item>
				<xr:Item xsi:type="xr:MDObjectRef">Document.РеализацияТоваровУслуг</xr:Item>
				<xr:Item xsi:type="xr:MDObjectRef">Document.АктВыполненныхРабот</xr:Item>
			</BasedOn>
			<InputByString>
				<xr:Field>Document.ОперацияПоПлатежнойКарте.StandardAttribute.Number</xr:Field>
			</InputByString>
			<CreateOnInput>Use</CreateOnInput>
			<SearchStringModeOnInputByString>Begin</SearchStringModeOnInputByString>
			<FullTextSearchOnInputByString>DontUse</FullTextSearchOnInputByString>
			<ChoiceDataGetModeOnInputByString>Directly</ChoiceDataGetModeOnInputByString>
			<DefaultObjectForm>Document.ОперацияПоПлатежнойКарте.Form.ФормаДокумента</DefaultObjectForm>
			<DefaultListForm>Document.ОперацияПоПлатежнойКарте.Form.ФормаСписка</DefaultListForm>
			<DefaultChoiceForm>Document.ОперацияПоПлатежнойКарте.Form.ФормаВыбора</DefaultChoiceForm>
			<AuxiliaryObjectForm/>
			<AuxiliaryListForm/>
			<AuxiliaryChoiceForm/>
			<Posting>Allow</Posting>
			<RealTimePosting>Allow</RealTimePosting>
			<RegisterRecordsDeletion>AutoDeleteOff</RegisterRecordsDeletion>
			<RegisterRecordsWritingOnPost>WriteSelected</RegisterRecordsWritingOnPost>
			<SequenceFilling>AutoFillOff</SequenceFilling>
			<RegisterRecords>
				<xr:Item xsi:type="xr:MDObjectRef">AccumulationRegister.РасчетыСКлиентами</xr:Item>
				<xr:Item xsi:type="xr:MDObjectRef">InformationRegister.СуммыДокументовВВалютеРегл</xr:Item>
				<xr:Item xsi:type="xr:MDObjectRef">AccumulationRegister.ДенежныеСредстваКВыплате</xr:Item>
				<xr:Item xsi:type="xr:MDObjectRef">AccumulationRegister.РасчетыСКлиентамиПоДокументам</xr:Item>
				<xr:Item xsi:type="xr:MDObjectRef">AccumulationRegister.РасчетыПоЭквайрингу</xr:Item>
			</RegisterRecords>
			<PostInPrivilegedMode>true</PostInPrivilegedMode>
			<UnpostInPrivilegedMode>true</UnpostInPrivilegedMode>
			<IncludeHelpInContents>false</IncludeHelpInContents>
			<DataLockFields/>
			<DataLockControlMode>Automatic</DataLockControlMode>
			<FullTextSearch>Use</FullTextSearch>
			<ObjectPresentation>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Эквайринговая операция</v8:content>
				</v8:item>
			</ObjectPresentation>
			<ExtendedObjectPresentation/>
			<ListPresentation>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Эквайринговые операции</v8:content>
				</v8:item>
			</ListPresentation>
			<ExtendedListPresentation/>
			<Explanation>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Регистрация оплаты клиентами с использованием платежных карт </v8:content>
				</v8:item>
			</Explanation>
			<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
		</Properties>
		<ChildObjects>
			<Attribute uuid="32212b4a-8193-4934-ba95-d3ed10bd7e8b">
				<Properties>
					<Name>Организация</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Организация</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>cfg:CatalogRef.Организации</v8:Type>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Организация предприятия, от имени которой оформляется документ.</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:type="xr:DesignTimeRef">Catalog.Организации.EmptyRef</FillValue>
					<FillChecking>ShowError</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="342692c4-1812-403c-82f9-981415df255c">
				<Properties>
					<Name>ХозяйственнаяОперация</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Хозяйственная операция</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>cfg:EnumRef.ХозяйственныеОперации</v8:Type>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Хозяйственная операция по платежной карте: поступление оплаты от клиента или возврат оплаты клиенту.</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:type="xr:DesignTimeRef">Enum.ХозяйственныеОперации.EnumValue.ПоступлениеОплатыОтКлиента</FillValue>
					<FillChecking>ShowError</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="aaea6696-8853-4364-b37d-d71392e5cd07">
				<Properties>
					<Name>Валюта</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Валюта</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>cfg:CatalogRef.Валюты</v8:Type>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Используется для указания валюты, в которой оформлен документ.</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:type="xr:DesignTimeRef">Catalog.Валюты.EmptyRef</FillValue>
					<FillChecking>DontCheck</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="fae2b246-aa5e-417f-82c7-ed7f0fc38986">
				<Properties>
					<Name>ДоговорЭквайринга</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Договор эквайринга</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>cfg:CatalogRef.ДоговорыЭквайринга</v8:Type>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Договор с банком, по которому осуществляется обслуживание операций по платежным картам.</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:type="xr:DesignTimeRef">Catalog.ДоговорыЭквайринга.EmptyRef</FillValue>
					<FillChecking>DontCheck</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="d246f82c-4de0-46e8-acb3-0c17d376ba73">
				<Properties>
					<Name>Контрагент</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Контрагент</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>cfg:CatalogRef.Контрагенты</v8:Type>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Клиент (регл.), от которого поступает оплата, или которому возвращается оплата</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:type="xr:DesignTimeRef">Catalog.Контрагенты.EmptyRef</FillValue>
					<FillChecking>ShowError</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="557ad4ee-e851-4cb7-9178-4bc0e4d515e8">
				<Properties>
					<Name>СуммаДокумента</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Сумма документа</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>xs:decimal</v8:Type>
						<v8:NumberQualifiers>
							<v8:Digits>15</v8:Digits>
							<v8:FractionDigits>2</v8:FractionDigits>
							<v8:AllowedSign>Nonnegative</v8:AllowedSign>
						</v8:NumberQualifiers>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Общая сумма операции по платежной карте</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>true</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:type="xs:decimal">0</FillValue>
					<FillChecking>DontCheck</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="d6caa25b-dc5a-49b7-972b-28fbdf52078a">
				<Properties>
					<Name>ЭквайринговыйТерминал</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Эквайринговый терминал</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>cfg:CatalogRef.ЭквайринговыеТерминалы</v8:Type>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Терминал регистрации оплат по платежным картам</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:type="xr:DesignTimeRef">Catalog.ЭквайринговыеТерминалы.EmptyRef</FillValue>
					<FillChecking>ShowError</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters>
						<app:item name="Отбор.РозничнаяТорговля">
							<app:value xsi:type="xs:boolean">false</app:value>
						</app:item>
					</ChoiceParameters>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="6174572a-aeaa-4767-a249-b40283f1cfef">
				<Properties>
					<Name>Касса</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Касса</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>cfg:CatalogRef.Кассы</v8:Type>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Касса, на которой установлен эквайринговый терминал.</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:type="xr:DesignTimeRef">Catalog.Кассы.EmptyRef</FillValue>
					<FillChecking>DontCheck</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="3b8d53b7-b8f4-4020-85e7-c8463c2db2f9">
				<Properties>
					<Name>ВидПлатежнойКарты</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Вид платежной карты</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>xs:string</v8:Type>
						<v8:StringQualifiers>
							<v8:Length>50</v8:Length>
							<v8:AllowedLength>Variable</v8:AllowedLength>
						</v8:StringQualifiers>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Вид платежной карты, по которой произведена операция</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:type="xs:string"/>
					<FillChecking>ShowError</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="d1776595-d075-41c9-bff9-da1f951298dd">
				<Properties>
					<Name>НомерПлатежнойКарты</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Номер платежной карты</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>xs:string</v8:Type>
						<v8:StringQualifiers>
							<v8:Length>22</v8:Length>
							<v8:AllowedLength>Variable</v8:AllowedLength>
						</v8:StringQualifiers>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Номер платежной карты, по которой произведена операция</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>false</FillFromFillingValue>
					<FillValue xsi:type="xs:string"/>
					<FillChecking>ShowError</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="f4097631-e975-4a3f-8833-fe1af35f610c">
				<Properties>
					<Name>ЗаявкаНаРасходованиеДенежныхСредств</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Заявка на расходование денежных средств</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>cfg:DocumentRef.ЗаявкаНаРасходованиеДенежныхСредств</v8:Type>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Заявка на расходование денежных средств по которой выдаются наличные денежные средства.</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:type="xr:DesignTimeRef">Document.ЗаявкаНаРасходованиеДенежныхСредств.EmptyRef</FillValue>
					<FillChecking>ShowError</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks>
						<xr:Link>
							<xr:Name>Отбор.Валюта</xr:Name>
							<xr:DataPath xsi:type="xs:string">Document.ОперацияПоПлатежнойКарте.Attribute.Валюта</xr:DataPath>
							<xr:ValueChange>Clear</xr:ValueChange>
						</xr:Link>
						<xr:Link>
							<xr:Name>Отбор.Организация</xr:Name>
							<xr:DataPath xsi:type="xs:string">Document.ОперацияПоПлатежнойКарте.Attribute.Организация</xr:DataPath>
							<xr:ValueChange>Clear</xr:ValueChange>
						</xr:Link>
						<xr:Link>
							<xr:Name>Отбор.ХозяйственнаяОперация</xr:Name>
							<xr:DataPath xsi:type="xs:string">Document.ОперацияПоПлатежнойКарте.Attribute.ХозяйственнаяОперация</xr:DataPath>
							<xr:ValueChange>Clear</xr:ValueChange>
						</xr:Link>
					</ChoiceParameterLinks>
					<ChoiceParameters>
						<app:item name="Отбор.Статус">
							<app:value xsi:type="xr:DesignTimeRef">Enum.СтатусыЗаявокНаРасходованиеДенежныхСредств.EnumValue.Утверждена</app:value>
						</app:item>
					</ChoiceParameters>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="00587bb4-ded1-4c18-99f1-69904617bfb7">
				<Properties>
					<Name>ОплатаВыполнена</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Оплата выполнена</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>xs:boolean</v8:Type>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip/>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>false</FillFromFillingValue>
					<FillValue xsi:nil="true"/>
					<FillChecking>DontCheck</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="f517ae9b-6c7f-45af-91d5-7c3dcf2d30df">
				<Properties>
					<Name>НеКонтролироватьЗаполнениеЗаявки</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Не контролировать заполнение заявки</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>xs:boolean</v8:Type>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>При проведении документа не контролировать заполнение заявки на расходование денежных средств.</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>false</FillFromFillingValue>
					<FillValue xsi:nil="true"/>
					<FillChecking>DontCheck</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="5224de30-43e3-49d5-9d11-f9964be6b3ad">
				<Properties>
					<Name>СтатьяДвиженияДенежныхСредств</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Статья ДДС</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>cfg:CatalogRef.СтатьиДвиженияДенежныхСредств</v8:Type>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format/>
					<EditFormat/>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Статья движения денежных средств</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>true</FillFromFillingValue>
					<FillValue xsi:nil="true"/>
					<FillChecking>ShowError</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks>
						<xr:Link>
							<xr:Name>Отбор.ХозяйственнаяОперация</xr:Name>
							<xr:DataPath xsi:type="xs:string">Document.ОперацияПоПлатежнойКарте.Attribute.ХозяйственнаяОперация</xr:DataPath>
							<xr:ValueChange>DontChange</xr:ValueChange>
						</xr:Link>
					</ChoiceParameterLinks>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Attribute uuid="0ea1f8e2-e1b9-4bed-a644-d2e5a157637a">
				<Properties>
					<Name>НомерЧекаККМ</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Номер чека ККМ</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Type>
						<v8:Type>xs:decimal</v8:Type>
						<v8:NumberQualifiers>
							<v8:Digits>4</v8:Digits>
							<v8:FractionDigits>0</v8:FractionDigits>
							<v8:AllowedSign>Any</v8:AllowedSign>
						</v8:NumberQualifiers>
					</Type>
					<PasswordMode>false</PasswordMode>
					<Format>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>ЧЦ=4; ЧН=0; ЧВН=; ЧГ=</v8:content>
						</v8:item>
					</Format>
					<EditFormat>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>ЧЦ=4; ЧН=0; ЧВН=; ЧГ=</v8:content>
						</v8:item>
					</EditFormat>
					<ToolTip>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Номер чека, пробитого на фискальном регистраторе</v8:content>
						</v8:item>
					</ToolTip>
					<MarkNegatives>false</MarkNegatives>
					<Mask/>
					<MultiLine>false</MultiLine>
					<ExtendedEdit>false</ExtendedEdit>
					<MinValue xsi:nil="true"/>
					<MaxValue xsi:nil="true"/>
					<FillFromFillingValue>false</FillFromFillingValue>
					<FillValue xsi:nil="true"/>
					<FillChecking>DontCheck</FillChecking>
					<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
					<ChoiceParameterLinks/>
					<ChoiceParameters/>
					<QuickChoice>Auto</QuickChoice>
					<CreateOnInput>Auto</CreateOnInput>
					<ChoiceForm/>
					<LinkByType/>
					<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
					<Indexing>DontIndex</Indexing>
					<FullTextSearch>Use</FullTextSearch>
				</Properties>
			</Attribute>
			<Form>ФормаДокумента</Form>
			<Form>ФормаСписка</Form>
			<Form>ФормаВыбора</Form>
			<Form>ФормаСпискаДокументов</Form>
			<TabularSection uuid="a78be934-b1f9-4f8f-a5f8-c7991dd31166">
				<InternalInfo>
					<xr:GeneratedType name="DocumentTabularSection.ОперацияПоПлатежнойКарте.РасшифровкаПлатежа" category="TabularSection">
						<xr:TypeId>fa9a9149-c398-4ed0-b543-ca5f6ad3c836</xr:TypeId>
						<xr:ValueId>ba965a44-07bd-4ef0-92f2-ec7022e6d1c9</xr:ValueId>
					</xr:GeneratedType>
					<xr:GeneratedType name="DocumentTabularSectionRow.ОперацияПоПлатежнойКарте.РасшифровкаПлатежа" category="TabularSectionRow">
						<xr:TypeId>4d9c3712-e912-40e2-b8d0-0240bfd61290</xr:TypeId>
						<xr:ValueId>4e403371-26df-4c48-a50c-47256f3b3573</xr:ValueId>
					</xr:GeneratedType>
				</InternalInfo>
				<Properties>
					<Name>РасшифровкаПлатежа</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Расшифровка платежа</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<ToolTip/>
					<FillChecking>ShowError</FillChecking>
					<StandardAttributes>
						<xr:StandardAttribute name="LineNumber">
							<xr:LinkByType/>
							<xr:FillChecking>DontCheck</xr:FillChecking>
							<xr:MultiLine>false</xr:MultiLine>
							<xr:FillFromFillingValue>false</xr:FillFromFillingValue>
							<xr:CreateOnInput>Auto</xr:CreateOnInput>
							<xr:MaxValue xsi:nil="true"/>
							<xr:ToolTip/>
							<xr:ExtendedEdit>false</xr:ExtendedEdit>
							<xr:Format/>
							<xr:ChoiceForm/>
							<xr:QuickChoice>Auto</xr:QuickChoice>
							<xr:ChoiceHistoryOnInput>Auto</xr:ChoiceHistoryOnInput>
							<xr:EditFormat/>
							<xr:PasswordMode>false</xr:PasswordMode>
							<xr:MarkNegatives>false</xr:MarkNegatives>
							<xr:MinValue xsi:nil="true"/>
							<xr:Synonym/>
							<xr:Comment/>
							<xr:FullTextSearch>Use</xr:FullTextSearch>
							<xr:ChoiceParameterLinks/>
							<xr:FillValue xsi:nil="true"/>
							<xr:Mask/>
							<xr:ChoiceParameters/>
						</xr:StandardAttribute>
					</StandardAttributes>
				</Properties>
				<ChildObjects>
					<Attribute uuid="737dae07-7788-49ba-9f6a-6b734d05dece">
						<Properties>
							<Name>Партнер</Name>
							<Synonym>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>Партнер</v8:content>
								</v8:item>
							</Synonym>
							<Comment/>
							<Type>
								<v8:Type>cfg:CatalogRef.Партнеры</v8:Type>
							</Type>
							<PasswordMode>false</PasswordMode>
							<Format/>
							<EditFormat/>
							<ToolTip>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>Клиент (упр.), от которого поступает оплата, или которому возвращается оплата.</v8:content>
								</v8:item>
							</ToolTip>
							<MarkNegatives>false</MarkNegatives>
							<Mask/>
							<MultiLine>false</MultiLine>
							<ExtendedEdit>false</ExtendedEdit>
							<MinValue xsi:nil="true"/>
							<MaxValue xsi:nil="true"/>
							<FillChecking>ShowError</FillChecking>
							<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
							<ChoiceParameterLinks>
								<xr:Link>
									<xr:Name>Контрагент</xr:Name>
									<xr:DataPath xsi:type="xs:string">Document.ОперацияПоПлатежнойКарте.Attribute.Контрагент</xr:DataPath>
									<xr:ValueChange>Clear</xr:ValueChange>
								</xr:Link>
							</ChoiceParameterLinks>
							<ChoiceParameters>
								<app:item name="Отбор.Клиент">
									<app:value xsi:type="xs:boolean">true</app:value>
								</app:item>
							</ChoiceParameters>
							<QuickChoice>Auto</QuickChoice>
							<CreateOnInput>Auto</CreateOnInput>
							<ChoiceForm/>
							<LinkByType/>
							<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
							<Indexing>DontIndex</Indexing>
							<FullTextSearch>Use</FullTextSearch>
						</Properties>
					</Attribute>
					<Attribute uuid="6c5a8800-191a-48a9-9b0e-48bd750d33c5">
						<Properties>
							<Name>ОснованиеПлатежа</Name>
							<Synonym>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>Основание платежа</v8:content>
								</v8:item>
							</Synonym>
							<Comment/>
							<Type>
								<v8:Type>cfg:DocumentRef.ПоступлениеТоваровУслуг</v8:Type>
								<v8:Type>cfg:DocumentRef.ОтчетКомиссионера</v8:Type>
								<v8:Type>cfg:DocumentRef.ЗаказПоставщику</v8:Type>
								<v8:Type>cfg:CatalogRef.ДоговорыКонтрагентов</v8:Type>
								<v8:Type>cfg:DocumentRef.ОтчетПоКомиссииМеждуОрганизациями</v8:Type>
								<v8:Type>cfg:DocumentRef.ЗаявкаНаВозвратТоваровОтКлиента</v8:Type>
								<v8:Type>cfg:DocumentRef.ОтчетКомитенту</v8:Type>
								<v8:Type>cfg:DocumentRef.РеализацияУслугПрочихАктивов</v8:Type>
								<v8:Type>cfg:DocumentRef.РеализацияТоваровУслуг</v8:Type>
								<v8:Type>cfg:DocumentRef.СчетФактураВыданный</v8:Type>
								<v8:Type>cfg:DocumentRef.ПоступлениеУслугПрочихАктивов</v8:Type>
								<v8:Type>cfg:DocumentRef.АктВыполненныхРабот</v8:Type>
								<v8:Type>cfg:DocumentRef.ОтчетКомиссионераОСписании</v8:Type>
								<v8:Type>cfg:DocumentRef.ПередачаТоваровМеждуОрганизациями</v8:Type>
								<v8:Type>cfg:DocumentRef.СчетНаОплатуКлиенту</v8:Type>
								<v8:Type>cfg:DocumentRef.ЗаказКлиента</v8:Type>
							</Type>
							<PasswordMode>false</PasswordMode>
							<Format/>
							<EditFormat/>
							<ToolTip>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>Документ, по которому оформлена оплата</v8:content>
								</v8:item>
							</ToolTip>
							<MarkNegatives>false</MarkNegatives>
							<Mask/>
							<MultiLine>false</MultiLine>
							<ExtendedEdit>false</ExtendedEdit>
							<MinValue xsi:nil="true"/>
							<MaxValue xsi:nil="true"/>
							<FillChecking>DontCheck</FillChecking>
							<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
							<ChoiceParameterLinks>
								<xr:Link>
									<xr:Name>Отбор.Контрагент</xr:Name>
									<xr:DataPath xsi:type="xs:string">Document.ОперацияПоПлатежнойКарте.Attribute.Контрагент</xr:DataPath>
									<xr:ValueChange>Clear</xr:ValueChange>
								</xr:Link>
								<xr:Link>
									<xr:Name>Отбор.Организация</xr:Name>
									<xr:DataPath xsi:type="xs:string">Document.ОперацияПоПлатежнойКарте.Attribute.Организация</xr:DataPath>
									<xr:ValueChange>Clear</xr:ValueChange>
								</xr:Link>
							</ChoiceParameterLinks>
							<ChoiceParameters/>
							<QuickChoice>Auto</QuickChoice>
							<CreateOnInput>Auto</CreateOnInput>
							<ChoiceForm/>
							<LinkByType/>
							<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
							<Indexing>DontIndex</Indexing>
							<FullTextSearch>Use</FullTextSearch>
						</Properties>
					</Attribute>
					<Attribute uuid="a541d62a-f5c4-47ea-ad22-49d5a7899410">
						<Properties>
							<Name>Заказ</Name>
							<Synonym>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>Объект расчетов</v8:content>
								</v8:item>
							</Synonym>
							<Comment/>
							<Type>
								<v8:Type>cfg:DocumentRef.ОтчетКомиссионера</v8:Type>
								<v8:Type>cfg:CatalogRef.ДоговорыКонтрагентов</v8:Type>
								<v8:Type>cfg:DocumentRef.ОтчетПоКомиссииМеждуОрганизациями</v8:Type>
								<v8:Type>cfg:DocumentRef.ЗаявкаНаВозвратТоваровОтКлиента</v8:Type>
								<v8:Type>cfg:DocumentRef.ОтчетКомитенту</v8:Type>
								<v8:Type>cfg:DocumentRef.РеализацияУслугПрочихАктивов</v8:Type>
								<v8:Type>cfg:DocumentRef.РеализацияТоваровУслуг</v8:Type>
								<v8:Type>cfg:DocumentRef.АктВыполненныхРабот</v8:Type>
								<v8:Type>cfg:DocumentRef.ОтчетКомиссионераОСписании</v8:Type>
								<v8:Type>cfg:DocumentRef.ПередачаТоваровМеждуОрганизациями</v8:Type>
								<v8:Type>cfg:DocumentRef.ЗаказКлиента</v8:Type>
							</Type>
							<PasswordMode>false</PasswordMode>
							<Format/>
							<EditFormat/>
							<ToolTip>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>Документ расчетов с партнером</v8:content>
								</v8:item>
							</ToolTip>
							<MarkNegatives>false</MarkNegatives>
							<Mask/>
							<MultiLine>false</MultiLine>
							<ExtendedEdit>false</ExtendedEdit>
							<MinValue xsi:nil="true"/>
							<MaxValue xsi:nil="true"/>
							<FillChecking>DontCheck</FillChecking>
							<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
							<ChoiceParameterLinks>
								<xr:Link>
									<xr:Name>Отбор.Контрагент</xr:Name>
									<xr:DataPath xsi:type="xs:string">Document.ОперацияПоПлатежнойКарте.Attribute.Контрагент</xr:DataPath>
									<xr:ValueChange>Clear</xr:ValueChange>
								</xr:Link>
								<xr:Link>
									<xr:Name>Отбор.Организация</xr:Name>
									<xr:DataPath xsi:type="xs:string">Document.ОперацияПоПлатежнойКарте.Attribute.Организация</xr:DataPath>
									<xr:ValueChange>Clear</xr:ValueChange>
								</xr:Link>
							</ChoiceParameterLinks>
							<ChoiceParameters/>
							<QuickChoice>Auto</QuickChoice>
							<CreateOnInput>Auto</CreateOnInput>
							<ChoiceForm/>
							<LinkByType/>
							<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
							<Indexing>DontIndex</Indexing>
							<FullTextSearch>Use</FullTextSearch>
						</Properties>
					</Attribute>
					<Attribute uuid="a5664015-fd5d-4785-90da-83c5eb1d7409">
						<Properties>
							<Name>Сумма</Name>
							<Synonym>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>Сумма</v8:content>
								</v8:item>
							</Synonym>
							<Comment/>
							<Type>
								<v8:Type>xs:decimal</v8:Type>
								<v8:NumberQualifiers>
									<v8:Digits>15</v8:Digits>
									<v8:FractionDigits>2</v8:FractionDigits>
									<v8:AllowedSign>Nonnegative</v8:AllowedSign>
								</v8:NumberQualifiers>
							</Type>
							<PasswordMode>false</PasswordMode>
							<Format/>
							<EditFormat/>
							<ToolTip>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>Сумма платежа.</v8:content>
								</v8:item>
							</ToolTip>
							<MarkNegatives>true</MarkNegatives>
							<Mask/>
							<MultiLine>false</MultiLine>
							<ExtendedEdit>false</ExtendedEdit>
							<MinValue xsi:nil="true"/>
							<MaxValue xsi:nil="true"/>
							<FillChecking>ShowError</FillChecking>
							<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
							<ChoiceParameterLinks/>
							<ChoiceParameters/>
							<QuickChoice>Auto</QuickChoice>
							<CreateOnInput>Auto</CreateOnInput>
							<ChoiceForm/>
							<LinkByType/>
							<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
							<Indexing>DontIndex</Indexing>
							<FullTextSearch>Use</FullTextSearch>
						</Properties>
					</Attribute>
					<Attribute uuid="45de3013-b3d0-49b5-9ecb-ab2622796c34">
						<Properties>
							<Name>СуммаВзаиморасчетов</Name>
							<Synonym>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>Сумма взаиморасчетов</v8:content>
								</v8:item>
							</Synonym>
							<Comment/>
							<Type>
								<v8:Type>xs:decimal</v8:Type>
								<v8:NumberQualifiers>
									<v8:Digits>15</v8:Digits>
									<v8:FractionDigits>2</v8:FractionDigits>
									<v8:AllowedSign>Nonnegative</v8:AllowedSign>
								</v8:NumberQualifiers>
							</Type>
							<PasswordMode>false</PasswordMode>
							<Format/>
							<EditFormat/>
							<ToolTip>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>Сумма взаиморасчетов</v8:content>
								</v8:item>
							</ToolTip>
							<MarkNegatives>true</MarkNegatives>
							<Mask/>
							<MultiLine>false</MultiLine>
							<ExtendedEdit>false</ExtendedEdit>
							<MinValue xsi:nil="true"/>
							<MaxValue xsi:nil="true"/>
							<FillChecking>DontCheck</FillChecking>
							<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
							<ChoiceParameterLinks/>
							<ChoiceParameters/>
							<QuickChoice>Auto</QuickChoice>
							<CreateOnInput>Auto</CreateOnInput>
							<ChoiceForm/>
							<LinkByType/>
							<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
							<Indexing>DontIndex</Indexing>
							<FullTextSearch>Use</FullTextSearch>
						</Properties>
					</Attribute>
					<Attribute uuid="44f0d3da-5487-4e82-b0ff-6f794cb78256">
						<Properties>
							<Name>ВалютаВзаиморасчетов</Name>
							<Synonym>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>Валюта взаиморасчетов</v8:content>
								</v8:item>
							</Synonym>
							<Comment/>
							<Type>
								<v8:Type>cfg:CatalogRef.Валюты</v8:Type>
							</Type>
							<PasswordMode>false</PasswordMode>
							<Format/>
							<EditFormat/>
							<ToolTip>
								<v8:item>
									<v8:lang>ru</v8:lang>
									<v8:content>в валюте взаиморасчетов с партнером</v8:content>
								</v8:item>
							</ToolTip>
							<MarkNegatives>false</MarkNegatives>
							<Mask/>
							<MultiLine>false</MultiLine>
							<ExtendedEdit>false</ExtendedEdit>
							<MinValue xsi:nil="true"/>
							<MaxValue xsi:nil="true"/>
							<FillChecking>DontCheck</FillChecking>
							<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
							<ChoiceParameterLinks/>
							<ChoiceParameters/>
							<QuickChoice>Auto</QuickChoice>
							<CreateOnInput>Auto</CreateOnInput>
							<ChoiceForm/>
							<LinkByType/>
							<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
							<Indexing>DontIndex</Indexing>
							<FullTextSearch>Use</FullTextSearch>
						</Properties>
					</Attribute>
				</ChildObjects>
			</TabularSection>
			<Command uuid="884b93af-8602-4644-8f69-17b579eb91e5">
				<Properties>
					<Name>ЭквайринговыеОперации</Name>
					<Synonym>
						<v8:item>
							<v8:lang>ru</v8:lang>
							<v8:content>Эквайринговые операции</v8:content>
						</v8:item>
					</Synonym>
					<Comment/>
					<Group>NavigationPanelOrdinary</Group>
					<CommandParameterType/>
					<ParameterUseMode>Single</ParameterUseMode>
					<ModifiesData>false</ModifiesData>
					<Representation>Auto</Representation>
					<ToolTip/>
					<Picture/>
					<Shortcut/>
				</Properties>
			</Command>
		</ChildObjects>
	</Document>
</MetaDataObject>


text:
require 'fileutils'
require 'thor'

module Polymer
  class CLI < Thor

    include Thor::Actions

    class_option 'no-color', :type => :boolean, :default => false,
      :desc => 'Disable colours in output', :aliases => '--no-colour'

    def initialize(*args)
      super
      self.shell = Thor::Shell::Basic.new if options['no-color']
    end

    # --- bond ---------------------------------------------------------------

    desc 'bond [SPRITES]',
      'Creates the sprites specified by your .polymer or polymer.rb file'

    long_desc <<-DESC
      The bond task reads your project configuration and creates your shiny
      new sprites. If enabled, CSS and/or SCSS will also be written so as to
      make working with your sprites a little easier.

      You may specify exactly which sprites you want generated, otherwise
      Polymer will generate all sprites defined in your config file. Any
      sprite which has not changed since you last ran this command will not be
      re-generated unless you pass the --force option.
    DESC

    method_option :force, :type => :boolean, :default => false,
      :desc => 'Re-generates sprites whose sources have not changed'

    method_option :fast, :type => :boolean, :default => false,
      :desc => "Skip optimisation of images after they are generated"

    def bond(*sprites)
      project = find_project!

      # Determine which sprites we'll be working on.
      sprites = project.sprites.select do |sprite|
        if sprites.empty? or sprites.include?(sprite.name)
          # The user specified no sprites, or this sprite was requested.
          if project.cache.stale?(sprite) or options[:force]
            # Digest is different, user is forcing update or sprite file
            # has been deleted.
            project.cache.set(sprite)
          end
        end
      end

      # There's nothing to generate.
      return if sprites.empty?

      # Get on with it.
      sprites.each do |sprite|
        next unless sprite.save

        say_status('generated', sprite.name, :green)

        unless options[:fast]
          run_optimisation(sprite.save_path, sprite.name)

          # Store the cached image so that running polymer-optimise
          # skips this image.
          project.cache.set(sprite.save_path.relative_path_from(project.root))
        end
      end

      # Stylesheets.
      if SassGenerator.generate(project)
        say_status('written', 'Sass mixin', :green)
      end

      #process Processors::CSS,        project

      # Find sprites with deviant-width sources.
      sprites.each do |sprite|
        if deviants = DeviantFinder.find_deviants(sprite)
          say DeviantFinder.format_ui_message(sprite, deviants)
        end
      end

      # Finish by writing the new cache.
      project.cache.write

      # Clean up temporary directories from data URI sprites.
      if project.data_uri_sprites.any?
        FileUtils.remove_entry_secure(project.tmpdir)
      end

    rescue Polymer::MissingSource, Polymer::TargetNotWritable => e
      say Polymer.compress_lines(e.message), :red
      exit 1
    end

    # --- help ---------------------------------------------------------------

    # Provides customised help information using the man pages.
    # Nod-of-the-hat to Bundler.
    def help(command = nil)
      page_map = {
        # Main manual page.
         nil         => 'polymer.1',
        'polymer'    => 'polymer.1',

        # Sub-commands.
        'init'       => 'polymer-init.1',
        'bond'       => 'polymer-bond.1',
        'optimise'   => 'polymer-optimise.1',
        'optimize'   => 'polymer-optimise.1',
        'position'   => 'polymer-position.1',

        # Configuration format.
        'polymer(5)' => 'polymer.5',
        'polymer.5'  => 'polymer.5',
        '.polymer'   => 'polymer.5',
        'polymer.rb' => 'polymer.5',
        'config'     => 'polymer.5'
      }

      if page_map.has_key?(command)
        root = File.expand_path('../man', __FILE__)

        if groff_available?
          groff = 'groff -Wall -mtty-char -mandoc -Tascii'
          pager = ENV['MANPAGER'] || ENV['PAGER'] || 'more'

          Kernel.exec "#{groff} #{root}/#{page_map[command]} | #{pager}"
        else
          puts File.read("#{root}/#{page_map[command]}.txt")
        end
      else
        super
      end
    end

    # --- init ---------------------------------------------------------------

    desc 'init', 'Creates a new Polymer project in the current directory'

    long_desc <<-DESC
      In order to use Polymer, a .polymer configuration file must be created.
      The init task creates a sample configuration, and also adds a couple of
      example source images to demonstrate how to use Polymer to create your
      own sprite images.
    DESC

    method_option :sprites, :type => :string, :default => 'public/images',
      :desc => 'Default location to which generated sprites are saved'

    method_option :sources, :type => :string, :default => '<sprites>/sprites',
      :desc => 'Default location of source images'

    method_option 'no-examples', :type => :boolean, :default => false,
      :desc => "Disables copying of example source files"

    method_option :windows, :type => :boolean, :default => false,
      :desc => 'Create polymer.rb instead of .polymer for easier editing on ' \
               'Windows systems.'

    def init
      if File.exists?('.polymer')
        say 'A .polymer file already exists in this directory.', :red
        exit 1
      end

      project_dir = Pathname.new(Dir.pwd)

      config = {
        :sprites => options[:sprites],
        :sources => options[:sources].gsub(/<sprites>/, options[:sprites]),
        :windows => options[:windows]
      }

      filename  = options[:windows] ? 'polymer.rb' : '.polymer'
      polymerfile = project_dir + filename

      template 'polymer.tt', polymerfile, config

      # Clean up the template.
      contents = polymerfile.read.gsub(/\n{3,}/, "\n\n")
      polymerfile.open('w') { |file| file.puts contents }

      unless options['no-examples']
        directory 'sources',  project_dir + config[:sources]
      end

      say_status '', '-------------------------'
      say_status '', 'Your project was created!'
    end

    # --- optimise -----------------------------------------------------------

    desc 'optimise PATHS', 'Optimises PNG images at the given PATHS'

    long_desc <<-DESC
      Given a path to an image (or multiple images), runs Polymer's optimisers
      on the image. Requires that the paths be images to PNG files. Image
      paths are relative to the current working directory.
    DESC

    method_option :force, :type => :boolean, :default => false,
      :desc => "Re-optimise images which haven't changed since the last " \
               "time they were optimised; has no effect unless in a " \
               "project directory."

    map 'optimize' => :optimise

    def optimise(*paths)
      dir = Pathname.new(Dir.pwd)

      # Try to use the project cache.
      begin
        project = find_project
        cache   = project.cache
      rescue Polymer::MissingProject
        project, cache = nil, Polymer::Cache.new
      end

      paths = paths.map do |path|
        path = dir + path
        # If given a directory, append a glob which recursively looks
        # for PNG files, otherwise use the path literally.
        path.directory? ? Pathname.glob(path + '**' + '*.png') : path.cleanpath
      end.flatten

      paths.each do |path|
        relative = path.relative_path_from(dir)

        if options[:force] or cache.stale?(relative)
          run_optimisation(path, relative)
          cache.set(relative)
        end
      end

      cache.clean! if project
      cache.write
    end

    # --- position -----------------------------------------------------------

    desc 'position SOURCE', 'Shows the position of a source within a sprite'

    long_desc <<-DESC
      The position task shows you the position of a source image within a
      sprite and also shows the appropriate CSS statement for the source
      should you wish to create your own CSS files.

      You may supply the name of a source image; if a source image with the
      same name exists in multiple sprites, the positions of each of them will
      be shown to you. If you want a particular source, you may instead
      provide a "sprite/source" pair.
    DESC

    def position(source)
      project = find_project!

      if source.index('/')
        # Full sprite/source pair given.
        sprite, source = source.split('/', 2)

        if project.sprite(sprite)
          sprites = [project.sprite(sprite)]
        else
          say "No such sprite: #{sprite}", :red
          exit 1
        end
      else
        # Only a source name was given.
        sprites = project.sprites
      end

      # Remove sprites which don't have a matching source.
      sprites.reject! { |sprite| not sprite.source(source) }
      say("No such source: #{source}") && exit(1) if sprites.empty?

      say ""

      sprites.each do |sprite|
        say "#{sprite.name}/#{source}: #{sprite.position_of(source)}px", :green
        say "    #{Polymer::CSSGenerator.background_statement(sprite, source)}"
        say "  - or -"
        say "    #{Polymer::CSSGenerator.position_statement(sprite, source)}"
        say ""
      end
    end

    # --- version ------------------------------------------------------------

    desc 'version', "Shows the version of Polymer you're using"
    map '--version' => :version

    def version
      say "Polymer #{Polymer::VERSION}"
    end

    private # ----------------------------------------------------------------

    # Returns the Project for the current directory. Exits with a message if
    # no project could be found.
    #
    # @return [Polymer::Project]
    #
    def find_project!
      find_project
    rescue Polymer::MissingProject
      say Polymer.compress_lines(<<-ERROR), :red
        Couldn't find a Polymer project in the current directory, or any of
        the parent directories. Run "polymer init" if you want to create a new
        project here.
      ERROR
      exit 1
    end

    # Trys to find a project, and raises if one is not available.
    #
    # @return [Polymer::Project]
    #
    def find_project
      Polymer::DSL.load Polymer::Project.find_config(Dir.pwd)
    end

    # Runs optimisation on a given +path+.
    #
    # @param [Pathname] path
    #   Path to the file to optimise.
    # @param [String] name
    #   The name of the "thing" being optimised. This is the value shown to
    #   the user, and allows removal of the path prefix, or use of a sprite
    #   name.
    #
    def run_optimisation(path, name)
      # Ensure the file is a PNG.
      unless path.to_s =~ /\.png/
        say_status 'skipped', "#{name} - not a PNG", :yellow
        return
      end

      before = path.size
      say "  optimising  #{name} "
      reduction = Polymer::Optimisation.optimise_file(path)

      if reduction > 0
        saved = '- saved %.2fkb (%.1f' %
          [reduction.to_f / 1024, (reduction.to_f / before) * 100]
        say_status "\r\e[0K   optimised", "#{name} #{saved}%)", :green
      else
        say_status "\r\e[0K   optimised", "#{name} - no savings", :green
      end
    end

    # Returns if the current machine has groff available.
    #
    # @return [Boolean]
    #
    def groff_available?
      require 'rbconfig'

      if RbConfig::CONFIG["host_os"] =~ /(msdos|mswin|djgpp|mingw)/
        `which groff 2>NUL`
      else
        `which groff 2>/dev/null`
      end

      $? == 0
    end

    def self.source_root
      File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
    end

    # Temporary -- until the next Thor release.
    def self.banner(task, namespace = nil, subcommand = false)
      super.gsub(/^.*polymer/, 'polymer')
    end

  end # CLI
end # Polymer