Friday, July 23, 2010

An Intelligent Game

Every now and again as a programmer you come across some bit of code that excites you. In this case it's a simple 20 questions game. Now, I'm sure the code is fairly simple. People are characterized with qualities and it asks questions to optimally limit the remaining possibilities. But I tried playing the game about 10 times and it was dead on each time, even when trying to think of people it would likely fail on. I thought it was impressive to have such an extensive list of people that it's been trained for. And every time it's asked something it becomes smarter and better able to determine your person.

Try it out at http://us.akinator.com/

Tuesday, July 13, 2010

Droid

Next up on the list of projects is a Droid App. I'll throw something very simple together first, maybe something similar to the black jack I made a few posts ago. After a starter App I'll try and make something more complex. I hate Eclipse, but it seems I'll be using it once again for these google droid apps. If nothing else, it will keep me learning new things which is very important as a programmer. Over the course of my career I'm sure i'll need to re-learn everything I do in order to stay competative and challenged.

Saturday, July 10, 2010

Retirement Calculator


So how soon will you be able to retire? This little post calculates and graphs the amount of money you'll be able to save towards retirement. This gadget maps out the growth of your wealth based on monthly contributions from your salary, which increases every year with raises.



For example, Average Joe makes 50,000 a year. He expects an average yearly raise of 10% for the next 30 years. He currently has 5000 in saving, 6500 in his 401K and 6500 in a taxable stock account.

Each pay check he pays 8% into a 401k retirment which yeilds an average of 7.5% annually. He pays 2% into savings at 3.5% interest, and 5% into a taxable stock fund that yields roughly 11%.



I assert that in order to retire at a very young age, you'll have to have enough retirement money to earn as much as you withdraw from it. That can be calculated with the formulate: amount_required = desired_salary / (interest - inflation). In order to retire now with a before tax income of $30,000 you'll need to have $1,200,000 saved.

The Red graph represents the amount required to retire. It adjusts with inflation each year. The green represents what you've saved up to that ponit.



Of Coures, if you're only planning on needing that money for a period of time, and not replenish your money as quickly as you're taking from it, then you won't need quite so much. I made this to try and see what it would take to retire by the age of 35, and thus didn't want a time period. I'll probably add a period of time to the retirment section down the road.



Basic Salary Information:
Salary with Bonuses:
Yearly Raise %:%


Initial Money Saved:
Initial Savings:
Initial 401K:
Initial Taxable Stocks:


Investment Contributions:
Savings Account:%
Savings Rate:%
401K:%
401K Rate:%
Taxable Stock:%
Taxable Stock Rate:%
Years:


Retirement Info
Desired yearly retirement salary:
Expected interest rate on all retirement funds:%
Expected inflation rate:%
Amount Required to sustain salary:




Tuesday, July 6, 2010

Google Wave, Part 2

Roughly 2 months after first looking at the Google wave API, I finished my first Google wave gadget.  I included it in the wave embedded in the original post: check it out here.

It's a simple app that graphs numbers as they're entered, intended to track weight.  I discovered that the wave API has a couple tricky bits to it.  Using a variable as a key when storing or getting a value does not work, while using a string literal does.  For example:

 wave.getState().get('count');  
works perfectly, but:

 var mapId='count';
 wave.getState().get(mapId); 
will not work at all.

Hopefully I have some more time going forward to play around with the wave API.

Saturday, July 3, 2010

Gaming and Programming

I've had a lot of fun playing a game that seems to teach the basics of programming. It illustrates functions, recursion, conditional statements, and all in a thought provoking and challenging manner. The recursion and expert levels were a blast. So if you're interested in programming, or a guru wanting a quick critical thinking challenge, check out: http://www.kongregate.com/games/Coolio_Niato/lighbot-2-0.

A professor from mine at college, probably inspired by the amount of World of Warcraft I played at the time, was frequently looking into the possibilities of teaching via games. I think making learning fun and teaching critical thinking skills through video games will be the wave of the future.

How about you? Did you find the game enjoyable and challenging?