2010年1月27日 星期三

[Japanese Drama] Mr. Brain

     This Japanese drama, "Mr. Brain", is about how to use brain knowledge in science to solve the crime. A criminal can lie, but his brain can't.

The following content may reveal a little plot!
2010年1月26日 星期二

[日劇] Mr. Brain 腦科學先生

[Chinese Ver.]
     大腦可說是人體最重要的器官,雖僅重約1,400克,但掌管呼吸、心跳、認知、記憶等重大功能。如果大腦有了損壞,必然會嚴重影響生活品質。這部由木村拓哉和綾瀨遙主演的日劇描述警方如何透過腦科學的知識來辦案、收集證據。

以下可能會透漏些劇情:
2010年1月18日 星期一

Let firefox support telnet protocol(BBS)

[English Ver.]
    In most case, I'll choose firefox as my browser because it has many convenient plug-ins. Unfortunately, it doesn't support telnet protocol. So, we need to install the telnet plug-in which was made by pcman(famous programer in Taiwan). Here is its install page. Because it is released with xpi formate, firefox will remind you install it directly. But the default setting of firefox will consider this plug-in doesn't fit v3.5 and suspend it. Type "about:config" in address line, and confire the message. Right-click to add two settings, name:extensions.checkCompatibility, value is false ; the other name is extensions.checkUpdateSecurity, and the value is also false. Restart the firefox, type the telnet address(begin with telnet://), and you can also booksmark it just like web pages.

讓firefox與telnet(BBS)共舞

        在大多數的情況下,筆者是使用firefox作為瀏覽器,雖然他有浪費記憶體、多分頁執行速度慢等缺點,可是還是有很多方便的plug-in可使用。大概是用telnet介面的人少了(全球而言),幾乎沒有人在寫telnet的plug-in。好在pcman做了移植的工作,並將它以GPL的方式釋出。
telnet plug-in for firefox
    
       因為是.xpi,所以firefox會自動完成安裝。由於firefox會自動檢查它的版本,並將它認定為不支援並加以停用,所以要透過設定來停止版本檢查。首先在網址列鍵入:「about:config」,確定警告訊息後,右鍵新增布林值,分別是extensions.checkCompatibility,值設為false;另一個為extensions.checkUpdateSecurity,值也為false。重新執行程式後,在瀏覽列鍵入telnet://ptt.cc即可連到台大的批踢踢。
2010年1月16日 星期六

[VB .NET] How to Cancel the Closing of Form

[English Ver.]
     There is a X button on top-right side of form. When user press it, will raise an closing event. Before VB .NET 2008, we can set e.cancel=true in closing event function to stop the closing process. But there's no such event function in VB .NET 2008. There is another methond to use the function. We have to refer to system.windows.presentation in References page ,and the OnClosing(byval e as system.componentmodel.canceleventargs) event function will be gernerated.  But the closing function doesn't have content. OnClosing function should be "overrides" to stop closing by setting e.cancel=true.
  
    About the development of ASSEditor, v0.6 has already done. And which remains a testing version. Main changes are to suport Janpanese and Korean ANSI encoding. Encoding-convert is a very import ability to this program. So, the user will get garbage as soon as the impropriate encoding is choosen. That is why I choose Unicode as default encoding, unless user try to change the encoding. The fewer number of ANSI file is, the less miss-coding will make.

VB .NET 如何取消(阻止) 表單關閉

在Windows的視窗中右上角有個X來讓使用者按下關閉,那麼要如何阻止表單關閉呢?在2008版之前,在closing event中可用e.cancel=true來阻止關閉行為,但在2008版的form物件並不存在closing event。然而有個onclosing event可以應用,但必須先在references中引入system.windows.presentation才會出現。因為onclosing函式是沒有內容的,所以必須用overrides覆寫,當使用者按下X後會引發onclosing event,在處理這個事件的函式中有被宣告為system.componentmodel.canceleventargs的類別e,設定e.cancel=true即可取消關閉的程序。

順便一提,ASSEditor又做了一些修改,主要是增加了日文和韓文的ANSI編碼。由於字元編碼的正確性是重點項目,所以對於不相容的編碼,ASSEditor會立即呈現出來。不像記事本,存檔前才要求使用者改以Unicode存檔。這是因為ASSEditor預設的編碼是Unicode,如果使用者不去變動自然不會有問題,但若被改用其他的ANSI編碼,就意味使用者對於編碼有一定認識。況且這樣的預設也是鼓勵使用Unicode,不再在使用傳統ANSI。對於編碼一致性有很大的幫助,減少ANSI檔案也就不用再猜它到底用何種編碼了。
2010年1月13日 星期三

[Announce] English and Traditional ver. are provided

It was only Traditional Chinese ver. in this blog before. To make more people be able to read the articles, I will post two versions in one subject. Please forgive me the English version may be later and slightly different from the Chinese version. This is due to my English writing skill.

[公告]文章將有中、英兩版

[You are reading Traditional Chienese Ver. ]
為了進軍國際...噢不,為了提昇人氣,以後所發表的文章將新增英文版讓不懂中文的網友也能閱讀。同個主題會發兩篇文章,標明Traditional Chinese Ver.和English Ver.來區分,內容以中文版為主,英文版的部份則可能會較晚發表、內容有所刪減或是描述上的差異。這是受限於板主的英文能力,請多包涵。
2010年1月10日 星期日

為什麼我少聽國語流行歌曲

        在AA看到一個討論串:「是什麼理由讓你放棄(或少聽)中文歌的?」,不知這是不是所謂的物以類聚,回應意見真是令人心有戚戚焉。筆者認為如果舞跳得好,那可以自稱dancer;如果口才好,那就可以自稱名主持人;同理,歌唱的好才能當singer,我懷疑在台灣的主流市場好吧連非主流市場也算進來,有幾個singer?舉例來說:張雨生、林志炫;女歌手方面,陳淑樺、鄭怡、曾淑勤,都是比較早期的歌手了,現在的歌手實在很少能讓我留下印象。根本的問題就是現在的歌手太氾濫,MTV的普及下,只要有心人人都可以是歌手。早期環境沒有那麼好,要有真正的唱功實力才能冒出頭來。還有現在的歌手太迷信所謂的主流唱法。比如說周杰倫很紅,就一窩蜂的學他的唱腔。就像嚴長壽先生批評在金門開賭場,「既是美女何必入紅塵」。應該是很少數的人才有的天賦能當歌手,台灣的歌手太多了。琢磨各種歌唱技巧是好事,重點是要根據自身的實力特質去努力。不要以為花俏的技巧可以掩蓋實力的不足,反之,對於真正有實力的歌手,他並不需要刻意的強調技巧。自身優美的嗓音足矣,更多的技巧只是錦上添花。
2010年1月8日 星期五

純文字文件編輯器-Ass Editor

        一直以來都在找一個既堪當寫簡單程式又可以編輯文章的editor。筆者用過幾個不錯的免費軟體:notepad++、notepad2、ulipad。尤其是ulipad是針對開發python所設計,與編譯器整合的相當好。可是這些editor有一個共通的毛病,就是中文和英文同時存在段落就分得很奇怪。所以筆者決定要自己來寫筆者決定要用VB .net自己來寫一套,它需具備有:
1.支援多分頁開啟。
2.不同編碼能互相轉換。
            相信大家都有過拿到音樂的cue檔卻讀不出來的窘境吧,僅僅是因為字元的編碼不同。
3.段落要正常。
4.支援自動縮排。

最後一項是筆者最想要的功能,再之前用的軟體怎麼樣就之前用的軟體怎麼樣就是沒辦法像Word一樣,按ENTER就自動縮排,所以一定要實現。至於怎會有個不文雅的名字,因為它設計的最重要的中心思想就是「As Simple aS possible」,沒有多餘只有最需要的功能。

  VB是我最熟悉的語言,目前最新是2010版,不過還是用2008版來寫就已經足夠。
Download Link: Ass Editor,目前只是測試版,還不算穩定,大家可以下載來玩一下,順便給個意見。