The eclectic musings of a bitter software engineer.

Archived Posts

Displaying posts 61 - 70 of 587

Quicken Online rocks

Tuesday January 08, 2008 @ 10:10 PM (PST)

Apart from a few games, Quicken is the last piece of Windows software that I just haven't been able to replace since switching to Mac OS X. The Mac version of Quicken is pretty much universally hated and is, from all accounts, a buggy piece of crap, and I have no desire to boot up a Windows VM in order to run the Windows version.

I tried a few other OS X finance apps and wasn't happy with most of them. MoneyWell was nice enough that I actually ended up buying a copy, but after a few weeks of use I discovered that it's just not as convenient as Quicken was (it also suffers from a few annoying bugs).

In terms of web apps, Mint is okay, but pretty limited, occasionally glitchy, and spammy. Buxfer is nicer, but often frustratingly slow, and still not as advanced (or as automated) as I'd like.

Somehow, while searching high and low for a Quicken replacement, I completely failed to discover Quicken Online until today. I was blown away. It doesn't have the full featureset of desktop Quicken, but it's got all the stuff I care about, wrapped in a gorgeous, responsive UI. They even officially support my new favorite browser, Safari, and there's an awesome iPhone interface for when I'm not near a computer. Within five minutes of signing up I had imported all my accounts and was ready to go.

If you haven't taken a look at Quicken Online yet, I recommend checking it out.

Code aesthetics

Sunday January 06, 2008 @ 04:36 PM (PST)

I’m not exactly the tidiest person when it comes to the physical world. I have two desks in my office at home; on top of one is a bunch of clutter and an LCD, keyboard, and mouse, so you might say it’s at least serving a purpose. The other desk serves no purpose other than forming the nucleus of another gigantic ball of clutter.

When it comes to code, though, I’m the most mind-numbingly anal perfectionist you’ve ever met. Ugly code—even if there’s nothing wrong with it aside from being messy—makes me depressed. It actually affects my mood. I can’t bear to look at it, much less work with it. The aesthetics of code have such a strong effect on me that I actively avoid languages that encourage or facilitate messy code and I try to avoid working with programmers who write messy code. I know this isn’t rational, especially if I want to continue to learn and grow as a programmer, but it seems to be hard-wired. I can’t help it.

One of my biggest pet peeves is when programmers fail to use vertical whitespace and descriptive comments to make their code more readable. Obviously you don’t want pages of blank space or comments on every line, but ideally whitespace and meaningful comments should be used to break up code inside a function into logical groups. This makes the code more readable in the same way that paragraph breaks make text more readable.

The following example is a more or less randomly-chosen snippet from a Ruby Flickr library I wrote a while back. Exhibits A and B are absolutely identical, except that B has vertical whitespace and comments, whereas A does not.

Exhibit A:

def sign_request(request, params)
  if @api_secret.nil?
    request.set_form_data(params)
    return request
  end
  params['auth_token'] = @auth.token unless @auth.token.nil?
  paramlist = ''
  params.keys.sort.each {|key| paramlist << key << URI.escape(params[key].to_s)}
  params['api_sig'] = Digest::MD5.hexdigest(@api_secret + paramlist)
  request.set_form_data(params)
  return request      
end

Exhibit B:

# Signs a Flickr API request with the API secret if set.
def sign_request(request, params)
  # If the secret isn't set, we can't sign anything.
  if @api_secret.nil?
    request.set_form_data(params)
    return request
  end

  # Add auth_token to the param list if we're already authenticated.
  params['auth_token'] = @auth.token unless @auth.token.nil?

  # Build a sorted, concatenated parameter list as described at
  # http://flickr.com/services/api/auth.spec.html
  paramlist = ''
  params.keys.sort.each {|key| paramlist << key << 
      URI.escape(params[key].to_s) }

  # Sign the request with a hash of the secret key and the concatenated
  # parameter list.
  params['api_sig'] = Digest::MD5.hexdigest(@api_secret + paramlist)
  request.set_form_data(params)

  return request
end

This function isn’t the least bit complicated, but Exhibit A sure makes it look like it is. Exhibit B, on the other hand, breaks it into meaningful chunks and uses comments to tell you what each bit is doing, so that a programmer unfamiliar with the codebase can see at a glance what’s happening without having to parse the actual code.

I probably spent an extra minute or two writing those comments and adding whitespace, but that up-front investment was well worth it when I found myself looking at that code again today for the first time in months and understood it instantly.

Do your future self and your fellow programmers a favor: comment your code and use whitespace to make it more readable. Only assholes and Perl programmers think cryptic code is impressive.

Why I lack sleep

Saturday January 05, 2008 @ 12:03 AM (PST)

For the curious, the reason my eyeballs are currently burning like they're covered in acid is that last night, after I went to bed early hoping to get a nice restful night's sleep, I was awakened from said restful sleep at 4:15 AM by my phone ringing.

Since everyone who knows my phone number also knows that I hate talking on the phone, and since the number on caller ID wasn't one I recognized, and since it was 4:15 in the goddamn morning, I naturally assumed it was some kind of emergency and at least one of my favorite people in the universe had been killed or was in the process of being killed by terrorists or Godzilla or something equally horrible. So I immediately shook off the sleep and answered:

Me: Hello?
Female voice: Hello?
Me: Hello?
Female voice: [pause] Who's this?
Me: Who the fuck is this?
Female voice: I think I have the wrong number.
Me: You think? [click]

Do me a favor, folks: if you're going to make a phone call at 4:15 in the morning, please take a moment to make sure you're dialing the right number.

Lazyweb: please fix my broken eyeballs

Friday January 04, 2008 @ 04:39 PM (PST)

For at least the last five years or so, I've been afflicted with this horribly annoying condition: if I don't get an average of about seven hours of sleep per night, then sometime around mid-afternoon my eyes begin to sting as if I'm having some kind of allergic reaction, and they'll continue doing this until I sleep.

If I have several nights of bad sleep, my eyes will begin to itch earlier and earlier in the day. The only way to make it stop happening is to get enough sleep to make up for whatever sleep debt I've incurred; then the itchiness goes away and my eyes are fine. In other words, two nights of bad sleep requires two nights of good sleep in order for my eyes to get better. On the other hand, if I get consistently good sleep for several weeks, then I can get bad sleep for a few nights in a row before my eyes begin to itch. It's as if I'm storing up sleep, and when I run out, my eyes punish me for it until I repay them.

The most frustrating thing about this is that even if my lack of sleep isn't enough to actually make me sleepy, it's often enough to make my eyes hurt so much that I have no choice but to try to get more sleep (which isn't always possible if I'm, say, at work).

I've tried everything I can think of to relieve the symptoms, including eyedrops and mid-day naps, and the only thing that works is for me to repay whatever sleep debt I've incurred, which often means I can't get any relief until the weekend (and sometimes not even then if I happen to sleep badly).

Does anyone else suffer from something similar? If so, how do you deal with it, short of just sleeping a lot?

Xbox Live is a delicate flower

Sunday December 30, 2007 @ 01:58 PM (PST)

When I got home from my trip to Portland late Friday night, I had a grand plan: I would use the gift cards I'd received for Christmas to buy a crapload of Xbox 360 games and then spend the remainder of my holiday vacation sitting on the couch, having a massive 360 gaming marathon.

Instead, I spent all day Saturday trying unsuccessfully to recover my Xbox Live user account, which I had transferred to Loren's 360 in Portland while I was there so we could play Rock Band and Madden '08. Apparently lots of other people had the same idea over the holidays and the Live servers couldn't handle the load of all the accounts being recovered.

Major Nelson spent the day updating his Twitter feed every few minutes with helpful and informative status messages like "I can't stress enough that Account Recovery should ONLY be used in emergencies" and "Just played some H3 with a few of you". You might expect him to know what's going on over there seeing as how he's the Xbox Live Director of Programming (whatever that is), yet every fifteen minutes or so he'd say something like "Everything appears to be working now" only to follow it up a few minutes later with, "Fooled you! Everything's still broken." I'm sure he means well, but Jesus Christ it's infuriating.

The most infuriating thing about all of this, though, is that Major Nelson, Xbox Live customer service, and some of the Xbox Live support personnel commenting on the forums seem to be blaming the account recovery problems on users who used the feature to temporarily move their accounts to a friend's 360. They say account recovery is meant only for "emergencies" and not for roaming. The implication is that by misusing the feature, we overloaded Microsoft's fragile little servers and brought all this pain upon ourselves.

If this is true, and if account recovery really isn't supposed to be used for roaming, then it would probably be a good idea not to encourage people to use it for roaming right there on the account recovery screen.

Anyway, as a result of all this nonsense I went out and spent my Christmas money on PlayStation 3 games instead. My PS3's online features are working just fine.

WordPress sucks

Tuesday December 11, 2007 @ 05:11 PM (PST)

More than two years ago, I wrote a scathing, obscenity-filled tirade about WordPress's misuse of addslashes() to escape user-supplied strings used in SQL queries.

Lots of people posted comments. Some said I was being pedantic, some said I was downright wrong, and one person linked to a diff showing a fix that was supposedly going to be in the next release.

Apparently they never got around to releasing that fix.

Header photos

Monday December 10, 2007 @ 09:53 PM (PST)

I recently added a bunch of new random header photos to the site and it occurred to me that even though they've been up there for years, I've never actually mentioned them in a blog post.

So, for the curious: the header photos are the product of a Ruby script that sifts through the thousands of photos I've taken since I bought my first digital camera way back in the 20th century. It creates a 720x170 crop of a randomly-chosen section of each image. Then I go through the resulting mess and manually weed out anything that isn't interesting. There are currently 127 photos in the pool, one of which is displayed at random on each pageview.

In addition to providing a bit of dynamic color for the page, they have the pleasing effect of triggering fond memories each time I look at my website. Since this tends to be one of the first and last websites I look at every day, that can be rather soothing.

Internet Explorer 8 doesn't matter

Thursday December 06, 2007 @ 11:55 AM (PST)

Microsoft's complete silence on the status of Internet Explorer 8 has resulted in much wailing and gnashing of teeth from web developers, but ultimately it's not an issue worth getting worked up about (note: the Ryan G. quoted in that article isn't me).

The status of IE8 is unimportant. Whether or not IE8 will be less of a piece of shit than IE6 and IE7 is unimportant. What is important is that in spite of the release of IE7 over a year ago, IE6 is still the world's dominant web browser, and it's holding the web back.

Even if Microsoft were to release a fully standards-compliant IE8 tomorrow, it wouldn't solve this problem, because IE users have no interest in upgrading until they're forced. The people who are still using IE6 are grandparents and casual computer users — people who don't necessarily know or care what a web browser is — and corporate users who have no control over what browser their IT department lets them use.

Microsoft needs to figure out how to get these users to upgrade, and they need to do it now. They botched the IE7 release utterly by giving it a horrid, unfamiliar UI that alienated casual users and by failing to address many of the concerns of web developers, thus providing virtually no incentive for anyone to upgrade to it or develop for it. They also tied IE7 too tightly to Vista, which has itself been an utter failure, so Windows XP and IE6 are still shipping on many (possibly even most) new PCs.

Unless Microsoft relearns how to develop usable, marketable software, it won't matter how good IE8 is or how soon it arrives, because web developers will still have to develop for the lowest common denominator.

War Rocket Ajax takes a hit

Friday November 30, 2007 @ 09:06 PM (PST)

Driving home on highway 101 during rush hour every evening is a lot like playing with fire, only not nearly as much fun, and when you get burned it costs a lot of money. It sure does light up the night sky real pretty though.

Tonight, just as I was settling into my evening commute, the car in front of me hit the brakes, I hit my brakes, and the guy behind me hit his brakes. None of this is really newsworthy, since it happens about 18 times a second on the 101. What made it interesting was the guy behind the guy behind me, who didn’t hit his brakes. Car #2 and I came to a complete stop, but car #3 hit car #2 hard enough to slam him into me, creating a nice car #2 sandwich. Car #2 hit me so hard the impact actually knocked the hat off my head (the driver of car #2 later told me that his hat ended up in the back seat).

As car #2 and I limped to the shoulder, car #3 caught fire.

There happened to be an ambulance a few hundred yards behind us. It joined us on the shoulder and the paramedics called the fire department. By this time, the other two drivers and I were exchanging information and watching car #3 burn as traffic swerved to avoid it. The paramedics seemed strangely disappointed that none of us was injured and had us each sign a statement saying we had refused care and wouldn’t sue them. Lovely society we live in. Meanwhile, car #3 burned bigger and brighter and there wasn’t much we could do about it.

After another ten or fifteen minutes, two fire engines arrived nearly simultaneously (one from each direction) and the firefighters had the fire out in a jiffy. They were followed shortly by a CHP officer, who began trying to figure out how to get the mangled, smoldering wreck out of the middle of the highway. What they ended up doing was brilliant:

The firefighters attacked the wreck with their axes, pounding down the crumpled hood and peeling back protruding bits of metal to make enough room for one of them to squeeze into the driver’s seat. Then, after stopping all five lanes of traffic on the 101, the cop got in his cruiser, nudged up against the wreck from behind, and floored it. There ensued a cacaphony of squealing tires and a cloud of smoke, and somehow the firefighter managed to steer the wreck (with wheels pointing in opposite directions) onto the side of the road. It was great fun to watch.

This was followed by lots of boring statement-giving and report-taking. Luckily the damage to my car was minor and seems to have been limited to the rear bumper, so I was able to drive home. The guy in car #2 was also able to drive away, but just barely, and accompanied by a lot of unhappy grinding noises. Car #3 wasn’t going anywhere, so I assume he waited around for a tow truck.

Now I get to deal with insurance and hope my headache (which existed before the accident, but which the accident didn’t help) doesn’t get worse.

Gaia Online is doing awesome things with LazyLoad

Wednesday November 28, 2007 @ 11:42 AM (PST)

Jakob Heuser wrote to let me know about this big meaty blog post describing how he and the other folks at Gaia Online have implemented an impressive just-in-time CSS and JavaScript loader based in part on LazyLoad.

They've made some very nice improvements (such as replacing LazyLoad's queue-based loading with method chaining, which ends up being much faster) and fixed some bugs, all while keeping the library down to a slim 5.6K (minified) without any external dependencies. Very nice.

Copyright © 2002-2008 Ryan Grove. All rights reserved.
Powered by Thoth.