Problem:How do to get the fractional portion of a number in Java?
Suppose we have a number 4.56.
We need to get 0.56(fractional part) of it.
Solution:
double fraction(double d) {
if (d >= 0)
return d-Math.floor(d);
return d-Math.ceil(d);
}
Thanks to this link:
http://forum.java.sun.com/thread.jspa?threadID=752735&messageID=4301382
Search
Wednesday, April 23, 2008
Tuesday, March 25, 2008
Farewell to S10
For the past 2 years, S10 has been my second home. I think I must have spent more here rather than at my home. :-)
As all things are prone to changes, so is my location. Our project has been shifted to Campus and from tomorrow, we will be working from Campus.
This sudden change is making me feel very insecure and restless, I don't know why.
For the past two years, S10-4F10 has been the adda for most of our NCG-10 ppl... For the guys working in non-S10 locations, this location has been the baggage counter(cloak room).. By 6PM, my desk has been decorated with your bags, jerkins, helmets etc. etc. Most of you have used my system at some point or the other, for sending mails or to play games or to copy photos using USB ;-)
But from now on, this desk, this location will be used by someone else. S10-4F10 has been my location but now I will have to leave it for someone else to occupy.
My desk drawers have been home to all the sauce sachets from McD, for snacks that would come in handy during late-night treats and also for paper-plates, butter-knife, spoons etc. etc... It was also a stationery unit where one could find staplers, pins and other knick-knacks... I have emptied the drawers now, for I have to submit the desk keys to the facilities... I have never seen my desk, this empty..
Whoever gets a call from 6405 will say, "Haan Arathi.. Enti? Cheppu..." (even when it's Spoo or Shank who is making the call.. ) The number 6405 has been an permanent extn number for me.. But from tomorrow, the calls to this number will not be picked up by me... :-(
You must be thinking, what an emotional fool, I am... But guys, this is what I feel right now.
As all things are prone to changes, so is my location. Our project has been shifted to Campus and from tomorrow, we will be working from Campus.
This sudden change is making me feel very insecure and restless, I don't know why.
For the past two years, S10-4F10 has been the adda for most of our NCG-10 ppl... For the guys working in non-S10 locations, this location has been the baggage counter(cloak room).. By 6PM, my desk has been decorated with your bags, jerkins, helmets etc. etc. Most of you have used my system at some point or the other, for sending mails or to play games or to copy photos using USB ;-)
But from now on, this desk, this location will be used by someone else. S10-4F10 has been my location but now I will have to leave it for someone else to occupy.
My desk drawers have been home to all the sauce sachets from McD, for snacks that would come in handy during late-night treats and also for paper-plates, butter-knife, spoons etc. etc... It was also a stationery unit where one could find staplers, pins and other knick-knacks... I have emptied the drawers now, for I have to submit the desk keys to the facilities... I have never seen my desk, this empty..
Whoever gets a call from 6405 will say, "Haan Arathi.. Enti? Cheppu..." (even when it's Spoo or Shank who is making the call.. ) The number 6405 has been an permanent extn number for me.. But from tomorrow, the calls to this number will not be picked up by me... :-(
You must be thinking, what an emotional fool, I am... But guys, this is what I feel right now.
Thursday, March 20, 2008
Getting Married, Part-V
(Continuation of "Getting Married Part-IV")
A girl leaves her home to spend the rest of her life with a completely different/new family. She adjusts her life style, her dressing, her working hours etc. to suit her new home. Yet she is not the bakra here! Only the guy is bakra!
She has to forgo her professional career if they decide to have a baby. Yet the guy is the bakra!
After marriage is there any change in the way a man lives? Not much, in fact the change is almost negligible! He still continues to get up at seven… gets a ready cup of coffee and breakfast once he gets ready… His clothes are readily pressed for him as always… Even after he returns from office, he gets to watch his favorite TV programs…
How about the girl? She is expected to cook, wash and clean and take care of the family… She is asked to do things that she has never done before. She has to manage home and office… Yet the guy is the bakra! How mean! Why is life so partial!
******************
Bhavana and I are having our lunch together when I see the wedding card of her friends. It says: “Sanjay weds Sarika(alias Gautami)”
“What’s Sarika doing?”
“Who’s Sarika?”
“Sanjay’s fiancĂ©e.”
“Oh! You mean Gautami?” she says, “She’s a school teacher. Actually, her name is Gautami only. But according to Sanjay’s horoscope, he should marry a girl whose name starts with an S. Only then he will be wealthy.”
“So? So, she has changed her name for him?” I ask.
“Oh no! He has asked her to change it to Sarika,” she replies and adds, “In fact, she did not want to change her name at all. But her parents insisted that she will never get a better marriage proposal; so she had to change her name.”
“Bad! Very bad!” I exclaim and add, “Very sad too!”
In general the girl’s surname changes after her marriage. In fact, after her marriage, Bhavana prefers to be called as Bhavana Dubey, rather than Bhavana Sharma. One day, I asked her, “Why did you change your name after marriage?”
“That is our India tradition, dear,” she said and continued, “One day, even you will change your name.”
“Do you like being called Ms. Dubey rather than Ms. Sharma?”
“Yes, of course!””Is your husband called Mr. Sharma?”
“No,” she replied in a shock, “Why will Vinod be called a Sharma? He was born in the Dubey family.”
“But you were also born in a Varma family not a Dubey family,” I argued.
“You don’t seem to value Indian traditions.”
“It’s not like that. People do not wish to change something that has been continued for ages. They don’t want to see a change. They don’t want to be singled out and pointed out. Or sometimes, they have been brainwashed to such a extent that they accept all the norms of the society without any question. If someone goes against these general norms, he/she is called arrogant.”
I got so angry that day that I stormed out of her cubicle. But now, changing of surname seemed so small when compared to changing a person’s name. We have been called by a name since our birth, it is the same name that we see in all our school certificates and ID cards, and now all at once, it is printed differently in our wedding card. It’s so sad! Why are we forced to change for someone else? If Gautami was interested in changing her name, it would be fine, but this change has been against her wishes. I pity at the plight of most of the girls in the society.
(To be Continued in "Getting Married Part-VI")
A girl leaves her home to spend the rest of her life with a completely different/new family. She adjusts her life style, her dressing, her working hours etc. to suit her new home. Yet she is not the bakra here! Only the guy is bakra!
She has to forgo her professional career if they decide to have a baby. Yet the guy is the bakra!
After marriage is there any change in the way a man lives? Not much, in fact the change is almost negligible! He still continues to get up at seven… gets a ready cup of coffee and breakfast once he gets ready… His clothes are readily pressed for him as always… Even after he returns from office, he gets to watch his favorite TV programs…
How about the girl? She is expected to cook, wash and clean and take care of the family… She is asked to do things that she has never done before. She has to manage home and office… Yet the guy is the bakra! How mean! Why is life so partial!
******************
Bhavana and I are having our lunch together when I see the wedding card of her friends. It says: “Sanjay weds Sarika(alias Gautami)”
“What’s Sarika doing?”
“Who’s Sarika?”
“Sanjay’s fiancĂ©e.”
“Oh! You mean Gautami?” she says, “She’s a school teacher. Actually, her name is Gautami only. But according to Sanjay’s horoscope, he should marry a girl whose name starts with an S. Only then he will be wealthy.”
“So? So, she has changed her name for him?” I ask.
“Oh no! He has asked her to change it to Sarika,” she replies and adds, “In fact, she did not want to change her name at all. But her parents insisted that she will never get a better marriage proposal; so she had to change her name.”
“Bad! Very bad!” I exclaim and add, “Very sad too!”
In general the girl’s surname changes after her marriage. In fact, after her marriage, Bhavana prefers to be called as Bhavana Dubey, rather than Bhavana Sharma. One day, I asked her, “Why did you change your name after marriage?”
“That is our India tradition, dear,” she said and continued, “One day, even you will change your name.”
“Do you like being called Ms. Dubey rather than Ms. Sharma?”
“Yes, of course!””Is your husband called Mr. Sharma?”
“No,” she replied in a shock, “Why will Vinod be called a Sharma? He was born in the Dubey family.”
“But you were also born in a Varma family not a Dubey family,” I argued.
“You don’t seem to value Indian traditions.”
“It’s not like that. People do not wish to change something that has been continued for ages. They don’t want to see a change. They don’t want to be singled out and pointed out. Or sometimes, they have been brainwashed to such a extent that they accept all the norms of the society without any question. If someone goes against these general norms, he/she is called arrogant.”
I got so angry that day that I stormed out of her cubicle. But now, changing of surname seemed so small when compared to changing a person’s name. We have been called by a name since our birth, it is the same name that we see in all our school certificates and ID cards, and now all at once, it is printed differently in our wedding card. It’s so sad! Why are we forced to change for someone else? If Gautami was interested in changing her name, it would be fine, but this change has been against her wishes. I pity at the plight of most of the girls in the society.
(To be Continued in "Getting Married Part-VI")
Delightful Dosa, Part-II
(Continued from Part-I...)
Two months later:
The Mom prepared the batter for dosas and put it in the fridge. The next day was the dosa-day. They all would have dosas for breakfast. She prepared the spicy onion sambar and the sweet coconut chutney and set them on the dining table. As the daughter was busy solving a puzzle given by her Dad, there was no banging of plates and spoons and no shouting slogans. It was a calm Sunday.
The Mom wanted to start making the dosas but the Dad was missing. He had not gone out but he was not inside the house either. The Mom called out to the daughter to fetch her Dad. Just then the phone started ringing. She went to the drawing room to pick it up. It was one of her childhood friends. She chatted with her without the sense of the passage of time.
In the mean time she could smell the making of dosa. She thought she was just imagining things. But she was wrong. Soon the Dad and daughter got a tray laden with a hot, crispy dosa, bowl of sambar and a bowl of chutney to the drawing room. They dragged a side-stool and placed the tray on it. She was so much overwhelmed that she hastily ended the call and sat transfixed. The Dad cut a piece of the yummy dosa, dipped it into the tasty sambar and put it into the Mom’s mouth.
Mom’s eyes filled with tears of gratitude. After almost five years, she was having a homemade dosa. After the initial hesitation, she ate and ate and ate till she could eat no more. The Dad put dosa after dosa onto her plate and she gulped it down at an equally fast pace. When she felt that her tummy would burst, she put the plate in the sink and washed her hands. She saw the Dad in the kitchen making more dosas for the daughter and for him. She simply put her arms around him from behind and gave him a warm hug.
That night after the daughter was tucked into the bed and fast asleep, the Mom and the Dad lay on a thin mattress on the terrace, gazing at the stars.
The Mom asked, “Where did you learn to make such good dosas?”
“I learnt them from your mom.”
“But when?” she asked in surprise.
“Why do you think I have been coming home late for the past two months?”
“Oh! So, you have been meeting your mother-in-law in secret?” she teased.
He laughed and said “I have always wondered why you always ordered for dosas whenever we went out to eat. But you would never eat them at home. I thought, may be you don’t like home-made dosas but then you always eat them when you are at your place. That was when I went to your mother and asked for the reason. She said that sometimes when we use a lot of oil during cooking, we would be left with a nauseating feeling. We might not even like to have anything, even if it were our favorite snack. The same would hold for vadas, puris, pakodis and bhajjis.”
He paused and took her hands in his and asked, “Why didn’t you tell me this, dear?”
“Tell you that I don’t feel like having my favorite snack anymore?”
“Not that. You should have told that you were sacrificing the food preparation that you like the most, just for the sake of us.”
“It’s not like that!” she argued, “I love it when I see you enjoy your dosa.”
“While you choke yourself in the smoke inside the kitchen?”
Mom could not say anything more.
“I could not bear to keep quiet after seeing you doing so much for us,” said Dad
“So, the person, who hates to even make tea, has now learnt to make tasty dosas,” she chuckled.
He nodded and replied, “From now on, I will be the only one making dosas…”
“...And I will be the one to eat them,” she added happily.
“But of course,” he added, “You will have to make the sambar and chutney!”
Mom snuggled closer to Dad realizing how happy and fortunate she was to get a husband like him!
(Well, that's the end of the story! :-D)
Two months later:
The Mom prepared the batter for dosas and put it in the fridge. The next day was the dosa-day. They all would have dosas for breakfast. She prepared the spicy onion sambar and the sweet coconut chutney and set them on the dining table. As the daughter was busy solving a puzzle given by her Dad, there was no banging of plates and spoons and no shouting slogans. It was a calm Sunday.
The Mom wanted to start making the dosas but the Dad was missing. He had not gone out but he was not inside the house either. The Mom called out to the daughter to fetch her Dad. Just then the phone started ringing. She went to the drawing room to pick it up. It was one of her childhood friends. She chatted with her without the sense of the passage of time.
In the mean time she could smell the making of dosa. She thought she was just imagining things. But she was wrong. Soon the Dad and daughter got a tray laden with a hot, crispy dosa, bowl of sambar and a bowl of chutney to the drawing room. They dragged a side-stool and placed the tray on it. She was so much overwhelmed that she hastily ended the call and sat transfixed. The Dad cut a piece of the yummy dosa, dipped it into the tasty sambar and put it into the Mom’s mouth.
Mom’s eyes filled with tears of gratitude. After almost five years, she was having a homemade dosa. After the initial hesitation, she ate and ate and ate till she could eat no more. The Dad put dosa after dosa onto her plate and she gulped it down at an equally fast pace. When she felt that her tummy would burst, she put the plate in the sink and washed her hands. She saw the Dad in the kitchen making more dosas for the daughter and for him. She simply put her arms around him from behind and gave him a warm hug.
That night after the daughter was tucked into the bed and fast asleep, the Mom and the Dad lay on a thin mattress on the terrace, gazing at the stars.
The Mom asked, “Where did you learn to make such good dosas?”
“I learnt them from your mom.”
“But when?” she asked in surprise.
“Why do you think I have been coming home late for the past two months?”
“Oh! So, you have been meeting your mother-in-law in secret?” she teased.
He laughed and said “I have always wondered why you always ordered for dosas whenever we went out to eat. But you would never eat them at home. I thought, may be you don’t like home-made dosas but then you always eat them when you are at your place. That was when I went to your mother and asked for the reason. She said that sometimes when we use a lot of oil during cooking, we would be left with a nauseating feeling. We might not even like to have anything, even if it were our favorite snack. The same would hold for vadas, puris, pakodis and bhajjis.”
He paused and took her hands in his and asked, “Why didn’t you tell me this, dear?”
“Tell you that I don’t feel like having my favorite snack anymore?”
“Not that. You should have told that you were sacrificing the food preparation that you like the most, just for the sake of us.”
“It’s not like that!” she argued, “I love it when I see you enjoy your dosa.”
“While you choke yourself in the smoke inside the kitchen?”
Mom could not say anything more.
“I could not bear to keep quiet after seeing you doing so much for us,” said Dad
“So, the person, who hates to even make tea, has now learnt to make tasty dosas,” she chuckled.
He nodded and replied, “From now on, I will be the only one making dosas…”
“...And I will be the one to eat them,” she added happily.
“But of course,” he added, “You will have to make the sambar and chutney!”
Mom snuggled closer to Dad realizing how happy and fortunate she was to get a husband like him!
(Well, that's the end of the story! :-D)
Tuesday, March 18, 2008
Delightful Dosa
The Dad and the daughter were sitting at the table making sounds by hitting the plates and glasses with spoons and forks. It was music to their ears. Mom came into the dining room. She has two bowls in her hand. She put that down and went back into the kitchen. Dad and daughter started sniffing at the bowls imitating dogs. The aroma of onion sambar and smell of freshly ground coconut hung in the air. This made them all the more hungry and they started singing, “We want dosa. We want dosa,” at the top of their voices. The banging of plates and tumblers gave them the required background music.
The Mom smiled at the two and hurried back to the kitchen. She had two tawas on the gas stove and started to making dosas, two at a time. She put a little oil on the tawa, then poured a ladle of thick batter onto it and spread it evenly on the tawa’s surface. She put some more oil around the edges of the dosa, flipped it on the tawa and waited till it cooked. The dosa, after completion, would go directly on the plates of Dad or daughter. The Dad helped the daughter cut a piece of the crispy dosa, dip it into a cup of spicy onion sambar or sweet coconut chutney and put it in her mouth. The Mom was reminded of her childhood days when her Dad would so the same for her. When she could eat dosas to her heart content. These days things had changed a little.
While making dosas, the entire kitchen would be filled the smell of burning oil. Even with the exhaust fan switched on, the smoke remained for sometime. While making the first few dosas, the mother’s mouth would water, but with the Dad and daughter eagerly waiting to taste them, she would want to serve them first. By the time they had finished eating, with the smell of smoke around, the mother would lose her appetite and sometimes would have a feeling of nausea. She would not make any dosas for herself. Instead, she would eat a little curd rice. She would be alone at the table as the Dad and daughter, with their tummies full, would be lying on the divan in the hall and watching some cartoon programs.
That day, also the same thing happened. She was having her curd rice with pickle when the Dad came to the dining hall to drink some water. He sat beside her and asked, “The dosas are simply delicious. You are a great cook!” She smiled back at him and continued to eat. “Why did n’t you eat some?” asked Dad. “Of course, I ate,” she lied, as always, “I had two dosas and now I am having this curd rice so that I don’t feel very thirsty.” Dad gazed at her for sometime and then patted her back and went back to the TV room.
Two months later:
(To be continued soon.. I know, you people hate to see this line at the end of almost every post of mine. I promise to end this in the next two days :-D)
The Mom smiled at the two and hurried back to the kitchen. She had two tawas on the gas stove and started to making dosas, two at a time. She put a little oil on the tawa, then poured a ladle of thick batter onto it and spread it evenly on the tawa’s surface. She put some more oil around the edges of the dosa, flipped it on the tawa and waited till it cooked. The dosa, after completion, would go directly on the plates of Dad or daughter. The Dad helped the daughter cut a piece of the crispy dosa, dip it into a cup of spicy onion sambar or sweet coconut chutney and put it in her mouth. The Mom was reminded of her childhood days when her Dad would so the same for her. When she could eat dosas to her heart content. These days things had changed a little.
While making dosas, the entire kitchen would be filled the smell of burning oil. Even with the exhaust fan switched on, the smoke remained for sometime. While making the first few dosas, the mother’s mouth would water, but with the Dad and daughter eagerly waiting to taste them, she would want to serve them first. By the time they had finished eating, with the smell of smoke around, the mother would lose her appetite and sometimes would have a feeling of nausea. She would not make any dosas for herself. Instead, she would eat a little curd rice. She would be alone at the table as the Dad and daughter, with their tummies full, would be lying on the divan in the hall and watching some cartoon programs.
That day, also the same thing happened. She was having her curd rice with pickle when the Dad came to the dining hall to drink some water. He sat beside her and asked, “The dosas are simply delicious. You are a great cook!” She smiled back at him and continued to eat. “Why did n’t you eat some?” asked Dad. “Of course, I ate,” she lied, as always, “I had two dosas and now I am having this curd rice so that I don’t feel very thirsty.” Dad gazed at her for sometime and then patted her back and went back to the TV room.
Two months later:
(To be continued soon.. I know, you people hate to see this line at the end of almost every post of mine. I promise to end this in the next two days :-D)
Thursday, February 28, 2008
Happy Extra Day!
Today is 29th February...
The extra day that comes only once in 4 yrs...
On this special day in this special month
(Feb is the only month that has less than 30days),
I want to wish all those special persons
who have added so many cherished moments in my life...
Looking back at my life,
I realize that how happy and contented,
my life has turned out to be, in the last few months..
It's all because of your presence...
My loving dears, you have touched my soul!
You are simply amazing...
I am very proud to have you all, so close to me... :-)
I pray that your life be filled with countless number of special moments..
The extra day that comes only once in 4 yrs...
On this special day in this special month
(Feb is the only month that has less than 30days),
I want to wish all those special persons
who have added so many cherished moments in my life...
Looking back at my life,
I realize that how happy and contented,
my life has turned out to be, in the last few months..
It's all because of your presence...
My loving dears, you have touched my soul!
You are simply amazing...
I am very proud to have you all, so close to me... :-)
I pray that your life be filled with countless number of special moments..
Wednesday, February 20, 2008
Do you believe in Telepathy?
Well, I don't know about you, but I do! :-)
This night our dear Mandu asked me if I needed anything for dinner. I was sitting at my office desk, fully-exhausted and dead-tired. I had already eaten my lunch for dinner, so I told him:'Nothing'. He joked that 'Nothing' can't be ordered for dinner and that it is very difficult to get 'Nothing' for me. I just smiled and got back to work. Infact I was feeling like having some sweet paans. You know what I like the most in Tabla? The sweet paans that come along with the bill. ;-)
When he returned from dinner, guess what? He had got sweet paan for me. I was utterly surprised and extremely delighted. How could he read my thoughts? Or was I silently in my thought, asking him to bring me sweet paan?
No one knows but he did read my mind and this was not the first time! :-)
So, atleast now, do you believe in Telepathy?
This night our dear Mandu asked me if I needed anything for dinner. I was sitting at my office desk, fully-exhausted and dead-tired. I had already eaten my lunch for dinner, so I told him:'Nothing'. He joked that 'Nothing' can't be ordered for dinner and that it is very difficult to get 'Nothing' for me. I just smiled and got back to work. Infact I was feeling like having some sweet paans. You know what I like the most in Tabla? The sweet paans that come along with the bill. ;-)
When he returned from dinner, guess what? He had got sweet paan for me. I was utterly surprised and extremely delighted. How could he read my thoughts? Or was I silently in my thought, asking him to bring me sweet paan?
No one knows but he did read my mind and this was not the first time! :-)
So, atleast now, do you believe in Telepathy?
Monday, February 4, 2008
God is still there!
Last night I decided to take some parcels for home from Dosa Plaza. As we all know, Dosa Plaza is in the second floor. We have to take the stairs to the place. As I was about to climb the steps of the building I observed two boys (Ones who do valet parking), talking to each other. I heard one say to the other: “Take care of this girl also na!” and then both started laughing. To my disbelief, that guy started following me. I was terrified. My saree did not allow me to climb fast, yet I managed to take two steps at a time. But he was catching up fast. When I was almost at the second floor, I looked back to see him climbing faster with both his arms stretched towards me. He was at a distance where he could almost touch me. Luckily for me, two other persons were coming in the opposite direction and I rushed into Dosa Plaza.
While I was waiting for my order, I was wondering how to get out of the building. I was sure that that guy would be still lurking around. With everyone already at home, I could not call anybody. But for moral support, I just sent home an SMS telling my situation. This is what I got for reply, “Wait! Ask the waiter to drop you. He will; he knows us dear. Act quick. Courage. Nothing will happen. God is there. I wish I were there (with you).” I read it several times. But how could I ask the waiter? What would I tell him, if he asked for the reason why I wanted him to accompany me? While all these thoughts stormed my mind, the waiter got the parcels and the bill. I paid and got up to leave.
Just then the power went off. There was no provision of generator for Dosa Plaza and other outlets in that building. I cursed myself. How would I get down the stairs in dark and that too in a Saree? I felt so vulnerable. Meanwhile the waiter asked me to wait and he fetched a torch and showed me the way out through the stairs, all the way till I got out of the building.
While we were walking down, I noticed the valet parking guy following us. He was using a matchstick for light. I felt relieved that I was not alone. When the reached the last step of the staircase, I thanked the waiter profusely.
This incident has increased my faith in God. Yes, there is surely someone up there taking care of all of us.
While I was waiting for my order, I was wondering how to get out of the building. I was sure that that guy would be still lurking around. With everyone already at home, I could not call anybody. But for moral support, I just sent home an SMS telling my situation. This is what I got for reply, “Wait! Ask the waiter to drop you. He will; he knows us dear. Act quick. Courage. Nothing will happen. God is there. I wish I were there (with you).” I read it several times. But how could I ask the waiter? What would I tell him, if he asked for the reason why I wanted him to accompany me? While all these thoughts stormed my mind, the waiter got the parcels and the bill. I paid and got up to leave.
Just then the power went off. There was no provision of generator for Dosa Plaza and other outlets in that building. I cursed myself. How would I get down the stairs in dark and that too in a Saree? I felt so vulnerable. Meanwhile the waiter asked me to wait and he fetched a torch and showed me the way out through the stairs, all the way till I got out of the building.
While we were walking down, I noticed the valet parking guy following us. He was using a matchstick for light. I felt relieved that I was not alone. When the reached the last step of the staircase, I thanked the waiter profusely.
This incident has increased my faith in God. Yes, there is surely someone up there taking care of all of us.
Subscribe to:
Posts (Atom)