30 November, 2012

recovery unsaved word files

Some unsaved word files are stored in the following folder: 
C:\Users\YOUR-USER-NAME\AppData\Roaming\Microsoft\Word\ 
In German system it is: 
C:\Benutzer\YOUR-USER-NAME\AppData\Roaming\Microsoft\Word\ 
Try to check for every file under this folder and its sub-folder with the approximate modification time and size.

14 September, 2012

javascript trim

return str.replace(/^\s+|\s+$/g, '');

29 March, 2012

pass 2D array in C++ functions/c++中调用函数时传递2维数组

template < int M, int N >
void printMat(int (&mat) [M][N]) {
  for (int i=0; i < M; i++)
  {
    for (int j=0; j < N; j++)
    {
      std::cout << mat[i][j] << "\t";
    }
    std::cout << std::endl;
  }
  return;
}

21 February, 2012

用perl在多个文件中替换

用perl在多个文件中替换
perl -pi -w -e 's/search/replace/g;' *.cpp

e.g.

perl -pi -w -e 's/.C>/.cpp>/g;' jni/ga/*

30 April, 2011

iphone


You are discouraged from overriding description—if this method fires a fault during a debugging operation, the results may be unpredictable—and initWithEntity:insertIntoManagedObjectContext:. You should typically not override the key-value coding methods such as valueForKey: and setValue:forKeyPath:.

何处落尘埃

身如菩提树,心如明镜台,时时勤拂拭,不使留尘埃。
菩提本非树,明镜亦非台,本来无一物,何处落尘埃。

04 April, 2011

enable auto spellcheck in Firefox

Type about:config in address bar, enter

Click on "I'll be careful, I promise!",

Type layout.spellcheckDefault on Filter,
Change the default value from 1 to 2.