2009年1月13日 星期二

我有話要說

如果你覺得這學期Java 功課表現尚不滿意,你可以在部落格上自由發揮,用你覺得比較好的方式告訴別人,其實我已經學好 Java 。期末評分時,我會閱讀你所書寫。

老實說,在上老師課之前我曾經猶豫了一陣子,因為我對寫程式語言完全沒有任何的基礎,只有在大一上計概的時候,勉強接觸了一些,但回想起來,也幾乎沒有學到什麼,我覺得可能是因為我太笨,嚴老師交的太難以至於我這呆腦袋沒辦法吸收。我想了又想,最後還是決定修一下老師的課,因為我覺得既然是電子系,沒有理由不碰到程式這一塊的東西,畢竟在這競爭激厲的時代當中,電子系所涵蓋的範圍越來越廣,現實社會當中一些公司也都需要會寫程式語言的工程師,如果連基本的程式都不會寫的話!那不就跟高中畢業一樣,所以我才硬著頭皮修了老師的課,當然這期間也參雜了一些學長姐或同學們的建議。一開始上的時候,還算適應的OK,因為還再學一些JAVA的基本知識與架設部落格,隨著時間慢慢的加深,我覺得上老師的最大的優點是老師講的東西顯淺易懂,老師能把看似複雜的程式,透過一些生活的例子表達出來,並且舉一下實際的例子,讓我們這些初學JAVA的小毛頭能更快的進入狀況,老師也會分享一些過去的勵志故事給我們聽,跟我們說一些未來社會可能的走向,比如說我們已經WEB2.0的時代,未來的發展等等之類的。上老師的課,說有趣也不是,枯燥也不是,大概在兩者之間吧!因為老師有時候上課很有趣,但又有時候覺得很無聊,我不否認我有幾堂課曾經夢見周公過!這學期的JAVA給我最大收穫就是讓我對JAVA有一些概念,可能還是寫不出很厲害的程式,但一些基本的程式至少我都懂,還有部落格的架設,都讓我獲益良多,也感謝老師對我們這些不懂程式的小毛頭的耐心,交我們應該很辛苦吧!

學生9526157 電子三甲 盧志展

2008年12月29日 星期一

Lab Web Stress Test

1. Download Stress Test
2. Take a look at the user manual.
3. Test a static page.
Try combinations of stress levels and stress multipliers to simulate 10 users and 100 users.
4. Test a dynamic page.
Try combinations of stress levels and stress multipliers to simulate 10 users and 100 users.
5. Compare the response time of both pages and explain why.


Lab Site Traffic Metrics

1. Enter Sitemeter.
2. Put a Sitemeter in your own blog.
2. Check the site meter to see the daily traffic chart, the recent visitors by locations.

Lab: Packet Sniffer

1. Install Protocol Analyzer Ethereal at http://www.wireshark.org/
2. Capture the packets at your Ethernet interface card.
3. Enter a login required website that you often go to, such as web mail. Don't use the real account or password.
4. Try to catch the packet that contains the password.


2008年12月22日 星期一

Lab: Drap and Drop

1. Go to Laszlo and enter (Laszlo in 10 minutes).
2. Study and play around the "drag-and-drop" example.
3. Use this method to control movie playing as in the previous lab.
4. If you drag and drop the photo to the "play" area, the movie plays.
5. If you drap and drop the photo to the "pause" area, the movie pauses.


Lab: Movie Player

1. Go to Laszlo and enter (Laszlo in 10 minutes).
2. Study and play around the "scripting" and "video" examples.

3. Use this script to control movie playing.

4. If you push the "pause" button, the movie pauses.

5. If you push the "resume" button, the movie resumes.








Lab Hanoi Tower

The pseudocode for Hanoi Tower is as follows:

solve(N, Src, Aux, Dst)
if N is 0 return
solve(N-1, Src, Dst, Aux)
Move N from Src to Dst
solve(N-1, Aux, Src, Dst)


Write the Java program based on the pseudocode in the above.



Lab Recursive Method

Write a recursive method to compute Fibonacci series.

Hint:

1.
fib(n)=fib(n-1)+fib(n-2)

2.
public static long fib(int n)


Lab Factorial

Write a Java program that computes N! where N is a positive integer.

Hint:

public static long factorial(int n)




2008年12月15日 星期一

Lab DOM

[Lab]
1. Open NVu
2. Based on the code as in http://www.scottandrew.com/weblog/articles/dom_4 ,
write a code to generate the table of 9*9 products. (九九乘法表)

Hint: The javascript code should be enclosed by script tags.


Lab Create Image using DOM

1. Open Nvu
2. Hand code a javascript that loads an image from Internet based on
the DOM model.
3. Take a look at the sample code that shows how window.onload to load the image.
4. Use a button to load the image. Try how onclick works.






2008年12月1日 星期一

Lab XML (2)

1. Register and Download Xray, an XML, XSLT editor and processor.

2. Given the
Listing 1. An XML document representing the results of a soccer tournament

Listing 2. A basic style sheet for the soccer results

use the XSLT as in the Listing 2 to transform the XML file as in the Listing 1.
(archive)

3. View the formatted HTML file.
4. Given the
Listing 1. An XML document representing the results of a soccer tournament
Listing 3. A style sheet that computes team standings


compute the team standings in a table.

5. View the formatted HTML file.





Lab XML

1. Register and Download Xray, an XML, XSLT editor and processor.

2. Given the the XML file and XSLT file ,
use Xray to do the transformation of the XML into HTML.
You have to replace [ with <.

3. View the formatted HTML file.


Homework 11-24-2008

1. Lab: Form and Action, Part II
2. 在CGI語法裡,解釋 GET, POST 差異在哪裡?

answer:
1.LAB

2.再CGI程式中,GET與POST最大的差別就是接收資料方式的不同。GET是使用環境變數QUERY_STRING來傳遞資料;而POST則是使用STDIN(標準輸入)來取得資料 。

2008年11月28日 星期五

Lab Overloading

Do Display 4.11


Lab ADT

Define a Complex class and write an object oriented program to compute (2+3i)+(4+5i) in Java.
The methods should include an access and a mutator.






2008年11月24日 星期一

Lab: 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 like http://maps.google.com/maps?q=24.9586,+121.24114 Use Form CGI that includes action, input, and submit. Try a few different coordinates.













Lab Checking dead links

W3C Link Check 可以檢查 dead links, 而且只要輸入首頁, 就可以依據指定深度自動向下檢查, 而且也可以檢查對外連結(外站). Link Checker 首先要設定檢查深度(Check linked documents recursively, recursion depth=?), 如果沒有設定, 它就只有檢查首頁. 因此如果出現 deadlink, 就是在首頁. 如果你設定檢查深度, 它就會逐一檢查此深度內的每一頁, 在檢查某一頁開始時, 它會先顯示現正在檢查的 URL, 然後 在逐一爬行該頁內每個 link. 報表輸出很漂亮. 請參閱 http://validator.w3.org/checklink 請檢查三個你最常使用的網站, 看看連結的品質如何? 紀錄有錯誤連結 (HTTP Error 404) 的次數.












Lab: 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. Save your file on your computer. 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 11-17-2008

1. Lab Making web pages accessible
2. What is Web 2.0?
3. What is mashup?

answer
1.很抱歉,我不會> <

2.
Web 2.0,他是一個新生的術語,大致上跟Web1.0的基本功能一樣,唯一改變的是他是可以透過分享,讓更多
人享受這些資源,這可說是網路的一大創舉。

3.所謂的mashup,就是混搭。整合網路上的一些資源,結合成一個新的服務,例如一個網站,可以由很多的網址或圖片穿插而成。