Thursday, January 11, 2007

Preparation of essentials for Lab sessions of Principles of Programming course at IIITMK





Principles of Programming is a course being offered at IIITM-K in Kerala, India during the 2nd Semester of the 2006-2007 Academic Year.

The aim of this course is to teach students the fundamental concepts underlying in programming. The course uses the Javascript language (no relation to Java) to introduce concepts essential for understanding programming from a perspective that emphasizes computational ideas (recursion, interaction, persistence) rather than grinding through language syntax. In addition, the course introduces concepts using a hands-on approach in which students will build and test client-side applications on a web Browser.

We had to perform the preparation of "Lab programming environment" in the project lab in one of the machines of Mrs.Smitharani a project Associate working under Edugrid and also one of the Associate instructors of the program.



The agenda of the program and requirements as part of it can be had from the below link:

http://www.iiitmk.ac.in:8090/wiki/index.php/Principles_of_Programming_-_ITM_121_AY_2006-2007_Sem2



NOTE :All these steps have been tried out in Linux or Ubuntu machines running in the Project wing.



Review : A close review of the System revealed that:



Installed : Emacs,Firefox v1.4 without addons,

Not installed : Mozlab and Mozrepl with Emacs,upgraded Firefox version,other addons for Browser



Step 1 : Install firefox 2.0 in Linux or upgrade from 1.x version to 2.x version




For that,first ensure that you are root user in the target machine.Take a backup of the profile of currently running firefox version,bookmarks,etc.



  1. Optional: Empty the browser cache, to reduce the amount of data to backup. Go to Tools > Options... (Edit > Preferences... on Linux), select Privacy and click the Clear button next to the Cache item in the list.
  2. Shut down Firefox completely (File > Exit).
  3. Make a copy of your profile folder to, for example, a CD-RW disc or a separate hard disk for backup purposes.
Find and remove the currently installed firefox folder with the executable(Dont remove library files in /usr/lib).Then,do a check to find some distributed optional files with firefox located elsewhere and perform staring firefox using command.



[root@localhost opt]# firefox



If it still starts up,the executable is still within /usr/bin.Use 'which firefox' command to locate and remove



Get newer version from the given link (Ver.2.0).Extract the archive into /opt/ and:



[root@localhost opt]# tar -zxvf firefox-2.0.0.1.tar

[root@localhost opt]# cd firefox

[root@localhost opt]# chmod a+x firefox run-mozilla.sh firefox-bin

[root@localhost opt]# ./firefox



This should fire up the browser if all libraries are working.But it showed the Glib library should be reinstalled.The following error was shown:



[root@localhost opt]# "libstdc++.so.6: libraries not found.Firefox cannot start"



So i googled and found following post."Firefox libraries are not properly upgraded.Perform the following command



[root@localhost opt]# yum install
libstdc++.so.6



You can check the installation by following command



[root@localhost opt]# rpm -qf libstdc++.so.6



and it should return the following line



compat-libstdc++-33-3.2.3-47.fc4 . Now we can start firefox using abovesaid command.



Now we can add a launcher for it from desktop by right-clicking on desktop > Add launcher > give Name as "Firefox browser" > give Command as "/opt/firefox/firefox".



I got an interesting link connected with it which can give you information on the possible risks associated :



http://listvine.com/2006/10/25/9-reasons-not-to-upgrade-to-firefox-20/



Step 2 : Check and intall subversion clients in machines for accessing repositories at Park Center office



I first checked installed instances of subversion in the machine using 'svn' command.It didnt detect anyone.Then,i issued following command as found in linux forum :



[root@localhost ~]# yum install subversion



It was done in 5 minutes.When we issue 'svn' command, we get the following message:



[root@localhost ~]# svn

Type 'svn help' for usage.



Now,we can use all svn-related operations.



Step 3 : Addons to the firefox browser for lab sessions



The following plug-in are need to install in your Firefox 2.0 browser.By clicking Tools > Add-ons in the Firefox 2.0 browser menu , click on the link in the right bottom "Get Extensions" . The browser will open Firefox add-ons page, you can search for the plug-ins in the provided in the bottom of the page. Search each plug-in and install it in your browser, the plug-ins get installed only when you restart the Firefox browser, ie close all the browser windows and reopen.

You can also directly go to the plug-in download pages given below under the subtitle.

You can check the detailed listing on the needed addons here:



http://www.iiitmk.ac.in:8090/wiki/index.php/Lab_Programming_Environment#Add-ons_to_Browser



Step 4 : Setting up Mozlab and Mozrepl for working with Emacs



Check if Emacs is already installed by issuing :



[root@localhost ~]# emacs



If it is not present,try installing it using yum or from its webpage here



MozRepl is a Firefox addon that provides a Javascript Read-Eval-Print Loop that directly interacts with the browser. It has other nice things as well. Here is a explanation of using MozRepl on a Linux notebook running Fedora Core 3.



http://www.iiitmk.ac.in:8090/wiki/index.php/Mozlab_and_MozRepl





Parts of this manual are reproduced from the IIITMK Wiki featuring "Principles of Programming" course

No comments: