~:: kalyan ::~

December 27, 2008

Christmas Holiday

Filed under: General, life — Tags: — skalyanasundaram @ 7:02 pm
  • Solved Rubix cube
  • Could solve the rubic cube. Dont know what method its. Right now taking lot of time to solve. 
    I guess i will end up breaking my cube some time, still need to practice for the nice movement.
    Look at my solved cubes, :)
    rubix
  • Finished reading Veronika Decided To Die
  • After reading The Alchemist, johnny suggest this one. This is indeed good. I liked it.
    The whole story was moving inside villete. "Every one is mad, the one whos not mad is
    whos not showing others that he/she is mad" is nice. Inspiring book. So, What next?
    Rich dad Poor dad? or Seven Ancient Wonders?
  • Watching TV a lot
  • Children of Heaven movie is cute, slow movie though.

And Advanced Happy new Year.

Advertisements

December 25, 2008

LOC counter

Filed under: open-source, Script — Tags: — skalyanasundaram @ 6:19 pm

I moved to a new project at work. I thought i would count the loc. AWK is cool for this job.

BEGIN {x=0}
{
if ($0 ~ /^[[:blank:]]*/*/ )  {x=x+1}
if(x > 0 && $0 ~ /.**/[[:blank:]]*$/) {x=x-1}
else if(x==0 && $0 !~ /^[[:blank:]]*/// && $0 !~ /^$/) {
print $0
}
}

There are lot of free loc counters available. May be i am re-inventing the wheel. Anyway it is my version. Comments are welcome. This does not count the single line comment and multiline nested comments and all blank lines are ignored.

You need to call this explicitly like, > find . -name *.c -or -name *.h | awk -f ./abovefile.awk | wc -l

Merry Christmas!!

Filed under: General — skalyanasundaram @ 5:47 pm

Did absoutly nothing today other than waiting for santaclause and watching TV at home 😉

Create a free website or blog at WordPress.com.