Saturday 27 April 2013

Hyper Terminal for windows 7

Here is the link to hyper Terminal to access the serial ports through windows 7.

A Wonder full book to learn C++ Programming for Beginners

AWK File scripts

Following are the links to

1. Calculate end to end delay (old trace) E2Edelay

2. Calculate NRL (old trace) NRl_old_trace NRL   (new  trace) NRL_new_trace

3. Calculate Packet delivery fraction PDF

TIC TAC TOE GAME using graphical library of TURBO C

Here is the link to the tic tac toe game playable by two players.

Graphics_tic_tac_toe

Simple calculator in C using strings

You can download the flow-chart pseudo code and the c program from the link given below.
calculator_in_C

This program performs the simple functions of

1. addition
2. subtraction
3. multiplication
4. division.
5. remainder
6. expression evaluation including parenthesis(highest precedence) and precedence from left to right

Installation of ns-2.34 in Ubuntu 10.10

The process of installation of ns-2.34 is very similar to installing it in fedora.

Ubuntu doesnot contain the yum installer so you will need apt-get installer to get dependencies.

Run the following command to install all dependencies needed for installation of ns-2.34.

sudo apt-get install xorg-dev g++ xgraph

Fix the error in the linking of Otcl by editing the line 6304 of otcl-1.13/configure so that it reads

SHLIB_LD="gcc -shared"

instead of

SHLIB_LD="ld -shared"


NS2.34 installs smoothly with gcc compiler version 4.3. By default, Ubuntu10.10 ships with gcc-4.4.5. So we use a downgraded compiler version for the installation. This is done as follows :
Edit Makefile.in found at this location ns-allinone-2.34/otcl-1.13/Makefile.in as follows:

Find the line that says:
CC= @CC@
and change it to:
CC= gcc-4.3


And run
./install 

After ns-2.34 is successfully made you will have to give the path in similar way as u did in installation of ns-2 in fedora. You can see that post here to set the exact path. Good Luck  


Method of Installing ns-2.34 in Fedora 12




First of all Install the dependency packages.  This will create an environment to get ready to install NS-2.  All the packages will be downloaded from the Internet, therefore make sure you have an Internet connection.

It is advisable to do all the steps as a Super User, or abbreviated as su in Linux.  To change status as a super user, type:
su -
you will then required to enter the root password which you entered during the Fedora Core 8 (FC8) installation.
Then, you can start to install the package dependencies.
yum install autoconf
yum install automake
yum install gcc-c++
yum install libX11-devel
yum install xorg-x11-proto-devel
yum install libXt-devel
yum install libXmu-devel


After installation of dependancy packages is complete download and install NS-2.  In this example, I’m showing how to install NS-2 version 2.30.  I am using the all in one package, ns-allinone-2.30.
From the terminal, you can use the wget command to download the NS-2 package.  Then, decompress/ untar it before installing using the ./install command.  Please make sure that you are the root before installing the package.
$ wget http://www.isi.edu/nsnam/dist/ns-allinone-2.30.tar.gz
$ tar -xzf ns-allinone-2.30.tar.gz
$ cd ns-allinone-2.30.tar.gz
You can also download the ns-allinone-2.xx package of ns-2 using mozilla and untar it using GUI.
after that you will need to goto ns-allinone-2.xx directory and run the following command.


          $. /install


If you are familiar with the Windows environment, you will notice that there is section where you can configure the environment variables to set a Class Path.  In Linux, we also have the section, but it is not in a graphical user interface (GUI).  It is in a text file format named .bashrc.  You have to add some lines in the text file so that it can detect the NS-2 libraries to compile your script that you will write to configure your simulation scenarios and settings.
Go to the /etc folder.  Then type:
gedit .bashrc
Then, add some lines at THE END of the text file.  Remember replace “/usr/local/” by your installation path like “/home/najwan”.  These lines are:

# LD_LIBRARY_PATH
OTCL_LIB=/usr/local/ns-allinone-2.xx/otcl-1.xx
NS2_LIB=/usr/local/ns-allinone-2.xx/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/usr/local/ns-allinone-2.xx/tcl8.x.xx/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/usr/local/ns-allinone-2.xx/bin:/usr/local/ns-allinone-2.xx/tcl8.x.xx/unix:/usr/local/ns-allinone-2.xx/tk8.x.xx/unix
NS=/usr/local/ns-allinone-2.xx/ns-2.xx/
NAM=/usr/local/ns-allinone-2.xx/nam-1.xx/
PATH=$PATH:$XGRAPH:$NS:$NAM
 You can use these steps to install the later version of NS, such as ns-allinone-2.31 and ns-allinone-2.32. BUT make sure the version number is correct!  This includes the nam version, tcl version, tk version and the otcl version. replace the "x" with the correct version number as in your downloaded ns-allinone-2.xx.