Tuesday, October 23, 2012

thoughts about god




I can understand that if there exists a god ,there is only a single god, rest all are aliases pointing to the one god.so the question about one or many gods is settled for me.no need to discuss about that.

So , moving on, this is my doubt or view. its about the rules set by the god for us poor souls.
There exists so many different religions on earth. atleast 25 atmost a 100+, all with contradicting theories about what "god likes" and what "god dislikes" (isnt it funny , just thinking what god "likes" and "dislikes")
What makes a hard core believer of one religion think with 100 % certainty that only the set of rules mentiond in his religion's scripture is true and the things mentioned in other religions scripture (which are equally good for men and women) arent favored by the god.
Dont the people believing in other religions have an equal right to believe what they believe is true as well.


As I know no religion has any particular advantage with respect to any kind of proof about what the god actually said.
And if one religion produces one such proof , 3 other religions can produce 4 other such proofs about their (different) religions. there is no point discussing about such "proofs" , it will never end. And moreover if god really wanted to leave a proof , it could have come anyday as leaflets from sky or an open announcement in all languages spoken. It has never happened(or has it)
So isnt it clear as daylight their exists no proof at all about any the authenticity of any religions on earth and that god doesnt take sides.Arent all religions just speculation and hearsay (I know there are people who will have a different opinion on this, I can only pity their ignorance and inability to think for themselves, no offence meant)
what I believe is this , dont waste your time thinking about what god likes and dislikes, god doesnt want you to do that.Instead just wake up in the morning , do your job, help somebody if you can (atleast dont hurt anybody) go to sleep at night, and die someday.
And in between in your life ,if you are praying to god , ask god to give you the ability to think for yourself, not going blindly by some book which you don’t know who has written under what motive
whats most funny about it is that even after thousands of years of the hardest , the most painful lessons , even the most literate, intelligent people dont seem to understand that blind belief does more harm than good, instead they continue to argue and teach others about "what god said" .
God must be ROFL thinking how stupid we are Description: smile

Wednesday, August 22, 2012

How to automate the process of formatting code to meet coding standards while working with vim/emacs

It will help everybody if the code that you write follows coding standards.


Following are the challenges in doing it on a daily basis.

1 ) While writing code , people may not have the patience to enforce coding standards.
2 ) Different people will have their own personal preferences when it comes to coding standards such as K&R style, GNU style or Allman style and it takes a lot of effort to enforce a common style across all those who write code (ref : http://en.wikipedia.org/wiki/Indent_style )
3 ) A lot of code is already existing which does not follow a specific coding standard.

Under these circumstances, it would have been great if there was an automatic code formatting tool which is customizable to meet our specific requirements.

Fortunately , there is one !

That is the GNU indent tool 
(Please refer man indent || http://www.gnu.org/software/indent/manual/)

With indent, let your code be in any format ( or no format at all ), it will reformat your code for you , and present it to you in the way you need.

indent can be used in the Makefile's 'clean' section , so that the code is formatted every time you do a 'make clean'
This way it is ensured that the code is formatted with zero manual effort.

Following is an example section from Makefile (Please refer the man page to know more about what the different switches mean)

clean:
  rm -f *.o objs/*.o
  indent -kr  *.c include/*.h

Please note the following points while using indent.

1) Indent modifies your original source file . This way if your source file did contain any error (like a missing brace) indent may change your file to an illegible format. However this is not a problem as indent always backs up your original source file with the name 'original_file.c~' , as shown in the example below.

srcs]$ ls test.c*
test.c
srcs]$ indent -kr  test.c
srcs]$ ls test*
test.c  test.c~

2)Indent doesn't like the "// hi i am a comment" style of commenting. If it finds such comments it will format it to multiple lines, which will not look pretty.
Please take care to use the "/* hi i am a comment*/ " style of commenting while using indent

3)If a checked out source file is formatted with indent, the repository (svn for example) will show the file as modified even if you did not change any part of the file. However this is applicable only the first time you run indent. After the indented file is committed back to repository the first time, the file will be shown as modified only if there is a change done by the programmer.