Sunday, April 12, 2009

Elevator Pitch# 1

I have just completed the writeup of the script for the elevator pitch and will be recording it with a MP3 player and embed it into the WORD document to be submitted to EAST later this afternoon.

Saturday, April 11, 2009

Workshop 4 - learning more about RoR syntax


1. Ok. I just went to http://www.fincher.org/tips/Languages/Ruby/ and had reviewed the samples.



Working with TEXT file reminds me of the VI editor, then i follow to download VIM.org's vi editor for windows XP. I think i will enjoy using it again.

Why do i need vi if i can just copy and paste from the tutorial into the notepad and save as .RB file and run it..

So i did exactly that for some of the rest of the tutorials.





I haven't completed all 46 tutorials. I did read it all though.
2.
What are the syntax differences in the way that Ruby and Javascript use the if statement?


There are some significant difference in the if statement in RUBY and in Javascript


- Ruby uses "elsif" and Javascript use "else if"

- Ruby does not place the comparision in parenthesis and Javascript do place the comparision in parenthesis

- Ruby does not use "then" and Javascript uses "then" option

- Ruby requires the "end" to finish the condition testing and Javascript uses the last set of {} parenthesis instead

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


Ruby is a server-side scripting and interpreting language and Javascript is purely a client-side play and similarities are that they can both handle similar input and outputs. The difference is the efficiency.



Workshop 3


I have Ruby on Rails loaded, downloaded MySQL Tools and have it all installed and working.
I also did find the database.yml file inside the config directory.

It keeps saying that sqlite3 is not available (no such file to load), when I issue at command prompt with "rake db:migrate".. At this point, I am puzzled. I mean, I want to overcome this, but I ain't no programmer anymore.. I will come back to this.

Workshop 2

1. I have setup the following focus group at the forum to discuss about the progress.

2. Convention Over Configuration (CoC) – means that Rails makes assumptions about
what you want to do and how you’re going to do it, rather than letting you tweak
every little thing through endless configuration files in XML or the like.

3. I load up the link but it does not appear to be live. http://wiki.rubyonrails.org/rails/pages/UnderstandingMVC

I also downloaded the MVCtutorial zip file and did walked through some of it

4. Watched the "video" at Youtube. The speaker Amando Fox is actually a very "good" presenter



5. Read through some of the description from this author about MVC. Quite enlightening.

Workshop 1

Q1. Make a list of all programming languages and web development tools used by you in prior experiences...

Q1. 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.

Web applicaiton framework
is a software framework that is designed to support the development of dynamic websites, web applications and web services. The framework aims to alleviate the overhead associated with common activities used in web development. For example, many frameworks provide libraries for database access, templating frameworks and session management, and often promote code resue. (Source: Wikipedia, 2009)

I have mainly used these languages in the past

1. C and Sun SparcOS Digital Ultrix or Kodak's BSD version of Unix back in 1990s
2. Cobol

For Web development, i have used the following

3. Basic HTML tools
4. Simple PERL/PHP scripts interfacing MySQL
5. Microsoft Frontpage as an authoring tool (I tried dreamwever and didn't like it too much)
6. other image cropping software and FTP tools
7. Off the shelf CMS, Shoppingcart (eg. Drupal, Joomla, OScommerce)

Q2. Ruby is "an interpreted scripting language" for quick and easy object-oriented programming. Find out about the Ruby language and discover what this means.

Ruby is an interpreted scripting language unlike lower level languages like FORTRAN, C, PASCAL which need to be compiled into executable sources. Ruby is slower but offers high efficiency including lower level control of the operating systems. Ruby does not need to be compiled to offer the same level of access as the predecessor when comes to programming langugages.

Ruby is percieved by many to be more elegant, yet it does pretty much the same job as PERL, TCL and Python. Thomas & Hunt (2000) strongly supports that Ruby does offer very elegant and lightweight syntax and offers some rationale to maintain easy to read clean code.

Ruby is object oriented based programming language and was originaly inspired by PERL and Smalltalk; and originally created by a Japanese called Yukihiro "Matz" Matsumoto in 1990's.

Q3. What is Rails and how does it work with Ruby?

Rails Rails is a web development framework written in the Ruby language which is designed to make programming web applications easier by making several assumptions about what every developer needs to get started. Rails allows a web developer or programmer to write less code while accomplishing more than many other languages and frameworks.

Ruby on Rails was extracted by David Heinemeier Hansson from his work on Basecamp, a project management tool by 37signals (now a web application company). Heinemeier Hansson first released Rails as open source in July 2004, but did not share commit rights to the project until February 2005. The latest verison is Rails version 2.3 which was released on March 15, 2009.


With the increasing popularity of the Rails web development framework, the Ruby programming language is making its way towards the top. By focusing on convention over configuration, RoR is lowering the barriers of entry to programming and positively impacting employee productivity-ultimately proving that all of the hype is true and well-deserved.


Rails work with Ruby by means of elegantly organized around the Model, View,
Controller architecture, usually just called MVC and also providing rapid feedback loop which allows developer to save time between making a change in code and seeing the results in the execution of your application on the screen

Q4. What is meant by "convention over configuration" in regards to the use of Rails in Web application development?


CoC is the short form for Convention over Configuration means that that Rails makes assumptions about what you want to do and how you’re going to do it, rather than letting you tweak every little thing through endless configuration files. 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.

Q5. When did Model-View-Controller begin and where is it used?

MVC begins in 1979 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.

MVC is often seen in web applications, where the view is the actual HTML or
XHTML page, and the controller is the code that gathers dynamic data and
generates the content within the HTML or XHTML.


Q6. Describe the steps involved with the MVC design approach

MVC is often seen in web applications, where the view is the actual HTML or XHTML page, and the controller is the code that gathers dynamic data and generates the content within the HTML or XHTML. The model is represented by the actual content, which is often stored in a database or in XML nodes, and the business rules that transform that content based on user actions.

The MVC design approach entails 3 major components - Models, Views and Controllers

Models (Active Record)
– A model represents the information (data) of the application and the rules to manipulate that
data.
– In the case of Rails, models are primarily used for managing the rules of interaction with a
corresponding database table.
– In most cases, one table in your database will correspond to one model in your application.
The bulk of your application’s business logic will be concentrated in the models.

Views (Active View)
– Views represent the user interface of your application.
– In Rails, views are often HTML files with embedded Ruby code that performs tasks
related solely to the presentation of the data. Views handle the job of providing data to the
web browser or other tool that is used to make requests from your application.

Controller (Active Controller)
– Controllers provide the “glue” between models and views.
– In Rails, controllers are responsible for processing the incoming requests from the web
browser, interrogating the models for data, and passing that data on to the views for presentation.


Reference

1. Thomas,. D & Hunt, A (2000) Programming Ruby: A Pragmatic Programmer's Guide, Addison Wesley.

Exercise 11. XML Introduction

1. The generic tool to parse XML documents are the browsers but other tools are also available in the market.

i) XMLPARSE at http://www.gnu.org/software/gnustep/resources/documentation/Developer/Tools/Reference/xmlparse.html

ii) expat - XML Parser Toolkit Version 1.2 at http://webdesign.about.com/gi/dynamic/offsite.htm?site=http://www.jclark.com/xml/expat.html

iii) LARK - http://webdesign.about.com/gi/dynamic/offsite.htm?site=http://www.textuality.com/Lark/

2. The benefits of adopting a schema standardised for a business sector enables

i) the exchange of documents between different people and organizations in much structured manner ;
ii) the control of namespace according to http://www.W3.org/2001/XMLSchema-instance allows for easier validation of documents ;
iii) allowing global standardardisation using pre-defined namespace that is muched needed.


3. SMIL stands for Synchronized Multimedia Integration Language, and is a XML markup language endorsed by W3C for describing multimedia presentations. It defines markup for timing, layout, animations, visual transitions, and media embedding, among other things.

This techonology will enable the users to make web presentation of with a variety of media items such as text, images, video, and audio, as well as links to other SMIL presentations, and files from multiple web servers. SMIL markup is written in XML, and has similarities to plain old html syntax.

It is specificlly useful for applying to the use of multimedia presentationon the web. As of Dec 1, 2008, The SYMM Working Group at W3C.org has published the SMIL 3.0 Recommendation.

Exercise 10. Application Server platforms in e-commerce

1. In the IBM website, it refers its e-commerce suites to Websphere whereas its most famous DB2 database products are more focused on to data management - although this intrinsicly also supports database driven e-commerce applications. Link is here
http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?subtype=ca&infotype=an&appname=iSource&supplier=897&letternum=ENUS200-415

In the ORACLE website, it largely refers their Siebel Commerce suites as their E-commerce platform that supports database driven applications. Link is here
http://www.oracle.com/applications/crm/siebel/self-service-ebilling/siebel-e-commerce-8-1-1.html

Sybase website also mentions its GDI . Link is here http://www.sybase.com/detail?id=1008953

For Microsoft, their e-commerce efforts has been with MSDN for small business although they also have relevant articles dated for 2005 MS SQL for e-commerce.

MySQL is a open source GPL license (acquired by Sun OS), but IBM, Oracle, Microsoft and Sybase are all related to paid/license software. In terms of functionality, there isn't much difference other than scalability and performance.

2. AJAX stands for (Asynchronous JavaScript and XML), is a group of interrelated web development techniques used to create interactive web applications or rich Internet applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. (Wikipedia, 2009)

Garrett (2005) suggested that "An Ajax application eliminates the start-stop-start-stop nature of interaction on the Web by introducing an intermediary —an Ajax engine —between the user and the server" And because of this efficiency, many organisation in the connected economy can employed this development framework as the software architecture of choice. The use of Ajax can reduce connections to the server, reducing IPC calls and users experience faster or more responsive applications. These important attributes will be significant in the enterprise software development level.

3. Ruby on rails's MVC and Flash's Action Script 2.0 are both object oriented programming language which allows both to create classes, definte sub-classes and its relationships.




Reference:

Garrett, J (2005) Ajax: A New Approach to Web Applications. Adaptive Path. Retrieved on Apr 12 at http://www.robertspahr.com/courses/cwd/ajax_web_applications.pdf


Wikipedia (2009) Definition of AJAX. retreieved on Apr 12, at http://en.wikipedia.org/wiki/AJAX

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

I was able to design a web form as this which was taken from a PERL SCRIPT from this link
I changed the code to reflect our need to use the data



The link of the PERL SCRIPT is at http://www.scriptarchive.com/download.cgi?s=ccver&c=txt&f=cc_ver.pl

and yes i was able to change the form to read input into new variables that I defined in particularly i changed to the variable to "parfarm" eq "french" then, process the Credit Card.

The CGI is placed onto the CGI bin directory. At this point, it did not process it right, as there may be some other errors from the original script.

Exercise 8. PHP and MySQL database access


I am having trouble getting the MySQL server/tools to work. I am not giving up yet. but I shall come back to this section later.

I did install it on to my PC natively. I started the MySQL Administrator. Then What's next ?

Exercise 7. User Input for database access with PHP

I was able to creat the small database access applicaiton at http://littlescientist.net/get-name.html

But it does not return my name; i check the syntax and it seems ok. the URL still also shows that myname variable being submitted is Daniel Chun

Exercise 6. Some Server Practice with PHP

I practiced by using my webhost's php instead of native installation.

the first attempt to use the php_info.php was working at http://littlescientist.net/php_info.php
it loads back a series of recommended variables - almost a complete table of help and guidelines.

I then followed Exercice 6.1 to create the small php to echo the local environment variable. but somehow this is not successful. I load it and renamed it to be http://littlescientist.net/practice.php. I think this is due to the $ root definition of local vs an actual host.


6.2 Hello_world.php - small application; I was able to complete this. I use "japanese Koni Chi Wa instead though.