【每日进步】September 2012

>>>>>>>>>>>>>>>>>>>>>>> Sep 11 2012 <<<<<<<<<<<<<<<<<<<<<<<<<

1. 有关随机出现的内存错误:多线程、多C库交叉调用、堆溢出/越界

2. Is it legal (and moral) for a member function to say delete this?

Here's how I define "careful":

  1. You must be absolutely 100% positively sure that this object was allocated via new (not by new[], nor by placement new, nor a local object on the stack, nor a global, nor a member of another object; but by plain ordinary new).
  2. You must be absolutely 100% positively sure that your member function will be the last member function invoked on this object.
  3. You must be absolutely 100% positively sure that the rest of your member function (after the delete this line) doesn't touch any piece of this object (including calling any other member functions or touching any data members).
  4. You must be absolutely 100% positively sure that no one even touches the this pointer itself after the delete this line. In other words, you must not examine it, compare it with another pointer, compare it with NULL, print it, cast it, do anything with it.

>>>>>>>>>>>>>>>>>>>>>>> Sep 11 2012 <<<<<<<<<<<<<<<<<<<<<<<<<

1. windows 中可以使用nul实现/dev/null的效果,nul是windows保留的设备名称,不可作为文件名,打开该文件语义为打开该设备文件

>>>>>>>>>>>>>>>>>>>>>>> Sep 28 2012 <<<<<<<<<<<<<<<<<<<<<<<<<

1. 编辑距离:让两个字符串相等所需要的最小步数

>>>>>>>>>>>>>>>>>>>>>>> Sep 29 2012 <<<<<<<<<<<<<<<<<<<<<<<<<

1. 让vs抛出浮点数除0异常方法:

#include <float.h>

int cw = _controlfp(0,0);
cw &= ~(EM_OVERFLOW | EM_UNDERFLOW | EM_INEXACT | EM_ZERODIVIDE | EM_DENORMAL | EM_INVALID);
_controlfp(cw,MCW_EM);

  

 >>>>>>>>>>>>>>>>>>>>>>> Sep 30 2012 <<<<<<<<<<<<<<<<<<<<<<<<<

 1. 什么是纵向扩展、横向扩展。扩展现有系统的两种策略,举个例子,现有的机器处理不了我目前的问题(不够快,存储不够)

     >> 纵向扩展/Scale up/ Scale Vertically: 扩展现有机器,更多的CPU、内存

     >> 横向扩展/Scale out/Scale Horizonally: 添加新的机器

参考:http://en.wikipedia.org/wiki/Scalability

posted @ 2012-09-11 16:22  D3猎人  阅读(140)  评论(0编辑  收藏  举报