Sunday, May 25, 2008

ExtJS Ajax Request and Rails Authenticity Token

I was testing out ExtJS with Rails 2.1. As I was making a POST request to the server, I get an ActionController::InvalidAuthenticityToken. It's bugging me for a little while until I get to this site. I made my own fix and put the following code in the header part of my layout after ExtJS has been loaded:

Ext.Ajax.extraParams = { authenticity_token: "<%= form_authenticity_token %>" };

And everything is working for me.

Wednesday, July 4, 2007

Capistrano 2.0 Preview 4

I am such a chicken. I very much wanted the next release of Capistrano to be the official “Capistrano 2.0” release. But as I watched the changelog grow, I started to get cold feet.

Thus, tonight I announce the fourth (and final, hopefully!) preview release of Capistrano 2.0. As before, you can grab it from the Rails beta gems server:


gem install -s http://gems.rubyonrails.com capistrano

The following items are just some of the changes new in preview #4:

  • The deploy:symlink task works correctly now when run by itself.
  • Synchronously instantiate the gateway to prevent it being instantiated multiple times.
  • Use “which” instead of “test -p to test whether a command exists on the path.
  • The :hosts and :roles keys can now accept lambdas, to lazily select which hosts or roles a task uses.
  • Versions of Net::SSH prior to 1.1.0 work with Capistrano again.
  • Variable accesses are now thread safe.
  • The deployment code is now locale-independent, so that the revision is parsed correctly even if your computer is using a non-English locale.
  • You can now pass :on_error => :continue when defining a task, so that any connection or command errors that occur during the task’s execution will be ignored, allowing the task (and subsequent tasks) to continue.

You can see the entire list of changes in the CHANGELOG.

So, give it a go. Try it out. Post your feedback to the Capistrano mailing list. I’d love to release cap2 final next week!

P.S. If you are on a Windows machine, and you get Zlib errors trying to install the Capistrano gem, try this. Find the rubygems/package.rb file (wherever it happens to be in your Ruby installation), open it up, and find the zipped_stream method. Then, replace it, wholesale, with the following:

1
2
3
4
5
6
7
def zipped_stream(entry)
entry.read(10) # skip the gzip header
zis = Zlib::Inflate.new(-Zlib::MAX_WBITS)
is = StringIO.new(zis.inflate(entry.read))
ensure
zis.finish if zis
end

That seems to do the trick for me; let me know if it doesn’t work for you.

Source

Tuesday, July 3, 2007

jQuery 1.1.3: 800%+ Faster, still 20KB

I’m pleased to announce the release of jQuery 1.1.3. After many months of testing, developing, and more testing, we have a very solid release available for download. It comes with roughly 80+ fixed bugs and a handful of enhancements for good measure. Highlights include:

  1. Improved speeds, with DOM traversal over 800% faster than in 1.1.2.
  2. A re-written event system, with more graceful handling of keyboard events.
  3. A re-written effects system (with an accompanying fx test suite), featuring faster execution and better cross-platform support.

Download:

As always, if you find any bugs with this release, please post them to the jQuery Bug Tracker.

1.1.3 Features

Massive Selector Speed Improvements

Due to popular demand, we dug deep and made some major changes to jQuery’s selector engine. Here’s a breakdown of the speed improvements that were made to jQuery itself. All numbers are based on the SlickSpeed test suite.

Browser jQuery 1.1.2 jQuery 1.1.3 % Improvement
IE 6 4890ms 661ms 740%
Firefox 2 5629ms 567ms 993%
Safari 2 3575ms 475ms 753%
Opera 9.1 3196ms 326ms 980%
Average improvement: 867%

Additionally, we tested the improved code base against some of the other popular selector libraries, again with the SlickSpeed test suite.

Browser Prototype jQuery Mootools Ext Dojo
IE 6 1476ms 661ms 1238ms 672ms 738ms
Firefox 2 219ms 567ms 220ms 951ms 440ms
Safari 2 1568ms 475ms 909ms 417ms 527ms
Opera 9.1 220ms 326ms 217ms 296ms 220ms

A couple things to notice when looking at the speed suite results are that:

  • We’re over 800% faster than we were in jQuery 1.1.2.
  • We’re the fastest framework in the most popular browser, Internet Explorer 6.
  • We’re the only framework that doesn’t give incorrect results.
  • And all of this comes at no expense to you — jQuery is still the same 20KB that you’ve come to expect and enjoy.

New Selectors

Unicode Selectors: This is a huge addition for those of you who want to use Unicode attribute values, IDs, class names, or tag names. You can now use them directly in jQuery selectors:

$("div.台北")
$("div#台北")
$("foo_bar台北")
$("div[@id=台北]")

Escape Selectors: A frequently requested feature you can now select elements by ID (or other selector) that uses a special character, for example this will find the div that has the ID of “foo.bar”:

$("div#foo\\.bar")

Inequality Selector: While this selector isn’t part of the CSS specification, it’s frequently used and included in other selector libraries, so we decided to add it in:

$("div[@id!=test]")

:nth-child() improvements: This selector allows you to locate specific child elements. We’ve supported selectors like :nth-child(1) and :nth-child(odd) since the beginning of jQuery, now we’ve added advanced :nth-child selectors, such as:

$("div:nth-child(2n)")
$("div:nth-child(2n+1)")
$("div:nth-child(n)")

Space-separated attributes: After being removed in jQuery 1.0, this selector has now been brought back by popular demand. It allows you to locate individual items in a space-separated attribute (such as a class or rel attribute).

$("a[@rel~=test]")

Animation Improvements

Speed: Animations are now significantly faster and smoother. Additionally, you can run more simultaneous animations without incurring any speed hits.

Testing: We now have a dedicated test suite for animations — which has allowed us to fix a number of pressing animation bugs that weren’t previously locatable.

DOM Event Listeners

Internally, the jQuery Event system has been overhauled to use the DOM Event system, rather than the classical “onclick” style of binding event handlers. This improvement allows you to be more unobtrusive in your use of the library (not affecting the flow of other libraries around it). Additionally, it helped to resolve some of the outstanding issues that existed with binding event listeners to IFrames.

Event Normalization

Some great steps have been taken to normalize keyboard and mouse events. You can now access the event.which property to get most details about the specific key or button that was pressed.

Multiple .is()

The .is() method can now take multiple selectors, separated by a comma. This allows you to test your jQuery set against multiple selectors.

$("div").is(":visible, :first")

Browser Version

A commonly requested feature, by plugin authors, was a way to determine what browser version their users were using. We now expose an extra property through which this information can be accessed.

jQuery.browser.version

More Bug Fixes

Please see the ticket listing for the full list of all issues resolved in this release.

The Future of jQuery

We’ve been very concerned with the direction and progress being made towards furthering the jQuery project. We’re focusing on a number of different aspects now, but the primary concern is still the advancement of the core jQuery library. We’ve spec’d out the next two releases, which you can read more about below:

jQuery 1.1.4

This will be the last release of the jQuery 1.1 branch - another bug fix release with some minor improvements. This release will also mark a number of methods as deprecated, in accordance with the upcoming jQuery 1.2 release.

We’re currently planning on having this release take place at the end of July.

jQuery 1.2

This will be the next major release of jQuery, containing a significant number of new features. The full details of this release can be found in the jQuery 1.2 Roadmap.

Your comments and feedback on this release are greatly appreciated. It’s still in planning, so nothing is completely final. We’re currently planning on releasing jQuery 1.2 by the end of August.

jQuery Books

We’re now up to 4 jQuery books being written and, just as importantly, they’re all being written by members of the jQuery team (so you’ll know that you’re getting good information).

The books and their authors are as follows:

  • Learning jQuery by Karl Swedberg and Jonathan Chaffer - due out early July 2007 (Packt Publishing).
  • jQuery Reference Guide by Karl Swedberg and Jonathan Chaffer - due out Summer 2007 (Packt Publishing).
  • jQuery Quickly by Yehuda Katz and Bear Bibeault (Manning Publishing).
  • Designing with jQuery by Glen Lipka (Manning Publishing).

This is really fantastic news. I’ve been able to read some of the pre-release chapters and I think you’re going to be in for a real treat with these books.

jQuery Talks and Conference

I’d like to announce some talks being given about jQuery in the upcoming months. Specifically, there will be a number of talks given about jQuery at both of the Ajax Experience conferences.

At the San Francisco Ajax Experience, John Resig will be giving an introductory overview to jQuery followed by an advanced jQuery talk. Glen Lipka will be giving a talk on designing with jQuery.

At the Boston Ajax Experience, John and Glen will be presenting again, and will be joined by Paul Bakaus to give a talk on developing intense applications and games with jQuery.

Since there’s going to be quite a few members of the jQuery team at the Boston Ajax Experience, we’d like to announce that we’re planning on doing a small, one day, jQuery Conference the next day after the Ajax Experience. This will be the perfect opportunity for you to meet the jQuery team and ask any nagging questions that you have. We’ll also be giving a number of talks about specific aspects of jQuery. We’ll have more details about this soon.

jQuery UI

Today, we’re also pleased to announce a secret project that we’ve been working on: jQuery UI. This project, being written by Paul Bakaus, is a whole new Drag & Drop library being developed from the ground up with speed and extensibility taken into consideration. Additionally, great care is being taken to have the code be fully documented and tested — allowing many other developers to use and help extend it.

This library will contain full code for Draggables, Droppables, Sortables, Resizables, and a Slider.

You can take a look at some of Paul’s early work in the SVN repository.


Source: jQuery

Technorati Loses Three MOre

The news is just coming out that Technorati have lost two more employees. Tantek Celik has left after serving as 3 years as head of technology at Technorati and Adam Hertz has also left, after also serving for 3 years as the VP of Engineering. Both Tantek and Adam have played important roles in developing the technology at Technorati, with Tantek additionally being a spokesperson and evangelist of Microformats and other open standards.

From the blog post it appears that they have both left the company to pursuit other opportunities. It is unknown if they are working on the same opportunity together, as they have left at the same time and worked closely together at Technorati. Having their two most important technology people leave is a big blow to Technorati. Tantek brought a lot of technical credibility to Technorati, which was especially needed as they have struggled with downtime and performance issues. Tantek was also responsible for a large part of the developer community that formed around the company and its services, and also played an important part in Technorati’s support for tags and microformats. Today you can find Technorati built into almost every blogging platform and their API being used in many different sites to display latest results, reputation and more. Technorati have had solid adoption amongst third-parties because of the level of developer evangelism and support that Tantek, along with others (such as Kevin Marks - who left for Google earlier this year) brought to the company.

It is yet to be seen what effect this will have on Technorati, as many third-party developers were loyal to the key developers at Technorati, most of who have now left the company. There were also many initiatives at Technorati, such as Microformats, that were being lead by the same key people who are no longer there. It also remains to be seen as to what will happen to those, and most importantly, if Technorati will be able to maintain their somewhat-lagging credibility with developers.

Update: It turns out that Technorati product manager Liz Dunn has also left the company, although there was no mention of it in Dave Sifry’s post. Liz has left Technorati to join Will Farrell’s Sequoia-back comedy video site FunnyOrDie as the Director of Product. Liz had been at Technorai for 18 months and was responsible for the new site they launched.

More to come on this story.

Respectance: Social Networking With A Deadly Twist

It must be niche social networking week. Following my review yesterday of Bakespace, a social networking site for people who like cooking, another interesting site hit my inbox: Respectance.

Respectance is a social networking site for online tributes, or as the email sent to me so nicely put it: “MySpace for dead people”. Respectance provides a space for family and friends to honor their dead loved ones by creating online tributes. Whilst similar tribute profiles do appear on MySpace or Facebook, Respectance differs by being dedicated entirely to the dead.

Respectance’s creators wanted to develop a dedicated and appropriate outlet for individuals to heal and share memories of their loved ones, while finding others with similar experiences. The site has also attracted fans that have created tribute sites for dead celebrities; Kurt Cobain and Ernest Hemingway are two examples.

The site (respectfully) does not run advertising; instead the business model focuses on charging for premium services.

Respectance was founded by Tom Wilkinson and Kazaa co-founder Richard Derks. The company has offices in San Francisco and Krakow, Poland and took funding of $250,000 from Dutch VC firm Solid Ventures in June.

respectance1.jpg

Monday, July 2, 2007

iPhone has a $250 - $300 Million Opening Weekend

iphonemoney.jpg

Piper Jaffray’s Gene Munster is estimating Apple sold half a million iPhones from 6 p.m. Friday through the close of business on Sunday. With the devices going for $500 to $600, that’s around $250 to $300 million in cash changing hands, depending on the mix of 4GB and 8GB units sold.

With margins on the device in the 20-50% range (probably closer to the lower end), that leaves an estimated $50 to $150 million in profit.

Not a bad weekend for Apple.

Sunday, July 1, 2007

AOL takes page from blogs in news site relaunch

Time Warner plans to launch a test of its overhauled news portal on Tuesday, drawing influences from the uncluttered design of popular Internet blogs.

The online division of the world's largest media company said it aimed to keep readers returning and to introduce a new generation of media consumers to the site by offering more interactive features such as polls and voting features and user-created news on one page.

"I truly believe that when you go to most news sites, it's a Web 1.0 world," Lewis D'Vorkin, senior vice president of AOL News and Sports, said, referring to the first generation of Internet sites. "They have rearranged the furniture. We have built new furniture."

AOL's sports site will also relaunch later this week following a similar design model.

D'Vorkin's work has included introducing a blog-like format about a year ago to celebrity gossip Web site TMZ.com, now one of the most closely read sites in Hollywood. TMZ is a joint venture of AOL and Warner Bros.

Like some, but not all, of its mainstream media rivals, AOL News faces a decline in visitors in the past month, according to comScore Media Metrix figures for May.

Even as top news site Yahoo News' traffic rose 8 percent to 33.7 million unique visitors in May, AOL News traffic fell 12 percent to 19.1 million. The New York Times brand site also fell 9 percent to 8.3 million visitors in May.

AOL overhauled its business model last summer, when it decided to give away most of its services away for free to boost online advertising by focusing on its free portal.

The new design divides the page into three vertical columns, with the heart of the programming at the center column. There, AOL's editors and producers update and select top news stories, videos and photos in one place.

Much like a blog, new stories push older ones lower as they are posted.

The right column is occupied by wire feeds from major news sources from the Associated Press, ABC News, CBS News and others. AOL News bloggers entries will also appear on the right column.

The left side of the page will feature user-submitted news and top stories voted on or commented on by viewers.

D'Vorkin said the ability to personalize the news page will come in the next two to three months, using technology the company acquired from Relegence, a financial news services company.