利用VC++实现对XML结点的更新和追加
实现功能:根据配置文件(XXXX.ini)中的内容对XML中节点进行操作,如果XML中存在与配置文件中相同的节点,则根据配置文件将XML文件中相应节点的值进行更新;如果XML文件中不存在配置文件中出现的节点,则在XML中将新节点及值进行插入操作。
◆XML文档结构如下
//--------------------------------------------------------------------------------------------
- <printer driver-name="OKI C710(PS)">
<color-profile path="ColorProfiles/OkiC710CMY.icc" />
</printer>
- <printer driver-name="OKI C710(PCL)">
<color-profile path="ColorProfiles/OkiC710CMY.icc" />
</printer>
- <printer driver-name="OKI C830(PS)">
<color-profile path="ColorProfiles/OkiC830CMY_new.icc
" />
</printer>
- <printer driver-name="OKI C830(PCL)">
<color-profile path="ColorProfiles/OkiC830CMY.icc" />
</printer>
//--------------------------------------------------------------------------------------------
◆配置文件结构如下
//----------------------------------------------------------------------------------------------
[Driver]
D1=OKI C830(PCL);OkiC830CMY_new;ColorProfiles/OkiC830CMY_new.icc
D2=OKI C810(PCL);OkiC810CMY_new;ColorProfiles/OkiC810CMY_new.icc
//-----------------------------------------------------------------------------------------------
实现步骤:
1, 读取配置文件,并将其中的信息内容用类对像进行保存
2, 对XML档进行更新.
因为整个过程并不复杂,现将代码附上。
类定义
//CCustomMediaInfoクラスの定義
//機能:GridLayouter機種設定ツールのGLPDFInfo.datファイル情報を初期化処理
//期日:2009.10.29
//作成:
//その他:The CustomMedia.ini file is located at ..\CustomMedia\CustomMediaInfo.ini
#define MAX_UPDATE_PRN 256 //The must number of printers to be updated.
//To save the value of every item of a line in GLPDFInfo.dat or okPrnInfo
相关文档:
http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html
Sunday, May 10, 2009
Hadoop should target C++/LLVM, not Java (because of watts)
< type="text/javascript">
digg_url="http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html";
Over the years, ......
//数据绑定
public void DataBind()
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath(@"App_data/dbGuest.xml"));
&nbs ......
引用类库:
using System;
using System.Data;
using System.IO;
using System.Xml;
using System.Text;
// 相应C#代码:
private string ConvertDataTableToXML(DataTable xmlDS)
{
MemoryStream stream = null;
XmlTextWriter writer = null;
try
......
2009-12-19考了CET英语,心情很差,估计又不过的,哎!英文差!
于是看看书,看看自己感兴趣的书
今天下午,研究了整个下午的小难题,在8点40分终于搞定了!肚子饿,还没吃饭,还没洗澡,克服了一个不懂的小难题,心理有点体会,想在这里留点纪念,方便别人以后学习。于是乎,我写了:
(那些开训练器的相关介绍我就不再 ......
三、训练分类器
样本创建之后,接下来要训练分类器,这个过程是由haartraining 程序来实现的。
Haartraining 的命令行参数如下:
-data<dir_name>
存放训练好的分类器的路径名。
-vec<vec_file_name>
正样本文件名(由trainingssamples 程序或者由其他的方法创建的)
-bg<background_file_name& ......