Monday, March 05, 2007

[FUN] Top 21 things an Indian does after returning from U.S

(---  Good One!.... Just for fun---)


21. Tries to use credit cards in a road side hotel.


20. Drinks and carries mineral water and always speaks of being health conscious.


19. Sprays deo so that he doesn't need to take bath.


18. Sneezes and says 'Excuse me'.


17. Says "Hey" instead of "Hi".
says "Yogurt" instead of "Curds".
Says "Cab" instead of "Taxi".
Says "Candy" instead of "Chocolate".
Says "Cookie" instead of "Biscuit".
Says "Free Way" instead of "Highway".
Says "got to go" instead of "Have to go".
Says "Oh" instead of "Zero", (for 704, he will say Seven Oh Four Instead of Seven Zero Four)

 

 


16. Doesn't forget to crib about the air pollution. Keeps cribbing every time he steps out.

15. Says all the distances in Miles (Not in Kilo Meters), and counts in Millions. (Not in Lakhs)

14. Tries to figure all the prices in Dollars as far as possible (but deep inside multiplies by 43).


13. Tries to see the % of fat on the cover of a milk pocket.

12. When he needs to say Z (zed), he never says Z (Zed), instead repeats "Zee" several times, and if the other person is unable to get it, then says X, Y Zee(but never says Zed)

11. Writes the date in MM/DD/YYYY. On watching traditional DD/MM/YYYY, says "Oh! British Style!!!!"

10. Makes fun of Indian Standard Time and the Indian Road Conditions.

9. Even after 2 months, complaints about "Jet Lag".

8. Avoids eating spicy food.

7. Tries to drink "Diet Coke", instead of Normal Coke. Eats Pizza instead of Dosa.

6. Tries to complain about any thing in India as if he is experiencing it for the first time. Asks questions etc. about India as though its his first visit to India.

5. Pronounces "schedule" as "skejule", and "module" as "mojule".

4. Looks suspiciously towards any Hotel/Dhaba food.Few more important ones:

3. From the luggage bag, does not remove the stickers of the Airways by which he traveled back to India, even after 4 months of arrival.

2. Takes the cabin luggage bag to short visits in India and tries to roll the bag on Indian Roads.The Ultimate one


1. Tries to begin any conversation with "In US ...." or "When I was in US..."

Tuesday, February 27, 2007

[Tech] How to determine the bus bandwidth.

Hi recently I had a need to find out the bus bandwidth. 
The bus had 64 lines and assume that the speed of the bus is xMHz.
This implies the bandwidth = (no.of lines) * (speed of each line).
Bus Bandwidth = ((64/8)*x*10^6)/(2^20) MBytes/sec.

A simple use of this metric is suppose you have 
SMP(Shared memory processors) with a common bus
and the bandwidth of the bus is 1 GBytes/sec
and you have several processors which have an 
(memory) Instruction bandwidth of 250 MBytes/sec
you cannot connect more than 4 processors to 
saturate the bus.  

Thursday, February 22, 2007

[Tech] Pathetic non unix standard matlab editor

Well I'm really pissed of this damn editor (matlab editor) , some how I cannot execute my program .m file from the command line so I had to use this matlab's editor to run my program, after using vi for long this is really pathetic, its more worse than windows I just did ctrl+c and ctrl+v it pased some junk instead of the code which I intended to paste.

Monday, February 19, 2007

[SPICE2LAYOUT] 40% Complete

Got back to the SPICE2LAYOUT project updated some Makefiles and added all the skeletal code today. By the mid of the week I should get this up and running, It also needs to have the channel router in that.
Need to get back home and study some stuff for a upcoming Friday jury.

Sunday, February 18, 2007

Algorithm for Permuting in place

Problem: Given a set of numbers S = 1...n and a permutation PI(S), how can you rearrange elements in S in O(n) time with no extra space.

I don't like explaining things just code it., here's code below
#include
#include
#include
int a[10];
int b[10];

void ResetArray(){
    unsigned int i;
    for(i=0;i<10;i++){
        a[i] = i; 
    }
}
void swap_elements(unsigned int i,unsigned int j){
    int temp;
    temp = a[i];
    a[i] = a[j];
    a[j] = temp;
}
/*b is the swap list*/
void InplacePermute(int *perm){
    unsigned int i;
    for(i=0;i<10;i++){
        if(perm[i] < i){
            perm[i] = perm[perm[i]];
        }
        if(a[i] < i){
            perm[a[i]] = perm[i];
        }
        swap_elements(i,perm[i]);
    }
}

void PrintPermutation(void){
    unsigned int i;
    for(i=0;i<10;i++){
        printf("%d ",a[i]);
    }
}

int main(){
    int runs=10;
    unsigned int i;
    do{
        ResetArray();
        printf("Please enter the permutation of size 10, 10 unique digits from 0-9\n");
        for(i=0;i<10;i++){
         if(scanf("%d",&b[i])<=0){
            break;
         }
         assert(b[i] >=0 && b[i] <=10);
        }
        if(i<10){
            break;
        }
        InplacePermute(b);
        printf("The permutation is::");
        PrintPermutation();
    }while(1);
}

The following are testcases
7 3 2 1 4 8 9 0 5 6
8 9 1 2 5 6 7 3 4 0
1 2 3 4 5 6 7 8 0 9
1 3 4 8 9 0 7 6 5 2
Well this week has been a little productive, got the space for http://phaedrus.sourceforge.net a library of randomized algorithms
Have Fun.... Vamsi.

Thursday, February 15, 2007

Passing multidimensional arrays to functions

Got enlightened by this today. And realized the following.
int a[10][20];

int main(){
 print_array(a); /*results in a crash.*/

}

void print_array(int **a,int i,int j){
 printf("%d",a[i][j]); /*How stupid this can be?*/
}

Monday, February 12, 2007

I love PHP

Have been using PHP with apache to build some stuff really like programming in this I'am in love with PHP.

Tuesday, January 30, 2007

[Tech] One more reason why MACRO's are Not Preferred over inlines.

...macro.h....
/***Dangerouse Macro1***/
#define print_int_value_twice(c) do{\
 printf("first time %c second time %c\n",c,c);\
}while(0);

/***Stupid Preprocessor***/
#define my_error(c) do{\
 fprintf(stderr,"Error::");
 fprintf(stderr,c);
 fprintf(stderr,"\n");
 exit(1);
}while(0);

.....macro user ....
j=0;
print_int_value_twice(j++);
/*j incremented twice by the preprocessor*/


/*In this case the preprocessor is stupid 
 not treat the string spanned across several lines
 as a incomplete macro argument and fails compilation.*/
my_error(" My error spans three lines
            line1
            line2");


Avoid MACROS start using inlines , if you define macros the users should use them with caution

Monday, January 29, 2007

[Personal] I was not good and never have been.....

Yes! today I realize my potential, I was never good in fact never have been....I accept my failure. I'm a looser, I cannot win and never have won and in fact I'm obliged to life for letting me live and eat what ever I want and wear what ever I could....in the midst of bitter shame....I gave up...I don't want to live as a looser...I will soon end my life and this blog may be the last. I was never honest to myself I have things which I don't deserve. And I get emotional for small things...what else a looser can say except bending down head in shame.

Wednesday, January 24, 2007

[TECH-NON-TECH] SPICE2LAYOUT should I use BGL?

A Warm Welcome to a great new year 2007! This is my first blog after 24 days in the new year. Last time I had written my blog was on Dec 31, 2006, well this was the coldest new year eve I had. I just went to bed on Dec 31 night 2006. Its because I was with puppy taking care of puppy...we were really afraid on whats going to happen next....but it was great what happened next day was really a new begining in a new year things went excatly how I wanted (In fact I did'nt know what would be the best solution and just prayed "God! Please do something so that I will be comfortable after that")...a great going new year 2007 from there on, really had great time in Hyd from Jan-1 to Jan-6.....after that I took pathetic AeroSvit flight (Never Ever Take this shoddy airline) back to JFK, travelled all the way from NewYork to Hartford and took a cab to my place....its quite a tiresome journey to travel from India to U.S, next time I will travel by either BA ,Lufthansa or Emirates..... Now I need startoff my coding for the SPICE2LAYOUT project its been a while I took a break and its really a long one....Tomorrow Is a SRM from TopCoder....I was having a dilemma to use Boost Graph library or not...but I guess it will be fine if I write it on my own. Take care...keep Warm :) Cheers! Vamsi

Sunday, December 31, 2006

[PERSONAL] Lets solve the problem.....

"Lets solve the problem" , thats what I have been saying to myself for all these days. Well I have decided never to budge and just take the things the way they come..just bought my copies to the Art of Computer Programming. For me right now there are no shortcuts, no quickies I have to take the things the hardway or the toughway more specifically.
I guess I have become a little bit more matured now, because I have to do things more responsibly now. I have a big responsibility now, I don't worry about it but I welcome it into my life, I'am ready to solve it and all the consequences...I will never run-away from the problem. But I need to be a little bit more practical also, well for any problem now there is no way out except to solve it.
So...LETS SOLVE THE PROBLEM RATHER RUNNING AWAY FROM IT....
And when you are solving problem's you need to be very methodological...I know its all spelling mistakes my blog...I may not be a great genius but I'll try my part to solve the problem. And when I solve the problem there will be no shortcuts.
Frankly I have been not getting great results for my Dynamic Programming based Border Length Minimization Problem. What to do I don't know I cannot really fake up any results. It's bad really bad. I leave it
Today puppy came out, she has been not liking the place where she is living but she has to for sometime, she should feel free and I'am a very lucky guy interms of that. I will always care for puppy and will solve the problem and not run away from it.
Happy new year 2007.....LETS SOLVE IT....that's the quote of this year.
Take care guys and keep having fun.....mean while I will lay back and keep thinking....

Friday, December 08, 2006

[NON-TECH] Travelling to india....

I should be indeed thankful to sudha for a ride from Storrs to Stamford. When I reached Stamford it was a little difficult to find out where ravi is and finally found ravi, went to circuit city to buy some stuff, later toured manhattan,brooklyn went to a great Italian restaurant, I really liked the hot bread and that olive oil to eat the bread, I never tried any Italian food apart from the normal pizza. Its really windy today in New York with -7 Centigrade, really had a hard time pulling all my luggage into the airport.....well found a wireless connection at the food court here, IT WORKS...well I'am writing this from that connection only, I need to wait till 4:00 PM to take my flight. Its a long wait.

Good that I got some charge on my laptop so that I can do some work today, I have many things pending, mac,tim,ion and raj. I need to get all the work done in this break good if I could make a proper schedule to fix up all the things.

Lets see how things work......luv....Vamsi

Thursday, December 07, 2006

I have not started any packing

Its just 12 hours for my flight I have not packed any thing .....dont know how I will pack....I think in have insomnia I cannot sleep its killing me every day its 4:00 AM in the morning I have been trying to sleep for last 4 hours but failed miserably. God please gimme some sleep please....it would have been great if we could buy sleep :((

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);


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

Sunday, May 07, 2006

My F1 student visa.....

Wow its been couple of weeks of unavoidable personal work I was busy with, although I got a full support I had to do all the formalities to get enough documentation that I'am not a potential immigrant. Well it costed me my valuable time and also money (Thats OK) but not time. The Visa officer was a nice lady she just saw my I-20 and my Transcripts and approved my visa... Well now I'am alleviated of this pain which is unavoidable for any student who is going to U.S. The only thing I have learned from all this excercise is JUST FINISH IT OFF, THERE IS NO WAY OUT. VAMSI.

Saturday, March 18, 2006

Life through ELF loaders.....

Hey its a long time I have been blogging...... yes its really a tough last two weeks. From last two weeks I have been trying to get a work around to the 'exec-shield' problem we were facing. I have got a lot of new ideas on implementing this. The following are some of the them pretty generic though
o My current problem boils down to create a executable from the running program itsself. To get this working I have been studying the kernels code in 'fs/binfmt_elf.c' especially code around 'load_elf_binary', The following are my finding might find it useful (for myself to look after some time).
-----1.)The kernels loader does not do any great , it basically gets all the metadata from the elf headers and just does the dirty work of just mapping and transferring the control. The summary of what excatly the kernel does is
a.) set the entry point from the (Elf32_Ehdr *).e_entry as the start jump to the program
b.) Load all the segments (PHDRS) the loader just deals with the program headers, it does not use any section headers. It loads all the segments with type (Elf32_Phdr *).type == PT_LOAD. If you do a 'readelf --segments a.out' you can see the segments


(gdb) shell readelf --segments a.out

Elf file type is EXEC (Executable file)
Entry point 0x80482a0
There are 7 program headers, starting at offset 52

Program Headers:
Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
PHDR           0x000034 0x08048034 0x08048034 0x000e0 0x000e0 R E 0x4
INTERP         0x000114 0x08048114 0x08048114 0x00013 0x00013 R   0x1
    [Requesting program interpreter: /lib/ld-linux.so.2]
LOAD           0x000000 0x08048000 0x08048000 0x004cc 0x004cc R E 0x1000
LOAD           0x0004cc 0x080494cc 0x080494cc 0x00104 0x00198 RW  0x1000

DYNAMIC        0x0004dc 0x080494dc 0x080494dc 0x000c8 0x000c8 RW  0x4
NOTE           0x000128 0x08048128 0x08048128 0x00020 0x00020 R   0x4
STACK          0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4

Section to Segment mapping:
Segment Sections...
 00  
 01     .interp
02 .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame
 03     .data .dynamic .ctors .dtors .jcr .got .bss
 04     .dynamic
 05     .note.ABI-tag
 06
(gdb) 


c.) One more important thing about how excatly it sets the 'brk' base I guess to set up the 'brk' base the kernel only (also see the copy of the email posted on linux-kernel mailing list
Hello All,

I have been working on an idea of creating an executable from a
running process image.

MOTIVATION:
Process migration among the nodes in distributed computing,
checkpointing process state.

BASIS:

The basis of my idea would be update the existing executable with
extra PHDRS (Program Headers) with type PT_LOAD and each of these
headers corresponding the vaddr mapping from /proc//maps.

I have done some basic study of kernels loders code in
'fs/binfmt_elf.c' especially code in 'load_elf_binary' function, the
following is my understanding.
-----------------------------

bss=0;
brk=0;
foreach (phdr in elf_header){

if(phdr->type == PT_LOAD){
if( phdr->filesize <>memsize){
/* Segment with .bss, so update brk and bss*/
}
else {
/* Just map it*/
}
}
/*Update brk bss*/
}
------------------------------------

from the above the kernel is updating brk, thus creating the start of
sbrk(0) only when it sees a PT_LOAD segment with filesize less than memsize. 
The kernel will set brk base i.e sbrk(0) to the value phdr.vaddr+phdr.memsize 
of the last PT_LOAD
segment its mapping? so do I need to reoder my PT_LOAD segments so
that the heap goes as the last PT_LOAD segment?

Is there any way we can tell the elf loader to force the vaddr for
sbrk(0) i.e brk base ?

Let me know your suggestion on this idea?

Really appreciate your valuable comments.

Sincerely,
Vamsi

[PS: I dont know if some one has already implemented this idea??]


-----2.) Also found out that the virtual address's for the sections in the segments are the excat virtual address if they are within the range of corresponding phdr. that is I found that if .bss section has a vaddr of 0x00001000 and .data has 0x00000010 and there is a corresponding mapping (rw-p) in /proc//maps as 0x00000004-0x00010000 which includes segment to section mapping in the order '.data ...... .bss' note that .data will not start at 0x00000004 it infact still starts at 0x00000010 same with .bss. This is very logical since if the kernel's loader changes the mapping of the .data section the all the code referencing the virtual address's has to be changes. So the segments in /proc//maps file are not the segments excatly corresponding to 'readelf --segments a.out' infact they are bigger carousels with wrap around the the excat segment address's for page alignment.
More ideas next time..........
Cheers
Vamsi

Wednesday, February 08, 2006

Presumption is a Programming Perversity..... [Discovery of new GUMPTION TRAP]

It was few weeks back in sunnyvale working on a night when I had ran out of my gumption and was almost burnt out , sitll wanted to write code to handle (In my sourcecov project) call to function pointers via 'call *%(ebp)' instruction on amd64, I ran into a problem and made a persumption on that sleepy night.......
I cannot imagine this presumption cost me 2 valuable weeks of time, which I wasted in meeting my bullshit girlfriend who has been bugging me all the way. Suddenly today after fight with her I went back (Filled with gumption) and got time to look at the code which I had left for 2 weeks with a presumption which I made that night when I saw that the debugger (gdb) itself crashed when I tried to something tricky on that sleepy night, I lost my gumption that night and presumed that its a very big problem, I was telling my self "Come on man there should be something really nasty in the code causing the debugger to crash............huh " this presumption made me very apprehensive to touch the code for two weeks :( , I have screwed the schedule with this just a crazy apprehension.
Rather than attacking the problem, I took a conventional root of comfort bought a TV to play on the XBOX with I bought it did'nt work researched on the voltage differences between india and U.S wasted my time and also wasted......Hey this reminds the the time when pheadrus took a break from answering the basic question of QUALITY, rather he went and married and forgot about QUALITY for sometime until he started thinking about it again and the mistake he made of the Presumption that QUALITY cannot be defined and took a comfort root of the question haunting him....later on he realized how big mistake it was left his wife and went on the journey of QUALITY again.
Yes even me also with this crazy prejudice lost my QUALITY track for a while.....But "Its never too late to get back..." (My Old Slang :)) ). Today I discovered a new "GUMPTION TRAP" ---> "PRESUMPTION and APPREHENSION" , probably we should have a course "GUMPTIONOLOGY101" in our school to know about all these traps rather than discovering them ourself. The problem was very silly when I got back into my QUALITY track its just that "I have been using old instructions and accessing/writing into a virtual address of the program in optimized mode when the instructions/code came from debug executable" (May be u should send me an email to explain the problem), but in a lucid manner its a very basic problem which I overlooked, its ok as long as I discover more gumption traps like this...........One thing is never presumption is bad and also evil....its a LOW QUALITY LIFE.
So today Its the 9th revision of the file just cvs commited and wanted to save my feeling to my harddisk before I forget about it......
Take care guys.....
Its always a journey no destination, you will get of QUALITY track when you say you have reached a destination
Reminds me of a quote from prisig "When you are filled with gumption there is no one stopping you from fixing the motorcycle"
Keep going guys make it a habit and enjoy it

Tuesday, November 29, 2005

Life of a hyderabadi....

"Akhir, Hyderabad ki zindagi kya he" .Whats all about hyderabadis ,and thier way of living.This mail explores certain ascpects of hyderabadi life style.I wish to seek some reviews basing on which I will post more.
A Hyderabadi on the road
It some time looks stranger than fiction when a Hyderabadi while driving on the road feels that he is the 'king of the road' and the traffic rules are meant (only )to be broken, so don't ever cross the path of a Hyderabadi when he is on the move. In case if you cross his path, he invariably tries to get into an argument as if 'raking up a fight is in the blood' of Hyderabadi.Even if he is wrong, as the proverb goes "barking dogs seldom bites "(Shara** style), he tries to get you by neck but the crowd around him stops him by holding his hands while he vainly tries to get his hand over you (a Hyderabadi seldom gets into fitscuffs )so don't worry you won't be beaten but you have to bear the choicest abuses in the Hyderabadi slang. The Potti Patana "Hyderabadi Ishtyle"
So far so good, the other aspect of a hyderabadi life style or rather estyle is "potti patana". It is the favorite pastime for some while for others it is a fulltime job. A Hyderabadi would try all the tricks in the book and outside the book to get hold of the woman of his dreams. With the girls of the generation next it is "potta patana hai". If people in rest of India were carried over by the movie "Hyderabad Blues" that it is taboo for guys and girls to be seen in public together,then they are going to have a culture shock if they come to Hyderabad.So don't believe those confused desh returned non-real Indian (NRIs).If you don't believe me have a dhekko on the Necklace Road -the scene would put to shame even the overly romantic French. Bindaas Batein
The bindaas attitude of Hyderabadis is personified in the numerous cafes of the city where in you get to see a whole lot of bindaas Hyderabadis sipping tea for hours together. One might wonder as to how these people have all the time in the world to indulge in such long sessions. There is so much of time available with folks over here that at times you have to literally ask them to go for want of peace.
Warning:
Beware of some nerds living around garden cafe ,Sec-Bad YMCA(Yocs and KC janta).They are extreamly intellectual and are always angry that swedish society has not awarded them nobel prizes for thier ideologies and symbolisms,trivias,Information oveload's.Make sure you drive around clock tower to avoid YMCA road , if your are a mere mortal .
"Abhi" never mean NOW...and Parson never mean day before yesterday.
eg "Parson ich apun world cup jeetenaa" Nakko is a famous word used forever! Lite lena mama! is ubiquitous
Irani cafe and Irani chai A typical scene in an Irani cafe The Steward shouts "Ye chotu ..Ek Chai La Rey" and gets it himself(!) to serve to his customers. We are talking of Irani Hotels where some people build their lives around it. They sit for hours and hours and chat with friends, families and even strangers. Irani hotels are an excellent franchise( but of course no royalty, no ownership and no rules). They can only run one way and that is successful way. Every one likes the "Chota Samosa" made out of Onions that are special to any Irani Hotel. Fine Biscuit, and the world famous Osmania biscuits were born from this concept called Irani Hotel.Some famous Iranis Cafes Blue sea, Garden,Niagra, Paradise,Madina,Sarvi.Always try to avoid cafes on lower tank bund road named as "Tea city " and "Tea Den ",For reasons follow above mentioned warning. Gold Flake Rs 3/(rate keeps fluctuating ,includes tip for the "Khadir")- and Irani Chai along with samosa and osmania biscuit make the day for many.
[Thanks to my friend sagar for sending this :))]

Script2Executable project....

Today....I'have been thinking about this very exiting project..."SCRIPT2EXECUTABLE". I have googled on the net and found that some specific projects were existing for perl, phyton, etc.... But in this unix would we have several interpreters like expect (which I'have been using lately), lisp, csh (shell interpreters)....
So now my ideal is to create a program which takes the interpreter name and the file (script) and create a compiled executable file, which can run standalone. There are several advantages of this program one thing is that this hepls the developers to hide the code of the scripts, what are the other advantages??....
To create this generic solution, I started thinking about this idea
STEP1:
o I'll create a dummy executable file compiled, with a placeholder for the script as follows
#include
static char buffer_space_for_script[MAX_SCRIPT_FILE_SIZE]="#Cheating perl hahaha...";
/*Driver program to launch the script, similar to piping except the program reads from static buffer and writes into the pipe.*/
int main(){
int fd[2], pid;
/*create a pipe all finer details avoided*/
pipe(fd);
dup2(1,fd[1]);
pid = fork()
........
if(pid==0){
dup2(0,fd[0]);
exec(perl/other interpreter);
.....
}
else{
write(1,buffer_space_for_script,MAX_SCRIPT_SIZE); /*write into stdout will be read by interpreter in the child*/
}

Now I wanted to compile this program and use 'hexdump -c a.out" find the seek location(byte in the physical file of the buffer_space_for_script and write the contents of the script file into the file a.out)....
I almost coded it but suddently realized that the major objective of this has been breached since hexdump -c will read out the ascii, thus a intelligent user can read the script using hexdump, even though we have created a compiled executable from the script.....
:(

Monday, November 07, 2005

Algorithm to build DFA's to test divisibility

I found this following algorithm very useful in designing DFA's (especially making DFA's to test the multipules, divisibility etc.....). This logic can help slove may DFA problems lets start with an example and generalize this after that..
Problem: Create a DFA to test the divisibility of a binary string by 3. (Assume the string can be scanned from left to right....ex 11 , 110 )
During the scan of the binary string the current state (Value of the binary string scanned till now) can be in one of the following states
1. 3K 2. 3K+1 3. 3K+2
So if the current state of the DFA is 3K+1 and we scan a '0' the value becomes 2*(3K+1) == 3k+2. If we scan a '1' it becomes 2*(3K+1)+1 == 3K. Similarly if we scan '0' in state '3k+2' it becomes 2*(3k+2) == 6k+4 == 3k+1. So now we have 3 states and move according to the following table.
CURRENT STATE SCAN_LITERAL NEXT_STATE
3k (final state) 1 3k+1
3k (final state) 0 3k
3k+1 1 3k
3k+1 0 3k+2
3k+2 1 3k+2
3k+2 0 3k+1
We can now extened this for the divisibility test for any 'k' that requires a D.F.A of kstates (can we minimize?). With this we can solve problems like the following.
Problem: Design a DFA for the set of string in {0,1,2}* that are ternary(base 3) representations, leading zeros permitted, of numbers that are not multiples of four.
Thought that this would be a useful piece of information.......Cheers Vamsi.

Sunday, September 18, 2005

Small observation in our life

A small truth to make our Life 100% successful.......... If A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Is equal to 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Then H+A+R+D+W+O+R+K = 8+1+18+4+23+15+18+11 = 98% K+N+O+W+L+E+D+G+E = 11+14+15+23+12+5+4+7+5 = 96% L+O+V+E=12+15+22+5=54% L+U+C+K = 12+21+3+11 = 47% (None of them makes 100%) ............................... Then what makes 100% Is it Money? ..... No!!!!! Leadership? ...... NO!!!! Every problem has a solution, only if we perhaps change our "ATTITUDE". It is OUR ATTITUDE towards Life and Work that makes OUR Life 100% Successful.. A+T+T+I+T+U+D+E = 1+20+20+9+20+21+4+5 = 100

Sunday, September 11, 2005

klists an ideal way for building asynchronous applications.......

Hi doood's, Long time blogging.....its high time now "I'am back to hack". Was following a lot of lkml threads these days to garner some intriguing suff. Just found 'KLISTS', these datastructures are highly consistent across the asynchronous processing within the kernel (basically from interrupts from the devices as well as software interrupts).
Ok let me put this in much lucid terms... 1. I have some data to be shared across process's (not threads). 2. This shared data is accessed asynchronously. We get this type of context typically in telecom applications ( I recall from my experience from moto****). They have a unix based system, with several process's running each communicating with each other.
Ok talked a lot about the problem so whats a unix way of solving it. BTW way the data should be consistent and pocess the ACID (Atomic .....dont remember :-p) behaviour i.e a typical transcational behavior, basically the solution should'nt be error prone to race conditions occuring due to asynchronous behaviour within the process's. So how do you architect this kind of applications?
Ok let me give you some really shoddy professional solution which MOTOSHIT has sold to _NEXTEL_ (being soooo dump bought it from moto***a). 1. Moto***a had a real dumb soultion, to make sure that the data is consistent across the process's they seem to use a DATABASE :)).... 2. I have seen code which tries to access a shared variable as a row in the database table. 3. They just dumbly put every shared suff in the database...to make sure that the data is having ACID properties during the modification of the data by these asynchronous process's. 4. And more ludicrously they buy a database from a shoddy database vendor informix....and just heard that they are lobbying for support form IBM for this outdated product. really amazed by the quality (the romantic quality form zen and art of motorcycle maintenance :-p) of the approach to this problem. After knowing about klists I just felt that kernel which also has asychronous stuff inside does it in a much smarter way using KLIST. (KLIST is worth a reading please use the link above).

Monday, August 22, 2005

Solving serious problems....

I was just reading about an article about 10 best innovators in computer science. Infoworld magazine names 6 people from solaris 10 development team as best innovators. You should emphatically read the blogs of each of these sun engineers....So coming towards problems its a really hard problem to find serious and effective problems especially in computer science. Most of the research work is essentially a cliche. Frankly speaking I always do something to get a research publication, may be I feel gingerly that I dont have enough research publications compared to my friends.
Surely this kind of attitude will not help serious problems. But I have that innate feeling that I'am not doing any challenging and substantial stuff at work, so during the last few months I adopted an attitude shift in my thought "rather than complaining about the dark try to light a candle", I took all the pain to refactor every thing except the inane attitude of the superiors around, but they seem to have an attitude similar to some examples in my last post.
I quickly realised that they were just using me to their own glorification. Surely my managers are not my ideals but try to force that thought on people that they are great role models, I just keep mum. I really feel that they could really drive innovation and conceive innovative things, rather than drinking that materialistic vine.
Maan I just feel that I should do something different.

Friday, August 19, 2005

The power of intention.

Just finished studying the book "The power of intention", really felt very inspired after reading this. Some of the authors statements had striking effect on me, statements like "Don't die with the music still left in you!!". Seemed to me a very good way to do my self talk. Other highlights in the book which was equally striking was the authors description about the ego. The author gives the following example of how people are really blinded by this ego.
1. A tiny and thin beam of sunlight suddenly thought that is was the sun...
2. A mild ripple in the middle of the ocean suddenly beleives that its the ocean...
Yes its really true on how ego can really doom a person. If you are reading this just dont be egoistic ever in your life, just relax and think about it again.

Thursday, July 28, 2005

Why this vacuous discernment between senior and junior?

I still remember Dr.PJN telling during my college days...."To test a person's real character, give him immense power". Its long time I'have been blogging just wanted to write about some topcoder dynamic programming problems in this post (I had drafted it may be I'll post in my next post).
All my mood is off when I see this guy walking ostentatiously all around, with a sneer unfurling those perverse insinuations, to motrify me. I guess his vanity has reached a zenith. All this is because of the discrimination the management shows between experienced and people with little experience. They just seems to despise our ideas with a prejudice that only experienced people only can make successful things and get things working, the management seems tout excessively that they will give weight to everyones views.
Its just because they think they are really privileged , they demand obligation....I really feel these are not the ideal people, no one is a junk. I'am not writing this out of jealously that they are getting paid more and are accessible to more stuff, these are words right out of a morbid mind twarthed by such inane seniors guys working along....I just learned one thing out of it although its a hard way to learn, I will never show that attitude when I become experienced. In fact I will never become a manager, its really a job with massive sagacity not to create any internal humilation among the people working under the manager.....I strongly feel that there should'nt be any discrimination among people interms of experience.

Thursday, June 30, 2005

Verminous ego stench .........

I don't know why we(including me......) inanely always do things anticipating something, yes every one anticipates for good things to happen for their course of action. But in some cases this anticipation is different , sometimes you try to flaunt in doing things as if some one watching and you actions are mended in such a way to impress people around you. Every time you write a mail , talk to people or do some thing you want to impress people around you. But I feel that you should do things naturally but not to impress any one....the root cause of all this is ego of people . I too was a victim of it but I think I have realised some thing about it and these day I listen to people and value what they say............its ok if you are a wise man and can take great decisions but you should'nt make others feel low or jeer at people at sloppiness, but every one can slowly get things accomplished and I feel that touting may not always converge to a right solution.............and sooner or the later every one will realise this.
BTW the book I'am studying this week is "If tomorrow comes" , really a good one by sheldon makes us feel how a sapped, anguish and vindictive mind with a sedative torso feels. It was a story of a dejected lover tracy withney who tries to endure with a slender hope to seek vengeance.
TGIT (Thank God Its Thursday)
V@msi

Sunday, June 26, 2005

Fervent gaming hermit....

Hmm.....finally I have moved into this reclusive world of FPS games, had spent around 90% of this weekend time quaking.....just fragged sarge 20 - 7 in a nightmare, in a map with no railguns only rocket launchers, plasma guns and shot guns (machine guns ofcourse :)) . I like this rocket launcher (although I was succumb to the rockets launched without a lot of span between walls and myself)...I almost fragged very accurately with this rocket launcher. My dodging skills are improving with every game, I felt the best way to dodge is to hold all the three keys 'w' ,'a' and 'd' which will make you move forward and press 'space' during aim and leave the keys 'a' and 'w' while shooting, this seems to be a very useful tactic of dodging, surely you can frag a human with this dodging, there are some really good players here like 'KeYmaker' and 'Devil' they fragged me couple of times. Its really great fun when you have a bunch of bacchanalian quake freaks at work places, good that I also I have 'Geforce Go' on a LCD which makes gaming more exotic.

Tuesday, June 21, 2005

Don't be afraid of making mistakes.......

Yep....I was depressed last week. But I'am starting a new life now, honestly I'am concentraring on my guitar in all my solitude they(guitar skills) seem to be improving, I feel good finally I learned to play "happy birthday......" for that special occassion next month. All this inspiration came from watching "Million dollar baby" again.......Mr.Scrape's words to danger seem to show me some light...."Any one can loose one fight....." , "Sometimes to deliver a good punch is to step back...." . And also thanks to call from karun, karun called me from canada and reminded me about st.laurel street in montreal, and about the good times we had, I really felt excited to receive his call (he will be in india soon). Sometimes this kind of suprise calls make you feel happy, and you feel something new....one more thing is I started playing cricket, people are really happy about my batting....seem's like I have'nt ever thought about my cricketing skills after a long break from club cricket during highschool...during those days I used to spend many hours to get my timing right, but was not quite getting it....but today after a long break and zero practice I'am batting like I'am in a great touch......some times when you try to work too hard on anything you don't seem to get it right (probably I'am too afraid of making mistakes during those old cricket days to get selected into the team), but when you have removed that thing of being afraid of making mistakes (because right now I dont care wether I'am in the corporate team or not) you seem to do things naturally and you get it right.......may be its a pathological example on how one should remove fear of screwing up something......... \/ /-\ /\/\ _\"" |

Tuesday, June 07, 2005

Transmeta lessons.......

Really feel sorry about this high technology microprocessor designer. But I really appreciate their nerve to compute against titans like INTEL and AMD. I feel that monopoly is bad and it reduces innovation and checks conceiving new products. Transmeta's low-power combat against is definitely a dud, I feel that transmeta should have invested more in research to overcome the 'underpower citics' rather then demonstrating a mere obeisance, may be transmeta management failed to notice the infliction points the company has being going through, intel on the other hand have been leveraing on grove's pedagogy(Only the Paranoids survive) of identifying these infliction points and thus bashed transmeta. Intel was the first one today to get a dual-core chip out, amd followed later, but I don't why transmeta never thought about dual-cores. This indicates Intel's astute ability to pick up infliction points, but transmeta I feel should conceive something really creative to get back and start running.

I feel it as a small practical reminder about how one should always keep track of the infliction points, at any instance there are millions and millions of people competing with you and a slight negligence might create a infliction point with negative slope............ Think big to conceive a marvel.

Monday, May 23, 2005

Podcasting with itunes...

Ohh...that sounds 'leet right. Yes indeed it is. Thankgod no need of any external podcatchers, since every thing would be integrated in itunes itself. You just need to sync up your ipod by just connecting and you get all your favourite radio shows.
BTW the following are radiostations I'have been listening all my downtime
http://feeds.feedburner.com/ITConversations-EverythingMP3
http://www.hackermedia.net/wp-rss2.php
http://www.binrev.com/radio/podcast/
http://daily-horoscope.libsyn.com/rss/

Sunday, May 15, 2005

Its podcasting revolution.....

Hey guys.....wondering whats new in scintillating world of gizmo's? make a guess no its not "Ipod U2" or "Ipod Shuffle" It's not a gadget but something related to them yes its Podcasting!!. Podcasting is real fun, so what excatly is this podcasting? . hmmm..... I guess most of you have already been using RSS feeds (adding them to firefox livefeed toolbar) :-? , podcasting is akin to RSS syndication, actually normal RSS feeds get you only the text content from where ever you have subscribed the feed, now just imagine a feed which will play audio when ever you select it, rather than reading the feed you are now listening to the feed, sounds great!! right? this is excatly what is podcasting. In a little geeky terms podcasting is similar to tunnelling (protocol tunnelling) where you add (embedd) 'protocol2' in the carrier 'protocol1' as a payload, so the multimedia content is being added as the payload in RSS (Really simple syndication protocol) 2.0 protocol for syndicating audio content from the publisher. So lets come to the bottomline "how can I get podcasting work". 1. Get a podcatcher I use doppler. 2. Configure podcatcher to integrate with mediaplayer or itunes, I use itunes and every live audio feed you add to the doppler makes it a playlist. 3. Sync up the playlist to your Ipod or any other MP3 player. 4. Enjoy podcasting (Podcasting is fun!) You can also setup podcasting and make your blog audioblog. So get started with the pocasting revolution.....keep checking for my upcoming podcast. Cheers! Vamsi

Monday, May 09, 2005

Love you momma!!


mom, originally uploaded by vamsi.

Hmmm......have been thinking about too many things these days, finally I got some time to write about momma.

I just shut my mind up for few minutes and start thinking about momma feeling a little nostalgic. Momma made me realise that "success is going from failure to failure with out loss of enthusiasm", without her motivation, I would'nt have accomplished any thing till now. In fact every day is a mothers day for me.......I love you momma!!!

Wishing all of you a happy mothers day

Friday, April 29, 2005

Solace for the weekend.....

Feel's like I had found an oasis in scorching heat.....just heard from JMMA (Journal for Mathematical Modelling and Algorithms) www.kluweronline.com/issn/1570-1166 . That they have accepted a work which I had done at the school related to polygon enclosure algorithms titled "Optimal algorithms for some polygon enclosure problems for VLSI Physical Design". No Idea in which month they will publish it but just finished off a final LaTeX version of it. I remember I submitted this around Nov-2003 and they had screened it now really loooong time right? (Ref No:100335). I almost forgot about this submission was having no hopes on this but suddently it comes back at right time helping my confidence. Really speaking after school I did'nt do much research. But I always use to tell my friends that I'am still working on that "external memory algorithms project" but could really never finish it off. May I got really complacent these days....but "Its never tooo late to get it back!!!"

Tuesday, April 26, 2005

Corporate victimization of enthusiasm.......

I guess you should have been hearing things like "Employee centered company" , "Employee * company". This is just to exploit the energy of the young kids in the company get the work done at a very cheap price. Ultimately bussiness is just making money yes thats true. But the way the current corporate culture is evolving these days in india especially of the outsource buzz word is really pathetic. The managers who take the initiative of settting up shops in india for corporates tend to be extremely selfish...selfish and selfish, this is not silicon valley attitude of "Win...Win" in the managers. Yes I'am currently a victim of this and I really had a feel of this selfishness, I dont know any where else but atleast in indian corporates (MNC's) this is what every one crib about...I felt really demotivated about these vices in the corporate culture of india. I feel that there is no use of doing things proactively taking up responsibilty and showing an effective commitment towards in getting things done ultimately. I have learnt a lesson that you should just do what ever is enough and nothing more. Live your life do what you think is good and what you think is right. Dont become an work addict at the corporate there are better places where you can prove your self and prove not just to the corporate to the complete world, write opensource software make opensource software run efficiently fix bugs in them do research and what not you can do any thing what ever you like.... So the bottom line is "Never count on anyone except your self!"

Tuesday, April 19, 2005

IPOD Mini on the go......


28-03-05_0844, originally uploaded by vamsi.

Recently bought an IPOD mini for just
$199 . I felt this to be really great no hassles of batteries, no hassles of space (4GB). I really feel like throwing my samsung YEPP-90S (64 MB) mp3 player.


The great thing about IPOD's is their integration with audible ( click here). I could really play all my audiobooks in audible format without converting them into mp3's. Yes now I turned out into an audible freak listening tons of audio books in my down time.....guys wondering why I have photo of mine rather than an IPOD mini here??......keep guessing

Monday, March 14, 2005

Turned into a RSS Freak

I found this to be really intresting it saves my time by not visiting the websities for news and other tech stuff and most wonderful part of it is the integration with Firefox, yes I'am talking about teh Live Bookmarks a great feature in firefox which integrates a RSS Feed reader in firefox....Suddenly I realized that I wanted RSS feed for every thing I even wrote to timesofindia to provide a rss feed on their site..yes I have become an RSS freak now my firefox toolbar is filled with 18 RSS Feeds right from BBC News, Devx Tech updates, CNET News.com, Wired ..........to ESR's blog.
:-p Vamsi

Tuesday, February 22, 2005

There is no AI only RI (Real Intelligence)


On Intelligence
Originally uploaded by vamsi.
I have been studying "On Intelligence" these days I could'nt stop myself reading. I really liked the way Jeff tried to put this new Memory prediction framework. Wondering if this guy has any thing to do with stefen hawking? NOWAY.


Jeff Hawkins, the man who created the PalmPilot, Treo smart phone, and other handheld devices, has reshaped our relationship to computers. Now he stands ready to revolutionize both neuroscience and computing in one stroke, with a new understanding of intelligence itself.
Hawkins develops a powerful theory of how the human brain works, explaining why computers are not intelligent and how, based on this new theory, we can finally build intelligent machines.

The brain is not a computer, but a memory system that stores experiences in a way that reflects the true structure of the world, remembering sequences of events and their nested relationships and making predictions based on those memories. It is this memory-prediction system that forms the basis of intelligence, perception, creativity, and even consciousness.

Monday, February 21, 2005

The Aviator........


Hughes
Originally uploaded by vamsi.
"I am by nature a perfectionist, and I seem to have trouble allowing anything to go through in a half-perfect condition. So if I made any mistake it was in working too hard and in doing too much of it with my own hands."
-- Howard Hughes describing his way of working and the mistakes made in building the "Spruce Goose."

Monday, January 31, 2005

How to avoid BROKEN PIPE errors in code (SIGPIPE)

Recently I had to struggle a lot to fix a issue generating BROKEN PIPE on a AMD64 platform, this code works on EMT64 and other 32-bit platforms but fails on AMD64. The bottom line is be really careful when you do use a fflush.
void *stream = (FILE *)......;
............
............
//To make sure the data is written to disk (HA)
if(!fflush((FILE *)stream)){
   printf("Flush failed due to %d error refer error.h\n",errno);
}
//This is really very dangerous code if you dont have a signal handler
//written for SIGPIPE (either you write a sig handler for SIGPIPE) or
//use the following code//

/*Safe Code*/
if(!fsync(fileno((FILE *)stream)))){
  printf("Sync failed due to %d error refer error.h\n",errno);
}
I found the standards guide on context of libc functions really useful
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_05.html
Hope you will not go through the same pain....
Vamsi

Monday, January 17, 2005

Symbol referencing errors for static variable in C++

Are you stuck with static symbol referencing errors in ur code??
What could be wrong in the following definition of a c++ class to find out how many instances of MyClass are created??
class MyClass{
 private:
   static int __instance_count;
 public:
    MyClass(){
         __instance_count++;
    }
    int getInstances(){
      return __instance_count;
    }
};
main(){
....
}
When complied with g++ says that __instance_count is not defined...this can be resolved by defining __instance_count outside the class definition,as follows.
int MyClass::__instance_count;
Why do we need this seperate definiton of static variables?

Saturday, January 01, 2005

04 to 05 with a 4-5 puzzle....


01-01-05_1857
Originally uploaded by vamsi.
I have seen people circulating this 04 to 05 puzzle to check how difficult 2005 will be compared to 2004. It's crazy but timepass. Get the square
here cut it into 5 pieces and solve it.....finally keep track of how much time you took to solve this and this will be proportional to the hard times you will have to face in 2005....how about people who solved this already :)) not problems at all in 2005??

Saturday, December 18, 2004

L-TREE a new datastructure for efficient hierarchy representation in a database.....

Hey don't say that you guys have never came across an LDAP server....hmm...ok its your directory within your organizaion.....since every organizaition is hierarchical in the sense a 'senior manager' has several 'managers' reporting to him and a 'manager' has 'developers' etc.....so all this data is hierarchical. So if I were to give you this problem and make a system which will report queries like 'gimme all the employees under employee X' how would you approach the problem ?....
One quick solution is create a table in the database
CREATE TABLE ORG_DIR (int EMP_ID NOT_NULL,VARCHAR(10) EMP_NAME, int SUP_ID);
To answer that you might query the database like
SELECT T1.EMP_NAME 
FROM ORG_DIR T1, ORG_DIR T2
WHERE T1.SUP_ID == T2.EMP_ID && T2.EMP_ID = &INPUT
Finally you have got a workaround...Unfortunately this kind of workarounds seem to be very inefficient for storing and retriving Structured Hierarchical Data hmm...I know you are thinking about some thing right??? XML :)) Yes its XML. How can I store XML in my database and answer my queries on the Hierarchical data. My Idea is to make HIERARCHY as a datatype itself rather than some thing else. That is just as we have primitive datatype support within a database..ie every column in the database would be of some primitive datatype supported by the database...so The idea is can we make HIERARCHY a datatype.....hey wait a sec just figured out I'am not the only one who thought about it....yes Oleg has alreay added a great Contrib Module for postgresql. Oleg made is generic so that you can persist any label based HIERARCHY...now I have a good Idea in extending L-TREE to support XML....its really great to have such an optimized HIERARCHY representation for structured data...people have been talking about indexing and datastructures for XML Databases but this seems to me as a really good contribution from Oleg..... Vamsi

Tuesday, December 14, 2004

Useful unix command for finding all the files recusively which contain a string

peemt4:vamsik:(vamsi_aix_ns_port):/vobs/ETG_Repository/src>find . -name "*.c" -exec grep -i "Your Search String" \{\} \; -print
Sound simple but thought it would be useful....

Saturday, December 04, 2004

Moving from STL to GTL


GTL
Originally uploaded by vamsi.
Most of the developers building any systems are generally stuck with the problem of implementing graph algorithms. Graph algorithms are really fundamental algorithms and are applied extensively...take the following example's

1. Circuit Partitioning: The stage where the designer had come up with a netlist and technology mapping being done. Now want to partition the circuit so that highly connected blocks stay together.....So when I talk about netlist....there it goes the HYPERGRAPH. The most fundamental netlist representation so to make systems which process these hypergraphs (netlist's) you need to write code in a very generic manner because the partioned hypergraph by the partitioning algorithms will be used by the placement algorithms and it goes on and on.......hmmmm now I recollect the network stack where pointer to the packet is passed across several layers and its done in such a way that to avoid redundancy involved in copying over the stack (process stack not network stack) they use a pointer to some heap space.......similarly in EDA tools where the netlist is taken through several stages(involves verification also) and finally realized into physical geometry, the developers especially EDA tool developers need some generic implementations like STL....its really great TEMPLATE LIBRARY lets you quickly do your tasks and modify only appropriate parts of the algorithms.....but STL has no support of hypergraphs...I mean not even graphs....you need to create your own Graph Container on the existing framework.....so now to avoid this we have got GTL a great libray.....I came across it while helping a friend in implementing KLM circuit partitioning algorithm...I feel that it would be really helpful for may other computer science domains apart from CAD....

Cheers
Vamsi

Monday, November 22, 2004

Trying to start a new life(Genetic Algorithms).....but those old memories(Deterministic Algorithms) still make me feel emotional.........

Joined JGAP to contribute to the opensource community. Genetic algorithms (GA's) are search algorithms that work via the process of natural selection. They begin with a sample set of potential solutions which then evolves toward a set of more optimal solutions. Within the sample set, solutions that are poor tend to die out while better solutions mate and propegate their advantageous traits, thus introducing more solutions into the set that boast greater potential (the total set size remains constant; for each new solution added, an old one is removed). A little random mutation helps guarantee that a set won't stagnate and simply fill up with numerous copies of the same solution. In general, genetic algorithms tend to work better than traditional optimization algorithms because they're less likely to be led astray by local optima. This is because they don't make use of single-point transition rules to move from one single instance in the solution space to another. Instead, GA's take advantage of an entire set of solutions spread throughout the solution space, all of which are experimenting upon many potential optima. However, in order for genetic algorithms to work effectively, a few criteria must be met: * It must be relatively easy to evaluate how "good" a potential solution is relative to other potential solutions. * It must be possible to break a potential solution into discrete parts that can vary independently. These parts become the "genes" in the genetic algorithm. * Finally, genetic algorithms are best suited for situations where a "good" answer will suffice, even if it's not the absolute best answer.

Tuesday, November 16, 2004

Never count on anyone except your self..........(Dont trust the runtime it will never behave ideally for your programs)

Never think that the code you have written is platform independent, even though you write it according to POSIX standards. So this is what programs teach us in life never trust any thing which is not written by you. YOU CANNOT COUNT ON ANYONE EXCEPT YOU.... --------------------------------------- An echo fades into the night, an eerie mournful sound. A shooting star disappears from sight, and I crumble to the ground. There is no life within this garden; my sobs are the only sound. I have poisoned the honeyed fountain where your love could be found. Dazed, I stare at the stars above, my grieving howls fill the night! Unintended betrayal of love has hidden you from my sight. I remember how it used to be when we shared our fears and delights. You are a treasured friend to me. How can I make things right? Feeling afraid, cold and lonely, I long to tell you how I feel, but you don’t want to hear me. The pain for you is much too real. Should I back away and build a wall and block away how I feel? Or, should I give you a call? We both need some time to heal. An echo fades into the night as our friendship disappears. How do I know what is right? How can I ease my fears? If I do call you again, would the old wounds reappear? I can’t stand to cause you pain. Hurting you again is my worst fear!

Friday, November 12, 2004

what you feel when __L_I_F_E__ daemon receives signal 11...

Pain... Tension... Fatigue... Depression... Anger, Aggression, Frustration. All these unwanted sensations - Burning, hurting, tearing. My heart alone, cold and fearing. Why won't you let me sleep, let me rest, Let me forget To eradicate, eliminate, destroy all my regrets? These memories inside, swirling, twirling, unwilling to reside in the corner of my mind. Repeating, resisting, insisting - Refusing to be denied its recognition Of its position in my Frustration, Confusion, Delusion. Ah, to close my eyes and let time fly by, Because there's so much to gain By forgetting these dreams driving me insane. Unfocused, unclear, out of control, My world spinning, spinning, spinning, My sanity flying through the door. My reason, my logic, oh, it's tragic, Like fine sands running through my hands, I'm losing my mind.

Tuesday, November 09, 2004

Some thing about research.

1. research needs more brains than hands (unfortunately we were given two hands but only one brain); before counting how many tools you can use, ponder how effectively you can think. 2. writing is occupying a critical role, since "writing is nature's way of letting you know how sloppy your thinking is". 3. mathematics is the key word, since it is "the science of effetive reasoning"; or "mathematics is nature's way of letting you know how sloppy your writing is".

Saturday, November 06, 2004

External Memory Geometric Datastructures

Many massive dataset applications involve geometric data (or data that can be interpreted geometrically) Points, lines, polygons Data need to be stored in data structures on external storage media such that on-line queries can be answered I/O-efficiently Data often need to be maintained during dynamic updates,Data sets in large applications are often too massive to fit completely inside the computer's internal memory. The resulting input/output communication (or I/O) between fast internal memory and slower external memory (such as disks) can be a major performance bottleneck. During the last decade a major body of research has been devoted to the development of efficient external memory algorithms, where the goal is to exploit locality in order to reduce the I/O costs Examples: Phone: Wireless tracking Consumer: Buying patterns (supermarket checkout) Geography: NASA satellites generate 1.2 TB per day

Tuesday, November 02, 2004

How to represent INFINITY in ur programs

No doubt every one might have come across this in their programming experience, on how to represent the theoritical infinity in the programs.
Example: -----------
Most candid use of INFINITY is to use them in graphs to represent two nodes which are not connected ie if we dont have any edge between two nodes N1 and N2 then we represent the cost of the edge as INFINITY. in the implementation of the dijkstra's algorithm on a graph we generally, come across a condition 'CURRENT_COST > CURRENT_COST + WEIGHT_OF_EDGE' then update the path. Theoritically INFINITY+1 = INFINITY. So if some one just does a #define INFINITY __SOME_LARGE_NUMBER, then INFINITY+1 will not be INFINITY. And the conditions just as the ones illustrated above will become buggy. The following representation of infinity is more shrewd than the ordinary #def's
/*
* The following coordinate, INFINITY, is used to represent a
* tile location outside of the tile plane.
*
* It must be possible to represent INFINITY+1 as well as
* INFINITY.
*
* Also, because locations involving INFINITY may be transformed,
* it is desirable that additions and subtractions of small integers
* from either INFINITY or MINFINITY not cause overflow.
*
* Consequently, we define INFINITY to be the largest integer
* representable in wordsize - 5 bits.
*/

#undef INFINITY
#define	INFINITY	((1 << (8*sizeof (int) - 6)) - 4)
#define	MINFINITY	(-INFINITY)

Monday, October 18, 2004

Moving towards Scalable Distributed and High Available Data Structures

MultiComputers: ---------------

Commodity computers, interconnected through the high- speed networks are becoming the basic hardware. Such configurations, called multicomputers, clusters, superservers... include dozens, often hundreds or even thousands of clients and servers . Their cumulative resources are impressive: dozens of GBytes of distributed RAM, and TBytes of disks accessible for the GMips-highly parallel and distributed processing. They offer potentially unbeatable performance and price/performance ratio, opening up new perspectives for the applications . Major hardware and software makers present multicomputers as the next step of their business strategy. This was, among others, the subject of Microsoft Scalability Day organized in May 1997 for the US professionals. The technology is also felt as the next step for the Internet that should evolve from a data providing utility today, into a computing utility . One also foresees very large multicomputers coming as new tools for the academia, e.g., a 10.000 node multicomputer for Stanford University in 5-10 years . Finally, the domain was recently declared as strategic to the US computer science supremacy in 21st century by the US Government, and become the object of nationwide research program PACI .

Multicomputers need new system software, fully taking advantage of the distributed RAM, and of parallel and processing on multiple CPUs,. One especially needs new data structures, allowing files to span over multiple servers, and to scale to as many sites as needed. Such files should reside for processing in the distributed RAM, providing then access performance inaccessible to disk files. They should be accessible to multiple autonomous clients, including the mobile ones. Finally, they should not require any centralized data access computation or directories, too avoid hot-spots.

One solution is a new class of data structures called Distributed Scalable Data Structures (SDDSs). First proposed in 1992-1993, SDDSs gave rise to important research effort, materialized by several algorithms, papers and implementations. It was shown that SDDS files are able to scale to thousands of sites, and terabytes in distributed RAM, with constant access performance, and search times under a millisecond. Multi-key searches requiring an hour or so in a traditional file, e.g., a k-d file, may succeed in less than a second in an SDDS file . All these properties should be of prime importance for the applications, especially in the DBMS design arena, . They open new perspective for the VLDB design, for multimedia databases, for real-time and high-availability databases, for decision support systems, and for high performance computing in general.

Wednesday, October 06, 2004

Need of Incremental Datastructures.........from transistors to transactions

Yep that sound's really great. As a developer did you ever felt the need of these things ever??. Currently Iam into this intresting area, I talked about making your datastructures persistent datasturctures (look at my previous blog), persistent datastructures can replace the need to database to make use of the concurrrency and consistency of the data in these structures. So now come's the challenge Incremental Datastructures, especially Incremental Datastructures are most essential if the data in these structures is really behemoth. Take the following examples from totally different domains Geometric synthesis: Physical Design ------------------------------------ As we know in many of the physical design tools (software), we need to represent all the geometric information of the circuit, I mean for the fabricator he just need the geometric information about the polygons in each layer (p-type, n-type , metal ect...). So in the software tools (Physical Design Layout Editors) to process this information. The complete information should be kept in some datastructure. I'll give an example of my favourite datastructure the CORNER STITCH. Created by Ousterhout corner stitch. but unfortunately corner stitch has the following drawbacks. 1. Its a totally inmemory datastructure. 2. Its not an incremental datastructure. So to handle the incremental changes (Custom IC design). We need an incremental corner stitch. So the question is can we make a incremental and external memory corner stitch? Bussiness Intelligence ----------------------- Lets move into a totally different domain which deals with massive amount of data, lets move from Transistors to Transcations. The massive data here Iam talking is about the data you dump in your Datawarehouse. So most of the analytical queries are based on MV's(Materialized Views). These MV's Hold massive amount of data really massive. And these are genereally refreshed every 1 to 1.5 months, to analyze the transcations a particular enterprise is processing. Yes Iam talking about OLAP and not OLTP. Generally the refresh time of a OLAP system is very large for an enterprise, typically goes to several days before the managers can analyze the reports on these MV's. Now the challenge is can we build a Real-Time OLAP system, which will not take this much time to refresh.....Yes Yes you got it right Iam talking about incremental refresh....so incremental refresh need a Incremental Datastructure. Recently I have been working with oracle, On a Bussiness Intelligence product. Oracle is the first company to recognise the need of incremental algorithms in the area of bussiness intelligence. They call it Daily Bussiness Intelligence (DBI) is the implementation of such incremental OLAP system with a lot of incremental datastructures in it. study more about DBI DBI So do you think your datastructures need a Incremental tinge???? Vamsi