Archive for 2010

Water Heater Cost / Payback Calculator

For the few months my wife and I have been trying to decide on a new water heater. After moving into our new place, we realized that the existing electric tank water heater wasn’t working right since the temperature of our showers steadily got colder. It was suggested that one of the heating elements was busted, but I wasn’t interested in getting it repaired since the heater was way older than the expected lifetime of an electric heater. However, there are a lot of choices for a replacement. Another electric tank water heater would be cheap, a gas tank heater would be cheaper to run but require running a gas line, and there are tankless water heaters which are much more expensive but are cheaper to operate and don’t have to keep a whole tank of water heated up all the time for the few times you use it.

There are a number of ways out there for you to figure out how the cost of installation and purchase balance out with the cost of operation over time. You can always make your own Excel spreadsheet to figure it out, or you can use calculators like this one from energy.gov. However, all the web payback calculators I’ve seen have had clunky 90s interfaces, don’t take into account all the variables, and most importantly, don’t let you compare multiple types of heaters at the same time. So, like any good software developer, I built my own.

My water heater calculator is based on the same calculations used on the Federal Energy Management Program site, with the addition of inputs for your hot and cold water temperature. It’s also more flexible about how you enter your water usage. But the best part is that you can enter as many different water heaters as you want and they’ll all be graphed against each other, taking into account the lifetime of the unit. Get multiple bids, try different models, compare gas and electric. By displaying them as a graph of total cost over time, you can see where each heater breaks even with each other, and how much savings you’re getting by the end.

As a bonus, the calculator will also calculate how much you may be able to claim as part of the Energy Star Federal Tax Credit program. It’s smart enough to know the rules about the credits (gas heaters >e; 0.82 efficiency only, 30% of total cost up to $1500), and you can choose not to use the rebate if you’ve already used it up this year or don’t plan on applying it to your heater.

You can get started with the calculator by filling in values for your water usage and resource costs, or accept the defaults. Then add as many heaters as you like, entering in the cost for purchase and installation, the Energy Factor (which should be in the documentation for the heater), and the estimated lifetime of the heater. The more accurate you can make the numbers, the better your cost projection will be. Then check out the graph to see what your total expenditure will be after every year. If you’re comparing a new heater with the option of keeping your existing heater, just set the Cost to $0 and reduce the lifetime to how long you expect your existing heater to last.

Hopefully this little tool will be helpful to anyone else looking to replace their water heater. I filled it out for a combination of several electric, gas tanked, gas tankless, and heat-pump based water heaters, and it gave me a much better picture of what was worth it and what wasn’t. In the end, even though the graphs told me that the increased efficiency of a gas tankless heater wouldn’t ever pay back the cost difference versus an electric tank water heater, we ended up going with one. The promise of infinite hot water (long showers after a hike!) and no chance of burst water heaters outweighed the additional cost. But at least we were well-informed!

PNGGauntlet 2.1 with Windows 7 integration

Last week I pushed a new update to PNGGauntlet, version 2.1. It’s been almost two years since the last PNGGauntlet update, and 2.1 doesn’t bring a lot of new stuff – it’s mainly bug fixes and optimizations. But there are some cool new bits. My favorite is that PNGGauntlet now integrates with the Windows 7 taskbar to show compression progress on its taskbar icon.

It isn’t a huge feature, but it lets you keep an eye on a big compression job while you’re doing other things. PNGGauntlet is slightly prettier in other areas, too, especially the list of files, which is also now sortable.

The other neat thing is that PNGGauntlet now registers itself as a handler for compatible image files on install now. This means that you can right-click an image, go to “Open With…” and select PNGGauntlet, and it’ll open right up with your file ready to go.

Beyond that, a couple bugs have been fixed where you could get PNGGauntlet into a weird state or hang. Check out the full changelog for all the features and fixes.

Glowback – Arduino-powered glowing ceramic creature

While I spend most of my time in front of a keyboard and monitor, my wife Eva Funderburgh spends her time sculpting amazing, imaginary ceramic creatures. Her beasts are assembled out of different clays and wood-fired. About a year ago she enlisted my help in building a new type of beast with egg-shaped domes on its back. The idea was to have the domes glow and pulse with an organic, bioluminescent light. (Note: This was way before we’d seen Avatar!) Eva had already built and fired the beast a few months earlier, using thin shells of translucent Southern Ice porcelain for the domes. She left a few of the domes unattached so we could get lights inside after the firing.

The start of the Glowback

(more…)

Searchable tab switching in Firefox 3.6

As an emacs user, I’ve found iswitchb (interactive-switch-buffers) to be a huge time saver. Basically, to switch files (buffers) you enter a typically byzantine key combination and then type to search through your open files – as less and less files match your search, the choices narrow down, and you can choose between them. This ends up being way faster than switching with a mouse even in tabbed editors, and I’ve managed to set up a similar thing in Eclipse/Aptana. But until recently I didn’t have the same functionality for switching tabs in Firefox.

The good news is that Firefox 3.6 has this feature built in, though it takes a bit of work to enable. Apparently they’ve been trying to get this feature into Firefox since 3.0, but there’s been a lot of different opinions, so even though they finally shipped it with 3.6, it isn’t on by default. You can turn it on by going to about:config (just type that right into your address bar), then searching for “ctrlTab”. Double-click browser.ctrlTab.previews to turn it to “true”. Now, when you hit Ctrl-Tab, you’ll get a tab switcher that looks a bit like the default Windows Alt-Tab window switcher (though with a much lighter glass effect that honestly looks pretty bad compared to Windows’ Alt-Tab). On other platforms you’ll get a similarly system-integrated look. Unfortunately this popup isn’t exactly what we’re looking for – it doesn’t show all your tabs and you can’t search! However, you can navigate down to “show all X tabs” at the bottom and you get a search box and a list of every tab. That’s a real pain to do every time you want to switch tabs, though. Fortunately, there’s a solution. Instead of hitting Ctrl-Tab, use Ctrl-Shift-Tab, and you’ll start out right at the big tab switcher with search. From here you can type to narrow down your selection and hit Enter to choose your tab. I wish there was a preference to make this full search show up when you hit Ctrl-Tab, but it doesn’t look like there is.

Firefox Ctrl-Shift-Tab tab switcher
Switching between tabs (man, that glass effect is a mess)

Visual issues aside, I wish every program with a tab-oriented UI had a feature like this to make their app faster to use for keyboard users. While we’re at it, Windows and OSX should add search to their built-in window switchers – it could really help when I have a lot of windows open and don’t want to reach for the mouse.

Note: There are a couple extensions for Google Chrome that theoretically give a similar searchable tab switcher, but of the few I tried, none of them could appear with a keyboard shortcut – you had to click an icon on the toolbar, which seems to defeat the point. Apparently the Chrome Extensions API has known problems with keyboard shortcuts, so maybe things will get better soon.

Simple expiring caching for Ruby on Rails

Ruby on Rails has some great caching support built right in, but it’s most useful when you have MemCacheD or DRb around to serve as a cache store. I don’t have access to those everywhere – Dreamhost and other shared hosting providers often prohibit running your own MemCacheD. There’s a default memory store, but it won’t share cached info between Rails server processes. That leaves the file store, which just writes cached objects to a file that gets shared between all your Rails processes on the same box. The main problem with the file store is that it doesn’t support time-based expiration – you have to set up a cron job to sweep out the cache files every once in a while to invalidate your cache.

To get around this, I wrote a tiny, obvious little module that gives a simple syntax for caching objects with the file store. The trick is that it stores the insert time whenever it caches a new object, and compares it with the current time every time it looks it up. If the cached object is too old (or the cache is empty), it throws it away and executes the provided block and caches the new value.

Be sure to use the same expiration whenever you fetch the same object, or things will expire differently depending on where they’re accessed. You can also do a bit of customization for more complex cache invalidations – I have a version of fetch that caches objects within one calendar day and recalculates them only when the date is different. I suppose I could made fetch take an optional Proc to control the caching strategy, but I didn’t really need that much customization. Anyway, this isn’t exactly brilliant new code, but it has made caching objects from my smaller Rails apps a bit easier.