您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wd函数代码示例

51自学网 2021-06-03 09:54:28
  C++
这篇教程C++ wd函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wd函数的典型用法代码示例。如果您正苦于以下问题:C++ wd函数的具体用法?C++ wd怎么用?C++ wd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wd函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: wd

void WatchedDirTest::test_method(){    QString dirname = _tempDir.absolutePath();    {        // Use Case:        // Empty directory watched        // Expect readyRead on any new file        WatchedDir wd(dirname);        QSignalSpy spy( &wd, SIGNAL( readyRead() ) );        boost::shared_ptr<QTemporaryFile> file1=addFile(dirname);        _app->processEvents();        CPPUNIT_ASSERT_EQUAL( 1, spy.count() );        CPPUNIT_ASSERT_EQUAL( (int)file1->size() , (int)wd.bytesAvailable() );        boost::shared_ptr<QTemporaryFile> file2=addFile(dirname);        _app->processEvents();        // ensure we can read the data        // and that the stream at end markers are set only when all files        // are consumed from the stream        CPPUNIT_ASSERT_EQUAL( file1->fileName().toStdString(), wd.fileName().toStdString() );        QByteArray f1 = wd.readFile();        CPPUNIT_ASSERT( ! wd.atEnd() );        CPPUNIT_ASSERT_EQUAL( (int)file1->size(), f1.size() );        CPPUNIT_ASSERT_EQUAL( file2->fileName().toStdString(), wd.fileName().toStdString());        CPPUNIT_ASSERT_EQUAL( 2, spy.count() ); // emit signal each time we switch files        CPPUNIT_ASSERT_EQUAL( (int)file2->size() , (int)wd.bytesAvailable() );        QByteArray f2 = wd.readFile();        CPPUNIT_ASSERT_EQUAL( (int)file2->size(), (int)f2.size() );        CPPUNIT_ASSERT_EQUAL( 2, spy.count() );        CPPUNIT_ASSERT( wd.atEnd() );    }}
开发者ID:chrisjwilliams,项目名称:pelican,代码行数:31,


示例2: alphacol

void AnimatedInst::draw(GameState* gs) {	GameView& view = gs->view();	if (sprite > -1) {		GLimage& img = game_sprite_data[sprite].img();		int w = img.width, h = img.height;		int xx = x - w / 2, yy = y - h / 2;		if (!view.within_view(xx, yy, w, h))			return;		if (!gs->object_visible_test(this))			return;		Colour alphacol(255, 255, 255, 255 * timeleft / animatetime);		gl_draw_sprite(view, sprite, xx, yy, orientx, orienty, gs->frame(),				alphacol);	}	Colour wd(255 - textcol.r, 255 - textcol.g, 255 - textcol.b);	if (text.size() > 0) {		Colour alphacol = textcol;		if (timeleft > -1) {			int fade = 100 * timeleft / animatetime;			alphacol = Colour(textcol.r + fade * wd.r / 100,					textcol.g + fade * wd.g / 100,					textcol.b + fade * wd.b / 100, 255 - fade);		}		gl_printf(gs->primary_font(), alphacol, x - view.x, y - view.y, "%s",				text.c_str());	}}
开发者ID:Zolomon,项目名称:lanarts,代码行数:31,


示例3: spectrum

vec spectrum(const vec &v, const vec &w, int noverlap){  int nfft = w.size();  it_assert_debug(pow2i(levels2bits(nfft)) == nfft,                  "The window size must be a power of two in spectrum()!");  vec P(nfft / 2 + 1), wd(nfft);  P = 0.0;  double w_energy = energy(w);  if (nfft > v.size()) {    P = sqr(abs(fft(to_cvec(elem_mult(zero_pad(v, nfft), w)))(0, nfft / 2)));    P /= w_energy;  }  else {    int k = (v.size() - noverlap) / (nfft - noverlap), idx = 0;    for (int i = 0; i < k; i++) {      wd = elem_mult(v(idx, idx + nfft - 1), w);      P += sqr(abs(fft(to_cvec(wd))(0, nfft / 2)));      idx += nfft - noverlap;    }    P /= k * w_energy;  }  P.set_size(nfft / 2 + 1, true);  return P;}
开发者ID:c304728539,项目名称:itpp-fastica,代码行数:28,


示例4: get_nth_kday_type

    nth_kday_type    get_nth_kday_type(stream_itr_type& sitr,                      stream_itr_type& stream_end,                      std::ios_base& a_ios,                      const facet_type& facet) const    {      // skip leading whitespace      while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; }       typename nth_kday_type::week_num wn;      day_of_week_type wd(0); // no default constructor      month_type m(1);        // no default constructor      match_results mr = m_element_strings.match(sitr, stream_end);      switch(mr.current_match) {        case first  : { wn = nth_kday_type::first; break; }        case second : { wn = nth_kday_type::second; break; }        case third  : { wn = nth_kday_type::third; break; }        case fourth : { wn = nth_kday_type::fourth; break; }        case fifth  : { wn = nth_kday_type::fifth; break; }        default:        {          boost::throw_exception(std::ios_base::failure("Parse failed. No match found for '" + mr.cache + "'"));          BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(wn = nth_kday_type::first);        }      }                                         // week num      facet.get(sitr, stream_end, a_ios, wd);   // day_of_week      extract_element(sitr, stream_end, of);    // "of" element      facet.get(sitr, stream_end, a_ios, m);    // month      return nth_kday_type(wn, wd, m);    }
开发者ID:00liujj,项目名称:dealii,代码行数:32,


示例5: main

int main(int argc, char* argv[])      {#if 0      logFile.setFileName("mtest.log");      if (!logFile.open(QIODevice::WriteOnly)) {            fprintf(stderr, "mtest: cannot open log file <mtest.log>/n");            exit(-1);            }#endif      QDir wd(QDir::current());#ifdef Q_OS_MAC      wd.cdUp();#endif#if 0      scanDir(wd);#else      for (const char* s : tests)            process(s);#endif      printf("/n");      printf("================/n");      printf("  processed %d  -- failed %d/n", processed, failed);      printf("================/n");      return 0;      }
开发者ID:Angeldude,项目名称:MuseScore,代码行数:27,


示例6: wd

void ComputeMgr::updateComputes2(CkQdMsg *msg){    delete msg;    CProxy_WorkDistrib wd(CkpvAccess(BOCclass_group).workDistrib);    WorkDistrib  *workDistrib = wd.ckLocalBranch();    workDistrib->saveComputeMapChanges(CkIndex_ComputeMgr::updateComputes3(),thisgroup);}
开发者ID:luyukunphy,项目名称:namd,代码行数:8,


示例7: wd

bool OpenGLContext::makeCurrentWithWindow(agpu_pointer window){    WithX11Display wd(display);    auto res = glXMakeCurrent(display, (Window)window, context) == True;    if(res)        currentGLContext = this;    return res;}
开发者ID:boberfly,项目名称:abstract-gpu,代码行数:8,


示例8: visit

 virtual void visit(const ConstElementPtr& e) {   if (e->getElementType() == ElementType::Way)   {     WayDiscretizer wd(_map->shared_from_this(), dynamic_pointer_cast<const Way>(e));     wd.discretize(_spacing, _result);   } }
开发者ID:andyneff,项目名称:hootenanny,代码行数:8,


示例9: wd

bool wxAppBase::SafeYield(wxWindow *win, bool onlyIfNeeded){    wxWindowDisabler wd(win);    wxEventLoopBase * const loop = wxEventLoopBase::GetActive();    return loop && loop->Yield(onlyIfNeeded);}
开发者ID:NullNoname,项目名称:dolphin,代码行数:8,


示例10: wd

void ShaderBoldLineGen::set_width(float32 w){	QOpenGLFunctions* ogl = QOpenGLContext::currentContext()->functions();	GLint viewport[4];	ogl->glGetIntegerv(GL_VIEWPORT, viewport);	QSizeF wd(w / float32(viewport[2]), w / float32(viewport[3]));	prg_.setUniformValue(unif_width_, wd);}
开发者ID:untereiner,项目名称:CGoGN_2,代码行数:8,


示例11: tst1

 void tst1() {     std::cerr << singleton(10) << "/n";     std::cerr << all() << "/n";     std::cerr << l(-10) << "/n";     std::cerr << r(10) << "/n";     std::cerr << l(-10, true) << "/n";     std::cerr << r(10, true) << "/n";     std::cerr << b(2, 10) << "/n";     std::cerr << wd(b(-5, 5, true, false, 1, 2) * b(-5, 5, false, true, 3, 4)) << "/n";     std::cerr << wd(l(2, false, 1) / b(2, 6, false, false, 2, 3)) << "/n";     std::cerr << wd(expt(b(-2, 3, true, false, 1, 2), 2)) << "/n";     std::cerr << wd(expt(b(-4, 3, true, false, 1, 2), 2)) << "/n";     std::cerr << wd(expt(b(2, 4, true, false, 1, 2), 2)) << "/n";     std::cerr << wd(expt(b(0, 3, true, false, 1, 2), 2)) << "/n";     std::cerr << wd(expt(b(-4, -2, true, false, 1, 2), 2)) << "/n";     std::cerr << b(2, 10, false, false, 1, 2) << " * " << l(10, false, 3).inv() << " = " << wd(b(2, 10, false, false, 1, 2) / l(10, false, 3)) << "/n";     std::cerr << b(-2, -1, false, true) << " * " << b(-3,0) << " = "; std::cerr.flush();     std::cerr << (b(-2, -1, false, true) * b(-3,0)) << "/n";     std::cerr << b(1, 2, true, false) << " * " << b(0,3) << " = "; std::cerr.flush();     std::cerr << (b(1, 2, true, false) * b(0,3)) << "/n";     std::cerr << b(1, 2, true, true) << " * " << b(-3,0) << " = "; std::cerr.flush();     std::cerr << (b(1, 2, true, true) * b(-3,0)) << "/n";     std::cerr << b(10,20) << " / " << b(0,1,true,false) << " = "; std::cerr.flush();     std::cerr << (b(10,20)/b(0,1,true,false)) << "/n";     std::cerr << (b(10,20)/b(0,2,true,false)) << "/n"; }
开发者ID:AleksandarZeljic,项目名称:z3,代码行数:26,


示例12: m3_fill

// fill mode 3 background with a colorvoid m3_fill(COLOR clr){	int ii;	u32 *dst = (u32*)vid_mem;	u32 wd (clr<<16) | clr;	for (ii = 0; ii < M3_SIZE / 4; ii++)		*dst++ = wd;}
开发者ID:jclementi,项目名称:rook_gba,代码行数:10,


示例13: main

int main(int argc, char *argv[]){	srand((unsigned int)time(0));	WorldDrawer wd(argc, argv, 800, 600, 200, 200, std::string("Tema 3: Labyrinth"));	wd.init();	wd.run();		return 0;}
开发者ID:costash,项目名称:Computer-Graphics-Assignments,代码行数:9,


示例14: wipe_directory

bool wipe_directory(const std::string &mountpoint, bool wipe_media){    struct stat sb;    if (stat(mountpoint.c_str(), &sb) < 0 && errno == ENOENT) {        // Don't fail if directory does not exist        return true;    }    WipeDirectory wd(mountpoint, wipe_media);    return wd.run();}
开发者ID:vaginessa,项目名称:DualBootPatcher,代码行数:11,


示例15: finalPunc

boolChartBase::finalPunc(const char* wrd){  ECString wd(wrd);  ECStringsIter ei = Term::Colons.begin();  for( ; ei!= Term::Colons.end() ; ei++) if(wrd == *ei) return true;  ei = Term::Finals.begin();  for( ; ei!= Term::Finals.end() ; ei++) if(wrd == *ei) return true;  return false;}
开发者ID:BLLIP,项目名称:bllip-parser,代码行数:11,


示例16: main

int main(int argc, char** argv){	std::unique_ptr<WeatherData> wd (new WeatherData);	std::unique_ptr<CurrentConditionsDisplay> ccd (new CurrentConditionsDisplay(*wd));		wd->registerObserver(ccd.get());	wd->setParameters(1,2,3);	ccd->display();	return 0;}
开发者ID:scrudrv,项目名称:dp,代码行数:11,


示例17: wd

void EditSolutionDialog::on_aw_clicked(){    QString wine = ui->aw->property("wine").toString();    WineDialog wd(wine, mWineModel, this);    if (wd.exec() == WineDialog::Accepted)    {        setWine(ui->aw, wd.wine());        if (ui->lockBtn->isChecked())            setWine(ui->bw, ui->aw->property("wine"));    }}
开发者ID:LLIAKAJL,项目名称:WineWizard,代码行数:11,


示例18: wxSafeYield

// Yield to other apps/messages and disable user input to all windows except// the given onebool wxSafeYield(wxWindow *win, bool onlyIfNeeded){    wxWindowDisabler wd(win);    bool rc;    if (onlyIfNeeded)        rc = wxYieldIfNeeded();    else        rc = wxYield();    return rc;}
开发者ID:252525fb,项目名称:rpcs3,代码行数:14,


示例19: wd

int wxGUIAppTraits::WaitForChild(wxExecuteData& execData){    // prepare to wait for the child termination: show to the user that we're    // busy and refuse all input unless explicitly told otherwise    wxBusyCursor bc;    wxWindowDisabler wd(!(execData.flags & wxEXEC_NODISABLE));    // Allocate an event loop that will be used to wait for the process    // to terminate, will handle stdout, stderr, and any other events and pass    // it to the common (to console and GUI) code which will run it.    wxGUIEventLoop loop;    return RunLoopUntilChildExit(execData, loop);}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:13,


示例20: wd

/** * Check the working directory for a weather model data directory * */void weatherModel::checkForModelData(){    QDir wd(cwd);    QStringList filters;    /* ndfd */    filters << QString::fromStdString( ndfd.getForecastIdentifier() )               + "-" + QFileInfo( inputFile ).fileName();    /* nam suface */    filters << QString::fromStdString( nam.getForecastIdentifier() )               + "-" + QFileInfo( inputFile ).fileName();    /* rap surface */    filters << QString::fromStdString( rap.getForecastIdentifier() )            + "-" + QFileInfo( inputFile ).fileName();    /* dgex surface */    //filters << QString::fromStdString( dgex.getForecastIdentifier() )    //	+ "-" + QFileInfo( inputFile ).fileName();    /* nam alaska surface */    filters << QString::fromStdString( namAk.getForecastIdentifier() )               + "-" + QFileInfo( inputFile ).fileName();    /* gfs */    filters << QString::fromStdString( gfs.getForecastIdentifier() )               + "-" + QFileInfo( inputFile ).fileName();#ifdef WITH_NOMADS_SUPPORT    int i;    for( i = 0; i < nNomadsCount; i++ )    {        filters <<             (QString::fromStdString(papoNomads[i]->getForecastReadable('-') )                    + "-" + QFileInfo( inputFile ).fileName()).toUpper();    }    filters << "20*.zip";#endif    //filter to see the folder in utc time    filters << "20*T*";    filters << "*.nc";    model->setNameFilters(filters);    model->setFilter(QDir::Files | QDir::Dirs);    treeView->setRootIndex(model->index(wd.absolutePath()));    treeView->resizeColumnToContents(0);    statusLabel->setText( "" );    unselectForecast(false);    // QModelIndex index = treeView->indexBelow( treeView->rootIndex() );    // treeView->setExpanded( index, true );    // index = treeView->indexBelow( index );    // treeView->setExpanded( index, true );}
开发者ID:psuliuxf,项目名称:windninja,代码行数:53,


示例21: main

int main(int argc, char *argv[]){	dict_elem_t *head_p;	int total;	char *value;	dict_elem_t *elem_fund;	FILE *fp_b;	switch(argc) {		case 2: //			if (strcmp(argv[1], "-test1") == 0) {				wd();			} else if (strcmp(argv[1], "-test2") == 0){				if ((fp_b = fopen("dict.dat","rb")) == NULL) {						total = get_elem_count("dict.txt");						head_p = malloc(total * sizeof(*head_p));						head_p = read_to_mem_from_txt("dict.txt", head_p, total);						if ((value = bd_fwrite(head_p, total, "dict.dat")) == NULL)						{							printf("error in bd_fwrite() /n");							return NULL;						}				} else {					fread(&total, sizeof(total), 1, fp_b);					head_p = malloc(total * sizeof(*head_p));					head_p = bd_fread(head_p, total);				}				print_data(head_p, total);			} else {				printf("please input right args");				return -1;			}			break;		case 4:			break;		default :				printf("please input right args");				return -1;	}	return 0;}
开发者ID:wxiaodong0829,项目名称:aka_edu_learned,代码行数:48,


示例22: pollThermostatCb

static  void ICACHE_FLASH_ATTR pollThermostatCb(void * arg){		unsigned long epoch = sntp_time+(sntp_tz*3600);		int year=get_year(&epoch);		int month=get_month(&epoch,year);		int day=day=1+(epoch/86400);		int dow=wd(year,month,day);		epoch=epoch%86400;		unsigned int hour=epoch/3600;		epoch%=3600;		unsigned int min=epoch/60;		int minadj = (min*100/60);		int currtime = hour*100+minadj;						if(sysCfg.thermostat1state == 0) {			os_printf("Thermostat switched off, abandoning routine./n");			return;		}				long Treading=-9999;				if(sysCfg.sensor_dht22_enable) { 			struct sensor_reading* result = readDHT();			if(result->success) {				Treading=result->temperature*100;				if(sysCfg.thermostat1_input==2) // Humidistat					Treading=result->humidity*100;			}					}		else { if(sysCfg.sensor_ds18b20_enable && sysCfg.thermostat1_input==0 ) { 			struct sensor_reading* result = read_ds18b20();			if(result->success) {			    int SignBit, Whole, Fract;				Treading = result->temperature;								SignBit = Treading & 0x8000;  // test most sig bit				if (SignBit) // negative				Treading = (Treading ^ 0xffff) + 1; // 2's comp					Whole = Treading >> 4;  // separate off the whole and fractional portions				Fract = (Treading & 0xf) * 100 / 16;				if (SignBit) // negative					Whole*=-1;				Treading=Whole*100+Fract;			}		}//ds8b20 enabled		}
开发者ID:openenergymonitor,项目名称:ESP8266_Relay_Board,代码行数:48,


示例23: wipe_directory

bool wipe_directory(const std::string &directory,                    const std::vector<std::string> &exclusions){    struct stat sb;    if (stat(directory.c_str(), &sb) < 0 && errno == ENOENT) {        // Don't fail if directory does not exist        return true;    }    std::vector<std::string> new_exclusions{ "multiboot" };    new_exclusions.insert(new_exclusions.end(),                          exclusions.begin(), exclusions.end());    WipeDirectory wd(directory, std::move(new_exclusions));    return wd.run();}
开发者ID:DTox187x,项目名称:DualBootPatcher,代码行数:16,


示例24: get_kday_after_type

    kday_after_type    get_kday_after_type(stream_itr_type& sitr,                        stream_itr_type& stream_end,                        std::ios_base& a_ios,                        const facet_type& facet) const    {      // skip leading whitespace      while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; }      day_of_week_type wd(0); // no default constructor      facet.get(sitr, stream_end, a_ios, wd);   // day_of_week      extract_element(sitr, stream_end, after); // "after" element      return kday_after_type(wd);    }
开发者ID:00liujj,项目名称:dealii,代码行数:16,


示例25: removePrefix

 void removePrefix(const QString &prefixHash, QWidget *parent) {     WaitDialog wd(parent);     QObject *worker = new QObject;     worker->moveToThread(new QThread);     wd.connect(worker->thread(), &QThread::started, worker, [worker, prefixHash]()     {         prefix(prefixHash).removeRecursively();         worker->deleteLater();     });     wd.connect(worker, &QObject::destroyed, worker->thread(), &QThread::quit);     wd.connect(worker->thread(), &QThread::finished, worker->thread(), &QThread::deleteLater);     wd.connect(worker->thread(), &QThread::destroyed, &wd, &WaitDialog::accept);     worker->thread()->start();     wd.exec(); }
开发者ID:Iaroslav464,项目名称:WineWizard,代码行数:16,


示例26: wd

double ProbabilityOfMatch::distanceScore(const ConstOsmMapPtr& map, const shared_ptr<const Way>& w1,  const shared_ptr<const LineString>& ls2, Meters circularError){  Meters distanceSum = 0.0;  vector<Coordinate> v;  WayDiscretizer wd(map, w1);  wd.discretize(2.0, v);  _dMax = 0.0;  for (size_t i = 0; i < v.size(); i++)  {    Point* point(GeometryFactory::getDefaultInstance()->createPoint(v[i]));    if (debug)    {      cout << "distance " << ls2->distance(point) << endl;    }    double d = ls2->distance(point);    distanceSum += d;    _dMax = max(d, _dMax);    delete point;  }  _dMax /= (circularError + w1->getCircularError());  Meters distanceMean = distanceSum / v.size();  /// @todo Make me better.  // E.g. if s1 = 50 & s2 = 50, then sigma = 70.  // This is a placeholder for the probability. Mike Porter will help me out w/ a better  // approximation later.  double s1 = w1->getCircularError() / 2.0;  double s2 = circularError / 2.0;  double sigma = sqrt(s1 * s1 + s2 * s2);  // The rational here is that we can calculate the  double p = 1 - (Normal::phi(distanceMean, sigma) - 0.5) * 2.0;  if (debug)  {    LOG_INFO("" << "distanceMean: " << distanceMean);    LOG_INFO("" << "  s1: " << s1 << " s2: " << s2 << " sigma: " << sigma << " p: " << p);  }  return p;}
开发者ID:giserh,项目名称:hootenanny,代码行数:47,


示例27: main

int main(int argc, char ** argv){  ros::init(argc, argv, "fcu");  ros::NodeHandle nh("fcu");  std::string port, portRX, portTX;  int baudrate;  ros::NodeHandle pnh("~");  CommPtr comm(new Comm);  bool connected = false;  pnh.param("baudrate", baudrate, HLI_DEFAULT_BAUDRATE);  if (pnh.getParam("serial_port_rx", portRX) && pnh.getParam("serial_port_tx", portTX))  {    connected = comm->connect(portRX, portTX, baudrate);  }  else  {    pnh.param("serial_port", port, std::string("/dev/ttyUSB0"));    connected = comm->connect(port, port, baudrate);  }  if (!connected)  {    ROS_ERROR("unable to connect");    ros::Duration(2).sleep();    return -1;  }  HLInterface asctecInterface(nh, comm);  SSDKInterface ssdk_if(nh, comm);  EKFInterface ekf_if(nh, comm);  printTopicInfo();  Watchdog wd(comm);  ros::spin();  return 0;}
开发者ID:ahm23ad,项目名称:asctec_mav_framework,代码行数:45,



注:本文中的wd函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ wd_start函数代码示例
C++ wcwidth函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。