Online Savings Accounts

Online savings accounts are similar to online checking accounts but they require that you have an existing checking account to link it to. This allows you to electronically transfer money between your existing checking accounts and online savings account without needing to visit a branch or ATM. Interest rates fluctuate over time, so if you have multiple online savings accounts, you can easily and instantly move your money to whichever bank account has the highest interest rate (as I do).

Schwab Savings (link)

  • 1.05% APY (as of 01/30/2010)
  • Can use ATM card to withdraw money
  • Same benefits as Schwab Checking

ING Savings (link)

  • 1.25% APY (as of 01/30/2010)
  • No fees or minimum balances
  • Can link to existing checking account from any bank
  • Does not work with mint.com
  • No ATM card (the only way to get money out of the savings account is to transfer it to a linked checking account)

ING currently has a higher APY than Schwab and is easier to link ING to an external account than it is to link a Schwab savings account to an external account.

Amex High Yield Savings (link)

  • 1.50% APY (as of 01/30/2010)
  • No fees or minimum balances
  • Can link to existing checking account from any bank
  • Works with mint.com (you need to input your username and password everytime you want it to update, but my balance only changes when I deposit or when I earn interest once a month)
  • No ATM card (the only way to get money out of the savings account is to transfer it to a linked checking account)

Verdict

The Amex beats the competition with its high interest rate and compatibility with mint.com. To be honest I have all three but I only keep my money in the one with the highest interest rate. I started with ING and then opened my Schwab savings when I opened my Schwab checking (because at the time Schwab had 2.0% interest on their savings!). After ING and Schwab interest rates fell to their current level, Amex started offering savings accounts at 1.7% (now 1.5%) so I decided to try that out. It is stupid easy to move money between accounts so there is really no reason to close the accounts I am no longer using and they may have higher interest rates in the future.

Time is Money

Learning about Go got me thinking about concurrency and synchronization in general, and I came up with a neat analogy.

Money : Trade :: Time : Synchronization

Money enables efficient trade. If I am a software developer who wants to buy a loaf of bread and money doesn’t exist, then I need to find a baker who needs my services to be able to barter for shoes! I would probably starve. Money provides an abstract way to represent the value I create by working. I can then exchange this abstract value with someone else to receive something that has real value to me. Without money, trade is very inefficient.

What does time do? Standard time enables efficient synchronization. If I want to watch a movie with a friend, then we want to meet each other at the movie theater before the movie starts. Without standard time I would have to say something imprecise like “meet me for the third showing of the movie after midday” instead of “meet me at 4:00 pm”. Time provides an abstract way for me to synchronize my actions with other people. Without standard time, synchronization is very inefficient!

The actual units of time and money are irrelevant. This is easily evidenced by the many currencies that exist in the work. Luckily time is more standard, but one could easily imagine a new time system where we divide a day into 100,000 “pulses” instead of 86,400 seconds. Running with this metric inspired example we could have 100 “pulses” as a “period” for 1000 periods in a day (compare to 1440 minutes in a day). Then you could tell your friend to meet you at “500.00 period” for lunch (pretty cool, huh?).

My point is that a $5 bill, 2 euros, 4:00 pm, and 500 “pulses” are merely concrete containers for abstract ideas.

How does Etherpad work?

Etherpad is (but not for long) an awesome tool that lets you do real time collaborative editing for free without creating an account. My favorite use case for Etherpad is for conducting phone screen interviews because it allows me to copy and paste pre-written questions for the candidate to read, and also enables me to ask coding questions to software engineers.

It came as an unpleasant surprise on Friday (2009-12-05) when a friend discovered that Etherpad disabled new pad creation because they had been bought by Google to work on Google Wave. This sparked a multi-hour discussion with some fellow engineers about how we might implement Etherpad since we had been unable to find any suitable alternatives that matched our requirements (free, no sign up, real time editing). Our discussion ultimately converged to a solution that we later found out was very similar the Google Wave implementation. Fortunately, Etherpad came back online the next day so I decided to investigate how Etherpad had solved this very interesting problem.

To keep everything in sync, the Etherpad server holds the authoritative copy of the document. When an Etherpad client updates the document, it sends a changeset to the server. The client does not receive any information back when it posts a changeset, nor does it poll the server for updates, so it appears that the client must initiate some sort of semi-persistent connection to the server on page load that allows the server to stream updates to the client.

While a client is updating the document it sends changesets to the server every N milliseconds until there are no more changesets to send. In practice this means most changesets are only a few characters depending on how fast you type. The changesets that the client is sending are quite cryptic but I was inspired to do some reverse engineering.

Actions:

  1. Type “hellodude” on line 2.
  2. Highlight “hellodude” and PASTE “bye” (I had copied “bye” to my clipboard outside of Etherpad)
  3. Highlight “bye” and delete it with one keystroke

Changesets that Etherpad generated:

  1. "changeset":"Z:2>9|1=1*0+9$hellodude"
  2. "changeset":"Z:c<6|1=1-8*0+2$by"
  3. "changeset":"Z:6<3|1=1-3$

Analysis:

  • “Z:2″, “Z:c” and “Z:6″ are the length of the current document in base 36 (1,2,…,8,9,a,b,…,y,z,10,11,…,18,19,1a,1b,…) BEFORE the change occurred. The “length” is the number of distinct positions where your cursor can exist.
  • “>9″ means the net effect of the changeset was to add 9 characters. “<6″ means the net effect of the changeset was to delete 6 characters (deleted 8 characters and added 2 characters).
  • “|1″ is the line number that the changeset applies to (this parameter is omitted for the first line which has index 0)
  • “=1″ is the starting position of the cursor for the changeset (index starting at 1 for each line)
  • “-8*” are the absolute number of characters that were deleted (omitted if no characters were deleted)
  • “*0″ is either present or not present in everything that I have tried so I can’t figure out it is is more than just a delimiter.
  • “+9$”, “+2$” and “-3$” are the absolute number of characters that were added
  • “$hellodude” and “$hi” are the characters that were added. If characters were deleted and no characters were added then this is empty (which means the client is requesting to delete the character at a specific position, regardless of its value)

I assume the server is streaming back similar changesets to the client but I don’t know for sure since the persistent connection isn’t visible in Firebug and I am not interested in busting out Wireshark. This isn’t a complete picture (it gets a little bit more complicated for multiline changesets, and I don’t care about text formatting) but I am satisfied that I was able to figure out the basics.

Online Checking Accounts

For years I had a “free” checking account from Chase and life was simple. When I moved out to California, I needed a new bank because Chase was not in California (at least not yet; they later bought WaMu) so I opened another “free” checking account at Bank of America along with a savings account.

A few months later I was talking with a friend who traveled a lot and mentioned that he had a Schwab checking account and told me about some of the benefits. Curious, I looked up more information and learned about a whole new class of banks that were completely electronic (ING Direct, Schwab, Amex). Their advantages and disadvantages are one and the same: no physical branches. Online banks do not offer any services that can not be offered online or by phone. As a result, they can pay impressive interest rates on checking accounts and even higher interest rates for savings accounts! If you have a traditional checking or savings account I highly recommend researching electronic banks to see if you can benefit by opening an account. Here are two online checking accounts that I looked at:

Schwab Checking (link)

  • 0.75% APY (as of 11/30/2009)
  • No fees or minimum balances
  • No ATM fees. Schwab Bank will reimburse you for any fees charged by other banks.
  • FDIC Insured
  • Free checks and address labels whenever you want
  • Works with mint.com

I have had a great experience with Schwab overall. The customer service representatives that you can call are in the US (gasp) and are very knowledgeable. Did I mention that this is a checking account that earns more interest then either of my BoA or Chase savings accounts?

ING Checking (link)

  • Tiered interest rate (0.25% up to $50k, 1.50% up to $100k, 1.55% above $100k)
  • No fees or minimum balances
  • Free use of ATMs within network
  • FDIC Insured
  • Free electronic checks
  • Does not work with mint.com

ING does not provide physical checks. If you need to send a check to someone, you use their web interface to write the check and then they will mail the check for you. Sounds cool, but there are certain situations where it is better to have a physical check that you can hand someone (e.g. if you want to buy something that costs a couple hundred dollars on of Craig’s List, you probably want to write a check instead of carrying around that much cash).

Verdict

Needless to say, I am a fan of Schwab because it has a higher interest rate, larger ATM network (i.e. every ATM in the world), and works with mint.com. Keep an eye out for my next post on online savings accounts.

To delete or not to delete

I recently found out how satisfying it is to delete old code. Why? Because it improves the signal to noise ratio of individual code files and of the code repository as a whole.

Imagine you are a new hire who is trying to get familiar with a repository and learn how things are done. If your repository is cluttered with old code files then looking for good examples of how to do something is like walking through a minefield of “// DEPRICATED!!!”  and “// TODO: get rid of this hack”.

Not only is old code clutter, it is dangerous. Consider a function calculateFoo() which was written assuming X was true (a reasonable assumption at the time). What happens if X ceases to be true at some point in the future? If calculateFoo() is still being used, then it creates a bug (which may or may not be noticed in a timely fashion).

Worse, if nobody is using calculateFoo() then the bug turns in to a time bomb waiting to explode on the next person who needs to calculate foo. This person will probably eyeball the code and if they don’t happen to notice the potentially subtle bug, then they will start to use calculateFoo() assuming that it works.

Another possible scenario is that a new programmer needs to calculate foo but needs the result formatted differently then how calculateFoo() formats the result. A cautious programmer might not want to modify the behavior of calculateFoo() for fear of breaking any existing uses of the function (even though there aren’t any). Therefore this programmer might add a new function calculateFooNewFormat() that calls calculateFoo() and then formats the result in the desired way. The code is now more complex then necessary because it handles a non-existent case.

The solution? Delete code that is old and unused!

Process Thrashing on Mac OS X?

I have been trying to test the benefits of writing a multi-threaded program on my Macbook Pro with some surprising results. Consider the simple C++ program below:

#include <iostream>
#include <cstdlib>
using namespace std;

int main(int argc, char** argv) {
 double n = atof(argv[1]);
 double sum = 0;

 cout << "n: " << n << endl;

 while (sum < n) {
   sum += 1;
 }

 cout << "sum: " << sum << endl;
 return 0;
}

This program clearly has a single thread of execution but when I run it on my Macbook Pro, both of my cores light up!

$ g++ -O2 sum.cpp; time ./a.out 10000000000;
n: 1e+10
sum: 1e+10

real    0m14.188s
user    0m14.086s
sys    0m0.038s

So what the heck is the second core doing? The most reasonable explanation I can think of is that my program is thrashing between the cores but never using more than one core at a time. Because the activity monitor update interval is only one second, it will report that the program used both cores on any given second but they weren’t actually in use simultaneously.

If this explanation is indeed correct, then I am kind of surprised that the Mac OS X scheduler lets a process thrash between cores like that. Would Linux or Windows behave differently? Perhaps the Mac OS X scheduler thought it would be less expensive to move my process to another core than some system background process, I don’t know. I would be interested to know how this program utilizes the cores on your system if you have a 3+ core Mac, a 2+ core Windows machine, or a 2+ core Linux machine.

Go

Google recently announced their new computer language “Go”, which I will admit repulsed me on first impression (you write a new language and THAT is what code looks like?). Perhaps it is more efficient to type and compile, but code is read more than it is written. It is not sexy like Python, but it IS new programming language so I felt obligated to suppress my gag reflex and learn more (http://golang.org/). After reading the tutorials, FAQs, and watching the tech talk I began to understand the the “why” of Go (concurrency + fast compiles), which reduced my “eww” reaction.

Interesting features

  • It is a compile time error import a package that you don’t use (builds are fast and minimal)
  • All needed packages must be explicitly imported (dependencies are explicit)
  • goroutines/channels make writing code that executes concurrently easy
  • garbage collected (because multi-threaded memory management is hard)
  • Did I mention fast compiles? (perhaps I can forgive some of the syntax if that is what it takes)

I am very intrigued by goroutines and channels since I have not worked with any languages that have features like these (although Go is not the first language to have these features). I hope to write my first Go program that uses these features soon.

Cash Back Credit Cards – Other Categories

This is part 4 of my series on Cash Back Credit Cards.

Special categories are anything that you regularly spend a non-trivial amount of money on (e.g. movies, restaurants, travel, etc.). You should know what categories you regularly spend the most money in so that you can try to get a cash back credit card that rewards you for spending in those categories. Your “everything else” credit card will affect whether or not it is worth the trouble to add a new card for a specific category (or categories).

For example, my Charles Schwab Invest First Visa gives me 2% cash back on everything so I can ignore any card that does not give me more than 2% cash back in a category that I care about.

Here are a few cards to look at:

Costco True Earnings American Express (link)

  • 3% cash back for gasoline
  • 3% cash back for restaurants
  • 2% cash back for travel
  • 1% cash back everywhere else
  • Requires Costco membership ($50/year)

If you already are a Costco member then this card is probably a good deal depending on what cards you already have. If you are not a Costco member then you have to ask yourself if you will make up the $50 membership fee in cash back. Lets assume that you don’t use Costco and already have a credit card that gives you a vanilla 1% cash back on everything. You would need to spend $2,500 per year (or $208 per month) at gas and restaurants to break even on the membership fee. If you spend more than that, or if you already go to Costco then this card might be a good deal.

Citi Forward Visa (link)

  • 5 ThankYou points (3.57% cash back) for books, movies, music, and restaurants
  • 1 ThankYou point (0.7143% cash back) for everything else

The cash back percentage assumes that you redeem your ThankYou points for Citi Visa Gift Cards at a rate of $25 per 3,500 points (which is currently the most cost effective way to spend your points). Obviously never use this card for anything other than the bonus categories because you would be getting less than 1% cash back.

Aside from g/d/g, movies and restaurants are my next biggest spending categories so this card is perfect for me. Plus I have heard (but not verified) that www.amazon.com is classified as “books” so you could potentially get 3.57% cash back on anything amazon sells.

That is the end of this series for now, but I am always on the lookout for new or interesting cash back cards.

Cash Back Credit Cards – Gas, Drugstores, and Groceries

This is part 3 of my series on Cash Back Credit Cards.

Almost everyone spends a non-trivial amount of money each month at gas stations, drugstores, grocery stores so it would be foolish to not have a card that gives you extra rewards in these categories. There are many people who have cards that give 3-5% cash back on g/d/g with no strings attached but I don’t think any of these cards are still available. If you have one of these cards, consider yourself lucky and for the love of god keep your card in good standing because it is probably better than any g/d/g card available at this time. If you don’t have one of these old cards, here are your choices.

Capital One No Hassle Cash Rewards Mastercard (link)

  • 2% cash back for gas and groceries (x)
  • 1% cash back on everything else (y)

This card is pretty straight forward, but there is no reason to get this when you can get the Fidelity Amex that gives you 2% cash back on everything. Next!

American Express Blue Cash (link)

  • 1% cash back at supermarkets, gas stations, and drugstores
  • 5% cash back at supermarkets, gas stations, and drugstores after spending $6,500 in one year
  • 0.5% cash back everywhere else
  • 1.25% cash back everywhere else after spending $6,500 in one year

This card sounds great until you read the fine print (which I conveniently bolded) that says the maximum cash back bonus doesn’t kick in until after you spend $6,500 in one year. On the first $6,500 you spend each year, this card gives a dismal 1% cash back on g/d/g and 0.5% on everything else, so how much do you need to spend to make the average cash back something reasonable?

The Fidelity Amex will give you 2% cash back on everything, so let’s calculate how much you would have to spend on g/d/g for the Blue Cash to average 2% cash back.

0.02 = (0.01*6500+0.05*(x-6500))/x
x = $8,666 per year or $722 per month

That means if you are spending less than $722 a month of g/d/g, the Blue Cash will probably give you less cash back then the Fidelity Amex would. I say “probably” because it actually depends on how much you spend in “other” categories. Here is the formula for how much cash back you would receive if X is the amount you spend on g/d/g and Y is the amount you spend on everything else. This equation assumes that X and Y are evenly spent throughout the year.

Let t = x+y

c = .01*6500*x/t + .005*6500*y/t + .05*(x-6500*x/t) + .0125*(y-6500*y/t)

Substitute for t and reduce to get

c = 0.05*x + 0.0125*y  – (260*x + 48.75*y)/(x+y)

The formula for the Fidelity Amex is pretty simple

c = 0.02*x + 0.02*y

Using these formulas we can figure out which strategies maximize cash back given your spending.

If I had to choose one, which should I get?

To find the line where the cards are equal, just set the equations equal to each other and plot (the intersection of two surfaces is a line!)

0.02*x + 0.02*y = 0.05*x + 0.0125*y – (260*x + 48.75*y)/(x+y)

Simplified

0 = 3*x^2 + 2.25*x*y – 0.75*y^2 – 26000*x – 4875*y

Graph (using Gnuplot)

fidelity_amex_vs_blue_cash

If you spend $X on g/d/g every year and $Y on everything else, then just find the point (x, y) on the graph. If you are to the left of the red line then a Fidelity Amex is better for you than a Blue Cash. If you are to the right of the red line then a Blue Cash is better for you than a Fidelity Amex.

If I already have a Blue Cash, should I get a Fidelity Amex?

Yes. If you aren’t reaching the $6500 tier every year then you a strictly better off with the Fidelity Amex. If you are reaching your $6500 tier then it doesn’t make sense to keep spending “other” categories on your Blue Cash at 1.25% cash back when you can be earning 2% on your Fidelity Amex.

If I already have a Fidelity Amex, should I get a Blue Cash?

There are two potential strategies if you have both cards.

  1. Use Blue Cash only for g/d/g and Fidelity Amex for everything else
  2. Use Blue Cash for everything until you hit the $6500 tier and then switch to strategy 1

Let’s compare, here is the formula for strategy 1

c = 0.01*6500 + 0.05*(x – 6500) + 0.02*y

Simplified

c = 0.05*x + 0.02*y – 260

And the formula for strategy 2. Let t = x+y

c = .01*6500*x/t + .005*6500*y/t + .05*(x-6500*x/t) + .02*(y-6500*y/t)

Simplified

c = 0.05*x + 0.02*y – (260*x + 97.5*y)/(x+y)

Set them equal to each other to find their intersection. Pay attention to the steps…

0.05*x + 0.02*y – 260 = 0.05*x + 0.02*y – (260*x + 97.5*y)/(x+y)
-260 = -(260*x + 97.5*y)/(x+y)
260*x + 260*y = 260*x + 97.5*y
260*y = 97.5*y

The strategies are equal if y = 0, but if y > 0 then working backwards we have

260*y > 97.5*y
260*x + 260*y > 260*x + 97.5*y
-260 < -(260*x + 97.5*y)/(x+y) [multiplied by a negative so flip inequality]
0.05*x + 0.02*y – 260 < 0.05*x + 0.02*y – (260*x + 97.5*y)/(x+y)
strategy 1 < strategy 2

So why is strategy 2 always better than strategy 1? As I calculated earlier, strategy 1 doesn’t make make any sense unless you spend at least $8,666 per year or $722 per month on g/d/g, otherwise you would be better off just putting everything on Fidelity Amex. But for the sake of argument, lets assume that you are using strategy 1 because you DO spend at least $8,666 per year on g/d/g. Now think about what would happen if you moved $1 of “other” spending from your Fidelity to your Blue Cash before you hit the $6500 tier on your Blue Cash. Well, you would lose the $0.02 cash back Fidelity would have paid you, but you would push $1 more of g/d/g spending to the $6500 tier which means Blue Cash would pay you $0.05 for that dollar instead of $0.01. That is a net gain of $0.05 – $0.01 – $0.02 = $0.02! The previous logic holds for any non negative amount so we just proved (twice) that strategy 1 is a dominated strategy and we can forget about it.

Now compare strategy 2 with using only a Fidelity Amex

0.02*x + 0.02*y = 0.05*x + 0.02*y – (260*x + 97.5*y)/(x+y)

Simplified

0 = 3*x^2 + 3*x*y + 26000*x – 9750*y

And the new graph

fidelity_amex_vs_blue_cash_and_fidelity_amex

Once again, if you are to the left of the red line then you are better off without a Blue Cash.

Verdict

It depends, but luckily I just gave you all the graphs you need to figure out which is best for you! Here are some more general points.

  • Amex is not accepted everywhere, so you should always have a backup Visa or Mastercard (I recommend Fidelity Visa with 1.5% cash back)
  • Your Amex only gives you cash back once a year as a statement credit, so if something bad happens to your account you could lose it

Next: Cash Back Credit Cards – Other Categories

Cash Back Credit Cards – One Size Fits All

This is part 2 of my series on Cash Back Credit Cards.

Having a one size fits all cash back credit card is a good way to start earning cash back because you don’t have to worry about categories, reward tiers, or points. The goal is to find a card with the highest cash back across all categories and with no strings attached. Any decent cash back card will give you at least 1% on all purchases, so ideally you should be looking for a card that will give you more than 1%.

Charles Schwab Invest First Visa Signature

  • 2% cash back on all purchases
  • Cash back deposited into a Schwab Brokerage Account (free to open) automatically every month
  • Easy to set up online transfers between your Schwab brokerage account and your existing checking account
  • discontinued

This is an excellent cash back credit card that Schwab introduced less than a year ago. I was surprised that Schwab could afford to give 2% cash back on a Visa but I guess they were trying to acquire users. It must have been too expensive to maintain because Schwab recently stopped issuing the card less than a year after it was introduced. Fortunately there are still some good alternatives.

Fidelity Investment Rewards Visa Signature (link)

  • 1.5% cash back on all purchases
  • 2% cash back on all purchases after you spend $15,000 in one year
  • Cash back is automatically deposited into any eligible Fidelity account once you earn $50 in rewards

I would ignore the 2% clause and just consider this a 1.5% cash back card, which is still better than the typical 1% cash back card.

Fidelity Rewards American Express (link)

  • 2% cash back on all purchases
  • Cash back is automatically deposited into any eligible Fidelity account once you earn $50 in rewards

Verdict

I would slightly favor the Fidelity Investment Rewards Visa Signature because having an Amex is not worth getting an extra 0.5% cash back to me, but it is mostly a personal preference. The optimal scenario would be to have both but that is probably overkill.

Next: Cash Back Credit Cards – Gas, Drugstores, and Groceries

Next Page »