text:
// ==========================================================================
//                 SeqAn - The Library for Sequence Analysis
// ==========================================================================
// Copyright (c) 2006-2015, Knut Reinert, FU Berlin
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of Knut Reinert or the FU Berlin nor the names of
//       its contributors may be used to endorse or promote products derived
//       from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// ==========================================================================
// Author: Rene Rahn <rene.rahn@fu-berlin.de>
// ==========================================================================

#ifndef INCLUDE_SEQAN_BASIC_ITERATOR_ZIP_H_
#define INCLUDE_SEQAN_BASIC_ITERATOR_ZIP_H_

#include <tuple>

namespace seqan
{

// ============================================================================
// Forwards
// ============================================================================

// This function enables us to use the initializer-list trick to expand a parameter pack,
// in order to call a function on each element of the parameter pack.
template <typename T>
inline void
_seqanUnpackFunc(std::initializer_list<T> const /*unused*/)
{}

// This macro is used to hide wrapping the function call as an initializer-list.
#define SEQAN_UNPACK_FUNC(f) _seqanUnpackFunc({(f, 0)...})

// ============================================================================
// Tags, Classes, Enums
// ============================================================================

// Traits to hold the indices of the corresponding tuple.
template <unsigned... >
struct IndexSequence
{};

// Tag to determine the zip iterator.
struct ZipIterator_;
typedef Tag<ZipIterator_> ZipIterator;

/*!
 * @class ZipIterator
 *
 * @extends Iter
 * @implements IteratorAssociatedTypesConcept
 *
 * @headerfile <seqan/basic.h>
 *
 * @brief Zips multiple iterators over different containers into a single iterator.
 *
 * @signature class Iter<std::tuple<TIteratorTypes...>, ZipIterator>;
 *
 * @tparam TIteratorTypes A template parameter pack with one or more @link ContainerConcept#Iterator @endlink types.
 *
 * This iterator ties together different iterator types for different containers of the same size.
 * It allows to operate on a single iterator, if multiple containers need to be traversed simultaneously.
 * Note, that all operations are still executed in a serial fashion.
 * If the zip iterator is dereferenced it returns a std::tuple
 * containing the dereferenced values of all embedded iterators.
 * The metafunctions @link Value @endlink, @link GetValue @endlink and @link Reference @endlink
 * are overloaded accordingly.
 *
 * To easily create a zip iterator one can use the helper function @link makeZipIterator @endlink.
 *
 * @section Example
 *
 * The following example demonstrates the function of the zip iterator:
 *
 * @include demos/dox/basic/zip_iterator.cpp
 *
 * This outputs the following to the console:
 * @include demos/dox/basic/zip_iterator.cpp.stdout
 *
 * @note Throws an assertion if <tt>sizeof...(TIteratorTypes) == 0</tt> is true.
 */

template <typename... TIteratorPack>
class Iter<std::tuple<TIteratorPack...>, ZipIterator>
{
public:
    std::tuple<TIteratorPack...> dataIter;  // tuple stores the different iterators.

    /*!
     * @fn ZipIterator#ZipIterator
     * @brief Constructor.
     * @signature Iter()
     *            Iter(TIteratorTypes... args)
     *
     * @param args The iterator instances to create the @link ZipIterator @endlink from. Default constructors are not listed.
     */

    // Default c'tor.
    Iter()
    {
        static_assert(sizeof...(TIteratorPack) > 0, "Requires at least one argument!");
    }

    // Custom c'tor to create from iterator pack
    Iter(TIteratorPack... iterPack) : dataIter(std::make_tuple(iterPack...))
    {}
};

// ============================================================================
// Metafunctions
// ============================================================================

// ----------------------------------------------------------------------------
// Metafunction MakeIndexSequence
// ----------------------------------------------------------------------------

// This metafunction recursively calls itself, while adding a new index to the growing
// Indices pack.
template<unsigned ID, unsigned... Indices>
struct MakeIndexSequence :
MakeIndexSequence<ID-1, ID-1, Indices...>
{};

// Base case to stop the recursion and to define the IndexSequence with the indices pack.
template<unsigned... Indices>
struct MakeIndexSequence<0, Indices...>
{
    typedef IndexSequence<Indices...> Type;
};

// ----------------------------------------------------------------------------
// Metafunction Container
// ----------------------------------------------------------------------------

/*!
 * @mfn ZipIterator#Container
 * @headerfile <seqan/basic.h>
 * @brief Retruns the Container type of the @link ZipIterator @endlink.
 *
 * @signature typename Container<TZipIterator>::Type;
 *
 * @tparam TZipIterator The type of the @link ZipIterator @endlink.
 *
 * @return TRes A std::tuple containing the container
 *               types of all iterator types embedded in the <tt>TZipIterator</tt> type.
 */
template <typename... TIteratorPack>
struct Container<Iter<std::tuple<TIteratorPack...>, ZipIterator> >
{
    typedef std::tuple<typename Container<TIteratorPack>::Type...> Type;
};

// ----------------------------------------------------------------------------
// Metafunction Value
// ----------------------------------------------------------------------------

// We expand each iterator type in the param pack to call its Value metafunction
// and define a tuple with the value types.

/*!
 * @mfn ZipIterator#Value
 * @headerfile <seqan/basic.h>
 * @brief Retruns the Value type of the @link ZipIterator @endlink.
 *
 * @signature typename Value<TZipIterator>::Type;
 *
 * @tparam TZipIterator The type of the @link ZipIterator @endlink.
 *
 * @return TRes A std::tuple containing the value
 *               types of all iterator types embedded in the <tt>TZipIterator</tt> type.
 */
template <typename... TIteratorPack>
struct Value<Iter<std::tuple<TIteratorPack...>, ZipIterator> >
{
    typedef std::tuple<typename Value<TIteratorPack>::Type...> Type;
};

// ----------------------------------------------------------------------------
// Metafunction GetValue
// ----------------------------------------------------------------------------

/*!
 * @mfn ZipIterator#GetValue
 * @headerfile <seqan/basic.h>
 * @brief Retruns the GetValue type of the @link ZipIterator @endlink.
 *
 * @signature typename GetValue<TZipIterator>::Type;
 *
 * @tparam TZipIterator The type of the @link ZipIterator @endlink.
 *
 * @return TRes A std::tuple containing the value
 *               types of all iterator types embedded in the <tt>TZipIterator</tt> type.
 */
template <typename... TIteratorPack>
struct GetValue<Iter<std::tuple<TIteratorPack...>, ZipIterator> >
{
    typedef std::tuple<typename GetValue<TIteratorPack>::Type...> Type;
};

// ----------------------------------------------------------------------------
// Metafunction Reference
// ----------------------------------------------------------------------------

/*!
 * @mfn ZipIterator#Reference
 * @headerfile <seqan/basic.h>
 * @brief Retruns the Reference type of the @link ZipIterator @endlink.
 *
 * @signature typename GetValue<TZipIterator>::Type;
 *
 * @tparam TZipIterator The type of the @link ZipIterator @endlink.
 *
 * @return TRes A std::tuple containing the value
 *               types of all iterator types embedded in the <tt>TZipIterator</tt> type.
 */
template <typename... TIteratorPack>
struct Reference<Iter<std::tuple<TIteratorPack...>, ZipIterator> >
{
    typedef std::tuple<typename Reference<TIteratorPack>::Type...> Type;
};

// Unclear why we need that! It should be possible to let the generic implementation
// in iterator_base.h to take care of it. Apparently, it is the same semantic.
template <typename... TIteratorPack>
struct Reference<Iter<std::tuple<TIteratorPack...>, ZipIterator> const> :
    Reference<Iter<std::tuple<TIteratorPack...>, ZipIterator> > {};

// ----------------------------------------------------------------------------
// Metafunction Size
// ----------------------------------------------------------------------------

// The size type is only defined by the first type as only the first iterator
// is used to determine the difference between two iterators.
template <typename TFirst, typename... TIteratorPack>
struct Size<Iter<std::tuple<TFirst, TIteratorPack...>, ZipIterator> >
{
    typedef typename Size<TFirst>::Type Type;  // The position and size is determined only by the first argument in the tuple.
};

// Use the default Position-MF

// ----------------------------------------------------------------------------
// Metafunction Difference
// ----------------------------------------------------------------------------

// We use only the first iterator to determine the difference.
template <typename TFirst, typename... TIteratorPack>
struct Difference<Iter<std::tuple<TFirst, TIteratorPack...>, ZipIterator> >
{
    typedef typename Difference<TFirst>::Type Type;  // The difference is determined by only the first argument in the tuple.
};

// ============================================================================
// Functions
// ============================================================================

namespace impl
{

// ----------------------------------------------------------------------------
// Function impl::increment
// ----------------------------------------------------------------------------

// private increment interface.
// Uses the initializer-trick to apply the ++operator to all elements in the tuple
// using pack expansion.
template <typename... TIteratorPack, unsigned... INDEX_SEQUENCE>
inline void
increment(std::tuple<TIteratorPack...> & me,
          IndexSequence<INDEX_SEQUENCE...> const)
{
    SEQAN_UNPACK_FUNC(++std::get<INDEX_SEQUENCE>(me));
}

// ----------------------------------------------------------------------------
// Function impl::decrement
// ----------------------------------------------------------------------------

// Same here for decrement.
template <typename... TIteratorPack, unsigned... INDEX_SEQUENCE>
inline void
decrement(std::tuple<TIteratorPack...> & me,
          IndexSequence<INDEX_SEQUENCE...> const)
{
    SEQAN_UNPACK_FUNC(--std::get<INDEX_SEQUENCE>(me));
}

// ----------------------------------------------------------------------------
// Function impl::advance
// ----------------------------------------------------------------------------

// ... and for advancing the iterator.
template <typename... TIteratorPack, unsigned... INDICES, typename TIntegral>
inline void
advance(std::tuple<TIteratorPack...> & me,
        IndexSequence<INDICES...> const,
        TIntegral const steps)
{
    SEQAN_UNPACK_FUNC(std::advance(std::get<INDICES>(me), steps));
}

// ----------------------------------------------------------------------------
// Function impl::dereference
// ----------------------------------------------------------------------------

// Dereference each iterator in the tuple and forward return values as tuple.
template <typename... TIteratorPack, unsigned... INDEX_SEQUENCE>
inline auto
dereference(std::tuple<TIteratorPack...> & me,
            IndexSequence<INDEX_SEQUENCE...> const) -> decltype(std::forward_as_tuple(*std::get<INDEX_SEQUENCE>(me)...))
{
    return std::forward_as_tuple(*std::get<INDEX_SEQUENCE>(me)...);
}

template <typename... TIteratorPack, unsigned... INDEX_SEQUENCE>
inline auto
dereference(std::tuple<TIteratorPack...> const & me,
            IndexSequence<INDEX_SEQUENCE...> const) -> decltype(std::forward_as_tuple(*std::get<INDEX_SEQUENCE>(me)...))
{
    return std::forward_as_tuple(*std::get<INDEX_SEQUENCE>(me)...);
}

// ----------------------------------------------------------------------------
// Function impl::assignValue
// ----------------------------------------------------------------------------

// Dereference each iterator in the tuple and forward return values as tuple.
template <typename... TRefPack, typename... TValuePack, unsigned... INDEX_SEQUENCE>
inline void
assignValue(std::tuple<TRefPack...> targetPack,
            std::tuple<TValuePack...> const & sourcePack,
            IndexSequence<INDEX_SEQUENCE...> const)
{
    SEQAN_UNPACK_FUNC(assign(std::get<INDEX_SEQUENCE>(targetPack), std::get<INDEX_SEQUENCE>(sourcePack)));
}

// ----------------------------------------------------------------------------
// Function impl::moveValue
// ----------------------------------------------------------------------------

// Dereference each iterator in the tuple and forward return values as tuple.
template <typename... TRefPack, typename... TValuePack, unsigned... INDEX_SEQUENCE>
inline void
moveValue(std::tuple<TRefPack...> targetPack,
          std::tuple<TValuePack...> const & sourcePack,
          IndexSequence<INDEX_SEQUENCE...> const)
{
    SEQAN_UNPACK_FUNC(move(std::get<INDEX_SEQUENCE>(targetPack), std::get<INDEX_SEQUENCE>(sourcePack)));
}

}  // namespace impl

// ----------------------------------------------------------------------------
// Function operator*
// ----------------------------------------------------------------------------

template <typename... TIteratorPack>
inline typename Reference<Iter<std::tuple<TIteratorPack...>, ZipIterator> >::Type
operator*(Iter<std::tuple<TIteratorPack...>, ZipIterator> & me)
{
    return impl::dereference(me.dataIter, typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type());
}

template <typename... TIteratorPack>
inline typename Reference<Iter<std::tuple<TIteratorPack...>, ZipIterator> const>::Type
operator*(Iter<std::tuple<TIteratorPack...>, ZipIterator> const & me)
{
    return impl::dereference(me.dataIter, typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type());
}

// ----------------------------------------------------------------------------
// Function operator++; pre-increment
// ----------------------------------------------------------------------------

template <typename... TIteratorPack>
inline Iter<std::tuple<TIteratorPack...>, ZipIterator> &
operator++(Iter<std::tuple<TIteratorPack...>, ZipIterator> & me /*pre-increment*/)
{
    impl::increment(me.dataIter, typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type());
    return me;
}

// ----------------------------------------------------------------------------
// Function operator++; post-increment
// ----------------------------------------------------------------------------

template <typename... TIteratorPack>
inline Iter<std::tuple<TIteratorPack...>, ZipIterator>
operator++(Iter<std::tuple<TIteratorPack...>, ZipIterator> & me, int const /*post-increment*/)
{
    typename std::remove_reference<decltype(me)>::type tmp(me);
    impl::increment(me.dataIter, typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type());
    return tmp;
}

// ----------------------------------------------------------------------------
// Function operator+
// ----------------------------------------------------------------------------

template <typename... TIteratorPack, typename TIntegral>
inline Iter<std::tuple<TIteratorPack...>, ZipIterator>
operator+(Iter<std::tuple<TIteratorPack...>, ZipIterator> me,
          TIntegral const steps)
{
    impl::advance(me.dataIter,
                  typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type(),
                  steps);
    return me;
}

template <typename... TIteratorPack, typename TIntegral>
inline Iter<std::tuple<TIteratorPack...>, ZipIterator>
operator+(TIntegral const steps,
          Iter<std::tuple<TIteratorPack...>, ZipIterator> me)
{
    impl::advance(me.dataIter,
                  typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type(),
                  steps);
    return me;
}

// ----------------------------------------------------------------------------
// Function operator+=
// ----------------------------------------------------------------------------

template <typename... TIteratorPack, typename TIntegral>
inline Iter<std::tuple<TIteratorPack...>, ZipIterator> &
operator+=(Iter<std::tuple<TIteratorPack...>, ZipIterator> & me,
           TIntegral const steps)
{
    impl::advance(me.dataIter,
                  typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type(),
                  steps);
    return me;
}

// ----------------------------------------------------------------------------
// Function operator--; pre-increment
// ----------------------------------------------------------------------------

template <typename... TIteratorPack>
inline Iter<std::tuple<TIteratorPack...>, ZipIterator>&
operator--(Iter<std::tuple<TIteratorPack...>, ZipIterator> & me /*pre-increment*/)
{
    impl::decrement(me.dataIter, typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type());
    return me;
}

// ----------------------------------------------------------------------------
// Function operator--; post-increment
// ----------------------------------------------------------------------------

template <typename... TIteratorPack>
inline Iter<std::tuple<TIteratorPack...>, ZipIterator>
operator--(Iter<std::tuple<TIteratorPack...>, ZipIterator> & me, int const /*post-increment*/)
{
    typename std::remove_reference<decltype(me)>::type tmp(me);
    impl::decrement(me.dataIter, typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type());
    return tmp;
}

// ----------------------------------------------------------------------------
// Function operator-
// ----------------------------------------------------------------------------

template <typename... TIteratorPack, typename TIntegral>
inline Iter<std::tuple<TIteratorPack...>, ZipIterator>
operator-(Iter<std::tuple<TIteratorPack...>, ZipIterator> me,
          TIntegral const steps)
{
    typedef typename MakeSigned<TIntegral>::Type TSigned;
    impl::advance(me.dataIter, typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type(),
                  -static_cast<TSigned>(steps));
    return me;
}

template <typename... TIteratorPack>
inline typename Difference<Iter<std::tuple<TIteratorPack...>, ZipIterator> >::Type
operator-(Iter<std::tuple<TIteratorPack...>, ZipIterator> const & lhs,
          Iter<std::tuple<TIteratorPack...>, ZipIterator> const & rhs)
{
    return std::get<0>(lhs.dataIter) - std::get<0>(rhs.dataIter);
}

// ----------------------------------------------------------------------------
// Function operator-=
// ----------------------------------------------------------------------------

template <typename... TIteratorPack, typename TIntegral>
inline Iter<std::tuple<TIteratorPack...>, ZipIterator> &
operator-=(Iter<std::tuple<TIteratorPack...>, ZipIterator> & me,
           TIntegral const steps)
{
    typedef typename MakeSigned<TIntegral>::Type TSigned;
    impl::advance(me.dataIter, typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type(),
                  -static_cast<TSigned>(steps));
    return me;
}

// ----------------------------------------------------------------------------
// Function operator==
// ----------------------------------------------------------------------------

template <typename... TIteratorPackL, typename... TIteratorPackR>
inline bool
operator==(Iter<std::tuple<TIteratorPackL...>, ZipIterator> const & lhs,
           Iter<std::tuple<TIteratorPackR...>, ZipIterator> const & rhs)
{
    return lhs.dataIter == rhs.dataIter;
}

// ----------------------------------------------------------------------------
// Function operator!=
// ----------------------------------------------------------------------------

template <typename... TIteratorPackL, typename... TIteratorPackR>
inline bool
operator!=(Iter<std::tuple<TIteratorPackL...>, ZipIterator> const & lhs,
           Iter<std::tuple<TIteratorPackR...>, ZipIterator> const & rhs)
{
    return lhs.dataIter != rhs.dataIter;
}

// ----------------------------------------------------------------------------
// Function operator>=
// ----------------------------------------------------------------------------

template <typename... TIteratorPackL, typename... TIteratorPackR>
inline bool
operator>=(Iter<std::tuple<TIteratorPackL...>, ZipIterator> const & lhs,
           Iter<std::tuple<TIteratorPackR...>, ZipIterator> const & rhs)
{
    return lhs.dataIter >= rhs.dataIter;
}

// ----------------------------------------------------------------------------
// Function operator>
// ----------------------------------------------------------------------------

template <typename... TIteratorPackL, typename... TIteratorPackR>
inline bool
operator>(Iter<std::tuple<TIteratorPackL...>, ZipIterator> const & lhs,
          Iter<std::tuple<TIteratorPackR...>, ZipIterator> const & rhs)
{
    return lhs.dataIter > rhs.dataIter;
}

// ----------------------------------------------------------------------------
// Function operator<=
// ----------------------------------------------------------------------------

template <typename... TIteratorPackL, typename... TIteratorPackR>
inline bool
operator<=(Iter<std::tuple<TIteratorPackL...>, ZipIterator> const & lhs,
           Iter<std::tuple<TIteratorPackR...>, ZipIterator> const & rhs)
{
    return lhs.dataIter <= rhs.dataIter;
}

// ----------------------------------------------------------------------------
// Function operator<
// ----------------------------------------------------------------------------

template <typename... TIteratorPackL, typename... TIteratorPackR>
inline bool
operator<(Iter<std::tuple<TIteratorPackL...>, ZipIterator> const & lhs,
          Iter<std::tuple<TIteratorPackR...>, ZipIterator> const & rhs)
{
    return lhs.dataIter < rhs.dataIter;
}

// ----------------------------------------------------------------------------
// Function swap()
// ----------------------------------------------------------------------------

template <typename... TIteratorPack>
inline void
swap(Iter<std::tuple<TIteratorPack...>, ZipIterator> & lhs,
     Iter<std::tuple<TIteratorPack...>, ZipIterator> & rhs)
{
    std::swap(lhs.dataIter, rhs.dataIter);
}

// ----------------------------------------------------------------------------
// Function assignValue()
// ----------------------------------------------------------------------------

template <typename... TIteratorPack, typename... TValuePack>
inline void
assignValue(Iter<std::tuple<TIteratorPack...>, ZipIterator> & target,
            std::tuple<TValuePack...> const & value)
{
    static_assert(sizeof...(TIteratorPack) == sizeof...(TValuePack), "Wrong number of arguments.");
    impl::assignValue(*target, value, typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type());
}

// ----------------------------------------------------------------------------
// Function moveValue()
// ----------------------------------------------------------------------------

template <typename... TIteratorPack, typename... TValuePack>
inline void
moveValue(Iter<std::tuple<TIteratorPack...>, ZipIterator> & target,
          std::tuple<TValuePack...> const & value)
{
    static_assert(sizeof...(TIteratorPack) == sizeof...(TValuePack), "Wrong number of arguments.");
    impl::moveValue(*target, value, typename MakeIndexSequence<sizeof...(TIteratorPack)>::Type());
}

// ----------------------------------------------------------------------------
// Function makeZipIterator()
// ----------------------------------------------------------------------------

/*!
 * @fn makeZipIterator
 * @headerfile <seqan/basic_iterator.h>
 * @brief Creates a @link ZipIterator @endlink, deducing the iterator types from the arguments.
 *
 * @signature iter makeZipIterator(TIteratorTypes... args)
 *
 * @param [in] args One or more iterator instances to construct the @link ZipIterator @endlink from.
 *
 * @return iter A @link ZipIterator @endlink containing the given iterator instances.
 */
template <typename... TIteratorPack>
inline Iter<std::tuple<TIteratorPack... >, ZipIterator>
makeZipIterator(TIteratorPack... iterPack)
{
    return Iter<std::tuple<TIteratorPack... >, ZipIterator>(iterPack...);
}

}

#endif  // #ifndef INCLUDE_SEQAN_BASIC_ITERATOR_ZIP_H_


text:
class CCheckerBoard : public CInfinitePlane
{
public:
	CCheckerBoard();
	virtual ~CCheckerBoard();

	CColour Colour1;
	CColour Colour2;
	double CheckSize;

private:
	virtual void InitialiseValues(s_IntersectionInfo *Intersection, CRay *IncomingRay);

};

#endif // !defined(AFX_CHECKERBOARD_H__DA0E5304_B3F7_4896_9180_D3E2FAA92344__INCLUDED_)

redpajama_set_name: RedPajamaGithub


text:
/**
 */
package fr.unice.spinefm.ActionModel.SystemActionModel.impl;

import fr.unice.spinefm.ActionModel.SystemActionModel.ActionRenameConfig;
import fr.unice.spinefm.ActionModel.SystemActionModel.SystemActionModelPackage;

import fr.unice.spinefm.ConfigurationModel.Configuration;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 *
 * An implementation of the model object 'Action Rename Config'.
 *
 *

 * The following features are implemented:
 *

 *
{@link fr.unice.spinefm.ActionModel.SystemActionModel.impl.ActionRenameConfigImpl#getConfig Config}

 *

 *

 *
 * @generated
 */
public class ActionRenameConfigImpl extends ActionAbstractRenameImpl implements ActionRenameConfig
{
	/**
	 * The cached value of the '{@link #getConfig() Config}' reference.
	 *
	 *
	 * @see #getConfig()
	 * @generated
	 * @ordered
	 */
	protected Configuration config;

	/**
	 *
	 *
	 * @generated
	 */
	protected ActionRenameConfigImpl()
	{
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	protected EClass eStaticClass()
	{
		return SystemActionModelPackage.Literals.ACTION_RENAME_CONFIG;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public Configuration getConfig()
	{
		if (config != null && config.eIsProxy())
		{
			InternalEObject oldConfig = (InternalEObject)config;
			config = (Configuration)eResolveProxy(oldConfig);
			if (config != oldConfig)
			{
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SystemActionModelPackage.ACTION_RENAME_CONFIG__CONFIG, oldConfig, config));
			}
		}
		return config;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public Configuration basicGetConfig()
	{
		return config;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setConfig(Configuration newConfig)
	{
		Configuration oldConfig = config;
		config = newConfig;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SystemActionModelPackage.ACTION_RENAME_CONFIG__CONFIG, oldConfig, config));
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType)
	{
		switch (featureID)
		{
			case SystemActionModelPackage.ACTION_RENAME_CONFIG__CONFIG:
				if (resolve) return getConfig();
				return basicGetConfig();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue)
	{
		switch (featureID)
		{
			case SystemActionModelPackage.ACTION_RENAME_CONFIG__CONFIG:
				setConfig((Configuration)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eUnset(int featureID)
	{
		switch (featureID)
		{
			case SystemActionModelPackage.ACTION_RENAME_CONFIG__CONFIG:
				setConfig((Configuration)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID)
	{
		switch (featureID)
		{
			case SystemActionModelPackage.ACTION_RENAME_CONFIG__CONFIG:
				return config != null;
		}
		return super.eIsSet(featureID);
	}

} //ActionRenameConfigImpl


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MI.Domain.Entity.WarehouseManage
{
    public class WarehouseEntity : IEntity<WarehouseEntity>, ICreationAudited, IDeleteAudited, IModificationAudited
    {

        public string F_Id { get; set; }

        public string F_ParentId { get; set; }

        /// <summary>
        /// 组织主键
        /// </summary>
        public string F_OrganizeId { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        public string F_EnCode { get; set; }

        public string F_FullName { get; set; }

        /// <summary>
        /// 仓库类型1:实体0:虚拟仓库
        /// </summary>
        public int? F_Type { get; set; }

        /// <summary>
        /// 联系地址
        /// </summary>
        public string F_Address { get; set; }

        /// <summary>
        /// 货架存储位数
        /// </summary>
        public int? F_ShelfNumber { get; set; }

        /// <summary>
        /// 货架存储层数
        /// </summary>
        public int? F_ShelfLayer { get; set; }

        public bool? F_AllowEdit { get; set; }

        public bool? F_AllowDelete { get; set; }

        public int? F_SortCode { get; set; }
        public bool? F_DeleteMark { get; set; }
        public bool? F_EnabledMark { get; set; }

        public string F_Description { get; set; }
        public DateTime? F_CreatorTime { get; set; }
        public string F_CreatorUserId { get; set; }
        public DateTime? F_LastModifyTime { get; set; }
        public string F_LastModifyUserId { get; set; }
        public DateTime? F_DeleteTime { get; set; }
        public string F_DeleteUserId { get; set; }
    }
}


text:
<!DOCTYPE html>
<canvas id="canvas" width="1" height="1"></canvas>
<script src="../../resources/js-test.js"></script>
<script>
jsTestIsAsync = true;

description("Tests that non-opaque pixels are faithfully preserved in conversions between ImageData and ImageBitmap");

var imageData = new ImageData(new Uint8ClampedArray([12, 34, 56, 64]), 1, 1);
var newImageData;
createImageBitmap(imageData).then(imageBitmap => {
    var context = document.getElementById("canvas").getContext("2d");
    context.drawImage(imageBitmap, 0, 0);
    newImageData = context.getImageData(0, 0, 1, 1);

    // newImageData is not necessary the same as imageData because of
    // multiplying and dividing by alpha during the round trip, but
    // they should be close.
    // The alpha channel should be exactly the same.
    shouldBeCloseTo("newImageData.data[0]", "imageData.data[0]", 5);
    shouldBeCloseTo("newImageData.data[1]", "imageData.data[1]", 5);
    shouldBeCloseTo("newImageData.data[2]", "imageData.data[2]", 5);
    shouldBe("newImageData.data[3]", "imageData.data[3]");

    finishJSTest();
});
</script>


text: very lightweight pseudo-window manager for webpages


text:
#ifndef __OU_FLAGS_H_INCLUDED
#define __OU_FLAGS_H_INCLUDED

#include <ou/simpleflags.h>
#include <ou/atomicflags.h>

#endif // #ifndef __OU_FLAGS_H_INCLUDED


text:
package com.dongxiguo.fastring

import language.experimental.macros
import scala.collection.TraversableLike
import scala.collection.mutable.LazyBuilder
import scala.collection.generic.CanBuildFrom
import scala.reflect.macros.Context

abstract class Fastring extends TraversableLike[String, Fastring] with Traversable[String] { self =>
  override final def seq = this

  override protected final def newBuilder = Fastring.newBuilder

  final def appendTo(appendable: Appendable) {
    for (string <- this) {
      appendable.append(string)
    }
  }

  final def appendTo(stringBuilder: StringBuilder) {
    for (string <- this) {
      stringBuilder ++= string
    }
  }

  override final def mkString = {
    val sb = new java.lang.StringBuilder
    for (s <- this) {
      sb.append(s)
    }
    sb.toString
  }

  override final def toString = mkString

}

final object Fastring {

  final object Empty extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {}
  }

  final class FromAny(from: Any) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      visitor(String.valueOf(from))
    }
  }

  final class FromCharArray(from: Array[Char]) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      visitor(String.valueOf(from))
    }
  }

  final class FromBoolean(from: Boolean) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      visitor(String.valueOf(from))
    }
  }

  final class FromByte(from: Byte) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      visitor(String.valueOf(from))
    }
  }

  final class FromChar(from: Char) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      visitor(String.valueOf(from))
    }
  }

  final class FromShort(from: Short) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      visitor(String.valueOf(from))
    }
  }

  final class FromInt(from: Int) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      visitor(String.valueOf(from))
    }
  }

  final class FromLong(from: Long) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      visitor(String.valueOf(from))
    }
  }

  final class FromFloat(from: Float) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      visitor(String.valueOf(from))
    }
  }

  final class FromDouble(from: Double) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      visitor(String.valueOf(from))
    }
  }

  final class FromString(string: String) extends Fastring {

    @inline
    override final def foreach[U](visitor: String => U) {
      visitor(string)
    }
  }

  @deprecated(message = "Use `leftPad` instead", since = "0.3.0")
  final class FilledLong(value: Long, minWidth: Int, filledChar: Char, radix: Int)
      extends LeftPadLong(value, minWidth, filledChar, radix)

  class LeftPadLong(value: Long, minWidth: Int, filledChar: Char, radix: Int) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      val unfilled = java.lang.Long.toString(value, radix)
      if (unfilled.length < minWidth) {
        if (value >= 0) {
          visitor(new String(Array.fill(minWidth - unfilled.length)(filledChar)))
          visitor(unfilled)
        } else {
          visitor("-")
          visitor(new String(Array.fill(minWidth - unfilled.length)(filledChar)))
          visitor(unfilled.substring(1))
        }
      } else {
        visitor(unfilled)
      }
    }
  }

  @deprecated(message = "Use `leftPad` instead", since = "0.3.0")
  final class FilledInt(value: Int, minWidth: Int, filledChar: Char, radix: Int)
      extends LeftPadInt(value, minWidth, filledChar, radix)

  class LeftPadInt(value: Int, minWidth: Int, filledChar: Char, radix: Int) extends Fastring {
    @inline
    override final def foreach[U](visitor: String => U) {
      val unfilled = java.lang.Integer.toString(value, radix)
      if (unfilled.length < minWidth) {
        if (value >= 0) {
          visitor(new String(Array.fill(minWidth - unfilled.length)(filledChar)))
          visitor(unfilled)
        } else {
          visitor("-")
          visitor(new String(Array.fill(minWidth - unfilled.length)(filledChar)))
          visitor(unfilled.substring(1))
        }
      } else {
        visitor(unfilled)
      }
    }
  }

  final def empty = Empty

  @inline
  final def apply[A <: Fastring](fastring: A): A = fastring

  @inline
  final def apply(from: Any) = new FromAny(from)

  @inline
  final def apply(from: Array[Char]) = new FromCharArray(from)

  @inline
  final def apply(from: Boolean) = new FromBoolean(from)

  @inline
  final def apply(from: Byte) = new FromByte(from)

  @inline
  final def apply(from: Char) = new FromChar(from)

  @inline
  final def apply(from: Short) = new FromShort(from)

  @inline
  final def apply(from: Int) = new FromInt(from)

  @inline
  final def apply(from: Long) = new FromLong(from)

  @inline
  final def apply(from: Float) = new FromFloat(from)

  @inline
  final def apply(from: Double) = new FromDouble(from)

  final def applyVarargs_impl(
      c: Context)(argument1: c.Expr[Any], argument2: c.Expr[Any], rest: c.Expr[Any]*): c.Expr[Fastring] = {
    val visitorExpr = c.Expr[String => _](c.universe.Ident(c.universe.newTermName("visitor")))
    val foreachBodyExpr = rest.foldLeft[c.Expr[Unit]](c.universe.reify {
      _root_.com.dongxiguo.fastring.Fastring(argument1).foreach(visitorExpr.splice)
      _root_.com.dongxiguo.fastring.Fastring(argument2).foreach(visitorExpr.splice)
    }) { (prefixExpr, argument) =>
      c.universe.reify {
        prefixExpr.splice
        _root_.com.dongxiguo.fastring.Fastring(argument).foreach(visitorExpr.splice)
      }
    }
    c.universe.reify {
      new _root_.com.dongxiguo.fastring.Fastring {
        @inline
        override final def foreach[U](visitor: _root_.scala.Predef.String => U) {
          foreachBodyExpr.splice
        }
      }
    }
  }

  @inline final def apply(argument1: Any, argument2: Any, rest: Any*): Fastring = macro applyVarargs_impl

  @inline
  final def apply(string: String) = new FromString(string)

  object FastringCanBuildFrom extends CanBuildFrom[Fastring, String, Fastring] {
    def apply(from: Fastring) = newBuilder
    def apply() = newBuilder
  }

  @inline
  implicit final def canBuildFrom = FastringCanBuildFrom

  final def newBuilder = new LazyBuilder[String, Fastring] {
    final def result() = {
      val parts = this.parts
      this.parts = null
      new Fastring {
        @inline
        override final def foreach[U](visitor: String => U) {
          for (part <- parts) {
            part.foreach(visitor)
          }
        }
      }
    }
  }

  final object Implicits {
    type Fastring = com.dongxiguo.fastring.Fastring

    object FastringContext {

      private def newLocalFastringClass(c: Context, escapeFunction: String => String)(
          arguments: Seq[c.Expr[Any]]): c.Expr[Fastring] = {

        import c.universe._
        val Apply(Select(Apply(_, List(Apply(_, partTrees))), _), _) =
          c.macroApplication
        assert(partTrees.length == arguments.length + 1)
        val visitorExpr = c.Expr[String => _](c.universe.Ident(newTermName("visitor")))
        val visitPartExprs = for (partTree <- partTrees) yield {
          val Literal(Constant(part: String)) = partTree
          if (part == "") {
            reify(())
          } else {
            val partExpr =
              c.Expr[String](Literal(Constant(escapeFunction(part))))
            reify(visitorExpr.splice(partExpr.splice))
          }
        }
        val visitAllExpr =
          0.until(arguments.length).foldLeft[c.Expr[Unit]](c.Expr(c.universe.EmptyTree)) { (prefixExpr, i) =>
            val argumentExpr = c.Expr[Any](c.universe.Ident(newTermName("__arguments" + i)))
            val visitPartExpr = visitPartExprs(i)
            c.universe.reify {
              prefixExpr.splice
              visitPartExpr.splice
              _root_.com.dongxiguo.fastring.Fastring(argumentExpr.splice).foreach(visitorExpr.splice)
            }
          }
        // Workaround for https://issues.scala-lang.org/browse/SI-6711
        val valDefTrees =
          (for ((argumentExpr, i) <- arguments.iterator.zipWithIndex) yield {
            c.universe.ValDef(c.universe.Modifiers(),
                              c.universe.newTermName("__arguments" + i),
                              c.universe.TypeTree(),
                              argumentExpr.tree)
          })
        val visitLastPartExpr = visitPartExprs(arguments.length)
        val newFastringExpr =
          c.universe.reify {
            new _root_.com.dongxiguo.fastring.Fastring {
              @inline
              override final def foreach[U](visitor: _root_.scala.Predef.String => U) {
                visitAllExpr.splice
                visitLastPartExpr.splice
              }
            }
          }
        c.Expr(c.universe.Block(valDefTrees.toList, newFastringExpr.tree))
      }

      final def fast_impl(c: Context)(arguments: c.Expr[Any]*): c.Expr[Fastring] =
        newLocalFastringClass(c, StringContext.treatEscapes)(arguments)

      final def fastraw_impl(c: Context)(arguments: c.Expr[Any]*): c.Expr[Fastring] =
        newLocalFastringClass(c, identity)(arguments)

    }

    implicit final class FastringContext(val stringContext: StringContext) extends AnyVal {
      import FastringContext._

      final def fastraw(arguments: Any*) = macro fastraw_impl

      final def fast(arguments: Any*) = macro fast_impl

    }

    final object MkFastring {

      final def mkFastring_impl(c: Context): c.Expr[Fastring] = {
        import c.universe._
        val Select(mkFastringTree, _) = c.macroApplication
        val mkFastringExpr = c.Expr[MkFastring[_]](mkFastringTree)
        reify {
          // Workaround for https://issues.scala-lang.org/browse/SI-6711
          val m = mkFastringExpr.splice
          new _root_.com.dongxiguo.fastring.Fastring {
            @inline
            override final def foreach[U](visitor: _root_.scala.Predef.String => U) {
              for (subCollection <- m.underlying) {
                _root_.com.dongxiguo.fastring.Fastring(subCollection).foreach(visitor)
              }
            }
          }
        }
      }

      final def mkFastringWithSeperator_impl(c: Context)(seperator: c.Expr[String]): c.Expr[Fastring] = {
        import c.universe._
        val Apply(Select(mkFastringTree, _), _) = c.macroApplication
        val mkFastringExpr = c.Expr[MkFastring[_]](mkFastringTree)
        reify {
          // Workaround for https://issues.scala-lang.org/browse/SI-6711
          val s = seperator.splice
          val m = mkFastringExpr.splice
          new _root_.com.dongxiguo.fastring.Fastring {
            @inline
            override final def foreach[U](visitor: _root_.scala.Predef.String => U) {
              var first = true
              for (subCollection <- m.underlying) {
                if (first) {
                  first = false
                } else {
                  visitor(s)
                }
                _root_.com.dongxiguo.fastring.Fastring(subCollection).foreach(visitor)
              }
            }
          }
        }
      }
    }

    implicit final class MkFastring[A](val underlying: TraversableOnce[A]) extends AnyVal {
      import MkFastring._
      final def mkFastring: Fastring = macro mkFastring_impl
      final def mkFastring(seperator: String): Fastring = macro mkFastringWithSeperator_impl
    }

    implicit final class ArrayMkFastring[A](val underlying: Array[A]) extends AnyVal {
      import MkFastring._
      final def mkFastring: Fastring = macro mkFastring_impl
      final def mkFastring(seperator: String): Fastring = macro mkFastringWithSeperator_impl
    }

    implicit final class LongLeftPadOps(val underlying: Long) extends AnyVal {
      @inline
      final def leftPad(minWidth: Int, filledChar: Char = ' ', radix: Int = 10) =
        new LeftPadLong(underlying, minWidth, filledChar, radix)
    }

    @deprecated(message = "Use `leftPad` instead", since = "0.3.0")
    implicit final class LongFilled(val underlying: Long) extends AnyVal {
      @deprecated(message = "Use `leftPad` instead", since = "0.3.0")
      @inline
      final def filled(minWidth: Int, filledChar: Char = ' ', radix: Int = 10) =
        new FilledLong(underlying, minWidth, filledChar, radix)
    }

    implicit final class IntLeftPadOps(val underlying: Int) extends AnyVal {
      @inline
      final def leftPad(minWidth: Int, filledChar: Char = ' ', radix: Int = 10) =
        new LeftPadInt(underlying, minWidth, filledChar, radix)
    }

    @deprecated(message = "Use `leftPad` instead", since = "0.3.0")
    implicit final class IntFilled(val underlying: Int) extends AnyVal {

      @deprecated(message = "Use `leftPad` instead", since = "0.3.0")
      @inline
      final def filled(minWidth: Int, filledChar: Char = ' ', radix: Int = 10) =
        new FilledInt(underlying, minWidth, filledChar, radix)

    }

    import language.implicitConversions
    @inline
    implicit final def byteFilled(byte: Byte) = new IntFilled(byte)

    @inline
    implicit final def shortFilled(short: Short) = new IntFilled(short)

  }
}


text:
'use strict';

// Reminder: this file exists because code coverage testing breaks if we try to
// `require()` a JSON file (e.g. package.json)
module.exports = {
  version: '0.5.236'
};


text:
/* eslint no-console: 0 */
import React from 'react';
import deprecated from '../src/deprecated';

export function shouldError(about) {
  console.error.called.should.be.true;
  console.error.calledWithMatch(about).should.be.true;
  console.error.reset();
}

describe('deprecated', function() {
  beforeEach(function() {
    // because 'warning' package uses console.error instead of console.warn
    sinon.stub(console, 'error');
  });

  afterEach(function() {
    console.error.restore();
  });

  function validate(prop) {
    return deprecated(React.PropTypes.string, 'Read more at link')({pName: prop}, 'pName', 'ComponentName');
  }

  it('Should warn about deprecation and validate OK', function() {
    const err = validate('value');
    shouldError('"pName" property of "ComponentName" has been deprecated.\nRead more at link');
    assert.notInstanceOf(err, Error);
  });

  it('Should warn about deprecation and throw validation error when property value is not OK', function() {
    const err = validate({});
    shouldError('"pName" property of "ComponentName" has been deprecated.\nRead more at link');
    assert.instanceOf(err, Error);
    assert.include(err.message, 'Invalid undefined `pName` of type `object` supplied to `ComponentName`');
  });
});


text:
var result = result ||[];
result.push('inject-js-start');

window.onload = function(){
	result.push('onload')
};


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

namespace Fink\config\value;
use Fink\config\Configuration;

/**
 * Class ConfigurationValue
 *
 * Class to represent a configuration value
 *
 * @package Fink\config
 */
class ConfigurationValue {

  const NESTED_CONFIGURATION_REGEX = "/\\$\{(?<key>.*)\}/";

  const NESTED_CONFIGURATION_PATH_DIVIDER = "/";

  private $value;

  private $configuration;

  private $parser;

  /**
   * ConfigurationValue constructor.
   *
   * @param Configuration $configuration the configuration instance of this value
   * @param mixed $value some value
   */
  public function __construct(Configuration $configuration, $value) {
    $this->configuration = $configuration;
    $this->value = $value;
    $this->parser = new ValueParser();
  }

  /**
   * @return mixed the unparsed value
   */
  public function getRawValue() {
    return $this->value;
  }

  /**
   * Parse the configuration value and return the parsed result
   *
   * @return mixed the parsed value
   */
  public function parse() {
    $value = $this->getRawValue();
    $matches = [];
    if (is_array($value)) {
      return $value;
    }

    if (preg_match(self::NESTED_CONFIGURATION_REGEX, $value, $matches) === 1) {
      return $this->parseNestedValue($value, $matches);
    } else {
      return $this->parser->parseIntelligent($value);
    }
  }

  private function parseNestedValue($value, $matches) {
    $keys = explode(self::NESTED_CONFIGURATION_PATH_DIVIDER, $matches["key"]);
    $valueToReplace = $this->configuration->get(...$keys);

    return preg_replace(self::NESTED_CONFIGURATION_REGEX, $valueToReplace, $value);
  }

}


text:
from .version_microsoft import WINVER

from types import IntType, LongType

from ctypes import *

from .windows import *
from .wtl_core import *
from .comctl import *

memcpy = cdll.msvcrt.memcpy

# Dialog Box Template Styles
DS_ABSALIGN         = 0x01
DS_SYSMODAL         = 0x02
DS_LOCALEDIT        = 0x20   # Edit items get Local storage
DS_SETFONT          = 0x40   # User specified font for Dlg controls
DS_MODALFRAME       = 0x80   # Can be combined with WS_CAPTION
DS_NOIDLEMSG        = 0x100  # WM_ENTERIDLE message will not be sent
DS_SETFOREGROUND    = 0x200  # not in win3.1
if WINVER >= 0x0400:
	DS_3DLOOK           = 0x0004
	DS_FIXEDSYS         = 0x0008
	DS_NOFAILCREATE     = 0x0010
	DS_CONTROL          = 0x0400
	DS_CENTER           = 0x0800
	DS_CENTERMOUSE      = 0x1000
	DS_CONTEXTHELP      = 0x2000
	DS_SHELLFONT        = DS_SETFONT | DS_FIXEDSYS
#if(_WIN32_WCE >= 0x0500)
#DS_USEPIXELS        = 0x8000L

# Dialog Codes
DLGC_WANTARROWS      = 0x0001      # Control wants arrow keys
DLGC_WANTTAB         = 0x0002      # Control wants tab keys
DLGC_WANTALLKEYS     = 0x0004      # Control wants all keys
DLGC_WANTMESSAGE     = 0x0004      # Pass message to control
DLGC_HASSETSEL       = 0x0008      # Understands EM_SETSEL message
DLGC_DEFPUSHBUTTON   = 0x0010      # Default pushbutton
DLGC_UNDEFPUSHBUTTON = 0x0020      # Non-default pushbutton
DLGC_RADIOBUTTON     = 0x0040      # Radio button
DLGC_WANTCHARS       = 0x0080      # Want WM_CHAR messages
DLGC_STATIC          = 0x0100      # Static item: don't include
DLGC_BUTTON          = 0x2000      # Button item: can be checked

class StringOrOrd:
    """Pack up a string or ordinal"""
    def __init__(self, value):
        if value is None or value == "":
            self.value = c_ushort(0)
        elif type(value) in (IntType, LongType):
            # treat as an atom
            if not value:
                self.value = c_ushort(0)        # 0 is not a valid atom
            else:
                ordinaltype = c_ushort * 2
                ordinal = ordinaltype(0xffff, value)
                self.value = ordinal
        else:
            value = str(value)

            mbLen = MultiByteToWideChar(CP_ACP, 0, value, -1, 0, 0)
            if mbLen < 1:
                raise RuntimeError("Could not determine multibyte string length for %s" % \
                                   repr(value))

            #this does not work for me:, why needed?
            #if (mbLen % 2):
            #    mbLen += 1          # round up to next word in size

            stringtype = c_ushort * mbLen
            string = stringtype()
            result = MultiByteToWideChar(CP_ACP, 0, value, -1, addressof(string), sizeof(string))
            if result < 1:
                raise RuntimeError("could not convert multibyte string %s" % repr(value))
            self.value = string

    def __len__(self):
        return sizeof(self.value)

class DialogTemplate(WindowsObject):
    __dispose__ = GlobalFree
    _window_class_ = None
    _window_style_ = WS_CHILD
    _window_style_ex_ = 0
    _class_font_size_ = 8
    _class_font_name_ = "MS Sans Serif"

    def __init__(self,
                 wclass = None,    # the window class
                 title = "",
                 menu=None,
                 style = None,
                 exStyle = None,
                 fontSize=None,
                 fontName=None,
                 rcPos = RCDEFAULT,
                 orStyle = None,
                 orExStyle = None,
                 nandStyle = None,
                 nandExStyle = None,
                 items=[]):

        if wclass is not None:
            wclass = StringOrOrd(wclass)
        else:
            wclass = StringOrOrd(self._window_class_)

        title = StringOrOrd(title)
        menu = StringOrOrd(menu)

        if style is None:
            style = self._window_style_

        if exStyle is None:
            exStyle = self._window_style_ex_

        if orStyle:
            style |= orStyle

        if orExStyle:
            exStyle |= orExStyle

        if nandStyle:
            style &= ~nandStyle

        if rcPos.left == CW_USEDEFAULT:
            cx = 50
            x = 0
        else:
            cx = rcPos.right
            x = rcPos.left

        if rcPos.top == CW_USEDEFAULT:
            cy = 50
            y = 0
        else:
            cy = rcPos.bottom
            y = rcPos.top

        if style & DS_SETFONT:
            if fontSize is None:
                fontSize = self._class_font_size_

            if fontName is None:
                fontName = StringOrOrd(self._class_font_name_)
        else:
            fontSize = None
            fontName = None

        header = DLGTEMPLATE()
        byteCount = sizeof(header)

        byteCount += len(wclass) + len(title) + len(menu)
        if fontName or fontSize:
            byteCount += 2 + len(fontName)

        d, rem = divmod(byteCount, 4)   # align on dword
        byteCount += rem
        itemOffset = byteCount  # remember this for later

        for i in items:
            byteCount += len(i)

        valuetype = c_ubyte * byteCount
        value = valuetype()

        header = DLGTEMPLATE.from_address(addressof(value))
        # header is overlayed on value
        header.exStyle = exStyle
        header.style = style
        header.cDlgItems = len(items)
        header.x = x
        header.y = y
        header.cx = cx
        header.cy = cy

        offset = sizeof(header)

        # now, memcpy over the menu
        memcpy(addressof(value)+offset, addressof(menu.value), len(menu))    # len really returns sizeof menu.value
        offset += len(menu)

        # and the window class
        memcpy(addressof(value)+offset, addressof(wclass.value), len(wclass))    # len really returns sizeof wclass.value
        offset += len(wclass)

        # now copy the title
        memcpy(addressof(value)+offset, addressof(title.value), len(title))
        offset += len(title)

        if fontSize or fontName:
            fsPtr = c_ushort.from_address(addressof(value)+offset)
            fsPtr.value = fontSize
            offset += 2

            # now copy the fontname
            memcpy(addressof(value)+offset, addressof(fontName.value), len(fontName))
            offset += len(fontName)

        # and now the items
        assert offset <= itemOffset, "offset %d beyond items %d" % (offset, itemOffset)
        offset = itemOffset
        for item in items:
            memcpy(addressof(value)+offset, addressof(item.value), len(item))
            offset += len(item)
            assert (offset % 4) == 0, "Offset not dword aligned for item"

        self.m_handle = GlobalAlloc(0, sizeof(value))
        memcpy(self.m_handle, addressof(value), sizeof(value))
        self.value = value

    def __len__(self):
        return sizeof(self.value)

class DialogItemTemplate(object):
    _window_class_ = None
    _window_style_ = WS_CHILD|WS_VISIBLE
    _window_style_ex_ = 0

    def __init__(self,
                 wclass = None,    # the window class
                 id = 0,              # the control id
                 title = "",
                 style = None,
                 exStyle = None,
                 rcPos = RCDEFAULT,
                 orStyle = None,
                 orExStyle = None,
                 nandStyle = None,
                 nandExStyle = None):

        if not self._window_class_ and not wclass:
            raise ValueError("A window class must be specified")

        if wclass is not None:
            wclass = StringOrOrd(wclass)
        else:
            wclass = StringOrOrd(self._window_class_)

        title = StringOrOrd(title)

        if style is None:
            style = self._window_style_

        if exStyle is None:
            exStyle = self._window_style_ex_

        if orStyle:
            style |= orStyle

        if orExStyle:
            exStyle |= orExStyle

        if nandStyle:
            style &= ~nandStyle

        if rcPos.left == CW_USEDEFAULT:
            cx = 50
            x = 0
        else:
            cx = rcPos.right
            x = rcPos.left

        if rcPos.top == CW_USEDEFAULT:
            cy = 50
            y = 0
        else:
            cy = rcPos.bottom
            y = rcPos.top

        header = DLGITEMTEMPLATE()
        byteCount = sizeof(header)
        byteCount += 2  # two bytes for extraCount
        byteCount += len(wclass) + len(title)
        d, rem = divmod(byteCount, 4)
        byteCount += rem            # must be a dword multiple

        valuetype = c_ubyte * byteCount
        value = valuetype()

        header = DLGITEMTEMPLATE.from_address(addressof(value))
        # header is overlayed on value
        header.exStyle = exStyle
        header.style = style
        header.x = x
        header.y = y
        header.cx = cx
        header.cy = cy
        header.id = id

        # now, memcpy over the window class
        offset = sizeof(header)
        memcpy(addressof(value)+offset, addressof(wclass.value), len(wclass))
        # len really returns sizeof wclass.value
        offset += len(wclass)
        # now copy the title
        memcpy(addressof(value)+offset, addressof(title.value), len(title))
        offset += len(title)
        extraCount = c_ushort.from_address(addressof(value)+offset)
        extraCount.value = 0
        self.value = value

    def __len__(self):
        return sizeof(self.value)

PUSHBUTTON = 0x80
EDITTEXT = 0x81
LTEXT = 0x82
LISTBOX  = 0x83
SCROLLBAR = 0x84
COMBOBOX = 0x85

class PushButton(DialogItemTemplate):
    _window_class_ = PUSHBUTTON
    _window_style_ = WS_CHILD|WS_VISIBLE|WS_TABSTOP

class DefPushButton(DialogItemTemplate):
    _window_class_ = PUSHBUTTON
    _window_style_ = WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_DEFPUSHBUTTON

class GroupBox(DialogItemTemplate):
    _window_class_ = PUSHBUTTON
    _window_style_ = WS_CHILD|WS_VISIBLE|BS_GROUPBOX

class EditText(DialogItemTemplate):
    _window_class_ = EDITTEXT
    _window_style_ = WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP

class StaticText(DialogItemTemplate):
    _window_class_ = LTEXT
    _window_style_ = WS_CHILD|WS_VISIBLE|WS_GROUP

class ListBox(DialogItemTemplate):
    _window_class_ = LISTBOX
    _window_style_ = LBS_STANDARD

class ScrollBar(DialogItemTemplate):
    _window_class_ = SCROLLBAR
    _window_style_ = WS_CHILD|WS_VISIBLE|WS_TABSTOP|SBS_VERT|SBS_RIGHTALIGN

class ComboBox(DialogItemTemplate):
	_window_class_ = COMBOBOX
	_window_style_ = WS_VISIBLE|WS_CHILD|WS_OVERLAPPED|WS_VSCROLL|WS_TABSTOP|CBS_DROPDOWNLIST

class RadioButton(DialogItemTemplate):
    _window_class_ = PUSHBUTTON
    _window_style_ = WS_CHILD|WS_VISIBLE|WS_GROUP|WS_TABSTOP|BS_RADIOBUTTON

class AutoRadioButton(DialogItemTemplate):
    _window_class_ = PUSHBUTTON
    _window_style_ = WS_CHILD|WS_VISIBLE|WS_GROUP|WS_TABSTOP|BS_AUTORADIOBUTTON

class CheckBox(DialogItemTemplate):
    _window_class_ = PUSHBUTTON
    _window_style_ = WS_CHILD|WS_VISIBLE|WS_GROUP|WS_TABSTOP|BS_CHECKBOX

class AutoCheckBox(DialogItemTemplate):
    _window_class_ = PUSHBUTTON
    _window_style_ = WS_CHILD|WS_VISIBLE|WS_GROUP|WS_TABSTOP|BS_AUTOCHECKBOX

class Dialog(Window):
    """supports _dialog_id_ and _dialog_module_ class properties or
    use _dialog_template_"""
    _dialog_template_ = None
    _dialog_module_ = None
    _dialog_id_ = None

    def __init__(self, template = None, id = None, module = None):
        """module and dlgid can be passed as parameters or be given as class properties"""
        self.module = None
        self.id = None
        self.template = None

        if template or self._dialog_template_:
            self.template = template or self._dialog_template_
        elif module or self._dialog_module_:
            self.module = module or self._dialog_module_
            self.id = id or self._dialog_id_

        if self.module and type(self.module) == type(''): #module is given as path name
            self.module = LoadLibrary(self.module)

        self.m_handle = 0 #filled in on init dialog

    def DoModal(self, parent = 0, center = 1):
        self.center = center
        if self.template:
            return DialogBoxIndirectParam(self.module,
                                          self.template.handle,
                                          handle(parent),
                                          DialogProc(self.DlgProc),
                                          0)
        else:
            return DialogBoxParam(self.module, self.id, handle(parent),
                                  DialogProc(self.DlgProc), 0)

    def DlgProc(self, hwnd, uMsg, wParam, lParam):
        handled, result = self._msg_map_.Dispatch(self, hwnd, uMsg, wParam, lParam)
        return result

    def GetDlgItem(self, nIDDlgItem, windowClass = None):
        """specify window class to get a 'Venster' wrapped control"""
        hWnd = GetDlgItem(self.handle, nIDDlgItem)
        if hWnd and windowClass:
            return windowClass(hWnd = hWnd)
        else:
            return hWnd

    def EndDialog(self, exitCode):
        EndDialog(self.handle, exitCode)

    def OnOK(self, event):
        self.EndDialog(IDOK)

    def OnCancel(self, event):
        self.EndDialog(IDCANCEL)

    def OnInitDialog(self, event):
        self.m_handle = event.handle
        if self.center: self.CenterWindow()
        return 0

    _msg_map_ = MSG_MAP([MSG_HANDLER(WM_INITDIALOG, OnInitDialog),
                         CMD_ID_HANDLER(IDOK, OnOK),
                         CMD_ID_HANDLER(IDCANCEL, OnCancel)])


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

    <groupId>com.johnstarich.ee360p</groupId>
    <artifactId>java-skip-list</artifactId>
    <version>1.0</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>7.6</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                </configuration>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>checkstyle.xml</configLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <violationSeverity>warning</violationSeverity>
                            <failsOnError>true</failsOnError>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

</project>


text:
/**
 *
 */
package com.github.nnest.sparrow.command.document.query.joining;

import com.github.nnest.sparrow.command.document.query.DefaultExampleType;
import com.github.nnest.sparrow.command.document.query.Example;
import com.github.nnest.sparrow.command.document.query.ExampleType;
import com.github.nnest.sparrow.command.document.query.attrs.ScoreMode;
import com.google.common.base.Strings;

/**
 * nested query
 *
 * @author brad.wu
 * @since 0.0.1
 * @version 0.0.1
 */
public class Nested extends AbstractExampleJoiningQuery<Nested> {
	private String path = null;
	private ScoreMode scoreMode = null;

	public Nested(String path, Example example) {
		super(example);
		this.withPath(path);
	}

	/**
	 * (non-Javadoc)
	 *
	 * @see com.github.nnest.sparrow.command.document.query.Example#getExampleType()
	 */
	@Override
	public ExampleType getExampleType() {
		return DefaultExampleType.NESTED;
	}

	/**
	 * @return the path
	 */
	public String getPath() {
		return path;
	}

	/**
	 * @param path
	 *            the path to set
	 * @return this
	 */
	public Nested withPath(String path) {
		assert Strings.nullToEmpty(path).trim().length() != 0 : "Path cannot be null or blank.";

		this.path = path;
		return this;
	}

	/**
	 * @return the scoreMode
	 */
	public ScoreMode getScoreMode() {
		return scoreMode;
	}

	/**
	 * @param scoreMode
	 *            the scoreMode to set
	 * @return this
	 */
	public Nested with(ScoreMode scoreMode) {
		assert scoreMode != null && scoreMode != ScoreMode.MULTIPLY : "Score mode cannot be null or ScoreMode.MULTIPLY";

		this.scoreMode = scoreMode;
		return this;
	}
}


text:
require 'spec_helper'

describe Shutl::Resource::Rest do
  let(:headers) do
    {'Accept'=>'application/json', 'Authorization'=>'Bearer', 'Content-Type'=>'application/json'}
  end

  class OverrideUrlResource
    include Shutl::Resource::Rest
    collection_url '/api/resources'
    resource_url '/api/resources/:name'
  end

  module Namespace
    class Resource
      include Shutl::Resource::Rest
    end
  end

  describe '#remote_collection_url' do
    it 'should be based on the resource name by default' do
      TestRest.remote_collection_url.should == '/test_rests'
    end

    it 'should use the override if defined' do
      OverrideUrlResource.remote_collection_url.should == '/api/resources'
    end

    it 'only uses the specific object to infer the resource name' do
      Namespace::Resource.remote_collection_url.should == '/resources'
    end
  end

  describe '#remote_resource_url' do
    it 'should be base on the resource name and the resource id name by default' do
      TestRest.remote_resource_url.should == '/test_rests/:a'
    end

    it 'should use the override if defined' do
      OverrideUrlResource.remote_resource_url.should == '/api/resources/:name'
    end
  end

  context 'nested resource' do
    class NestedResource
      include Shutl::Resource::Rest
      base_uri 'http://host'
      collection_url '/nested/:parent_id/resources'
      resource_url '/nested/:parent_id/resources/:id'
    end

    let(:resource) { NestedResource.new(id: 2, parent_id: 10) }

    describe '#all' do
      it 'should query the correct endpoint' do
        request = stub_request(:get, 'http://host/nested/10/resources').
          to_return(body: '{"nested_resources": []}', headers: headers)

        NestedResource.all(parent_id: 10)

        request.should have_been_requested
      end

      it 'should add the nested params to the attributes' do
        stub_request(:get, 'http://host/nested/10/resources').
          to_return(body: '{"nested_resources": [{}, {}]}', headers: headers)

        resources = NestedResource.all(parent_id: 10)

        resources.each { |r| r.parent_id.should == 10 }
      end

      it 'should support the params' do
        request = stub_request(:get, 'http://host/nested/10/resources?arg1=val1&arg2=val2').
          to_return(body: '{"nested_resources": []}', headers: headers)

        NestedResource.all(parent_id: 10, arg1: 'val1', arg2: 'val2')

        request.should have_been_requested
      end

      it 'should not send the auth param' do
        request = stub_request(:get, 'http://host/nested/10/resources?arg1=val1&arg2=val2').
          to_return(body: '{"nested_resources": []}', headers: headers)

        NestedResource.all(parent_id: 10, arg1: 'val1', arg2: 'val2', auth: 'token')

        request.should have_been_requested
      end

      it 'should not send the auth param with an indexed by string hash' do
        request = stub_request(:get, 'http://host/nested/10/resources?arg1=val1&arg2=val2').
          to_return(body: '{"nested_resources": []}', headers: headers)

        NestedResource.all('parent_id' => 10, 'arg1' => 'val1', 'arg2' => 'val2', 'auth' => 'token')

        request.should have_been_requested
      end

      it 'should support the params with invalid uri name' do
        request = stub_request(:get, 'http://host/nested/10/resources?arg1=val1&arg%2B2=val2').
          to_return(body: '{"nested_resources": []}', headers: headers)

        NestedResource.all(parent_id: 10, arg1: 'val1', :'arg 2' => 'val2')

        request.should have_been_requested
      end

      it 'should support the params with invalid uri value' do
        request = stub_request(:get, 'http://host/nested/10/resources?arg1=val1&arg2=val%202').
          to_return(body: '{"nested_resources": []}', headers: headers)

        NestedResource.all(parent_id: 10, arg1: 'val1', arg2: 'val 2')

        request.should have_been_requested
      end
    end

    describe '#find' do
      it 'should query the correct endpoint' do
        request = stub_request(:get, 'http://host/nested/10/resources/2').
          to_return(body: '{"nested_resource": {}}', headers: headers)

        NestedResource.find(id: 2, parent_id: 10)

        request.should have_been_requested
      end

      it 'should add the nested params to the attributes' do
        stub_request(:get, 'http://host/nested/10/resources/2').
          to_return(body: '{"nested_resource": {}}', headers: headers)

        resource = NestedResource.find(id: 2, parent_id: 10)

        resource.parent_id.should == 10
      end
    end

    describe 'update' do
      it 'should query the correct endpoint' do
        request = stub_request(:put, 'http://host/nested/10/resources/2').
          to_return(body: '{"nested_resource": {}}', headers: headers)

        resource.save

        request.should have_been_requested
      end
    end

    describe '#create' do
      it 'should query the correct endpoint' do
        request = stub_request(:post, 'http://host/nested/10/resources').
          to_return(body: '{"nested_resource": {}}', headers: headers)

        NestedResource.create(parent_id: 10)

        request.should have_been_requested
      end
    end

    describe '#delete' do
      it 'should query the correct endpoint' do
        request = stub_request(:delete, 'http://host/nested/10/resources/2').
          to_return(body: '{"nested_resource": {}}', headers: headers)

        NestedResource.destroy(parent_id: 10, id: 2)

        request.should have_been_requested
      end

      specify do
        request = stub_request(:delete, 'http://host/nested/10/resources/2').
          to_return(body: '{"nested_resource": {}}',
                    headers: {"Content-Type" => "application/json"})

        resource.destroy auth: 'TOKEN'

        request.should have_been_requested

      end

    end
  end
end


text:
class Sketch : public chr::CrossSketch
{
public:
  Sketch();

  void setup() final;
  void resize() final;
  void draw() final;

protected:
  chr::gl::Camera camera;

  chr::gl::ShaderProgram shader;
  chr::gl::IndexedVertexBatch<chr::gl::XYZ.N.UV> batch;
  chr::gl::InstanceBuffer instanceBuffer;

  static void drawOnHelix(chr::gl::InstanceBuffer &instanceBuffer, float r1, float r2, float turns, float h, float spacing, float scale);
};


text:
import numpy as np
import matplotlib.pyplot as graph
import random as rand
import time as watch
pi = np.pi

######
###SIMULATIONS

#FUNCTION: ishit
#PURPOSE: This function is meant to test whether or not a given 2d point is within the unit circle.
#INPUTS: x = x-axis location, y = y-axis location
#OUTPUT: Boolean
def ishit(x, y):
	#Below Section: Calculates (x, y) vector distance from origin using Pythagorean theorem
	hyplength = np.sqrt(x**2 + y**2)

	#Below Section: Returns whether or not length within unit circle or not
	if hyplength <= 1:
		return True
	else:
		return False

#FUNCTION: simdarts
#PURPOSE: This function is meant to simulate a dart game, with the goal of hitting the inner circle.
#INPUTS: Number of times to 'throw' a dart
#OUTPUTS: Arrays of x and y locations where the dart falls each time; estimated pi value
def simdarts(num):
	#Below Section: Simulates given number of dart throws
	num = int(num)
	xlocs = np.zeros(num) #X-axis locations
	ylocs = np.zeros(num) #Y-axis locations

	#Below generates the random numbers in [0, 1)
	for a in range(0, num):
		xlocs[a] = rand.random()
		ylocs[a] = rand.random()

	#Below Section: Estimates the value of pi using the results
	count = 0
	for b in range(0, num):
		if ishit(x=xlocs[b], y=ylocs[b]):
			count = count + 1

	#Below Section: Returns the calculated values
	#NOTE: Multiplies proportion by four to account for percentage of total circular area
	return {'xs':xlocs, 'ys':ylocs, 'estpi':(count/1.0/num)*4}


text:
module.exports = App.UploadFileView = Ember.TextField.extend({
  type:'file',
  attributeBindings:['name'],

  change:function(e) {
    var el = this;
    var input = e.target;
    if(input.files && input.files[0]) {
      el.get('content').set('songFile', input.files[0]);
    }
  }
});


text:
.class public Landroid/support/v4/view/ViewParentCompatICS;
.super Ljava/lang/Object;

# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static requestSendAccessibilityEvent(Landroid/view/ViewParent;Landroid/view/View;Landroid/view/accessibility/AccessibilityEvent;)Z
    .locals 1

    invoke-interface {p0, p1, p2}, Landroid/view/ViewParent;->requestSendAccessibilityEvent(Landroid/view/View;Landroid/view/accessibility/AccessibilityEvent;)Z

    move-result v0

    return v0
.end method


text:
Release date: May 7, 2018

This project contains the source code to convert the public
Centers for Medicare & Medicaid Services (CMS) Data Entrepreneurs'
[Synthetic Public Use File](<https://www.cms.gov/Research-Statistics-Data-and-Systems/Downloadable-Public-Use-Files/SynPUFs/DE_Syn_PUF.html>) (DE-SynPUF) to .csv files suitable for loading into an OMOP Common Data Model v5.2 database.

The DE-SynPUF dataset contains 2.33 million synthetic patients, and we
anticipate that this resource will be useful for researchers in
developing OHDSI tools, as well as serve as a testbed for the analysis
of observational health records.

The processed data can be retrieved from [ftp://ftp.ohdsi.org/synpuf](ftp://ftp.ohdsi.org/synpuf). More details can be found [here](https://github.com/OHDSI/ETL-CMS/blob/master/python_etl/README.md).

This marks the first availability of a massive open CDM v5-adhering synthetic dataset.

## What's in Here?

### python_etl
A complete Python-based ETL of the DE-SynPUF data into CDMv5-compatible CSV
files. See the [README.md](https://github.com/OHDSI/ETL-CMS/blob/master/python_etl/README.md) file therein for detailed instructions for
running the ETL, as well as creating and loading the data into a CDMv5 database.

### RabbitInAHat
The WhiteRabbit/RabbitInAHat files used to develop the ETL specification, along with an out-of-date ETL specification in DOCX format.

### scripts
The scripts folder holds handy scripts for downloading and munging some of the raw
data used in the ETL process. Instructions for their use can be found
in the [python_etl/README.md](https://github.com/OHDSI/ETL-CMS/blob/master/python_etl/README.md) file.

### hand_conversion
@claire-oi hand-converted a couple patients worth of SynPUF data into CDMv5.  Along the way she found several inconsistencies and ambiguities with the ETL specification which have hopefully been addressed.  Her internal notes, along with the sample patients and her hand-converted CDM outputs are available in the [hand_conversion](https://github.com/OHDSI/ETL-CMS/tree/master/hand_conversion) directory.

### Additional Resources
- [Partial ETL of SEER Medicare to OMOP CDMv4](https://github.com/outcomesinsights/seer_to_omop_cdmv4) - [Outcomes Insights](http://outins.com) has released their partial implementation of a SEER Medicare ETL, along with their specification document to serve as a reference for the ETLs created by this workgroup
 - The [OHDSI Medicare ETL SynPUF.pdf](https://github.com/OHDSI/ETL-CMS/blob/master/OHDSI%20Medicare%20ETL%20SynPuf.pdf) provides a light overview of the differences between SynPUF and other Medicare datasets, such as SEER Medicare and Medicare LDS.  This presentation was presented to the OHDSI CMS ETL workgroup on February 2015 by Jennifer Duryea at [Outcomes Insights](http://outins.com).

#Version history
- 1.0.0 First complete release, implementing version 5.0.0 of the OMOP CDM

- 1.0.1 Bug fixed changing only the visit_occurrence table. Formerly
the visit_concept_id for all visits was set to the concept for an
inpatient visit (9201). Now visits from the inpatient source data have
visit_concept_id set to 9201, visits from outpatient source data are
set to 9202, and visits from carrier claims source data are set to 0,
as we cannot distinguish between inpatient and outpatient visits for
carrier claims data.  The new visit_occurrence.csv file has been
uploaded to the ftp site, as well as a new synpuf_1.zip file and we
how retain versions of the ETL'd data within subdirectories at
[ftp://ftp.ohdsi.org/synpuf](ftp://ftp.ohdsi.org/synpuf).

- 2.0.0 Leverating the 1.0.1 builder however transforming it to the CDM v5.2. format.  Many thanks to Anthony Molinaro (@AnthonyMolinaro) for writing the translation script, Lee Evans (@leeevans) for updating the OHDSI infrastructure with the updated copy.

#History of contributions

An early release of the Python-based ETL-CMS software was developed by
members of the CMS Working Group of the Observational Health Data
Sciences and Informatics (OHDSI) community to process the DE-SynPUF
files and to create OMOP CDM v5-compatible4 CSV files. Those contributors include:

- Ryan Duryea [@aguynamedryan](https://github.com/aguynamedryan), Outcomes Insights, Inc.
- Erica Voss [@ericaVoss](http://forums.ohdsi.org/users/ericaVoss), Janssen Research and Development.
- Jennifer Duryea [@jenniferduryea](https://github.com/jenniferduryea), Outcomes Insights, Inc.
- Don O'Hara [@donohara](https://github.com/donohara), Evidera.
- Claire Cangialose [@claire-oi](https://github.com/claire-oi), Outcomes Insights, Inc.
- Patrick Ryan [@Patrick_Ryan](http://forums.ohdsi.org/users/Patrick_Ryan), Janssen Research and Development.

Development was partial, stopping in August 2015. Researchers at the
University of New Mexico resumed development in December
2015 and implemented the complete ETL, releasing version 1.0 on June 24, 2016.
Documentation was created for running the
ETL, creating an OMOP CDM v5 database, and loading the DE-SynPUF
data. Among many improvements, the ETL was overhauled to implement the
visit_occurrrence, location, care_site, payer_plan_period, drug_era, and condition_era tables, and
numerous deficiencies were rectified in concept mapping, in order to
be feature-complete with the CDM v5. All tables now conform to the
constraints defined in the schema. The contributors to this effort were:

- Christophe Lambert [@Christophe_Lambert](http://forums.ohdsi.org/users/Christophe_Lambert), University of New Mexico, Center for Global Health, Division of Translational Informatics, Department of Internal Medicine
- Praveen Kumar [@Praveen_Kumar](http://forums.ohdsi.org/users/Praveen_Kumar), University of New Mexico, Department of Computer Science
- Amritansh [@Amritansh](http://forums.ohdsi.org/users/Amritansh), University of New Mexico, Department of Computer Science


text:
<?xml version="1.0" encoding="utf-8"?><!--<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"--><!--xmlns:tools="http://schemas.android.com/tools"--><!--android:id="@+id/rl_root"--><!--android:layout_width="wrap_content"--><!--android:layout_height="wrap_content"--><!--android:gravity="center"--><!--android:background="@drawable/qcw_selector_checkable_button"--><!--android:orientation="horizontal">-->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    >
  <CheckBox
      android:id="@+id/cb_hoot"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:background="#0000"
      android:gravity="center"
      android:visibility="gone"
      />

  <TextView
      android:id="@+id/tv_content"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:background="#0000"
      android:gravity="center"
      android:visibility="visible"
      tools:text="test"
      />
</merge>


text:
import datetime

from sqlalchemy import Column
from sqlalchemy import BigInteger
from sqlalchemy import Integer
from sqlalchemy import Text
from sqlalchemy import Boolean
from sqlalchemy import DateTime
from sqlalchemy import ForeignKey
from sqlalchemy import UniqueConstraint
from sqlalchemy.orm import relationship

import citext

import common.db_base
import common.db_types

class WebPages(common.db_base.Base):
	__versioned__ = {}

	__tablename__ = 'web_pages'
	name = 'web_pages'

	id                = Column(BigInteger, primary_key = True, index = True)
	state             = Column(common.db_types.dlstate_enum, default='new', index=True, nullable=False)
	errno             = Column(Integer, default='0')
	url               = Column(Text, nullable = False, index = True, unique = True)
	starturl          = Column(Text, nullable = False)
	netloc            = Column(Text, nullable = False, index = True)

	# Foreign key to the files table if needed.
	file              = Column(BigInteger, ForeignKey('web_files.id'))

	priority          = Column(Integer, default=1000000, index=True, nullable=False)
	distance          = Column(Integer, index=True, nullable=False)

	is_text           = Column(Boolean, default=False)
	limit_netloc      = Column(Boolean, default=True)

	title             = Column(citext.CIText)
	mimetype          = Column(Text)
	type              = Column(common.db_types.itemtype_enum, default='unknown')

	# Disabled due to disk-space issues.
	# raw_content       = Column(Text)

	content           = Column(Text)

	fetchtime         = Column(DateTime, default=datetime.datetime.min, index=True)
	addtime           = Column(DateTime, default=datetime.datetime.utcnow)

	ignoreuntiltime   = Column(DateTime, default=datetime.datetime.min, nullable=False)
	epoch             = Column(Integer,  default=0)

	# Items with `normal_fetch_mode` set to false are not retreived by the normal scheduling system
	# in WebMirror\Engine.py. This is to allow external systems that need to manage their own
	# fetch scheduling to operate within the same database.
	normal_fetch_mode = Column(Boolean, default=True)

	file_item         = relationship("WebFiles")

# File table doesn't know anything about URLs, since they're kept in the
# WebPages table entirely.
class WebFiles(common.db_base.Base):
	__tablename__ = 'web_files'
	id           = Column(BigInteger, primary_key = True)
	filename     = Column(Text)

	# File hash, used for deduplicating
	fhash        = Column(Text, index = True)

	fspath       = Column(Text, nullable=False)

# Tools for tracking plugins
class PluginStatus(common.db_base.Base):
	__tablename__ = 'plugin_status'
	id             = Column(BigInteger, primary_key = True)

	plugin_name    = Column(Text)

	is_running     = Column(Boolean, default=False)

	last_run       = Column(DateTime)
	last_run_end   = Column(DateTime)

	last_error     = Column(DateTime)
	last_error_msg = Column(Text)

##################################################

class NuReleaseItem(common.db_base.Base):
	__tablename__ = 'nu_release_item'
	id               = Column(BigInteger, primary_key=True)

	validated        = Column(Boolean, default=False, nullable=False, index=True)
	reviewed         = Column(common.db_types.nu_item_enum, default='unverified', nullable=False, index=True)

	actual_target    = Column(Text)

	seriesname       = Column(Text, nullable=False, index=True)
	releaseinfo      = Column(Text)
	groupinfo        = Column(Text, nullable=False, index=True)
	referrer         = Column(Text, nullable=False)
	outbound_wrapper = Column(Text, nullable=False, unique=True)

	release_date     = Column(DateTime, nullable=False, default=datetime.datetime.utcnow)
	first_seen       = Column(DateTime, nullable=False, default=datetime.datetime.min)
	validated_on     = Column(DateTime, index=True)

	fetch_attempts       = Column(Integer, index=True, default=0, nullable=False)
	local_fetch_attempts = Column(Integer,             default=0, nullable=False)

	resolved         = relationship("NuResolvedOutbound", backref='release')

	__table_args__ = (
		UniqueConstraint('seriesname', 'releaseinfo', 'groupinfo', 'outbound_wrapper'),
		)

class NuResolvedOutbound(common.db_base.Base):
	__tablename__ = 'nu_resolved_outbound'
	id               = Column(BigInteger, primary_key=True)

	# Foreign key to the files table if needed.
	parent           = Column(BigInteger, ForeignKey('nu_release_item.id'), index=True, nullable=False)

	client_id        = Column(Text, nullable=False, index=True)
	client_key       = Column(Text, nullable=False, index=True)

	actual_target    = Column(Text, nullable=False)
	resolved_title   = Column(Text)

	fetched_on       = Column(DateTime, default=datetime.datetime.utcnow, nullable=False)

	disabled         = Column(Boolean, default=False, nullable=False)

	__table_args__ = (
		UniqueConstraint('parent', 'client_id', 'client_key', 'actual_target'),
		)


text:
$C('$data.Expressions.ParameterResolverVisitor', $data.Expressions.ExpressionVisitor, null, {

    constructor: function (expression, resolver) {
    	///
    	/// ParameterResolverVisitor traverses the JavaScript Code Expression tree and converts
        /// outer but otherwise execution local variable references into ConstantExpressions-t.
        /// for example: context.Persons.filter(function(p) { return p.Name == document.location.href })
        /// is transformed into a constant that has the current href as its value
    	///
    	/// <param name="expression"></param>
    	/// <param name="resolver"></param>
        this.lambdaParamCache = {};
    },

    Visit: function (expression, resolver) {
        ///<param name="expression" type="$data.Expressions.ExpressionNode" />
        ///<param name="resolver" type="$data.Expressions.Resolver" />
        //TODO base call is just ugly
        return $data.Expressions.ExpressionVisitor.prototype.Visit.call(this, expression, resolver);

    },

    VisitArrayLiteral: function(eNode, context) {
        var self = this;
        var items = eNode.items.map(function (item) { return self.Visit(item, context); });
        var allLocal = items.every(function (item) {
            return item instanceof $data.Expressions.ConstantExpression;
        });

        if (allLocal) {
            items = items.map(function (item) { return item.value });
            return Container.createConstantExpression(items, "array");
        } else {
            return Container.createArrayLiteralExpression(items);
        }
    },

    VisitObjectLiteral: function(eNode, context) {
        var self = this;
        var members = eNode.members.map(function (item) { return self.Visit(item, context); });
        var allLocal = members.every(function (member) {
            return member.expression instanceof $data.Expressions.ConstantExpression;
        });

        if (allLocal) {
            var params = members.map(function (member) { return { name: member.fieldName, value: member.expression.value }; });
            var value = eNode.implementation(params);
            return Container.createConstantExpression(value, typeof value);
        } else {
            return Container.createObjectLiteralExpression(members);
        }
    },

    VisitThis: function(eNode, resolver) {
        return resolver.Visit(eNode, resolver);
    },

    VisitParameter: function(eNode, resolver) {
        ///<param name="eNode" type="$data.Expressions.ParameterExpression" />
        ///<param name="resovler" type="$data.Expressions.ParameterResolver" />
        ///<returns type="$data.Expressions.ParameterExpression" />

        var node;
        ///TODO let the resolver handle lambdaReferences if it wants to deal with it
        switch(eNode.nodeType){
            case $data.Expressions.ExpressionType.Parameter:
            case $data.Expressions.ExpressionType.LambdaParameter:
                node = resolver.Visit(eNode, resolver);
                if (node.nodeType == $data.Expressions.ExpressionType.LambdaParameter) {
                    this.lambdaParamCache[node.name] = node;
                }
                return node;
            case $data.Expressions.ExpressionType.LambdaParameterReference:
                var lambdaParam = this.lambdaParamCache[eNode.name];
                if (lambdaParam) {
                    node = Container.createParameterExpression(eNode.name,
                            lambdaParam.type,
                            $data.Expressions.ExpressionType.LambdaParameterReference);
                    node.paramIndex = eNode.paramIndex;
                    //node.typeName = lambdaParam.type.name || lambdaParam.type;
                    return node;
                }
                break;
            default:
                return eNode;

        }

        return eNode;
    },

    VisitConstant: function (eNode, context) {
        ///<param name="eNode" type="$data.Expressions.ParameterExpression" />
        ///<returns type="$data.Expressions.ParameterExpression" />
        return eNode;
    },

    VisitFunction: function(eNode, context) {
        ///<param name="eNode" type="$data.Expressions.FunctionExpression" />

        var self = this;
        var params = eNode.parameters.map(function (p, i) {
            var result = self.Visit(p, context);
            return result;
        });
        var body = self.Visit(eNode.body, context);
        var result = new $data.Expressions.FunctionExpression(eNode.name, params, body);

        return result;
    },

    VisitBinary: function (eNode, context) {
        ///
        ///<param name="eNode" type="$data.Expressions.ExpressionNodeTypes.BinaryExpressionNode"/>
        ///<param name="context" type="Object"/>
        ///<return type="$data.Expressions.ExpressionNodeTypes.BinaryExpressionNode"/>

        var left = this.Visit(eNode.left, context);
        var right = this.Visit(eNode.right, context);
        var expr = $data.Expressions;

        if (left instanceof expr.ConstantExpression && right instanceof expr.ConstantExpression)
        {
                var result = eNode.implementation(left.value, right.value);
                return Container.createConstantExpression(result, typeof result);
        }
        return new Container.createSimpleBinaryExpression(left, right, eNode.nodeType, eNode.operator, eNode.type);
    },

    VisitUnary: function (eNode, context) {
        ///
        ///<param name="eNode" type="$data.Expressions.ExpressionNodeTypes.BinaryExpressionNode"/>
        ///<param name="context" type="Object"/>
        ///<return type="$data.Expressions.ExpressionNodeTypes.BinaryExpressionNode"/>

        var operand = this.Visit(eNode.operand, context);
        //var imp = $data.unaryOperators.getOperator(
        var expr = $data.Expressions;
        if (operand  instanceof expr.ConstantExpression)
        {
                var result = eNode.operator.implementation(operand.value);
                return Container.createConstantExpression(result, typeof result);
        }
        return new Container.createUnaryExpression(operand, eNode.operator, eNode.nodeType);
    },

    VisitProperty: function (eNode, context) {
        ///<param name="eNode" type="$data.Expressions.PropertyExpression" />
        var expression = this.Visit(eNode.expression, context);
        var member = this.Visit(eNode.member, context);
        var result;
        if (expression instanceof $data.Expressions.ConstantExpression &&
            member instanceof $data.Expressions.ConstantExpression) {
            ///TODO implement checking for the member, throw on error
            result = eNode.implementation(expression.value, member.value);

            //Method call processed before
            //if (typeof result === 'function') {
            //    return new $data.Expressions.ConstantExpression(
            //        function () { return result.apply(expression.value, arguments); });
            //}
            return Container.createConstantExpression(result, typeof result, expression.name + '$' + member.value);
        }
        if (expression === eNode.expression && member === eNode.member)
            return eNode;

        result = Container.createPropertyExpression(expression, member);
        return result;
    },

    VisitCall: function (eNode, context) {
        ///<param name="eNode" type="$data.Expressions.CallExpression" />
        function isExecutable(args, body, obj) {
            return body instanceof $data.Expressions.ConstantExpression &&
                //global methods will not have a this.
                (!obj || obj instanceof $data.Expressions.ConstantExpression) &&
                args.every(function(item) {
                    return item instanceof $data.Expressions.ConstantExpression;
                });
        }
        var call = $data.Expressions.ExpressionVisitor.prototype.VisitCall.apply(this, arguments);
        var obj = call.expression;
        var body  = call.member;
        var args = call.args;

        function convertToValue(arg) {
            if (arg instanceof $data.Expressions.ConstantExpression)
                return arg.value;
            return arg;
        };

        if (isExecutable(args, body, obj)) {
            var fn = body.value;
            if (typeof fn === 'string' && obj.value) {
                fn = obj.value[fn];
            }
            if (typeof fn !== 'function') {
                //TODO dig that name out from somewhere
                Guard.raise("Constant expression is not a method...");
            }
            var value = eNode.implementation(obj.value, fn, args.map(convertToValue));
            return new $data.Expressions.ConstantExpression(value, typeof value);
        }
        return call;
    }
}, {});
$C("$data.Expressions.AggregatedVisitor", $data.Expressions.ExpressionVisitor, null, {
    constructor: function (visitors) {
        ///<param name="resolver" type="Array" elementType="$data.Expression.ParameterResolver" />

        this.Visit = function (node, context) {
            for (var i = 0; i < visitors.length; i++) {
                var n = visitors[i].Visit(node, context);
                if (n !== node)
                    return n;
            }
            return node;
        };
    }

});