
C++
saintony
这个作者很懒,什么都没留下…
展开
-
Project Euler 46 solution optimized using C++ meta-programming
Continued with last post.. now I'm using C++ meta-programming to solve this problem - all computation moved to compile time.But there are limitations for G++ to compile template like recursion depth原创 2015-07-19 02:36:59 · 2222 阅读 · 0 评论 -
"C++ Coding Standards" -- the Guru of all the C++ developers
Its been a long time I havent read this book till now. It shocked me that it is totally different experience this time of reading. Two months ago when I was a little younger, I cannot feel anythin原创 2007-12-26 21:00:00 · 704 阅读 · 0 评论 -
Take care of the Details
Here "Details" especially refers to the points that we thought it is quite tiny to influence the big picture, and then you leave it to a "all right but not perfect" status. Its proved that this habit原创 2007-12-06 18:20:00 · 721 阅读 · 0 评论 -
Take care of fopen
For every C/C++ programmers, fopen may be one of the most familiar functions. Taking myself as instance, I used to use it quite freely, as its free lunch. But theres no free food ever -- the FILE* n原创 2007-11-30 00:01:00 · 784 阅读 · 0 评论 -
Where am I ?
I mean my technique skill level actually. First, Im an engineer, not a coder, and I think you have to be a good coder before you become an engineer. What mean? Whether you can keep the semantic you原创 2007-11-06 16:48:00 · 829 阅读 · 0 评论 -
There's always gap between Idealism & Realism
I thought the STL is good enough for solving kinds of issues. But I have to say NO to STL many times now. - STL has different implementations & different versions, which confuses the programmers a l原创 2007-10-15 11:16:00 · 772 阅读 · 0 评论 -
One perfect book for C++
"C++ Coding Standard" is really an excellent book. It doesnt tell you one special technogoly or some abstruse theory, while it has told you 101 basic principles for coding in C++, including coding s原创 2007-10-28 13:23:00 · 656 阅读 · 0 评论 -
Further & Further on my way
Our project is in a "mostly done but not finished" phase. I think this is the period in which we could check our design and coding quality adequatly. Testing & testing, and more & more features adde原创 2007-10-23 17:26:00 · 650 阅读 · 0 评论 -
[Effective STL] finished!
It takes me several weeks to finish reading this book. In fact, I read this book not in detail, just with a glance over. I need to read this book several more times after Ive made a good & systemati原创 2007-10-19 20:22:00 · 600 阅读 · 0 评论 -
Testing is Significant!
I hated testing. I thought it was trivial & unnecessary. After these days work, Ive totally pulled down my former opinion on testing. My tasks in these days are unit testing. It is surprised that原创 2007-10-18 21:07:00 · 720 阅读 · 0 评论 -
一点体会
纯粹的设计是语言独立的, 而语言只是支撑设计的工具(或者叫平台),不同的语言有不同的特性,所以不同语言所适合的应用领域是不同的(不同的领域会有不同的设计特点)。比如在人工智能里,最常用的是函数式语言LISP,再比如单继承的Java会较C++某些方面更欠缺些,因为一些设计模式完全是基于多继承的,具体可以参考MCD。其实若干时间前十年陈酿就跟我们讲过这个问题,但是今天才真正切身体会到。p.s. 今原创 2007-09-24 16:42:00 · 679 阅读 · 0 评论 -
Prototype alpha Done...
经过将近1周的连续奋战,prototype算是勉强跑起来了。要说coding的速度和质量我还是比较满意,team-lead也给我一个“good job” 的评价。但是今天集成的时候设计方面的问题逐个凸显出来,比如buffer的设计问题,对象的生命周期问题,还有最关键的IO模型的设计,都比较不尽如人意。而且今天才知道realloc的真正语义,汗~看来经验才是王道啊...原创 2007-06-19 22:09:00 · 1081 阅读 · 0 评论 -
Reading Annotated STL Sources -- 1
Ive just finished reading the first three chapters of "The Annotated STL Sources". I would say the code Ive read is the most brilliant, expressive & advanced code Ive ever seen. What Ive read is原创 2008-04-19 21:21:00 · 879 阅读 · 0 评论 -
What's OO?
Nowadays almost every programmer knows about the Object-Oriented Analysis/Design. But I think only a few among us know what OO really is actually.Why? Most treat OO as a kind of trash-packaging work原创 2008-05-07 22:33:00 · 672 阅读 · 0 评论 -
Calling Haskell from C - (DLL solution)
My main reference is : http://mostlycode.wordpress.com/2010/01/03/shared-haskell-so-library-with-ghc-6-10-4-and-cabal/Step 1: Write your Haskell code原创 2014-06-28 05:51:08 · 1196 阅读 · 0 评论 -
Boost Preprocessor is so cool
#include "boost/preprocessor/seq/size.hpp" #include "boost/preprocessor/seq/elem.hpp" #include "boost/preprocessor/seq/push_back.hpp" #include "boost/preprocessor/stringize.hpp" #include "boost/pr原创 2014-06-04 12:52:45 · 1882 阅读 · 0 评论 -
Stand-alone Profiler for VS2005
I’m using VS2005 Professional Edition that doesn’t include Performance Test Tool set. So I have to download & install the stand-alone Performance tool set. It requires a lot of manual work: (I am using Sampling mode instead of Tracing mode because I think原创 2010-07-16 01:52:00 · 1179 阅读 · 0 评论 -
‘volatile’matters
This is NOT NEW but it still worths being emphasized again…In my current render engine I have a bool variable that needs to be evaluated like this: while(bIsRunning); this piece of code controls the termination of one thread. In debug mode it原创 2010-07-13 22:26:00 · 655 阅读 · 0 评论 -
SSE instruction optimization challenges in C/C++
Many suggest that the core of Ray-tracing should be implemented using SSE/SSE2, and several SIMD-based Ray-tracer has even been published. People say the performance has been enhanced amazingly… Very attracting isn’t it… But SSE/SSE2 has an critical const原创 2010-07-16 13:13:00 · 892 阅读 · 0 评论 -
Annotated STL Done
I bought this book a year ago, and finally Ive finished this book.This book is different than most of the didactic language books, I think it could be called a "STL analysis guidance", so you canno原创 2009-04-10 10:01:00 · 583 阅读 · 0 评论 -
Make your responsibilities clear
Determining the ownership of different responsibilities is really important because it would make your design totally different. Involving clients responsibilities may add unnecessary massive load on原创 2009-02-24 12:47:00 · 559 阅读 · 0 评论 -
The song to Bjarne from Herb Sutter
It is really a funny song to Bjarne by Herb Sutter, and the lyric is the very point.Heres the video : http://www.youtube.com/watch?v=xF0-LGoXtawI recorded most of the lyric:Ive tried Pascal, time af原创 2008-11-21 14:55:00 · 571 阅读 · 0 评论 -
Don't overskill
Deviation from the requirements may be the first issue that all rookie software engineers need to solve. Actually theres another issue due to the same reason that may need to be cared - overskilling.原创 2009-01-13 17:08:00 · 706 阅读 · 0 评论 -
Two points - STL, and multi-threading
* About STL : never trust its performance too muchSTL is a standard now. You cannot avoid it ever. People trust it a lot, but keep it in mind: STL is not as good as you think of it. First, you have原创 2008-06-17 18:00:00 · 613 阅读 · 0 评论 -
No Pain, No Upgrade
Weve all read a lot of books of "rules" (C++ Coding Standard, etc.). It tells you how much pain youll suffer if you dont conform with the rules. But, how many rules have you remembered finally just原创 2008-07-16 10:32:00 · 649 阅读 · 0 评论 -
终于把C++ Templates看完了~!
4月份的时候就从pangwa那里借来了英文版的书,此书恐怕是到现在看得最痛苦的一本,比大一那会儿通读的《Thinking in Java》E版还难受。尤其是第一篇讲Template技术细节的时候巨细靡遗,头昏脑胀,因此中间还中止了1个多月没看。不过第二篇讲高级应用的时候感觉还好。总的来说这本书绝对是必看的,尤其是最后几章,是MCD的前导知识,很有必要学好。感觉C++的模板技术是另一番天地,运行原创 2007-09-15 19:21:00 · 1817 阅读 · 0 评论 -
疯狂Coding
从早晨9点coding到晚上10点半,遇到了很多细节问题,多谢pangwa的指点,使得我的进度提前不少~ 原定明天要能够build通过,结果今天下午不到4点就提前ok了,之后又改进了一些设计,添加了对应的实现代码。还剩下最关键的IO代码没有写,明天搞~p.s.今天学到了很多原创 2007-06-14 23:25:00 · 1110 阅读 · 0 评论 -
差点冤枉了boost iostream
今天发现了两个细节上的错误和疏漏1 性能测试只能在release下,debug绝对不准,有时候可以差若干个数量级2 boost iostream里面必须指定buffer大小,否则比蜗牛还慢。实践证明boost-iostream可以达到std::iostream的性能,最起码在大多数情况下是接近的。原创 2007-07-30 21:30:00 · 1980 阅读 · 0 评论 -
深度探索C++对象模型前三章 读后感
这书写的不错,就是很多内容似乎只有做编译器的人看着才有意义。比如第三章极其详细的分析了vptr vtbl vbptr ,各个不同厂商编译器的不同实现,以及各自实现的性能对比等等。我感觉:除非我要写C++编译器(前两天刚说的,得看自己的安排),不然知道那么多virtual实现的细节真的没有太大的意义。所以我们老大说真正掌握More Effective和Effective就够了,俺们的重点在设计.原创 2007-04-29 15:20:00 · 1154 阅读 · 0 评论 -
翻完了《深度探索C++对象模型》
今天翻完了最后一章。到现在大概3个多月的时间,勉强的粗粗翻完了这本书。 此书不错,还是挺搔痒的。我个人认为如果要对C++有深入的认识这本书是必看的。看这本书的时候因为工作忙,断断续续的,看一点忘一点。好书只看一遍是不够的,要想真正理解一本书真得反复多次看原创 2007-07-29 20:35:00 · 864 阅读 · 0 评论 -
几个最近在看的软件测试工具
1. UnitTest in VS2005感觉天底下的UnitTest工具都差不多,不过MS做得真的不错,基本达到了Seamless的标准,用起来非常方便,让我想起了Eclipse中的JUnit,这个集成的也不错。有一点要注意的是F5-debug情况下不能做code coverage。2. Performance tool in VS2005同样的Seamless,用起来很方便,不过总原创 2007-07-23 19:48:00 · 1154 阅读 · 0 评论 -
勉强读完了《Inside C++ Object Model》第六章
刚刚憋了半天很勉强的“读”完了 《Inside》的第六章,其实应该说是浏览。这章讲了C++运行时的语义以及底层实现,包括Constructor、Destructor、TemporaryObj、new和delete。还是那个感觉:如果不是自己要写C++编译器,这些东西很少会被用到。p.s.发现自己英语阅读能力还是不行,长点的句子就能把我搞晕....... : (原创 2007-07-24 01:07:00 · 966 阅读 · 1 评论 -
《C++ Template》读中感
只有两个感觉:1 看的是英文版,头昏脑胀,经常是单词都看懂了但是连不起来,或者是词都连起来了但是理解不了人家到底要说啥2 这本书讲的太细,有点像Primer,就是个字典,有些现象在工程里是看不到的。当然还是要看一下,对理解有好处原创 2007-04-21 15:22:00 · 706 阅读 · 0 评论 -
ASM & C & C++
记得原来跟Terence讨论ASM和C的时候得出一个结论:ASM和C无二无别 。因此如果一个C程序员什么时候觉得自己写的C代码和汇编(or 对应的体系结构)没有区别的时候,就说明该C程序员“精通”了C语言;这两天读《Inside the C++ Object Model》的最新体会就是:如果一个C++程序员什么时候真正在开发中体会到C++的C-Implemented的本质,那么可以说该C++程序员原创 2007-04-18 15:15:00 · 979 阅读 · 0 评论 -
Unmanaged Code's Code Coverage Analyze
VSTS自带的UnitTest目前测试Unmanaged-Code还有些困难,因为在CLR中运行的托管代码有Reflection支持。所以对于native的raw code必须经过特殊的处理才行。幸运的是VS自带了工具进行这类处理:vsinstr和vsperfmon。对于单一的Exe处理很简单,但是对于需要调用其他dll的复杂app来说就要稍微麻烦一点,要求exe引用的dll用/profile原创 2007-07-24 22:10:00 · 1143 阅读 · 1 评论 -
完成端口的简单理解
完成端口(I/O Completion Port)据说是目前最复杂的IO模型,看了整整一天才看出个名堂来,趁现在赶快记下来,不然过两天又要忘了。完成端口是Windows平台的异步I/O处理技术,可以极大的提升高频度IO处理的性能,尤其是在连接量较大的Web-Server中应用尤其广泛。传统的Socket处理都是利用多线程来处理,但是当请求数量过多导致线程数量也较大的时候,就会降低系统的性能-原创 2007-04-20 12:13:00 · 1187 阅读 · 0 评论 -
终于看到了风格优良的C++代码
前天终于拿到了DWF-Toolkit的源代码,也许是我孤陋寡闻,第一次看到如此的代码竟然激动的快不行了 -- 从来没见过如此清晰的注释,而且代码结构极其工整而且极富逻辑性,值得好好学学!原创 2007-04-16 15:36:00 · 1728 阅读 · 2 评论 -
Part 1 of 《C++ Template》finished
Just finished the Part 1 of the book "C++ template" .Part 1 is just a general introduction of the Template. Nothing special. But therere still lots of things to learn, Traits & Metaprogramming , etc.原创 2007-04-10 18:00:00 · 806 阅读 · 0 评论 -
有点入门
随着工作和学习的进行,理论和实际已经有一点能接上了,明白了设计和实现之间的微妙关系,也明白了语言和设计的互作用。不过仍然有n多书要读,n多优秀源代码要看,n多代码要写...路无止境啊p.s.说点无关的,我的确认为优快云的Blog很失败,不管功能多强,也不管你多先进,首先blog服务高频率的crash就可以证明csdn-blog这个东东不成功,别说web2.0,就是web250.0也不行。原创 2007-08-07 00:10:00 · 781 阅读 · 0 评论 -
Chapter 13 of "C++ Templates" Done
时隔n久再拿起这本书,一鼓作气把13章看完了,讲了很多模板里面比较尖端前沿的技术(虽然很多都只是给C++标准委员会的建议) 。到目前为止Template的语法部分就都过完了,接下来就到了和设计相关的部分,相对要有趣一些。p.s. 看书是为了学东西,不能为了看书而看书原创 2007-08-08 02:02:00 · 762 阅读 · 0 评论