2010年12月28日 星期二

【轉貼】利用Windows的Hosts設定來測試網站

【轉貼】利用Windows的Hosts設定來測試網站

因為我接的大多是較為複雜的案子,可能需要同時編寫Server端和Client端的程式,當然功能測試也是非常重要的一環,所以今天我來分享一些測試系統的小技巧。

顧客的網站我大多在我的Lab Server上做測試,為了開發方便所以我所採用的是Windows Server(可以同時開發JSP,ASP.NET,PHP,ColdFusion…),每個客戶的的案子當然就放在Web Server的虛擬伺服器上,要測試的時候很多人可能會有點傷腦經。
其實這個不是問題,只要是MIS都會知道Windows裡面有個hosts的檔案,可以讓使用者自己去調整IP的對應方式,例如你可以在瀏覽器中輸入http://localhost,這其實等同你輸入http://127.0.0.1,為什麼會這樣呢?原因就在於在hosts中有描述localhost的domain name其實是要對應到127.0.0.1這個IP的,所以若你想要將某個domain name對應到自己的測試環境,只要去修改這個設定檔就可以了,而不需要去動到整個網路環境。
 這個檔案的位置在 C:\WINDOWS\system32\drivers\etc\hosts ,找到後用Notepad打開就可以直接編輯了,例如下例,我們將 http://blog.riaproject.com 直接指定到 127.0.0.1,只需要這樣做:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
127.0.0.1       localhost
127.0.0.1       blog.riaproject.com

2010年12月25日 星期六

【心情】隨手一畫

【心情】隨手一畫

隨手一畫...

好久沒畫圖了

每次畫完的結論都是....

我還真沒有畫畫天份.....

 

2010年12月22日 星期三

【轉貼】Skype查明全球性宕機原因:“超級節點”故障

【轉貼】Skype查明全球性宕機原因:“超級節點”故障

Skype查明全球性宕機原因:“超級節點”故障

鉅亨網新聞中心 (來源:北美新浪) 2010-12-23 06:40:29 網友評論 0  我來說兩句    Blog談新聞  下則
226
新浪科技訊 北京時間12月23日凌晨消息,Skype周三表示,已查明當天全球範圍內Skype宕機原因,但警告稱解決問題仍需要數小時的時間。
Skype表示,Skype與傳統的電話或即時通訊服務不同,該語音通話服務依賴於數百萬個獨立的連接,其中部分電腦被稱為“超級節點”。
“在正常情況下,可用的超級節點數量非常多,”Skype在一篇博客中稱,“不幸的是,許\多超級節點都在今天遇到了故障,這是由於部分版本的Skype出錯所致。由於Skype無法同部分超級節點保持連接,一些用戶會無法登陸。”
Skype稱,他們已經找到解決問題的方法,即建立新的“超大型超級節點”。
“我們的工程師正在創建新的“超大型超級節點,隨後Skype服務應該會逐步恢複正常,”Skype表示,“這可能需要數小時的時間,我們對因此造成的不便表示道歉。部分功\能,如多人視頻通話,可能需要更長的時間才能恢複正常。”
該公司稱,用戶可以關注該公司的Twitter帳號@skype,以獲悉最新進展。(張和)

2010年12月19日 星期日

【轉貼】Standard Event Attributes

【轉貼】Standard Event Attributes


Standard Event Attributes

HTML 4 added the ability to let events trigger actions in a browser, like starting a JavaScript when a user clicks on an element.
To learn more about programming events, please visit our JavaScript tutorial and our DHTML tutorial.
Below is the standard event attributes that can be inserted into HTML / XHTML elements to define event actions.

and Events

The two attributes below can only be used in or :
Attribute Value Description
onload script Script to be run when a document load
onunload script Script to be run when a document unload


Form Events

The attributes below can be used in form elements:
Attribute Value Description
onblur script Script to be run when an element loses focus
onchange script Script to be run when an element change
onfocus script Script to be run when an element gets focus
onreset script Script to be run when a form is reset
onselect script Script to be run when an element is selected
onsubmit script Script to be run when a form is submitted


Image Events

The attribute below can be used with the img element:
Attribute Value Description
onabort script Script to be run when loading of an image is interrupted


Keyboard Events

Valid in all elements except base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title.
Attribute Value Description
onkeydown script Script to be run when a key is pressed
onkeypress script Script to be run when a key is pressed and released
onkeyup script Script to be run when a key is released


Mouse Events

Valid in all elements except base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title.
Attribute Value Description
onclick script Script to be run on a mouse click
ondblclick script Script to be run on a mouse double-click
onmousedown script Script to be run when mouse button is pressed
onmousemove script Script to be run when mouse pointer moves
onmouseout script Script to be run when mouse pointer moves out of an element
onmouseover script Script to be run when mouse pointer moves over an element
onmouseup script Script to be run when mouse button is released