Exemplo n.º 1
0
/************************************************************************
* Function : send_search_result											
*																	
* Parameters:														
*	IN void *data: Search reply from the device
*																	
* Description:														
*	This function sends a callback to the control point application with 
*	a SEARCH result
*
* Returns: void
*
***************************************************************************/
void
send_search_result( IN void *data )
{
    ResultData *temp = ( ResultData * ) data;

    temp->ctrlpt_callback( UPNP_DISCOVERY_SEARCH_RESULT,
                           &temp->param, temp->cookie );
    free( temp );
}
Exemplo n.º 2
0
Arquivo: result.C Projeto: HeyJJ/ball
	void Result::add(const String& lig_conf_id_in, const String& lig_conf_id_out, int scoringmethod, double energy, const String& rec_conf_id)
	{
		ResultData rd;
		rd.setEnergy(energy);
		rd.setScoringMethod(scoringmethod);
		rd.setLigandConformationId(lig_conf_id_out);
		rd.setReceptorConformationId(rec_conf_id);
		add(lig_conf_id_in, rd);
	}
Exemplo n.º 3
0
Arquivo: result.C Projeto: HeyJJ/ball
	void Result::add(Conformation* lig_conf_in, Conformation* lig_conf_out, int scoringmethod, double energy, Conformation* rec_conf)
	{
		ResultData rd;
		rd.setEnergy(energy);
		rd.setScoringMethod(scoringmethod);
		rd.setLigandConformation(lig_conf_out);
		rd.setReceptorConformation(rec_conf);
		add(lig_conf_in, rd);
	}
Exemplo n.º 4
0
/*!
 * \brief Sends a callback to the control point application with a SEARCH
 * result.
 */
static void send_search_result(
	/* [in] Search reply from the device. */
	IN void *data)
{
	ResultData *temp = (ResultData *) data;

	temp->ctrlpt_callback(UPNP_DISCOVERY_SEARCH_RESULT, &temp->param,
			      temp->cookie);
	free(temp);
}
Exemplo n.º 5
0
Arquivo: result.C Projeto: HeyJJ/ball
	String Result::toString(const ResultData &rd)
	{
		String ret="";
		ret += " method: "+ String(rd.getScoringMethod());
		ret += " energy: "+ String(rd.getEnergy());
		ret += " lig_id: "+ rd.getLigandConformationId();
		ret += " rec_id: "+ rd.getReceptorConformationId();
		ret += " ";
		return ret;
	}
Exemplo n.º 6
0
/************************************************************************
* Function : send_search_result											
*																	
* Parameters:														
*	IN void *data: Search reply from the device
*																	
* Description:														
*	This function sends a callback to the control point application with 
*	a SEARCH result
*
* Returns: void
*
***************************************************************************/
void
send_search_result( IN void *data )
{
    ResultData *temp = ( ResultData * ) data;

    temp->ctrlpt_callback( UPNP_DISCOVERY_SEARCH_RESULT,
                           &temp->param, temp->cookie );
#ifdef _UPNP_MM_
    upnp_free( temp );
#else
    free( temp );
#endif
}
Exemplo n.º 7
0
Arquivo: result.C Projeto: HeyJJ/ball
	HashSet<String> Result::getOutputIds()
	{
		HashSet<String> ret;
		HashMap<String, vector<ResultData> >::Iterator iter = result_data_.begin();
		for (; iter != result_data_.end(); iter++)
		{
			vector<ResultData>::iterator iter2 = (iter->second).begin();
			for (; iter2 != (iter->second).end(); iter2++)
			{
				ResultData rd = *iter2;
				ret.insert(rd.getLigandConformationId());
			}
		}
		return ret;
	}
Exemplo n.º 8
0
Arquivo: result.C Projeto: HeyJJ/ball
	void Result::add(String lig_conf_id_in, ResultData &rd)
	{
		if ( input_conformations_map_.has(lig_conf_id_in)
			&& result_output_data_.has(rd.getLigandConformationId()) )
		{
			//cout<<"[Warning:] Result object already has data for given pair of input- and output-conformation! Thus, no new data is added!"<<endl;
			return;
		}

		if (!result_data_.has(lig_conf_id_in))
		{
			input_conformations_.push_back(lig_conf_id_in);
			input_conformations_map_.insert(lig_conf_id_in);
			result_data_[lig_conf_id_in] = vector<ResultData>();
		}
		result_data_[lig_conf_id_in].push_back(rd);
		result_output_data_[rd.getLigandConformationId()] = rd;
	}
// パーティクルの初期化
void ResultSlimeObject::initParticle()
{
	//メインで作った色を取得
	StageNumber stageNumber;
	ResultData stageColor;
	int stageNum = stageNumber.loadStageNumber();
	int colorR = stageColor.readColorR( stageNum );
	int colorG = stageColor.readColorG( stageNum );
	int colorB = stageColor.readColorB( stageNum );
    // パーティクルの生成に必要な設定記述子を生成する。
    LiquidFunParticleDescCreator	creator;
    LiquidFunParticleDesc			particleDesc	{ creator.createParticleDesc( 10.0f ) };
	LiquidFunParticleGroupDesc		groupDesc		{ creator.createParticleGroupDesc( Color3B( colorR, colorG, colorB ), { 360, 1280 }, PARTICLE_TYPE, 160, 120 ) };
    
    // パーティクルを装着する。
    mParticle		= LiquidFunParticleSettlor::attachParticle( particleDesc );
    mParticleGroup	= LiquidFunParticleSettlor::attachParticleGroup( mParticle, groupDesc );
    
    // 液体挙動を無効化する。
    //disableLiquidBehavior();
}
Exemplo n.º 10
0
int main() {
    // Create thread pool
    printf("Creating thread pool\n");
    int NUM_THREADS = 4;

    DataSource dataSource;
    ResultData result;

    //TODO change to smart pointers
    std::vector<WorkerThread*> threadPool(NUM_THREADS);

    for(std::vector<WorkerThread*>::iterator it = threadPool.begin();
            it != threadPool.end();
            ++it) {
        *it = new WorkerThread();
    }

    unsigned t0 = clock();

    for(std::vector<WorkerThread*>::iterator it = threadPool.begin();
            it != threadPool.end();
            ++it) {
        (*it)->Run(&dataSource, &result);
    }

    printf("Exiting the program\n");
    for(std::vector<WorkerThread*>::iterator it = threadPool.begin();
            it != threadPool.end();
            ++it) {
        delete(*it);
    }
    unsigned t1 = clock() - t0;

    printf("Exec time(%d), Final result: %d\n", t1, result.GetResult());

}
Exemplo n.º 11
0
int MysqlClient::GetResult(ResultData &data)
{
	if (result == NULL) {
		return 0;
	}
	
	int feild_count = mysql_field_count(&connection);
	MYSQL_ROW sqlrow;
	while((sqlrow = mysql_fetch_row(result))) {
		unsigned count = 0;		
		vector<string> row;
		while (count < feild_count) {
			row.push_back(string(sqlrow[count]));
			count++;
		}
		data.push_back(row);
	}
	mysql_free_result(result);//只是释放空间,并不把result置为null
	result = NULL;//置为null,以后释放时需判断
	return 0;
}
Exemplo n.º 12
0
void ResultEvaluation::playAnimation(){
    
    Evaluation* e = Evaluation::create();
    addChild( e );
	
    Sequence* animation = nullptr;
	StageNumber stageNumber;
	ResultData resultData;
	int stageNum = stageNumber.loadStageNumber();
	int ColorR = resultData.readColorR( stageNum );
    int ColorG = resultData.readColorG( stageNum );
    int ColorB = resultData.readColorB( stageNum );
    
    if ( e->getTag() == EvaluationTag::BAD ){
        
        animation = Sequence::create( DelayTime::create( 0.5f ), CallFunc::create( [ = ] (){
            mIsAnimation = true;
            Sprite* sprite = Sprite::create("Texture/GameResult/" + EvaluationPath.at( EvaluationTag::BAD ) + ".png" );
            sprite->setColor( Color3B( ColorR, ColorG, ColorB ) );
            //sprite->setPosition( 360, 930 );
			ADX2Player::getInstance().play( 9 );
			sprite->setAnchorPoint( Vec2::ANCHOR_MIDDLE );
            this->addChild(sprite);
        }), nullptr);

    }
    
    if ( e->getTag() == EvaluationTag::GOOD ){
        
        animation = Sequence::create( DelayTime::create( 0.5f ), CallFunc::create( [ = ] (){
            mIsAnimation = true;
            Sprite* sprite = Sprite::create("Texture/GameResult/" + EvaluationPath.at( EvaluationTag::GOOD ) + ".png" );
            sprite->setColor( Color3B( ColorR, ColorG, ColorB ) );
            //sprite->setPosition( 360, 930 );
			ADX2Player::getInstance().play( 9 );
			sprite->setAnchorPoint( Vec2::ANCHOR_MIDDLE );
            this->addChild(sprite);
        }), nullptr);

    }
    
    if ( e->getTag() == EvaluationTag::EXCELLENT ){
    
        animation = Sequence::create( DelayTime::create( 0.5f ), CallFunc::create( [ = ] (){
            mIsAnimation = true;
            Sprite* sprite = Sprite::create("Texture/GameResult/" + EvaluationPath.at( EvaluationTag::EXCELLENT ) + ".png" );
            sprite->setColor( Color3B( ColorR, ColorG, ColorB ) );
            //sprite->setPosition( 360, 930 );
			ADX2Player::getInstance().play( 9 );
			sprite->setAnchorPoint( Vec2::ANCHOR_MIDDLE );
            this->addChild(sprite);
        }), nullptr);

    }
    
    if ( e->getTag() == EvaluationTag::PERFECT ){
    
        animation = Sequence::create( DelayTime::create( 0.5f ), CallFunc::create( [ = ] (){
            mIsAnimation = true;
            Sprite* sprite = Sprite::create("Texture/GameResult/" + EvaluationPath.at( EvaluationTag::PERFECT ) + ".png" );
            sprite->setColor( Color3B( ColorR, ColorG, ColorB ) );
            //sprite->setPosition( 360, 930 );
			ADX2Player::getInstance().play( 9 );
			sprite->setAnchorPoint( Vec2::ANCHOR_MIDDLE );
            this->addChild(sprite);
        }), nullptr);

    }
    
    animation->setTag( 0 );
    this->runAction( animation );
}
Exemplo n.º 13
0
int main()
{
    string db_host = "192.168.144.119";
    uint16_t db_port = 3306;
    string db_account = "root";
    string db_password = "******";
    string db_name = "test";
    string charset = "utf8";

    DbConfig db_config;
    db_config.db_host = db_host;
    db_config.db_port = db_port;
    db_config.db_account = db_account;
    db_config.db_password = db_password;
    db_config.db_name = db_name;
    db_config.charset = charset;

    MysqlClient* mysql = new MysqlClient();
    int ret = mysql->Initialize(db_config);
    if(ret != 0)
    {
        cout<<mysql->GetErrMsg()<<endl;
        return -1;
    }

    string sql = "insert into Persons values (12,'王','小名','长安街','北京')";
    ret = mysql->ExecuteSql(sql);
    if(ret != 0)
    {
        cout<<mysql->GetErrMsg()<<endl;
    }

    ret = mysql->GetAffectedRows();
    if(ret <= 0)
    {
        cout<<"insert fail"<<endl;
    }

    sql = "select * from Persons";
    ret = mysql->ExecuteSql(sql);
    if(ret != 0)
    {
        cout<<mysql->GetErrMsg()<<endl;
    }

    ResultData result;
    mysql->GetResult(result);
    ResultData::iterator it = result.begin();
    while(it != result.end())
    {
        vector<string> row  = *it;
        vector<string>::iterator it_row = row.begin();
        while(it_row != row.end())
        {
            cout<<*it_row<<",";
			++it_row;
        }
        cout<<endl;
		++it;
    }
    //delete mysql;
	mysql->CloseConnect();
    return 0;
}