Twitter Said To Be Abandoning Ruby on Rails

There was always a mess and confusion around the scaling abilities of Rails.

We’re hearing this from multiple sources: After nearly two years of high profile scaling problems, Twitter is planning to abandon Ruby on Rails as their web framework and start from scratch with PHP or Java (another solution is to stick with the Ruby language and move away from the Rails framework).

.. as it was written yesterday on Techcrunch.

On the other hand, David Heinemeier Hansson (creator of Ruby On Rails) wrote a post on Loud Thinking (his personal Blog) about the scaling opportunities of the framework.

Well, I am about to dig deeper into this very exciting question and share my experiences.

UPDATE: Just got noticed by Arnold Funken on Twitter:

Element.Update(), flash and IE7

Yesterday I run into an issue with IE7 again (well, I assume not too many of you are surprised, ehh).

When I was trying to move an element in the DOM (actually update) with an other element’s innerHTML including a flash object, the movie (.swf) forgot to load. Right clicking on the flash file you can see the following message, greyed out:

“Movie not loaded”

This is an example snippet of the code:

<div id="container"></div>
<div id="video">
	<object width="184" height="140" type="application/x-shockwave-flash" data="/videos/15.swf" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">
		<param name="movie" value="/videos/15.swf"/>
		<param name="bgcolor" value="999999"/>
		<param name="quality" value="high"/>
		<param name="allowScriptAccess" value="always"/>
		<param name="allowNetworking" value="all"/>
	</object>
</div>
 
<script type="text/javascript">
	$('container').update($('video').innerHTML);
</script>

Using IE7, Prototype 1.5 and Flash Player 9 on Windows XP.

This problem does not seem to occur in normal browsers (like Safari or Firefox), they load the movie file perfectly. I thought it would be good to share with others, maybe you guys know a workaround, or I can warn others before they will have to face the same problem.

Safari 3.1 and Prototype conflicts

Apple has shipped the new version of Safari last week, which has enhanced usage of JavaScript. From now on Safari 3.1 natively supports getElementsByClassName, which is good, Safari can process and execute this function even faster than before. The upcoming version of Firefox also implements native support. Good. Performance upgrades are always good, and even more welcome nowadays in our ‘ultra-interactive’ web of 2.0 applications.

But on the other side, this causes issues for Prototype-based websites, there is a conflict between the native and the Prototype methods, which both have the same name.

For example if you are accessing a bunch of elements like this:

$('foo').getElementsByClassName("bar").each(Element.hide);

It will not behave like it did before. Hmm. You do not need to scream and shout now, until the Prototype team comes out with a solution you can still use this syntax:

$$("#foo .bar").each(Element.hide);

Easy, huh? So be aware that your sites may be broken for Safari users and replace the affected lines with the workaround mentioned above.

Rails 2.0 is finally out

Yes, you are right. It is finally finished after about a year in the making. This is a fantastic release that’s absolutely stuffed with great new features, loads of fixes, and an incredible amount of polish. So let’s digg into the new features and everybody: update your stuff to get even more funky!

Update details can be found here.

Custom cursor “bug” in ActionScript3

If you ever want to use a custom mouse cursor in AS3 (for say dragging) with rollover/rollout events toggling it (so it will only change the cursor for certain movie-clips), bear this in mind:
When the user moves the mouse to the right with a certain (slowish) speed, the (original) hidden mouse cursor will go over the custom cursor, so it will fire the rollout event. Then when Flash updates the custom cursor position, the original mouse cursor won`t be over the custom one anymore, so it fires the rollout event, thus the cursor blinks quite noticeably. And no, the event.updateAfterEvent() won`t help either.

The workaround for this is to add the MouseEvent.MOUSE_MOVE listener to the stage and watch the event.target in the handler function and toggle the custom cursor using that, so you can specify that Flash shouldn`t do the toggling (= keep the custom cursor on) when the mouse goes over it.

So it isn`t necessarily a Flash Player bug, because this behavior makes sense (the mouse updates much more frequently than the .swf), but well annoying to figure out anyway.

eclips3.media (ECLM) TextMate Theme

I usually check several development forums and I’ve found a thread on Rails Forum about development environments where people share a screenshot about their tools. I did this too, after several examples. Since my TextMate Theme got so many respects I decided to share it with the public.

One of its main benefits is that it separates the different data structures, functions, variables, comments, etc. So it is easier to look up your code.

Development Environment

So, if you like it, it can be found here.

Copyright: This theme was originally improved from the one what we can see in Ryan Bates’ Railscasts.

Flash textfield height error using device fonts

I`ve ran into a rather annoying bug today, if you want to use either the _height or textHeight property of a textfield using device fonts and set to autoSize, it`ll add a phantom line, so will report the heights as if there was an extra line in the textfield.

The fix for it is quite random as well, you have to ADD a “\n” (=new line) at the end of your text and whooops, the phantom line is gone.

Problems with RMagick 1.5.x

Last week one of our webistes went down for some unknown reason, and I’ve found this kind of error message in production.log:

LoadError (Expected xy file to define ...)

Of course this is a useless error message which means Rails couldn’t find a controller file which has been still at its proper path of course. What to do now? If you need a more detailed error log, there is a solution to force Rails to log errors in deeper detail, just set your caching classes to true in your environment.rb file:

config.cache_classes = true

After restarting the webserver, and reloading the page, I could get a proper and useful error message, Rails pointed that the error is in RMagick gems. Take a quick look on the new error message in the log:

RuntimeError (This version of RMagick was created to run with ImageMagick 6.3.3
but ImageMagick 6.3.6 is installed on this system. You should either
1) Configure and build RMagick for ImageMagick 6.3.6, or
2) download ImageMagick 6.3.3 from file:///usr/local/share/doc/ImageMagick-6.3.3/index.html and install it.
):

Now this is something what you can use to start debugging. After reinstalling RMagick, the problem has been solved, and the site was up and online again. Just do the following 3 easy steps:

gem uninstall rmagick
gem install rmagick
apachectl restart

Done, hoorraaay!

Rails goes v2.0, shortly

Behold, behold, Rails 2.0 is almost here. Take a quick look here to check out the new killer features. There is a preview version available as well. Must be seen!

Update:

This morning (November 29th) the Rails team has released RC2 so if you are a freak who is keen on the latest builds and wants to check out RC2 - use the svn checkout command of:

svn co http://dev.rubyonrails.org/svn/rails/tags/rel_2-0-0_RC2 vendor/rails

The people who make websites

In April 2007, A List Apart and An Event Apart conducted a survey of people who make websites. Close to 33,000 web professionals answered the survey’s 37 questions, providing the first data ever collected on the business of web design and development as practiced in the U.S. and worldwide. Now  the results just became public.

The findings they present here have never been seen before, because until now, no one has ever conducted public research to learn the facts of our profession.

Take a quick look at the website, read the article and check out the results which are available in different formats, such as Adobe PDF. (1.6 megabytes)