Google new toolbar

Google在4月1日的時候,除了發行了鼎鼎大名的Google Gulp(詳細介紹可以參考對牛亂彈琴裡面的文章),另外一方面,Google也更新了一版新得Toolbar(可以到這裡下載繁體中文版),其實這版有許多令人驚艷的功能,除了更好的介面外,還多了線上翻譯的功能,雖然現在只能翻譯英文的部份,但是卻是讓常常必須一邊開著眼博士(Dr.Eye 的戲稱)一邊工作的我,Loading 變的輕鬆一點 (也許會變的更大~)

安裝完畢之後,將游標移到英文單字上面,就會自動出現。等等~~~~~ 為何我的站台沒有呢?~~ 於是~~ 又讓我覺得~~ 可能是一個千年老BUG (IE6對於CSS支援的缺陷),一直以來IE6對於CSS的支援讓我感到非常痛苦,除了在我的網站無法選取文字之外、當然也無法正常運用到Google Tool Bar線’上英文翻譯功能。但是微軟也似乎不想推出IE7了,或許這些奢求就等到Longhorn出來吧。

Google 工具列

360 degree 入手

Yahoo!Gmail容量超過2G的上限後,感謝Lotos.Lee 分享他的邀請函給我,也讓我加入了Yahoo! 360 ,講講試用心得,其實YahooYahoo! 360 結合了許多網路的功能,榮同他們做入口網站般,我相信Yahoo! 360 可以變成許多Bloger的入口網站,因為可以結合Email、PHOTO、交友、聊天、BLOG的功能的Yahoo! 360 ,接受到朋友的邀請函後,可以發現你自動的與那位朋友連接出朋友的關係,自然而然~~~如果你不斷的去發送的你邀請卡,就會有如同Orkut般的小世界的感覺一樣。

歡迎大家來我的Yahoo 360 Blog E

嗯嗯現在重點來了~~~如果要邀請卡的,馬上來這裡吧~留下你們EMAIL在迴響中的選項就好~~ 不要留在內文中~~ (Want be invited in Yahoo 360? just leave your information in the comment…..)

Gmail new features!!

Google

Gmail 一直是免費Email市場中,站有領導者的地位,在大家努力將EMAIL增大的同時~~Gmail又有新功能的發表~除了逐漸變大的容量之外(聽說慢慢會變成2G,線在逐漸變大中~),據說每個人增大的容量還不太一樣各位可以去查查你們Gmail多大(我的是1503MB)~~

不知道容量增大對大家幫助如何,但是對最有我幫助的是”Rich Email”,這樣的話~~~ 我們就可以直接轉寄內含 WEB內容的EMAIL給其他人,而不會擔心EMAIL內容不見了~~~~~

真是方便~~~~~~~~

Finalizer, Dispose, Close

Designing .NET Class Libraries: Designing for a Managed Memory WorldDesigning .NET Class Libraries is very good place that I am used to go here and study something anout .NET Framework. I also like Brad Abrams very much, because hi usually use very simple example to explain such hard thing like “dispose”, “finalizer”, “Manage code”, “CLR” … . In the speechDesigning for a Managed Memory WorldBrad Abrams focus on “Gabage Colloection”, and talking about finalizer (seems he like this word more than destructor) , dispose( I think dispose is new concept in .NET framework, but it really hard to use it well).

He also talk about try {} ,excption{} and_ finally {}_ to manage the memory well. Nested use try{} finally {} can make exception more clear and can handle more condition even we don’t think it will happen.

static void CopyFile(file sourcdeFile, file destFile){ > > try { > >     OpensourceFile(sourcdeFile); > >    try { OpensourceFile(destFile);  } > >    finally { CloseFile(destFile); } > >    } > >  finally { CloseFile(sourcdeFile); } > > } > >

Important concept about GC (Gabage Collection) is when dispose, close, finalize call? The anwser is use code to call dispose and close; but GC will call finalize when this object should be collection back.

The scope bug of “for loop”

Route 64 - Kang Su Gatlin talks about 64-bit對於for loop的使用,相信大家跟我一樣,總是習慣去撰寫

for(int i=0; i<5; ++i) { > > ....... > > } > > cout << i ; > >

但是,若是根據以上的程式,利用VC6或是BCB會看到哪樣的ouput i?很簡單~~就是 i = 5,但是正常來說,i 的scope 在哪裡??

i 應該是在for 之內的,所以他的生命週期(scope)應該也是在其中,但是由於VC++與BCB的錯誤,此得i 的scope 變成了for 之外,造成許多程式的問題。

解決方式: #define for   if(0); else for

參考網站: BBS文章,參照侯捷老師上課內容

Interesting bug in VC6

Route 64 - Kang Su Gatlin talks about 64-bit最近在做VC6轉換VC7的時候,倒是慢慢發現VC6的一些bug,舉例來說,看一下下面的範例程式:

 if (int i)  {     i = 1;  } > >

在VC6只會得到一個warnning:

warning C4700: local variable 'i' used without having been initialized > >

但是由於Constructor 通常不會有回傳值(return value),所以基本上在if() 不應該有變數的起始。所以這樣的code在GNU C++會發現是無法compiler過的~~~

當然VC7 修掉了這個嚴重的bug,你可以看到出現:

error C2059: syntax error : ')' > >

蠻有趣的bug,不過~~~ 若有人這樣寫code 可就慘了,因為雖然constructor沒有回傳值(return value),但是在VC6中, if (int i)卻是判斷為true~~~ 這樣可能是與原來的想法會有點出入~

所以有時候利用VC7來compiler一下現在的code,也是一個好主意。