Profilo di TonyThinking The WayFotoBlogElenchi Strumenti Guida

Blog


23/10/2009

数据库经典推荐

image

Database System Concepts
Fifth Edition

Avi Silberschatz
Henry F. Korth
S. Sudarshan

作者还提供了PPT供下载, Henry的弟子之一Laura Haas, 现在是IBM Almaden Research Center 研究中心的Director,同时也是IBM Fellow (今年晋升的,主页还没更新)

http://codex.cs.yale.edu/avi/db-book/db5/slide-dir/index.html

07/02/2009

One Billion Customers

image

作者James McGrego 日报母公司道琼斯公司在中国的首席业务代表

阅读全书  十亿消费者

全球贸易、外国投资和中国经济的商业化促使法律主体扩大,法律体系不断得到完善。但是核心理念依然是“以法制国”(rule by law),而非“依法治国”(rule of law)。被蒙上双眼的正义女神并不是中国文化的一部分。在中国,法律就是为了统治者的利益而对社会进行统治的一套枷锁。在过去20多年制定法律、建立法院体系的过程中,中国采纳了日本和德国的民法理念,而不是英国和美国所采用的普通法理念。因此,法官并不是公正的仲裁人,而是审判官。反过来说,法官本人也受到一个名为“政法委”的组织监督,这个党组织从北京的中央政法委书记一直延声到最基层的法院。中国的正义最终只是政治决策。

本书是想向诸位展示 ——而非阐述——在中国经商是怎么一回事。这里没有简单的公式或魔法咒语。只有通过展示那些异常复杂的细节:交易如何达成或破裂;人们如何看待、对待彼此;政治和偏见如何影响预期和结果,我才能够让你了解那些微妙之处,而正是这些微妙之处才使得中国给外国老板们既带来挫折也带来回报。每一章的开始都有简单的人物和背景介绍。接下来在总体概要部分,我将人物和背景放置到适当的场景中。然后整个故事通过平铺直叙展开。最后一部分标题为“这对你意味着什么”,我将解释这一章中发生的事情将如何影响你在中国的经商之路。最后,我希望通过简洁的语言,模仿毛泽东红宝书的形式来总结我自己的一些心得。

30/03/2008

Oracle 学习资料收集

最近做项目正好用到oracle,之前基本了解很少,正在苦读中。收集了一些好的站点和书籍推荐与此。

<–more–>

China Oracle User Group - 国内论坛,资料详尽。


http://asktom.oracle.com/ - 最具价值的Oracle技术资源基地。

推荐本盖国强写的《深入浅出Oracle》 , 看了半本了,写的非常好,适合初学者。


16/02/2008

病由心生不错

今天来说说病由心生这本书。 现代社会大部分人有心理疾病,压力的与日俱增让各种各样的病症,脖子疼,肩膀疼,严重的还有胃部痉挛什么的。辛德勒医生用实际遇到的病例,实际阐述了情绪对人身体功能的影响。文中话语朴实,俨然一个朋友在旁边讲故事,聊天一般,谈论了如何保持乐观,积极的生活态度。如何认识所谓成熟,如何处理家庭关系等等。

值得一读。

29/11/2007

《黑天鹅理论》作者自评

“一半的时间我很肤浅;另一半的时间我想避免肤浅。我在美感上是肤浅的。在我看来,诗歌高过散文、希腊高过罗马、尊严要先于典雅、典雅先于文化、文化先于博学、博学先于知识、知识先于才智、才智先于事实。”

13/11/2007

识字

是夸大其词还是夸大其辞?
是惟一还是唯一?
是凝练还是凝炼?
即来之,则安之 还是 既来之,则安之?
哈密瓜还是哈蜜瓜?
签订还是签定?
是扯淡还是扯蛋?
作出和做出有什么区别?
的地得有什么区别 ?

27/05/2007

你 媚雅 了么?

王小波 10年, 精品选中有个《有关“媚雅”》 的文章。挺有意思,心得改日补上。现在要看球了。:-)
 
30/12/2006

'You've got to find what you love,' Jobs says

Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma — which is living with the results of other people's thinking. Don't let the noise of others' opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.
 
This is the text of the Commencement address by Steve Jobs, CEO of Apple Computer and of Pixar Animation Studios, delivered on June 12, 2005.
 
Worth a read:
 
 
10/07/2006

Share

昨天看书,偶然看到一段小话,觉的不错。贴出来分享一下:
......
欣赏你的人可以使你充满自信
批评你的人可以使你愈挫俞勇
伤害你的人可以使你更加坚强
疼惜你的人可以使你知道感恩
依赖你的人可以让你拥有能力
依靠的对象可以让你歇歇脚
.......
 
认真的,平静的,坦诚的面对爱你&你爱的人吧。
27/01/2006

TICPP-VOL2-读书笔记-防御性编程

生存理由:
1.提高代码的生存质量
2.XP(极限编程原则):边测试,边开发.
本章主要介绍了assert断言调试技术&TestSuite Framwork以及内存泄漏的宏调试方法.算是介绍了一些测试技术的基本思想&方法.概念不多.需要多读例子代码体会.
作者的TestSuite Framwork写的清晰易懂.在随后章节中大量应用.
一.断言
原则1.使用assert(case)对其中case的正确性进行判断.
二.简单单元测试框架
原则2.测试程序+编码 > 直接编码
原则3.阅读TestSuite的代码
三.调试技术
原则4.用于跟踪代码的宏
#define Trace(ARG) cout<<#ARG<<endl; ARG
#define D(A) cout<<#a<<"=["<<A<<"]"<<endl;
原则5.内存泄漏
1.数组边界监察
2.基类的非虚析构函数
3跟踪new/delete,malloc/free语句
文中介绍了一种重载new/delete,并且使用数组存储内存分配信息的方法.
 
本章的学习关键在于实践中体会XP编程思想.
25/01/2006

TICPP-VOL2-读书笔记-异常处理

生存理由:
1.异常处理远离异常发生地
2.针对对象的释放资源的管理
try
{
// ur code
throw ;//exception style
}
catch(type n)
{
  //handle exceptions of type
}
异常处理模型:中止&恢复模型.
一.异常匹配
原则1.对象或者指向派生类对象的引用都会与其基类处理器匹配.
原则2.捕获所有异常
         catch(...)
         {
         }
原则3.重新抛出异常,应用于调用链高层次异常处理.呵呵,就是高层处理底层异常.
        catch(...)
         {
         //ur code
         throw;
         }
原则4.不捕获异常.不是真正不捕获,是从底层到高层,寻找合适的异常处理器.如果没有,那么执

行,terminate()函数,其调用了abort()函数.
后果:全局对象&静态对象析构函数没有执行
set_terminate()函数制作自己的中止函数.
析构函数抛出异常几乎被禁止.
二.清理.就是资源释放.
原则5.
难点在于构造函数异常处理,处理方式:构造函数发生异常,析构函数不被调用.
第一种
1.构造函数捕获异常,用于资源释放
2.对象构造函数分配资源,析构函数释放资源.
原子性的处理.
第二种,用模板封装指针的方法.
    template<class T,int sz =1> class PWrap{
    T * Ptr;
    public:
   class RangeError();
   PWrap(){
   Ptr = new T[sz];
  }
  ~Pwrap(){
   delete []Ptr;
   }
   T& operator[](int i) throw(RangeError)
  {
    if(i>=0 && i<sz) return Ptr[i];
    throw RangeError();
  }
 
}
原则6.使用auto_ptr对象. 
class A{
public:
   void test(){cout<<"test"<<endl}:
}
int main()
{
    auto_ptr<A> pObject(new A());
    pObject->test(); //test is an object of auto_ptr
}
三.标准异常.
使用c++的标准异常可以大大提高工作效率.
四.异常规格说明.
example: void f() throw(toobig,toosmall,divzero) //函数捕获throw的三种异常
         void g() //捕获任何可能异常
         void h() throw() //不捕获任何异常
原则7.unexpected()&set_unexpected()的使用
example:
#include <exception>
#include <iostream>
using namespace std;
class up();
class fit();
void g();
void f(int i) throw(up,fit){
   switch(i)
 {
          case 1: throw up();
          case 2: throw fid();
        }
    g();
}

void g(){}; // version 1
void g(){throw 47} //version 2
void my_unexpected(){
   exit(0);
}
int main(){
   set_unexpected(my_unexpectd);
   for(int i=1;i<=3;i++)
      try{
 f(i); 
 }
      catch(up){
        cout<<"up caught"<<endl;
      }
 catch(fit)
      {
        cout<<"fit caught"<<endl;
      }
}

原则8.unexpected()抛出的异常类型不违反触发unexpected()的函数的异常规格说明的话,
函数恢复到函数被调用位置重新开始.
#include <exception>    // For std::bad_exception
#include <iostream>
#include <cstdio>
using namespace std;

// Exception classes:
class A {};
class B {};

// terminate() handler
void my_thandler() {
  cout << "terminate called" << endl;
  exit(0);
}

// unexpected() handlers
void my_uhandler1() { throw A(); }
void my_uhandler2() { throw; }

// If we embed this throw statement in f or g,
// the compiler detects the violation and reports
// an error, so we put it in its own function.
void t() { throw B(); }

void f() throw(A) { t(); }
void g() throw(A, bad_exception) { t(); }

int main() {
  set_terminate(my_thandler);
  set_unexpected(my_uhandler1);
  try {
    f();
  } catch(A&) {
    cout << "caught an A from f" << endl;
  }
  set_unexpected(my_uhandler2);
  try {
    g();
  } catch(bad_exception&) {
    cout << "caught a bad_exception from g" << endl;
  }
  try {
    f();
  } catch(...) {
    cout << "This will never print" << endl;
  }
} ///:~

原则9.如果函数规格说明包括bad_exception,则unexpected()函数抛出异常替换为bad_expection.
原则10.如果函数规格说明不包括bad_exception,则调用terminated()函数.
原则11.派生类跟基类要遵循is-a的关系.
#include <exception>    // For std::bad_exception
#include <iostream>
#include <cstdio>
using namespace std;

// Exception classes:
class A {};
class B {};

// terminate() handler
void my_thandler() {
  cout << "terminate called" << endl;
  exit(0);
}

// unexpected() handlers
void my_uhandler1() { throw A(); }
void my_uhandler2() { throw; }

// If we embed this throw statement in f or g,
// the compiler detects the violation and reports
// an error, so we put it in its own function.
void t() { throw B(); }

void f() throw(A) { t(); }
void g() throw(A, bad_exception) { t(); }

int main() {
  set_terminate(my_thandler);
  set_unexpected(my_uhandler1);
  try {
    f();
  } catch(A&) {
    cout << "caught an A from f" << endl;
  }
  set_unexpected(my_uhandler2);
  try {
    g();
  } catch(bad_exception&) {
    cout << "caught a bad_exception from g" << endl;
  }
  try {
    f();
  } catch(...) {
    cout << "This will never print" << endl;
  }
} ///:~
原则12.异常规格说明主要为非模板类实现.
五.异常安全.
原则13.使用clone技术实现新增对象的安全分配内存&初始化.
六.异常使用原则.
原则14.避免使用异常
1.异步事件.2.处理简单错误.3.程序流程控制.4.强迫使用5.新异常,老代码.
原则15.使用异常.
1.使用异常规格说明时,要编写自己的unexpected函数.
2.尽量使用标注异常.
3.嵌套用户自己的异常.
4.使用异常层次结构.捕获基类型异常.
5.多重继承.
6.引用捕获异常.
7.构造函数中抛出异常.
8.不在析构函数抛出异常.
9.避免悬挂指针.auto_ptr

30/11/1999

Reading Gives Power

用程序统计了一下去年读过的书,有的书是第二或者N遍。其中部分是在门口10元一本盗版书摊买的,基本小说大部分属于此类。也有部分是发现amozon.cn后定的,dangdang也订过一些。还有部分是拜伟大的网络文学所赐,例如,明朝和接待处长等等…还有些书是读了一年,还没读完的,比如,王小波作品精选。

我,随着心情的不同,会选择读不同的书。原来坐城铁回家的时候,经常去五道口的光合作用溜达,看到有意思的书就买下来。坐在光合作用二层的咖啡厅里面读书是件非常惬意的事情。看一本郁闷了,可以走不到10m去换本自己喜欢的。因为工作的关系,上班以后,很少在那里逗留。通常在买到数的当晚,我都会看的很晚。我会试着尝试去体会书中人物的心情和试着去理解书中表达的种种理论,感悟或者社会发展现象。有些时候,是在感叹中,迷迷糊糊读完的,例如最近的货币战争。读的时候发现自己突然知道了很多有趣的事情,但是里面解释的银行家的捉迷藏游戏却看不明白。好东东在不同时期的欣赏,会给予自己不同的感悟。

我试着让自己不再庸俗,多少能听懂一些文化人说的文化事儿,能看懂一些文化人写的文章。比如光子的通俗文学和花总的高雅文学作品。过去的N年,我努力着,似乎成效并不大:( 。阅读的乐趣只能身临其境,方可品味其中之美。

今天开始使用豆瓣来记录读过的书,听过的音乐和看过的电影。我推荐你也使用。大家共同分享阅读的乐趣。使用这个可以统计过去看过的书,http://www.machenlei.com/archives/139

克里希那穆提

克里希那穆提不是一个上师,也不是一个老师,而是一位在真理路上的研究者与探询者。
——R.Venkataraman

 

他(克里希那穆提)是我所见过的最美的人类
——赫胥黎

 

http://www.krishnamurti.com.cn/01_cnhome.htm

TICPP-VOL2-读书笔记-防御性编程

生存理由:
1.提高代码的生存质量
2.XP(极限编程原则):边测试,边开发.
本章主要介绍了assert断言调试技术&TestSuite Framwork以及内存泄漏的宏调试方法.算是介绍了一些测试技术的基本思想&方法.概念不多.需要多读例子代码体会.
作者的TestSuite Framwork写的清晰易懂.在随后章节中大量应用.
一.断言
原则1.使用assert(case)对其中case的正确性进行判断.
二.简单单元测试框架
原则2.测试程序+编码 > 直接编码
原则3.阅读TestSuite的代码
三.调试技术
原则4.用于跟踪代码的宏
#define Trace(ARG) cout<<#ARG<<endl; ARG
#define D(A) cout<<#a<<"=["<<A<<"]"<<endl;
原则5.内存泄漏
1.数组边界监察
2.基类的非虚析构函数
3跟踪new/delete,malloc/free语句
文中介绍了一种重载new/delete,并且使用数组存储内存分配信息的方法.
本章的学习关键在于实践中体会XP编程思想.

TICPP-VOL2-读书笔记-异常处理

生存理由:
1.异常处理远离异常发生地
2.针对对象的释放资源的管理
try
{
// ur code
throw ;//exception style
}
catch(type n)
{
  //handle exceptions of type
}
异常处理模型:中止&恢复模型.
一.异常匹配
原则1.对象或者指向派生类对象的引用都会与其基类处理器匹配.
原则2.捕获所有异常
         catch(…)
         {
         }
原则3.重新抛出异常,应用于调用链高层次异常处理.呵呵,就是高层处理底层异常.
        catch(…)
         {
         //ur code
         throw;
         }
原则4.不捕获异常.不是真正不捕获,是从底层到高层,寻找合适的异常处理器.如果没有,那么执

行,terminate()函数,其调用了abort()函数.
后果:全局对象&静态对象析构函数没有执行
set_terminate()函数制作自己的中止函数.
析构函数抛出异常几乎被禁止.
二.清理.就是资源释放.
原则5.
难点在于构造函数异常处理,处理方式:构造函数发生异常,析构函数不被调用.
第一种
1.构造函数捕获异常,用于资源释放
2.对象构造函数分配资源,析构函数释放资源.
原子性的处理.
第二种,用模板封装指针的方法.
    template<class T,int sz =1> class PWrap{
    T * Ptr;
    public:
   class RangeError();
   PWrap(){
   Ptr = new T[sz];
  }
  ~Pwrap(){
   delete []Ptr;
   }
   T& operator[](int i) throw(RangeError)
  {
    if(i>=0 && i<sz) return Ptr[i];
    throw RangeError();
  }

}
原则6.使用auto_ptr对象. 
class A{
public:
   void test(){cout<<"test"<<endl}:
}
int main()
{
    auto_ptr<A> pObject(new A());
    pObject->test(); //test is an object of auto_ptr
}
三.标准异常.
使用c++的标准异常可以大大提高工作效率.
四.异常规格说明.
example: void f() throw(toobig,toosmall,divzero) //函数捕获throw的三种异常
         void g() //捕获任何可能异常
         void h() throw() //不捕获任何异常
原则7.unexpected()&set_unexpected()的使用
example:
#include <exception>
#include <iostream>
using namespace std;
class up();
class fit();
void g();
void f(int i) throw(up,fit){
   switch(i)
 {
          case 1: throw up();
          case 2: throw fid();
        }
    g();
}

void g(){}; // version 1
void g(){throw 47} //version 2
void my_unexpected(){
   exit(0);
}
int main(){
   set_unexpected(my_unexpectd);
   for(int i=1;i<=3;i++)
      try{
 f(i); 
 }
      catch(up){
        cout<<"up caught"<<endl;
      }
 catch(fit)
      {
        cout<<"fit caught"<<endl;
      }
}

原则8.unexpected()抛出的异常类型不违反触发unexpected()的函数的异常规格说明的话,
函数恢复到函数被调用位置重新开始.
#include <exception>    // For std::bad_exception
#include <iostream>
#include <cstdio>
using namespace std;

// Exception classes:
class A {};
class B {};

// terminate() handler
void my_thandler() {
  cout << "terminate called" << endl;
  exit(0);
}

// unexpected() handlers
void my_uhandler1() { throw A(); }
void my_uhandler2() { throw; }

// If we embed this throw statement in f or g,
// the compiler detects the violation and reports
// an error, so we put it in its own function.
void t() { throw B(); }

void f() throw(A) { t(); }
void g() throw(A, bad_exception) { t(); }

int main() {
  set_terminate(my_thandler);
  set_unexpected(my_uhandler1);
  try {
    f();
  } catch(A&) {
    cout << "caught an A from f" << endl;
  }
  set_unexpected(my_uhandler2);
  try {
    g();
  } catch(bad_exception&) {
    cout << "caught a bad_exception from g" << endl;
  }
  try {
    f();
  } catch(…) {
    cout << "This will never print" << endl;
  }
} ///:~

原则9.如果函数规格说明包括bad_exception,则unexpected()函数抛出异常替换为bad_expection.
原则10.如果函数规格说明不包括bad_exception,则调用terminated()函数.
原则11.派生类跟基类要遵循is-a的关系.
#include <exception>    // For std::bad_exception
#include <iostream>
#include <cstdio>
using namespace std;

// Exception classes:
class A {};
class B {};

// terminate() handler
void my_thandler() {
  cout << "terminate called" << endl;
  exit(0);
}

// unexpected() handlers
void my_uhandler1() { throw A(); }
void my_uhandler2() { throw; }

// If we embed this throw statement in f or g,
// the compiler detects the violation and reports
// an error, so we put it in its own function.
void t() { throw B(); }

void f() throw(A) { t(); }
void g() throw(A, bad_exception) { t(); }

int main() {
  set_terminate(my_thandler);
  set_unexpected(my_uhandler1);
  try {
    f();
  } catch(A&) {
    cout << "caught an A from f" << endl;
  }
  set_unexpected(my_uhandler2);
  try {
    g();
  } catch(bad_exception&) {
    cout << "caught a bad_exception from g" << endl;
  }
  try {
    f();
  } catch(…) {
    cout << "This will never print" << endl;
  }
} ///:~
原则12.异常规格说明主要为非模板类实现.
五.异常安全.
原则13.使用clone技术实现新增对象的安全分配内存&初始化.
六.异常使用原则.
原则14.避免使用异常
1.异步事件.2.处理简单错误.3.程序流程控制.4.强迫使用5.新异常,老代码.
原则15.使用异常.
1.使用异常规格说明时,要编写自己的unexpected函数.
2.尽量使用标注异常.
3.嵌套用户自己的异常.
4.使用异常层次结构.捕获基类型异常.
5.多重继承.
6.引用捕获异常.
7.构造函数中抛出异常.
8.不在析构函数抛出异常.
9.避免悬挂指针.auto_ptr