December 2007 Archives

Resolution Recap

A year has passed so it's time to look at how I did resolution-wise:

  1. Get things done: I've finally figured out my system. It's a modified version of Zen To Done and it's paper-based. I never did bother learning PHP. I'm not perfect, but I'd consider this one met.
  2. Reduce my Mountain Dew consumption to one can a day: I started the year out really well. Until maybe July, I was Mountain Dew free. Then I started drinking them again. Irregularly—once a week—until October and then full tilt until now. I'm up to about three cans a day and then miscellaneous soda as needed. Not surprisingly, I've inched above 200 pounds again so this one will likely make a re-appearance in this year's set of resolutions.
  3. Stop the fighting: it's gotten better but I wouldn't say that it's been met. Plenty of room for improvement.
  4. Reread Atlas Shrugged: got to Galt's speech and my motivation just fizzled.
  5. Develop a Web application: hooked up with my cousin and we've got a great idea. I frittered away most of 2007 not writing code in Python and Django until I realized that I should just bite the bullet and develop in what I know: ASP.NET. Now that I've made that decision, I have made some progress but it's just not enough. I must finish the app in 2008.
  6. Start saving money: negligible. I'm counting this one as a failure.
  7. Re-carpet the downstairs: we're getting estimates in January, so fail.
  8. Blog more: I started the year off quite strong on bblog but ran out of steam pretty quickly. I may move this blog to Wordpress or I may split it into a philosophical/political blog elsewhere and focus this one on coding and business.
  9. Get Phoenix history site rolling: does killing wiki spam count? If so, then I was a big success.
  10. Simplify my life: yes, I would say that I have. The garage is vastly improved, I've shed a lot of obligations, and I've never been happier. 2008 will focus on simplification again though because there's plenty of complication still remaining.
  11. Do something romantic at least once a week: I probably did, but not consciously so. I count this as a failure.
  12. Keep library fines under $5: I think I kept it under $10 total. Frankly, given the poor performance of the past, I'm considering this a technical win.
  13. Go the entire year without a traffic ticket: made it. Technically, I have one photo radar ticket but it was mistakenly issued to me even though I wasn't the driver. I'll leave it at that.

So by my count, I achieved four of the thirteen resolutions. That's pathetic and reflects my general laziness of the last year. I've been working hard the last six months or so and I just haven't been terribly motivated in the rest of my life because of that. But that's an excuse and it's not going to fly in 2008. I'll craft my new resolutions probably tomorrow.

Javascript Splice Ain't Remove

I wanted to remove an item from a Javascript array and looked in vain for a remove function. I did find an implementation of remove using the Array.prototype but I just needed a function to get rid of items that matched a specific criterion.

That's when the trouble started. The splice function—calling its array.splice(index, count) variant—will indeed remove an item or items from the array (and return an array of the items removed for some reason) but it also closes the void left by the removed item and resizes the array all in one fell swoop. So code like this doesn't work as you'd think:

for (var i = 0; i < array.length; i++)
{
   if (array[i].someParameter == "someValue")
   {
      array.splice(i, 1);
   }
}

Since array.length changes with each removal, this code will end up missing some items because it will end too quickly. In the interest of saving future Googling, frustrated Javascripters, here's how I solved the issue:

for (var i = array.length - 1; i >= 0; i--)
{
   if (array[i].someParameter == "someValue")
   {
      array.splice(i, 1);
   }
}

By starting the loop from the top of the array and working backwards, item removals and the dynamic resizing have no effect. If anyone has a better way, I'm all ears. Well, eyes.

Review of High School Musical

Frequently, I find myself shaking my head at kids today. I'm not quite to the point of requesting them to stay off my yard, but it's getting closer and closer. The females dress more and more risqué, the males more punky. The music seems insipid, though I know that that's always been the case. In my more reasonable moments, I consider that there have always been elements of banality and senselessness in every generation.

But then I see a movie like High School Musical and I think that maybe things are getting worse. It makes Mean Girls look like high culture. It trades in every stereotype in the book and wraps its plot (such as it is) in tired bromides. And it is totally lacking in character development. The leads are a consummate bookworm who can't be bothered to put the book down during a New Year's Eve party and a basketball jock who spends his whole vacation practicing.

But then they're paired at the party for a random karaoke and suddenly it's as if they've been on the Mickey Mouse Club their entire childhoods. They don't need the karaoke machine, their voices are pitch perfect, and they riff off each other as if they'd practiced. But alas their vacations are concluding and they'll likely never see each other again. Except, lo and behold, she's just transferred to his school in Albuquerque!

I won't spoil the rest of the movie because a) I kind of have already forgot a lot of it and b) you shouldn't really care. I generally agree with Kathy Sierra's admonition but there's only so much you can take. I think it's safe to say that HSM is the Bill & Ted's Excellent Adventure of this generation.

About this Archive

This page is an archive of entries from December 2007 listed from newest to oldest.

November 2007 is the previous archive.

January 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Feedback to