shorepound.net

August 19th, 2008

Facebox and IE7: Stack Trace Overflow

Posted by nathan in Tech

In our latest release of City Cliq, we became more and more dependent on Facebox for previewing and editing Cliq Sites. As we continued development, and with subsequent browser testing, we noticed that IE7 was giving us a “Stack Trace Overflow” error, while Safari and Firefox were handling all of our code gracefully [as always].

Unfortunately for me, I was given the task of resolving this issue. I have been tackling browser compatibility issues for more than a decade, so the delegation was an easy one. I am happy to say that I resolved the issue with the same ease, though it took a bit of digging.

I finally found some relevant information on the Facebox web site, where it is advised to load all of your dependencies before you make any Facebox calls. We have several scripts that run in our edit and preview screens and it wasn’t until I read the dependency issue that I decided to start pulling out and rearranging script calls to isolate the ‘Stack Trace Overflow’ problem in IE7.

As it turns out, we were loading our application.js file after we loaded our facebox.js file. For those of you who keep up with Javascript and specific browser implementation of Javascript, you will know that IE7 uses a more propriety version of Javascript in it’s browsers called JScript. Big surprise there, eh? This is why Firefox and Safari were not having any problems with the Stack Trace: IE couldn’t handle the requests being slightly out of order (they are all there at run time, IE, quit being a baby) hence the IE only error.

Cliff Notes: IE will take a big dump at run time if you attempt to run any scripts that references the Facebox.js file. Just to be safe, render all of your JS files, and render your Facebox.js file LAST.

I could really use a Rum Drink right about now.

August 11th, 2008

Oops

Posted by nathan in Tech, Life

July just flew right by without a single blog posting. How about that? Needless to say I have been plenty busy with the latest version of http://www.citycliq.com.

The site is written with Ruby on Rails, Haml, and Sass. This was my first full on Rails project, and I must say I hope to have more.

On a personal note, I have been riding the long board as much as possible, because that is all I have been able to ride around here lately. It has been quite flat. The fishing has been great, but I would prefer more surf.

Donovan starts kindergarten next week, which is VERY exciting!!! My little guy is growing up so fast, and I couldn’t be more proud.

Ok back to work.

June 26th, 2008

Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org

Posted by nathan in Tech

I was getting the error above recently anytime I would try to run script/server or script/console in Terminal, all the while I was running RubyGems 1.2.0. It took a few hours to track down the problem(s). At first I thought I had caused the error (read my previous post about hacking conf files), but as it turns out Apache and Mongrel can run side by side with no problems. I can run a static html site at http://localhost while running a Ruby on Rails site at http://0.0.0.0:3000. Pure awesomeness! But I didn’t know that until now. Back to the solution.

I googled and googled and finally found a meaningul post on the Rails forum. Here’s the thread: http://railsforum.com/viewtopic.php?id=14850 The last post was what helped me the most.

I ran sudo port uninstall readline and sudo port uninstall ruby successfully, then tried to boot Mongrel by running ruby script/server. Mongrel tried to boot, but failed. Hey, I was happy with that! By reading the stack trace I found that I was missing a few gems for my project.

After installing these gems, everything was working again. What a week. Thankfully tomorrow is FRIDAY!

June 24th, 2008

How to set up a local development site on a Mac (OS Leopard & Apache)

Posted by nathan in Tech

Steps to set up a local development site if you have TextMate:

  1. open Terminal
  2. type: cd / and hit return (you are now in the root folder)
  3. type cd private/etc/apache2/ and hit return
  4. now type mate httpd.conf and hit return. this will open the conf file in textmate
  5. locate the <Directory> node and change this line ‘Deny from all’ to ‘Allow from all’
  6. edit this line: < DocumentRoot “/Library/WebServer/Documents” > to read: < DocumentRoot “/Users/yourusername/sites/YourSite” >
  7. change < Directory “/Library/WebServer/Documents” > to read < Directory “/Users/yourusername/sites/YourSite” >
  8. save the file
  9. now in terminal, type sudo apachectl stop and hit enter (this will stop the apache web server)
  10. now type sudo apachectl start and hit enter to restart the web server
  11. create YourSite folder in /Users/Sites/ and add html files
  12. open your favorite web browser and navigate to http://localhost

If you don’t have TextMate, you have to be a little more tricky…

  1. open Terminal (Utilities > Terminal)
  2. close TextEdit if you have it open (Very important)
  3. type: sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit
  4. open Finder and select the Go menu > Go to Folder
  5. type /etc
  6. select the apache2 folder
  7. right click (ctrl click) the file named httpd.conf
  8. select ‘open with’ and then find TextEdit and select it
  9. locate the <Directory> node and change this line ‘Deny from all’ to ‘Allow from all’
  10. edit this line: < DocumentRoot “/Library/WebServer/Documents” > to read: < DocumentRoot “/Users/yourusername/sites/YourSite” >
  11. change < Directory “/Library/WebServer/Documents” > to read < Directory “/Users/yourusername/sites/YourSite” >
  12. save the file
  13. now in terminal, type sudo apachectl stop and hit enter (this will stop the apache web server)
  14. now type sudo apachectl start and hit enter to restart the web server
  15. create YourSite folder in /Users/Sites/ and add html files
  16. open your favorite web browser and navigate to http://localhost

References:
Forbidden 403 Error
Giving TexEdit root access for locked files

That was a giant pain in the ass, wasn’t it?

Oh but there is still more! You have to right click on your site folder and Get Info. Grant ‘Everyone’ read access, and make sure you allow all of the items in the folder to inherit these permissions. Click the settings icon at the very bottom of the Info window to do this.

Now you’re done!

June 12th, 2008

Donovan the Graduate!

Posted by nathan in Life

Donovan graduated from Pre School last week. As always, we are very proud of him. He can’t wait to start Kindergarten; hopefully he will be accepted at Atlantic Beach Elementary School (A+ school just steps away from the ocean). I sent in the paperwork for ‘Special Assignment’ yesterday and it looks like he has a good chance of getting in.

Grad Pics

May 14th, 2008

Haml and Sass

Posted by nathan in Tech

I will be working with these two new technologies to create a new web site in the works. To save time, instead of me explaining in depth how these technologies work, here are some links:

Haml

Sass

These two gems work with Ruby and other open source languages to help save time and streamline coding.

The Haml is used to create XHTML in a fast and efficient way, while the Sass does the same thing, but for CSS. Sass (Strictly Awesome Style Sheets) is insane! The inheritance is easily understood as the indentation of elements (parents and children alike) make it easy to reduce redundancy in the style sheets, and also in your XHTML (Haml) by using variables and constants.

I am getting ahead of myself here, so I’ll get back to coding and enjoying some refreshing work!

One last thing: I’ll be getting a Mac lap top in a few days, so I will be working on a Mac OS, programming for non windows application servers and such. I am excited beyond words.

April 9th, 2008

Back to work!

Posted by nathan in Tech

In an effort to make our company web site more search engine friendly, I am currently in the process of incorporating a URL Rewriter to re write the query string to something that google or any other spider might find more appealing.

Instead of this:

http://www.yellowpagesunited.com/yellow_pages/search.aspx?heading=Insurance&coname=&city=Atlanta&citySelect=&state=GA&zipcode=&recsPerPage=20

I hope to have something like this:
http://www.yellowpagesunited.com/yellow_pages/search.aspx/Insurance/Atlanta/GA/20

Further, I will create relevant content on my pages based on that string.

SEO, better late than never!

April 9th, 2008

Dear Gus,

Posted by nathan in Life
I miss you buddy! : (
March 12th, 2008

2008: so far, so good

Posted by nathan in Tech, Life

All things considered, 2008 has been pretty good so far. I’ve been doing some really great freelance; so much that I am on the verge of finally purchasing a lap top and a wireless router so that I can work outside or on my couch instead of in my office/bedroom.

Eventually I would like to make my spare bedroom an official office, but that will have to wait.

After a few more projects are completed, I will be in the perfect position to outfit that room with a new desk, bigger filing cabinet, and a nice ergonomic chair.

I love building web sites. I love my house. I might as well be comfortable doing what I love, right? It’s time to upgrade, for sure.

January 31st, 2008

C# Web Services: Parsing Ruby Generated XML

Posted by nathan in Tech

I know, I know; Web Services are so old, but hey, they work. This is my first time really developing one, and much to my surprise the experience has been rewarding. Once the final product is released, I will discuss it in further detail. For now, let’s just say that the web service parses an XML document generated by a separate Ruby application so that data integrity is maintained within two separate object oriented systems (one written in Ruby, one written in C#) via this middle tier application, or service.

Next Page »