Вы находитесь на странице: 1из 2

The primary goal of this test is to gauge the depth of your programming and logi c skills.

Please read all these tasks below carefully and then choose at least one task (p referably two, ideally three). TASK A: * Request: 1. Create a PHP script to receive some user inputs using this format: NAME[s pace]AGE[space]CITY For example: CUT MINI 28 BANDA ACEH 2. After the data is submitted, the script parses it to get three data: Name , Age, and City 3. Those data are inserted into a table whose fields are: - ID (auto increment) - NAME - AGE - CITY * Things to consider: 1. The script must be able to handle names and cities using multiple words ( no limit). You have to convert the name and city data into upper case before inserti ng them into the table. 2. As for age data, the script must be able to handle Indonesian user's comm on mistake, which is adding TAHUN, THN, or TH string after the age data. For example: - 28 TAHUN, 28 THN, 28 TH - 28TAHUN, 28THN, 28TH 3. Please make sure the script is able to handle TAHUN, THN, and TH strings case-insensitively. 4. You have to use OOP, instead of simple structured programming. TASK B: * Request: Apache Web Server has an access log file that looks like this: 127.0.0.1 - - [25/Nov/2008:16:56:10 +0700] "GET /phpMyAdmin/themes/or iginal/img/b_export.png HTTP/1.1" 200 313 "http://localhost/phpMyAdmin/phpmyadmi n.css.php?token=094e691a16d64e0d7b8b760ed459f89c&js_frame=right&nocache=36345570 52" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/2008111318 Ubuntu /8.10 (intrepid) Firefox/3.0.4" 127.0.0.1 - - [25/Nov/2008:16:56:10 +0700] "GET /phpMyAdmin/themes/or iginal/img/b_import.png HTTP/1.1" 200 310 "http://localhost/phpMyAdmin/phpmyadmi n.css.php?token=094e691a16d64e0d7b8b760ed459f89c&js_frame=right&nocache=36345570 52" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/2008111318 Ubuntu /8.10 (intrepid) Firefox/3.0.4" 127.0.0.1 - - [25/Nov/2008:16:56:10 +0700] "GET /phpMyAdmin/themes/or iginal/img/s_lang.png HTTP/1.1" 200 422 "http://localhost/phpMyAdmin/phpmyadmin. css.php?token=094e691a16d64e0d7b8b760ed459f89c&js_frame=right&nocache=3634557052 " "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/2008111318 Ubuntu/8 .10 (intrepid) Firefox/3.0.4" 127.0.0.1 - - [25/Nov/2008:16:56:10 +0700] "GET /phpMyAdmin/themes/or iginal/img/s_theme.png HTTP/1.1" 200 737 "http://localhost/phpMyAdmin/phpmyadmin .css.php?token=094e691a16d64e0d7b8b760ed459f89c&js_frame=right&nocache=363455705 2" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/2008111318 Ubuntu/ 8.10 (intrepid) Firefox/3.0.4" Please create a PHP script (using OOP) to parse the log file and count th e number of path occurences each day. So the above sample will output: 2008-11-25 /phpMyAdmin/themes/original/img/b_export.png 1 2008-11-25 /phpMyAdmin/themes/original/img/b_import.png 1 2008-11-25 /phpMyAdmin/themes/original/img/s_lang.png 1

2008-11-25 /phpMyAdmin/themes/original/img/s_themes.png 1 TASK C: * Request: 1. Create a Java Application to fetch http://www.w3.org/ index page and save it to a file. 2. Modify the application so that it will "continuously" fetch www.w3.or g each minute and save it to a file like: index-YMDHM.html (YMD = year,month,day, HM = hour,min) 3. Modify the application so that when it stops (user send CTRL+C), it p rints the number of times it fetches www.w3.org. The result must be packaged in a single zip file containing: 1. SQL Dump file of the table 2. The complete source code of your PHP Script/Java Application 3. A brief manual (in English)