1. The area no. 2, Business process analysis, is selected.
In a business organization, monitoring and management of the business processes to attain profitability is an essential task. E.g. measuring the revenue versus target, building up customer relationship via e-communication.
Various softwares for business process analysis are available, e.g. CRM, Work Flow management, new Web 2.0 tools like the Salesforce.com. One of them has been around for a while and very popular is calledEnterprise resource planning (ERP). It is an 'integrated computer-based system used to manage internal and external resources including tangible assets, financial resources, materials, and human resources. Built on a centralized database, it is a software architecture to facilitate the flow of information between all business functions inside and outside the boundaries of the organization like supplier and customers.
The ERP was originated from the manufacturing resource planning (MRP), and typically handled the manufacturing, logistics, distribution, inventory, shipping invoicing and accounting processes for a company. But for today, ERP has extend across almost all business processes and activities like sales, marketing, human resources management.
The new generation of ERP is called ERPII, largely utilize the web interface and allows both employees and external resources (such as suppliers and customers) real-time access to the system's data.
Apart from the traditional ERP vendor like SAP, open ERP resources are readily available now, e.g. the OpenBravo.com for SMB, xTuple PostBooks is an integrated ERP, CRM and accounting system, OpenERP integrates accounting, hr, sales, crm, purchase, stock, production, services management, project management, marketing campaign. (Gaea, 2009)
References
Enterprise resource planning. (2010). Retrieved on 19 May 2010 from http://en.wikipedia.org/wiki/Enterprise_resource_planning#History
Gaea, P. (2009). 10 Best Open Source ERP Software. Retrieved on 19 May 2010 from http://blog.taragana.com/index.php/archive/10-best-open-source-erp-software/
1. What is meant by a location based service? Explain using the Web applications found on a late model mobile device.
From the Wiki, A location-based service (LBS) is an information and entertainment service, accessible with mobile devices through the mobile network and utilizing the ability to make use of the geographical position of the mobile device.
LBS services can be used in a variety of contexts, such as health, work, personal life, etc. LBS services include services to identify a location of a person or object, such as discovering the nearest banking cash machine or the whereabouts of a friend or employee. LBS services include parcel tracking and vehicle tracking services.
LBS can include mobile commerce when taking the form of coupons or advertising directed at customers based on their current location. They include personalized weather services and even location-based games. They are an example of telecommunication convergence.
2. Describe the purpose of the Open Mobile Alliance Initiative?
According to the home page of the OMA:
"The mission of the Open Mobile Alliance is to facilitate global user adoption of mobile data services by specifying market driven mobile service enablers that ensure service interoperability across devices, geographies, service providers, operators, and networks while allowing businesses to compete through innovation and differentiation."
3. What are the main components of a mobile Web services framework?
In a mobile Web service environment, the limited resources and the lack of bandwidth in its communication network makes it is different from a Web service on a regular size computer. In Mobile devices, Synchronous web services are not feasible. It makes the user wait while each Web service processes requests and returns results. The mechanism of mobile Web service network is called Asynchronous Web services that the invocation solves this performance issue and enhances the end user experience by increasing server efficiency. There are three types of processes and components which are involved in web services.
Firstly, a discovery process which is done through UDDI. When one party (requester) contacts another (provider) to obtain services, the requester must locate an appropriate provider. This process is known as discovery. Different mechanisms can be used in the process, such as finding services listed on a web site, searching a directory or locating the provider through a framework that supports discovery.
Next process is description. When a provider has been located, the requester needs to learn the rules related to contacting the provider (e.g., which protocols to use, how to structure messages, and which security and other policies to observe).
A document which contains a description of web services is called WSDL (Web Services Description Language).
The third process is to communicate with the provider by sending (and possibly receiving) messages. The communication usually takes place using the SOAP protocol together with underlying protocols such as HTTP. The definition of how an underlying protocol is to be used with SOAP is called a SOAP binding. It is required in order to achieve interoperability between SOAP messages and their underlying protocol.
4. Visit an airline Web site and search for information on WAP or SMS or 3G mobile application access to booking airline services. The same services exist in banding. How do both industries compare?
I’ve visited the Cathay Pacific Airways and Bank of America (BoA). The Cathay Pacific introduced the WAP service in year 2000, and was the 1st airline to introduce this service in Asia. For BoA, the service was introduced in 2007. The mobile features and requirements are listed below.
Cathay
BoA
Main features
Check-in
News & Offers
Flight Schedules
Flight Status
View Latest Flight Bookings
The Marco Polo Club Account
Airport Information
City Guides
(Only on CX Mobile Application)
Subscribe to notiFLY
Subscribe to CXpecials
Local Contacts
Custom design unique to your phone's features
ATM and banking center locator, using geo-locator –find the nearest location without entering your address or zip code
On-the-go management of your accounts to check balances, transfer funds and pay bills
Supported mobile devices
iPhone
Blackberry
Java-enabled mobile phones such as Nokia, Sony Ericsson, Motorola, Samsung, etc.
iPhone
Blackberry
Android
Target users
Frequent Traveler (Quick access to information and booking of flights)
General banking customers (Quickly locate the ATM machine)
Funds investor (Quick access to funds information and management)
Benefits to users
Quickly access to the required information and no need to spend time to get to a place or waiting in a queue
Quickly access to the required information and no need to spend time to get to a place or waiting in a queue
Benefits to the company
Increase business volume without increasing number of shops
Increase business volume without increasing number of shops
Can mobile service replace all physical shops?
No
It can support most of the transactions (e.g. flights booking, check-in) but there are tasks still need to be done at a physical location. (e.g. check-in luggage)
No
It can support most of the transactions (e.g. bill payments, transfer funds) but there are tasks still need to be done at a physical location. (e.g. Withdraw cash, bank-in cheques at ATM)
According to Whatis.com, a spider is a program that visits Web sites and reads their pages and other information in order to create entries for a search engine index. The major search engines on the Web all have such a program, which is also known as a "crawler" or a "bot." Spiders are typically programmed to visit sites that have been submitted by their owners as new or updated. Entire sites or specific pages can be selectively visited and indexed. Spiders are called spiders because they usually visit many sites in parallel at the same time, their "legs" spanning a large area of the "web." Spiders can crawl through a site's pages in several ways. One way is to follow all the hypertext links in each page until all the pages have been read.
2. Differentiate the various types of software agents.
Haag (2006) suggests that there are only four essential types of intelligent software agents: • Buyer agents or shopping bots • User or personal agents • Monitoring-and-surveillance agents • Data Mining agents
3. Identify various activities in e-commerce where software agents are currently in use.
Buyer agents (shopping bots) - Buyer agents travel around a network (i.e. the internet) retrieving information about goods and services. These agents, also known as 'shopping bots', work very efficiently for commodity products such as CDs, books, electronic components, and other one-size-fits-all products. Amazon.com is a good example of a shopping bot. The website will offer you a list of books that you might like to buy on the basis of what you're buying now and what you have bought in the past.
User agents, or personal agents - Intelligent agents that take action on your behalf. In this category belong those intelligent agents that already perform, or will shortly perform, the following tasks:
• Check your e-mail, sort it according to the user's order of preference, and alert you when important emails arrive. • Play computer games as your opponent or patrol game areas for you. • Assemble customized news reports for you. There are several versions of these, including newshub and CNN. • Find information for you on the subject of your choice. • Fill out forms on the Web automatically for you, storing your information for future reference • Scan Web pages looking for and highlighting text that constitutes the "important" part of the information there • "Discuss" topics with you ranging from your deepest fears to sports • Facilitate with online job search duties by scanning known job boards and sending the resume to opportunities who meet the desired criteria • Profile synchronization across heterogeneous social networks
Monitoring-and-surveillance (predictive) agents - They are used to observe and report on equipment, usually computer systems. The agents may keep track of company inventory levels, observe competitors' prices and relay them back to the company, watch stock manipulation by insider trading and rumors, etc.
Data mining agents - This agent uses information technology to find trends and patterns in an abundance of information from many different sources. The user can sort through this information in order to find whatever information they are seeking.
4. Computing ethics and bot programming case study: rocky
a. Get an account username and password form the lecturer to LC_MOO at http://ispg.csu.edu.au:7680 and login to the Welcome Lobby.
I log in with the user account 'user19', below is the screenshot of the Welcome Lobby.
Figure 11: LC_MOO screen layout with the Rocky bot object.
b. Hold a 5-minute discussion with Rocky on special topic. Commands and chat are entered in command box (bottom-left of screen in Figure 11) : act rocky (start bot) hush rocky (stop bot)
Figure 11: LC_MOO screen layout with the Rocky bot object.
c. Rocky is an ELIZA-like bot. Report your findings. Rocky is an ELIZA-like bot. Rocky provided a corresponding response of a pre-defined instruction. You also can create an instruction by LC_MOO command.
I typed in the LC_MOO command and the bot showed 'I don't understand that', I also typed in many words, all responded the same. My conclusion is that is a rubbish, no intelligence but a junk program with poor interface and only be able to answer some pre-defined questions.
References
Hagg. S. (2006). Management Information Systems for the Information Age", pp. 224-228.
Wiki. (2010). Software agent. Retrieved on 14 May 2010 from http://en.wikipedia.org/wiki/Software_agent
Whatis.now. (2008). Spiders. Retrieved on May 14, 2010 from http://whatis.techtarget.com/definition/0,,sid9_gci213035,00.html
1. Develop the class diagram for the following shopping cart specifications:
A shoppingCart object is associated with only one creditCard and customer and to items in itemToBuy object. Persistent customer information such as name, billing address, delivery address, e-mail address and credit rating is stored in the customer object. The credit card object is associated with a frequentShopper discount object, if the credit rating for the customer is good. The customer can make or cancel orders as well as add and delete items to the shopping cart product. The credit card object contains the secure method for checking that the charge is authentic.
1. Examine the Use Case in Figure 4 and explain the MVC architecture of the online bookstore (the model the view and controllers) needed to Lookup Books and Add to Shopping Cart.
Figure 4: Use case diagram for a customer using a shopping cart at an online bookstore.
According to the Wiki, the MVC functions are summarized below: The model is used to manage information and notify observers when that information changes. The model is the domain-specific representation of the data upon which the application operates. Domain logic adds meaning to raw data (for example, calculating whether today is the user's birthday, or the totals, taxes, and shipping charges for shopping cart items). When a model changes its state, it notifies its associated views so they can be refreshed. Many applications use a persistent storage mechanism such as a database to store data.
The view renders the model into a form suitable for interaction, typically a user interface element. Multiple views can exist for a single model for different purposes. A viewport typically has a one to one correspondence with a display surface and knows how to render to it.
The controller receives input and initiates a response by making calls on model objects. A controller accepts input from the user and instructs the model and viewport to perform actions based on that input. By comparing the MVC to the User Case, the MVC representations are below.
Lookup Books (104) Model - Lookup Books (Database) View: - Result of the book searched Controller - Input of book information to be searched
Add to Shopping Cart (105) Model - Add to Shopping Cart (Database) View - Result of the books selected to add in Cart Controller - Input of book information to be added to Cart
Wiki. (2010). Model-View-Controller. Retrieved on 14 May 2010 from http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller
1. Give a description in your own words of the ACID properties of a transaction. A transaction is a single logical operation for a data. The ACID (atomicity, consistency, isolation, durability) is the measurement to ensure the reliable database transactions.
References
Wiki. (2010). ACID. Retrieved on 13 May 2010 from http://en.wikipedia.org/wiki/ACID
2. Describe a TP monitor environment. How can a TP monitor stop an operating system being overwhelmed? TP monitor environment (TeleProcessing monitor or Transaction Processing monitor) is a control program to monitor and manage the transfer of data between multiple local and remote terminals and the application programs that serve them. It may also include programs that format the terminal screens and validate the data entered.
In a distributed client/server environment, a TP monitor provides integrity by ensuring that transactions do not get lost or damaged. It may be placed in a separate machine and used to balance the load between clients and various application servers and database servers. It is also used to create a high availability system by switching a failed transaction to another machine. A TP monitor guarantees that all databases are updated from a single transaction.
References
The Free Online Dictionary. (2010). TP Monitor. Retrieved on 13 May 2010 from http://encyclopedia2.thefreedictionary.com/TP+monitor
1. Find definitions for eight terms and concepts used in threaded programming: 1. Thread Synchronization 2. Locks 3. Deadlock 4. Semaphores 5. Mutex (mutual exclusion) 6. Thread 7. Event 8. Waitable timer.
1. Thread Synchronization - The ability to synchronize the activities of various threads. A thread synchronizes itself with another thread by putting itself to sleep. Before doing so, the thread notifies the operating system as to what event has to occur in order for the thread to resume execution.
IBM. (2004). T. Retrieved on 12 May 2010 from http://mail.serc.iisc.ernet.in/ComputingFacilities/systems/cluster/vac-7.0/html/glossary/czgt.htm
2. Locks – A lock is a special value that can be held by at most one thread.
University of Wisconsin. (n.d.) Locks, Semaphores and Monitors Lock Granularity and Access Deadlock. Retrieved on 13 May 2010 from http://pages.cs.wisc.edu/~fischer/cs538.s07/lectures/Lecture37.4up.pdf
3. Deadlock - Two or more threads hold locks that other threads require. Each waits for the other thread to release a needed lock, and no thread is able to execute.
4. Semaphores – A semaphore is a signal to acquire or release a lock, usually it is an integer value (often just a single bit) with two atomic operations: up and down.
5. Mutex (mutual exclusion) - Mutual exclusion (often abbreviated to mutex) algorithms are used in concurrent programming to avoid the simultaneous use of a common resource,
6. Thread – A mechanism of executing concurrent operation, a thread of execution results from a fork of a computer program into two or more concurrently running tasks.
7. Event - Event-driven programming or event-based programming is a programming paradigm in which the flow of the program is determined by events—i.e., sensor outputs or user actions (mouse clicks, key presses) or messages from other programs orthreads.
Wiki. (2010). Event-driven programming. Retrieved on 13 May, 2010 from http://en.wikipedia.org/wiki/Event-driven_programming
8. Waitable timer – A waitable timer object is a synchronization object whose state is set to signaled when the specified due time arrives. There are two types of waitable timers that can be created: manual-reset and synchronization. A timer of either type can also be a periodic timer.
MSDN. (2010). Waitable Timer object. Retrieved on 13 May 2010 from http://msdn.microsoft.com/en-us/library/ms687012(VS.85).aspx
1. Find out about SET and the use of RSA 128-bit encryption of e-commerce.
In the Internet arena, the growth of e-commerce is not much quickly as the Internet growth itself. It is largely hindered by the security threat. Many security protection mechanisms have been developed.
The SET (Secure Electronic Transaction) is an ‘open encryption and security specification designed to protect credit card transactions on the Internet.’ (Stalling, 2002) The initial version, SETv1, was emerged from a call for security standards by MasterCard and Visa in February 1996. Later more companies jointed the development of the specification, like IBM, Microsoft, Netscape, RSA, Terisa, and Verisign.
After years of evolution, SET is now widely used for secured digital transactions. The digital certificates, digital signatures, and digital wallets all function according to the SET protocol. (Free Encyclopedia of Ecommerce, n.d.)
There are several components for the SET protocol.
The Cardholder Application, also referred to as a digital wallet, is held by an online consumer and packages a digital signature and credit card information that ensures his or her identity and safeguards his or her financial information through a complex encryption system.
The Merchant Server component is the verification product held by the merchant to process the online card payment.
The Payment Gateway component is held by an acquiring bank or other trusted third party that accepts and processes the merchant's verification and the customer's payment information and filters them to their appropriate financial institutions.
The Certificate Authority component, usually run by a financial institution, is the trusted agent that issues the digital certificates and is responsible for ensuring that all users of digital certificates are in fact secure and trustworthy customers.
As the SET is more on the security mechanism side, the RSA is a cryptography algorithm. The name RSA actually named after the three inventor called Rivest, Shamir and Adleman, where they were the first to invent this algorithm for public-key cryptography. From Wiki, It is the ‘first algorithm known to be suitable for signing as well as encryption, and was 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.’ (Wiki, 2010)
In the cryptography, the key size or key length makes a difference on the security level. The 128 bits key size follows the standard AES (Advanced Encryption Standard) that published in 2001. Optional It also can use keys up to 256 bits (a specification requirement for submissions to the AES contest). 128 bits is currently thought, by many observers, to be sufficient for the foreseeable future for symmetric algorithms of AES's quality. The U.S. Government requires 192 or 256-bit AES keys for highly sensitive data.
2. What can you find out about network and host-based intrusion detection systems?
Intrusion detection is the process of monitoring the events occurring in a computer system or network and analyzing them for signs of possible incidents, which are violations or imminent threats of violation of computer security policies, acceptable use policies, or standard security practices. An IDS (Intrusion detection system) is a device (or application) that monitors network and/or system activities for malicious activities or policy violations and produces reports to a Management Station.
There are two main types of IDS's: network-based and host-based IDS.
In a network-based intrusion-detection system (NIDS), the sensors are located at choke points in the network to be monitored, often in the demilitarized zone (DMZ) or at network borders. The sensor captures all network traffic and analyzes the content of individual packets for malicious traffic.
In a host-based system, the sensor usually consists of a software agent, which monitors all activity of the host on which it is installed, including file system, logs and the kernel. Some application-based IDS are also part of this category.
Wiki. (2010). Intrusion detection system. Retrieved on 11 May 2010 from
Phishing basically is the online identity theft. It usually appears in the form of email of your friend or a trustworthy web site, and links to a web site to input the personal information like user name and password, credit card information.
4. What is SET and how does it compare to SSL as a platform for secure electronic transaction? Is SET in common use?
While the SET uses a mechanism to avoid the merchants get the credit card detail information, the SSL (Secure Sockets Layer) is a encrypted client/server protocols to enable safe communication between network devices.
The SSL was developed by Netscape, as a encryption standard for the data between a Web browser and a Web server. ‘The version 1.0 was never publicly released; version 2.0 was released in February 1995 but "contained a number of security flaws which ultimately led to the design of SSL version 3.0", which was released in 1996’ (Rescorla 2001).T
SSL is supported and built into all major browsers and web servers nowadays; it is easily used to install a digital certificate on the machine The encryption level also depends on the key size, with 40 and 128-bit, which the 128-bit key is deemed to be strongly secured for foreseeable future.
As supported by the major browsers and easy to use, the SSL is vastly used in the outlet shops.The SET might be more secure because of the double checking mechanism but it asks for higher cost and complexity, and mainly supported by the Visa and Master Card, therefore it is less popular.
5. What are cookies and how are they used to improve security? Can the use of cookies be a security risk?
Cookies are ‘name-value’ pairs to contain user information of the browser. It can store user name, password, site preferences…etc. This information basically are stored in text strings. The cookie is sent from the web server to the browser machine as an HTTP header, then sent back each time it access the server.
The cookies can be improved the security by encrypted the data.However, as it contains the user information, some spywares target the cookie to track the user’s privacy, so it can be a security risk.
6. What makes a firewall a good security investment?Accessing the Internet, find two or three firewall vendors.Do they provide hardware, software or both?
From a research report, a firewall can bring the below benefits as ROI (Computer Economics, n.d.)
The return on investment is calculated based on the following product benefits:
Increases network availability by stopping the spread of malicious code attacks (i.e., Nimda, Trojan horses, DDoS).
Protects remote users from attacks.
Reduces administrative costs and deploys rapidly with ePolicy Orchestratormanagement capabilities.
Stops internal hackers from stealing proprietary data from desktops.
Temporarily or permanently blocks unauthorized, vulnerable, and expensive application connections.
As the hacking technology getting advanced every day, the firewall technologies have to be getting up-to-date as well.The three firewall software below are the top-listed in 2010, from ‘All-Internet-Security.com’ (All-Internet-Security.com, 2010)
7. What measures should e-commerce provide to create trust among their potential customers? What measures can be verified by the customer?
According to the research from Xerox and Research Technology, the e-commerce trust can be measured by the ‘trust metric’. (Manchala, 2000) The measurement can be summarized as below.
Transacting entity: Any entity that engages itself in an electronic commerce transaction is a transacting entity. This entity could be a customer, a vendor, a broker, an intelligent agent, a payment server, or any intermediary.
Trust authority: Trust matrices are used to evaluate the trust on a certain transaction or on the next set of transactions. Unless these trust matrices are protected against manipulation and are maintained by certain authorities, transacting entities cannot trust them. These authorities are called trust authorities (TA). Transacting entities use trust protocols to access trust matrices. A TA maintains trust matrices by updating them based on the information received from each completed transaction. TAs should be able to provide proof to trust matrix updates using non repudiation services and to provide each of the transacting entities the level of trust index to be placed on a certain transaction.
Agreement Framework1: A relationship binding all the transacting entities involved in a single set of transactions. The relationship usually includes various policies for conducting transactions and is usually placed at a TA. Each set of transactions is interpreted based on the policy, and the results are used to update trust matrices.
M. Roscheisen and T. Winograd, “A Communication Agreement Framework of
Access/Action Control,” Proc. IEEE Symp. Security and Privacy, IEEE Computer
Society Press, Los Alamitos, Calif., May 1996, pp. 154-163.
8. Get the latest PGP information from http://en.wikipedia.org/wiki/Pretty_Good_Privacy The use of digital certificates and passports are just two examples of many tools for validating legitimate users and avoiding consequences such as identity theft. What others exist?
According to Wiki, Pretty Good Privacy (PGP) is a computer program that provides cryptographic privacy and authentication. PGP is often used for signing, encrypting and decrypting e-mails to increase the security of e-mail communications. It was created by Philip Zimmermann in 1991.
PGP and similar products follow the OpenPGP standard (RFC 4880) for encrypting and decrypting data.The latest version is called PGP5.
Besides the digital certificates and passports, web of trust and security quality are two other tools.
References
Wiki. (2010). PGP. Retrieved on 12 May 12, 2010 from http://en.wikipedia.org/wiki/Pretty_Good_Privacy
1. Set up the MySQL tools on your computer as described in section 6 above.
The GUI tool is called MySQL Workbench, and is downloaded from http://www.mysql.com/products/tools/. The latest GA version is 5.1.18a. A Microsoft MSI installation file is available. After installation, it is running successfully and the screen shot is as follow.
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).
I did not install InstantRails, but the Ruby and Rails from rubyforge.org. The version is 1.86-27, it is an older one but stable.
The RoR is installed successfully, and the folder c:\Ruby is created.
In this version, the RubyGems is not necessary to installed separately. But according to the installation instruction, two instructions to update the RubyGems are required.
C:\rudy> gem update rails
C:\ruby>gem install rails—include-dependencies (takes quite a while)
After installation is completed, the online taxi booking system (OTBS) is created by running command from the Ruby folder.
Associated folders are created.
To start the WEBrick server, below command is run at the c:\ruby\otbs folder.
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.
The port at 3000 of Rails is running as shown as follow:
The detail of the config/database.yml is shown below. The database that connected from three environment ‘development’, ‘test’ and ‘production’ are specified by default.
4. Generate the Passenger model by creating the MySQL database and ‘passengers’ table from the information above.
The procedure can be straightly followed through the Ruby on Rails instructions:
(a) Showing options by running without parameters
(b) Running script/generate command with table ‘Passengers’ and columns
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? Below is a simple example comparing the basic syntax. JavaScript if (card > 21) { document.write("busted"); } else if (card == 21) { document.write("won"); } else { document.write("continue"); } Ruby if card > 21 print "busted" elseif card == 21 print "won" else print "continue" end
3. While Ruby and Python are quite similar, can you find some similarities between Ruby and Javascript?
The main similarity between Ruby and Javascript is quite fundamental; they both have similar syntax and are object-oriented language.
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:
#!/usr/bin/ruby # The Dog year calculator program called dogyears.rb
def dogyears # get the original age puts “Enter your age (in human years): " age = gets # gets is a method for input from keyboard puts # is a method or operator for screen output
#do some range checking, then print result if age <> 110 puts "Frankly, I don't believe you." else puts "That's", age*7, "in dog years." end dogyears
Python
#!/usr/bin/python # The Dog year calculator program called dogyears.py
def dogyears(): # get the original age age = input("Enter your age (in human years): ") print # print a blank line
# do some range checking, then print result if age <> 110: print "Frankly, I don't believe you." else: print "That's", age*7, "in dog years."
Ruby Python File extension rb py Function quotation No quotation (): Remark # # Prompt Puts “ “ Input (“ “) End of loop 'End' statement No need to put ‘End’ Statement
Create an XML document for an online catalogue of cars where each car has the child elements of make, model, year, colour, engine, number_of_doors, transmission_type and accessories. The engine has child elements called number_of_cylinders and fuel_system.
Taking reference from W3School.com, below is the scripts.
1. Why is the perception getting stronger that integration will become a critical factor in coming days?
The perception of integration getting stronger is because it can bring business benefits. The benefits could be extracted from a research from a networking consultancy company called Camden. (Zeichick. A., 2004)The research is called 'THE BUSINESS BENEFITS OF INTEGRATION', and the main points are summarized below.
Integration may be the most cost-effective way for IT to add business value to the enterprise.
Revenue Enhancers 1. Sell more through suggestive sales techniques. 2. Boost customer retention by turning customer service into self-service. 3. Increase revenue by empowering your own sales and support teams.
Cost Reducers 4. Eliminate the cost of storing and managing redundant data. 5. Reduce the cost of manual data reentry and report generation. 6. Lower ongoing system administration expenses.
Efficiency Improvers 7. Accelerate application development using modern RAD platforms. 8. Control and simplify business processes via work flow. 9. Efficiently incorporate modern security programs.
Future Planning 10. Lay an architectural framework that will provide the enterprise with greater agility. References
Zeichick.A. (2004). The Business Benefits of Integration. Camden Associates. Retrieved on 3 April, 2010 from www.attachmate.com/NR/rdonlyres/...50C0.../literature_bbintegrate.pdf
2. What is the relationship of AJAX to JQuery (jquery.com) and the lightweight Web 2.0 javascript framework called MooTools (mootools.net) within the enterprise software architecture?
The below information are extracted from Wiki.
jQuery is a lightweight cross-browser JavaScript library that emphasizes interaction between JavaScript and HTML. It was released in January 2006 at BarCamp NYC by John Resig. Used by over 27% of the 10,000 most visited websites, jQuery is the most popular JavaScript library in use today. (Wiki, 2010)
MooTools (My Object-Oriented Tools) is an open-source, lightweight, modular object-oriented programming JavaScript Web application framework released under the MIT License. …The framework includes built-in functions for manipulation of CSS, DOM elements, native JavaScript objects, Ajax requests, DOM effects, and more. MooTools also provides a detailed, coherent application programming interface (API)[8], as well as a custom downloads module allowing developers to download only the modules and dependencies they need for a particular app.
References
Wiki. (2010). iQuery. Retrieved on 4 April 2010 from http://en.wikipedia.org/wiki/JQuery Wiki. (2010). Mootools. Retrieved on 4 April 2010 from http://en.wikipedia.org/wiki/Mootools
4. What does it mean to develop RESTful practices into our web applications?
Representational State Transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. Conforming to the REST constraints is referred to as being ‘RESTful’.
Constraints The REST architectural style describes the following six constraints applied to the architecture, while leaving the implementation of the individual components free to design:
Client-server Stateless Cacheable Layered system Code on demand (optional) Uniform interface
Complying with these constraints, and thus conforming to the REST architectural style, will enable any kind of distributed hypermedia system to have desirable emergent properties, such as performance, scalability, simplicity, modifiability, visibility, portability and reliability.
Impmenting RESTful web services A RESTful web service (also called a RESTful web API) is a simple web service implemented using HTTP and the principles of REST. It is a collection of resources, with three defined aspects:
• the base URI for the web service, such as http://example.com/resources/ • the MIME type of the data supported by the web service. This is often JSON, XML or YAML but can be any other valid MIME type. • the set of operations supported by the web service using HTTP methods (e.g., POST, GET, PUT or DELETE).
Unlike SOAP-based web services, there is no "official" standard for RESTful web service.[8] This is because REST is an architecture, unlike SOAP, which is a protocol. Even though REST is not a standard, a RESTful implementation such as the Web can use standards like HTTP, URL, XML, PNG, etc.
for buying some French perfume into the HTML form fields and submit button on the Web page form.
My scripts are as follow:
The screen shot of running the program is as follow:
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.
The scripts I found from the web is as follow, and the steps are very self-explanatory.
#!/usr/bin/python
import sys import time import cgi
sys.stderr = sys.stdout
# Read in a template for the page we're to generate
fh = open ("template.htp") html = "".join(fh.readlines())
# Read in the form contents and save them in a dictionary
inputs = cgi.FieldStorage() fill = {} for key in inputs: fill[key] = inputs[key].value
# Do Work! # Use values in input to create values in fill
matched = lines = 0 fval = fill.get("code","") if fval != "": fill["result"] = "Dialling codes starting " + fill["code"] fhdata = open("../../live_html/data/stdcodes.xyz") while 1: line = fhdata.readline(); if line == "": break if line.startswith(fval): fill["result"]+= " " + line matched += 1 lines += 1 fill["result"] += " matched "+str(matched)+ \ " out of "+str(lines) else: fill["result"] = "Your results will appear here" fill["time"] = str(time.time());
# Fill in the response template
for key in fill: lookfor = "%"+key+"%" html = html.replace(lookfor,fill[key])
# Send out the results
print "Content-type: text/html\n\n",html
3.Can you modify the script to process the form?
Yes, I can but I would not because it is quite simple already.