28 Mar 2009

To Do List....

Workshop 1 - Setting up the model railway...

To Do:
  1. Download iTunes from http://www.apple.com/itunes/download/ and subscribe to the “Leraning Rails” Podcasts from http://www.buildingwebapps.com/podcasts
  2. Install Ruby on Rails on your computer by using the material and downloads from http://www.rubyonrails.org/
  3. Rather than get Ruby on Rails running manually, you use the pre-packaged solutions. These include everything in one bundle: Web server, database, Ruby, Rails, the works. (a) For OS X, there's Locomotive. (b) For Windows, there's Instant Rails.
Answer:

1. I have listened to the web courses from url - http://www.buildingwebapps.com/podcasts.

2. I have then downloaded the InatantRails2.0 and installed into my PC.

3. I am using Instant Rails 2.0 as development platform for my taxi booking system.

The following diagram-28 shows my successful installation of R0R...

Diagram-28 - The Successful Installation of InstantRails in my home-PC


Diagram-29 - Tables (Passenger_origin & Passenger_destination) are created in MySQL



26 Mar 2009

Q2. Write the script ... and Q3. Can you modufy ...

Q2. Write the script -
Script archives exist for PERL, Python and JavaScript. Search the Web for a script that processes the HTML forms data. Read the code and list the steps involved in processing the form.

Q3. Can you modify the script to process the form?

Answer:


In these 2 questions, I use xampp instant packages and xampp's python plug-in to develop the perl and python script. For JavaScript (ajax), I use Jaxer to develop the script.

PERL script to handle the data from the form in try.html is shown as follow...

Diagram-20 - The PERL script to handle the form's data

After clicking the "Buy!" button, the perl_order.cgi perl script will be run and the output of the perl_order.cgi to handle the form's data is shown in Diagram-21.

Diagram-21 - the output of the perl_order.cgi after clicking the "buy!" button

The explanation of this perl_order.cgi is stated below step by step...
  1. #!"G:\xampp\xampp\perl\bin\perl.exe" - Firstly, we states the location of Perl. "#!" means notation invoke interpreters.
  2. $query_string=$ENV{'QUERY_STRING'}; - in the try.html, get method is used to submit the form data. This statement put the get statement string into $query_string variable, for example, the get statement string in URL is like ?fullname=Joseph+Cheung&fulladdress=Room+100&2C.... etc
  3. @pairs=split(/&/, $query_string); - take the & away from the $query_string
  4. foreach $pair (@pairs)
    {
    ($key, $content)=split(/=/, $pair);
    $content=~tr/+/ /;
    $content=~s/%(..)/pack("c", hex($1))/ge;
    $fields{$key}=$content;
    } - foreach and its statements inside {} are used to divide the $query_string into pieces. Each piece is put in field variable.
  5. $name=$fields{'fullname'};
    $address=$fields{'fulladdress'};
    $email=$fields{'fullemail'};
    $discount=$fields{'fulldiscount'};
    $visa=$fields{'fullvisa'};
    $perfume=$fields{'fullperfume'};
    my $receipt=2009030000;
    my $range=1000;
    $total=0; - initialize the variables and put the field variable into local user-friendly variable.
  6. $perfume=int($perfume);
    $discount=int($discount); - convert strings into integers.
  7. $total=$perfume*(100-$discount)/100;
    $receipt=$receipt+int(rand($range)); - compute the total charge of the transaction and generate the receipt number.
  8. print "Content=type:.... - all print statements are used to output and show the transaction has been completed.
Can you modify the script to process the form? Yes, I can modify the script. Actually, I learn PERL from www.comp.leeds.ac.uk/Perl/start.html by myself and then I develop the perl_order.cgi directly.


Python script to handle the data from the form in try2.html is shown as follow... This time, we use post method and the form action is "/cgi-bin/python.cgi".


Diagram-22 - the source code of python.cgi which handle the post data from the form in try2.html

The output screen of python.cgi is shown in Diagram-23. After clicking the "Buy!" button in try2.html, the python.cgi python script will be run and the output is then obtained.


Diagram-23 - The output after handling the post data from the form


The explanation of the python.cgi python script is listed as below...
  1. #!G:\xampp\xampp\python\python.exe - is used to locate the interpreter python.exe location
  2. import os, sys, cgi, cgitb, random; cgitb.enable() - import python library
  3. form=cgi.FieldStorage()
    name=form.getvalue('fullname')
    address=form.getvalue('fulladdress')
    email=form.getvalue('fullemail')
    discount=form.getvalue('fulldiscount')
    perfume=form.getvalue('fullperfume')
    visa=form.getvalue('fullvisa') - handling the post data from the form
  4. receipt=2009030000 - create receipt number
  5. startrange=0
    stoprange=1000
    total=0
    statement=''
    finalstatmt='' - variables declaration
  6. perfume=int(perfume)
    discount=int(discount) - convert strings to integers
  7. total=perfume*(100-discount)/100
    receipt=receipt+random.randint(startrange, stoprange) - calculate the total charge after discount and generate the receipt number
  8. if (perfume==1000):
    statement='You have bought Odors Perfume with Discount '
    if (perfume==5000):
    statement='You have bought Worthless Perfume with Discount '
    if (perfume==10000):
    statement='You have bought Very Good Perfume with Discount '
    if (discount==0):
    statement=statement+'0% Off '
    if (discount==50):
    statement=statement+'50% Off '
    if (discount==80):
    statement=statement+'80% Off ' - make the statement to show what you have bought and the discount you have
  9. finalstatmt & print statements are used to display the output in the browser
Can you modify the script to process the form? Yes, I can modify the script. In fact, I learn Python from http://www.freebsd.org.hk/html/python/tut_tw/tut.html by myself and then I develop the python.cgi directly.


JavaScript script to handle the data from the form in try5.html is shown as follow... This time, we do not use post or get method and the form is handled by formHandle.js JavaScript script.


Diagram-24 - Ajax - The French Perfume Purchase Form

When you enter your information in the form in the Diagarm-24. The information you have just entered are displayed instantly in the bottom of the try5.html. After filling all information and then clicking "Pay" button, your Receipt will be generated. The word "Receipt" will be shown in the bottom in the try5.html but on the top of the personal information. Beside that, the total amount you need to pay will be calculated and also be shown in the bottom of the try5.html but under your personal information. The try5.html involves 2 JavaScript scripts. They are ajax.js and formHandle.Js. The following diagrams show them and I will explain for these 2 scripts too.


Diagram-25 - Ajax.js is download from www.w3schools.com and is used to detect the brower's version & manufacturer

Ajax.js will detect the brower's version & manuacturer. If the brower is Internet Explorer (IE), then Ajax.js will create a actionXObject. If the brower is others, like firefox or Netscape, Ajax.js will generate a XMLHttprequest. Javascipt itself is seldom used to manipulate form's data. However, JavaScript together with other technologies, like xml forms AJAX - Asynchronous JavaScript and XML which can create more interactive webpages and handle form's data.

Diagram-26 - fromHandle.js

Diagram-27 - try5.html

When you interact with the try5.html, for example, onkeyup or onclick by keyboard or mouse respectively, formHandle.js will then get the form's data value by getElementByID().value in formHandle.js. After that, formHandle.js use the values to generate the html output strings printed in the Receipt and to compute the total payable amount after the "Pay" button is clicked. The variables - finalperfume and finaldiscount are used to store the perfume and the discount rate you finally select.

Can you modify the script to process the form? Yes, the formHandle.js, try5.html is developed by me. I learn JavaScript in w3schools.com.

Q1. Design the form...

Exercise 9: Web form design and processing: A basis for e-commerce interaction

Q1. Design the form -
"Retrofit" the form data string above for buying some French perfume into the HTML form fields and submit button on the Web page form.

Answer:

I have designed the form and please see the html code as follow:


Diagram-18 - HTML code for the French perfume ordering system


The screen dump of these HTML code is shown in Diagram-19



Diagram-19 - screen dump of French perfume ordering system





24 Mar 2009

Q3. What are the similarities between the object-oriented development using model-view-controller (MVC) ...

Q3. What are the similarities between the object-oriented development using model-view-controller (MVC) in Ruby on Rails 2.0 and Action Script 2.0 (Flash Animations)?

Answer:

Whatis.com (2008) defines that the concepts and rules used in object-oriented programming provide these important benefits:
  • The concept of a data class makes it possible to define subclasses of data objects that share some or all of the main class characteristics. Called inheritance, this property of OOP forces a more thorough data analysis, reduces development time, and ensures more accurate coding.
  • Since a class defines only the data it needs to be concerned with, when an instance of that class (an object) is run, the code will not be able to accidentally access other program data. This characteristic of data hiding provides greater system security and avoids unintended data corruption.
  • The definition of a class is reuseable not only by the program for which it is initially created but also by other object-oriented programs (and, for this reason, can be more easily distributed for use in networks).
  • The concept of data classes allows a programmer to create any new data type that is not already defined in the language itself.

Ruby on Rails 2.0 and Flash Animation Action Script 2.0 are both Object-Oriented Programming. Both can create classes, objects, new data types, inheritance, data hiding, reusability... Poe (2007) describes MVC that
Model - Business logic goes here
View - Presentation logic goes here
Controller - Application logic goes here
MVC is very similar with ActionScript in Animated Flash, that is, the classes in ActionScript, like, musics, sounds & graphics is similar with Model in ROR. It is the backend.
The animated objects is designed to present the action scripts. It seems like View in ROR.
The timeline in the action scripts is used to control the objects so It seems as Controller in ROR.

Reference:

1. Whatis.com (2008). "What is object-oriented programming?". Whatis.com, Retrieved Mar-17th-2009 from URL - http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci212681,00.html
2. Poe Curtis (2007). "What is MVC?". O'Reilly ONLamp Blog, Retrievd Mar-17th-2009 from URL - http://www.oreillynet.com/onlamp/blog/2007/06/what_is_mvc.html


23 Mar 2009

Q2. Why is the perception getting stronger that integration will become a critical factor in coming days?...

Q2. Why is the perception getting stronger that integration will become a critical factor in coming days? What is the role of AJAX within the enterprise software architecture?

Answer:


Integration means System integration is the bringing together of the component subsystems into one system and ensuring that the subsystems function together as a system. Or Digital integration is the idea that data or information on any given electronic device can be read or manipulated by another device using a standard format. Or Enterprise Application Integration (EAI) is defined as the use of software and computer systems architectural principles to integrate a set of enterprise computer applications. (Wikipedia, 2009)

Anyway, in my opinion, Integration is that small systems can form a large system so information within small systems can be shared or exchanged.

Integration becomes a critical factor since Integration can...
  • Provides users with the ability to manipulate legacy data.
  • Provides users with the ability to take advantage of familiar software to use known assets and resources.
  • Provides users with the ability to acquire and easily maintain new data.
  • Provides users with the ability to use existing data management tools to access data wherever it is located. (IBM.com, 2009)
And Integrated data provides a framework that helps organizations:
  • Deliver a complete view of a customer
  • Offload the processing burden on operational systems
  • Standardize business processes and data definitions
  • Combine current and past values from disparate sources in order to see the big picture (BusinessObjects.com, 2009)
The role of AJAX within the enterprise software architecture is that
  • Development times and costs are slashed dramatically, as companies take advantage of the re-usability of services as well as the ability to avoid the problems inherent in thick client deployments.
  • The ability to use the same interface technology regardless of user location or platform. Since AJAX is platform agnostic, it works regardless of what the user is on, be it Windows, Linux or the Mac. This makes deployment much simpler, as well as guaranteeing that the entire user population has access to the same rich interactive services.
  • Companies implementing AJAX in an service-oriented architecture framework can finally use the full interactive capabilities of services without having to deal with the constraints of Web browsers. AJAX RIAs provide Web-based applications that function as well or better than traditional desktop interfaces. (Quinn, 2007)

Reference:


1. Wikipedia (2009). "Integration". Wikipedia The Free Encyclopedia, Retrieved Mar-17th-2009 from URL - http://en.wikipedia.org/wiki/Digital_integration, http://en.wikipedia.org/wiki/System_integration and http://en.wikipedia.org/wiki/Enterprise_application_integration
2. IBM.com (2009). "DB2 Universal Database". IBM.com, Retrieved Mar-17-2009 from URL - http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.ii.doc/ad/ciiwhyen.htm
3. BusinessObjects.com (2009). "Data_Integration". Business Objects, Retrieved Mar-17th-2009 from URL - http://www.businessobjects.com/global/pdf/whitepapers/data_integration.pdf
4. Quinn Mathew (2007). "AJAX: Bringing SOA to the Front Lines". SOA Magazine, Retrieved Mar-17th-2009 from URL - http://www.soamag.com/I3/0107-1.asp


22 Mar 2009

Q1. Go to the website of IBM, Oracle, Microsoft and Sybase....

Exercise 10: Application server platforms in E-commerce

Q1. Goto the website of IBM, Oracle, Microsoft and Sybase. Is there any mention of e-commerce associated with their database products? What suite or partnership do they list with related E-commerce offerings? How do they compare with open source products like MySQL?

Answer:


Yes, IBM has mentioned e-commerce associated with DB2 product, for example, IBM.com (2006) shows there is a topic called "Mining your Business in Retail with IBM DB2 Intelligent Miner". IBM DB2 Intelligent Miner is used to apply data mining technique to generate automatically product recommendations for customers in a possible e-commerce shop environment. IBM.com lists the partnership with related e-commerce offerings, for instance,
IBM and Arbor Software have delivered on the strategic development and marketing relationship. Also, Cognos, a global leader in business intelligence tools, and IBM, announced that IBM will bundle Cognos' market-leading business intelligence tools, Impromptu and PowerPlay, with DB2 and DB2 OLAP Server. IBM.com compares DB2 with MySQL, in terms of, Graphical User Interface, Backup & Recovery Tools, Administration & Basic Tasks, and Data Movement.

Yes, Orcale has announced that Siebel E-Commerce 8.1.1 is the next-generation of Siebel eSales. Siebel eSales has been designed to enable companies to manage multi-channel interactions with consistency and agility. Sophisticated selling rules such as pricing, eligibility, compatibility, and configuration can be managed once within Siebel CRM and deployed anywhere across the enterprise. All customer interactions transition seamlessly from self-service, to assisted care, into the call center, and back out to the self-service channel while giving customers transparent access to the real time information they need to do business. Features include Browse and Compare Products, Up-sell/Cross-sell, Configure Products, Shopping Cart & Checkout, Asset-based Ordering, View Order Status and Site Administration. (Orcale, 2009)
Oracle lists the partnership with related e-commerce offerings, for example, Oracle and partner Quistor will maximize the payoffs of BPO with Quistor's Learning BPO solution based on the Oracle iLearning technology. Beside Quistor, Genesys has had a long and rich partnership with both Oracle and Siebel, providing enterprises with the industry's most complete solutions for managing customer interactions across sales and support units.
Oracle compares Oracle Database with MySQL, according to, Database security, Schema Migration, Data Types, and Data Storage Concepts.

Yes, Microsoft having Microsoft SQL Server has states that the Microsoft TerraServer stores aerial and satellite images of the earth in a Microsoft SQL Server database served to the public through the Internet. The TerraServer is also an E-Commerce application. Microsoft lists U.S. Geological Survey and Tometa as partners with the e-commerce offerings of Microsoft SQL server. (Microsoft, 1998)
Microsoft compares Microsoft SQL Server with MySQL, in terms of, Features, Licensing, Performance, Replication, Security and Recovery. (Tometa, 2006)

Yes, Sybase has mentioned that Sybase Powers GDI is Repeatable Business-to-Business e-Commerce Framework. Sybase lists paybox - the Furthering Mobile Commerce as a partner.
Sybase compares Sybase ASE with MySQL, in terms of, Performance, Data Management, Scalable and Platform. (Sybase, 2008)

Reference:

1. IBM.com (2006). "Mining your Business in Retail with IBM DB2 Intelligent Miner". IBM.com, Retrieved Mar-16th-2009 from URL - http://www.ibm.com/developerworks/edu/dm-dw-dm-retail_tutorial-i.html and http://www-03.ibm.com/press/us/en/pressrelease/2779.wss
2. Oracle (2009). "About Siebel E-commerce 8.1.1". Oracle.com, Retrieved Mar-16th-2009 from URL - http://www.oracle.com/applications/crm/siebel/self-service-ebilling/siebel-e-commerce-8-1-1.html, http://www.oracle.com/profit/partner/082007_quistor.html, http://download.oracle.com/docs/cd/E12151_01/doc.150/e12155/oracle_mysql_compared.htm and http://www.oracle.com/siebel/ptr_quote.html
3. Microsoft (1998). "Microsoft TerraServer". Microsoft.com, Retrieved Mar-16th-2009 from URL - http://msdn.microsoft.com/en-us/library/aa226316(SQL.70).aspx
4. Tometa (2006). "MySQL 5.0 vs Microsoft SQL Server 2005". Tometa Software, Retrieved Mar-16th-2009 from URL - http://www.tometasoftware.com/MySQL-5-vs-Microsoft-SQL-Server-2005.asp
5. Sybase (2008). "Performance Comparison of ASE 15 vs MySQL 5.0 White Paper". Sybase.com, Retrieved Mar-16th-2009 from URL - http://www.sybase.com/detail?id=1061086, http://www.sybase.com/detail?id=1008953 and http://www.sybase.com/detail?id=1045499



Q3. SMIL is an application of XML. What is the purpose of this technology? What does it apply?

Answer:

SMIL ( Synchronized Multimedia Integration Language) is a W3C recommended XML markup language for describing multimedia presentations. It defines markup for timing, layout, animations, visual transitions, and media embedding, among other things. SMIL allows the presentation of media items such as text, images, video, and audio, as well as links to other SMIL presentations, and files from multiple web servers. SMIL markup is written in XML, and has similarities to HTML. (Wikipedia, 2009)
The Synchronized Multimedia Integration Language enables simple authoring of interactive audiovisual presentations. SMIL is typically used for "rich media"/multimedia presentations which integrate streaming audio and video with images, text or any other media type. SMIL is an easy-to-learn HTML-like language, and many SMIL presentations are written using a simple text-editor. (W3Schools.com, 2009)

Arndt (2009) states that the purposes of SMIL are ...
  1. It is also desirable to be able to publish multimedia presentations using a markup language.
  2. A multimedia markup language needs to enable scheduling and synchronization of different multimedia elements, and define their interactivity with the user.
Where does SMIL apply?
SMIL is used or applied in Multimedia Players to view Video, Audio, Image... etc... For example, the players are AMBULANT, Helix Player, QuickTime Player, RealPlayer, Totem, KMPlayer, Windows Media Player (Playlist Files), Zune (Playlist Files) and Amarok. In order to view a SMIL presentation, a client will need to have a SMIL player installed on his/her computer. Currently, Apple's Quicktime player, Windows Media Player (WMP) and RealNetworks RealPlayer are among the most popular media players.

Reference:

1. Wikipedia (2009). "Synchronized Multimedia Integration Language". Wikipedia The Free Encyclopedia, Retrieved Mar-15th-2009 from URL - http://en.wikipedia.org/wiki/Synchronized_Multimedia_Integration_Language
2. W3Schools.com (2009). "W3C Synchronized Multimedia Home Page". W3Schools.com, Retrieved Mar-15th-2009 from URL - http://www.w3.org/AudioVideo/
3. Arndt Timothy (2009). "The Power Point file". The Department of Computer and Information Sciences in Cleveland State University, Retrieved Mar-16th-2009 from URL - http://grail.cba.csuohio.edu/~arndt/cis658_1.ppt and http://grail.cba.csuohio.edu/~arndt/






Q2. What are the benefits of adopting a schema standardized for a business sector?

Answer:

The benefits of adopting a schema standardized for a business sector are ...
1. The extensibility and structured nature of the standardized schema allows information to be used for communication between different systems.
2. The information sharing, system interoperability knowledge transfer between different computing teams becomes easier as well (because of the same format from the standard).
3. The information creator can format and distribute the information via a multitude of different channels with minimal effort. (because everyone in the business sector knows the standardized scheme)
4. Retrieve the content and data once, deliver many times and in many formats with ease.
(Intranet Journal, 2003)


Reference:

1. Intranet Journal (2003). "XML Tutorial". Intranet Journal Building the Corporate Enterprise, Retrieved Mar-16th-2009 from URL - http://www.intranetjournal.com/articles/200312/ij_12_08_03a.html