Tue Mar 11, 2008

WMSHC Photos

Hmmm, I've noticed a little bump in traffic yesterday. I can't imagine why. Maybe people are suddenly interested in my techno-babble rants. Yeah, that's probably it!

Well, I'm a bit pressed for time this week. So you ain't getting all the photos just yet! But to appease the masses, here's a sampling. Hopefully I'll have the time to put the whole lot of them up before next Tuesday.

Click images to view larger versions.

image
image
image
image
image
image
image
image
image
image

Posted by: Sheldon Finlay on Mar 11, 08 | 12:10 pm | Profile

[6] comments (2053 views) |  [0] Trackbacks   [0] Pingbacks

#top


Thu Jan 24, 2008

Running Rails Apps in a Subdirectory

Rails likes to be run in the top root directory of a web site, such as domain.com/. It doesn't play very nicely if you try to deploy an app in a subdirectory such as domain.com/myrailsapp. Nonetheless, sometimes you just want to deploy a basic app within its own folder under your current domain. I managed to cobble together a simple solution taking bits and pieces from others who have gone down a similar path. I don't take credit for this method, I am just writing down what I learned in hopes that it might helps someone others caught in a similar predicament. This solution isn't enterprise level by any means. It doesn't leverage all the wonderful potential of using a mongrel cluster, load balancing, etc. One nice perk of this method is it doesn't require root access which is ideal for those using shared hosting. There's no changes to the httpd.conf file. Everything is configured on the development side.

Here's how I do it. Feel free to adjust it to your needs:

I set up my Rails apps in my root directory: /home/user/myapp . I like to keep my apps out of the public directory just in case things go terribly wrong. Last thing you want it someone downloading your database.yml file. Next, set up a rewrite condition in a .htaccess file within the web servers public directory (/home/username/public_html on my server):

RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^myapp http://127.0.0.1:8000%{REQUEST_URI} [P,QSA,L]


This basically tells Apache that any requests for domain.com/myapp should be forwarded to port 8000 which is where my Mongrel server is listening and ready to serve the Rails app. You'll probably have to change the port number for your Mongrel server.

Now if you have your Mongrel server running for your app (I'm not going to address that, there are plenty resources for setting up Mongrel) and you try to go to domain.com/myapp it will probably work (that is, be served by Mongrel and not Apache) but will most likely throw an error. The next step is to open the config/environment.rb file and add this line to the very end:

ActionController::AbstractRequest.relative_url_root = "/myapp"


This tells Rails to append /myapp to all the urls it creates in your views and controller. Without this, every link would be broken within your app. So you if fire up the browser you should be able to move though your app like normal (you may need to restart Mongrel since you made changed to your app). But you'll notice something is missing: your stylesheets, images and javascripts won't be loaded. Basically Rails isn't able to access anything from within the Rails public folder. This problem stumped me for a long while but the solution is quite simple:

Go to the public directory and create a symbolic link by typing:

ln -s . myapp


And that's it. Your app should work like normal from within the subdirectory. If you are using a Cpanel server that supports Rails, it will handle creating the Rails app, the .htaccess rewrite, and setting up the Mongrel process. All you have to worry about is the environment.rb edit and the symbolic link. Again, this isn't a scalable or robust solution by any means. I haven't tested it very extensively so there may be other ramifications that I just haven't come across. It also forces everything through Mongrel, including static content like Javascript, images, css, etc. Ideally we want Mongrel to handle the dynamic content and Apache to continue to serve out the static content. As I experiment with this setup, I plan on adjusting the rewrite rules to accommodate this. But for now, use it at your own peril.

Posted by: Sheldon Finlay on Jan 24, 08 | 10:48 pm | Profile

[0] comments (570 views) |  [0] Trackbacks   [0] Pingbacks

#top


Sun Sep 09, 2007

TrampCamp 2007

Forget Camp FaSoLa. The new hotness is TrampCamp. 2007 was the inaugural year for TrampCamp and our one camper/instructor (pictured) is already signing up again for TrampCamp 2008. Shouldn't you too? Learn backflips, frontflips, sideflips, flipflops and much much more. Find your inner Mary Lou Retton power animal. TrampCamp 2007 would like to thank our generous sponsor, Craigslist for helping us secure this 10 year old trampoline for $60 and enabling us to have a full summer of flipping fun.

image

Afraid of getting hurt? No Insurance? Never fear! Thanks to the marvel of YouTube's How-To videos, all our TrampCamp counselors are fully skilled in setting broken bones, relocating dislocated hips and shoulder sockets, applying ice packs and remedying all other common trampoline traumas.

Posted by: Sheldon Finlay on Sep 09, 07 | 11:02 pm | Profile

[5] comments (2422 views) |  [0] Trackbacks   [0] Pingbacks

#top


An offering of peace

My handlers have been busy fielding the bundles upon bundles of angry fan mail that I've been receiving in response to my last few blog posts. So to help control the backlash I offer to my faithful, albeit, restless fans this generous bouquet of parentheses ((())) and accompanying ubercute WMSHC baby photo. I trust that the healing has begun.

image

Posted by: Sheldon Finlay on Sep 09, 07 | 10:20 pm | Profile

[0] comments (990 views) |  [0] Trackbacks   [0] Pingbacks

#top


Mon Aug 27, 2007

Getting Highslide JS to assign an id to an iframe

After many days of working on a slick AJAX enabled video pop-up, I threw in the towel and decided to switch to using an iframe to call in the Flash video player. Ultimately, the end result is the same. The Ajax call was refusing to run the SWFObject which rewrites the div and embeds the Flash player. The window would open, but no video was present. The benefit of using SWFObject to embed the video far outweighs the benefit of using a true AJAX call for launching the videos. Iframe was the logical contingency.

The problem with using an iframe in Highslide was when the window was closed/hidden in IE, the video continues to play and the audio could be heard despite the fact that the video was not present. I tried various methods of rewriting the video div upon closing using getElementById, but these would end up breaking things when subsequent videos on the same page were played. I also tried reloading the iframe upon closing which would cause the video to stop playing, however since Highslide's instance of create.Element doesn't assign an ID, my efforts were met with further resistance by IE.

Ultimately, I ended up adding some code to highslide-html.js file telling it to assign an id to the iframe (~line 202, last line is my addition and assigns the iframe an id="videoframe") :


this.iframe = hs.createElement('iframe', { frameBorder: 0 },
{ width: this.objectWidth +'px', height: this.objectHeight +'px' },
this.objContainer);
this.iframe.id='videoframe'; // added to assign id


With this addition the Highslide generated iframe would now have an ID attribute which I could target with some simple DOM scripting telling the iframe to reload itself:


function reloadFrame() { // This reloads the iframe upon closing in order to stop video in IE
var objFrame = document.getElementById("videoframe");
objFrame.src = objFrame.src;
}


I trigger this event by appending it to the close text of my Highslide div. As the video is close the iframe is reloaded thus stopping the video from playing:



onclick="reloadFrame();return hs.close(this)



Now this code works for my purposes and gets around IE's quirky behavior. Ultimately, if you have multiple iframes you would need to assign them different IDs and would need to find a way to assign and pass the IDs dynamically. But hardcoding them in works for me.

Posted by: Sheldon Finlay on Aug 27, 07 | 4:45 pm | Profile

[11] comments (9512 views) |  [0] Trackbacks   [0] Pingbacks

#top


Fri Aug 24, 2007

Google! Woot!

Whoah! Two posts in two days. Maybe I should admit myself?

My morning routine is pretty much the same each day: Wake up, eat, workout, bathe, eat more, feed Tina, and check my Google standing in the world. I've done a lot of work getting KH exposure in Google (among others), so we're usually in the top spots for such keywords as knitting, learn to knit, knitting videos, etc. Google also sends us about 40% of our traffic everyday! So, today was extra nice as we're sitting in the #2 slot for knitting out of 20,300,000 possible results! Not too bad (although we'll probably bump down to 3rd or 4th in a couple hours. Hence the screenshot as proof!). If only I could find a way to knock about.com's knitting page from the top. Their placement is not their based upon the quality of their content but rather the ubiquity of their about.com domain and brand. Someday I will unleash my evil monkeys upon them. Someday about.com!

image

Posted by: Sheldon Finlay on Aug 24, 07 | 11:27 am | Profile

[0] comments (964 views) |  [0] Trackbacks   [0] Pingbacks

#top


Thu Aug 23, 2007

Work and Stuff

Well, I just got a non-spam comment to this blog (thank K) which sort of reminded me that this blog-o-thing exists and people occasionally stumble in here. I've been meaning to post something new and interesting for a while, so without further ado...

I've been getting quite absorbed in my work lately. The latest project I am working on (err, slaving away at) is Amy's fabulous web site: KnittingHelp.com. The site continues to grow in popularity and with each newbie knitter visitor I cringe. You see, the existing web site design was knocked out in a weekend in 2004. At the time it was just a pet project for Amy so I put very little forethought into the design and just created a unreasonably clean and simple design. It's a horrible design in my opinion, in both aesthetics and coding, with all sort of nasty nested tables and an atrocious image based navigation. Yuck! It such a shame to my design ideals!

Earlier in the year I set forth to create a new design, but the pressures of my day job quickly overtook that. But here we are at the cusp of a new knitting season and I decided a couple weeks ago to delve back into the new KH design as a last ditch effort to restore my dignity.

image

This is just a corner screen shot. I don't want to revel too much just yet. But here's some technical highlights of the new design:


  • Pure CSS and XHTML design coded to web standards and fully validating. Heck Yes!

  • CSS based two-tier navigation. You wouldn't believe how much work went into this part! I think I invented a new way of doing this, so I may release a tutorial when I have it cleaned up.

  • Ajax enabled goodness!

  • Takes advantage of some nice javascript libraries such as
    Prototype , Scriptaculous and Mootools

  • Videos are (slowly) being refilmed and converted to Flash and played through a psuedo-streaming Flash player. The new videos are much larger (480 x 320) and have better quality and sound with little increase in bandwidth overhead.

  • Videos are no longer displayed in a pop-up window but rather get displayed via an Ajax call through
    HighSlide JS. Very slick!

  • CSS themes! Boy knitters can choose blue themes and girl knitters can choose pink :) We'll probably have 4 to 5 separate color themes.

  • The new site is being build with Modx, a CMS and PHP application framework. This will make for nice an easy development and future management of the site, as well as the possibility of having other editors and contributors add content to the web site.



Well, that's it in a nutshell. As you can see the new KH is very technologically enabled and full of web 2.0 bling. At the same time, I am building the site to degrade elegantly in older browsers which might not support some of the advanced features. The goal is to make a elegant site that is accessible to everyone. The work to date has involved a lot of freshing and expanding of my skill-set as well as many nights working past 1:AM. I am thoroughly enjoying every challenge the re-design as presented and hopefully we'll be ready for phase one of the launch in a couple weeks.

Posted by: Sheldon Finlay on Aug 23, 07 | 10:39 am | Profile

[1] comments (1007 views) |  [0] Trackbacks   [0] Pingbacks

#top


Thu Aug 02, 2007

Happy Birthday to Me!

Posted by: Sheldon Finlay on Aug 02, 07 | 12:00 am | Profile

[1] comments (668 views) |  [0] Trackbacks   [0] Pingbacks

#top


Thu Jul 05, 2007

Pioneer Valley All Day Sing Photos!

Amy put the pressure on me to get these photos done sooner rather than later. So, without further ado, here they are:

Pioneer Valley All Day Sing Photos

Enjoy!

Posted by: Sheldon Finlay on Jul 05, 07 | 3:55 pm | Profile

[4] comments (745 views) |  [0] Trackbacks   [0] Pingbacks

#top


Fri Apr 20, 2007

New York Times Article

My contact at the New York Times emailed me this morning reminding me that the Sacred Harp article went live. I might have forgot, given how busy things are around here. The article is well written and it looks like they talked to a few of the right people. I was sort of nervous handing over my photos with the article sight unseen. The photo editor said they used two of my photos, but I only see one online. Maybe the other is in the print edition.

Link Here

Postscript: I guess the print edition has two images. I'll have to pick up a copy when I go out today. Not sure which image they used for the second one.

Posted by: Sheldon Finlay on Apr 20, 07 | 12:21 pm | Profile

[1] comments (1530 views) |  [0] Trackbacks   [0] Pingbacks

#top


  NEXT page