Wednesday, September 26, 2007

11. Webspider Extension

My second version here


First addition, I add method morePopular() in my new version Webspider. Before for I did make that part, and this time I inspired the code from "Chiao-Fen" and "Jon Lao" to make both method work.


Second addition, I add logging parameter and import logging from java utility. When insert "-logging" argument in command line, it will switch to log mode, otherwise turn to normal.


There are something I cannot made it is test case, I try to create one but it turn out a lot of exception on eclipse that I have no idea how to fix it.

Monday, September 24, 2007

11. Webspider

11. WebSpider


Here is my file


My opinion about this assignment is difficult, hard, complicated, challenging.......
but I like the algorithm of search web link inside web link. It is a good chance to practice our algorithm since we study ICS 311. I didn't finish about this assignment yet, becasue I took a lot of time to figure out how to avoid infinite loop when reach "home" link. The ANT is very good, it help compile, package and build all in one step, we didn't need compile file by file, but the harder part is setting up ANT.

In the assignment, I only finish task 0 and 1, and I cannot get my most popular page working, also logging, and I didn't implement logging. First, I try to use recursive to loop back and forward to search number of link, but it only work with no "home" direct page inside of each link, so I come up use two for loop to control the page and link that I found.

I hope we can have more time to improve this assignment.

Sunday, September 16, 2007

10. Stack

Download my Stack file here.


Task 1: Installation

Step 1: Download all tools from Standards: QA Tools page and extract all tools to folder named as tools under i.e. c:/tools/**.
Step 2: Follow the instruction to configure ant standards.
Step 3: Copy "tools.jar" file from "C:\Java\jdk1.6.0_02\lib" to "C:\tools\apache-ant-1.7.0\lib".
Step 4: Set Environment Variables:

(Copy and Paste the following lines on command prompt)
set ANT_HOME=c:\tools\apache-ant-1.7.0
set JAVA_HOME=c:\Java\jdk1.6.0_02
set CHECKSTYLE_HOME=c:\tools\checkstyle-4.3
set JUNIT_HOME=c:\tools\junit4.4
set PMD_HOME=c:\tools\pmd-4.0
set FINDBUGS_HOME=c:\tools\findbugs-1.2.1
set SCLC_HOME=c:\tools\sclc-2.5.525
set EMMA_HOME=c:\tools\emma-2.0.5312
set JAVANCSS_HOME=c:\tools\javancss28.49
set PATH=%PATH%;%ANT_HOME%\bin
set PATH=%PATH%;%JAVA_HOME%\bin
set PATH=%PATH%;%CHECKSTYLE_HOME%
set PATH=%PATH%;%JUNIT_HOME%
set PATH=%PATH%;%PMD_HOME%\bin
set PATH=%PATH%;%FINDBUGS_HOME%\bin
set PATH=%PATH%;%SCLC_HOME%
set PATH=%PATH%;%EMMA_HOME%\lib
set PATH=%PATH%;%JAVANCSS_HOME%

Hit Enter.
I follow the above step to setup that I think success to install ant tool.

Task 2: Use Stack as a Template to create a new Project


Step 1: Create new project and named stack-.
Step 2: Download and extract stack-5.0.909.
Step 3: Open eclipse->File->Import->File System->Browse->(look for extract folder from stack-5.0.909)->OK

Task 3: Fix the problems in Stack-so that "verify" passes the build.


What would I do on this part is try invoke those
ant -f checkstyle.build.xml
ant -f dist.build.xml
ant -f findbugs.build.xml
ant -f javadoc.build.xml
ant -f junit.build.xml
ant -f pmd.build.xml
ant -f sclc.build.xml
and look for error report they generate of each invoke, then follow the error to fix violation and bugs.
Finally, I invoke "ant -f verify.build.xml" that will create a folder named build.

Task 4: Add support for the JavaNCSS static analysis tool to your project.


Here is my javancss.build.xml file

Task 5: Improve coverage.


For this task, the emma report show


name
method, %
block, %
line, %
getTop (): Object0% (0/1)
0% (0/3)
0% (0/1)

I took out
public Object getTop() throws EmptyStackException {
return this.top();
}
from ClearStack, and it improve coverage to 100% only of this file.
But I got many error appear on different file, when I took out the above codes.

Wednesday, September 5, 2007

08.CodeRulerRedux

My code ruler file: here


In part one, we only implement the movement of my knigths, follow and capture enemies, these basic function.


My part 1 result is:
Round1 Round2 Round3:
JeffreyLam/Split-up 514/782 586/785 540/591
JeffreyLam/Gang-up 355/101 711/32 480/78
JeffreyLam/Migrate 627/41 458/16 663/50



My part 2 result is:
Round1 Round2 Round3:
Jeffrey-PhuocLe/Split-up 64/846 122/778 99/368
Jeffrey-PhuocLe/Gang-up 472/530 94/540 95/572
Jeffrey-PhuocLe/Migrate 142/13 123/93 199/19



Compare to two result there are no big different on it, but I learned how to organize the code setting, I made some change on knigth movement that control knigth priority. But I didn't change my strategy that no bigger different on my both result.
Actually, there are three components that we need to care in this game programming is controlling our knigth, peasant and castle. Also, I learned more JAVA coding and style on this game.