text:
/**
 * @file
 *   This file implements MeshCoP Datasets manager to process commands.
 *
 */

#include "dataset_manager.hpp"

#include <stdio.h>

#include "common/instance.hpp"
#include "common/locator-getters.hpp"
#include "common/logging.hpp"
#include "meshcop/meshcop.hpp"
#include "meshcop/meshcop_tlvs.hpp"
#include "radio/radio.hpp"
#include "thread/thread_netif.hpp"
#include "thread/thread_tlvs.hpp"
#include "thread/thread_uri_paths.hpp"

namespace ot {
namespace MeshCoP {

DatasetManager::DatasetManager(Instance &      aInstance,
                               const Tlv::Type aType,
                               const char *    aUriGet,
                               const char *    aUriSet,
                               Timer::Handler  aTimerHandler)
    : InstanceLocator(aInstance)
    , mLocal(aInstance, aType)
    , mTimestampValid(false)
    , mTimer(aInstance, aTimerHandler, this)
    , mUriGet(aUriGet)
    , mUriSet(aUriSet)
{
    mTimestamp.Init();
}

const Timestamp *DatasetManager::GetTimestamp(void) const
{
    return mTimestampValid ? &mTimestamp : NULL;
}

int DatasetManager::Compare(const Timestamp &aTimestamp) const
{
    const Timestamp *timestamp = GetTimestamp();
    int              rval      = 1;

    if (timestamp)
    {
        rval = timestamp->Compare(aTimestamp);
    }

    return rval;
}

otError DatasetManager::Restore(void)
{
    otError          error;
    Dataset          dataset(mLocal.GetType());
    const Timestamp *timestamp;

    mTimer.Stop();

    mTimestampValid = false;

    SuccessOrExit(error = mLocal.Restore(dataset));

    timestamp = dataset.GetTimestamp();

    if (timestamp != NULL)
    {
        mTimestamp      = *timestamp;
        mTimestampValid = true;
    }

    if (mLocal.GetType() == Tlv::kActiveTimestamp)
    {
        dataset.ApplyConfiguration(GetInstance());
    }

exit:
    return error;
}

otError DatasetManager::ApplyConfiguration(void) const
{
    otError error;
    Dataset dataset(mLocal.GetType());

    SuccessOrExit(error = mLocal.Read(dataset));
    SuccessOrExit(error = dataset.ApplyConfiguration(GetInstance()));

exit:
    return error;
}

void DatasetManager::Clear(void)
{
    mTimestamp.Init();
    mTimestampValid = false;
    mLocal.Clear();
    mTimer.Stop();
}

void DatasetManager::HandleDetach(void)
{
    Restore();
}

otError DatasetManager::Save(const Dataset &aDataset)
{
    otError          error = OT_ERROR_NONE;
    const Timestamp *timestamp;
    int              compare;
    bool             isMasterkeyUpdated = false;

    timestamp = aDataset.GetTimestamp();

    if (timestamp != NULL)
    {
        mTimestamp      = *timestamp;
        mTimestampValid = true;

        if (mLocal.GetType() == Tlv::kActiveTimestamp)
        {
            SuccessOrExit(error = aDataset.ApplyConfiguration(GetInstance(), &isMasterkeyUpdated));
        }
    }

    compare = mLocal.Compare(timestamp);

    if (isMasterkeyUpdated || compare > 0)
    {
        mLocal.Save(aDataset);

#if OPENTHREAD_FTD
        if (Get<Mle::MleRouter>().GetRole() == OT_DEVICE_ROLE_LEADER)
        {
            Get<NetworkData::Leader>().IncrementVersion();
            Get<NetworkData::Leader>().IncrementStableVersion();
        }
#endif
    }
    else if (compare < 0)
    {
        mTimer.Start(1000);
    }

exit:
    return error;
}

otError DatasetManager::Save(const otOperationalDataset &aDataset)
{
    otError error = OT_ERROR_NONE;

    SuccessOrExit(error = mLocal.Save(aDataset));

    switch (Get<Mle::MleRouter>().GetRole())
    {
    case OT_DEVICE_ROLE_DISABLED:
        Restore();
        break;

    case OT_DEVICE_ROLE_CHILD:
        mTimer.Start(1000);
        break;
#if OPENTHREAD_FTD
    case OT_DEVICE_ROLE_ROUTER:
        mTimer.Start(1000);
        break;

    case OT_DEVICE_ROLE_LEADER:
        Restore();
        Get<NetworkData::Leader>().IncrementVersion();
        Get<NetworkData::Leader>().IncrementStableVersion();
        break;
#endif

    default:
        break;
    }

exit:
    return error;
}

otError DatasetManager::GetChannelMask(Mac::ChannelMask &aChannelMask) const
{
    otError                        error;
    const MeshCoP::ChannelMaskTlv *channelMaskTlv;
    uint32_t                       mask;
    Dataset                        dataset(mLocal.GetType());

    SuccessOrExit(error = mLocal.Read(dataset));

    channelMaskTlv = static_cast<const MeshCoP::ChannelMaskTlv *>(dataset.Get(MeshCoP::Tlv::kChannelMask));
    VerifyOrExit(channelMaskTlv != NULL, error = OT_ERROR_NOT_FOUND);
    VerifyOrExit((mask = channelMaskTlv->GetChannelMask()) != 0);

    aChannelMask.SetMask(mask & Get<Mac::Mac>().GetSupportedChannelMask().GetMask());

    VerifyOrExit(!aChannelMask.IsEmpty(), error = OT_ERROR_NOT_FOUND);

exit:
    return error;
}

void DatasetManager::HandleTimer(void)
{
    VerifyOrExit(Get<Mle::MleRouter>().IsAttached());

    VerifyOrExit(mLocal.Compare(GetTimestamp()) < 0);

    if (mLocal.GetType() == Tlv::kActiveTimestamp)
    {
        Dataset dataset(Tlv::kPendingTimestamp);
        Get<PendingDataset>().Read(dataset);

        const ActiveTimestampTlv *tlv = static_cast<const ActiveTimestampTlv *>(dataset.Get(Tlv::kActiveTimestamp));
        const Timestamp *         pendingActiveTimestamp = static_cast<const Timestamp *>(tlv);

        if (pendingActiveTimestamp != NULL && mLocal.Compare(pendingActiveTimestamp) == 0)
        {
            // stop registration attempts during dataset transition
            ExitNow();
        }
    }

    Register();
    mTimer.Start(1000);

exit:
    return;
}

otError DatasetManager::Register(void)
{
    otError          error = OT_ERROR_NONE;
    Coap::Message *  message;
    Ip6::MessageInfo messageInfo;
    Dataset          dataset(mLocal.GetType());

    VerifyOrExit((message = NewMeshCoPMessage(Get<Coap::Coap>())) != NULL, error = OT_ERROR_NO_BUFS);

    SuccessOrExit(error = message->Init(OT_COAP_TYPE_CONFIRMABLE, OT_COAP_CODE_POST, mUriSet));
    SuccessOrExit(error = message->SetPayloadMarker());

    mLocal.Read(dataset);
    SuccessOrExit(error = message->Append(dataset.GetBytes(), dataset.GetSize()));

    messageInfo.SetSockAddr(Get<Mle::MleRouter>().GetMeshLocal16());
    Get<Mle::MleRouter>().GetLeaderAloc(messageInfo.GetPeerAddr());
    messageInfo.SetPeerPort(kCoapUdpPort);
    SuccessOrExit(error = Get<Coap::Coap>().SendMessage(*message, messageInfo));

    otLogInfoMeshCoP("sent dataset to leader");

exit:

    if (error != OT_ERROR_NONE && message != NULL)
    {
        message->Free();
    }

    return error;
}

void DatasetManager::HandleGet(const Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo) const
{
    Tlv      tlv;
    uint16_t offset = aMessage.GetOffset();
    uint8_t  tlvs[Dataset::kMaxSize];
    uint8_t  length = 0;

    while (offset < aMessage.GetLength())
    {
        aMessage.Read(offset, sizeof(tlv), &tlv);

        if (tlv.GetType() == Tlv::kGet)
        {
            length = tlv.GetLength();
            aMessage.Read(offset + sizeof(Tlv), length, tlvs);
            break;
        }

        offset += sizeof(tlv) + tlv.GetLength();
    }

    // MGMT_PENDING_GET.rsp must include Delay Timer TLV (Thread 1.1.1 Section 8.7.5.4)
    if (length != 0 && strcmp(mUriGet, OT_URI_PATH_PENDING_GET) == 0)
    {
        uint16_t i;

        for (i = 0; i < length; i++)
        {
            if (tlvs[i] == Tlv::kDelayTimer)
            {
                break;
            }
        }

        if (i == length && (i + 1u) <= sizeof(tlvs))
        {
            tlvs[length++] = Tlv::kDelayTimer;
        }
    }

    SendGetResponse(aMessage, aMessageInfo, tlvs, length);
}

void DatasetManager::SendGetResponse(const Coap::Message &   aRequest,
                                     const Ip6::MessageInfo &aMessageInfo,
                                     uint8_t *               aTlvs,
                                     uint8_t                 aLength) const
{
    otError        error = OT_ERROR_NONE;
    Coap::Message *message;
    Dataset        dataset(mLocal.GetType());

    mLocal.Read(dataset);

    VerifyOrExit((message = NewMeshCoPMessage(Get<Coap::Coap>())) != NULL, error = OT_ERROR_NO_BUFS);

    SuccessOrExit(error = message->SetDefaultResponseHeader(aRequest));
    SuccessOrExit(error = message->SetPayloadMarker());

    if (aLength == 0)
    {
        const Tlv *cur = reinterpret_cast<const Tlv *>(dataset.GetBytes());
        const Tlv *end = reinterpret_cast<const Tlv *>(dataset.GetBytes() + dataset.GetSize());

        while (cur < end)
        {
            if (cur->GetType() != Tlv::kNetworkMasterKey ||
                (Get<KeyManager>().GetSecurityPolicyFlags() & OT_SECURITY_POLICY_OBTAIN_MASTER_KEY))
            {
                SuccessOrExit(error = message->AppendTlv(*cur));
            }

            cur = cur->GetNext();
        }
    }
    else
    {
        for (uint8_t index = 0; index < aLength; index++)
        {
            const Tlv *tlv;

            if (aTlvs[index] == Tlv::kNetworkMasterKey &&
                !(Get<KeyManager>().GetSecurityPolicyFlags() & OT_SECURITY_POLICY_OBTAIN_MASTER_KEY))
            {
                continue;
            }

            if ((tlv = dataset.Get(static_cast<Tlv::Type>(aTlvs[index]))) != NULL)
            {
                SuccessOrExit(error = message->AppendTlv(*tlv));
            }
        }
    }

    if (message->GetLength() == message->GetOffset())
    {
        // no payload, remove coap payload marker
        message->SetLength(message->GetLength() - 1);
    }

    SuccessOrExit(error = Get<Coap::Coap>().SendMessage(*message, aMessageInfo));

    otLogInfoMeshCoP("sent dataset get response");

exit:

    if (error != OT_ERROR_NONE && message != NULL)
    {
        message->Free();
    }
}

otError DatasetManager::SendSetRequest(const otOperationalDataset &aDataset, const uint8_t *aTlvs, uint8_t aLength)
{
    otError          error = OT_ERROR_NONE;
    Coap::Message *  message;
    Ip6::MessageInfo messageInfo;

    VerifyOrExit((message = NewMeshCoPMessage(Get<Coap::Coap>())) != NULL, error = OT_ERROR_NO_BUFS);

    SuccessOrExit(error = message->Init(OT_COAP_TYPE_CONFIRMABLE, OT_COAP_CODE_POST, mUriSet));
    SuccessOrExit(error = message->SetPayloadMarker());

#if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE && OPENTHREAD_FTD

    if (Get<Commissioner>().IsActive())
    {
        const Tlv *cur          = reinterpret_cast<const Tlv *>(aTlvs);
        const Tlv *end          = reinterpret_cast<const Tlv *>(aTlvs + aLength);
        bool       hasSessionId = false;

        for (; cur < end; cur = cur->GetNext())
        {
            VerifyOrExit((cur + 1) <= end, error = OT_ERROR_INVALID_ARGS);

            if (cur->GetType() == Tlv::kCommissionerSessionId)
            {
                hasSessionId = true;
                break;
            }
        }

        if (!hasSessionId)
        {
            CommissionerSessionIdTlv sessionId;
            sessionId.Init();
            sessionId.SetCommissionerSessionId(Get<Commissioner>().GetSessionId());
            SuccessOrExit(error = message->AppendTlv(sessionId));
        }
    }

#endif // OPENTHREAD_CONFIG_COMMISSIONER_ENABLE && OPENTHREAD_FTD

    if (aDataset.mComponents.mIsActiveTimestampPresent)
    {
        ActiveTimestampTlv timestamp;
        timestamp.Init();
        static_cast<Timestamp *>(&timestamp)->SetSeconds(aDataset.mActiveTimestamp);
        static_cast<Timestamp *>(&timestamp)->SetTicks(0);
        SuccessOrExit(error = message->AppendTlv(timestamp));
    }

    if (aDataset.mComponents.mIsPendingTimestampPresent)
    {
        PendingTimestampTlv timestamp;
        timestamp.Init();
        static_cast<Timestamp *>(&timestamp)->SetSeconds(aDataset.mPendingTimestamp);
        static_cast<Timestamp *>(&timestamp)->SetTicks(0);
        SuccessOrExit(error = message->AppendTlv(timestamp));
    }

    if (aDataset.mComponents.mIsMasterKeyPresent)
    {
        NetworkMasterKeyTlv masterkey;
        masterkey.Init();
        masterkey.SetNetworkMasterKey(static_cast<const MasterKey &>(aDataset.mMasterKey));
        SuccessOrExit(error = message->AppendTlv(masterkey));
    }

    if (aDataset.mComponents.mIsNetworkNamePresent)
    {
        NetworkNameTlv networkname;
        networkname.Init();
        networkname.SetNetworkName(aDataset.mNetworkName.m8);
        SuccessOrExit(error = message->AppendTlv(networkname));
    }

    if (aDataset.mComponents.mIsExtendedPanIdPresent)
    {
        ExtendedPanIdTlv extpanid;
        extpanid.Init();
        extpanid.SetExtendedPanId(static_cast<const Mac::ExtendedPanId &>(aDataset.mExtendedPanId));
        SuccessOrExit(error = message->AppendTlv(extpanid));
    }

    if (aDataset.mComponents.mIsMeshLocalPrefixPresent)
    {
        MeshLocalPrefixTlv localprefix;
        localprefix.Init();
        localprefix.SetMeshLocalPrefix(aDataset.mMeshLocalPrefix);
        SuccessOrExit(error = message->AppendTlv(localprefix));
    }

    if (aDataset.mComponents.mIsDelayPresent)
    {
        DelayTimerTlv delaytimer;
        delaytimer.Init();
        delaytimer.SetDelayTimer(aDataset.mDelay);
        SuccessOrExit(error = message->AppendTlv(delaytimer));
    }

    if (aDataset.mComponents.mIsPanIdPresent)
    {
        PanIdTlv panid;
        panid.Init();
        panid.SetPanId(aDataset.mPanId);
        SuccessOrExit(error = message->AppendTlv(panid));
    }

    if (aDataset.mComponents.mIsChannelPresent)
    {
        ChannelTlv channel;
        channel.Init();
        channel.SetChannel(aDataset.mChannel);
        SuccessOrExit(error = message->AppendTlv(channel));
    }

    if (aDataset.mComponents.mIsChannelMaskPresent)
    {
        ChannelMaskTlv channelMask;
        channelMask.Init();
        channelMask.SetChannelMask(aDataset.mChannelMask);
        SuccessOrExit(error = message->AppendTlv(channelMask));
    }

    if (aLength > 0)
    {
        SuccessOrExit(error = message->Append(aTlvs, aLength));
    }

    if (message->GetLength() == message->GetOffset())
    {
        // no payload, remove coap payload marker
        message->SetLength(message->GetLength() - 1);
    }

    messageInfo.SetSockAddr(Get<Mle::MleRouter>().GetMeshLocal16());
    Get<Mle::MleRouter>().GetLeaderAloc(messageInfo.GetPeerAddr());
    messageInfo.SetPeerPort(kCoapUdpPort);
    SuccessOrExit(error = Get<Coap::Coap>().SendMessage(*message, messageInfo));

    otLogInfoMeshCoP("sent dataset set request to leader");

exit:

    if (error != OT_ERROR_NONE && message != NULL)
    {
        message->Free();
    }

    return error;
}

otError DatasetManager::SendGetRequest(const otOperationalDatasetComponents &aDatasetComponents,
                                       const uint8_t *                       aTlvTypes,
                                       uint8_t                               aLength,
                                       const otIp6Address *                  aAddress) const
{
    otError          error = OT_ERROR_NONE;
    Coap::Message *  message;
    Ip6::MessageInfo messageInfo;
    Tlv              tlv;
    uint8_t          datasetTlvs[kMaxDatasetTlvs];
    uint8_t          length;

    length = 0;

    if (aDatasetComponents.mIsActiveTimestampPresent)
    {
        datasetTlvs[length++] = Tlv::kActiveTimestamp;
    }

    if (aDatasetComponents.mIsPendingTimestampPresent)
    {
        datasetTlvs[length++] = Tlv::kPendingTimestamp;
    }

    if (aDatasetComponents.mIsMasterKeyPresent)
    {
        datasetTlvs[length++] = Tlv::kNetworkMasterKey;
    }

    if (aDatasetComponents.mIsNetworkNamePresent)
    {
        datasetTlvs[length++] = Tlv::kNetworkName;
    }

    if (aDatasetComponents.mIsExtendedPanIdPresent)
    {
        datasetTlvs[length++] = Tlv::kExtendedPanId;
    }

    if (aDatasetComponents.mIsMeshLocalPrefixPresent)
    {
        datasetTlvs[length++] = Tlv::kMeshLocalPrefix;
    }

    if (aDatasetComponents.mIsDelayPresent)
    {
        datasetTlvs[length++] = Tlv::kDelayTimer;
    }

    if (aDatasetComponents.mIsPanIdPresent)
    {
        datasetTlvs[length++] = Tlv::kPanId;
    }

    if (aDatasetComponents.mIsChannelPresent)
    {
        datasetTlvs[length++] = Tlv::kChannel;
    }

    if (aDatasetComponents.mIsPskcPresent)
    {
        datasetTlvs[length++] = Tlv::kPskc;
    }

    if (aDatasetComponents.mIsSecurityPolicyPresent)
    {
        datasetTlvs[length++] = Tlv::kSecurityPolicy;
    }

    if (aDatasetComponents.mIsChannelMaskPresent)
    {
        datasetTlvs[length++] = Tlv::kChannelMask;
    }

    VerifyOrExit((message = NewMeshCoPMessage(Get<Coap::Coap>())) != NULL, error = OT_ERROR_NO_BUFS);

    SuccessOrExit(error = message->Init(OT_COAP_TYPE_CONFIRMABLE, OT_COAP_CODE_POST, mUriGet));

    if (aLength + length > 0)
    {
        SuccessOrExit(error = message->SetPayloadMarker());
    }

    if (aLength + length > 0)
    {
        tlv.SetType(Tlv::kGet);
        tlv.SetLength(aLength + length);
        SuccessOrExit(error = message->Append(&tlv, sizeof(tlv)));

        if (length > 0)
        {
            SuccessOrExit(error = message->Append(datasetTlvs, length));
        }

        if (aLength > 0)
        {
            SuccessOrExit(error = message->Append(aTlvTypes, aLength));
        }
    }

    if (aAddress != NULL)
    {
        messageInfo.SetPeerAddr(*static_cast<const Ip6::Address *>(aAddress));
    }
    else
    {
        Get<Mle::MleRouter>().GetLeaderAloc(messageInfo.GetPeerAddr());
    }

    messageInfo.SetSockAddr(Get<Mle::MleRouter>().GetMeshLocal16());
    messageInfo.SetPeerPort(kCoapUdpPort);
    SuccessOrExit(error = Get<Coap::Coap>().SendMessage(*message, messageInfo));

    otLogInfoMeshCoP("sent dataset get request");

exit:

    if (error != OT_ERROR_NONE && message != NULL)
    {
        message->Free();
    }

    return error;
}

ActiveDataset::ActiveDataset(Instance &aInstance)
    : DatasetManager(aInstance,
                     Tlv::kActiveTimestamp,
                     OT_URI_PATH_ACTIVE_GET,
                     OT_URI_PATH_ACTIVE_SET,
                     &ActiveDataset::HandleTimer)
    , mResourceGet(OT_URI_PATH_ACTIVE_GET, &ActiveDataset::HandleGet, this)
#if OPENTHREAD_FTD
    , mResourceSet(OT_URI_PATH_ACTIVE_SET, &ActiveDataset::HandleSet, this)
#endif
{
    Get<Coap::Coap>().AddResource(mResourceGet);
}

bool ActiveDataset::IsPartiallyComplete(void) const
{
    return mLocal.IsSaved() && !mTimestampValid;
}

otError ActiveDataset::Save(const Timestamp &aTimestamp, const Message &aMessage, uint16_t aOffset, uint8_t aLength)
{
    otError error = OT_ERROR_NONE;
    Dataset dataset(mLocal.GetType());

    SuccessOrExit(error = dataset.Set(aMessage, aOffset, aLength));
    dataset.SetTimestamp(aTimestamp);
    DatasetManager::Save(dataset);

exit:
    return error;
}

void ActiveDataset::HandleGet(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
    static_cast<ActiveDataset *>(aContext)->HandleGet(*static_cast<Coap::Message *>(aMessage),
                                                      *static_cast<const Ip6::MessageInfo *>(aMessageInfo));
}

void ActiveDataset::HandleGet(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo) const
{
    DatasetManager::HandleGet(aMessage, aMessageInfo);
}

void ActiveDataset::HandleTimer(Timer &aTimer)
{
    aTimer.GetOwner<ActiveDataset>().HandleTimer();
}

PendingDataset::PendingDataset(Instance &aInstance)
    : DatasetManager(aInstance,
                     Tlv::kPendingTimestamp,
                     OT_URI_PATH_PENDING_GET,
                     OT_URI_PATH_PENDING_SET,
                     &PendingDataset::HandleTimer)
    , mDelayTimer(aInstance, &PendingDataset::HandleDelayTimer, this)
    , mResourceGet(OT_URI_PATH_PENDING_GET, &PendingDataset::HandleGet, this)
#if OPENTHREAD_FTD
    , mResourceSet(OT_URI_PATH_PENDING_SET, &PendingDataset::HandleSet, this)
#endif
{
    Get<Coap::Coap>().AddResource(mResourceGet);
}

void PendingDataset::Clear(void)
{
    DatasetManager::Clear();
    mDelayTimer.Stop();
}

void PendingDataset::ClearNetwork(void)
{
    Dataset dataset(mLocal.GetType());

    mTimestamp.Init();
    mTimestampValid = false;
    DatasetManager::Save(dataset);
}

otError PendingDataset::Save(const otOperationalDataset &aDataset)
{
    otError error = OT_ERROR_NONE;

    SuccessOrExit(error = DatasetManager::Save(aDataset));
    StartDelayTimer();

exit:
    return error;
}

otError PendingDataset::Save(const Timestamp &aTimestamp, const Message &aMessage, uint16_t aOffset, uint8_t aLength)
{
    otError error = OT_ERROR_NONE;
    Dataset dataset(mLocal.GetType());

    SuccessOrExit(error = dataset.Set(aMessage, aOffset, aLength));
    dataset.SetTimestamp(aTimestamp);
    DatasetManager::Save(dataset);
    StartDelayTimer();

exit:
    return error;
}

void PendingDataset::StartDelayTimer(void)
{
    DelayTimerTlv *delayTimer;
    Dataset        dataset(mLocal.GetType());

    mLocal.Read(dataset);

    mDelayTimer.Stop();

    if ((delayTimer = static_cast<DelayTimerTlv *>(dataset.Get(Tlv::kDelayTimer))) != NULL)
    {
        uint32_t delay = delayTimer->GetDelayTimer();

        // the Timer implementation does not support the full 32 bit range
        if (delay > Timer::kMaxDt)
        {
            delay = Timer::kMaxDt;
        }

        mDelayTimer.StartAt(dataset.GetUpdateTime(), delay);
        otLogInfoMeshCoP("delay timer started %d", delay);
    }
}

void PendingDataset::HandleDelayTimer(Timer &aTimer)
{
    aTimer.GetOwner<PendingDataset>().HandleDelayTimer();
}

void PendingDataset::HandleDelayTimer(void)
{
    DelayTimerTlv *delayTimer;
    Dataset        dataset(mLocal.GetType());

    mLocal.Read(dataset);

    // if the Delay Timer value is larger than what our Timer implementation can handle, we have to compute
    // the remainder and wait some more.
    if ((delayTimer = static_cast<DelayTimerTlv *>(dataset.Get(Tlv::kDelayTimer))) != NULL)
    {
        uint32_t elapsed = mDelayTimer.GetFireTime() - dataset.GetUpdateTime();
        uint32_t delay   = delayTimer->GetDelayTimer();

        if (elapsed < delay)
        {
            mDelayTimer.StartAt(mDelayTimer.GetFireTime(), delay - elapsed);
            ExitNow();
        }
    }

    otLogInfoMeshCoP("pending delay timer expired");

    dataset.ConvertToActive();

    Get<ActiveDataset>().Save(dataset);

    Clear();

exit:
    return;
}

void PendingDataset::HandleGet(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
{
    static_cast<PendingDataset *>(aContext)->HandleGet(*static_cast<Coap::Message *>(aMessage),
                                                       *static_cast<const Ip6::MessageInfo *>(aMessageInfo));
}

void PendingDataset::HandleGet(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo) const
{
    DatasetManager::HandleGet(aMessage, aMessageInfo);
}

void PendingDataset::HandleTimer(Timer &aTimer)
{
    aTimer.GetOwner<PendingDataset>().HandleTimer();
}

} // namespace MeshCoP
} // namespace ot


text:
package mujava.cli;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
 /**
 * <p>
 * Description: The Class doRandomGivenMutationOperator.
 * Overview: This class is used to calculate mutation scores
 * based on randomly generated adequate test set of given mutation operators.
 * Experiment use only.
 * </p>
 *
 * @author Lin Deng
 * @version 1.0  $Date: 06/10/2014 $
  */

public class doRandomGivenMutationOperator {

	/**
	 * The main method.
	 *
	 * @param args
	 *            the arguments
	 * @throws IOException
	 *             Signals that an I/O exception has occurred.
	 */
	public static void main(String[] args) throws IOException {
		// need result file name
//		String[] argv = { "/Users/dmark/COVDLsExpCopy/Triangle/result_list_2014_7_22_11_13_35.csv", "twoPred", "CDL", "10",
//				"/Users/dmark/COVDLsExpCopy/Triangle/" };
		String path = args[0];
		String target = args[2];

		int numOfRandom = Integer.valueOf(args[3]);
		if (numOfRandom < 1) {
			System.out.println("need more random times");
			return;
		}

		String resultPath = args[4];

		ArrayList<String> targets = new ArrayList<>();

		// used for getting results
		// if no target is selected, randomly take one test

//		targets.add("SDL");
//		targets.add("ODL");
//		targets.add("VDL");
//		targets.add("CDL");
//		targets.add("SDL");targets.add("ODL");
//		targets.add("SDL");targets.add("VDL");
//		targets.add("SDL");targets.add("CDL");
//		targets.add("VDL");targets.add("CDL");
//		targets.add("SDL");targets.add("VDL");targets.add("CDL");

		// read in file into data structure
		HashMap<String, ArrayList<String>> result = readResultsFromFile(path);
		// get all tests names
		ArrayList<String> testNames = result.get("Mutant");

		// need a filtered map based on target
		HashMap<String, ArrayList<String>> filtered_data = getFilteredDataBasedOnTargets(result, targets);

		// get the adequate test set
//		CopyOnWriteArrayList<ArrayList<String>> adequateTestSet = getAdequateTestSets4(filtered_data, testNames);
		// randomly get N adequate test set
		ArrayList<ArrayList<String>> randomedTestSet = new ArrayList<>();
		for(int i = 0; i < numOfRandom; i++)
		{
			randomedTestSet.add(getAdequateTestSets4(filtered_data, testNames));
		}

		// calculate each one with mutation score
		ArrayList<Pair> mutationScores = getMutationScores(randomedTestSet, path);
		double totalMS = 0.0;
		for (Pair ms : mutationScores)
		{
			System.out.println(ms.testSet + ": " + ms.mutationScore);
			totalMS=totalMS+ms.mutationScore;
		}
		double avgMS = totalMS / mutationScores.size();
		System.out.println("avg: " + avgMS);

		// write files
		writeResultToFiles(mutationScores, resultPath, targets);

	}

	/**
	 * Write result to files.
	 *
	 * @param mutationScores the mutation scores
	 * @param resultPath the result path
	 * @param targets the targets
	 * @throws UnsupportedEncodingException the unsupported encoding exception
	 * @throws IOException Signals that an I/O exception has occurred.
	 */
	private static void writeResultToFiles(ArrayList<Pair> mutationScores, String resultPath, ArrayList<String> targets)
			throws UnsupportedEncodingException, IOException {

		resultPath=resultPath+"ResultOfRandomAdequateTests_"+targets+".txt";
		// set the output file
		File file = new File(resultPath);

		FileOutputStream fout = new FileOutputStream(file);
		StringBuffer fileContent = new StringBuffer();

		double totalMS = 0.0;
		for (Pair pair : mutationScores) {
			totalMS = totalMS + pair.mutationScore;
			fileContent.append(pair.testSet + ": " + pair.mutationScore);
			fileContent.append("\r\n");
		}
		double avgMS = totalMS / mutationScores.size();
		fileContent.append("Avg: " + avgMS);

		fout.write(fileContent.toString().getBytes("utf-8"));
		fout.close();

	}

	/**
	 * Gets the filtered data based on targets.
	 *
	 * @param result
	 *            the result
	 * @param targets
	 *            the targets
	 * @return the filtered data based on targets
	 */
	private static HashMap<String, ArrayList<String>> getFilteredDataBasedOnTargets(
			HashMap<String, ArrayList<String>> result, ArrayList<String> targets) {
		HashMap<String, ArrayList<String>> filtered_data = new HashMap<String, ArrayList<String>>();

		for (String target : targets) {
			for (Object key : result.keySet()) {
				if (key.toString().contains(target))
					filtered_data.put(key.toString(), result.get(key));

			}
		}
		return filtered_data;
	}

	/**
	 * Read results from file. Note: This result include the fist title line.
	 * e.g. {VDL_3=[, 1, 1, 1, 2], Mutant=[test4, test1, test2, test3, Total,
	 * Equiv?], VDL_4=[1, 1, 1, , 3, y], VDL_5=[1, , 1, , 2]}
	 *
	 * @param path
	 *            the path
	 * @return the hash map
	 * @throws IOException
	 *             Signals that an I/O exception has occurred.
	 */
	private static HashMap<String, ArrayList<String>> readResultsFromFile(String path) throws IOException {
		// read the file
		File f = new File(path);
		if (!f.exists()) {
			System.out.println("Can't find file at: " + path);
			return null;
		}
		// read in file into data structure
		HashMap<String, ArrayList<String>> result = new HashMap<>();

		String s = null;
		StringBuffer sb = new StringBuffer();
		BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
		while ((s = br.readLine()) != null) {
			// split line
			List<String> tests = Arrays.asList(s.split(",\\s*"));
			// System.out.println(tests.get(1));
			ArrayList<String> list = new ArrayList<>();
			for (int i = 1; i < tests.size(); i++) {
				list.add(tests.get(i));
			}
			result.put(tests.get(0), list);
		}

		return result;
	}

	/**
	 * Gets the mutation scores.
	 *
	 * @param randomedTestSet            the randomed test set
	 * @param path the path
	 * @return the mutation scores
	 * @throws IOException Signals that an I/O exception has occurred.
	 */
	private static ArrayList<Pair> getMutationScores(ArrayList<ArrayList<String>> randomedTestSet, String path)
			throws IOException {

		// read in file into data structure, this result includes title line
		HashMap<String, ArrayList<String>> result = readResultsFromFile(path);

		// get all tests names
		ArrayList<String> testNames = result.get("Mutant");

		// build result with names, i.e. VDL_3=[test1, test2, test3],
		// VDL_4=[test4, test1, test2], VDL_5=[test4, test2]
		HashMap<String, ArrayList<String>> resultWithTestNames = getResultsWithNames(result);

		// calculate
		// get total number
		int totalNumOfMutants = resultWithTestNames.size();

		// get equiv number
		int numOfEq = 0;
		for (Object key : result.keySet()) {
			if (result.get(key).contains("y") || result.get(key).contains("Y")) // has
																				// an
																				// equiv
			{
				numOfEq++;
			}
		}

		ArrayList<Pair> mutationScores = new ArrayList<>();
		// get killed number
		// for each test test set, calculate how many killed mutants
		for (ArrayList<String> tests : randomedTestSet) {
			int numOfKilledMutants = 0;
			for (Object key : resultWithTestNames.keySet()) // for each mutant
			{
				for (String test : tests) // for each test in current test set
				{
					if (resultWithTestNames.get(key).contains(test)) // current
																		// test
																		// kills
																		// current
																		// mutant
					{
						numOfKilledMutants++;
						break; // directly go to the next mutant
					}
				}
			}

			// save mutation score
			double ms = (double)numOfKilledMutants / (double)(totalNumOfMutants - numOfEq);
			mutationScores.add(new Pair(tests, ms));
		}

		return mutationScores;
	}

	/**
	 * Gets the results with names.
	 *
	 * @param result the result
	 * @return the results with names
	 */
	private static HashMap<String, ArrayList<String>> getResultsWithNames(HashMap<String, ArrayList<String>> result) {
		// get all tests names
		ArrayList<String> testNames = result.get("Mutant");

		// build result with names
		HashMap<String, ArrayList<String>> resultWithTestNames = new HashMap<>();
		HashMap<String, Integer> resultStat = new HashMap<>();

		for (Object key : result.keySet()) {
			ArrayList<String> temp = result.get(key);
			ArrayList<String> testStrings = new ArrayList<>();
			for (int i = 0; i < temp.size(); i++) {
				if (temp.get(i).equals("1") && !testNames.get(i).equals("Total")) // current test kills the current
												// mutant
				{
					testStrings.add(testNames.get(i));
					if (resultStat.containsKey(testNames.get(i)))
						resultStat.put(testNames.get(i), resultStat.get(testNames.get(i)) + 1);
					else {
						resultStat.put(testNames.get(i), 1);
					}
				}
			}
			if (!key.toString().equals("Mutant"))
				resultWithTestNames.put(key.toString(), testStrings);
		}
		return resultWithTestNames;
	}

	/**
	 * Gets the adequate test sets.
	 *
	 * @param filtered_data the filtered_data
	 * @param testNamesCopy the test names copy
	 * @return the adequate test sets4
	 */
	public static ArrayList<String> getAdequateTestSets4 (HashMap<String, ArrayList<String>> filtered_data,
			ArrayList<String> testNamesCopy) {

		CopyOnWriteArrayList<ArrayList<String>> testSets = new CopyOnWriteArrayList<ArrayList<String>>();
		CopyOnWriteArrayList<String> mutantStrings = new CopyOnWriteArrayList<>();
		HashMap<String, ArrayList<String>> resultWithTestNames = new HashMap<>();
		HashMap<String, Integer> resultStat = new HashMap<>();

		ArrayList<String> testNames = new ArrayList<>(testNamesCopy);

		// get all mutants name in filtered data
		for (Object key : filtered_data.keySet()) {
			mutantStrings.add(key.toString());
			ArrayList<String> temp = filtered_data.get(key);
			ArrayList<String> testStrings = new ArrayList<>();
			for (int i = 0; i < temp.size(); i++) {
				if (temp.get(i).equals("1") && !testNames.get(i).equals("Total")) // current test kills the current
												// mutant
				{
					testStrings.add(testNames.get(i));

					if (resultStat.containsKey(testNames.get(i)))
						resultStat.put(testNames.get(i), resultStat.get(testNames.get(i)) + 1);
					else {
						resultStat.put(testNames.get(i), 1);
					}
				}
			}
			resultWithTestNames.put(key.toString(), testStrings);
		}

		// check if there is an equivalent
		int numOfEq = 0;
		int numOfTotalMutants = filtered_data.size();

		ArrayList<String> nonEquivNonKilled = new ArrayList<>();

		// remove those weren't be killed
		for (Object key : filtered_data.keySet()) {
			if (filtered_data.get(key).contains("y") ||
					filtered_data.get(key).contains("Y") ||
					filtered_data.get(key).contains("n") ||
					filtered_data.get(key).contains("N")||
					filtered_data.get(key).contains("?")
					)
			{
				mutantStrings.remove(key.toString());
			}
		}

		testNames.remove("Total");
		testNames.remove("Equiv?");

		ArrayList<String> result = new ArrayList<>();
		int[] mutants = new int[mutantStrings.size()];
		// for each mutant, randomly find a test that kills it
		for(int i =0; i<mutantStrings.size();i++)
		{
			if(mutants[i]==1)
				continue;
			// get all tests that kill it
			ArrayList<String> testsKillCurrentMutant = resultWithTestNames.get(mutantStrings.get(i));

			// randomly choose one
			SecureRandom random = new SecureRandom();
			String randomTest = testsKillCurrentMutant.get(random.nextInt(testsKillCurrentMutant.size()));
			result.add(randomTest);

			// remove this mutant by marking the array to 1
			mutants[i] = 1;

			// remove other mutants that killed by the same test
			for (int j =0; j<mutantStrings.size();j++)
			{
				if(mutants[j]==1)
					continue;
				if(resultWithTestNames.get(mutantStrings.get(j)).contains(randomTest))
					// the test selected killed this m
				{
					mutants[j] = 1;
				}
			}

		}
//	System.out.println(result);
	return result;
	}
}

redpajama_set_name: RedPajamaGithub


text:
This documents presents set of rules and guidelines when working with q+/kdb code.

Every developer is obliged to read and conform to the rules stated in the document.

Any violation to the guide is allowed only if it enhances readability.

## File names
- File name should reflect functionality of the code or module, for example, for handling `hdb`
  functionality, the file should be named `hdb.q`
- In case of longer names the camel casing should be used, (e.g. for `Access Point` -> `accessPoint.q`)

## Structure of the file
- Each file should have some or most of the following sections:
    - License
    - Script summary
    - Script start up command (if applicable)
    - Author(s)
    - Release date
    - Script version
    - List of global variables
    - Global functions
    - Interface functions
    - Private functions
- All of the above sections reflect available tags which must be used for commenting your code and
  creating documentation
    - Please refer to
      [Documenting q code](Documenting-q-code)
      for detailed explanation and examples on code generation
    - For more details about comments, please see section 'Comments' below
- Lines should not be longer than 100 columns.
- Indentation is always 2 (two) spaces. Tab characters are not allowed.

## Namespaces

- Namespace used in the module should reflect name of the file, for example in module `hdb.q` the
  namespace should also be `hdb`:

```q
/F/ realod hdb directory
.hdb.reload:{[]
  .event.at[`hdb;`.hdb.p.reload;();`;`info`info`fatal;"hdb reloading, hdb dir:", system"cd"];
  };
```

- In case of longer file names (such as `cfgServer.q`) please shorten the namespace to reflect the
  first letters from each part of the file name (`cs`):

```q
/F/ List all configuration tables for the component instance
/P/ instance - Q server instance name
/E/.cs.getCfgNames`feedCsvT
.cs.getCfgNames:{[instance]
  exec name from .cs.status where instance=instId
  };
```

- Whenever possible the namespaces should be limited to maximum of three levels:

```q
/F/ Parses a symbol. Symbol can be any string that does not contain ")",
/F/ spaces are stripped from both sides
/P/ ps - item to be parsed as symbol
/R/ :SYMBOL - the parsed symbol
.cr.atomic.symbol:{[ps]
  res:.cr.atomic.string ps;
  if[null res[`errp];
    s:res[`ast];
    res[`ast]:`$s]
    ;
  :res;
  };
```

## Functions

- Function body should be always indented
- Function definition should always end with semicolon `;`

## Private variables and private functions

Although q+/kdb doesn't have a notion of 'private' variables or functions, we've introduced
private-like notation. In general, all 'private' functionality should be using `p` namespace:

```q
/F/ initialization and reload
.hdb.p.init:{[]
  system "cd ",1_string .hdb.cfg.hdbPath;
  .hdb.reload[];
  };
```

These private functions (or variables) are accessible from q level as any other (i.e. - they keep
their 'global' scope), however, during code generation they are simply omitted to present end user
with only necessary set of interfacing functionality.

> **Note**
>
> Although private functions/variables are not parsed during document generation, they should be
> documented in the code.

## Long statements

It is recommended to split long lines of code. It is good if line breaks reflect
the logical meaning of the code, e.g.:

```q
final:delete parsed from select lineType, varName:parsed[;1;0], varVal:parsed[;1;1], line, col+parsed[;0], file, errors from parsed where lineType<>`empty;
```

to:

```q
final:delete parsed from
  select lineType, varName:parsed[;1;0], varVal:parsed[;1;1],
  line, col+parsed[;0], file, errors from parsed where lineType<>`empty;
```

## White spaces
- Tabs are not allowed and should be replaced with spaces
- Tab size should be set to two spaces

## Comments
- In general, the use of comments should be minimized by making the code self-documenting by
  appropriate name choices and an explicit logical structure.
- All comments should be written in English.
- Use `//` for all non-DevDoc comments, including multi-line comments. Using `//` comments ensure that
  it is always possible to comment out entire sections of a file using `/  ...  \` for debugging
  purposes etc.

## Miscellaneous
- The use of magic numbers in the code should be avoided.
- Try to limit length of each function. As a rule of thumb - if function's body doesn't fit in
  visible portion of your IDE, perhaps it should be divided into smaller functions


text:
package com.lecloud.valley.common;

import com.lecloud.sdk.constant.PlayerParams;

/**
 * Created by raojia on 2016/11/11.
 */
public interface Constants {

//============== REACT_CLASS ======================

    String REACT_CLASS_VIDEO_VIEW = "RCTLeVideo";

    String REACT_CLASS_SUB_VIDEO_VIEW = "RCTLeSubVideo";

    String REACT_CLASS_PUSH_VIEW = "RCTLePush";

    String REACT_CLASS_PAY_MODULE = "RCTLePayModule";

    String REACT_CLASS_LINEAR_GRADIENT_VIEW = "RCTLinearGradient";

    String REACT_CLASS_DEVICE_MODULE = "RCTDeviceModule";

    String REACT_CLASS_CACHE_MODULE = "RCTCacheModule";

    String REACT_CLASS_ORIENTATION_MODULE = "RCTOrientationModule";

    String REACT_CLASS_WECHAT_MODULE = "RCTWeChatModule";

    String REACT_CLASS_QQ_MODULE = "RCTQQModule";

    String REACT_CLASS_WEIBO_MODULE = "RCTWeiboModule";

    String REACT_CLASS_UMENG_PUSH_MODULE = "RCTUmengPushModule";

    String REACT_CLASS_DOWNLOAD_MODULE = "RCTDownloadModule";

    String REACT_CLASS_IMAGE_PICKER_MODULE = "RCTImagePickerModule";

    String REACT_CLASS_IMAGE_CROP_PICKER_MODULE = "RCTImageCropPickerModule";

//============== REACT_METHOD ======================

    //方法
    String PROP_SRC = "src";  //URI数据源:本地或者在线  复杂数据源
    String PROP_SRC_PLAY_MODE = PlayerParams.KEY_PLAY_MODE;  //播放器模式
    String PROP_SRC_URI = "uri"; //URI地址
    //点播模式参数
    String PROP_SRC_VOD_UUID = "uuid";
    String PROP_SRC_VOD_VUID = "vuid";
    String PROP_SRC_VOD_BUSINESSLINE = "businessline";
    String PROP_SRC_VOD_SAAS = "saas";
    String PROP_SRC_VOD_EXTRA = "videoInfo";
    //活动直播模式参数
    String PROP_SRC_ALIVE_ACTIONID = "actionId";
    String PROP_SRC_ALIVE_CUSTOMERID = "customerId";
    String PROP_SRC_ALIVE_BUSINESSLINE = "businessline";
    String PROP_SRC_ALIVE_CUID = "cuid";
    String PROP_SRC_ALIVE_UTIOKEN = "utoken";
    String PROP_SRC_ALIVE_IS_USEHLS = "usehls";
    //机位播放器参数
    String PROP_SRC_LIVE_ID = "liveId";
    String PROP_SRC_STREAM_ID = "streamId";
    String PROP_SRC_STREAM_URL = "streamUrl";
    String PROP_SRC_IS_PANO = "pano";
    String PROP_SRC_IS_REPEAT = "repeat";

    // 暂停方法
    String PROP_PAUSED = "paused";
    // 重播方法
    String PROP_REPEAT = "repeat";
    // 快进方法
    String PROP_SEEK = "seek";
    // 切换码率
    String PROP_RATE = "rate";
    // 切换机位
    String PROP_LIVE = "live";
    // 音量调节
    String PROP_VOLUME = "volume";
    // 左右声道
    String PROP_TRACK = "track";
    // 点击广告
    String PROP_CLICKAD = "clickAd";
    // 屏幕亮度调节
    String PROP_BRIGHTNESS = "brightness";
    // 屏幕方向
    String PROP_ORIENTATION = "orientation";
    // 是否后台播放
    String PROP_PLAY_IN_BACKGROUND = "playInBackground";

//================= REACT_PUSH ====================

    String PROP_PUSH_PARA = "para"; //推流参数,包含移动直播(无/有地址)、乐视云直播
    String PROP_PUSH_TYPE = "type"; //推流类型
    String PROP_PUSH = "push"; //开始/停止推流
    String PROP_CAMERA = "camera"; //切换摄像头
    String PROP_FLASH = "flash"; //打开/关闭闪光灯
    String PROP_FILTER = "filter"; //选取滤镜

    // 定义分享类型常量
    int PUSH_TYPE_MOBILE_URI = 0;
    int PUSH_TYPE_MOBILE = 1;
    int PUSH_TYPE_LECLOUD = 2;
    int PUSH_TYPE_NONE = -1;

    String EVENT_PROP_PUSH_PUSH_URL = "pushUrl";  //推流地址
    String EVENT_PROP_PUSH_PLAY_URL = "playUrl";  //播放地址

    String EVENT_PROP_PUSH_STATE = "state";  //推流操作状态
    String EVENT_PROP_PUSH_TIME = "time"; //推流计时
    String EVENT_PROP_PUSH_TIME_FLAG = "timeFlag"; //推流计时标识,为true正在计时
    String EVENT_PROP_PUSH_CAMERA_FLAG = "cameraFlag";  //摄像头切换标识,为true表示正在切换,不可以切换
    String EVENT_PROP_PUSH_CAMERA_DIRECTION = "cameraDirection";  //摄像头方向,1为前置,0为后置
    String EVENT_PROP_PUSH_FLASH_FLAG = "flashFlag"; //闪光灯标识,为true表示打开
    String EVENT_PROP_PUSH_FILTER = "filter"; //滤镜
    String EVENT_PROP_PUSH_VOLUME = "volume"; //音量

//============== REACT_EVENT_PROP ======================

    String EVENT_PROP_PLAY_MODE = "playMode"; //播放模式(VOD,LIVE)

    //字段名
    String EVENT_PROP_TITLE = "title"; //视频标题(VOD,LIVE)
    String EVENT_PROP_DURATION = "duration"; //视频总长(VOD)
    String EVENT_PROP_PLAYABLE_DURATION = "playableDuration"; //可播放时长(VOD)
    String EVENT_PROP_PLAY_BUFFERPERCENT = "bufferpercent"; //二级进度长度百分比(VOD)
    String EVENT_PROP_CURRENT_TIME = "currentTime"; //当前时长(VOD,LIVE)
    String EVENT_PROP_SEEK_TIME = "seekTime"; //跳转时间(VOD)
    String EVENT_PROP_VOD_IS_DOWNLOAD = "isDownload"; //是否允许下载(VOD)
    String EVENT_PROP_VOD_IS_PANO = "isPano"; //是否全景(VOD)
    String EVENT_PROP_NATURALSIZE = "naturalSize"; //视频原始尺寸(VOD,LIVE)
    String EVENT_PROP_VIDEO_BUFF = "videobuff";  //缓冲加载进度百分比(VOD)
    String EVENT_PROP_RATELIST = "rateList";  //可选择的码率(VOD,LIVE)
    String EVENT_PROP_CURRENT_RATE = "currentRate"; //当前码率(VOD,LIVE)
    String EVENT_PROP_DEFAULT_RATE = "defaultRate"; //默认码率(VOD,LIVE)
    String EVENT_PROP_NEXT_RATE = "nextRate"; //下一个码率(VOD,LIVE)

    String EVENT_PROP_LIVE_NEED_FULLVIEW = "needFullView"; //是否全屏(LIVE)
    String EVENT_PROP_LIVE_NEED_TIMESHIFT = "needTimeShift"; //是否支持时移(LIVE)
    String EVENT_PROP_LIVE_IS_NEED_AD = "isNeedAd"; //是否有广告(LIVE)
    String EVENT_PROP_LIVE_ARK = "ark"; //ARK(LIVE)
    String EVENT_PROP_CURRENT_LIVE = "currentLive"; //当前机位(LIVE)
    String EVENT_PROP_NEXT_LIVE = "nextLive"; //切换后的机位(LIVE)
    String EVENT_PROP_SERVER_TIME = "serverTime"; //服务器时间(LIVE)
    String EVENT_PROP_LIVE_BEGIN_TIME = "beginTime"; //直播开始时间(LIVE)
    String EVENT_PROP_LIVE_END_TIME = "endTime"; //直播结束时间(LIVE)
    String EVENT_PROP_ACTIONLIVE = "actionLive"; //云直播数据(LIVE)
    String EVENT_PROP_LIVE_ACTION_STATE = "actionState"; //当前直播活动状态(LIVE)

    String EVENT_PROP_LIVE_ACTION_ID = "actionId"; //当前直播活动ID(LIVE)
    String EVENT_PROP_LIVE_COVER_IMG = "coverImgUrl"; //封面URL(LIVE)
    String EVENT_PROP_LIVE_PLAYER_URL = "playerPageUrl"; //直播页地址URL(LIVE)

    String EVENT_PROP_LIVE_START_TIME = "startTime"; //直播开始时间(LIVE)

    String EVENT_PROP_LIVES = "lives";  //机位集合(LIVE)

    String EVENT_PROP_LIVE_ID = "liveId"; //机位Id(LIVE)
    String EVENT_PROP_LIVE_MACHINE = "machine"; //机位Machine(LIVE)
    String EVENT_PROP_LIVE_PRV_STEAMID = "previewSteamId"; //流ID(LIVE)
    String EVENT_PROP_LIVE_PRV_STEAMURL = "previewSteamPlayUrl"; //预览流URL(LIVE)
    String EVENT_PROP_LIVE_STATUS = "liveStatus"; //机位状态(LIVE)
    String EVENT_PROP_STREAM_ID = "streamId"; //当前机位流ID(LIVE)

    String EVENT_PROP_ONLINE_NUM = "onlineNum"; //当前在线人数

    String EVENT_PROP_MMS_STATCODE = "statusCode";  //媒资返回状态码
    String EVENT_PROP_MMS_HTTPCODE = "httpCode"; //媒资返回HTTP状态码

    String EVENT_PROP_ERROR_CODE = "errorCode"; //错误码
    String EVENT_PROP_ERROR_MSG = "errorMsg"; //错误描述

    String EVENT_PROP_WIDTH = "width"; //视频宽度
    String EVENT_PROP_HEIGHT = "height"; //视频高度

    String EVENT_PROP_ORIENTATION = "orientation"; //屏幕方向
    String EVENT_PROP_VIDEO_ORIENTATION = "videoOrientation"; //视频方向
    String EVENT_PROP_AD_TIME = "AdTime"; //广告倒计时

    String EVENT_PROP_RATE_KEY = "rateKey";  //码率索引
    String EVENT_PROP_RATE_VALUE = "rateValue";  //码率值

    String EVENT_PROP_LOGO = "logo";  //logo属性集合
    String EVENT_PROP_LOAD = "loading";  //加载属性集合
    String EVENT_PROP_WMARKS = "waterMarks";  //水印集合

    String EVENT_PROP_PIC = "pic";  //图片地址
    String EVENT_PROP_TARGET = "target";  //目标URL
    String EVENT_PROP_POS = "pos";  //位置

    String EVENT_PROP_VOLUME = "volume";  //音量
    String EVENT_PROP_BRIGHTNESS = "brightness";  //亮度

    String EVENT_PROP_ERROR = "error";
    String EVENT_PROP_WHAT = "what";
    String EVENT_PROP_EXTRA = "extra";
    String EVENT_PROP_EVENT = "event";

//================= REACT_SOCIAL ====================

    // 定义分享类型常量
    String SHARE_TYPE_NEWS = "news";
    String SHARE_TYPE_IMAGE = "image";
    String SHARE_TYPE_IMAGE_FILE = "imageFile";
    String SHARE_TYPE_TEXT = "text";
    String SHARE_TYPE_VIDEO = "video";
    String SHARE_TYPE_AUDIO = "audio";
    String SHARE_TYPE_VOICE = "voice";
    String SHARE_TYPE_FILE = "file";
    String SHARE_TYPE_APP = "app";

    // 定义分享共性字段名
    String SHARE_PROP_TYPE = "type";
    String SHARE_PROP_TITLE = "title";
    String SHARE_PROP_TEXT = "text";
    String SHARE_PROP_DESP = "description";
    String SHARE_PROP_TARGET = "webpageUrl";
    String SHARE_PROP_THUMB_IMAGE = "thumbImage";
    String SHARE_PROP_IMAGE = "imageUrl";
    String SHARE_PROP_VIDEO = "videoUrl";
    String SHARE_PROP_AUDIO = "audioUrl";
    String SHARE_PROP_APPNAME = "appName";

    //事件字段定义
    String EVENT_PROP_SOCIAL_CODE = "errCode";
    String EVENT_PROP_SOCIAL_MSG = "errMsg";
    String EVENT_PROP_SOCIAL_TYPE = "type";

    //授权和分享返回码和消息体
    int AUTH_RESULT_CODE_SUCCESSFUL = 0;
    int AUTH_RESULT_CODE_FAILED = 1;
    int AUTH_RESULT_CODE_CANCEL = 2;

    String AUTH_RESULT_MSG_SUCCESSFUL = "登录成功";
    String AUTH_RESULT_MSG_FAILED = "授权失败,请稍后重试";
    String AUTH_RESULT_MSG_CANCEL = "授权失败,用户取消";

    int SHARE_RESULT_CODE_SUCCESSFUL = 0;
    int SHARE_RESULT_CODE_FAILED = 1;
    int SHARE_RESULT_CODE_CANCEL = 2;

    String SHARE_RESULT_MSG_SUCCESSFUL = "分享成功";
    String SHARE_RESULT_MSG_FAILED = "分享失败,请稍后重试";
    String SHARE_RESULT_MSG_CANCEL = "分享失败,用户取消";

    //事件返回码
    String CODE_NOT_REGISTERED = "-1";
    String CODE_NULL_ACTIVITY = "-2";
    String CODE_INVOKE_FAILED = "-3";
    String CODE_INVALID_ARGUMENT = "-4";

    //事件处理响应
    String MSG_NOT_REGISTERED = "NOT_REGISTERED";
    String MSG_NULL_ACTIVITY = "NULL_ACTIVITY";
    String MSG_INVOKE_FAILED = "INVOKE_FAILED";
    String MSG_INVALID_ARGUMENT = "INVALID_ARGUMENT";

    //================= REACT_LEPAY ====================

}


text:
package com.thoughtworks.go.plugin.access.configrepo.contract.material;

import com.google.gson.JsonObject;
import com.thoughtworks.go.plugin.access.configrepo.contract.CRBaseTest;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

public class CRConfigMaterialTest extends CRBaseTest<CRConfigMaterial> {
    private final CRConfigMaterial named;
    private final CRConfigMaterial namedDest;
    private final CRConfigMaterial blacklist;
    private final CRConfigMaterial invalidList;

    public CRConfigMaterialTest() {
        named = new CRConfigMaterial("primary", null,null);
        namedDest = new CRConfigMaterial("primary", "folder",null);
        List<String> patterns = new ArrayList<>();
        patterns.add("externals");
        patterns.add("tools");
        blacklist = new CRConfigMaterial("primary", "folder",new CRFilter(patterns,false));

        CRFilter badFilter = new CRFilter(patterns,false);
        badFilter.setWhitelistNoCheck(patterns);
        invalidList = new CRConfigMaterial("primary", "folder",badFilter);
    }

    @Override
    public void addGoodExamples(Map<String, CRConfigMaterial> examples) {
        examples.put("namedExample", named);
        examples.put("namedDest", namedDest);
        examples.put("blacklist", blacklist);
    }

    @Override
    public void addBadExamples(Map<String, CRConfigMaterial> examples) {
        examples.put("invalidList",invalidList);
    }

    @Test
    public void shouldAppendTypeFieldWhenSerializingMaterials()
    {
        CRMaterial value = named;
        JsonObject jsonObject = (JsonObject)gson.toJsonTree(value);
        assertThat(jsonObject.get("type").getAsString(), is(CRConfigMaterial.TYPE_NAME));
    }

    @Test
    public void shouldHandlePolymorphismWhenDeserializing()
    {
        CRMaterial value = named;
        String json = gson.toJson(value);

        CRConfigMaterial deserializedValue = (CRConfigMaterial)gson.fromJson(json,CRMaterial.class);
        assertThat("Deserialized value should equal to value before serialization",
                deserializedValue,is(value));
    }

}


text:
bison glslang/MachineIndependent/glslang.y --no-lines \
    --defines=glslang/gen/glslang_tab.cpp.h \
    --output-file=glslang/gen/glslang_tab.cpp


text:
//
// BEEPoo - Standalone AY-3-8912 player with ATMEGA32U4 with Arduino bootloader
//
// Copyright (c) 2014 SmallRoomLabs / Mats Engstrom - mats.engstrom@gmail.com
//
// Hardware and Firmware released under the MIT License (MIT) than can be
// found in full in the file named LICENCE in the git repository.
//
// https://github.com/SmallRoomLabs/BEEPoo
//

#include "Arduino.h"
#include <stdint.h>
#include "spi.h"

// SPI clock modes
#define SPI_MODE_0 0x00 /* Sample (Rising) Setup (Falling) CPOL=0, CPHA=0 */
#define SPI_MODE_1 0x01 /* Setup (Rising) Sample (Falling) CPOL=0, CPHA=1 */
#define SPI_MODE_2 0x02 /* Sample (Falling) Setup (Rising) CPOL=1, CPHA=0 */
#define SPI_MODE_3 0x03 /* Setup (Falling) Sample (Rising) CPOL=1, CPHA=1 */

// data direction
#define SPI_LSB 1 /* send least significant bit (bit 0) first */
#define SPI_MSB 0 /* send most significant bit (bit 7) first */

// whether to raise interrupt when data received (SPIF bit received)
#define SPI_NO_INTERRUPT 0
#define SPI_INTERRUPT 1

// slave or master with clock diviser
#define SPI_SLAVE 0xF0
#define SPI_MSTR_CLK4 0x00 /* chip clock/4 */
#define SPI_MSTR_CLK16 0x01 /* chip clock/16 */
#define SPI_MSTR_CLK64 0x02 /* chip clock/64 */
#define SPI_MSTR_CLK128 0x03 /* chip clock/128 */
#define SPI_MSTR_CLK2 0x04 /* chip clock/2 */
#define SPI_MSTR_CLK8 0x05 /* chip clock/8 */
#define SPI_MSTR_CLK32 0x06 /* chip clock/32 */

void SpiSetup(uint8_t mode, int dord, int interrupt, uint8_t clock) {
  SPSR = (((clock & 0x04) == 4) << SPI2X); // clock divisor SPI2X
  SPCR = ((interrupt ? 1 : 0)<<SPIE)       // interrupt enabled
    | (1<<SPE)                             // enable SPI
    | (dord<<DORD)                         // LSB or MSB
    | (1<<MSTR)                            // Master
    | (((mode & 0x02) == 2) << CPOL)       // clock timing mode CPOL
    | (((mode & 0x01)) << CPHA)            // clock timing mode CPHA
    | (((clock & 0x02) == 2) << SPR1)      // cpu clock divisor SPR1
    | ((clock & 0x01) << SPR0);            // cpu clock divisor SPR0
}

//
//
//
void SpiDisable(void) {
  SPCR=0;
}

//
//
//
void SpiEnable(uint8_t fast) {
  if (fast) {
    SpiSetup(SPI_MODE_0, SPI_MSB, SPI_NO_INTERRUPT, SPI_MSTR_CLK2);
  } else {
    SpiSetup(SPI_MODE_0, SPI_MSB, SPI_NO_INTERRUPT, SPI_MSTR_CLK128);
  }
}

//
//
//
uint8_t SpiSend(uint8_t data) {
  SPDR=data;
  while (!(SPSR & (1<<SPIF)));
  return SPDR;
}


text:
@interface SSZipArchiveTests ()
- (NSString *)_cachesPath;
@end

@implementation SSZipArchiveTests

- (void)testZipping {
	NSString *outputPath = [self _cachesPath];
	NSArray *inputPaths = [NSArray arrayWithObjects:
						   [outputPath stringByAppendingPathComponent:@"Readme.markdown"],
						   [outputPath stringByAppendingPathComponent:@"LICENSE"],
	nil];
	NSString *archivePath = [outputPath stringByAppendingPathComponent:@"CreatedArchive.zip"];
	[SSZipArchive createZipFileAtPath:archivePath withFilesAtPaths:inputPaths];

	// TODO: Make sure the files are actually unzipped. They are, but the test should be better.
	STAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:archivePath], @"Archive created");
}

- (void)testUnzipping {
	NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"];
	NSString *outputPath = [self _cachesPath];

	[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath];

	NSFileManager *fileManager = [NSFileManager defaultManager];
	NSString *testPath = [outputPath stringByAppendingPathComponent:@"Readme.markdown"];
	STAssertTrue([fileManager fileExistsAtPath:testPath], @"Readme unzipped");

	testPath = [outputPath stringByAppendingPathComponent:@"LICENSE"];
	STAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped");

	// Commented out to avoid checking in several gig file into the repository. Simply add a file named
	// `LargeArchive.zip` to the project and uncomment out these lines to test.
//	zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"LargeArchive" ofType:@"zip"];
//	outputPath = [[self _cachesPath] stringByAppendingPathComponent:@"large"];
//	[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath];
}

#pragma mark - Private

- (NSString *)_cachesPath {
	return [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]
			stringByAppendingPathComponent:@"com.samsoffes.ssziparchive.tests"];
}

@end


text:
<?php

/**
 * Zend_Http_Client
 */
require_once 'Zend/Http/Client.php';

/**
 * @category   Zend
 * @package    Zend_Service
 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
abstract class Zend_Service_Abstract
{
    /**
     * HTTP Client used to query all web services
     *
     * @var Zend_Http_Client
     */
    protected static $_httpClient = null;

    /**
     * Sets the HTTP client object to use for retrieving the feeds.  If none
     * is set, the default Zend_Http_Client will be used.
     *
     * @param Zend_Http_Client $httpClient
     */
    final public static function setHttpClient(Zend_Http_Client $httpClient)
    {
        self::$_httpClient = $httpClient;
    }

    /**
     * Gets the HTTP client object.
     *
     * @return Zend_Http_Client
     */
    final public static function getHttpClient()
    {
        if (!self::$_httpClient instanceof Zend_Http_Client) {
            self::$_httpClient = new Zend_Http_Client();
        }

        return self::$_httpClient;
    }
}


text:
package org.broadinstitute.clio.server.webservice

import org.broadinstitute.clio.server.service.StatusService
import org.broadinstitute.clio.status.model.{
  ClioStatus,
  SearchStatus,
  StatusInfo,
  VersionInfo
}
import org.broadinstitute.clio.transfer.model.ApiConstants._
import org.scalamock.scalatest.MockFactory

import scala.concurrent.Future

class StatusWebServiceSpec extends BaseWebserviceSpec with MockFactory {
  behavior of "StatusWebService"

  val statusService: StatusService = mock[StatusService]
  val webService = new StatusWebService(statusService)

  it should "versionRoute" in {
    val expectedVersion = VersionInfo("Mock Server Version")
    (statusService.getVersion _).expects().returning(Future(expectedVersion))
    Get(s"/$versionString") ~> webService.versionRoute ~> check {
      responseAs[VersionInfo] should be(expectedVersion)
    }
  }

  it should "healthRoute" in {
    val expectedStatus = StatusInfo(ClioStatus.Started, SearchStatus.OK)
    (statusService.getStatus _).expects().returning(Future(expectedStatus))
    Get(s"/$healthString") ~> webService.healthRoute ~> check {
      responseAs[StatusInfo] should be(expectedStatus)
    }
  }
}


text:
/* Icons and Glyphs */
@font-face {
	font-family: 'icomoon-admin';
	src:url('../fonts/icomoon-admin.eot?-k5opr7');
	src:url('../fonts/icomoon-admin.eot?#iefix-k5opr7') format('embedded-opentype'),
		url('../fonts/icomoon-admin.woff?-k5opr7') format('woff'),
		url('../fonts/icomoon-admin.ttf?-k5opr7') format('truetype'),
		url('../fonts/icomoon-admin.svg?-k5opr7#icomoon-admin') format('svg');
	font-weight: normal;
	font-style: normal;
}

.font-light { font-family: 'museo_sans100'; }

.icon {
	font-family: 'icomoon-admin';
	speak: none;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	line-height: 1;

	/* Better Font Rendering =========== */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.icon-uniE614:before {
	content: "\e614";
}
.icon-pencil:before {
	content: "\e615";
}
.icon-remove:before {
	content: "\e616";
}
.icon-stack:before {
	content: "\e617";
}
.icon-cancel-circle:before {
	content: "\e610";
}
.icon-checkmark-circle:before {
	content: "\e611";
}
.icon-close:before {
	content: "\e609";
}
.icon-checkmark:before {
	content: "\e60a";
}
.icon-minus:before {
	content: "\e60c";
}
.icon-plus:before {
	content: "\e60b";
}
.icon-gallery:before {
	content: "\e613";
}
.icon-link:before {
	content: "\e600";
}
.icon-eye:before {
	content: "\e60e";
}
.icon-cd:before {
	content: "\e601";
}
.icon-rss:before {
	content: "\e602";
}
.icon-arrow:before {
	content: "\e603";
}
.icon-list2:before {
	content: "\e60f";
}
.icon-text:before {
	content: "\e612";
}
.icon-flow-tree:before {
	content: "\e604";
}
.icon-flow-line:before {
	content: "\e605";
}
.icon-arrow-down:before {
	content: "\e61d";
}
.icon-arrow-up:before {
	content: "\e61c";
}
.icon-arrow-left:before {
	content: "\e606";
}
.icon-arrow-down2:before {
	content: "\e607";
}
.icon-arrow-up2:before {
	content: "\e608";
}
.icon-uniE60D:before {
	content: "\e60d";
}

.icon-uniE614, .icon-pencil, .icon-remove, .icon-stack, .icon-cancel-circle, .icon-close, .icon-checkmark, .icon-minus, .icon-gallery, .icon-plus, .icon-link, .icon-cd, .icon-rss, .icon-arrow, .icon-flow-tree, .icon-text, .icon-eye, .icon-list2, .icon-flow-line, .icon-arrow-down, .icon-arrow-up, .icon-arrow-left, .icon-arrow-down2, .icon-arrow-up2, .icon-uniE60D {
	font-family: 'icomoon-admin';
	speak: none;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
}

/* Fonts */
@font-face {
    font-family: 'museo_sans100';
    src: url('../fonts/museosans-100-webfont.eot');
    src: url('../fonts/museosans-100-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/museosans-100-webfont.woff') format('woff'),
         url('../fonts/museosans-100-webfont.ttf') format('truetype'),
         url('../fonts/museosans-100-webfont.svg#museo_sans100') format('svg');
    font-weight: normal;
    font-style: normal;

}

@font-face {
    font-family: 'museo_sans300';
    src: url('../fonts/museosans-300-webfont.eot');
    src: url('../fonts/museosans-300-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/museosans-300-webfont.woff') format('woff'),
         url('../fonts/museosans-300-webfont.ttf') format('truetype'),
         url('../fonts/museosans-300-webfont.svg#museo_sans300') format('svg');
    font-weight: normal;
    font-style: normal;

}

@font-face {
    font-family: 'museo_sans500';
    src: url('../fonts/museosans-500-webfont.eot');
    src: url('../fonts/museosans-500-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/museosans-500-webfont.woff') format('woff'),
         url('../fonts/museosans-500-webfont.ttf') format('truetype'),
         url('../fonts/museosans-500-webfont.svg#museo_sans500') format('svg');
    font-weight: normal;
    font-style: normal;

}

@font-face {
    font-family: 'museo_sans700';
    src: url('../fonts/museosans-700-webfont.eot');
    src: url('../fonts/museosans-700-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/museosans-700-webfont.woff') format('woff'),
         url('../fonts/museosans-700-webfont.ttf') format('truetype'),
         url('../fonts/museosans-700-webfont.svg#museo_sans700') format('svg');
    font-weight: normal;
    font-style: normal;

}
/* New admin styles */
.panel-PENDING .panel-heading .panel-title { border-left:5px solid #efb310; position: relative; }
.panel-ACTIVE .panel-heading .panel-title { border-left:5px solid #67cf34; position: relative; }
.panel-DENIED .panel-heading .panel-title { border-left:5px solid #f25151; position: relative; }
.panel-UNDEPLOYED .panel-heading .panel-title { border-left:5px solid #3399cc; position: relative; }

.h-PENDING { color:#efb310; }
.h-ACTIVE { color:#67cf34; }
.h-DENIED { color:#f25151; }
.h-UNDEPLOYED { color:#3399cc; }
.h-SYSTEM { color:#999; text-transform:uppercase; }

.POC-info { padding:15px 25px; line-height:200%; border-top:1px solid #eaeaea; border-bottom:1px solid #eaeaea; margin-bottom:25px; }

.nav-tabs.nav-justified { display: block; position: relative; }
.tab-content {
	padding:20px;
	box-sizing:border-box;
	border-right:1px solid #bcbcbc;
	border-bottom:1px solid #bcbcbc;
	border-left:1px solid #bcbcbc;
	border-radius: 0 0 5px 5px;
	-webkit-border-radius: 0 0 5px 5px;
	-moz-border-radius: 0 0 5px 5px;
	background:#fff;
	box-shadow: 0 2px 0px 0px rgba(0, 0, 0, 0.05);
	display: block;
	position: relative;
}
.nav-tabs.nav-justified>li>a {
	border: 1px solid #dadada;
	border-radius: 5px 5px 0 0;
	background: #eaeaea;
	color:#757575;
	bottom:-3px;
	font-size:18px;
	cursor:pointer;
}
.nav-tabs.nav-justified>li>a:hover { color:#fff; text-shadow:-1px -1px 0px #bbb; background:#dbdbdb; border:1px solid #cdcdcd; transition:all 300ms; }
.nav-tabs.nav-justified>.active>a {
    background: #fff;
    border:1px solid #bcbcbc;
    border-bottom-color: #fff;
    bottom:0px;
    color:#757575;
    cursor:pointer;
}
.nav-tabs.nav-justified>.active>a:hover { background:#fff; text-shadow: none; border:1px solid #bcbcbc; border-bottom-color: #fff; color:#43c7f4; }
.mar-l30 { margin-left:30px; }

table {
	width: 100%;
	border-collapse: collapse;
    border-spacing: 0;
    border-bottom: 1px solid #454545;
    background: transparent;
}
table:first-child {  }
table:last-child { border-bottom: 0px; }
/*table:nth-of-type(odd) { background: #fff;}*/
table.table-header { border-bottom: 0px; }

th {
	padding: 2px;
	font-size: 12px;
	background: #454545;
	text-align: center;
	color: #fff;
	width: 48%;
}
th:first-child { border-right:1px solid #d8d8d8; }
th:last-child { border-left:1px solid #d8d8d8; }

td { padding: 20px 10px; text-align: left; width:46%; text-shadow: #fff 0px 1px 0px; vertical-align: top; border-right:1px solid #efefef; }
td:last-child { border-right:0px; }

.app-set { width:100%; background: transparent; border-collapse: collapse; border-spacing: 0; border:none; display:block; position:relative; }
.app-set .left-col { padding: 7px 0px; border:none; width:28%; float:left; }
.app-set .right-col { padding: 7px 0px; color:#000; width:70%; float:right; word-break: break-all; }
.app-set .right-col-short { padding: 7px 0px; color:#000; width:48%; float:left; word-break: break-all;}
.app-set .view-details-wrapper { position:absolute; top:0; right:0; }

ul.packages { padding-left: 0px; }
ul.packages li { padding:5px 0px; word-wrap: break-word; }

.center { text-align:center; }

.btn-cntrl {
	padding: 10px 20px;
	background: #3dcefc;
	-webkit-border-radius: 3px;
	-moz-border-radius: 3px;
	border-radius: 3px;
	border: 1px solid #33beea;
    color: #fff;
    font-size: 15px;
    font-family: 'museo_sans500';
    cursor: pointer;
    outline: none;
    text-decoration: none;
    text-shadow: 1px 1px 1px rgba(0,0,0, .15);
	vertical-align: inherit;
}

	.btn-cntrl:hover {
		background-image: -ms-linear-gradient(bottom, #0db5ea 0%, #3dcefc 100%);
		background-image: -moz-linear-gradient(bottom, #0db5ea 0%, #3dcefc 100%);
		background-image: -o-linear-gradient(bottom, #0db5ea 0%, #3dcefc 100%);
		background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #0db5ea), color-stop(1, #3dcefc));
		background-image: -webkit-linear-gradient(bottom, #0db5ea 0%, #3dcefc 100%);
		background-image: linear-gradient(to top, #0db5ea 0%, #3dcefc 100%);
		text-shadow: 1px 1px 1px rgba(0,0,0, .25);
		-webkit-box-shadow: 0 2px 2px rgba(0,0,0, .15);
		-moz-box-shadow: 0 2px 2px rgba(0,0,0, .15);
		box-shadow: 0 2px 2px rgba(0,0,0, .15);
		transition:all 150ms;
	}

button[disabled] { background:#dedede; color:#333; text-shadow:none; opacity:.5; cursor:default; }
button[disabled]:hover { box-shadow:none; background-image:none; text-shadow:none; }

.app-set { display:block; font-family:'museo_sans300'; margin-bottom:10px; font-size:15px; }
.app-set span { font-family:'museo_sans100'; color:#686868; text-transform:uppercase; font-size:13px; }
.pipeline-group { display:block; width:100%; border-top:1px solid #efefef; padding:7px 0; }
.pipeline-group:last-child { border-bottom:1px solid #efefef; }
.pipeline { display:block; margin:15px 0 10px 5px; padding-left:0px; font-size:15px; color:#000; }
.pipeline span { font-family:'museo_sans100'; color:#686868; text-transform:uppercase; font-size:13px; padding-right: 10px; }
table.topics { display:block; margin:15px 0 10px 30px; font-size:15px; color:#000; }
table.topics span { font-family:'museo_sans100'; color:#686868; text-transform:uppercase; font-size:13px; padding-right: 10px; }
table.topics td { padding:3px; border:none; width:auto; }
.topic-item { padding-bottom:7px; }
table.aminoJobs { display:block; margin:15px 0 10px 30px; font-size:15px; color:#000; }
table.aminoJobs span { font-family:'museo_sans100'; color:#686868; text-transform:uppercase; font-size:13px; padding-right: 10px; }
table.aminoJobs td { padding:3px; border:none; width:auto; }
.aminoJobs-item { padding-bottom:7px; }
.aminoJob-group { display:block; width:100%; border-top:1px solid #efefef; padding:7px 0; }
.aminoJob-group:last-child { border-bottom:1px solid #efefef; }
.aminoJob { display:block; margin:15px 0 10px 5px; padding-left:0px; font-size:15px; color:#000; }
.aminoJob span { font-family:'museo_sans100'; color:#686868; text-transform:uppercase; font-size:13px; padding-right: 10px; }

.icon-uniE614, .icon-flow-line, .icon-arrow, .icon-rss, .icon-cd, .icon-link { color:#d4d4d4; font-size:18px; float:left; vertical-align:middle; padding-right:5px; }
.icon-uniE614 { color:#bcbcbc; }
.icon-link.separator { float:none; padding-right:5px; padding-left:5px; display:inline; color:#333; }

/* End new admin styles */

.mask-overlay {
	position: absolute;
	width: 100%;
	/* min-height: 650px; */
	height: 100%;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: #000;
	opacity: .75;
	display: none;
	z-index: 999;
}

.contentPage {
	position: absolute;
	background: #efefef;
	/* width: auto !important; */
	/* min-height: 650px; */
	height: 100%;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: none;
	-webkit-box-shadow: 0 2px 2px rgba(0,0,0, .20);
	-moz-box-shadow: 0 2px 2px 1px rgba(0,0,0, .20);
	box-shadow: 0 2px 2px 1px rgba(0, 0, 0, 0.20);
	overflow: auto;
	z-index: 9999;
}

[ng\:cloak], [ng-cloak], .ng-cloak {
	display: none !important;
}

section {
	background: #fff;
	/* border: 1px solid #e0e0e0; */
	border: 1px solid #d5d5d5;
	padding: 0;
	-webkit-box-shadow: 0 1px 4px rgba(0,0,0,.0);
	-moz-box-shadow: 0 1px 4px rgba(0,0,0,.0);
	box-shadow: 0 1px 4px rgba(0,0,0,.0);
}
section:last-child {
	margin-bottom: 30px;
}

.section-container {
	padding: 20px 30px 30px 30px;
	overflow: hidden;
}

.fade {
	opacity: 0;
	-webkit-transition: opacity .15s linear;
	transition: opacity .15s linear
}

.fade.in {
	opacity: 1
}

.modal-open {
	overflow: hidden;
}

.modal {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1040;
	display: none;
	overflow: auto;
	overflow-y: scroll
}

.modal.fade .modal-dialog {
	-webkit-transform: translateX(0);
	-ms-transform: translateX(0);
	transform: translateX(0);

	-webkit-transition: -webkit-transform 1s ease-out;
	-moz-transition: -moz-transform 1s ease-out;
	-o-transition: -o-transform 1s ease-out;
	transition: transform 1s ease-out
}

.modal.in .modal-dialog {
	-webkit-transform: translateX(0);
	-ms-transform: translateX(0);
	transform: translateX(0);
}

.modal-dialog {
	margin: 0 auto;
	top:150px;
	width:700px;

}

.modal-content {
	-moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    -khtml-border-radius: 5px;
    backround:#fff;
	padding: 30px;
	position: relative;
    -webkit-box-shadow:none;
    box-shadow: none;
    background-clip: padding-box;
    outline: 0;
   	box-shadow: 0px 0px 20px #333;
	border:1px solid #c6c6c6;
}

.modal-backdrop {
	position: fixed;
	width: 100%;
	height: 100%;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: #000;
	opacity: 0.75;
	z-index: 999;
	display:block;
}

.modal-backdrop.fade { opacity: 0; filter: alpha(opacity = 0) }

.modal-backdrop.in { opacity: .5; filter: alpha(opacity = 50) }

.modal-header { }

.dialog-window-close {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 5px;
  cursor: pointer;
  display: inline-block;
  color:#a5a5a5;
  text-shadow: #fff 0px 1px 0px;
}
.dialog-window-close:hover { color:#000; transition:all 200ms; }

.modal-header .close {
  position: absolute;
  top: 90px;
  right: 30px;
  padding: 5px;
  cursor: pointer;
  display: inline-block;
  color:#a5a5a5;
  text-shadow: #fff 0px 1px 0px;
}

.header-wrapper { width:100%; }
.header {
	background: #20272d;
	border-right: 1px solid #2e3b43;
	border-bottom: 1px solid #2e3b43;
	border-left: 1px solid #2e3b43;
	padding: 15px;
	color: #a5a5a5;
	font-size: 12px;
	font-family: 'museo_sans300';
	cursor: default;
	width:100%;
	margin:0 auto;
	position:relative;
}

@-webkit-keyframes rotation {
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(359deg);}
}

@-moz-keyframes rotation {
from {-moz-transform: rotate(0deg);}
to {-moz-transform: rotate(359deg);}
}

@-o-keyframes rotation {
from {-o-transform: rotate(0deg);}
to {-o-transform: rotate(359deg);}
}

@keyframes rotation {
from {transform: rotate(0deg);}
to {transform: rotate(359deg);}
}
.centered-spinner { margin:0 auto; width:178px; padding-top:30px; }

/* Spinner */
.spinner-wrapper { position: relative; float: center; padding:10px 20px 20px; }
.spinner-content { vertical-align:middle; display:inline-block; font-family: 'museo_sans500'; font-size:15px; color:#cbcbcb; text-shadow:#fff 0px 1px 0px; }
.spinner {
	height:40px;
	width:40px;
	box-shadow:inset 0px 0px 1px #fff;
	-webkit-animation: rotation .6s infinite linear;
	-moz-animation: rotation .6s infinite linear;
	-o-animation: rotation .6s infinite linear;
	animation: rotation .6s infinite linear;
	border-left:6px solid #e1e1e1;
	border-right:6px solid #e1e1e1;
	border-bottom:6px solid #e1e1e1;
	border-top:6px solid #3DCEFC;
	border-radius:100%;
	position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-right:5px;
}

@-webkit-keyframes rotation {
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(359deg);}
}

@-moz-keyframes rotation {
from {-moz-transform: rotate(0deg);}
to {-moz-transform: rotate(359deg);}
}

@-o-keyframes rotation {
from {-o-transform: rotate(0deg);}
to {-o-transform: rotate(359deg);}
}

@keyframes rotation {
from {transform: rotate(0deg);}
to {transform: rotate(359deg);}
}

.font-red { color: #f25151; }

/* Globals */
body { color:#5a5a5a; font-family: 'museo_sans300'; font-size:14px; line-height: 18px; background: #efefef; margin:0;}

a { color:#3399cc; text-decoration:none; }

a:hover { text-decoration: none; }

p { color:#000; font-size: 15px; margin: 0 0 15px 0; }
p.radio { margin:0 0 10px 0; }

h1 { font-size: 28px; font-family: 'museo_sans100'; color: #b5b5b5; line-height: 100%; margin:10px 0px 0px 30px; }

h2 { font-size: 24px; font-family: 'museo_sans100'; color: #43c7f4; margin-top:0px;  margin-bottom:15px; line-height: 100%; }

h3 { font-size: 18px; font-family: 'museo_sans300'; color:#43c7f4; padding-bottom:20px; line-height: 100%; }

h4 { font-size: 18px; font-family: 'museo_sans300'; padding:0px; margin:0px; }

ul {
    -webkit-margin-before: 0em;
    -webkit-margin-after: 0em;
    -webkit-margin-start: 0px;
    -webkit-margin-end: 0px;
    -webkit-padding-start: 0px;
	list-style-type:none;
}

.group-closed { opacity:0.3; filter:alpha(opacity=30); /* For IE8 and earlier */ }

textarea, input, button { outline: none; }
button:focus, button:hover, button:active, button:visited { outline:none !important; color:#fff; }
.btn:focus, .btn:hover, .btn:active, .btn:visited { outline:none !important; color:#fff; }

small { font-family: 'museo_sans300'; }

.divider { display:block; height:1px; width:100%; border-top:1px solid #efefef; margin: 30px 0px; }

.no-disc { list-style-type:none; padding-left: 0px; }
.no-pad { padding:none !important; }
.mar-t50 { margin-top:50px; }
.mar-t30 { margin-top:30px; }
.mar-t20 { margin-top: 20px; }
.mar-t10 { margin-top:10px; }
.mar-b20 { margin-bottom:20px; }
.pad-b20 { padding-bottom: 20px; }
.mar-t0 { margin-top:0px !important; }
.pad-20 { padding:20px; }
.bold { font-family: 'museo_sans700'; }
.medium { font-family: 'museo_sans300'; }
.intro-container { padding:10px 24px 0px; }
.interior-container { padding:10px 15px; line-height:180%; }
.inline { display:inline; vertical-align:top; }
.inline-middle { display:inline-block; vertical-align:middle; }

.form-content {
    display: block;
    padding: 15px 15px 50px 15px;
    background: #fff;
    /*border: 1px solid #d5d5d5;*/
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    -khtml-border-radius: 5px;
    position: relative;
}

.fields-box {
    width:100%;
    margin:10px 0;
    background-color:#fcfcfc;
    border:1px solid #d8d8d8;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    -khtml-border-radius: 5px;
}

.fields-wrapper {
    display: table;
    width:100%;
    border-bottom:1px solid #d8d8d8;
    border-top:1px solid #fff;
}

div.fields-wrapper:first-child {
    border-top:none;
}

div.fields-wrapper:last-child {
    border-bottom:none;
}
.clearfix {clear: both; }

input {
    padding:10px 12px;
    background: #efefef;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    -khtml-border-radius: 3px;
    border:1px solid #e0e0e0;
    font-family: 'museo_sans300';
    font-size: 14px;
    color: #2a2a2a;
	box-sizing: border-box;
	-moz-box-sizing: border-box;
}
input:focus { outline:none; }
input:required, input:invalid { box-shadow:none; outline:none; }

input.number { padding:7px 10px; width: 60px; }

.help-block { display:block; padding:5px 0; }
.code-container { color:#fff; font-size:11px; font-family: "Courier New", monospace; padding:15px; background:#2e3b43; margin:15px 0; -webkit-appearance:none;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px; }

select {
    -webkit-appearance:none;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    padding: 10px;
	background: url(../images/dd_arrow.png) no-repeat right #efefef;
    width: 150px;
    height:40px;
    font-size: 14px;
    border: 1px solid #e0e0e0;
}
select:focus { outline:none; }

.btn {
    min-width: 200px;
    padding: 10px 20px 10px 20px;
    background: #3dcefc;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    border: none;
    color: #fff;
    font-size: 14px;
    font-family: 'museo_sans500';
    cursor: pointer;
    outline: none;
    text-decoration: none;
    text-shadow: 1px 1px 1px rgba(0,0,0, .15);
	vertical-align: inherit;
}

.btn:hover {
    background-image: -ms-linear-gradient(bottom, #0db5ea 0%, #3dcefc 100%);
    background-image: -moz-linear-gradient(bottom, #0db5ea 0%, #3dcefc 100%);
    background-image: -o-linear-gradient(bottom, #0db5ea 0%, #3dcefc 100%);
    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #0db5ea), color-stop(1, #3dcefc));
    background-image: -webkit-linear-gradient(bottom, #0db5ea 0%, #3dcefc 100%);
    background-image: linear-gradient(to top, #0db5ea 0%, #3dcefc 100%);
    text-shadow: 1px 1px 1px rgba(0,0,0, .25);
    -webkit-box-shadow: 0 2px 2px rgba(0,0,0, .15);
    -moz-box-shadow: 0 2px 2px rgba(0,0,0, .15);
    box-shadow: 0 2px 2px rgba(0,0,0, .15);
	color:#fff;
	outline:0px;
	transition:all 200ms;
}

.btn:active {
    -webkit-box-shadow: inset 0 1px 5px rgba(0,0,0, .25);
    -moz-box-shadow: inset 0 1px 5px rgba(0,0,0, .25);
    box-shadow: inset 0 1px 5px rgba(0,0,0, .25);
}
.btn:visited { outline:0px; color:#fff; }

.icon-list2, .icon-eye, .icon-text, .icon-gallery { font-size:18px; float:left; padding-right:5px; }
.btn.view-details { float:right; padding:10px 12px 10px 12px; vertical-align:middle; margin-right:10px; background:transparent; border:none; min-width:30px; box-shadow:none; text-shadow:none; color:#999; font-family:'museo_sans100'; }
.btn.view-details:hover { background-image:#fff; background:transparent; border:none; color:#33beea; }
.btn.view-package { padding:0px 0px 0px 15px; vertical-align:middle; background:transparent; border:none; min-width:30px; box-shadow:none; text-shadow:none; color:#999; font-family:'museo_sans100'; font-size: 18px; float:right; }
.btn.view-package:hover { background-image:#fff; background:transparent; border:none; color:#33beea; }
.btn.radio { width:100px; min-width:0px; }
.btn.plus { min-width:0px; height:40px; width:40px; text-shadow:none; padding:0px; display:inline-block; vertical-align:top; }
.btn.plus span { font-size: 22px; line-height: 0px; vertical-align: middle; display: inline-block; padding-bottom: 4px; }
.btn.minus { min-width:0px; height:38px; width:38px; text-shadow:none; padding:0px; }
.btn.minus span { font-size: 22px; line-height: 0px; vertical-align: middle; display: inline-block; padding-bottom: 4px; }
.btn.gray { background:#999; border:transparent; }
.btn.gray:hover { background:#aeaeae; }
.remove { background:none; border:0px; outline:0px; color:#666; font-size: 15px; position: absolute; right: 0; top: 0px; }
.remove:hover { color:#000; cursor:pointer; transition: all 150ms;}
.edit { background:none; border:0px; outline:0px; color:#666; font-size: 15px; position: absolute; right: 25px; top: 0px; }
.edit:hover { color:#000; cursor:pointer; transition: all 150ms;}

ul.mapping, ul.system-list { padding:0px; margin:10px 0px 0px 0px; list-style-type:none; }
ul.mapping li { border-bottom:1px solid #e0e0e0; position: relative; min-height:35px; margin-bottom: 15px; }

ul.system-list li {
	background:#fff;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    -khtml-border-radius: 3px;
    border:1px solid #e0e0e0;
    font-family: 'museo_sans300';
    font-size: 14px;
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	margin-right:8px;
	margin-top: 8px;
	padding:6px 10px 5px;
	display:inline-block;
	box-shadow: 1px 1px 3px #ededed;
}
ul.system-list li:hover { border:1px solid #d2d2d2; transition:all 300ms; }

ul.users { padding:0px; margin:0px; list-style-type:none; }
ul.users li { border-bottom:1px solid #e0e0e0; position: relative; min-height: 35px; margin-bottom: 15px; }

ul.applications { padding:0px; margin:0px; list-style-type:none; }
ul.applications li { padding-bottom:15px; border-bottom:1px solid #e0e0e0;  }

.item-container { width:85%; padding-bottom: 15px; box-sizing:border-box; }
.item-container.long { width:100%; }

#registration-progress-list { }
.registration-progress { position:absolute; top:0; left:0; }
ul.registration-progress-list { list-style:none; margin:100px 0 0 20px; position:fixed; }
ul.registration-progress-list li { color:#999; font-size:14px; padding-bottom:25px; position:relative; width: 220px; display:block; vertical-align: middle; }
ul.registration-progress-list li a { color:#999; text-decoration:none; cursor:pointer; transition: all 150ms; }
ul.registration-progress-list li a:hover { color:#333; transition: all 150ms; }
ul.registration-progress-list li span {font-size:18px; padding-right:10px; float: left; }

.icon-step-complete { display: inline-block; *display: inline; float: right !important; }
.icon-step-complete:after { content: "\e611"; color:#67cf34; }

@-moz-document url-prefix() {
  ul.registration-progress-list { margin:100px 0 0 -20px; }
}

.registration-benefits { display:inline-block; *display: inline; margin-top:10px; vertical-align: top; }
ul.registration-benefits { list-style:none; width:47%; vertical-align: top; padding: 0px; }
ul.registration-benefits.left { padding-right:20px; }
ul.registration-benefits li { color:#010101; font-size:16px; font-family:'museo_sans500'; display: inline-block; vertical-align: middle; margin-bottom:25px; line-height: 21px; }
.registration-benefits span { color:#fff; font-size:30px; }
.circle { background-color:#4cc8f4; height:60px; width:60px; 	border-radius: 50%; display:inline-block; vertical-align:middle; *display: inline; float: left; margin-right: 15px; padding:15px 0 0 16px; box-sizing: border-box; -moz-box-sizing: border-box; }
.registration-benefits .connection { padding:17px 0 0 12px; }
.registration-benefits .headphones { padding:15px 0 0 15px; }

.centered { margin:0 auto; text-align: center;}
.app-registration-container { display:block; margin: 0 auto; width:90%; height: 100%; overflow: auto; position:relative; max-width: 1200px; padding-bottom: 50px; }
.registration-progress-container { float: left; width:25%; display:inline; position:relative; }
.registration-slider-container { float:right; width:75%; overflow:hidden; background: #efefef; display:inline; position: relative; }
.registration-wrapper { margin:0 auto; padding:90px 30px 30px 30px; position: relative; }

.input-container { margin-bottom:10px; position:relative; box-sizing: border-box; -moz-box-sizing: border-box; display:block; width: 100%; }
.input-container.tall { margin-bottom:25px; margin-top:25px; }
.input-label { display: inline-block; font-family: 'museo_sans500'; font-size:13px; width:200px; }
.input-label.small { font-size:13px; }
.input-label.wide { font-family: 'museo_sans500'; font-size:14px; position:relative; display:block; width:100%; }
.input-field { display: inline-block; box-sizing: border-box; -moz-box-sizing: border-box; font-size:13px; vertical-align:top; }
.input-field.long { padding-left:0px; width:100%; }
.input-field input { width:100%; }
.input-field input:focus { outline: none; background:#fff; transition: all 500ms; }
.input.additem { width:85%; }
.input.half { width:50%; }

button.add-new { color:#c5c5c5; border:dashed 2px #c5c5c5; cursor:pointer; padding:10px 20px; width:100%; background:none; outline:none; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; margin-top:20px; vertical-align:middle; text-shadow:#fff 0px 1px 0px; box-shadow:#fff 0px 1px 0px; }
button.add-new:hover { color:#000; border:dashed 2px #aeaeae; transition: all 600ms; }
button.add-new span { padding-right:10px; }

button.cancel { background:none; border:0px; outline:0px; color:#ccc; font-size: 10px; margin-left: 8px; padding: 0px; display: inline; vertical-align: middle; }
button.cancel:hover { color:#000; cursor:pointer; transition: all 300ms;}

.arrow { box-sizing:border-box; background:none; border:0px; outline:0px; color:#d8d8d8; font-size: 35px; position:absolute; top:0px; right:0px; width:100%; text-align: right; padding: 13px 15px 5px 15px; }
.arrow span { text-shadow:0 -1px 0 #999; text-align:right; }
.arrow:hover { color:#bdbdbd; transition: all 300ms; }
.arrow:visited, button:arrow:active, button.arrow:focus { color:#a5a5a5; }

input[type="checkbox"] {
	webkit-border-radius: 2px;
	-moz-border-radius: 2px;
	border-radius: 2px;
	background:#eaeaea;
	border: 1px solid #d5d5d5;
	outline: none;
	padding: 10px;
}
label { display: inline-block; }
.tag { display: block; float: left; margin-right:30px; }

.regular-checkbox { display: none; }
.regular-checkbox + label {
	background-color: #eaeaea;
	border: 1px solid #d5d5d5;
	padding: 9px;
	webkit-border-radius: 2px;
	-moz-border-radius: 2px;
	border-radius: 2px;
	display: inline-block;
	position: relative;
	float: left;
	margin-right:5px;
	cursor:pointer;
}
.regular-checkbox + label:active, .regular-checkbox:checked + label:active { }
.regular-checkbox:checked + label {
	border: 1px solid #a5a5a5; background-color:#fff;  transition:all 300ms;
}
.regular-checkbox:checked + label:after {
	content: "\e60a";
	font-size: 16px;
	position: absolute;
	top: 0px;
	left: 3px;
	color: #404040;
	border: 1px solid #a5a5a5;
	background-color:#fff;
	transition:all 300ms;
}
.auth-column { float:left; width:48%; padding-right:2%; }
.auth-column.left { width:30% }
.auth-column ul, .auth-inline ul { margin:0; padding:0; }
.auth-inline ul li { list-style-type:none; display:inline; word-wrap:none; }
.auth-column ul li { padding-bottom:10px; display:block; float:none; list-style-type:none; margin:0 0 20px 0; word-wrap:none; }

/* Additionals */
.content-wrapper { padding:30px 0px 0px 0px; box-sizing:border-box; }
.jumbotron { background: #fff; padding: 20px; overflow: hidden; -webkit-box-shadow: 0 1px 4px rgba(0,0,0,.0); -moz-box-shadow: 0 1px 4px rgba(0,0,0,.0); box-shadow: 0 1px 4px rgba(0,0,0,.0); -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid #d5d5d5; margin-top:20px; box-sizing:border-box; }
.jumbotron:hover { border: 1px solid #c5c5c5; -webkit-box-shadow: 0 2px 2px rgba(0,0,0, .05); -moz-box-shadow: 0 2px 2px rgba(0,0,0, .05); box-shadow: 0 2px 2px rgba(0,0,0, .05); transition: all 500ms; }
.jumbotron h2 { font-size: 18px; margin:0px; font-family: 'museo_sans500'; display:block; }
.logo { display:inline; vertical-align:middle; }
.engine-logo { width:180px; padding-top: 10px; }

/* Bootstrap Overrides */
.panel-group .panel {box-shbox-shadow
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    -khtml-border-radius: 3px;
    transition:all 300ms;
}
.panel-heading { padding:0px; }
.panel-group .panel-heading+.panel-collapse .panel-body {
	padding:15px;
	color: #5a5a5a;
	background: #fbfbfb;
	height: auto;
	-webkit-box-shadow: inset 0 0 7px rgba(0,0,0, .08);
	-moz-box-shadow: inset 0 0 7px rgba(0,0,0, .08);
	box-shadow: inset 0 0 7px rgba(0,0,0, .08);
	border-bottom: 1px solid #ddd;
}
.panel-group .panel { margin-bottom:15px;; }
.panel-group .panel+.panel {margin-top:0px; }
.panel-group .panel:hover { border:1px solid #bdbdbd; box-shadow: 0 0 2px #e0e0e0; transition:all 100ms;  }
.panel-default>.panel-heading { background:transparent; border-color: transparent; }
.panel-title>a { text-decoration:none; cursor:pointer; padding: 20px; display:block; }
.collapse.in { margin-bottom:20px; }

/* Animation */
.animated {
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}
.animated-fast {
  -webkit-animation-duration: .35s;
  animation-duration: .35s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}

@-webkit-keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.fadeIn {
  -webkit-animation-name: fadeIn;
  animation-name: fadeIn;
}

@-webkit-keyframes slideInDown {
  0% {
    -webkit-transform: translateY(-60px);
    transform: translateY(-60px);
  }

  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  0% {
    -webkit-transform: translateY(-60px);
    -ms-transform: translateY(-60px);
    transform: translateY(-60px);
  }

  100% {
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
  }
}

.slideInDown {
  -webkit-animation-name: slideInDown;
  animation-name: slideInDown;
}

.community-auth { color: red; word-break: normal }

/* Breakpoint Media Queries */
@media only screen and (max-width: 1020px) {
	ul.registration-progress-list li { color:#999; font-size:14px; padding-bottom:20px; vertical-align:middle; width:180px; }
	.icon-info, .icon-feed, .icon-tree, .icon-cog { display:none; }
	.icon-step-complete { padding-top: 0px; }
}

@media only screen and (max-width: 835px) {
	ul.registration-progress-list li { font-size: 16px; }
	.registration-wrapper { background: #efefef; }
	.registration-progress-container { display:none; }
	.registration-slider-container { float:none; width:100%; overflow:hidden; background: #efefef; display:inline; position: relative; }

	.registration-benefits { display:block; *display: block; margin-top:10px; vertical-align: top; }
	ul.registration-benefits { list-style:none; width:100%; vertical-align: top; padding: 0px; margin-top: 0px; }
	ul.registration-benefits.left { padding-right:0px; }
	ul.registration-benefits li { color:#010101; font-size:16px; font-family:'museo_sans500'; display: inline-block; margin-bottom:15px; line-height: 18px; }

	.registration-benefits span { color:#fff; font-size:20px; }
	.registration-benefits .connection { padding:11px 0 0 8px; }
	.registration-benefits .headphones { padding:10px 0 0 11px; }
	.circle { background-color:#4cc8f4; height:40px; width:40px; padding: 9px 0 0 11px; vertical-align:middle; }

	.input-label { display: block; position: relative; width: 100%; }
	.input-field { display: block; position: relative; padding-left: 0px; }

	.modal-dialog { width:90%; }

	.app-set { margin-bottom:20px; }
	.app-set .left-col { width:100%; float:none; padding:0px; }
	.app-set .right-col { width:100%; float:none; padding:0px; }
	.app-set .right-col-short { width:100%; float:none; padding:0px; }
	.app-set .view-details-wrapper { position: relative; float:right; margin-bottom:0px; }

	table.topics, table.aminoJobs { margin:15px 0 10px 0px; }
	.icon-rss, .icon-uniE614, .icon-arrow { display:none; }
	.icon-gallery { padding-right:0px; float:none; }
	.btn-cntrl { width:100%; margin-bottom:10px; }
	.panel-group .panel-heading+.panel-collapse .panel-body { padding:5px; }
	.btn.view-details { padding:2px; margin-right:0px; }
	.btn.view-details span { display:none; }

	@-moz-document url-prefix() {
    ul.registration-progress-list { margin:80px 0 0 -20px; }
}


text:
package org.foxbpm.connector.actorconnector.AllUserActorConnector;

import org.foxbpm.engine.Constant;
import org.foxbpm.engine.impl.connector.ActorConnectorHandler;
import org.foxbpm.engine.task.DelegateTask;

public class AllUserActorConnector extends ActorConnectorHandler{

	private static final long serialVersionUID = 1L;

	public void assign(DelegateTask task) throws Exception {
		task.addCandidateUser(Constant.FOXBPM_ALL_USER);
	}

}


text:
package com.bearsoft.org.netbeans.modules.form.layoutsupport;

import com.bearsoft.org.netbeans.modules.form.RADProperty;
import java.awt.*;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
import org.openide.ErrorManager;

/**
 * This class is used internally to provide default support for any layout
 * manager class. The layout manager is handled as a JavaBean, no component
 * constraints are supported, as well as no drag&drop and no arranging features.
 *
 * @author Tomas Pavek
 */
class DefaultLayoutSupport extends AbstractLayoutSupport {

    private Class<?> layoutClass;

    public DefaultLayoutSupport(Class<?> layoutClass) {
        this.layoutClass = layoutClass;
    }

    @Override
    public Class<?> getSupportedClass() {
        return layoutClass;
    }

    @Override
    public void addComponentsToContainer(Container container,
            Container containerDelegate,
            Component[] components,
            int index) {
        // for better robustness catch exceptions that might occur because
        // the default support does not deal with constraints
        try {
            super.addComponentsToContainer(container,
                    containerDelegate,
                    components,
                    index);
        } catch (RuntimeException ex) { // just ignore
            ErrorManager.getDefault().notify(ex);
        }
    }

    /**
     * Derives changed properties from the instance in the meta layout. The
     * instance in the meta layout is the default instance from the container.
     * This can differ from the default instance of the layout class. For
     * example, VerticalLayout in SwingX library has gap property. The default
     * value of this property is 0, but the default value of gap property of
     * layout obtained from the default instance of JXTaskContainer is 14.
     *
     * @param metaLayout information about the layout.
     */
    @Override
    protected void deriveChangedPropertiesFromInstance(RADLayout metaLayout) {
        Map<String, Object> map = new HashMap<>();
        for (RADProperty<Object> prop : (RADProperty<Object>[])metaLayout.getBeanProperties()) {
            if (prop.canRead() && prop.canWrite()) {
                try {
                    map.put(prop.getName(), prop.getValue());
                } catch (IllegalAccessException | InvocationTargetException ex) {
                    ErrorManager.getDefault().notify(ex);
                }
            }
        }
        try {
            metaLayout.setInstance(createDefaultLayoutInstance());
            for (RADProperty<Object> prop : (RADProperty<Object>[])metaLayout.getBeanProperties()) {
                if (prop.canRead() && prop.canWrite() && map.containsKey(prop.getName())) {
                    try {
                        prop.setValue(map.get(prop.getName()));
                    } catch (Exception ex) {
                        ErrorManager.getDefault().notify(ex);
                    }
                }
            }
        } catch (Exception ex) {
            ErrorManager.getDefault().notify(ex);
        }
    }

    /**
     * Cloning method - creates a new instance of this layout support, just not
     * initialized yet.
     *
     * @return new instance of this layout support
     */
    @Override
    protected AbstractLayoutSupport createLayoutSupportInstance() {
        return new DefaultLayoutSupport(layoutClass);
    }
}