text:
namespace phd
{
template <class ContainerAllocator>
struct doctor_cloudResponse_
{
  typedef doctor_cloudResponse_<ContainerAllocator> Type;

  doctor_cloudResponse_()
    : clouds()  {
    }
  doctor_cloudResponse_(const ContainerAllocator& _alloc)
    : clouds(_alloc)  {
  (void)_alloc;
    }

   typedef std::vector< ::phd::doctor_msg_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::phd::doctor_msg_<ContainerAllocator> >::other >  _clouds_type;
  _clouds_type clouds;

  typedef boost::shared_ptr< ::phd::doctor_cloudResponse_<ContainerAllocator> > Ptr;
  typedef boost::shared_ptr< ::phd::doctor_cloudResponse_<ContainerAllocator> const> ConstPtr;

}; // struct doctor_cloudResponse_

typedef ::phd::doctor_cloudResponse_<std::allocator<void> > doctor_cloudResponse;

typedef boost::shared_ptr< ::phd::doctor_cloudResponse > doctor_cloudResponsePtr;
typedef boost::shared_ptr< ::phd::doctor_cloudResponse const> doctor_cloudResponseConstPtr;

// constants requiring out of line definition

template<typename ContainerAllocator>
std::ostream& operator<<(std::ostream& s, const ::phd::doctor_cloudResponse_<ContainerAllocator> & v)
{
ros::message_operations::Printer< ::phd::doctor_cloudResponse_<ContainerAllocator> >::stream(s, "", v);
return s;
}

} // namespace phd

namespace ros
{
namespace message_traits
{

// BOOLTRAITS {'IsFixedSize': False, 'IsMessage': True, 'HasHeader': False}
// {'sensor_msgs': ['/opt/ros/indigo/share/sensor_msgs/cmake/../msg'], 'actionlib_msgs': ['/opt/ros/indigo/share/actionlib_msgs/cmake/../msg'], 'std_msgs': ['/opt/ros/indigo/share/std_msgs/cmake/../msg'], 'geometry_msgs': ['/opt/ros/indigo/share/geometry_msgs/cmake/../msg'], 'phd': ['/home/mike/catkin_ws/src/phd/msg']}

// !!!!!!!!!!! ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_parsed_fields', 'constants', 'fields', 'full_name', 'has_header', 'header_present', 'names', 'package', 'parsed_fields', 'short_name', 'text', 'types']

template <class ContainerAllocator>
struct IsFixedSize< ::phd::doctor_cloudResponse_<ContainerAllocator> >
  : FalseType
  { };

template <class ContainerAllocator>
struct IsFixedSize< ::phd::doctor_cloudResponse_<ContainerAllocator> const>
  : FalseType
  { };

template <class ContainerAllocator>
struct IsMessage< ::phd::doctor_cloudResponse_<ContainerAllocator> >
  : TrueType
  { };

template <class ContainerAllocator>
struct IsMessage< ::phd::doctor_cloudResponse_<ContainerAllocator> const>
  : TrueType
  { };

template <class ContainerAllocator>
struct HasHeader< ::phd::doctor_cloudResponse_<ContainerAllocator> >
  : FalseType
  { };

template <class ContainerAllocator>
struct HasHeader< ::phd::doctor_cloudResponse_<ContainerAllocator> const>
  : FalseType
  { };

template<class ContainerAllocator>
struct MD5Sum< ::phd::doctor_cloudResponse_<ContainerAllocator> >
{
  static const char* value()
  {
    return "2f19691a84376a2883697fa8233da957";
  }

  static const char* value(const ::phd::doctor_cloudResponse_<ContainerAllocator>&) { return value(); }
  static const uint64_t static_value1 = 0x2f19691a84376a28ULL;
  static const uint64_t static_value2 = 0x83697fa8233da957ULL;
};

template<class ContainerAllocator>
struct DataType< ::phd::doctor_cloudResponse_<ContainerAllocator> >
{
  static const char* value()
  {
    return "phd/doctor_cloudResponse";
  }

  static const char* value(const ::phd::doctor_cloudResponse_<ContainerAllocator>&) { return value(); }
};

template<class ContainerAllocator>
struct Definition< ::phd::doctor_cloudResponse_<ContainerAllocator> >
{
  static const char* value()
  {
    return "doctor_msg[] clouds\n\
\n\
\n\
================================================================================\n\
MSG: phd/doctor_msg\n\
sensor_msgs/PointCloud2 cloud_out\n\
float64[16] transform_mat\n\
float32 x\n\
float32 y\n\
float32 z\n\
float32 id\n\
\n\
================================================================================\n\
MSG: sensor_msgs/PointCloud2\n\
# This message holds a collection of N-dimensional points, which may\n\
# contain additional information such as normals, intensity, etc. The\n\
# point data is stored as a binary blob, its layout described by the\n\
# contents of the \"fields\" array.\n\
\n\
# The point cloud data may be organized 2d (image-like) or 1d\n\
# (unordered). Point clouds organized as 2d images may be produced by\n\
# camera depth sensors such as stereo or time-of-flight.\n\
\n\
# Time of sensor data acquisition, and the coordinate frame ID (for 3d\n\
# points).\n\
Header header\n\
\n\
# 2D structure of the point cloud. If the cloud is unordered, height is\n\
# 1 and width is the length of the point cloud.\n\
uint32 height\n\
uint32 width\n\
\n\
# Describes the channels and their layout in the binary data blob.\n\
PointField[] fields\n\
\n\
bool    is_bigendian # Is this data bigendian?\n\
uint32  point_step   # Length of a point in bytes\n\
uint32  row_step     # Length of a row in bytes\n\
uint8[] data         # Actual point data, size is (row_step*height)\n\
\n\
bool is_dense        # True if there are no invalid points\n\
\n\
================================================================================\n\
MSG: std_msgs/Header\n\
# Standard metadata for higher-level stamped data types.\n\
# This is generally used to communicate timestamped data \n\
# in a particular coordinate frame.\n\
# \n\
# sequence ID: consecutively increasing ID \n\
uint32 seq\n\
#Two-integer timestamp that is expressed as:\n\
# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\
# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\
# time-handling sugar is provided by the client library\n\
time stamp\n\
#Frame this data is associated with\n\
# 0: no frame\n\
# 1: global frame\n\
string frame_id\n\
\n\
================================================================================\n\
MSG: sensor_msgs/PointField\n\
# This message holds the description of one point entry in the\n\
# PointCloud2 message format.\n\
uint8 INT8    = 1\n\
uint8 UINT8   = 2\n\
uint8 INT16   = 3\n\
uint8 UINT16  = 4\n\
uint8 INT32   = 5\n\
uint8 UINT32  = 6\n\
uint8 FLOAT32 = 7\n\
uint8 FLOAT64 = 8\n\
\n\
string name      # Name of field\n\
uint32 offset    # Offset from start of point struct\n\
uint8  datatype  # Datatype enumeration, see above\n\
uint32 count     # How many elements in the field\n\
";
  }

  static const char* value(const ::phd::doctor_cloudResponse_<ContainerAllocator>&) { return value(); }
};

} // namespace message_traits
} // namespace ros

namespace ros
{
namespace serialization
{

  template<class ContainerAllocator> struct Serializer< ::phd::doctor_cloudResponse_<ContainerAllocator> >
  {
    template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
    {
      stream.next(m.clouds);
    }

    ROS_DECLARE_ALLINONE_SERIALIZER
  }; // struct doctor_cloudResponse_

} // namespace serialization
} // namespace ros

namespace ros
{
namespace message_operations
{

template<class ContainerAllocator>
struct Printer< ::phd::doctor_cloudResponse_<ContainerAllocator> >
{
  template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::phd::doctor_cloudResponse_<ContainerAllocator>& v)
  {
    s << indent << "clouds[]" << std::endl;
    for (size_t i = 0; i < v.clouds.size(); ++i)
    {
      s << indent << "  clouds[" << i << "]: ";
      s << std::endl;
      s << indent;
      Printer< ::phd::doctor_msg_<ContainerAllocator> >::stream(s, indent + "    ", v.clouds[i]);
    }
  }
};

} // namespace message_operations
} // namespace ros

#endif // PHD_MESSAGE_DOCTOR_CLOUDRESPONSE_H


text:
<?xml version="1.0"?>
<!--

-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd">
    <repository class="Mage\Downloadable\Test\Repository\DownloadableProduct">
        <dataset name="default">
            <field name="name" xsi:type="string">DownloadableProduct_%isolation%</field>
            <field name="sku" xsi:type="string">DownloadableProduct_%isolation%</field>
            <field name="visibility" xsi:type="string">Catalog, Search</field>
            <field name="status" xsi:type="string">Enabled</field>
            <field name="url_key" xsi:type="string">downloadable-product-%isolation%</field>
            <field name="price" xsi:type="array">
                <item name="value" xsi:type="string">100.00</item>
            </field>
            <field name="tax_class_id" xsi:type="array">
                <item name="dataset" xsi:type="string">Taxable Goods</item>
            </field>
            <field name="description" xsi:type="string">This is description for downloadable product.</field>
            <field name="short_description" xsi:type="string">This is short description for downloadable product.</field>
            <field name="stock_data" xsi:type="array">
                <item name="qty" xsi:type="string">1.0000</item>
                <item name="is_in_stock" xsi:type="string">In Stock</item>
            </field>
            <field name="is_virtual" xsi:type="string">Yes</field>
            <field name="downloadable_links" xsi:type="array">
                <item name="dataset" xsi:type="string">default</item>
            </field>
            <field name="downloadable_sample" xsi:type="array">
                <item name="dataset" xsi:type="string">default</item>
            </field>
            <field name="category_ids" xsi:type="array">
                <item name="dataset" xsi:type="string">default_subcategory</item>
            </field>
            <field name="website_ids" xsi:type="array">
                <item name="datasets" xsi:type="array">
                    <item name="0" xsi:type="string">main_website</item>
                </item>
            </field>
        </dataset>

        <dataset name="with_two_separately_links">
            <field name="name" xsi:type="string">Downloadable product %isolation%</field>
            <field name="sku" xsi:type="string">downloadable_product_%isolation%</field>
            <field name="visibility" xsi:type="string">Catalog, Search</field>
            <field name="status" xsi:type="string">Enabled</field>
            <field name="url_key" xsi:type="string">downloadable-product-%isolation%</field>
            <field name="price" xsi:type="array">
                <item name="value" xsi:type="string">20</item>
            </field>
            <field name="tax_class_id" xsi:type="array">
                <item name="dataset" xsi:type="string">Taxable Goods</item>
            </field>
            <field name="description" xsi:type="string">This is description for downloadable product with two separately
                links
            </field>
            <field name="short_description" xsi:type="string">This is short description for downloadable product with
                two separately links
            </field>
            <field name="stock_data" xsi:type="array">
                <item name="qty" xsi:type="string">111</item>
                <item name="is_in_stock" xsi:type="string">In Stock</item>
            </field>
            <field name="is_virtual" xsi:type="string">Yes</field>
            <field name="downloadable_links" xsi:type="array">
                <item name="dataset" xsi:type="string">with_two_separately_links</item>
            </field>
            <field name="downloadable_sample" xsi:type="array">
                <item name="dataset" xsi:type="string">default</item>
            </field>
            <field name="checkout_data" xsi:type="array">
                <item name="dataset" xsi:type="string">with_two_separately_links</item>
            </field>
            <field name="website_ids" xsi:type="array">
                <item name="dataset" xsi:type="array">
                    <item name="0" xsi:type="string">main_website</item>
                </item>
            </field>
        </dataset>

        <dataset name="with_two_separately_links_special_price_and_category">
            <field name="name" xsi:type="string">Downloadable product %isolation%</field>
            <field name="sku" xsi:type="string">downloadable_product_%isolation%</field>
            <field name="url_key" xsi:type="string">downloadable-product-%isolation%</field>
            <field name="price" xsi:type="array">
                <item name="value" xsi:type="string">30</item>
            </field>
            <field name="special_price" xsi:type="string">20</field>
            <field name="tax_class_id" xsi:type="array">
                <item name="dataset" xsi:type="string">Taxable Goods</item>
            </field>
            <field name="stock_data" xsi:type="array">
                <item name="qty" xsi:type="string">1111</item>
                <item name="is_in_stock" xsi:type="string">In Stock</item>
            </field>
            <field name="description" xsi:type="string">This is description for downloadable product with special
                price
            </field>
            <field name="short_description" xsi:type="string">This is short description for downloadable product with
                special price
            </field>
            <field name="status" xsi:type="string">Enabled</field>
            <field name="category_ids" xsi:type="array">
                <item name="dataset" xsi:type="string">default_subcategory</item>
            </field>
            <field name="visibility" xsi:type="string">Catalog, Search</field>
            <field name="is_virtual" xsi:type="string">Yes</field>
            <field name="website_ids" xsi:type="array">
                <item name="dataset" xsi:type="array">
                    <item name="0" xsi:type="string">main_website</item>
                </item>
            </field>
            <field name="downloadable_links" xsi:type="array">
                <item name="dataset" xsi:type="string">with_two_separately_links</item>
            </field>
            <field name="checkout_data" xsi:type="array">
                <item name="dataset" xsi:type="string">with_two_bought_links</item>
            </field>
        </dataset>

        <dataset name="with_two_separately_links_group_price_and_category">
            <field name="name" xsi:type="string">Downloadable product %isolation%</field>
            <field name="sku" xsi:type="string">downloadable_product_%isolation%</field>
            <field name="url_key" xsi:type="string">downloadable-product-%isolation%</field>
            <field name="price" xsi:type="array">
                <item name="value" xsi:type="string">30</item>
            </field>
            <field name="group_price" xsi:type="array">
                <item name="dataset" xsi:type="string">downloadable_with_tax</item>
            </field>
            <field name="tax_class_id" xsi:type="array">
                <item name="dataset" xsi:type="string">Taxable Goods</item>
            </field>
            <field name="stock_data" xsi:type="array">
                <item name="qty" xsi:type="string">1111</item>
                <item name="is_in_stock" xsi:type="string">In Stock</item>
            </field>
            <field name="description" xsi:type="string">This is description for downloadable product with group price
            </field>
            <field name="short_description" xsi:type="string">This is short description for downloadable product with
                group price
            </field>
            <field name="status" xsi:type="string">Enabled</field>
            <field name="category_ids" xsi:type="array">
                <item name="dataset" xsi:type="string">default_subcategory</item>
            </field>
            <field name="visibility" xsi:type="string">Catalog, Search</field>
            <field name="is_virtual" xsi:type="string">Yes</field>
            <field name="website_ids" xsi:type="array">
                <item name="dataset" xsi:type="array">
                    <item name="0" xsi:type="string">main_website</item>
                </item>
            </field>
            <field name="downloadable_links" xsi:type="array">
                <item name="dataset" xsi:type="string">with_two_separately_links</item>
            </field>
            <field name="checkout_data" xsi:type="array">
                <item name="dataset" xsi:type="string">with_two_bought_links</item>
            </field>
        </dataset>

        <dataset name="with_two_separately_links_custom_options_and_category">
            <field name="name" xsi:type="string">Downloadable product %isolation%</field>
            <field name="sku" xsi:type="string">downloadable_product_%isolation%</field>
            <field name="url_key" xsi:type="string">downloadable-product-%isolation%</field>
            <field name="price" xsi:type="array">
                <item name="value" xsi:type="string">20</item>
            </field>
            <field name="tax_class_id" xsi:type="array">
                <item name="dataset" xsi:type="string">Taxable Goods</item>
            </field>
            <field name="stock_data" xsi:type="array">
                <item name="qty" xsi:type="string">1111</item>
                <item name="is_in_stock" xsi:type="string">In Stock</item>
            </field>
            <field name="description" xsi:type="string">This is description for downloadable product with custom
                options
            </field>
            <field name="short_description" xsi:type="string">This is short description for downloadable product with
                custom options
            </field>
            <field name="status" xsi:type="string">Enabled</field>
            <field name="category_ids" xsi:type="array">
                <item name="dataset" xsi:type="string">default_subcategory</item>
            </field>
            <field name="visibility" xsi:type="string">Catalog, Search</field>
            <field name="is_virtual" xsi:type="string">Yes</field>
            <field name="website_ids" xsi:type="array">
                <item name="dataset" xsi:type="array">
                    <item name="0" xsi:type="string">main_website</item>
                </item>
            </field>
            <field name="downloadable_links" xsi:type="array">
                <item name="dataset" xsi:type="string">with_two_separately_links</item>
            </field>
            <field name="custom_options" xsi:type="array">
                <item name="dataset" xsi:type="string">drop_down_with_one_option_percent_price</item>
            </field>
            <field name="checkout_data" xsi:type="array">
                <item name="dataset" xsi:type="string">one_custom_option_and_downloadable_link</item>
            </field>
        </dataset>
    </repository>
</config>

redpajama_set_name: RedPajamaGithub


text:
.. include:: meta-persistent_get.rst

Retrieve a value from the Zotonic visitor record.

The visitor record's value for the ``key`` argument is returned::

  http://localhost:8000/api/base/persistent_get?key=foo

might return::

  {
      "key": "foo",
      "value": null
  }

If the value is undefined; or ::

  {
      "key": "foo",
      "value": "bar"
  }

If the value was set.

.. seealso:: :ref:`service-persistent_set`


text:
<?php

namespace FelixOnline\Admin\Ajax;

class actionAjaxHelper extends Core {
	public function run() {
		if(!array_key_exists('action', $_POST) || $_POST['action'] == '') {
			$this->error("Action not specified.", 400);
		}

		if(!array_key_exists('page', $_POST) || $_POST['page'] == '') {
			$this->error("Page not specified.", 400);
		}

		$action = $_POST['action'];
		$page = $_POST['page'];

		if(isset($_POST['pull'])) {
			$pullThrough = $_POST['pull'];
		} else {
			$pullThrough = null;
		}

		if(!array_key_exists('records', $_POST)) {
			$records = array();
		} else {
			$records = $_POST['records'];
		}

		$actionObj = 'FelixOnline\Admin\Actions\\'.$action;
		$app = \FelixOnline\Core\App::getInstance();

		try {
			if(!class_exists($actionObj)) {
				throw new \Exception('Could not find action');
			}

			$pageObj = new \FelixOnline\Admin\Page($page, true, $pullThrough);
			if(!$pageObj->lightLoad($page)) {
				throw new \Exception('You do not have permission to do this');
			}

			$data = $pageObj->getPageData();
			$data = $data['actions'][$action];

			if(isset($action['roles'])) {
				if(count(array_intersect($action['roles'], $app['env']['session']->session['roles'])) == 0) {
					throw new \Exception('You do not have permission to do this');
				}
			}

			$actionObj = new $actionObj($pageObj);
		} catch(\Exception $e) {
			$this->error($e->getMessage(), 500);
		}

		try {
			$message = $actionObj->run($records, $pullThrough);

			$this->success(array("message" => $message));
		} catch(\Exception $e) {
			$this->error($e->getMessage(), 400);
		}
	}
}


text:
<!doctype html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1">

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

        <link rel="stylesheet" href="css/main.css">
        <link rel="stylesheet" href="css/login.css">

        <title>UTT Arena 2015</title>

UTT Arena 2015

                    <form action="login" method="post">
                        <input type="text" class="form-control input-lg" placeholder="Identifiant" required autofocus>
                        <input type="password" class="form-control input-lg" placeholder="Motde passe" required>
                        <button class="btn btn-primary btn-lg btn-block" type="submit">Connexion</button>
                    </form>


text:
(function(window) {
    var AUDIO_RECORDER_WORKER = 'bower_components/pocketsphinx.js-lib/audioRecorderWorker.js';
    var AudioRecorder = function(source, cfg) {
	this.consumers = [];
	var config = cfg || {};
	var errorCallback = config.errorCallback || function() {};
	var inputBufferLength = config.inputBufferLength || 4096;
	var outputBufferLength = config.outputBufferLength || 4000;
	this.context = source.context;
	this.node = this.context.createScriptProcessor(inputBufferLength);
	var worker = new Worker(config.worker || AUDIO_RECORDER_WORKER);
	worker.postMessage({
	    command: 'init',
	    config: {
		sampleRate: this.context.sampleRate,
		outputBufferLength: outputBufferLength,
		outputSampleRate: (config.outputSampleRate || 16000)
	    }
	});
	var recording = false;
	this.node.onaudioprocess = function(e) {
	    if (!recording) return;
	    worker.postMessage({
		command: 'record',
		buffer: [
		    e.inputBuffer.getChannelData(0),
		    e.inputBuffer.getChannelData(1)
		]
	    });
	};
	this.start = function(data) {
	    this.consumers.forEach(function(consumer, y, z) {
                consumer.postMessage({ command: 'start', data: data });
		recording = true;
		return true;
	    });
	    recording = true;
	    return (this.consumers.length > 0);
	};
	this.stop = function() {
	    if (recording) {
		this.consumers.forEach(function(consumer, y, z) {
                    consumer.postMessage({ command: 'stop' });
		});
		recording = false;
	    }
	    worker.postMessage({ command: 'clear' });
	};
	this.cancel = function() {
	    this.stop();
	};
	myClosure = this;
	worker.onmessage = function(e) {
	    if (e.data.error && (e.data.error == "silent")) errorCallback("silent");
	    if ((e.data.command == 'newBuffer') && recording) {
		myClosure.consumers.forEach(function(consumer, y, z) {
                    consumer.postMessage({ command: 'process', data: e.data.data });
		});
	    }
	};
	source.connect(this.node);
	this.node.connect(this.context.destination);
    };
    window.AudioRecorder = AudioRecorder;
})(window);


text:
/***********************************************************************
    filename:   CEGUITreeProperties.h
    created:	5-13-07
    author:		Jonathan Welch (Based on Code by David Durant)
*************************************************************************/
/***************************************************************************
*   Copyright (C) 2004 - 2008 Paul D Turner & The CEGUI Development Team
*
*   Permission is hereby granted, free of charge, to any person obtaining
*   a copy of this software and associated documentation files (the
*   "Software"), to deal in the Software without restriction, including
*   without limitation the rights to use, copy, modify, merge, publish,
*   distribute, sublicense, and/or sell copies of the Software, and to
*   permit persons to whom the Software is furnished to do so, subject to
*   the following conditions:
*
*   The above copyright notice and this permission notice shall be
*   included in all copies or substantial portions of the Software.
*
*   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
*   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
*   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
*   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
*   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
*   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
*   OTHER DEALINGS IN THE SOFTWARE.
***************************************************************************/
#ifndef _CEGUITreeProperties_h_
#define _CEGUITreeProperties_h_

#include "CEGUIProperty.h"

// Start of CEGUI namespace section
namespace CEGUI
{

// Start of TreeProperties namespace section
/*!
\brief
	Namespace containing classes that make up the properties interface specific
    to the Tree class.
*/
namespace TreeProperties
{
/*!
\brief
	Property to access the sort setting of the Tree.

	\par Usage:
		- Name: Sort
		- Format: "[text]"

	\par Where [Text] is:
		- "True" to indicate the tree items should be sorted.
		- "False" to indicate the tree items should not be sorted.
*/
class Sort : public Property
{
public:
	Sort() : Property(
		"Sort",
		"Property to get/set the sort setting of the tree.  "
        "Value is either \"True\" or \"False\".",
		"False")
	{}

	String	get(const PropertyReceiver* receiver) const;
	void	set(PropertyReceiver* receiver, const String& value);
};

/*!
\brief
	Property to access the multi-select setting of the tree.

	\par Usage:
		- Name: MultiSelect
		- Format: "[text]"

	\par Where [Text] is:
		- "True" to indicate that multiple items may be selected.
		- "False" to indicate that only a single item may be selected.
*/
class MultiSelect : public Property
{
public:
	MultiSelect() : Property(
		"MultiSelect",
		"Property to get/set the multi-select setting of the tree.  "
        "Value is either \"True\" or \"False\".",
		"False")
	{}

	String	get(const PropertyReceiver* receiver) const;
	void	set(PropertyReceiver* receiver, const String& value);
};

/*!
\brief
	Property to access the 'always show' setting for the vertical scroll bar of
    the tree.

	\par Usage:
		- Name: ForceVertScrollbar
		- Format: "[text]"

	\par Where [Text] is:
		- "True" to indicate that the vertical scroll bar will always be shown.
		- "False" to indicate that the vertical scroll bar will only be shown
          when it is needed.
*/
class ForceVertScrollbar : public Property
{
public:
	ForceVertScrollbar() : Property(
		"ForceVertScrollbar",
		"Property to get/set the 'always show' setting for the vertical scroll "
        "bar of the tree.  Value is either \"True\" or \"False\".",
		"False")
	{}

	String	get(const PropertyReceiver* receiver) const;
	void	set(PropertyReceiver* receiver, const String& value);
};

/*!
\brief
	Property to access the 'always show' setting for the horizontal scroll bar
    of the tree.

	\par Usage:
		- Name: ForceHorzScrollbar
		- Format: "[text]"

	\par Where [Text] is:
		- "True" to indicate that the horizontal scroll bar will always be
          shown.
		- "False" to indicate that the horizontal scroll bar will only be shown
          when it is needed.
*/
class ForceHorzScrollbar : public Property
{
public:
	ForceHorzScrollbar() : Property(
		"ForceHorzScrollbar",
		"Property to get/set the 'always show' setting for the horizontal "
        "scroll bar of the tree.  Value is either \"True\" or \"False\".",
		"False")
	{}

	String	get(const PropertyReceiver* receiver) const;
	void	set(PropertyReceiver* receiver, const String& value);
};

/*!
\brief
    Property to access the show item tooltips setting of the tree.

    \par Usage:
        - Name: ItemTooltips
        - Format: "[text]"

    \par Where [Text] is:
        - "True" to indicate that the tooltip of the tree will be set by the
          item below the mouse pointer
        - "False" to indicate that the tree has a static tooltip.
*/
class ItemTooltips : public Property
{
public:
	ItemTooltips() : Property(
		"ItemTooltips",
		"Property to access the show item tooltips setting of the tree.  "
        "Value is either \"True\" or \"False\".",
		"False")
	{}

	String	get(const PropertyReceiver* receiver) const;
	void	set(PropertyReceiver* receiver, const String& value);
};

} // End of  TreeProperties namespace section

} // End of  CEGUI namespace section

#endif	// end of guard _CEGUITreeProperties_h_


text:
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/test', function() {
    $x = ["abc" => ["c" => 4, "b" => 2, "x" => [2,3,4]]];
    array_set($x, "abc.c", 80);
    array_set($x, "abc.x.0", 30);
    $c = array_get($x, "abc.x");
    $c[] = 50;
    array_set($x, "abc.x", $c);

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

// list of projects
Route::get('/', 'ProjectListController@showList');
Route::post('/', 'ProjectListController@addProject');

// remove project
Route::get('proj/{projName}/del', 'ProjectListController@removeProject');

// list of endpoints
Route::get('proj/{projName}', 'EndpointListController@showList');
Route::post('proj/{projName}', 'EndpointListController@addEndpoint');

// management of single endpoint
Route::get('proj/{projName}/edit/{endpointName}', 'SingleEndpointController@showEditable');
Route::post('proj/{projName}/edit/{endpointName}', 'SingleEndpointController@editEndpoint');

// remove endpoint
Route::get('proj/{projName}/edit/{endpointName}/del', 'SingleEndpointController@removeEndpoint');

// remove endpoint parameter
Route::get('proj/{projName}/edit/{endpointName}/param/del/{parameterId}', 'SingleEndpointController@removeParameter');

// query endpoint
Route::any('proj/{projName}/query/{endpointName}', 'SingleEndpointController@query');

// list of modifications
Route::get('proj/{projName}/mod', 'ModificationController@showList');
Route::post('proj/{projName}/mod', 'ModificationController@addModification');

// remove modification
Route::get('proj/{projName}/mod/del/{modId}', 'ModificationController@removeModification');

// edit modification
Route::get('proj/{projName}/mod/{modId}', 'ModificationController@showEditable');
Route::post('proj/{projName}/mod/{modId}', 'ModificationController@editModification');


text:
Running Luigi
-------------

Running from the Command Line
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The preferred way to run Luigi tasks is through the ``luigi`` command line tool
that will be installed with the pip package.

.. code-block:: python

    # my_module.py, available in your sys.path
    import luigi

    class MyTask(luigi.Task):
        x = luigi.IntParameter()
        y = luigi.IntParameter(default=45)

        def run(self):
            print(self.x + self.y)

Should be run like this

.. code-block:: console

        $ luigi --module my_module MyTask --x 123 --y 456 --local-scheduler

Or alternatively like this:

.. code-block:: console

        $ python -m luigi --module my_module MyTask --x 100 --local-scheduler

Note that if a parameter name contains '_', it should be replaced by '-'.
For example, if MyTask had a parameter called 'my_parameter':

.. code-block:: console

        $ luigi --module my_module MyTask --my-parameter 100 --local-scheduler

.. note:: Please make sure to always place task parameters behind the task family!

Running from Python code
^^^^^^^^^^^^^^^^^^^^^^^^

Another way to start tasks from Python code is using ``luigi.build(tasks, worker_scheduler_factory=None, **env_params)``
from ``luigi.interface`` module.

This way of running luigi tasks is useful if you want to get some dynamic parameters from another
source, such as database, or provide additional logic before you start tasks.

One notable difference is that ``build`` defaults to not using the identical process lock.
If you want to change this behaviour, just pass ``no_lock=False``.

.. code-block:: python

    class MyTask1(luigi.Task):
        x = luigi.IntParameter()
        y = luigi.IntParameter(default=0)

        def run(self):
            print(self.x + self.y)

    class MyTask2(luigi.Task):
        x = luigi.IntParameter()
        y = luigi.IntParameter(default=1)
        z = luigi.IntParameter(default=2)

        def run(self):
            print(self.x * self.y * self.z)

    if __name__ == '__main__':
        luigi.build([MyTask1(x=10), MyTask2(x=15, z=3)])

Also, it is possible to pass additional parameters to ``build`` such as host, port, workers and local_scheduler:

.. code-block:: python

    if __name__ == '__main__':
         luigi.build([MyTask1(x=1)], workers=5, local_scheduler=True)

To achieve some special requirements you can pass to ``build`` your  ``worker_scheduler_factory``
which will return your worker and/or scheduler implementations:

.. code-block:: python

    class MyWorker(Worker):
        # some custom logic

    class MyFactory:
      def create_local_scheduler(self):
          return scheduler.Scheduler(prune_on_get_work=True, record_task_history=False)

      def create_remote_scheduler(self, url):
          return rpc.RemoteScheduler(url)

      def create_worker(self, scheduler, worker_processes, assistant=False):
          # return your worker instance
          return MyWorker(
              scheduler=scheduler, worker_processes=worker_processes, assistant=assistant)

    if __name__ == '__main__':
        luigi.build([MyTask1(x=1)], worker_scheduler_factory=MyFactory())

In some cases (like task queue) it may be useful.

Response of luigi.build()/luigi.run()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- **Default response** By default *luigi.build()/luigi.run()* returns True if there were no scheduling errors. This is the same as the attribute ``LuigiRunResult.scheduling_succeeded``.

- **Detailed response** This is a response of type :class:`~luigi.execution_summary.LuigiRunResult`. This is obtained by passing a keyword argument ``detailed_summary=True`` to *build/run*. This response contains detailed information about the jobs.

  .. code-block:: python

    if __name__ == '__main__':
         luigi_run_result = luigi.build(..., detailed_summary=True)
         print(luigi_run_result.summary_text)

Luigi on Windows
^^^^^^^^^^^^^^^^

Most Luigi functionality works on Windows. Exceptions:

- Specifying multiple worker processes using the ``workers`` argument for
  ``luigi.build``, or using the ``--workers`` command line argument. (Similarly,
  specifying ``--worker-force-multiprocessing``). For most programs, this will
  result in failure (a common sight is ``BrokenPipeError``). The reason is that
  worker processes are assumed to be forked from the main process. Forking is
  `not possible <https://docs.python.org/dev/library/multiprocessing.html#contexts-and-start-methods>`_
  on Windows.
- Running the Luigi central scheduling server as a daemon (i.e. with ``--background``).
  Again, a Unix-only concept.


text:
/*
    Usage:

    $ ./Brightness ../images/baboon.jpg
*/

#include <iostream>

#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>

using namespace cv;

double alpha;  // simple contrast control
int beta;  // simple brightness control

int main(int argc, char** argv)
{
    // read the image
    Mat image = imread(argv[1]);
    Mat new_image = Mat::zeros(image.size(), image.type());

    // initialize the values
    std::cout << "Basic Linear Transforms " << std::endl;
    std::cout << "------------------------" << std::endl;
    std::cout << "* Enter the alpha value [1.0-3.0]: "; std::cin >> alpha;
    std::cout << "* Enter the beta value [0-100]: "; std::cin >> beta;

    // do the operation:
    // new_image(i, j) = alpha * image(i, j) + beta
    for (int y = 0; y < image.rows; y++)
    {
        for (int x = 0; x < image.cols; x++)
        {
            for (int c = 0; c < 3; c++)
            {
                new_image.at<Vec3b>(y, x)[c] = saturate_cast<uchar>( alpha * (image.at<Vec3b>(y, x)[c]) + beta);
            }
        }
    }

    // create windows
    namedWindow("Original Image", 1);
    namedWindow("New Image", 1);

    // show stuff
    imshow("Original Image", image);
    imshow("New Image", new_image);

    // wait until user press some key
    waitKey();
    return 0;
}


text:
"""
EasyBuild support for building and installing MetaVelvet, implemented as an easyblock

@author: Cedric Laczny (Uni.Lu)
@author: Fotis Georgatos (Uni.Lu)
@author: Kenneth Hoste (Ghent University)
"""

import os
import shutil

from easybuild.easyblocks.generic.configuremake import ConfigureMake
from easybuild.tools.build_log import EasyBuildError

class EB_MetaVelvet(ConfigureMake):
    """
    Support for building MetaVelvet
    """

    def configure_step(self):
        """
        No configure
        """
        pass

    def install_step(self):
        """
        Install by copying files to install dir
        """
        srcdir = self.cfg['start_dir']
        destdir = os.path.join(self.installdir, 'bin')
        srcfile = None
        # Get executable files: for i in $(find . -maxdepth 1 -type f -perm +111 -print | sed -e 's/\.\///g' | awk '{print "\""$0"\""}' | grep -vE "\.sh|\.html"); do echo -ne "$i, "; done && echo
        try:
            os.makedirs(destdir)
            for filename in ["meta-velvetg"]:
                srcfile = os.path.join(srcdir, filename)
                shutil.copy2(srcfile, destdir)
        except OSError, err:
            raise EasyBuildError("Copying %s to installation dir %s failed: %s", srcfile, destdir, err)

    def sanity_check_step(self):
        """Custom sanity check for MetaVelvet."""

        custom_paths = {
                        'files': ['bin/meta-velvetg'],
                        'dirs': []
                       }

        super(EB_MetaVelvet, self).sanity_check_step(custom_paths=custom_paths)


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.python.psi.impl;

import com.intellij.lang.ASTNode;
import com.intellij.util.ArrayUtil;
import com.jetbrains.python.PythonDialectsTokenSetProvider;
import com.jetbrains.python.psi.PyExpression;
import com.jetbrains.python.psi.PySequenceExpression;
import org.jetbrains.annotations.NotNull;

/**
 * @author Mikhail Golubev
 */
public abstract class PySequenceExpressionImpl extends PyElementImpl implements PySequenceExpression {
  public PySequenceExpressionImpl(ASTNode astNode) {
    super(astNode);
  }

  @Override
  public void deleteChildInternal(@NotNull ASTNode child) {
    if (ArrayUtil.contains(child.getPsi(), getElements())) {
      PyPsiUtils.deleteAdjacentCommaWithWhitespaces(this, child.getPsi());
    }
    super.deleteChildInternal(child);
  }

  @Override
  public PyExpression @NotNull [] getElements() {
    return childrenToPsi(PythonDialectsTokenSetProvider.INSTANCE.getExpressionTokens(), PyExpression.EMPTY_ARRAY);
  }

  @Override
  public boolean isEmpty() {
    return childToPsi(PythonDialectsTokenSetProvider.INSTANCE.getExpressionTokens()) == null;
  }
}


text:
package by.bsuir.verkpavel.courseproject.logic.tablemodel.concrete;

import java.util.List;

import by.bsuir.verkpavel.courseproject.dao.Entity;
import by.bsuir.verkpavel.courseproject.dao.entity.Salary;
import by.bsuir.verkpavel.courseproject.logic.tablemodel.GeneralDeliveryServiceTableModel;

public class SalaryTableModel extends GeneralDeliveryServiceTableModel {

    public SalaryTableModel(List<? extends Entity> beans) {
        super(beans);
    }

    public Class<?> getColumnClass(int columnIndex) {
        return String.class;
    }

    public int getColumnCount() {
        return 4;
    }

    public String getColumnName(int columnIndex) {
        switch (columnIndex) {
        case 0:
            return "Номер";
        case 1:
            return "Оклад";
        case 2:
            return "Повышающий коэффициент";
        case 3:
            return "Итог";

        }
        return "";
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        Salary bean = (Salary) getBeans().get(rowIndex);
        switch (columnIndex) {
        case 0:
            return bean.getIdSalary();
        case 1:
            return String.format("%.2f", bean.getBaseRate());
        case 2:
            return bean.getRaisingFactor();
        case 3:
            return String.format("%.2f", bean.getRaisingFactor() * bean.getBaseRate());
        }
        return "";
    }

}


text:
[![Build Status](https://travis-ci.org/patrickdappollonio/download-terraform-binaries.svg?branch=master)](https://travis-ci.org/patrickdappollonio/download-terraform-binaries)

A bash script to download the most up-to-date Terraform binaries per platform (or the version you want). This script, when executed,
will download the terraform compiled binary from the [terraform.io website](https://www.terraform.io/)
based on the [Hashicorp Checkpoint API](https://checkpoint.hashicorp.com/) or the
[Hashicorp releases page](https://releases.hashicorp.com/terraform/) -- as a way to find the latest
version available.

Unfortunately, Hashicorp does not provide a way to download the latest version of their software in an easy way,
[and with a fair reason](https://github.com/hashicorp/terraform/issues/9803#issuecomment-257903082), hence the
existence of the page you're reading.

## Usage

To execute it, simply run the following command:

```bash
bash <(curl -s https://raw.githubusercontent.com/patrickdappollonio/download-terraform-binaries/master/download_terraform_binaries.sh)
```
## Details

The script by default will save the binaries into the `$HOME` directory in a `terraform/` folder. Inside
that folder, there will be a folder for each platform you requested the download for. For example,
if you request the plarforms `windows`, `darwin` and `linux`, then you'll get a bin folder with the
following structure:

```
$ tree $HOME/terraform/
terraform/
├── darwin
├── linux
└── windows

3 directories
```

By default, **only the `terraform` binary for Linux** is downloaded (although you can change that,
see "Configuration" below). Also, **this tool can only download 64-bit binaries** (but it's not
difficult to modify the script to allow 32-bit too).

## Configuration

* `$TF_DOWNLOAD_PATH`: path to a folder where to store the terraform binaries. If ran locally (without the `bash curl` trick from above) this will automatically be set to `./bins/`.
* `$TF_PLATFORMS`: one or many terraform platforms separated by space (use quotes to pass more than one). The current available platforms at terraform are "darwin", "freebsd", "openbsd", "linux", "solaris" and "windows".
* `$TF_VERSION`: the version of terraform you want to download. By default, if nothing passed, it'll check against the terraform Checkpoint API to retrieve the latest version.


text:
<?php

/**
 * sfSympalMenuItemGroup filter form.
 *
 * @package    elf-ekb.ru
 * @subpackage filter
 * @author     Cluster Studio <clusterstudio@gmail.com>
 * @version    SVN: $Id: sfDoctrinePluginFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class sfSympalMenuItemGroupFormFilter extends PluginsfSympalMenuItemGroupFormFilter
{
  public function configure()
  {
  }
}


text:
@implementation ShareSDKTool

#pragma mark - ShareSDK 注册
+ (void)registerShareSDK
{
    NSLog(@"%s",__FUNCTION__);

    //registerApp 初始化SDK并且初始化第三方平台
    [ShareSDK registerApp:ShareAppKey
          activePlatforms:@[@(SSDKPlatformSubTypeWechatSession),
                            @(SSDKPlatformSubTypeWechatTimeline),
                            @(SSDKPlatformTypeQQ)]
                 onImport:^(SSDKPlatformType platformType) {
                     switch (platformType)
                     {
                         case SSDKPlatformTypeWechat:{
                             [ShareSDKConnector connectWeChat:[WXApi class]];
                             break;
                         }
//                         case SSDKPlatformTypeSinaWeibo:
//                             [ShareSDKConnector connectWeibo:[WeiboSDK class]];
//                             break;
                         case SSDKPlatformTypeQQ:
                             [ShareSDKConnector connectQQ:[QQApiInterface class] tencentOAuthClass:[TencentOAuth class]];
                             break;
                         default:
                             break;
                     }

                 } onConfiguration:^(SSDKPlatformType platformType, NSMutableDictionary *appInfo) {
                     switch (platformType)
                     {
                         case SSDKPlatformTypeWechat:
                             [appInfo SSDKSetupWeChatByAppId:WXAppID
                                                   appSecret:WXAppSecret];
                             break;
//                         case SSDKPlatformTypeSinaWeibo:
//                             //设置新浪微博应用信息,其中authType设置为使用SSO+Web形式授权
//                             [appInfo SSDKSetupSinaWeiboByAppKey:SinaShareAppKey
//                                                       appSecret:SinaShareAppSecret
//                                                     redirectUri:SinaOAuthWebAddress
//                                                        authType:SSDKAuthTypeBoth];
//                             break;
                         case SSDKPlatformTypeQQ:
                             [appInfo SSDKSetupQQByAppId:QQAppID
                                                  appKey:QQAppSecret
                                                authType:SSDKAuthTypeBoth];
                             break;
                         default:
                             break;
                     }
                 }
     ];
}

+ (void)shareContentWithShareContentType:(ShareContentType)shareContentType
                            contentTitle:(NSString *)contentTitle
                      contentDescription:(NSString *)contentDescription
                            contentImage:(id)contentImage
                              contentURL:(NSString *)contentURL
                              showInView:(UIView *)showInView
                                 success:(void (^)())success
                                 failure:(void (^)(NSString *failureInfo))failure
                     OtherResponseStatus:(void (^)(SSDKResponseState state))otherResponseStatus
{

    //0.区分分享类型
    SSDKContentType type;
    switch (shareContentType) {
        case ShareContentTypeAuto: // 自动适配类型,视传入的参数来决定
            type = SSDKContentTypeAuto;
            break;
        case ShareContentTypeText: //文本
            type = SSDKContentTypeText;
            break;

        case ShareContentTypeImage://图片
            type = SSDKContentTypeImage;
            break;

        case ShareContentTypeWebPage://网页
            type = SSDKContentTypeWebPage;
            break;

        case ShareContentTypeApp: //应用
            type = SSDKContentTypeApp;
            break;

        case ShareContentTypeAudio://音频
            type = SSDKContentTypeAudio;
            break;

        case ShareContentTypeVideo://视频
            type = SSDKContentTypeVideo;
            break;
        case ShareContentTypeFile://文件类型(暂时仅微信可用)
            type = SSDKContentTypeFile;
            break;

        default:
            break;
    }

    //1. 创建分享参数
    NSMutableDictionary *shareParams = [NSMutableDictionary dictionary];
    [shareParams SSDKEnableUseClientShare]; //这个参数控制是"应用内分享(网页分享)" 还是客户端分享. 不加的话是'应用内分享(网页分享)'

    [shareParams SSDKSetupShareParamsByText:contentDescription
                                     images:contentImage
                                        url:[NSURL URLWithString:contentURL]
                                      title:contentTitle
                                       type:type];

    //2. 分享,显示分享view
    SSUIShareActionSheetController *sheet =[ShareSDK showShareActionSheet:showInView
                                                                    items:nil
                                                              shareParams:shareParams
                                                      onShareStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error, BOOL end) {

                                                          NSLog(@"SSDKResponseState state:%lu",(unsigned long)state);
                                                          switch (state) {

                                                              case SSDKResponseStateBegin:
                                                              {
                                                                  //这里不填写
                                                                  break;
                                                              }
                                                              case SSDKResponseStateSuccess:
                                                              {
                                                                  NSLog(@"0");
                                                                  success();
                                                                  break;

                                                              }
                                                              case SSDKResponseStateFail:
                                                              {

                                                                  if (platformType == SSDKPlatformTypeSMS && [error code] == 201)
                                                                  {

                                                                      NSLog(@"1");

                                                                      failure(@"失败原因可能是:1、短信应用没有设置帐号;2、设备不支持短信应用;3、短信应用在iOS 7以上才能发送带附件的短                                                     信。");
                                                                      break;

                                                                  }
                                                                  else if(platformType == SSDKPlatformTypeMail && [error code] == 201)
                                                                  {

                                                                      NSLog(@"2");
                                                                      failure(@"失败原因可能是:1、邮件应用没有设置帐号;2、设备不支持邮件应用;");
                                                                      break;

                                                                  }
                                                                  else
                                                                  {

                                                                      NSLog(@"3");
                                                                      failure([NSString stringWithFormat:@"%@",error]);
                                                                      break;

                                                                  }
                                                                  break;
                                                              }
                                                              case SSDKResponseStateCancel:
                                                              {

                                                                  NSLog(@"4");
                                                                  //                           otherResponseStatus(SSDKResponseStateCancel); //捕获不准确
                                                                  break;

                                                              }
                                                              default:
                                                                  break;
                                                          }

                                                          if (state != SSDKResponseStateBegin)
                                                          {
                                                              NSLog(@"5");
                                                              //                         failure([NSString stringWithFormat:@"%@",error]);

                                                          }

                                                      }];

    [sheet.directSharePlatforms addObject:@(SSDKPlatformTypeSinaWeibo)]; //这句话是取消掉 sahreSDK自带的 分享内容编辑界面

}

+ (void)thirdLoginWithType:(SSDKPlatformType)type result:(ThirdLoginResult)loginResult
{

    [ShareSDK cancelAuthorize:type];

    [ShareSDK getUserInfo:type onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error) {

        switch (state) {
            case SSDKResponseStateSuccess:{

                loginResult(YES,nil);
            }
                break;
            case SSDKResponseStateFail:{

                loginResult(NO,error.localizedDescription);
            }
                break;
            default:
                break;
        }

    }];
}

@end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/>
    <title>Help</title>

    <link rel="stylesheet" type="text/css" href="../help-phone.css">

 Gestures

                aFreeRDP is designed for touch sensitive devices.
                These gestures let you do the most usual operations with your fingers.


text:
package org.apache.camel.example.rss;

import org.apache.camel.builder.RouteBuilder;

/**
 * A simple example router demonstrating the camel-rss component.
 */
public class MyRouteBuilder extends RouteBuilder {

    public void configure() {

        String rssURL = "https://issues.apache.org/jira/sr/jira.issueviews:searchrequest-rss/temp/SearchRequest.xml"
                + "?pid=12311211&sorter/field=issuekey&sorter/order=DESC&tempMax=1000&delay=10s";

        // START SNIPPET: e1
        from("rss:" + rssURL).
                marshal().rss().
                setBody(xpath("/rss/channel/item/title/text()")).
                transform(body().prepend("Jira: ")).
                to("log:jirabot?showHeaders=false&showExchangePattern=false&showBodyType=false").
                to("irc:JiraBot@irc.freenode.net/#jirabottest");
        // END SNIPPET: e1

    }
}


text:
'use strict';

define(['app'], function (app) {
    app.controller('ProductCtrl', ['$scope', '$state', 'resourceService', 'collectionService', 'Environment',
        function ($scope, $state, resourceService, collectionService, Environment) {

            var itemService = new resourceService('product');

            $scope.collectionTitle = 'Products';
            $scope.pageLimit = 20;
            $scope.pageNumber = 1;
            $scope.columns = [
                {name: 'id', enableColumnMenu: false, width: '100'},
                {name: 'locale', enableColumnMenu: false, width: '100'},
                {name: 'price', enableColumnMenu: false, width: '100'},
                {name: 'name', enableColumnMenu: false},
                {name: 'meta_url', enableColumnMenu: false},
                {name: 'description', enableColumnMenu: false},
                {name: 'created_at', enableColumnMenu: false},
                {name: 'status', enableColumnMenu: false},
                {
                    name: 'action',
                    enableSorting: false,
                    enableFiltering: false,
                    enableColumnMenu: false,
                    width: '100',
                    cellTemplate: collectionService.actionTemplate()
                }
            ];
            $scope.gridOptions = collectionService.gridOptions($scope);

            // === Item Action ===
            $scope.editDetails = function (id) {
                $state.transitionTo('productEdit', {locale: Environment.currentLocale(), id: id});
            };
            $scope.newItem = function () {
                $state.transitionTo('productNew', {locale: Environment.currentLocale()});
            }

            // === Load collection from remote ===
            $scope.loadCollection = function (pageNumber) {
                collectionService.loadCollection($scope, itemService, pageNumber);
            }
            $scope.loadCollection();
        }]);
});


text:
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var common_1 = require("@angular/common");
var fieldsetdemo_1 = require("./fieldsetdemo");
var fieldsetdemo_routing_module_1 = require("./fieldsetdemo-routing.module");
var fieldset_1 = require("../../../components/fieldset/fieldset");
var tabview_1 = require("../../../components/tabview/tabview");
var codehighlighter_1 = require("../../../components/codehighlighter/codehighlighter");
var FieldsetDemoModule = (function () {
    function FieldsetDemoModule() {
    }
    return FieldsetDemoModule;
}());
FieldsetDemoModule = __decorate([
    core_1.NgModule({
        imports: [
            common_1.CommonModule,
            fieldsetdemo_routing_module_1.FieldsetDemoRoutingModule,
            fieldset_1.FieldsetModule,
            tabview_1.TabViewModule,
            codehighlighter_1.CodeHighlighterModule
        ],
        declarations: [
            fieldsetdemo_1.FieldsetDemo
        ]
    })
], FieldsetDemoModule);
exports.FieldsetDemoModule = FieldsetDemoModule;
//# sourceMappingURL=fieldsetdemo.module.js.map


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.github.slotties.gw2trades</groupId>
        <artifactId>gw2trades-root</artifactId>
        <version>2.0</version>
    </parent>

    <artifactId>gw2trades-import</artifactId>
    <packaging>jar</packaging>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <descriptor>dist.xml</descriptor>
                </configuration>
                <executions>
                    <execution>
                        <id>create-archive</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
        </dependency>

        <dependency>
            <groupId>com.github.slotties.gw2trades</groupId>
            <artifactId>gw2trades-repository</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
        </dependency>
    </dependencies>
</project>


text:
using System;

namespace DRBlog.Core.Infrastructure.DependencyInjection
{
    public interface IIoCContainerResolution
    {
        //bool TryResolve(Type serviceType, out object instance);

        //object Resolve(Type type);

        //T Resolve<T>(string key = "") where T : class;

        //T[] ResolveAll<T>(string key = "");

        //bool IsRegistered(Type serviceType);

        // object ResolveUnregistered(Type type);

        //T ResolveUnregistered<T>() where T : class;

        //object ResolveOptional(Type serviceType);
    }
}


text:
<?php
namespace Piton;

use Piton\Appender\Console;
use Piton\Common\LoggerLevel;
use ReflectionProperty;

class LoggerTest extends \PHPUnit_Framework_TestCase
{

    protected $consoleAppender = ['console' => ['target' => 'STDOUT', 'class' => 'Piton\Appender\Console']];
    protected $allAppenders = [
        'logger' => ['level' => 'info'],
        'appenders' => [
            'console' => [
                'target' => 'STDOUT',
                'class' => 'Piton\Appender\Console'
            ],
            'null' => ['class' => 'Piton\Appender\Null'],
            'splunk' => [
                'target' => 'api-fake.data.splunkstorm.com',
                'class' => 'Piton\Appender\SplunkStorm',
                'context' => [
                    'SplunkStorm' => [
                        'projectID' => 'SomeFakeProjectID',
                        'accessToken' => 'AnotherFakeAccessToken',
                        'apiVersion' => 1,
                        'apiEndpoint' => 'inputs/http',
                        'urlScheme' => 'https'
                    ]
                ]
            ]
        ]
    ];
    /**
     * @var Logger
     */
    protected $logger;

    public function testConstructor()
    {
        $this->assertEquals(LoggerLevel::INFO_STR, $this->logger->getLevel());
    }

    public function testSetEmptyAppenders()
    {
        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->setAppenders([]);
    }

    public function testSetNoClassAppenders()
    {
        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->setAppenders(['nothing' => ['nada']]);
    }

    public function testSetNoConfigArrayAppenders()
    {
        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->setAppenders(['nothing']);
    }

    public function testSetEmptyClassArrayAppenders()
    {
        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->setAppenders(['empty' => ['class' => []]]);
    }

    public function testSetBadClassArrayAppenders()
    {
        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->setAppenders(['bad' => ['class' => 'NonExistantClass']]);
    }

    public function testNullFactory()
    {
        $nullLogger = Logger::defaultNullFactory();
        $this->assertEquals('null', $nullLogger->getAppender('null')->getName());
    }

    public function testConsoleFactory()
    {
        $nullLogger = Logger::defaultConsoleFactory();
        $this->assertEquals('console', $nullLogger->getAppender('console')->getName());
    }

    public function testContextualizeMessage(){
        $nullLogger = Logger::defaultNullFactory();
        $nullLogger->contextualizeMessage = TRUE;
        $nullLogger->enableTimestamp();
        $nullLogger->setRequiredMessage('{MESSAGE} {LOGLEVEL}');
        $this->assertNull($nullLogger->info('Booohyaaaa'));
    }
    public function testGetAppender()
    {
        $this->assertEquals('splunk', $this->logger->getAppender('splunk')->getName());
        $this->assertEquals('null', $this->logger->getAppender('null')->getName());
        $this->assertEquals('console', $this->logger->getAppender('console')->getName());
        $this->assertFalse($this->logger->getAppender('IDonNotExist'));
        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->getAppender(['stuff']);
    }

    public function testGetSetLevel()
    {
        $this->logger->setLevel('error');
        $this->assertEquals('ERROR', $this->logger->getLevel()->toString());

        $this->logger->setLevel(500);
        $this->assertEquals('NOTICE', $this->logger->getLevel()->toString());

        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->setLevel(array());

    }

    public function testRemoveAppender()
    {
        $this->assertEquals(3, $this->logger->appenderCount());
        $this->logger->removeAppender('null');
        $this->assertEquals(2, $this->logger->appenderCount());
        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->removeAppender([]);
    }

    public function testSetTimezoneId(){
        $this->logger->setTimezoneId('Europe/London');
        $this->assertEquals(new \DateTimeZone('Europe/London'), $this->logger->getTimezone());
        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->setTimezoneId('Europa/HinesHill');
    }

    public function testSetBadTimezoneId(){
        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->setTimezoneId([]);
    }

    public function testTimestamp()
    {
        $this->assertFalse($this->logger->usesTimeStamp());
        $this->logger->enableTimestamp();
        $this->assertTrue($this->logger->usesTimeStamp());
        $this->logger->disableTimestamp();
        $this->assertFalse($this->logger->usesTimeStamp());

        $this->assertEquals('D M j G:i:s.u T Y', $this->logger->getTimestampFormat());
        $this->logger->setTimestampFormat('D M j G:i:s.u Y');
        $this->assertEquals('D M j G:i:s.u Y', $this->logger->getTimestampFormat());
        $this->logger->setTimestampFormat('D M j G:i:s.u T Y');
        $this->assertTrue(
            date_create_from_format('D M j G:i:s.u T Y', $this->logger->createTimeStamp(), $this->logger->getTimezone()) instanceof \DateTime
        );
        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->setTimestampFormat([]);
    }

    public function testRequiredMessage()
    {
        $this->assertFalse($this->logger->usesRequiredMessage());
        $this->logger->enableRequiredMessage();
        $this->assertTrue($this->logger->usesRequiredMessage());
        $this->logger->disableRequiredMessage();
        $this->assertFalse($this->logger->usesRequiredMessage());

        $this->logger->setRequiredMessage('Bubba {required} this');
        $this->assertEquals('Bubba {required} this', $this->logger->getRequiredMessage());

        $this->setExpectedException('Piton\Exceptions\InvalidArgumentException');
        $this->logger->setRequiredMessage([]);
    }

    public function testRequiredContext()
    {
        $this->assertFalse($this->logger->usesRequiredContext());
        $this->logger->enableRequiredContext();
        $this->assertTrue($this->logger->usesRequiredContext());
        $this->logger->disableRequiredContext();
        $this->assertFalse($this->logger->usesRequiredContext());

        $this->logger->setRequiredContext(['bubba' => 'said']);
        $this->assertEquals(['bubba' => 'said'], $this->logger->getRequiredContext());
    }

    public function testLogEqualLevel()
    {
        $this->logger->removeAppender('console');
        $this->logger->removeAppender('splunk');
        $this->logger->setLevel('info');
        $this->assertNull($this->logger->log('info', 'my test log', []));
    }

    public function testLogLowerLevel()
    {
        $this->logger->removeAppender('console');
        $this->logger->removeAppender('splunk');
        $this->logger->setLevel('info');
        $this->assertNull($this->logger->log('error', 'my test log', []));
    }

    public function testLogHigherLevel()
    {
        $this->logger->removeAppender('console');
        $this->logger->removeAppender('splunk');
        $this->logger->setLevel('info');
        $this->assertNull($this->logger->log('debug', 'my test log', []));
    }

    public function testLogBadLevel()
    {
        $this->logger->removeAppender('console');
        $this->logger->removeAppender('splunk');
        $this->logger->setLevel('info');
        $this->assertNull($this->logger->log([], 'my test log', []));
    }

    public function testUsingFormatedMessage(){
        $this->logger->removeAppender('console');
        $this->logger->removeAppender('splunk');
        $this->logger->setLevel('info');
        $this->logger->setRequiredMessage('bubba required this');
        $this->logger->enableRequiredMessage();
        $this->assertNull($this->logger->log('info', 'my test log', []));
    }

    public function testUsingMergedContexts(){
        $this->logger->removeAppender('console');
        $this->logger->removeAppender('splunk');
        $this->logger->setLevel('info');
        $this->logger->setRequiredContext(['testing'=>'tested']);
        $this->logger->enableRequiredContext();
        $this->assertNull($this->logger->log('info', 'my {testing} log', []));
    }

    protected function setUp()
    {
        $this->logger = new Logger($this->allAppenders);
    }

    public function testAppendRequiredContext(){
        // Remove all the appenders
        $this->logger->removeAppender('console');
        $this->logger->removeAppender('splunk');
        $this->logger->removeAppender('null');

        // Create a new one
        $appender = new Console();

        // Remove the console stream and replace it with a memory stream.
        $streamProp = new ReflectionProperty($appender, 'fp');
        $memStream = \fopen('php://memory', 'rw');
        $streamProp->setAccessible(true);
        $streamProp->setValue($appender, $memStream);

        // now add the new Console, with memory stream
        $this->logger->addAppender($appender);

        // log something
        $expected = 'Test Log Message'.PHP_EOL;
        $this->logger->info($expected, []);

        // see what happened!
        \fseek($memStream, 0);
        $actual = \stream_get_contents($memStream);
        $this->assertEquals(trim(preg_replace('/\s+/', ' ', $expected)), trim(preg_replace('/\s+/', ' ', $actual)));
        $pos = ftell($memStream);

        // log something contextualized with no required message
        $this->logger->contextualizeMessage = TRUE;
        $expected = 'Contextualized Message'.PHP_EOL;
        $this->logger->info($expected, ['anything'=>'something']);

        // see what happened!
        \fseek($memStream, $pos);
        $actual = \stream_get_contents($memStream);
        $this->assertEquals(trim(preg_replace('/\s+/', ' ', $expected)), trim(preg_replace('/\s+/', ' ', $actual)));
        $pos = ftell($memStream);

        // log something contextualized with a message
        $this->logger->setRequiredMessage('app="PHPUnitTest" level="{LOGLEVEL}" msg="{MESSAGE}" ');
        $msg = 'Contextualized and Required Message';
        $this->logger->info($msg, ['anything'=>'something']);
        $expected = $msg;
        // see what happened!
        \fseek($memStream, $pos);
        $actual = \stream_get_contents($memStream);
        $this->assertEquals(trim(preg_replace('/\s+/', ' ', $expected)), trim(preg_replace('/\s+/', ' ', $actual)));
        $pos = ftell($memStream);

        // log something contextualized with a message, and enable required messages
        $this->logger->enableRequiredMessage();
        $msg = 'Contextualized and Required Message';
        $this->logger->info($msg, ['anything'=>'something']);
        $expected = 'app="PHPUnitTest" level="INFO" msg="Contextualized and Required Message" ';
        // see what happened!
        \fseek($memStream, $pos);
        $actual = \stream_get_contents($memStream);
        $this->assertEquals(trim(preg_replace('/\s+/', ' ', $expected)), trim(preg_replace('/\s+/', ' ', $actual)));
        //$pos = ftell($memStream);
    }

    public function testSetAndEnableRequiredMessage()
    {
        // Remove all the appenders
        $this->logger->removeAppender('console');
        $this->logger->removeAppender('splunk');
        $this->logger->removeAppender('null');

        // Create a new one
        $appender = new Console();

        // Remove the console stream and replace it with a memory stream.
        $streamProp = new ReflectionProperty($appender, 'fp');
        $memStream = \fopen('php://memory', 'rw');
        $streamProp->setAccessible(true);
        $streamProp->setValue($appender, $memStream);

        // now add the new Console, with memory stream
        $this->logger->addAppender($appender);

        $this->logger->setAndEnableRequiredMessage('this is a required message');

        // log something
        $expected = 'Test Log Message' . PHP_EOL;
        $this->logger->info($expected, []);
        $expected = 'this is a required message Test Log Message';

        // see what happened!
        \fseek($memStream, 0);
        $actual = \stream_get_contents($memStream);
        $this->assertEquals(trim(preg_replace('/\s+/', ' ', $expected)), trim(preg_replace('/\s+/', ' ', $actual)));
        $pos = ftell($memStream);

        $this->logger->setAndEnableRequiredMessage('this is a required {MESSAGE}', true);
        $this->logger->setAndEnableRequiredContext(['some'=>'thing']);
        // log something
        $expected = 'Test Log Message' . PHP_EOL;
        $this->logger->info($expected, []);
        $expected = 'this is a required Test Log Message';

        // see what happened!
        \fseek($memStream, $pos);
        $actual = \stream_get_contents($memStream);
        $this->assertEquals(trim(preg_replace('/\s+/', ' ', $expected)), trim(preg_replace('/\s+/', ' ', $actual)));
    }
}


text:
package org.apache.poi.hssf.record;

import org.apache.poi.util.LittleEndianOutput;

/**
 * Title:        Print Headers Record

 * Description:  Whether or not to print the row/column headers when you
 *               enjoy your spreadsheet in the physical form.

 * REFERENCE:  PG 373 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)

 * @author Andrew C. Oliver (acoliver at apache dot org)
 * @author Jason Height (jheight at chariot dot net dot au)
 * @version 2.0-pre
 */

public final class PrintHeadersRecord
    extends StandardRecord
{
    public final static short sid = 0x2a;
    private short             field_1_print_headers;

    public PrintHeadersRecord()
    {
    }

    public PrintHeadersRecord(RecordInputStream in)
    {
        field_1_print_headers = in.readShort();
    }

    /**
     * set to print the headers - y/n
     * @param p printheaders or not
     */

    public void setPrintHeaders(boolean p)
    {
        if (p == true)
        {
            field_1_print_headers = 1;
        }
        else
        {
            field_1_print_headers = 0;
        }
    }

    /**
     * get whether to print the headers - y/n
     * @return printheaders or not
     */

    public boolean getPrintHeaders()
    {
        return (field_1_print_headers == 1);
    }

    public String toString()
    {
        StringBuffer buffer = new StringBuffer();

        buffer.append("[PRINTHEADERS]\n");
        buffer.append("    .printheaders   = ").append(getPrintHeaders())
            .append("\n");
        buffer.append("[/PRINTHEADERS]\n");
        return buffer.toString();
    }

    public void serialize(LittleEndianOutput out) {
        out.writeShort(field_1_print_headers);
    }

    protected int getDataSize() {
        return 2;
    }

    public short getSid()
    {
        return sid;
    }

    public Object clone() {
      PrintHeadersRecord rec = new PrintHeadersRecord();
      rec.field_1_print_headers = field_1_print_headers;
      return rec;
    }
}


text:
/**
 *
 */
package br.com.sistemaescolar.modelo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @author Daniel Correia
 *
 */
@Entity
@Table(name = "FREQUENCIA")
public class Frequencia {

	@Id
	@GeneratedValue
	private Long id;

	@OneToOne
	@JoinColumn(name = "ID_MATRICULA")
	private Matricula matricula;

	@Column(name = "DATA")
	private Date data;

	@Column(name = "PRESENTE")
	private String presente;

	@OneToOne
	@JoinColumn(name = "ID_CURSO")
	private Curso curso;

	public Long getId() {
		return id;
	}

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

	public Matricula getMatricula() {
		return matricula;
	}

	public void setMatricula(Matricula matricula) {
		this.matricula = matricula;
	}

	public Date getData() {
		return data;
	}

	public void setData(Date data) {
		this.data = data;
	}

	public String getPresente() {
		return presente;
	}

	public void setPresente(String presente) {
		this.presente = presente;
	}

	public Curso getCurso() {
		return curso;
	}

	public void setCurso(Curso curso) {
		this.curso = curso;
	}

}


text:
namespace Serenity.Test {
    let assert: Assert = QUnit.assert;
    QUnit.module('Widget');

    QUnit.test('TryGetWidget tests', function () {
        var input = $('<input />');
        assert.strictEqual(input.tryGetWidget(Serenity.StringEditor), null,
            'should return null before widget creation');

        var stringEditor = new StringEditor(input);
        assert.strictEqual(input.tryGetWidget(Serenity.StringEditor), stringEditor,
            'should return created stringeditor widget');

        var secondaryWidget = new DecimalEditor(input);
        assert.strictEqual(input.tryGetWidget(Serenity.StringEditor), stringEditor,
            'should still return stringeditor after second widget');

        (<any>secondaryWidget).destroy();
        assert.strictEqual(input.tryGetWidget(Serenity.StringEditor), stringEditor,
            'should still return stringeditor after second widget is destroyed');

        assert.strictEqual(input.tryGetWidget(Serenity.Widget), stringEditor,
            'can return stringeditor using base class');

        (<any>stringEditor).destroy();
        assert.equal(input.tryGetWidget(Serenity.StringEditor), null,
            'should return null after string editor is destroyed');
    });
}


text:
using Markdig.Extensions.Tables;
using osu.Framework.Graphics.Containers.Markdown;

namespace osu.Game.Graphics.Containers.Markdown
{
    public class OsuMarkdownTable : MarkdownTable
    {
        public OsuMarkdownTable(Table table)
            : base(table)
        {
        }

        protected override MarkdownTableCell CreateTableCell(TableCell cell, TableColumnDefinition definition, bool isHeading) => new OsuMarkdownTableCell(cell, definition, isHeading);
    }
}


text:
'use strict';

const { getTestCases } = require('./get-test-cases');
const { runAuthHelperTests } = require('./auth-helper.tape');
const { runEscherTests } = require('./escher.tape');
const { runSignerTests } = require('./signer.tape');
const { runCanonicalizerTests } = require('./canonicalizer.tape');
const { runDateHandlingTests } = require('./date-handling.tape');
const { runUtilTests } = require('./utils.tape');

getTestCases('escher-test-cases').then(testCases =>
  [
    runEscherTests,
    runAuthHelperTests,
    runSignerTests,
    runCanonicalizerTests,
    runDateHandlingTests,
    runUtilTests
  ].forEach(runTests => runTests(testCases))
);


text:
<?php

$I = new FunctionalTester($scenario);
$I->amOnPage(script(__FILE__));

$I->selectOption('select[name=foo]', 'B');
$I->click('Go');

$I->seeOptionIsSelected('select[name=foo]', 'B');


text:
var Q = require('../kew')
var originalQ = require('q')

// test that fin() works with a synchronous resolve
exports.testSynchronousThenAndFin = function (test) {
  var vals = ['a', 'b']
  var counter = 0

  var promise1 = Q.resolve(vals[0])
  var promise2 = promise1.fin(function () {
    counter++
  })
  var promise3 = promise2.then(function (data) {
    if (data === vals[0]) return vals[1]
  })
  var promise4 = promise3.fin(function () {
    counter++
  })

  Q.all([promise2, promise4])
    .then(function (data) {
      test.equal(counter, 2, "fin() should have been called twice")
      test.equal(data[0], vals[0], "first fin() should return the first val")
      test.equal(data[1], vals[1], "second fin() should return the second val")
      test.done()
    })
}

// test that fin() works with a synchronous reject
exports.testSynchronousFailAndFin = function (test) {
  var errs = []
  errs.push(new Error('nope 1'))
  errs.push(new Error('nope 2'))
  var counter = 0

  var promise1 = Q.reject(errs[0])
  var promise2 = promise1.fin(function () {
    counter++
  })
  var promise3 = promise2.fail(function (e) {
    if (e === errs[0]) throw errs[1]
  })
  var promise4 = promise3.fin(function () {
    counter++
  })

  Q.all([
    promise2.fail(function (e) {
      return e === errs[0]
    }),
    promise4.fail(function (e) {
      return e === errs[1]
    })
  ])
    .then(function (data) {
      test.equal(counter, 2, "fin() should have been called twice")
      test.equal(data[0] && data[1], true, "all promises should return true")
      test.done()
    })
}

// test that fin() works with an asynchrnous resolve
exports.testAsynchronousThenAndFin = function (test) {
  var vals = ['a', 'b']
  var counter = 0

  var defer = Q.defer()
  setTimeout(function () {
    defer.resolve(vals[0])
  })
  var promise1 = defer.promise
  var promise2 = promise1.fin(function () {
    counter++
  })
  var promise3 = promise2.then(function (data) {
    if (data !== vals[0]) return

    var defer = Q.defer()
    setTimeout(function () {
      defer.resolve(vals[1])
    })
    return defer.promise
  })
  var promise4 = promise3.fin(function () {
    counter++
  })

  Q.all([promise2, promise4])
    .then(function (data) {
      test.equal(counter, 2, "fin() should have been called twice")
      test.equal(data[0], vals[0], "first fin() should return the first val")
      test.equal(data[1], vals[1], "second fin() should return the second val")
      test.done()
    })
}

// test that fin() works with an asynchronous reject
exports.testAsynchronousFailAndFin = function (test) {
  var errs = []
  errs.push(new Error('nope 1'))
  errs.push(new Error('nope 2'))
  var counter = 0

  var defer = Q.defer()
  setTimeout(function () {
    defer.reject(errs[0])
  }, 10)
  var promise1 = defer.promise
  var promise2 = promise1.fin(function () {
    counter++
  })
  var promise3 = promise2.fail(function (e) {
    if (e !== errs[0]) return

    var defer = Q.defer()
    setTimeout(function () {
      defer.reject(errs[1])
    }, 10)

    return defer.promise
  })
  var promise4 = promise3.fin(function () {
    counter++
  })

  Q.all([
    promise2.fail(function (e) {
      return e === errs[0]
    }),
    promise4.fail(function (e) {
      return e === errs[1]
    })
  ])
    .then(function (data) {
      test.equal(counter, 2, "fin() should have been called twice")
      test.equal(data[0] && data[1], true, "all promises should return true")
      test.done()
    })
}

// test several thens chaining
exports.testChainedThens = function (test) {
  var promise1 = Q.resolve('a')
  var promise2 = promise1.then(function(data) {
    return data + 'b'
  })
  var promise3 = promise2.then(function (data) {
    return data + 'c'
  })
  // testing the same promise again to make sure they can run side by side
  var promise4 = promise2.then(function (data) {
    return data + 'c'
  })

  Q.all([promise1, promise2, promise3, promise4])
    .then(function (data) {
      test.equal(data[0], 'a')
      test.equal(data[1], 'ab')
      test.equal(data[2], 'abc')
      test.equal(data[3], 'abc')
      test.done()
    })
}

// test several fails chaining
exports.testChainedFails = function (test) {
  var errs = []
  errs.push(new Error("first err"))
  errs.push(new Error("second err"))
  errs.push(new Error("third err"))

  var promise1 = Q.reject(errs[0])
  var promise2 = promise1.fail(function (e) {
    if (e === errs[0]) throw errs[1]
  })
  var promise3 = promise2.fail(function (e) {
    if (e === errs[1]) throw errs[2]
  })
  var promise4 = promise2.fail(function (e) {
    if (e === errs[1]) throw errs[2]
  })

  Q.all([
    promise1.fail(function (e) {
      return e === errs[0]
    }),
    promise2.fail(function (e) {
      return e === errs[1]
    }),
    promise3.fail(function (e) {
      return e === errs[2]
    }),
    promise4.fail(function (e) {
      return e === errs[2]
    })
  ])
  .then(function (data) {
    test.equal(data[0] && data[1] && data[2] && data[3], true)
    test.done()
  })
}

// test that we can call end without callbacks and not fail
exports.testEndNoCallbacks = function (test) {
  Q.resolve(true).end()
  test.ok("Ended successfully")
  test.done()
}

// test that we can call end with callbacks and fail
exports.testEndNoCallbacksThrows = function (test) {
  var testError = new Error('Testing')
  try {
    Q.reject(testError).end()
    test.fail("Should throw an error")
  } catch (e) {
    test.equal(e, testError, "Should throw the correct error")
  }
  test.done()
}

// test chaining when a promise returns a promise
exports.testChainedPromises = function (test) {
  var err = new Error('nope')
  var val = 'ok'

  var shouldFail = Q.reject(err)
  var shouldSucceed = Q.resolve(val)

  Q.resolve("start")
    .then(function () {
      return shouldFail
    })
    .fail(function (e) {
      if (e === err) return shouldSucceed
      else throw e
    })
    .then(function (data) {
      test.equal(data, val, "val should be returned")
      test.done()
    })
}

// test .end() is called with no parent scope (causing an uncaught exception)
exports.testChainedEndUncaught = function (test) {
  var errs = []
  errs.push(new Error('nope 1'))
  errs.push(new Error('nope 2'))
  errs.push(new Error('nope 3'))

  process.on('uncaughtException', function (e) {
    test.equal(e, errs.shift(), "Error should be uncaught")
    if (errs.length === 0) test.done()
  })

  var defer = Q.defer()
  defer.promise.end()

  var promise1 = defer.promise
  var promise2 = promise1.fail(function (e) {
    if (e === errs[0]) throw errs[1]
  })
  var promise3 = promise2.fail(function (e) {
    if (e === errs[1]) throw errs[2]
  })

  promise1.end()
  promise2.end()
  promise3.end()

  setTimeout(function () {
    defer.reject(errs[0])
  }, 10)
}

// test .end() is called with a parent scope and is caught
exports.testChainedCaught = function (test) {
  var err = new Error('nope')

  try {
    Q.reject(err).end()
  } catch (e) {
    test.equal(e, err, "Error should be caught")
    test.done()
  }
}

// test a mix of fails and thens
exports.testChainedMixed = function (test) {
  var errs = []
  errs.push(new Error('nope 1'))
  errs.push(new Error('nope 2'))
  errs.push(new Error('nope 3'))

  var vals = [3, 2, 1]

  var promise1 = Q.reject(errs[0])
  var promise2 = promise1.fail(function (e) {
    if (e === errs[0]) return vals[0]
  })
  var promise3 = promise2.then(function (data) {
    if (data === vals[0]) throw errs[1]
  })
  var promise4 = promise3.fail(function (e) {
    if (e === errs[1]) return vals[1]
  })
  var promise5 = promise4.then(function (data) {
    if (data === vals[1]) throw errs[2]
  })
  var promise6 = promise5.fail(function (e) {
    if (e === errs[2]) return vals[2]
  })

  Q.all([
    promise1.fail(function (e) {
      return e === errs[0]
    }),
    promise2.then(function (data) {
      return data === vals[0]
    }),
    promise3.fail(function (e) {
      return e === errs[1]
    }),
    promise4.then(function (data) {
      return data === vals[1]
    }),
    promise5.fail(function (e) {
      return e === errs[2]
    }),
    promise6.then(function (data) {
      return data === vals[2]
    })
  ])
  .then(function (data) {
    test.equal(data[0] && data[1] && data[2] && data[3] && data[4] && data[5], true, "All values should return true")
    test.done()
  })
}

exports.testInteroperabilityWithOtherPromises = function(test) {
  var promise1 = Q.defer()
  promise1.then(function(value) {
    return originalQ(1 + value)
  }).then(function(result) {
    test.equal(result, 11)
  })

  var promise2 = Q.defer(),
      errToThrow = new Error('error')
  promise2.then(function() {
    return originalQ.reject(errToThrow)
  }).fail(function(err) {
    test.equal(err, errToThrow)
  })

  promise1.resolve(10)
  promise2.resolve()

  Q.all([promise1, promise2]).then(function() {
    test.done()
  })
}

exports.testAllSettled = function(test) {
  var promise1 = Q.resolve('woot')
  var promise2 = Q.reject(new Error('oops'))

  Q.allSettled([promise1, promise2, 'just a string'])
    .then(function (data) {
      test.equals('fulfilled', data[0].state)
      test.equals('woot', data[0].value)
      test.equals('rejected', data[1].state)
      test.equals('oops', data[1].reason.message)
      test.equals('fulfilled', data[2].state)
      test.equals('just a string', data[2].value)
    })

  Q.allSettled([])
    .then(function (data) {
      test.equals(0, data.length)
      test.done()
    })
}

exports.testTimeout = function(test) {
  var promise = Q.delay(50).timeout(45, 'Timeout message')
  promise.then(function () {
    test.fail('The promise is supposed to be timeout')
  })
  .fail(function (e) {
    test.equals('Timeout message', e.message, 'The error message should be the one passed into timeout()')
  })
  .fin(test.done)
}

exports.testNotTimeout = function(test) {
  var promise = Q.delay(40, 'expected data').timeout(45, 'Timeout message')
  promise.then(function (data) {
    test.equals('expected data', data, 'The data should be the data from the original promise')
  })
  .fail(function (e) {
    test.fail('The promise is supposed to be resolved before the timeout')
  })
  .fin(test.done)
}

exports.testNotTimeoutButReject = function(test) {
  var promise = Q.delay(40).then(function() {throw new Error('Reject message')}).timeout(45, 'Timeout message')
  promise.then(function (data) {
    test.fail('The promise is supposed to be rejected')
  })
  .fail(function (e) {
    test.equals('Reject message', e.message, 'The error message should be from the original promise')
  })
  .fin(test.done)
}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package minersinstrument.db;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Hashtable;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultComboBoxModel;
import minersinstrument.ui.AErrorDialog;
import org.postgresql.ds.PGPoolingDataSource;

/**
 *
 * @author kopychenko
 */
public abstract class PAJDBCComboBoxModel extends DefaultComboBoxModel {

    // Класс записи
    protected class Row {

        private int id = 0;
        private String name;
        private String description;

        public Row(int id, String name, String description) {
            this.id = id;
            this.name = name;
            this.description = description;
        }

        public String getDescription() {
            return description;
        }

        public int getId() {
            return id;
        }

        public String getName() {
            return name;
        }

        @Override
        public String toString() {
            return name;
        }
    }
    private PGPoolingDataSource source;
    private Hashtable<Integer, Row> hashtable = new Hashtable<Integer, Row>();

    public PAJDBCComboBoxModel(PGPoolingDataSource source) {
        this.source = source;
        updateRows();
    }

    /**
     * Результирующий класс
     */
    public static class PAJDBCCResult {

        private ResultSet rs;
        private Connection conn;
        private CallableStatement proc;

        public PAJDBCCResult(ResultSet rs, Connection conn, CallableStatement proc) {
            this.rs = rs;
            this.conn = conn;
            this.proc = proc;
        }

        public Connection getConn() {
            return conn;
        }

        public CallableStatement getProc() {
            return proc;
        }

        public ResultSet getRs() {
            return rs;
        }

        public void close() {
            try {
                if (rs != null) {
                    rs.close();
                    System.out.println("rs - закрыт");
                }

                if (proc != null) {
                    proc.close();
                    System.out.println("proc - закрыт");
                }

                if (conn != null) {
                    conn.close();
                    System.out.println("conn - закрыт");
                }

            } catch (SQLException ex) {
                Logger.getLogger(PADBUtils.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

    public void updateRows() {
        Connection conn = null;
        PAJDBCCResult result = null;

        try {
            conn = source.getConnection();

            // Получаем результат запроса
            result = vExecuteQuery(conn);

            ResultSet resultSet = result.getRs();

            while (resultSet.next()) {
                Row row = new Row(resultSet.getInt(1), resultSet.getString(2), resultSet.getString(3));
                addElement(row);
                hashtable.put(row.getId(), row);
            }

        } catch (SQLException ex) {
            Logger.getLogger(PAJDBCComboBoxModel.class.getName()).log(Level.SEVERE, null, ex);

            AErrorDialog d = new AErrorDialog("Ошибка SQL уровня...", ex.getMessage());
            d.setVisible(true);
            d.dispose();

        } finally {
            if (result != null) {
                result.close();
            }

            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException ex2) {
                    Logger.getLogger(PAJDBCComboBoxModel.class.getName()).log(Level.SEVERE, null, ex2);

                    AErrorDialog d = new AErrorDialog("Ошибка SQL уровня...", ex2.getMessage());
                    d.setVisible(true);
                    d.dispose();
                }
            }
        }
    }

    protected abstract PAJDBCCResult vExecuteQuery(Connection conn) throws SQLException;

    public int getSelectedRowId() {
        return ((Row) getSelectedItem()).getId();
    }

    public void setSelectedRowId(int id) {
        if (id != -1) {
            Row row = hashtable.get(id);
            setSelectedItem(row);
            vAfterSetSelectedRowId(row);
        } else {
            setSelectedItem(null);
            vAfterSetSelectedRowId(null);
        }
    }

    public void vAfterSetSelectedRowId(Row row) {
    }

    public String getSelectedRowName() {
        return ((Row) getSelectedItem()).getName();
    }

    public String getSelectedRowDescription() {
        return ((Row) getSelectedItem()).getDescription();
    }
}


text:
module Spontaneous::Collections
  class BoxSet < PrototypeSet

    attr_reader :owner

    def initialize(owner)
      super()
      @owner = owner
      initialize_from_prototypes
    end

    def initialize_from_prototypes
      owner.class.boxes.each do |box_prototype|
        box = box_prototype.get_instance(owner)
        add_box(box)
      end
    end

    alias_method :get_without_ranges, :[]

    def [](*args)
      if args.length == 1
        get_single(args[0])
      else
        args.map { |index| get_single(index) }.flatten
      end
    end

    def export
      self.map { |item| item.export }
    end

    def group(group_name)
      self.select { |box| box._prototype.group == group_name }
    end

    protected

    def get_single(index)
      case index
      when Range
        order[index].map { | name | named(name) }
      else
        get_without_ranges(index)
      end
    end

    def add_box(box)
      self[box._prototype.name] = box
      getter_name = box._prototype.name
      singleton_class.class_eval do
        define_method(getter_name) { |*args| box.tap { |b| b.template_params = args } }
      end
    end

    def box_groups
      owner.class.box_prototypes.map { |prototype| prototype.group }.compact
    end

    def method_missing(method, *args)
      # allow access by group name e.g. instance.boxes.group_name
      if box_groups.include?(method)
        group(method)
        # self.select { |box| box._prototype.group == method }
      else
        super
      end
    end
  end
end