﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-huyutian</title><link>http://www.cppblog.com/huyutian/</link><description>他强由他强，清风拂山岗；他横由他横，明月照大江。他自狠来他自恶，我自一口真气足
</description><language>zh-cn</language><lastBuildDate>Fri, 03 Apr 2026 21:54:20 GMT</lastBuildDate><pubDate>Fri, 03 Apr 2026 21:54:20 GMT</pubDate><ttl>60</ttl><item><title>pandas使用HDF5格式存储需要注意的问题</title><link>http://www.cppblog.com/huyutian/archive/2015/12/08/212436.html</link><dc:creator>胡雨田</dc:creator><author>胡雨田</author><pubDate>Tue, 08 Dec 2015 08:38:00 GMT</pubDate><guid>http://www.cppblog.com/huyutian/archive/2015/12/08/212436.html</guid><wfw:comment>http://www.cppblog.com/huyutian/comments/212436.html</wfw:comment><comments>http://www.cppblog.com/huyutian/archive/2015/12/08/212436.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/huyutian/comments/commentRss/212436.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/huyutian/services/trackbacks/212436.html</trackback:ping><description><![CDATA[<div>HDF5格式非常适合保存层次化的结构数据集合。python下有pytable和h5py两种接口方式支持存储HDF5文件，pandas就支持直接读写pytable。保存数据量不太大（一般控制在2GB以内）的日线分钟线数据用h5格式还是很方便的。pandas在读取h5文件时，可以像数据库一样进行条件检索。详细资料可参考pandas.HDFStore的where参数。要使column可以在where语句中查询，保存数据文件时需要增加index或者明确指定data_columns。但是指定过多的column为data_columns将会使得<a href="http://pandas.pydata.org/pandas-docs/stable/io.html">性能下降</a>。<br />网上搜索后找到了关于pandas存储HDF5文件性能优化的一些建议，原文在<a href="http://stackoverflow.com/questions/24892904/python-pandas-store-a-data-frame-in-hdf5-with-a-multi-index">这里</a><br /><div><br />1.不使用index，创建出来的HDF文件尺寸会小一些，速度也快一些。<br />2.通过store.create_table_index() 创建索引，对data_columns进行筛选时的速度没有什么影响。<br />3.保存HDF时使用压缩选项对数据的读取速度影响很小，但是压缩后，文件尺寸会显著的变小。<br />使用pandas读写hdf5文件示例如下<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008000; ">#</span><span style="color: #008000; ">write</span><span style="color: #008000; "><br /></span>store=pd.HDFStore(<span style="color: #800000; ">"</span><span style="color: #800000; ">./data/Minutes.h5</span><span style="color: #800000; ">"</span>,<span style="color: #800000; ">"</span><span style="color: #800000; ">a</span><span style="color: #800000; ">"</span>,&nbsp;complevel=9,&nbsp;complib=<span style="color: #800000; ">'</span><span style="color: #800000; ">zlib</span><span style="color: #800000; ">'</span>)<br />store.put(<span style="color: #800000; ">"</span><span style="color: #800000; ">Year2015</span><span style="color: #800000; ">"</span>,&nbsp;dfMinutes,&nbsp;format=<span style="color: #800000; ">"</span><span style="color: #800000; ">table</span><span style="color: #800000; ">"</span>,&nbsp;append=True,&nbsp;data_columns=[<span style="color: #800000; ">'</span><span style="color: #800000; ">dt</span><span style="color: #800000; ">'</span>,<span style="color: #800000; ">'</span><span style="color: #800000; ">code</span><span style="color: #800000; ">'</span>])<br /><span style="color: #008000; ">#</span><span style="color: #008000; ">&nbsp;read</span><span style="color: #008000; "><br /></span>store=pd.HDFStore(<span style="color: #800000; ">"</span><span style="color: #800000; ">./data/Minutes.h5</span><span style="color: #800000; ">"</span>,<span style="color: #800000; ">"</span><span style="color: #800000; ">r</span><span style="color: #800000; ">"</span>)<br />store.select(<span style="color: #800000; ">"</span><span style="color: #800000; ">Year2015</span><span style="color: #800000; ">"</span>,&nbsp;where=[<span style="color: #800000; ">'</span><span style="color: #800000;">dt&lt;Timestamp("2015-01-07")</span><span style="color: #800000; ">'</span>,<span style="color: #800000; ">'</span><span style="color: #800000; ">code=="000570"</span><span style="color: #800000; ">'</span>])</div></div></div><img src ="http://www.cppblog.com/huyutian/aggbug/212436.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huyutian/" target="_blank">胡雨田</a> 2015-12-08 16:38 <a href="http://www.cppblog.com/huyutian/archive/2015/12/08/212436.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>转载：linux启动过程中的几个重要文件的详解</title><link>http://www.cppblog.com/huyutian/archive/2015/03/01/209903.html</link><dc:creator>胡雨田</dc:creator><author>胡雨田</author><pubDate>Sun, 01 Mar 2015 11:57:00 GMT</pubDate><guid>http://www.cppblog.com/huyutian/archive/2015/03/01/209903.html</guid><wfw:comment>http://www.cppblog.com/huyutian/comments/209903.html</wfw:comment><comments>http://www.cppblog.com/huyutian/archive/2015/03/01/209903.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/huyutian/comments/commentRss/209903.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/huyutian/services/trackbacks/209903.html</trackback:ping><description><![CDATA[<div>终于搞清楚了为啥我的Ec2108在/etc/init.d/rcS中设置的PATH，启动后莫名的被修改了，原来是/etc/init.d/profile中又把PATH重新设置了，原因记录下来。<br />【本文为OurUnix--Linux's境原创，转载请注明源地址www.ourunix.org】</div><div></div><div>这两天在做根文件系统的时候，注意到/linuxrc、/etc/init.d/rcS、/etc/init.d/rc.local、/etc/init.d/profile这几个文件尤其重要，遂把他们记载下来了。</div><div></div><div>/Linuxrc 执行init 进程初始化文件。主要工作是把已安装根文件系统中的/etc 挂载为ramfs，并拷贝/mnt/etc/目录下所有文件到/etc，这里存放系统启动后的许多特殊文件；接着Linuxrc 重新构建文件分配表inittab；之后执行系统初始化进程/sbin/init。</div><div>Linuxrc</div><div>#!/bin/sh</div><div>echo "mount /etc as ramfs"</div><div>/bin/mount -n -t ramfs ramfs /etc</div><div>/bin/cp -a /mnt/etc/* /etc</div><div>echo "re-create the /etc/mtab entries"</div><div># re-create the /etc/mtab entries</div><div>/bin/mount -f -t cramfs -o remount,ro /dev/mtdblock/3 /</div><div>/bin/mount -f -t ramfs ramfs /etc</div><div>exec /sbin/init</div><div></div><div>etc/init.d/rcS 完成各个文件系统的 mount，再执行/usr/etc/rc.local；通过rcS 可以调用 dhcp 程序配置网络。rcS 执行完了以后，init 就会在一个 console 上，按照 inittab 的指示开一个 shell，或者是开 getty + login，这样用户就会看到提示输入用户名的提示符。</div><div>rc.local</div><div>/usr/etc/</div><div>#!/bin/sh</div><div>. /usr/etc/profile</div><div>echo "HELLO! Embest"</div><div>echo "ifconfig eth0 192.168.0.10"</div><div>ifconfig eth0 192.168.0.10 #可自行配置开发板IP</div><div></div><div>/usr/etc/rc.local 这是被init.d/rcS 文件调用执行的特殊文件，与Linux 系统硬件平台相关，如安装核心模块、进行网络配置、运行应用程序、启动图形界面等。</div><div>rcS</div><div>/mnt/etc/init.</div><div>d/</div><div>#!/bin/sh</div><div>/bin/mount -a</div><div>exec /usr/etc/rc.local</div><div></div><div>/usr/etc/profile 执行该文件配置需要的环境变量等。</div><div>Profile</div><div>/usr/etc/</div><div>#!/bin/sh</div><div>PATH=/bin:/sbin:/usr/bin:/usr/sbin ?? 设置命令工具所在位置</div> <div id="haloword-lookup" class="ui-widget-content ui-draggable"><div id="haloword-title"><span id="haloword-word"></span><a herf="#" id="haloword-pron" class="haloword-button" title="发音"></a><audio id="haloword-audio"></audio><div id="haloword-control-container"><a herf="#" id="haloword-add" class="haloword-button" title="加入单词表"></a><a herf="#" id="haloword-remove" class="haloword-button" title="移出单词表"></a><a href="#" id="haloword-open" class="haloword-button" title="查看单词详细释义" target="_blank"></a><a herf="#" id="haloword-close" class="haloword-button" title="关闭查询窗"></a></div></div><div id="haloword-content"></div></div><img src ="http://www.cppblog.com/huyutian/aggbug/209903.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huyutian/" target="_blank">胡雨田</a> 2015-03-01 19:57 <a href="http://www.cppblog.com/huyutian/archive/2015/03/01/209903.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>sqlite下使用Replace命令和Update更新记录时的差别</title><link>http://www.cppblog.com/huyutian/archive/2015/03/01/209900.html</link><dc:creator>胡雨田</dc:creator><author>胡雨田</author><pubDate>Sun, 01 Mar 2015 10:12:00 GMT</pubDate><guid>http://www.cppblog.com/huyutian/archive/2015/03/01/209900.html</guid><wfw:comment>http://www.cppblog.com/huyutian/comments/209900.html</wfw:comment><comments>http://www.cppblog.com/huyutian/archive/2015/03/01/209900.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/huyutian/comments/commentRss/209900.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/huyutian/services/trackbacks/209900.html</trackback:ping><description><![CDATA[&nbsp; &nbsp; &nbsp;最近在写sqilte语句更新数据时发现个问题，那就是Replace into执行时居然会把id主键修改了。google了一下，原来Replace的原理是找到待修改的记录后，整条删除，然后插入新记录。所以这个过程中，默认的id主键会被修改。有时候这种结果并不是我们所想要的，应该如何解决呢？<br /><div>http://stackoverflow.com/questions/2717590/sqlite-upsert-on-duplicate-key-update这里有很好的讨论。<br />个人觉得以下方法最好，摘抄如下。<br /><div>&nbsp;INSERT OR REPLACE INTO page (id, name, title, content, author)</div><div>&nbsp;SELECT old.id, new.name, new.title, old.content, new.author</div><div>&nbsp;FROM ( SELECT</div><div>&nbsp; &nbsp; &nbsp;"about" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AS name,</div><div>&nbsp; &nbsp; &nbsp;"About this site" AS title,</div><div>&nbsp; &nbsp; &nbsp;42 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AS author</div><div>&nbsp;) AS new</div><div>&nbsp;LEFT JOIN (</div><div>&nbsp; &nbsp; &nbsp;SELECT id, name, content</div><div>&nbsp; &nbsp; &nbsp;FROM page WHERE name= "about"</div><div>&nbsp;) AS old ON new.name = old.name;</div></div><div id="haloword-lookup" class="ui-widget-content ui-draggable"><div id="haloword-title"><span id="haloword-word"></span><a herf="#" id="haloword-pron" class="haloword-button" title="发音"></a><audio id="haloword-audio"></audio><div id="haloword-control-container"><a herf="#" id="haloword-add" class="haloword-button" title="加入单词表"></a><a herf="#" id="haloword-remove" class="haloword-button" title="移出单词表"></a><a href="#" id="haloword-open" class="haloword-button" title="查看单词详细释义" target="_blank"></a><a herf="#" id="haloword-close" class="haloword-button" title="关闭查询窗"></a></div></div><div id="haloword-content"></div></div><img src ="http://www.cppblog.com/huyutian/aggbug/209900.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huyutian/" target="_blank">胡雨田</a> 2015-03-01 18:12 <a href="http://www.cppblog.com/huyutian/archive/2015/03/01/209900.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>sqlite下使用Replace命令和Update更新记录时的差别</title><link>http://www.cppblog.com/huyutian/archive/2015/03/01/209899.html</link><dc:creator>胡雨田</dc:creator><author>胡雨田</author><pubDate>Sun, 01 Mar 2015 10:11:00 GMT</pubDate><guid>http://www.cppblog.com/huyutian/archive/2015/03/01/209899.html</guid><wfw:comment>http://www.cppblog.com/huyutian/comments/209899.html</wfw:comment><comments>http://www.cppblog.com/huyutian/archive/2015/03/01/209899.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/huyutian/comments/commentRss/209899.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/huyutian/services/trackbacks/209899.html</trackback:ping><description><![CDATA[&nbsp; &nbsp; &nbsp;最近在写sqilte语句更新数据时发现个问题，那就是Replace into执行时居然会把id主键修改了。google了一下，原来Replace的原理是找到待修改的记录后，整条删除，然后插入新记录。所以这个过程中，默认的id主键会被修改。有时候这种结果并不是我们所想要的，应该如何解决呢？<br /><div>http://stackoverflow.com/questions/2717590/sqlite-upsert-on-duplicate-key-update这里有很好的讨论。<br />个人觉得以下方法最好，摘抄如下。<br /><div>&nbsp;INSERT OR REPLACE INTO page (id, name, title, content, author)</div><div>&nbsp;SELECT old.id, new.name, new.title, old.content, new.author</div><div>&nbsp;FROM ( SELECT</div><div>&nbsp; &nbsp; &nbsp;"about" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AS name,</div><div>&nbsp; &nbsp; &nbsp;"About this site" AS title,</div><div>&nbsp; &nbsp; &nbsp;42 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AS author</div><div>&nbsp;) AS new</div><div>&nbsp;LEFT JOIN (</div><div>&nbsp; &nbsp; &nbsp;SELECT id, name, content</div><div>&nbsp; &nbsp; &nbsp;FROM page WHERE name= "about"</div><div>&nbsp;) AS old ON new.name = old.name;</div></div><div id="haloword-lookup" class="ui-widget-content ui-draggable"><div id="haloword-title"><span id="haloword-word"></span><a herf="#" id="haloword-pron" class="haloword-button" title="发音"></a><audio id="haloword-audio"></audio><div id="haloword-control-container"><a herf="#" id="haloword-add" class="haloword-button" title="加入单词表"></a><a herf="#" id="haloword-remove" class="haloword-button" title="移出单词表"></a><a href="#" id="haloword-open" class="haloword-button" title="查看单词详细释义" target="_blank"></a><a herf="#" id="haloword-close" class="haloword-button" title="关闭查询窗"></a></div></div><div id="haloword-content"></div></div> <div id="haloword-lookup" class="ui-widget-content"><div id="haloword-title"><span id="haloword-word"></span><a herf="#" id="haloword-pron" class="haloword-button" title="发音"></a><audio id="haloword-audio"></audio><div id="haloword-control-container"><a herf="#" id="haloword-add" class="haloword-button" title="加入单词表"></a><a herf="#" id="haloword-remove" class="haloword-button" title="移出单词表"></a><a href="#" id="haloword-open" class="haloword-button" title="查看单词详细释义" target="_blank"></a><a herf="#" id="haloword-close" class="haloword-button" title="关闭查询窗"></a></div></div><div id="haloword-content"></div></div><img src ="http://www.cppblog.com/huyutian/aggbug/209899.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huyutian/" target="_blank">胡雨田</a> 2015-03-01 18:11 <a href="http://www.cppblog.com/huyutian/archive/2015/03/01/209899.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>解决linux虚拟机下 VMware Tools安装问题</title><link>http://www.cppblog.com/huyutian/archive/2015/02/22/209846.html</link><dc:creator>胡雨田</dc:creator><author>胡雨田</author><pubDate>Sun, 22 Feb 2015 04:28:00 GMT</pubDate><guid>http://www.cppblog.com/huyutian/archive/2015/02/22/209846.html</guid><wfw:comment>http://www.cppblog.com/huyutian/comments/209846.html</wfw:comment><comments>http://www.cppblog.com/huyutian/archive/2015/02/22/209846.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/huyutian/comments/commentRss/209846.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/huyutian/services/trackbacks/209846.html</trackback:ping><description><![CDATA[<div>ubuntu下安装vmware tools问题<br />VMware Tools installation cannot be started manually while Easy Install is in progress.</div><span style="font-size: 12px;"><br />vmware-install.pl</span><div id="haloword-lookup"  ui-draggable"="" class="ui-draggable"><div id="haloword-title"><a herf="#" id="haloword-pron" title="发音"></a><audio id="haloword-audio"></audio><div id="haloword-control-container"><a herf="#" id="haloword-add" title="加入单词表"></a><a herf="#" id="haloword-remove" title="移出单词表"></a><a href="#" id="haloword-open" title="查看单词详细释义" target="_blank"></a><a herf="#" id="haloword-close" title="关闭查询窗"></a></div></div><div id="haloword-content"></div></div>我在虚拟机安装Ubuntu时，无法自动安装VMware Tools，不能全屏显示。<br />网上搜索解决办法如下，未成功。<br /><span style="font-size: 12px;">在开启虚拟机操作系统的情况下，在虚拟机设置中更改floppy为auto detect。然后点击菜单中的安装VMWare Tools，虚拟操作系统中的光驱里就会有VMWare Tools的安装程序了，自行安装即可<br />最终解决办法：<br />在VMware目录（win7下为</span>C:\Program Files (x86)\VMware\VMware Workstation<span style="font-size: 12px;">）下找到linux.iso挂接到Ubuntu虚拟机光驱。在Ubuntu虚拟机中解压光盘安装包，启动终端程序，进入</span><span style="color: #555555; font-family: 宋体, 'Arial Narrow', arial, serif; line-height: 28px; background-color: #ffffff;">VMware-tools-distrib目录，</span><span style="font-size: 12px;">运行sudo perl&nbsp;</span><span style="background-color: #ffffff;"><font color="#555555" face="宋体, Arial Narrow, arial, serif"><span style="line-height: 28px;">vmware-install.pl</span></font><br /><br /><font color="#555555" face="宋体, Arial Narrow, arial, serif"><span style="line-height: 28px;">debian下安装vmware tools问题</span></font><br /><font color="#555555" face="宋体, Arial Narrow, arial, serif"><span style="line-height: 28px;">debian下按照上面的方法安装虚拟机是不能成功的，会显示错误</span></font><br /></span><div><span style="line-height: 28px;">"The path "usr/bin/gcc" is not a valid path to the gcc binary path"&nbsp;</span></div><div><span style="line-height: 28px;">"The path "" is not a valid path to the 2.6.32-5-686 kernel header"</span><br /><span style="line-height: 28px;">原因是vmware tools需要搜素gcc编译器和linux内核版本。解决办法是</span><br /><div><span style="line-height: 28px;">uname -r</span></div><div><span style="line-height: 28px;">显示2.6.32-5-686</span></div><div><span style="line-height: 28px;">然后安装头文件</span></div><div><span style="line-height: 28px;">apt-get install linux-headers-2.6.32-5-686<br />安装编译环境</span></div><div><span style="line-height: 28px;">apt-get install make</span></div><div><span style="line-height: 28px;">apt-get install build-essential<br /></span></div>然后再重复上面Ubuntu的安装过程<br />先用df命令确定光盘mount位置<br /><img src="http://www.cppblog.com/images/cppblog_com/huyutian/Debian6-2015-02-25-15-27-41.png" width="800" height="600" alt="" /><br />我的光盘位置/media/cdrom0<br /><div>cd /tmp<br /><div>tar zxpf /mnt/cdrom/VMwareTools-8.8.0-47126.tar.gz<br />cd vmware-tools-distrib<br /><div>./vmware-install.pl<br />然后安装时一路回车，使用默认选项就ok<br /><img src="http://www.cppblog.com/images/cppblog_com/huyutian/Debian6-2015-02-25-15-08-24.png" width="800" height="600" alt="" /></div></div></div></div><div id="haloword-lookup"  ui-draggable"=""><div id="haloword-title"><a herf="#" id="haloword-pron" title="发音"></a><audio id="haloword-audio"></audio><div id="haloword-control-container"><a herf="#" id="haloword-add" title="加入单词表"></a><a herf="#" id="haloword-remove" title="移出单词表"></a><a href="#" id="haloword-open" title="查看单词详细释义" target="_blank"></a><a herf="#" id="haloword-close" title="关闭查询窗"></a></div></div><div id="haloword-content"></div></div><div id="haloword-lookup" class="ui-widget-content"><div id="haloword-title"><span id="haloword-word"></span><a herf="#" id="haloword-pron" class="haloword-button" title="发音"></a><audio id="haloword-audio"></audio><div id="haloword-control-container"><a herf="#" id="haloword-add" class="haloword-button" title="加入单词表"></a><a herf="#" id="haloword-remove" class="haloword-button" title="移出单词表"></a><a href="#" id="haloword-open" class="haloword-button" title="查看单词详细释义" target="_blank"></a><a herf="#" id="haloword-close" class="haloword-button" title="关闭查询窗"></a></div></div><div id="haloword-content"></div></div> <div id="haloword-lookup" class="ui-widget-content"><div id="haloword-title"><span id="haloword-word"></span><a herf="#" id="haloword-pron" class="haloword-button" title="发音"></a><audio id="haloword-audio"></audio><div id="haloword-control-container"><a herf="#" id="haloword-add" class="haloword-button" title="加入单词表"></a><a herf="#" id="haloword-remove" class="haloword-button" title="移出单词表"></a><a href="#" id="haloword-open" class="haloword-button" title="查看单词详细释义" target="_blank"></a><a herf="#" id="haloword-close" class="haloword-button" title="关闭查询窗"></a></div></div><div id="haloword-content"></div></div><img src ="http://www.cppblog.com/huyutian/aggbug/209846.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huyutian/" target="_blank">胡雨田</a> 2015-02-22 12:28 <a href="http://www.cppblog.com/huyutian/archive/2015/02/22/209846.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于inline函数"unresolved external" 错误</title><link>http://www.cppblog.com/huyutian/archive/2014/12/28/209324.html</link><dc:creator>胡雨田</dc:creator><author>胡雨田</author><pubDate>Sun, 28 Dec 2014 08:04:00 GMT</pubDate><guid>http://www.cppblog.com/huyutian/archive/2014/12/28/209324.html</guid><wfw:comment>http://www.cppblog.com/huyutian/comments/209324.html</wfw:comment><comments>http://www.cppblog.com/huyutian/archive/2014/12/28/209324.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/huyutian/comments/commentRss/209324.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/huyutian/services/trackbacks/209324.html</trackback:ping><description><![CDATA[内联函数能够提高程序性能这是大家都知道的。但内联函数应该怎样申明和定义呢？今天我就遇到一个"unresolved external" 错误。google后找到答案。<br /><br /><div id="haloword-lookup"  ui-draggable"=""><div id="haloword-title"><a herf="#" id="haloword-pron" title="发音"></a><audio id="haloword-audio"></audio><div id="haloword-control-container"><a herf="#" id="haloword-add" title="加入单词表"></a><a herf="#" id="haloword-remove" title="移出单词表"></a><a href="#" id="haloword-open" title="查看单词详细释义" target="_blank"></a><a herf="#" id="haloword-close" title="关闭查询窗"></a></div></div><div id="haloword-content"></div></div><span style="font-size: 12px;">t's imperative that the function's definition (the part between the {...}) be placed in a header file, unless the function is used only in a single .cpp file. In particular, if you put the inline function's definition into a .cpp file and you call it from some other .cpp file, you'll get an "unresolved external" error from the linker.<br /></span><br />内联函数体必须定义在头文件中，除非你的程序只有单一cpp文件。如果你在一个cpp文件中定义内联函数体，而要从其他cpp文件访问该内联函数，你就会在link时遇到<span style="font-size: 12px;">"unresolved external" 错误。</span>原文链接看<a href="http://www.parashift.com/c++-faq-lite/inline-nonmember-fns.html">这里</a>。<br /><div id="haloword-lookup" class="ui-widget-content ui-draggable"><div id="haloword-title"><span id="haloword-word"></span><a herf="#" id="haloword-pron" class="haloword-button" title="发音"></a><audio id="haloword-audio"></audio><div id="haloword-control-container"><a herf="#" id="haloword-add" class="haloword-button" title="加入单词表"></a><a herf="#" id="haloword-remove" class="haloword-button" title="移出单词表"></a><a href="#" id="haloword-open" class="haloword-button" title="查看单词详细释义" target="_blank"></a><a herf="#" id="haloword-close" class="haloword-button" title="关闭查询窗"></a></div></div><div id="haloword-content"></div></div><img src ="http://www.cppblog.com/huyutian/aggbug/209324.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huyutian/" target="_blank">胡雨田</a> 2014-12-28 16:04 <a href="http://www.cppblog.com/huyutian/archive/2014/12/28/209324.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>office2010自定义安装问题</title><link>http://www.cppblog.com/huyutian/archive/2014/02/04/205630.html</link><dc:creator>胡雨田</dc:creator><author>胡雨田</author><pubDate>Tue, 04 Feb 2014 00:35:00 GMT</pubDate><guid>http://www.cppblog.com/huyutian/archive/2014/02/04/205630.html</guid><wfw:comment>http://www.cppblog.com/huyutian/comments/205630.html</wfw:comment><comments>http://www.cppblog.com/huyutian/archive/2014/02/04/205630.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/huyutian/comments/commentRss/205630.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/huyutian/services/trackbacks/205630.html</trackback:ping><description><![CDATA[<span style="font-size: 12px;">最近重新安装系统，选择自定义安装office，本意是想尽量精简掉一些用不上的内容，结果不小心给自己添麻烦了。<br />安装完后，用WORD打开文档时，总是提示：此文档有宏，该应用程序的宏语言支持功能被取消。功能要求的VBA不可用。如果关闭文档退出还会提示：</span><span style="font-size: 12px;">所做更改会影响共用模板NORMAL</span><span style="font-size: 12px;"></span><br /><div><span style="font-size: 12px;"><div>网上查找了一番， 解决办法有两个：<br />1.打开文档时，进入&#8220;开始&#8221;-&#8220;选项&#8221;-&#8220;加载项&#8221;-&#8220;管理COM加载项&#8221;，将三个可用加载项前的打勾去掉。</div><div>2.用office安装盘重新安装-&#8220;添加/删除功能&#8221;-&#8220;自定义安装&#8221;-&#8220;OFFICE 共享功能&#8221;下，安装&#8220;VBA数字工程证书&#8221;和&#8220;Visual　Basic　for　Applications&#8221;</div></span><span style="font-size: 12px;"><div>&nbsp;方法1临时用用可以，但解决不了问题。最后还是选修复安装搞定。</div></span></div><img src ="http://www.cppblog.com/huyutian/aggbug/205630.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huyutian/" target="_blank">胡雨田</a> 2014-02-04 08:35 <a href="http://www.cppblog.com/huyutian/archive/2014/02/04/205630.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>推荐一款轻巧好用的编辑软件MadEdit</title><link>http://www.cppblog.com/huyutian/archive/2013/10/08/203602.html</link><dc:creator>胡雨田</dc:creator><author>胡雨田</author><pubDate>Tue, 08 Oct 2013 12:30:00 GMT</pubDate><guid>http://www.cppblog.com/huyutian/archive/2013/10/08/203602.html</guid><wfw:comment>http://www.cppblog.com/huyutian/comments/203602.html</wfw:comment><comments>http://www.cppblog.com/huyutian/archive/2013/10/08/203602.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/huyutian/comments/commentRss/203602.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/huyutian/services/trackbacks/203602.html</trackback:ping><description><![CDATA[我自己使用已经有一阵子了，感觉非常不错。MadEdit是一款用<span style="color: #555555; font-family: sans-serif; font-size: 13px; line-height: 18px; background-color: #ffffff;">wxWidgets和c++写的</span>开源软件，可以跨平台工作。<br />主要特点：<br />1.免费、开源、小巧，精致，绿色便携<br />2.支持16进制编辑，这个用于分析一个未知文件的文件存储结构，非常方便。对程序调试、底层开发的人非常适合。以前大家都用ultraedit，但随着版本的升级，变得越来越庞大，已经不适合我这种偶尔玩玩编程的人了。<br />3.支持c/c++/java/html/python等数十种语言语法高亮度显示。那么如果你时不时的需要写写小程序，那么它就非常适合你。<br />4.支持正则表达式。最近突然觉得正则表达式在查找替换一些特使场合还是非常好用的，效率非常高。一般并不需要掌握复杂的正则表达式规则。<br />比如，我有一个大文件有很多处"01.","02.","03."之类文本的要删除，这时候[0-9][0-9]\.就能快速搞定。<br />5.自身支持设置添加到资源管理器右键菜单中去，windows系统用户的最爱。<br />6.中文/英文界面随意切换，支持gbk/unicode编码格式，还内置繁简转换功能。这这简直就是为中国人专用的编辑器么。完全可以把Notepad，Note++之类仍掉了。<br />用一句时髦话形容：低调奢华有内涵，你值得拥有。<br />唯一的缺点就是目前原作者很久没有更新程序了，但好消息是，有几个爱好者开源了另一个给madEdit打补丁的项目，可以去看看。<br />madEdit的原网址在这里<a href="http://sourceforge.net/projects/madedit/">http://sourceforge.net/projects/madedit/</a><br />这里是爱好者修改的打补丁版本，注意也是开源的哟。<a href="https://code.google.com/p/madedit-pv/">https://code.google.com/p/madedit-pv/<br /></a>从后一个网址下载时，MadEdit20130705.7z是单个主程序，不需安装可以直接运行。中文用户建议最好再下载一个中文化配置文件syntax_locale.7z，解压到同一个目录中即可。<img src ="http://www.cppblog.com/huyutian/aggbug/203602.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huyutian/" target="_blank">胡雨田</a> 2013-10-08 20:30 <a href="http://www.cppblog.com/huyutian/archive/2013/10/08/203602.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>解决visual studio 2010下warning LNK4099: PDB 'vc100.pdb' was not found问题</title><link>http://www.cppblog.com/huyutian/archive/2012/10/06/192930.html</link><dc:creator>胡雨田</dc:creator><author>胡雨田</author><pubDate>Sat, 06 Oct 2012 15:27:00 GMT</pubDate><guid>http://www.cppblog.com/huyutian/archive/2012/10/06/192930.html</guid><wfw:comment>http://www.cppblog.com/huyutian/comments/192930.html</wfw:comment><comments>http://www.cppblog.com/huyutian/archive/2012/10/06/192930.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/huyutian/comments/commentRss/192930.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/huyutian/services/trackbacks/192930.html</trackback:ping><description><![CDATA[以前用visual studio 2008时也碰到过类似问题，问题产生的原因就是由于一个Solution下单多个Project是分开编译的，主项目和子项目的pdb文件名相同(默认都是<span style="color: #333333; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.78333282470703px; text-align: justify; ">vc90.pdb或vc100.pdb</span>)从而造成冲突。这个问题对程序的执行不会产生影响，但会导致丢失部分调试信息。<br />在网上搜到<a href="http://cldoten.wordpress.com/2009/07/01/vs2008-fixing-the-warning-pdb-vc90-pdb-not-found/">解决办法</a>，修改pdb文件设置的路径和名称。转贴于此。<br /><p style="font-size: 1.05em; color: #333333; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; line-height: 16.78333282470703px; text-align: justify; "><strong>Project Configuration Properties -&gt; C/C++ -&gt; Output Files<br />Program Database File</strong></p><p style="font-size: 1.05em; color: #333333; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; line-height: 16.78333282470703px; text-align: justify; ">This name, e.g. $(IntDir)\vc90.pdb, is embedded into the object file and it should be the same as the one in</p><p style="font-size: 1.05em; color: #333333; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; line-height: 16.78333282470703px; text-align: justify; "><strong>Project Configuration Properties -&gt; Linker -&gt; Debugging<br />Generate Program Database File</strong></p><p style="font-size: 1.05em; color: #333333; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; line-height: 16.78333282470703px; text-align: justify; ">This is, e.g. $(TargetDir)$(TargetName).pdb</p><p style="font-size: 1.05em; color: #333333; font-family: 'Lucida Grande', Verdana, Arial, sans-serif; line-height: 16.78333282470703px; text-align: justify; ">Now the object file contain the path where the library is located, too.</p><br />由此引出一个话题，那就是对于分开编译的多个Project组成的一个复杂的Solution如何组织目录文档结构，既保持各个Project相对独立，同时又保证整个Solution调试信息的完整性。我的解决办法是：首先肯定要像上面一样修改各单独Project的pdb的路径和文件名。其次在复制Project编译结果到Solution的Lib时，要把所有的obj文件和pdb文件一起copy过来。要注意单独的Project编译的obj文件和pdb文件路径最好相同，而且使用相对路径"..\"和&#8220;.\"打头。文件复制工作可以写成一个批处理，放入主Solution的Pre-Build Event中去。<br /><img src="http://www.cppblog.com/images/cppblog_com/huyutian/QQ截图20121006232610.png" width="910" height="334" alt="" /><br /><img src ="http://www.cppblog.com/huyutian/aggbug/192930.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huyutian/" target="_blank">胡雨田</a> 2012-10-06 23:27 <a href="http://www.cppblog.com/huyutian/archive/2012/10/06/192930.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>注意TA-LIB与国内股票软件的技术指标计算方式的区别</title><link>http://www.cppblog.com/huyutian/archive/2012/04/08/170432.html</link><dc:creator>胡雨田</dc:creator><author>胡雨田</author><pubDate>Sun, 08 Apr 2012 03:31:00 GMT</pubDate><guid>http://www.cppblog.com/huyutian/archive/2012/04/08/170432.html</guid><wfw:comment>http://www.cppblog.com/huyutian/comments/170432.html</wfw:comment><comments>http://www.cppblog.com/huyutian/archive/2012/04/08/170432.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/huyutian/comments/commentRss/170432.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/huyutian/services/trackbacks/170432.html</trackback:ping><description><![CDATA[折腾了好久才发现开源库TA-LIB关于很多指标计算都与国内通用股软不太一样。刚开始还以为是自己的程序写错了，汗一个。<br />比如ATR的计算，国内一般是取TR（真实波幅）的简单平均。而TA-LIB则是采取类似EMA平均一样的方法求TR的平均值。<br />再如MACD(12,26,9)的计算，TA-LIB对于前33个初始值是未定义的，国内股软计算初始值时则是根据已有的几根bar计算的<br />平均值比照MACD公式进行换算的。自己利用TA-LIB库开发股软时一定要对比一下指标的计算异同，否则浪费时间就划不来了。 <img src ="http://www.cppblog.com/huyutian/aggbug/170432.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huyutian/" target="_blank">胡雨田</a> 2012-04-08 11:31 <a href="http://www.cppblog.com/huyutian/archive/2012/04/08/170432.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>