Saturday, November 29, 2008

Mumbai Terror Attacks - Eenadu Story

I have seen many people making Fun of Media these days because of thier over-reaction and sensationalism. Recently, I read a news article in Eenadu, a leading dialy in Telugu(In some survey, it stands third nation wide in no. of readers). Artcile says that - "No Country is Touring Pakistan because of Terrorist attacks and all, India is also not willing to tour Pak in January, so if they attack India then Pakistan can question other teams which travel to India and at the end, They might have attacked India because India is not willing to tour Pak based on Terrorism". Anybody who have seen these attacks, can easily guess the planning and homework done for these firings. These are not some thing, which are thought on Monday and executed on Wednesday. Being a Leading News paper, Eenadu failed miserably in this aspect. You can find that article Here.


@sarmaLink

Monday, November 24, 2008

Team India Beat England and Won the Series 4 - 0

Men in Blue have won the Hero Honda Cup 2008 in very Authoritative Fashion. Team India has done good on many occassions so far and testing times ahead as there will be changes in team composition to give rest to players who are playing for some time and to test players who are sitting for some time. Before this series, it appreared to be clash between two equally good and Motivating Captains. But Dhoni out-classed KP in each and every department. Toss usually plays an important role in winning matches. KP won most of the tosses, but did not make money from any. Dhoni's thinking is always way ahead of KP, either in Bowling changes, opting for Batting Power Plays. Dhoni usually kept his main strike bowlers fresh by giving enough rest for Batting power play, while KP used them all the time, in a way they are not able to bowl successfully when there are field restrictions. Lack of thinking and Application from England Side cost the series. On paper, England side does compete with Team India, but on Field, they are hardly manage to do so. Its true that whatever Dhoni touches, its turning Gold, but Fortune Favours the Brave.

So Bravado Dhoni, Good Luck for Clean Sweep.

@kova

Tuesday, November 11, 2008

Creating a Shared and Static Library Using Gnu Compiler

Sample steps to create static and shared Library using gcc.

Program for which Library is created

Library Contains code to multiply two integers.

Header file contains Function Declaration.

find_mul.h

int multiply(int, int);

Source file contains Function Definition

find_mul.c

int multiply(int a, int b)
{
return (a * b);
}

Creating Static Library

A static library is a set of object files that were copied into a single file. This single file is the static library. Executable contains static Libraries at compile time itself. The static file is created with the archiver (ar).

we create object file for find_mul.cpp

gcc -c find_mul.c -o find_mul.o

and Static Library is

ar rcs libmul.a find_mul.o

Note: the library must start with the three letters lib and have the suffix .a

Creating a Shared Library

Shared Libaries need position independent code which is done by -fPIC

gcc -c -fPIC find_mul.c -o find_mul.o

and Shared Library is

gcc -shared -o libmul.so find_mul.o

Sample Program Using Library

main.c

#include
#include "find_mul.h"
int main()
{
int a = 20;
int b = 30;
printf("Multplication is %d\n", multiply(a, b));
return 0;
}

Linking against static Library

gcc -static main.c -L. -lmul -o statically_linked

For Running

$ ./statically_linked

Linking against static Library

gcc main.c -o dynamically_linked -L. -lmul
For Running,

$ LD_LIBRARY_PATH=.
$ ./dynamically_linked

Thanks to web.


@kova

Saturday, November 8, 2008

Team India - Dada and Jumbo

I have come across an excellent article on Sachin, Rahul, Anil and Sourav - how they influenced a generation of people in India. You can find article here. Personally, I also feel, if I had to watch Indian Team without Jumbo and Dada, I feel something like part of body missing.



@kova