Tuesday, June 27, 2006

Problems for which "Principle of Optimality" does not hold??

For many optimization problems we take for granted that DP (Dynamic Programming works). But the first thing we need to check before we use the DP technique is the "Principle of Optimality".
o If the aim of a descision sequence(d1,d2,d3,d4........dn) is to minimize/maximize some objective function, then for any di , 1<=i<=n , the subsequence (di,di+1,....dn) should also minimize/maximize the objective function respectively.
o One problem for which the "Principle of Optimality" is when we have a KNAPSACK problem which both negative and postive profits, we might well ask ourself if a Item has negative profit then why we select that Item? well you might have forgotten the other factor which is the size of item...
I dont know of any other problems.

Tuesday, June 20, 2006

[NON-TECH] Marriage is buying conditional LOVE its for loosers, unconditional LOVE is what winners get.

Well, have seen several guys getting married these days in india. I don't know some how people in india always think thats the ultimate thing. I have heard many people definition of SETTLING in life is something like "I neeed to get a high paying job, have a house a car and a beautiful wife and have children".....
I just think its bullshit if you marry you get to loose the fire in you, I just don't beleive in SETTLING in life. I just believe that "ITS JUST A JOURNEY which goes on and on and on......." , I don't think there is a destination where you think you have reached the NIRVANA and just bullshit marry and have SEX.....
I live a life for myself, I just beleive I just want to be happy without causing others any trouble (ofcourse envy and jealous are some thing I cannot help).
Any way reiterating things my aim is just to create technology for real good, not for building research papers or making a huge sum of money. Feel technology as an art and contribute without any motive. Some time I see that people tend to use my high energy levels, thats what I tell myself "Don't take it damn seriously, when can people expolit something ? if something is in abundance (high energy here) people exploit it. If I crib about people who expolit I'll loose my abundance of energy, I want more people to exploit me so that indirectly they are helping me to create a lot of abundance of energy to create things...."
Well if I keep all things aside (all but technology), people's egoes, money, holidays etc... life just ROCKS for me I love it.

Friday, June 09, 2006

Yet another memory corruption on linuxipf, new FAT POINTERS on IA-64

Well its really gruesome last two days, was haunted by this problem in which my program on IA64 gets stuck just before the exit, I drilled down to _IO_flush_all @@ glibc which is not returning. After a elegant investigation found that a memcpy into a invalid address cooked up all this it basically created a cycle in FILE *ptr->_chain which is the reason why _IO_flush_all was not returning..
Well IA-64 had been a real good thing to work with, it has a real helpful kernel maintainers especially at ia64-linux@kernel.org, Well these guys gave me a lot of insight into several things RES backing store [60000fff80000000-60000fff80004000 rw-p 0000000000000000 00:00 0] this segment maps for every process on IA64 kernel.
Well other intresting thing is about the FAT POINTERS, the IA64 ABI mandates that the call to functions should be done via FAT POINTERS. do a google search if you want more details about this....
All in all a good productive week also fixed a couple of HSIM issues..
I really love it.

Wednesday, June 07, 2006

IA64 different virual memory layout

Hey just found that the IA64 is having a totally different mmap space and start of the text generally text start at 0x08048000 but here it starts at some 0x400000000000000. and also the mmap space is above &_etext in contrast to below &_end.

Thursday, June 01, 2006

How SIGINFO structure makes our life easy...

Well have been fixing code failing due to SIGFPE, The code was written to handle all signals like (SIGBUS,SIGFPE,SIGSEGV....). Well the culprit is SIGFPE which generally happen due to compiler optimization, the tricky thing is that I dont recevie SIGFPE when I run this through a debugger, it happens only when I run it normally.
Writing siginfo handlers will help you get the culprit virtual address which causes the problem. See the following handy code.
struct sigaction action;
action.sa_sigaction = my_handler;
if(sigaction(SIGBUS,&action,NULL)<0) {
printf("Cannot register handler\n");

void my_handler(int sig,siginfo_t *siginfo,void *ucontext){
if(sig == SIGBUS){
printf("SIGBUS Caught\n");
printf("SIGBUS due to address alignment at %x\n",siginfo->si_addr);
printf("SIGBUS due to BUS_ADRERR%08lx\n",siginfo->si_addr);
printf("SIGBUS due to hardware\n");
} q

Cheers! V.