2008年4月28日 星期一

2008年4月17日 星期四

Lab 22: Form and Action, Part II

Hand code a HTML or use Nvu to edit an HTML so that the webpage can send a request to Google likehttp://maps.google.com/maps?q=24.9586,+121.24114
Use Form CGI that includes action, input, and submit.Try a few different coordinates.















































Lab 21: Form and Action

"logic will get you from A to B - imagination will take you anywhere"

How to use Form to invoke a remote service through CGI.

1. Copy the search box of this search page,
inlcuding radio buttons, text input, and submit button.
2. Open your Nvu HTML editor.
3. Open a new empty HTML file.
4. Paste the search box into this new file.
5. Use Nvu to add a Form to this search box. Do not hand code the HTML. Just fill the blank in the Form dialog.

6. In the form dialog, set Action="http://google.com/search" and name of Form as "f" and method as "get"
(See Hint if it does not work.)
7. Run your HTML by Firefox. What do you get?



8. Set method as "post"
9. Run your HTML by Firefox. What do you get?



Homework 3-28-2008

1 根據無障礙網頁設計原則 。為什麼不要開出新視窗?
ANS :
一、而對於視障者來說,直接跳出新視窗也會讓他們感到困擾,因為螢幕朗讀軟體無法讓他們明確的發現跳出的新視窗。
二、視力不佳的人也因為難發現有新視窗被開出來,加上"上一頁"的按鈕又不能用而感到不知所措。
三、此外,對於習慣使用分頁的人,開出新的視窗將沒有保留之前的分頁,要切換想看的網頁也不方便。
。為什麼要使用貼切的網頁標頭? 而不是留白?
ANS :
一、對視障者來說,螢幕朗讀軟體就能夠讀出網頁的標題;或者能先用布拉耶點字讀到標題。二、對於記憶力不佳的人,由於看同一個網頁其他文章時標題位置不會改變,因此能夠幫助他們喚起記憶。
三、有意義的標題還能使普遍大眾方便搜尋到想看的網頁。
。定義快速鍵有什麼好處?
ANS :
一、對視障者來說,當 JAWS 讀到定義有accesskey 的鏈結時,會把這個快捷鍵讀出來。就能方便他們連結出去。
二、而即使無法使用滑鼠的人,也能靠鍵盤導覽以及快速鍵的幫忙來在頁面中移動。
2. According to Section 2.1 of Textbook, some websites are powered by databases in the back end and some are not. What are the purposes of using databases?
ANS :
使用資料庫可將所有用戶資料作分類後存放,使用戶資料作有效率的存取,也方便資料的更新。
3. Problem 1 & Problem 3 of Textbook on Page 55.1)解釋 Web 技術演進是要解決什麼樣的問題?
ANS :
全球資訊網技術從開始到現在約有三個時期:第一時期:主要是HTML的製作,這時用戶端所看到的網頁稱為靜態網頁。然而因為沒有資料庫做後台,資料的更新就成了一件繁瑣的事。
第二時期:通常以C、Perl或是其它的語言來達到資料存取的目的,呈現的網頁已經可以在伺服端處理過後再將內容呈現出來。這時主要是使用程序的觀念,每服務一位使用者,就必須開啟一個新程序,當使用者增多時,由於耗費過多系統資源而導致網站速度明顯下降。
第三時期:以效率較高的執行緒取代程序,使用常駐的服務。程式設計以手稿方式為主,取代傳統的C、Perl等所寫的CGI程式,簡化網路程式設計並提高程式開發效率。
結論:Web 技術演進是為了要處理在"提供用戶端更優質、高效率的服務"的目的下,所遇到的種種問題。
2)程序(Process) 和執行緒(Thread) 對網站性能有什麼不同的影響?
ANS :
程序:每服務一位使用者,就必須開啟一個新程序,當使用者增多時,由於耗費過多系統資源而導致網站速度明顯下降。執行緒:使用常駐的服務,提高網站速度。
4. Reading Assignments:XML (Page 187-188 on the Textbook)

2008年4月14日 星期一

Average income by gender


Write a program to calculate average income by gender based on the following data, where F stands for female and M for male.
F 62,000
M 25,000
F 38,000
F 43,000
M 65,000
M 120,000
F 80,000
M 30,100
You should be able to allow users to type in a whole line such as F 80,000 followed by next line M 30,100.


Without any change made to your program, your program should be able to process a new set of data, such as follows:
M 52,000
M 35,000
F 48,000
M 33,000
F 75,000
F 110,000
F 90,000
M 30,100

Lab Fibonacci numbers




Lab 9*9




2008年4月7日 星期一

Homework 3-24-2008


1. Based on your study of Display 3.8, write a code to find the max and min of a list of number.For example, given 1,3,5, and9, the max is 9 and the min is 1.Your program should be able to process a list of any length.



2. Write a program to generate the series 1, 1, 2, 3, 5, 8, 13, ...The series has a property that the third number is the sum of the first and second numbers. For example, 2=1+1, 3=1+2, and 5=2+3.