Sunday, November 26, 2006

[TECH] Algorithm to find euler circuit in a graph in O(|E|)

Important observation I found is that, if we delete a cycle (delete all the edges which form a cycle) from the graph which has a Euler circuit, the property of the graph still remains, i.e the necessary and sufficient condition for the graph to have a Euler cycle is that every vertex should have even degree. And also there has to be a cycle at every vertex.

INPUT: G =(E,V)
v = v
euler_cycle = NULL;
while(|E| > 0){
 /*Find a cycle in G, start
   the search at v, returns c0 around 
  which cycle is formed*/
 c0 = FIND_CYCLE(G,v);
 v = GET_NON_ZERO_DEGREE_VERTEX(c0); 
/*Above can be done in constant time,
 using some space while finding the cycle
 */
 MERGE(c0,euler_cyle);
/*constant time operation,
 put c0 after an edge e1 in
 euler cycle which ends at 
 vertex 'v', we can just remember 
 the position of v n euler_cycle
 every time we merge*/

}

[TECH] Building tags on the complete source code...

I see that sometimes

  $ctags -R *  
don't work. I just typed
$ctags -R *
in my cygwin it crashed
 ctags.exe.stackdum 
. Well now the question is how do I build the tags on the complete source recursively if
  -R 
don't work, we can use the the following to build the tags


$find . -name "*.c" -exec ctags -a \{\} \; -print; sort tags > tags1; mv tags1 tags;

The -a option appends to the existing tags file build

I initially thought that ctags keeps some seek information of the file in tags file,but just was amazed its a 3 column multientry text file, the first column is the tag which you are searching, second column is the file where is tag is and the most interesting part the 3 column is the search string for vim....hmmm see every one takes advantage of the plethora of things vim can do :)

Make_bp_profile ./RNAlib/ProfileDist.c  /^PUBLIC float *Make_bp_profile(int length)$/
Make_swString   ./RNAlib/stringdist.c   /^PUBLIC swString *Make_swString(char *string)$/

.........luv.......Vamsi

Saturday, November 25, 2006

[TECH] Never use a file stream for lookahead reading while using lex.....

Just got the parser working....I did a lot of modification to mac's code, especially the grammar rules which have the lookahead information while parsing. The code tries to read from the

yyin
file stream of lex, but that is really pathetic because lex code is now optimize and it position in the lex buffer may not correspond to the position in the filestream...well this is what is the bug in code, well it took a while to fix. But its a good one.

I added lookahead rules

(st,bt)\n[\+]{linenum++;}
(st,bt)\n[\*].*${linenum++;}
for lookahead extensions and comments in the spice syntax.

Tomorrow I'll get the layout printed ,,,,,,

Apart from this folks from india called and were telling me about the issues regarding priya pickles, well I think its really a slander against Ramoji Rao, any way I support this guy...yes may be after that great 3 day party at ramoji film city makes me baised, I guess you too will be baised once you receive that wonderful hospitality at hotel sitara in ramoji film city...when our team (verification group) went out there I saw mithun chakraborthy

..........luv..........Vamsi

Thursday, November 23, 2006

[TECH] SPICE layout generator.......

I have been a bit of slackish this week, but sure I want to start running soon.

Last night I read about the BPlane (Binned Plane datastructure used in micromagic, I need to implement that in magic soon).

Tonight, I thought about backing up my CVS repository regularly into my external hardrive, so that I can keep all my projects safe.

SPICE Layout generator

My new project, which generates cell layout from by reading from the SPICE files (transistor netlist) directly. I need to rewrite some of the code for the algorithm which tries to find the EULER trace in the transistors graph (and also its p-stack dual graph). Its exiting for me start it today....

I'am in love with my life for the first time.......writing code is what I loved apart from all other tensions in life I love it

Tomorrow morning I'll be running for the sale in circuit city and best buy

[TECH] SRM327

http://www.topcoder.com/stat?c=problem_statement&pm=6871&rd=10007

/*
 * topcoder_class1.java
 *
 * Created on November 22, 2006, 1:41 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package topcoder_srm1;

/**
 *
 * @author vamsi
 */
import java.lang.Math;

public class NiceOrUgly{


   
    private boolean checkNice(char[] s_arr,int len){

 int vcount=0;
 int ccount=0;
 int i;
 for(i=0;i

I challenged some guy in this SRM got 50 bonus points.

..........luv......vamsi

Monday, November 20, 2006

[TECH] DAG's and Dynamic Programming......

Directed Acyclic Graph (DAG), directly embeds into dynamic programming....as from Vazirani's notes, the useful property of the DAG is that its nodes can be linearized (topologically). So if we process these nodes in the topological order we have sub-problems solved and the solution can be used for the next level. In the simple example of shortest path, we need (u1,v) , (u2,v) are the edges adjacent on the node v. To solve the shortest path problem we need the shortest path to u1, u2 to get the shortest path to v. The wonderful property of the DAG's is that if we start with the topological SOURCE (may be hypothetical by adding 0 weight edges), we are sure that we solved u1,u2 before solving v (if we process the nodes in topological order)

Longest monotonic subsequence in a given sequence, suppose the given sequence is '5,2,8,6,3,6,9,7' (The longest monotonically increasing sequence) in this is 2,3,6,9. On the first look, it appears that it doesn't have sub-optimality inside it. In the sense take a subsequence '5,2,8' the longest monotonically increasing subsequence in this is is (5,8) or (2,8) but neither (5,8) and (2,8) is not in the overall longest monotonic subsequence, so the question is how dynamic programming works here??.....well people don't talk about the sub-optimality here......but still this can be solved by dynamic programming...
Let me restate the principle of optimality here...."If a optimization problem involves of sequences of decisions d1,d2,d3,d4...dn . The principle of suboptimality states that what ever decision you make initially the rest of the decisions should still optimize whats remaining after making decision d1...i.e would form a sequence of decisions to save a smaller optimization problem
Any way I wrote the following code segment , S[i] = length of the longest monotonic subseqence ending at index i, input is a array of integers A[i].

global_max_length=-INFINITY;
PATH[N];
for(i=0;i0;j--){
      if(A[j] < A[i]){
         if(S[j]+1 > S[i]){
             S[i] = S[j]+1;
             if(S[i] > global_max_length){
                 global_max_length = S[i];
                 PATH[N] = j;
             }
             PATH[i] = j;
         }
      }
   }
}

void printSeqence(){

 int j=N;
 do{
  print("%ld ",A[PATH[j]]);
  j = PATH[j];
 }while(j!=PATH[j])

}

global_max_length , returns the length of the longest monotonic increasing sequence, and also prints the sequence

Apart from this life has been very cold, man today was REALLY_ __FREEZING__ here, I have cold the damn cold, I cannot drink cool drinks, eat any cold stuff it sucks......Well , I'll be going to India soon meet swapna,chamu...just talked to chamu on the phone, hope to see her and swappy soon...............THE LIFE GOES ON ON ON...by the way the GYM is closed till 26th and its cold outside I cannot even jog its really HELL out here

With love ...............Vamsi...............

Tuesday, November 14, 2006

[TECH] Channel Router for cell synthesis......

Its quite an effort to get this thing working.....started on saturday night , worked on sunday, and monday night its done


perl had lot of kookups especially my $a,$b and my ($a,$b) are not the same, I pulled it from the manual. sometimes its really hard to fix this kind of errors, thanks for that wonderful debugger 'perl -d' , its really great to work with.

But I did'nt see if perl debugger has a backtrace kind of facility? just a gdb?


Life apart for my passion of the CGEN2MAGIC project, is quite slow need to study a lot about that Border Minimization Problem, also got the home work done on parallel algorithms and network flows.


I guess I'have started loving algorithms/problem solving...its really kewl


Take care....HAPPY CHILDRENS DAY.

Saturday, November 11, 2006

[TECH] Setting up VNC on LAN

Today I got my laptop dell-inspiron-640m, I have linux desktop running fedora connected to a wireless router which my friend uses, so totally we have 3 computers connected to the wireless router. Actually we have cloned the MAC address of my desktop onto the wireless router. Now I want to use my laptop and start working with vnc on my desktop. By default the port 5901 was firewalled, I had to setup the firewall to accept the tcp:5901. After which I had the probelems with the window manager, by default kde starts the twm& . So I edited the xstartup file to get the kde.


kwin & kdesktop & kicker &


You need all the three things to get the kde desktop up and running

Well thats all the infrastructure work, now I'am back to write the CHANNEL ROUTER for CGEN which I have not worked on for the last three days, due that motif-algorithm which I have been working on, last week I also had the polynomial algorithm for FINDING OUT ALL THE CUTS in the network flow graph.

Take care guys, I also had a long chat with swapna and that was really wonderful.

Monday, November 06, 2006

[TECH]Crippled mmap

I was trying to use a anonymous memory mapping to use in the first version of the Tile database memory manager which I was writing,

mmap(void *start_address,size_t length,int prot,int flags,int fd,off_t offset)

. I had prot = MAP_ANONYMOUS , (I thought its equivalent to MAP_ANON | MAP_PRIVATE , the man page says MAP_ANON , is depreciated). Well any way I got it fixed by MAP_ANONYMOUS | MAP_PRIVATE.


Last time I had problem with this syscall is when I need to mmap to actual address's , i.e the start_address argument is not NULL, once again WHEN YOU DO A MMAP FOR A STATIC ADDRESS YOU NEED TO HAVE OFFSET OF THE FILE ALIGNED TO THE PAGE BOUNDARY.

Friday, October 27, 2006

Fridays seems to coming very quickly.

I dont know why Fridays seems to be coming so quickly for me? I'am doing less work?.

Sunday, October 08, 2006

A melancholic 24th birthday....but I think I have started to think

Just added a year of life's experience, its really the coldest birthday I had ever had, it really feels lonely here. Nothing to smile about except the fall colors to cheer up missing all my loved ones back home, sometimes I feel I don't like it here(infact any where away from home)....
The other day I was returning back from the bus I broke within my heart, I knew I was a little more capable of getting into a better school, all my friends I have studied are now in better schools and me at UCONN making that hasty desicion to move from UCR....
I could certainly feel that I have a really hard luck, I don't know I think I have a nac for the SELF PITY for myself...first time in my life I feel I need to compromise, really I feel very low every day dont know why. May be I'am missing people very much, more than I could ever think of...mom told me to come back to india if I dont feel good here....you know at the same time I feel that by doing that I'am running away from the problem, ok now I'am in the problem a big complex problem the only way I can overcome this just by solving it....I say to myself I'AM TRANSFORMING TO MYSELF TO ATTAIN STRENGTH AND ENERGY TO SOLVE PROBLEMS....God please give me STRENGTH to face this problem. I know that I'am not a genius to come up with some idea to create a revolution but I'am trying sincerely...I don't do things to impress any one...
I don't feel any selfish any more the other day I was thinking about the change in me, I don't know I started feeling happiness in others happiness, sometimes I just did things that people are happy, although I don't expect anything from them.....
What ever it might be its really a rocky ride ahead of me....

Sunday, September 10, 2006

[TECH] Buffer insertion and signal integrity.

10-09-2006...if we add up all these its a perfect modulo of nine. Well today I started my research. Studied the classic "Buffer Insertion Algorithm" paper, its really great I the moment I read it I see the application of dynamic programming in it.
Well its a well studied problem after all this should have been done, but I'am loving it application of algorithms. The basic principles I need to stick to is honesty. I want to carry on like this feel good about it every day I sleep.....Well Its becoming a habit for me.
Delay modeling is a totally different research area, but the classic paper assumes a simple Elmore delay modeling...I guess I need to design a good algorithm which strikes a right balance on delay estimation and timing minimization.
Apart from that I wanted to see how much I can think backward. I tried to recall what I have done in my last few new years.
2006--> Partied in escape pub, hyderabad [I got a wildest dancer prize :)]
2005--> Freaked out on the roads boozing, my friend veeru with me he was annoyed a little that day :(
2004--> Well I was interning at Oracle this time, drank bacardi and made a mess, I guess I was frustrated that I was not having a grilfriend :))
2003--> Well I was with my parents in railclub. 2002--> I think I did nothing, but tasted beer for the first time...

Cheers! Vamsi

Saturday, September 02, 2006

Yes I cannot cheat myself......I never had...I'am proud that I was myself

Well I always had that guilty feeling in me every time I told everyone that I'am going to california and study. Every one thought that its some how great to belong to california, well pheadrus in me was I guess taking a break...started to enjoy the material pleasures and forgot about his journey which is the quest of quality. Yes indeed I wanted to cash on the name of UC .
Although I couldnt blame the professor for bringing me this far I need to blame myself. I know I want to do more fundamental things rather then jumping in something which I claimed to know, I told people that I had been working in a mixed signal simulation tool development. The word DEVELOPMENT here meant a different thing, I never really wrote anything core, what I was doing was just doing all system realted work to make the tool work. Well I guess I was somewhat doing well in what ever I had done. When I got admission at UCR with this background I started feeling guilty, I want to make up for it by looking into books on how fastspice was implemented, although I had a very high level of understanding on how fastspice worked I thought I could make it and decided to come to riverside. But when I talked to the professor I felt bad that he want to make use only programming skills which I had, he never expected me to design new algorithms, create new paradigms to revolutionize the research. Just at this moment I decided to leave this place RIVERSIDE. I CANNOT JUST DO SOMETHING JUST TO BELONG TO A UC AND BELONG TO CALIFORNIA AND TELL THAT PROUDLY FOR ALL THE PEOPLE OVER THAT WORLD...........I THOUGHT I'AM CHEATING MYSELF I CANNOT TAKE IT I DECIDED TO MOVE TO UCONN.
I know Dr.Raj was a great prof but people dont want me to go there when I said I got admit in a UC, well now I really dont give a damn shit on which university I belong I want to really learn the ART OF ALGORITHM DESIGN and apply in much more elegant manner with more CS pedagogy.....I FELT IF I COULD MASTER THE ART OF SOLVING PROBLEMS WITH A COMPUTER.....IT DOESNT KEEP MYSELF JUST TO CAD I CAN APPLY MY ALGORITHM DESIGN SKILLS TO ANY PROBLEM....I'AM EXCITED TO WORK UNDER DR.RAJ....
Well this is excatly what happens in pheadrus's book.......BUT I ADMIRE MY GUTS TO NOT TO CHEAT MYSELF EVEN TILL THE LAST MINUTE....ITS NEVER TO LATE TO GET IT BACK....,,,,,,NOW I NEED TO LIE SAYING SOMETHING TO THE OLD PROF AND MAKE SURE THE BRIDGES ARE NOT BURNT......

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;
action.sa_flags = SA_RESTART | SA_SIGINFO | SA_RESETHAND;
if(sigaction(SIGBUS,&action,NULL)<0) {
printf("Cannot register handler\n");
}

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


Cheers! V.

Wednesday, May 31, 2006

Gives some solace.....

I have been thinking that I have reinvented the wheel, I had that guilty feeling when I did'nt use _etext , _edata , _end to figure out the begining and end of .data and .bss sections, which I rather got from the ELF sections. I had a feeling that I reinvented the wheel until I tested the code with _etext , _edata and _end they seem just SCREW....My method was and elite one I love it...I'am really happy. I love it. Now I realize how its a different feeling when you do things really right from your heart, other day after my workout (obviously with a lot of sweat, I generally jog for 33minutes cover 3 miles and burn 500 CAL) I was talking to arindam. I really liked what this guy said. He said "Workout spirit is something you need to get right from your heart just like a 100m sprinter......Theres just no showoff" WOW I liked what he said thats what I'am after in my life be it technology or art or just life.... KEWL V.

Sunday, May 28, 2006

ELF CORE file optimizations in Linux, problems with non standardization of core files.

Well, all these days life is revolving on BINARY RECONSTRUCTION from the corefiles(although this is only one of the ideas I have currently for BINARY RECONSTRUCTION).

o After my deep observation of the fact why core files have some program headers which have phdr.p_filesiz==0, found that David Miller, had added some changes to the core file which the linux kernel dumps, the optimizations are ofcourse to reduce the core file size, so I guess these guys are taking off the text part of the executable and the text part of the dyanmic shared libraries.

o My Question is WHY?? WHY?? do these people just dont try to stick to standards (if some standard dont exist they should create one, and once they enhance some stuff then update the standard rather than just flushing the changes into the code), in this opensource community this is really bad that the current standard of the core file depends on few induviduals.

I checked the PHDRS (readelf --segments) the following are the PHDRS of the core.exe
=================================
Elf file type is EXEC (Executable file)
Entry point 0x8048364
There are 11 program headers, starting at offset 52

Program Headers:
 Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
 NOTE           0x000194 0x00000000 0x00000000 0x00a48 0x00000     0
 **LOAD           0x001000 0x08048000 0x00000000 0x00000 0x01000 R E 0x1000

 LOAD           0x001000 0x08049000 0x00000000 0x01000 0x01000 RWE 0x1000
 LOAD           0x002000 0xf649b000 0x00000000 0x01000 0x01000 RWE 0x1000
 **LOAD           0x003000 0xf649c000 0x00000000 0x00000 0x132000 R E 0x1000
 LOAD           0x003000 0xf65ce000 0x00000000 0x03000 0x03000 RWE 0x1000
 LOAD           0x006000 0xf65d1000 0x00000000 0x03000 0x03000 RWE 0x1000
 LOAD           0x009000 0xf65e8000 0x00000000 0x01000 0x01000 RWE 0x1000
 **LOAD           0x00a000 0xf65e9000 0x00000000 0x00000 0x15000 R E 0x1000
 LOAD           0x00a000 0xf65fe000 0x00000000 0x01000 0x01000 RWE 0x1000
 LOAD           0x00b000 0xfeffe000 0x00000000 0x02000 0x02000 RWE 0x1000
===================================

o As I said earlier I see some of the PHDRS are having FileSiz as zero, the
first (1st **ed ) PHDR which is having virtual address 0x08048000
(this is obviously) the start of the text of the program, and its not
having any memory in the core file.

o The other PHDRS for which FileSiz is zero correspond to the
dynamic shared objects (.so) text , example in the above we see (2
**ed ) PHDR with VirtAddr as 0xf649c000 , so this means the text of
some shared .so has been mapped here.

o I had a question about the memory mapping with permissions r--s or
r--p (gconv used by glibc gets mapped like this some time) , so does
the core file contains this information of the memory mappings? IMO this content
is also mapped as PROGBITS I guess not sure.

o Is there a way I can findout the standard which the OS follows to
write the core file? No absolutely no, solaris dumps the entire core.

o Rather than depending on the OS core file, hows your opinion on
writing out all the mappings form /proc//maps as PT_LOAD into a
elf formatted file of type ET_EXEC, do you think this works? rather
than converting core file to exe?

Should I start working to write the standard.

=======================================================
#include
#include
#include
#include
#include

#ifndef __64_BIT__
#define __32_BIT__
#endif

#ifdef __32_BIT__
#define ELF_EHDR Elf32_Ehdr
#else
#define ELF_EHDR Elf64_Ehdr
#endif

ELF_EHDR place_holder;

/*Chages the elf_header in the file with ptr */
int ChangeElfHeader(int CoreFd, int WriteFd, unsigned long vaddr){

     unsigned long got_len=0;

     if((got_len = read(CoreFd,&place_holder,sizeof(ELF_EHDR)))
             != sizeof(ELF_EHDR)){
             perror("Unable to read the ELF Header::");
             exit(1);
     }
     /*Change the ET_CORE tto ET_EXEC*/
     if(place_holder.e_type == ET_CORE) {
             place_holder.e_type = ET_EXEC;
     } else {
             fprintf(stderr,"The file is not of ELF core file");
             exit(1);
     }

     /*Change the entry */

     place_holder.e_entry = vaddr;

     /*Write back the header*/
     got_len = 0;
     if (( got_len = write(WriteFd,&place_holder,sizeof(ELF_EHDR)))
             != sizeof(ELF_EHDR)) {
             perror("Unable to write the header::");
             exit(1);
     }
     return 1;
}

static void finishWriting(int coreFd, int writeFd) {

     unsigned char write_buffer[4*1024];
     int got_len = -1;

     while( (got_len = read(coreFd,write_buffer,4096)) != 0) {
             if(write(writeFd,write_buffer,got_len) != got_len ){
                     perror("Unable to to write the length which was read:");
                     exit(1);
             }
     }
     close(writeFd);
     close(coreFd);

}

int main(int argc,char* argv[]){

     int coreFd;
     int writeFd;
     unsigned long vaddr;

     if( argc < 3 ) {
             fprintf(stderr,"Usage core2elf core.file exe.file.name");
             exit(1);
     }
     if( (coreFd = open(argv[1],O_RDONLY)) < 0) {
             perror("Unable to open the core file:");
             exit(1);
     }
     if ((writeFd = open(argv[2],O_WRONLY| O_CREAT)) < 0) {
             perror("Unable to open the write file::");
             exit(1);
     }
     sscanf(argv[3],"%lx",&vaddr);
     ChangeElfHeader(coreFd,writeFd,vaddr);
     finishWriting(coreFd,writeFd);


}
====================================================