Wednesday 29 April 2009

PHP and MySQL database access

I created a database named "mydatabase" and a table named "employees" in MySQL.

I inserted one record into the Employees table and try to execute the PHP script to show the record.

I always get the error message "HTTP 500 - Internal server error..." and then I check the Apache errorlog and find out the real cause is "PHP Fatal error: Call to undefined function mysql_connect()". Finally, after I have read through the following url, I know how to fix the problems now.


http://docs.phplivesupport.com/viewarticle.php?uid=1&aid=73&pid=3

I really don't know why I always engage with the setup problems but really thank God I can resolve them eventually. This is a good exprience.




I insert a new record through "add_record.html".



The new record is uploaded to the table correctly by "add_record.php".

I execute the script show_records.php to display multiple records.

Tuesday 28 April 2009

Perfume Order Form

I modified a pizza order form sourced from (Pickering, Powers & Johnson 1996) and which becomes the following Perfume Order form.

***************************************************
French Perfume

Pricing:

high
medium
low

Quantity



Brand Name



Fragrance Accessories:

Body Spray
Body Lotion
Shower Gel
Body Mist
Aftershave
Deodorant
Body Roll On

Name

Address












***************************************************

Not long ago I wrote a web form illustrated below which is being used in my form for handling IT equipment loan requests. The web form is an ASP web page written by both Visual Basic script and Java script, which is running on Microsoft Internet Information Server (IIS) platform. Behind the scene, the program is very complex as it incorporates a lot of business logics. In brief, it serves the following purposes:

  1. Check the access right of users as a measure of security
  2. Capture the data from users
  3. Validate the data through the field controls, the client side programming
  4. Pass the data to the middle tier programmig for examination (the business logics incorporated in the store procedures, the middle tier programming)
  5. Click "Submit" to post the data to the database, the backend server (if no error is found)
  6. Repeat step 2 to 4 until the data is posted successfully (if error(s) is/are found)

Can you modify the script to process the form?

The answer can be Yes or No. It really depends on how large degree you have modified the scripts of the form. Normally the web form will not be workable in other system ( I do not mean the platform e.g. IIS or Apache) even though you have modified the source codes/scripts. Because the web form is just the user interface of the web application and the business logics would be embedded in the client side programming for "thick client" and in the middleware or backend server for "thin client". For the web application with think client approach, you can modify the scripts of the web form according to the business logics of your application and process it on your system. However, this is not an easy task, you nearly reprogram the application in order to make it to work on your system. For thin client application, this is much more possible, you only need to change the field controls of the form to meet the requirements of the business logics.

Reference

Pickering G, Powers S & Johnson R 1996, Javascript How-To: The Definitive Javascript Problem-Solver, CH08, HT0801.HTM, CD-ROM, Waite Group Press.

User Input for database access with PHP


I don't know why the parameter doesn't show on the php page but definitely, it has been successfully passed to it. Any idea? Finally, I can work out why the parameter was shown on the php web page. This is due to the syntax issue of different version of php. I replaced the varaible $myname with $_GET["myname"]. It works.





Some server practice with PHP


I don't know why I can't get the values of the variable including ($REMOTE_ADDR $SERVER_NAME and $PHP_SELF) when running the EX61.php. But it works well with "hello_world.php" as well as "php_info.php".


After I have checked the ITC 594 Forum, I resolve the problem now.

Thanks a lot!




Saturday 25 April 2009

Network and programmng framework

According to Hughes' demonstration, he just use a standard API to build the chat application which runs through TCP/IP socket. In brief, this is a client/server application, the chat server is responsible to read messages from the source chat clients through one thread and broadcast them to all connected chat clients through another thread, and the main thread is handling new connections. Every new ChatClient will connect to the ChatServer; this ChatServer will hand the connection to a new instance of the ChatHandler class that will receive messages from the new client. Within the ChatHandler class, a list of the current handlers is maintained; the broadcast() method uses this list to transmit a message to all connected ChatClients. The following illustrates the operations of the Char Client Server system.


Buyya (2002) defines 'the Grid is a type of parallel and distributed system that enables the sharing, selection, and aggregation of geographically distributed "autonomous" resources dynamically at runtime depending on their availability, capability, performance, cost, and users' quality-of-service requirements'. The Grid is “distinguished from conventional distributed computing by its focus on large-scale resourcesharing, innovative applications, and in somecases, high performance orientation”.

Peer to Peer (P2P) is somewhat like a Grid but Ledlie et al. (2003) gives a statement that ' P2p's focus on decentralization, instability, and fault tolerance exemplify areas that essentially have
been omitted from emerging Grid standards, but will become more significant as the system grows'.

The Grid community is currently authoring a Web Services-oriented API called Open Grid Services Architecture (OGSA). The next generation of Globus us intened to be a reference implemetation of this API (Ledlie et al. 2003). P2P computing has been widely used for file sharing, distributed computation and anonymity. The pure P2P computing will not have server or client but every computer is a node in the network.

The development of the Grid and P2P will move to non client server model, more decentralised model. This will be good for massive information sharing and storage.

Comparing CLR and JVM

Microsoft .NET’s Common Language Runtime (CLR) and Java’s Java Virtual Machine (JVM) are the most popular web application development frameworks. Without installing either one on your computer, many web applications will be able to run on your computer.


The .NET framework's Common Language Runtime (CLR) is much similar to Java Virtual Machine (JVM), in terms of garbage collection, security, just in time compilation (JIT).


Java platform views the Internet world as one language running on different operating systems (OS), whereas .NET framework views the world running on one OS with a programmers having choice of multiple languages. Therefore Java platform interpolates multiple operating systems, and .NET framework interpolates multiple languages. Therefore, SUN Java does not focus on the GUI development as we know the server side programming does not really need GUI. On the contrary, Microsoft dominates the client side desktop market.

So far Microsoft has issued three development tools including C#, VB.NET and C++, including for developments plus five execution containers hosting this runtime, namely: ASP.NET, Windows Shell, VBA scripting host for Office suite, Visual Forms container and IE (Internet Explorer). Much like Java it contains a rich set of API and lib.

Besides, Microsoft has done an excellent job to standardise .Net framework CLI/CLR in European Computer Manufacturing Association (ECMA) and standardise Simple Oject Access protocol (SOAP) through W3C. These will help to take hold the web application development market.


References

Banerjee A 2001, .NET framework comparison with Java Architecture, Mindcracker Network, viewed 26 April 2009, <http://www.c-sharpcorner.com/UploadFile/abanerjee/DotNetforJava11292005023419AM/DotNetforJava.aspx>.


Buyya R 2002, Grid computing info centre, viewed 24 April 2009, <http://www.gridcomputing.com/gridfaq.html>.

Hughes M 1997, Building an Internet chat system, Multithreaded client/server chat -- the Java way, Javaworld, viewed 23 April 2009, <http://www.javaworld.com/javaworld/jw-01-1997/jw-01-chat.html>.

Ledlie J, Shneidman J, Seltzer M & Huth J 2003, Scooped, Again, Harvard University, viewed 24 April 2009, <http://iptps03.cs.berkeley.edu/final-papers/scooped.pdf>.

Friday 24 April 2009

E-systems Infrastructure

Probably, every IT practitioner knows about the history of the TCP/IP protocol.

The TCP/IP Protocol Architecture is a result of protocol research and development conducted on the experimental packet-switched network, ARPANET, funded by the Defense Advanced Research Projects Agency (DARPA), and is generally referred to as the TCP/IP protocol suite. It has 5 independent layers which are Application, Transport, Internet, Network Access and Physical (Stalling 2005 p.106).

Today Internetworking has highly adopted the TCP/IP architecture. The TCP/IP network has been dominating the market while there are many communications choices available, standardising on one particular protocol can make administration easier and reduce costs and complexity.

Internet Protocol (IP) is used at the Internet layer to define routing, logical IP addressing, the format of IP headers and packets, and interfaces. It provides routing function across multiple networks.

Transmission Control Protocol (TCP) is used at the Transport layer that enables data to be reliably passed through a network. Why? TCP uses a header to hold important information for performing its tasks. The header fields includes source port, destination port, sequence number acknowledge number, header length, reserved, flags, window checksum, urgent, options and padding and data. TCP uses the port numbers to identify application process on the sender computer and the receiving computer. Besides, TCP can do the error-checking on the IP packet. In case of any error, the packet would be resent again (Knott & Odom 2006).

The Domain Name System (DNS) is a hierarchic way of naming a computer on a TCP/IP network. The name of a network host is on the DNS hosted by the ISP.

The above are the fundamental components of the internetworks nowadays. In brief, IP is implemeted in all end systems and routers (which are bridging different networks). It acts as a relay to move a block of data (i.e. IP packets) from one host, through one or more routers, to another host. TCP is implemeted only in the end systems; it keeps track of the blocks of data being transferred to assure that all are delivered reliably to the appropriate application.
No matter you are running a close Local Area Network (LAN) or an open network if you adopt the TCP/IP model, you will need to have at least a DNS server within your network. All the hosts within the network need to find one another via the DNS server(s). Of course, behind the name of each host is identified by the IP address.
I can say, the Internet is actually the biggest network in the world. Your LAN, Wide Area Network (WAN), Intranet, Extranet and even your personal Wi-Fi gadgets are just the hosts of the Internet. Take the efiling service of Hong Kong Intellectual Property department (HKIPD) as an example, clients (most likely are legal firms) file their tradmark, patent or design applications through the official website https://iponline.ipd.gov.hk/base/bs0100.jsp. Of course, the clients need to registered their company accounts plus user accounts in advance. Money will be deducted from the accounts for each successful upload and e-receipts will be issued immediately. All the things are done over the Internet. Behind the scene, the process is far more complicated. First of all, the clients need to establish the e-system infrastructure for running the efiling service. Client sites need to follow the standard of HKIPD to setup their e-system infrasturcture. For example, a specific port number is required to open on the Firewall, official e-certificates are required for registering the accounts and the uploaded files must strictly follow the required formats.
The virtual private network (VPN) is a cost effective way to interconnect sites by using the Internet or other public network. For example, I can use VPN to connect two network sites located in two different countries. The beauty of VPN is offloading the wide area network management task to the public network provider. That same public network provides an access path for telecommuters and other mobile employees to log on to corporate systems from remote sites (stallings 2005). This can reduce the cost of B2B e-commerce and ease the operations.
The downside is the security of the public network would be out of control.

References

Knott T & Odom W 2006, Networking Basics CCNA 1 Companion Guide, Cisco Press, 800 East 96th Street, Indianapolis, IN 46240 USA, pp.462-463, 522-523.

Stallings W 2005, ‘Business Data Communications’, International Edition, 8th edn, Pearson Education, Inc., Upper Saddle River, NJ 07458, pp.98-128.

Thursday 23 April 2009

Rapid evolutionary prototyping approach

Rapid software prototyping is an approach which attempts to remedy some of the shortcomings of the life-cycle model. There are three types of prototyping: Throw-it-away, Evolutionary and Incremental.


Hekmatpour (1987) mentioned that 'Evolutionary prototyping is in complete contrast to the life-cycle model and regards development as consisting of three stages of design, implementation and evaluation, where these are carried out iteratively until the prototype converges to final system'.


The rapid software prototyping approach is very applicable to develop small scale projects. I myself are taking this approach to develop a simple web application at my firm. In the first place, I started developing the most fundemental modules of the appliaction by writting a couple of web pages and creating a rather simple database plus a few store procedures. This would be a prototype for users to give their comments. After I collected the comments from the users, I would modify the design of the application and program it accordingly. Then, I asked the users to evaluate and test it. I iterated this process a few times until it could meet the requirements for the first phase roll-out. That means I leave some requirements to the next phase. When the application is in production, I am adding more modules to it and prepare for the second phase roll-out. Meanwhile, I am designing it for the phase three roll-out. In short, addition and modification are two essential features of the entire development process.

According to Wikipedia (2009), Agile software development refers to a group of software development methodologies based on iterative development, where requirements and solutions evolve through collaboration between self-organizing cross-functional teams. I can say Evolutonary Prototyping approach is similar to Agile software development as they both do not focus on the initial design but focus on the development process. The iterative development enables the product to be in production in relatively short time. Besides, the design will be perfected throughout the entire development process. This approach is highly adaptive to the volatile business environment. Imperatively, the development life cycle of an application is much shorter in the era. Maybe this is due to the fast moving of the technologies. For example, Microsoft SQL server is one of the most successful products of Microsoft, which released newer version in 2000, 2005 and last year. You can see there is a new delivery every 4 or 5 years. Probably, the frequent release is more likely subject to the business perspective rather than the actual technological breakthrough.

Developers do not afford to have a thorough study and a detail design for a project because this is too costly and risky. I can say longer the development process you take and lesser the production time ythe appliaction has. Therefore, rapid evolutionary prototyping is a more practical approach to software development.

References

Hekmatpour, S 1987, ‘Experience With Evolutionary Prototyping in a Large Software Project’, SIGSOFT Software Engineering Notes, vol.12, no.1, ACM, also available as PDF, pp. 38-41.

Wikipedia 2009, Agile software development, Wikipedia, The free encyclopedia, last modified 21 April 2009, Wikimedia Foundation, Inc., US, viewed 23 April, <http://en.wikipedia.org/wiki/Agile_development>.

The evolution of e-commerce

Further to my blog yesterday, I would like to follow this path to share more about the development of e-commerce. Probably, everyone can get the meaning of “e-commerce” from Wikipedia or any other online knowledge bases over the Internet. The growth of e-commerce is highly related to the changes of the infrastructures of e-systems.
Nowadays, e-commerce has extended to various media. We can basically do business transactions through our mobile devices as the wireless networks like Wi-Fi, WiMax, 3G or even 4G and mobile devices are very well-developed.Therefore, it comes up with so-called M-commerce, T-commerce, U-commerce and so on.
Australian Competition & Consumer Commission (2008) illustrated M-commerce very well with examples below. However, it also mentioned other concerns the consumers need to consider.

Using your mobile phone to buy products and services is becoming a part of everyday life. Examples of this kind of trade—sometimes called m-commerce—include voting for reality TV shows, downloading ring tones and paying for car parking, and airline and concert tickets.

While using your phone in this way can be fun and convenient, there can be risks. To avoid them, you need to understand the costs and conditions of any products or services you buy.

Amazon Mobile, launched earlier this week, allows consumers to search for items on Amazon.com, update their shopping carts and wish lists, and make purchases from their iPhones.We can find many other ecommerce businesses over the internet.
Like HSBC ebanking, it offers the mobile mode, clients can use their mobile to access the ebanking services.
Many teens really enjoy downloading music or videos from the internet. Apple targets this market and successfully launched their products and services such iPod, iPhone, iTune and... They can shop through the Apple websites http://www.apple.com/.
Mobile games are very hot to young consumers. They download the games from the mobile games websites. Alternatively, they can actually subscribe the online games services. For example, "EVE Online" provides many different multiplayer games.
For adults, Britannica Online Encyclopedia is a paid service. You can get to its information by subscription. http://www.britannica.com/
References

Australian Competition & Consumer Commission 2008, Shopping on your mobile (m-commerce), Commonwealth of Australia, viewed 23 April, 2009, <
http://www.accc.gov.au/content/index.phtml/itemId/266899>.
Meisner, J 2009, ‘New App Lets iPhone Users Photo Shop Amazon’, Ecommerce Times, Mobile Apps, viewed 23 April, 2009, <http://www.ecommercetimes.com/story/65390.html?wlc=1240476927>.

Tuesday 21 April 2009

The success of e-commerce II

Nowadays, Amazon is no longer an online bookshop but has extended a wide range of products for sale. In fact, the online community approach has made it very successful to grow in the market. Otterbacher (2009) illustrated why the online community design (the “helpfulness” method of social navigation) makes Amazon so successful.
What is the “helpfulness” method of social navigation?
Online communities displaying textual postings require measures to combat information overload. One popular approach is to ask participants whether or not messages are helpful in order to then guide others to interesting content. Adopting a well-established framework for assessing data quality, we examine the nature of “helpfulness” (Otterbacher 2009, p. 955).

Amazon’s community has successfully adopted this methodology in its design. Participants post their quality book reviews which are rated by other participants in terms of helpfulness. Therefore, participants can select the book reviews based on the rating. As we all know that at the information era, we are flooded with information. This design can help participants to get the quality information.

Besides, the search engine of Amazon is very powerful and user friendly, I use it to locate the book I need. The price comparison model is also useful for users to see the differences among the commodities.

I myself have bought a few books and DVDs through Amazon. My experience is very positive. I can actually chase the shipments of my products and view my purchase from account. Like other online shops, I settle the payment by credit card.

Reference
Otterbacher, J 2009, ‘“Helpfulness” in Online Communities: A Measure of Message Quality’, Proceedings of the 27th international conference on Human factors in computing systems, Boston, MA USA, pp. 955-964.

Wednesday 8 April 2009

The success of e-commerce I

IDC, ACM & Alibaba are commercial websites, which more or less have adopted the characteristics of Online Community such as issuing membership, linking with local sense, providing blog and forums for sharing and etc. On the other hand, they all have differences in their approaches of Online Community.

IDC is the premier global provider of market intelligence, advisory services, and events for the information technology, telecommunications, and consumer technology markets (written in its website), which is profitted by selling their research papers and giving consultions. As an IT research company, she keeps in touch with the IT markets and IT professionals. To achieve this, IDC issue questionairs and news updates to their members regular and awards those who participate with the research with credit points and members can use those credit points t o purchase articles or research papers and the places for events/forums. Of course, you can choose to pay online by credit card. This is a typical e-commerce website and provides very little online community activities.

ACM is the world’s largest educational and scientific computing society, delivers resources that advance computing as a science and a profession. ACM provides the computing field's premier Digital Library and serves its members and the computing profession with leading-edge publications, conferences, and career resources (written in its website). Certainly, ACM is very different from IDC as it is a professional body. The members are governed by the code of ethics and Professional Conduct of ACM and are required to pay the membership fees yearly. ACM offers many news update, online forums and blogs. However, generally the particition rates are pretty low. It also accept online payment by credit card.

Alibaba is B2B e-commerce/e-auction company and claims as the world's largest B2B online marketplace, which offers membership, forums, trade shows, free websites and news. Besides, members can post their purchase requests and display their products for free. Members can trade wide range products through Alibaba. The side product of Alibaba, aliblog is very successful, which can draw many sellers and buyers to participate. Like ebay, it has very strong local sense of community and highly regards locality. But Alibaba is a free platform for buyers and sellers. The owner of Alibaba makes profit through advertising and therefore, it assumes no responsibility for transactions. This is purely the deal between the seller and the buyer. That's why the high participation rate is very vital for its success. Over 23 millions people visited the site in 2008 only (Wikimedia Foundation, Inc., 2009).

Reference

Wikimedia Foundation, Inc., 2009, Alibaba Group, Wikipedia, The free encyclopedia, last modified 14 April 2009, Wikimedia Foundation, Inc., US, viewed 25 September, <http://en.wikipedia.org/wiki/Alibaba_Group>.

Sunday 5 April 2009

The trend of the Internet - online community (II)

When we look into the popular online auction web site - ebay, we can observe that it has very strong sense of locatily with online communities. Under the top level domain http://www.ebay.com/, it has many sub-domains by country. The default page of each sub-domain has its locality.

Virtanen & Malinen (2008) claimed that "people tend to have a positive emotional bond to familiar places, and this psychological relation between people and their environment is referred to as place attachment". I greatly agree with this statement. That is why we can find immigrants with the same race would settle down together and build up their own communities through various means in Australia. For example, we can find China town, Korean town, Eastern Orthodox Churchs or Jewish synagogues in Australia, people build up their connection through these places.

Locality can give members a strong sense of virtual community. That is why the well-organised online communities such as Google, Yahoo, Facebook, Wikipedia and etc strongly focus on the locality. Very often, the languages to be used is the online communities are subject to the locality.

According to Virtanen & Malinen's studies, Facebook started as a geographically-based campus community, with its members sharing mainly local offline connections. It was launched outside US on 2006, quickly became popular in Finland in the autumn 2007and is now the 8th most popular web site in Finland. The result is prominent. That is why the great success of the online communities have pushed the growth of e-commerce.

References

Virtanen, T & Malinen, S 2008, ‘Supporting the Sense of Locality with Online Communities’, MindTrek: Proceedings of the 12th international conference on Entertainment and media in the ubiquitous era 2008, Tampere, Finland, pp. 145-149.