Thursday, November 23, 2006

FAQs on C programming language

Few days back I was thinking of collecting the common questions asked in various orkut communities on C. But then I found such a collection already exists.....the link is here

Monday, November 20, 2006

Untold love.....


Shei tumi kano ato ochena hole
shei ami kano tomake dukkho dilem...

Friday, November 10, 2006

Static libraries in linux

Some days back I was trying to create static libraries in linux. I tried to search for the method,but did not find anything anywhere.I got the method from a teacher,and it worked.So here it is for anyone who does not know.....
1.Create files having the impelementations of the functions you wish to have in the library.Suppose we write test1.c and test2.c.So,test1.c is
#include
int square(int a)
{
return(a*a);
}
and test2.c is
#include
int cube(int b)
{
return(b*b*b);
}
2.compile them as
gcc -c test1.c test2.c
3.write the header file having the prototypes of the functions.So,test.h is
int square(int);
int cube(int);
4.Write a program to test the library.Say it is program.c
#include
#include "test.h" //assuming it is in the same directory
int main()
{
int num;
printf("Enter a number\n");
scanf("%d",&num);
printf("Square=%d\nCube=%d\n",square(num),cube(num));
return(EXIT_SUCCESS);
}
5.Compile the program as
gcc -c program.c
then link with the other object files
gcc -o program program.o test1.o test2.o
6.Run it as
./program
7.Create a library from the individual object files
ar crv libtest.a test1.o test2.o
note that this is a static library with extension .a
8.Now we need to list the library into the system list,for this,do
ranlib libtest.a
9.This library can be linked with programs in a number of ways....
gcc -o program program.c libtest.a
and then
./program
to run the program

Or,you can do
gcc program.c libtest.a
to compile and link and
./a.out
to run the program

Or,you can do
gcc -o program program.c -L. -ltest
and
./program
Here -L. instructs the compiler to search for libtest in the current directory.

Similarly,we also have
gcc program.c -L. -ltest
and
./a.out

We can also place the library in the /usr/include directory.Then we wont need the -L option to specify the path.But -ltest option is needed.

Saturday, July 29, 2006

Lost in someone....

In the darkest nights when friends are few,
I close my eyes and think of you.
A silent night,a silent tear,
a silent wish you were here

Bubble sort in 8085A assembly

;Sorts an array of five integers stored in memory using bubble sort ;algorithm,assuming the array elements to be distinct
;Input:the array,number of elements
;Output:the sorted array
;destroys:none
;calls:sort
;target microprocessor:Intel 8085A
;The array starts from 9000.B and C are the two loop variables.A memory location is used
;to store data (9050)


main:
LXI SP,A000
MVI B,05
L:CALL sort
DCR B
JNZ L
HLT

sort:
LXI H,9000
MVI C,04
L1:MOV A,M
INX H
CMP M
JC L2
STA 9050
MOV A,M
DCX H
MOV M,A
LDA 9050
INX H
MOV M,A
L2:DCR C
JNZ L1
RET

Saturday, May 13, 2006

TRAITOR

See the personal website of a TRAITOR

Friday, April 07, 2006

The "worst profile in orkut" trick...

Orkut is fast becoming an well known social network.This is mainly due to it's firm architecture and security policies.Orkut is really secure,you can never really save the login password,you will have to type it every time you enter.But still,orkut has some flaws which allows some pranks to be played.To tell the truth,at first,I was also embarrased by this!!!
Did you ever see a scrap in your friend's scrap book or a post in a forum titled "the worst profile in orkut" with a link to the "worst profile in orkut"?When you click on that link,to your surprise,you land up to your own profile!!!Then you feel totally embarrased,and wonder how it is possible!!!Is'nt it?Did you ever wonder how it is done?Orkut profile urls look like this http://www.orkut.com/Profile.aspx?uid=15986554242344144315 .The number after "uid" is to locate your profile.The link that says your profile is the worst in orkut will look like this http://www.orkut.com/Profile.aspx?2uid=15986554242344144315 .See the difference?There is a 2 before "uid".Actually this should be a wrong url,but it is the orkut server that directs all such urls to the profile of the person who clicks them.This may be regarded as a flaw in orkut,or just a way to play pranks on your friends.Just as you will like to see this.

Wednesday, September 21, 2005

My first post,my intro actually.

"Giving an intro" that's what I am worst at (ask my seniors to confirm this).Anyways, I am Abhishek Chanda
I studied at Nava Nalanda High School for 12 years(from nursury 1 to class 10).Then I got admitted at South Suburban School (Main).I was a student of science ,my additional was statistics during HS.Then I landed up at Bengal Engineering and Science University,Shibpur.Now I am a student of Computer Engineering there.
The world was blessed with me on the 25th day of August 1986.
About my hobbies,I love reading almost all kinds of books.I love chatting with good friends.And ofcourse as everyone knows,I am addicted to computers and everything related to it.I love web programming,Linux and Unix system administration,networking etc.My childhood hobbies included stamp collection,coin collection etc.
I love melodious songs,those which can touch my heart.I love Rabindra Sangeet.My favourite singers are Sonu Nigam,Kishore Kumar,Mohd. Rafi,Asha Bhonsle,Lata Mangeshkar,Chinmoy chatterjee, Srikanto Achrya etc.
Well so much for now.I am really tired to day.
Bye bye.Have a great day.

free web counter
free web counter