Saturday, September 13, 2008

核心能力 V.S. 核心價值

核心能力跟核心價值可分成企業面跟個人面


個人面:
核心能力就是
你的專業能力以及相關技能
例如建築師 的核心能力是建築設計
牙醫的核心能力是 治好我們的牙齒

而核心能力 不只有專業的這項
例如 會傾聽病人需求的牙醫
傾聽能力也會是他的核心能力
核心能力就是各種專業能力跟優勢力的聚合
例如你可能就是 對程式方面的專長
加上你自己的特質能力組成的
就是你的核心能力了

而核心價值是精神面的
以一個醫生來說
他的核心價值 也許是 賺一大筆錢 或是 照顧好每個病人
依照核心價值的不同
會走上不同的路
而核心價值是比較不會改變的
就是價值觀的根本


企業面:
像GOOGLE的核心價值 就是由兩個領導者的念頭
讓世界變得更好
就是他們的核心價值


要發展核心能力是第一步
當你有了能力
再來想 你要為世界或是你自己做些什麼
就會慢慢發展出你的核心價值



感謝少璞學長的解釋

Thursday, May 22, 2008

Call by XXX

轉錄自Ptt C_and_CPP版
參考網址 : http://sandwichc.blogspot.com/2007/02/cc-pointer-reference.html
// 測試用,不封裝
class Type {
    public : 
        Type() { i = 0 }
    int i;
};
1. call by Value (非 pointer):
修改 o 的資料是不會影響到 t 的 因為 o 是 t 的複本
void Value_Not_Pointer(Type o) {
    printf("%d ",o.i);  
    o.i = 3;   
    printf("%d ",o.i);
}

int main(){
    Type t;
    printf("%d ",t.i);  
    Value_Not_Pointer(t); 
    printf("%d ",t.i);
    return 0;
}
output : 0 0 3 0

2. call by Value (是 pointer): 一般稱作 call by Address Or call by Pointer
指派 o 到新的物件是不會影響到 t 的 因為 o 是 t 的複本
這個複本是指 o 與 t 所指到的物件是相同的物件
所以如果透過 o 去修改物件的話,則 t 所讀到的物件會受到影響
void Value_Is_Pointer_1(Type *o) { 
    printf("%d ",o->i); 
    o->i = 3; 
    printf("%d ",o->i);
}

int main(){  
    Type *t = new Type();
    printf("%d ",t->i);
    Value_Is_Pointer_1(t); 
    printf("%d ",t->i);
    return 0;
}
output : 0 0 3 3
------------------------------------------------------------------------
void Value_Is_Pointer_2(Type *o) { 
    printf("%x ",o);
    o = new Type();   
    printf("%x ",o);
} 

int main(){ 
    Type *t = new Type();
    printf("%x ",t); 
    Value_Is_Pointer_2(t); 
    printf("%x ",t);
    return 0;
}
output : 3d24b0 3d24b0 3d2548 3d24b0



3. call by Reference (非 pointer) 因為 o 就是 t 本身,某種程度上來說 o 是 t 的同名(alias)
所以在修改 o 的時候, t 是會受到影響的
在某種意涵上, call by Reference 與 call by Address 是相同的
void Reference_Not_Pointer(Type &o) {
    printf("%d ",o.i);
    o.i = 3;
    printf("%d ",o.i);
} 

int main(){
    Type t;
    printf("%d ",t.i);
    Reference_Not_Pointer(t);
    printf("%d ",t.i);
    return 0;
}
output : 0 0 3 3


4. call by Reference (是 pointer)
因為 o 是 t 本身,所以在透過 o 修改物件時,t 是會受到影響的
而且如果將 o 重新指派新的物件時,t 也會只到新的物件上
void Reference_Is_Pointer_1(Type *&o) {
printf("%d ",o->i);
    printf("%d ",o->i);
    o->i = 3;
printf("%d ",o->i) } int main(){ Type *t = new Type(); printf("%d ",t->i); Reference_Is_Pointer_1(t); printf("%d ",t->i); return 0; }
output : 0 0 3 3
------------------------------------------------------------------------
void Reference_Is_Pointer_2(Type *&o) {
    printf("%x ",o);
    o = new Type();
    printf("%x ",o);
}

int main(){
    Type *t = new Type();
    printf("%x ",t);
    Reference_Is_Pointer_2(t);
    printf("%x ",t);
    return 0;
}
output : 3d2460 3d2460 3d24c8 3d24c8