- Aug 02 Thu 2012 22:05
C - Volative
- Aug 02 Thu 2012 20:35
c/c++ - sizeof()
- Jun 21 Thu 2012 11:08
Math - Degenerate Distribution (退化分配)
- May 20 Sun 2012 10:05
Java - StringTokenizer (分割String)
在Java中 , 要分割String通常我們會用String Class中的split method ,
不過其實還有另外一個class可以幫我們達到這樣的目的 , 那就是StringTokenizer Class.
- Apr 15 Sun 2012 02:25
Windows - 快捷鍵
- Apr 07 Sat 2012 21:11
Cpp - When should I use a "private" constructor?
一般來說 , 宣告在private區域就是代表部給class以外的人使用 ,
所以若把constructor宣告在private區域 , 代表就是不可以對這個class instantize.
- Apr 07 Sat 2012 14:47
Cpp - iterator
- Apr 06 Fri 2012 17:36
Vim - Memo
- Apr 05 Thu 2012 19:29
Cpp - reference counting
The reference count tracks how many references to the object are currently active.
When the number of references drops to zero, the object deletes itself.
The last part is worth repeating: The object deletes itself; the program never explicitly deletes the object.
Here are the rules for reference counting:
0. When the object is first created, its reference count is 1. At this point, the program has a single pointer to the object.
1. Attach a counter to each pair in memory.
2. When a new pointer is connected to that pair, increment the counter.
3. When a pointer is removed, decrement the counter.
4. Any cell with 0 counter is garbage.
ref : http://msdn.microsoft.com/en-us/library/ff485846(v=vs.85).aspx
- Apr 05 Thu 2012 00:38
Java - 設定小數位數
- Apr 03 Tue 2012 21:23
Cpp - map & comparator
In their implementation in the C++ Standard Template Library, map containers take four template parameters:
template < class Key, class T, class Compare = less<Key>,
class Allocator = allocator<pair<const Key,T> > > class map;
- Apr 03 Tue 2012 21:17
Cpp - Function Object
- Apr 03 Tue 2012 21:05
Cpp - STL algorithm
In addition to container classes and iterators,
STL also provides a number of generic algorithms for working with the elements of the container classes.
- Apr 03 Tue 2012 17:16
Linux - ctags
There are four procedure when we want to use ctags.
1. go to the directory in which we want to trace the code.
- Mar 31 Sat 2012 21:01
Cpp - istringstream
- Mar 31 Sat 2012 20:38
Cpp - feof and fgets. (never use feof as the exit indicator for a loop)
我們在讀檔時 , 因為不知道檔案的大小 , 通常需要一個方法來幫我們判斷是否已經讀到檔案結尾.
but ... You should never use feof() as the exit indicator for a loop.
- Mar 24 Sat 2012 23:23
Cpp - dynamic_cast<>
在C++中 , 若有兩個derived class 繼承同一個abstract base class時 ,
我們若以base class pointer (or reference )來接derived class的instance , 並使用base class的pointer
- Mar 24 Sat 2012 20:14
Cpp - member function , Virtual function & Pure Virtual function
- Mar 22 Thu 2012 09:50
Java - 判斷String是否被包含在另一個String裡面
- Mar 16 Fri 2012 15:34
Cpp - Multiple inheritance
Multiple inheritance enables a derived class to inherit members from more than one parent.
While multiple inheritance seems like a simple extension of single inheritance ,