<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>whinah的专栏</title><link>http://blog.csdn.net/whinah/</link><description /><dc:language>zh-CN</dc:language><lastUpdateTime>Sun, 27 Jul 2008 00:45:00 GMT</lastUpdateTime><ttl>60</ttl><item><dc:creator>whinah</dc:creator><title>WinApi 参数的层次</title><link>http://blog.csdn.net/whinah/archive/2008/06/03/2508315.aspx</link><pubDate>Tue, 03 Jun 2008 17:36:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2008/06/03/2508315.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/2508315.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2008/06/03/2508315.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/2508315.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2508315</trackback:ping><description>我以前一直对WinApi参数太多，使用困难颇有微词，但是仔细想想，直接使用Api编程的情况是非常少的。Api难用点，功能强点，好过好用但功能弱。同时，仔细分析下Api的参数，能发现，它其实是很有设计原则的，我只归纳出以下：尽量使用单层参数，也是说，参数是简单数据类型，没有内嵌结构；尽量避免使用多层参数，也就是说，不得不使用结构传递参数的时候，结构里面尽量避免再内嵌其它结构。因此可以看到，一个参数很多的Api中，往往有好几个参数共同表达一个逻辑实体，而在面相对象中，这应该用一个对象来表达。&lt;img src ="http://blog.csdn.net/whinah/aggbug/2508315.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>泛型就意味着代码膨胀？</title><link>http://blog.csdn.net/whinah/archive/2008/05/09/2423877.aspx</link><pubDate>Fri, 09 May 2008 17:06:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2008/05/09/2423877.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/2423877.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2008/05/09/2423877.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/2423877.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2423877</trackback:ping><description>&amp;amp;lt;p&amp;amp;gt;我所了解的泛型实现，也就C++和Java，C++靠的是用代码膨胀来满足性能，Java泛型则只是一个Sugar。&amp;amp;lt;/p&amp;amp;gt;&amp;amp;lt;p&amp;amp;gt;现在使用C++泛型的人越来越多，生成的程序体积也越来越大。一个对10种数据和10种算子使用了泛型算法的程序，代码膨胀的最大可以达到100倍。但实际上，生成的代码“很模板”。现在的C++还没有C++0x 的 closure/auto 等功能，代码膨胀已经达到了很恐怖的程度。——比如使用了 Boost.asio 的程序尺寸就很恐怖。现在，代码膨胀虽然已经是一个很引起大家注意的问题，但是还没有让大家足够注意。可以预见，等到C++0x出世，泛型的语法更加优美，使用更加方便，大家的积极性更高，到那时，代码膨胀可能会成为一个非常残酷的现实问题。&amp;amp;lt;/p&amp;amp;gt;&amp;amp;lt;p&amp;amp;gt;应该有一些途径减少代码膨胀，现代的虚拟机（例如Java虚拟机和.Net虚拟机）可以通过动态优化来提高程序性能，先在运行时解释执行ByteCode，当发现某段ByteCode的执行&lt;img src ="http://blog.csdn.net/whinah/aggbug/2423877.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>多线程的 pipeline 设计模式</title><link>http://blog.csdn.net/whinah/archive/2008/04/22/2315528.aspx</link><pubDate>Tue, 22 Apr 2008 16:49:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2008/04/22/2315528.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/2315528.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2008/04/22/2315528.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/2315528.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2315528</trackback:ping><description>有很多个html网页，网页的id、title、url、path等信息存在一个数据库表中，网页内容存储在一个磁盘阵列上。现在要把所有网页都读出来，统计其中的html标签、正文等信息，并写入另一个数据库表，怎样的设计最好呢？一般的想法是使用多个平行的线程，每个线程处理某个ID范围的网页。但是仔细分析就可以发现，对每个网页的处理可以分为以下处理步骤：读取数据库行读取文件内容解析html，生成统计数据将统计结果写入数据库这几个处理步骤有各自的特征，读取数据库的时间一般主要消耗在数据库服务器响应，读取文件内容一般主要消耗在磁盘IO上，解析、统计消耗在计算上，写统计结果也消耗在数据库服务器响应上。如果我们为这几个过程建立各自的线程，每个任务通过消息队列来传递。&lt;img src ="http://blog.csdn.net/whinah/aggbug/2315528.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>C++ 的缺点</title><link>http://blog.csdn.net/whinah/archive/2008/04/22/2315356.aspx</link><pubDate>Tue, 22 Apr 2008 16:12:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2008/04/22/2315356.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/2315356.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2008/04/22/2315356.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/2315356.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2315356</trackback:ping><description>C++ 现在最时髦的用法是 template meta programming。booster 们对此非常津津乐道，我本人也是个狂热的booster。到了什么程度？不使用template 就浑身不舒服，不boost一下就感觉对不起C++。但是这种狂热带来的严重后果就是程序编译速度极慢无比，生成的执行程序尺寸超常。曾经一个 C++ 服务器程序，代码也就10000行左右，编译出来的执行程序竟然20M！编译时间半小时！写的时候感觉不到用了多少template，但是写出来竟然得到这样的结果，不得不让人吃惊！&lt;img src ="http://blog.csdn.net/whinah/aggbug/2315356.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>通用的 LoserTree</title><link>http://blog.csdn.net/whinah/archive/2008/04/22/2315078.aspx</link><pubDate>Tue, 22 Apr 2008 15:14:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2008/04/22/2315078.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/2315078.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2008/04/22/2315078.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/2315078.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2315078</trackback:ping><description> - 共有 n 个内部结点，n 个外部结点 - winner 只用于初始化时计算败者树，算完后即丢弃 - winner/loser 的第 0 个单元都不是内部结点，不属于树中的一员 - winner 的第 0 个单元未用 - m_tree 的第 0 个单元用于保存最终的赢者, 其它单元保存败者 - 该初始化需要的 n-1 次比较，总的时间复杂度是 O(n) - 严蔚敏&amp;amp;吴伟民 的 LoserTree 初始化复杂度是 O(n*log(n))，并且还需要一个 min_key,   但是他们的初始化不需要额外的 winner 数组 - 并且，这个实现比 严蔚敏&amp;amp;吴伟民 的 LoserTree 初始化更强壮 &lt;img src ="http://blog.csdn.net/whinah/aggbug/2315078.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>一个很强大的Comparator生成器</title><link>http://blog.csdn.net/whinah/archive/2008/04/22/2315040.aspx</link><pubDate>Tue, 22 Apr 2008 15:02:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2008/04/22/2315040.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/2315040.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2008/04/22/2315040.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/2315040.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2315040</trackback:ping><description>一个宏定义生成一个比较器(Comparator)，兼键提取(KeyExtractor)类&lt;img src ="http://blog.csdn.net/whinah/aggbug/2315040.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>Comparator 将 M×N 转化成 M+N</title><link>http://blog.csdn.net/whinah/archive/2008/04/22/2314996.aspx</link><pubDate>Tue, 22 Apr 2008 14:54:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2008/04/22/2314996.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/2314996.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2008/04/22/2314996.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/2314996.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2314996</trackback:ping><description>用C++写程序经常需要写一些很小的functor，最常见的例子就是 compare functor，排序的，查找的，自己每定义一个数据结构，就要定义一个 compare functor，甚至多个（对不同字段）。甚至，针对指针的，智能指针的……的compare，这件工作很繁琐，很容易使人厌倦。举个例子，同一个数据结构有M个字段，这些字段有P种类型，还有有N种不同的访问方式（直接提取、通过指针、通过智能指针、甚至通过反序列化等等），要实现所有这些情况的查找/排序，就需要 M×N 个 compare functor 的定义！从 boost::multi_index 中学到一点，将 KeyExtractor 和 Comparator 分离，这样，只需要写 P 个Comparator，M+N个KeyExtractor，一般情况下，甚至不需要写Comparator，因为字段类型大多是内建类型，Comparator是默认的。&lt;img src ="http://blog.csdn.net/whinah/aggbug/2314996.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>C++ 中 Bool functor 的优化</title><link>http://blog.csdn.net/whinah/archive/2008/04/22/2314682.aspx</link><pubDate>Tue, 22 Apr 2008 13:53:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2008/04/22/2314682.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/2314682.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2008/04/22/2314682.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/2314682.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2314682</trackback:ping><description>原以为足够现代的编译器的优化能力很强，看来我是高估了。GCC 没测过，VC 2008 刚刚被证实了。

&lt;img src ="http://blog.csdn.net/whinah/aggbug/2314682.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>住院归来</title><link>http://blog.csdn.net/whinah/archive/2008/02/23/2115223.aspx</link><pubDate>Sat, 23 Feb 2008 15:27:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2008/02/23/2115223.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/2115223.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2008/02/23/2115223.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/2115223.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2115223</trackback:ping><description>经常坐着的同行请注意了，千万不能一下子坐得太久，我这病跟老坐着关系很大。

这病叫做“肛周脓肿”，屁股上，很深的地方，出了脓肿，脓没地方排放，于是就肿大，刚开始很疼，我还以为是那次屁股撞了墙把股骨头撞坏了……，总之，费了很大周折，去医院做了手术，住了20多天的院。

肛门边上被开了一个口子，很疼，很麻烦，……

据医院的保守劝告，3~6个月不可久坐、久行、久立，不可骑自行车……
&lt;img src ="http://blog.csdn.net/whinah/aggbug/2115223.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>数据库集合查询的优化</title><link>http://blog.csdn.net/whinah/archive/2008/01/12/2040087.aspx</link><pubDate>Sat, 12 Jan 2008 22:21:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2008/01/12/2040087.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/2040087.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2008/01/12/2040087.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/2040087.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2040087</trackback:ping><description>有一个应用，需要经常做类似这样的查询 select * from SomeTable where key in (KeySet) ，其中 KeySet 可能很大，比如包含几百甚至几千个元素。理想中的情况，数据库应该先在 BTree 中查找到 KeySet 中的 Key 所在的物理页面地址，然后再对这物理地址排序，最后按顺序读入这些页面内容并填充结果。&lt;img src ="http://blog.csdn.net/whinah/aggbug/2040087.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>munmap 注意事项</title><link>http://blog.csdn.net/whinah/archive/2007/12/07/1922991.aspx</link><pubDate>Fri, 07 Dec 2007 16:51:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2007/12/07/1922991.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/1922991.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2007/12/07/1922991.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/1922991.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1922991</trackback:ping><description>posix linux unix munmap&lt;img src ="http://blog.csdn.net/whinah/aggbug/1922991.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>腾讯 QQ 真的不是一般的烂!</title><link>http://blog.csdn.net/whinah/archive/2007/08/19/1750535.aspx</link><pubDate>Sun, 19 Aug 2007 16:23:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2007/08/19/1750535.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/1750535.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2007/08/19/1750535.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/1750535.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1750535</trackback:ping><description>qq 目录下有几个微软的动态库(见图)：
如果删掉，按照常规，会加载系统最新的库，但是，当我把这几个文件中的任意一个删除的时候，qq 都无法正常运行。

&lt;img src ="http://blog.csdn.net/whinah/aggbug/1750535.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>gcc 一个恶心的 bug</title><link>http://blog.csdn.net/whinah/archive/2007/04/05/1553316.aspx</link><pubDate>Thu, 05 Apr 2007 18:57:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2007/04/05/1553316.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/1553316.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2007/04/05/1553316.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/1553316.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1553316</trackback:ping><description>竟然把 main.cpp 代码编译到了其它 .o 中！&lt;img src ="http://blog.csdn.net/whinah/aggbug/1553316.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>千万注意，不要 hack std::string</title><link>http://blog.csdn.net/whinah/archive/2007/02/25/1513988.aspx</link><pubDate>Sun, 25 Feb 2007 14:49:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2007/02/25/1513988.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/1513988.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2007/02/25/1513988.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/1513988.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1513988</trackback:ping><description>前段时间被一个bug折磨了两个星期，最后发现竟然是如此一个陷阱——我为了减少内存用量并且减少一次内存拷贝，直接通过string.data()修改了string的内部表示。这与其说是一个陷阱，不如说是我自己给自己造了一个陷阱然后把自己给掉进去了。&lt;img src ="http://blog.csdn.net/whinah/aggbug/1513988.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>whinah</dc:creator><title>前缀压缩词典</title><link>http://blog.csdn.net/whinah/archive/2007/02/09/1506685.aspx</link><pubDate>Fri, 09 Feb 2007 22:34:00 GMT</pubDate><guid>http://blog.csdn.net/whinah/archive/2007/02/09/1506685.aspx</guid><wfw:comment>http://blog.csdn.net/whinah/comments/1506685.aspx</wfw:comment><comments>http://blog.csdn.net/whinah/archive/2007/02/09/1506685.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/whinah/comments/commentRss/1506685.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=1506685</trackback:ping><description>包含多个固定索引，一个可变索引，

固定索引使用一个内存池和一个数组保存项目在内存中的偏移，并且使用前缀压缩，使用空间最小（每个词条4个字节的索引空间）   

可变索引不压缩，并且可以动态插入词条，占用空间较大（每个词条20个字节的索引空间）

存储 1000 万个词，占用内存 100M 左右，平均每个词10个字节（包括了字符串空间和索引空间）。

&lt;img src ="http://blog.csdn.net/whinah/aggbug/1506685.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>