这篇教程C++ DD函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DD函数的典型用法代码示例。如果您正苦于以下问题:C++ DD函数的具体用法?C++ DD怎么用?C++ DD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DD函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: sql_find_buddy_fdint sql_find_buddy_fd(cs_request_t *req, sqlite3 *db){ if (req == NULL || req->name == NULL || req->buddy_name == NULL || db == NULL) { E("parameter error."); return -1; } char *query_line = (char *)cs_malloc(sizeof(char) * QUERY_LEN_MAX); if (query_line == NULL) { E("cs_malloc() failed."); return -1; } sprintf(query_line, "select * from users where name='%s'", req->buddy_name); DS(query_line); int fd = 0; int ret = sqlite3_exec(db, query_line, sql_buddy_fd_cb, &fd, NULL); if (ret != SQLITE_OK || fd < 0) { E("sqlite3_exec() failed."); DD(fd); cs_free(&query_line); return -1; } cs_free(&query_line); D(GREEN"user %s fd is %d.", req->buddy_name, fd); return fd;}
开发者ID:jesse2013,项目名称:cs,代码行数:32,
示例2: zxid_soap_call_raw/* Called by: zxid_soap_call_hdr_body, zxid_wsc_call */struct zx_root_s* zxid_soap_call_raw(zxid_conf* cf, struct zx_str* url, struct zx_e_Envelope_s* env, char** ret_enve){#ifdef USE_CURL struct zx_root_s* r; struct zx_str* ret; struct zx_str* ss; char soap_action_buf[1024]; char* soap_act; const char* env_start; ss = zx_easy_enc_elem_opt(cf, &env->gg); DD("ss(%.*s) len=%d", ss->len, ss->s, ss->len); if (cf->soap_action_hdr && strcmp(cf->soap_action_hdr,"#inhibit")) { if (!strcmp(cf->soap_action_hdr,"#same")) { if (env->Header && env->Header->Action && ZX_GET_CONTENT_S(env->Header->Action)) { snprintf(soap_action_buf,sizeof(soap_action_buf), "SOAPAction: /"%.*s/"", ZX_GET_CONTENT_LEN(env->Header->Action), ZX_GET_CONTENT_S(env->Header->Action)); soap_action_buf[sizeof(soap_action_buf)-1] = 0; soap_act = soap_action_buf; D("SOAPaction(%s)", soap_action_buf); } else { ERR("e:Envelope/e:Headers/a:Action SOAP header is malformed %p", env->Header); } } else { snprintf(soap_action_buf,sizeof(soap_action_buf), "SOAPAction: /"%s/"", cf->soap_action_hdr); soap_action_buf[sizeof(soap_action_buf)-1] = 0; soap_act = soap_action_buf; } } else soap_act = 0; ret = zxid_http_post_raw(cf, url->len, url->s, ss->len, ss->s, soap_act); zx_str_free(cf->ctx, ss); if (ret_enve) *ret_enve = ret?ret->s:0; if (!ret) return 0; env_start = zxid_locate_soap_Envelope(ret->s); if (!env_start) { ERR("SOAP response does not have Envelope element url(%.*s)", url->len, url->s); D_XML_BLOB(cf, "NO ENVELOPE SOAP RESPONSE", ret->len, ret->s); ZX_FREE(cf->ctx, ret); return 0; } cf->ctx->top1 = 1; /* Stop parsing after first toplevel <e:Envelope> */ r = zx_dec_zx_root(cf->ctx, ret->len - (env_start - ret->s), env_start, "soap_call"); if (!r || !r->Envelope || !r->Envelope->Body) { ERR("Failed to parse SOAP response url(%.*s)", url->len, url->s); D_XML_BLOB(cf, "BAD SOAP RESPONSE", ret->len, ret->s); ZX_FREE(cf->ctx, ret); return 0; } return r;#else ERR("This copy of zxid was compiled to NOT use libcurl. SOAP calls (such as Artifact profile and WSC) are not supported. Add -DUSE_CURL (make ENA_CURL=1) and recompile. %d", 0); return 0;#endif}
开发者ID:grubba,项目名称:zxid,代码行数:61,
示例3: create_rangevoid uv_orb::fillDeltagrids(const std::string& file){ E_delta.clear();L_delta.clear();Delta.clear(); E_delta = create_range(E0,Emax,NE); L_delta = std::vector<VecDoub>(NE,VecDoub(NL,0.)); Delta = std::vector<VecDoub>(NE,VecDoub(NL,0.)); #pragma omp parallel for schedule (dynamic) for(int i=0; i<NE;i++){ double R = Pot->R_E(E_delta[i]); for(double j=0;j<NL;j++){ L_delta[i][j] = Pot->L_circ(R)*(j*0.8/(double)(NL-1)+0.001); find_best_delta DD(Pot, E_delta[i], L_delta[i][j]); Delta[i][j]=DD.delta(R*.9); if(Delta[i][j]<0. or Delta[i][j]!=Delta[i][j]) Delta[i][j]=R/5.; std::cerr<<"DeltaGrid: " <<OUTPUT(E_delta[i]) <<OUTPUT(L_delta[i][j]) <<OUTPUT(R) <<OUTPUTE(Delta[i][j]); } } std::cerr<<"DeltaGrid calculated: NE = "<<NE<<", NL = "<<NL<<std::endl; std::ofstream outfile; outfile.open(file); for(int i=0;i<NE;++i) for(int j=0;j<NL;++j) outfile<<E_delta[i]<<" "<<L_delta[i][j]<<" "<<Delta[i][j]<<std::endl; outfile.close();}
开发者ID:jobovy,项目名称:tact,代码行数:31,
示例4: zxid_oauth_dynclireg_clientstruct zx_str* zxid_oauth_dynclireg_client(zxid_conf* cf, zxid_cgi* cgi, zxid_ses* ses, const char* as_uri){ struct zx_str* res; char* azhdr; char* req = zxid_mk_oauth2_dyn_cli_reg_req(cf); char* url = zxid_oauth_get_well_known_item(cf, as_uri, "/"dynamic_client_endpoint/""); char* p; if (iat) { azhdr = zx_alloc_sprintf(cf->ctx, 0, "Authorization: Bearer %s", iat); } else azhdr = 0; DD("url(%s) req(%s) iat(%s)", url, req, STRNULLCHKD(azhdr)); if (_uma_authn) { p = url; url = zx_alloc_sprintf(cf->ctx, 0, "%s%c_uma_authn=%s", url, strchr(url,'?')?'&':'?', _uma_authn); ZX_FREE(cf->ctx, p); } D("url(%s) req(%s) iat(%s)", url, req, STRNULLCHKD(azhdr)); res = zxid_http_cli(cf, -1, url, -1, req, ZXID_JSON_CONTENT_TYPE, azhdr, 0); ZX_FREE(cf->ctx, url); if (azhdr) ZX_FREE(cf->ctx, azhdr); ZX_FREE(cf->ctx, req); D("%.*s", res->len, res->s); ses->client_id = zx_json_extract_dup(cf->ctx, res->s, "/"client_id/""); ses->client_secret = zx_json_extract_dup(cf->ctx, res->s, "/"client_secret/""); return res;}
开发者ID:gitpan,项目名称:zxid,代码行数:27,
示例5: slab_get_objstatic void * slab_get_obj(kmem_cache_t *cachep, struct slab *slabp){ if(cachep == NULL || slabp == NULL) { return NULL; } struct list_head *item = NULL; if(slabp->free == BUFCTL_END) { DD("not free obj."); return NULL; } void *objp = index_to_obj(cachep, slabp, slabp->free); uint32_t next = slab_bufctl(slabp)[slabp->free]; inc_slab_use(slabp); set_slab_free(slabp, next); /* move to the full list*/ if(slabp->inuse == cachep->obj_num) { item = &(slabp->list); list_del(item); list_add(item, &(cachep->kmem_lists.full)); } dec_cache_free(cachep); return objp;}
开发者ID:smushroom,项目名称:libmm,代码行数:31,
示例6: DDvoid HelloWorld::update (float delta){ CCLayer::update (delta); static double thinginterval =0; thinginterval+= delta; for (int i=0; i < bads.size(); ++i) { DD (bads[i]->GetID(), Telegram_AI, { }); DD (bads[i]->GetID(), Telegram_UPDATE, { delta }); } thinginterval=0;}
开发者ID:EchO-KID,项目名称:CBS,代码行数:16,
示例7: _getSearchPaths/* Parse a given config.ini file and extract the list of SDK search paths * from it. Returns the number of valid paths stored in 'searchPaths', or -1 * in case of problem. * * Relative search paths in the config.ini will be stored as full pathnames * relative to 'sdkRootPath'. * * 'searchPaths' must be an array of char* pointers of at most 'maxSearchPaths' * entries. */static int_getSearchPaths( IniFile* configIni, const char* sdkRootPath, int maxSearchPaths, char** searchPaths ){ char temp[PATH_MAX], *p = temp, *end= p+sizeof temp; int nn, count = 0; for (nn = 0; nn < maxSearchPaths; nn++) { char* path; p = bufprint(temp, end, "%s%d", SEARCH_PREFIX, nn+1 ); if (p >= end) continue; path = iniFile_getString(configIni, temp, NULL); if (path != NULL) { DD(" found image search path: %s", path); if (!path_is_absolute(path)) { p = bufprint(temp, end, "%s/%s", sdkRootPath, path); AFREE(path); path = ASTRDUP(temp); } searchPaths[count++] = path; } } return count;}
开发者ID:Noah0701,项目名称:android_s2e,代码行数:39,
示例8: EsqCurtovoid EsqCurto (ApontadorNo *Ap, short *Fim){ ApontadorNo Ap1; if ((*Ap)->BitE == Horizontal){ (*Ap)->BitE = Vertical; *Fim = TRUE; return; } if ((*Ap)->BitD == Horizontal){ Ap1 = (*Ap)->Dir; (*Ap)->Dir = Ap1->Esq; Ap1->Esq = *Ap; *Ap = Ap1; if ((*Ap)->Esq->Dir->BitE == Horizontal){ DE(&(*Ap)->Esq); (*Ap)->BitE = Horizontal; } *Fim = TRUE; return; } (*Ap)->BitD = Horizontal; if ((*Ap)->Dir->BitE == Horizontal){ DE(Ap); *Fim = TRUE; return; } if ((*Ap)->Dir->BitD == Horizontal){ DD(Ap); *Fim == TRUE; }}
开发者ID:patrickpff,项目名称:Algoritmos-e-estrutura-de-dados,代码行数:30,
示例9: buscarIzquierdaAVLint buscarIzquierdaAVL( AVL *a, int dato, int *band ){ int retAux; retAux = eliminaAVL( &(*a)->izq, dato, band ); if( *band ) { if( (*a) -> fe == 0 ) { (*a) -> fe = 1; *band = 0; }else if( (*a) -> fe == -1 ) (*a) -> fe = 0; else { if( (*a) -> der -> fe >= 0 ) { if( (*a) -> der -> fe == 0 ) *band = 0; DD( a ); }else DI( a ); } } return( retAux );}
开发者ID:miguellgt,项目名称:C-Dynamic-Data-Structures,代码行数:30,
示例10: eliminaAVLint eliminaAVL( AVL *a, int dato, int *band ){ int ret; AVL aux; if( !*a ) *band = ret = 0; else { if( dato == (*a) -> info ) { ret = *band = 1; aux = *a; if( !(*a) -> izq ) *a = (*a)-> der; else if( !(*a) -> der ) *a = (*a) -> izq; else { recorreIzqDerAVL( &(*a) -> izq, &aux, band ); (*a) -> info = aux -> info; if( *band ) { if( (*a) -> fe == 0 ) { (*a) -> fe = 1; *band = 0; }else if( (*a) -> fe == -1 ) (*a) -> fe = 0; else { if( (*a) -> der -> fe >= 0 ) { if( (*a) -> der -> fe == 0 ) *band = 0; DD( a ); }else DI( a ); } } } free( aux ); }else if( dato < (*a) -> info ) ret = buscarIzquierdaAVL( a, dato, band ); else if( dato > (*a) -> info ) ret= buscarDerechaAVL( a, dato, band ); } return( ret ); }
开发者ID:miguellgt,项目名称:C-Dynamic-Data-Structures,代码行数:60,
示例11: trans int GaussianProcessNormal::precomputePrediction() { size_t n = mGPXX.size(); size_t p = mMean->nFeatures(); mKF = trans(mFeatM); inplace_solve(mL,mKF,ublas::lower_tag()); //TODO: make one line matrixd DD(p,p); DD = prod(trans(mKF),mKF); utils::addToDiagonal(DD,mInvVarW); utils::cholesky_decompose(DD,mD); vectord vn = mGPY; inplace_solve(mL,vn,ublas::lower_tag()); mWMap = prod(mFeatM,vn) + utils::ublas_elementwise_prod(mInvVarW,mW0); utils::cholesky_solve(mD,mWMap,ublas::lower()); mVf = mGPY - prod(trans(mFeatM),mWMap); inplace_solve(mL,mVf,ublas::lower_tag()); if (boost::math::isnan(mWMap(0))) { FILE_LOG(logERROR) << "Error in precomputed prediction. NaN found."; return -1; } return 0; }
开发者ID:NoviaDroid,项目名称:MarioDifficulty,代码行数:28,
示例12: IInserevoid IInsere(TipoReg x, TipoApont *Ap,TipoInclinacao *IAp, short *Fim){ if (*Ap == NULL) { *Ap = (TipoApont)malloc(sizeof(TipoNo)); *IAp = Horizontal; (*Ap)->Reg = x; (*Ap)->BitE = Vertical; (*Ap)->BitD = Vertical; (*Ap)->Esq = NULL; (*Ap)->Dir = NULL; *Fim = FALSE; return; } if (x.Chave < (*Ap)->Reg.Chave) { IInsere(x, &(*Ap)->Esq, &(*Ap)->BitE, Fim); if (*Fim) return; if ((*Ap)->BitE != Horizontal) { *Fim = TRUE; return; } if ((*Ap)->Esq->BitE == Horizontal) { EE(Ap); *IAp = Horizontal; return; } if ((*Ap)->Esq->BitD == Horizontal) { ED(Ap); *IAp = Horizontal; } return; } //COMPARA C++ DDLCLIENT_STATE_IS函数代码示例 C++ DCondVar_Signal函数代码示例
|