Disney To Cut Emissions By Half In Four Years

Posted on March 09, 2009

This is the kind of article that I love. Disney pledging aggressive (seemingly) targets for consuming less power across their fleet of theme parks. What’s fascinating about this is that it’s a giant optimization problem, and that environmental concerns are directly in line with operating costs. Use less power == spend less money == save the planet. It’s win-win. And since the scale of WDW is mind-boggling (for example, WDW is the largest single-site employer in the US). So if you change the bathroom light bulbs to CFLs across 28,000 rooms on property, it’s going to have a measurable impact on your bottom-line. This would be an awesome contract for a environmental consulting firm.

The tricky part is when the lowest hanging fruit gets picked, or when they’ve already eliminated the biggest sources of waste. A NYT article on Walmart brought this up, that while Walmart has done great stuff with light bulbs and condensed laundry detergent, think of the dizzying array of products it could make green through the weight of its purchasing power. So when Disney runs out of obvious optimizations, it then has to make tougher economic decisions during what’s bound to be a tough economic period for tourism. Do they cut Wishes to 3 nights a week due to its environmental impact? Do they spend money to upgrade their buses to biodiesel?

Two salient points here: 1) it’s going to be interesting to see what happens to big company environmental efforts with a worsening economy (not that original of a point). 2) Let me just reiterate that how much fun this kind of optimization would be at a company of this scale. You help save the planet, make the company a ton of moolah, work with new, green technology, and go to disney theme parks. What a job.

UPDATE: John Frost has some notes on Disney’s newly released Corporate Responsibility Report.

reCAPTCHA on Rails

Posted on March 08, 2009

This has probably been done to death, but for the sake of Random Google Searches (RGSs), here is a quick run through about how to do reCAPTCHA with Rails.

First off, you need to register at recaptcha.net. Then you need to add your domain and get two keys (one public, one private). I created two sites once registered, one for my development environment (localhost), and one for production.

Second, there is a Rails plugin. It’s on GitHub. So install it like this:

$ ./script/plugin install git://github.com/ambethia/recaptcha.git

Third, take those public and private reCAPTCHA keys and place those suckers in your environment.rb or appropriate environment file. Here’s what I added to the bottom of my development.rb, replacing the ‘MY_PUBLIC_KEY’ and ‘MY_PRIVATE_KEY’ with the keys from recaptcha.net (but keep the single quotes):


ENV['RECAPTCHA_PUBLIC_KEY'] = 'MY_PUBLIC_KEY'
ENV['RECAPTCHA_PRIVATE_KEY'] = 'MY_PRIVATE_KEY'

Fourth, find the place in your views where you want the reCAPTCHA box to appear. The plugin defines a special view helper named recaptcha_tags. Here’s a basic example:

Ask a Question -- Get an Answer!

<% form_for(@question) do |f| %>
Question: <%= f.text_field :question %>
Human Test: <%= recaptcha_tags %>
<%= f.submit "Ask Question" %>
<% end %>

And here’s what it that basic html looks like:

Each page load will embed code that pings the reCAPTCHA API and generates a new captcha. Note that there are some extra options on recaptcha_tags if you need to handle ssl or want to by default not use javascript (uses an iframe instead).

Lastly, we have to handle the verification in the controller. Here’s how I integrated it:


def create
@question = Question.new(params[:question])
if verify_recaptcha() and @question.save
redirect_to :action => 'show', :permalink => @question.permalink
else
render :action => 'new'
end
end

The verify_recaptcha() method will take params from the POST request, ping recaptcha.net, and then return true or false. Then you can handle it however you want (here in the same block as model validation). If the captcha fails, it’ll render the new page again, where a small error message will show up in the reCAPTCHA box.

And that’s about it. Hat tip to Rob Olson for implementing this originally on Elevator Pitches (I checked out that implementation first).

The Long Huck => hwork.org

Posted on March 06, 2009

Finally made the switch from Blogger to WordPress.

All links are now redirected. The feed is now redirected (and hosted on feedburner). I’ve been working with WordPress for over a year now, and so I finally thought I should switch to it for myself.

Twitter Domain Duplicate Content Issues

Posted on March 06, 2009

Found this issue when vanity searching for ‘hwork‘, my bowdoin handed-out internet alias. Turns out that twitter maintains three (at least) different subdomains for each user that are all crawlable by google: twitter.com/hwork, http://m.twitter.com/hwork, and explore.twitter.com/hwork. The first is obviously the main site (they redirect all requests from www.twitter.com/* to twitter.com), the second is the mobile site (which they redirect you to if you connect via a mobile user-agent). The third I don’t recognize. But it’s literally the exact same content as the normal domain (maybe some differences based on your session data).

Anyways, the solution for Twitter to fix this is really simple. Just disallow all URLs via robots.txt on the m.twitter.com and explore.twitter.com domains. http://m.twitter.com/robots.txt should look like:

User-agent: *
Disallow: /

This should remove a ton of duplicate twitter urls from goog. According to the SEO for Firefox plugin, Ev’s regular twitter page as a pagerank of 7, while the mobile version of his page only has a pagerank of 4. Interestingly, ev’s explore domain page also has a pagerank of 7.

Update: Found another dupe content domain, here: http://api.twitter.com/hwork.