Searching for the perfect personal checks or business checks? Then stop on by and check out our latest niche search engine for checks Checks Please. We’ve collected all the best checks you can find online in one convenient search engine.
Warning: New Relic May Bring Down Your Rails App
March 10th, 2009
Just found out the hard way that if your Rails app can’t contact New Relic, it blocks your mongrels and brings down your app. Teenormous t-shirts is hosted on Slice Host and I believe there were network connectivity issues between my slice and New Relic and I was not the only one.
First Rule Of Monitoring: Do not bring down the application!
Needless to say, New Relic will most likely no longer be a part of my monitoring solution.
UPDATE: The issue appears to be related to DNS resolution at New Relic and there is a work around to prevent DNS lookup by hard-coding the IP (http://support.newrelic.com/discussions/support/480-why-didnt-you-announce-the-problems-with-rpm-this-morning). The folks at New Relic saw this post and setup a conference call to discuss the issues. I am impressed with this level of customer service. They believe New Relic will no longer cause issues for an application now that the DNS issues are resolved and they informed me they are actively working on improving the way this works in the application. Thanks to their impressive support and follow-through, I may give New Relic a try again in the future. For now, I am going to sit on the sidelines for a bit and only use it in development though.
Thinking Sphinx contributor
January 26th, 2009
I just noticed I am listed on the Thinking Sphinx contributors list!
All this stemmed from a post to the Thinking Sphinx mailing list related to facet support. Looking through the Sphinx code, you would be hard pressed to detect a lineage to my code but I must have contributed something to that final incarnation to deserve a credit.
Also, I noticed in a follow-up post I even got a “you rule!” for that same post. Just goes to show your voice can be heard.
Teenormous - A T-shirt Search Engine
August 30th, 2008
Teenormous.com is a t-shirt search engine which just went live yesterday. My friend Brian Pipa of Candy Addict fame and I have been cranking away for the past several months to make this happen. The site has almost 15,000 shirts already and many more features and t-shirts are on the way. Stop by and check it out. Feedback is welcome.
You can read the official announcement from the Teenormous blog.
has_many threads - Rails soon to be thread safe
August 18th, 2008
“Josh has been working on a Google Summer of Code project to bring thread safety to Rails and is just about ready to wrap it up. Rails 2.2 will be thread safe thanks to the work that Josh has put into it.”
Didn’t expect to see that great news inside here: http://weblog.rubyonrails.com/2008/8/16/josh-peek-officially-joins-the-rails-core That should deserve its own post.
I look forward to a Rails that is thread safe. I often have to work around any parallel tasks I run inside a Rails container by wrapping all Active Record calls inside a Mutex. It will be nice when that is not needed. Congrats Josh!
Bundle-Fu for combining Javascript and CSS
October 29th, 2007
Tim Harper just released an excellent RubyOnRails plugin called bundle-fu for bundling Javascript and CSS into one file. This is a really simple and powerful speedup gain you can add to your site to reduce the number of round trips to your server. The impact can be dramatic.
It does not do compression and Tim says:
Bundle-fu currently does not compress CSS or Javascript, as the speed gained by doing so is often marginal, at best.
However, I disagree with the “marginal, at best” part of that statement. Typically a JS file can be compressed upwards of 50% by just doing some simple JS compression techniques (you can also GZip the contents for an even bigger gain). For example, JQuery 1.2.1 uncompressed is 77Kb, and packed it is 26Kb and minified (Gzipped and packed) it is 14Kb.
That being said, I think its ok if bundle-fu does not add packing support since there are many different alternatives out there.
For example the new PackR plugin, a ruby port of Packer would complement bundle-fu nicely.
UPDATE: Less than two days after writing this post Tim updated Bundle-Fu to use the PackR plugin if it is installed. Impressive. You can read about it here.
Ajax Experience Boston Highlights
October 28th, 2007
Now that I’m back from the Ajax Experience Boston conference and had a little time to let the information settle, I would like to share some of the highlights. You can get the slides here for all of the presentations . Here are some thoughts on a few of the presentations that I found noteworthy.
Google Gears
Google Gears is a framework to allow you to store and retrieve information locally in a web browser. The main motivation behind this framework is to provide a way to allow web applications to still work without internet access. It makes perfect sense that Google is growing this framework since they are planning on using it with their apps such as GMail and Google Docs. It is worth noting that Google says this tool is not ready for production consumption at this time as it is just a developer preview.
Google Gears attempts a worthy goal of addressing a major flaw with web apps by providing a way for them to still work offline. However, there are two major drawbacks to this approach that may give you pause in choosing to use it:
- It requires your users to install a browser extension to work.
- It requires you to either implement your data access logic in pure Javascript using something like a REST api for the online mode, or you are required to implement your data access logic twice.
In addition, the implementation of Google Gears stores a local sqlite database so you will also have to manage versioning and upgrading any schema changes to that local database independent of your server application.
Google Gears provides a pretty novel approach to providing an offline mode to your web app. It should be interesting to see how this framework develops.
Javascript Frameworks and Libraries Galore
There were lots of great talks on a bunch of the major Javascript frameworks and libraries including, Prototype, script.aculo.us, JQuery, Dojo, ExtJS, and many others.
Prototype and Scriptaculous
Stuart Halloway of Relevance gave several great talks on the Prototype and Scriptaculous libraries. We both live in Raleigh, NC so I have had the pleasure of seeing him give a presentation before at a local Ruby meetup.
I have more experience working with these two libraries than any of the others that were at this conference since I found them by way of Ruby On Rails. As a result, I did not learn a whole lot of new information, but since Stuart is an excellent presenter I found these to be some of my favorite presentations. Some of the more interesting bits occurred during the Q and A. If you ever want to push his “rant” button, ask him about Javascript 2… very entertaining.
JQuery
I attended a couple of sessions by JQuery’s creator John Resig. When JQuery first came out I tried it out and was impressed by its elegance but ended up choosing Prototype and Scriptaculous since it was baked-in to RubyOnRails. However, nothing can beat seeing a presentation by the creator of a framework.
JQuery was a pioneer in using CSS selectors for accessing the DOM via Javascript. Many of the other frameworks have since followed suit. For example, to select all anchors that are within a paragraph tag you could do: $(’p a’)
I wasn’t looking for a new Javascript library to replace Prototype and Scriptaculous, but JQuery is a compelling alternative. Some of the main things about JQuery that speak to me are:
- It does not pollute the global Javascript namespace. This makes it really easy to combine libraries together. You can even use multiple different versions of JQuery together if you want to (not that I can imagine needing to but it is cool nonetheless).
- It has elegant and concise apis. When you obtain an element via the $(’some_el’) call, it returns a wrapped JQuery object that contains lots of JQuery methods to manipulate that element. In addition, most JQuery methods return JQuery objects so you can chain them together.
- It has a well-defined and actively used plugin framework. There are a bunch of great plugins. And because of the well-defined extension points, plugin methods are easy to find and blend well with the standard JQuery api. For example, to turn a form into an ajax form using the form plugin it’s as simple as: $(’someform’).ajaxForm();
- There is a JQuery UI project for UI widgets and an upcoming JQuery FX project for special effects. Also, the animation implementation used by JQuery is very efficient as it uses a single shared event loop rather than creating Intervals for each event.
Dojo
Alex Russell the creator of the Dojo Toolkit gave a talk as well. Unfortunately I was unable to attend due to a scheduling conflict with my co-worker, Ryan Breen’s, Ajax Performance Analysis presentation. During a panel discussion, the Dojo framework was referred to as “the kitchen sink” of the Javascript frameworks, so if you can’t find what you are looking for elsewhere there is a good chance you can find it in here.
Google Web Toolkit (GWT)
Chris Shalk gave a presentation on the Google Web Toolkit. GWT allows a developer to create an entire Ajax application from start to finish completely in Java. All of the Javascript and HTML are generated by Java.
One benefit of using this framework is that if you already know Java and don’t want to bother learning other technologies such as Javascript you can dive right in. In addition, you have all of the wide array of Java tools and debuggers available to help in your development. I personally don’t have a need for this framework but if you only like to write in Java this might be right for you. However, if that is the case I would highly recommend branching out and trying something new… you just might like it.
Closing Remarks
This was just a brief summary of the highlights of the conference off the top of my head. There were several other interesting technologies and presentations that I did not discuss since this post is already way longer than I intended it to be. All in all I would say this conference was an excellent way to catch up to date on the latest web development technologies.
Ajax Experience Conference
October 23rd, 2007
I am in Boston this week to attend the Ajax Experience conference.
My co-worker Ryan Breen is presenting a session on Ajax performance techniques. There are also several discussions from some of the heavy-weights in the Javascript world including Alex Russell the creator of Dojo and John Resig the creator of JQuery. Should be some interesting content and I am looking forward to it.
Netbeans Ruby and Rails IDE
October 16th, 2007
I just started playing with the NetBeans 6 Beta 1 Ruby IDE. I found out about it through George Cook’s excellent writeup which includes plenty of screen shots to spare you from having to install it to see how nice it is.
I must say I was blown away with how much better it is than my current setup of Eclipse and Aptana with RadRails. I’ve been using Eclipse for about 7 years primarily for Java development so it is no small feat to get me to even consider playing with NetBeans. However, after playing with NetBeans for Ruby there is no comparison. NetBeans is a clear winner over Aptana with RadRails.
A few random highlights include:
- Real code-completion that actually works. This includes some impressive class introspection that picks up you local class properties.
- Some handy short-cuts that let you jump from a controller action to its view and back, and from also from your code to your tests and back
- One of my favorites is that the rdoc information is shown as you type out method names. This is a huge time-saver so you don’t have to dig through some external resource for syntax specifics.
- A nice integrated SVN gui. This has been a big source of pain for me as well in Eclipse where SVN support is totally lacking
- A macro recorder
- An integrated database tool
- This project is very actively developed. When I first started using RadRails the development cycle was brisk and lots of new features were flying around. Ever since Aptana picked up the project development has ground to nearly a halt and what is there consistently crashes my Eclipse.
In addition, you can install just a standalone Ruby IDE bundle so you don’t need to grab the Java (or other) stuff if you don’t need it.
I am still not ready to take the plunge to use NetBeans for my Java development. However, thanks to this very impressive offering of a Ruby IDE there is now a glimmer of hope that I may try NetBeans for my Java development in the future.
Google Syntax Highlighter
October 11th, 2007
I just found a nice light-weight syntax highlighter called the Google Syntax Highlighter by Alex Gorbatchev. It is 100% client-side written in Javascript so it is extremely portable. I can already think of a few good uses for it starting with being the preferred highlight solution for this blog. This replaces the iG:Syntax Hiliter which is quite nice and powerful, but I am not nuts about the way it looks by default and too lazy to customize the style sheet. I went ahead and converted the last few articles to use it so you can see it in action below.
Also, if you happen to be on WordPress, you can just grab the Google Syntax Highlighter Plugin for WordPress.
Now on to creating some content that needs highlighting.
UPDATE: One pretty big drawback to this approach to highlighting is the code will not be highlighted until after the page loads. In the case of this blog, I am using the WordPress plugin so this highlighter is the last piece to run. This has resulted in a perceived load time for the blog that is much slower than if this highlighting was done server-side. As a result, I am probably going to move this blog back to a server-side solution with some customizations. I will share the details when I do.
It is worth mentioning that the Google syntax highlighter could probably be sped-up with a few customizations such as: bundling all the js in one file and compressing it, moving it higher up the load stack, and the Google Syntax highligher could be customized to render each element at load time instead of rendering the whole page at the end.
UPDATE 2: I am no longer using this plugin. I think the major slow-down is due to the multiple split JS files since each file blocks while executing. I switched to the Google Code Prettify which is much easier to use.
Subscribe to the feed!