posts by date

07/2007
Managing money online

Like a lot of people I’m sure, something I’m desperately lacking in the land of money management is a centralized place to manage everything. I tried the 60-day trial of Quicken, but it wasn’t quite what I was looking for. I mean, in theory it was exactly what I was looking for; but it didn’t auto-sync with all of my accounts, which is a must-have for me to spend the money on it ($64). It was supposed to grab my investments, loan balances (car and school), banking info, etc, but it didn’t. My bank and zero-balance credit card updated automatically, but with a catch: ignored pending transactions. I’ve gotten used to the “available balance” from online banking, which does consider pending transactions. Plus, that’s what I match my check book register against. In the end, Quicken just didn’t work for me.

Wesabe just released a Firefox extension that looks pretty slick (watch the video). But I don’t feel comfortable enough trusting it with everything. I trust my banking site, but I have more confidence in a national bank than a free (and community-based?) service with not much to lose. Personally, I would not enjoy working on an application that links into banking software and deals with other money-related accounts. That’s right up there in the list of things that aren’t fun to worry about.

Maybe someday I’ll find a solution. Until then, I’ll keep using the 6 bookmarks in my “money” bookmark folder. Blah.

xtimeline

xtimeline is a site that allows people to visually recap an event in history by building a time line for it. I initially thought it was pointless, and maybe it is. But it’s kind of interesting to browse through some of them. It’s actually not a bad way to brush up on past events. It held my attention a lot longer than it probably should have. To list a few:

If I were back in eighth grade doing those tedious “research” reports, something like this would have come in handy. It’s too bad I knew more history back in those days than I do now.

Raising custom exceptions in Rails

I’ve grown to not like the if/else block at all. Here’s an example of what I’m not fond of:

def do_some_work
  unless feeling_lazy?
    if current_user.is_boss
      do_boss_work
    else
      do_work
    end
    flash[:notice] = "Glad you're working hard."
  else
    redirect_to lazy_page_path
    flash[:error] = "You're too lazy to work here."
  end
end

The if/else statements just clutter the code. It disguises the logic by its ugliness. When appropriate, I’ll avoid if/else by raising exceptions to handle the “else” condition. That way, I can assume everything works how I want it to, and just raise if it doesn’t. Something like this is much better, in my opinion…

def do_some_work
  raise if feeling_lazy?
  current_user.is_boss ? do_boss_work : do_work
  flash[:notice] = "Glad you're working hard."
rescue
  redirect_to lazy_page_path
  flash[:error] = "You're too lazy to work here."
end

That’s much easier on the eyes. But I like to raise application-specific exceptions instead of the generic “rescue everything” solution. The way I’m currently doing this feels a little, I don’t know, sloppy. What I usually do is put a separate module in the lib folder, then include it in ApplicationController so it’s available everywhere. Something like this:

# lib/exceptions.rb
module Exceptions
  class TooLazyToWork < StandardError; end
  class NotTheBoss < StandardError; end
end

# using the custom exceptions
def do_some_work
  raise Exceptions::TooLazyToWork if feeling_lazy?
  ...
rescue Exceptions::TooLazyToWork => exception
  flash[:error] = "You can't work: #{exception.message}"
end

I’m not doing anything with the class except inheriting from StandardError (or Error, RunTimeError, etc)—that’s what feels sloppy. Is there a better way to achieve this? If you notice something that could be (or should be) done better (or differently), I’d appreciate the advice.

A mystery movie

Provoking curiosity is sometimes the best marketing strategy. If you’ve seen Transformers (and weren’t late), you’ve seen the preview for a movie that doesn’t reveal very much and doesn’t have a title (here’s the trailer for those who haven’t). All you see is a going away party for someone, explosions in the city, and the Statue of Liberty’s head being thrown for blocks. Godzilla almost seems too easy, since this trailer is thought of as a mystery, but I’m at a loss for anything else. Not knowing what it is makes me want to see it. Any ideas?

A Perfect Mess

A Perfect Mess is a book about disorder and how “being messy” can, in some ways, circumvent organized habits. I haven’t read it, but I bet it’d be interesting. I’ve actually argued that spending time organizing certain things is wasteful. There’s a fine line there, though. Organizing code is mandatory, and a lot of what I love about MVC is the organization it provides. But take gmail for example. Early on, I thought categorizing with labels was the way to go. It’s not. At least, for me it’s not. After I set the labels, I never go back to use them. It’s extra work before archiving, and there’s really no need. I just use the search if I need something—it’s much easier and faster. Plus, it returns chats, as well.

The point is the time spent digging through the mess falls short of the total time spent organizing. I’d like to read a book about this from someone who can articulate what they’re trying to say much better than I can. All I need is a reason to be messy…

Golf Trac will support OpenID

The other night, I added OpenID support for Golf Trac. I’ve been using it (OpenID) more and more lately and I’m starting to really like it. It’s so easy. Since not everyone uses it (yet), I’ve implemented username/password registration, as well. Going from username/password to OpenID, or vice versa, is no problem. The accounts can be easily merged as long as the email that is registered is the same email associated with the OpenID account.

Technically speaking, managing both login types for the same account didn’t go quite as smoothly as planned. I didn’t want to create a second username/password registration process just because a user had an OpenID, so it was somewhat involved to come up with a work-around. I had a few issues bypassing certain validations, but all is well now. And besides, it’s only a little awkward in the rare case (going from OpenID to username/password). The typical case (going from username/password to OpenID) is completely seamless. If a user already has a username/password, signing in with OpenID will then tell Golf Trac to merge with the existing account.

If you think managing multiple logins is a pain, you really should look into OpenID.

Personal Projects

Golf Trac is something I can’t wait to use. Originally, using it was all my motivation. Now, I’m remembering how fun it is to work on personal stuff, and that boosts my motivation to finish it even more—it’s a win-win. I have to say, though, I wouldn’t enjoy it nearly as much without Ruby/Rails. I’m still figuring out more and more, which is awesome. It’s that amazed, “Ah ha!” moment that constantly adds to the experience (for me, anyway).

Personal projects in general are fun to work on (especially when it’s not rpheath.com again). Nobody can tell me what to do or when to do it. If I want to spend a week on nothing but adjusting pixels, I can. There’s no worrying about this decision or that decision, I only have to please myself. And, believe it or not, sometimes I’m not in the mood to program. It’s nice to be able to set it aside for when I am in the mood.

I think Google employees get 20% of their work-week to work on personal projects. That’s what I need… one day per week to work on my own stuff, and get paid for it. Of course, a full week would be much better (lucky bums)1.

1 Yes, I realize it took hard work to get there. And they’re not really bums.

Preventing web-form spam using CSS

I just came across a pretty clever way to prevent comment spam (or any web-form spam for that matter). It’s straight forward and sticks to the basics. I’m honestly surprised I’ve never thought of this before.

In order to leave comments here, you must first fill in the spam-prevention field, which basically asks, “Are you human?” Since any extra field is a pain, I’m storing a cookie for you (if you answer correctly once, chances are you’re a human forever). I realized, today, that I can essentially do the same thing without the extra field. Since humans typically fill in fields that aren’t hidden, I could have:

// somewhere in the form...
<input type="text" name="verification" id="verification" />

// somewhere in the css...
input#verification { visibility: hidden; display: none; }

If a value from the verification input is posted to the server, it must be a robotronic spambot that fills in hidden fields, which is obviously not allowed. Personally, I think that’s a pretty clean way to deal with spam. I might use it on golf trac.

Beware of Firefox 2.0.0.5 update

I just upgraded to the latest and greatest Firefox. After the upgrade, the browser wouldn’t restart. After rebooting my computer twice, and uninstalling Firefox completely, I was able to get the upgrade to work. However, it’s been about 2 hours now, and it has crashed on me at least 3 times. Before tonight, it has been months since the last time Firefox crashed. I removed a good bit of my extensions to avoid unnecessary conflicts, but it’s still not quite as smooth as it was. Apparently, I’m not the only one to have trouble with this update. I’d steer clear of it if I were you—I’m sure they’ll have another one coming soon (I’m on Windows, by the way).

If I could get the del.icio.us extension and browser sync in Safari, I think I’d switch. It’s incredibly fast, and I like the way it renders pages. Also, the new Flock seems to be a reasonable alternative these days. I still don’t need all of that extra stuff, but it seems to be less obtrusive than it was before. I’m not a fan of the “my world” page (yes, I know it’s not mandatory), and I was informed today that it does finally have a spell-checker.

CEO vs. minimum-wage worker

Amie mentioned a statistic to me yesterday. It came from a nonprofit institution in New York that compiles an “injustice index” each year. Here is one of the injustice’s reported (for 2006):

The average CEO earns more before lunchtime than a full-time minimum-wage worker makes in 1 year. The ratio of the average U.S. CEO’s annual pay to a minimum-wage worker’s is 821:1—the highest ratio ever.

That just blew me away. I know CEO’s are important and all, but for that to be the average is just not right. I wonder how the money-makers in entertainment/sports compare to a minimum-wage worker? I’m sure it would make me sick, as well.

Getting ahead in life

What I’m quickly realizing about life is, no matter what you do right, it’s increasingly difficult to get ahead. Everyone goes through it, but I guess I’m (more or less) just starting out.

Marrying Amie was the best thing in my life. But a big part of being married, that I hadn’t considered before, is insurance. Yes, insurance. It drives me insane. Right now, our insurance expenses cover: life, car(s), ring(s), and since we’re still renting, we have renter’s insurance. On top of that, a recent quote for health insurance—just to add Amie (she’s still a full-time student)—came in at just under $500/month! “But it’s pre-taxed.” Oh OK, that makes everything just fine. And another thing about insurance, anytime you actually use it, the provider raises the cost. It’s absolutely absurd how much insurance costs, but at the same time, you’ve got to have it.

I honestly feel like I’ve done just about everything right so far in life, and I still get smacked in the face with a few things. I’m learning first hand why it’s so very important to invest, invest, invest while you’re young. We don’t have kids or a dog, and it feels like it takes nearly everything we have just to make it. I’m so excited to get a house, but it’s no fun to realize the budget we thought we had is about 25% less.

A friend of a friend told me about a guy who got a raise that pushed him into the next tax bracket. After his raise, he ended up making less than he was before the raise. And all you can say is… that’s life!

All out of ideas

Since the end of January, I’ve designed between 7-10 sites from scratch, and I’m currently working on another one. It’s beginning to wear me out. I don’t mind working that much, but it’s the depressing realization that I’m all out of ideas that’s breaking me down. It’s hard to be creative and do something fresh and new over and over and over again. I think I’ve hit a wall, and I have a deadline coming up around mid-August for another new design.

Sometimes I wonder if I’m moving too fast; sometimes I wonder if I like this stuff as much as I say I do; and sometimes I wonder if I just need a break from it all. It can be frustrating… very, very frustrating. But in the end, bad days come and go. I’ll move on, and probably be happy with the design. For now, though, I feel like complaining.

Introducing Golf Trac (almost)

I enjoy monitoring things over time (Google Reader trends, my investments, spending habits, etc). For me, golf adds one more thing to the list. However, there’s no real easy way to monitor my golf game over time. Especially since it has potential to span across years and years, adding up to hundreds (if not thousands) of rounds. To make things easier for me, I’ve decided to build an application I’ll call Golf Trac (excuse the cheap name, but it wasn’t that important to me).

Currently, it’s only in a sign-up state. I had originally planned on doing it for myself, but I know of at least a couple of people who would like to use it, which was reason enough to build it for others, as well. I don’t plan on having a “social network” around it, as the original reasoning is for those who want to track his or her own game. Of course, if I see some sort of need or reason to add social context, I may, but it’s better for me to start off with the basics. However, I have considered a mobile interface (to post scores as you play), but since I’m not really into mobile technology (yet?), that’s not a priority of mine.

So if you’re a golfer and think you might be interested, sign up to find out when it’s ready (curious minds are fine, too).

Say goodbye to categories

Chris was right. The categories and tags were overlapping. So I dug deep and somehow found the strength to remove the categories! Actually, you just can’t see them anymore. All of the helpers and methods are still there, and I’m still associating categories with my posts… you know, just in case. Did you think I was that crazy??? It’s definitely less redundant, and all I have to do is get used to the less-dressed left sidebar (say that three times fast) and not add anymore useless information.

Data Warehousing

I’m currently taking a grad class on data warehousing. As I’ve mentioned before, I’m somewhat intrigued by useful data analysis, which is the exact reasoning behind data warehousing.

After a month or so into the class, I wonder how companies and large organizations can compete without having a data warehouse. Do you know why Wal-mart always beats out its competitors and K-Mart doesn’t? They maintain one of the largest and efficient data warehouses in the business, with analysts and pattern recognition scripts to spot trends based on products, location, cost, date, time, day-of-the-week, and a million other things. Amazon.com is another prime example. I believe they’re currently generating around $3 billion per year in sales, and I bet it’s because of how well they watch customer habits and trends. Personally, I’m not one to be coaxed into buying the “recommended” books, or “some who’ve bought [product A], have also bought [product B],” but I’m sure some people bite. Actually, they’re pretty good recommendations. I’m a penny-pincher for the most part, and have considered them at times.

The size of the database is another amazing facet of data warehousing. For instance, Amazon.com runs a data warehouse around 10TB in size; AT&T is around 90TB; Yahoo! has one exceeding 100TB; and the mighty Google is analyzing a couple of peta-bytes worth of data (which is almost incomprehensible). For perspective, a peta-byte is 1,024TB, or ~20,000 PCs with 50GB each.

Designing a data warehouse contradicts pretty much all that I know about database design. It’s almost the exact opposite: de-normalize instead of normalize, optimize for querying rather than transactional processes, duplicating data becomes popular, no more relational tables (goal is to remove the JOIN), and so on. It’s definitely a different way of thinking, but interesting nonetheless.

Warehouse: web-based SVN browser (and other)

A couple of days ago, Active Reload released a web-based SVN browser that doesn’t suck: Warehouse. I’ve gone as far as browse around the demo, look at screen shots, videos, tutorials, etc. I have to say, from what I’ve seen so far, I’m impressed. I just might be willing to pay the $30.

And while I’m at it, Lighthouse looks like a great bug tracking tool, as well. It integrates with subversion, too (maybe via Warehouse ?) Currently, I’m the only one working on Ruby/Rails stuff at work, so my bug tracking system usually remains in my head (or at best, ends up on scrap paper somewhere).

One more thing, Versions is what seems to be a “tortoise for Mac” when dealing with subversion. I, personally, prefer to use the command line over tortoise, but usually things built for the Mac look and feel a lot cleaner than the Windows counterpart. But that also applies to command line, in which I don’t see how I could pass up that terminal.

Another JavaScript light-window-ish-box

I remember, my first or second summer as an intern, I used a javascript lightbox on this (.NET) tool I was working on. I thought it was the greatest thing and yet it was so generic and buggy. It was a mess trying to get it to work with forms, too. Since then, there has been a ton of effort into improving alternatives to the modal/pop-up window. Well, I just stumbled upon what may be one of the nicest one’s to date: LightWindow. It appears to work very well with videos, flash animations, multiple image galleries, external sites, PDFs, etc. Plus, you can mix in different types of media into the same gallery, which is pretty cool. It may be a nice way to preview screens in a content building tool, which just so happens to be what I’ve been devoting most of my time to the last few months (at work, that is).

Code abstraction and Rails

Sometimes I have a hard time abstracting code when developing in Rails. I mean, the act of abstraction itself isn’t the problem, it’s how far to go with it—or more accurately, when to stop.

When I first started doing web development, I wasn’t too concerned with abstraction. I barely even knew what it was. Like most beginners, if I got something to work, I was satisfied… until I wanted to update something. It was an obvious pain to modify and update code, since I had to remember (or search) for all instances to stay consistent. Then (in addition to object-orientation), I realized that anything I was duplicating I should extract out so I could reuse it—brilliant! (It’s weird to think I was at a point where I didn’t think like that.) So I began to abstract only to prevent duplication. Now, with Rails, I can’t help but abstract everything. Ruby is so readable by nature, it’s stupidly tempting to want to continue that.

I enjoy immediately knowing what’s going on in any of my methods, just by reading them. Typically, I set them up that way. Sometimes, though, it seems like I’m tracing through all of these abstracted methods, and I don’t know if that’s a good thing. As an example, here’s a method I wrote to publish content out to XML:

def publish_xml_for(root_id)
  content = Content.find(root_id)
  create_publish_directory_for(content)
  output_xml_for(content)
  flag_as_published(content)
end

Anyone can look at that and know what’s going on. I’m not necessarily reusing any of those methods (yet, anyway), I just like how readable it is. But altogether, the publish_xml_for method works as a compilation of 5 or 6 methods (the methods inside of it are also abstracted to be very readable—it never ends).

Also, I find myself writing private methods within the controller class—would it be better to add these to some sort of extension in the lib directory? I don’t do that very often, so I have yet to build up habits as to when that should happen. I’ve written some tag extensions for polymorphic tagging, but that’s about it.

ASP on Rails

I’ve been developing solely in Rails for several months now (a lot longer considering my own time), and I’ve become biased as to how web applications should be setup. And how’s that you ask? Exactly like Rails. If you’re subscribed to my web portfolio feed, you’ve probably already seen the most recent project I just added. You may also already know that it was built in ASP/VBScript.

Before Rails, the only other web development experience I have is in PHP and a little bit of C#/VB .NET crapola. So I don’t know a whole lot. The PMI project was to be built in regular ASP and VBScript, which was completely new to me. From the beginning, I knew I wanted to try and adopt some ideas brought forth by the Rails framework. I quickly realized how spoiled I’ve become (it took way too long just to get the DB and configuration stuff working). Trying to set my own conventions, I was able to do things like generate menus and sub-menus dynamically based on page location. Here are a few other things I tried in order to mimic a Rails environment:

  • included a separate helpers file that had various methods to ease my pain (which is better: response.write("message") or p("message")?)
  • mocked model classes by building CRUD operations in classes based on the DB table names
  • used one “layout” file that contained the header, footer, sidebar, menus, etc, while loading dynamic templates based on location (I have a gripe about how I had to do this, though)
  • convention over configuration

More about the gripe with my generic dynamic templates. This is where I was limited the most, as ASP doesn’t support dynamic includes! Instead of using a convention to fill in the file I needed based on page location (i.e. <!--#include virtual="/content/<%= get_page_name %>.asp"-->), I had to have a “content_for_layout” file that had about 20+ if/elseif conditions to determine which content to load. And it gets much worse. Even though only one of those includes are executed (the one inside the true if condition), all of them get loaded. I only needed one view at a time, but had to basically load every template within the site. Awful.

In the end it was kind of fun breaking away from Rails for a little while. Well, it wasn’t fun leaving Rails, it was fun learning something new, though. And on a side note, I can’t fathom how brilliant and consistent you have to be to extract out a framework such as Rails. It’s amazing. I’ll probably be releasing ASP on Rails under the GPLv3 license in the near future, so stay tuned (haha… not really).

A few useful programming resources

As a web developer, I spend some time looking up better syntax or methods to achieve the most efficient solution. I thought I’d make note of some of the resources I use almost daily. I’m primarily developing in Ruby/Rails right now, but some of these resources are outside of that. Here they are, in the order I tend to use them…

  1. Rails API—It’s nice if I know exactly what I need.
  2. Got API—I think we’ve all used this a time or two, or at least are aware of it. I find myself using http://start.gotapi.com more than http://gotapi.com itself. They’re both extremely fast ajaxified interfaces.
  3. Pickaxe online—I prefer the hard copy over the online version, but I do use it occasionally.
  4. Rails API search—This is good if you’re seeking examples (although, not all methods come shipped with examples).
  5. Ruby on Rails Forum—I use this more for posting questions, although I haven’t done that in a while. It’s probably not bad to search for solutions, though.

I thought I had bookmarks of sites that allow you to paste snippets of focused code, but I can’t seem to find them, nor remember what they are. They show their face occasionally on Google searches. If you know of any other “must-be-aware-of” references, leave them in the comments.

2008 by Ryan Heath | Get In Touch

flickr

DesolateInfinityLooking upDazedBlurred