text:
#include "servant/StatReport.h"
#include "util/tc_common.h"
#include "util/tc_timeprovider.h"
#include "servant/TarsLogger.h"
#include "servant/Communicator.h"
#include <iostream>

namespace tars
{
//////////////////////////////////////////////////////////////////
//
StatReport::StatReport(size_t iEpollNum)
: _time(0)
, _reportInterval(60000)
, _reportTimeout(5000)
, _maxReportSize(MAX_REPORT_SIZE)
, _terminate(false)
, _sampleRate(1)
, _maxSampleCount(500)
, _epollNum(iEpollNum)
, _retValueNumLimit(10)
{
    for(size_t i = 0 ; i < _epollNum; i++)
    {
        _statMsg.push_back(new stat_queue(MAX_STAT_QUEUE_SIZE));
    }
}

StatReport::~StatReport()
{
    if (isAlive())
    {
        terminate();

        getThreadControl().join();
    }
}

void StatReport::terminate()
{
    Lock lock(*this);

    _terminate = true;

    notifyAll();
}

void StatReport::report(size_t iSeq,MapStatMicMsg * pmStatMicMsg)
{
    assert(iSeq < _epollNum);
    bool bFlag = _statMsg[iSeq]->push_back(pmStatMicMsg);
    if(!bFlag)
    {
        delete pmStatMicMsg;
        pmStatMicMsg = NULL;

        TLOGERROR("[TARS][StatReport::report] queue full." << endl);
    }
}

void StatReport::setReportInfo(const StatFPrx& statPrx,
                       const PropertyFPrx& propertyPrx,
                       const string& strModuleName,
                       const string& strModuleIp,
                       const string& strSetDivision,
                       int iReportInterval,
                       int iSampleRate,
                       unsigned int iMaxSampleCount,
                       int iMaxReportSize,
                       int iReportTimeout)
{
    Lock lock(*this);

    _statPrx        = statPrx;

    _propertyPrx    = propertyPrx;

    //包头信息,trim&substr 防止超长导致udp包发送失败
    _moduleName  = trimAndLimitStr(strModuleName, MAX_MASTER_NAME_LEN);

    _ip          = trimAndLimitStr(strModuleIp, MAX_MASTER_IP_LEN);

    _time          = TNOW;

    _reportInterval    = iReportInterval < 10000 ? 10000 : iReportInterval;

    _reportTimeout = iReportTimeout < 5000 ? 5000 : iReportTimeout;

    _sampleRate        = (iSampleRate < 1)?1: iSampleRate;

    _maxSampleCount    = iMaxSampleCount>500?500:iMaxSampleCount;

    if ( iMaxReportSize < MIN_REPORT_SIZE || iMaxReportSize > MAX_REPORT_SIZE )
    {
        _maxReportSize = MAX_REPORT_SIZE;
    }
    else
    {
        _maxReportSize = iMaxReportSize;
    }
    vector<string> vtSetInfo = TC_Common::sepstr<string>(strSetDivision,".");
    if (vtSetInfo.size()!=3 ||(vtSetInfo.size()==3&&(vtSetInfo[0]=="*"||vtSetInfo[1]=="*")))
    {
        _setArea= "";
        _setID  = "";
    }
    else
    {
        _setName         = vtSetInfo[0];
        _setArea         = vtSetInfo[1];
        _setID           = vtSetInfo[2];
    }
    //TLOGDEBUG("setReportInfo Division:" << strSetDivision << " " << _setName << " " << _setArea << " " << _setID  << endl);
    resetStatInterv();

    if (!isAlive())
    {
        start();
    }
}

void StatReport::addStatInterv(int iInterv)
{
    Lock lock(*this);

    _timePoint.push_back(iInterv);

    sort(_timePoint.begin(),_timePoint.end());

    unique(_timePoint.begin(),_timePoint.end());
}

void StatReport::getIntervCount(int time,StatMicMsgBody& body)
{
    int iTimePoint = 0;
    bool bNeedInit = false;
    bool bGetIntev = false;
    if(body.intervalCount.size() == 0)  //第一次需要将所有描点值初始化为0
    {
        bNeedInit = true;
    }
    for(int i =0;i<(int)_timePoint.size();i++)
    {
        iTimePoint = _timePoint[i];
        if(bGetIntev == false && time < iTimePoint)
        {
            bGetIntev = true;
            body.intervalCount[iTimePoint]++;
            if(bNeedInit == false)
                break;
            else
                continue;
        }
        if(bNeedInit == true)
        {
           body.intervalCount[iTimePoint] = 0;
        }
    }
    return;
}

void  StatReport::resetStatInterv()
{
    _timePoint.clear();
    _timePoint.push_back(5);
    _timePoint.push_back(10);
    _timePoint.push_back(50);
    _timePoint.push_back(100);
    _timePoint.push_back(200);
    _timePoint.push_back(500);
    _timePoint.push_back(1000);
    _timePoint.push_back(2000);
    _timePoint.push_back(3000);

    sort(_timePoint.begin(),_timePoint.end());

    unique(_timePoint.begin(),_timePoint.end());
}

string StatReport::trimAndLimitStr(const string& str, uint32_t limitlen)
{
    static const string strTime = "\r\t";

    string ret = TC_Common::trim(str, strTime);

    if (ret.length() > limitlen)
    {
        ret.resize(limitlen);
    }
    return ret;
}

bool StatReport::divison2SetInfo(const string& str, vector<string>& vtSetInfo)
{
    vtSetInfo = TC_Common::sepstr<string>(str,".");

    if (vtSetInfo.size() != 3 ||(vtSetInfo.size()==3&&(vtSetInfo[0]=="*"||vtSetInfo[1]=="*")))
    {
        TLOGERROR(__FUNCTION__ << ":" << __LINE__ << "|bad set name [" << str << endl);
        return false;
    }
    return true;
}

/*
tars.tarsstat to tarsstat
*/
string StatReport::getServerName(string sModuleName)
{
    string::size_type pos =  sModuleName.find(".");
    if(pos != string::npos)
    {
         return sModuleName.substr(pos + 1); //+1:过滤.
    }
    return  sModuleName;
}

void StatReport::report(const string& strModuleName,
                      const string& setdivision,
                      const string& strInterfaceName,
                      const string& strModuleIp,
                      uint16_t iPort,
                      StatResult eResult,
                      int iSptime,
                      int iReturnValue,
                      bool bFromClient)
{
    //包头信息,trim&substr 防止超长导致udp包发送失败
    //masterIp为空服务端自己获取。

    StatMicMsgHead head;
    StatMicMsgBody body;
    string sMaterServerName = "";
    string sSlaveServerName = "";
    string appName = "";// 由setdivision生成

    if(bFromClient)
    {
        if (!_setName.empty())
        {
            head.masterName = _moduleName + "." + _setName + _setArea + _setID + "@" + ClientConfig::TarsVersion;
        }
        else
        {
            head.masterName = _moduleName + "@" + ClientConfig::TarsVersion;
        }

        if (!setdivision.empty()) //被调没有启用set分组,slavename保持原样
        {
            vector <string> vtSetInfo;
            if(divison2SetInfo(setdivision, vtSetInfo))
            {
                head.slaveSetName         = vtSetInfo[0];
                head.slaveSetArea         = vtSetInfo[1];
                head.slaveSetID          = vtSetInfo[2];
            }
            head.slaveName = trimAndLimitStr(strModuleName, MAX_MASTER_NAME_LEN) + "." + head.slaveSetName + head.slaveSetArea + head.slaveSetID;
        }
        else
        {
            head.slaveName = trimAndLimitStr(strModuleName, MAX_MASTER_NAME_LEN);
        }

        head.masterIp       = "";
        head.slaveIp        = trimAndLimitStr(strModuleIp, MAX_MASTER_IP_LEN);

    }
    else
    {
        //被调上报,masterName没有set信息
        head.masterName     = trimAndLimitStr(strModuleName, MAX_MASTER_NAME_LEN);

        head.masterIp       = trimAndLimitStr(strModuleIp, MAX_MASTER_IP_LEN);

        if(_setName.empty()) //被调上报,slave的set信息为空
        {
            head.slaveName      = _moduleName;//服务端version不需要上报
        }
        else
        {
            head.slaveName    = _moduleName + "." + _setName + _setArea + _setID;
        }
        head.slaveIp             = "";

        head.slaveSetName        = _setName;

        head.slaveSetArea        = _setArea;

        head.slaveSetID          = _setID;
    }

    head.interfaceName  = trimAndLimitStr(strInterfaceName, MAX_MASTER_NAME_LEN);
    head.slavePort      = iPort;
    head.returnValue    = iReturnValue;

    //包体信息.
    if(eResult == STAT_SUCC)
    {
        body.count = 1;

        body.totalRspTime = body.minRspTime = body.maxRspTime = iSptime;
    }
    else if(eResult == STAT_TIMEOUT)
    {
        body.timeoutCount = 1;
    }
    else
    {
        body.execCount = 1;
    }
    submit(head, body, bFromClient);
}

void StatReport::report(const string& strMasterName,
                        const string& strMasterIp,
                        const string& strSlaveName,
                        const string& strSlaveIp,
                        uint16_t iSlavePort,
                        const string& strInterfaceName,
                        StatResult eResult,
                        int  iSptime,
                        int  iReturnValue)
{
    //包头信息,trim&substr 防止超长导致udp包发送失败
    //masterIp为空服务端自己获取。

    StatMicMsgHead head;
    StatMicMsgBody body;

    head.masterName     = trimAndLimitStr(strMasterName + "@" + ClientConfig::TarsVersion, MAX_MASTER_NAME_LEN);
    head.masterIp       = trimAndLimitStr(strMasterIp,      MAX_MASTER_IP_LEN);
    head.slaveName      = trimAndLimitStr(strSlaveName,     MAX_MASTER_NAME_LEN);
    head.slaveIp        = trimAndLimitStr(strSlaveIp,       MAX_MASTER_IP_LEN);
    head.interfaceName  = trimAndLimitStr(strInterfaceName, MAX_MASTER_NAME_LEN);
    head.slavePort      = iSlavePort;
    head.returnValue    = iReturnValue;

    //包体信息.
    if(eResult == STAT_SUCC)
    {
        body.count = 1;

        body.totalRspTime = body.minRspTime = body.maxRspTime = iSptime;
    }
    else if(eResult == STAT_TIMEOUT)
    {
        body.timeoutCount = 1;
    }
    else
    {
        body.execCount = 1;
    }

    submit(head, body, true);
}

string StatReport::sampleUnid()
{
    char s[14]              = {0};
    time_t t                = TNOW;
    int ip                  = inet_addr(_ip.c_str());
    int thread              = TC_Common::gettid();
    static unsigned short n = 0;
    ++n;
    memcpy( s, &ip, 4 );
    memcpy( s + 4, &t, 4);
    memcpy( s + 8, &thread, 4);
    memcpy( s + 12, &n, 2 );
    return TC_Common::bin2str(string(s,14));
}

void StatReport::submit( StatMicMsgHead& head, StatMicMsgBody& body,bool bFromClient )
{
    Lock lock(*this);

    MapStatMicMsg& msg = (bFromClient == true)?_statMicMsgClient:_statMicMsgServer;
    MapStatMicMsg::iterator it = msg.find( head );
    if ( it != msg.end() )
    {
        StatMicMsgBody& stBody      = it->second;
        stBody.count                += body.count;
        stBody.timeoutCount         += body.timeoutCount;
        stBody.execCount            += body.execCount;
        stBody.totalRspTime         += body.totalRspTime;
        if ( stBody.maxRspTime < body.maxRspTime )
        {
            stBody.maxRspTime = body.maxRspTime;
        }
        //非0最小值
        if ( stBody.minRspTime == 0 ||(stBody.minRspTime > body.minRspTime && body.minRspTime != 0))
        {
            stBody.minRspTime = body.minRspTime;
        }
        getIntervCount(body.maxRspTime, stBody);
    }
    else
    {
        getIntervCount(body.maxRspTime, body);
        msg[head] = body;
    }
}

void StatReport::doSample(const string& strSlaveName,
                      const string& strInterfaceName,
                      const string& strSlaveIp,
                      map<string, string> &status)
{
}

int StatReport::reportMicMsg(MapStatMicMsg& msg,bool bFromClient)
{
    if(msg.empty())
        return 0;
    try
    {
       int iLen = 0;
       MapStatMicMsg  mTemp;
       MapStatMicMsg  mStatMsg;
       mStatMsg.clear();
       mTemp.clear();
       {
           Lock lock(*this);
           msg.swap(mStatMsg);
       }

       TLOGINFO("[TARS][StatReport::reportMicMsg get size:" << mStatMsg.size()<<"]"<< endl);
       for(MapStatMicMsg::iterator it = mStatMsg.begin(); it != mStatMsg.end(); it++)
       {
           const StatMicMsgHead &head = it->first;
           int iTemLen = STAT_PROTOCOL_LEN +head.masterName.length() + head.slaveName.length() + head.interfaceName.length()
               + head.slaveSetName.length() + head.slaveSetArea.length() + head.slaveSetID.length();
           iLen = iLen + iTemLen;
           if(iLen > _maxReportSize) //不能超过udp 1472
           {
               if(_statPrx)
               {
                   TLOGINFO("[TARS][StatReport::reportMicMsg send size:" << mTemp.size()<<"]"<< endl);
                   _statPrx->tars_set_timeout(_reportTimeout)->async_reportMicMsg(NULL,mTemp,bFromClient);
               }
               iLen = iTemLen;
               mTemp.clear();
           }

           mTemp[head] = it->second;
           if(LOG->IsNeedLog(TarsRollLogger::INFO_LOG))
           {
                  ostringstream os;
               os.str("");
               head.displaySimple(os);
               os << "  ";
               mTemp[head].displaySimple(os);
               TLOGINFO("[TARS][StatReport::reportMicMsg display:" << os.str() << endl);
           }
       }
       if(0 != (int)mTemp.size())
       {
           if(_statPrx)
           {
               TLOGINFO("[TARS][StatReport::reportMicMsg send size:" << mTemp.size()<<"]"<< endl);
               _statPrx->tars_set_timeout(_reportTimeout)->async_reportMicMsg(NULL,mTemp,bFromClient);
           }
       }
       return 0;
    }
    catch ( exception& e )
    {
        TLOGERROR("StatReport::report catch exception:" << e.what() << endl);
    }
    catch ( ... )
    {
        TLOGERROR("StatReport::report catch unkown exception" << endl);
    }
    return -1;
}

int StatReport::reportPropMsg()
{
    try
    {
       MapStatPropMsg mStatMsg;

       {
           Lock lock(*this);
           for(map<string, PropertyReportPtr>::iterator it = _statPropMsg.begin(); it != _statPropMsg.end(); ++it)
           {
               StatPropMsgHead head;
               StatPropMsgBody body;

               if (!it->second->getMasterName().empty())
               {
                   if (!_setName.empty())
                   {
                       head.moduleName = it->second->getMasterName() + "." + _setName + _setArea + _setID;
                   }
                   else
                   {
                       head.moduleName = it->second->getMasterName();
                   }
               }
               else
               {
                   if (!_setName.empty())
                   {
                       head.moduleName = _moduleName + "." + _setName + _setArea + _setID;
                   }
                   else
                   {
                       head.moduleName = _moduleName;
                   }
               }

               head.ip              = "";
               head.propertyName    = it->first;
               head.setName         = _setName;
               head.setArea         = _setArea;
               head.setID           = _setID;
               head.iPropertyVer    = 2;

               vector<pair<string, string> > v = it->second->get();
               for(size_t i = 0; i < v.size(); i++)
               {
                   bool bFlag = false;
                   if(v[i].first == "Sum")
                   {
                        if(v[i].second != "0")
                            bFlag = true;
                   }
                   else if(v[i].first == "Avg")
                   {
                        if(v[i].second != "0")
                            bFlag = true;
                   }
                    else if(v[i].first == "Distr")
                   {
                        if(v[i].second != "")
                            bFlag = true;
                   }
                   else if(v[i].first == "Max")
                   {
                        if(v[i].second != "-9999999")
                            bFlag = true;
                   }
                   else if(v[i].first == "Min")
                   {
                        if(v[i].second != "0")
                            bFlag = true;
                   }
                   else if(v[i].first == "Count")
                   {
                        if(v[i].second != "0")
                            bFlag = true;
                   }
                   else
                   {
                        bFlag = true;
                   }

                   if(bFlag)
                   {
                        StatPropInfo sp;
                        sp.policy = v[i].first;
                        sp.value  = v[i].second;
                        body.vInfo.push_back(sp);
                   }
               }
               mStatMsg[head]  = body;
               if(LOG->IsNeedLog(TarsRollLogger::INFO_LOG))
               {
                      ostringstream os;
                   os.str("");
                      head.displaySimple(os);
                   os << "  ";
                   mStatMsg[head].displaySimple(os);
                   TLOGINFO("[TARS][StatReport::reportPropMsg display:" << os.str() << endl);
               }
           }
       }

       TLOGINFO("[TARS][StatReport::reportPropMsg get size:" << mStatMsg.size()<<"]"<< endl);
       int iLen = 0;
       MapStatPropMsg mTemp;
       for(MapStatPropMsg::iterator it = mStatMsg.begin(); it != mStatMsg.end(); it++)
       {
           const StatPropMsgHead &head = it->first;
           const StatPropMsgBody &body = it->second;
           int iTemLen = head.moduleName.length()+ head.ip.length() + head.propertyName.length() + head.setName.length() + head.setArea.length() + head.setID.length();
           for(size_t i = 0; i < body.vInfo.size(); i++)
           {
               iTemLen+=body.vInfo[i].policy.length();
               iTemLen+=body.vInfo[i].value.length();
           }
           iTemLen = PROPERTY_PROTOCOL_LEN + body.vInfo.size(); //
           iLen = iLen + iTemLen;
           if(iLen > _maxReportSize) //不能超过udp 1472
           {
               if(_propertyPrx)
               {
                   TLOGINFO("[TARS][StatReport::reportPropMsg send size:" << mTemp.size()<<"]"<< endl);
                   _propertyPrx->tars_set_timeout(_reportTimeout)->async_reportPropMsg(NULL,mTemp);
               }
               iLen = iTemLen;
               mTemp.clear();
           }
           mTemp[it->first] = it->second;
       }
       if(0 != (int)mTemp.size())
       {
           if(_propertyPrx)
           {
               TLOGINFO("[TARS][StatReport::reportPropMsg send size:" << mTemp.size()<< "]"<< endl);
               _propertyPrx->tars_set_timeout(_reportTimeout)->async_reportPropMsg(NULL,mTemp);
           }
       }
       return 0;
    }
    catch ( exception& e )
    {
        TLOGERROR("StatReport::reportPropMsg catch exception:" << e.what() << endl);
    }
    catch ( ... )
    {
        TLOGERROR("StatReport::reportPropMsg catch unkown exception" << endl);
    }
    return -1;
}

int StatReport::reportSampleMsg()
{
    try
    {
        MMapStatSampleMsg mmStatSampleMsg;
        {
            Lock lock(*this);
            _statSampleMsg.swap(mmStatSampleMsg);
        }

        TLOGINFO("[TARS][StatReport::reportSampleMsg get size:" << mmStatSampleMsg.size()<<"]"<< endl);

        int iLen = 0;
        vector<StatSampleMsg> vTemp;
        for(MMapStatSampleMsg::const_iterator it = mmStatSampleMsg.begin() ;it != mmStatSampleMsg.end();++it)
        {
           StatSampleMsg sample =  it->second;
           int iTemLen = STAT_PROTOCOL_LEN +sample.masterName.length() + sample.slaveName.length() + sample.interfaceName.length();
           iLen = iLen + iTemLen;
           if(iLen > _maxReportSize) //不能超过udp 1472
           {
               if(_statPrx)
               {
                   TLOGINFO("[TARS][StatReport::reportSampleMsg send size:" << vTemp.size()<< "]"<< endl);
                   _statPrx->tars_set_timeout(_reportTimeout)->async_reportSampleMsg(NULL,vTemp);
               }
               iLen = iTemLen;
               vTemp.clear();
           }
           vTemp.push_back(sample);
        }
        if(0 != (int)vTemp.size())
        {
           if(_statPrx)
           {
               TLOGINFO("[TARS][StatReport::reportSampleMsg send size:" << vTemp.size()<< "]"<< endl);
               _statPrx->tars_set_timeout(_reportTimeout)->async_reportSampleMsg(NULL,vTemp);
           }
        }

        return 0;
    }
    catch ( exception& e )
    {
        TLOGERROR("StatReport::reportSampleMsg catch exception:" << e.what() << endl);
    }
    catch ( ... )
    {
        TLOGERROR("StatReport::reportSampleMsg catch unkown exception" << endl);
    }
    return -1;
}

void StatReport::addMicMsg(MapStatMicMsg & old,MapStatMicMsg & add)
{
    MapStatMicMsg::iterator iter;
    MapStatMicMsg::iterator iterOld;
    iter = add.begin();
    for(;iter != add.end();++iter)
    {
        iterOld = old.find(iter->first);
        if(iterOld == old.end())
        {
            //直接insert
            old.insert(make_pair(iter->first,iter->second));
        }
        else
        {
            //合并
            iterOld->second.count += iter->second.count;
            iterOld->second.timeoutCount += iter->second.timeoutCount;
            iterOld->second.execCount += iter->second.execCount;

            map<int,int>::iterator iterOldInt,iterInt;
            map<int,int> & mCount = iter->second.intervalCount;
            map<int,int> & mCountOld = iterOld->second.intervalCount;
            iterInt = mCount.begin();
            for(;iterInt != mCount.end();++iterInt)
            {
                iterOldInt = mCountOld.find(iterInt->first);
                if(iterOldInt == mCountOld.end())
                {
                    mCountOld.insert(make_pair(iterInt->first,iterInt->second));
                }
                else
                {
                    iterOldInt->second += iterInt->second;
                }
            }

            iterOld->second.totalRspTime += iter->second.totalRspTime;

            if(iterOld->second.maxRspTime < iter->second.maxRspTime)
                iterOld->second.maxRspTime = iter->second.maxRspTime;

            if(iterOld->second.minRspTime > iter->second.minRspTime)
                iterOld->second.minRspTime = iter->second.minRspTime;
        }
    }
}

void StatReport::run()
{
    while(!_terminate)
    {
        try
        {
            time_t tNow = TNOW;

            if(tNow - _time > _reportInterval/1000)
            {
                reportMicMsg(_statMicMsgClient, true);

                reportMicMsg(_statMicMsgServer, false);

                MapStatMicMsg mStatMsg;

                for(size_t i = 0; i < _epollNum; ++i)
                {
                    MapStatMicMsg * pStatMsg;
                    while(_statMsg[i]->pop_front(pStatMsg))
                    {
                        addMicMsg(mStatMsg,*pStatMsg);
                        delete pStatMsg;
                    }
                }
#if 0

                ostringstream os;
                MapStatMicMsg::iterator iter;
                iter = mStatMsg.begin();
                for(;iter != mStatMsg.end();++iter)
                {
                    iter->first.display(os);
                    os<<endl;
                    iter->second.display(os);
                    os<<endl<<endl;
                }

                TLOGDEBUG("StatReport::run() msg:"<<os.str()<<endl);
#endif
                reportMicMsg(mStatMsg, true);

                reportPropMsg();

                reportSampleMsg();

                _time = tNow;
            }

            Lock lock(*this);

            timedWait(1000);
        }
        catch ( exception& e )
        {
            TLOGERROR("StatReport::run catch exception:" << e.what() << endl);
        }
        catch ( ... )
        {
            TLOGERROR("StatReport::run catch unkown exception" << endl);
        }
    }
}

////////////////////////////////////////////////////////////////
}


text:
@class WindRewardInfo;
@class WindAdRequest;
@protocol WindRewardVideoAdAdapter;

@protocol WindRewardVideoAdConnector<WindAdRequestProtocol>

@optional

- (void)adapterDidSetUpRewardVideoAd:(id<WindRewardVideoAdAdapter>)rewardVideoAdAdapter;

- (void)adapter:(id<WindRewardVideoAdAdapter>)rewardVideoAdAdapter didFailToSetUpRewardVideoAd:(NSError *)error;

- (void)adapterDidAdClick:(id<WindRewardVideoAdAdapter>)adapter placementId:(NSString *)placementId;

- (void)adapterDidReceiveRewardVideoAd:(id<WindRewardVideoAdAdapter>)rewardVideoAdAdapter placementId:(NSString *)placementId;

- (void)adapterDidStartPlayingRewardVideoAd:(id<WindRewardVideoAdAdapter>)rewardVideoAdAdapter placementId:(NSString *)placementId;

- (void)adapterDidCloseRewardVideoAd:(id<WindRewardVideoAdAdapter>)rewardVideoAdAdapter rewardInfo:(WindRewardInfo *)info placementId:(NSString *)placementId;

- (void)adapter:(id<WindRewardVideoAdAdapter>)rewardVideoAdAdapter didFailToLoadRewardVideoAdwithError:(NSError *)error placementId:(NSString *)placementId;

- (void)adapter:(id<WindRewardVideoAdAdapter>)rewardVideoAdAdapter didPlayRewardVideoAdwithError:(NSError *)error placementId:(NSString *)placementId;

- (void)adapterDidCompletePlayingRewardVideoAd:(id<WindRewardVideoAdAdapter>)rewardVideoAdAdapter placementId:(NSString *)placementId;

- (void)adapterRewardedVideoAdServerDidSucceed:(id<WindRewardVideoAdAdapter>)rewardVideoAdAdapter placementId:(NSString *)placementId;

- (void)adapterRewardedVideoAdServerDidFail:(id<WindRewardVideoAdAdapter>)rewardVideoAdAdapter placementId:(NSString *)placementId;

@end

redpajama_set_name: RedPajamaGithub


text:
(async function() {
  TestRunner.addResult(
      `Tests that CSSParser correctly parses declarations with unterminated strings. Blink bug 231127\n`);
  await TestRunner.loadLegacyModule('elements'); await TestRunner.loadTestModule('elements_test_runner');
  await TestRunner.showPanel('elements');
  await TestRunner.loadHTML(`

    `);

  ElementsTestRunner.selectNodeAndWaitForStyles('inspected', dumpStyles);

  async function dumpStyles() {
    await ElementsTestRunner.dumpSelectedElementStyles(true);
    TestRunner.completeTest();
  }
})();


text:
package com.avsystem.commons.misc

import com.avsystem.commons.JInteger
import org.scalatest.funsuite.AnyFunSuite

class OptRefTest extends AnyFunSuite {
  test("nonempty test") {
    val opt = OptRef("lol")
    opt match {
      case OptRef(str) => assert(str == "lol")
    }
  }

  test("empty test") {
    val str: String = null
    val opt = OptRef(str)
    opt match {
      case OptRef.Empty =>
    }
  }

  test("null some test") {
    intercept[NullPointerException](OptRef.some[String](null))
  }

  test("unboxing matching test") {
    val opt = OptRef[JInteger](42)
    opt match {
      case OptRef.Boxed(num) => assert(num == 42)
    }
  }

  test("zip") {
    assert(OptRef[JInteger](3).zip(OptRef[JInteger](2)) == OptRef((3, 2)))
    assert(OptRef.Empty.zip(OptRef[JInteger](2)) == OptRef.Empty)
    assert(OptRef[JInteger](3).zip(OptRef.Empty) == OptRef.Empty)
  }
}


text:
package bio.terra.workspace.service.spendprofile;

import bio.terra.common.exception.ValidationException;
import bio.terra.profile.api.ProfileApi;
import bio.terra.profile.client.ApiClient;
import bio.terra.profile.client.ApiException;
import bio.terra.profile.model.CreateProfileRequest;
import bio.terra.profile.model.ProfileModel;
import bio.terra.workspace.app.configuration.external.SpendProfileConfiguration;
import bio.terra.workspace.service.iam.AuthenticatedUserRequest;
import bio.terra.workspace.service.iam.SamRethrow;
import bio.terra.workspace.service.iam.SamService;
import bio.terra.workspace.service.iam.model.SamConstants;
import bio.terra.workspace.service.spendprofile.exceptions.BillingProfileManagerServiceAPIException;
import bio.terra.workspace.service.spendprofile.exceptions.SpendUnauthorizedException;
import bio.terra.workspace.service.workspace.model.CloudPlatform;
import com.google.api.client.util.Strings;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Maps;
import io.opencensus.contrib.http.jaxrs.JaxrsClientExtractor;
import io.opencensus.contrib.http.jaxrs.JaxrsClientFilter;
import io.opencensus.contrib.spring.aop.Traced;
import io.opencensus.trace.Tracing;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import javax.ws.rs.client.Client;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;

/**
 * A service for retrieving and authorizing the use of {@link SpendProfile}s.
 *
 * <p>If enabled, calls out to Billing Profile Manager to fetch the relevant spend data. Otherwise,
 * fetches from our in-memory configuration.
 */
@Component
public class SpendProfileService {
  private final Logger logger = LoggerFactory.getLogger(SpendProfileService.class);
  private final SamService samService;
  private final Map<SpendProfileId, SpendProfile> spendProfiles;
  private final SpendProfileConfiguration spendProfileConfiguration;
  private final Client commonHttpClient;

  @Autowired
  public SpendProfileService(
      SamService samService, SpendProfileConfiguration spendProfileConfiguration) {
    this(
        samService,
        adaptConfigurationModels(spendProfileConfiguration.getSpendProfiles()),
        spendProfileConfiguration);
  }

  public SpendProfileService(
      SamService samService,
      List<SpendProfile> spendProfiles,
      SpendProfileConfiguration spendProfileConfiguration) {
    this.samService = samService;
    this.spendProfiles = Maps.uniqueIndex(spendProfiles, SpendProfile::id);
    this.spendProfileConfiguration = spendProfileConfiguration;

    this.commonHttpClient =
        new ApiClient()
            .getHttpClient()
            .register(
                new JaxrsClientFilter(
                    new JaxrsClientExtractor(), Tracing.getPropagationComponent().getB3Format()));
  }

  /**
   * Authorize the user to link the Spend Profile. Returns the {@link SpendProfile} associated with
   * the id if there is one and the user is authorized to link it. Otherwise, throws a {@link
   * SpendUnauthorizedException}.
   */
  @Traced
  public SpendProfile authorizeLinking(
      SpendProfileId spendProfileId, boolean bpmEnabled, AuthenticatedUserRequest userRequest) {

    SpendProfile spend;
    if (bpmEnabled) {
      // profiles returned from BPM means we are auth'ed
      spend = getSpendProfileFromBpm(userRequest, spendProfileId);
    } else {
      if (!SamRethrow.onInterrupted(
          () ->
              samService.isAuthorized(
                  userRequest,
                  SamConstants.SamResource.SPEND_PROFILE,
                  spendProfileId.getId(),
                  SamConstants.SamSpendProfileAction.LINK),
          "isAuthorized")) {
        throw SpendUnauthorizedException.linkUnauthorized(spendProfileId);
      }
      spend = spendProfiles.get(spendProfileId);
    }

    if (spend == null) {
      // We throw an unauthorized exception when we do not know about the Spend Profile to match
      // Sam's behavior. Sam authz check does not reveal if the resource does not exist vs the user
      // does not have access to it. In practice, however, something is probably misconfigured on
      // Workspace Manager if the authz check from Sam passes but we don't know about the spend
      // profile, so log a warning to help debug.
      logger.warn("Sam spend link authz succeeded but spend profile unknown: {}", spendProfileId);
      throw SpendUnauthorizedException.linkUnauthorized(spendProfileId);
    }
    return spend;
  }

  private static List<SpendProfile> adaptConfigurationModels(
      List<SpendProfileConfiguration.SpendProfileModel> spendModels) {
    return spendModels.stream()
        .filter(
            // filter out empty profiles
            spendModel ->
                !Strings.isNullOrEmpty(spendModel.getBillingAccountId())
                    && !Strings.isNullOrEmpty(spendModel.getId()))
        .map(
            spendModel ->
                new SpendProfile(
                    new SpendProfileId(spendModel.getId()),
                    CloudPlatform.GCP,
                    spendModel.getBillingAccountId(),
                    null,
                    null,
                    null))
        .collect(Collectors.toList());
  }

  @Traced
  private SpendProfile getSpendProfileFromBpm(
      AuthenticatedUserRequest userRequest, SpendProfileId spendProfileId) {
    SpendProfile spend;
    var profileApi = getProfileApi(userRequest);
    try {
      var profile = profileApi.getProfile(UUID.fromString(spendProfileId.getId()));
      logger.info(
          "Retrieved billing profile ID {} from billing profile manager",
          profile.getId().toString());
      spend =
          new SpendProfile(
              spendProfileId,
              getProfileCloudPlatform(profile),
              profile.getBillingAccountId(),
              profile.getTenantId(),
              profile.getSubscriptionId(),
              profile.getManagedResourceGroupId());
    } catch (ApiException ex) {
      if (ex.getCode() == HttpStatus.FORBIDDEN.value()) {
        return null;
      } else {
        throw new BillingProfileManagerServiceAPIException(ex);
      }
    }

    return spend;
  }

  private CloudPlatform getProfileCloudPlatform(ProfileModel profile) {
    if (profile.getCloudPlatform().equals(bio.terra.profile.model.CloudPlatform.GCP)) {
      return CloudPlatform.GCP;
    } else if (profile.getCloudPlatform().equals(bio.terra.profile.model.CloudPlatform.AZURE)) {
      return CloudPlatform.AZURE;
    } else {
      throw new ValidationException(
          String.format(
              "Invalid cloud platform for billing profile id %s: %s ",
              profile.getId().toString(), profile.getCloudPlatform().getValue()));
    }
  }

  /**
   * Creates a spend profile via the billing profile manager service, intended for usage in tests
   * only.
   */
  @VisibleForTesting
  public SpendProfile createGcpSpendProfile(
      String billingAccountId,
      String displayName,
      String biller,
      AuthenticatedUserRequest userRequest) {
    CreateProfileRequest req =
        new CreateProfileRequest()
            .id(UUID.randomUUID())
            .billingAccountId(billingAccountId)
            .displayName(displayName)
            .biller(biller)
            .cloudPlatform(bio.terra.profile.model.CloudPlatform.GCP);
    try {
      var rawModel = getProfileApi(userRequest).createProfile(req);
      return SpendProfile.buildGcpSpendProfile(
          new SpendProfileId(rawModel.getId().toString()), rawModel.getBillingAccountId());
    } catch (ApiException e) {
      throw new BillingProfileManagerServiceAPIException(e);
    }
  }

  /** Deletes a profile in the billing profile manager service, intended for usage in tests only */
  @VisibleForTesting
  public void deleteProfile(UUID profileId, AuthenticatedUserRequest userRequest) {
    try {
      getProfileApi(userRequest).deleteProfile(profileId);
    } catch (ApiException e) {
      throw new BillingProfileManagerServiceAPIException(e);
    }
  }

  private ApiClient getApiClient(String accessToken) {
    ApiClient apiClient = new ApiClient().setHttpClient(commonHttpClient);
    apiClient.setAccessToken(accessToken);
    apiClient.setBasePath(this.spendProfileConfiguration.getBasePath());
    return apiClient;
  }

  private ProfileApi getProfileApi(AuthenticatedUserRequest userRequest) {
    return new ProfileApi(getApiClient(userRequest.getRequiredToken()));
  }
}


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping default-lazy="false" auto-import="false">
	<import class="com.opnitech.release.services.model.Foo1" />
	<class name="com.opnitech.release.services.model.impl.Foo1Impl" table="release_dependency_management_Foo1">
		<cache usage="read-write" />
		<id name="fooId" type="long">
			<generator class="assigned" />
		</id>
		<property name="uuid" type="com.liferay.portal.dao.orm.hibernate.StringType" column="uuid_" />
		<property name="groupId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
		<property name="companyId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
		<property name="userId" type="com.liferay.portal.dao.orm.hibernate.LongType" />
		<property name="userName" type="com.liferay.portal.dao.orm.hibernate.StringType" />
		<property name="createDate" type="org.hibernate.type.TimestampType" />
		<property name="modifiedDate" type="org.hibernate.type.TimestampType" />
		<property name="field1" type="com.liferay.portal.dao.orm.hibernate.StringType" />
		<property name="field2" type="com.liferay.portal.dao.orm.hibernate.BooleanType" />
		<property name="field3" type="com.liferay.portal.dao.orm.hibernate.IntegerType" />
		<property name="field4" type="org.hibernate.type.TimestampType" />
		<property name="field5" type="com.liferay.portal.dao.orm.hibernate.StringType" />
		<property name="test" type="com.liferay.portal.dao.orm.hibernate.BooleanType" />
	</class>
</hibernate-mapping>


text:
package controle.telas;

import java.math.BigDecimal;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;

import controle.dao.AjusteEstoqueProdutoFinalDao;
import controle.modelos.AjusteEstoqueProdutoFinal;
import controle.modelos.ProdutoFinal;
import controle.modelos.Unidade;
import controle.uteis.BigDecimalConverter;
import controle.uteis.Interface;

public class AnalisarEstoqueProdutoFinalAction extends AnalisarEstoqueProdutoFinal{

	private ProdutoFinal produto;
	private AjusteEstoqueProdutoFinalDao daoAjuste = new AjusteEstoqueProdutoFinalDao();
	private List<AjusteEstoqueProdutoFinal> list = new ArrayList<>();

	public AnalisarEstoqueProdutoFinalAction(Shell pai, ProdutoFinal produto) {
		super(pai);
		this.produto = Objects.requireNonNull(produto);
		adicionarEventosButton();
		popularDados();
		shell.open();
		Interface.manterJanelaModal(shell);
	}

	private void adicionarEventosButton(){
		btnFechar.addSelectionListener(new SelectionAdapter(){
			public void widgetSelected(SelectionEvent e) {
				shell.close();
			}
		});
	}

	private void popularDados(){
		DateTimeFormatter formatoDataHora = DateTimeFormatter.ofPattern("dd/MM/yyyy hh:mm");
		lblItem.setText(produto.getNome());
		BigDecimal total = daoAjuste.apurarQuantidade(produto);
		lblTotal.setText(total.toPlainString());
		list = daoAjuste.pesquisar(produto);
		list.forEach(ae -> {
			TableItem ti = new TableItem(table, SWT.NONE);
			ti.setText(0, formatoDataHora.format(ae.getDataHora()));
			ti.setText(1, formatarQuantidade(ae));
			ti.setText(2, ae.isEntrada() ? "E" : "S");
		});
	}

	private String formatarQuantidade(AjusteEstoqueProdutoFinal ae) {
		StringBuilder sb = new StringBuilder();
		sb.append(ae.isEntrada() ? "" : "-");
		boolean isDecimal = ae.getProdutoFinal().getUnidade().equals(Unidade.KILOS);
		sb.append(BigDecimalConverter.bigDecimalToString(ae.getQuantidade(), isDecimal ? 4 : 0));
		return sb.toString();
	}

}


text:
namespace NetOfficeTools.ExtendedAccessCS4
{
    partial class SamplePane
    {
        /// <summary>
        /// Erforderliche Designervariable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Verwendete Ressourcen bereinigen.
        /// </summary>
        /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Vom Komponenten-Designer generierter Code

        /// <summary>
        /// Erforderliche Methode für die Designerunterstützung.
        /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SamplePane));
            this.timerRunningTime = new System.Windows.Forms.Timer(this.components);
            this.labelTime = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.buttonEnabled = new System.Windows.Forms.Button();
            this.imageListButtons = new System.Windows.Forms.ImageList(this.components);
            this.buttonReset = new System.Windows.Forms.Button();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.labelHint = new System.Windows.Forms.Label();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            //
            // timerRunningTime
            //
            this.timerRunningTime.Interval = 900;
            this.timerRunningTime.Tick += new System.EventHandler(this.timerRunningTime_Tick);
            //
            // labelTime
            //
            this.labelTime.AutoSize = true;
            this.labelTime.BackColor = System.Drawing.Color.Transparent;
            this.labelTime.ForeColor = System.Drawing.Color.Blue;
            this.labelTime.Location = new System.Drawing.Point(371, 7);
            this.labelTime.Name = "labelTime";
            this.labelTime.Size = new System.Drawing.Size(58, 16);
            this.labelTime.TabIndex = 1;
            this.labelTime.Text = "00:00:00";
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.ForeColor = System.Drawing.Color.Blue;
            this.label1.Location = new System.Drawing.Point(279, 7);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(91, 16);
            this.label1.TabIndex = 2;
            this.label1.Text = "Running Time:";
            //
            // buttonEnabled
            //
            this.buttonEnabled.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)));
            this.buttonEnabled.FlatAppearance.BorderColor = System.Drawing.Color.White;
            this.buttonEnabled.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonEnabled.ForeColor = System.Drawing.Color.Blue;
            this.buttonEnabled.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.buttonEnabled.ImageKey = "alarmclock_run.png";
            this.buttonEnabled.ImageList = this.imageListButtons;
            this.buttonEnabled.Location = new System.Drawing.Point(0, 0);
            this.buttonEnabled.Margin = new System.Windows.Forms.Padding(2);
            this.buttonEnabled.Name = "buttonEnabled";
            this.buttonEnabled.Size = new System.Drawing.Size(126, 30);
            this.buttonEnabled.TabIndex = 0;
            this.buttonEnabled.Text = "Enable";
            this.buttonEnabled.UseVisualStyleBackColor = true;
            this.buttonEnabled.Click += new System.EventHandler(this.buttonEnabled_Click);
            //
            // imageListButtons
            //
            this.imageListButtons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListButtons.ImageStream")));
            this.imageListButtons.TransparentColor = System.Drawing.Color.Transparent;
            this.imageListButtons.Images.SetKeyName(0, "alarmclock_run.png");
            this.imageListButtons.Images.SetKeyName(1, "alarmclock_stop.png");
            this.imageListButtons.Images.SetKeyName(2, "delete2.png");
            //
            // buttonReset
            //
            this.buttonReset.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)));
            this.buttonReset.FlatAppearance.BorderColor = System.Drawing.Color.White;
            this.buttonReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonReset.ForeColor = System.Drawing.Color.Blue;
            this.buttonReset.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.buttonReset.ImageKey = "delete2.png";
            this.buttonReset.ImageList = this.imageListButtons;
            this.buttonReset.Location = new System.Drawing.Point(127, 0);
            this.buttonReset.Margin = new System.Windows.Forms.Padding(2);
            this.buttonReset.Name = "buttonReset";
            this.buttonReset.Size = new System.Drawing.Size(126, 30);
            this.buttonReset.TabIndex = 3;
            this.buttonReset.Text = "Reset";
            this.buttonReset.UseVisualStyleBackColor = true;
            this.buttonReset.Click += new System.EventHandler(this.buttonReset_Click);
            //
            // pictureBox1
            //
            this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
            this.pictureBox1.Location = new System.Drawing.Point(509, 7);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(20, 17);
            this.pictureBox1.TabIndex = 4;
            this.pictureBox1.TabStop = false;
            //
            // labelHint
            //
            this.labelHint.AutoSize = true;
            this.labelHint.ForeColor = System.Drawing.Color.Blue;
            this.labelHint.Location = new System.Drawing.Point(529, 7);
            this.labelHint.Name = "labelHint";
            this.labelHint.Size = new System.Drawing.Size(248, 16);
            this.labelHint.TabIndex = 5;
            this.labelHint.Text = "NetOffice Tools - Extended Sample Addin";
            //
            // SamplePane
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.labelHint);
            this.Controls.Add(this.pictureBox1);
            this.Controls.Add(this.buttonReset);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.labelTime);
            this.Controls.Add(this.buttonEnabled);
            this.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.Name = "SamplePane";
            this.Size = new System.Drawing.Size(807, 30);
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Timer timerRunningTime;
        private System.Windows.Forms.Label labelTime;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button buttonEnabled;
        private System.Windows.Forms.Button buttonReset;
        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.Label labelHint;
        private System.Windows.Forms.ImageList imageListButtons;
    }
}


text:
package cn.updev.Action.Event;

import cn.updev.EventWeight.Rate.EventGroupRate;
import cn.updev.Users.Static.FuctionClass.Login;
import cn.updev.Users.Static.UserOrGroupDAO.UserOrGroupQuery;
import cn.updev.Users.Static.UserOrGroupInterface.IGroupInfo;
import cn.updev.Users.Static.UserOrGroupInterface.IGroupUser;
import cn.updev.Users.Static.UserOrGroupInterface.IUser;
import cn.updev.Users.User.GroupUserInfo;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by hypo on 15-12-4.
 */
public class TeamTaskAction extends ActionSupport {

    private Integer groupId;

    public String addTask(){

        Login login = new Login();

        if(login.isNotLogined()){
            return LOGIN;
        }

        IUser user = login.getLoginedUser();

        HttpServletRequest request = ServletActionContext.getRequest();

        if(groupId == null || groupId < 1){

            List<IGroupInfo> groupInfoList = new UserOrGroupQuery().queryGroupAllUserJoined(user.getUserId());
            List<IGroupInfo> createGroup = new ArrayList<IGroupInfo>();
            List<IGroupInfo> manageGroup = new ArrayList<IGroupInfo>();
            List<IGroupInfo> joinGroup = new ArrayList<IGroupInfo>();

            for(IGroupInfo info : groupInfoList){
                UserOrGroupQuery DAO = new UserOrGroupQuery();
                IGroupUser groupUser = DAO.queryGroupUser(user.getUserId(), info.getGroupId());

                if(groupUser.isCreater()){
                    createGroup.add(info);
                }else if(groupUser.isAdmin()){
                    manageGroup.add(info);
                }else if(groupUser.isUser()){
                    joinGroup.add(info);
                }
            }

            request.setAttribute("createGroup",createGroup);
            request.setAttribute("manageGroup",manageGroup);
            request.setAttribute("joinGroup",joinGroup);

            return INPUT;
        }

        // 获取团队信息
        UserOrGroupQuery DAO = new UserOrGroupQuery();
        IGroupInfo groupInfo = DAO.queryGroupInfoById(groupId);

        request.setAttribute("groupInfo",groupInfo);

        return SUCCESS;

    }

    public Integer getGroupId() {
        return groupId;
    }

    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }
}


text:
See also "[How Shipkit Works](/docs/how-shipkit-works.md)" documentation index.
Please help us with docs and submit a PR with improvements!

Your users need to know documentation of your project. You want release documentation?
Write it as Javadoc and publish to separate (or the same) repo. Make it available for everyone.

#### Intro

Gradle build generate Jar with Javadoc by default.
Shipkit allows you to push your unpacked Javadoc in HTML format to the GitHub repository/brach.
So that [GitHub Pages](https://pages.github.com/) can show browsable, readable HTML Javadocs for your users right
after each release.

#### Nitty gritty

We are recommending to create separate repository for your project, e.g.: yourOrg/yourProject-javadoc and publish
Javadoc there.
Or if you use GitHub Pages then you can publish Javadocs to your Project GitHub Page.
There is also a possibility to publish Javadocs to the same repository, but in that case your repo will grow very fast.

#### User guide

To enable shipping Javadoc, you need to apply Javadoc plugin in your ```build.gradle``` in root project:

```gradle
apply plugin: "org.shipkit.java"
// enable Shipkit Javadoc plugin. Now Javadoc can be shipped to the GitHub repository
// this plugin should be applied AFTER org.shipkit.java
apply plugin: "org.shipkit.javadoc"
```

Now you can configure your Javadoc repository in ```gradle/shipkit.gradle```:

```gradle
shipkit {
    gitHub.repository = "mockito/shipkit-example"
    // ...

    // OPTIONAL GitHub repository (owner/repo) where Javadocs are shipped.
    // To enable shipping Javadoc you need to apply Javadoc plugin first:
    // apply plugin: "org.shipkit.javadoc"
    // The default value is gitHub.repository + "-javadoc", so in this project case:
    // https://github.com/mockito/shipkit-example-javadoc
    javadoc.repository = "mockito/shipkit-example-javadoc"

    // OPTIONAL GitHub Javadoc repository branch name. The branch needs to exist.
    // By default it's using the branch set as main in GitHub repo, usually master.
    // To enable shipping Javadoc you need to apply Javadoc plugin first:
    // apply plugin: "org.shipkit.javadoc"
    javadoc.repositoryBranch = "gh-pages"

    // OPTIONAL GitHub Javadoc repository directory where put javadoc files. By default it's project root directory.
    // To enable shipping Javadoc you need to apply Javadoc plugin first:
    // apply plugin: "org.shipkit.javadoc"
    javadoc.repositoryDirectory = "dir1/dir2"

    // OPTIONAL Commit message used to commit Javadocs. Default: "Update current and ${version} Javadocs. [ci skip]"
    // You can override this message and ${version} will be replaced by currently build version.
    // You don't need to specify "[ci skip]" in your message - it will be added automatically.
    // To enable shipping Javadoc you need to apply Javadoc plugin first:
    // apply plugin: "org.shipkit.javadoc"
    javadoc.commitMessage = "Update current and ${version} Javadocs."
}
```

Thank you for reading!
Questions or feedback?
Start discussion [by opening a ticket](https://github.com/mockito/shipkit/issues/new) in GitHub!


text:
<?php

namespace App\Facades;

use Illuminate\Support\Facades\Facade;

/**
 * Class User.
 */
class User extends Facade
{
    /**
     * Get the registered name of the component.
     *
     * @return string
     */
    protected static function getFacadeAccessor()
    {
        return 'chocouser';
    }
}


text:
<meta charset="UTF-8">
<meta name="author" content="Ivascu Adrian">
<title>Blog Italia - La mia vacanza</title>

Home

Blog Francia

La mia vacanza

Ah la Francia...

Ah.. la Francia.. Prima di venire in Italia, vivevo in Francia con mia madre. Quanti ricordi.. Da quel tempo, mia madre è partita in un posticello fuori Parigi. Perché? Perché lì c'è di tutto. Proprio tutto. A meno di 5 minuti di camminata si può trovare: grande centro commerciale con tutti i tipi di negozi possibili, posta, negozio alimentare (Carrefour, grande negozio come Esselunga), una grande piazza dove tantissimi praticano il skateboarding, il municipio, un parco, un grande lago che si può percorrere in barca oppure dove si trova gente che pesca, oppure c'è chi fa il giro del lago correndo o camminando, una stazione di metro, tante stazioni di bus, ospedale, scuole, palestra, bar e ristoranti. Impressionante.

Ho stampato del denaro

Eh già. Grazie al funzionamento dei bitcoins, si può creare e stampare dei biglietti di denaro. Basta creare un nuovo indirizzo, e copiare il codice QR, che poi viene photoshopato su un biglietto personalizzato.

Sto creando una app

Ho imparato un nuovo linguaggio di programmazione, cioè Dart. È un linguaggio molto bello e giovane. Assomiglia molto a JavaScript, però è più focalizzato sulla programmazione a oggetti. Ad esempio, si può anche omettere il tipo delle variabili e delle funzioni, oppure si possono passare dei parametri per il loro nome.

Ad esempio:
int calcola(int num1, int num2)
{
  return num1*num2;
}
int calcola2(int num1, int num2, int num3)
{
  return num1*num2*num3;
}

Si potrebbe scrivere così in Dart:
calcola(num1, num2, {num3})
{
  num3 != null ? return num1*num2*num3 : return num1*num2;
}

print(calcola(num3: 5, 4, 3));

È molto elegante e bello da scrivere e da vedere.

Ancora sta valigia

Ultima destinazione : Romania. Mia madre ha preso un biglietto di aereo, anzi due. Si volaaa!

< Italia

> Romania

^ Andare all'inizio della pagina ^

Copyright ©Ivascu


text:
using namespace Gaffer;
using namespace GafferScene;
using namespace GafferVDB;
using namespace Imath;
using namespace IECore;
using namespace IECoreScene;
using namespace IECoreVDB;

IE_CORE_DEFINERUNTIMETYPED( SphereLevelSet );

size_t SphereLevelSet::g_firstPlugIndex = 0;

SphereLevelSet::SphereLevelSet( const std::string &name )
: ObjectSource( name, "sphere" )
{
	storeIndexOfNextChild( g_firstPlugIndex );
	addChild( new StringPlug( "grid", Plug::In, "surface") );
	addChild( new FloatPlug( "radius", Plug::In, 1.0f, 0.0f ) );
	addChild( new V3fPlug( "center", Plug::In, V3f( 0.0f, 0.0f, 0.0f ) ) );
	addChild( new FloatPlug( "voxelSize", Plug::In, 0.1f, 0.0001f ) );
	addChild( new FloatPlug( "halfWidth", Plug::In, (float) openvdb::LEVEL_SET_HALF_WIDTH, 1.0001f ) );
}

SphereLevelSet::~SphereLevelSet()
{
}

Gaffer::StringPlug *SphereLevelSet::gridPlug()
{
	return getChild<StringPlug>( g_firstPlugIndex );
}

const Gaffer::StringPlug *SphereLevelSet::gridPlug() const
{
	return getChild<StringPlug>( g_firstPlugIndex );
}

Gaffer::FloatPlug *SphereLevelSet::radiusPlug()
{
	return getChild<FloatPlug>( g_firstPlugIndex + 1 );
}

const Gaffer::FloatPlug *SphereLevelSet::radiusPlug() const
{
	return getChild<FloatPlug>( g_firstPlugIndex + 1 );
}

Gaffer::V3fPlug *SphereLevelSet::centerPlug()
{
	return getChild<V3fPlug>( g_firstPlugIndex + 2 );
}

const Gaffer::V3fPlug *SphereLevelSet::centerPlug() const
{
	return getChild<V3fPlug>( g_firstPlugIndex + 2 );
}

Gaffer::FloatPlug *SphereLevelSet::voxelSizePlug()
{
	return getChild<FloatPlug>( g_firstPlugIndex + 3 );
}

const Gaffer::FloatPlug *SphereLevelSet::voxelSizePlug() const
{
	return getChild<FloatPlug>( g_firstPlugIndex + 3 );
}

Gaffer::FloatPlug *SphereLevelSet::halfWidthPlug()
{
	return getChild<FloatPlug>( g_firstPlugIndex + 4 );
}

const Gaffer::FloatPlug *SphereLevelSet::halfWidthPlug() const
{
	return getChild<FloatPlug>( g_firstPlugIndex + 4 );
}

void SphereLevelSet::affects( const Plug *input, AffectedPlugsContainer &outputs ) const
{
	ObjectSource::affects( input, outputs );

	if(
		input == gridPlug() ||
		input == radiusPlug() ||
		input->parent() == centerPlug() ||
		input == voxelSizePlug() ||
		input == halfWidthPlug()
	)
	{
		outputs.push_back( sourcePlug() );
	}
}

void SphereLevelSet::hashSource( const Gaffer::Context *context, IECore::MurmurHash &h ) const
{
	gridPlug()->hash( h );
	radiusPlug()->hash( h );
	centerPlug()->hash( h );
	voxelSizePlug()->hash( h );
	halfWidthPlug()->hash( h );
}

IECore::ConstObjectPtr SphereLevelSet::computeSource( const Context *context ) const
{
	Interrupter interrupter( context->canceller() );

	const auto center = centerPlug()->getValue();

	openvdb::FloatGrid::Ptr grid = openvdb::tools::createLevelSetSphere<openvdb::FloatGrid, Interrupter>(
		radiusPlug()->getValue(),
		openvdb::Vec3f(center.x, center.y, center.z),
		voxelSizePlug()->getValue(),
		halfWidthPlug()->getValue(),
		&interrupter
	);

	Canceller::check( context->canceller() );

	grid->addStatsMetadata();
	grid->setName( gridPlug()->getValue() );

	VDBObjectPtr newVDBObject = new VDBObject();
	newVDBObject->insertGrid( grid );

	return newVDBObject;

}


text:
<!doctype html>

  <meta charset="utf-8">
  <title>Angular-PertChartViewSampleApp</title>

  <base href="/GanttChartHyperLibrary/Demos/Samples/Angular/PertChartView/MainFeatures/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="styles.3ff695c00d717f2d2a11.css">

  <app-root></app-root>


text:
using System;

namespace NewsletterSender.WebApplication.DTO
{
    // DTO
    public interface IDto
    {
        // Identyfikator
        Guid Id { get; set; }
    }
}


text:
var shell   = require('shelljs'),
    fs      = require('fs'),
    url     = require('url'),
    plugins = require('./util/plugins'),
    xml_helpers = require('./util/xml-helpers'),
    metadata = require('./util/metadata'),
    path    = require('path'),
    Q       = require('q'),
    registry = require('./registry/registry');
// XXX: leave the require('../plugman') because jasmine shits itself if you declare it up top
// possible options: link, subdir, git_ref, client, expected_id
// Returns a promise.
module.exports = function fetchPlugin(plugin_src, plugins_dir, options) {
    // Ensure the containing directory exists.
    shell.mkdir('-p', plugins_dir);

    options = options || {};
    options.subdir = options.subdir || '.';
    options.searchpath = options.searchpath || [];
    if ( typeof options.searchpath === 'string' ) {
        options.searchpath = [ options.searchpath ];
    }

    // clone from git repository
    var uri = url.parse(plugin_src);

    // If the hash exists, it has the form from npm: http://foo.com/bar#git-ref[:subdir]
    // NB: No leading or trailing slash on the subdir.
    if (uri.hash) {
        var result = uri.hash.match(/^#([^:]*)(?::\/?(.*?)\/?)?$/);
        if (result) {
            if (result[1])
                options.git_ref = result[1];
            if(result[2])
                options.subdir = result[2];

            // Recurse and exit with the new options and truncated URL.
            var new_dir = plugin_src.substring(0, plugin_src.indexOf('#'));
            return fetchPlugin(new_dir, plugins_dir, options);
        }
    }

    // If it looks like a network URL, git clone it.
    if ( uri.protocol && uri.protocol != 'file:' && uri.protocol != 'c:' && !plugin_src.match(/^\w+:\\/)) {
        require('../plugman').emit('log', 'Fetching plugin "' + plugin_src + '" via git clone');
        if (options.link) {
            return Q.reject(new Error('--link is not supported for git URLs'));
        } else {
            var data = {
                source: {
                    type: 'git',
                    url:  plugin_src,
                    subdir: options.subdir,
                    ref: options.git_ref
                }
            };

            return plugins.clonePluginGitRepo(plugin_src, plugins_dir, options.subdir, options.git_ref)
            .then(function(dir) {
                return checkID(options.expected_id, dir);
            })
            .then(function(dir) {
                metadata.save_fetch_metadata(dir, data);
                return dir;
            });
        }
    } else {
        // If it's not a network URL, it's either a local path or a plugin ID.

        var p,  // The Q promise to be returned.
            linkable = true,
            plugin_dir = path.join(plugin_src, options.subdir);

        if (fs.existsSync(plugin_dir)) {
            p = Q(plugin_dir);
        } else {
            // If there is no such local path, it's a plugin id.
            // First look for it in the local search path (if provided).
            var local_dir = findLocalPlugin(plugin_src, options.searchpath);
            if (local_dir) {
                p = Q(local_dir);
                require('../plugman').emit('verbose', 'Found ' + plugin_src + ' at ' + local_dir);
            } else {
                // If not found in local search path, fetch from the registry.
                linkable = false;
                require('../plugman').emit('log', 'Fetching plugin "' + plugin_src + '" via plugin registry');
                p = registry.fetch([plugin_src], options.client);
            }
        }

        return p
        .then(function(dir) {
                return copyPlugin(dir, plugins_dir, options.link && linkable);
            })
        .then(function(dir) {
                return checkID(options.expected_id, dir);
            });
    }
};

function readId(dir) {
    var xml_path = path.join(dir, 'plugin.xml');
    var et = xml_helpers.parseElementtreeSync(path.join(dir, 'plugin.xml'));
    var plugin_id = et.getroot().attrib.id;
    return plugin_id;
}

// Helper function for checking expected plugin IDs against reality.
function checkID(expected_id, dir) {
    if ( expected_id ) {
        var id = readId(dir);
        if (expected_id != id) {
            throw new Error('Expected fetched plugin to have ID "' + expected_id + '" but got "' + id + '".');
        }
    }
    return dir;
}

var idCache = Object.create(null);
// Look for plugin in local search path.
function findLocalPlugin(plugin_id, searchpath) {
    function tryPath(p) {
        if (!(p in idCache)) {
            var id = null;
            if (fs.existsSync(path.join(p, 'plugin.xml'))) {
                id = readId(p);
            }
            idCache[p] = id;
        }
        return (plugin_id === idCache[p]);
    }

    for (var i = 0; i < searchpath.length; i++) {
        // Allow search path to point right to a plugin.
        if (tryPath(searchpath[i])) {
            return searchpath[i];
        }
        var files = fs.readdirSync(searchpath[i]);
        for (var j = 0; j < files.length; j++) {
            var pluginPath = path.join(searchpath[i], files[j]);
            if (tryPath(pluginPath)) {
                return pluginPath;
            }
        }
    }
    return null;
}

// Copy or link a plugin from plugin_dir to plugins_dir/plugin_id.
function copyPlugin(plugin_dir, plugins_dir, link) {
    var plugin_id = readId(plugin_dir);
    var dest = path.join(plugins_dir, plugin_id);
    shell.rm('-rf', dest);
    if (link) {
        require('../plugman').emit('verbose', 'Linking plugin "' + plugin_dir + '" => "' + dest + '"');
        fs.symlinkSync(plugin_dir, dest, 'dir');
    } else {
        shell.mkdir('-p', dest);
        require('../plugman').emit('verbose', 'Copying plugin "' + plugin_dir + '" => "' + dest + '"');
        shell.cp('-R', path.join(plugin_dir, '*') , dest);
    }

    var data = {
        source: {
        type: 'local',
              path: plugin_dir
        }
    };
    metadata.save_fetch_metadata(dest, data);
    return dest;
}


text:
package org.apache.hadoop.hbase.client;

import java.util.Map;

import org.apache.hadoop.hbase.TableName;
import org.apache.yetus.audience.InterfaceAudience;

import org.apache.hbase.thirdparty.org.apache.commons.collections4.MapUtils;

/**
 * The POJO equivalent of HBaseProtos.SnapshotDescription
 */
@InterfaceAudience.Public
public class SnapshotDescription {
  private final String name;
  private final TableName table;
  private final SnapshotType snapShotType;
  private final String owner;
  private final long creationTime;
  private final long ttl;
  private final int version;

  public SnapshotDescription(String name) {
    this(name, (TableName)null);
  }

  public SnapshotDescription(String name, TableName table) {
    this(name, table, SnapshotType.DISABLED, null, -1, -1, null);
  }

  public SnapshotDescription(String name, TableName table, SnapshotType type) {
    this(name, table, type, null, -1, -1, null);
  }

  public SnapshotDescription(String name, TableName table, SnapshotType type, String owner) {
    this(name, table, type, owner, -1, -1, null);
  }

  /**
   * SnapshotDescription Parameterized Constructor
   *
   * @param name          Name of the snapshot
   * @param table         TableName associated with the snapshot
   * @param type          Type of the snapshot - enum SnapshotType
   * @param owner         Snapshot Owner
   * @param creationTime  Creation time for Snapshot
   * @param version       Snapshot Version
   * @param snapshotProps Additional properties for snapshot e.g. TTL
   */
  public SnapshotDescription(String name, TableName table, SnapshotType type, String owner,
                             long creationTime, int version, Map<String, Object> snapshotProps) {
    this.name = name;
    this.table = table;
    this.snapShotType = type;
    this.owner = owner;
    this.creationTime = creationTime;
    this.ttl = getTtlFromSnapshotProps(snapshotProps);
    this.version = version;
  }

  private long getTtlFromSnapshotProps(Map<String, Object> snapshotProps) {
    return MapUtils.getLongValue(snapshotProps, "TTL", -1);
  }

  /**
   * SnapshotDescription Parameterized Constructor
   *
   * @param snapshotName  Name of the snapshot
   * @param tableName     TableName associated with the snapshot
   * @param type          Type of the snapshot - enum SnapshotType
   * @param snapshotProps Additional properties for snapshot e.g. TTL
   */
  public SnapshotDescription(String snapshotName, TableName tableName, SnapshotType type,
                             Map<String, Object> snapshotProps) {
    this(snapshotName, tableName, type, null, -1, -1, snapshotProps);
  }

  public String getName() {
    return this.name;
  }

  public String getTableNameAsString() {
    return this.table.getNameAsString();
  }

  public TableName getTableName() {
    return this.table;
  }

  public SnapshotType getType() {
    return this.snapShotType;
  }

  public String getOwner() {
    return this.owner;
  }

  public long getCreationTime() {
    return this.creationTime;
  }

  // get snapshot ttl in sec
  public long getTtl() {
    return ttl;
  }

  public int getVersion() {
    return this.version;
  }

  @Override
  public String toString() {
    return new StringBuilder("SnapshotDescription: ")
            .append("name = ")
            .append(name)
            .append("/table = ")
            .append(table)
            .append(" /owner = ")
            .append(owner)
            .append(creationTime != -1 ? ("/creationtime = " + creationTime) : "")
            .append(ttl != -1 ? ("/ttl = " + ttl) : "")
            .append(version != -1 ? ("/version = " + version) : "")
            .toString();
  }
}


text:
#include <aws/support/model/CaseDetails.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace Support
{
namespace Model
{

CaseDetails::CaseDetails() :
    m_caseIdHasBeenSet(false),
    m_displayIdHasBeenSet(false),
    m_subjectHasBeenSet(false),
    m_statusHasBeenSet(false),
    m_serviceCodeHasBeenSet(false),
    m_categoryCodeHasBeenSet(false),
    m_severityCodeHasBeenSet(false),
    m_submittedByHasBeenSet(false),
    m_timeCreatedHasBeenSet(false),
    m_recentCommunicationsHasBeenSet(false),
    m_ccEmailAddressesHasBeenSet(false),
    m_languageHasBeenSet(false)
{
}

CaseDetails::CaseDetails(JsonView jsonValue) :
    m_caseIdHasBeenSet(false),
    m_displayIdHasBeenSet(false),
    m_subjectHasBeenSet(false),
    m_statusHasBeenSet(false),
    m_serviceCodeHasBeenSet(false),
    m_categoryCodeHasBeenSet(false),
    m_severityCodeHasBeenSet(false),
    m_submittedByHasBeenSet(false),
    m_timeCreatedHasBeenSet(false),
    m_recentCommunicationsHasBeenSet(false),
    m_ccEmailAddressesHasBeenSet(false),
    m_languageHasBeenSet(false)
{
  *this = jsonValue;
}

CaseDetails& CaseDetails::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("caseId"))
  {
    m_caseId = jsonValue.GetString("caseId");

    m_caseIdHasBeenSet = true;
  }

  if(jsonValue.ValueExists("displayId"))
  {
    m_displayId = jsonValue.GetString("displayId");

    m_displayIdHasBeenSet = true;
  }

  if(jsonValue.ValueExists("subject"))
  {
    m_subject = jsonValue.GetString("subject");

    m_subjectHasBeenSet = true;
  }

  if(jsonValue.ValueExists("status"))
  {
    m_status = jsonValue.GetString("status");

    m_statusHasBeenSet = true;
  }

  if(jsonValue.ValueExists("serviceCode"))
  {
    m_serviceCode = jsonValue.GetString("serviceCode");

    m_serviceCodeHasBeenSet = true;
  }

  if(jsonValue.ValueExists("categoryCode"))
  {
    m_categoryCode = jsonValue.GetString("categoryCode");

    m_categoryCodeHasBeenSet = true;
  }

  if(jsonValue.ValueExists("severityCode"))
  {
    m_severityCode = jsonValue.GetString("severityCode");

    m_severityCodeHasBeenSet = true;
  }

  if(jsonValue.ValueExists("submittedBy"))
  {
    m_submittedBy = jsonValue.GetString("submittedBy");

    m_submittedByHasBeenSet = true;
  }

  if(jsonValue.ValueExists("timeCreated"))
  {
    m_timeCreated = jsonValue.GetString("timeCreated");

    m_timeCreatedHasBeenSet = true;
  }

  if(jsonValue.ValueExists("recentCommunications"))
  {
    m_recentCommunications = jsonValue.GetObject("recentCommunications");

    m_recentCommunicationsHasBeenSet = true;
  }

  if(jsonValue.ValueExists("ccEmailAddresses"))
  {
    Array<JsonView> ccEmailAddressesJsonList = jsonValue.GetArray("ccEmailAddresses");
    for(unsigned ccEmailAddressesIndex = 0; ccEmailAddressesIndex < ccEmailAddressesJsonList.GetLength(); ++ccEmailAddressesIndex)
    {
      m_ccEmailAddresses.push_back(ccEmailAddressesJsonList[ccEmailAddressesIndex].AsString());
    }
    m_ccEmailAddressesHasBeenSet = true;
  }

  if(jsonValue.ValueExists("language"))
  {
    m_language = jsonValue.GetString("language");

    m_languageHasBeenSet = true;
  }

  return *this;
}

JsonValue CaseDetails::Jsonize() const
{
  JsonValue payload;

  if(m_caseIdHasBeenSet)
  {
   payload.WithString("caseId", m_caseId);

  }

  if(m_displayIdHasBeenSet)
  {
   payload.WithString("displayId", m_displayId);

  }

  if(m_subjectHasBeenSet)
  {
   payload.WithString("subject", m_subject);

  }

  if(m_statusHasBeenSet)
  {
   payload.WithString("status", m_status);

  }

  if(m_serviceCodeHasBeenSet)
  {
   payload.WithString("serviceCode", m_serviceCode);

  }

  if(m_categoryCodeHasBeenSet)
  {
   payload.WithString("categoryCode", m_categoryCode);

  }

  if(m_severityCodeHasBeenSet)
  {
   payload.WithString("severityCode", m_severityCode);

  }

  if(m_submittedByHasBeenSet)
  {
   payload.WithString("submittedBy", m_submittedBy);

  }

  if(m_timeCreatedHasBeenSet)
  {
   payload.WithString("timeCreated", m_timeCreated);

  }

  if(m_recentCommunicationsHasBeenSet)
  {
   payload.WithObject("recentCommunications", m_recentCommunications.Jsonize());

  }

  if(m_ccEmailAddressesHasBeenSet)
  {
   Array<JsonValue> ccEmailAddressesJsonList(m_ccEmailAddresses.size());
   for(unsigned ccEmailAddressesIndex = 0; ccEmailAddressesIndex < ccEmailAddressesJsonList.GetLength(); ++ccEmailAddressesIndex)
   {
     ccEmailAddressesJsonList[ccEmailAddressesIndex].AsString(m_ccEmailAddresses[ccEmailAddressesIndex]);
   }
   payload.WithArray("ccEmailAddresses", std::move(ccEmailAddressesJsonList));

  }

  if(m_languageHasBeenSet)
  {
   payload.WithString("language", m_language);

  }

  return payload;
}

} // namespace Model
} // namespace Support
} // namespace Aws


text:
package consulo.csharp.resolve;

import javax.annotation.Nonnull;

import consulo.csharp.CSharpMockModuleDescriptor;
import com.intellij.psi.ResolveResult;
import com.intellij.testFramework.TestModuleDescriptor;
import com.intellij.util.Function;
import consulo.testFramework.ResolvingTestCase;

/**
 * @author VISTALL
 * @since 06.04.2016
 */
public abstract class MethodReferenceResolveTest extends ResolvingTestCase
{
	public MethodReferenceResolveTest()
	{
		super("/csharp-impl/testData/resolve/methodReference/", "cs");
	}

	public void testIssue134()
	{
	}

	public void testIssue194()
	{
	}

	public void testIssue231()
	{
	}

	public void testIssue292()
	{
	}

	public void testIssue355()
	{
	}

	public void testIssue461()
	{
	}

	public void testIssue406()
	{
	}

	@Nonnull
	@Override
	protected TestModuleDescriptor createTestModuleDescriptor()
	{
		return new CSharpMockModuleDescriptor();
	}

	@Nonnull
	@Override
	protected Function<ResolveResult, String> createReferenceResultBuilder()
	{
		return ResultElementBuilder.INSTANCE;
	}
}


text:
package com.v2gclarity.risev2g.secc.states;

import com.v2gclarity.risev2g.secc.session.V2GCommunicationSessionSECC;
import com.v2gclarity.risev2g.shared.enumerations.V2GMessages;
import com.v2gclarity.risev2g.shared.messageHandling.ReactionToIncomingMessage;
import com.v2gclarity.risev2g.shared.v2gMessages.msgDef.BodyBaseType;
import com.v2gclarity.risev2g.shared.v2gMessages.msgDef.ResponseCodeType;
import com.v2gclarity.risev2g.shared.v2gMessages.msgDef.SessionSetupReqType;
import com.v2gclarity.risev2g.shared.v2gMessages.msgDef.SessionSetupResType;

public class WaitForSessionSetupReq extends ServerState {

	private SessionSetupResType sessionSetupRes;

	public WaitForSessionSetupReq(V2GCommunicationSessionSECC commSessionContext) {
		super(commSessionContext);
		sessionSetupRes = new SessionSetupResType();
	}

	@Override
	public ReactionToIncomingMessage processIncomingMessage(Object message) {
		if (isIncomingMessageValid(message, SessionSetupReqType.class, sessionSetupRes)) {
			sessionSetupRes.setEVSEID(getCommSessionContext().getEvseController().getEvseID());

			// Unix time stamp is needed (seconds instead of milliseconds)
			sessionSetupRes.setEVSETimeStamp(System.currentTimeMillis() / 1000L);
		} else {
			if (sessionSetupRes.getResponseCode().equals(ResponseCodeType.FAILED_SEQUENCE_ERROR)) {
				BodyBaseType responseMessage = getSequenceErrorResMessage(new SessionSetupResType(), message);

				return getSendMessage(responseMessage, V2GMessages.NONE, sessionSetupRes.getResponseCode());
			} else {
				setMandatoryFieldsForFailedRes(sessionSetupRes, sessionSetupRes.getResponseCode());
			}
		}

		return getSendMessage(sessionSetupRes,
				  			  (sessionSetupRes.getResponseCode().toString().startsWith("OK") ?
				  			  V2GMessages.SERVICE_DISCOVERY_REQ : V2GMessages.NONE),
				  			  sessionSetupRes.getResponseCode()
				 			 );
	}

	@Override
	public BodyBaseType getResponseMessage() {
		return sessionSetupRes;
	}

}


text:
package javasmmr.zoowsome.views;

import java.awt.GridLayout;
import java.awt.event.ActionListener;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SpringLayout;

public abstract class AbstractAnimalFormFrame extends ZooFrame{

	public JTextField nameTextField;
	public JTextField nrOfLegsTextField;
	public JTextField maintananceCostTextField;
	public JTextField dangerPercTextField;
	public SpringLayout slPanel;
	public JPanel pan;

	public AbstractAnimalFormFrame(String title) {
		super(title);
		contentPanel.setLayout(new GridLayout(0, 3, 0, 0));

		JPanel panel = new JPanel();
		// adding empty panel to fill grid layout
		contentPanel.add(panel);

		pan = new JPanel();
		contentPanel.add(pan);
		slPanel = new SpringLayout();
		pan.setLayout(slPanel);

		JLabel text1 = new JLabel("First of all, choose animal attributes");
		slPanel.putConstraint(SpringLayout.NORTH, text1, 20, SpringLayout.NORTH, pan);
		slPanel.putConstraint(SpringLayout.WEST, text1, 0, SpringLayout.WEST, pan);
		pan.add(text1);

		/** TEXT FIELDS for RETRIEVING ATTRIBUTES **/
		//for name
		JLabel nameLabel = new JLabel("Name:");
		slPanel.putConstraint(SpringLayout.NORTH, nameLabel, 40, SpringLayout.NORTH, pan);
		slPanel.putConstraint(SpringLayout.WEST, nameLabel, 90, SpringLayout.WEST, pan);
		pan.add(nameLabel);
		nameTextField = new JTextField(10);
		slPanel.putConstraint(SpringLayout.NORTH, nameTextField, 60, SpringLayout.NORTH, pan);
		slPanel.putConstraint(SpringLayout.WEST, nameTextField, 90, SpringLayout.WEST, pan);
		pan.add(nameTextField);

		//for nr of legs
		JLabel nrOfLegsLabel = new JLabel("Number of legs:");
		slPanel.putConstraint(SpringLayout.NORTH, nrOfLegsLabel, 80, SpringLayout.NORTH, pan);
		slPanel.putConstraint(SpringLayout.WEST, nrOfLegsLabel, 90, SpringLayout.WEST, pan);
		pan.add(nrOfLegsLabel);
		nrOfLegsTextField = new JTextField(10);
		slPanel.putConstraint(SpringLayout.NORTH,nrOfLegsTextField, 100, SpringLayout.NORTH, pan);
		slPanel.putConstraint(SpringLayout.WEST, nrOfLegsTextField, 90, SpringLayout.WEST, pan);
		pan.add(nrOfLegsTextField);

		JLabel maintananceCostLabel = new JLabel("Maintanance cost:");
		slPanel.putConstraint(SpringLayout.NORTH, maintananceCostLabel, 120, SpringLayout.NORTH, pan);
		slPanel.putConstraint(SpringLayout.WEST,maintananceCostLabel, 90, SpringLayout.WEST, pan);
		pan.add(maintananceCostLabel);
		maintananceCostTextField = new JTextField(10);
		slPanel.putConstraint(SpringLayout.NORTH,maintananceCostTextField, 140, SpringLayout.NORTH, pan);
		slPanel.putConstraint(SpringLayout.WEST,maintananceCostTextField, 90, SpringLayout.WEST, pan);
		pan.add(maintananceCostTextField);

		JLabel dangerPercLabel = new JLabel("Danger percent:");
		slPanel.putConstraint(SpringLayout.NORTH, dangerPercLabel, 160, SpringLayout.NORTH, pan);
		slPanel.putConstraint(SpringLayout.WEST,dangerPercLabel, 90, SpringLayout.WEST, pan);
		pan.add(dangerPercLabel);
		dangerPercTextField = new JTextField(10);
		slPanel.putConstraint(SpringLayout.NORTH,dangerPercTextField, 180, SpringLayout.NORTH, pan);
		slPanel.putConstraint(SpringLayout.WEST,dangerPercTextField, 90, SpringLayout.WEST, pan);
		pan.add(dangerPercTextField);

		//some text display
		JLabel text2 = new JLabel("Now, choose the animal");
		slPanel.putConstraint(SpringLayout.NORTH, text2, 320, SpringLayout.NORTH, pan);
		slPanel.putConstraint(SpringLayout.WEST, text2, 0, SpringLayout.WEST, pan);
		pan.add(text2);

		JPanel panel_2 = new JPanel();
		contentPanel.add(panel_2);
		setVisible(true);

	}

	@Override
	public void goBack() {
		// TODO Auto-generated method stub

	}

    public void setNameTextFieldActionListener(ActionListener a) {

		nameTextField.addActionListener(a);
	}

	public void setNrOfLegsTextFieldActionListener(ActionListener a) {

		nrOfLegsTextField.addActionListener(a);
	}

    public void setMaintananceCostTextFieldActionListener(ActionListener a) {

		maintananceCostTextField.addActionListener(a);
	}

    public void setDangerPercentTextFieldActionListener(ActionListener a) {

		dangerPercTextField.addActionListener(a);
	}

}


text:
module Fastlane
  module Actions
    class PodLibLintAction < Action
      # rubocop:disable Metrics/PerceivedComplexity
      def self.run(params)
        command = []

        command << "bundle exec" if params[:use_bundle_exec] && shell_out_should_use_bundle_exec?
        command << "pod lib lint"

        command << params[:podspec] if params[:podspec]
        command << "--verbose" if params[:verbose]
        command << "--allow-warnings" if params[:allow_warnings]
        command << "--sources='#{params[:sources].join(',')}'" if params[:sources]
        command << "--subspec='#{params[:subspec]}'" if params[:subspec]
        command << "--include-podspecs='#{params[:include_podspecs]}'" if params[:include_podspecs]
        command << "--external-podspecs='#{params[:external_podspecs]}'" if params[:external_podspecs]
        command << "--swift-version=#{params[:swift_version]}" if params[:swift_version]
        command << "--use-libraries" if params[:use_libraries]
        command << "--use-modular-headers" if params[:use_modular_headers]
        command << "--fail-fast" if params[:fail_fast]
        command << "--private" if params[:private]
        command << "--quick" if params[:quick]
        command << "--no-clean" if params[:no_clean]
        command << "--no-subspecs" if params[:no_subspecs]
        command << "--platforms=#{params[:platforms]}" if params[:platforms]
        command << "--skip-import-validation" if params[:skip_import_validation]
        command << "--skip-tests" if params[:skip_tests]

        result = Actions.sh(command.join(' '))
        UI.success("Pod lib lint Successfully ⬆ ")
        return result
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        "Pod lib lint"
      end

      def self.details
        "Test the syntax of your Podfile by linting the pod against the files of its directory"
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
                                       description: "Use bundle exec when there is a Gemfile presented",
                                       type: Boolean,
                                       default_value: true,
                                       env_name: "FL_POD_LIB_LINT_USE_BUNDLE"),
          FastlaneCore::ConfigItem.new(key: :podspec,
                                       description: "Path of spec to lint",
                                       type: String,
                                       optional: true,
                                       env_name: "FL_POD_LIB_LINT_PODSPEC"),
          FastlaneCore::ConfigItem.new(key: :verbose,
                                       description: "Allow output detail in console",
                                       type: Boolean,
                                       optional: true,
                                       env_name: "FL_POD_LIB_LINT_VERBOSE"),
          FastlaneCore::ConfigItem.new(key: :allow_warnings,
                                       description: "Allow warnings during pod lint",
                                       type: Boolean,
                                       optional: true,
                                       env_name: "FL_POD_LIB_LINT_ALLOW_WARNINGS"),
          FastlaneCore::ConfigItem.new(key: :sources,
                                       description: "The sources of repos you want the pod spec to lint with, separated by commas",
                                       type: Array,
                                       optional: true,
                                       env_name: "FL_POD_LIB_LINT_SOURCES",
                                       verify_block: proc do |value|
                                         UI.user_error!("Sources must be an array.") unless value.kind_of?(Array)
                                       end),
          FastlaneCore::ConfigItem.new(key: :subspec,
                                       description: "A specific subspec to lint instead of the entire spec",
                                       type: String,
                                       optional: true,
                                       env_name: "FL_POD_LIB_LINT_SUBSPEC"),
          FastlaneCore::ConfigItem.new(key: :include_podspecs,
                                       description: "A Glob of additional ancillary podspecs which are used for linting via :path (available since cocoapods >= 1.7)",
                                       type: String,
                                       optional: true,
                                       env_name: "FL_POD_LIB_LINT_INCLUDE_PODSPECS"),
          FastlaneCore::ConfigItem.new(key: :external_podspecs,
                                       description: "A Glob of additional ancillary podspecs which are used for linting via :podspec. If there"\
                                         " are --include-podspecs, then these are removed from them (available since cocoapods >= 1.7)",
                                       type: String,
                                       optional: true,
                                       env_name: "FL_POD_LIB_LINT_EXTERNAL_PODSPECS"),
          FastlaneCore::ConfigItem.new(key: :swift_version,
                                       description: "The SWIFT_VERSION that should be used to lint the spec. This takes precedence over a .swift-version file",
                                       type: String,
                                       optional: true,
                                       env_name: "FL_POD_LIB_LINT_SWIFT_VERSION"),
          FastlaneCore::ConfigItem.new(key: :use_libraries,
                                       description: "Lint uses static libraries to install the spec",
                                       type: Boolean,
                                       default_value: false,
                                       env_name: "FL_POD_LIB_LINT_USE_LIBRARIES"),
          FastlaneCore::ConfigItem.new(key: :use_modular_headers,
                                       description: "Lint using modular libraries (available since cocoapods >= 1.6)",
                                       type: Boolean,
                                       default_value: false,
                                       env_name: "FL_POD_LIB_LINT_USE_MODULAR_HEADERS"),
          FastlaneCore::ConfigItem.new(key: :fail_fast,
                                       description: "Lint stops on the first failing platform or subspec",
                                       type: Boolean,
                                       default_value: false,
                                       env_name: "FL_POD_LIB_LINT_FAIL_FAST"),
          FastlaneCore::ConfigItem.new(key: :private,
                                       description: "Lint skips checks that apply only to public specs",
                                       type: Boolean,
                                       default_value: false,
                                       env_name: "FL_POD_LIB_LINT_PRIVATE"),
          FastlaneCore::ConfigItem.new(key: :quick,
                                       description: "Lint skips checks that would require to download and build the spec",
                                       type: Boolean,
                                       default_value: false,
                                       env_name: "FL_POD_LIB_LINT_QUICK"),
          FastlaneCore::ConfigItem.new(key: :no_clean,
                                       description: "Lint leaves the build directory intact for inspection",
                                       type: Boolean,
                                       default_value: false,
                                       env_name: "FL_POD_LIB_LINT_NO_CLEAN"),
          FastlaneCore::ConfigItem.new(key: :no_subspecs,
                                       description: "Lint skips validation of subspecs",
                                       type: Boolean,
                                       default_value: false,
                                       env_name: "FL_POD_LIB_LINT_NO_SUBSPECS"),
          FastlaneCore::ConfigItem.new(key: :platforms,
                                       description: "Lint against specific platforms (defaults to all platforms supported by "\
                                          "the podspec). Multiple platforms must be comma-delimited (available since cocoapods >= 1.6)",
                                       optional: true,
                                       env_name: "FL_POD_LIB_LINT_PLATFORMS"),
          FastlaneCore::ConfigItem.new(key: :skip_import_validation,
                                       description: "Lint skips validating that the pod can be imported (available since cocoapods >= 1.3)",
                                       type: Boolean,
                                       default_value: false,
                                       env_name: "FL_POD_LIB_LINT_SKIP_IMPORT_VALIDATION"),
          FastlaneCore::ConfigItem.new(key: :skip_tests,
                                       description: "Lint skips building and running tests during validation (available since cocoapods >= 1.3)",
                                       type: Boolean,
                                       default_value: false,
                                       env_name: "FL_POD_LIB_LINT_SKIP_TESTS")
        ]
      end

      def self.output
      end

      def self.return_value
        nil
      end

      def self.authors
        ["thierryxing"]
      end

      def self.is_supported?(platform)
        [:ios, :mac].include?(platform)
      end

      def self.example_code
        [
          'pod_lib_lint',
          '# Allow output detail in console
          pod_lib_lint(verbose: true)',
          '# Allow warnings during pod lint
          pod_lib_lint(allow_warnings: true)',
          '# If the podspec has a dependency on another private pod, then you will have to supply the sources
          pod_lib_lint(sources: ["https://github.com/username/Specs", "https://github.com/CocoaPods/Specs"])'
        ]
      end

      def self.category
        :misc
      end
    end
  end
end


text:
layout: post
title: Time to turn around and head home
categories: 2017-NorthChannel
excerpt: After the north channel, our schedule was dictated by getting to the apostle Islands.
date: 2017-07-30
published: true
image:
  ogimage: 2017/2017-08-05 14.42.07.jpg
images-array:
 - path: 2017/2017-08-02 18.15.52.jpg
   label: We sailed all day with the spinnaker up and the auto pilot steering. I like to go fast, but there's nothing like making a steady 6kts all day long. The boat has a very comfortable and stable motion. There's nothing like it.
 - path: 2017/2017-08-03 13.57.18.jpg
   label: yup, more river and more CSL (and other) ships.
 - path: 2017/2017-08-03 13.58.14.jpg
   label: This is way closer than I'd prefer, but it was shallow and rocky outside the channel, so this is far over as I could go. They weren't going that much faster than us, so it was a slow overtaking.
 - path: 2017/2017-08-03 13.58.23.jpg
   label:
 - path: 2017/2017-08-03 13.59.28.jpg
   label:
 - path: 2017/2017-08-03-1.jpg
   label: This was a first for me. We were boarded for a safety inspection by the USCG. It seems to happen to everyone at some point. Our turn was up.
 - path: 2017/2017-08-03-2.jpg
   label: We passed the inspection!
 - path: 2017/2017-08-05 14.41.58.jpg
   label: Westward out of the Soo Locks.
 - path: 2017/2017-08-05 14.42.07.jpg
   label: After weeks of beautiful wilderness, it was a jolt to be back in the industrial area of the Soo.
 - path: 2017/2017-08-05 14.59.17.jpg
   label:
 - path: 2017/2017-08-05 15.01.15.jpg
   label:
 - path: 2017/2017-08-05 16.03.31.jpg
   label: I believe this was the American Integrity overtaking us. It's one of a handful of ships on the lakes that are 1000 feet long. It's too big to get out of the St. Lawrence Seaway locks, so she's a great-lakes-for-life ship.
 - path: 2017/2017-08-06 19.43.04.jpg
   label: And we're back on Lake Superior so of course there must be fog.
 - path: 2017/2017-08-09 14.39.45.jpg
   label: While it's foggy and buggy, there are still some great places to visit on the greatest and coldest of the lakes. Pictured Rocks National Lakeshore is one of them.
 - path: 2017/2017-08-09 20.43.02.jpg
   label: It was stormy during our visit, so we didnt' get to go as close to the cliffs as I had hoped.
 - path: 2017/2017-08-10 09.41.09.jpg
   label: Pictured Rocks.
 - path: 2017/2017-08-10 11.51.42.jpg
   label: Lots of stuff to take pictures of.
 - path: 2017/2017-08-10 11.52.11.jpg
   label: Another cloudy sailing picture. How many of these did I take!!
 - path: 2017/2017-08-10 17.20.11.jpg
   label: After pictured rocks, we stoped in another favorite spot of Marquette. You can just make out Meadowhawk anchored to the left of the bell tower thingy. It's a great spot to visit by boat because there is easy acces to the town with some good restaurants and a fabulous co-op.
 - path: 2017/2017-08-14 20.24.14.jpg
   label: The shoreline between Marquette and the lower entrance to the Portage Canal is incredible. We seem to often pass it at night though. I need to see more of this area.
 - path: 2017/2017-08-14 20.24.27.jpg
   label: Approaching the Keewenaw Peninsula.
 - path: 2017/2017-08-23 16.18.12.jpg
   label: After waiting a bit for some East winds, we blasted off to the apostles making another FAST passage under spinnaker and then just like that, we were back in our home cruising grounds of the Apostle Islands.
 - path: 2017/2017-08-23 16.19.16.jpg
   label: Devils Island sea caves Apostle Islands National Lakeshore.
 - path: 2017/2017-08-23 16.25.06.jpg
   label: Devils Island.
 - path: 2017/2017-08-24 19.36.21.jpg
   label: For sailing west against the prevailing winds, we were sure under spinnaker a lot. I much prefer to either change my destination, or wait until the wind is favorable. Life is much easier when you're not under time pressure.
 - path: 2017/2017-08-24 20.26.07.jpg
   label: This is a favorite spot to sit when we're underway. That's the Duluth hillside with a ship departing.
 - path: 2017/2017-08-24 20.26.21.jpg
   label: Approaching Duluth.
 - path: 2017/2017-08-24 20.29.11.jpg
   label:
 - path: 2017/2017-08-24 21.37.46.jpg
   label: We docked in our home slip just after dark a bit over 2 months and 1600 nautical miles later. What a trip

---

After the north channel, our schedule was dictated by getting to the apostle Islands, near home, in time for Ethan's annual birthday camp weekend. So it was go-go-go when the weather was good for going. We had a couple days of strong East winds and covered some serious ground. We even sailed UP most of the St. Mary's river. Yes, we sailed up stream. It was so windy, we were still often doing 8kts with a current against us. It was amazing.

After the river, we stopped in Sault Ste Marie and happened to be there for the start of the Trans-Superior yacht race. The George Kemp marina was completely packed and it was fun to see the fancy race boats and catch up with sailor friends. I'm not a racer, but I enjoyed the atmosphere.


text:
package com.averi.worldscribe.views;

import android.content.Context;
import androidx.appcompat.widget.Toolbar;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.TextView;

import java.lang.reflect.Field;

/**
 * A Marquee-able Android Toolbar.
 *
 *

 *     Credit to InsanityOnABun. The Gist for this class can be found
 *     here.
 *

 */
public class MarqueeToolbar extends Toolbar {

    TextView title;
    boolean reflected = false;

    public MarqueeToolbar(Context context) {
        super(context);
    }

    public MarqueeToolbar(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MarqueeToolbar(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public void setTitle(CharSequence title) {
        if (!reflected) {
            reflected = reflectTitle();
        }
        super.setTitle(title);
        // Due to postDelayed(), selectTitle() will cause an exception if it's called before
        // the title TextView has been created. In Activities, setSupportActionBar() might
        // call selectTitle() too early, thus causing an exception.
        // We can prevent this by checking reflected, which can only be set
        // to true if the title TextView exists.
        if (reflected) {
            selectTitle();
        }
    }

    @Override
    public void setTitle(int resId) {
        if (!reflected) {
            reflected = reflectTitle();
        }
        super.setTitle(resId);
        // Due to postDelayed(), selectTitle() will cause an exception if it's called before
        // the title TextView has been created. In Activities, setSupportActionBar() might
        // call selectTitle() too early, thus causing an exception.
        // We can prevent this by checking reflected, which can only be set
        // to true if the title TextView exists.
        if (reflected) {
            selectTitle();
        }
    }

    private boolean reflectTitle() {
        try {
            Field field = Toolbar.class.getDeclaredField("mTitleTextView");
            field.setAccessible(true);
            title = (TextView) field.get(this);
            title.setEllipsize(TextUtils.TruncateAt.MARQUEE);
            title.setMarqueeRepeatLimit(-1);
            return true;
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
            return false;
        } catch (IllegalAccessException e) {
            e.printStackTrace();
            return false;
        } catch (NullPointerException e) {
            e.printStackTrace();
            return false;
        }
    }

    public void selectTitle() {
        title.postDelayed(new Runnable() {
            @Override
            public void run() {
                title.setSelected(true);
            }
        }, 1000);
    }
}