text:
using System.Diagnostics;
using System.Runtime.Serialization;

namespace System.Collections.Generic
{
    public partial class SortedSet<T>
    {
        /// <summary>
        /// This class represents a subset view into the tree. Any changes to this view
        /// are reflected in the actual tree. It uses the comparer of the underlying tree.
        /// </summary>
        [Serializable]
        internal sealed class TreeSubSet : SortedSet<T>, ISerializable, IDeserializationCallback
        {
            private SortedSet<T> _underlying;
            private T _min, _max;
            // these exist for unbounded collections
            // for instance, you could allow this subset to be defined for i > 10. The set will throw if
            // anything <= 10 is added, but there is no upper bound. These features Head(), Tail(), were punted
            // in the spec, and are not available, but the framework is there to make them available at some point.
            private bool _lBoundActive, _uBoundActive;
            // used to see if the count is out of date

#if DEBUG
            internal override bool versionUpToDate()
            {
                return (_version == _underlying._version);
            }
#endif

            public TreeSubSet(SortedSet<T> Underlying, T Min, T Max, bool lowerBoundActive, bool upperBoundActive)
                : base(Underlying.Comparer)
            {
                _underlying = Underlying;
                _min = Min;
                _max = Max;
                _lBoundActive = lowerBoundActive;
                _uBoundActive = upperBoundActive;
                _root = _underlying.FindRange(_min, _max, _lBoundActive, _uBoundActive); // root is first element within range
                _count = 0;
                _version = -1;
                VersionCheckImpl();
            }

            private TreeSubSet(SerializationInfo info, StreamingContext context)
            {
                _siInfo = info;
                OnDeserializationImpl(info);
            }

            internal override bool AddIfNotPresent(T item)
            {
                if (!IsWithinRange(item))
                {
                    throw new ArgumentOutOfRangeException(nameof(item));
                }

                bool ret = _underlying.AddIfNotPresent(item);
                VersionCheck();
#if DEBUG
                Debug.Assert(this.versionUpToDate() && _root == _underlying.FindRange(_min, _max));
#endif

                return ret;
            }

            public override bool Contains(T item)
            {
                VersionCheck();
#if DEBUG
                Debug.Assert(versionUpToDate() && _root == _underlying.FindRange(_min, _max));
#endif
                return base.Contains(item);
            }

            internal override bool DoRemove(T item)
            {
                if (!IsWithinRange(item))
                {
                    return false;
                }

                bool ret = _underlying.Remove(item);
                VersionCheck();
#if DEBUG
                Debug.Assert(versionUpToDate() && _root == _underlying.FindRange(_min, _max));
#endif
                return ret;
            }

            public override void Clear()
            {
                if (_count == 0)
                {
                    return;
                }

                List<T> toRemove = new List<T>();
                BreadthFirstTreeWalk(n => { toRemove.Add(n.Item); return true; });
                while (toRemove.Count != 0)
                {
                    _underlying.Remove(toRemove[toRemove.Count - 1]);
                    toRemove.RemoveAt(toRemove.Count - 1);
                }

                _root = null;
                _count = 0;
                _version = _underlying._version;
            }

            internal override bool IsWithinRange(T item)
            {
                int comp = _lBoundActive ? Comparer.Compare(_min, item) : -1;
                if (comp > 0)
                {
                    return false;
                }

                comp = _uBoundActive ? Comparer.Compare(_max, item) : 1;
                return comp >= 0;
            }

            internal override bool InOrderTreeWalk(TreeWalkPredicate<T> action)
            {
                VersionCheck();

                if (_root == null)
                {
                    return true;
                }

                // The maximum height of a red-black tree is 2*lg(n+1).
                // See page 264 of "Introduction to algorithms" by Thomas H. Cormen
                Stack<Node> stack = new Stack<Node>(2 * (int)SortedSet<T>.Log2(_count + 1)); // this is not exactly right if count is out of date, but the stack can grow
                Node current = _root;
                while (current != null)
                {
                    if (IsWithinRange(current.Item))
                    {
                        stack.Push(current);
                        current = current.Left;
                    }
                    else if (_lBoundActive && Comparer.Compare(_min, current.Item) > 0)
                    {
                        current = current.Right;
                    }
                    else
                    {
                        current = current.Left;
                    }
                }

                while (stack.Count != 0)
                {
                    current = stack.Pop();
                    if (!action(current))
                    {
                        return false;
                    }

                    Node node = current.Right;
                    while (node != null)
                    {
                        if (IsWithinRange(node.Item))
                        {
                            stack.Push(node);
                            node = node.Left;
                        }
                        else if (_lBoundActive && Comparer.Compare(_min, node.Item) > 0)
                        {
                            node = node.Right;
                        }
                        else
                        {
                            node = node.Left;
                        }
                    }
                }
                return true;
            }

            internal override bool BreadthFirstTreeWalk(TreeWalkPredicate<T> action)
            {
                VersionCheck();

                if (_root == null)
                {
                    return true;
                }

                Queue<Node> processQueue = new Queue<Node>();
                processQueue.Enqueue(_root);
                Node current;

                while (processQueue.Count != 0)
                {
                    current = processQueue.Dequeue();
                    if (IsWithinRange(current.Item) && !action(current))
                    {
                        return false;
                    }
                    if (current.Left != null && (!_lBoundActive || Comparer.Compare(_min, current.Item) < 0))
                    {
                        processQueue.Enqueue(current.Left);
                    }
                    if (current.Right != null && (!_uBoundActive || Comparer.Compare(_max, current.Item) > 0))
                    {
                        processQueue.Enqueue(current.Right);
                    }
                }
                return true;
            }

            internal override SortedSet<T>.Node FindNode(T item)
            {
                if (!IsWithinRange(item))
                {
                    return null;
                }

                VersionCheck();
#if DEBUG
                Debug.Assert(this.versionUpToDate() && _root == _underlying.FindRange(_min, _max));
#endif
                return base.FindNode(item);
            }

            // this does indexing in an inefficient way compared to the actual sortedset, but it saves a
            // lot of space
            internal override int InternalIndexOf(T item)
            {
                int count = -1;
                foreach (T i in this)
                {
                    count++;
                    if (Comparer.Compare(item, i) == 0)
                        return count;
                }
#if DEBUG
                Debug.Assert(this.versionUpToDate() && _root == _underlying.FindRange(_min, _max));
#endif
                return -1;
            }

            /// <summary>
            /// Checks whether this subset is out of date, and updates it if necessary.
            /// </summary>
            internal override void VersionCheck() => VersionCheckImpl();

            private void VersionCheckImpl()
            {
                Debug.Assert(_underlying != null);
                if (_version != _underlying._version)
                {
                    _root = _underlying.FindRange(_min, _max, _lBoundActive, _uBoundActive);
                    _version = _underlying._version;
                    _count = 0;
                    InOrderTreeWalk(n => { _count++; return true; });
                }
            }

            // This passes functionality down to the underlying tree, clipping edges if necessary
            // There's nothing gained by having a nested subset. May as well draw it from the base
            // Cannot increase the bounds of the subset, can only decrease it
            public override SortedSet<T> GetViewBetween(T lowerValue, T upperValue)
            {
                if (_lBoundActive && Comparer.Compare(_min, lowerValue) > 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(lowerValue));
                }
                if (_uBoundActive && Comparer.Compare(_max, upperValue) < 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(upperValue));
                }
                return (TreeSubSet)_underlying.GetViewBetween(lowerValue, upperValue);
            }

#if DEBUG
            internal override void IntersectWithEnumerable(IEnumerable<T> other)
            {
                base.IntersectWithEnumerable(other);
                Debug.Assert(versionUpToDate() && _root == _underlying.FindRange(_min, _max));
            }
#endif

            void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) => GetObjectData(info, context);

            protected override void GetObjectData(SerializationInfo info, StreamingContext context)
            {
                if (info == null)
                {
                    throw new ArgumentNullException(nameof(info));
                }

                info.AddValue(MaxName, _max, typeof(T));
                info.AddValue(MinName, _min, typeof(T));
                info.AddValue(LowerBoundActiveName, _lBoundActive);
                info.AddValue(UpperBoundActiveName, _uBoundActive);

                base.GetObjectData(info, context);
            }

            void IDeserializationCallback.OnDeserialization(Object sender)
            {
                // Don't do anything here as the work has already been done by the constructor
            }

            protected override void OnDeserialization(Object sender) => OnDeserializationImpl(sender);

            private void OnDeserializationImpl(Object sender)
            {
                if (_siInfo == null)
                {
                    throw new SerializationException(SR.Serialization_InvalidOnDeser);
                }

                _comparer = (IComparer<T>)_siInfo.GetValue(ComparerName, typeof(IComparer<T>));
                int savedCount = _siInfo.GetInt32(CountName);
                _max = (T)_siInfo.GetValue(MaxName, typeof(T));
                _min = (T)_siInfo.GetValue(MinName, typeof(T));
                _lBoundActive = _siInfo.GetBoolean(LowerBoundActiveName);
                _uBoundActive = _siInfo.GetBoolean(UpperBoundActiveName);
                _underlying = new SortedSet<T>();

                if (savedCount != 0)
                {
                    T[] items = (T[])_siInfo.GetValue(ItemsName, typeof(T[]));

                    if (items == null)
                    {
                        throw new SerializationException(SR.Serialization_MissingValues);
                    }

                    for (int i = 0; i < items.Length; i++)
                    {
                        _underlying.Add(items[i]);
                    }
                }

                _underlying._version = _siInfo.GetInt32(VersionName);
                _count = _underlying._count;
                _version = _underlying._version - 1;
                VersionCheck(); // this should update the count to be right and update root to be right

                if (_count != savedCount)
                {
                    throw new SerializationException(SR.Serialization_MismatchedCount);
                }

                _siInfo = null;
            }
        }
    }
}


text:
#ifndef STRINGITEM_H
#define STRINGITEM_H

#include "Comparable.h"
#include "Vector.h"
#include "Item.h"

/**
 * Abstract class representing an entry in the stringtable.
 */
class StringItem : public PosComparable
{
	public:
      /**
       * Constructor.
       *
       * @param str is the widechar string to be stored.
       * @param length is the length of the string including the
       *        terminating \0, i.e. wcslen(str) + 1.
       */
		StringItem( const wchar_t* str, int length  );

      /**
       * Constructor.
       *
       * @param str is the char string to be stored as widechar.
       * @param length is the length of the string.
       */
		StringItem( const char* str, int length  );

      /**
       * Destructor.
       */
      virtual ~StringItem();

      /**
       * Adds a pointer to an item.
       *
       * @param item is the pointer to add.
       */
      void addItem( Item* item );

      /**
       * Update hte names with a new stringindex
       */
      void updateNames( uint32 newIndex );

      /**
       * Adds items to vector.
       */
      void addItemsToVector( Vector& vector );

      /**
       * Adds only the items with the right mask to the vector.
       *
       * @param vector Outparameter The vector, which the items are added to.
       * @param mask Mask, put together with ItemTypes::itemMask values.
       */
      void addItemsToVector( Vector& vector, uint32 mask );

      /**
       * Returns the string in this item.
       */
      wchar_t* getString();

      /**
       *  Returns true if the items has a valid string.
       *
       * @return true if the item has a valid string.
       */
      bool hasString();

      bool hasItems();

      /**
       *   @name  operators.
       *   To make it possible to sort and search for the elements in
       *   ObjVector. If the elements not should be sorted or searched
       *   for the functions doesn't need to be implemented.
       */
      //@ {
         ///   equals
         virtual bool operator== (const Comparable& comp) const = 0;

         ///   not equal
         virtual bool operator != (const Comparable& comp) const = 0;

         ///   greater
         virtual bool operator > (const Comparable& comp) const = 0;

         ///   less
         virtual bool operator < (const Comparable& comp) const = 0;
      //@ }

      /**
       * Compare the n first positions.
       *
       * @param   comp  The comparable to compare with.
       * @param   n     The number of positions to compare.
       * @return  An integer less than, equal to, or greater than zero if the
       *          n first positions of THIS comparable  is found, respectively, to be less
       *          than, to match, or be greater than comp.
       */
      virtual int compareFirstPos(const PosComparable& comp, int n) const = 0;

	protected:

      /**
       * The string to store.
       */
		wchar_t* m_string;

      /**
       * A vector with items to store.
       */
		Vector m_items;
};
#endif

redpajama_set_name: RedPajamaGithub


text:
var ColsDescription       = require('./ColsDescription');
var RowsDescription       = require('./RowsDescription');
var RenderGridDescription = require('./RenderGrid');

module.exports = React.createClass({
  render : function(){
    return(

A Simple Example

The most basic implementation of ReactDataGrid requires 4 properties; an array of columns, a rowGetter function to retrive a row for a given index, the number of rows the grid expects and the minimum height of the grid.

The columns property is an array of object that has at a minimum key and name properties

        <ColsDescription/>
        <RowsDescription/>
        <RenderGridDescription/>

)
    }
  })


text:
using Jint;
using Nancy.Pile.Properties;

namespace Nancy.Pile
{
    internal static class CoffeeScript
    {
        public static string Compile(string text)
        {
            var engine = new Engine();
            engine.SetValue("coffeein", text);
            engine.Execute(Resources.CoffeeScript);
            engine.Execute("coffeeout = CoffeeScript.compile(coffeein)");
            return engine.GetValue("coffeeout").AsString();
        }
    }
}


text:
using System.Threading.Tasks;
using Augurk.Entities;

namespace Augurk.Api.Managers
{
    public interface ICustomizationManager
    {
        /// <summary>
        /// Retrieves the customization settings; or, creates them if they do not exist.
        /// </summary>
        /// <returns>A <see cref="Customization"/> instance containing the customization settings.</returns>
        Task<Customization> GetOrCreateCustomizationSettingsAsync();

        /// <summary>
        /// Persists the provided customization settings.
        /// </summary>
        /// <param name="customizationSettings">A <see cref="Customization"/> instance containing the settings that should be persisted.</param>
        Task PersistCustomizationSettingsAsync(Customization customizationSettings);
    }
}


text:
[![Build Status](https://travis-ci.org/mattcg/socks5-http-client.png?branch=master)](https://travis-ci.org/mattcg/socks5-http-client)

SOCKS v5 HTTP client implementation in JavaScript for Node.js.

```js
var shttp = require('socks5-http-client');

shttp.get('http://www.google.com/', function(res) {
	res.setEncoding('utf8');
	res.on('readable', function() {
		console.log(res.read()); // Log response to console.
	});
});
```

URLs are parsed using `url.parse`. You may also pass an options hash as the first argument to `get` or `request`.

Specify the `socksHost` and `socksPort` options if your SOCKS server isn't running on `localhost:1080`. Tor runs its SOCKS server on port `9050` by default, for example.

## Using with Tor ##

Works great for making HTTPS requests through [Tor](https://www.torproject.org/).

Make sure a Tor server is running locally and run `node example/tor http://en.wikipedia.org/wiki/SOCKS` to test.

## Using with Request ##

To use with [Request](https://github.com/mikeal/request), just pass a reference to the `Agent` constructor.

```js
var Agent = require('socks5-http-client/lib/Agent');

request({
	url: 'http://en.wikipedia.org/wiki/SOCKS',
	agentClass: Agent,
	agentOptions: {
		socksHost: 'my-tor-proxy-host', // Defaults to 'localhost'.
		socksPort: 9050 // Defaults to 1080.
	}
}, function(err, res) {
	console.log(err || res.body);
});
```

## HTTPS ##

This client only provides support for making HTTP requests. See [socks5-https-client](https://github.com/mattcg/socks5-https-client) for an HTTPS implementation.

## License ##

Copyright © 2013 [Matthew Caruana Galizia](http://twitter.com/mcaruanagalizia), licensed under an [MIT license](http://mattcg.mit-license.org/).


text:
Spark Core and MDNS
-------------------

Here is the Spark Core port of Adafruit MDNS library. The library provides the ability to setup a name for the Spark Core and resolve it. We can name the Core anything we want, the library will append "**.local**" to the name and we can access the Core using the URL "*name*.local".

The sample application names the Core as "***myspark***". If the MDNS is setup correctly then it creates a TCPServer on port 80. The Core can be accessed using the URL "**http://myspark.local**". The server simply prints a test message.

**Requirement**

 1. For Mac OSX support is built in through Bonjour already.
 2. For Linux, install Avahi.
 3. For Windows, install Bonjour.

**Screenhots**

![enter image description here][1]

  [1]: https://raw.githubusercontent.com/krvarma/MDNS_SparkCore/master/screenshot.jpg


text:
namespace boost {
namespace container {
namespace dtl {

template<class I>
struct are_elements_contiguous
{
   static const bool value = false;
};

/////////////////////////
//    raw pointers
/////////////////////////

template<class T>
struct are_elements_contiguous<T*>
{
   static const bool value = true;
};

/////////////////////////
//    move iterators
/////////////////////////

template<class It>
struct are_elements_contiguous< ::boost::move_iterator<It> >
   : are_elements_contiguous<It>
{};

}  //namespace dtl {

/////////////////////////
//    predeclarations
/////////////////////////

template <class Pointer, bool IsConst>
class vec_iterator;

}  //namespace container {

namespace interprocess {

template <class PointedType, class DifferenceType, class OffsetType, std::size_t OffsetAlignment>
class offset_ptr;

}  //namespace interprocess {

namespace container {

namespace dtl {

/////////////////////////
//vector_[const_]iterator
/////////////////////////

template <class Pointer, bool IsConst>
struct are_elements_contiguous<boost::container::vec_iterator<Pointer, IsConst> >
{
   static const bool value = true;
};

/////////////////////////
//    offset_ptr
/////////////////////////

template <class PointedType, class DifferenceType, class OffsetType, std::size_t OffsetAlignment>
struct are_elements_contiguous< ::boost::interprocess::offset_ptr<PointedType, DifferenceType, OffsetType, OffsetAlignment> >
{
   static const bool value = true;
};

template <typename I, typename O>
struct are_contiguous_and_same
   : boost::move_detail::and_
      < are_elements_contiguous
      , are_elements_contiguous<O>
      , is_same< typename remove_const< typename ::boost::container::iterator_traits::value_type >::type
               , typename ::boost::container::iterator_traits<O>::value_type
               >
      >
{};

template <typename I, typename O>
struct is_memtransfer_copy_assignable
   : boost::move_detail::and_
      < are_contiguous_and_same
      , dtl::is_trivially_copy_assignable< typename ::boost::container::iterator_traits::value_type >
      >
{};

template <typename I, typename O>
struct is_memtransfer_copy_constructible
   : boost::move_detail::and_
      < are_contiguous_and_same
      , dtl::is_trivially_copy_constructible< typename ::boost::container::iterator_traits::value_type >
      >
{};

template <typename I, typename O, typename R>
struct enable_if_memtransfer_copy_constructible
   : enable_if<dtl::is_memtransfer_copy_constructible, R>
{};

template <typename I, typename O, typename R>
struct disable_if_memtransfer_copy_constructible
   : disable_if<dtl::is_memtransfer_copy_constructible, R>
{};

template <typename I, typename O, typename R>
struct enable_if_memtransfer_copy_assignable
   : enable_if<dtl::is_memtransfer_copy_assignable, R>
{};

template <typename I, typename O, typename R>
struct disable_if_memtransfer_copy_assignable
   : disable_if<dtl::is_memtransfer_copy_assignable, R>
{};

template
   <typename I, // I models InputIterator
    typename F> // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE F memmove(I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
{
   typedef typename boost::container::iterator_traits::value_type value_type;
   value_type *const dest_raw = boost::movelib::iterator_to_raw_pointer(r);
   const value_type *const beg_raw = boost::movelib::iterator_to_raw_pointer(f);
   const value_type *const end_raw = boost::movelib::iterator_to_raw_pointer(l);
   if(BOOST_LIKELY(beg_raw != end_raw && dest_raw && beg_raw)){
      const typename boost::container::iterator_traits::difference_type n = end_raw - beg_raw;
      std::memmove(dest_raw, beg_raw, sizeof(value_type)*n);
      r += n;
   }
   return r;
}

template
   <typename I, // I models InputIterator
    typename U, // U models unsigned integral constant
    typename F> // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE F memmove_n(I f, U n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{
   typedef typename boost::container::iterator_traits::value_type value_type;
   if(BOOST_LIKELY(n)){
      std::memmove(boost::movelib::iterator_to_raw_pointer(r), boost::movelib::iterator_to_raw_pointer(f), sizeof(value_type)*n);
      r += n;
   }

   return r;
}

template
   <typename I, // I models InputIterator
    typename U, // U models unsigned integral constant
    typename F> // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE I memmove_n_source(I f, U n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{
   if(BOOST_LIKELY(n)){
      typedef typename boost::container::iterator_traits::value_type value_type;
      std::memmove(boost::movelib::iterator_to_raw_pointer(r), boost::movelib::iterator_to_raw_pointer(f), sizeof(value_type)*n);
      f += n;
   }
   return f;
}

template
   <typename I, // I models InputIterator
    typename U, // U models unsigned integral constant
    typename F> // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE I memmove_n_source_dest(I f, U n, F &r) BOOST_NOEXCEPT_OR_NOTHROW
{
   typedef typename boost::container::iterator_traits::value_type value_type;
   if(BOOST_LIKELY(n)){
      std::memmove(boost::movelib::iterator_to_raw_pointer(r), boost::movelib::iterator_to_raw_pointer(f), sizeof(value_type)*n);
      f += n;
      r += n;
   }
   return f;
}

template <typename O>
struct is_memzero_initializable
{
   typedef typename ::boost::container::iterator_traits<O>::value_type value_type;
   static const bool value = are_elements_contiguous<O>::value &&
      (  dtl::is_integral<value_type>::value || dtl::is_enum<value_type>::value
      #if defined(BOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL)
      || dtl::is_pointer<value_type>::value
      #endif
      #if defined(BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_ZERO)
      || dtl::is_floating_point<value_type>::value
      #endif
      #if defined(BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_ZERO) && defined(BOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL)
      || dtl::is_pod<value_type>::value
      #endif
      );
};

template <typename O, typename R>
struct enable_if_memzero_initializable
   : enable_if_c<dtl::is_memzero_initializable<O>::value, R>
{};

template <typename O, typename R>
struct disable_if_memzero_initializable
   : enable_if_c<!dtl::is_memzero_initializable<O>::value, R>
{};

template <typename I, typename R>
struct enable_if_trivially_destructible
   : enable_if_c < dtl::is_trivially_destructible
                  <typename boost::container::iterator_traits::value_type>::value
               , R>
{};

template <typename I, typename R>
struct disable_if_trivially_destructible
   : enable_if_c <!dtl::is_trivially_destructible
                  <typename boost::container::iterator_traits::value_type>::value
               , R>
{};

}  //namespace dtl {

//////////////////////////////////////////////////////////////////////////////
//
//                               uninitialized_move_alloc
//
//////////////////////////////////////////////////////////////////////////////

//! Effects:
//!   \code
//!   for (; f != l; ++r, ++f)
//!      allocator_traits::construct(a, &*r, boost::move(*f));
//!   \endcode
//!
//! Returns: r
template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_constructible::type
   uninitialized_move_alloc(Allocator &a, I f, I l, F r)
{
   F back = r;
   BOOST_TRY{
      while (f != l) {
         allocator_traits<Allocator>::construct(a, boost::movelib::iterator_to_raw_pointer(r), boost::move(*f));
         ++f; ++r;
      }
   }
   BOOST_CATCH(...){
      for (; back != r; ++back){
         allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(back));
      }
      BOOST_RETHROW;
   }
   BOOST_CATCH_END
   return r;
}

template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_constructible::type
   uninitialized_move_alloc(Allocator &, I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove(f, l, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                               uninitialized_move_alloc_n
//
//////////////////////////////////////////////////////////////////////////////

//! Effects:
//!   \code
//!   for (; n--; ++r, ++f)
//!      allocator_traits::construct(a, &*r, boost::move(*f));
//!   \endcode
//!
//! Returns: r
template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_constructible::type
   uninitialized_move_alloc_n(Allocator &a, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
   F back = r;
   BOOST_TRY{
      while (n) {
         --n;
         allocator_traits<Allocator>::construct(a, boost::movelib::iterator_to_raw_pointer(r), boost::move(*f));
         ++f; ++r;
      }
   }
   BOOST_CATCH(...){
      for (; back != r; ++back){
         allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(back));
      }
      BOOST_RETHROW;
   }
   BOOST_CATCH_END
   return r;
}

template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_constructible::type
   uninitialized_move_alloc_n(Allocator &, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove_n(f, n, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                               uninitialized_move_alloc_n_source
//
//////////////////////////////////////////////////////////////////////////////

//! Effects:
//!   \code
//!   for (; n--; ++r, ++f)
//!      allocator_traits::construct(a, &*r, boost::move(*f));
//!   \endcode
//!
//! Returns: f (after incremented)
template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_constructible::type
   uninitialized_move_alloc_n_source(Allocator &a, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
   F back = r;
   BOOST_TRY{
      while (n) {
         --n;
         allocator_traits<Allocator>::construct(a, boost::movelib::iterator_to_raw_pointer(r), boost::move(*f));
         ++f; ++r;
      }
   }
   BOOST_CATCH(...){
      for (; back != r; ++back){
         allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(back));
      }
      BOOST_RETHROW;
   }
   BOOST_CATCH_END
   return f;
}

template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_constructible::type
   uninitialized_move_alloc_n_source(Allocator &, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove_n_source(f, n, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                               uninitialized_copy_alloc
//
//////////////////////////////////////////////////////////////////////////////

//! Effects:
//!   \code
//!   for (; f != l; ++r, ++f)
//!      allocator_traits::construct(a, &*r, *f);
//!   \endcode
//!
//! Returns: r
template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_constructible::type
   uninitialized_copy_alloc(Allocator &a, I f, I l, F r)
{
   F back = r;
   BOOST_TRY{
      while (f != l) {
         allocator_traits<Allocator>::construct(a, boost::movelib::iterator_to_raw_pointer(r), *f);
         ++f; ++r;
      }
   }
   BOOST_CATCH(...){
      for (; back != r; ++back){
         allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(back));
      }
      BOOST_RETHROW;
   }
   BOOST_CATCH_END
   return r;
}

template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_constructible::type
   uninitialized_copy_alloc(Allocator &, I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove(f, l, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                               uninitialized_copy_alloc_n
//
//////////////////////////////////////////////////////////////////////////////

//! Effects:
//!   \code
//!   for (; n--; ++r, ++f)
//!      allocator_traits::construct(a, &*r, *f);
//!   \endcode
//!
//! Returns: r
template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_constructible::type
   uninitialized_copy_alloc_n(Allocator &a, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
   F back = r;
   BOOST_TRY{
      while (n) {
         --n;
         allocator_traits<Allocator>::construct(a, boost::movelib::iterator_to_raw_pointer(r), *f);
         ++f; ++r;
      }
   }
   BOOST_CATCH(...){
      for (; back != r; ++back){
         allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(back));
      }
      BOOST_RETHROW;
   }
   BOOST_CATCH_END
   return r;
}

template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_constructible::type
   uninitialized_copy_alloc_n(Allocator &, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove_n(f, n, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                               uninitialized_copy_alloc_n_source
//
//////////////////////////////////////////////////////////////////////////////

//! Effects:
//!   \code
//!   for (; n--; ++r, ++f)
//!      allocator_traits::construct(a, &*r, *f);
//!   \endcode
//!
//! Returns: f (after incremented)
template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_constructible::type
   uninitialized_copy_alloc_n_source(Allocator &a, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
   F back = r;
   BOOST_TRY{
      while (n) {
         boost::container::construct_in_place(a, boost::movelib::iterator_to_raw_pointer(r), f);
         ++f; ++r; --n;
      }
   }
   BOOST_CATCH(...){
      for (; back != r; ++back){
         allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(back));
      }
      BOOST_RETHROW;
   }
   BOOST_CATCH_END
   return f;
}

template
   <typename Allocator,
    typename I, // I models InputIterator
    typename F> // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_constructible::type
   uninitialized_copy_alloc_n_source(Allocator &, I f, typename boost::container::allocator_traits<Allocator>::size_type n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove_n_source(f, n, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                               uninitialized_value_init_alloc_n
//
//////////////////////////////////////////////////////////////////////////////

//! Effects:
//!   \code
//!   for (; n--; ++r, ++f)
//!      allocator_traits::construct(a, &*r);
//!   \endcode
//!
//! Returns: r
template
   <typename Allocator,
    typename F> // F models ForwardIterator
inline typename dtl::disable_if_memzero_initializable<F, F>::type
   uninitialized_value_init_alloc_n(Allocator &a, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
   F back = r;
   BOOST_TRY{
      while (n) {
         --n;
         allocator_traits<Allocator>::construct(a, boost::movelib::iterator_to_raw_pointer(r));
         ++r;
      }
   }
   BOOST_CATCH(...){
      for (; back != r; ++back){
         allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(back));
      }
      BOOST_RETHROW;
   }
   BOOST_CATCH_END
   return r;
}

template
   <typename Allocator,
    typename F> // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memzero_initializable<F, F>::type
   uninitialized_value_init_alloc_n(Allocator &, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
   typedef typename boost::container::iterator_traits<F>::value_type value_type;
   if (BOOST_LIKELY(n)){
      std::memset((void*)boost::movelib::iterator_to_raw_pointer(r), 0, sizeof(value_type)*n);
      r += n;
   }
   return r;
}

//////////////////////////////////////////////////////////////////////////////
//
//                               uninitialized_default_init_alloc_n
//
//////////////////////////////////////////////////////////////////////////////

//! Effects:
//!   \code
//!   for (; n--; ++r, ++f)
//!      allocator_traits::construct(a, &*r);
//!   \endcode
//!
//! Returns: r
template
   <typename Allocator,
    typename F> // F models ForwardIterator
inline F uninitialized_default_init_alloc_n(Allocator &a, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
   F back = r;
   BOOST_TRY{
      while (n) {
         --n;
         allocator_traits<Allocator>::construct(a, boost::movelib::iterator_to_raw_pointer(r), default_init);
         ++r;
      }
   }
   BOOST_CATCH(...){
      for (; back != r; ++back){
         allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(back));
      }
      BOOST_RETHROW;
   }
   BOOST_CATCH_END
   return r;
}

//////////////////////////////////////////////////////////////////////////////
//
//                               uninitialized_fill_alloc
//
//////////////////////////////////////////////////////////////////////////////

//! Effects:
//!   \code
//!   for (; f != l; ++r, ++f)
//!      allocator_traits::construct(a, &*r, *f);
//!   \endcode
//!
//! Returns: r
template
   <typename Allocator,
    typename F, // F models ForwardIterator
    typename T>
inline void uninitialized_fill_alloc(Allocator &a, F f, F l, const T &t)
{
   F back = f;
   BOOST_TRY{
      while (f != l) {
         allocator_traits<Allocator>::construct(a, boost::movelib::iterator_to_raw_pointer(f), t);
         ++f;
      }
   }
   BOOST_CATCH(...){
      for (; back != l; ++back){
         allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(back));
      }
      BOOST_RETHROW;
   }
   BOOST_CATCH_END
}

//////////////////////////////////////////////////////////////////////////////
//
//                               uninitialized_fill_alloc_n
//
//////////////////////////////////////////////////////////////////////////////

//! Effects:
//!   \code
//!   for (; n--; ++r, ++f)
//!      allocator_traits::construct(a, &*r, v);
//!   \endcode
//!
//! Returns: r
template
   <typename Allocator,
    typename T,
    typename F> // F models ForwardIterator
inline F uninitialized_fill_alloc_n(Allocator &a, const T &v, typename boost::container::allocator_traits<Allocator>::size_type n, F r)
{
   F back = r;
   BOOST_TRY{
      while (n) {
         --n;
         allocator_traits<Allocator>::construct(a, boost::movelib::iterator_to_raw_pointer(r), v);
         ++r;
      }
   }
   BOOST_CATCH(...){
      for (; back != r; ++back){
         allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(back));
      }
      BOOST_RETHROW;
   }
   BOOST_CATCH_END
   return r;
}

//////////////////////////////////////////////////////////////////////////////
//
//                               copy
//
//////////////////////////////////////////////////////////////////////////////

template
<typename I,   // I models InputIterator
typename F>    // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_assignable::type
   copy(I f, I l, F r)
{
   while (f != l) {
      *r = *f;
      ++f; ++r;
   }
   return r;
}

template
<typename I,   // I models InputIterator
typename F>    // F models ForwardIterator
inline typename dtl::enable_if_memtransfer_copy_assignable::type
   copy(I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove(f, l, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                               copy_n
//
//////////////////////////////////////////////////////////////////////////////

template
<typename I,   // I models InputIterator
typename U,   // U models unsigned integral constant
typename F>   // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_assignable::type
   copy_n(I f, U n, F r)
{
   while (n) {
      --n;
      *r = *f;
      ++f; ++r;
   }
   return r;
}

template
<typename I,   // I models InputIterator
typename U,   // U models unsigned integral constant
typename F>   // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_assignable::type
   copy_n(I f, U n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove_n(f, n, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                            copy_n_source
//
//////////////////////////////////////////////////////////////////////////////

template
<typename I,   // I models InputIterator
typename U,   // U models unsigned integral constant
typename F>   // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_assignable::type
   copy_n_source(I f, U n, F r)
{
   while (n) {
      --n;
      boost::container::assign_in_place(r, f);
      ++f; ++r;
   }
   return f;
}

template
<typename I,   // I models InputIterator
typename U,   // U models unsigned integral constant
typename F>   // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_assignable::type
   copy_n_source(I f, U n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove_n_source(f, n, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                            copy_n_source_dest
//
//////////////////////////////////////////////////////////////////////////////

template
<typename I,   // I models InputIterator
typename U,   // U models unsigned integral constant
typename F>   // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_assignable::type
   copy_n_source_dest(I f, U n, F &r)
{
   while (n) {
      --n;
      *r = *f;
      ++f; ++r;
   }
   return f;
}

template
<typename I,   // I models InputIterator
typename U,   // U models unsigned integral constant
typename F>   // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_assignable::type
   copy_n_source_dest(I f, U n, F &r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove_n_source_dest(f, n, r);  }

//////////////////////////////////////////////////////////////////////////////
//
//                         move
//
//////////////////////////////////////////////////////////////////////////////

template
<typename I,   // I models InputIterator
typename F>   // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_assignable::type
   move(I f, I l, F r)
{
   while (f != l) {
      *r = ::boost::move(*f);
      ++f; ++r;
   }
   return r;
}

template
<typename I,   // I models InputIterator
typename F>   // F models ForwardIterator
inline typename dtl::enable_if_memtransfer_copy_assignable::type
   move(I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove(f, l, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                         move_n
//
//////////////////////////////////////////////////////////////////////////////

template
<typename I,   // I models InputIterator
typename U,   // U models unsigned integral constant
typename F>   // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_assignable::type
   move_n(I f, U n, F r)
{
   while (n) {
      --n;
      *r = ::boost::move(*f);
      ++f; ++r;
   }
   return r;
}

template
<typename I,   // I models InputIterator
typename U,   // U models unsigned integral constant
typename F>   // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_assignable::type
   move_n(I f, U n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove_n(f, n, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                         move_backward
//
//////////////////////////////////////////////////////////////////////////////

template
<typename I,   // I models BidirectionalIterator
typename F>    // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_assignable::type
   move_backward(I f, I l, F r)
{
   while (f != l) {
      --l; --r;
      *r = ::boost::move(*l);
   }
   return r;
}

template
<typename I,   // I models InputIterator
typename F>   // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_assignable::type
   move_backward(I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
{
   typedef typename boost::container::iterator_traits::value_type value_type;
   const typename boost::container::iterator_traits::difference_type n = boost::container::iterator_distance(f, l);
   if (BOOST_LIKELY(n)){
      r -= n;
      std::memmove((boost::movelib::iterator_to_raw_pointer)(r), (boost::movelib::iterator_to_raw_pointer)(f), sizeof(value_type)*n);
   }
   return r;
}

//////////////////////////////////////////////////////////////////////////////
//
//                         move_n_source_dest
//
//////////////////////////////////////////////////////////////////////////////

template
<typename I    // I models InputIterator
,typename U    // U models unsigned integral constant
,typename F>   // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_assignable::type
   move_n_source_dest(I f, U n, F &r)
{
   while (n) {
      --n;
      *r = ::boost::move(*f);
      ++f; ++r;
   }
   return f;
}

template
<typename I    // I models InputIterator
,typename U    // U models unsigned integral constant
,typename F>   // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_assignable::type
   move_n_source_dest(I f, U n, F &r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove_n_source_dest(f, n, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                         move_n_source
//
//////////////////////////////////////////////////////////////////////////////

template
<typename I    // I models InputIterator
,typename U    // U models unsigned integral constant
,typename F>   // F models ForwardIterator
inline typename dtl::disable_if_memtransfer_copy_assignable::type
   move_n_source(I f, U n, F r)
{
   while (n) {
      --n;
      *r = ::boost::move(*f);
      ++f; ++r;
   }
   return f;
}

template
<typename I    // I models InputIterator
,typename U    // U models unsigned integral constant
,typename F>   // F models ForwardIterator
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_memtransfer_copy_assignable::type
   move_n_source(I f, U n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{  return dtl::memmove_n_source(f, n, r); }

//////////////////////////////////////////////////////////////////////////////
//
//                               destroy_alloc_n
//
//////////////////////////////////////////////////////////////////////////////

template
   <typename Allocator
   ,typename I   // I models InputIterator
   ,typename U>  // U models unsigned integral constant
inline typename dtl::disable_if_trivially_destructible::type
   destroy_alloc_n(Allocator &a, I f, U n)
{
   while(n){
      --n;
      allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(f));
      ++f;
   }
}

template
   <typename Allocator
   ,typename I   // I models InputIterator
   ,typename U>  // U models unsigned integral constant
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_trivially_destructible::type
   destroy_alloc_n(Allocator &, I, U)
{}

//////////////////////////////////////////////////////////////////////////////
//
//                         deep_swap_alloc_n
//
//////////////////////////////////////////////////////////////////////////////

template
   <std::size_t MaxTmpBytes
   ,typename Allocator
   ,typename F // F models ForwardIterator
   ,typename G // G models ForwardIterator
   >
inline typename dtl::disable_if_memtransfer_copy_assignable<F, G, void>::type
   deep_swap_alloc_n( Allocator &a, F short_range_f, typename allocator_traits<Allocator>::size_type n_i
                    , G large_range_f, typename allocator_traits<Allocator>::size_type n_j)
{
   typename allocator_traits<Allocator>::size_type n = 0;
   for (; n != n_i ; ++short_range_f, ++large_range_f, ++n){
      boost::adl_move_swap(*short_range_f, *large_range_f);
   }
   boost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f);  // may throw
   boost::container::destroy_alloc_n(a, large_range_f, n_j - n_i);
}

static const std::size_t DeepSwapAllocNMaxStorage = std::size_t(1) << std::size_t(11); //2K bytes

template
   <std::size_t MaxTmpBytes
   ,typename Allocator
   ,typename F // F models ForwardIterator
   ,typename G // G models ForwardIterator
   >
inline typename dtl::enable_if_c
   < dtl::is_memtransfer_copy_assignable<F, G>::value && (MaxTmpBytes <= DeepSwapAllocNMaxStorage) && false
   , void>::type
   deep_swap_alloc_n( Allocator &a, F short_range_f, typename allocator_traits<Allocator>::size_type n_i
                    , G large_range_f, typename allocator_traits<Allocator>::size_type n_j)
{
   typedef typename allocator_traits<Allocator>::value_type value_type;
   typedef typename dtl::aligned_storage
      <MaxTmpBytes, dtl::alignment_of<value_type>::value>::type storage_type;
   storage_type storage;

   const std::size_t n_i_bytes = sizeof(value_type)*n_i;
   void *const large_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(large_range_f));
   void *const short_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(short_range_f));
   void *const stora_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(storage.data));
   std::memcpy(stora_ptr, large_ptr, n_i_bytes);
   std::memcpy(large_ptr, short_ptr, n_i_bytes);
   std::memcpy(short_ptr, stora_ptr, n_i_bytes);
   boost::container::iterator_advance(large_range_f, n_i);
   boost::container::iterator_advance(short_range_f, n_i);
   boost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f);  // may throw
   boost::container::destroy_alloc_n(a, large_range_f, n_j - n_i);
}

template
   <std::size_t MaxTmpBytes
   ,typename Allocator
   ,typename F // F models ForwardIterator
   ,typename G // G models ForwardIterator
   >
inline typename dtl::enable_if_c
   < dtl::is_memtransfer_copy_assignable<F, G>::value && true//(MaxTmpBytes > DeepSwapAllocNMaxStorage)
   , void>::type
   deep_swap_alloc_n( Allocator &a, F short_range_f, typename allocator_traits<Allocator>::size_type n_i
                    , G large_range_f, typename allocator_traits<Allocator>::size_type n_j)
{
   typedef typename allocator_traits<Allocator>::value_type value_type;
   typedef typename dtl::aligned_storage
      <DeepSwapAllocNMaxStorage, dtl::alignment_of<value_type>::value>::type storage_type;
   storage_type storage;
   const std::size_t sizeof_storage = sizeof(storage);

   std::size_t n_i_bytes = sizeof(value_type)*n_i;
   char *large_ptr = static_cast<char*>(static_cast<void*>(boost::movelib::iterator_to_raw_pointer(large_range_f)));
   char *short_ptr = static_cast<char*>(static_cast<void*>(boost::movelib::iterator_to_raw_pointer(short_range_f)));
   char *stora_ptr = static_cast<char*>(static_cast<void*>(storage.data));

   std::size_t szt_times = n_i_bytes/sizeof_storage;
   const std::size_t szt_rem = n_i_bytes%sizeof_storage;

   //Loop unrolling using Duff's device, as it seems it helps on some architectures
   const std::size_t Unroll = 4;
   std::size_t n = (szt_times + (Unroll-1))/Unroll;
   const std::size_t branch_number = (!szt_times)*Unroll + (szt_times % Unroll);
   switch(branch_number){
      case 4:
         break;
      case 0: do{
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);
         std::memcpy(large_ptr, short_ptr, sizeof_storage);
         std::memcpy(short_ptr, stora_ptr, sizeof_storage);
         large_ptr += sizeof_storage;
         short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;
      case 3:
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);
         std::memcpy(large_ptr, short_ptr, sizeof_storage);
         std::memcpy(short_ptr, stora_ptr, sizeof_storage);
         large_ptr += sizeof_storage;
         short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;
      case 2:
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);
         std::memcpy(large_ptr, short_ptr, sizeof_storage);
         std::memcpy(short_ptr, stora_ptr, sizeof_storage);
         large_ptr += sizeof_storage;
         short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;
      case 1:
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);
         std::memcpy(large_ptr, short_ptr, sizeof_storage);
         std::memcpy(short_ptr, stora_ptr, sizeof_storage);
         large_ptr += sizeof_storage;
         short_ptr += sizeof_storage;
         } while(--n);
   }
   std::memcpy(stora_ptr, large_ptr, szt_rem);
   std::memcpy(large_ptr, short_ptr, szt_rem);
   std::memcpy(short_ptr, stora_ptr, szt_rem);
   boost::container::iterator_advance(large_range_f, n_i);
   boost::container::iterator_advance(short_range_f, n_i);
   boost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f);  // may throw
   boost::container::destroy_alloc_n(a, large_range_f, n_j - n_i);
}

//////////////////////////////////////////////////////////////////////////////
//
//                         copy_assign_range_alloc_n
//
//////////////////////////////////////////////////////////////////////////////

template
   <typename Allocator
   ,typename I // F models InputIterator
   ,typename O // G models OutputIterator
   >
void copy_assign_range_alloc_n( Allocator &a, I inp_start, typename allocator_traits<Allocator>::size_type n_i
                              , O out_start, typename allocator_traits<Allocator>::size_type n_o )
{
   if (n_o < n_i){
      inp_start = boost::container::copy_n_source_dest(inp_start, n_o, out_start);     // may throw
      boost::container::uninitialized_copy_alloc_n(a, inp_start, n_i - n_o, out_start);// may throw
   }
   else{
      out_start = boost::container::copy_n(inp_start, n_i, out_start);  // may throw
      boost::container::destroy_alloc_n(a, out_start, n_o - n_i);
   }
}

//////////////////////////////////////////////////////////////////////////////
//
//                         move_assign_range_alloc_n
//
//////////////////////////////////////////////////////////////////////////////

template
   <typename Allocator
   ,typename I // F models InputIterator
   ,typename O // G models OutputIterator
   >
void move_assign_range_alloc_n( Allocator &a, I inp_start, typename allocator_traits<Allocator>::size_type n_i
                              , O out_start, typename allocator_traits<Allocator>::size_type n_o )
{
   if (n_o < n_i){
      inp_start = boost::container::move_n_source_dest(inp_start, n_o, out_start);  // may throw
      boost::container::uninitialized_move_alloc_n(a, inp_start, n_i - n_o, out_start);  // may throw
   }
   else{
      out_start = boost::container::move_n(inp_start, n_i, out_start);  // may throw
      boost::container::destroy_alloc_n(a, out_start, n_o - n_i);
   }
}

template<class Allocator, class Iterator>
struct array_destructor
{
   typedef typename ::boost::container::iterator_traits<Iterator>::value_type value_type;
   typedef typename dtl::if_c
      <dtl::is_trivially_destructible<value_type>::value
      ,dtl::null_scoped_destructor_range<Allocator>
      ,dtl::scoped_destructor_range<Allocator>
      >::type type;
};

template
   <typename Allocator
   ,typename F // F models ForwardIterator
   ,typename O // G models OutputIterator
   ,typename InsertionProxy
   >
void uninitialized_move_and_insert_alloc
   ( Allocator &a
   , F first
   , F pos
   , F last
   , O d_first
   , typename allocator_traits<Allocator>::size_type n
   , InsertionProxy insert_range_proxy)
{
   typedef typename array_destructor<Allocator, F>::type array_destructor_t;

   //Anti-exception rollbacks
   array_destructor_t new_values_destroyer(d_first, d_first, a);

   //Initialize with [begin(), pos) old buffer
   //the start of the new buffer
   O d_last = ::boost::container::uninitialized_move_alloc(a, first, pos, d_first);
   new_values_destroyer.set_end(d_last);
   //Initialize new objects, starting from previous point
   insert_range_proxy.uninitialized_copy_n_and_update(a, d_last, n);
   d_last += n;
   new_values_destroyer.set_end(d_last);
   //Initialize from the rest of the old buffer,
   //starting from previous point
   (void) ::boost::container::uninitialized_move_alloc(a, pos, last, d_last);
   //All construction successful, disable rollbacks
   new_values_destroyer.release();
}

template
   <typename Allocator
   ,typename F // F models ForwardIterator
   ,typename InsertionProxy
   >
void expand_forward_and_insert_alloc
   ( Allocator &a
   , F pos
   , F last
   , typename allocator_traits<Allocator>::size_type n
   , InsertionProxy insert_range_proxy)
{
   typedef typename array_destructor<Allocator, F>::type array_destructor_t;

   if (BOOST_UNLIKELY(!n)){
      return;
   }
   else if (last == pos){
      insert_range_proxy.uninitialized_copy_n_and_update(a, last, n);
   }
   else{
      typedef typename allocator_traits<Allocator>::size_type alloc_size_type;
      const alloc_size_type elems_after = static_cast<alloc_size_type>(last - pos);
      if(elems_after >= n){
         //New elements can be just copied.
         //Move to uninitialized memory last objects
         ::boost::container::uninitialized_move_alloc_n(a, last - n, n, last);
         array_destructor_t on_exception(last, last, a);
         //Copy previous to last objects to the initialized end
         boost::container::move_backward(pos, last - n, last);
         //Insert new objects in the pos
         insert_range_proxy.copy_n_and_update(a, pos, n);
         on_exception.release();
      }
      else {
         //The new elements don't fit in the [pos, end()) range.
         //Copy old [pos, end()) elements to the uninitialized memory (a gap is created)
         F new_last = ::boost::container::uninitialized_move_alloc(a, pos, last, pos + n);
         array_destructor_t on_exception(pos + n, new_last, a);
         //Copy first new elements in pos (gap is still there)
         insert_range_proxy.copy_n_and_update(a, pos, elems_after);
         //Copy to the beginning of the unallocated zone the last new elements (the gap is closed).
         insert_range_proxy.uninitialized_copy_n_and_update(a, last, n - elems_after);
         on_exception.release();
      }
   }
}

}  //namespace container {
}  //namespace boost {

//#pragma GCC diagnostic ignored "-Wclass-memaccess"
#if defined(BOOST_GCC) && (BOOST_GCC >= 40600)
#pragma GCC diagnostic pop
#endif

#endif   //#ifndef BOOST_CONTAINER_DETAIL_COPY_MOVE_ALGO_HPP


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

	<base href="<?php echo base_url();?>"/>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>Daily Expense Reports</title>
	<meta name="robots" content="index, nofollow" />
	<link rel="shortcut icon" href="reports/favicon.ico" type="image/x-icon" />
	<link rel="stylesheet" type="text/css" href="reports/reports.css"/>
	<link rel="stylesheet" media="screen,projection" type="text/css" href="<?php echo base_url();?>reports/jquery-ui.css" />
	<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">

<?php
$mot=0;

$fdate=$this->input->get('fdate',TRUE);if (empty($fdate)) $fdate=date('Y-m-d');
$tdate=$this->input->get('tdate',TRUE);if (empty($tdate)) $tdate=date('Y-m-d');

$query=$this->db->query("select voucher_date, narration, voucher_no, expense_id, amount, entry_date from expense_ledger where date(voucher_date) between '$fdate' and '$tdate'")->result();

?>

<form action="" method="get">

From:
<input type="text" class="date" id="fromdate" name='fdate' value="<?php echo $fdate?>">
  To:
<input type="text" class="date" id="todate" name='tdate' value="<?php echo $tdate?>">

<input type="submit" value="Submit" class="submit">

</form>

Mirpur Polytechnic Institute

Daily Expense Report

From <?php echo $fdate?> till <?php echo $tdate?>

Nr.
Voucher Date
Voucher No
Purpose
Narration
Amount

<?php $nr=1;foreach ($query as $row):
?>

<?php echo $nr?>
<?php echo date('d/m/y', strtotime($row->voucher_date))?>
<?php echo $row->voucher_no?>
<?php echo $this->lib->expName($row->expense_id);?>
<?php echo $row->narration?>
<?php echo $row->amount;$mot+=$row->amount;?>
<?php $nr++;endforeach;?>

Total:
<?php echo number_format($mot,2)?>


text:
<?php

/**
 * Sitemap cms page collection model
 *
 * @category    Mage
 * @package     Mage_Sitemap
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_Sitemap_Model_Resource_Cms_Page extends Mage_Core_Model_Resource_Db_Abstract
{
    /**
     * Init resource model (catalog/category)
     *
     */
    protected function _construct()
    {
        $this->_init('cms/page', 'page_id');
    }

    /**
     * Retrieve cms page collection array
     *
     * @param unknown_type $storeId
     * @return array
     */
    public function getCollection($storeId)
    {
        $pages = array();

        $select = $this->_getWriteAdapter()->select()
            ->from(array('main_table' => $this->getMainTable()), array($this->getIdFieldName(), 'identifier AS url'))
            ->join(
                array('store_table' => $this->getTable('cms/page_store')),
                'main_table.page_id=store_table.page_id',
                array()
            )
            ->where('main_table.is_active=1')
            ->where('store_table.store_id IN(?)', array(0, $storeId));
        $query = $this->_getWriteAdapter()->query($select);
        while ($row = $query->fetch()) {
            if ($row['url'] == Mage_Cms_Model_Page::NOROUTE_PAGE_ID) {
                continue;
            }
            $page = $this->_prepareObject($row);
            $pages[$page->getId()] = $page;
        }

        return $pages;
    }

    /**
     * Prepare page object
     *
     * @param array $data
     * @return Varien_Object
     */
    protected function _prepareObject(array $data)
    {
        $object = new Varien_Object();
        $object->setId($data[$this->getIdFieldName()]);
        $object->setUrl($data['url']);

        return $object;
    }
}


text:
'''It provides common formatting chain.'''

from .util import value, identifier, identifier_as, identifier_dir, paren
from .util import concat_by_comma, concat_by_space, build_values_list, build_where, build_set, build_on

single_value         = (value, )
single_identifier    = (identifier, )
single_identifier_as = (identifier_as, )
identifier_list      = (identifier, concat_by_comma)
identifier_as_list   = (identifier_as, concat_by_comma)
identifier_dir_list  = (identifier_dir, concat_by_comma)
column_list          = (identifier, concat_by_comma, paren)
values_list          = (build_values_list, )
where_list           = (build_where, )
set_list             = (build_set, )
on_list              = (build_on, )
statement_list       = (concat_by_space, )


text:
/*
Section: Mobile - Activation
Title: iPhone
*/

The following final activation steps are intended for the iPhone 4, 4S and 5 running any iOS.

After the phone has been added to your account:

Connect to a Wi-Fi network
Restart your phone
Within 2-3 minutes the phone should start a Hands Free Activation on its own
When the activation completes, your phone is ready for use
If your phone does not start working immediately, follow the steps below.
1. Check the MEID number and confirm that it's the same as the one listed in your 2600hz Mobile account. To find the MEID on your phone:

Tap the Settings app
Tap General
Tap About
Look for the MEID - do not confuse this with the IMEI
Look for ICCID and make sure it's correct (iPhone 5 only)
NOTE: Your MEID will be listed in the hex form on your phone; it's listed in both forms in your 2600hz Mobile account on your Device Settings page underneath the picture of the phone.

2. Make sure you're not in a roaming area.

3. Make sure that voice and data are enabled on your 2600hz Mobile account.

4. Make sure that data is enabled on your phone. To confirm this:

Tap the Settings app
Tap Cellular (on iOS 6, tap General, then Cellular)
Make sure the ON/OFF button for Cellular Data is in the ON position

5. Try running a network reset:

Tap the Settings app
Tap General
Tap Reset
Tap Reset Network Settings
6. Try running a profile update:

Connect to a Wi-Fi network
Tap the phone app
Dial # # 873283 #
Tap Call
Starting Service Update message will appear - tap OK
If update is successful Service Update Complete message will appear after about a minute - tap OK
**If update is not successful Service Update Fails message will appear, make sure you are connected to a Wi-Fi network and try again; if this happens again try running a factory reset.

**If the update is successful but you only have voice/text and not data, try running a factory reset.

7. Wait 3-6 hours. Some users have found that waiting 3-6 hours after attempting activation gives the phone sufficient time to connect to the network and the phone activates on its own during this time. If your profile update was successful but you still aren't able to activate, it may help to wait a few hours prior to trying a factory reset.

Factory Reset
If you've tried all of the steps above and your phone is still not activating, you'll need to run a factory reset.

Factory Reset

Back up your phone
Tap the Settings app
Tap General
Tap Reset
Tap Erase All Content and Settings
Enter your passcode if prompted
Erase iPhone
Erase iPhone
The phone will reboot and you will be prompted to set up your phone again, which you can do as a new device or restore it from a previous backup in iTunes or iCloud.

Picture Messaging Settings
The following steps will allow your phone to send and receive mms messages between your iPhone and other non-Apple devices

Ensure that "Can send picture and video messages" is enabled for the phone on your 2600hz Mobile account
Once mms messaging has been enabled on the account, wait 6 hours (if you've already had it enabled for more than 6 hours, move on to the next step)
Restart your phone
If mms messaging still isn't working on your phone, run a profile update:

Connect to a Wi-Fi network
Tap the phone app
Dial # # 873283 #
Tap Call
Starting Service Update message will appear - tap OK
If update is successful Service Update Complete message will appear after about a minute - tap OK
If mms messaging still isn't working on your phone, run a factory reset:

Back up your phone
Tap the Settings app
Tap General
Tap Reset
Tap Erase All Content and Settings
Enter your passcode if prompted
Erase iPhone
Erase iPhone
If you have tried all the options and are still having problems, get in touch with us here so we can help you out.


text:
package com.automationrockstars.gir.ui;

import com.automationrockstars.design.gir.webdriver.HasLocator;
import com.automationrockstars.design.gir.webdriver.UiObject;
import com.google.common.collect.FluentIterable;
import org.openqa.selenium.SearchContext;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.internal.WrapsElement;
import org.openqa.selenium.support.ui.FluentWait;
import ru.yandex.qatools.htmlelements.element.Link;

public abstract interface UiPart extends WrapsElement, WebElement, HasLocator {

    String name();

    FluentIterable<UiObject> children();

    boolean has(org.openqa.selenium.By element);

    boolean hasText(String text);

    boolean isPresent();

    boolean isVisible();

    FluentWait<SearchContext> delay();

    void waitForHidden();

    UiObject childWithText(String text);

    Link childLinkWithText(String text);

    SearchContext parent();

}


text:
title: Comparison with the Inequality Operator
localeTitle: Comparación con el operador de desigualdad
---
## Comparación con el operador de desigualdad

*   `!=` (Desigualdad) es un operador lógico que devuelve el caso verdadero, el valor de la izquierda es diferente del de la derecha.
*   El operador de desigualdad considera que `7` y `"7"` son iguales porque no compara el tipo de variable.

## Solucion basica

```javascript
function testNotEqual(val) {
  if (val != 99)
    return "Not Equal";

  return "Equal";
 }

```


text:
// @flow

import { MiddlewareRegistry } from '../base/redux';

import { OPEN_DESKTOP_APP } from './actionTypes';
import { openDesktopApp } from './functions';

/**
 * Implements the middleware of the deep linking feature.
 *
 * @param {Store} store - The redux store.
 * @returns {Function}
 */
// eslint-disable-next-line no-unused-vars
MiddlewareRegistry.register(store => next => action => {
    switch (action.type) {
    case OPEN_DESKTOP_APP:
        openDesktopApp(store.getState());
        break;
    }

    return next(action);
});


text:
<?php

namespace Erre\TransitoMultasBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Departamento
 *
 * @ORM\Table(name="Departamento")
 * @ORM\Entity
 */
class Departamento
{
    /**
     * @var string
     *
     * @ORM\Column(name="Departamento", type="string", length=45, nullable=false)
     */
    private $departamento;

    /**
     * @var integer
     *
     * @ORM\Column(name="idDepartamento", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $iddepartamento;

    /**
     * Set departamento
     *
     * @param string $departamento
     * @return Departamento
     */
    public function setDepartamento($departamento)
    {
        $this->departamento = $departamento;

        return $this;
    }

    /**
     * Get departamento
     *
     * @return string
     */
    public function getDepartamento()
    {
        return $this->departamento;
    }

    /**
     * Get iddepartamento
     *
     * @return integer
     */
    public function getIddepartamento()
    {
        return $this->iddepartamento;
    }

    public function __toString()
    {
        return $this->departamento;
    }
}


text:
#include "webrtc/p2p/base/basicpacketsocketfactory.h"

#include "webrtc/p2p/base/asyncstuntcpsocket.h"
#include "webrtc/p2p/base/stun.h"
#include "webrtc/base/asynctcpsocket.h"
#include "webrtc/base/asyncudpsocket.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/nethelpers.h"
#include "webrtc/base/physicalsocketserver.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/socketadapters.h"
#include "webrtc/base/ssladapter.h"
#include "webrtc/base/thread.h"

namespace rtc {

BasicPacketSocketFactory::BasicPacketSocketFactory()
    : thread_(Thread::Current()),
      socket_factory_(NULL) {
}

BasicPacketSocketFactory::BasicPacketSocketFactory(Thread* thread)
    : thread_(thread),
      socket_factory_(NULL) {
}

BasicPacketSocketFactory::BasicPacketSocketFactory(
    SocketFactory* socket_factory)
    : thread_(NULL),
      socket_factory_(socket_factory) {
}

BasicPacketSocketFactory::~BasicPacketSocketFactory() {
}

AsyncPacketSocket* BasicPacketSocketFactory::CreateUdpSocket(
    const SocketAddress& address,
    uint16_t min_port,
    uint16_t max_port) {
  // UDP sockets are simple.
  rtc::AsyncSocket* socket =
      socket_factory()->CreateAsyncSocket(
          address.family(), SOCK_DGRAM);
  if (!socket) {
    return NULL;
  }
  if (BindSocket(socket, address, min_port, max_port) < 0) {
    LOG(LS_ERROR) << "UDP bind failed with error "
                    << socket->GetError();
    delete socket;
    return NULL;
  }
  return new rtc::AsyncUDPSocket(socket);
}

AsyncPacketSocket* BasicPacketSocketFactory::CreateServerTcpSocket(
    const SocketAddress& local_address,
    uint16_t min_port,
    uint16_t max_port,
    int opts) {
  // Fail if TLS is required.
  if (opts & PacketSocketFactory::OPT_TLS) {
    LOG(LS_ERROR) << "TLS support currently is not available.";
    return NULL;
  }

  rtc::AsyncSocket* socket =
      socket_factory()->CreateAsyncSocket(local_address.family(),
                                          SOCK_STREAM);
  if (!socket) {
    return NULL;
  }

  if (BindSocket(socket, local_address, min_port, max_port) < 0) {
    LOG(LS_ERROR) << "TCP bind failed with error "
                  << socket->GetError();
    delete socket;
    return NULL;
  }

  // If using SSLTCP, wrap the TCP socket in a pseudo-SSL socket.
  if (opts & PacketSocketFactory::OPT_SSLTCP) {
    ASSERT(!(opts & PacketSocketFactory::OPT_TLS));
    socket = new rtc::AsyncSSLSocket(socket);
  }

  // Set TCP_NODELAY (via OPT_NODELAY) for improved performance.
  // See http://go/gtalktcpnodelayexperiment
  socket->SetOption(rtc::Socket::OPT_NODELAY, 1);

  if (opts & PacketSocketFactory::OPT_STUN)
    return new cricket::AsyncStunTCPSocket(socket, true);

  return new rtc::AsyncTCPSocket(socket, true);
}

AsyncPacketSocket* BasicPacketSocketFactory::CreateClientTcpSocket(
    const SocketAddress& local_address, const SocketAddress& remote_address,
    const ProxyInfo& proxy_info, const std::string& user_agent, int opts) {

  rtc::AsyncSocket* socket =
      socket_factory()->CreateAsyncSocket(local_address.family(), SOCK_STREAM);
  if (!socket) {
    return NULL;
  }

  if (BindSocket(socket, local_address, 0, 0) < 0) {
    LOG(LS_ERROR) << "TCP bind failed with error "
                  << socket->GetError();
    delete socket;
    return NULL;
  }

  // If using a proxy, wrap the socket in a proxy socket.
  if (proxy_info.type == rtc::PROXY_SOCKS5) {
    socket = new rtc::AsyncSocksProxySocket(
        socket, proxy_info.address, proxy_info.username, proxy_info.password);
  } else if (proxy_info.type == rtc::PROXY_HTTPS) {
    socket = new rtc::AsyncHttpsProxySocket(
        socket, user_agent, proxy_info.address,
        proxy_info.username, proxy_info.password);
  }

  // If using TLS, wrap the socket in an SSL adapter.
  if (opts & PacketSocketFactory::OPT_TLS) {
    ASSERT(!(opts & PacketSocketFactory::OPT_SSLTCP));

    rtc::SSLAdapter* ssl_adapter = rtc::SSLAdapter::Create(socket);
    if (!ssl_adapter) {
      return NULL;
    }

    socket = ssl_adapter;

    if (ssl_adapter->StartSSL(remote_address.hostname().c_str(), false) != 0) {
      delete ssl_adapter;
      return NULL;
    }

  // If using SSLTCP, wrap the TCP socket in a pseudo-SSL socket.
  } else if (opts & PacketSocketFactory::OPT_SSLTCP) {
    ASSERT(!(opts & PacketSocketFactory::OPT_TLS));
    socket = new rtc::AsyncSSLSocket(socket);
  }

  if (socket->Connect(remote_address) < 0) {
    LOG(LS_ERROR) << "TCP connect failed with error "
                  << socket->GetError();
    delete socket;
    return NULL;
  }

  // Finally, wrap that socket in a TCP or STUN TCP packet socket.
  AsyncPacketSocket* tcp_socket;
  if (opts & PacketSocketFactory::OPT_STUN) {
    tcp_socket = new cricket::AsyncStunTCPSocket(socket, false);
  } else {
    tcp_socket = new rtc::AsyncTCPSocket(socket, false);
  }

  // Set TCP_NODELAY (via OPT_NODELAY) for improved performance.
  // See http://go/gtalktcpnodelayexperiment
  tcp_socket->SetOption(rtc::Socket::OPT_NODELAY, 1);

  return tcp_socket;
}

AsyncResolverInterface* BasicPacketSocketFactory::CreateAsyncResolver() {
  return new rtc::AsyncResolver();
}

int BasicPacketSocketFactory::BindSocket(AsyncSocket* socket,
                                         const SocketAddress& local_address,
                                         uint16_t min_port,
                                         uint16_t max_port) {
  int ret = -1;
  if (min_port == 0 && max_port == 0) {
    // If there's no port range, let the OS pick a port for us.
    ret = socket->Bind(local_address);
  } else {
    // Otherwise, try to find a port in the provided range.
    for (int port = min_port; ret < 0 && port <= max_port; ++port) {
      ret = socket->Bind(rtc::SocketAddress(local_address.ipaddr(),
                                                  port));
    }
  }
  return ret;
}

SocketFactory* BasicPacketSocketFactory::socket_factory() {
  if (thread_) {
    ASSERT(thread_ == Thread::Current());
    return thread_->socketserver();
  } else {
    return socket_factory_;
  }
}

}  // namespace rtc


text:
;(function () {
  'use strict'
  angular.module('app.index', ['app.core'])
})()


text:
using namespace std;

#include "Menu.hpp"

TesterBase::TesterBase()
{
	m_totalTestCount = 0;
	m_totalTestPass = 0;

	cout << "* TEST LOG WILL BE WRITTEN OUT TO:" << endl;
	Menu::PrintPwd();

	m_output.open( "test_result.html" );

    OutputHeader();

    m_closed = false;
}

TesterBase::~TesterBase()
{
    Close();
}

void TesterBase::Close()
{
    if ( m_closed ) { return; }

    OutputFooter();
    m_output.close();

    m_closed = true;
}

void TesterBase::OutputHeader()
{
    m_output << "<!DOCTYPE html>" << endl;
    m_output << "" << endl;
    m_output << "    " << endl;
    m_output << "        <title> cuTEST Test Results </title>" << endl;

    m_output << "        " << endl;
    m_output << "    " << endl;

    m_output << "    " << endl;
    m_output << "
Warning: Make sure to check if all tests finish (there will be a message at the end of the file) -
" << endl;
    m_output << "    It is possible for your program to crash early, but still show that tests have passed because it hasn't gone through everything.
" << endl;

    m_output << "
" << endl;
    m_output << "
" << endl;
    m_output << "             Test set 	" << endl;
    m_output << "             Test 	" << endl;
    m_output << "             Prerequisite
 functions 	" << endl;
    m_output << "             Pass/fail 	" << endl;
    m_output << "             Expected
 output 	" << endl;
    m_output << "             Actual
 output 	" << endl;
    m_output << "             Comments 	" << endl;
    m_output << "
" << endl;

//    m_output << "
" << endl;
//    m_output << "              	" << endl;
//    m_output << "              	" << endl;
//    m_output << "             Functions that need to be implemented for these tests to work right 	" << endl;
//    m_output << "              	" << endl;
//    m_output << "             The output expected from the function's return 	" << endl;
//    m_output << "             What was actually returned from the function 	" << endl;
//    m_output << "             Additional notes from the test 	" << endl;
//    m_output << "
" << endl;
}

void TesterBase::OutputFooter()
{
    m_output << "
" << endl;

    if ( m_subtest_totalPasses == m_subtest_totalTests )
    {
        m_output << "
" << m_totalTestCount << " testsets ran; " << m_totalTestPass << " testsets passed
" << endl;
    }
    else
    {
        m_output << "
" << m_totalTestCount << " testsets ran; " << m_totalTestPass << " testsets passed
" << endl;
    }

    m_output << "    " << endl;
    m_output << "" << endl;
}

void TesterBase::WriteoutSummary()
{
    m_output << "
" << endl;
    m_output << "" << endl;
    m_output << "SUMMARY FOR " << col_testSet << ":" << endl;
    m_output << m_subtest_totalPasses << " out of " << m_subtest_totalTests << " tests passed" << endl;
    m_output << "	" << endl;
    m_output << "
" << endl;
    m_output << "

" << endl;
}

void TesterBase::WriteoutRow()
{
    if ( col_result == "passed" )
        m_output << "
" << endl;
    else
        m_output << "
" << endl;

    m_output << "      " << col_testSet <<         "       	" << endl;
    m_output << "          " << col_testName <<        "       	" << endl;
    m_output << "
 " << col_prerequisites <<   "
 	" << endl;
    m_output << "        " << col_result <<          "       	" << endl;
    m_output << "
 " << col_expectedOutput <<  "
 	" << endl;
    m_output << "
 " << col_actualOutput <<    "
 	" << endl;
    m_output << "
 " << col_comments <<        "
 	" << endl;
    m_output << "
" << endl;
}

void TesterBase::Start()
{
//	MainMenu();
    TestAll();
}

void TesterBase::TestAll()
{
    int counter = 1;
    cout << endl;
    for ( list<TestListItem>::iterator it = m_tests.begin(); it != m_tests.end(); it++ )
    {
        if ( it->testAggregate == false )
        {
            cout << "Running testset " << counter << " out of " << m_totalTestCount << ": \t"
                << it->name << endl;
            int result = it->callFunction();
            if ( result == 1 )
            {
                m_totalTestPass++;
            }
        }
        counter++;
    }

    cout << endl << " NOTE: CHECK \"test_result.html\" FOR FULL DETAILS." << endl;
}

void TesterBase::AddTest( const TestListItem& test )
{
	m_tests.push_back( test );
	m_totalTestCount++;
}

void TesterBase::StartTestSet( const string& name, const vector<string>& prereqs )
{
    Set_TestSet( name );
    m_subtest_totalTests = 0;
    m_subtest_totalPasses = 0;
    Set_TestPrerequisites( prereqs );
}

void TesterBase::StartTest( const string& description )
{
    cout << left << setw( 1 ) << " * " << setw( 70 ) << description << setw( 10 ) << "... ";
    Set_TestName( description );
    m_subtest_totalTests++;
    col_actualOutput = "";
    col_expectedOutput = "";
}

void TesterBase::TestFail()
{
    cout << "FAIL" << endl;
    Set_Result( false );
}

void TesterBase::TestFail( const string& message )
{
    cout << "FAIL" << endl;
    Set_Comments( message );
    Set_Result( false );
}

void TesterBase::TestPass()
{
    cout << "PASS" << endl;
    Set_Result( true );
    m_subtest_totalPasses++;
}

int TesterBase::TestResult()
{
    return ( m_subtest_totalPasses == m_subtest_totalTests );
}

void TesterBase::FinishTest()
{
    WriteoutRow();
}

void TesterBase::FinishTestSet()
{
    WriteoutSummary();
    cout << endl << endl;
}

void TesterBase::Set_TestSet( const string& value )
{
    col_testSet = value;
}

void TesterBase::Set_TestName( const string& value )
{
    col_testName = value;
}

void TesterBase::Set_TestPrerequisites( const vector<string>& prereqs )
{
    col_prerequisites = "";
    for ( unsigned int i = 0; i < prereqs.size(); i++ )
    {
        col_prerequisites += "
" + prereqs[i] + "
";
    }
}

void TesterBase::Set_Result( bool passed )
{
    col_result = ( passed ) ? "passed" : "FAILED";
}

void TesterBase::Set_ExpectedOutput( const string& variable )
{
    col_expectedOutput += "
" + variable + "
";
}

void TesterBase::Set_ExpectedOutput( const string& variable, const string& value )
{
    col_expectedOutput += "
" + variable + " = " + value + "
";
}

void TesterBase::Set_ExpectedOutput( const string& variable, int value )
{
    Set_ExpectedOutput( variable, StringUtil::ToString( value ) );
}

void TesterBase::Set_ExpectedOutput( const string& variable, bool value )
{
    Set_ExpectedOutput( variable, StringUtil::ToString( value ) );
}

void TesterBase::Set_ActualOutput( const string& variable )
{
    col_actualOutput += "
" + variable + "
";
}

void TesterBase::Set_ActualOutput( const string& variable, const string& value )
{
    col_actualOutput += "
" + variable + " = " + value + "
";
}

void TesterBase::Set_ActualOutput( const string& variable, int value )
{
    Set_ActualOutput( variable, StringUtil::ToString( value ) );
}

void TesterBase::Set_ActualOutput( const string& variable, bool value )
{
    Set_ActualOutput( variable, StringUtil::ToString( value ) );
}

void TesterBase::Set_Comments( const string& value )
{
    col_comments += "
" + value + "
";
}

void TesterBase::TerminationMessage( const string& message )
{
    cout << "TEST TERMINATED: " << message << endl;
}


text:
package com.lightbend.lagom.javadsl.api.transport

import java.util
import java.util.Optional

import com.lightbend.lagom.javadsl.api.deser.DeserializationException
import com.lightbend.lagom.javadsl.api.deser.SerializationException
import org.scalatest.Matchers
import org.scalatest.WordSpec

import scala.collection.immutable

/**
 *
 */
class TransportExceptionSpec extends WordSpec with Matchers {
  val protocolTextPlain = new MessageProtocol(Optional.of("text/plain"), Optional.of("utf-8"), Optional.empty[String])
  val protocolJson      = new MessageProtocol(Optional.of("application/json"), Optional.of("utf-8"), Optional.empty[String])
  val protocolHtml      = new MessageProtocol(Optional.of("text/html"), Optional.of("utf-8"), Optional.empty[String])

  val supportedExceptions: immutable.Seq[TransportException] = List(
    new DeserializationException("some msg - DeserializationException"),
    new BadRequest("some msg - BadRequest"),
    new Unauthorized("some msg - Unauthorized"),
    new Forbidden("some msg - Forbidden"),
    new PolicyViolation("some msg - PolicyViolation"),
    new NotFound("some msg - NotFound"),
    new NotAcceptable(util.Arrays.asList(protocolJson, protocolTextPlain), protocolHtml),
    new PayloadTooLarge("some msg - PayloadTooLarge"),
    new UnsupportedMediaType(protocolTextPlain, protocolJson),
    new TooManyRequests("some msg - TooManyRequests"),
    new SerializationException("some msg - SerializationException")
  )

  "Lagom-provided TransportExceptions" should {
    supportedExceptions.foreach { ex =>
      s"be buildable from code and message (${ex.getClass.getName})" in {
        val reconstructed = TransportException.fromCodeAndMessage(ex.errorCode(), ex.exceptionMessage())
        reconstructed.getClass.getName should ===(ex.getClass.getName)
        reconstructed.exceptionMessage() should ===(ex.exceptionMessage())
      }
    }

    // TODO: implement roundtrip de/ser tests like in com.lightbend.lagom.scaladsl.api.ExceptionsSpec
  }
}


text:
<?php
namespace Procure\Application\Reporting\PO\Output;

use PhpOffice\PhpSpreadsheet\Spreadsheet;

/**
 * PR Row Service.
 *
 * @author Nguyen Mau Tri - ngmautri@gmail.com
 *
 */
class PoRowStatusInOpenOffice extends PoRowStatusInExcel
{

   /**
    *
    * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $objPHPExcel
    */
    protected function createHeader(\PhpOffice\PhpSpreadsheet\Spreadsheet $objPHPExcel)
    {
        // TODO Auto-generated method stub

        // Create new PHPExcel object
        $objPHPExcel = new Spreadsheet();

        // $drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing();
        /*
         * $drawing->setName('Logo');
         * $drawing->setDescription('Logo');
         * $drawing->setPath(ROOT . '/public/images/mascot.gif');
         * $drawing->setHeight(120);
         */

        // $drawing->setWorksheet($objPHPExcel->getActiveSheet());

        // Set document properties
        $objPHPExcel->getProperties()
            ->setCreator("Nguyen Mau Tri")
            ->setLastModifiedBy("Nguyen Mau Tri")
            ->setTitle("Office 2007 XLSX Test Document")
            ->setSubject("Office 2007 XLSX Test Document")
            ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
            ->setKeywords("office 2007 openxml php")
            ->setCategory("Test result file");
    }

    /**
     *
     * {@inheritdoc}
     * @see \Procure\Application\Reporting\PO\Output\PoRowStatusInExcel::createHeader()
     */
    protected function createFooter(\PhpOffice\PhpSpreadsheet\Spreadsheet $objPHPExcel)
    {
        // TODO Auto-generated method stub
        // Set active sheet index to the first sheet, so Excel opens this as the first sheet
        $objPHPExcel->setActiveSheetIndex(0);

        $objPHPExcel->getActiveSheet()->setAutoFilter("A3:U3");

        // Redirect output to a client's web browser (Excel2007)
        header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
        header('Content-Disposition: attachment;filename="' . 'all' . '.ods"');
        header('Cache-Control: max-age=0');
        // If you're serving to IE 9, then the following may be needed
        header('Cache-Control: max-age=1');

        // If you're serving to IE over SSL, then the following may be needed
        // header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified
        header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
        header('Pragma: public'); // HTTP/1.0

        $objWriter = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($objPHPExcel, 'Ods');
        $objWriter->save('php://output');
        exit();
    }
}


text:
using Zed.Core.Domain;

namespace Zeega.Domain.GameModel {
    /// <summary>
    /// Enumeration that represent device types
    /// </summary>
    public class DeviceTypeSupport : ValueObject {

        #region Fields and Properties

        /// <summary>
        /// Indicates if a desktop device is enabled
        /// </summary>
        private readonly bool isDesktopEnabled;

        /// <summary>
        /// Gets an indicator which indicates if a desktop device is enbled
        /// </summary>
        public bool IsDesktopEnabled { get { return isDesktopEnabled; } }

        /// <summary>
        /// Indicates if a mobile device is enabled
        /// </summary>
        private readonly bool isMobileEnabled;

        /// <summary>
        /// Gets an indicator which indicates if a mobile device is enabled
        /// </summary>
        public bool IsMobileEnabled { get { return isMobileEnabled; } }

        #endregion

        #region Constructors and Init

        /// <summary>
        /// Default constructor created DeviceTypeSupport instance
        /// </summary>
        private DeviceTypeSupport() { }

        /// <summary>
        /// Creates value object that represetns device type support
        /// </summary>
        /// <param name="isDesktopEnabled">Indicates if a desktop device is enabled.</param>
        /// <param name="isMobileEnabled">Indicates if a mobile device is enabled.</param>
        public DeviceTypeSupport(bool isDesktopEnabled, bool isMobileEnabled) {
            this.isDesktopEnabled = isDesktopEnabled;
            this.isMobileEnabled = isMobileEnabled;
        }

        #endregion

    }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>

<wicket:panel xmlns:wicket="http://wicket.apache.org">
    <form wicket:id="form" class="form-horizontal">

             <wicket:message key="PageResourceWizard.autoSaveWarning" />

             <wicket:message key="PageResourceWizard.readOnlyNote" />
            <wicket:message key="PageResourceWizard.readOnlySwitch"/>

    </form>
</wicket:panel>


text:
:+1::tada: First, thanks for getting involved with Grav! :tada::+1:

Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.

Following these guidelines helps to communicate that you respect the time of
the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing
patches and features.

## Grav, Plugins, Themes and Skeletons

Grav is a large open source project—it's made up of over 100 repositories. When you initially consider contributing to Grav, you might be unsure about which of those 200 repositories implements the functionality you want to change or report a bug for.

[https://github.com/getgrav/grav](https://github.com/getgrav/grav) is the main Grav repository. The core of Grav is provided by this repo.

[https://github.com/getgrav/grav-plugin-admin](https://github.com/getgrav/grav-plugin-admin) is the Admin Plugin repository.

Every Plugin and Theme has its own repository. If you have a problem you think is specific to a Theme or Plugin, please report it in its corresponding repository. Please read the Plugin or Theme documentation to ensure the problem is not addressed there already.

Every Skeleton also has its own repository, so if an issue is not specific to a theme or plugin but rather to its usage in the skeleton, report it in the skeleton repository.

## Using the issue tracker

The issue tracker is the preferred channel for [bug reports](#bugs),
[features requests](#features) and [submitting pull
requests](#pull-requests), but please respect the following restrictions:

* Please **do not** use the issue tracker for support requests. Use
  [the Forum](http://getgrav.org/forum) or [the Gitter chat](https://gitter.im/getgrav/grav).

## Bug reports

A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful - thank you!

Guidelines for bug reports:

1. **Check you satisfy the Grav requirements** — [http://learn.getgrav.org/basics/requirements](http://learn.getgrav.org/basics/requirements)

2. **Check this happens on a clean Grav install** — check if the issue happens on any Grav site, or just with a specific configuration of plugins / theme

3. **Use the GitHub issue search** — check if the issue has already been
   reported.

4. **Check if the issue is already being solved in a PR** — check the open Pull Requests to see if one already solves the problem you're having

5. **Check if the issue has been fixed** — try to reproduce it using the
   latest `develop` branch in the repository.

6. **Isolate the problem** — create a [reduced test
   case](http://css-tricks.com/reduced-test-cases/) and provide a step-by-step instruction set on how to recreate the problem. Include code samples, page snippets or yaml configurations if needed.

7. **Check the problem on Grav 1.1** — if you're using Grav 1.0, latest stable release, please also check if you can replicate the issue on Grav 1.1 RC as many bugs are already solved in the next Grav release.

A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report.

What is your environment? Is it localhost, OSX, Linux, on a remote server? Same happening locally and or the server, or just locally or just on Linux?

What steps will reproduce the issue? What browser(s) and OS experience the problem?

What would you expect to be the outcome?

Did the problem start happening recently (e.g. after updating to a new version of Grav) or was this always a problem?

If the problem started happening recently, can you reproduce the problem in an older version of Grav? What's the most recent version in which the problem doesn't happen? You can download older versions of Grav from the releases page on Github.

Can you reliably reproduce the issue? If not, provide details about how often the problem happens and under which conditions it normally happens.

All these details will help people to fix any potential bugs.

Important: [include Code Samples in triple backticks](https://help.github.com/articles/github-flavored-markdown/#fenced-code-blocks) so that Github will provide a proper indentation. [Add the language name after the backticks](https://help.github.com/articles/github-flavored-markdown/#syntax-highlighting) to add syntax highlighting to the code snippets.

Example:

> Short and descriptive example bug report title
>
> A summary of the issue and the browser/OS environment in which it occurs. If
> suitable, include the steps required to reproduce the bug.
>
> 1. This is the first step
> 2. This is the second step
> 3. Further steps, etc.
>>
> Any other information you want to share that is relevant to the issue being
> reported. This might include the lines of code that you have identified as
> causing the bug, and potential solutions (and your opinions on their
> merits).

## Feature requests

Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong
case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible.

## Pull requests

Good pull requests - patches, improvements, new features - are a fantastic
help. They should remain focused in scope and avoid containing unrelated
commits.

**Please ask first** in Gitter or in the Forum before embarking on any significant pull request (e.g.
implementing features, refactoring code..),
otherwise you risk spending a lot of time working on something that the
project's developers might not want to merge into the project.

Please adhere to the coding conventions used throughout the project (indentation,
accurate comments, etc.) and any other requirements.

See [Using Pull Request](https://help.github.com/articles/using-pull-requests/) and [Fork a Repo](https://help.github.com/articles/fork-a-repo/) if you're not familiar with Pull Requests.

**IMPORTANT**: By submitting a patch, you agree to allow the project owner to
license your work under the same license as that used by the project.