Tuesday, May 29, 2012

Even more fun: get me closing price for a sticker

If you enter a valid sticker NASDAQ code, program will print closing price.

Solution 

Because NASDAQ page is real clear XHTML, it begs for parsing by ElementTree. I'll do that next.

Sunday, May 27, 2012

What is current temperature in Honolulu?

It is obviously VERY important problem, so we need to write a program to solve it.

It's an example of reading a HTML page, parsing it, finding bit of salient info and printing it.
Obviously, for every target website you need to create customized parsing rules. We will use FindLocalWeather.com website.

Solution

Monday, May 21, 2012

Version 2, and docs

Version 2: Config may run multiple games, so file with rooms does not have to be renamed to change game. I also added simple (but non-trivial) game, "Escape from Pirate's Island" :-)

... and some documentation

Sunday, May 20, 2012

Adventure Game v 0.1

Simplest version - it has only two files (game.py and config.py), and data.py file with "rooms" to be visited.

Bad news it that blogger mangles whitespace. I need to either figure it out, or find another way to publish sources.

Problem solved: Use different, better platform! Source was posted at my new wiki: http://learnpython.wikidot.com/ (including syntax highlighting, no less!)

BTW wikidot.com is currently my favorite wikifarm - you can also get your own wiki for free.

Tomorrow: add more rooms to get more interesting game.

Sunday, April 29, 2012

I know what I am going to blog about: Python!

I will write about implementing my old idea:
Text adventure game.
It will be a good match for my another website LearnPython wiki . - Python learners can see how project grows. I may even implement it as Django app, and even as AJAX app. We will see how far I will go.

And why Python? XKCD has the answer:

Wednesday, February 10, 2010

Yale Public Events Calendar

I created a Google Calendar with public events at Yale

Sunday, December 13, 2009

Expert opinion: Mortgage

In one of my previous jobs I worked for a mortgage servicer (a bank which handles mortgage payments) and learned a couple tricks which can save you a bit on mortgage.

First asides:

Simple Wikipedia has simple explanation what a mortgage is (a way to use one's real property, like land or a house, as a guarantee for a loan to get money to buy that same property), but for more background you need to go to the Big Wikipedia: It has all the background info you may ever need. Including origins of the name and translation to other languages - it means Hypotéka (in Slovak) - Hypoteční úvěr (in Czech), and Ипотека (in Russian - which also mentions that concept was invented in Classic Greece in 4th century BCE, way before Romans, as English wikipedia claims).

For those of you who cannot read Russian, article says that ipotheke (ὑποθήκη) was the name for the pole which marked a land as security for repayment of debt to the lender (so borrower cannot use it as security for someone else).

For Russians it's easier to read Greek alphabet because many letters are similar in both languages. And vice versa, for people who can read Russian, Greek is easier (to read, not to understand).

And yes, "Mort" in mortgage means death. My colleagues in the bank bamboozled (=said not a truth) me that it is so because mortgage was used to be paid until death. But "origins of the term" in English Wikipedia suggest it is just a myth. And it makes sense, mortgages were originally for 10-20 years, no bank was ready to take chances on money for 30 years like they do now - and at the crest (=top of the wave) of the housing boom in Silicon Valley some people signed 40 year mortgages to afford monthly payments. Insane world!

Mortgage business is so profitable that Wikipedia entry for it appears way down on Google search page - try any other common term and Wikipedia is always in top 10. Not for mortgages!

-------

Back to regular programming...

My advice for people contemplating mortgage would be:

1) Get educated

It is one of the biggest financial decisions of your life, and might be very expensive mistake to make.

Process is complicated, different participants use terminology which might be confusing (and maybe intentionally) but it is in your own best interests to understand exactly what the terminology is, and what it means.

Talk to the bank you have saving account/credit card very soon. Because they see your payment history, they know your credit well. In many cases, bank has classes for future homeowners about the process of buying house - and if your bank does not have it, get account in a bank which does. My "classes" were 4 evenings for 2-3 hours. I found it very useful, and my real estate agent was happier too. At least, read the "for dummies" book about the process of buying the house.

Those classes will also explain you what are the roles of different people in the sale - i.e. why you should not agree to use the real estate agent who is selling the house to be also your agent - because he is working for the seller, there is conflict of interest, and not in your favor.

Those classes or that book will tell you basics:
- Start by finding good agent (who will get paid 3% of the price of the house)
- get your finances in order, clean any mistakes on your credit report
- buy exactly the house you need (there is difference between want and need).
- understand exactly what your monthly payment covers: escrow for property taxes (bank pays it in your behalf when due), interest, and principal. Principal payment is the amount you pay to own the property, rest is just fees (that's why bank does not want to disclose what is what unless you ask).

2) How to afford downpayment

That's one advice which was important for me and nowhere to find (except "save more" non-advice).

Downpayment is usually 20% of the property price (to protect bank: if you stop paying, they can sell it for 80% of the price, get back what you owe, and you lost all downpayment), which is more than average first-time buyer has. So bank forces you to have mortgage insurance (where bank uses your money to buy insurance from another bank that if you stop paying, they will get some money back). But mortgage insurance, usually $50-80 a month, is money which do not count against principal (do not decrease the principal amount you owe to the bank).

You are much better off to have second lien (from the same bank) even with higher interest rate for the 10-15% of the property price (and put down 5-10% of your own money as downpayment). You can deduct the interest (but not the mortgage insurance) from taxes, and you can pay second lien separately and faster then main loan, as you have money available. With mortgage insurance, it may take 15 years to own 20% of the property and be able to drop paying insurance, because so little of your monthly payment is applied to the principal.

Why it is called "second lien"? Because if something goes wrong, "second lien" holder stays second to receive any value. Say, if home is foreclosed after you stopped paying mortgage, and sold for 85% of the loan value, mortgage bank who is first lien holder (80%) receives 100% of what he is owed, but second lien holder receives only remaining 5% of the value. Risk of default (not paying) is higher, so you pay higher interest on second lien loan, but you can pay it down faster and separately than much bigger main loan.

Second lien could be converted to home equity loan - so when you pay it down, you can still keep it open and use it as your emergency reserve - you can draw it as needed, without asking bank for anything. It may cost $50/year to keep it open with no balance on it.

Another important trick is to make sure your loan has no prepayment penalty - so if you want refinance or pay it sooner, you don't pay the penalty.

3) Extra principal payments might be the best return on your money, ever. Why?

Check the principal portion of your monthly payments: If from your $1000 monthly payment principal is $100 a month, every $100 extra principal you pay shortens the life of the mortgage by one month (saving you $1000). This extra principal payments are most beneficial during first years (when the interest part of the payment is bigger, and principal is smaller). It really can make a big difference to skip expensive vacation during couple of first years and just pay down the principal.

So, very strongly consider making extra payments, even couple hundreds of dollars makes big difference, and save you thousands.

Of course it makes sense only if you plan to stay in home for quite a long time, possibly until you pay it off. If you plan to move, having more liquidity (cash) might be better than more equity, and extra payments do not make sense.

4) Biweekly payments can save you money

Another trick, if your salary is paid weekly or biweekly is to make two half-payments a month instead of single monthly payment. Because you are charged for interest for every day you owe the money, owing half the amount for half the month can be worth hundred dollars a year, and definitely many times more than you earn on saving on that amount, even if you are disciplined enough to move it to saving account and back.

Of course IANAL, this is not a legal advice, all standard exclusions apply, get advice from a real estate professional. This is given as-is, best effort, might not apply to your situation, but is just an attempt to give you insight what questions to learn about and research deeper.

--
Peter Masiar
Database/web programmer and problem solver
http://www.linkedin.com/in/petermasiar