Thursday, June 30, 2005

Completion of One Year in Software Industry

Yesss!
Today is a memorable day in my life. It marks my successful accomplishment of 1 year at software industry. Just, as it happens with me for every other important day (birthday's of my family members, exam dates etc.) for this day also till a week before I had huge plans to await for this day, but by the time the day arrived as usual I forgot about it. Only after a best pal wished me over phone did I realize that its a D day for me. I really want to celebrate this day, but I don't see my friends around :( . Everyone including me are busy at their respective works. It makes sense if I take time out of work, b'coz my PM understands that its my work anniversary at CA. But I can't expect my friends PMs to be so considerate to let them off for an hour or two for their friends D day. So then, is it going to be just another dumb day? Ohh...NOOOOO.

Nature's mockery

Time: 5P.M
Hey! Its raining out. Argh... but this one looks like a furious one. Heavy downpour with huge wind blows. Even cars seem to take a side and halt. Thanks to the air-tight work place or else I would be shivering till I lost a tooth or two.

Time: 6P.M
Just slided the venition blinds open to see how the weather is out, if the rain is still daunting. Amazing! not a clue about the fact that it rained so furiously an hour ago. Everything is so dry outside. Well all I could see out of the window is the tar road and cement flooring only. Had there been some clay court somewhere in the view it could have given me the intensity of the rain. In any case, Nature is mocking us with its ability to create unpredictable weather patterns.

Wednesday, June 29, 2005

Least number of bags - CAT kinda question

This one is a most common one.

Question:
----------
Jaya has 110 one rupee coins with him. He wants to distribute them into bags of various amounts such that he would be able to hand over a whole number of bags for any requested amount of money, which is going to be a whole number from 1 to 110, without adjusting the number of coins in any of the bags. What is the least number of bags required to do so.

Solution:
---------
An amount of 1 rupee to be given away there needs to be a 1 Re bag. So lets have it. So far #of bags is 1. With the existing bags can we give away an amount of Rs.2? No. Either we need to have one more bag of Re.1 or a bag of Re.2. For least number of bags, second choice should be followed. So we will have as the second bag a Re.2 bag. With these existing lets see what all amounts we can give. We can give upto Rs.3 . Now we will make a bag of Re.4 so that we can cater to all amounts till Rs.7. Then again a bag at Re.8, Re.16, Re.32. So far we have bagged (1+2+4+8+16+32 = 63) rupees into bags. And we are in a position to cater to any requested amount upto Rs.63. Since this is greater than half of the total amount (i.e.110/2 = 55). We can stop continuing the above process and bag the remaining amount (i.e. Re.47) into one bag. This process will yield us the least number of required bags. In this case, it is 7.

As a short cut one can remember that for a total amount of 2^n to [2^(n+1)]-1, we will need at least n+1 bags

TajMahal - Symbol of Love

Love!
Just one word, but it has more than an Encyclopedia Britannica inside it.
It is vague yet very concrete. Its mild but has the power to bring down a mountain.

It can mould the tough into unimaginably soft. Similarly soft ones to unconceivably tough. It can put a lazy laggard into best of his form. It can control the otherwise uncontrolled. A serious promise to even father or mother sometimes might skip the mind unnoticed, but one to a true love would remain. I feel there isn't any unique definition of love and its a varied answer as perceived by everyone who has experienced it. And that answer would be the way their beloved receives them, treats them and moulds them to the core. To the conventional thinker who thinks that marriage is the climax of love, and not realizing it that way is equivalent to not being loved, I have serious objections.
This reminds me to answer here one of the most controversial questions 'Can love happen more than once?' Yes! it can. Its the process of receiving, treating and moulding that had the impact on you than the person who does it. In the case of lucky ones, its always one person who does that for a life time. But for those not so lucky ppl, as destined by God in their fate, more than one seem to carry the torch across their lifetime. But I'd say, heart being not so easily erasible plate the threshold barriers simply multiply many fold to convince it that the torch bearer changed.

Wooooph! better not tickle me on this aspect, I become all the more hazy and complex.

Monday, June 27, 2005

Moms are crazy

Moms can be crazy! When my sisters hinted that when I was a kid, I didn't first believe. But slowly I too began to have my share of experiences. Well, this isn't anything hostile about my Mummy, she is so very sweet. Its just that she is innocently sentimental, and the very same time foolishly stubborn on her decisions. Just depicts a perfect example for grown-up's childish mentality. Yesterday I had a fresh new experience. Everytime I say I'm gonna shop a new pair of clothes she would, just for the sake without any reason, reflexively say 'hold on, you can have it on your b'day (or some other fairly distant occassion in future)'. So I partly got accustomed to it i.e. a mix of procrastinating my shopping sometimes or slyly doing the shopping without informing my mother about it. Given that background, would it not be a surprize to me if my mom calls on 27th June to inform that I better go purchase, not one but two pairs of clothes and that too before 30th of June and also wear them on consecutive days.

Another interesting CAT question and solution

Question:
A number when divided by 5, 6, 8, 9, 12 leaves a remainder 1 in every case. But, when divided by 13 doesn't leave any remainder. Find the least such possible number.

Solution:
Looking at first line, straight away we should find L.C.M(5,6,8,9,12). And that is 360. Now any mulitple of 360 increased by 1 would satisfy the first line. Now the second line is the tricky one. 361 as such is not divisible by 13. 361 % 13 = 10 and not 0. So some other mulitple of 360 increased by 1 should be tested. Rather than brute forcing on every multiple. Assume that 'alpha'*360 when increased by 1 is perfectly divisible by 13. Then that means...
('alpha'*360) % 13 = 12 (Note this carefully)
=> [('alpha')%13] * [360%13] = 12
=> [('alpha' * 9)%13] = 12 (since 360%13 = 9)

So this looks more manageable, [('alpha') *9] should be one less than mulitple of 13 i.e. 12 or 25 or 38 or 51 or 64 or 77 or 90 <<< there you got a mulitple of 9. So least 'alpha' value is 90/9 = 10.
Hence the required answer is [(10 * 360) + 1] = 3601.

However, if in the options there is no 'none' and the other options look weird enough (as it happened in the answer choices I got), i.e. doesn't even satisfy the first requirement. Elimination of the answers and quickly arriving at the correct answer should be the preferred way of tackling a CAT question like this. CAT setters are interestingly nice, they set tough questions but keep some steppign stones in the path to arrive at solution without actually formally solving the question. Rewarded is the one, who identifies these stepping stones.

Regards
Jayachandra

Thursday, June 23, 2005

Some introduction on Webservices

Web Services are what I'm delving in since more than an year. WS idea is all about how a client on one platform can leverage the functionality of a piece of code written on a differnt platform. Say a java client talking with a .NET server. Earlier there are technologies like CORBA, Java RMI etc, which were very tightly coupled between client and server. They often relied on seperate port connections to communicate between client and server. But enterprises were skeptical about adopting such tightly coupled technologies fearing by enabling extra ports, malicious programs can cause harm etc. So the idea of web services sprout out in this context. There wont be need to enable any extra ports, there won't be transfer of data in any other format than plain text XML.

There are majorly two types of Webservice technologies SOAP based Webservices and REST Webservices. The later I've no idea. Former one is the popular one. Let me elaborate on SOAP based Webservices.
Here the whole idea is whatever client wants to ask, it will ask passing a piece of plain text XML. Whatever the server wants to respond, it will respond by sending another piece of plain text XML.

Request workflow:
Client -> BlackBox1 -> ====XML Request==== -> BlackBox2 -> Server side webservice

Fig:1

Response workflow:
Client <- BlackBox1 <- ====XML Response==== <- BlackBox2 <- Server side webservice Fig: 2 Now there above two black boxes are mentioned, if you observe. These are the web service engines like our open source Axis or gSOAP, or proprietary .NET etc. These actually create the XML request for a call made by client in its program that looks like String answer = localStub.addNumbers(5, 10); But then you would get the natural question of what should the XML request look like and how is it that the server is going to understand whatever piece of XML client sends. There pitches in the WSDL - Web Service Description Language. If you take the black box on the server side, henceforth BB2, it has the ability to look into the webservice (its nothing but a java program for me, or a C# program from somebody else) and come up with a description document (WSDL) saying if anybody wants to request the addNumber method of this webservice their XML request should be sent to me in the following format <>
<>
<>
<>value1 < /param1 >
<>value2 < /param2 >
< /addnumber >
< /BODY >
< /soapenv >
Fig: 3
and I'd respond the answer in the following format
<>
<>
<>
< type="integer">answer< /addnumberreturn >
< /response >
< /body >
< /soapenv >
Fig: 4

Note: The above xmls are just meant to be directive to help understanding and are not actual

BB2 receives the client sent XML requests, parses and processes them and finally calls the webservice method code. It takes the answer returned by the webservice and again wraps it as per the template shown in Fig: 4 and sends it to client.

The client side black box, hence forth BB1, has the ability to read the WSDL and understand that I need to send the request as per Fig:1 template and parse the answer wrapped and sent as in Fig: 4 template.

If you see the XMLs above they are slightly strange in the sense have extra and tags which might seem redundant as per the knowledge given so far, but they are actually place holders for some information as to type of charset-encoding used to send the content etc. This special format XML is generally called SOAP. Essentially on the wire a SOAP request and a SOAP response are transferred.

The WSDL also has in it embedded information in which it can say I'm expecting the XML to be sent to me over http protocol (in which case BB2 will be listening at port 80) or ftp protocol or SMTP mail protocol etc.

This is the way Webservices, XML, SOAP are related.

Strange dreams!

Everyone of us get dreams in sleep (gifted is the one who doesn't dream, he/she is supposedly giving the perfect relaxation to his grey cells), and I'm not any different. And just as my friends do, I too don't remember them in the morning after I awake unless it's such a nightmare that forces me out of sleep. Today I've had two such nightmares (if I can call them so, because they disturbed my sleep). First one was I dreamt of united andhra pradesh getting split into two states - Telanga and 'X' (my dream didn't name it :( ). Guntur was declared to be the capital of 'X' it seems. Guntur being the city near to my native, I always wished to own a good plot in it. But the land prices grew exhorbitantly high overnight that I couldn't own any small plot in Guntur. And that worried me I guess and result - sleep disturbed. But it didn't take much time to drown back into sleep again (for it's been my birth right :D). This time I dreamt of taking CAT exam, all was well till the end of the exam but just before the examiner came to collect my answer sheet I realized I didn't attempt comprehension questions in English section at all. There was a steep anxiety spike in my mind I guess, that it choked me out of sleep. Come to think about it, am I subconciously fearing CAT? Its high time I follow these hints and make the CAT journey as safe and smooth as I can. That means, put in some *quality* time after office and in weekends into CAT prep before I really get tensed up. Exam tension is the last thing one could entertain.

Good luck to me!

Signing off
Jayachandra

Nostalgia about college days

I was trying to organize the frivolously scattered away content on my PC when I found a folder named 'GDIT2kYearBook'. Double clicking the folder is the reason why I'm blogging around now here. A reel of scenes passed right infront of my eyes as I began to see several documents present in there. They are mostly just individual profiles of my classmates and the comments that others had then to say to each one of them. But since the batch is a 140 strong one, that itself is quite a lot. Those early days when we were intially alloted rooms as per our roll numbers wished me 'Hi buddy! do you remember how nice we were to you'. The term roll numbers made me involutarily recall what are the roll numbers of my dear ones. I had tough time recollecting them, for I barely used to proxy for anyone. Even if I did, I never used to do it to any particular set on a daily basis as some of my other peers used to :). So that makes it difficult now to recollect roll numbers. Having failed to recollect the roll numbers in a manner that I myself am convinced at, I thought can I find them somewhere at the college site? Strange! Those ids without which nothing used to move even an inch, be it academic work or mess registration or gate pass ... when we spent our time there, doesn't even seem to have a record anywhere on the college site once we are out. Of course, at least I was able to find a graduation program wise sorted listed of all old students. As I scrolled through the list of names of my classmates ( 140 is a long list, isn't it?) tears whirlled, unknowingly, into my eyes. Oh well! I can't say that the reason is unknown. If I take time and analyse why that happened, I end up in 'that's what might be what they call Nostalgia'. Without my intention a series of incidents such as day to day fun/pun we friends used to have amongst overselves, the basketball court, the TV room, the mess (yuck! but sometimes its nice also), the classroom (I'm comfortable calling it Seminar Hall), the canteen, the roads every inch of my alma mater babbled with my mind. The hostel though, took the largest share of time my mind wavered across the whole campus life. Only after I poured out my feelings I'm feeling relaxed, lest I would have got too depressed with my own nostalgia. Should I say leading such a nice campus life is a boon? or bane? Huh! I am too confused to think on it anymore.

CAT question and interesting solution

In a certain system product of 44 X 11 is represented as 2124 find how 1453 can be represented in decimal system ?
1)248 2) 346 3) 393 4) 410

Try to solve the above question.
A typical way people set out to try this one after giving it a thought is to come up with an equation as follows
2*(x^3) + 1*(x^1) + 2*(x^2) + 4*(x^0) = 44 * 11 = 484

But this being a quadratic there won't be easy methods of indentifying the roots and hence takes significant time to solve and get x=6 as the answer.

The intelligent way of tackling such a question would be, we are given that 484 of decimal system maps to 2124 of a system to the base x. Since in decimal system 2124 is more than 484, certainly base value should be less than 10 for the new system. So we have zero'd down the sample space to 9,8,...,3,2,1. We are asked to find what does 1453 of unknown base system correspond to in decimal system, as simple rule is that digits of a number in certain system with base=n will all be less than 'n'. So in our case the base value must be at least greater than 5. So the search space got reduced to 6,7,8 and 9. Now try substituting in the above equation x=6 and you see it satisfies, so you can quickly calculate the required answer i.e. 1*(6^3) + 4*(6^2) + 5*(6^1) + 3*(6^0) = 393.

This is the way to tackle a CAT question, there always will be a simpler way to unfold things than they appear infront of our eyes in the first glance, the one who identifies it wins the race.

Hope that helps at least some fellow aspirant out there.

cheers,
Jayachandra

Tuesday, June 21, 2005

You think you know a girl...

But you really dont.
That's the whole point, which might seem obvious to guys who have had an experience and ridiculous to those who didn't. But my case is that after having had a couple of experiences, still I couldn't get this thing into my mind. May be writing it somewhere would benifit me in avoiding a fall flat on nose the next time.
In short if I had a little younger brother, what I'd suggest him is... 'girls, particularly those who you think match your taste, will turn out to be extremely complex in their mind. So better close the shop, stay away and remain silent (best thing of all times). Eating lunch in your own cafeteria is far better than attending a lunch invitation given by girl(s). Don't even think about you trying to convince them for a lunch outside. It's only next to possible.'

Hurray

Finally! I've got something I've longed for. Hello all my friends out there, here I'm about to send you all my new blog "http://readmymusings.blogspot.com/". To memorize it better, split the words as 'read' 'my' 'musings' and you wouldn't forget.

Yet again a test blog

Hi there!
I don't know if its the lack of homework on my end or a complex ui for a new blogger like me that I've repeatedly failed to have a blog with a decent name for myself. The first time I tried, all that I could do was to just have a username registered. Next time, out to put some serious content, in the wake of fellow colleagues publishing pretty nice blogs, I wrote something but got it hosted with an unusual blog name which would make sense to have just that post in all under it (I've mistook 'blog' for a specific 'post'). And now this is the third time I'm here trying to create a meaningful blog that I can give out to others saying 'Hey! watch out, the following is my blog url' and still expect no one to grin at its name.