Technical Article

April 9, 2008

The development of World Wide Web has passed through 2 phases. The traditional WWW is known as Web 1.0 or Read-or-Write Web because, at that moment, only webmaster or author could manage the web contents and static web pages were written by HTML and GIF only.

 

However, a fast growing technology makes web sites change in nature/characteristics, design and infrastructure. Now, Web 2.0 sites are not limited for user to retrieve information. They can produce dynamic contents and promote the interactivity by using different scripts, extension or plug-in, like ActiveX, Javascript, CSS (Cascading Style Sheets), PHP (Hypertext Preprocessor) and etc. Furthermore, with AJAX (Asynchronous Javascript and XML), XML, REST (Representational State Transfer), Web 2.0 site become rich user experience, user participation, web standards and providing web services or other API (Application Programming Interface). Therefore, at Web 2.0, it is encouraging both authors and readers make contribution to web spaces and contents.

On the other hand, Web 2.0 also affects the web site design. In designing Web 2,0 site, designers have to refresh their mindset on the following points:

1.      Writing to semantic markup

2.      Remixing content

3.      Web shifting to services

Probably, a Web 2.0 site designer is also as a programmer.

For network infrastructure, now, Web 2.0 is changing network environment from client / server to P2P (Peer-to-Peer) and deployment from centralized to decentralized. These happen because, at Web 2.0, the concept of client / server is weak. Nowadays, all client machines are acting as server role since users / readers will publish the content or hold the information in their client machines.

Non-technical Article

April 9, 2008

World Wide Web is ubiquitous for over 10 years. Since 1993 the first graphical browser emerged, the evolution process of web technology is ongoing and the changing rate is developed at a high speed.

 

In the initial implementation of World Wide Web, web site was a repository of information and static content. Web content or hyperlinks were assigned by webmaster while web reader could view the web page only. Web reader could not delivery any comment or feedback. Therefore, it was known as Read-or-Write web or Web 1.0.

 

Due to fast growing in hardware capacity, such as CPU and RAM, as well as Internet connection, web sites are moving to the age of higher interactive in which web users will have more involvement. At the moment, many new web applications come out, like wiki, blog and RSS. These allow web users to manipulate and control over the data on website. Gradually, these new web applications such as Facebook are becoming an invisible part of people’s daily life. In general, these web sites are known as Read/Write web or Web 2.0.  

 

In near future, many technologist and industrial experts are foreseeing Web 3.0 being the next stage in web evolution. Up to this moment, there is no general agreed definition of Web 3.0. However, many people believe that the characteristics of Web 3.0 are far beyond Web 2.0. For example, it will be embedded with Artificial Intelligence element, enhanced searching engine, supporting 3D and so on.

Workshop 4

April 9, 2008

Step 5

I put the files, as_you.txt, as_you_SAX_parser.py, XML_pullDOM_parser.py and play.dtd, at the same folder. Then I execute as_you_SAX_parser.py by IDLE and the output it displayed the dialogue of each actor in pre-assigned order while DOM just displayed one script only.

 

SAX’s Result:

ROSALIND

That he hath not.

 

CELIA

No, hath not? Rosalind lacks then the love

Which teacheth thee that thou and I am one:

Shall we be sunder’d? shall we part, sweet girl?

No: let my father seek another heir.

Therefore devise with me how we may fly,

Whither to go and what to bear with us;

And do not seek to take your change upon you,

To bear your griefs yourself and leave me out;

For, by this heaven, now at our sorrows pale,

Say what thou canst, I’ll go along with thee.

 

ROSALIND

Why, whither shall we go?

 

CELIA

To seek my uncle in the forest of Arden.

When I ran XML_pullDOM_parser.py, the output is:

 

DOM’s Result:

 

Which is he that killed the deer?

 

 

 

Step 6.

I can find miniDOM and pullDOM only.

              

Step 10.

Both entrance and exit are in red.

 

Step 12

Nodes, like Title, Stagedir, are needed to generate actor tools as well as node, line, is for actors’ script.

 

           Step 13

We can do client side XSLT styling because client-side XSLT processing has been available in IE s.

 

Step 15

Both as_you.xml and two_gent.xml have the similar tree structure. Therefore, I add the line, <?xml-stylesheet href=”play.xsl” type=”text/xsl”?> in the beginning of two_gent.xml. It produced the output as follows:

 

 

Workshop 3

April 9, 2008

For internal DTD XML

I created an internal DTD XML file, airportsDTD.xml, as follows:

And I executed the file in IE with positive result.

 

 

<?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>

<!DOCTYPE airports [

<!ELEMENT airports (airport+)>

<!ELEMENT airport (name, city, alt, lat, long, runway+) >

<!ATTLIST airport code CDATA #REQUIRED>

<!ELEMENT name (#PCDATA) >

<!ELEMENT city (#PCDATA) >

<!ELEMENT alt (#PCDATA) >

<!ELEMENT lat (#PCDATA) >

<!ELEMENT long (#PCDATA) >

<!ELEMENT runway (heading, length, width?) >

<!ATTLIST runway number (en1|en2|..) #REQUIRED>

<!ELEMENT heading (#PCDATA) >

<!ELEMENT length (#PCDATA) >

<!ELEMENT width (#PCDATA) >

]>

 

<airports>

 <airport code=”AKL”>

           <city>Auckland</city>

          <name>Auckland International</name>

          <runway number=”en1″> 

                     <heading>05/23</heading>

                     <length>3,635m</length>

           </runway>

          

 </airport>

 <airport code=”BKK”>

           <city>Bangkok</city>

          <name>Don Muang International</name>

          <runway number=”en1″>

                     <heading>03L/21R</heading>

                     <length>3,700m</length>

           </runway>

          <runway number=”en2″>

                     <heading>03R/21L</heading>

                     <length>3,500m</length>

           </runway>

 

 </airport>

 <airport code =”BOM”>

           <city>Mumbai</city>

          <name>Chhatarpati Shivaji</name>

          <runway number =”en1″>

                     <heading>09/27</heading>

                     <length>3,489m</length>

           </runway>

          <runway number =”en2″>

                     <heading>14/32</heading>

                     <length>2,925m</length>

           </runway>

 

 </airport>

</airports>

 

 

 

For external DTD XML

As per instruction, I created 2 files, airport.dtd and airport.xml, with the coding as below. Then I saved them at the same directory as airport.py. Then I executed airport.py by IDLE with positive result.

 

Code of airport.dtd

 

<!ELEMENT airport (name, city, alt, lat, long, runway+) >

 

<!ATTLIST airport code CDATA #REQUIRED>

 

<!ELEMENT name (#PCDATA) >

 

<!ELEMENT city (#PCDATA) >

 

<!ELEMENT alt (#PCDATA) >

 

<!ELEMENT lat (#PCDATA) >

 

<!ELEMENT long (#PCDATA) >

 

<!ELEMENT runway (heading, length, width?) >

 

<!ATTLIST runway number (en1|en2|..) #IMPLIED >

 

<!ELEMENT heading (#PCDATA) >

 

<!ELEMENT length (#PCDATA) >

 

<!ELEMENT width (#PCDATA) >

 

Code of airport.xml

<?xml version=”1.0″ encoding=”iso-8859-1″ standalone=”no” ?>

<!DOCTYPE airports SYSTEM “airport.dtd”>

 

<airports>

<airport code=”AKL”>

   <city>Auckland</city>

   <name>Auckland International</name>

   <alt>10</alt>

   <lat>37 0’6″S</lat>

   <long>174?7?9″E</long>

   <runway number=”1″>

      <heading>05/23</heading>

      <length>3635</length>

      <width>…</width>

   </runway>

</airport>

 

<airport code=”BKK”>

   <city>Bangkok</city>

   <name>Don Muang International</name>

   <alt>3</alt>

   <lat>13 4’2″N</lat>

   <long>100 6’0″E</long>

   <runway number=”1″>

      <heading>03L/21R</heading>

      <length>3700</length>

      <width>…</width>

   </runway>

   <runway number=”2″>

      <heading>03R/21L</heading>

      <length>3500</length>

      <width>…</width>

   </runway>

</airport>

 

<airport code=”HKG”>

   <city>Hong Kong</city>

   <name>Hong Kong</name>

   <alt>6</alt>

   <lat>22 18’32″N</lat>

   <long>113 54’53″E</long>

   <runway number=”1″>

      <heading>07/25</heading>

      <length>3800</length>

      <width>…</width>

   </runway>

   <runway number=”2″>

      <heading>07/25</heading>

      <length>3800</length>

      <width>…</width>

   </runway>

</airport>

</airports>

 

 

 

Result:

 

   Auckland

   Auckland International

   10

   37 0’6″S

   174?7?9″E

  

      05/23

      3635

     

  

 

 

 

   Bangkok

   Don Muang International

   3

   13 4’2″N

   100 6’0″E

  

      03L/21R

      3700

     

  

  

      03R/21L

      3500

     

  

 

 

 

   Hong Kong

   Hong Kong

   6

   22 18’32″N

   113 54’53″E

  

      07/25

      3800

     

  

  

      07/25

      3800

     

 

 

Workshop 2

April 9, 2008

Workshop 2

Firstly, I created file, WML_create_miniDOM.py, as per instruction. Then executed the file by using IDLE but returned syntax error.

Then we changed the “From” to “from” in the document and run again with positive result as follows:

 

<?xml version=”1.0” ?>

<wml>

  <card id=”main”>

    <p>

      XML for e-business!

    </p>

  </card>

</wml>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

I created the file, native_plants.xml, as per instruction. Then, I modified the poetry.py as follows and save as native_plants_SAXparser.py. Lastly, I executed the file, native_plants_SAXparser.py, by IDLE and returned the result as below.

 

Code of “native_plants_SAXparser.py”

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#!/usr/local/bin/python

 

# Defining my specialized handler classes

from xml.sax.handler import ContentHandler

 

import xml.sax, sys

 

class textHandler(ContentHandler):

 

           def characters(self, ch):

 

                     sys.stdout.write(ch)

 

# Creating an XML parser

parser = xml.sax.make_parser()

 

# Creating an instance of the handler classes

handler = textHandler()

 

# Telling the parser to use your handler instance

parser.setContentHandler(handler)

 

# Parsing the file; my handler’s method will get called

parser.parse(“native_plants.xml”)

 

Result:

 

Nepenthes burbidgeae

 

Nusa rubinea

 

Drosera spatulata

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Workshop 1

April 9, 2008

Firstly, I created 2 files, poetry.xml and poetry.py, per instruction. Then I uploaded them to csusap.csu.edu.au with my userid, kng69. Afterward, I executed the command: python poetry.py but returned the indentation error.

Then, it placed the indents to appropriate lines and run it again with success.

The output was:

 

Athol Aardvark went walking

 

Angelina Armadillo saw him in the distance

 

 

Exercise 11

April 9, 2008

1.      Altova xmlspy can be used to parse an XML document and ensure the document is well formed and valid.

2.      Test

3.      SMIL aims at simplifying authoring of interactive audiovisual presentations. As usual, it applies in “rich media”/ multimedia presentations which embed with streaming audio and video with images, text or other media type.

Exercise 10

April 9, 2008

1.      Here below are some application servers in competition with ZOPE:

JBoss, Enhydra, Websphere, Weblogic, Oracle OC4J, .NET Framework

 

From the text, three application servers have been mentioned like ZOPE, JBoss, Enhydra and IBM’s Websphere. Below table is a simple comparison among them.

 

Application Server

Latest version

Released date

ZOPE

3.3.1

14 Jan 2007

JBoss

5.0.0. Beta4

10 Feb 2008

Enhydra

7.2-1

25 Oct 2007

IBM Websphere

6.1.1.6

29 Mar 2008

 

Often, the release cycle of Internet software is shorter than business software.

2.      Among IBM, Oracle, Microsoft and Sybase, they have different solutions for e-commerce but IBM, Microsoft and Sybase are focusing on middleware. For example, IBM is selling IBM Websphere 6.0. Only Oracle has mentioned her e-commerce solution with associated database product, Oracle 10g. Compared to other four giants, MySQL is more aggressive and active to develop their database product for the e-commerce environment.

3.      Nowadays, integration will become a critical factor because much data need to be exchanged across different systems, like accounting system and payroll system, for various purposes such as system automation or realtime tracing. With the result that many external interfacings are needed. This will create a lot of software customizations, software re-engineering or security risks.

ERP systems aims at integrating different data sources and processes of organization into single system. The role of ERP within enterprise software architecture is the foundation. Based on needs from different enterprises or industries, they are capable of plugging various function modules into the ERP.

4.      Among Javascript, VBScript and DTML, all of them are scripting languages and can be embedded in HTML. In addition, they provide dynamic \ interactive HTML content.

5.      ASP, JSP and PHP have the following similarities:

                            i.                They are embedded n HTML.

                           ii.                They can provide dynamic web content.

                          iii.                They are scripting language.

They have the following differences:

i.                    ASP can support Microsoft OS only while the others can support multi-platform.

ii.                  ASP tied to MS IIS while the others can run in any web server.

iii.                JSP and PHP are open source while ASP is not.

iv.                ASP and PHP are server-side scripting while JSP is client-side scripting.

v.                  JSP and PHP support OOP while ASP doesn’t.

Exercise 9

April 9, 2008

1.      Code of the form is:

<form ACTION=”process.pl” METHOD=POST>

<table>

           <tr>

                     <td>Name:</td>

                     <td>

                     <input type=”text” name=”name” value=”Evan Burke”>

                     </td>

           </tr>

<br>

<br>

           <tr>

                     <td>Credit Card:</td>     

               <td>

                     <input type=”radio” name=”card” value=”Visa” checked> Visa

                     <input type=”radio” name=”card” value=”Master”>Master

                     </td>

           </tr>

<br>

<br>

           <tr>

           <td>Card Number:</td>

           <td>

           <input type=”text” name=”number” value=”8443261344895544″>

           </td>

           </tr>

<br>

<br>

           <tr>

                     <td>Order:</td>

                     <td>

                     <input type=”text” name=”order” value=”French perfume”>                   

                     </td>

           </tr>

<br>

<br>

</table>

<input type=”submit” value=”Submit”>

</form>

 

        Screen of the form is:

       

 

2.      Searched from Internet, the typical perl script for processing html form involved the following steps:

                            i.               Use CGI modules to read data passed from a form.

          e.g.         use CGI qw (:cgi-lib :standard);

                          ii.                Use function to grab the data passed from the form

                                   and puts it into an array.

          e.g.  &ReadParse(%in);

                        iii.                Get the value from the form and assign to variable.

          e.g.  $name = $in{“name”};

                        iv.                Print HTML document

           e.g.  print<<EOSTUFF;

 

3.      The script was modified as below to process the form above.

  #!/usr/bin/perl

 

  # Program Name: process.pl

  # Author: Kwok Keung NG

  # This program uses the data passed by the form program and creates

  # a new web page with that information. 

 

  use CGI qw(:cgi-lib :standard);  # Use CGI modules that let people read data passed from a form

 

 

  &ReadParse(%in);                 # This grabs the data passed by the form and puts it in an array

 

  $name = $in{“name”};             # Get the user’s name and assign to variable

  $card = $in{“card”};               # Get the credit card type and assign to variable

  $cnumber = $in{“number”};        # Get the credit card’s number and assign to variable

  $order = $in{“order”};             # Get the order information and assign to variable

 

  print<<EOSTUFF;                             # Start printing HTML document

Exercise 8

April 9, 2008

1.      Firstly, I created the database, exercise8, and table, employees, by following command:

mysql> create database exercise8;

      mysql>use database exercise8;

mysql>create table employees (id INT NOT NULL auto-increment, first varchar(30) not null, last varchar(30), address varchar(60), position varchar(30), primary key (id)); 

       

After input “mysql> select * from employees;”, the output was:

        “Empty set”

 

2.      Secondly, I created the exercise8-2.php as:

<?php

             $db = mysql_connect(“localhost”, “root”, “f22larry”);

             mysql_select_db (“exercise8″, $db);

             $result = mysql_query (“select * from employees”, $db);

             echo “First Name: “, mysql_result ($result, 0, “first”), “<br>”;

             echo “Last Name: “, mysql_result ($result, 0, “last”), “<br>”;

             echo “Address: “, mysql_result ($result, 0, “address”), “<br>”;

             echo “Position: “, mysql_result ($result, 0, “position”), “<br>”;

   ?>

 

3.      Thirdly, I created “add_record.html” according to the instructions provided.

When I connected to http://192.168.1.16/add_record.html, the output was:

 

 

 

4.      Then I created add_record.php as follows:

  <?php

             $db = mysql_connect(“localhost”, “root”, “f22larry”);

             mysql_select_db (“exercise8″, $db);

             $result = mysql_query (“insert into employees (first, last, address, position) values (‘$first’, ‘$last’,

‘$address’, ‘$position’)”);

             if ($result ==1 ) {echo “Thank you! Your information has been entered”;

                        } else {

                        echo “Sorry, there’s a problem”;}

   ?>

 

When I input the information to http://192.168.1.16/add_record.html and pressed “Enter information” button as follows:

 

 

 

Then, it would return the result as follows:

 

 

 

5.      Lastly, I created “show_mulitple.php” as follows:

  <?php

             $db = mysql_connect(“localhost”, “root”, “f22larry”);

             mysql_select_db (“exercise8″, $db);

             $result = mysql_query (“select * from employees”, $db);

             echo “<table border=1>\n”;

             echo “<tr><td><b>Name</b></td><td><b>Position</b></td></tr>\n”;

             while ($myrow = mysql_fetch_row($result)) {

                        echo “<tr><td>”, $myrow[2], “, “, $myrow[1], “</td><td>”, $myrow[3], “</td><tr>”;

                        }

             echo “</table><br>”;

   ?>

 

Then I input one more record in http://192.168.1.16/add_record.html and I connected to http://192.168.1.16/show_multiple.php. The output was:

 

 


Follow

Get every new post delivered to your Inbox.