【每日进步】July 2012

------------------------------------------Tue July 3 2012-------------------------------------------------

1. vs中float结果有时会为-1.#IND000,表示非法的浮点数,一般是由除0错误导致

------------------------------------------Sta July 14 2012------------------------------------------------

1. LoadLibrary可以使用绝对路径

2. LoadLibrary加载的DLL如果其依赖项找不到,会报“。。。重新安装或许会解决问题。。。”错误,错误码忘记了,可以使用Dependency Walker 找到缺少的DLL,之后放到对于位置即可

------------------------------------------Wen July 18 2012------------------------------------------------

1. SendDlgItemMessage, 封装了GetDlgItem 与SendMessage,效果和SendMessage一样,阻塞调用

RenderMan:

1. Attribute "trace" "bias" [.01]this bias value affects transmission/shadow rays as well as trace/environment rays. It is an offset applied to the ray origin, moving it slightly away from the surface launch point in the ray direction. This offset can prevent blotchy artifacts resulting from the ray immediately finding an intersection with the surface it just left. 不能设置的太小,否则会产生噪点,一般默认值就OK

2. Displacement Shader做displacement时需要保证物体表面法向与是朝向视线的,否则渲染时会出现一些空洞(无法使用displacementBound来矫正)

  在shader中,使用N前应使用faceForward来矫正法向。(Orientation可以显示调整法向方向)

------------------------------------------Thu July 19 2012------------------------------------------------

1. 查看obj中的符号,dumpbin -symbols,表示是个符号都输出出来了,没有nm方便

2. Bison生成parser时会自动加入#include "XXX.lex.cpp"引入yylex函数,本以为是需要单独编译呢,费好大劲才找到。这就表示,使用flex生成原文件时要注意文件名(如果不想改文件内容的话)

------------------------------------------Fir July 20 2012------------------------------------------------

1. m4 is a general purpose macro processor designed by Brian Kernighan and Dennis Ritchie. m4 is an extension of an earlier macro processor m3, written by Ritchie for the AP-3 minicomputer. 

While similar in principle to the better-known C preprocessor, it is a far more powerful, general-purpose tool. Some significant uses are:

  • sendmail: sendmail's rather cryptic configuration file (/etc/mail/sendmail.cf) is generated using m4 from a template file that is much easier to read and edit (/etc/mail/sendmail.mc).
  • GNU Autoconf: m4 macros are used to produce “configure” scripts which make source code packages portable across different Unix-like platforms.
  • Security Enhanced Linux: SELinux policy files are (at time of writing) processed using m4. (In fact, m4 is the source of some difficulties here because its flexibility allows abuses and makes automated policy analysis difficult to apply.)

  表示这个工具相当强大的说,可以用来做C预处理等等。。。

2. pp - ANSI C preprocessor。表示这个工具很不好找的说,google搜索好久才找到,很老的一个工具,不知道现在是不是被新工具给替换了。下载位置:http://homepage.ntlworld.com/itimpi/pp_make.htm 源文件是p1-p8的C文件。

3. 其他的C/C++ preprocessor有mcpp、fcpp

4. unifdef/sunifdef:Commandline tools for eliminating superfluous preprocessor clutter from C and C++ source files.有时候代码为提交可移植性,有很多ifdef代码,可以使用该工具简化代码,但不像preprocessor,它只处理#ifdef类的。

5. vc中可以使用#pragma message在预处理时输出消息

6. 在使用extern "C" __declspec(dllimport)的函数时, 寻找的符号都带前缀__imp_(obj中的函数带__imp_前缀),表明是使用dll中的符号,但是在生成dll同时生成的lib文件中,使用dumpbin -exports时得到的符号是没有__imp_的

------------------------------------------Thu July 26 2012------------------------------------------------

1. C++子类虽不一定需要重载父类的非纯虚函数,但是在实例化子类对象时,该非纯虚函数必须要有一个实现(继承父类的,或者子类来实现一个),否则会出现错误。

原文地址:https://www.cnblogs.com/D3Hunter/p/2574993.html