Aug 15, 2006  -  Comments

Weeks and months of pining and wishing have finally come to fruition. Thanks to the Georgia sales tax holiday at the beginning of August and the back-to-school iPod promotion, I was finally able to justify dropping $1300 on a tiny white laptop.

Never before have I been happier with a purchase (since I bought my iPod). I have absolutely no "buyer's remorse." I was talking to a coworker shortly after my purchase about the frame of reference when it comes to prices for purchases. Most people don't think twice about spending $1000+ for a desktop or laptop computer, but when contemplating buying a game console or an appliance for $300-$500 the majority of people will think and rethink about whether to buy. It's very odd.

The event that started my Mac addiction happened around March of this year. We needed to hire another person at Plexus to help me out because we had more work than I could handle. Well, that involved buying a new computer for the extra person. El Presidente offered to give him my old PC and buy me a new Mac Mini and, of course, I jumped at the opportunity. It was a bit different getting used to OS X at first, coming from the world of Windows. I got the hang of it pretty quickly and immediately saw the benefits of the Mac over the PC. Since then I've wanted an Apple, and two weeks ago the dream became a reality.

Tagged: apple

OS X Leopard to have Ruby on Rails

Aug 09, 2006  -  Comments

I received a jubilant email today from Shawn that contained a link to this article officially announcing that Mac OS X Leopard will indeed be shipped with Ruby on Rails pre-configured.

For anyone who's followed these great directions to get RoR up and running on a Mac knows that it takes a fair amount of time and a good bit of focus to get everything correct. Having everything pre-installed will save many people a great deal of aggravation.

On top of having Ruby and Rails in the box, they've promised other packaged goodies like Mongrel, a Ruby alternative to Apache that I've heard is much more efficient.

It's not like I needed another reason to look forward to the OS X update, but now I'm truly excited to get my hands on Leopard.

Tagged: applerails

Why Ruby on Rails is better than .NET

Jul 10, 2006  -  Comments

For the past four days at work I've been assigned to apply a redesign to an older .NET site that we did a couple of years ago. It has been infuriatingly frustrating trying to apply a CSS-based design to a table-based .NET site. The way .NET handles almost everything is so convoluted and esoteric that it took me a full day just to get the hang of how it handled displaying markup.

And what is the deal with the datagrid?!?! It's great on paper, but crap in practice. Just the datagrid definition spanned five lines. Using the AlternatingItemStyle tag to get alternating styles for the table rows is ok, but Rails makes it SOOOO much easier with the cycle method. And speaking of styles, the datagrid has to have each style that you'd like applied declared seperately which makes for the huge datagrid definition. Also, take a look at the HTML that a datagrid produces. You'll be surprised at how much markup it can create for a simple <td>.

Now, don't get me wrong. I can see where .NET would be useful and I'm sure there are a ton of examples where it would make much more sense to use .NET than Rails. I think my biggest problem is that I know almost nothing about .NET. I can get by with making visual changes, but I stay far away from the codebehinds.

Closing thoughts: give Ruby on Rails a try! You might just like it!

Tagged: rails

Lightbox JS 2 hacked for AJAX

Jun 23, 2006  -  Comments

At work today I was given the task of implementing Lightbox JS v2.0 on our new website. To its credit, it was extremely easy to get working... almost too easy.

Of course, that's when I encountered a problem. On our portfolio detail page, Shawn put in a neat little AJAX slider for viewing the pictures of each project. The problem arose because the pictures were being generated dynamically after the page had been loaded. For the Lightbox to work, it needed to know about all of the images as the page loaded. Any images generated after that wouldn't work correctly.

I looked around for awhile to see if I could find anyone else who had run into this same problem that maybe had found a workaround. Well, I found several people who were having the same problem, but no one had solved it yet. So, against all odds, I started poking around in the code to see if I could maybe get something working. Below is my step-by-step solution.

First of all, I edited the .js file. Take the following chunk OUT of the file. Delete it, comment it out, whatever. The code is located in the start: function(imageLink) block.

// if image is NOT part of a set..
if((imageLink.getAttribute('rel') == 'lightbox')){
  // add single image to imageArray
  imageArray.push(new Array(imageLink.getAttribute('href'), imageLink.getAttribute('title')));			
} else {
  // if image is part of a set..
  // loop through anchors, find other images in set, and add them to ImageArray
  for (var i=0; i<anchors.length; i++){
    var anchor = anchors[i];
    if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))){
      imageArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title')));
  while(imageArray[imageNum][0] != imageLink.getAttribute('href')) { imageNum++;}

Notice: This breaks the ability to add images to a set and cycle through them from within the Lightbox.

The next step is to initialize the myLightbox object. Put the following code at the top of the page that you'd like to use the Lightbox (or alternately, you can just call it in the <head> section).

<script type="text/javascript">

Update: IE will throw an error if you put the above line of code in the middle of a page. The page must load fully before it will successfully evaluate the JavaScript. So, just put the call at the end of all your code.

And last, all we need to do is to call the start() function to make the magic happen. I'm using Rails, so this is how I did it:

<%= link_to_function image_tag('/images/thumbnail.jpg'), "myLightbox.start('/images/fullsize_picture.jpg');" %>

And just substitute /images/fullsize_picture.jpg with the actual path to your image.

I hope this can help someone else out.

Tagged: javascriptlightboxajax


Jun 16, 2006  -  Comments

One of the things I had hoped to be able to do with Rails for this blog was to create an RSS feed. I briefly looked at the chapter that describes how to do this in the Rails Recipes book and kinda decided put it off until later.

Well, after seeing that Adam added an RSS feed to his blog and even provided the steps he took to accomplish it, I decided to finally implement it. It turned out to be a lot easier than I thought.

So, if you're really bored often, go ahead and subscribe.

Tagged: railsrss