Saturday, May 23, 2009

Exercise 4: Answer

  1. Describe the IP protocol. What is DNS?


    According to (Wikipedia)
    The Internet Protocol (IP) is a protocol used for communicating data across a packet-switched internetwork using the Internet Protocol Suite, also referred to as TCP/IP. IP is the primary protocol in the Internet Layer of the Internet Protocol Suite and has the task of delivering distinguished protocol data-grams (packets) from the source host to the destination host solely based on their addresses. For this purpose the Internet Protocol defines addressing methods and structures for datagram encapsulation. The first major version of addressing structure, now referred to as Internet Protocol Version 4 (IPv4) is still the dominant protocol of the Internet, although the successor, Internet Protocol Version 6 (IPv6) is being deployed actively worldwide

    The Domain Name System (DNS) is a hierarchical naming system for computers, services, or any resource participating in the Internet. It associates various information with domain names assigned to such participants. Most importantly, it translates domain names meaningful to humans into the numerical (binary) identifiers associated with networking equipment for the purpose of locating and addressing these devices world-wide. An often used analogy to explain the Domain Name System is that it serves as the "phone book" for the Internet by translating human-friendly computer hostnames into IP addresses. For example, www.example.com translates to 208.77.188.166.(Wikipedia)

  2. Describe the TCP protocol. How is it related to the IP protocol?


    The Transmission Control Protocol (TCP) is one of the core protocols of the Internet Protocol Suite. TCP was one of the two original components, with Internet Protocol (IP), of the suite, so that the entire suite is commonly referred to as TCP/IP. Whereas IP handles lower-level transmissions from computer to computer as a message makes its way across the Internet, TCP operates at a higher level, concerned only with the two end systems, for example, a Web browser and a Web server. In particular, TCP provides reliable, ordered delivery of a stream of bytes from a program on one computer to another program on another computer. Besides the Web, other common applications of TCP include e-mail and file transfer. Among its other management tasks, TCP controls message size, the rate at which messages are exchanged, and network traffic congestion.(Wikipedia)
  3. Differentiate between intranets and extranets.


    Intranet is a internal computer network, normally housed behind a companies firewall, that can be accessed only by authorized persons, especially members or employees of the organization. Extranet is an online (internet) site with additional information, which is restricted to registered users only.(Ukobona)
  4. Describe the different elements of HTTP protocol.


    HTTP is a request/response standard of a client and a server. A client is the end-user, the server is the web site. The client making a HTTP request—using a web browser, spider, or other end-user tool—is referred to as the user agent. The responding server—which stores or creates resources such as HTML files and images—is called the origin server. In between the user agent and origin server may be several intermediaries, such as proxies, gateways, and tunnels. HTTP is not constrained to using TCP/IP and its supporting layers, although this is its most popular application on the Internet. Typically, an HTTP client initiates a request. It establishes a Transmission Control Protocol (TCP) connection to a particular port on a host (port 80 by default; see List of TCP and UDP port numbers). An HTTP server listening on that port waits for the client to send a request message. Upon receiving the request, the server sends back a status line, such as "HTTP/1.1 200 OK", and a message of its own, the body of which is perhaps the requested resource, an error message, or some other information. Resources to be accessed by HTTP are identified using Uniform Resource Identifiers (URIs)—or, more specifically, Uniform Resource Locators (URLs)—using the http: or https URI schemes.(Wikipedia)
    for a more in depth look at the protocol look at Craig’s blog entry.

  5. What do you know about building e-business applications as an Intranet, Extranet, Web portal, B2B, B2C or Virtual Private Network (VPN)? Find some examples on the Web.


    According to Creative Web Solutions (a web design company located in Mumbai India),
    B2C Portal is like a store front where you can display your products, catalogue, price etc. The customer comes to your store visiting the website and chooses the items/products which he requires; once choosing products gets completed he is shown the total amount to be paid for the items he has selected. He is given an option for paying to complete the transaction.

    Approaching Payment Gateway Service Provider

    Now the Payment Gateway Service Provider comes into picture that is authorized to accept credit card on behalf of the merchant. It may be a Bank or authorized Company who can accept and process the credit card online. They provide the merchant with the payment gateway software that needs to be integrated with the website to enable a secure transaction.

    Integrating Payment Gateway with the Website

    This is the last stage of building a B2C Portal. The Payment Gateway software is integrated with the website to carry online transaction safely and securely.
  6. What role can a VPN play in business-to-business e-commerce?

    A Virtual Private Network (VPN) is an enabling technology that allows companies to build cost-effective private e-marketplaces or extranets that can typically operate within a sector. The Australian Automotive Network Exchange is an example of a VPN.(DCITA)

References


DCITA. Contemporary developments in B2B e-commerce. Retrieved 23 May 2009, from http://www.archive.dcita.gov.au/2001/10/b2b_e-commerce/developments
Ukubona. Retrieved 23 May 2009, from http://www.ukubona.com/Inter/Intra/Extranets-2660.htm
Wikipedia. Internet Protocol. Retrieved 23 May 2009, from http://en.wikipedia.org/wiki/Internet_Protocol
Wikipedia. Domain Name System. Retrieved 23 May 2009, from http://en.wikipedia.org/wiki/Domain_Name_System
Wikipedia. Transmission Control Protocol. Retrieved 23 May 2009, from http://en.wikipedia.org/wiki/Transmission_Control_Protocol
Wikipedia. Hypertext Transfer Protocol. Retrieved 23 May 2009, from http://en.wikipedia.org/wiki/HTTP
Wright, C. (13 May 2009). Visiting EBay. Retrieved 23 May 2009, from http://itc565developersblog.blogspot.com/2009/05/http-protocol.html

Thursday, May 21, 2009

Workshop 1: Learning Ruby

Being used to and IDE I have downloaded Aptana and am currently loading the RADRails plugin The following link points to a video on creating a rails app in the Aptana Studio http://www.aptana.tv/movies/aptana_radrails_intro/aptana_radrails_intro.html Whilst watching the jar files being uploaded I can only hope that, not only does this run on Win7, but the security issues Craig mentioned with downloads dont raise there ugly heads.

Workshop 1: Challenge problems

1. Make a list of all programming languages and Web development tools used by you in prior experiences. Describe what you know about Web application frameworks before we begin. Computing/Programming languages The only web development that I have is that involved in meeting the requirements for the Microsoft Industry subjects webforms and distributed applications for .net 2.0 (ITI532 and ITI533). In that light the only web development tool I have used is Visual Studio 2008. 2. Ruby is “an interpreted scripting language” for quick and easy object-oriented programming”. Find out about the Ruby language and discover what this means. The code is interpreted at runtime and not compiled at design time. Ruby is interpreted scripting language:
•ability to make operating system calls directly •powerful string operations and regular expressions •immediate feedback during development
quick and easy:
•variable declarations are unnecessary •variables are not typed •syntax is simple and consistent •memory management is automatic
object oriented programming:
•everything is an object •classes, methods, inheritance, etc. •singleton methods •"mixin" functionality by module •iterators and closures
also:
•multiple precision integers •convenient exception processing •dynamic loading •threading support
3. What is Rails and how does it work with Ruby? Ruby on Rails is a powerful, open-source toolkit that enables you to build sophisticated web applications quickly. Built in Ruby (a dynamic, object-oriented language), Ruby on Rails is a framework that provides a broad set of capabilities upon which you can build your web application: It handles all the communication with the database, so you can deal with software objects and let the framework generate SQL. It provides a template system for handling layouts and page sections, plus extensive facilities for form processing and Ajax updates. There’s a wide range of plug-ins to quickly implement many features. Ruby on Rails was designed to make the best use of your time, eliminate drudgery, and let you create great solutions with an agile, iterative approach. There’s a tremendous demand for Ruby on Rails developers, so learning to build sites with Rails is a valuable step in your web development career, whether you’re building your skills as a freelancer or planning your next job move. 4. What is meant by “convention over configuration” in regards to the use of Rails in Web application development? Convention over configuration is a very important principle behind Rails. It goes hand-in-hand with another attribute of Rails, that it is “opinionated software”. The Rails design embodies lots of opinions about how you should structure your code, name your classes and files, and organize your database tables. There are methods to override most of these conventions, but if you go with the flow and follow the conventions, then you can avoid almost all configuration code. That’s convention over configuration — and the payoff is huge 5. When did Model-View-Controller begin and where is it used? History as defined by wikipedia MVC was first described in 1979[1] by Trygve Reenskaug, then working on Smalltalk at Xerox PARC. The original implementation is described in depth in the influential paper Applications Programming in Smalltalk-80: How to use Model–View–Controller.[2] There have been several derivatives of MVC; one of the most known (due to its use by Microsoft) is the Model View Presenter pattern which appeared in the early 1990s and was designed to be an evolution of MVC. However Model–View–Controller still remains very widely used. In November 2002 the W3C voted to make MVC structures part of their XForms architecture for all future web applications [3]. These specifications will now be integrated directly into the XHTML 2.0 specifications. There are now over 20 vendors that support XForms frameworks with MVC integrated into the application stack. 6. Describe the steps involved with the MVC design approach. I will get back to this later

Workshop 1: InstantRails podcasts

I have now listened to the entire series twice. It is not a bad way to pass the time on my commute. I guess I am looking forward to moving on from listening about Ruby on Rails at a conceptual level to getting my hands dirty in code and application development. A few observations first: I certainly hope that using ruby is fun, because Michael and Christopher kept telling me that using ruby was going to be "more fun" Having lived in the Visual Studio IDE for the past 5 years or so developing winforms apps, where seemingly all the tools are in one location, to be told I need to use a text editor, command line interface, subversion, etc etc etc was seemingly sounding like a step backwards. And this is going to be "more fun"? And then there is episode 8. Its all about the Mac. I chuckled to myself just a little thinking about apple - windows flame wars. Well now to get back into looking at what we need to do to get this workshop underway.

Exercise 5: Answer

1. Using any familiar programming language environment, what do you know about sockets (network) programming? Coming from a .net framework / Microsoft programming paradigm, the use of the term socket is completely new to me. So my immediate answer to the question is not a thing. However if we review the definition given by (Ince, p50)
"Each communication channel into and out of a TCP/IP-based computer is identified by the unique pair of numbers consisting of the IP address and the port number. This combination is a programming abstraction known as a socket."
This gives me a line of enquiry to take, and so reviewing remoting in a .net environment leads us to (as an example) looking at registering a communication channel and specifying the port. This can be done with the System.Runtime.Remoting.Channels.Http class. Looking at (MSDN)
Sockets The System.Net.Sockets namespace contains a managed implementation of the Windows Sockets interface. All other network-access classes in the System.Net namespace are built on top of this implementation of sockets. The .NET Framework Socket class is a managed-code version of the socket services provided by the Winsock32 API. In most cases, the Socket class methods simply marshal data into their native Win32 counterparts and handle any necessary security checks. The Socket class supports two basic modes, synchronous and asynchronous. In synchronous mode, calls to functions that perform network operations (such as Send and Receive) wait until the operation completes before returning control to the calling program. In asynchronous mode, these calls return immediately. 2. Define some terms. (Wikipedia) provides examples of the following API methods
Sockets are usually implemented by an API library such as Berkeley sockets, first introduced in 1983. Most implementations are based on Berkeley sockets, for example Winsock introduced in 1991. Other socket API implementations exist, such as the STREAMS-based Transport Layer Interface (TLI). Development of application programs that utilize this API is called socket programming or network programming. These are examples of functions or methods typically provided by the API library: socket() creates a new socket of a certain socket type, identified by an integer number, and allocates system resources to it. bind() is typically used on the server side, and associates a socket with a socket address structure, i.e. a specified local port number and IP address. listen() is used on the server side, and causes a bound TCP socket to enter listening state. connect() is used on the client side, and assigns a free local port number to a socket. In case of a TCP socket, it causes an attempt to establish a new TCP connection. accept() is used on the server side. It accepts a received incoming attempt to create a new TCP connection from the remote client, and creates a new socket associated with the socket address pair of this connection. send() and recv(), or write() and read(), or recvfrom() and sendto(), are used for sending and receiving data to/from a remote socket. close() causes the system to release resources allocated to a socket. In case of TCP, the connection is terminated.
3. How is a socket bound to a port number and what is the role of the operating system on the server end? As per the definition given by (Ince, p50), a socket does not exist without the port number. According to (Wikipedia ), the operating system forwards incoming IP packets to the corresponding application or service process by extracting the socket address information from the IP and transport protocol headers 4. Investigate a simple chat client/server system. Look at some program code and describe how it works with multiple users. Here is a vb.net chat server program written in VB that provides information on setting up and implementing a multi user client/server chat system. References Ince, D. (2006). Developing Distributed & E-commerce Applications: Prentice-Hall, Inc. Upper Saddle River, NJ, USA.
MSDN. Sockets. .NET Framework Developer's Guide Retrieved 27 May 2009, from http://msdn.microsoft.com/en-us/library/b6xa24z5.aspx
VB.NET Communications Tutorial. Retrieved 28 May 2009, from http://vb.net-informations.com/communications/vb.net_chat_server_program.htm
Wikipedia. Internet socket. Retrieved 27 May 2009, from http://en.wikipedia.org/wiki/Internet_socket

Exercise 5: About Sockets

Link to article about sockets
Found this on Codeproject Daily news email I received this morning. The timing is quite remarkable.

Wednesday, May 20, 2009

Exercise 1: Weirdness, response to Karens comment

The issue I was trying to bring to light can hopefully be better explained by the following 2 screen shots:
The first image shows the gap I am talking about.
The second screen shot displays the code that is somehow generating the gap.

Tuesday, May 19, 2009

Exercise 1: Getting weird and unexplained layout using a table.

You may be able to see my problem that is causing me to lose hair. Have just wasted umpteen minutes trying to get the table positioned correctly in the blog. But as you can see it is appearing WAY down the page. Has anyone experienced this before. I am not a html expert, have done very little in fact so not sure why this table is being pushed down. Hoping that someone could provide a hint.

Workshop 1: Learning Ruby

I downloaded the Audio (Lessons 1-8) from LearningRails and also the Screencasts (Lessons 9-23). Having never used a podcast in any form before, and not one to burn music, copying these to a format I could listen to in the car on the commute to and from work turned into a challenge that wasn't.

An aside:

The iTunes player didn't work very well in burning to disk. This may have been for a number of reasons. There may be a bug in Win7 RC that caused my DVD burner to lose itself intermittently. The burner itself may have had a problem. The iTunes interface may have been my problem.

In the end I stopped using my main machine and used my laptop. This is a dell XPS1330 and also has Win7 RC installed. This showed the benefits of the homegroups concept introduced in Win7, and the ease with which network setup and connections is now handled.

Now back to the point of the blog. I finally got the podcasts (audio lessons 1-8) copied onto 3 CDs. Listened to the first 6 episodes today and found that they give a very good, yet brief overview of the Ruby language. Hopefully 7 and 8 tomorrow will give me some idea about actually getting started with Ruby development.

Sunday, May 17, 2009

Workshop 4: Riding the Rails with Ruby

Topic objectives

  1. To learn about the Ruby language and its classes and methods;
  2. To use Ruby via an interpreter console window with Windows, Linux or MacOS
  3. To select and test a Ruby IDE
  4. To explain how Rails framework is built upon inheritance of Ruby classes and methods.

To do:

1. Spend some time moving your way through the 46 Ruby coding examples in the Ruby Tutorial with Code from http://www.fincher.org/tips/Languages/Ruby/

2. What are the syntax differences in the way that Ruby and Javascript use the if statement?

3. While Ruby and Python are quite similar, can you find some similarities between Ruby and Javascript?

Challenge Problems:

1. Create, test and debug a Ruby program called dognames.rb or catnames.rb to accept 3 names from the keyboard and to display each name on the screen in alphabetical order WITHOUT using a data structure such as a list.

2. Write a Ruby program called fizzbuzz.rb that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

3. Compare the Ruby and Python versions of the dog years calculator:

Workshop 3: Online Taxi Booking System: MySQL and Database design

Topic objectives

  1. Develop a database object design for an online taxi booking system (OTBS);
  2. Revise database techniques with Rails and SQL
  3. Describe how to use the MVC “push-based architecture” in the Ruby on Rails development environment

To do:

1. Set up the MySQL tools on your computer as described in section 6 above.

2. Rails will setup a new application directory for each of your Web application projects. Get InstantRails (Windows) or Locomotive (MacOS) running on your machine. Both packages install Ruby, Rails, a Web server or one called ‘Mongrel’ or another small Ruby Web server called ‘WEBrick’, and MySQL “inside a bubble” as I call it so that others parts of your system are not modified (Similarly ZOPE does with installing its own Web server and Python versions).

3. Once Rails is running you at http://localhost:3000, you need to configure database access. Connection to the database is specified in the config/database.yml file.

4. Generate the Passenger model by creating the MySQL database and ‘passengers’ table from the information above.

5. Further work on understanding MySQL under Rails by David Mertz:

a. See “Fast-track your Web apps with Ruby on Rails” at http://www-128.ibm.com/developerworks/linux/library/l-rubyrails/

b. The “Rolling with Ruby on Rails” series and “Cookbook recipes by Curt Hibbs and others beginning at http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html

Workshop 2: Model View Controller design approach

Topic objectives

  1. Describe the history and architecture of the Model View Controller (MVC) approach to Web application design;
  2. Revise database techniques with Rails and SQL
  3. Describe how to use MVC in the Ruby on Rails development environment
  4. Set up a focus group (like a study group for peer learning) to work on the Ruby on Rails workshops via Interact tools

To do:

1. Set up a focus group (like a study group for peer learning) to work on the Ruby on Rails workshops via Interact tools as a class.

This has been informally done via the forum. We haven't organised a study group, but comments have been forthcoming on issues when they have arisen.

2. What is meant by “convention over configuration” and how does it reduce coding?

(Wikipedia)Convention over Configuration (aka Coding by convention) is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility.

The phrase essentially means a developer only needs to specify unconventional aspects of the application. For example, if there's a class Sale in the model, the corresponding table in the database is called sales by default. It is only if one deviates from this convention, such as calling the table "products_sold", that one needs to write code regarding these names.

When the convention implemented by the tool you are using matches your desired behaviour, you enjoy the benefits without having to write configuration files. When your desired behaviour deviates from the implemented convention, then you configure your desired behaviour.

3. Further work on understanding MVC:

a. See the wiki at http://wiki.rubyonrails.org/rails/pages/UnderstandingMVC

As Karen pointed out on the forums and I have found out subsequently, there is nothing to be gained by going to this site. This is what grabs you
This topic does not exist yet
As I posted on the forums, Ken may have meant for us to visit http://c2.com/cgi/wiki?ModelViewController

b. Do the MVC tutorial at http://wiki.squeak.org/squeak/1767

I have visited this URL and downloaded the tutorial which is in a nice small zip file. Unzipped the file and then looked at the contents page which said that the tutorial was to develop and MVC application in Smalltalk. Not sure about anyone else, but I decided then and there that I didn't need to learn yet another syntax just at the moment.

4. Got a spare hour or so? I recommend the UC Berkeley RAD lab’s Ruby on Rails Short course at http://YouTube.com/watch?v=LADHwoN2LMM

I watched this yesterday. I found this to be very useful in bringing the concepts talked about in the podcast LearningRails episodes to light. He does speak a little quickly, but he is definitely enthusiastic.

5. Read the Flash article using ActionScript by Colin Moock titled “The Model-View-Controller Design Pattern “at http://www.adobe.com/devnet/flash/articles/mv_controller.html

I have read this article. Got enthusiastic enough to download the entire chapter. The full chapter explains how the author builds an MVC Clock that displays digital and analog time. Unfortunately I didn't actually gain a lot from the rest of the chapter. It contains a lot of code with some explanations of how all the pieces fit together, but I felt that he laboured the point just a little.

References

Wikipedia. Convention over configuration. Retrieved 11 June 2009, from http://en.wikipedia.org/wiki/Convention_over_Configuration

Exercise 12: Designing for a secure framework

  1. Find out about SET and the use of RSA 128-bit encryption for e-commerce.
  2. According to (Wikipedia) Secure Electronic Transaction (SET) was a standard protocol for securing credit card transactions over insecure networks, specifically, the Internet. SET was not itself a payment system, but rather a set of security protocols and formats that enables users to employ the existing credit card payment infrastructure on an open network in a secure fashion. However, it failed to gain traction.

    SET was developed by SETco, led by VISA and MasterCard (and involving other companies such as GTE, IBM, Microsoft, Netscape, RSA and VeriSign) starting in 1996. SET was based on X.509 certificates with several extensions. The first version was finalised in May 1997 and a pilot test was announced in July 1998.

    SET was intended to become the de facto standard of payment method on the Internet between the merchants, the buyers, and the credit-card companies. Despite heavy publicity, it failed to win market share. Reasons for this include:

    • Network effect - need to install client software (an e wallet).
    • Cost and complexity for merchants to offer support and comparatively low cost and simplicity of the existing SSL based alternative.
    • Client-side certificate distribution logistics.

    According to (Wikipedia) RSA keys are typically 1024-2048 bits long. RSA is an algorithm for public-key cryptography. It is the first algorithm known to be suitable for signing as well as encryption, and one of the first great advances in public key cryptography. RSA is widely used in electronic commerce protocols, and is believed to be secure given sufficiently long keys and the use of up-to-date implementations.

  3. Design a Web application form for a new credit card.
  4. x
  5. What can you find out about network and host-based intrusion detection systems?
  6. (Wikipedia)says that one can think of a HIDS as an agent that monitors whether anything or anyone, whether internal or external, has circumvented the system's security policy.

    According to (Wikipedia)a network intrusion detection system (NIDS) is an intrusion detection system that tries to detect malicious activity such as denial of service attacks, port scans or even attempts to crack into computers by monitoring network traffic.

    The NIDS does this by reading all the incoming packets and trying to find suspicious patterns. If, for example, a large number of TCP connection requests to a very large number of different ports are observed, one could assume that there is someone conducting a port scan of some or all of the computer(s) in the network. It also (mostly) tries to detect incoming shellcodes in the same manner that an ordinary intrusion detection systems does.

    A NIDS is not limited to inspecting incoming network traffic only. Often valuable information about an ongoing intrusion can be learned from outgoing or local traffic as well. Some attacks might even be staged from the inside of the monitored network or network segment, and are therefore not regarded as incoming traffic at all.


References
Wikipedia. Host-based intrusion detection system. Retrieved 30 June 2009, from http://en.wikipedia.org/wiki/Host-based_intrusion_detection_system
Wikipedia. Network intrusion detection system. Retrieved 30 June 2009, from http://en.wikipedia.org/wiki/Network_intrusion_detection_system
Wikipedia. RSA. Retrieved 20 July 2009, from http://en.wikipedia.org/wiki/RSA
Wikipedia. Secure Electronic Transaction. Retrieved 20 July 2009, from http://en.wikipedia.org/wiki/Secure_Electronic_Transaction

Exercise 11: XML introduction

  1. Conduct research on the Internet to find out what tools can be used to parse an XML document and ensure that the document is well formed and valid.
  2. XML schema is a forthcoming development of the technology. Visit the W3C website and search for information on schema. What are the benefits of adopting a schema standardized for a business sector?
  3. What are DOMs and why were they developed?
  4. Why are some developers using SAX instead of DOM for document processing?
  5. SMIL is an application of XML. What is the purpose of this technology? Where does it apply?
  6. The current recommendation of W3C is to use XHTML as an alternative to HTML.
  7. Do you think adopting XHTML is a wise move?

Exercise 10: Application server platforms in e-commerce

  1. List some application servers in competition with ZOPE. Access the web and find the latest version of the application servers mentioned in the text. When were they released? Can you make any conclusion about the release cycle of Internet software in comparison to other business software (e.g. spreadsheet, word processor, accounting packages)?
  2. List the main Web servers. What types of companies are offering the leading servers? Distinguish between open source and proprietary products. Who is providing support for the products? How much do they cost? Do you think the Web server purchase price is a significant factor in budget considerations for a large e-commerce initiative?
  3. Go to 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?
    Access the web and find the current rate for website hosting. What are the criteria used by the ISP for pricing?
  4. Why is the perception getting stronger that integration will become a critical factor in coming days?
  5. What is the role of ERP within the enterprise software architecture?
  6. What is Customer Resource Management and why is it important to e-commerce?
  7. What are the differences between HTML and DHTML?
  8. Why was XHTML developed? Do you think this addresses most of the HTML weaknesses?
  9. What are the similarities between JavaScript, VBScript and ZOPE’s DTML?
  10. What are the similarities and differences between ASP, JSP and PHP?
  11. What are the differences between the various approaches to scripting?
  12. List some of the shareware or freely available tools for web design. In addition to a good HTML editor, what utilities could be very handy to the developer?

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

  1. 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.
  2. 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.
  3. Can you modify the script to process the form?

Exercise 8: PHP and MySQL database access

  1. Start with a simple table in the database:
    mysql> SELECT * FROM employees;
  2. Create a web page with the following PHP:
    <?php
    $db = mysql_connect(“farrer.csu.edu.au", “keustace", “password");
    mysql_select_db(“mydatabase",$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>";
    ?>
    My password is included? We look at security later…☺
  3. This is how we can add a record and is part of a file to create called add_record.html
    <HTML>
    <BODY>
    <FORM METHOD="POST" ACTION="add_record.php">
    First name:<INPUT TYPE="Text" NAME="first"><br>
    Last name:<INPUT TYPE="Text" NAME="last"><br>
    Address:<INPUT TYPE="Text" NAME="address"><br>
    Position:<INPUT TYPE="Text" NAME="position"><br>
    <INPUT TYPE="Submit" NAME="submit" VALUE="Enter information">
    </FORM>
    </BODY>
    </HTML>
  4. The corresponding PHP file is add_record.php used with the POST method:
    <?php $db = mysql_connect(“farrer.csu.edu.au", “keustace", "password");
    mysql_select_db(“mydatabase",$db);
    $result = mysql_query("INERT 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";
    }
    ?>
  5. The last code example shows how to get multiple records:
    <?php
    $db = mysql_connect(“farrer.csu.edu.au", “keustace", "password");
    mysql_select_db(“mydatabase",$db);
    $result = mysql_query("SELECT * FROM employees",$db);
    echo "<table border=1>\n";
    echo "<tr><td><b>Name</b></td><td><b>Position</b></tr>\n";
    while ($myrow = mysql_fetch_row($result)) {
    echo "<tr><td>", $myrow[2], ", ", $myrow[1], "</td><td>", $myrow[3], "</td></tr>";
    }
    echo

Exercise 7: User input for database access with PHP

  1. Create an HTML page with the form:
    <FORM METHOD="GET" ACTION="submit.php"> What's your name? <INPUT NAME="myname" SIZE=10>
    (Then press RETURN)
    </FORM>
  2. Then, create a PHP file named submit.php with the following code:
    <?php
    echo "Hello, ", $myname;
    ?>

Exercise 6: Some server practice with PHP

  1. In this exercise with can call up and examine some environment variables on the server. The code below has the UNIX environment variable for storing your remote Internet address. UNIX environment variable are recognised by the use of upper case letters. Try the same code by replacing with $REMOTE_ADDR $SERVER_NAME, or $PHP_SELF
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    <?php
    echo "You are connected from: ",$REMOTE_ADDR;
    echo "<BR>";
    ?>
    </BODY>
    </HTML>
  2. Create a web application called "hello_world.php" which contains in the body:
    <?php
    $myvar = "Hello World!";
    echo $myvar;
    ?>

Exercise 5: Binding sockets in a chat room

  1. Using any familiar programming language environment, what do you know about sockets (network) programming?
  2. Define some terms.
  3. How is a socket bound to a port number and what is the role of the operating system on the server end?
  4. Investigate a simple chat client/server system. Look at some program code and describe how it works with multiple users.

Introduction: Computing Background

A brief look at what I have been exposed to and used over the past 20 years or so:

  • XP, Vista, Win7
  • .net framework 2.0
  • VS 2003, 2005, 2008 (Predominantly VB)
  • Visual Basic V6, Visual Studio .Net, C# 2005
  • SQL Server 7, 2000, 2005
  • Microsoft Analysis Services, DTS packages
  • Extensive development of SQL Stored procedures
  • OpenDOCS, KFlow, Lattice HR/Payroll, Finance One
  • GEAC Pathway, Masterview, Heat
  • Extensive VBA Programming (Word, Excel, Access and Outlook)
  • Oracle PL/SQL and database administration
  • Oracle Financials administration and support
  • Peoplesoft v7.5 and v8.4
  • CHRIS HR/Payroll administration and support
  • GEAC Pathway software implementation and support
  • Software and hardware installation, support and troubleshooting
  • ASP web page application development
  • CGPL (GIS Interface Programming Language)
  • Geographic Data Management System, GDMS.
  • Infomaster, Formida GIS programming language
  • MapInfo, MapBasic, Autolisp development

Workshop 1: InstantRails success – Ruby now working

Got to have some fun with testing Win7 and creating a virtual machine. Worked fine after I had fiddled a bit with some of the settings.

Got my completely vanilla Win7 virtual machine set up about 4pm. Have run the InstantRails app and it has all worked.

Have played with the Cookbook app, sort of but am not sure what I am connected to. Have never played with a Hosts file before so am presuming that when changed to point mycookbook to 127.0.0.1 it worked, but when you run the site how do you tell?

Workshop 1: Ruby fun

I am having a wonderful time trying to get ruby to work.
I have downloaded itunes64, installed it and have proceeded to download lots of podcasts(in the learning rails series)
On unzipping the Instantrails zip file (this took longer than I expected, in the order of 5 minutes or so. Seems excessive for a 170MB expansion)and trying to run the InstantRails app was informed that my file path could not contain spaces. Painful to say the least.
Got a new path and copied all the files (only about 40000 of them)
Ran the InstantRails app and get the following error:
My machine is running Windows 7 64bit, have VS2008 professional installed with SQL2008 standard edition installed.
I guess this has something to do with SQL server??
Somewhere in all of this is the answer to my problems.
I may have to resort to creating a vanilla virtual machine with nothing installed. Unless someone has some other advice.
The documentation for installing Ruby leaves a lot to be desired.

Workshop 1: Setting up the model railway

Topic objectives

  1. Install Ruby on Rails on your computer (InstantRails or Locomotive);
  2. Learn about the Model View Controller (MVC) approach to Web application design;
  3. Revise database techniques with MySQL
  4. Learn how to use the Ruby on Rails development environment
  5. Set up a focus group (like a study group for peer learning) to work on the Ruby on Rails workshops via Interact tools

To do:

1. Download iTunes from http://www.apple.com/itunes/download/ and subscribe to the “Learning 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.

Recommended time: 1-4 hours.

Challenge Problems:

  1. Make a list of all programming languages and Web development tools used by you in prior experiences. Describe what you know about Web application frameworks before we begin.
  2. Ruby is “an interpreted scripting language” for quick and easy object-oriented programming”. Find out about the Ruby language and discover what this means.
  3. What is Rails and how does it work with Ruby?
  4. What is meant by “convention over configuration” in regards to the use of Rails in Web application development?
  5. When did Model-View-Controller begin and where is it used?
  6. Describe the steps involved with the MVC design approach.