Tuesday, April 30, 2013
Monday, April 29, 2013
Sunday, April 28, 2013
Hyper Terminal for windows 7
Here is the link to hyper Terminal to access the serial ports through windows 7.
Saturday, April 27, 2013
A Wonder full book to learn C++ Programming for Beginners
This Book covers the basics of C++ in a very lighter way. The language used is really amusing and simple to understand.
It is a hands on step by step resource of c++ that will guide you through each phase of C++ programming, providing you with the foundation to discover how computer programs and programming languages work.
Table of Contents
- Chapter 1 - How a C++ Program Works
- Chapter 2 - Memory and Data Types
- Chapter 3 - Variables
- Chapter 4 - Arithmetic Operators
- Chapter 5 - Making Decisions: if and switch Statements
- Chapter 6 - Nested if Statements and Logical Operators
- Chapter 7 - The For Loop
- Chapter 8 - While and Do While Loops
- Chapter 9 - Functions
- Chapter 10 - Arrays
- Chapter 11 - What’s the Address? Pointers
- Chapter 12 - Character, C-String, and C++ String Class Functions
- Chapter 13 - Persistent Data: File Input and Output
- Chapter 14 - The Road Ahead: Structures and Classes
AWK File scripts
Here is the link to an awk file. It calculates all the prominent parameters from a trace of new format. AWK FILE. You can enable generation of new format trace file in tcl file by statement "$ns use-newtrace", where $ns is the name of scheduler instance you are using. Also make sure the Agent(AGT) and mac trace are enabled in tcl file.
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
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.
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
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++ xgraphFix the error in the linking of Otcl by editing the line 6304 of otcl-1.13/configure so that it readsSHLIB_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.
You can also download the ns-allinone-2.xx package of ns-2 using mozilla and untar it using GUI.$ 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
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_PATHYou 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.
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
Subscribe to:
Posts (Atom)