Tuesday, April 29, 2008

Impressed with Jawbone headset and its customer service support

A week or two ago, I purchased the Jawbone bluetooth headset which has got a lot of reviews as the best bluetooth headset in the market. I should say I am pretty impressed. The noise canceling feature is just awesome, people on the other side rarely hear any other noises other than my voice. After trying the multiple ear pieces and loops and fixed on a set. I haven't used a bluetooth headset before so I can't really compare. My long calls started turning effortless and I was pretty happy with the piece. Worth every penny, oh yeah..

And then the inevitable according to Murphy's law had happened. I broke the left standard ear loop. I was trying to remove it when it broke. I called up the Jawbone support guy. They wouldn't give their number on the website but a quick Google search revealed their support phone number 408-848-4348. The customer service guy was cool and he told me that he will send me a complimentary one in 7 business days. Now, how cool is that. I didn't know you could also buy the ear loops from their website, you pay $10 for the ear loops but then you will need to order the 4 piece set. I should say that I am pretty impressed both with the piece and the customer service. All the negative reviews on the web, I guess those guys were probably having a bad day :)

Monday, April 28, 2008

Too smart or too novice in Java: Relevance of for loops

During the course of my work, I have had to fix some code written by others and modify existing code for enhanced functionality. In one of such projects, I encountered this piece of code written by someone


for(boolean valid = false; !valid; valid = true)
{
try
{
sp = spf.newSAXParser();
parser = new ProjectParser();
sp.parse(projectFile, parser);
}
catch(Exception e)
{
e.printStackTrace();
log.throwable(e);
throw new RuntimeException((new StringBuilder("Unable to parse ")).append(projectFile.getAbsoluteFile()).toString());
}
}


Let's see how this for loop works. It initializes a boolean called valid with a value false. The condition is until valid is false. The increment is making valid true. And then inside the loop, the coder wants to accomplish something. Now what is the point of this for loop at all. Was the for loop used because the coder didn't know that loops are used for, you guessed right, looping. If he/she just wanted it to run only once, then what is the point of using a for loop at all. How different is the below code from the above code.


try
{
sp = spf.newSAXParser();
parser = new ProjectParser();
sp.parse(projectFile, parser);
}
catch(Exception e)
{
e.printStackTrace();
log.throwable(e);
throw new RuntimeException((new StringBuilder("Unable to parse ")).append(projectFile.getAbsoluteFile()).toString());
}


This would execute the code only once and that is the desired behavior that was accomplished by using the for loop for once. I think keeping your code clean and staying away from such unnecessary stuff helps you in keeping your code clean and reducing any unwanted bugs. Why turn the hand around the neck to eat something when you could directly eat it.. Is this trying to be too smart or being too much of a novice to know what loops are used for. Or is there something, that I am missing that is something great that I haven't realized in using this type of code. If someone could elaborate, I would be glad...

Friday, March 14, 2008

Pay auto/car Loan or Invest in a CD or other investment. When do you break even

The previous post of mine on auto loan had lots of discussion and ifs and buts. I decided to make it pretty simple this time. Here is the case. You have $10000 with you today, that you can use to pay off a car loan of equivalent amount which is at a interest rate of 5.5% or you can pay the monthly installment on the car loan and invest the current $1000 you have in a CD or shares..

Analysis
--------

Current car loan = $10000
Interest rate = 5.5%
Term = 2 years or 24 months

From Bank Rate Calculator the equal monthly installment is $440.96

Let us say Best CD rate available is 5% (which is impossible at this time). So the case under study is that you have $10000 in hand today and you have $440.96 from your monthly income available to you to pay the car loan

Pay the car loan
----------------

In this case you paid off the car loan and you put the $440.96 in a Savings account like ING Direct. Let us say in an ideal scenario you are making 4% on your savings account (ING doesn't offer this interest at this time). So putting $440.96 in a Savings account for 2 years, at the end of 2 years, (from dinkytown)

Total = $11,505
Taxes = 28% of (11505-10000) = $421.4
After taxes total savings = $1083.6
After paying taxes, money you have with you = $11083.60

Put in a CD
------------

From Bankrate $10000 at 5% for two years will yield a total of $11,052.

Total = $11,052
Taxes = 28% of (11,052-10000) = $294.56
After taxes, net with you = $757.44
After paying taxes, money you have = $10,757.44

Paying the car versus CD
------------------------

Difference you lose by not paying the car loan and investing in a CD = $11083.6-$10757.44 = $326.16

Incentives for not paying the car loan is the fact that you are only liable to $441 a month, if you lose the job or if you are on bench in consulting, then you have $10000 with you and you are only liable to $441 a month. So, that makes it easier for your mental peace

If you do not put in a CD and invest in shares or something, then what percent interest rate on your $10000 investment justifies your not paying off the car loan? lets calculate that. This means that your $10000 has to become $11,505 in 2 years. Using the formula for compound interest, that would be 7.26% assuming interest compounded annually. That is a very low interest rate compared to gains on Shares. But then, you never know about Shares. You might as well lose your money.

So, that's the calculation folks. Know your facts, analyze your situation and make a good decision :)

Wednesday, March 12, 2008

Overcoming cross domain issues through php proxy server in Flex for RSS Reader samples

Today, I took a second look at my home page and decided that the blog link should not directly point to this page and should have an in-built RSS Reader for getting these posts there. And then the troubles started. People who know me already know my website and know that it was built in Flex. I had this idea of an in-built RSS Reader in my home page for long, but whenever I started working on it, I would have weird exceptions on page load, which were not straight forward and I wouldn't have time to debug them. So it remained the same, a hyperlink to this blog. Today a post on DZone caught my attention and I again tried this. I found a simple example which I implemented in my home page and thankfully everything went cool. But when I put it on the server, another problem started. The cross-domain problem..

The thing about flex is that, while being cool and xml dominated, the biggest problem is with the fact that you cannot load the rss or xml from other websites, without a cross-domain.xml file on the serving domain that lists the calling domain. Now I cannot ask blogger.com to put my domain name in their cross-domain.xml file. Can I ?? So I preferred the alternative route, which is widely written on the net, the proxy server route. And though I do not have Java hosting by my space provider, they support php and went for a simple php script..

<?php
header('Content-Type: text/xml');
$url = 'http://cognitivecache.blogspot.com/rss.xml';
$content = file_get_contents($url);
echo $content;
?>

The script looks so simple like a no-brainer right. Nope, that wouldn't still solve my problem. Because, the blogger wouldn't let the php script open a stream and I kept ending up with this error

Warning: readfile [function.readfile]: failed to open stream: No route to host..

After changing the scripts from the net thrice hoping the other one would be different, I kept coming back to the same problem. Finally I realized that it could be an issue with Blogger not allowing an incoming connection. Boom, that was it. I changed the code to point to my feed in FeedBurner and that was it. My new code looks like this

<?php
header('Content-Type: text/xml');
$url = 'http://feeds.feedburner.com/CognitiveCache';
$content = file_get_contents($url);
echo $content;
?>

Now, The RSS Reader gets its content now and it looks like a nice addition. A Happy ending to lot of time spent indeed !!

If you are still wondering about the whole process, what you need to do, is to burn a feed in FeedBurner and put the above code in a file called proxy.php. Now upload this file to your domain and use the url for xml in your flash file as "http://mydomain.com/proxy.php" and thats it..

Saturday, January 5, 2008

Taare Zameen Par - Because every kid is special...

I haven't done my homework and prepared for the exam well. I was hoping and praying that the exam would get canceled, I was praying to God again and again that something should happen, a flood or earthquake should come so that the exam gets canceled, and I don't fail. Because failing the exam is a doom, that would set a downward spiral on, which would leave me with no future. I won't have a place to live or food to eat in future. What could I do now. The thoughts of "if only" run through my mind as I promise myself, if somehow I pass this exam by God's grace, I will always prepare well for every exam in m life.


Source: Movie Home

And boom, I suddenly wake up in the middle of the night realizing it was just a dream, realizing that I have finished my Masters and am in a stable job making a decent salary and set for a decent career. But why do I still get these dreams. My parents never compelled me for anything. Still there was fear of exams, fear of failing, fear of going nowhere in life, that has captured my thought process so vehemently that even at about one-third of my lifetime, I still get such dreams. Is it a psychological disorder. Of course not, it is the psychological set up of almost every Indian student who has gone through the rigors of Indian system of education, the stress of what the society would say if you fail. Is the fault with the Indian system of education. Nope. the fault is with the societal mind set in India or at least in Andhra Pradesh, where you have to be an Engineer or a Doctor in your life. Other career options don't even exist..

The thought process above was triggered in me, after watching the movie Taare Zameen Par. A wonderful movie that takes us through the journey of a kid who suffers from Dyslexia. Trying to camouflage his inability to read and write like other kids in a cover of stubbornness and frustration, Ishaan slowly loses interest in one thing he is the best at, painting. As Aamir points out, his parents and teachers were seeing the symptoms of the problem, but none try to understand the reason for his problem. It is not that he does not want to read and write, its just that he cannot. Having suffered through the trama himself in his childhood, Aamir sets out to help the kid. With the kids' Dad not understanding the situation, he gets the help of the Principal to get the kid to normality by giving him ample time to learn things his way in his own pace. And guess what, he brings progress in the kid by projecting his positive points and building up his confidence.

A really wonderful movie with superb action from the kid who portrayed the role of Ishaan. Aamir Khan performs well enough, but the best part in the movie is his direction. His sincere attempt at a heart touching story strikes an emotional cord or two by making you fell for the boy, because you have been there! Overall cent percent to Aamir Khan for a honest attempt at a genuine subject, instead of song and dance routine.. Do yourself and your kids or your future kids a big favor. Watch Taare Zameen Par, because it teaches you how to be a real parent. Because it lets you see a child's mindset from his point of view. Perhaps your kid might really benefit from your changed outlook. Perhaps India will see light in careers other than Engineering and Medicine !!

Tuesday, December 18, 2007

Tum Chalo to Hindusta Chale - TOI Lead India "Tree" (India will be what we are..)

No words necessary to describe. The video speaks for itself!!

Monday, December 10, 2007

Genuine attempts lead to Fame, over course of time too

My previous roommate started this site called Sanskritvoice.com a little while ago. We used to discuss about websites, making money from them, or business models. It was then, I asked him, what he was doing this site for, money or fame. And he replied that it was a passion that he had for the Sanskrit language and was trying to do, what he could. He wasn't doing it for money or fame. Recently he got profiled in NDTV. This only goes out to prove that, you should concentrate on what you are passionate about, money or fame will slowly follow your passion, perhaps a little later, though I doubt if money will follow in this case. Check out the video where he got profiled..

Wednesday, October 31, 2007

What happened to the $1. Can you explain? - A simple math brain teaser that leaves you thinking..

So you think you are good at Math and at simple calculations. Here we go. Try and solve this..

Three guys came to a motel and asked for a room with 3 beds. The manager said that the room rent was $30. They said they will check the room and pay for it. So the boy took them to the room, they liked it and each paid with a $10 note and the net amount came to $30. The boy went back to the manager and gave him $30. Then the manager realized that they had discounts at that time and that the room rent was actually $25 for the day. Since he was honest, he gave $5 (5 1 dollar notes) to the boy and asked him to return that money to those guys in the room. While going to the room, the boy thought that they cannot share the amount of $5 equally and since they didn't pay him the tip last time, he thought that he will take $2 and give them back $3 so that each gets $1 back. He silently slipped $2 into his pocket and went to their room and gave each guy $1. Everyone was happy.

But here is the question about it.. Initially the three visitor guys gave $30. Each paid $10 and got $1 back. This means each paid $9 and so the total they paid is $27. $2 were stolen by the hotel boy. We have the count for $27 + $2 = $29. What happened to the remaining $1 ???

How much do you understand your auto loan - Can you find the fault in this calculation?

A small discussion with my room mate brought up the subject of auto loan that I have on my car and why I should / should not pay it off. I have some savings in my savings account and I have an auto loan on my car. If I open a CD (Certificate of Deposit) with Indymac bank they will give me an APR of 5.5% and my car loan is financed by a Credit Union at 5.5%. The argument that my roomie was making was that I should pay off the car loan instead of opening a CD. His reasoning was that, though the car loan and the APR on the CD were the same, I am actually losing money, because on the interest that I earn on the CD, I have to pay a tax. And since I am single and fall in the higher tax bracket, I will end up paying 25%(+) on the interest earned. Which means that I will actually be making around 75% of the 5.5% which is around 4.13% which means that I am losing around 1.37% (5.5-4.13) on the whole amount that I am planning to open a CD with. In a way, it made sense for a brief moment.

But then, further investigation showed that it is not a valid argument to me. Here was my case that I presented. Let us say you have $10000 with you, and you have two choices, put it in a CD for two years at the rate of 5.5%, or pay off your loan which is 5.5% and ends in 2 years. If you don't pay off the loan now, you keep paying it in monthly amounts of $440.96 (Calculation from Bankrate calculator) with your salary. If you put it in CD for 2 years, you make a simple interest of $1130.25 (550+550). Let us say, you pay 28% tax on it. So your net interest earned from that amount after paying taxes off is 72% of 1130.25 which is $813.28 and the total interest you pay on the car loan for these 2 years is $582.96 (Calculation from Bankrate calculator). So I argued that I actually am making $230.32 (813.28-582.96) extra by not paying off the car loan.

Sounds logical right, but the above calculation is wrong because it was one-sided. The reason is, if I pay off the car loan with the $10000, then I don't need to pay them the $441 that I was paying every month, which means that I can put it in a savings account like ING Direct for an APY of 4.3% or an APR of 4.21%. This means that the total amount I make in two years with this monthly savings would be $11541 (Calculation from dinkytown). This means I make an interest of $1541 in two years. After cutting the tax at the rate of 28%, I will be left with around 72% of 1541 which is $1109.52. This means the total I save is this 1109.52 plus the interest I would have paid for the car loan which is 582.96. So the net total I would have saved is $1692.48 So by not paying off the loan today, I am actually losing is $879.20. So the conclusion of the whole calculations is it is better to pay off the car loan, if you have the cash instead of saving in your bank account and having the loan aside and paying monthly payments.

Agreed this calculation has some flaws because of some assumptions. It assumes that the rate from ING Direct will be 4.21%, but since it is variable it can go up or come down. Also, we are assuming that you will have continuous money from your salary, and that you will actually put aside the car loan amount payment in a Savings account instead of spending it on the next cool thing like the Iphone :) It also assumes that you would pay the money off instead of having it in your savings account, which you can withdraw in case of an emergency. You obviously can't get a car loan again on your car in case of an emergency right :) It also assumes you have 10k or the total amount of your car loan with you in your savings. But anyways, under the given set of assumptions, it makes sense to actually pay off the car loan rather than put the amount in the CD or Savings account. One more thing, you can consider is taking the amount from a special offer like 0% APR (be careful with the Balance Transfer fee in the fine print) on Balance Transfer from a credit card company like Citi and paying off the loan, provided you have a good credit history. That way, you don't pay the interest to the auto loan provider and you can pay off monthly amounts to the credit card company. And when the balance transfer offer ends after one year, take another card and transfer the balance to that. All this provided you actually have time to do some research on these and wish to save some dollars :)

Feel free to challenge the above calculations or present counter arguments :)

PS: There is a big fundamental mistake in the above calculation, and the net amount you actually save is $272.19 and not $879.20 as mentioned above. Can you prove this?

Tuesday, October 23, 2007

What do you work for? Money, Fame or a Happy Relaxed retirement??

A lunch time discussion yesterday got me thinking about what do I actually work for.. At lunch, my team lead told us about his friend's Mom who expired at 60. And he was like, I would be pretty disappointed with myself if I die at 60. His reasoning was simple. One works till about 60 years thinking that he/she will retire at 60, and then with all the money saved, he can just relax, buy a great car, and relax and do nothing on that private yacht just sitting down on a chair in the yacht on a sunny day relaxing. But let's say, you work hard and toil till 60 thinking of that day, that you would have enough money to just sit and relax, and guess what, you just die at 60. Then what's all this hard work worth?



You may say, I am doing this for my children. But the point is, you will be tuning the minds of your children, the same way your parents did to yours, as to how important it is to be in top 10 percent in the class, as to how it is important to be educated well enough to lead happy and secure life. And you know what, they will toil just like you do, and the vicious cycle always keeps continuing. No, I am not telling you Rich Dad-Poor Dad story to forget saving to your 401 (k) and paying your bills like the Poor dad and start investing like Rich Dad. Either ways, you are toiling towards something, which you are never gonna enjoy actually. You earn when you should be enjoying, and by the time you have enough money, you do not have age to enjoy your life. The long term benefits are indeed way too long to achieve.

So, does that mean that you should stop studying, or working and then start enjoying your life doing nothing. That is not what I am hinting at. You need to understand and plan, when you need to relax, may be take a year off in thirties and start fresh again, and again take a year off in your forties and relax probably. Yes, you might not get those lucrative pay hikes, and those well deserved promotions in your organization, but come to think of it, it is probably well worth it. If you can't give yourself 1 year out of ten years of your life, then who and what are you living for.. If at all, you live to see your golder seventies and glorious eighties, you will still not regret your taking off those years because you dared to enjoy you life when you had the zeal and the age to enjoy.. Think about it, it might be something that you could put in your achievements to cherish at a later age. May be this might not be the best solution, but it is one of the feasible solutions to balance your craving for a relaxed life and your hectic work schedules..