#86 Logging Variables

Have you ever wanted to easily log all variables? Now you can by using some advanced Ruby concepts as shown in this episode.

#86 Logging Variables

Have you ever wanted to easily log all variables? Now you can by using some advanced Ruby concepts as shown in this episode.

Paginatin’ Christmas

In a timely holiday manner, we present to you a short list of will_paginate resources. Please enjoy responsibly.

will paginate

Sightings

Since its inception, millions of people have paginated billions of records using will_paginate. A few notable examples:

Know a site that belongs on this list? Let us know in the comments.

New Features

Just in time for the holidays, Mislav has gifted us all with a bucket o’ new features for will_paginate, mostly dealing with customizing the output. Take a look at his announcement and dive in.

Testing Your Views

For those of us constantly asking the view testing question, stern but fair will_paginate maintainer Mislav comes to the rescue with his aptly titled will_paginate and view testing article. It’s in-depth, so be sure to check it out. Also: subscribe to his blog. Immediately.

Ajax Pagination

This Ajax thing is going to be huge! Get in on the action with Matt Aimonetti’s Ajax Pagination in less than 5 minutes article. He’ll teach you how to unobtrusively add Ajax behavior to will_paginate using Prototype, LowPro, and RJS.

If you’re more of the jQuery type, check out the Ajax will_paginate, jq-style article over at ozmm.

The RailsCast

The prolific Ryan Bates has a screencast explaining the basics of WP. As always, it’s to the point and very well done. And hey, you can even watch it on your iPod! Have a look.

will_paginate without ActiveRecord

There’s only a few things I like more than websites with tildes in the URL. Like, say, twisting Rails plugins into non-Rails uses. Lucky for us, Erin Ptacek provides both in an entry titled Erin’s Adventures with Rails: will_paginate without ActiveRecord. In it, you’ll learn how to paginate a collection of OpenStruct objects. No ActiveRecord required. What a rush.

Ferret Integration

Brandon Keepers, that handsome devil, wrote a popular article detailing the steps necessary to paginate your Ferret search results using good ol’ WP. If you’re using Ferret, this is definitely the way to go.

Solr Integration

While I don’t know what ‘The Pug Automatic’ means, and I certainly know nothing of the RoboPug in said blog’s header, Henrik Nyh’s article on paginating acts_as_solr with will_paginate is an undeniable must read for any Java lovin’, Apache huggin’ Solr user wanting to add a bit of style and flair into his app.

acts_as_taggable Integration

Perhaps as contentious as the comments and this thread suggest, Jim Morris’ Paginating acts_as_taggable article offers a few ways to make both the on_steroids variant of acts_as_taggable plugin and will_paginate play nicely together.

Rails Plugins

A number of Rails plugins have been released with support for will_paginate lovingly baked in. Like a Santa shaped sugar cookie.

SpinBits’ SimplySearchable helps you search in style while providing options to paginate using our friend WP.

UltraSphinx, Evan Weaver’s preeminent Sphinx search engine plugin, longs to be installed alongside will_paginate.

While will_paginate, due to popular demand, plays nicely with scope_out, Nick Kallen’s similar HasFinder works technically and conceptually well with everyone’s favorite paginator.

And finally, how can we neglect to mention Will_Paginate_Search, which hooks into both WP and acts_as_indexed to the benefit of all involved parties.

The Bugtracker

Found a bug? Got an idea? Of course we’d love to hear it. Our Lighthouse tracker, which we love is the place for all of it.

The Google Group

Did you catch it above? Yep, you did. So observant: there’s now a Google Group for will_paginate. Be sure to join up and chime in.

Nightly RDoc

Finally, RDoc is now generated nightly from the latest code in Subversion. Check it out at the Rock. It’s like Christmas every day!

That’s a wrap

Hey, where did 2007 go? I’m getting sucked into 2008 faster than Perl into obscurity.

Keep paginatin’, Railers. See you next year.

#85 YAML Configuration File

Application configuration shouldn’t be spread throughout your code base. Instead a much better place to put it is an external YAML file. See how to do that in this episode.

#85 YAML Configuration File

Application configuration shouldn’t be spread throughout your code base. Instead a much better place to put it is an external YAML file. See how to do that in this episode.

#84 Cookie Based Session Store

In Rails 1.2 the default session store is file based. This is inefficient and difficult to maintain. In Rails 2.0 the default is now cookie based which has several benefits as you will see in this episode.

#84 Cookie Based Session Store

In Rails 1.2 the default session store is file based. This is inefficient and difficult to maintain. In Rails 2.0 the default is now cookie based which has several benefits as you will see in this episode.

ThreadsafeBenchmark

When testing products such as services which need to be stress-tested prior to release, it’s necessary to use multi-threading to get as close to real world usage as possible. This gem, though not intended to be a replacement for full-fledged testing suites such as LoadRunner, can provide instantaneous results to facilitate TDD programming. To reduce the duplication of code, the gem utilizes Ruby’s built-in Benchmark module for the base functionality while preventing the output from clobbering through the use of thread-specific IO buffers.

require 'threadsafe_benchmark'
include ThreadsafeBenchmark

threads = []
max_num = 5000

5.to_i.times { |i|
threads << Thread.new(max_num) { |n|
threadsafe_bm(6) { |x|
x.report("for:") { for i in 1..n; a = "1"; end }
x.report("times:") { n.times do ; a = "1"; end }
x.report("upto:") { 1.upto(n) do ; a = "1"; end }
}
}
}

threads.each
Continue reading "ThreadsafeBenchmark"

ThreadsafeBenchmark

When testing products such as services which need to be stress-tested prior to release, it’s necessary to use multi-threading to get as close to real world usage as possible. This gem, though not intended to be a replacement for full-fledged testing suites such as LoadRunner, can provide instantaneous results to facilitate TDD programming. To reduce the duplication of code, the gem utilizes Ruby’s built-in Benchmark module for the base functionality while preventing the output from clobbering through the use of thread-specific IO buffers.

require 'threadsafe_benchmark'
include ThreadsafeBenchmark

threads = []
max_num = 5000

5.to_i.times { |i|
threads << Thread.new(max_num) { |n|
threadsafe_bm(6) { |x|
x.report("for:") { for i in 1..n; a = "1"; end }
x.report("times:") { n.times do ; a = "1"; end }
x.report("upto:") { 1.upto(n) do ; a = "1"; end }
}
}
}

threads.each { |t| t.join }

Using the standard Benchmark, the results would be printed haphazardly making it difficult to read and interpret. But ThreadsafeBenchmark cleans everything up giving us nicely laid out columns.

user system total real
for 0.000000 .000000 .000000 ( 0.002889)
times 0.000000 .000000 .000000 ( 0.002477)
upto 0.000000 .000000 .000000 ( 0.002479)
for 0.000000 .000000 .000000 ( 0.002401)
times 0.010000 .000000 .010000 ( 0.002586)
upto 0.000000 .000000 .000000 ( 0.002413)
for 0.000000 .000000 .000000 ( 0.002205)
times 0.010000 .000000 .010000 ( 0.002245)
upto 0.000000 .000000 .000000 ( 0.002272)
for 0.000000 .000000 .000000 ( 0.001822)
times 0.010000 .000000 .010000 ( 0.001958)
upto 0.000000 .000000 .000000 ( 0.001943)
for 0.010000 .000000 .010000 ( 0.010090)
times 0.010000 .000000 .010000 ( 0.009225)
upto 0.010000 .000000 .010000 ( 0.007986)

The gem and source files are available at Rubyforge.

BlazeDS and open source version of livecycle data services…

That sounds cool. Read all about it here…

http://www.techcrunch.com/2007/12/12/adobe-releases-blaze-ds-open-source-version-of-livecycle-data-services/

Maybe not. Techcrunch released this message on their blog but no text was attached and comments where closed. Maybe somebody clicked the submit button to quickly. Now I am curious…

UPDATE: 10:17pm Denver time…it’s official: http://www.adobe.com/aboutadobe/pressroom/pressreleases/200712/121307BlazeDS.html

#83 Migrations in Rails 2.0

Migrations are now sexy in Rails 2.0! In this episode we will take a look at these improvements and the related rake tasks.

#83 Migrations in Rails 2.0

Migrations are now sexy in Rails 2.0! In this episode we will take a look at these improvements and the related rake tasks.

James Cox – Ruby on Rails Podcast

James Cox, former PHP team member and current Rails consultant. From London.
Also mentioned:

James Cox – Ruby on Rails Podcast

James Cox, former PHP team member and current Rails consultant. From London.
Also mentioned:

Rails 2.0

Rails 2.0 is out! Thanks guys for all the hard work, this release is just impressive.

#82 HTTP Basic Authentication

Rails 2.0 offers an extremely easy way to do HTTP basic authentication. See how in this episode.

#82 HTTP Basic Authentication

Rails 2.0 offers an extremely easy way to do HTTP basic authentication. See how in this episode.