• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ps函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ch

std::vector<Vendor> VendorDAOMySQL::findVendorByName(const std::string &name)
{
    MySQLManager::ConnectionHolder ch(MySQLManager::getInstance());
    std::unique_ptr<sql::PreparedStatement> ps(ch.conn->prepareStatement(FIND_VENDOR_BY_NAME));

    ps->setString(1, "%" + name + "%");

    std::unique_ptr<sql::ResultSet> res(ps->executeQuery());

    std::vector<Vendor> vendors;
    while(res->next())
    {
        vendors.push_back(Vendor(res->getInt(1), res->getString(2)));
    }

    return vendors;
}
开发者ID:filipkofron,项目名称:Thesis,代码行数:17,代码来源:VendorDAOMySQL.cpp


示例2: w_validate_buffer

 void w_validate_buffer(window* pw, int view_w, int view_h)
 {
   if(pw->dirty_area.is_valid())
   {
     WINDOW_ON_PAINT_PARAMS p;
     paint_graphics ps(pw->buffer, pw->dirty_area.x1, pw->dirty_area.y1, pw->dirty_area.x2, pw->dirty_area.y2 );
     p.clip_x = pw->dirty_area.x1;
     p.clip_y = pw->dirty_area.y1;
     p.clip_w = pw->dirty_area.x2 - pw->dirty_area.x1;
     p.clip_h = pw->dirty_area.y2 - pw->dirty_area.y1;
     p.view_w = view_w;
     p.view_h = view_h;
     p.surface = &ps; 
     pw->notify(WINDOW_ON_PAINT, &p);
     pw->dirty_area = agg::rect_i(1,1,0,0);
   }
 }
开发者ID:emuikernel,项目名称:BaijieCppUILib,代码行数:17,代码来源:window.cpp


示例3: ps

void Network::handlePluckerMessage(const osc::ReceivedMessage& m,
                                   const IpEndpointName& remoteEndpoint)
{
  // Utility data structures
  char buffer[1024];
  osc::OutboundPacketStream ps(buffer, 1024);

  // Parse OSC message
  osc::Symbol uuid;
  m.ArgumentStream() >> uuid >> osc::EndMessage;
  std::cerr << uuid << std::endl;

  WidgetMap* widgets = Widget::getAll();
  WidgetMap::iterator wit = widgets->find(std::string(uuid));
  if (wit != widgets->end() && dynamic_cast<Track*>(wit->second))
    ((Track*)wit->second)->addPlucker();
}
开发者ID:emarschner,项目名称:playround,代码行数:17,代码来源:Network.cpp


示例4: ps

void Function::Compile( sqlite3_context* ctx )
{
	Parser ps( mVM, mText );	

	if( ps.mErr.size() )
	{
		mCompiled = false;
		
		vector<char> buf;
		ConvertToUTF8( ps.mErr, buf );
		sqlite3_result_error( ctx, &buf[ 0 ], buf.size() - 1 );
	}
	else
	{
		mCompiled = true;
	}
}
开发者ID:lesteriv,项目名称:slite,代码行数:17,代码来源:Function.cpp


示例5: ch

std::vector<Inventory> InventoryDAOMySQL::searchInventoryByGtin(const int &userId, const std::string &gtin)
{
    MySQLManager::ConnectionHolder ch(MySQLManager::getInstance());
    std::unique_ptr<sql::PreparedStatement> ps(ch.conn->prepareStatement(INVENTORIES_SEARCH_GTIN));

    ps->setInt(1, userId);
    ps->setString(2, "%" + gtin + "%");

    std::unique_ptr<sql::ResultSet> res(ps->executeQuery());

    std::vector<Inventory> inventories;
    while(res->next())
    {
        inventories.push_back(Inventory(res->getInt(1), res->getInt(2), res->getInt(3), res->getString(4)));
    }
    return inventories;
}
开发者ID:filipkofron,项目名称:Thesis,代码行数:17,代码来源:InventoryDAOMySQL.cpp


示例6: ps

void MergeGraphOp::setParams(const std::string params)
{
    ParamSet ps(params);   

    ps("color_is_vector", _color_is_vector);
    ps("secondary_color_is_vector", _secondary_color_is_vector);
    ps("texcoord_is_vector", _texcoord0_is_vector);
    ps("texcoord0_is_vector", _texcoord0_is_vector);
    ps("texcoord1_is_vector", _texcoord1_is_vector);
    ps("texcoord2_is_vector", _texcoord2_is_vector);
    ps("texcoord3_is_vector", _texcoord3_is_vector);

    std::string out = ps.getUnusedParams();
    if(out.length())
    {
        FWARNING(("MergeGraphOp doesn't have parameters '%s'.\n",
                out.c_str()));
    }
}
开发者ID:jondo2010,项目名称:OpenSG,代码行数:19,代码来源:OSGMergeGraphOp.cpp


示例7: CheckPointer

HRESULT CFGFilterLAV::PropertyPageCallback(IBaseFilter* pBF)
{
    CheckPointer(pBF, E_POINTER);

    CComPropertySheet ps(ResStr(IDS_PROPSHEET_PROPERTIES), AfxGetMyApp()->GetMainWnd());

    // Find out which internal filter we are opening the property page for
    CFGFilterLAV::LAVFILTER_TYPE LAVFilterType = CFGFilterLAV::INVALID;
    if (!CFGFilterLAV::IsInternalInstance(pBF, &LAVFilterType)) {
        return E_UNEXPECTED;
    }

    HRESULT hr = E_FAIL;
    if (CComQIPtr<ISpecifyPropertyPages> pSPP = pBF) {
        ps.AddPages(pSPP, (LAVFilterType != CFGFilterLAV::AUDIO_DECODER) ? 1 : 2);
    }

    CComPtr<IPropertyPage> pPP = DEBUG_NEW CInternalPropertyPageTempl<CPinInfoWnd>(nullptr, &hr);
    ps.AddPage(pPP, pBF);

    if (ps.GetPageCount() > 1) {
        ps.DoModal();

        if (CComQIPtr<ILAVFSettings> pLAVFSettings = pBF) {
            CFGFilterLAVSplitterBase::Settings settings;
            if (settings.GetSettings(pLAVFSettings)) { // Get current settings from LAVSplitter
                settings.SaveSettings(); // Save them to the registry/ini
            }
        } else if (CComQIPtr<ILAVVideoSettings> pLAVVideoSettings = pBF) {
            CFGFilterLAVVideo::Settings settings;
            if (settings.GetSettings(pLAVVideoSettings)) { // Get current settings from LAVVideo
                settings.SaveSettings(); // Save them to the registry/ini
            }
        } else if (CComQIPtr<ILAVAudioSettings> pLAVAudioSettings = pBF) {
            CFGFilterLAVAudio::Settings settings;
            if (settings.GetSettings(pLAVAudioSettings)) { // Get current settings from LAVAudio
                settings.SaveSettings(); // Save them to the registry/ini
            }
        }

        hr = S_OK;
    }

    return hr;
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:45,代码来源:FGFilterLAV.cpp


示例8: ps

void CXGraphBitmap::Draw(CDCEx *pDC)
{
    if (!m_bVisible)
        return;

    CDCEx  dc;
    BITMAP bmp;
    CRect  bmpRect = m_clRect;

    if (m_bBorder)
    {
        CPenSelector ps(0, 1, pDC);
        pDC->Rectangle(m_clRect);
        bmpRect.DeflateRect (1,1,1,1);
    }

    if (pDC->m_bPrinting)
        pDC->AdjustRatio (bmpRect);

    m_pBitmap->GetBitmap(&bmp);

    dc.CreateCompatibleDC (pDC);

    CGdiObject* pOldObject = dc.SelectObject (m_pBitmap);

    pDC->StretchBlt(bmpRect.left, bmpRect.top, bmpRect.Width(), bmpRect.Height(), &dc, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);

    dc.SelectObject (pOldObject);

    if (m_bSizing)
    {
        if (pDC->m_bPrinting)
        {
            CRect rect = m_Tracker.m_rect;
            pDC->AdjustRatio (m_Tracker.m_rect);
            m_Tracker.Draw (pDC);
            m_Tracker.m_rect = rect;
        }
        else
            m_Tracker.Draw (pDC);
    }



}
开发者ID:yunhaisoft,项目名称:aoctm,代码行数:45,代码来源:XGraphBitmap.cpp


示例9: main

int main(int argc,char* argv[])
	{
	LidarProcessOctree lpo(argv[1],512*1024*1024);
	
	#if 1
	Misc::Timer t;
	{
	// BinaryPointSaver bps(argv[2]);
	PointCounter pc;
	lpo.processPoints(pc);
	std::cout<<pc.getNumPoints()<<std::endl;
	}
	t.elapse();
	std::cout<<"Done in "<<t.getTime()*1000.0<<" ms"<<std::endl;
	#elif 0
	PointSaver ps(argv[2]);
	Box box=Box::full;
	for(int i=0;i<2;++i)
		{
		box.min[i]=atof(argv[3+i]);
		box.max[i]=atof(argv[5+i]);
		}
	lpo.processPointsInBox(box,ps);
	#else
	PointCounter pc;
	Scalar radius=Scalar(0.1);
	PointDensityCalculator pdc(lpo,radius,4);
	#if 0
	Box box;
	box.min=Point(930,530,0);
	box.max=Point(970,570,100);
	lpo.processPointsInBox(box,pdc);
	#else
	// lpo.processPoints(pdc);
	lpo.processNodesPostfix(pdc);
	#endif
	
	std::cout<<"Number of processed points: "<<pdc.numPoints<<std::endl;
	std::cout<<"Total number of found neighbors: "<<pdc.totalNumNeighbors<<std::endl;
	std::cout<<"Total number of loaded octree nodes: "<<lpo.getNumSubdivideCalls()<<", "<<lpo.getNumLoadedNodes()<<std::endl;
	std::cout<<"Average point density in 1/m^3: "<<pdc.totalNumNeighbors/(pdc.numPoints*4.0/3.0*3.141592654*radius*radius*radius)<<std::endl;
	#endif
	
	return 0;
	}
开发者ID:jrevote,项目名称:3DA-LidarViewer,代码行数:45,代码来源:LidarProcessTest.cpp


示例10: MINILOG

Eigen::MatrixXf
powerspectrum::from_pcm(const Eigen::VectorXf& pcm_samples)
{
    MINILOG(logTRACE) << "Powerspectrum computation. input samples="
            << pcm_samples.size();
    // check if inputs are sane
    if ((pcm_samples.size() < win_size) || (hop_size > win_size)) {
        return Eigen::MatrixXf(0, 0);
    }
    size_t frames = (pcm_samples.size() - (win_size-hop_size)) / hop_size;
    size_t freq_bins = win_size/2 + 1;

    // initialize power spectrum
    Eigen::MatrixXf ps(freq_bins, frames);

    // peak normalization value
    float pcm_scale = std::max(fabs(pcm_samples.minCoeff()),
            fabs(pcm_samples.maxCoeff()));

    // scale signal to 96db (16bit)
    pcm_scale =  std::pow(10.0f, 96.0f/20.0f) / pcm_scale;

    // compute the power spectrum
    for (size_t i = 0; i < frames; i++) {

        // fill pcm
        for (int j = 0; j < win_size; j++) {
            kiss_pcm[j] = pcm_samples(i*hop_size+j) * pcm_scale * win_funct(j);
        }

        // fft
        kiss_fftr(kiss_status, kiss_pcm, kiss_freq);

        // save powerspectrum frame
        Eigen::MatrixXf::ColXpr psc(ps.col(i));
        for (int j = 0; j < win_size/2+1; j++) {
            psc(j) =
                    std::pow(kiss_freq[j].r, 2) + std::pow(kiss_freq[j].i, 2);
        }
    }

    MINILOG(logTRACE) << "Powerspectrum finished. size=" << ps.rows() << "x"
            << ps.cols();
    return ps;
}
开发者ID:agangzz,项目名称:musly,代码行数:45,代码来源:powerspectrum.cpp


示例11: ps

void MapgenV7P::generateCaves(s16 max_stone_y, s16 large_cave_depth)
{
	if (max_stone_y < node_min.Y)
		return;

	PseudoRandom ps(blockseed + 21343);
	PseudoRandom ps2(blockseed + 1032);

	u32 large_caves_count = (node_max.Y <= large_cave_depth) ? ps.range(0, 2) : 0;

	for (u32 i = 0; i < small_caves_count + large_caves_count; i++) {
		CavesV6 cave(ndef, &gennotify, water_level, c_water_source, c_lava_source);

		bool large_cave = (i >= small_caves_count);
		cave.makeCave(vm, node_min, node_max, &ps, &ps2,
			large_cave, max_stone_y, heightmap);
	}
}
开发者ID:MultiCraftProject,项目名称:MultiCraft,代码行数:18,代码来源:mapgen_v7p.cpp


示例12: main

using namespace cluster

int main(int argc, char* argv[])
{
  ClusterId num_clusters = 30;
  PointId num_points = 3000;
  Dimensions num_dimensions = 10;

  PointsSpace ps(num_points, num_dimensions);
  //std::cout << "PointSpace" << ps;

  Clusters clusters(num_clusters, ps);

  clusters.k_means();
  
  std::cout << clusters;

}
开发者ID:wxwidget,项目名称:cluster,代码行数:18,代码来源:test.cpp


示例13: ps

void plLayerAnimation::Read(hsStream* s, hsResMgr* mgr)
{
    plLayerAnimationBase::Read(s, mgr);

    fTimeConvert.Read(s, mgr);  
    if (!(fTimeConvert.IsStopped()))
    {   
        plSynchEnabler ps(true);    // enable dirty tracking so that we send state about
                                    // the anim resetting to start now.
        fTimeConvert.SetCurrentAnimTime(0, true);
    }
    Eval(hsTimer::GetSysSeconds(),0,0);

    // add sdl modifier
    delete fLayerSDLMod;
    fLayerSDLMod = new plLayerSDLModifier;
    fLayerSDLMod->SetLayerAnimation(this);
}
开发者ID:H-uru,项目名称:Plasma,代码行数:18,代码来源:plLayerAnimation.cpp


示例14: ProcessStmt

bool BuildAstTreeDepGraph ::
ProcessStmt( AstInterface &fa, const AstNodePtr& s)
{
   GraphAccessInterface::Node *n = graph->CreateNodeImpl(s, GetStmtDomain(s));
   StmtNodeInfo info(n,s);
   stmtNodes.PushFirst(info);
   for (StmtStackType::Iterator ps(stmtNodes); !ps.ReachEnd(); ++ps) {
        ComputeStmtDep((*ps), info, DEPTYPE_DATA | DEPTYPE_IO);
   }
   for ( StmtStackType::Iterator p(ctrlNodes); !p.ReachEnd(); ++p) {
      ComputeCtrlDep((*p), info);
   }
   for (StmtStackType::Iterator pg(gotoNodes); !pg.ReachEnd(); ++pg) {
        ComputeCtrlDep((*pg), info);
   }

   return ProcessAstTree::ProcessStmt(fa, s);
}
开发者ID:matzke1,项目名称:rose-develop,代码行数:18,代码来源:DepGraphBuild.C


示例15: test_file

int test_file(const std::string & test_data_filepath,
        const std::string & label_prefix) {
    int fails = 0;
    std::vector<pstrudel::TreeShape>  trees;
    pstrudel::treeio::read_from_filepath(trees, test_data_filepath, "nexus");
    unsigned long tree_idx = 0;
    for (auto & tree : trees) {
        std::string label = label_prefix + ":" + std::to_string(tree_idx + 1);
        pstrudel::LineageThroughTimeProfileCalculator ltt_calc(tree);
        auto profiles = ltt_calc.build_lineage_splitting_time_profile();
        auto lst_profile = profiles.first;
        auto scaled_lst_profile = profiles.second;
        std::ostringstream o;
        TREE_WRITER.write(o, tree);
        o << "\n";
        assert(lst_profile.data_size() == scaled_lst_profile.data_size());
        auto rds = lst_profile.data_size();
        for (unsigned long idx = 0; idx < rds; ++idx) {
            o << std::fixed << std::setprecision(22) << lst_profile.raw_data(idx);
            o << "\t" << std::fixed << std::setprecision(22) << scaled_lst_profile.raw_data(idx);
            o << "\n";
        }
        colugo::Subprocess ps({"python", CHECK_SCRIPT, "-f", "newick", "-l", label});
        try {
            auto result = ps.communicate(o.str());
            if (ps.returncode() != 0) {
                std::cerr << "(test '" << label << "' returned error: " << ps.returncode() << ")\n";
                // TREE_WRITER.write(std::cerr, tree);
                // std::cerr << std::endl;
                std::cerr << result.first;
                std::cerr << result.second;
                fails += 1;
            // } else {
            //     std::cerr << result.second;
            }
        } catch (const colugo::SubprocessTimeOutException & e) {
            std::cerr << "(test '" << label << "' timed out)\n";
            exit(1);
        }
        ++tree_idx;
    }
    return fails;
}
开发者ID:jeetsukumaran,项目名称:pstrudel,代码行数:43,代码来源:lineage_splitting_time.cpp


示例16: main

int main(int argc, char* argv[]) {

	if (argc != 2) {
		std::cout << "Invalid input fromt the command line argument.\n";
		return -1;
	}
	else {
		ProcessScheduler ps(argv[1]);
		
		if (!fileExists(ps.filename.c_str())) {
			std::cout << "File not found" << std::endl;
			return -1;
		}
		ps.readFile();
		ps.run();
	}

    return 0;
}
开发者ID:mkpham2,项目名称:Process-Scheduler,代码行数:19,代码来源:ps.cpp


示例17: main

int main(int argc, char **argv)
{

	symbol_table_t st;

	// add symbols to st;

	PRE_IN_FIX(st, "+", 130, 110);
	PRE_IN_FIX(st, "-", 130, 110);

	INFIX(st, "*", 120);
	INFIX(st, "/", 120);
	INFIX(st, "%", 120);

	INFIX(st, "|", 70);
	INFIX(st, "^", 80);
	INFIX(st, "&", 90);

	INFIX(st, "<<", 100);
	INFIX(st, ">>", 100);

	PREFIX(st, "~", 130);

	INFIX_R(st, "**", 140);

//	SYMBOL(st, "(", 150);
	// usage
	{
		//char line[500];
		if (argc != 2)
			return 1;
		char *line = argv[1];
		//while (fgets(line, sizeof(line), stdin)) {
			parse_state_t ps(st);
			symbol_base_t *root = ps.parse(line, strlen(line));
			printf ("%d\n", calc(root));

			delete root;
		//}
	}

	return 0;
}
开发者ID:billyevans,项目名称:pratt_parse,代码行数:43,代码来源:example.cpp


示例18: wr_string

/*
 *  wr_string() writes a string to the operation screen at the location
 *  specified by col and row.  F_color is the color of the string
 *  and B_color is the color of the background. blinking should be BLINK
 *  if the string is to blink, and !BLINK if not. The last parameter is
 *  a pointer to the null-terminated string. wr_string goes to the next
 *  line if the current line is filled.
 *
 *  wr_string() was modified to support writing to graphics screen
 *  as well as text screen.  If graphics has not been initialized,
 *  writes messages to text screen.  Necessary in order to see any
 *  smx error messages that occur during initialization (these are
 *  usually insufficient resource errors -- for example, failure to
 *  create task due to lack of tcb's.
 */
void _cdecl wr_string(int col, int row, int F_color, int B_color,
                                         int blinking, const char *in_string)
{
#if (DEVICE_CONSOLE_OUT)

 #if (USES_UART)
   int   was_unlocked;
 #endif

   if (!crt_is_init) return;

 #if (USES_UART)
  #if (USE_COLOR == 0)
   F_color = WHITE;
   B_color = BLACK;
  #endif
   was_unlocked = !IS_LOCKED(self);
   LOCK(self);
   ANSI_GotoXY(row,col);
   ANSI_SetGMode(F_color+30);
   ANSI_SetGMode(B_color+40);
   if (blinking)
      ANSI_SetGMode(BLINK);
   ps(in_string);
   ANSI_ClrEndOfLine();
   if (was_unlocked) unlockx(self);
 #endif

 #if defined(PEG) && SMXPEG_CONSOLE_WINDOW
   //TODO:
 #endif

#else
   /* Avoid compiler warning about unused pars. */
   (void) col;
   (void) row;
   (void) F_color;
   (void) B_color;
   (void) blinking;
   (void) in_string;

#endif
}
开发者ID:peteratebs,项目名称:webcwebbrowser,代码行数:58,代码来源:CRT.C


示例19: computeDB

void computeDB(const robot_model::RobotModelPtr &robot_model,
           unsigned int ns, unsigned int ne)
{
  planning_scene::PlanningScenePtr ps(new planning_scene::PlanningScene(robot_model));
  ompl_interface::OMPLInterface ompl_interface(robot_model);
  moveit_msgs::Constraints c = getConstraints();
  ompl_interface::ConstraintApproximationConstructionOptions opt;
  opt.state_space_parameterization = "PoseModel";
  opt.samples = ns;
  opt.edges_per_sample = ne;
  opt.explicit_motions = true;
  opt.max_edge_length = 0.2;
  opt.explicit_points_resolution = 0.05;
  opt.max_explicit_points = 10;

  ompl_interface.getConstraintsLibrary().addConstraintApproximation(c, "right_arm", ps, opt);
  ompl_interface.getConstraintsLibrary().saveConstraintApproximations("~/constraints_approximation_database");
  ROS_INFO("Done");
}
开发者ID:ksenglee,项目名称:ros,代码行数:19,代码来源:demo_construct_state_database.cpp


示例20: ps

PropertyRecordPtr XmlPropertyReader::getPropertiesAsRecord(DOMElement *parent)
{
    PropertyRecordPtr ps(new PropertyRecord());

    DOMNodeList* propertyDefChildren = parent->getChildNodes();
    for (XMLSize_t childIdx = 0; childIdx < propertyDefChildren->getLength(); childIdx++)
    {
        DOMNode* curChild = propertyDefChildren->item(childIdx);
        if (curChild->getNodeType() == DOMNode::ELEMENT_NODE)
        {
            PropertyEntry entry = processProperty(static_cast<DOMElement*>(curChild));
            if (entry.first != "")
            {
                ps->setProperty(entry.first, entry.second);
            }
        }
    }
    return ps;
}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:19,代码来源:XmlPropertyReader.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ps3_result函数代码示例发布时间:2022-05-30
下一篇:
C++ prvStartFirstTask函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap