Business Technology


Morty is a pet project i been working on here and there which spills out an amortization schedule for you, based on your loan attributes. I’ve been incubating it at Heroku since it is quite a fascinating concept and tool. Their online console is pretty geeky but easy to use and deploying rails apps is straightforward really. Anyhow…. Morty.

Say you considering a loan for (in any currency) $150000 at an annual interest rate of 12%, compounded monthly over 5 years (or 60 compounding periods). Immediately you get an idea of how much your repayments are going to be.

In this case, 3336.67 per month. The schedule part is the interesting bit; if you are indeed interested. First, you can see, at a glance, how your equity in the loan grows and how quickly (slowly) the loan capital is repaid over time.

As you can see, it’s only just after halfway that you start to owe less than you’ve repaid. You will notice slight curves due to the nature of amortization. Experiment with bigger loans and interest rates to see just how the curve is affected.

You can also see how much total interest you end up paying, versus how much of the interest you’ve paid off so far.

Here, the curves are slightly more pronounced. Of the ±50k interest you’re going to pay back in total, most of it is paid off quite early. Which makes sense. The more you owe in the beginning, the more interest you pay. So if you really want to make a difference on the interest on your loan, over time, make the biggest impact you can as early on as possible. You can see that towards the end of the loan, how flat the curve is. If you start making advanced payments at this stage, you’ll still save, but not nearly as much as you could have if you were even one or two months earlier with that payment…

The schedule…

Numbers number numbers. All it is is numbers. The numbers tell you that when you make your first payment of R3336.67, almost half of that payment is paying back the interest. R1500, in this case. So, in effect, you’ve only paid back R1836.67 of the capital (R150k) back after actually paying R3336.67. That starting to make sense now? Sucks, eh? So you make another payment, through enforced religiosity (ie. debit order). This time, you’re _only_ paying back R1481 interest. The balance pays off the capital. And so it goes until eventually you reach a stage where you’re paying off more capital than interest with each payment.

Now take a look at your home loan. An average value in current property markets might be something like R800k at 14% over 20 years (or 240 compounding periods). You’re paying back almost R10k every month but your first 42 payments don’t even dent the capital by more than R1000 at a time. Effectively, after 3.5 years, you’ve paid over R420k back, but still have R767k out of the original R800k owing.

Eish. That’s why credit is so expensive and not everybody can afford to jump into the property game.

Which also brings me to another point… a parting shot, if you like. Think _very_ carefully about the impact of renegotiating your outstanding debt. Imagine: 3.5 years later, and almost half a million out of pocket, you get a generous offer an opportunity to renegotiate your existing debt. In essence, you start all over again. Remember the curve! Another 3.5 years later, another R400k out of pocket, and you’ve only managed to claw back R35k, give or take. Sound like a smart move?

**NOTE: Different institutions structure fees into their loans, so the actual repayments may vary if you ask them for quotes and compare to this calculator. Query the fees. Always.


Deploying Rails

A while ago, i got addicted to RoR. Life before RoR was… well. Mundane. Don’t get me wrong. There was still a lot of exciting stuff going on, but RoR opened up a brave new world and it’s “differentness” added to its appeal. And since then, i’ve written a fair amount of Rails apps and a few libraries in Ruby for my own use. And then i tried to deploy a Rails app.

… ?:o

It was hard. And especially hard since i couldn’t eat, sleep and breathe the environment; so every opportunity i got to tackle the problem, i had to relearn the same commands. But i got used to it. I read _a lot_. And i managed to actually understand the conversations at one point. A major plus 🙂

In case you’re wondering what a *normal (or typical?) deployment might look like, take a peek here.

*Normal or typical probably doesn’t even exist, it’s just a phrase which suits my goals at the moment.

In any event, there’s some configuring going on. Examples are here, and here, and here. And there are more.

And despite the seeming “mission” related to deploying apps (and why a lot of folk just abandoned the platform altogether), i still believed it would get better. It just had to.

Hello, Phusion Passenger. Phenomenal! And suddenly, the roses are redder, the skies are bluer, the birds sing clearer and the apps deploy smoother. Waaaay smoother. Keep your eye on this one!

Oh. and here’s more about using Phusion Passenger in development.


J2ME Math

While developing a financial calculator on the J2ME platform (MIDP2.0, CLDC1.1) i had the need for some “basic” math functions like pow() and log(). As it is, there’s nothing quite like that natively available on the platform which on one hand surprised me; on the other, got me quite excited. I’d have to implement my own 🙂 Geek.

Now there’s a lot of discussion online and i’m not going to repeat all that here about the various math libraries and the reasons why the implementations aren’t available. What i will link to however, is a friendly, but relatively in-depth review of implementing your own pow() function. Incidentally, this article also implements an “inline” function for determining ln(x) in the dissection on using the Taylor series algorithm.

Wikipedia also have a pretty decent discussion on the fundamentals of logarithms which lead to more insight on the implementations discussed above.

So if you plan on doing math on J2ME, plan ahead. You will need to Google for some math libraries, or be prepared to roll your own. I prefer the roll-your-own method unless you need _all_ the features of library X. Keep it trim. And i get to apply some years of text-book learning 🙂

Big plus is you can unit-test it and luckily the laws of math don’t change too often so once you’ve written it, porting to other platforms/frameworks/languages in future is straightforward. Where as the entire library you might have linked to is only available on that one platform/language.


CodeIgniter Playground

After some tinkering with CodeIgniter, i’ve setup a small playground (which will hopefully grow over time) to test drive the framework.
I like the framework for it’s lightness- and you get quite a lot of control without having to rely on helpers to do _everything_. You can learn the helpers as you need to, so getting something up and running is easy enough and requires no massive investment in a proprietary methodology, terminology, apiology or documentology.

As for rhe RoR-ish slant. It is well… erm… RoR-ish. But really, nothing beats RoR. CodeIgniter is not bad. Rails still kicks!


A Dev Environment with Trac+Subversion

Setting up development environments is something you do once in a while- hopefully. And over time, you tweak different areas and add in bits and pieces here and there and it evolves. Nicely. And then you get to do it all over again 🙂 But then you got to go back a couple of months/years and look at it all over again. Thank goodness for tutorials!

Incidentally, another good reason to make the effort to document (read blog) that learning, or even just link that learning into your own blog. You never know when you gonna need it again…

Setting up Trac and Subversion on Ubuntu

This is probably about the most comprehensive and easy to follow guide i’ve come across so far. It has all the basic necessities to serve as both a refresher and get you up and running quickly. There is one small “typo” but you should spot it quickly if you’ve done this before. It refers to the root web folder for the trac setup.


All In One Month

What a month! 3 exams, a couple of teeth and a brand new baby boy. If you got kids, you’ll understand, right?

So if you ever end up having to plan something like this (not that you can always consciously time it so well) then i have a a tip for you…

Make sure you got a loving, enduring and patient wife backing you up and supporting you all the way. It makes it seem so easy. Thanks, Lolly! You simply rock! Your honorary degree is almost there 😉

Seriously. Jack was due just after the first exam, Macro Economics. So we figured it’d be alright ‘cos we’d have two weeks before starting to prep for the next two to settle in. Then Jack decided… “Neh. Too warm and cosy in here, thanks. Think i’ll stay a little while longer.”

8 days later (over due), little Jack says: “Hello, world!” That was one week before my last two exams: Financial Modeling and my major: Applied Mathematics. Oops = MC^2?

Needless to say, we -and i do mean “we”- decided to forge on and today, on my last exam, as soon as the invigilator said: “Pens down. Your time is up.” a chorus of angels hauled out the trumpets and started singing “Hallelujah!”. Shew!

Until next year…


Put It In the Bond?

If you’re servicing a mortgage at the moment, and you happen to come into some money, the “best” advice you’re probably going to get is: “put it in your bond”. Not bad advice, i guess, but i’m not so sure it’s the “best”.

**DISCLAIMER: I’m NOT a financial advisor; am not pretending to be one; and certainly not qualified to be one. But i can kinda do the numbers, so this looking at it purely from a mathematical perspective.

When it’s not really the “best” advice is when you are servicing other debt, at higher interest rates. Then the numbers say: kill that debt first, and _then_ look at the mortgage. So if you’re servicing a credit card, overdraft or vehicle finance (which can typically be higher than prime) and your mortgage is sub-prime, service the higher first.

But more personally, i recently faced the opportunity of trading in my vehicle for a newer one (which would have been nice) and i was figuring out what to do with the trade-in amount and work out where it would best pay dividends. On an aside, i’m of the opinion that buying a vehicle is NOT a financially smart move at all- no matter how you try slice the numbers. You will always lose (and i’m not referring to collectors’ classics). So look after your car- treat it nice, drive nice, service it regularly so you can leave it in your will. After all, it’s __just__ a car, right 😉

So down to the maths… Note: the numbers have been changed slightly to protect the prudent.
New car: R150k at 15.5% APR over 60 months.
Existing debt: R640k mortgage (±30 months into the schedule) at 14% APR over 20 years.
Trade in on car: R50k. What to do with the R50k? A) Plough it into the bond. B) Use 100% of it as a down payment on new car. A or B, what do you do? The “best” advice i received was plough into the bond and save thousands in interest on the bond! Uhuh. That’s half the truth.

As a down payment on the new car, I reduce the repayments from R3.6K to R2.4K, and end up saving, in effect, R44k in interest over the term. Not bad, not great.
In the bond, i reduce the interest _over the same term_ by R33K. Worse. But not a surprise. And that’s the important part here: the same term. 60 months. You see, over the remainder term of the mortgage, that advance payment will save you A LOT! But now you’re comparing a value of money of two different terms: 60 months versus N years on the mortgage, so don’t be too surprised if you draw bogus conclusions. Afterall, once you’ve finished paying off the car, you’re R3.6k deeper in the pocket which you can then plough into the mortgage anyway.

So, on face value, it’s more favourable, over the same term, to service the vehicle as quick as possible and then see to the lower interest obligations. But there are better options… which is the other half of the truth: discipline.

Add in some fiscal discipline into the mix, and suddenly your options are wild. For example…

Put down the down payment on the car, saving an extra R1.2k in repayments each month on the car, but then put the saving into the mortgage over the same term. Suddenly you start to save R64K in interest. Mmmm… Or…

And then there’s this. Which really was the best option (Thanks, A)…

Take your old car for a shmancy valet at about R200, pretend it’s new and “pay for it” anyway at R3.6k per month. Now you’re saving close to double your previous best!

The bottom line is; if you’re in the market for a car and can afford X, but you’re servicing other debt, service that debt first- forget about the car*. Unless it’s an absolutely necessity (and looking better than the Jones’ is not a necessity- i checked) you probably don’t need it.

*Forgetting about the car, probably anywhere in the world, is really hard to do though. In South Africa, households spend a disproportionate amount of their disposable income on vehicle financing, which says a lot about how we feel about our cars. Somehow, cars have so (too) much appeal. So much so that having 4 reliable wheels is just never enough. There’s always going to be something really “cool” about a car that makes you just wanna have it. And the price tag is just irritating. Can you say X-Trail… or Fortuner? 🙂