text:
#include "CCTouchDispatcher.h"
#include "CCTouchHandler.h"
#include "cocoa/CCArray.h"
#include "cocoa/CCSet.h"
#include "CCTouch.h"
#include "textures/CCTexture2D.h"
#include "support/data_support/ccCArray.h"
#include "ccMacros.h"
#include <algorithm>

NS_CC_BEGIN

class TouchBufferItem : public CCObject
{
public:
	TouchBufferItem(unsigned int type, CCSet *touches, CCEvent *pEvent)
	{
		mType = type;
		mTouches = new CCSet(*touches);
		mEvent = pEvent;
	}
	~TouchBufferItem() {
		mTouches->release();
	}
public:
	unsigned int mType;
	CCSet		*mTouches;
	CCEvent     *mEvent;
};

class JSTouchDelegate : public CCTouchDelegate, public CCObject
{
public:
	JSTouchDelegate(v8::Handle<v8::Object> delegateObj) {
		mTouchesDelegate = v8::Persistent<v8::Object>::New(delegateObj);
	}

	virtual ~JSTouchDelegate() {
		if (!mTouchesDelegate.IsEmpty()) {
			mTouchesDelegate.Dispose();
		}
	}

	virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) {
		return this->getJSCCallFunc()->callJSFunctionWithName(mTouchesDelegate, "ccTouchBegan", pTouch) != NULL;
	};
    // optional

    virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent) {
		this->getJSCCallFunc()->callJSFunctionWithName(mTouchesDelegate, "ccTouchMoved", pTouch);
	}
    virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {
		this->getJSCCallFunc()->callJSFunctionWithName(mTouchesDelegate, "ccTouchEnded", pTouch);
	}
    virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {
		this->getJSCCallFunc()->callJSFunctionWithName(mTouchesDelegate, "ccTouchCancelled", pTouch);
	}

    // optional
     virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) {
		 this->getJSCCallFunc()->callJSFunctionWithName(mTouchesDelegate, "ccTouchesBegan", pTouches);
	 }
     virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) {
		 this->getJSCCallFunc()->callJSFunctionWithName(mTouchesDelegate, "ccTouchesMoved", pTouches);
	 }
     virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {
		 this->getJSCCallFunc()->callJSFunctionWithName(mTouchesDelegate, "ccTouchesEnded", pTouches);
	 }
     virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {
		 this->getJSCCallFunc()->callJSFunctionWithName(mTouchesDelegate, "ccTouchesCancelled", pTouches);
	 }

private:
	friend class CCTouchDispatcher;
	v8::Persistent<v8::Object> mTouchesDelegate;
};
/**
 * Used for sort
 */
static int less(const CCObject* p1, const CCObject* p2)
{
    return ((CCTouchHandler*)p1)->getPriority() < ((CCTouchHandler*)p2)->getPriority();
}

bool CCTouchDispatcher::isDispatchEvents(void)
{
    return m_bDispatchEvents;
}

void CCTouchDispatcher::setDispatchEvents(bool bDispatchEvents)
{
    m_bDispatchEvents = bDispatchEvents;
}

/*
+(id) allocWithZone:(CCZone *)zone
{
    @synchronized(self) {
        CCAssert(sharedDispatcher == nil, @"Attempted to allocate a second instance of a singleton.");
        return [super allocWithZone:zone];
    }
    return nil; // on subsequent allocation attempts return nil
}
*/
void CCTouchDispatcher::setJSObjInstance(v8::Handle<v8::Object> data)
{
	if (!data.IsEmpty()) {
		mV8JSObjInstance = v8::Persistent<v8::Object>::New(data);
	}
}
bool CCTouchDispatcher::init(void)
{
    m_bDispatchEvents = true;
    m_pTargetedHandlers = CCArray::createWithCapacity(8);
    m_pTargetedHandlers->retain();
	CCLOG("setJSObjInstance");
	m_pTargetedHandlers->setJSObjInstance(this->getJSObjInstance());

    m_pStandardHandlers = CCArray::createWithCapacity(4);
    m_pStandardHandlers->retain();
	m_pStandardHandlers->setJSObjInstance(this->getJSObjInstance());
    m_pHandlersToAdd = CCArray::createWithCapacity(8);
    m_pHandlersToAdd->retain();
	m_pHandlersToAdd->setJSObjInstance(this->getJSObjInstance());

    m_pHandlersToRemove = ccCArrayNew(8);

    m_bToRemove = false;
    m_bToAdd = false;
    m_bToQuit = false;
    m_bLocked = false;
    m_sHandlerHelperData[CCTOUCHBEGAN].m_type = CCTOUCHBEGAN;
    m_sHandlerHelperData[CCTOUCHMOVED].m_type = CCTOUCHMOVED;
    m_sHandlerHelperData[CCTOUCHENDED].m_type = CCTOUCHENDED;
    m_sHandlerHelperData[CCTOUCHCANCELLED].m_type = CCTOUCHCANCELLED;
    return true;
}

CCTouchDispatcher::~CCTouchDispatcher(void)
{
     CC_SAFE_RELEASE(m_pTargetedHandlers);
     CC_SAFE_RELEASE(m_pStandardHandlers);
     CC_SAFE_RELEASE(m_pHandlersToAdd);
	 CC_SAFE_RELEASE(m_pTouchesBuffer);
     ccCArrayFree(m_pHandlersToRemove);
    m_pHandlersToRemove = NULL;
}

//
// handlers management
//
void CCTouchDispatcher::forceAddHandler(CCTouchHandler *pHandler, CCArray *pArray)
{
    unsigned int u = 0;

    CCObject* pObj = NULL;
    CCARRAY_FOREACH(pArray, pObj)
     {
         CCTouchHandler *h = (CCTouchHandler *)pObj;
         if (h)
         {
             if (h->getPriority() < pHandler->getPriority())
             {
                 ++u;
             }

             if (h->getDelegate() == pHandler->getDelegate())
             {
                 CCAssert(0, "");
                 return;
             }
         }
     }

    pArray->insertObject(pHandler, u);
}

void CCTouchDispatcher::addStandardDelegate(CCTouchDelegate *pDelegate, int nPriority)
{
    CCTouchHandler *pHandler = CCStandardTouchHandler::handlerWithDelegate(pDelegate, nPriority);
    if (! m_bLocked)
    {
        forceAddHandler(pHandler, m_pStandardHandlers);
    }
    else
    {
        /* If pHandler is contained in m_pHandlersToRemove, if so remove it from m_pHandlersToRemove and return.
         * Refer issue #752(cocos2d-x)
         */
        if (ccCArrayContainsValue(m_pHandlersToRemove, pDelegate))
        {
            ccCArrayRemoveValue(m_pHandlersToRemove, pDelegate);
            return;
        }

        m_pHandlersToAdd->addObject(pHandler);
        m_bToAdd = true;
    }
}

void CCTouchDispatcher::addTargetedDelegate(CCTouchDelegate *pDelegate, int nPriority, bool bSwallowsTouches)
{
    CCTouchHandler *pHandler = CCTargetedTouchHandler::handlerWithDelegate(pDelegate, nPriority, bSwallowsTouches);
    if (! m_bLocked)
    {
        forceAddHandler(pHandler, m_pTargetedHandlers);
    }
    else
    {
        /* If pHandler is contained in m_pHandlersToRemove, if so remove it from m_pHandlersToRemove and return.
         * Refer issue #752(cocos2d-x)
         */
        if (ccCArrayContainsValue(m_pHandlersToRemove, pDelegate))
        {
            ccCArrayRemoveValue(m_pHandlersToRemove, pDelegate);
            return;
        }

        m_pHandlersToAdd->addObject(pHandler);
        m_bToAdd = true;
    }
}

void CCTouchDispatcher::forceRemoveDelegate(CCTouchDelegate *pDelegate)
{
    CCTouchHandler *pHandler;

    // XXX: remove it from both handlers ???

    // remove handler from m_pStandardHandlers
    CCObject* pObj = NULL;
    CCARRAY_FOREACH(m_pStandardHandlers, pObj)
    {
        pHandler = (CCTouchHandler*)pObj;
        if (pHandler && pHandler->getDelegate() == pDelegate)
        {
            m_pStandardHandlers->removeObject(pHandler);
            break;
        }
    }

    // remove handler from m_pTargetedHandlers
    CCARRAY_FOREACH(m_pTargetedHandlers, pObj)
    {
        pHandler = (CCTouchHandler*)pObj;
        if (pHandler && pHandler->getDelegate() == pDelegate)
        {
            m_pTargetedHandlers->removeObject(pHandler);
            break;
        }
    }
}

void CCTouchDispatcher::removeDelegate(CCTouchDelegate *pDelegate)
{
    if (pDelegate == NULL)
    {
        return;
    }

    if (! m_bLocked)
    {
        forceRemoveDelegate(pDelegate);
    }
    else
    {
        /* If pHandler is contained in m_pHandlersToAdd, if so remove it from m_pHandlersToAdd and return.
         * Refer issue #752(cocos2d-x)
         */
        CCTouchHandler *pHandler = findHandler(m_pHandlersToAdd, pDelegate);
        if (pHandler)
        {
            m_pHandlersToAdd->removeObject(pHandler);
            return;
        }

        ccCArrayAppendValue(m_pHandlersToRemove, pDelegate);
        m_bToRemove = true;
    }
}

void CCTouchDispatcher::forceRemoveAllDelegates(void)
{
     m_pStandardHandlers->removeAllObjects();
     m_pTargetedHandlers->removeAllObjects();
}
void CCTouchDispatcher::breakAllDelegates()
{
	m_bStopLoop = true;
	forceRemoveAllDelegates();
}
void CCTouchDispatcher::removeAllDelegates(void)
{
    if (! m_bLocked)
    {
        forceRemoveAllDelegates();
    }
    else
    {
        m_bToQuit = true;
    }
}

CCTouchHandler* CCTouchDispatcher::findHandler(CCTouchDelegate *pDelegate)
{
    CCObject* pObj = NULL;
    CCARRAY_FOREACH(m_pTargetedHandlers, pObj)
    {
        CCTouchHandler* pHandler = (CCTouchHandler*)pObj;
        if (pHandler->getDelegate() == pDelegate)
        {
            return pHandler;
        }
    }

    CCARRAY_FOREACH(m_pStandardHandlers, pObj)
    {
        CCTouchHandler* pHandler = (CCTouchHandler*)pObj;
        if (pHandler->getDelegate() == pDelegate)
        {
            return pHandler;
        }
    }

    return NULL;
}
CCTouchHandler* CCTouchDispatcher::findHandler(v8::Handle<v8::Object> pDelegate)
{
    CCObject* pObj = NULL;
	void* key = this->getJSCCallFunc()->getHash(pDelegate);
    CCARRAY_FOREACH(m_pTargetedHandlers, pObj)
    {
        CCTouchHandler* pHandler = (CCTouchHandler*)pObj;
		JSTouchDelegate *jstouch = dynamic_cast<JSTouchDelegate*>(pHandler->getDelegate());
		if (jstouch && this->getJSCCallFunc()->getHash(jstouch->mTouchesDelegate) == key)
        {
            return pHandler;
        }
    }

    CCARRAY_FOREACH(m_pStandardHandlers, pObj)
    {
        CCTouchHandler* pHandler = (CCTouchHandler*)pObj;

		JSTouchDelegate *jstouch = dynamic_cast<JSTouchDelegate*>(pHandler->getDelegate());
		if (jstouch && this->getJSCCallFunc()->getHash(jstouch->mTouchesDelegate) == key)
        {
            return pHandler;
        }
    }

    return NULL;
}
CCTouchHandler* CCTouchDispatcher::findHandler(CCArray* pArray, CCTouchDelegate *pDelegate)
{
    CCAssert(pArray != NULL && pDelegate != NULL, "");

    CCObject* pObj = NULL;
    CCARRAY_FOREACH(pArray, pObj)
    {
        CCTouchHandler* pHandle = (CCTouchHandler*)pObj;
        if (pHandle->getDelegate() == pDelegate)
        {
            return pHandle;
        }
    }

    return NULL;
}

void CCTouchDispatcher::rearrangeHandlers(CCArray *pArray)
{
    std::sort(pArray->data->arr, pArray->data->arr + pArray->data->num, less);
}

void CCTouchDispatcher::setPriority(int nPriority, CCTouchDelegate *pDelegate)
{
    CCAssert(pDelegate != NULL, "");

    CCTouchHandler *handler = NULL;

    handler = this->findHandler(pDelegate);

    CCAssert(handler != NULL, "");

    if (handler->getPriority() != nPriority)
    {
        handler->setPriority(nPriority);
        this->rearrangeHandlers(m_pTargetedHandlers);
        this->rearrangeHandlers(m_pStandardHandlers);
    }
}
void CCTouchDispatcher::setPriority(int nPriority, v8::Handle<v8::Object> pDelegate)
{
	if (pDelegate.IsEmpty()) return;

    CCTouchHandler *handler = NULL;

	handler = this->findHandler(pDelegate);

    CCAssert(handler != NULL, "");

    if (handler->getPriority() != nPriority)
    {
        handler->setPriority(nPriority);
        this->rearrangeHandlers(m_pTargetedHandlers);
        this->rearrangeHandlers(m_pStandardHandlers);
    }
}
//
// dispatch events
//
void CCTouchDispatcher::touches(CCSet *pTouches, CCEvent *pEvent, unsigned int uIndex)
{
	if (m_bToQuit)
    {
        m_bToQuit = false;
        forceRemoveAllDelegates();
    }
    CCAssert(uIndex >= 0 && uIndex < 4, "");

    CCSet *pMutableTouches;
    m_bLocked = true;

    // optimization to prevent a mutable copy when it is not necessary
     unsigned int uTargetedHandlersCount = m_pTargetedHandlers->count();
     unsigned int uStandardHandlersCount = m_pStandardHandlers->count();
    bool bNeedsMutableSet = (uTargetedHandlersCount && uStandardHandlersCount);

    pMutableTouches = (bNeedsMutableSet ? pTouches->mutableCopy() : pTouches);

    struct ccTouchHandlerHelperData sHelper = m_sHandlerHelperData[uIndex];
    //
    // process the target handlers 1st
    //
    if (uTargetedHandlersCount > 0)
    {
        CCTouch *pTouch;
        CCSetIterator setIter;
        for (setIter = pTouches->begin(); setIter != pTouches->end(); ++setIter)
        {
            pTouch = (CCTouch *)(*setIter);

            CCTargetedTouchHandler *pHandler = NULL;
            CCObject* pObj = NULL;
            CCARRAY_FOREACH(m_pTargetedHandlers, pObj)
            {
                pHandler = (CCTargetedTouchHandler *)(pObj);

                if (! pHandler)
                {
                   break;
                }

                bool bClaimed = false;
                if (uIndex == CCTOUCHBEGAN)
                {
                    bClaimed = pHandler->getDelegate()->ccTouchBegan(pTouch, pEvent);

                    if (bClaimed)
                    {
                        pHandler->getClaimedTouches()->addObject(pTouch);
                    }
                } else
                if (pHandler->getClaimedTouches()->containsObject(pTouch))
                {
                    // moved ended canceled
                    bClaimed = true;

                    switch (sHelper.m_type)
                    {
                    case CCTOUCHMOVED:
                        pHandler->getDelegate()->ccTouchMoved(pTouch, pEvent);
                        break;
                    case CCTOUCHENDED:
						pHandler->getClaimedTouches()->removeObject(pTouch);
                        pHandler->getDelegate()->ccTouchEnded(pTouch, pEvent);
                        break;
                    case CCTOUCHCANCELLED:
                        pHandler->getClaimedTouches()->removeObject(pTouch);
						pHandler->getDelegate()->ccTouchCancelled(pTouch, pEvent);
                        break;
                    }
                }
				if (m_bStopLoop)
				{
					m_bStopLoop = false;
					break;
				}
                if (bClaimed && pHandler->isSwallowsTouches())
                {
                    if (bNeedsMutableSet)
                    {
                        pMutableTouches->removeObject(pTouch);
                    }

                    break;
                }
            }
        }
    }

    //
    // process standard handlers 2nd
    //
    if (uStandardHandlersCount > 0 && pMutableTouches->count() > 0)
    {
        CCStandardTouchHandler *pHandler = NULL;
        CCObject* pObj = NULL;
        CCARRAY_FOREACH(m_pStandardHandlers, pObj)
        {
            pHandler = (CCStandardTouchHandler*)(pObj);

            if (! pHandler)
            {
                break;
            }

            switch (sHelper.m_type)
            {
            case CCTOUCHBEGAN:
                pHandler->getDelegate()->ccTouchesBegan(pMutableTouches, pEvent);
                break;
            case CCTOUCHMOVED:
                pHandler->getDelegate()->ccTouchesMoved(pMutableTouches, pEvent);
                break;
            case CCTOUCHENDED:
                pHandler->getDelegate()->ccTouchesEnded(pMutableTouches, pEvent);
                break;
            case CCTOUCHCANCELLED:
                pHandler->getDelegate()->ccTouchesCancelled(pMutableTouches, pEvent);
                break;
            }
			if (m_bStopLoop)
			{
				m_bStopLoop = false;
				break;
			}
        }
    }

    if (bNeedsMutableSet)
    {
        pMutableTouches->release();
    }

    //
    // Optimization. To prevent a [handlers copy] which is expensive
    // the add/removes/quit is done after the iterations
    //
    m_bLocked = false;
    if (m_bToRemove)
    {
        m_bToRemove = false;
        for (unsigned int i = 0; i < m_pHandlersToRemove->num; ++i)
        {
            forceRemoveDelegate((CCTouchDelegate*)m_pHandlersToRemove->arr[i]);
        }
        ccCArrayRemoveAllValues(m_pHandlersToRemove);
    }

    if (m_bToAdd)
    {
        m_bToAdd = false;
        CCTouchHandler* pHandler = NULL;
        CCObject* pObj = NULL;
        CCARRAY_FOREACH(m_pHandlersToAdd, pObj)
         {
             pHandler = (CCTouchHandler*)pObj;
            if (! pHandler)
            {
                break;
            }

            if (dynamic_cast<CCTargetedTouchHandler*>(pHandler) != NULL)
            {
                forceAddHandler(pHandler, m_pTargetedHandlers);
            }
            else
            {
                forceAddHandler(pHandler, m_pStandardHandlers);
            }
         }

         m_pHandlersToAdd->removeAllObjects();
    }

	//DuongNT moved to above
	/*
    if (m_bToQuit)
    {
        m_bToQuit = false;
        forceRemoveAllDelegates();
    }*/
}

void CCTouchDispatcher::touchesProcess()
{

	if (m_pTouchesBuffer->count() <= 0) return;

	CCArray *newBuffer = new CCArray();
	CCArray *fetchBuffer = m_pTouchesBuffer;
	m_pTouchesBuffer = newBuffer;

	if (m_bDispatchEvents)
	{
		for (int i = 0; i < fetchBuffer->count(); i++) {
			TouchBufferItem *item = (TouchBufferItem*)fetchBuffer->objectAtIndex(i);
			this->touches(item->mTouches, item->mEvent, item->mType);
		}
	}
	fetchBuffer->release();
}
void CCTouchDispatcher::touchesBegan(CCSet *touches, CCEvent *pEvent)
{
	TouchBufferItem *item = new TouchBufferItem(CCTOUCHBEGAN, touches, pEvent);
	item->autorelease();
	m_pTouchesBuffer->addObject(item);
	/*
    if (m_bDispatchEvents)
    {
        this->touches(touches, pEvent, CCTOUCHBEGAN);
    }*/
}

void CCTouchDispatcher::touchesMoved(CCSet *touches, CCEvent *pEvent)
{
	TouchBufferItem *item = new TouchBufferItem(CCTOUCHMOVED, touches, pEvent);
	item->autorelease();
	m_pTouchesBuffer->addObject(item);
	/*
    if (m_bDispatchEvents)
    {
        this->touches(touches, pEvent, CCTOUCHMOVED);
    }*/
}

void CCTouchDispatcher::touchesEnded(CCSet *touches, CCEvent *pEvent)
{
	TouchBufferItem *item = new TouchBufferItem(CCTOUCHENDED, touches, pEvent);
	item->autorelease();
	m_pTouchesBuffer->addObject(item);
	/*
    if (m_bDispatchEvents)
    {
        this->touches(touches, pEvent, CCTOUCHENDED);
    }*/
}

void CCTouchDispatcher::touchesCancelled(CCSet *touches, CCEvent *pEvent)
{
	TouchBufferItem *item = new TouchBufferItem(CCTOUCHCANCELLED, touches, pEvent);
	item->autorelease();
	m_pTouchesBuffer->addObject(item);
	/*
    if (m_bDispatchEvents)
    {
        this->touches(touches, pEvent, CCTOUCHCANCELLED);
    }*/
}

void CCTouchDispatcher::addStandardDelegate(v8::Handle<v8::Object> pDelegate, int nPriority)
{
	this->addStandardDelegate(new JSTouchDelegate(pDelegate), nPriority);
}
void CCTouchDispatcher::addTargetedDelegate(v8::Handle<v8::Object> pDelegate, int nPriority, bool bSwallowsTouches)
{
	this->addTargetedDelegate(new JSTouchDelegate(pDelegate), nPriority, bSwallowsTouches);
}

void CCTouchDispatcher::removeDelegate(v8::Handle<v8::Object> pDelegate)
{
	void* delegateHash = this->getJSCCallFunc()->getHash(pDelegate);
	CCObject* pObj = NULL;

	CCARRAY_FOREACH(m_pTargetedHandlers, pObj)
    {
        CCTouchHandler* pHandler = (CCTouchHandler*)pObj;
		JSTouchDelegate *jsDelegate = dynamic_cast<JSTouchDelegate*>(pHandler->getDelegate());
		if (jsDelegate)
        {
			if (delegateHash ==  this->getJSCCallFunc()->getHash(jsDelegate->mTouchesDelegate)) {
				removeDelegate(jsDelegate);
			}
        }
    }

	CCARRAY_FOREACH(m_pTargetedHandlers, pObj)
    {
       CCTouchHandler* pHandler = (CCTouchHandler*)pObj;
		JSTouchDelegate *jsDelegate = dynamic_cast<JSTouchDelegate*>(pHandler->getDelegate());
		if (jsDelegate)
        {
			if (delegateHash ==  this->getJSCCallFunc()->getHash(jsDelegate->mTouchesDelegate)) {
				removeDelegate(jsDelegate);
			}
        }
    }
}
NS_CC_END


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=../../../glium/uniforms/struct.Sampler.html">

Redirecting to ../../../glium/uniforms/struct.Sampler.html...

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/.idea/tensorflow.iml" filepath="$PROJECT_DIR$/.idea/tensorflow.iml" />
    </modules>
  </component>
</project>


text:
/**
 *
 */
package com.xinfan.wxshop.business.dao;

import java.util.List;

import com.xinfan.wxshop.business.entity.Customer;
import com.xinfan.wxshop.business.entity.CustomerExample;
import com.xinfan.wxshop.common.base.DataMap;
import com.xinfan.wxshop.common.dal.SqlSessionDaoSupport;
import com.xinfan.wxshop.common.page.Pagination;

public class CustomerDao extends SqlSessionDaoSupport {

	public List<DataMap> pageList(DataMap map, Pagination page) {
		return getSqlSession().selectList(wrapCommand("pageList"), map, page);
	}

	public Integer count(DataMap map) {
		return getSqlSession().selectOne(wrapCommand("count"), map);
	}

	public List<DataMap> pageSelectCustomerList(DataMap map, Pagination page) {
		return getSqlSession().selectList(
				wrapCommand("pageSelectCustomerList"), map, page);
	}

	public List<DataMap> pageSelectLayerCustomerList(DataMap map, Pagination page) {
		return getSqlSession().selectList(
				wrapCommand("pageSelectLayerCustomerList"), map, page);
	}

	public int updateByPrimaryKeySelective(Customer pojo) {
		return getSqlSession().update(
				wrapCommand("updateByPrimaryKeySelective"), pojo);
	}

	public int insertSelective(Customer pojo) {
		return getSqlSession().update(wrapCommand("insertSelective"), pojo);
	}

	public int deleteByPrimaryKey(int id) {
		return getSqlSession().delete(wrapCommand("deleteByPrimaryKey"), id);
	}

	public Customer selectByPrimaryKey(int id) {
		return getSqlSession().selectOne(wrapCommand("selectByPrimaryKey"), id);
	}

	public Customer selectByAccount(String account) {

		CustomerExample example = new CustomerExample();
		example.createCriteria().andAccountEqualTo(account);
		List<Customer> list = getSqlSession().selectList(
				wrapCommand("selectByExample"), example);

		return list.isEmpty() ? null : list.get(0);
	}

	public Customer selectByWxId(String account) {

		CustomerExample example = new CustomerExample();
		example.createCriteria().andWxIdEqualTo(account);
		List<Customer> list = getSqlSession().selectList(
				wrapCommand("selectByExample"), example);

		return list.isEmpty() ? null : list.get(0);
	}

	public List<Customer> getListCustomerLayerUser(DataMap map) {
		return getSqlSession().selectList(wrapCommand("getListCustomerLayerUser"), map);
	}

}


text:
package core

import (
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/oci/oci-go-sdk/v43/common"
	"net/http"
)

// AddIpv6VcnCidrRequest wrapper for the AddIpv6VcnCidr operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/core/AddIpv6VcnCidr.go.html to see an example of how to use AddIpv6VcnCidrRequest.
type AddIpv6VcnCidrRequest struct {

	// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VCN.
	VcnId *string `mandatory:"true" contributesTo:"path" name:"vcnId"`

	// Unique identifier for the request.
	// If you need to contact Oracle about a particular request, please provide the request ID.
	OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`

	// A token that uniquely identifies a request so it can be retried in case of a timeout or
	// server error without risk of executing that same action again. Retry tokens expire after 24
	// hours, but can be invalidated before then due to conflicting operations (for example, if a resource
	// has been deleted and purged from the system, then a retry of the original creation request
	// may be rejected).
	OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"`

	// For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
	// parameter to the value of the etag from a previous GET or POST response for that resource. The resource
	// will be updated or deleted only if the etag you provide matches the resource's current etag value.
	IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"`

	// Metadata about the request. This information will not be transmitted to the service, but
	// represents information that the SDK will consume to drive retry behavior.
	RequestMetadata common.RequestMetadata
}

func (request AddIpv6VcnCidrRequest) String() string {
	return common.PointerString(request)
}

// HTTPRequest implements the OCIRequest interface
func (request AddIpv6VcnCidrRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser) (http.Request, error) {

	return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
}

// BinaryRequestBody implements the OCIRequest interface
func (request AddIpv6VcnCidrRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) {

	return nil, false

}

// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (request AddIpv6VcnCidrRequest) RetryPolicy() *common.RetryPolicy {
	return request.RequestMetadata.RetryPolicy
}

// AddIpv6VcnCidrResponse wrapper for the AddIpv6VcnCidr operation
type AddIpv6VcnCidrResponse struct {

	// The underlying http response
	RawResponse *http.Response

	// Unique Oracle-assigned identifier for the request. If you need to contact
	// Oracle about a particular request, please provide the request ID.
	OpcRequestId *string `presentIn:"header" name:"opc-request-id"`

	// The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest)
	// with this ID to track the status of the request.
	OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"`
}

func (response AddIpv6VcnCidrResponse) String() string {
	return common.PointerString(response)
}

// HTTPResponse implements the OCIResponse interface
func (response AddIpv6VcnCidrResponse) HTTPResponse() *http.Response {
	return response.RawResponse
}


text:
from pyasn1.compat.octets import null

from pysnmp import error
from pysnmp.entity import config

__all__ = [
    'CommunityData', 'UsmUserData',
    'USM_AUTH_NONE', 'USM_AUTH_HMAC96_MD5',
    'USM_AUTH_HMAC96_SHA', 'USM_AUTH_HMAC128_SHA224',
    'USM_AUTH_HMAC192_SHA256', 'USM_AUTH_HMAC256_SHA384',
    'USM_AUTH_HMAC384_SHA512', 'USM_PRIV_NONE',
    'USM_PRIV_CBC56_DES', 'USM_PRIV_CBC168_3DES',
    'USM_PRIV_CFB128_AES', 'USM_PRIV_CFB192_AES',
    'USM_PRIV_CFB256_AES', 'USM_PRIV_CFB192_AES_BLUMENTHAL',
    'USM_PRIV_CFB256_AES_BLUMENTHAL', 'USM_KEY_TYPE_PASSPHRASE',
    'USM_KEY_TYPE_MASTER', 'USM_KEY_TYPE_LOCALIZED'
]

USM_AUTH_NONE = config.USM_AUTH_NONE
"""No Authentication Protocol"""

USM_AUTH_HMAC96_MD5 = config.USM_AUTH_HMAC96_MD5
"""The HMAC-MD5-96 Digest Authentication Protocol (:RFC:`3414#section-6`)"""

USM_AUTH_HMAC96_SHA = config.USM_AUTH_HMAC96_SHA
"""The HMAC-SHA-96 Digest Authentication Protocol AKA SHA-1 (:RFC:`3414#section-7`)"""

USM_AUTH_HMAC128_SHA224 = config.USM_AUTH_HMAC128_SHA224
"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)"""

USM_AUTH_HMAC192_SHA256 = config.USM_AUTH_HMAC192_SHA256
"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)"""

USM_AUTH_HMAC256_SHA384 = config.USM_AUTH_HMAC256_SHA384
"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)"""

USM_AUTH_HMAC384_SHA512 = config.USM_AUTH_HMAC384_SHA512
"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)"""

USM_PRIV_NONE = config.USM_PRIV_NONE
"""No Privacy Protocol"""

USM_PRIV_CBC56_DES = config.USM_PRIV_CBC56_DES
"""The CBC56-DES Symmetric Encryption Protocol (:RFC:`3414#section-8`)"""

USM_PRIV_CBC168_3DES = config.USM_PRIV_CBC168_3DES
"""The 3DES-EDE Symmetric Encryption Protocol (`draft-reeder-snmpv3-usm-3desede-00 \
<https:://tools.ietf.org/html/draft-reeder-snmpv3-usm-3desede-00#section-5>`_)"""

USM_PRIV_CFB128_AES = config.USM_PRIV_CFB128_AES
"""The CFB128-AES-128 Symmetric Encryption Protocol (:RFC:`3826#section-3`)"""

USM_PRIV_CFB192_AES = config.USM_PRIV_CFB192_AES
"""The CFB128-AES-192 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 \
<https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_) \
with Reeder key localization"""

USM_PRIV_CFB256_AES = config.USM_PRIV_CFB256_AES
"""The CFB128-AES-256 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 \
<https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_) \
with Reeder key localization"""

USM_PRIV_CFB192_AES_BLUMENTHAL = config.USM_PRIV_CFB192_AES_BLUMENTHAL
"""The CFB128-AES-192 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 \
<https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_)"""

USM_PRIV_CFB256_AES_BLUMENTHAL = config.USM_PRIV_CFB256_AES_BLUMENTHAL
"""The CFB128-AES-256 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 \
<https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_)"""

# USM key types (PYSNMP-USM-MIB::pysnmpUsmKeyType)

USM_KEY_TYPE_PASSPHRASE = config.USM_KEY_TYPE_PASSPHRASE
"""USM key material type - plain-text pass phrase (:RFC:`3414#section-2.6`)"""

USM_KEY_TYPE_MASTER = config.USM_KEY_TYPE_MASTER
"""USM key material type - hashed pass-phrase AKA master key (:RFC:`3414#section-2.6`)"""

USM_KEY_TYPE_LOCALIZED = config.USM_KEY_TYPE_LOCALIZED
"""USM key material type - hashed pass-phrase hashed with Context SNMP Engine ID \
(:RFC:`3414#section-2.6`)"""

class CommunityData(object):
    """Creates SNMP v1/v2c configuration entry.

    This object can be used by
    :py:class:`~pysnmp.hlapi.asyncore.AsyncCommandGenerator` or
    :py:class:`~pysnmp.hlapi.asyncore.AsyncNotificationOriginator`
    and their derivatives for adding new entries to Local Configuration
    Datastore (LCD) managed by :py:class:`~pysnmp.hlapi.SnmpEngine`
    class instance.

    See :RFC:`2576#section-5.3` for more information on the
    *SNMP-COMMUNITY-MIB::snmpCommunityTable*.

    Parameters
    ----------
    communityIndex: :py:class:`str`, :py:class:`~pysnmp.proto.rfc1902.OctetString`
        Unique index value of a row in snmpCommunityTable. If it is the
        only positional parameter, it is treated as a *communityName*.

    communityName: :py:class:`str`, :py:class:`~pysnmp.proto.rfc1902.OctetString`
        SNMP v1/v2c community string.

    mpModel: :py:class:`int`
        SNMP message processing model AKA SNMP version. Known SNMP versions are:

        * `0` - for SNMP v1
        * `1` - for SNMP v2c (default)

    contextEngineId: :py:class:`str`, :py:class:`~pysnmp.proto.rfc1902.OctetString`
        Indicates the location of the context in which management
        information is accessed when using the community string
        specified by the above communityName.

    contextName: :py:class:`str`, :py:class:`~pysnmp.proto.rfc1902.OctetString`
        The context in which management information is accessed when
        using the above communityName.

    tag: :py:class:`str`
        Arbitrary string that specifies a set of transport endpoints
        from which a command responder application will accept
        management requests with given *communityName* or to which
        notification originator application will send notifications
        when targets are specified by a tag value(s).

        The other way to look at the *tag* feature is that it can make
        specific *communityName* only valid for certain targets.

        The other use-case is when multiple distinct SNMP peers share
        the same *communityName* -- binding each instance of
        *communityName* to transport endpoint lets you distinguish
        SNMP peers from each other (e.g. resolving *communityName* into
        proper *securityName*).

        For more technical information on SNMP configuration tags please
        refer to :RFC:`3413#section-4.1.1` and :RFC:`2576#section-5.3`
        (e.g. the *snmpCommunityTransportTag* object).

        See also: :py:class:`~pysnmp.hlapi.UdpTransportTarget`

    Warnings
    --------
    If the same *communityIndex* value is supplied repeatedly with
    different *communityName* (or other parameters), the later call
    supersedes all previous calls.

    Make sure not to configure duplicate *communityName* values unless
    they have distinct *mpModel* and/or *tag* fields. This will make
    *communityName* based database lookup ambiguous.

    Examples
    --------
    >>> from pysnmp.hlapi import CommunityData
    >>> CommunityData('public')
    CommunityData(communityIndex='s1410706889', communityName=<COMMUNITY>, mpModel=1, contextEngineId=None, contextName='', tag='')
    >>> CommunityData('public', 'public')
    CommunityData(communityIndex='public', communityName=<COMMUNITY>, mpModel=1, contextEngineId=None, contextName='', tag='')
    >>>

    """
    mpModel = 1  # Default is SMIv2
    securityModel = mpModel + 1
    securityLevel = 'noAuthNoPriv'
    contextName = null
    tag = null

    def __init__(self, communityIndex, communityName=None, mpModel=None,
                 contextEngineId=None, contextName=None, tag=None,
                 securityName=None):

        if mpModel is not None:
            self.mpModel = mpModel
            self.securityModel = mpModel + 1

        self.contextEngineId = contextEngineId

        if contextName is not None:
            self.contextName = contextName

        if tag is not None:
            self.tag = tag

        # a single arg is considered as a community name
        if communityName is None:
            communityName, communityIndex = communityIndex, None

        self.communityName = communityName

        # Autogenerate communityIndex if not specified
        if communityIndex is None:
            self.securityName = 's%s' % hash(
                (self.communityName, self.mpModel, self.contextEngineId,
                 self.contextName, self.tag))

            self.communityIndex = self.securityName

        else:
            self.communityIndex = communityIndex

            if securityName is None:
                self.securityName = communityIndex

            else:
                self.securityName = securityName

    def __hash__(self):
        raise TypeError('%s is not hashable' % self.__class__.__name__)

    def __repr__(self):
        return ('%s(communityIndex=%r, communityName=<COMMUNITY>, mpModel=%r, '
                'contextEngineId=%r, contextName=%r, tag=%r, securityName='
                '%r)') % (self.__class__.__name__, self.communityIndex,
                          self.mpModel, self.contextEngineId, self.contextName,
                          self.tag, self.securityName)

    def clone(self, communityIndex=None, communityName=None,
              mpModel=None, contextEngineId=None,
              contextName=None, tag=None, securityName=None):

        # a single arg is considered as a community name
        if communityName is None:
            communityName, communityIndex = communityIndex, None

        return self.__class__(
            communityIndex,
            communityName is None and self.communityName or communityName,
            mpModel is None and self.mpModel or mpModel,
            contextEngineId is None and self.contextEngineId or contextEngineId,
            contextName is None and self.contextName or contextName,
            tag is None and self.tag or tag,
            securityName is None and self.securityName or securityName)

class UsmUserData(object):
    """Creates SNMP v3 User Security Model (USM) configuration entry.

    This object can be used by
    :py:class:`~pysnmp.hlapi.asyncore.AsyncCommandGenerator` or
    :py:class:`~pysnmp.hlapi.asyncore.AsyncNotificationOriginator`
    and their derivatives for adding new entries to Local Configuration
    Datastore (LCD) managed by :py:class:`~pysnmp.hlapi.SnmpEngine`
    class instance.

    See :RFC:`3414#section-5` for more information on the
    *SNMP-USER-BASED-SM-MIB::usmUserTable*.

    Parameters
    ----------
    userName: :py:class:`str`, :py:class:`~pysnmp.proto.rfc1902.OctetString`
        A human readable string representing the name of the SNMP USM user.

    Other Parameters
    ----------------
    authKey: :py:class:`str`, :py:class:`~pysnmp.proto.rfc1902.OctetString`
        Initial value of the secret authentication key.  If not set,
        :py:class:`~pysnmp.hlapi.usmNoAuthProtocol`
        is implied.  If set and no *authProtocol* is specified,
        :py:class:`~pysnmp.hlapi.usmHMACMD5AuthProtocol`
        takes effect.

    privKey: :py:class:`str`, :py:class:`~pysnmp.proto.rfc1902.OctetString`
        Initial value of the secret encryption key.  If not set,
        :py:class:`~pysnmp.hlapi.usmNoPrivProtocol`
        is implied.  If set and no *privProtocol* is specified,
        :py:class:`~pysnmp.hlapi.usmDESPrivProtocol`
        takes effect.

    authProtocol: :py:class:`tuple`, :py:class:`~pysnmp.proto.rfc1902.ObjectIdentifier`
        An indication of whether messages sent on behalf of this USM user
        can be authenticated, and if so, the type of authentication protocol
        which is used.

        Supported authentication protocol identifiers are:

        * :py:class:`~pysnmp.hlapi.usmNoAuthProtocol` (default is *authKey* not given)
        * :py:class:`~pysnmp.hlapi.usmHMACMD5AuthProtocol` (default if *authKey* is given)
        * :py:class:`~pysnmp.hlapi.usmHMACSHAAuthProtocol`
        * :py:class:`~pysnmp.hlapi.usmHMAC128SHA224AuthProtocol`
        * :py:class:`~pysnmp.hlapi.usmHMAC192SHA256AuthProtocol`
        * :py:class:`~pysnmp.hlapi.usmHMAC256SHA384AuthProtocol`
        * :py:class:`~pysnmp.hlapi.usmHMAC384SHA512AuthProtocol`

    securityEngineId: :py:class:`~pysnmp.proto.rfc1902.OctetString`
        The snmpEngineID of the authoritative SNMP engine to which a
        dateRequest message is to be sent. Will be automatically
        discovered from peer if not given, unless localized keys
        are used. In the latter case *securityEngineId* must be
        specified.

        See :RFC:`3414#section-2.5.1` for technical explanation.

    securityName: :py:class:`str`, :py:class:`~pysnmp.proto.rfc1902.OctetString`
        Together with the snmpEngineID it identifies a row in the
        *SNMP-USER-BASED-SM-MIB::usmUserTable* that is to be used
        for securing the message.

        See :RFC:`3414#section-2.5.1` for technical explanation.

    privProtocol: :py:class:`tuple`, :py:class:`~pysnmp.proto.rfc1902.ObjectIdentifier`
        An indication of whether messages sent on behalf of this USM user
        be encrypted, and if so, the type of encryption protocol which is used.

        Supported encryption protocol identifiers are:

        * :py:class:`~pysnmp.hlapi.usmNoPrivProtocol` (default is *privhKey* not given)
        * :py:class:`~pysnmp.hlapi.usmDESPrivProtocol` (default if *privKey* is given)
        * :py:class:`~pysnmp.hlapi.usm3DESEDEPrivProtocol`
        * :py:class:`~pysnmp.hlapi.usmAesCfb128Protocol`
        * :py:class:`~pysnmp.hlapi.usmAesCfb192Protocol`
        * :py:class:`~pysnmp.hlapi.usmAesCfb256Protocol`

    authKeyType: :py:class:`int`
        Type of `authKey` material. See :RFC:`3414#section-2.6` for
        technical explanation.

        Supported key types are:

        * :py:class:`~pysnmp.hlapi.usmKeyTypePassphrase` (default)
        * :py:class:`~pysnmp.hlapi.usmKeyTypeMaster`
        * :py:class:`~pysnmp.hlapi.usmKeyTypeLocalized`

    privKeyType: :py:class:`int`
        Type of `privKey` material. See :RFC:`3414#section-2.6` for
        technical explanation.

        Supported key types are:

        * :py:class:`~pysnmp.hlapi.usmKeyTypePassphrase` (default)
        * :py:class:`~pysnmp.hlapi.usmKeyTypeMaster`
        * :py:class:`~pysnmp.hlapi.usmKeyTypeLocalized`

    Notes
    -----
    If :py:class:`~pysnmp.hlapi.usmKeyTypeLocalized` is used when
    running a non-authoritative SNMP engine, USM key localization
    mechanism is not invoked. As a consequence, local SNMP engine
    configuration won't get automatically populated with remote SNMP
    engine's *securityEngineId*.

    Therefore peer SNMP engine's *securityEngineId* must be added
    to local configuration and associated with its localized keys.

    Alternatively, the magic *securityEngineId* value of five zeros
    (*0x0000000000*) can be used to refer to the localized keys that
    should be used with any unknown remote SNMP engine. This feature
    is specific to pysnmp.

    Examples
    --------
    >>> from pysnmp.hlapi import UsmUserData
    >>> UsmUserData('testuser', authKey='authenticationkey')
    UsmUserData(userName='testuser', authKey=<AUTHKEY>, privKey=<PRIVKEY>, authProtocol=(1,3,6,1,6,3,10,1,1,2), privProtocol=(1,3,6,1,6,3,10,1,2,1))
    >>> UsmUserData('testuser', authKey='authenticationkey', privKey='encryptionkey')
    UsmUserData(userName='testuser', authKey=<AUTHKEY>, privKey=<PRIVKEY>, authProtocol=(1,3,6,1,6,3,10,1,1,2), privProtocol=(1,3,6,1,6,3,10,1,2,2))
    >>>

    """
    authKey = privKey = None
    authProtocol = config.USM_AUTH_NONE
    privProtocol = config.USM_PRIV_NONE
    securityLevel = 'noAuthNoPriv'
    securityModel = 3
    mpModel = 3
    contextName = null

    def __init__(self, userName,
                 authKey=None, privKey=None,
                 authProtocol=None, privProtocol=None,
                 securityEngineId=None,
                 securityName=None,
                 authKeyType=USM_KEY_TYPE_PASSPHRASE,
                 privKeyType=USM_KEY_TYPE_PASSPHRASE):
        self.userName = userName

        if securityName is None:
            self.securityName = userName

        else:
            self.securityName = securityName

        if authKey is not None:
            self.authKey = authKey

            if authProtocol is None:
                self.authProtocol = config.USM_AUTH_HMAC96_MD5

            else:
                self.authProtocol = authProtocol

            if self.securityLevel != 'authPriv':
                self.securityLevel = 'authNoPriv'

        if privKey is not None:
            self.privKey = privKey

            if self.authProtocol == config.USM_AUTH_NONE:
                raise error.PySnmpError('Privacy implies authenticity')

            self.securityLevel = 'authPriv'

            if privProtocol is None:
                self.privProtocol = config.USM_PRIV_CBC56_DES

            else:
                self.privProtocol = privProtocol

        self.securityEngineId = securityEngineId
        self.authKeyType = authKeyType
        self.privKeyType = privKeyType

    def __hash__(self):
        raise TypeError('%s is not hashable' % self.__class__.__name__)

    def __repr__(self):
        return ('%s(userName=%r, authKey=<AUTHKEY>, privKey=<PRIVKEY>, '
                'authProtocol=%r, privProtocol=%r, securityEngineId=%r, '
                'securityName=%r, authKeyType=%r, privKeyType=%r)') % (
            self.__class__.__name__,
            self.userName,
            self.authProtocol,
            self.privProtocol,
            self.securityEngineId is None and '<DEFAULT>' or self.securityEngineId,
            self.securityName,
            self.authKeyType,
            self.privKeyType
        )

    def clone(self, userName=None,
              authKey=None, privKey=None,
              authProtocol=None, privProtocol=None,
              securityEngineId=None, securityName=None,
              authKeyType=None, privKeyType=None):
        return self.__class__(
            userName is None and self.userName or userName,
            authKey is None and self.authKey or authKey,
            privKey is None and self.privKey or privKey,
            authProtocol is None and self.authProtocol or authProtocol,
            privProtocol is None and self.privProtocol or privProtocol,
            securityEngineId is None and self.securityEngineId or securityEngineId,
            securityName is None and self.securityName or securityName,
            authKeyType is None and self.authKeyType or USM_KEY_TYPE_PASSPHRASE,
            privKeyType is None and self.privKeyType or USM_KEY_TYPE_PASSPHRASE
        )

# Backward-compatible protocol IDs

usmNoAuthProtocol = USM_AUTH_NONE
usmHMACMD5AuthProtocol = USM_AUTH_HMAC96_MD5
usmHMACSHAAuthProtocol = USM_AUTH_HMAC96_SHA
usmHMAC128SHA224AuthProtocol = USM_AUTH_HMAC128_SHA224
usmHMAC192SHA256AuthProtocol = USM_AUTH_HMAC192_SHA256
usmHMAC256SHA384AuthProtocol = USM_AUTH_HMAC256_SHA384
usmHMAC384SHA512AuthProtocol = USM_AUTH_HMAC384_SHA512
usmNoPrivProtocol = USM_PRIV_NONE
usmDESPrivProtocol = USM_PRIV_CBC56_DES
usm3DESEDEPrivProtocol = USM_PRIV_CBC168_3DES
usmAesCfb128Protocol = USM_PRIV_CFB128_AES
usmAesCfb192Protocol = USM_PRIV_CFB192_AES
usmAesCfb256Protocol = USM_PRIV_CFB256_AES
usmAesBlumenthalCfb192Protocol = USM_PRIV_CFB192_AES_BLUMENTHAL
usmAesBlumenthalCfb256Protocol = USM_PRIV_CFB256_AES_BLUMENTHAL

usmKeyTypePassphrase = USM_KEY_TYPE_PASSPHRASE
usmKeyTypeMaster = USM_KEY_TYPE_MASTER
usmKeyTypeLocalized = USM_KEY_TYPE_LOCALIZED

__all__.extend(
    ['usm3DESEDEPrivProtocol',
     'usmAesCfb128Protocol',
     'usmAesCfb192Protocol',
     'usmAesCfb256Protocol',
     'usmAesBlumenthalCfb192Protocol',
     'usmAesBlumenthalCfb256Protocol',
     'usmDESPrivProtocol',
     'usmHMACMD5AuthProtocol',
     'usmHMACSHAAuthProtocol',
     'usmHMAC128SHA224AuthProtocol',
     'usmHMAC192SHA256AuthProtocol',
     'usmHMAC256SHA384AuthProtocol',
     'usmHMAC384SHA512AuthProtocol',
     'usmNoAuthProtocol',
     'usmNoPrivProtocol',
     'usmKeyTypePassphrase',
     'usmKeyTypeMaster',
     'usmKeyTypeLocalized']
)


text:
#lightbox {
	position: absolute;
	/*left: 0;*/
	width: 100%;
	z-index: 100;
	text-align: center;
	line-height: 0;
}

#lightbox2 {
	z-index: 100;
	position:fixed;
	top:40%;
	left:50%;
	/*width:480px;*/
	background:#fff;
	padding:10px;
}

#lightbox2 object, #lightbox2 embed {
	display:block;
	margin-bottom:10px;
}
#lightbox2 .close {
	float:right;
	margin-right:20px;
}

#lightbox a img{ border: none; }

#outerImageContainer{
	position: relative;
	background-color: #fff;
	width: 250px;
	height: 250px;
	margin: 0 auto;
	}
#imageContainer img{
	max-width:600px;
}
#imageContainer{
	padding: 10px;
	}

#loading{
	position: absolute;
	top: 40%;
	left: 0%;
	height: 25%;
	width: 100%;
	text-align: center;
	line-height: 0;
	}
#hoverNav{
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 100%;
	z-index: 10;
	}
#imageContainer>#hoverNav{ left: 0;}
#hoverNav a{ outline: none;}

#prevLink, #nextLink{
	width: 49%;
	height: 100%;
	background: transparent url(../assets/images/blank.gif) no-repeat; /* Trick IE into showing hover */
	display: block;
	}
#prevLink { left: 0; float: left;}
#nextLink { right: 0; float: right;}
#prevLink:hover, #prevLink:visited:hover { background: url(../assets/images/prev.gif) left 50% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url(../assets/images/next.gif) right 50% no-repeat; }

/*** START : next / previous text links ***/
#nextLinkText, #prevLinkText{
color: #FF9834;
font-weight:bold;
text-decoration: none;
}
#nextLinkText{
padding-left: 20px;
}
#prevLinkText{
padding-right: 20px;
}
/*** END : next / previous text links ***/
/*** START : added padding when navbar is on top ***/

.ontop #imageData {
		padding-top: 5px;
}

/*** END : added padding when navbar is on top ***/

#imageDataContainer{
	font: 10px Verdana, Helvetica, sans-serif;
	background-color: #fff;
	margin: 0 auto;
	line-height: 1.4em;
	}

#imageData{
	padding:0 10px;
	}
#imageData #imageDetails{ width: 70%; float: left; text-align: left; }
#imageData #caption{ font-weight: bold;	}
#imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em;	}
#imageData #bottomNavClose{ width: 66px; float: right;	padding-bottom: 0.7em;	}
#imageData #helpDisplay {clear: left; float: left; display: block; }

#overlay{
	position: fixed;
	top: 0;
	left: 0;
	z-index: 90;
	width: 100%;
	height: 100%;
	background-color: #000;
	display: none;
}

.clearfix:after {
	content: ".";
	display: block;
	height: 0;
	clear: both;
	visibility: hidden;
	}

* html>body .clearfix {
	display: inline-block;
	width: 100%;
	}

* html .clearfix {
	/* Hides from IE-mac \*/
	height: 1%;
	/* End hide from IE-mac */
	}

#lightboxIframe {
	display: none;
}


text:
namespace fontTest {

std::string FontTest::interfaceType() const {
    return "CONTINUOUS";
}

void FontTest::solve(
        int mazeWidth, int mazeHeight, bool isOfficialMaze,
        char initialDirection, sim::MouseInterface* mouse) {

    // Put all the characters on the closest tiles

    std::string allChars =
        " !\"#$%&'()*+,-./0123456789:;<=>?"
        "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
        "`abcdefghijklmnopqrstuvwxyz{|}~";

    for (int i = 0; i < 6; i += 1) {
        for (int j = 0; j < 6; j += 1) {
            int index = 18 * i + 3 * j + 0;
            std::string str;
            for (int k = 0; k < 3; k += 1) {
                if (index + k < allChars.size()) {
                    str += allChars.substr(index + k, 1);
                    str += " ";
                }
            }
            mouse->setTileText(i, 5 - j, str);
        }
    }

    // Easy manual mode control so that we can look around

    double accelerateAmount = 60.0;
    double decelerateAmount = 1.5;
    double leftWheelSpeed = 0.0;
    double rightWheelSpeed = 0.0;

    while (true) {

        leftWheelSpeed /= decelerateAmount;
        rightWheelSpeed /= decelerateAmount;

        if (sim::S()->arrowKeyIsPressed(sim::Key::UP)) {
            leftWheelSpeed -= accelerateAmount;
            rightWheelSpeed += accelerateAmount;
        }
        if (sim::S()->arrowKeyIsPressed(sim::Key::DOWN)) {
            leftWheelSpeed += accelerateAmount;
            rightWheelSpeed -= accelerateAmount;
        }
        if (sim::S()->arrowKeyIsPressed(sim::Key::RIGHT)) {
            leftWheelSpeed -= accelerateAmount / 4.0;
            rightWheelSpeed -= accelerateAmount / 4.0;
        }
        if (sim::S()->arrowKeyIsPressed(sim::Key::LEFT)) {
            leftWheelSpeed += accelerateAmount / 4.0;
            rightWheelSpeed += accelerateAmount / 4.0;
        }

        if (leftWheelSpeed < -mouse->getWheelMaxSpeed("left")) {
            leftWheelSpeed = -mouse->getWheelMaxSpeed("left");
        }
        if (mouse->getWheelMaxSpeed("left") < leftWheelSpeed) {
            leftWheelSpeed = mouse->getWheelMaxSpeed("left");
        }
        if (rightWheelSpeed < -mouse->getWheelMaxSpeed("right")) {
            rightWheelSpeed = -mouse->getWheelMaxSpeed("right");
        }
        if (mouse->getWheelMaxSpeed("right") < rightWheelSpeed) {
            rightWheelSpeed = mouse->getWheelMaxSpeed("right");
        }

        mouse->setWheelSpeed("left", leftWheelSpeed);
        mouse->setWheelSpeed("right", rightWheelSpeed);
        mouse->delay(30);
    }
}

} // namespace fontTest


text:
namespace ui {

class ZXDGSurfaceV6WrapperImpl;
class WaylandConnection;
class WaylandWindow;

// Popup wrapper for xdg-shell-unstable-v6
class ZXDGPopupV6WrapperImpl : public ShellPopupWrapper {
 public:
  ZXDGPopupV6WrapperImpl(std::unique_ptr<ZXDGSurfaceV6WrapperImpl> surface,
                         WaylandWindow* wayland_window,
                         WaylandConnection* connection);

  ZXDGPopupV6WrapperImpl(const ZXDGPopupV6WrapperImpl&) = delete;
  ZXDGPopupV6WrapperImpl& operator=(const ZXDGPopupV6WrapperImpl&) = delete;

  ~ZXDGPopupV6WrapperImpl() override;

  // XDGPopupWrapper:
  bool Initialize(const ShellPopupParams& params) override;
  void AckConfigure(uint32_t serial) override;
  bool IsConfigured() override;
  bool SetBounds(const gfx::Rect& new_bounds) override;
  void SetWindowGeometry(const gfx::Rect& bounds) override;
  void Grab(uint32_t serial) override;

 private:
  wl::Object<zxdg_positioner_v6> CreatePositioner(WaylandWindow* parent_window);

  // zxdg_popup_v6_listener
  static void Configure(void* data,
                        struct zxdg_popup_v6* zxdg_popup_v6,
                        int32_t x,
                        int32_t y,
                        int32_t width,
                        int32_t height);
  static void PopupDone(void* data, struct zxdg_popup_v6* zxdg_popup_v6);

  ZXDGSurfaceV6WrapperImpl* zxdg_surface_v6_wrapper() const;

  // Non-owned WaylandWindow that uses this popup.
  WaylandWindow* const wayland_window_;
  // Non-owned WaylandConnection.
  WaylandConnection* const connection_;

  // Ground surface for this popup.
  std::unique_ptr<ZXDGSurfaceV6WrapperImpl> zxdg_surface_v6_wrapper_;

  // XDG Shell V6 object.
  wl::Object<zxdg_popup_v6> zxdg_popup_v6_;

  // Parameters of this popup.
  ShellPopupParams params_;
};

}  // namespace ui

#endif  // UI_OZONE_PLATFORM_WAYLAND_HOST_ZXDG_POPUP_V6_WRAPPER_IMPL_H_


text: google-site-verification: google8589fa6992b6bde2.html


text:
//
//  OCHamcrest - HCIsDictionaryContainingKey.h
//  Copyright 2011 hamcrest.org. See LICENSE.txt
//
//  Created by: Jon Reid
//

    // Inherited
#import <OCHamcrestIOS/HCBaseMatcher.h>

/**
    Matches dictionaries containing a key satisfying a given matcher.
    @ingroup collection_matchers
 */
@interface HCIsDictionaryContainingKey : HCBaseMatcher
{
    id<HCMatcher> keyMatcher;
}

+ (id)isDictionaryContainingKey:(id<HCMatcher>)theKeyMatcher;
- (id)initWithKeyMatcher:(id<HCMatcher>)theKeyMatcher;

@end

//--------------------------------------------------------------------------------------------------

/**
    Matches dictionaries containing a key satisfying a given matcher.

    @b Synonym: @ref hasKey
    @param matcherOrValue  A matcher, or a value for @ref equalTo matching.
    @see HCIsDictionaryContainingKey
    @ingroup collection_matchers
 */
OBJC_EXPORT id<HCMatcher> HC_hasKey(id matcherOrValue);

/**
    hasKey(matcherOrValue) -
    Matches dictionaries containing a key satisfying a given matcher.

    Synonym for @ref HC_hasKey, available if @c HC_SHORTHAND is defined.
    @param matcherOrValue  A matcher, or a value for @ref equalTo matching.
    @see HCIsDictionaryContainingKey
    @ingroup collection_matchers
 */
#ifdef HC_SHORTHAND
    #define hasKey HC_hasKey
#endif


text:
<?php

namespace Tuulia\Bundle\TestBundle\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class DefaultControllerTest extends WebTestCase
{
    /**
     * Test fron end controller index
     */
    public function testIndex()
    {

        // start the symfony kernel and get container so that you can make $this->get like in front end
        $kernel = static::createKernel();
        $kernel->boot();

        //
        // Test database
        //
        $emDefault = $kernel->getContainer()
            ->get('doctrine')
            ->getManager();

        // Make connection to the defaut databse , SymfonyTest
        $products = $emDefault
            ->getRepository('AppBundle:Product')
            ->findAll();
        $this->assertEquals(3, count($products));

        // Make connection to the  databse , SymfonyTest2
        $emSymfonyTest2 = $kernel->getContainer()
            ->get('doctrine')
            ->getManager('symfonyTest2');
        $users = $emSymfonyTest2
            ->getRepository('TuuliaBundleTestBundle:Users')
           ->findAll();

        $this->assertEquals(3, count($users));
        $this->assertEquals('tuulia3', $users[2]->get('username'));

    }

    /**
     *
     */
    public function testSave() {
        $kernel = static::createKernel();
        $kernel->boot();

        $userId = 2;
        $userName = 'tuulia' . uniqid();

        // Save
        $emSymfonyTest2 = $kernel->getContainer()
            ->get('doctrine')
            ->getManager('symfonyTest2');
        $user = $emSymfonyTest2
            ->getRepository('TuuliaBundleTestBundle:Users')
            ->find($userId);

        $user->set('username' , $userName);
        $emSymfonyTest2>flush();

        // Check if value is saved
        $user = $emSymfonyTest2
            ->getRepository('TuuliaBundleTestBundle:Users')
            ->find($userId);
        $this->assertEquals($userName, $user->get('username'));
    }

    /**
     *
     */
    public function testSaveValidation() {
        $kernel = static::createKernel();
        $kernel->boot();
        $container = $kernel->getContainer();

        $userId = 2;

        // Save
        $emSymfonyTest2 = $kernel->getContainer()
            ->get('doctrine')
            ->getManager('symfonyTest2');
        $user = $emSymfonyTest2
            ->getRepository('TuuliaBundleTestBundle:Users')
            ->find($userId);

        // Trying to insert user with illegal character *
        $user->set('username' , 'tuulia*');
        $validator =$container->get('validator');
        $errors = $validator->validate($user);
        $errorMessage = '/contains an illegal character: it can only contain letters or numbers/';
        $this->assertEquals(true, preg_match($errorMessage , (string)$errors), 'Case: ' . $errorMessage);

        //Trying to insert user without 'tuulia'
        $user->set('full_name' , 'x');
        $user->set('username' , 'tuulia2323');
        $errors = $validator->validate($user);
        $errorMessage = '/Both usename an full_name must contain tuulia/';
        $this->assertEquals(true, preg_match($errorMessage , (string)$errors), 'Case: ' . $errorMessage);
    }
    /**
     * Test test service
     */
    public function testTestService(){

        // start the symfony kernel and get container so that you can make $this->get like in front end
        $kernel = static::createKernel();
        $kernel->boot();
        $container = $kernel->getContainer();
        // In front end you do $this->get('tuulia.test);
        $testmanager = $container->get('tuulia.test');

        $this->assertEquals('tuuliaTestArg', $testmanager->getTestParam1());

    }

    public function testCoreManager()
    {
        // start the symfony kernel and get container so that you can make $this->get like in front end
        $kernel = static::createKernel();
        $kernel->boot();
        $container = $kernel->getContainer();

        $aholdManager = $container->get('tuulia.ahold');
        $this->assertEquals(22342, $aholdManager->getTestParam());

        $uwvManager = $container->get('tuulia.uwv');
        $this->assertEquals(242, $uwvManager->getTestParam());

    }
}


text:
layout: category
section-type: category
title: C
---
## Category


text:
<?php

use app\models\general\GeneralLabel;

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model app\models\RefKategoriPenggunaan */

$this->title = GeneralLabel::createTitle.' '.GeneralLabel::kategori_penggunaan;
$this->params['breadcrumbs'][] = ['label' => GeneralLabel::kategori_penggunaan, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>


text:
package com.rhomobile.rhodes.extmanager;

import android.webkit.JavascriptInterface;

import com.rhomobile.rhodes.Logger;

public class RhoJSApi {
    private static final String TAG = RhoJSApi.class.getSimpleName();

    @JavascriptInterface
    public String apiCall(String json, boolean async) {
        Logger.D(TAG, "Execute JS hook: " + json);
        String res = RhoExtManagerImpl.nativeJSCallEntryPoint(json);
        Logger.D(TAG, "JS result: " + res);
        return res;
    }

}


text:
<?php

namespace Modules\Core\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;

class CoreController extends Controller
{
    /**
     * Display a listing of the resource.
     * @return Response
     */
    public function index()
    {
        return view('core::index');
    }

    /**
     * Show the form for creating a new resource.
     * @return Response
     */
    public function create()
    {
        return view('core::create');
    }

    /**
     * Store a newly created resource in storage.
     * @param  Request $request
     * @return Response
     */
    public function store(Request $request)
    {
    }

    /**
     * Show the specified resource.
     * @return Response
     */
    public function show()
    {
        return view('core::show');
    }

    /**
     * Show the form for editing the specified resource.
     * @return Response
     */
    public function edit()
    {
        return view('core::edit');
    }

    /**
     * Update the specified resource in storage.
     * @param  Request $request
     * @return Response
     */
    public function update(Request $request)
    {
    }

    /**
     * Remove the specified resource from storage.
     * @return Response
     */
    public function destroy()
    {
    }
}


text:
<?php

/**
 * Для каждого выделенного номера можно получить ссылку на страницу статистики.
 * Эта страница будет доступна только, тем у кого есть ссылка.
 * Страница содержит таблицу со звонками на номер.
 */

require_once ('../config/config.php');
require_once ('../lib/httpful.phar');
require_once ('../lib/SipuniApi.class.php');
use sipuni\SipuniApi;

function main(){

    $api = new SipuniApi(SIPUNI_API_KEY);

    try{
        $url = $api->getStatisticsUrl('74996476965');
        print("Statistics url: {$url}\n");

    }catch (\Exception $e){
        print $e;
    }
}

main();


text:
require 'test/unit'
require 'uri'
require '_base'
require 'webcrawler'

class TC_Webcrawler < Test::Unit::TestCase
  def test_crawl_one
    checker=Webcrawler::new(uriFromTest("test_crawl_one/"))
    checker.crawlOne(uriFromTest("test_crawl_one/index.htm")) {|uri,req|
      assert_equal req.code,"200"
      [URI("success.htm")]
    }
    assert checker.toCrawl.include?(URI("success.htm"))
    assert checker.crawled.include?(uriFromTest("test_crawl_one/index.htm"))
  end

  def test_crawl_no_cycles
    checker=Webcrawler::new(uriFromTest("test_crawl_no_cycles/index.htm"))
    checker.crawlNext {|uri,req|
      [uriFromTest("test_crawl_no_cycles/testA.htm")]
    }
    checker.crawlNext {|uri,req|
      assert_equal uri,uriFromTest("test_crawl_no_cycles/testA.htm")
      [uriFromTest("test_crawl_no_cycles/testB.htm")]
    }
    checker.crawlNext {|uri,req|
      assert_equal uri,uriFromTest("test_crawl_no_cycles/testB.htm")
      [uriFromTest("test_crawl_no_cycles/testA.htm")]
    }
    assert checker.toCrawl.empty?
  end

  def test_crawl
    checker=Webcrawler::new(uriFromTest("test_crawl/index.htm"))
    my400s=[]
    my200s=[]
    checker.crawl {|uri,req|
      if req.code=="200"
        my200s << uri
      end
      if req.code=="404"
        my404s << uri
      end
      if uri==uriFromTest("test_crawl/index.htm")
        return [uriFromTest("test_crawl/exists.htm"),uriFromTest("test_crawl/should404.htm")]
      end
      return []
    }
    assert my200s.include?(uriFromTest("test_crawl/index.htm"))
    assert my200s.include?(uriFromTest("test_crawl/exists.htm"))
    assert my404s.include?(uriFromTest("test_crawl/should404.htm"))
  end
end


text:
int dbSet = 0;
DbConnectionSettings _dbConnection;

// Implementation of DbConnection.h
DbConnectionSettings* GetDbConnectionSettings ()
{
  return &_dbConnection;
}

#define DBCLEANSE(dbattr) tryfree (settings->dbattr);
void CleanseDbConnectionSettings ()
{
  DbConnectionSettings* settings;
  settings = GetDbConnectionSettings ();

  if (dbSet)
  {
    trace ("Cleansing db connection settings.");
    DBCLEANSE (Hostname);
    DBCLEANSE (User);
    DBCLEANSE (Password);
    DBCLEANSE (Database);
    DBCLEANSE (Socket);

    settings->Port = 0;
    settings->Flags = 0;

    dbSet = 0;
  }
}

#define DBCLONE(dbset,dbval) settings->dbset = strclone (dbval);
void SetDbConnectionSettings (const char* host, const char* user, const char* password,
  const char* dbName, unsigned int port, const char* socket, unsigned long flag)
{
  DbConnectionSettings* settings;
  settings = GetDbConnectionSettings ();

  trace ("Setting db connection settings.");
  CleanseDbConnectionSettings ();

  DBCLONE (Hostname, host);
  DBCLONE (User, user);
  DBCLONE (Password, password);
  DBCLONE (Database, dbName);
  DBCLONE (Socket, socket);

  settings->Port = port;
  settings->Flags = flag;

  dbSet = 1;
}

#define ASSERT_DB_ASSET(asset,message) if (!asset) { error (message); CleanseDbConnection (conn); return NULL; }
MYSQL* NewDbConnection()
{
  MYSQL* conn, *connected;
  DbConnectionSettings* settings;

  ASSERT_DB_ASSET (dbSet, "The database connection settings were never set.");
  settings = GetDbConnectionSettings ();

  trace ("Opening a new db connection.");
  conn = mysql_init (NULL);

  ASSERT_DB_ASSET (conn, "Error initializing database connection object.");

  connected = mysql_real_connect (conn,
    settings->Hostname,
    settings->User,
    settings->Password,
    settings->Database,
    settings->Port,
    settings->Socket,
    settings->Flags);

  ASSERT_DB_ASSET (connected, "Error connection to the database.");

  return connected;
}

void CleanseDbConnection (MYSQL* conn)
{
  if (mysql_errno (conn))
    error (mysql_error (conn));

  trace ("Closing db connection object.");
  mysql_close (conn);
}


text:
function PasswordVerification() {

    // configuration
    this.size = 8,
    this.forceUpperCase = true,
    this.forceLowerCase = true,
    this.forceNumber = true,
    this.forceSpecialChar = true,
    this.forceSize = true,

    // initial state
    this.result = false,
    this.resultPass = false,
    this.resultPassRetype = false,

    this.pass = null,
    this.passRetype = null,

    this.hasUpperCase = false,
    this.hasLowerCase = false,
    this.hasNumber = false,
    this.hasSpecialChar = false,
    this.hasSize = false,
    this.hasNotAllowedChar = false,

    this.passCheck = false;

    this.messages = [];

    this._resetResults = function() {
        this.result = false,
        this.resultPass = false,
        this.resultPassRetype = false;
    };

    this._resetHas = function() {
        this.hasUpperCase = false,
        this.hasLowerCase = false,
        this.hasNumber = false,
        this.hasSpecialChar = false,
        this.hasSize = false;
    };
}

PasswordVerification.prototype.test = function() {
    console.log('testing...');
};

PasswordVerification.prototype.check = function(pass, passRetype) {

    this.pass = pass;
    this.passRetype = passRetype;

    this._resetResults();
    this._resetHas();

    if(this.pass !== null) {
        for (var i = 0 ; i < this.pass.length; i++) {
            console.log(this.pass[i]);
            var c = this.pass.charAt(i);
            var founded = false;
    //            var passRetypeCheck = false;

            if ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'.indexOf(c) >= 0)
            {
                this.hasUpperCase = true;
                founded = true;
            }
            if ('abcdefghijklmnopqrstuvwxyz'.indexOf(c) >= 0)
            {
                this.hasLowerCase = true;
                founded = true;
            }

            if ('0123456789'.indexOf(c) >= 0)
            {
                this.hasNumber = true;
                founded = true;
            }
            if ('!@#$%&*_,.'.indexOf(c) >= 0)
            {
                this.hasSpecialChar = true;
                founded = true;
            }

            if(!founded) {
                this.hasNotAllowedChar = true;
            }

            if(this.pass.length >= this.size) {
                this.hasSize = true;
            }

            if(this.pass === this.passRetype) {
                this.resultPassRetype = true;
            }

        }
    }

    this.resultPass = false;
    if(!this.hasNotAllowedChar
            && (!this.forceUpperCase || this.hasUpperCase)
            && (!this.forceLowerCase || this.hasLowerCase)
            && (!this.forceNumber || this.hasNumber)
            && (!this.forceSpecialChar || this.hasSpecialChar)
            && (!this.forceSize || this.hasSize)
            ) {
        this.resultPass = true;
    }

    this.messages = [];
    if(this.forceUpperCase && !this.hasUpperCase) {
        this.messages.push('Requires uppercase');
    }
    if(this.forceLowerCase && !this.hasLowerCase) {
        this.messages.push('Requires lowercase');
    }
    if(this.forceNumber && !this.hasNumber) {
        this.messages.push('Requires number');
    }
    if(this.forceSpecialChar && !this.hasSpecialChar) {
        this.messages.push('Requires special character');
    }
    if(this.forceSize && !this.hasSize) {
        this.messages.push('Requires minimum ' + this.size + ' characters');
    }
    if(this.hasNotAllowedChar) {
        this.messages.push('Contains not allowed characters');
    }
    if(!this.resultPassRetype) {
        this.messages.push('Password and retype password don\'t match');
    }

    this.result = false;
    if(this.resultPass && this.resultPassRetype) {
        this.result = true;
        this.messages.push('Password is OK!');
    }

    var response = {
        "result" : this.result,
        "resultPass" : this.resultPass,
        "resultPassRetype" : this.resultPassRetype,
        "check" : {
            "hasUpperCase" : this.hasUpperCase,
            "hasLowerCase" : this.hasLowerCase,
            "hasNumber" : this.hasNumber,
            "hasSpecialChar" : this.hasSpecialChar,
            "hasSize" : this.hasSize,
            "hasNotAllowedChar" : this.hasNotAllowedChar,
            "passCheck" : this.resultPassRetype // remove
        },
        "messages" : this.messages
    };

    return response;
};


text:
/*global chrome, document, require, Promise, SETTINGS:true */
/*jslint devel: true, browser: true, nomen: true, maxlen: 90 */

var communicate,
    acom_analytics,
    utilities,
    started,
    startup = new Promise(function (resolve, reject) {
        'use strict';
        started = resolve;
    }),
    startupComplete = false;

// just in case it wasn't set by including settings.js
SETTINGS = SETTINGS || {USE_ACROBAT: true};

chrome.runtime.getPlatformInfo(function (info) {
    'use strict';
    SETTINGS.OS = info.os;
});

function registerActions(evt) {
    'use strict';
    function addQueryParam(list) {
        var list2 = list.splice(), i;
        for (i = 0; i < list.length; i += 1) {
            list2.push(list[i] + "?*");
        }
    }

    var web2pdf = function () { return communicate.getModule("acro-web2pdf"); },
        gstate = function () { return communicate.getModule("acro-gstate"); },
        i,
        context,
        title,
        link_id,
        contexts,
        pdfURL = ["*://*/*.pdf"],
        image_id,
        links = ["link"],
        images = ["image"],
        pdf_id,
        all = ["all"],
        flickr_id,
        toPDFURLs = [
            '*://*/*.ai',
            '*://*/*.bmp',
            '*://*/*.doc',
            '*://*/*.docx',
            '*://*/*.gif',
            '*://*/*.indd',
            '*://*/*.jpeg',
            '*://*/*.jpg',
            '*://*/*.odf',
            '*://*/*.odg',
            '*://*/*.odp',
            '*://*/*.ods',
            '*://*/*.odt',
            '*://*/*.png',
            '*://*/*.ppt',
            '*://*/*.pptx',
            '*://*/*.pptx',
            '*://*/*.ps',
            '*://*/*.psd',
            '*://*/*.pub',
            '*://*/*.rtf',
            '*://*/*.stw',
            '*://*/*.sxd',
            '*://*/*.sxc',
            '*://*/*.sxi',
            '*://*/*.sxw',
            '*://*/*.text',
            '*://*/*.tif',
            '*://*/*.tiff',
            '*://*/*.txt',
            '*://*/*.xls',
            '*://*/*.xlsx'
        ],
        allURLs = addQueryParam(toPDFURLs.concat(pdfURL));

    function checkOS() {
        chrome.runtime.getPlatformInfo(function (info) {
            var ver;

            SETTINGS.OS = info.os;
            SETTINGS.CHROME_VERSION = 0;
            SETTINGS.EXTENSION_VERSION = 0;
            try {
                ver = navigator.userAgent.match(/Chrome\/([0-9]+)/);
                if (ver) {
                    SETTINGS.CHROME_VERSION = +ver[1];
                }
            } catch (e1) {}
            try {
                SETTINGS.EXTENSION_VERSION = chrome.runtime.getManifest().version;
            } catch (e2) {}
            if (info.os === "mac") {
                acom_analytics.event(acom_analytics.e.OS_MAC_OP);
            } else if (info.os === "win") {
                acom_analytics.event(acom_analytics.e.OS_WIN_OP);
            }
        });
    }
    if (startupComplete) {
        return;
    }

    startupComplete = true;
    startup.then(
        function (analytics) {
            checkOS();
            if (!evt) {
                analytics.event(analytics.e.EXTENSION_STARTUP);
            } else {
                if (evt.reason === "update") {
                    analytics.event(analytics.e.EXTENSION_UPDATE);

                } else if (evt.reason === "install") {
                    analytics.event(analytics.e.EXTENSION_INSTALLED);
                }
            }
            chrome.browserAction.onClicked.addListener(function (tab) {
                communicate.echo(tab);
            });
        }
    );

    function getLocaleString(keyStr) {
        var str;
        if (!utilities || !utilities.getTranslation) {
            str = chrome.i18n.getMessage(keyStr);
        } else {
            str = utilities.getTranslation(keyStr);
        }
        return str;
    }

    function getTitle(tab) {
        var title = tab.title ||
            getLocaleString("web2pdfUntitledFileName");

        return title.replace(/[<>?:|\*"\/\\'&\.]/g, "");
    }

    function ConvertToPDFContextMenu(info, tab) {
        acom_analytics.event(acom_analytics.e.CONTEXT_MENU_CONVERT_PAGE);
        web2pdf().handleConversionRequest(
            {
                tabId       : tab.id,
                caller      : gstate().web2pdfCaller.MENU,
                action      : gstate().web2pdfAction.CONVERT,
                context     : gstate().web2pdfContext.PAGE,
                url         : info.pageUrl || tab.url,
                domtitle    : getTitle(tab)
            }
        );
    }

    function AppendToExistingPDFContextMenu(info, tab) {
        acom_analytics.event(acom_analytics.e.CONTEXT_MENU_APPEND_PAGE);
        web2pdf().handleConversionRequest(
            {
                tabId       : tab.id,
                caller      : gstate().web2pdfCaller.MENU,
                action      : gstate().web2pdfAction.APPEND,
                context     : gstate().web2pdfContext.PAGE,
                url         : info.pageUrl || tab.url,
                domtitle    : getTitle(tab)
            }
        );
    }

    function ConvertLinkTargetToPDFContextMenu(info, tab) {
        acom_analytics.event(acom_analytics.e.CONTEXT_MENU_CONVERT_LINK);
        web2pdf().handleConversionRequest(
            {
                tabId       : tab.id,
                caller      : gstate().web2pdfCaller.MENU,
                action      : gstate().web2pdfAction.CONVERT,
                context     : gstate().web2pdfContext.LINK,
                url         : info.linkUrl,
                domtitle    : getTitle(tab)
            }
        );
    }

    function AppendLinkTargetToExistingPDFContextMenu(info, tab) {
        acom_analytics.event(acom_analytics.e.CONTEXT_MENU_APPEND_LINK);
        web2pdf().handleConversionRequest(
            {
                tabId       : tab.id,
                caller      : gstate().web2pdfCaller.MENU,
                action      : gstate().web2pdfAction.APPEND,
                context     : gstate().web2pdfContext.LINK,
                url         : info.linkUrl,
                domtitle    : getTitle(tab)
            }
        );
    }

    if (SETTINGS.USE_ACROBAT) {
        /**
         * Create a context menus which will show up for page content.
         */
        chrome.contextMenus.create(
            {
                "title"     : getLocaleString("web2pdfConvertPageContextMenu"),
                "contexts"  : ["page"],
                "onclick"   : ConvertToPDFContextMenu
            }
        );
        chrome.contextMenus.create(
            {
                "title"     : getLocaleString("web2pdfAppendPageContextMenu"),
                "contexts"  : ["page"],
                "onclick"   : AppendToExistingPDFContextMenu
            }
        );

        /**
         * Create a context menus which will show up for links.
         */
        chrome.contextMenus.create(
            {
                "title": getLocaleString("web2pdfConvertLinkContextMenu"),
                "contexts": ["link"],
                "onclick": ConvertLinkTargetToPDFContextMenu
            }
        );
        chrome.contextMenus.create(
            {
                "title": getLocaleString("web2pdfAppendLinkContextMenu"),
                "contexts": ["link"],
                "onclick": AppendLinkTargetToExistingPDFContextMenu
            }
        );

    } else {
        title = "Adobe PDF";
        pdf_id = chrome.contextMenus.create(
            {
                "title": title,
                "contexts": all,
                "id": "pdf-page"
            }
        );
        chrome.contextMenus.create(
            {
                "title": "Upload PDF to acrobat.com",
                "contexts": all,
                "parentId": pdf_id,
                "id": "upload",
                documentUrlPatterns: pdfURL
            }
        );
        chrome.contextMenus.create(
            {
                "title": "Upload and export to Word/Excel/PowerPoint/Images",
                "contexts": all,
                "parentId": pdf_id,
                "id": "export",
                documentUrlPatterns: pdfURL
            }
        );
        chrome.contextMenus.create(
            {
                "title": "Upload link to acrobat.com",
                "contexts": links,
                "parentId": pdf_id,
                "id": "upload_link",
                targetUrlPatterns: allURLs
            }
        );
        chrome.contextMenus.create(
            {
                "title": "Upload image to acrobat.com",
                "contexts": images,
                "parentId": pdf_id,
                "id": "upload-image"
            }
        );

        chrome.contextMenus.create(
            {
                "title": "Create a Slideshow from a Flickr album",
                "contexts": all,
                "parentId": pdf_id,
                "id": "flickr-slideshow",
                documentUrlPatterns: ["*://www.flickr.com/*"]
            }
        );
        chrome.contextMenus.create(
            {
                "title": "Create a contact sheet from Flickr images",
                "contexts": all,
                "parentId": pdf_id,
                "id": "flickr-contact-sheet",
                documentUrlPatterns: ["*://www.flickr.com/*"]
            }
        );
    }
}

require([
    "communicate",
    "util",
    "upload",
    "download-manager",
    "analytics",
    "acro-gstate",
    "acro-actions",
    "acro-web2pdf",
    "session",
    "convert-to-zip"
], function (com,
              util,
              upload,
              downloadManager,
              analytics,
              acroGstate,
              acroActions,
              acroWeb2pdf) {
    'use strict';

    registerActions();
    function fte(analytics) {
        var fteURL = SETTINGS.OS === "mac" ?
                "data/js/options.html?os=mac" :
                "https://adobe.com/go/chromeextensionfirstlaunch";

        if (util.getCookie("fte") !== "false") {
            util.createTab(
                fteURL,
                function () {
                    util.setCookie("fte", "false", 3650);
                    analytics.event(analytics.e.FTE_LAUNCH);
                }
            );
        }
    }
    chrome.management.getSelf(
        function (env) {
            if (!analytics.s) {
                analytics.init(
                    env.version,
                    env.installType
                );
            }
            acroActions.getVersion(
                function versionResponse(ver) {
                    started(analytics);
                }
            );
            fte(analytics);
        }
    );

    acom_analytics = analytics;
    communicate = com;
    utilities = util;
    function contextMenuClick(info, tab) {
        var request = {
            filename: tab.title,
            tabId: tab.id,
            menuItem: info.menuItemId,
            handleResult: "preview"
        };
        if (info.menuItemId === "flickr-slideshow" ||
                info.menuItemId === "flickr-contact-sheet") {
            analytics.event(request, analytics.e.FLICKR_CONTEXT_CLICK);
            communicate.deferMessage({panel_op: "flickr", tabId: tab.id});
            return;
        }
        if (info.menuItemId === "upload-image") {
            analytics.setOp("Image");
            request.handleResult = "image_preview";
            request.url = info.srcUrl;
        }
        if (info.menuItemId === "upload_link") {
            analytics.setOp("Link");
            request.url = info.linkUrl;
        }
        if (info.menuItemId === "upload") {
            analytics.setOp("Link");
            request.url = info.linkUrl;
        }
        if (info.menuItemId === "pdf-page") {
            analytics.setOp("PdfPage");
            request.url = info.pageUrl;
        }
        if (request.filename.length > 20) {
            request.filename = request.filename.substring(0, 19);
        }
        if (info.linkUrl) {
            request.filename = info.linkUrl.split("/").splice(-1)[0].replace(/\?\S*/, "");
        } else if (info.srcUrl) {
            request.url = info.srcUrl;
            request.filename = info.srcUrl.split("/").splice(-1)[0].replace(/\?\S*/, "");
        }
        if (info.menuItemId === "export") {
            request.handleResult = "export";
        }

        downloadManager.proxy(downloadManager.do_upload(request));
    }
    if (!SETTINGS.USE_ACROBAT) {
        chrome.contextMenus.onClicked.addListener(contextMenuClick);
    }
    chrome.runtime.onMessage.addListener(communicate.proxy(communicate.handler));
});

chrome.runtime.onInstalled.addListener(registerActions);


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = require("fs");
const vm = require("vm");
const path = require("path");
const NodeTemplatePlugin = require('webpack/lib/node/NodeTemplatePlugin');
const NodeTargetPlugin = require('webpack/lib/node/NodeTargetPlugin');
const LoaderTargetPlugin = require('webpack/lib/LoaderTargetPlugin');
const SingleEntryPlugin = require('webpack/lib/SingleEntryPlugin');
class WebpackResourceLoader {
    constructor(_parentCompilation) {
        this._parentCompilation = _parentCompilation;
        this._uniqueId = 0;
        this._context = _parentCompilation.context;
    }
    _compile(filePath, _content) {
        const compilerName = `compiler(${this._uniqueId++})`;
        const outputOptions = { filename: filePath };
        const relativePath = path.relative(this._context || '', filePath);
        const childCompiler = this._parentCompilation.createChildCompiler(relativePath, outputOptions);
        childCompiler.context = this._context;
        childCompiler.apply(new NodeTemplatePlugin(outputOptions), new NodeTargetPlugin(), new SingleEntryPlugin(this._context, filePath), new LoaderTargetPlugin('node'));
        // Store the result of the parent compilation before we start the child compilation
        let assetsBeforeCompilation = Object.assign({}, this._parentCompilation.assets[outputOptions.filename]);
        // Fix for "Uncaught TypeError: __webpack_require__(...) is not a function"
        // Hot module replacement requires that every child compiler has its own
        // cache. @see https://github.com/ampedandwired/html-webpack-plugin/pull/179
        childCompiler.plugin('compilation', function (compilation) {
            if (compilation.cache) {
                if (!compilation.cache[compilerName]) {
                    compilation.cache[compilerName] = {};
                }
                compilation.cache = compilation.cache[compilerName];
            }
        });
        // Compile and return a promise
        return new Promise((resolve, reject) => {
            childCompiler.runAsChild((err, entries, childCompilation) => {
                // Resolve / reject the promise
                if (childCompilation && childCompilation.errors && childCompilation.errors.length) {
                    const errorDetails = childCompilation.errors.map(function (error) {
                        return error.message + (error.error ? ':\n' + error.error : '');
                    }).join('\n');
                    reject(new Error('Child compilation failed:\n' + errorDetails));
                }
                else if (err) {
                    reject(err);
                }
                else {
                    // Replace [hash] placeholders in filename
                    const outputName = this._parentCompilation.mainTemplate.applyPluginsWaterfall('asset-path', outputOptions.filename, {
                        hash: childCompilation.hash,
                        chunk: entries[0]
                    });
                    // Restore the parent compilation to the state like it was before the child compilation.
                    Object.keys(childCompilation.assets).forEach((fileName) => {
                        // If it wasn't there and it's a source file (absolute path) - delete it.
                        if (assetsBeforeCompilation[fileName] === undefined && path.isAbsolute(fileName)) {
                            delete this._parentCompilation.assets[fileName];
                        }
                        else {
                            // Otherwise, add it to the parent compilation.
                            this._parentCompilation.assets[fileName] = childCompilation.assets[fileName];
                        }
                    });
                    resolve({
                        // Hash of the template entry point.
                        hash: entries[0].hash,
                        // Output name.
                        outputName: outputName,
                        // Compiled code.
                        content: childCompilation.assets[outputName].source()
                    });
                }
            });
        });
    }
    _evaluate(fileName, source) {
        try {
            const vmContext = vm.createContext(Object.assign({ require: require }, global));
            const vmScript = new vm.Script(source, { filename: fileName });
            // Evaluate code and cast to string
            let newSource;
            newSource = vmScript.runInContext(vmContext);
            if (typeof newSource == 'string') {
                return Promise.resolve(newSource);
            }
            return Promise.reject('The loader "' + fileName + '" didn\'t return a string.');
        }
        catch (e) {
            return Promise.reject(e);
        }
    }
    get(filePath) {
        return this._compile(filePath, fs_1.readFileSync(filePath, 'utf8'))
            .then((result) => this._evaluate(result.outputName, result.content));
    }
}
exports.WebpackResourceLoader = WebpackResourceLoader;
//# sourceMappingURL=/users/hansl/sources/angular-cli/src/resource_loader.js.map