<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Safety in Numbers</title>
 <link href="http://numbers.brighterplanet.com/atom.xml" rel="self"/>
 <link href="http://numbers.brighterplanet.com/"/>
 <updated>2015-05-28T14:08:00+00:00</updated>
 <id>http://numbers.brighterplanet.com</id>
 <author>
   <name>Brighter Planet</name>
   <email>staff@brighterplanet.com</email>
 </author>

 
 <entry>
   <title>End of the line</title>
   <link href="http://numbers.brighterplanet.com/2013/06/03/end-of-the-line"/>
   <updated>2013-06-03T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2013/06/03/end-of-the-line</id>
   <author>
     <name>Patti</name>
   </author>
   <content type="html">&lt;p&gt;For almost seven years, Brighter Planet has been a constant source of inspiration for me and, I’m proud to say, for the broader sustainability community. This makes it all the more difficult to announce that the company and its Brighter Planet Visa cards and other services are coming to the end of the line.&lt;/p&gt;

&lt;p&gt;We thank our customers, our partners, and all those with whom we’ve worked with over the years to move the needle on building a clean-energy future.  It’s phenomenal how knowing what your carbon footprint is and what you can do about it or even what simple choices like which card to pull out of your wallet can do.  Because of you, we offset over 350 million lbs. of CO2, supporting the development of 24 renewable energy and sustainable forestry projects across the US. This is the equivalent of over 20,000 homes being electrified by renewable energy for a year, removing over 10 million cars from the road for a day, or every cardholder turning off all the lights in their home for more than a year. &lt;/p&gt;

&lt;p&gt;We also thank our investors, leadership boards, and experts who have supported and advised us over the years. As a business that came to be profitable with almost 200,000 customers, we hope that we have helped demonstrate, along with all of our compatriots in the social entrepreneurship world, that you can certainly do well while also doing good.&lt;/p&gt;

&lt;p&gt;I must thank our team too, past and present, the soul of Brighter Planet. Andy, Seamus, Robbie, Ian H., Nancy, Matt K., Derek, Jon, Jake, Adam, Carolyn, Rich St., Daniel, Emily, Ashley, Bruce, David, Ian W., Kerry, Matt V., Rich Sa., Remy, and others.  Some were with us for more than five years, others were interns for a few months, all played a role in our many successes.&lt;/p&gt;

&lt;p&gt;You may be wondering why we are liquidating at this point. Having led businesses large and small, I can tell you that winding a company down is the toughest decision to make. It was not one that Brighter Planet’s Board or shareholders took lightly.&lt;/p&gt;

&lt;p&gt;A perfect storm of regulatory upheaval made Brighter Planet’s business model increasingly challenging and financially non-sustainable going forward. The passage of the Durbin Act, intended as a plus for U.S. consumers and merchants, upended the card market, effectively precluding economically viable rewards cards that provide revenue for cause-based organizations including Brighter Planet.  At the same time, the government’s inaction on meaningful cap-and-trade and the rise and fall of the U.S. carbon markets negated the need for and value of computational sustainability tools for businesses—tools that we pioneered in developing.  Finally, the country’s economic meltdown these past few years naturally impacted discretionary spending by consumers and businesses, in turn impacting companies offering products and services like Brighter Planet.&lt;/p&gt;

&lt;p&gt;Since getting our start in a Middlebury College classroom in 2005, so much has changed. The powerful call to action of An Inconvenient Truth came the year after Brighter Planet was created, and left millions of Americans searching for ways to make a difference in climate change, the most important challenge our world faces today.  Back then, there weren’t many significant organizations devoted to the global warming challenge.  Brighter Planet in partnership with the Bank of America and Visa offered a straightforward first step for people to reduce their impact on our planet’s atmosphere, and we appreciate the bold steps that these partners took along with us. &lt;/p&gt;

&lt;p&gt;Now in 2013, I see a myriad of ways for people and businesses to take action. With organizations like 350.org building the largest climate movement the world has seen or CERES mobilizing business leadership for a sustainable world, I think it’s safe to say that while we certainly haven’t solved the climate problem, the community has made a serious dent in the participation problem. That you no longer need a credit or debit card to join the fight is cause for celebration.&lt;/p&gt;

&lt;p&gt;So while Brighter Planet is wrapping up, I’m happy to count hundreds more capabilities that have sprung up from the ingenuity of the community as well as thousands of organizations both big and small that transformed themselves to embrace sustainability within their core businesses. Even several of Brighter Planet’s former employees, including one of its founders, have formed a new startup, Faraday, to apply Big Data technology to customer acquisition of energy efficiency solutions. What so many for-profits, not-for-profits, and individuals are doing today in 2013 is nothing short of amazing.  &lt;/p&gt;

&lt;p&gt;I’d like to close with some of my favorite Brighter Planet highlights from these past several years:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Managed the country’s largest consumer carbon offset program with almost 200,000 customers, outlasting every competitor in our space&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Supported the development of 24 projects such as wind power in public school districts and open lands, cow power on family farms, and conservation of redwood forests, decreasing our dependence on carbon-emitting dirty energy sources like coal burning power plants and removing carbon from the atmosphere &lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Modeled over 27.5 million carbon, energy, and resource impacts of real-life carbon emissions sources, the most in the country&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Conducted groundbreaking research in the aviation and hotel sectors, examining key drivers of energy efficiency and analyzing economic and environmental benefits &lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Assessed employee sustainability engagement in corporations and identified best practices &lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Provided grants to support community climate projects such as school gardens&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Ran industry defining social media campaigns &lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Successfully built and sold a social giving platform&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Named the country’s Best Small Business by Discovery Channel’s Treehugger&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Won the &lt;em&gt;Financial Times&lt;/em&gt; Social Innovation Award&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Won the EPA’s Apps for the Environment Award&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Recognized as thought leaders, presenting the company’s work to diverse audiences such as the technology, corporate travel, energy, and open government communities&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you all.&lt;/p&gt;

&lt;p&gt;Patti&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A new offset project</title>
   <link href="http://numbers.brighterplanet.com/2012/09/18/a-new-offset-project"/>
   <updated>2012-09-18T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/09/18/a-new-offset-project</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;We’ve got a new offset project, and once again it’s the first of it’s kind for Brighter Planet. The &lt;a href=&quot;http://brighterplanet.com/projects/23&quot;&gt;Rentech Fertilizer Plant&lt;/a&gt; project supports a new N&lt;sub&gt;2&lt;/sub&gt;O destruction system at midwestern fertilizer plant, and is certified under the &lt;a href=&quot;http://climateactionreserve.org&quot;&gt;Climate Action Reserve&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-09-18-a-new-offset-project/rentech_plan.jpg&quot; alt=&quot;Plan&quot; /&gt;{.wrapped}&lt;/p&gt;

&lt;p&gt;Rentech’s fertilizer plant in East Dubuque, Illinois produces nitric acid and ammonia, two of the main ingredients in fertilizer. The plant used to release Nitrous oxide (N&lt;sub&gt;2&lt;/sub&gt;O), a greenhouse gas about &lt;a href=&quot;http://brighterplanet.com/entries/7&quot;&gt;three hundred times more powerful&lt;/a&gt; than CO&lt;sub&gt;2&lt;/sub&gt;, as a byproduct of the nitric acid production process. With this project the tail gas from nitric acid production is piped through a special chamber where a catalyst converts between 95% and 99% of the N&lt;sub&gt;2&lt;/sub&gt;O into nitrogen and oxygen. A continuous emissions monitoring system directly measures the amount of N&lt;sub&gt;2&lt;/sub&gt;O in the tail gas exiting the chamber to ensure the catalyst is functioning effectively.&lt;/p&gt;

&lt;p&gt;This project is the first of its kind in the United States and serves as an example of how the fertilizer industry can reduce the impact of its operations while continuing to serve the needs of farmers.&lt;/p&gt;

&lt;p&gt;Learn more about the &lt;a href=&quot;http://brighterplanet.com/projects/23&quot;&gt;Rentech fertilizer plant&lt;/a&gt; or our &lt;a href=&quot;http://brighterplanet.com/projects&quot;&gt;other offset projects&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Back to the Browser - A JavaScript Workflow for UNIX Nerds</title>
   <link href="http://numbers.brighterplanet.com/2012/09/13/a-javascript-workflow-for-unix-nerds"/>
   <updated>2012-09-13T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/09/13/a-javascript-workflow-for-unix-nerds</id>
   <author>
     <name>derek</name>
   </author>
   <content type="html">&lt;p&gt;When Apple announced Mac OS X Lion, their tagline was “Back to the Mac” as they were bringing some features from iOS into the desktop-oriented Mac OS. In the JavaScript world, a similar thing has happened: innovations in the &lt;a href=&quot;http://nodejs.org/&quot;&gt;Node.js&lt;/a&gt; space can be brought back to the browser. These innovations have made JavaScript development faster and cleaner with command-line tools and the npm packaging system.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;As I began writing serious JavaScript libraries and apps, I wanted the same kind of workflow I enjoy when writing Ruby code. I wanted to write my code in vi, run tests in the command line, organize my code into classes and modules, and use versioned packages similar to Ruby gems. At the time, the standard way to write JavaScript was to manage separate files by hand and concatenate them into a single file. One of the only testing frameworks in town was Jasmine, which required you to run tests in the browser. Since then, there has been an explosion of command-line code packaging and testing frameworks in the Node.js community that have lent themselves well to client side development. What follows is the approach I find to be the most productive.&lt;/p&gt;

&lt;p&gt;Here’s a list of the tools that correspond to their Ruby world counterparts:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Application&lt;/th&gt;
      &lt;th&gt;Ruby&lt;/th&gt;
      &lt;th&gt;Javascript&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Testing&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;http://rspec.info&quot;&gt;RSpec&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;http://vowsjs.org&quot;&gt;vows&lt;/a&gt;, &lt;a href=&quot;http://busterjs.org&quot;&gt;buster&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Package management&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;http://rubygems.org&quot;&gt;rubygems&lt;/a&gt;, &lt;a href=&quot;http://gembundler.com&quot;&gt;bundler&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;http://npmjs.org&quot;&gt;npm&lt;/a&gt;, &lt;a href=&quot;http://github.com/substack/node-browserify&quot;&gt;browserify&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Code organization&lt;/td&gt;
      &lt;td&gt;&lt;code&gt;require&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;http://commonjs.org&quot;&gt;CommonJS&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Build tools&lt;/td&gt;
      &lt;td&gt;jeweler, rubygems&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;http://github.com/substack/node-browserify&quot;&gt;browserify&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;By installing Node.js, you have access to a command-line JavaScript runtime, testing, package management, and application building. Running tests from the command-line allows you to more easily use tools like &lt;a href=&quot;http://rubydoc.info/gems/guard/frames&quot;&gt;guard&lt;/a&gt;, run focused unit tests, and easily set up continuous integration.&lt;/p&gt;

&lt;h3 id=&quot;testing&quot;&gt;Testing&lt;/h3&gt;

&lt;p&gt;Many JavaScripters run Jasmine in the browser for testing. While it does the job, its syntax is extremely verbose and it breaks the command-line-only workflow. There is a Node.js package for running Jasmine from the command line, but I have found it to be buggy and not as feature rich as a typical command line testing tool. Instead I prefer vows or buster.js. Each supports a simpler “hash” based syntax, as opposed to Jasmine’s verbose syntax:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Jasmine&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;MyClass&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;#myMethod&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;before&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;instance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;MyClass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;foo&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  
    &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;returns true by default&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;myMethod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toBeTruthy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;returns false sometimes&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;myMethod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toBeFalsy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Vows&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;vows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;MyClass&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addBatch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&amp;#39;#myMethod&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;topic&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;MyClass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;foo&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;

    &lt;span class=&quot;s1&quot;&gt;&amp;#39;returns true by default&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;assert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;myMethod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;());&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;&amp;#39;returns false sometimes&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;refute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;myMethod&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;kr&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Vows and buster can be used just like &lt;code&gt;rspec&lt;/code&gt; to run tests from the command line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; vows test/my-class-test.js
................
OK &amp;gt;&amp;gt; 22 honored
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;One advantage that buster has over vows is that it can run its tests both from the command line and from a browser in case you want to run some integration tests in a real browser environment.&lt;/p&gt;

&lt;p&gt;For mocks and stubs, you can use the excellent &lt;a href=&quot;http://sinonjs.org&quot;&gt;sinon&lt;/a&gt; library, which is included by default with buster.js.&lt;/p&gt;

&lt;h4 id=&quot;integration-testing&quot;&gt;Integration testing&lt;/h4&gt;

&lt;p&gt;In addition to unit testing, it’s always good run a full integration test. Since every browser has its own quirks, it’s best to run integration tests in each browser. I write &lt;a href=&quot;http://cukes.info&quot;&gt;cucumber&lt;/a&gt; tests using &lt;a href=&quot;http://jnicklas.github.com/capybara/&quot;&gt;capybara&lt;/a&gt; to automatically drive either a “headless” (in-memory) webkit browser with &lt;a href=&quot;https://github.com/thoughtbot/capybara-webkit&quot;&gt;capybara-webkit&lt;/a&gt; and/or GUI browsers like Firefox and Chrome with &lt;a href=&quot;http://seleniumhq.org/&quot;&gt;selenium&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;features/support/env.rb&lt;/code&gt; you can define which type of browser is used to run the tests by defining custom drivers&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;selenium-webdriver&amp;#39;&lt;/span&gt;

    &lt;span class=&quot;no&quot;&gt;Capybara&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;register_driver&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:selenium_chrome&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
      &lt;span class=&quot;no&quot;&gt;Capybara&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Selenium&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Driver&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:browser&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:chrome&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;no&quot;&gt;Capybara&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;register_driver&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:selenium_firefox&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
      &lt;span class=&quot;no&quot;&gt;Capybara&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Selenium&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Driver&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:browser&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:firefox&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;BROWSER&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;chrome&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;no&quot;&gt;Capybara&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current_driver&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:selenium_chrome&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;elsif&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;BROWSER&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;firefox&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;no&quot;&gt;Capybara&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;current_driver&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:selenium_firefox&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;capybara-webkit&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;no&quot;&gt;Capybara&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;default_driver&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:webkit&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now you can choose your browser with an environment variable: &lt;code&gt;BROWSER=firefox cucumber features&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you are testing an app apart from a framework like Sinatra or Rails, you can use Rack to serve a static page that includes your built app in a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag. For example, you could have an html directory with an &lt;code&gt;index.html&lt;/code&gt; file in it:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Test App&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;application.js&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;body&amp;gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;app&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;When you’re ready to run an integration test, compile your code into &lt;code&gt;application.js&lt;/code&gt; using browserify:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; browserify -e lib/main.js -o html/application.js
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then tell cucumber to load your test file as the web app to test:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# features/support/env.rb&lt;/span&gt;
    
    &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rack&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rack/directory&amp;#39;&lt;/span&gt;

    &lt;span class=&quot;no&quot;&gt;Capybara&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rack&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Builder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;run&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rack&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Directory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;expand_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;../../../html/&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Once cucumber is set up, you can start writing integration tests just as you would with Rails:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# features/logging_in.feature

Feature: Logging in

Scenario: Successful in-log
  Given I am on the home page
  When I log in as derek
  Then I should see a welcome message
&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# features/step_definitions/log_in_steps.rb&lt;/span&gt;

    &lt;span class=&quot;no&quot;&gt;Given&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;%r{I am on the home page}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;visit&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;/index.html&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    
    &lt;span class=&quot;no&quot;&gt;When&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;%r{I log in as derek}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;click&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;#login&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;fill_in&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;username&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:with&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;derek&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;fill_in&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;password&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:with&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;secret&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;click&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;input[type=submit]&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    
    &lt;span class=&quot;no&quot;&gt;Then&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;%r{I should see a welcome message}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=~&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/Welcome, derek!/&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;package-management&quot;&gt;Package management&lt;/h3&gt;

&lt;p&gt;One of the joys of Ruby is its package manager, rubygems. With a simple &lt;code&gt;gem install&lt;/code&gt; you can add a library to your app. There has been an explosion of JavaScript package managers lately. Each one adds the basic ability to gather all of your libraries and application code, resolve the dependencies, and concatenate them into a single application file. I prefer &lt;a href=&quot;http://github.com/substack/node-browserify&quot;&gt;browserify&lt;/a&gt; over all the others for two reasons. First, you can use any Node.js package, which opens you up to many more utilities and libraries than other managers. Second, it uses Node.js’ CommonJS module system, which is a very simple and elegant module system.&lt;/p&gt;

&lt;p&gt;In your project’s root, place a &lt;code&gt;package.json&lt;/code&gt; file that defines the project’s dependencies:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&amp;quot;dependencies&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&amp;quot;JSONPath&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;0.4.2&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&amp;quot;underscore&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;*&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&amp;quot;jquery&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;1.8.1&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&amp;quot;devDependencies&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&amp;quot;browserify&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;*&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&amp;quot;vows&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;*&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Run &lt;code&gt;npm install&lt;/code&gt; and all of your project’s dependencies will be installed into the &lt;code&gt;node_modules&lt;/code&gt; directory. In your project you can then make use of these packages:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;_&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;underscore&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;jsonpath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;JSONPath&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;myJson&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;...&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;nx&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;jsonpath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;myJson&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;$.books&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If you’re looking for packages available for certain tasks, simply run &lt;code&gt;npm search &amp;lt;whatever&amp;gt;&lt;/code&gt; to find pacakges related to your search terms. Some packages are tagged with “browser” if they are specifically meant for client side apps, so you can include “browser” as one of your search terms to limit your results accordingly. Many of the old standbys, like jquery, backbone, spine, and handlebars are there.&lt;/p&gt;

&lt;h3 id=&quot;code-organization&quot;&gt;Code organization&lt;/h3&gt;

&lt;p&gt;As JavaScript applications get more complex, it becomes prudent to split your code into separate modules, usually placed in separate files. In the Ruby world, this was easily done by &lt;code&gt;require&lt;/code&gt;-ing each file. Node.js introduced many people (including me) to the CommonJS module system. It’s a simple and elegant way to modularize your code and allows you to separate each module into its own file. Browserify allows you to write your code in the CommonJS style and it will roll all of your code up into a single file appropriate for the browser.&lt;/p&gt;

&lt;h4 id=&quot;ruby-structure&quot;&gt;Ruby structure&lt;/h4&gt;

&lt;p&gt;For example, my Ruby project may look like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;~lib/
 -my_library.rb
 -my_library/
   -book.rb
-my_library.gemspec
-spec/
 -my_library/
   -book_spec.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Where &lt;code&gt;lib/my_library.rb&lt;/code&gt; looks like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;my_library/book&amp;#39;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MyLibrary&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;initialize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;vi&quot;&gt;@book&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And &lt;code&gt;lib/my_library/book.rb&lt;/code&gt; looks like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;jsonpath&amp;#39;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MyLibrary&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Book&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;no&quot;&gt;JSONPath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;eval&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;$.store.book\[0\]&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And &lt;code&gt;spec/my_library/book_spec.rb&lt;/code&gt; looks like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;json&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;helper&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;my_library/book&amp;#39;&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;MyLibrary&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Book&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;.parse&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;parses a book object&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;json&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;support/book.json&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;book&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;book&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Breakfast at Tiffany&amp;#39;s&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h4 id=&quot;javascript-structure&quot;&gt;JavaScript structure&lt;/h4&gt;

&lt;p&gt;A javascript project would look similar:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;~lib/
 -my-library.js
 -my-library/
   -book.js
-package.json
-test/
 -my-library/
   -book-test.js
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Where &lt;code&gt;lib/my-library.js&lt;/code&gt; looks like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Book&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;./my-library/book&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;MyLibrary&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;book&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exports&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;MyLibrary&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And &lt;code&gt;lib/my-library/book.js&lt;/code&gt; looks like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;jsonpath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;jsonpath&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Book&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;jsonpath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;$.store.book\[0\]&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exports&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And &lt;code&gt;test/my-library/book-test.js&lt;/code&gt; looks like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;fs&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;fs&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;helper&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;../helper&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;Book&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;../../lib/my_library/book&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// NOTE: there are ways to set up your modules &lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// to be able to use relative require()s but&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// it is beyond the scope of this article&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;vows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Book&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addBatch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&amp;#39;.parse&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;&amp;#39;parses a book object&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;json&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;fs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;readFileSync&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;support/book.json&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;book&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;assert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;equal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Breakfast at Tiffany&amp;#39;s&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;kr&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;build-tools&quot;&gt;Build tools&lt;/h3&gt;

&lt;p&gt;Browserify will build concatenated JavaScript files when you’re ready to deploy your code on a website or as a general-purpose library. Its usage is simple:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; browserify -e &amp;lt;main_application_startup_code&amp;gt; -o &amp;lt;path_to_built_file&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;building-a-library&quot;&gt;Building a library&lt;/h4&gt;

&lt;p&gt;If we were building the library in the section above, we could run &lt;code&gt;browserify -e lib/my-library.js -o build/my-library.js&lt;/code&gt;. Then, any user of your library can use your library with the &lt;code&gt;require&lt;/code&gt; function:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;jquery.js&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;my-library.js&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;myLibrary&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;my-library&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/lib.json&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;myLibrary&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can also save the library user some time with a custom entry point for browsers:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// in /browser.js&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;MyLibrary&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;my-library&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then run &lt;code&gt;browserify -e browser.js -o build/my-library.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And the library user would use it thusly:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;jquery.js&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;my-library.js&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/lib.json&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;MyLibrary&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h4 id=&quot;building-a-web-app&quot;&gt;Building a web app&lt;/h4&gt;

&lt;p&gt;A spine app might look something like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// in app/main.js&lt;/span&gt;
    
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;jquery&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;Spine&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;spine&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;nx&quot;&gt;Spine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;MainController&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;./controllers/main-controller&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ApplicationController&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Spine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Controller&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;init&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;main&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;MainController&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;routes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
          &lt;span class=&quot;s1&quot;&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;active&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

    &lt;span class=&quot;nx&quot;&gt;Spine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Route&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;setup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;history&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It would be built with &lt;code&gt;browserify -e app/main.js -o build/application.js&lt;/code&gt; and the application.js added to your website with a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;You can extend browserify with plugins like &lt;a href=&quot;https://github.com/mklabs/templatify#readme&quot;&gt;templatify&lt;/a&gt;, which precompiles HTML/Handlebar templates into your app.&lt;/p&gt;

&lt;p&gt;Together, npm packages, command-line testing and build tools, and modular code organization help you quickly build non-trivial JavaScript libraries and applications just as easily as it was in Ruby land. I’ve developed several in-production projects using this workflow, such as our &lt;a href=&quot;http://github.com/dkastner/CM1.js&quot;&gt;CM1&lt;/a&gt; JavaScript client library, our flight search &lt;a href=&quot;http://github.com/brighterplanet/careplane&quot;&gt;browser plugin&lt;/a&gt;, and &lt;a href=&quot;http://github.com/brighterplanet/hootroot1&quot;&gt;hootroot.com&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Split XML files with `sgrep`, a classic UNIX utility from 1995</title>
   <link href="http://numbers.brighterplanet.com/2012/09/11/split-xml-files-with-unix-utility-sgrep"/>
   <updated>2012-09-11T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/09/11/split-xml-files-with-unix-utility-sgrep</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.cs.helsinki.fi/u/jjaakkol/sgrepman.html&quot;&gt;&lt;code&gt;sgrep&lt;/code&gt;&lt;/a&gt; is better than &lt;a href=&quot;http://en.wikipedia.org/wiki/Split_%28Unix%29&quot;&gt;&lt;code&gt;split&lt;/code&gt;&lt;/a&gt; or &lt;a href=&quot;http://en.wikipedia.org/wiki/Csplit&quot;&gt;&lt;code&gt;csplit&lt;/code&gt;&lt;/a&gt; for breaking up XML files by element – you can even use it to create a constant-memory streaming “parser.”&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; sgrep -o &lt;span class=&quot;s2&quot;&gt;&amp;quot;XXXSTART%rSTOPXXX&amp;quot;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;quot;&amp;lt;TourismEntity&amp;quot; .. &amp;quot;&amp;lt;/TourismEntity&amp;quot;&amp;#39;&lt;/span&gt; transmission_file.xml
&lt;span class=&quot;go&quot;&gt;XXXSTART&amp;lt;TourismEntity&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;State&amp;gt;New York&amp;lt;/State&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;Saying&amp;gt;I♥NY&amp;lt;/Saying&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  &amp;lt;/TourismEntitySTOPXXXXXXSTART&amp;lt;TourismEntity&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;State&amp;gt;Virginia&amp;lt;/State&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;Saying&amp;gt;Is For Lovers&amp;lt;/Saying&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  &amp;lt;/TourismEntitySTOPXXXXXXSTART&amp;lt;TourismEntity&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;State&amp;gt;Wisconsin&amp;lt;/State&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;Saying&amp;gt;America&amp;#39;s Dairyland&amp;lt;/Saying&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  &amp;lt;/TourismEntitySTOPXXX&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(see below for why that output is useful)&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;tldr&quot;&gt;tl;dr&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;sgrep&lt;/code&gt; and a simple Ruby program (given below) let you stream XML elements into an &lt;code&gt;#emit&lt;/code&gt; method that can do whatever you want. What’s more, the memory usage is constant (and small); memory usage doesn’t grow like if you parse the entire XML document into memory like with &lt;a href=&quot;http://nokogiri.org/&quot;&gt;nokogiri&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;using-sgrep-to-split-xml&quot;&gt;Using sgrep to split XML&lt;/h3&gt;

&lt;p&gt;Combine &lt;code&gt;sgrep&lt;/code&gt; with, for example, a Ruby program:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/env ruby&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# your target element here&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;ELEMENT_START&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;lt;TourismEntity&amp;#39;&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;ELEMENT_STOP&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;lt;/TourismEntity&amp;#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# your emit code here - in this case I&amp;#39;m just writing it to a separate file named tourism_entity-NUM.txt&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;emit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tourism_entity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;vg&quot;&gt;$tourism_entity_count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
  &lt;span class=&quot;vg&quot;&gt;$tourism_entity_count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;tourism_entity-&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;vg&quot;&gt;$tourism_entity_count&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.txt&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;w&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;write&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tourism_entity&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;SGREP_BIN&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%w{ sgrep sgrep2 }&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;detect&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`which &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bin&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;vg&quot;&gt;$?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;success?&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;MAGIC_START&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;XXXSTART&amp;#39;&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;MAGIC_STOP&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;STOPXXX&amp;#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;leftover&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;IO&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;popen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;SGREP_BIN&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;-n&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;-o&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;MAGIC_START&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;%r&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;MAGIC_STOP&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%{&amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;ELEMENT_START&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;&amp;quot; .. &amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;ELEMENT_STOP&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;&amp;quot;}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ARGV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;io&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;additional&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;io&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;65536&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;buffer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;leftover&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;additional&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;start&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;MAGIC_START&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stop&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;MAGIC_STOP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;element_body&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;MAGIC_START&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;gt;&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# what &amp;quot;emit&amp;quot; does is up to you&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;emit&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;element_body&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;buffer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buffer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;MAGIC_STOP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;leftover&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;buffer&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So let’s go back to the example, &lt;code&gt;transmission_file.xml&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-xml&quot; data-lang=&quot;xml&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;TransmissionFile&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;TourismEntity&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;State&amp;gt;&lt;/span&gt;New York&lt;span class=&quot;nt&quot;&gt;&amp;lt;/State&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;Saying&amp;gt;&lt;/span&gt;I♥NY&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Saying&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/TourismEntity&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;TourismEntity&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;State&amp;gt;&lt;/span&gt;Virginia&lt;span class=&quot;nt&quot;&gt;&amp;lt;/State&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;Saying&amp;gt;&lt;/span&gt;Is For Lovers&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Saying&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/TourismEntity&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;TourismEntity&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;State&amp;gt;&lt;/span&gt;Wisconsin&lt;span class=&quot;nt&quot;&gt;&amp;lt;/State&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;Saying&amp;gt;&lt;/span&gt;America&amp;#39;s Dairyland&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Saying&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/TourismEntity&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/TransmissionFile&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You will get:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; ruby emit_tourism_entity.rb transmission_file.xml 
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; tail +1 tourism_entity-*
&lt;span class=&quot;go&quot;&gt;==&amp;gt; tourism_entity-1.txt &amp;lt;==&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  &amp;lt;TourismEntity&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;State&amp;gt;New York&amp;lt;/State&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;Saying&amp;gt;I♥NY&amp;lt;/Saying&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  &amp;lt;/TourismEntity&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;==&amp;gt; tourism_entity-2.txt &amp;lt;==&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  &amp;lt;TourismEntity&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;State&amp;gt;Virginia&amp;lt;/State&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;Saying&amp;gt;Is For Lovers&amp;lt;/Saying&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  &amp;lt;/TourismEntity&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;==&amp;gt; tourism_entity-3.txt &amp;lt;==&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  &amp;lt;TourismEntity&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;State&amp;gt;Wisconsin&amp;lt;/State&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    &amp;lt;Saying&amp;gt;America&amp;#39;s Dairyland&amp;lt;/Saying&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  &amp;lt;/TourismEntity&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;What’s happening is:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Ruby spawns &lt;code&gt;sgrep&lt;/code&gt; using a pipe&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;sgrep&lt;/code&gt; spits out a stream of element bodies separated by “XXXSTART” and “STOPXXX” into the pipe&lt;/li&gt;
  &lt;li&gt;Ruby reads from the pipe and watches for element bodies separated by the aforementioned magic tokens&lt;/li&gt;
  &lt;li&gt;When Ruby sees a whole element body, it runs &lt;code&gt;#emit&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;why-are-you-so-amazed-by-this-program-from-1995&quot;&gt;Why are you so amazed by this program from 1995&lt;/h3&gt;

&lt;p&gt;Because just look at that beautiful syntax:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; sgrep &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;quot;{&amp;quot; .. &amp;quot;}&amp;quot;&amp;#39;&lt;/span&gt; eval.c&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And because memory usage is really low, and it’s really fast.&lt;/p&gt;

&lt;h3 id=&quot;i-have-less-than-100-elements-and-just-want-to-split-up-the-file&quot;&gt;I have less than 100 elements and just want to split up the file&lt;/h3&gt;

&lt;p&gt;Both of these will break up the XML file into separate files without the need for a Ruby wrapper:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; split -p &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;lt;TourismEntity&amp;#39;&lt;/span&gt; transmission_file.xml
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; csplit -s -k transmission_file.xml &lt;span class=&quot;s1&quot;&gt;&amp;#39;/&amp;lt;TourismEntity/&amp;#39;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;{100}&amp;#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;But there are little problems, like you max out at 100 separate files (i.e. elements), and other things.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Upsert for MySQL, PostgreSQL, and SQLite3 (and Ruby)</title>
   <link href="http://numbers.brighterplanet.com/2012/09/04/upsert-for-mysql-postgresql-sqlite3-and-ruby"/>
   <updated>2012-09-04T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/09/04/upsert-for-mysql-postgresql-sqlite3-and-ruby</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;Our &lt;a href=&quot;https://github.com/seamusabshere/upsert&quot;&gt;&lt;code&gt;upsert&lt;/code&gt;&lt;/a&gt; library for Ruby gives you NoSQL-like &lt;code&gt;upsert&lt;/code&gt; functionality in traditional RDBMS databases. How?&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;MySQL’s native &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/insert-on-duplicate.html&quot;&gt;&lt;code&gt;INSERT ... ON DUPLICATE KEY UPDATE&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;PostgreSQL’s canonical &lt;a href=&quot;http://www.postgresql.org/docs/9.1/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE&quot;&gt;&lt;code&gt;CREATE FUNCTION merge_db&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;SQLite3’s &lt;a href=&quot;http://www.sqlite.org/lang_insert.html&quot;&gt;&lt;code&gt;INSERT OR IGNORE&lt;/code&gt;&lt;/a&gt; plus a trailing &lt;code&gt;UPDATE&lt;/code&gt; statement&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;faster-than-activerecord&quot;&gt;50%–80% faster than ActiveRecord&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;New in 0.4.0&lt;/strong&gt;: When used in PostgreSQL mode, database functions are re-used, so you don’t have to be in batch mode to get the speed advantage.&lt;/p&gt;

&lt;p&gt;You &lt;strong&gt;don’t&lt;/strong&gt; need &lt;a href=&quot;http://api.rubyonrails.org/classes/ActiveRecord/Base.html&quot;&gt;ActiveRecord&lt;/a&gt; to use it, but it’s benchmarked against ActiveRecord and found to be up to 50% to 80% faster than traditional techniques for emulating upsert:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;#&lt;/span&gt; postgresql &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;pg library&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Upsert was 78% faster than find + new/set/save&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Upsert was 78% faster than find_or_create + update_attributes&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Upsert was 88% faster than create + rescue/find/update&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;#&lt;/span&gt; mysql &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;mysql2 library&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Upsert was 46% faster than find + new/set/save&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Upsert was 63% faster than find_or_create + update_attributes&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Upsert was 74% faster than create + rescue/find/update&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Upsert was 28% faster than faking upserts with activerecord-import (which uses ON DUPLICATE KEY UPDATE)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;#&lt;/span&gt; sqlite3
&lt;span class=&quot;go&quot;&gt;Upsert was 72% faster than find + new/set/save&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Upsert was 74% faster than find_or_create + update_attributes&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Upsert was 83% faster than create + rescue/find/update&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(run the tests on your own machine to get these benchmarks)&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;what-is-a-selector-what-is-a-document&quot;&gt;What is a selector? What is a document?&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;upsert&lt;/code&gt; was inspired by the MongoDB upsert method – AKA &lt;a href=&quot;http://api.mongodb.org/ruby/1.6.4/Mongo/Collection.html#update-instance_method&quot;&gt;mongo-ruby-driver’s update method&lt;/a&gt; – and involves a “selector” (how to find the row to be inserted or updated) and a “document” (attributes that should be set once the record has been found.)&lt;/p&gt;

&lt;h4 id=&quot;example-1&quot;&gt;Example 1&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Selector: &lt;code&gt;:name =&amp;gt; &#39;Jerry&#39;&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Document: &lt;code&gt;:age =&amp;gt; 5&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Expression: &lt;code&gt;upsert.row({:name =&amp;gt; &#39;Jerry&#39;}, :age =&amp;gt; 5)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;example-2&quot;&gt;Example 2&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Selector: &lt;code&gt;:id =&amp;gt; 45&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Document: &lt;code&gt;:updated_at =&amp;gt; Time.now&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Expression: &lt;code&gt;upsert.row({:id =&amp;gt; 45}, :updated_at =&amp;gt; Time.now)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unfortunately, you currently &lt;strong&gt;can’t&lt;/strong&gt; do things like &lt;code&gt;:counter =&amp;gt; &#39;counter + 1&#39;&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;quickstart&quot;&gt;Quickstart&lt;/h3&gt;

&lt;p&gt;One record at a time:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Mysql2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;upsert&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Upsert&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;pets&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;upsert&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Jerry&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:breed&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;beagle&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;With ActiveRecord helper: (first &lt;code&gt;require &#39;upsert/active_record_upsert&#39;&lt;/code&gt;)&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;no&quot;&gt;Pet&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;upsert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Jerry&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:breed&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;beagle&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In batch mode, which is the fastest:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Mysql2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Upsert&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;batch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;pets&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;upsert&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;upsert&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Jerry&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:breed&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;beagle&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;upsert&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Pierre&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:breed&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;tabby&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Graphite and statsd – beyond the basics</title>
   <link href="http://numbers.brighterplanet.com/2012/08/27/graphite-beyond-the-basics"/>
   <updated>2012-08-27T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/08/27/graphite-beyond-the-basics</id>
   <author>
     <name>derek</name>
   </author>
   <content type="html">&lt;p&gt;The &lt;a href=&quot;http://graphite.wikidot.com/&quot;&gt;Graphite&lt;/a&gt; and &lt;a href=&quot;http://github.com/etsy/statsd&quot;&gt;statsd&lt;/a&gt; systems have been &lt;a href=&quot;http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/&quot;&gt;popular&lt;/a&gt; choices lately for recording system statistics, but there isn’t much written beyond how to get the basic system set up. Here are a few tips that will make your life easier.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;graphite--statsd---the-rundown&quot;&gt;Graphite + statsd - the rundown&lt;/h3&gt;

&lt;p&gt;The graphite and statsd &lt;a href=&quot;http://www.aosabook.org/en/graphite.html&quot;&gt;system&lt;/a&gt; consists of three main applications&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;carbon: a service that receives and stores statistics&lt;/li&gt;
  &lt;li&gt;statsd: a node server that provides an easier and more performant, UDP-based protocol for receiving stats which are passed off to carbon&lt;/li&gt;
  &lt;li&gt;graphite: a web app that creates graphs out of the statistics recorded by carbon&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;use-graphiti&quot;&gt;Use graphiti&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;http://graphite.readthedocs.org/en/latest/tools.html&quot;&gt;Several alternative front-ends&lt;/a&gt; to graphite have been written. I chose to use graphiti because it had the most customizable graphs. Note that graphiti is just a facade on top of graphite - you still need the graphite web app running for it to work. Graphiti makes it easy to quickly create graphs. I’ll cover this later.&lt;/p&gt;

&lt;p&gt;The flow looks like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;|App| ==[UDP]==&amp;gt; |statsd| ==&amp;gt; |carbon| ==&amp;gt; |.wsp file|

|.wsp file| ==&amp;gt; |graphite| ==&amp;gt; |graphiti| ==&amp;gt; |pretty graphs on your dashboard|
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;use-chef-solo-to-install-it&quot;&gt;Use chef-solo to install it&lt;/h3&gt;

&lt;p&gt;If you’re familiar with &lt;a href=&quot;http://wiki.opscode.com/display/chef/Home&quot;&gt;chef&lt;/a&gt;, you can use the cookboos that the community has already developed for installing graphite and friends. If not, this would be a good opportunity to learn. You can use chef-solo to easily deploy graphite to a single server. I plan to write a “getting started with chef-solo” post soon, so stay tuned!&lt;/p&gt;

&lt;p&gt;Chef saved me a ton of time setting up python, virtualenv, graphite, carbon, whisper, statsd, and many other tools since there are no OS-specific packages for some of these.&lt;/p&gt;

&lt;h3 id=&quot;use-sensible-storage-schemas&quot;&gt;Use sensible storage schemas&lt;/h3&gt;

&lt;p&gt;The default chef setup of graphite stores all stats with the following storage schema rule:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[catchall]
priority = 0
pattern = ^.*
retentions = 60:100800,900:63000
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The retentions setting is the most important. It’s a comma-delimited list of data resolutions and amounts.
* The number before the colon is the size of the bucket that holds data in seconds. A value of 60 means that 60 seconds worth of data is grouped together in the bucket. A larger number means the data is less granular, but more space efficient.
* The number after the colon is the number of data buckets to store at that granularity. 100800 will cover (100800 * 60) = 70 days of data. That’s (100800 * 12) = 1.2MiB of space for those 70 days. A bigger number means more disk space and longer seek times.&lt;/p&gt;

&lt;p&gt;Alternatively, you can specify retentions using time format shortcuts. For example, 1m:7d means “store 7 days worth of 1-minute granular data.”&lt;/p&gt;

&lt;h3 id=&quot;use-a-good-stats-client&quot;&gt;Use a good stats client&lt;/h3&gt;

&lt;p&gt;In the ruby world, there are two popular client libraries: &lt;a href=&quot;http://rubygems.org/gems/fozzie&quot;&gt;fozzie&lt;/a&gt; and &lt;a href=&quot;http://rubygems.org/gems/statsd-ruby&quot;&gt;statsd-ruby&lt;/a&gt;. Both provide the standard operations like counting events, timing, and gauging values.&lt;/p&gt;

&lt;p&gt;Fozzie differs in that it integrates with Rails or rack apps by adding a rack middleware that automatically tracks timing statistics for every path in your web app. This can save time, but it also has the downside of sending too much noise to your statsd server and can cause excessive disk space consumption unless you implement tight storage schema rules. It also adds a deep hierarchy of namespaces based on the client machine name, app name, and current environment. This can be an issue on heroku web apps where the machine name changes frequently.&lt;/p&gt;

&lt;p&gt;If you want more control over your namespacing, statsd-ruby is the way to go. Otherwise, fozzie may be worth using for its added conveniences.&lt;/p&gt;

&lt;h3 id=&quot;make-sure-you-dont-run-out-of-disk-space&quot;&gt;Make sure you don’t run out of disk space&lt;/h3&gt;

&lt;p&gt;Seriously, if you do run out of disk, the graphite (whisper) data files can become corrupted and force you to delete them and start over. I learned this the hard way :) Make sure your storage schemas are strict enough because each separate stat requires its own file that can be several megabytes in size.&lt;/p&gt;

&lt;h3 id=&quot;use-graphiti-for-building-graphs-and-dashboards&quot;&gt;Use graphiti for building graphs and dashboards&lt;/h3&gt;

&lt;p&gt;Graphiti has a great interface for building graphs. You can even fork it and deploy your own custom version that fits your company’s needs and/or style. It’s a small rack app that uses redis to store graph and dashboard settings. There’s even a chef cookbook for it!&lt;/p&gt;

&lt;p&gt;When setting up graphiti, remember to set up a cron job to run &lt;code&gt;rake graphiti:metrics&lt;/code&gt; periodically so that you can search for metric namespaces from graphiti.&lt;/p&gt;

&lt;h3 id=&quot;use-graphites-built-in-functions-for-summarizing-and-calculating-data&quot;&gt;Use graphite’s built-in functions for summarizing and calculating data&lt;/h3&gt;

&lt;p&gt;Graphite provides a wealth of &lt;a href=&quot;http://graphite.readthedocs.org/en/1.0/functions.html&quot;&gt;functions&lt;/a&gt; that run aggregate operations on data before it is graphed.&lt;/p&gt;

&lt;p&gt;For example, let’s say we’re tracking hit counts on our app’s home page. We’re using several web servers for load balancing and our stats data is namespaced by server under &lt;code&gt;stats.my_app.server-a.production.home-page.hits&lt;/code&gt; and &lt;code&gt;stats.my_app.server-b.production.home-page.hits&lt;/code&gt;. If we told graphite to graph results for &lt;code&gt;stats.my_app.*.production.home-page.hits&lt;/code&gt; we would get two graph lines – one for server-a and one for server-b. To combine them into a single measurement, use the &lt;code&gt;sumSeries&lt;/code&gt; function. You can then use the alias function to give it a friendlier display name like “Home page.”&lt;/p&gt;

&lt;p&gt;Graphiti has a peculiar way of specifying which function to use. In a normal series list, you have the following structure:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&quot;targets&quot;: [
  [
    &quot;stats.my_app.*.production.home-page.hits&quot;,
    {}
  ]
]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;{}&lt;/code&gt; is an object used to specify the list of functions to apply, in order, on the series specified in the parent array. Each graphite function is specified as a key and its parameters as the value. A &lt;code&gt;true&lt;/code&gt; value indicates the function needs no parameters and an array is provided if the function requires multiple parameters.&lt;/p&gt;

&lt;p&gt;You’ll notice in the function documentation that each function usually takes two initial arguments, a context and a series name. In graphiti, you won’t need to specify those first two arguments.&lt;/p&gt;

&lt;p&gt;Here’s an example of sumSeries and alias used together. Note that the order matters!&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&quot;targets&quot;: [
  [
    &quot;stats.my_app.*.production.home-page.hits&quot;,
    {
      &quot;sumSeries&quot;: true,
      &quot;alias&quot;: &quot;Homepage hits&quot;
    }
  ]
]
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;different-graph-areamode-for-different-applications&quot;&gt;Different graph areaMode for different applications&lt;/h3&gt;

&lt;p&gt;While not well documented, graphite has a few options for displaying graph lines. By default, the “stacked” area mode stacks each measurement on top of each other into an area chart that combines multiple measurements that are uniquely shaded. This can be good for seeing grand totals. The blank option plots each measurement as a line on a line chart. This is preferable for comparing measurements.&lt;/p&gt;

&lt;h3 id=&quot;different-metrics-for-different-events&quot;&gt;Different metrics for different events&lt;/h3&gt;

&lt;p&gt;Each stats recording method provided by statsd-ruby and fozzie has different behavior, which isn’t well documented anywhere.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;Stats.count&lt;/code&gt; is the base method for sending a count of some event for a given instance. It’s rarely used alone.&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;Stats.increment&lt;/code&gt; and &lt;code&gt;Stats.decrement&lt;/code&gt; will adjust a count of an event. It’s useful for counting things like number of hits on a page, number of times an activity occurs, etc. It will be graphed as “average number of events per second”. So if your web app runs &lt;code&gt;Stats.increment &#39;hits&#39;&lt;/code&gt; 8 times over a 1 second period, the graph will draw a value of 8 for that second. Sometimes you will see fractional numbers charted. This is because graphite may average the data over a time period based on your schema storage settings and charting resolution.&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;Stats.timing&lt;/code&gt; will take a block and store the amount of time the code in the block took to execute. It also keeps track of average, min, and max times, as well as standard deviation and total number of occurrences. &lt;/li&gt;
  &lt;li&gt;&lt;code&gt;Stats.gauge&lt;/code&gt; tracks absolute values over time. This is useful for tracking measurements like CPU, memory, and disk usage.&lt;/li&gt;
  &lt;li&gt;Fozzie provides &lt;code&gt;Stats.event &#39;party&#39;&lt;/code&gt; to track when an event happens. This is useful for tracking things like deploys or restarts. Equivalent functionality can be obtained in statsd-ruby by running &lt;code&gt;Stats.count &#39;party&#39;, Time.now.to_i&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;bonus-tip-graphs-on-your-mac-dashboard&quot;&gt;Bonus tip: Graphs on your Mac dashboard&lt;/h3&gt;

&lt;p&gt;If you’re using a mac, you can add your favorite graphs to your dashboard. Create a graph in graphiti, then view it on the graphiti dashboard with Safari. Click File-&amp;gt;Open in Dashboard… and select the graph image with the select box. Now, you can quickly see important graphs at the press of a button!&lt;/p&gt;

&lt;p&gt;Overall, statsd is a great tool and can add great visibility into your applications.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Analyze CREATE TABLE SQL with pure Ruby</title>
   <link href="http://numbers.brighterplanet.com/2012/08/27/analyze-create-table-sql-with-ragel-and-ruby"/>
   <updated>2012-08-27T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/08/27/analyze-create-table-sql-with-ragel-and-ruby</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;You can use the new &lt;a href=&quot;https://github.com/seamusabshere/create_table&quot;&gt;&lt;tt&gt;create_table&lt;/tt&gt; library&lt;/a&gt; to analyze and inspect CREATE TABLE statements (what is the primary key? what are the column data types? what are the defaults?) You can also generate SQL that works with different databases.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-irb&quot; data-lang=&quot;irb&quot;&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;create_table&amp;#39;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;=&amp;gt; true&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;CreateTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%{&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  CREATE TABLE employees&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  (employeeid INTEGER NOT NULL,&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  lastname VARCHAR(25) NOT NULL,&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  firstname VARCHAR(25) NOT NULL,&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  reportsto INTEGER NULL); &lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;=&amp;gt; #&amp;lt;CreateTable&amp;gt;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;columns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;=&amp;gt; [&amp;quot;employeeid&amp;quot;, &amp;quot;lastname&amp;quot;, &amp;quot;firstname&amp;quot;, &amp;quot;reportsto&amp;quot;]&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;columns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:data_type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;=&amp;gt; [&amp;quot;INTEGER&amp;quot;, &amp;quot;CHARACTER VARYING(25)&amp;quot;, &amp;quot;CHARACTER VARYING(25)&amp;quot;, &amp;quot;INTEGER&amp;quot;]&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;columns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:allow_null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;=&amp;gt; [false, false, false, true]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;!-- more start --&gt;

&lt;p&gt;(grabbed that example from the &lt;a href=&quot;http://databases.about.com/od/sql/a/tables_2.htm&quot;&gt;About.com entry on CREATE TABLE SQL&lt;/a&gt;, thanks!)&lt;/p&gt;

&lt;h3 id=&quot;uses-ragel-for-parsing&quot;&gt;Uses Ragel for parsing&lt;/h3&gt;

&lt;p&gt;The library uses &lt;a href=&quot;http://www.complang.org/ragel/&quot;&gt;Ragel&lt;/a&gt; internally for parsing.&lt;/p&gt;

&lt;p&gt;Check out the &lt;a href=&quot;https://github.com/seamusabshere/create_table/blob/master/lib/create_table/column.rl&quot;&gt;column parser code&lt;/a&gt;, for example.&lt;/p&gt;

&lt;h3 id=&quot;translates-among-mysql-postgresql-and-sqlite3&quot;&gt;Translates among MySQL, PostgreSQL, and SQLite3&lt;/h3&gt;

&lt;p&gt;Early versions target &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/create-table.html&quot;&gt;MySQL&lt;/a&gt;, &lt;a href=&quot;http://www.postgresql.org/docs/9.1/static/sql-createtable.html&quot;&gt;PostgreSQL&lt;/a&gt;, and &lt;a href=&quot;http://www.sqlite.org/lang_createtable.html&quot;&gt;SQLite&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-irb&quot; data-lang=&quot;irb&quot;&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;create_table&amp;#39;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;=&amp;gt; true&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;CreateTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%{&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  CREATE TABLE cats (&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    id INTEGER AUTO_INCREMENT, /* AUTO_INCREMENT with an underscore is MySQL-style... */&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    nickname CHARACTER VARYING(255),&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    birthday DATE,&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    license_id INTEGER,&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    price NUMERIC(5,2),&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    PRIMARY KEY (&amp;quot;id&amp;quot;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  )&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;=&amp;gt; #&amp;lt;CreateTable&amp;gt;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_mysql&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;=&amp;gt; [&amp;quot;CREATE TABLE cats ( `id` INTEGER PRIMARY KEY AUTO_INCREMENT, nickname CHARACTER VARYING(255), birthday DATE, license_id INTEGER, price NUMERIC(5,2) )&amp;quot;]&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_postgresql&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;=&amp;gt; [&amp;quot;CREATE TABLE cats ( \&amp;quot;id\&amp;quot; SERIAL PRIMARY KEY, nickname CHARACTER VARYING(255), birthday DATE, license_id INTEGER, price NUMERIC(5,2) )&amp;quot;]&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_sqlite3&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;=&amp;gt; [&amp;quot;CREATE TABLE cats ( \&amp;quot;id\&amp;quot; INTEGER PRIMARY KEY AUTOINCREMENT, nickname CHARACTER VARYING(255), birthday DATE, license_id INTEGER, price NUMERIC(5,2) )&amp;quot;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;obviously-theres-a-web-service&quot;&gt;Obviously there’s a web service&lt;/h3&gt;

&lt;p&gt;You can POST statements to &lt;a href=&quot;http://create-table.herokuapp.com/statements&quot;&gt;http://create-table.herokuapp.com/statements&lt;/a&gt; and get the results back as JSON:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; curl -i -X POST -H &lt;span class=&quot;s2&quot;&gt;&amp;quot;Accept: application/json&amp;quot;&lt;/span&gt; --data &lt;span class=&quot;s2&quot;&gt;&amp;quot;CREATE TABLE cats ( id INTEGER AUTO_INCREMENT, nickname CHARACTER VARYING(255), birthday DATE, license_id INTEGER, price NUMERIC(5,2), PRIMARY KEY (\&amp;quot;id\&amp;quot;) )&amp;quot;&lt;/span&gt; http://create-table.herokuapp.com/statements
&lt;span class=&quot;go&quot;&gt;HTTP/1.1 201 Created&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Cache-Control: max-age=0, private, must-revalidate&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Content-Type: application/json; charset=utf-8&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Date: Fri, 24 Aug 2012 22:24:52 GMT&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Etag: &amp;quot;f13513b9126eb1fb909229e828c6a7cd&amp;quot;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Location: http://create-table.herokuapp.com/statements/9&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Server: thin 1.4.1 codename Chromeo&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;X-Rack-Cache: invalidate, pass&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;X-Runtime: 0.051092&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;X-Ua-Compatible: IE=Edge,chrome=1&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Content-Length: 1490&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Connection: keep-alive&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;{&amp;quot;statement&amp;quot;:{&amp;quot;original&amp;quot;:&amp;quot;CREATE TABLE cats ( id INTEGER AUTO_INCREMENT, nickname CHARACTER VARYING(255), birthday DATE, license_id INTEGER, price NUMERIC(5,2), PRIMARY KEY (\&amp;quot;id\&amp;quot;) )&amp;quot;,&amp;quot;mysql&amp;quot;:&amp;quot;CREATE TABLE cats ( `id` INTEGER PRIMARY KEY AUTO_INCREMENT, nickname CHARACTER VARYING(255), birthday DATE, license_id INTEGER, price NUMERIC(5,2) )&amp;quot;,&amp;quot;postgresql&amp;quot;:&amp;quot;CREATE TABLE cats ( \&amp;quot;id\&amp;quot; SERIAL PRIMARY KEY, nickname CHARACTER VARYING(255), birthday DATE, license_id INTEGER, price NUMERIC(5,2) )&amp;quot;,&amp;quot;sqlite3&amp;quot;:&amp;quot;CREATE TABLE cats ( \&amp;quot;id\&amp;quot; INTEGER PRIMARY KEY AUTOINCREMENT, nickname CHARACTER VARYING(255), birthday DATE, license_id INTEGER, price NUMERIC(5,2) )&amp;quot;,&amp;quot;columns&amp;quot;:[{&amp;quot;name&amp;quot;:&amp;quot;id&amp;quot;,&amp;quot;data_type&amp;quot;:&amp;quot;INTEGER&amp;quot;,&amp;quot;allow_null&amp;quot;:false,&amp;quot;default&amp;quot;:null,&amp;quot;primary_key&amp;quot;:true,&amp;quot;unique&amp;quot;:true,&amp;quot;autoincrement&amp;quot;:true,&amp;quot;charset&amp;quot;:null,&amp;quot;collate&amp;quot;:null},{&amp;quot;name&amp;quot;:&amp;quot;nickname&amp;quot;,&amp;quot;data_type&amp;quot;:&amp;quot;CHARACTER VARYING(255)&amp;quot;,&amp;quot;allow_null&amp;quot;:true,&amp;quot;default&amp;quot;:null,&amp;quot;primary_key&amp;quot;:false,&amp;quot;unique&amp;quot;:false,&amp;quot;autoincrement&amp;quot;:false,&amp;quot;charset&amp;quot;:null,&amp;quot;collate&amp;quot;:null},{&amp;quot;name&amp;quot;:&amp;quot;birthday&amp;quot;,&amp;quot;data_type&amp;quot;:&amp;quot;DATE&amp;quot;,&amp;quot;allow_null&amp;quot;:true,&amp;quot;default&amp;quot;:null,&amp;quot;primary_key&amp;quot;:false,&amp;quot;unique&amp;quot;:false,&amp;quot;autoincrement&amp;quot;:false,&amp;quot;charset&amp;quot;:null,&amp;quot;collate&amp;quot;:null},{&amp;quot;name&amp;quot;:&amp;quot;license_id&amp;quot;,&amp;quot;data_type&amp;quot;:&amp;quot;INTEGER&amp;quot;,&amp;quot;allow_null&amp;quot;:true,&amp;quot;default&amp;quot;:null,&amp;quot;primary_key&amp;quot;:false,&amp;quot;unique&amp;quot;:false,&amp;quot;autoincrement&amp;quot;:false,&amp;quot;charset&amp;quot;:null,&amp;quot;collate&amp;quot;:null},{&amp;quot;name&amp;quot;:&amp;quot;price&amp;quot;,&amp;quot;data_type&amp;quot;:&amp;quot;NUMERIC(5,2)&amp;quot;,&amp;quot;allow_null&amp;quot;:true,&amp;quot;default&amp;quot;:null,&amp;quot;primary_key&amp;quot;:false,&amp;quot;unique&amp;quot;:false,&amp;quot;autoincrement&amp;quot;:false,&amp;quot;charset&amp;quot;:null,&amp;quot;collate&amp;quot;:null}]}}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Submissions are recorded so that you can add errata to them—like &lt;a href=&quot;http://create-table.herokuapp.com/statements/9#disqus_thread&quot;&gt;this one&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Madison Ruby Conf 2012 Healthy Hacker Fun Run</title>
   <link href="http://numbers.brighterplanet.com/2012/08/23/madison-ruby-conf-2012-healthy-hacker-fun-run-day-one"/>
   <updated>2012-08-23T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/08/23/madison-ruby-conf-2012-healthy-hacker-fun-run-day-one</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;Thanks to those who showed up for the Fun Run! Photos coming soon.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>How to parse quotes in Ragel (and Ruby)</title>
   <link href="http://numbers.brighterplanet.com/2012/08/21/how-to-parse-quotes-in-ragel"/>
   <updated>2012-08-21T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/08/21/how-to-parse-quotes-in-ragel</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;The key to parsing quotes in Ragel is &lt;tt&gt;([^’\] | /\./)*&lt;/tt&gt; as found in the &lt;a href=&quot;http://www.complang.org/ragel/examples/rlscan.rl&quot;&gt;&lt;code&gt;rlscan&lt;/code&gt; example&lt;/a&gt;. Think of it as &lt;tt&gt;( not_quote_or_escape | escaped_something )*&lt;/tt&gt;.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;making-it-work-with-single-and-double-quotes&quot;&gt;Making it work with single and double quotes&lt;/h3&gt;

&lt;p&gt;Here’s the heart of &lt;a href=&quot;/images/2012-08-21-how-to-parse-quotes-in-ragel/not_scanner.rl.txt&quot;&gt;a working example&lt;/a&gt; that covers both single and double quotes:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ragel&quot; data-lang=&quot;ragel&quot;&gt;&lt;span class=&quot;o&quot;&gt;%%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  machine not_scanner;&lt;/span&gt;

&lt;span class=&quot;x&quot;&gt;  action Start &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    s = p&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  action Stop &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    quoted_text = data[s...p].pack(&amp;#39;c*&amp;#39;)&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    # do something with the quoted text!&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;

&lt;span class=&quot;x&quot;&gt;  squote = &amp;quot;&amp;#39;&amp;quot;;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  dquote = &amp;#39;&amp;quot;&amp;#39;;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  not_squote_or_escape = [^&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;\\];&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  not_dquote_or_escape = [^&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;\\];&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  escaped_something = /\\./;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  ss = space* squote ( not_squote_or_escape | escaped_something )* &amp;gt;Start %Stop squote;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  dd = space* dquote ( not_dquote_or_escape | escaped_something )* &amp;gt;Start %Stop dquote;&lt;/span&gt;

&lt;span class=&quot;x&quot;&gt;  main := (ss | dd)*;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;why-does-it-work&quot;&gt;Why does it work?&lt;/h3&gt;

&lt;p&gt;Use this example string:&lt;/p&gt;

&lt;p style=&quot;font-size: large&quot;&gt;&quot;a\&quot;bc&quot;&lt;/p&gt;

&lt;p&gt;Follow it on the graph: (notice the symmetry… the “top” processes double quotes and the “bottom” processes single quotes)&lt;/p&gt;

&lt;p class=&quot;wide&quot;&gt;
  &lt;a href=&quot;/images/2012-08-21-how-to-parse-quotes-in-ragel/not_scanner.svg&quot; title=&quot;graph of the state machine&quot;&gt;
    &lt;img src=&quot;/images/2012-08-21-how-to-parse-quotes-in-ragel/not_scanner.png&quot; alt=&quot;thumbnail of the graph of the state machine&quot; /&gt;
  &lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;… tl;dr …&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;   &quot;      a     \     &quot;     b      c      &quot;
➇  →  ➁  →  ➂  →  ➃  →  ➂  →  ➂  →  ➂  →  ➇
                     BAM!
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;State ➃ is eating the escaped double quote and therefore preventing the machine from stopping—that’s the key!&lt;/p&gt;

&lt;h3 id=&quot;you-can-also-do-it-with-a-scanner&quot;&gt;You can also do it with a scanner&lt;/h3&gt;

&lt;p&gt;Here’s what you would do in &lt;a href=&quot;/images/2012-08-21-how-to-parse-quotes-in-ragel/scanner.rl.txt&quot;&gt;a scanner&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ragel&quot; data-lang=&quot;ragel&quot;&gt;&lt;span class=&quot;o&quot;&gt;%%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  machine scanner;&lt;/span&gt;

&lt;span class=&quot;x&quot;&gt;  action GotOne &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    quoted_text = data[(ts+1)...(te-1)].pack(&amp;#39;c*&amp;#39;)&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    # do something with quoted text!&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;

&lt;span class=&quot;x&quot;&gt;  squote = &amp;quot;&amp;#39;&amp;quot;;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  dquote = &amp;#39;&amp;quot;&amp;#39;;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  not_squote_or_escape = [^&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;\\];&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  not_dquote_or_escape = [^&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;\\];&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  escaped_something = /\\./;&lt;/span&gt;

&lt;span class=&quot;x&quot;&gt;  main := |*&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    squote ( not_squote_or_escape | escaped_something )* squote =&amp;gt; GotOne;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    dquote ( not_dquote_or_escape | escaped_something )* dquote =&amp;gt; GotOne;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    any;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  *|;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Simple, clean reports in Ruby</title>
   <link href="http://numbers.brighterplanet.com/2012/07/20/simple-clean-reports-in-ruby"/>
   <updated>2012-07-20T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/07/20/simple-clean-reports-in-ruby</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;Our &lt;a href=&quot;https://github.com/seamusabshere/report&quot;&gt;&lt;code&gt;report&lt;/code&gt;&lt;/a&gt; library for Ruby is the shortest path between&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mysql&amp;gt; select * from employees;
+----+------------+-----------+---------+------------+---------+
| id | first_name | last_name | salary  | birthdate  | role    |
+----+------------+-----------+---------+------------+---------+
|  1 | Deirdre    | Irish     |   45000 | 1960-09-10 | Liaison |
|  2 | Gregor     | German    | 16000.5 | 1950-09-09 | Tech    |
|  3 | Spence     | Scot      |    5000 | 1955-12-11 | Joker   |
|  4 | Vincent    | French    | 8000.99 | 1947-04-17 | Fixer   |
|  5 | Sam        | American  | 16000.5 | 1930-04-02 | Planner |
+----+------------+-----------+---------+------------+---------+
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and simple, clean reports like&lt;/p&gt;

&lt;p&gt;
  &lt;a href=&quot;/images/2012-07-20-simple-clean-reports-in-ruby/tps.xlsx&quot; title=&quot;.xlsx version of the TPS report&quot;&gt;
    &lt;img src=&quot;/images/2012-07-20-simple-clean-reports-in-ruby/tps.xlsx.thumb.png&quot; alt=&quot;screenshot of the .xlsx version of the TPS report&quot; /&gt;
  &lt;/a&gt;
&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;of-the-way-by-default&quot;&gt;90% of the way by default&lt;/h3&gt;

&lt;p&gt;Did you notice these little details?&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Business-class typography&lt;/strong&gt;: Arial 10pt, left-aligned text and dates, right-aligned numbers and currency&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Auto-fit to contents&lt;/strong&gt;: always enabled&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Autofilters&lt;/strong&gt;: always added to your column headers&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Freeze pane&lt;/strong&gt;: always frozen beneath your column headers&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s the code that generated it:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Tps&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Report&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;table&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Hierarchy&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;TPS code&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:code&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Date&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:date&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Section&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Hierarchy&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;rows&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:employees&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;last_name ASC&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Full name&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;first_name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;last_name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Role&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Salary&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:type&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:Currency&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;table&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Seniority&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;TPS code&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:code&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Date&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:date&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Section&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Seniority&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;rows&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:employees&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;birthdate DESC&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Full name&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;first_name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;last_name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Birthdate&amp;#39;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Over 70?&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;kp&quot;&gt;attr_reader&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:code&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;initialize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;vi&quot;&gt;@code&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;code&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;employees&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;Employee&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;each&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;employee&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;employee&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;date&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;today&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And here’s how you generate it:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Tps&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;ABC123&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#&amp;lt;Tps:0x00000101426998 @code=&amp;quot;ABC123&amp;quot;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Employee&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Load&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;36&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;no&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;last_name&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ASC&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Employee&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Load&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;no&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;birthdate&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;DESC&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;/var/folders/Nm/Nm0HFsHAH90Zyt7NLDUZUE+++TI/-Tmp-/133538737_Report__Xlsx.xlsx&amp;quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Employee&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Load&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;no&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;last_name&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ASC&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Employee&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Load&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;no&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;birthdate&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;DESC&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;/var/folders/Nm/Nm0HFsHAH90Zyt7NLDUZUE+++TI/-Tmp-/133548261_Report__Pdf.pdf&amp;quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;csv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;paths&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Employee&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Load&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;no&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;last_name&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ASC&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Employee&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Load&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;no&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`employees`&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;birthdate&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;DESC&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;/var/folders/Nm/Nm0HFsHAH90Zyt7NLDUZUE+++TI/-Tmp-/133553761_Report__Csv__Table_Hierarchy.csv&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;/var/folders/Nm/Nm0HFsHAH90Zyt7NLDUZUE+++TI/-Tmp-/133553767_Report__Csv__Table_Seniority.csv&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You get paths to files in the tmp dir. Only the CSV output format gives you multiple files.&lt;/p&gt;

&lt;h3 id=&quot;three-output-formats-xlsx-pdf-and-csv&quot;&gt;Three output formats: XLSX, PDF, and CSV&lt;/h3&gt;

&lt;p&gt;You’ve already seen the XLSX output format - it’s currently the most advanced.&lt;/p&gt;

&lt;p&gt;The PDF output format starts each table on its own page:&lt;/p&gt;

&lt;p&gt;
  &lt;a href=&quot;/images/2012-07-20-simple-clean-reports-in-ruby/tps.pdf&quot; title=&quot;.pdf version of the TPS report&quot;&gt;
    &lt;img src=&quot;/images/2012-07-20-simple-clean-reports-in-ruby/tps.pdf.thumb.png&quot; alt=&quot;screenshot of the .pdf version of the TPS report&quot; /&gt;
  &lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;The CSV output format puts each table into its own file:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;TPS code,ABC123
Date,2012-07-19
Section,Hierarchy

Full name,Role,Salary
Sam American,Planner,16000.5
Vincent French,Fixer,8000.99
Gregor German,Tech,16000.5
Deirdre Irish,Liaison,45000.0
Spence Scot,Joker,5000.0&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;
  &lt;a href=&quot;/images/2012-07-20-simple-clean-reports-in-ruby/tps0.csv&quot;&gt;tps0.csv&lt;/a&gt;
  &lt;a href=&quot;/images/2012-07-20-simple-clean-reports-in-ruby/tps1.csv&quot;&gt;tps1.csv&lt;/a&gt;
&lt;/p&gt;

&lt;h3 id=&quot;how-the-dsl-works&quot;&gt;How the DSL works&lt;/h3&gt;

&lt;p&gt;See the following for a line-by-line analysis…&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# don&amp;#39;t forget to inherit from Report&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Tps&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Report&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# this is the sheet name in excel&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;table&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Hierarchy&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# calling Tps#code&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;TPS code&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:code&lt;/span&gt;

      &lt;span class=&quot;c1&quot;&gt;# calling Tps#date&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Date&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:date&lt;/span&gt;

      &lt;span class=&quot;c1&quot;&gt;# no calls are made&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Section&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Hierarchy&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# Tps#employees(&amp;#39;last_name ASC&amp;#39;)&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;rows&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:employees&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;last_name ASC&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

      &lt;span class=&quot;c1&quot;&gt;# instance_eval&amp;#39;ing the proc on Employee... getting Employee#first_name + &amp;#39; &amp;#39; + Employee#last_name&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Full name&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;first_name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;last_name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

      &lt;span class=&quot;c1&quot;&gt;# Employee#role&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Role&amp;#39;&lt;/span&gt;

      &lt;span class=&quot;c1&quot;&gt;# formatted as currency where available (currently only XLSX output)&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Salary&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:type&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:Currency&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;header-and-footer-print-styles&quot;&gt;Header and footer print styles&lt;/h3&gt;

&lt;p&gt;You can apply formatting to the XLSX and PDF output formats according to what the underlying libraries support:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Tps&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Report&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# [...]&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# Where 72 = 1 inch&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;format_pdf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;:stamp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;expand_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;../acme_letterhead/report_template_landscape.pdf&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;:body&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:width&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;72&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:header&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;ss&quot;&gt;:document&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;ss&quot;&gt;:top_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;118&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;ss&quot;&gt;:right_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;36&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;ss&quot;&gt;:bottom_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;72&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;ss&quot;&gt;:left_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;36&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;ss&quot;&gt;:page_layout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:landscape&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# Whatever is supported by https://github.com/seamusabshere/xlsx_writer&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;format_xlsx&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;quiet_booleans!&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;acme_logo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;expand_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;../acme_letterhead/acme_logo.emf&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;118&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;107&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;acme_logo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;croptop&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;11025f&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;acme_logo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cropleft&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;9997f&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;brighterplanet_logo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;expand_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;../acme_letterhead/brighterplanet_logo.emf&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;116&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;36&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;acme_logo&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Corporate TPS Reporting Program&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;footer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Confidential&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;footer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Powered by &amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;brighterplanet_logo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;footer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:page_x_of_y&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;page_setup&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;top&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;page_setup&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;header&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;xlsx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;page_setup&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;footer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;wishlist&quot;&gt;Wishlist&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;Finalize the DSL - do you like it?&lt;/li&gt;
  &lt;li&gt;Finish documenting all the methods&lt;/li&gt;
  &lt;li&gt;Make sure XLSX output format renders on all versions of Microsoft Office above 2007&lt;/li&gt;
&lt;/ol&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>The Green Button that could have been</title>
   <link href="http://numbers.brighterplanet.com/2012/07/18/the-green-button-that-could-have-been"/>
   <updated>2012-07-18T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/07/18/the-green-button-that-could-have-been</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;What’s the first step in discovering efficiency opportunities? &lt;strong&gt;Data, data, data&lt;/strong&gt;. That’s what we always say here at &lt;a href=&quot;http://brighterplanet.com&quot;&gt;Brighter Planet&lt;/a&gt;, where we’re trying to &lt;a href=&quot;http://impact.brighterplanet.com&quot;&gt;compute our way&lt;/a&gt; to a more hopeful environmental future.&lt;/p&gt;

&lt;p&gt;So I’m sure it won’t surprise you when I say that the key to the energy challenge also starts with data: &lt;strong&gt;how much&lt;/strong&gt; we’re using and &lt;strong&gt;when&lt;/strong&gt; and &lt;strong&gt;where&lt;/strong&gt; we’re using it. Which makes it all the more poignant to write this critique of the much-lauded &lt;a href=&quot;http://greenbuttondata.org/&quot;&gt;Green Button&lt;/a&gt; program, which ostensibly is &lt;em&gt;all about&lt;/em&gt; opening up energy data.&lt;/p&gt;

&lt;p&gt;The truth is that Green Button, as a government advocacy program, has not succeeded in unleashing the gold rush of energy efficiency magic we know is locked up in the heads of entrepreneurs. Developers aren’t building apps, consumers aren’t using them, and utilities aren’t playing ball. &lt;strong&gt;Frankly it’s hard to blame them.&lt;/strong&gt; Luckily there’s a better way to do Green Button, using modern technology to truly empower energy consumers in a lasting, meaningful way. But first . . .&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;back-to-the-beginning&quot;&gt;Back to the beginning&lt;/h3&gt;

&lt;p&gt;Green Button started as a gleam in &lt;strong&gt;U.S. CTO Aneesh Chopra&lt;/strong&gt;’s eye. At the &lt;a href=&quot;http://www.gridweek.com/2011/&quot;&gt;GridWeek2011&lt;/a&gt; Smart Grid event, Aneesh challenged the energy industry to provide consumers with a “green button” you can click to download detailed energy use data. Here’s the bit from his keynote:&lt;/p&gt;

&lt;object class=&quot;wide&quot; width=&quot;651&quot; height=&quot;366&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/EZIkzRXJl38?version=3&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;start=1353&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;embed src=&quot;http://www.youtube.com/v/EZIkzRXJl38?version=3&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;start=1353&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;651&quot; height=&quot;366&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; /&gt;&lt;/object&gt;

&lt;p&gt;His oratory is certainly inspiring, and, had I been there, I would have been &lt;strong&gt;roused to standing applause&lt;/strong&gt;. But now I can’t help but wonder if the seasoned (grizzled?) energy infrastructure veterans in the crowd immediately saw the flaws in the Green Button challenge.&lt;/p&gt;

&lt;p&gt;I’ve met Aneesh twice (at &lt;a href=&quot;http://strataconf.com&quot;&gt;Strata&lt;/a&gt; and then later at &lt;a href=&quot;http://www.cleanweb.co/&quot;&gt;CleanWebHackathon&lt;/a&gt;) and both times said to myself, &lt;em&gt;here is a sharp guy.&lt;/em&gt; In conversation he is refreshingly blunt and he clearly does not put up with nonsense.&lt;/p&gt;

&lt;p&gt;So although Green Button is now deserving of this critique, I do not believe Aneesh intended for it to be the empty tease it is today. As he said himself in the keynote, &lt;strong&gt;“Nothing’ll be perfect on day one,”&lt;/strong&gt; and so, in that spirit, I will explain where I think this simple promising concept went &lt;strong&gt;so completely wrong&lt;/strong&gt;.&lt;/p&gt;

&lt;h3 id=&quot;buttons-galore&quot;&gt;Buttons galore&lt;/h3&gt;

&lt;p&gt;If you rewind the video a bit, you’ll see that before Aneesh issues his challenge, he describes a program called &lt;a href=&quot;http://www.va.gov/bluebutton/&quot;&gt;Blue Button&lt;/a&gt;, launched at the Veterans Administration, that allows patients to download their medical history with the proverbial click of a blue button.&lt;/p&gt;

&lt;p&gt;Using the VA program as inspiration was Green Button’s &lt;strong&gt;original sin&lt;/strong&gt;. If you look at Blue Button &lt;a href=&quot;http://bluebuttondata.org/faq.php&quot;&gt;promotional materials&lt;/a&gt;, you’ll find phrases like “human readable” and “easy-to-read.” Sure, we can program computers to interpret Blue Button files, but their primary purpose is to &lt;em&gt;inform humans&lt;/em&gt;. &lt;strong&gt;Don’t believe me?&lt;/strong&gt; Take a look at a &lt;a href=&quot;http://www.va.gov/BLUEBUTTON/docs/VA_My_HealtheVet_Blue_Button_Sample_Version_12_All_Data.txt&quot;&gt;sample file&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Allergy Name: Pollen
Date:         18 Mar 2010
Severity:     Mild    
Diagnosed:    Yes

Reaction: Watery eyes, itchy nose 

Comments: Took an over the counter antihistamine
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Eyes watering yet?&lt;/p&gt;

&lt;h3 id=&quot;a-smart-move&quot;&gt;A smart move&lt;/h3&gt;

&lt;p&gt;One thing Green Button got right was its data exchange format. Even though the data we’re talking about sounds simple (just a bunch of meter readings with timestamps) there has to be an agreed-upon way to serialize this data, and it turns out there’s an &lt;strong&gt;existing standard&lt;/strong&gt;—NAESB’s &lt;a href=&quot;http://www.naesb.org/ESPI_Standards.asp&quot;&gt;ESPI&lt;/a&gt;—for doing just that.&lt;/p&gt;

&lt;p&gt;Green Button’s adoption of ESPI was an &lt;strong&gt;excellent step in the right direction&lt;/strong&gt;. The &lt;a href=&quot;http://greenbuttondata.org/data/15MinLP_15Days.xml&quot;&gt;data files&lt;/a&gt; are really &lt;em&gt;quite simple&lt;/em&gt; to parse and use with &lt;a href=&quot;https://github.com/energyos/OpenESPI&quot;&gt;existing&lt;/a&gt; &lt;a href=&quot;http://nokogiri.org/&quot;&gt;tools&lt;/a&gt;. It would have been all too easy to follow Blue Button too closely and specify a newline-delimited or otherwise “human readable” file format. Although &lt;strong&gt;who knows&lt;/strong&gt; what your average human would be able to do with this:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;2012-03-01 00:00 to 2012-03-01 00:15  0.302 kWh $0.01&lt;br /&gt;
2012-03-01 00:15 to 2012-03-01 00:30  0.302 kWh $0.01&lt;br /&gt;
2012-03-01 00:30 to 2012-03-01 00:45  0.302 kWh $0.01&lt;br /&gt;
2012-03-01 00:45 to 2012-03-01 01:00  0.302 kWh $0.01&lt;br /&gt;
2012-03-01 01:00 to 2012-03-01 01:15  0.302 kWh $0.01&lt;br /&gt;
2012-03-01 01:15 to 2012-03-01 01:30  0.302 kWh $0.01&lt;br /&gt;
2012-03-01 01:30 to 2012-03-01 01:45  0.302 kWh $0.01&lt;br /&gt;
2012-03-01 01:45 to 2012-03-01 02:00  0.302 kWh $0.01&lt;br /&gt;
2012-03-01 02:00 to 2012-03-01 02:15  0.302 kWh $0.01&lt;br /&gt;
2012-03-01 02:15 to 2012-03-01 02:30  0.302 kWh $0.01&lt;br /&gt;
2012-03-01 02:30 to 2012-03-01 02:45  0.302 kWh $0.01&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;manual-labor&quot;&gt;Manual labor&lt;/h3&gt;

&lt;p&gt;With a human endpoint in mind, Blue Button’s “download this file to your computer and use it how you’d like” interaction model makes &lt;em&gt;perfect sense&lt;/em&gt;. Patients will likely email the file to their doctor or print it out and bring it to an appointment.&lt;/p&gt;

&lt;p&gt;But with energy data, where real value comes from continuous computer analysis, this model is &lt;strong&gt;truly inappropriate&lt;/strong&gt;. Here’s what I, as an energy consumer, must do to leverage the Green Button program:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Discover an interesting energy app&lt;/li&gt;
  &lt;li&gt;Open a new tab&lt;/li&gt;
  &lt;li&gt;Find my utility’s website&lt;/li&gt;
  &lt;li&gt;Log in&lt;/li&gt;
  &lt;li&gt;Find the green button (if it exists!) and click it&lt;/li&gt;
  &lt;li&gt;Choose a place on my computer to save the file&lt;/li&gt;
  &lt;li&gt;Go back to the first tab&lt;/li&gt;
  &lt;li&gt;Click the app’s “upload” link&lt;/li&gt;
  &lt;li&gt;Find the location I saved by data file on my computer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I’ll admit this list is a bit verbose, but you get my point: &lt;strong&gt;it’s a bore&lt;/strong&gt;. The energy app in step 1 is going to have be &lt;em&gt;incredibly interesting&lt;/em&gt; to drive a user through this interaction. And here’s the &lt;strong&gt;really awful part&lt;/strong&gt;: you have to go through all of these steps &lt;em&gt;every time&lt;/em&gt; you want your energy app to have access to new data.&lt;/p&gt;

&lt;p&gt;Imagine if in order to use &lt;a href=&quot;http://mint.com&quot;&gt;Mint.com&lt;/a&gt; you had to visit every one of your online banking accounts every morning, download exports of your transactions, and upload them to your Mint.com profile. &lt;strong&gt;That’s what we’re dealing with&lt;/strong&gt; when it comes to today’s Green Button.&lt;/p&gt;

&lt;p&gt;To put it simply, this is just an &lt;strong&gt;unworkable model&lt;/strong&gt; for developers for anything beyond experimentation. It’s ridiculous to expect your users to go through this process (repeatedly) to draw value from your application, which means a &lt;strong&gt;user base of approximately zero&lt;/strong&gt;, which means a revenue stream of roughly the same amount.&lt;/p&gt;

&lt;p&gt;I’ll be honest that my first reaction to hearing about the &lt;a href=&quot;http://appsforenergy.challenge.gov/&quot;&gt;Apps for Energy&lt;/a&gt; contest was to be a &lt;strong&gt;bit insulted&lt;/strong&gt;. Why should developers spend their valuable time building software on a platform that by its very nature precludes meaningful, lasting user relationships? Well, at least there were &lt;strong&gt;cash prizes&lt;/strong&gt;.&lt;/p&gt;

&lt;h3 id=&quot;a-way-forward&quot;&gt;A way forward&lt;/h3&gt;

&lt;p&gt;What we need is a system that allows us to tell our utility that it’s OK for an energy app we like to have ongoing access to our electricity usage data. This is how we’re able to allow apps like Tweetdeck to look at our Twitter feeds without downloading all of our tweets from Twitter and uploading them to Tweetdeck. It’s how we can add apps to our Facebook accounts that do cool things with our social data.&lt;/p&gt;

&lt;p&gt;This paradigm—applications talking to other applications, about us, with our permission—is the &lt;strong&gt;enduring reward&lt;/strong&gt; of Web 2.0, and it’s exactly what we need in energy land.&lt;/p&gt;

&lt;p&gt;If we can achieve this, it &lt;em&gt;won’t look much like today’s Green Button at all&lt;/em&gt;. We’d probably stick with ESPI for data exchange, but there wouldn’t even be a “green button” involved. (Recall that to add an app to a given platform, you start with the &lt;em&gt;app&lt;/em&gt;, which send you over to a “yes/no” authorization page on the platform.)&lt;/p&gt;

&lt;p&gt;There’s already a &lt;strong&gt;time-tested, secure, best-practice&lt;/strong&gt; way of doing this (&lt;a href=&quot;http://en.wikipedia.org/wiki/OAuth&quot;&gt;OAuth&lt;/a&gt;) that will allow energy app developers to accept data in a universal format with a common authorization process, regardless of the user’s utility. All the developer will need is a database listing the OAuth endpoints for each utility in the country.&lt;/p&gt;

&lt;h3 id=&quot;making-the-case&quot;&gt;Making the case&lt;/h3&gt;

&lt;p&gt;And, of course, &lt;strong&gt;that’s the rub&lt;/strong&gt;. Adoption by utilities of the Green Button program has been &lt;a href=&quot;http://greenbuttondata.org/greenadopt.html&quot;&gt;underwhelming&lt;/a&gt; to say the least: only &lt;em&gt;five&lt;/em&gt; have actually posted the clickable green button to their sites. I don’t think we can ask each utility to voluntarily expose a usage data endpoint via OAuth authentication and expect a more enthusiastic response.&lt;/p&gt;

&lt;p&gt;I know that Aneesh liked to fly a bit &lt;strong&gt;below the radar&lt;/strong&gt; (alas he’s not CTO anymore), championing solutions that don’t require budget outlays, laws, executive orders, or political dogfights. But this is a place where we &lt;em&gt;really need&lt;/em&gt; government direction: &lt;strong&gt;all U.S. electric utilities should be required to offer ESPI data at an OAuth endpoint by Jan. 1, 2014.&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id=&quot;meanwhile&quot;&gt;Meanwhile&lt;/h3&gt;

&lt;p&gt;But of course we developers &lt;strong&gt;don’t like to sit still&lt;/strong&gt;. Theoretically we could build a proxy system that automatically “logs in” to utility accounts, downloads Green Button data, and feeds this data to authorized applications on the user’s behalf.&lt;/p&gt;

&lt;p&gt;This is what we did with &lt;a href=&quot;http://sparkwire.io&quot;&gt;Sparkwire&lt;/a&gt;, and &lt;strong&gt;boy was it a bear&lt;/strong&gt;. We were only able, in fact, to produce a driver for &lt;em&gt;one&lt;/em&gt; utility—PG&amp;amp;E—and for that we had to whip out the &lt;strong&gt;nuclear weapon&lt;/strong&gt; of application integration: screen scraping. Behold:&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/3131346.js?file=pge.rb&quot;&gt; &lt;/script&gt;

&lt;p&gt;&lt;em&gt;What a mess.&lt;/em&gt; And we’d have to do this for each and every utility around the country that we want to support. But in the end, I suppose, that’s better than expecting every one of our users to go through the &lt;strong&gt;download/upload song-and-dance&lt;/strong&gt; every time they wanted some new insight.&lt;/p&gt;

&lt;h3 id=&quot;in-conclusion&quot;&gt;In conclusion&lt;/h3&gt;

&lt;p&gt;If we truly want to empower energy consumers, we must replace Green Button’s “download/upload” torture with a modern, OAuth-powered &lt;strong&gt;“app and platform”&lt;/strong&gt; model. To do this, we either have to prevail upon utilities nationwide to &lt;em&gt;get with the program&lt;/em&gt;, or we use a proxy like Sparkwire and write drivers for the &lt;a href=&quot;http://data.brighterplanet.com/electric_utilities&quot;&gt;3,000-odd&lt;/a&gt; electric utilities around the country.&lt;/p&gt;

&lt;p&gt;Either way, it’s daunting. But it’s gotta happen. &lt;strong&gt;Who’s in?&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id=&quot;ps&quot;&gt;P.S.&lt;/h3&gt;

&lt;p&gt;How incredible is it that they’re even &lt;em&gt;thinking&lt;/em&gt; about something as obscure as energy use data exchange formats in the top advisory levels of the White House? Heady times!
&lt;!-- more end --&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>My CompSust'12 Presentation</title>
   <link href="http://numbers.brighterplanet.com/2012/07/12/my-compsust-presentation"/>
   <updated>2012-07-12T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/07/12/my-compsust-presentation</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;Here are the slides from my talk on our &lt;a href=&quot;http://impact.brighterplanet.com/models/flight&quot;&gt;Flight emitter&lt;/a&gt; at &lt;a href=&quot;/2012/07/10/compsust-12&quot;&gt;CompSust’12&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/pdfs/2012-07-12-my-compsust-presentation/compsust_air_travel_slides.pdf&quot;&gt;&lt;img src=&quot;/images/2012-07-12-my-compsust-presentation/compsust_air_travel_slides.png&quot; alt=&quot;Presentation slides&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I basically gave a quick overview of the model and then summarized some findings from the &lt;a href=&quot;http://static.brighterplanet.com/science/publications/aviation/aviation.pdf&quot;&gt;Air Travel Carbon and Energy Efficiency&lt;/a&gt; paper we released last year.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;People were surprised that so much variation in flight efficiency exists since airlines have a financial incentive to reduce fuel use. They were also interested in how much of the variation was due to seat configuration and wondered to what extent the average passenger would support increased efficiency at the cost of smaller seats.&lt;/p&gt;

&lt;p&gt;Our &lt;a href=&quot;http://careplane.org&quot;&gt;Careplane&lt;/a&gt; browser plugin was a big hit, and a few people asked if we could extend it into an intermodal comparison tool.&lt;/p&gt;

&lt;p&gt;I also presented this poster at the poster session.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/pdfs/2012-07-12-my-compsust-presentation/compsust_air_travel_poster.pdf&quot;&gt;&lt;img src=&quot;/images/2012-07-12-my-compsust-presentation/compsust_air_travel_poster.png&quot; alt=&quot;Poster&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>CompSust'12</title>
   <link href="http://numbers.brighterplanet.com/2012/07/10/compsust-12"/>
   <updated>2012-07-10T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/07/10/compsust-12</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;I’m just back from the &lt;a href=&quot;http://www.computational-sustainability.org/compsust12/index.php&quot;&gt;3rd international conference on computational sustainbality&lt;/a&gt; in Copenhagen, Denmark. A beautiful scandinavian city, a jazz festival, and the latest on using machine learning and linear programming to develop intelligent energy management systems, integrate electric vehicles into the electricity grid, and optimize logistics - who could ask for more?&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;One of the things I liked was the conference’s size. At a bit less than 100 people it was big enough to have a variety of sessions but small enough that you could track down anyone you’d missed or had questions for. It was also a refreshing change to go to an academic conference as opposed to a professional one.&lt;/p&gt;

&lt;p&gt;Some of the presentations I particularly enjoyed included:&lt;/p&gt;

&lt;p&gt;Developing an intelligent system that automatically learns the characteristics of your home and your energy use patterns and then provides energy-saving tips (Nick Jennings).&lt;/p&gt;

&lt;p&gt;A model that improves short-term local wind forecasts by analysing spatio-temporal correlations in forecast versus actual wind speed across all of Denmark (Julija Tastu).&lt;/p&gt;

&lt;p&gt;Optimizing purchasing and distribution logistics for biomass power plants (Niels Kjeldsen).&lt;/p&gt;

&lt;p&gt;Automating the repositioning a shipping fleet (Kevin Tierney).&lt;/p&gt;

&lt;p&gt;Predicting future vegetation cover in the arctic (Theo Damoulas).&lt;/p&gt;

&lt;p&gt;All in all a great summary of how computational techniques are being applied to sustainability issues.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>A Deep Dive Into the New Automobile Emitter</title>
   <link href="http://numbers.brighterplanet.com/2012/06/21/a-deep-dive-into-the-new-automobile-emitter"/>
   <updated>2012-06-21T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/06/21/a-deep-dive-into-the-new-automobile-emitter</id>
   <author>
     <name>derek</name>
   </author>
   <content type="html">&lt;p&gt;We’ve made some exciting changes to our automobile emitter. Let’s take a look!&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h2 id=&quot;all-the-fuels&quot;&gt;All the fuels&lt;/h2&gt;

&lt;p&gt;We now support automobile variants like flex fuel and diesel vehicles. If you want to specify, for instance, a flex fuel Ford F-150, you can specify “FFV” as part of the model name, as in this query:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://impact.brighterplanet.com/automobiles?make=Ford&amp;amp;model=F150%20FFV&amp;amp;year=2012&quot;&gt;http://impact.brighterplanet.com/automobiles?make=Ford&amp;amp;modelF150 FFV&amp;amp;year=2012&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, you can specify an &lt;a href=&quot;http://data.brighterplanet.com/automobile_fuels&quot;&gt;automobile_fuel&lt;/a&gt; and the correct model will be used by CM1:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://impact.brighterplanet.com/automobiles?make=Ford&amp;amp;model=F150&amp;amp;year=2012&amp;amp;automobile_fuel=E85&quot;&gt;http://impact.brighterplanet.com/automobiles?make=Ford&amp;amp;modelF150&amp;amp;year=2012&amp;amp;automobile_fuel=E85&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternative fuels like electricity, compressed natural gas (CNG) and hydrogen are also supported. One of the most difficult tasks facing anyone trying to calculate automobile emissions is to convert from the EPA’s miles per gallon rating to alternative fuel consumption, then convert that fuel value to emissions. We do this all for you, all you need to tell us is distance travelled.&lt;/p&gt;

&lt;p&gt;For electric cars, if you specify a country, we will use that country’s average emissions from electricity generation. Otherwise, a global average is used.&lt;/p&gt;

&lt;h2 id=&quot;activity-years&quot;&gt;Activity Years&lt;/h2&gt;

&lt;p&gt;We now keep track of “activity years” which determine a range of years that an automobile is used. What this means is that when you say “I drove a Volkswagen Rabbit in 2010,” we can get the average emissions for a typical Rabbit that would have been in use in 2010.&lt;/p&gt;

&lt;h2 id=&quot;using-distance-based-emission-factors&quot;&gt;Using distance-based emission factors&lt;/h2&gt;

&lt;p&gt;Previously, we had used per-unit-fuel emission factors like “0.23 kilograms of CO2 per liter of gasoline.” Now we follow EPA’s GHG inventory methodology which calculates the amount of CO2 per unit of distance. This better takes an automobile’s engine characteristics and air conditioning use into account. &lt;/p&gt;

&lt;p&gt;As always, we are available for support in using CM1. If you’re on IRC, you can join us in the #brighterplanet room. You can also email us at &lt;a href=&quot;&amp;#109;&amp;#097;&amp;#105;&amp;#108;&amp;#116;&amp;#111;:&amp;#105;&amp;#110;&amp;#102;&amp;#111;&amp;#064;&amp;#098;&amp;#114;&amp;#105;&amp;#103;&amp;#104;&amp;#116;&amp;#101;&amp;#114;&amp;#112;&amp;#108;&amp;#097;&amp;#110;&amp;#101;&amp;#116;&amp;#046;&amp;#099;&amp;#111;&amp;#109;&quot;&gt;&amp;#105;&amp;#110;&amp;#102;&amp;#111;&amp;#064;&amp;#098;&amp;#114;&amp;#105;&amp;#103;&amp;#104;&amp;#116;&amp;#101;&amp;#114;&amp;#112;&amp;#108;&amp;#097;&amp;#110;&amp;#101;&amp;#116;&amp;#046;&amp;#099;&amp;#111;&amp;#109;&lt;/a&gt; or tweet us &lt;a href=&quot;http://twitter.com/brighterplanet&quot;&gt;@brighterplanet&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Striving for a great API client</title>
   <link href="http://numbers.brighterplanet.com/2012/06/19/how-to-write-a-great-http-api-client"/>
   <updated>2012-06-19T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/06/19/how-to-write-a-great-http-api-client</id>
   <author>
     <name>derek</name>
   </author>
   <content type="html">&lt;p&gt;I wanted to take a moment to share some of the principles and technologies we used to build client libraries for our &lt;a href=&quot;http://impact.brighterplanet.com&quot;&gt;CM1&lt;/a&gt; web service. As developers, we know how frustrating it can be to learn a new API and we keep that in mind as we design our client libraries to spare others of the same frustration.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;make-the-api-client-simple&quot;&gt;Make the API client simple&lt;/h3&gt;

&lt;p&gt;Give first-time developers early wins by avoiding signups. Don’t waste developers’ time with weird object instantiation patterns. A good API is one that takes very little configuration and setup. If I want to run a query, I want to do it with as few lines of code as possible. With our carbon gem you can be up and running with a single function call:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Carbon&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Flight&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;ss&quot;&gt;:origin_airport&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;MSN&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;ss&quot;&gt;:destination_airport&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;ORD&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Carbon for my cross country flight: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;carbon&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;No account setup is needed until you’re in production. Once you’re ready, you can sign up for an API key and set it:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;no&quot;&gt;Carbon&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;MyKeyABC&amp;#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Our JavaScript client works similarly:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;CM1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;cm1&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;CM1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;impacts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;flight&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;origin_airport&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;IAD&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;destination_airport&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;PDX&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;impacts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Carbon for my cross-country flight: &amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                  &lt;span class=&quot;nx&quot;&gt;impacts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;carbon&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Another benefit of a simple API is that it’s easier to mock out when testing an application against it.&lt;/p&gt;

&lt;h3 id=&quot;craft-well-written-documentation&quot;&gt;Craft well-written documentation&lt;/h3&gt;

&lt;p&gt;Document your client library’s code, README, and website. Never assume a new user is familiar with all of the terminology your API uses and explain it well. Note that the simpler your API is, the easier it’ll be to write documentation.&lt;/p&gt;

&lt;h4 id=&quot;ruby-docs-with-yardoc&quot;&gt;Ruby docs with YARDoc&lt;/h4&gt;

&lt;p&gt;You may be familiar with Ruby’s RDoc documentation generator. &lt;a href=&quot;http://yardoc.org/&quot;&gt;YARDoc&lt;/a&gt; is similar, but adds some handy directives that better format your documentation.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;@param&lt;/code&gt; directive - &lt;code&gt;@param [&amp;lt;type&amp;gt;] &amp;lt;name&amp;gt; &amp;lt;description&amp;gt;&lt;/code&gt; - defines a parameter that a function accepts.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;@return&lt;/code&gt; directive - &lt;code&gt;@return [&amp;lt;type&amp;gt;]&lt;/code&gt; - specifies the return value of the function.&lt;/p&gt;

&lt;p&gt;Each &lt;code&gt;@overload&lt;/code&gt; directive &lt;code&gt;@overload &amp;lt;function&amp;gt;(&amp;lt;param&amp;gt;)&lt;/code&gt; tells YARDoc that the function can be called with different method signatures.&lt;/p&gt;

&lt;p&gt;Here’s an example from the carbon gem:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# @overload query(emitter, params)&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#   The simplest form.&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#   @param [String] emitter The {http://impact.brighterplanet.com/emitters.json emitter name}.&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#   @param [optional, Hash] params Characteristics like airline/airport/etc., your API key (if you didn&amp;#39;t set it globally), timeframe, compliance, etc.&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#   @return [Hashie::Mash] The API response, contained in an easy-to-use +Hashie::Mash+&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# @overload query(obj)&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#   Pass in a single query-able object.&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#   @param [#as_impact_query] obj An object that responds to +#as_impact_query+, generally because you&amp;#39;ve declared {Carbon::ClassMethods#emit_as} on its parent class.&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#   @return [Hashie::Mash] The API response, contained in an easy-to-use +Hashie::Mash+&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Carbon&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And here’s the YARDoc output:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-06-19-how-to-write-a-great-http-api-client/yardoc.png&quot; alt=&quot;yardoc output sample&quot; /&gt;&lt;/p&gt;

&lt;p&gt;These directives are important for dynamically typed languages like Ruby.&lt;/p&gt;

&lt;h4 id=&quot;docco&quot;&gt;Docco&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;http://jashkenas.github.com/docco/&quot;&gt;Docco&lt;/a&gt; provides “narrative” style documentation that reads more like a manual than your typical API reference. It turns your comments into documentation on one side of the page, with the actual code on the other side. CM1.js &lt;a href=&quot;http://dkastner.github.com/CM1.js&quot;&gt;uses Docco to great effect&lt;/a&gt;.
&lt;img src=&quot;/images/2012-06-19-how-to-write-a-great-http-api-client/docco.png&quot; alt=&quot;a docco sample&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;html&quot;&gt;HTML&lt;/h4&gt;

&lt;p&gt;Having a dedicated web page for your client or API can be a big help. For example, our &lt;a href=&quot;http://impact.brighterplanet.com/&quot;&gt;CM1 site&lt;/a&gt;, rather than being a brochure for our service, is a guide to using our API and an introduction to our language-specific API clients.&lt;/p&gt;

&lt;h3 id=&quot;eat-your-own-dog-food&quot;&gt;Eat your own dog food&lt;/h3&gt;

&lt;p&gt;It should go without saying, but by using your API for your own projects, you instantly become a constructive critic of your own work. The great benefit is that because you own the API, you get to change it if you don’t like it! This is particularly useful in early stages of API development.&lt;/p&gt;

&lt;h3 id=&quot;use-vcr-or-other-http-mocking-libraries&quot;&gt;Use VCR or other HTTP mocking libraries&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/myronmarston/vcr&quot;&gt;VCR&lt;/a&gt; is a great testing tool that fakes out HTTP requests so that your tests run quickly and are run against real responses. A nice feature of VCR is that you can configure it to refresh response data, say, every month so you can verify that your client still works with your latest API.&lt;/p&gt;

&lt;p&gt;Here’s an example from the carbon gem:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Carbon&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;.query&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;calculates flight impact&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
          &lt;span class=&quot;no&quot;&gt;VCR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;use_cassette&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;LAX-&amp;gt;SFO flight&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:record&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:once&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Carbon&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Flight&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
              &lt;span class=&quot;ss&quot;&gt;:origin_airport&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;LAX&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:destination_airport&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;SFO&amp;#39;&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;decisions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;carbon&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;be_within&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
          &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In JavaScript land, a tool called &lt;a href=&quot;http://documentup.com/assaf/node-replay&quot;&gt;replay&lt;/a&gt; provides similar functionality.&lt;/p&gt;

&lt;h3 id=&quot;do-the-multithreading-for-them&quot;&gt;Do the multithreading for them&lt;/h3&gt;

&lt;p&gt;It’s best to save developers the trouble of handling performance issues by providing a solution. This goes hand-in-hand with eating your own dog food. We took our own pattern of parallelizing CM1 requests and baked it into the carbon gem. Simply pass &lt;code&gt;Carbon.query&lt;/code&gt; an array of calculations to perform, and we’ll use the amazing &lt;a href=&quot;http://rubygems.org/gems/celluloid&quot;&gt;Celluloid gem&lt;/a&gt; to parallelize the requests. Celluloid provides a pool of threaded workers for this task.&lt;/p&gt;

&lt;p&gt;The carbon gem first creates a Celluloid worker pool:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;celluloid&amp;#39;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Carbon&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;QueryPool&lt;/span&gt;
        &lt;span class=&quot;kp&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Celluloid&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;perform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then it hands out each query to workers in the pool:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;queries&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;each&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;pool&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;perform!&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;query&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is a super-simple way to provide parallelism to your API users.&lt;/p&gt;

&lt;h3 id=&quot;make-it-asynchronous&quot;&gt;Make it asynchronous&lt;/h3&gt;

&lt;p&gt;An interesting trend among API providers has been the idea of providing a queued interface. This makes asynchronous processing much easier for developers and also takes some load off of your web servers. We even played around with an SQS-based client at one time with our carbon gem. In the future, we could see a Socket.IO-based, asynchronous API for our JavaScript client.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Writing XLSX from Ruby</title>
   <link href="http://numbers.brighterplanet.com/2012/06/12/writing-xlsx-from-ruby"/>
   <updated>2012-06-12T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/06/12/writing-xlsx-from-ruby</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;Our &lt;a href=&quot;https://github.com/seamusabshere/xlsx_writer&quot;&gt;&lt;code&gt;xlsx_writer&lt;/code&gt;&lt;/a&gt; library for Ruby lets you create spreadsheets compatible with Microsoft Office 2007 Excel and above.&lt;/p&gt;

&lt;h3 id=&quot;features&quot;&gt;Features&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Essential cell types&lt;/strong&gt;: general, currency, date, integer, float (decimal)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Standardized formatting&lt;/strong&gt;: Arial 10pt, left-aligned text and dates, right-aligned numbers and currency&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Auto-fit to contents&lt;/strong&gt;: always enabled&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Autofilters&lt;/strong&gt;: just give it a range of cells&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Header and footer print styles&lt;/strong&gt;: margins, arbitrary text, page numbers, and vector logos (.emf)&lt;/li&gt;
&lt;/ol&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;basic-example&quot;&gt;Basic example&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;xlsx_writer&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;XlsxWriter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Document&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;sheet1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_sheet&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Sheet1&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;sheet1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_row&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;header1&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;header2&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;header3&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;sheet1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_row&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;b&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;c&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;sheet1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_row&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fileutils&amp;#39;&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;FileUtils&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;/path/to/desired/location&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cleanup&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;advanced-example&quot;&gt;Advanced example&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;xlsx_writer&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;XlsxWriter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Document&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;sheet1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_sheet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;People&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# First add data...&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;sheet1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;DoB&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;Occupation&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;Salary&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;Citations&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;Average citations per paper&amp;quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;sheet1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;July 31, 1912&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; 
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;Milton Friedman&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;Economist / Statistician&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:type&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:Currency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10_000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;500_000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;31&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Then add autofilters and page styles...&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;sheet1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_autofilter&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;A1:E1&amp;#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# (figure out your croptop and cropleft by mocking it up in Excel and then unzipping the xlsx file. Get the .emf files, &amp;quot;cropleft&amp;quot; (if necessary), etc. from there)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;left_header_image&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;image1.emf&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;118&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;107&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;left_header_image&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;croptop&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;11025f&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;left_header_image&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cropleft&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;9997f&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;center_footer_image&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;image2.emf&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;116&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;36&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;page_setup&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;top&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;page_setup&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;header&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;page_setup&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;footer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Corporate Reporting&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;footer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Confidential&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;footer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:page_x_of_y&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;left_header_image&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;footer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Powered by &amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;center_footer_image&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Finally you can generate the file.&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fileutils&amp;#39;&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;FileUtils&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;myfile.xlsx&amp;#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# don&amp;#39;t forget&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;doc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cleanup&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;debugging-utilities&quot;&gt;Debugging utilities&lt;/h3&gt;

&lt;p&gt;The library comes with two scripts:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;unpack.rb&lt;/strong&gt;: Takes an XLSX file, unzips it, and reformats the XML it contains to be more readable.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;repack.rb&lt;/strong&gt;: Takes a directory, converts the XML files to DOS line endings, and zips it into &lt;code&gt;out.xlsx&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;They have been useful in the past for debugging Excel crashes. You create a file in &lt;code&gt;xlsx_writer&lt;/code&gt; and also in Excel, then unpack both of them and do a line-by-line comparison of the XML files within using &lt;code&gt;diff -r&lt;/code&gt;.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Vote for Sparkwire!</title>
   <link href="http://numbers.brighterplanet.com/2012/05/17/vote-for-sparkwire"/>
   <updated>2012-05-17T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/05/17/vote-for-sparkwire</id>
   <author>
     <name>derek</name>
   </author>
   <content type="html">&lt;p&gt;We want YOU to &lt;a href=&quot;http://appsforenergy.challenge.gov/submissions/7984-sparkwire&quot;&gt;vote for Sparkwire&lt;/a&gt;, our Apps for Energy challenge entry. It allows any app to access your Green Button data without you having to download it yourself from your utility.&lt;/p&gt;

&lt;h2 id=&quot;green-what&quot;&gt;Green what?&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://greenbuttondata.org&quot;&gt;Green Button&lt;/a&gt; is a new standard being led by the Department of Energy which allows anyone to download their energy usage data from their utility. The DOE started the Apps for Energy contest in April to help drive use of the new standard. Currently, 15 utilities serving 27 million homes have committed to providing Green Button downloads. With this data, there are many ways apps could help us save energy: think targeted conservation tips to comparisons with neighbors to verification of energy-efficiency investments to rewarding greener behavior. Many companies and individuals have already developed great new energy apps to help all of us make sense of this data, reduce our energy use, and save money.&lt;/p&gt;

&lt;p&gt;There is a catch, though: for these energy apps to work well, they have to be able to get our Green Button data without us having to log in and download the data every month/hour/minute. Our experience in helping individuals reduce their environmental impact has taught us that removing barriers to entry is critical. So we created our own app, &lt;a href=&quot;http://sparkwire.io&quot;&gt;Sparkwire&lt;/a&gt;, to easily share your Green Button data with other apps.  You just provide Sparkwire with your utility site login and it does the rest. Any app connected to Sparkwire can pull in your latest data without any additional log-in or download. Don’t worry, your login info is encrypted and can only be used when an app you authorize requests access. &lt;a href=&quot;http://www.youtube.com/watch?v=BSxuSUip_OA&quot;&gt;This video&lt;/a&gt; demonstrates everything.&lt;/p&gt;

&lt;p&gt;Please give us your support by voting today (and every day thereafter :)) at &lt;a href=&quot;http://appsforenergy.challenge.gov/submissions/7984-sparkwire&quot;&gt;challenge.gov&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>2012 Fuel Economy Data</title>
   <link href="http://numbers.brighterplanet.com/2012/05/17/2012-fuel-economy-guide-data"/>
   <updated>2012-05-17T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/05/17/2012-fuel-economy-guide-data</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;Another data update - you can now find the fuel economy and other info for all 2012 model-year automobiles sold in the US in our &lt;a href=&quot;http://data.brighterplanet.com&quot;&gt;public data repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This data release took unusually long to process because we decided to improve the way we handle dual-fuel and alternate fuel vehicles in light of their increasing popularity. We now store all EPA-reported fuel efficiencies for every vehicle. Using the &lt;a href=&quot;http://impact.brighterplanet.com/models/automobile&quot;&gt;Automobile&lt;/a&gt; or &lt;a href=&quot;http://impact.brighterplanet.com/models/automobile_trip&quot;&gt;Automobile Trip&lt;/a&gt; impact models on &lt;a href=&quot;http://impact.brighterplanet.com/&quot;&gt;Cm1&lt;/a&gt; you can specify a particular fuel with the ‘automobile fuel’ characteristic.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Electric Utility Data</title>
   <link href="http://numbers.brighterplanet.com/2012/05/14/electric_utility_data"/>
   <updated>2012-05-14T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/05/14/electric_utility_data</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;We’ve just added US electric utilities to our &lt;a href=&quot;http://data.brighterplanet.com&quot;&gt;public data repository&lt;/a&gt;. Our current data includes which zip codes each utility serves (from the &lt;a href=&quot;http://www.eia.gov/cneaf/electricity/page/eia861.html&quot;&gt;EIA&lt;/a&gt;) and whether the utility has committed to or already begun giving customers access to their own energy information through the &lt;a href=&quot;http://www.greenbuttondata.org/greenadopt.html&quot;&gt;Green Button&lt;/a&gt; program.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://data.brighterplanet.com/electric_utilities&quot;&gt;ElectricUtility&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://data.brighterplanet.com/electric_markets&quot;&gt;ElectricMarket&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://data.brighterplanet.com/green_button_adoptions&quot;&gt;GreenButtonAdoption&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>EcoHackNYC, spring 2012 edition</title>
   <link href="http://numbers.brighterplanet.com/2012/04/29/ecohacknyc"/>
   <updated>2012-04-29T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/04/29/ecohacknyc</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;Last weekend we were proud to sponsor another round of the fantastic &lt;a href=&quot;http://www.ecohacknyc.org/&quot;&gt;EcoHackNYC&lt;/a&gt; green hackathon event.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/ecohack.jpg&quot; alt=&quot;Photo of hackathon&quot; /&gt;
{.wide}&lt;/p&gt;

&lt;p&gt;It’s always amazing to see another crop of apps for the environment emerge over the course of just one day. Personally, I worked with a team on &lt;a href=&quot;http://csabuilder.herokuapp.com/&quot;&gt;CSA Builder&lt;/a&gt;, a tool for local food organizations to figure out where to establish CSA pick-up locations for maximum effect.&lt;/p&gt;

&lt;p&gt;Look forward to next time!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A new perspective on hotel sustainability</title>
   <link href="http://numbers.brighterplanet.com/2012/04/26/a-new-perspective-on-hotel-sustainability"/>
   <updated>2012-04-26T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/04/26/a-new-perspective-on-hotel-sustainability</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;We have released the results of our latest research, focused on assessing the efficiency of 46,000 individual US hotels. The report, &lt;a href=&quot;http://brighterplanet.com/research&quot;&gt;Hotel Carbon &amp;amp; Energy Efficiency&lt;/a&gt;, presents efficiency rankings for 75 of the largest hotel chains, examines key drivers of efficiency, and analyzes industry trends.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-04-26-a-new-perspective-on-hotel-sustainability/map.png&quot; alt=&quot;Average hotel emissions intensity by state&quot; /&gt;&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;The analysis was performed using our CM1-based &lt;a href=&quot;http://impact.brighterplanet.com/models/lodging&quot;&gt;hotel impact model&lt;/a&gt; to estimate footprints for each individual hotel property, based on building characteristics data from the &lt;a href=&quot;http://www.northstartravelmedia.com/&quot;&gt;Northstar Travel Media&lt;/a&gt; hotels database. The model uses factors like a hotel’s location, size, number of floors, climate, construction date, and amenities like fridges and pools to predict energy use and carbon emissions using fuzzy set analysis that references the US EIA’s &lt;a href=&quot;http://www.eia.gov/emeu/cbecs/cbecs2003/detailed_tables_2003/detailed_tables_2003.html&quot;&gt;Commercial Buildings Energy Consumption Survey&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A few key findings include:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Hotel impact per room-night varies more than tenfold across the lodging industry. The most efficient quarter of hotels use just 7% of the industry’s energy, while the dirtiest quarter consume more than 50%.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Footprint reduction opportunities exist for hotel customers at every price point. Major footprint variation exists within service classes and even between hotels of the same chain in the same city, making it possible for most travelers to reduce their impact without increasing cost or limiting travel.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Hotels are growing less and less efficient. Energy and emissions per room-night have doubled over the past 50 years, driven by increasing area per room, increasing amenities, and increasing reliance on dirty fuels.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Hotel chains vary enormously in their impacts. Our analysis ranked &lt;a href=&quot;http://www.vagabondinn.com/&quot;&gt;Vagabond Inns&lt;/a&gt; as the most efficient among 75 of the largest hotel chains, while &lt;a href=&quot;http://www.marriott.com/jw-marriott/travel.mi&quot;&gt;JW Marriott&lt;/a&gt; had the greatest estimated impact per room-night.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Write code, save the planet</title>
   <link href="http://numbers.brighterplanet.com/2012/04/25/write-code-save-the-planet"/>
   <updated>2012-04-25T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/04/25/write-code-save-the-planet</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;We’re happy to announce &lt;a href=&quot;http://greendrea.ms&quot;&gt;greendreams&lt;/a&gt;, a compendium of environmental APIs for all the Cleanweb hackers out there.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://greendrea.ms&quot;&gt;&lt;img src=&quot;/images/greendreams.png&quot; alt=&quot;greendreams screenshot&quot; /&gt;&lt;/a&gt;
{.wide}&lt;/p&gt;

&lt;p&gt;Currently we have 6 APIs listed, but of course the more the merrier, so please &lt;a href=&quot;https://github.com/brighterplanet/greendreams&quot;&gt;fork away&lt;/a&gt; and add your favorites. Big thanks go out to Genability, GoodGuide, NREL, EPA, and AMEE for helping out with the first crop of APIs.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Introducing Prospect</title>
   <link href="http://numbers.brighterplanet.com/2012/04/23/introducing-prospect"/>
   <updated>2012-04-23T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/04/23/introducing-prospect</id>
   <author>
     <name>Derek</name>
   </author>
   <content type="html">&lt;p&gt;Have you ever wanted to add environmental impact data to your site? You’ve probably been too busy or don’t have the resources to have a developer integrate your site with an API like &lt;a href=&quot;http://impact.brighterplanet.com&quot;&gt;CM1&lt;/a&gt;. If so, we have good news for you! With our new service, &lt;a href=&quot;http://prospect.brighterplanet.com/&quot;&gt;Prospect&lt;/a&gt;, you can add the power of CM1 (carbon footprints, resource usage, etc.) to your website with a &lt;em&gt;minimal&lt;/em&gt; amount of coding! If you can edit HTML on a web page, you can be up and running with Prospect in minutes.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;&lt;img src=&quot;/images/prospect.png&quot; alt=&quot;Prospect screenshot&quot; /&gt;{.wrapped}
For example, let’s say you have an automobile sales site and you’d like to show your buyers what the yearly greenhouse gas emissions or fuel usage would be for each car on the page. Simply tell Prospect which HTML elements (using CSS rules) on the page provide input data that can be fed to our &lt;a href=&quot;http://impact.brighterplanet.com/models/automobile&quot;&gt;automobile CM1 model&lt;/a&gt;, insert a special &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag on your page, and the environmental impacts will appear on your page. No need to hire a developer to integrate with CM1. Now your in-house web master or power-user can do it all.&lt;/p&gt;

&lt;p&gt;An example of Prospect in action is at &lt;a href=&quot;http://prospect.brighterplanet.com/otto-s-autos&quot;&gt;http://prospect.brighterplanet.com/otto-s-autos&lt;/a&gt;. Reload and notice how the footprints magically appear at the bottom of each car description. The only change needed on that page was to add a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag at the top.&lt;/p&gt;

&lt;p&gt;With Prospect we hope even more sites will be able to integrate environmental impact measurements and help all of us make greener decisions.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Prius vs. Volt Reprise</title>
   <link href="http://numbers.brighterplanet.com/2012/04/17/prius-volt-reprise"/>
   <updated>2012-04-17T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/04/17/prius-volt-reprise</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;Following the surge in sales of the Chevy Volt in March, we thought it could be interesting to revisit &lt;a href=&quot;http://numbers.brighterplanet.com/2009/08/25/think-the-volt-is-greener-than-the-prius-think-again/&quot;&gt;our post from August 2009&lt;/a&gt; comparing the greenhouse gas emissions of the Volt to the Toyota Prius.&lt;/p&gt;

&lt;p&gt;Sneak peak: the Prius still rules in most of the US.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;The EPA rates the &lt;a href=&quot;http://www.fueleconomy.gov/feg/Find.do?action=sbs&amp;amp;id=31618&quot;&gt;2012 Chevy Volt&lt;/a&gt; at 97 miles per gallon equivalent (36 kilowatt hours per 100 miles) when running on electricity alone, or 60 miles per gallon for a combination of electric- and gasoline-powered driving. That handily beats the &lt;a href=&quot;http://www.fueleconomy.gov/feg/Find.do?action=sbs&amp;amp;id=31767&quot;&gt;2012 Toyota Prius&lt;/a&gt;’ 50 miles per gallon. And yet the Prius is still the greener option for two thirds of Americans.&lt;/p&gt;

&lt;p&gt;How can this be? When running on electricity the Volt doesn’t eliminate emissions, it just shifts them from its tailpipe to a power plant smokestack. And throughout much of the country electricity is more than twice as dirty as gasoline. This map shows where, based on the dirtiness of the power grid, it’s still better to drive a Prius. We’ve assumed the Volt operates in electric-only mode - the Prius would dominate even more if we compared mixed-mode driving.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-04-17-prius-volt-reprise/prius_versus_volt.png&quot; alt=&quot;Map&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Based on &lt;a href=&quot;http://www.epa.gov/cleanenergy/energy-resources/egrid/index.html&quot;&gt;eGRID2010 v1.1&lt;/a&gt; &lt;a href=&quot;http://data.brighterplanet.com/egrid_subregions&quot;&gt;subregion emission factors&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Our goal here isn’t to denigrate the Volt or plug-in hybrids in general. On the contrary we’re excited to see these vehicles entering the mainstream. In the long run electric cars will be cleaner than the most efficient hybrid imaginable, and they’re already the greener choice for anyone who generates their own power from renewable sources or has access to relatively clean grid electricity. Rather we want to emphasize the importance of shifting to cleaner electricity sources in tandem with our transition to efficient electric vehicles. Until we do, so-called “zero emissions vehicles” will remain anything but.&lt;/p&gt;

&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;N.B.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;To simplify the comparison, we’ve assumed that the emissions from manufacturing the Volt and Prius are equivalent and that the vehicles have similar lifetimes. We’ve also left out emissions from extracting, transporting, and processing raw fuels into electricity and gasoline. A rough comparison using Carnegie Mellon’s &lt;a href=&quot;http://www.eiolca.net/&quot;&gt;lifecycle assessment tool&lt;/a&gt; and EIA &lt;a href=&quot;http://www.eia.gov/totalenergy/data/annual/showtext.cfm?t=ptb0524&quot;&gt;energy&lt;/a&gt; &lt;a href=&quot;http://www.eia.gov/electricity/monthly/epm_table_grapher.cfm?t=epmt_5_3&quot;&gt;prices&lt;/a&gt; suggests that the embodied emissions of electricity are greater than those of gasoline, so including these would skew things even farther in the Prius’ favor.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>How to install mosh on Amazon EC2</title>
   <link href="http://numbers.brighterplanet.com/2012/04/14/how-to-install-mosh-on-amazon-ec2"/>
   <updated>2012-04-14T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/04/14/how-to-install-mosh-on-amazon-ec2</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;Here’s how to install &lt;a href=&quot;http://mosh.mit.edu/&quot;&gt;mosh&lt;/a&gt; on &lt;a href=&quot;http://aws.amazon.com/ec2/&quot;&gt;Amazon EC2 instances&lt;/a&gt;:&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h2 id=&quot;using-epel&quot;&gt;Using EPEL&lt;/h2&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;https://github.com/keithw/mosh/wiki/Build-Instructions&quot;&gt;@masnick’s instructions on the mosh wiki&lt;/a&gt;:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;http://aws.amazon.com/amazon-linux-ami/faqs/#epel&quot;&gt;Enable the EPEL repository&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;sudo yum install protobuf-compiler protobuf-devel libutempter-devel ncurses ncurses-devel zlib-devel boost-devel&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Download the latest release from &lt;a href=&quot;http://mosh.mit.edu&quot;&gt;http://mosh.mit.edu&lt;/a&gt;, unzip, and &lt;code&gt;./configure&lt;/code&gt;, &lt;code&gt;make&lt;/code&gt;, &lt;code&gt;sudo make install&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;without-epel&quot;&gt;Without EPEL&lt;/h2&gt;

&lt;p&gt;You have to install &lt;code&gt;protobuf-compiler&lt;/code&gt; and &lt;code&gt;protobuf-devel&lt;/code&gt; manually. Most of the rest is the same.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; sudo yum install git-core boost-devel libutempter-devel ncurses-devel zlib-devel perl-CPAN cpp make automake gcc-c++
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; sudo cpan IO::Pty
&lt;span class=&quot;go&quot;&gt;  [say yes twice]&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; curl -O &lt;span class=&quot;s2&quot;&gt;&amp;quot;http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz&amp;quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; tar -xzf protobuf-2.4.1.tar.gz 
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;protobuf-2.4.1
&lt;span class=&quot;go&quot;&gt;~/protobuf-2.4.1$ ./configure &lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;~/protobuf-2.4.1$ make&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;~/protobuf-2.4.1$ sudo make install&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;~/protobuf-2.4.1$ sudo echo &amp;quot;/usr/local/lib&amp;quot; &amp;gt; /etc/ld.so.conf.d/usr_local_lib.conf&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;~/protobuf-2.4.1$ sudo ldconfig | grep proto&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  [you should see libprotobuf, etc.]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;~/protobuf-2.4.1$ cd&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; git clone https://github.com/keithw/mosh
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;mosh
&lt;span class=&quot;go&quot;&gt;~/mosh$ ./autogen.sh &lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;~/mosh$ ./configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;~/mosh$ make&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;~/mosh$ sudo make install&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here’s something that’s easy to copy-paste:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo yum install git-core boost-devel libutempter-devel ncurses-devel zlib-devel perl-CPAN cpp make automake gcc-c++
sudo cpan IO::Pty
  [say yes twice]
curl -O &quot;http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz&quot;
tar -xzf protobuf-2.4.1.tar.gz 
cd protobuf-2.4.1
./configure 
make
sudo make install
sudo echo &quot;/usr/local/lib&quot; &amp;gt; /etc/ld.so.conf.d/usr_local_lib.conf
sudo ldconfig | grep proto
  [you should see libprotobuf, etc.]
cd
git clone https://github.com/keithw/mosh
cd mosh
./autogen.sh 
./configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
make
sudo make install
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;See the &lt;a href=&quot;/images/2012-04-14-how-to-install-mosh-on-amazon-ec2/my.log&quot;&gt;full log here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Then you need to open the EC2 port: (note UDP)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-04-14-how-to-install-mosh-on-amazon-ec2/open-firewall-for-mosh.png&quot; alt=&quot;Opening ports 60000-61000&quot; /&gt;&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>New flight data from ICAO</title>
   <link href="http://numbers.brighterplanet.com/2012/04/02/new-flight-data-from-icao"/>
   <updated>2012-04-02T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/04/02/new-flight-data-from-icao</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;We’ve just incorporated the latest ICAO flight stage data into our &lt;a href=&quot;http://impact.brighterplanet.com/models/flight&quot;&gt;flight carbon and energy model&lt;/a&gt;. The update includes data for international flights in 2009, 2010, and 2011 and adds several new airlines, such as Air Bucharest, Mihin Lanka, and UTair-Ukraine. It also adds some new direct routes such as &lt;a href=&quot;http://impact.brighterplanet.com/flights?segments_per_trip=1&amp;amp;origin_airport=acc&amp;amp;destination_airport=alg&quot;&gt;Accra to Algier&lt;/a&gt;, &lt;a href=&quot;http://impact.brighterplanet.com/flights?segments_per_trip=1&amp;amp;origin_airport=agp&amp;amp;destination_airport=dmv&quot;&gt;Malaga to Moscow&lt;/a&gt;, and &lt;a href=&quot;http://impact.brighterplanet.com/flights?segments_per_trip=1&amp;amp;origin_airport=zrh&amp;amp;destination_airport=evn&quot;&gt;Zurich to Yerevan&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Will premium gasoline improve your fuel economy?</title>
   <link href="http://numbers.brighterplanet.com/2012/03/14/will-premium-gasoline-improve-your-fuel-economy"/>
   <updated>2012-03-14T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/03/14/will-premium-gasoline-improve-your-fuel-economy</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;This morning’s NPR marketplace included a list of &lt;a href=&quot;http://www.marketplace.org/topics/life/tips-making-most-your-gas-money&quot;&gt;money-saving tips for drivers&lt;/a&gt;. Most are spot-on, but one surprised me: the recommendation that everyone use 91 octane premium gasoline.&lt;/p&gt;

&lt;p&gt;Numerous sources including the &lt;a href=&quot;http://www.ftc.gov/bcp/edu/pubs/consumer/autos/aut12.shtm&quot;&gt;Federal Trade Commission&lt;/a&gt;, &lt;a href=&quot;http://www.scientificamerican.com/article.cfm?id=fact-or-fiction-premium-g&quot;&gt;Scientific American&lt;/a&gt;, and the &lt;a href=&quot;http://www.consumerenergycenter.org/transportation/consumer_tips/regular_vs_premium.html&quot;&gt;California Energy Commission&lt;/a&gt; have debunked the myth that a higher octane rating will give you a performance boost or keep your engine cleaner. Possibly alluding to this, the tip claims that premium gasoline is better “because it’s more filtered, not because of the octane.”&lt;/p&gt;

&lt;p&gt;Since &lt;a href=&quot;http://data.brighterplanet.com/automobile_fuels&quot;&gt;all grades of gasoline have the same energy content&lt;/a&gt; I’m skeptical that any slight difference in purity could make up for a roughly 7% price premium.&lt;/p&gt;

&lt;p&gt;My take: follow the other tips but stick with regular unleaded.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>300,000,000 pounds</title>
   <link href="http://numbers.brighterplanet.com/2012/03/13/300000000-pounds"/>
   <updated>2012-03-13T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/03/13/300000000-pounds</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;I’m getting word that Brighter Planet credit and debit cardholders have collectively blazed past yet another major milestone on the road to a cleaner future: 300,000,000 pounds of carbon dioxide emissions offset!&lt;/p&gt;

&lt;p&gt;Three hundred million pounds. Sounds impressive, but how much prevented CO&lt;sub&gt;2&lt;/sub&gt; is this, really? Well, it’s equivalent to the carbon footprint of all the lights in every US home over more than four days – or of more than eleven million Americans leaving their car in the garage for a day and instead riding their bicycle to work. This volume of CO&lt;sub&gt;2&lt;/sub&gt; would fill a few party balloons for every child on earth – or it would fill one tractor trailer, every single day, for 1800 years.&lt;/p&gt;

&lt;p&gt;An impressive accomplishment indeed. But what’s equally impressive is how it’s been accomplished: through the widespread use of innovative technology and market mechanisms that harness the power of everyday actions to build (quite literally) a clean energy future.&lt;/p&gt;

&lt;p&gt;Thank you, all you Brighter Planet members, for doing your part.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>State electricity emission factors from eGRID</title>
   <link href="http://numbers.brighterplanet.com/2012/03/05/state-electricity-emission-factors"/>
   <updated>2012-03-05T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/03/05/state-electricity-emission-factors</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;Last week I was trying to calculate the greenhouse gas emissions for each building in the EIA Commercial Building Energy Consumption Survey (CBECS) &lt;a href=&quot;http://data.brighterplanet.com/commercial_building_energy_consumption_survey_responses&quot;&gt;microdata&lt;/a&gt;. Fuel oil and natural gas emissions were easy enough, but electricity emissions posed a problem.&lt;/p&gt;

&lt;p&gt;The standard way to calculate electricity emissions in the US is to use EPA &lt;a href=&quot;http://www.epa.gov/cleanenergy/energy-resources/egrid/index.html&quot;&gt;eGRID&lt;/a&gt; emission factors. To do this I needed to know the &lt;a href=&quot;http://data.brighterplanet.com/egrid_subregions&quot;&gt;eGRID subregion&lt;/a&gt; each building was in. Usually I’d use data from the EPA &lt;a href=&quot;http://www.epa.gov/cleanenergy/energy-and-you/how-clean.html&quot;&gt;power profiler tool&lt;/a&gt; to look up the eGRID subregion for each building’s &lt;a href=&quot;http://data.brighterplanet.com/zip_codes&quot;&gt;zip code&lt;/a&gt;. But to ensure anonymity CBECS doesn’t report a building’s zip code or even state, just its &lt;a href=&quot;http://data.brighterplanet.com/census_divisions&quot;&gt;census division&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;My solution was to add population data to most zip codes using &lt;a href=&quot;http://www.census.gov/geo/ZCTA/zcta.html&quot;&gt;ZCTA data&lt;/a&gt; from the 2010 Census. I then calculated the average electricity emission factor across all zip codes in a census division, weighted by population.&lt;/p&gt;

&lt;p&gt;Weighting by population amounts to assuming that the probability of the building being in a particular zip code is proportional to the zip code’s population. For this particular application it’d be better to weight by the number of commercial buildings in each zip code, but population should be a reasonable indicator of this.&lt;/p&gt;

&lt;p&gt;While I was at it I calculated population-weighted average electricity emission factors for each state and added this data to our &lt;a href=&quot;http://data.brighterplanet.com/states&quot;&gt;states table&lt;/a&gt;. These emission factors are a good alternative if you know the state but not the exact eGRID subregion for electricity use. Ideally I’d weight the zip codes by total electricity consumption, but that data simply isn’t available.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Inferential modeling - fuzzy sets vs. cohorts</title>
   <link href="http://numbers.brighterplanet.com/2012/03/01/inferential-modeling-fuzzy-sets-vs-cohorts"/>
   <updated>2012-03-01T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/03/01/inferential-modeling-fuzzy-sets-vs-cohorts</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;Inferential modeling is a big part of our R&amp;amp;D at Brighter Planet. Our &lt;a href=&quot;http://impact.brighterplanet.com/models&quot;&gt;impact models&lt;/a&gt; are designed to estimate the energy use of some activity without necessarily knowing all the variables that directly drive energy use.&lt;/p&gt;

&lt;p&gt;For example, let’s say we want to model the energy use of a modest &lt;a href=&quot;http://impact.brighterplanet.com/lodgings?rooms=1&amp;amp;duration=172800&amp;amp;zip_code=89109&amp;amp;property_name=the+bellagio&quot;&gt;weekend at the Bellagio&lt;/a&gt; in Vegas. We know some information like the local climate and building size, but we don’t know the Bellagio’s exact energy demand. What’s the best way to estimate it?&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;basic-idea-look-at-similar-properties&quot;&gt;Basic idea: look at similar properties&lt;/h3&gt;
&lt;p&gt;A technique we often use in this kind of situation is to cross-reference the information we have with a dataset that includes energy use – in this case the US EIA &lt;a href=&quot;http://data.brighterplanet.com/commercial_building_energy_consumption_survey_responses&quot;&gt;Commercial Buildings Energy Consumption Survey&lt;/a&gt; (CBECS). We find the CBECS records that represent hotels similar to the Bellagio and calculate their average energy intensity.&lt;/p&gt;

&lt;h3 id=&quot;but-whats-similar&quot;&gt;But what’s ‘similar’?&lt;/h3&gt;
&lt;p&gt;The big question is how to identify which CBECS records are similar enough to the Bellagio to merit inclusion in our average. There are two basic methods we’ve employed.&lt;/p&gt;

&lt;h3 id=&quot;cohorts&quot;&gt;Cohorts&lt;/h3&gt;
&lt;p&gt;The cohort approach is clean and simple. Using the &lt;a href=&quot;https://github.com/seamusabshere/cohort_analysis&quot;&gt;cohort_analysis&lt;/a&gt; gem we filter out all CBECS hotel records that don’t match the Bellagio on key variables. If we’re left with fewer records than a pre-defined minimum sample size we drop the least important variable and re-filter until we have enough records. We then calculate the average energy intensity of those records.&lt;/p&gt;

&lt;h3 id=&quot;fuzzy-sets&quot;&gt;Fuzzy sets&lt;/h3&gt;
&lt;p&gt;The fuzzy set approach is more nuanced. It recognizes that for continuous variables or when there’s more than one variable a CBECS hotel record isn’t an all-or-nothing match, but rather varies in its degree of similarity. Using the &lt;a href=&quot;http://github.com/seamusabshere/fuzzy_infer&quot;&gt;fuzzy_infer&lt;/a&gt; gem we assign each record a score for each variable based on how closely it matches the Bellagio. We compile the scores into a “fuzzy weight” and then calculate the average energy intensity across all the records, weighted by their fuzzy weight.&lt;/p&gt;

&lt;h3 id=&quot;but-which-is-better&quot;&gt;But which is better?&lt;/h3&gt;
&lt;p&gt;Both approaches follow the same basic profiling idea, but the cohort method is intuitive and faster while the fuzzy set method requires more computation and a lot of &lt;a href=&quot;https://github.com/seamusabshere/fuzzy_infer/blob/master/README.markdown&quot;&gt;statistical tinkering&lt;/a&gt; to set up. So is the fuzzy set method really worth all the extra trouble?&lt;/p&gt;

&lt;p&gt;We ran some tests, and the answer is definitive.&lt;/p&gt;

&lt;h3 id=&quot;fuzzy-sets-are-significantly-more-accurate&quot;&gt;Fuzzy sets are significantly more accurate&lt;/h3&gt;

&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;&lt;/th&gt;
    &lt;th style=&quot;padding-right: 10px&quot;&gt;Cohort&lt;/th&gt;
    &lt;th&gt;Fuzzy Set&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td style=&quot;padding-right: 10px&quot;&gt;Average variation from actual&lt;/td&gt;
    &lt;td&gt;68%&lt;/td&gt;
    &lt;td&gt;50%&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Median variation from actual&lt;/td&gt;
    &lt;td&gt;43%&lt;/td&gt;
    &lt;td&gt;33%&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Correlation with actual&lt;/td&gt;
    &lt;td&gt;0.29&lt;/td&gt;
    &lt;td&gt;0.76&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-03-01-inferential-modeling-fuzzy-sets-vs-cohorts/cohort_chart.png&quot; alt=&quot;Cohort&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-03-01-inferential-modeling-fuzzy-sets-vs-cohorts/fuzzy_chart.png&quot; alt=&quot;Fuzzy&quot; /&gt;&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Beware of String#hash being used for cache keys...</title>
   <link href="http://numbers.brighterplanet.com/2012/02/29/beware-of-string-hash-being-used-for-cache-keys"/>
   <updated>2012-02-29T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/02/29/beware-of-string-hash-being-used-for-cache-keys</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;Every process will have a &lt;strong&gt;different hash value for the same string&lt;/strong&gt;, so cache keys based on &lt;code&gt;String#hash&lt;/code&gt; will not work as expected!&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-irb&quot; data-lang=&quot;irb&quot;&gt;&lt;span class=&quot;go&quot;&gt;1.9.3-p0 :001 &amp;gt; &amp;#39;test&amp;#39;.hash&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; =&amp;gt; 240227015057187339 &lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1.9.3-p0 :002 &amp;gt; &amp;#39;test&amp;#39;.hash&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; =&amp;gt; 240227015057187339&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;But in another IRB session:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-irb&quot; data-lang=&quot;irb&quot;&gt;&lt;span class=&quot;go&quot;&gt;1.9.3-p0 :001 &amp;gt; &amp;#39;test&amp;#39;.hash&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; =&amp;gt; -2779337368972820904 &lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1.9.3-p0 :002 &amp;gt; &amp;#39;test&amp;#39;.hash&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; =&amp;gt; -2779337368972820904&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;All calls to plain vanilla &lt;code&gt;Object#hash&lt;/code&gt; have the same problem. It turns out it’s intentional…&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;… as &lt;a href=&quot;http://www.ruby-forum.com/topic/560622&quot;&gt;explained by Yui Naruse&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;It is intended. Ruby 1.9 explicitly use session local random seed to calculate a hash for strings (and some other objects).
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;… just not mentioned in &lt;a href=&quot;http://www.ruby-doc.org/core-1.9.3/String.html#method-i-hash&quot;&gt;the core Ruby docs for &lt;code&gt;String#hash&lt;/code&gt;&lt;/a&gt;, which say:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Return a hash based on the string’s length and content.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;There is a &lt;a href=&quot;https://github.com/ruby/ruby/pull/43&quot;&gt;7-month old pull request from FND to fix the docs&lt;/a&gt;… let’s hope it gets merged soon to prevent further confusion!&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Meet our turbocharged lodging model</title>
   <link href="http://numbers.brighterplanet.com/2012/02/23/meet-our-turbocharged-lodging-model"/>
   <updated>2012-02-23T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/02/23/meet-our-turbocharged-lodging-model</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;We’ve just rolled out the latest version of our &lt;a href=&quot;http://impact.brighterplanet.com/models/lodging&quot;&gt;hotel energy and emissions model&lt;/a&gt;, and it includes a number of new advancements that make lodging sustainability quantification more accurate, broadly applicable, and useful than ever before.&lt;/p&gt;

&lt;p&gt;Corporate travel is a fast-growing focus for sustainability managers, and we’re excited about the opportunities these new capabilities will give CM1 clients to empower smarter decision-making in this area.&lt;/p&gt;

&lt;p&gt;This latest version includes four major upgrades:&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Integration of the massive Northstar hotel database. Ian &lt;a href=&quot;http://numbers.brighterplanet.com/2012/01/23/new-hotel-data-from-northstar-travel-media/&quot;&gt;previously posted&lt;/a&gt; about our acquisition of this huge and detailed international hotel properties data set. Today’s update integrates this data into the lodging model, letting users model energy use and GHG emissions for stays at tens of thousands of specific hotels around the world – tourism and business travel applications can now compute sustainability data based on building information from the actual hotels on their itineraries.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Improved climate data. Local climate is a key predictor of the energy efficiency of a hotel room, as it drives heating and air conditioning needs. This release adds nuance to the climatic portion of the model using climate normals data from World Resources Institute’s (WRI) &lt;a href=&quot;http://cait.wri.org&quot;&gt;CAIT database&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;New CBECS fuzzy set analysis. &lt;a href=&quot;http://www.eia.gov/emeu/cbecs/contents.html&quot;&gt;Commercial Buildings Energy Consumption Survey&lt;/a&gt; (CBECS) data from the US EIA has long been central to the lodging model, but we’re now using more advanced big data analysis techniques to make powerful estimates of hotel energy consumption based on factors like a hotel’s construction year, size, and climate control infrastructure.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Amenities-based differentiation. The broad brushstrokes of climate and building infrastructure are key in painting the picture of a hotel’s energy use, but so too are details about specific energy-using appliances. The lodging model now takes information on amenities like fridges, minibars, hot tubs, and swimming pools into account, helping provide even sharper contrast among seemingly similar hotel options.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can test drive the lodging model via our &lt;a href=&quot;http://impact.brighterplanet.com/models/lodging&quot;&gt;query builder&lt;/a&gt; or our &lt;a href=&quot;http://impact.brighterplanet.com/documentation&quot;&gt;API&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Keystone: "XL" is pretty apt</title>
   <link href="http://numbers.brighterplanet.com/2012/02/13/keystone-xl-is-pretty-apt"/>
   <updated>2012-02-13T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/02/13/keystone-xl-is-pretty-apt</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;We’re in the midst of &lt;a href=&quot;http://act.350.org/sign/kxl/&quot;&gt;24 Hours to Stop Keystone XL&lt;/a&gt;, a day-long push by 35+ organizations to send half a million letters to Senators asking them to stop the pipeline. It’s a worthy, urgent cause and we at Brighter Planet will all be &lt;a href=&quot;http://act.350.org/sign/kxl/&quot;&gt;sending our letters&lt;/a&gt; today.&lt;/p&gt;

&lt;p&gt;Naturally we were tinkering with some of the numbers related to Keystone, and one question jumped out at us: Just how much CO2 emissions are represented by the oil in KXL at any given point in time?&lt;/p&gt;

&lt;p&gt;To get an answer we used &lt;a href=&quot;http://impact.brighterplanet.com&quot;&gt;CM1&lt;/a&gt;’s &lt;a href=&quot;http://impact.brighterplanet.com/models/fuel_purchase&quot;&gt;Fuel Purchase&lt;/a&gt; impact model, feeding in the total volume of the pipeline extensions&lt;sup id=&quot;fnref:fn&quot;&gt;&lt;a href=&quot;#fn:fn&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;, along with the type of oil (in this case, crude). The result:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.4 million tons CO2e&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That’s the GHG emissions represented by the oil that would be inside KXL at any point in time. &lt;a href=&quot;http://impact.brighterplanet.com/fuel_purchases?fuel_type=crude&amp;amp;volume=804400000&quot;&gt;Here’s the methodology&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;“XL” is right.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:fn&quot;&gt;
      &lt;p&gt;Wikipedia &lt;a href=&quot;http://en.wikipedia.org/wiki/Keystone_Pipeline#Keystone_XL&quot;&gt;tells us&lt;/a&gt; the radius and length of the two extensions that make up the “XL” part of Keystone. We plugged that into Wolfram Alpha to get &lt;a href=&quot;http://www.wolframalpha.com/input/?i=pi+*+457^2+millimeters^2+*+1226+km&quot;&gt;the volume&lt;/a&gt;. &lt;a href=&quot;#fnref:fn&quot; class=&quot;reversefootnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>New wind offset project</title>
   <link href="http://numbers.brighterplanet.com/2012/01/30/new-wind-offset-project"/>
   <updated>2012-01-30T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/01/30/new-wind-offset-project</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;Time for a new offset project - this time it’s &lt;a href=&quot;http://brighterplanet.com/projects/22-iowa_wind&quot;&gt;wind turbines on two family farms in northern Iowa&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://brighterplanet.com/images/projects/iowa_wind_slide_02.jpg&quot; alt=&quot;Turbine&quot; /&gt;
&lt;em&gt;Image credit: &lt;a href=&quot;http://nativeenergy.com&quot;&gt;NativeEnergy&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once again we’re working with our partner &lt;a href=&quot;http://nativeenergy.com&quot;&gt;NativeEnergy&lt;/a&gt; to support a small project that fights climate change and strengthens the local community. The project’s emissions reductions will be validated and verified under the &lt;a href=&quot;http://www.v-c-s.org/&quot;&gt;Verified Carbon Standard&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;This latest project involves two 1.6 MW turbines, one on Ruth and Ken Benjegerdes farm, the other on Lesley and Nora Mammen’s. Both families have watched as wind turbines transform this mostly coal-powered landscape, bringing jobs, increased tax revenue, and rural economic development. Young people who used to leave the towns have begun to stay, and farmers are welcoming a new source of critical income.&lt;/p&gt;

&lt;p&gt;Lesley Mammen was born in Iowa, although he left for several years before returning home. He and his wife, Nora, can see a large wind farm from their property, which inspired them to investigate wind on their own land.&lt;/p&gt;

&lt;p&gt;Ken Benjegerdes is the grandson of the original homesteaders, and his family has owned the land for nearly 100 years. From the porch of the house in which he was born, Ken and Ruth can now look over their fields of soybeans and corn to watch their own turbine produce renewable energy.&lt;/p&gt;

&lt;p&gt;As always, we’re proud to help our customers and cardholders build a clean energy future.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Cleanweb Hackathon NYC</title>
   <link href="http://numbers.brighterplanet.com/2012/01/27/cleanweb-hackathon-nyc"/>
   <updated>2012-01-27T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/01/27/cleanweb-hackathon-nyc</id>
   <author>
     <name>derek</name>
   </author>
   <content type="html">&lt;p&gt;We’re back from the &lt;a href=&quot;http://cleanwebhack.com/hackathon/&quot;&gt;Cleanweb Hackathon&lt;/a&gt;! It was a great weekend of meeting entrepreneurs in the clean tech space, joining forces with some of New York’s finest hackers, and hanging out at &lt;a href=&quot;http://itp.nyu.edu/itp/&quot;&gt;NYU’s Interactive Telecommunications&lt;/a&gt; space. &lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-01-25-cleanweb-hackathon-nyc/hacking.jpg&quot; alt=&quot;Hacking&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Image credit: &lt;a href=&quot;http://instagr.am/p/jQ9go/&quot;&gt;@greenskeptic&lt;/a&gt;, Instagram&lt;/em&gt;&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;hacking&quot;&gt;Hacking&lt;/h3&gt;

&lt;p&gt;Andy, Seamus and I helped two teams write apps and help get others up and running with our &lt;a href=&quot;http://impact.brighterplanet.com&quot;&gt;CM1&lt;/a&gt; API and &lt;a href=&quot;http://data.brighterplanet.com&quot;&gt;public data&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I helped prototype an app, &lt;a href=&quot;http://cleangpa.com&quot;&gt;CleanGPA&lt;/a&gt;, which gives you a GPA-like score based on your home energy usage. We developed with Rails, and aside from a few hangups around OAuth, I was once again amazed at how fast you can build an app with tools like &lt;a href=&quot;https://github.com/plataformatec/devise#readme&quot;&gt;devise&lt;/a&gt;, &lt;a href=&quot;https://github.com/justinfrench/formtastic#readme&quot;&gt;formtastic&lt;/a&gt;. I’ve also been thrilled with the ease and speed of using &lt;a href=&quot;https://github.com/technoweenie/faraday#readme&quot;&gt;faraday&lt;/a&gt; and &lt;a href=&quot;https://www.relishapp.com/myronmarston/vcr&quot;&gt;vcr&lt;/a&gt; as tools to build clients against RESTful APIs.&lt;/p&gt;

&lt;h3 id=&quot;yoga--juice&quot;&gt;Yoga &amp;amp; Juice&lt;/h3&gt;

&lt;p&gt;We also had the pleasure of sponsoring an hour-long yoga session. It was intense but energized me for the rest of the day. My abs are still a little sore!
&lt;img src=&quot;/images/2012-01-25-cleanweb-hackathon-nyc/cleanweb.jpg&quot; alt=&quot;Andy Yoging it up&quot; /&gt;&lt;/p&gt;

&lt;p&gt;After yoga, we enjoyed some cleansing juices from Liquiteria. I am a huge fan of ginger and these drinks really hit the spot.&lt;/p&gt;

&lt;h3 id=&quot;the-apps&quot;&gt;The Apps&lt;/h3&gt;

&lt;p&gt;The winning apps were &lt;a href=&quot;http://beta.econofy.com/&quot;&gt;Econofy&lt;/a&gt;, an efficient appliance shopping guide and, &lt;a href=&quot;http://nycbldgs.com/&quot;&gt;NYCBldgs&lt;/a&gt;, a tool that highlights the best and worst-performing buildings in New York City. Econofy did a great job rating products on a five-point scale and helping to calculate money saved by projecting electricity costs. NYCBldgs put New York’s public building energy usage data to good use. I was amazed that the city was opening up so much useful data like this. It really goes a long way in helping us “clean tech hackers” get the job done.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>The top 3 things I saw at the Detroit Auto Show</title>
   <link href="http://numbers.brighterplanet.com/2012/01/25/at-the-auto-show"/>
   <updated>2012-01-25T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/01/25/at-the-auto-show</id>
   <author>
     <name>derek</name>
   </author>
   <content type="html">&lt;p&gt;One of the benefits of living in Michigan is getting to swing over to the North American International Auto Show in Detroit. Here are the most interesting sustainability themes I noticed this year. &lt;img src=&quot;/images/2012-01-19-at-the-auto-show/derek-smart.jpg&quot; alt=&quot;Derek at the auto show&quot; style=&quot;width: 250px;&quot; /&gt;&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h2 id=&quot;more-electric&quot;&gt;More electric&lt;/h2&gt;

&lt;p&gt;Nearly every auto maker offers some sort of hybrid, electric, or diesel-powered car. It seems like not very long ago there were only a few companies offering hybrids and many alternative fuel cars were merely concepts. Even Dodge, not normally known for fuel efficiency, boasted of the new Dart offering improved fuel economy with its turbocharged engine.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-01-19-at-the-auto-show/70s-car.png&quot; alt=&quot;70s Electric Car&quot; style=&quot;width: 250px;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I am a geek and one of the neat parts about the auto show is the way the auto makers display their technology. A few companies displayed the inner workings of their electric drivetrains and batteries. It’s very eye-opening to see how many batteries they can stuff into the cars and how may batteries are required just to propel a 2,000lb car at speeds we’re accustomed to. It was also fun to listen to visitors from the auto industry examine and critique the construction of the Tesla drivetrain. It reminded me of all the time I’ve spent evaluating and choosing open source software projects on &lt;a href=&quot;http://github.com&quot;&gt;Github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-01-19-at-the-auto-show/batteries.jpg&quot; alt=&quot;A revealed interior view of a battery pack&quot; style=&quot;width: 250px;&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;alternative-fuels-for-fleets&quot;&gt;Alternative fuels for fleets&lt;/h2&gt;

&lt;p&gt;A company called &lt;a href=&quot;http://www.viamotors.com/&quot;&gt;VIA&lt;/a&gt; really intrigued me. They convert GM trucks and vans into electric vehicles that operate similarly to the Volt. A unique benefit of essentially converting a utility truck into a mobile generator is that you can plug any of your electric tools into an outlet connected to the engine. This sort of conversion could really benefit companies looking to reduce emissions and/or save on fuel costs. Since these are OEM conversions, they will appear in next year’s EPA fuel economy guide, which means they’ll show up in our &lt;a href=&quot;http://data.brighterplanet.com&quot;&gt;database&lt;/a&gt;, too!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-01-19-at-the-auto-show/via.jpg&quot; alt=&quot;VIA&#39;s electric truck&quot; style=&quot;width: 200px;&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;car-alternatives&quot;&gt;Car alternatives&lt;/h2&gt;

&lt;p&gt;With all of the improved gas-burning cars and flashy new (and expensive) “battery-guzzling” electric cars, I was surprised to see something you’d never expect to see at an auto show - bicycles, scooters, and personal rapid transit cabs. Since these smaller vehicles only need a battery a tenth of the size of an electric car (or smaller), these could end up being a more practical solution for many.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2012-01-19-at-the-auto-show/electric-bikes.jpg&quot; alt=&quot;Electric bikes&quot; style=&quot;width: 250px;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Overall, smaller, more efficient vehicles are here in force. There were still plenty of powerful, sporty cars and trucks, but even these are seeing efficiency improvements. For everyday driving, though, better efficiency is a win for the environment - as long as we also reduce or maintain overall vehicle miles traveled.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>New data from Northstar Travel Media</title>
   <link href="http://numbers.brighterplanet.com/2012/01/23/new-hotel-data-from-northstar-travel-media"/>
   <updated>2012-01-23T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/01/23/new-hotel-data-from-northstar-travel-media</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;We’re close to finishing some exciting updates to our &lt;a href=&quot;http://impact.brighterplanet.com/models/lodging&quot;&gt;Lodging&lt;/a&gt; model: soon it will be able to identify the actual hotel a client stayed at and use that property’s physical characteristics to calculate energy use and emissions.&lt;/p&gt;

&lt;p&gt;A key piece in this process is the hotel database we just purchased from &lt;a href=&quot;http://www.northstartravelmedia.com/&quot;&gt;Northstar Travel Media&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Northstar’s database covers more than 200,000 hotels worldwide. Along with a unique identifier for each property, it includes locational information and building attributes such as when the hotel was built, when it was last renovated, and how many rooms it has. It also provides some important energy use indicators like how many rooms are air-conditioned.&lt;/p&gt;

&lt;p&gt;With this new data we’ll be able to fine-tune our energy and emission predictions to reflect the actual characteristics of the hotel where a lodging occurred, rather than relying on broader averages. This is particularly exciting because it will let us start to show differences in emissions between hotels in the same city.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Join us at Cleanweb Hackathon NYC this weekend</title>
   <link href="http://numbers.brighterplanet.com/2012/01/19/join-us-at-cleanweb-hackathon-nyc-this-weekend"/>
   <updated>2012-01-19T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/01/19/join-us-at-cleanweb-hackathon-nyc-this-weekend</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;We’re psyched to be sponsoring—and participating in—this weekend’s &lt;a href=&quot;http://cleanwebhack.com/hackathon/&quot;&gt;Cleanweb Hackathon&lt;/a&gt; in New York City.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm7.staticflickr.com/6042/6316189868_8b9fd8cfe9_z.jpg&quot; alt=&quot;Yoga at EcoHackNYC&quot; /&gt;
{.wide}&lt;/p&gt;

&lt;p&gt;As usual, we’ll be holding a series of Healthy Hacker activities over the course of the weekend. (Above is a &lt;a href=&quot;http://www.flickr.com/photos/jatorre/6316189868/in/photostream&quot;&gt;shot&lt;/a&gt; of the Healthy Hacker yoga class we held during EcoHackNYC in November.)&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;&lt;img src=&quot;http://profile.ak.fbcdn.net/hprofile-ak-ash2/369929_165600215_1267715134_n.jpg&quot; alt=&quot;Brian Nygard&quot; /&gt;{.wrapped} Brian Nygard, a &lt;a href=&quot;http://yogatothepeople.com&quot;&gt;YTTP&lt;/a&gt; instructor, will be leading a yoga session for attendees at 2pm on Saturday. If you want a spot, make sure to put your name on the list first thing in the morning, as space will be limited.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/liquiteria.png&quot; alt=&quot;Liquiteria cup&quot; /&gt;{.wrapped} At 3pm we’re going to have fresh cold-pressed detox juices delivered by NYC’s famous &lt;a href=&quot;http://liquiteria.com&quot;&gt;Liquiteria&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you haven’t signed up for the Hackathon, all the more reason to &lt;a href=&quot;http://cleanwebhack.com/hackathon/&quot;&gt;sign up now!&lt;/a&gt;&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Fuzzy match in Ruby</title>
   <link href="http://numbers.brighterplanet.com/2012/01/18/fuzzy-match-in-ruby"/>
   <updated>2012-01-18T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/01/18/fuzzy-match-in-ruby</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;Our &lt;a href=&quot;https://github.com/seamusabshere/fuzzy_match&quot;&gt;&lt;code&gt;fuzzy_match&lt;/code&gt;&lt;/a&gt; library for Ruby can help link (cross-reference) records across data sources—for example, match up aircraft records from the &lt;a href=&quot;http://www.bts.gov&quot;&gt;Bureau of Transportation Statistics&lt;/a&gt; and the &lt;a href=&quot;http://www.faa.gov/&quot;&gt;Federal Aviation Administration&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;
  &lt;a href=&quot;http://www.transtats.bts.gov/Download_Lookup.asp?Lookup=L_AIRCRAFT_TYPE&quot; title=&quot;BTS aircraft data source&quot;&gt;
    &lt;img src=&quot;/images/2012-01-18-fuzzy-match-in-ruby/bts_aircraft.png&quot; alt=&quot;screenshot of the BTS aircraft data source&quot; /&gt;
  &lt;/a&gt;
  &lt;a href=&quot;http://www.faa.gov/air_traffic/publications/atpubs/CNT/5-2-B.htm&quot; title=&quot;FAA aircraft data source&quot;&gt;
    &lt;img src=&quot;/images/2012-01-18-fuzzy-match-in-ruby/faa_aircraft.png&quot; alt=&quot;screenshot of the FAA aircraft data source&quot; /&gt;
  &lt;/a&gt;
&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;of-the-way-by-default&quot;&gt;90% of the way by default&lt;/h3&gt;

&lt;p&gt;Let’s look at only the Boeing 737 records for now…&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;bts_records&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&amp;#39;Boeing 737-800&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Boeing 737-5/600lr&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Boeing 737-500&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&amp;#39;Boeing 737-400&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Boeing 737-300lr&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Boeing 737-300&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&amp;#39;Boeing 737-100/200&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Boeing 737-200c&amp;#39;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;faa_records&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&amp;#39;737-100&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;737-200, Surveiller (CT-43, VC-96)&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&amp;#39;737-300&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;737-400&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;737-500&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;737-600&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&amp;#39;737-700, BBJ, C-40&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;737-800, BBJ2&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;737-900&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&amp;#39;737 Stage 3 (US ONLY)&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fuzzy_match&amp;#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;BTS&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ljust&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;FAA&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;join&lt;/span&gt;    &lt;span class=&quot;c1&quot;&gt;# print a nice table header&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;matcher&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;FuzzyMatch&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;faa_records&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;c1&quot;&gt;# set up a matcher object&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;bts_records&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;each&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;faa&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;matcher&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;               &lt;span class=&quot;c1&quot;&gt;# given BTS record as input, find a matching FAA record&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ljust&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;faa&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;join&lt;/span&gt;      &lt;span class=&quot;c1&quot;&gt;# print a row showing the match&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;which produces &lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; ruby example.rb
&lt;span class=&quot;go&quot;&gt;BTS                     FAA&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Boeing 737-800          737-800, BBJ2&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Boeing 737-5/600lr      737-600&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Boeing 737-500          737-500&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Boeing 737-400          737-400&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Boeing 737-300lr        737-300&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Boeing 737-300          737-300&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Boeing 737-100/200      737-100&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Boeing 737-200c         737-100  # &amp;lt;- oops!&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;add-rules-to-get-to-95&quot;&gt;Add rules to get to 95%&lt;/h3&gt;

&lt;p&gt;Fuzzy matching may catch 90% by itself, but you will have to define rules to get to 95%.&lt;/p&gt;

&lt;p&gt;In this case, the error is “Boeing 737-200c” matching “737-100”. Let’s use an “identity” rule for “7X7-XXX”…&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;identities&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;
  &lt;span class=&quot;sr&quot;&gt;%r{(7\d7)-?(\d\d\d)}&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# when comparing two records that both contain 7X7, make sure all the digits (but not the dash) are equal&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;matcher&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;FuzzyMatch&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;faa_records&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:identities&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;identities&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;which produces the correct match&lt;/p&gt;

&lt;pre&gt;Boeing 737-200c         737-200, Surveiller (CT-43, VC-96)&lt;/pre&gt;

&lt;h3 id=&quot;rules-and-options&quot;&gt;Rules and options&lt;/h3&gt;

&lt;p&gt;Check out the &lt;a href=&quot;https://github.com/seamusabshere/fuzzy_match&quot;&gt;&lt;code&gt;fuzzy_match&lt;/code&gt; documentation&lt;/a&gt; for all the kinds of rules…&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;:blockings&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;:normalizers&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;:identities&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;:stop_words&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and also options you can pass to &lt;code&gt;find&lt;/code&gt;…&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;:read&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;:must_match_blocking&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;:must_match_at_least_one_word&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;:first_blocking_decides&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s it!&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Why the Brighter Planet API uses POST</title>
   <link href="http://numbers.brighterplanet.com/2012/01/16/our-api-get-vs-post"/>
   <updated>2012-01-16T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2012/01/16/our-api-get-vs-post</id>
   <author>
     <name>derek</name>
   </author>
   <content type="html">&lt;p&gt;Have we really created a &lt;a href=&quot;http://en.wikipedia.org/wiki/Representational_state_transfer#RESTful_web_services&quot;&gt;RESTful&lt;/a&gt; web service? If so, why are we &lt;a href=&quot;http://impact.brighterplanet.com/documentation&quot;&gt;specifying&lt;/a&gt; that users send POST requests to get calculations? I asked this question to the rest of my team and a lively debate ensued among us.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Under the REST convention we use &lt;em&gt;GET&lt;/em&gt; requests to retrieve data that represents some entity pointed to by a URI. We use &lt;em&gt;POST&lt;/em&gt; to create a new entity on the server.&lt;/p&gt;

&lt;p&gt;When a &lt;a href=&quot;http://impact.brighterplanet.com&quot;&gt;CM1&lt;/a&gt; user POSTs a calculation request to our service, e.g. POSTing “airline=Delta” to &lt;code&gt;http://brighterplanet.com/flights.json&lt;/code&gt;, a flight calculation isn’t actually stored on our server. Instead, a calculation is run against the data that exists in our database. Why then do we use the POST verb if no resource is actually created?&lt;/p&gt;

&lt;p&gt;To answer this question, W3C has a handy &lt;a href=&quot;http://www.w3.org/2001/tag/doc/whenToUseGet.html#principles-summary&quot;&gt;guide&lt;/a&gt; for determining which verbs are appropriate in different situations:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;1.3 Quick Checklist for Choosing HTTP GET or POST

Use GET if:
  * The interaction is more like a question (i.e., it
    is a safe operation such as a query, read operation,
    or lookup).
Use POST if:
  * The interaction is more like an order, or
  * The interaction changes the state of the
    resource in a way that the user would perceive
    (e.g., a subscription to a service), or
  * The user be held accountable for the results
    of the interaction.

However, before the final decision to use HTTP GET
or POST, please also consider considerations for
sensitive data and practical considerations.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In our case, we have two reasons to use POST:
1. The calculation request results in the user being billed for usage – “the user is held accountable” for the results.
1. The request contains sensitive information – the user’s API key – which should not be included in a link to a calcuation. That is, a GET URL should double as a hyperlink reference, but we don’t want the API key to be revealed (as in &lt;code&gt;http://impact.brighterplanet.com/flights.json?key=ABC123&lt;/code&gt;.) Every calculation result includes a GET-able methodology link that doesn’t include the API key, so you can safely share the link once the calculation is made.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Sustainability trends to watch</title>
   <link href="http://numbers.brighterplanet.com/2011/12/21/sustainability-trends-to-watch"/>
   <updated>2011-12-21T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/12/21/sustainability-trends-to-watch</id>
   <author>
     <name>Patti</name>
   </author>
   <content type="html">&lt;p&gt;We’ve just posted a &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/107/original/trends-2011.pdf?1324498421&quot;&gt;brief report&lt;/a&gt; on our &lt;a href=&quot;http://brighterplanet.com/research&quot;&gt;research page&lt;/a&gt; with the top five sustainability trends we’re watching out for in 2012. From new pressures to new areas of focus to new management techniques, we think the next year is gearing up to be a big one for the sustainability aroud the world. What would you add to our list?&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>285 million pounds and counting</title>
   <link href="http://numbers.brighterplanet.com/2011/12/21/285_million_and_counting"/>
   <updated>2011-12-21T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/12/21/285_million_and_counting</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;As of today, Brighter Planet’s cardholders have offset more than 285,000,000 pounds of carbon dioxide emissions. By simply using your Brighter Planet credit and debit cards in your daily lives, you’ve helped fund 20 renewable energy and sustainable forestry &lt;a href=&quot;http://brighterplanet.com/projects&quot;&gt;projects&lt;/a&gt;, bringing green jobs to rural America, proving the viability of community-scale clean technologies, and preventing nearly two weeks worth of GHG, SO&lt;sub&gt;2&lt;/sub&gt;, mercury, and particulate pollution from a typical coal-fired power plant.&lt;/p&gt;

&lt;p&gt;The CO&lt;sub&gt;2&lt;/sub&gt; you’ve collectively prevented is equivalent to:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Every home in the US shutting off all its lights for more than 4 days&lt;/li&gt;
  &lt;li&gt;The emissions sequestered by 33 million tree saplings in a year&lt;/li&gt;
  &lt;li&gt;More than 10 million people biking to work for a day instead of driving&lt;/li&gt;
  &lt;li&gt;Each cardholder powering their home with renewable energy for 3 weeks&lt;/li&gt;
  &lt;li&gt;Grounding all air travel to and from NYC for more than 5 days&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep up the good work!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Building snowflakes: the tech behind our holiday card</title>
   <link href="http://numbers.brighterplanet.com/2011/12/19/building-snowflakes-the-tech-behind-our-holiday-card"/>
   <updated>2011-12-19T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/12/19/building-snowflakes-the-tech-behind-our-holiday-card</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;Last week we &lt;a href=&quot;http://numbers.brighterplanet.com/2011/12/16/let-it-snow&quot;&gt;posted our 2011 holiday card&lt;/a&gt;, which has seen quite a bit of traffic since. There’s actually some pretty interesting new technology under the hood, so I thought I’d put together this behind-the-scenes blog post for anybody who’s interested.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;When designing the card, I knew that I wanted to use a kind of &lt;strong&gt;real time&lt;/strong&gt; animation to express the diverse flow of calculations that &lt;a href=&quot;http://impact.brighterplanet.com&quot;&gt;CM1&lt;/a&gt; is performing at any given time. Until recently “real time” on the client side meant &lt;em&gt;polling&lt;/em&gt;, but the recent introduction of &lt;a href=&quot;http://dev.w3.org/html5/websockets/&quot;&gt;&lt;strong&gt;WebSockets&lt;/strong&gt;&lt;/a&gt; has changed all that.&lt;/p&gt;

&lt;p&gt;Ultimately I decided to use &lt;a href=&quot;http://pusher.com&quot;&gt;Pusher&lt;/a&gt;, an incredible service that abstracts away a lot of the messiness of using WebSockets in a &lt;a href=&quot;http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern&quot;&gt;“pubsub”&lt;/a&gt; architecture. Implementing Pusher on the server side meant adding this single line to the right place in CM1’s codebase:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Pusher&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;queries&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;trigger!&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;announce&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;billed_query&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;slice&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;emitter&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;carbon_value&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;What this does: every time a calculation is made on CM1, the “queries” channel within the “CM1” app of our Pusher account receives an “announce” notification including two details from the query (the name of the impact model and its footprint).&lt;/p&gt;

&lt;p&gt;On the client side, the app sets up every browser to act as a “subscriber” to this channel with these three lines in &lt;code&gt;index.html&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;nx&quot;&gt;pusher&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Pusher&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;4441a27a742385492eb3&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// that&amp;#39;s our public Pusher key&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;queries&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;pusher&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;subscribe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;queries&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;queries&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;announce&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;displayQuery&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now, every time a query is performed on CM1, Pusher gets a notification, and this kicks off notifications to all of the browsers currently looking at the card, each of which execute the &lt;code&gt;displayQuery&lt;/code&gt; function with the impact model’s name and footprint as parameters.&lt;/p&gt;

&lt;p&gt;OK, now we now how the card gets the details to display as snowflakes, but how do we draw the actual snowflakes themselves?&lt;/p&gt;

&lt;p&gt;For this we use &lt;strong&gt;HTML5’s &lt;a href=&quot;http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html&quot;&gt;Canvas&lt;/a&gt;&lt;/strong&gt; element for dynamic drawing and animation. In truth, most of the messy animation stuff is handled by the excellent &lt;strong&gt;&lt;a href=&quot;https://github.com/mrdoob/three.js&quot;&gt;Three.js&lt;/a&gt;&lt;/strong&gt; library; the appearance and motion of the snow was inspired by a &lt;a href=&quot;http://sebleedelisle.com/2010/11/javascript-html5-canvas-snow-in-3d/&quot;&gt;post from Seb Lee-Delisle&lt;/a&gt;. I just made a few visual modifications and wired it all up to the notifications coming in from Pusher.&lt;/p&gt;

&lt;p&gt;So, there you have it. Happy to clarify things or answer questions in the comments. Happy holidays!&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Let it snow!</title>
   <link href="http://numbers.brighterplanet.com/2011/12/16/let-it-snow"/>
   <updated>2011-12-16T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/12/16/let-it-snow</id>
   <author>
     <name>Patti</name>
   </author>
   <content type="html">&lt;p&gt;Every year we do a holiday card for our friends (remember &lt;a href=&quot;http://numbers.brighterplanet.com/2010/12/16/reindeer-holiday-carbon-and-the-cloud/&quot;&gt;last year’s&lt;/a&gt;?) that connects the work we do to some aspect of the season. Click the image to check out this year’s card:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://snow.brighterplanet.com&quot;&gt;&lt;img src=&quot;/images/let-it-snow.png&quot; alt=&quot;Happy Holidays from Brighter Planet&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s some fancy new technology under the hood (more on that &lt;del&gt;in a later blog post&lt;/del&gt; &lt;a href=&quot;http://numbers.brighterplanet.com/2011/12/19/building-snowflakes-the-tech-behind-our-holiday-card&quot;&gt;here&lt;/a&gt;), so you’ll need a new-ish browser.&lt;/p&gt;

&lt;p&gt;Wishing you all the best in 2012,
Patti and the team&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Three big trends in employee sustainability engagement</title>
   <link href="http://numbers.brighterplanet.com/2011/12/06/three-big-trends-in-employee-sustainability-engagement"/>
   <updated>2011-12-06T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/12/06/three-big-trends-in-employee-sustainability-engagement</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;Two years ago we reported the results of our first survey on employee sustainability engagement, to a surprising amount of interest from non-profits, businesses, and governments. Today we’re releasing our second biennial &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/105/original/employee_engagement_2011.pdf?1322867541&quot;&gt;survey results&lt;/a&gt; on the subject, updating the picture of engagement initiatives, digging deeper into best practices for effective programs, and analyzing trends in this fast-evolving space.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;We heard from nearly 1000 respondents in 47 states and 51 countries, including employees at WalMart, Visa, UPS, Coca-Cola, Exxon, McDonalds, the US Government, and many other leading organizations. Three things that surprised us from this year’s findings that folks working on green engagement initiatives should keep in mind include:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;It’s not all rosy. Green engagement programs are becoming less effective as they spread. Employers are promoting staff conservation at higher rates than in 2009, but the number of programs rated as “very effective” or “somewhat effective” at actually eliciting green employee actions dropped notably. Are program leaders failing to heed best practices established at the most successful organizations, or are new programs simply slow on the uptake? Either way, it suggests the possibility that employee weariness at ineffective sustainability initiatives could undermine promising progress in this space if it’s not taken seriously.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Breadth is key. A defining characteristic of the most effective programs (compared to those that promote sustainability frequently but have low effectiveness) is that they focus more in emerging green issues like procurement, water use, and business travel. Interestingly, they’re no more likely to promote traditional sustainability issues like recycling, energy use, and commuting than their less successful counterparts. Expanding beyond these basic issues signals forward thinking and perhaps a more genuine environmental commitment – characteristics that are more likely to inspire employee action.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Data is power. Organizations that collect data on their footprint, the impact of staff travel and commuting, and employee sustainability efforts were roughly three times as likely to have a very effective program. And this group is growing, with the number of employers collecting these data increasing 15% since 2009, to three in ten.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The full report is available for free download on our &lt;a href=&quot;http://brighterplanet.com/research&quot;&gt;research page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We’d also like to thank &lt;a href=&quot;http://www.conservation.org/sites/celb/key_initiatives/bsc/Pages/main.aspx&quot;&gt;Conservation International’s Business &amp;amp; Sustainability Council&lt;/a&gt; for helping to get the word out about the survey.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Building queries for fun and profit</title>
   <link href="http://numbers.brighterplanet.com/2011/11/18/building-queries-for-fun-and-profit"/>
   <updated>2011-11-18T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/11/18/building-queries-for-fun-and-profit</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/query_builder.png&quot; alt=&quot;Query builder screenshot&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The primary way to experiment with &lt;a href=&quot;http://impact.brighterplanet.com&quot;&gt;CM1&lt;/a&gt; is to hit the API directly—either with code, a tool like cURL, or with our &lt;a href=&quot;http://numbers.brighterplanet.com/2011/04/20/introducing-bombshell-custom-interactive-consoles-for-your-ruby-libraries&quot;&gt;CM1 console&lt;/a&gt;. But sometimes it’s just easier to play around in a browser, so today we’re rolling out a Query Builder feature for each of our &lt;a href=&quot;http://impact.brighterplanet.com/models&quot;&gt;impact models&lt;/a&gt;. Details after the jump.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;To get started, visit the details page for any of our &lt;a href=&quot;http://impact.brighterplanet.com/models&quot;&gt;impact models&lt;/a&gt;—you’ll find the model’s query builder at the bottom of its page.&lt;/p&gt;

&lt;p&gt;On the left is where you build your request by adding, defining, and tweaking characteristics according to the model’s API (click the “characteristics API” link on that same page for full details).&lt;/p&gt;

&lt;p&gt;As you type, the query builder will continuously submit your request to CM1. Interpretations of your characteristics will display below the text fields, and the carbon impact will update on the right. In the lower right you’ll find some useful representations of this query, including a human-readable methodology link and a copy-pastable cURL command.&lt;/p&gt;

&lt;p&gt;Check out some pre-built queries by using the example dropdown in the upper-right. We’ll be adding many more example queries over the coming week.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>New best practices for green data providers</title>
   <link href="http://numbers.brighterplanet.com/2011/11/08/new-best-practices-for-green-data-providers"/>
   <updated>2011-11-08T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/11/08/new-best-practices-for-green-data-providers</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;This is a time of unprecedented threat to the environment brought about by increasing population and consumption – but it’s also an age of unprecedented opportunity for innovating solutions to these challenges. Increasing migration of daily decisions and activities to cyberspace, and increasing availability of valuable data resources, are giving software developers more opportunity than ever to build data-driven apps that power more sustainable decisions. The movement to build data-driven green apps is just getting started, and the government, business, and non-profit organizations with the data to power these innovative tools have an important role to play in helping ensure their success.&lt;/p&gt;

&lt;p&gt;That’s the focus of our latest report, entitled &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/100/original/green_apps_paper.pdf?1320839534&quot;&gt;Growing the Green Apps Ecosystem&lt;/a&gt;. The paper, edited by Ethan McMahon at the &lt;a href=&quot;http://www.epa.gov/aboutepa/oei.html&quot;&gt;EPA’s Office of Environmental Information&lt;/a&gt;, outlines best practices for data providers in engaging green developers and ensuring their data provision is as developer-friendly as possible. The paper combines the results of interviews we conducted with various green developers, our own experience working with data providers and green apps, and Ethan’s fact-checking perspective as an EPA official helping lead the movement for green apps innovation.&lt;/p&gt;

&lt;p&gt;In the paper we reassess open data practices for data providers, explaining how a focus on data orientation and life cycle can help ensure that open data practices actually meet developer needs. We also outline seven tactics for engaging developers in the creation of green apps, including hackathons, APIs, contests, and data support channels. You can read the full report &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/100/original/green_apps_paper.pdf?1320839534&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>20,000,000 calculations . . . spooky</title>
   <link href="http://numbers.brighterplanet.com/2011/11/02/20-million-calculations"/>
   <updated>2011-11-02T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/11/02/20-million-calculations</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/haunted_house.png&quot; alt=&quot;Haunted house&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Sometime in the darkest hours of Halloween night, our &lt;a href=&quot;http://impact.brighterplanet.com&quot;&gt;CM1 platform&lt;/a&gt; processed its &lt;strong&gt;20,000,000th calculation&lt;/strong&gt;. Hurray!&lt;/p&gt;

&lt;p&gt;But wait: after a couple days of intense analysis, we’re concluding that the &lt;a href=&quot;http://impact.brighterplanet.com/models/residence&quot;&gt;Residence&lt;/a&gt; impact being computed was that of a &lt;em&gt;bona fide&lt;/em&gt; haunted house. We present our argument below.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Here’s the raw request characteristics (location removed to protect the &lt;del&gt;innocent&lt;/del&gt; residents):&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:acquisition&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;2008-09-01&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:air_conditioner_use&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;NOT USED AT ALL&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:annual_coal_volume_estimate&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;0.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:annual_fuel_oil_volume_estimate&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;0.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:annual_kerosene_volume_estimate&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;0.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:annual_propane_volume_estimate&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;0.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:annual_wood_volume_estimate&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;0.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:clothes_drier_use&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:dishwasher_use&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;4 TO 6 TIMES A WEEK&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:floors&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:floorspace_estimate&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;111.484&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:freezer_count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:monthly_electricity_use_estimate&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;600.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:occupation&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;0.937&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:ownership&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:refrigerator_count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:residence_class&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;APARTMENT BUILDING WITH 2-4 UNITS&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:residents&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;3&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:retirement&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;2009-10-07&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:timeframe&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;2011-01-01/2012-01-01&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;:urbanity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;TOWN&amp;quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;As you see, the evidence is clear. Who, besides restless spirits, never use air conditioning? And the 94% occupancy rate means the “residents” are absent 21 days per year—roughly the number of days with a full or near-full moon. Could these dear tenants be, perhaps, quietly stalking the unaware?&lt;/p&gt;

&lt;p&gt;Sure, we can’t explain why these three poltergeist lodgers would need a refrigerator or wash so many dishes, but, after all, there’s no accounting for taste.&lt;/p&gt;

&lt;p&gt;So there we have it, &lt;strong&gt;proof positive&lt;/strong&gt;: ghosts are using CM1.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>HootRoot a winner in EPA Green Apps Challenge</title>
   <link href="http://numbers.brighterplanet.com/2011/11/01/hootroot-a-winner-in-epa-green-apps-challenge"/>
   <updated>2011-11-01T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/11/01/hootroot-a-winner-in-epa-green-apps-challenge</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://hootroot.com/&quot;&gt;HootRoot&lt;/a&gt;, our travel footprint mapping app, has been &lt;a href=&quot;http://blog.epa.gov/data/winners-announced-for-epa-apps-for-the-environment-challenge/&quot;&gt;declared a winner&lt;/a&gt; in the EPA’s &lt;a href=&quot;http://appsfortheenvironment.challenge.gov/submissions&quot;&gt;Apps for the Environment Challenge&lt;/a&gt;! Of the five awards announced in this nationwide contest for the best apps powered by EPA data, HootRoot was named the number two Best Overall App. &lt;a href=&quot;http://www.lightbulbfinder.net/&quot;&gt;Light Bulb Finder&lt;/a&gt;, a great mobile app that guides your transition away from incandescents, took first place.&lt;/p&gt;

&lt;p&gt;Hootroot helps you navigate efficiently from point A to point B. It’s powered by Brighter Planet &lt;a href=&quot;http://impact.brighterplanet.com/&quot;&gt;CM1&lt;/a&gt;, Google Maps, and HopStop. The app provides directions, travel times, and carbon footprints for driving, public transit, flying, and human-powered transportation options on any route. Check out &lt;a href=&quot;http://appsfortheenvironment.challenge.gov/submissions/4618-hootroot&quot;&gt;video and screenshots&lt;/a&gt; of the app on our contest submission page.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;The contest required participants to use EPA data. HootRoot relies on multiple EPA data sets to power its transportation carbon calculations: &lt;a href=&quot;http://www.fueleconomy.gov/&quot;&gt;Fuel Economy Guide&lt;/a&gt; for car trips, &lt;a href=&quot;http://www.epa.gov/cleanenergy/energy-resources/egrid/index.html&quot;&gt;eGRID&lt;/a&gt; for train and bus electricity emissions, and &lt;a href=&quot;http://epa.gov/climatechange/emissions/usinventoryreport.html&quot;&gt;US Greenhouse Gas Inventory&lt;/a&gt; for fuel emissions factors across all transport modes. It’s also powered by data from Energy Information Agency, Bureau of Transportation Statistics, and other sources. &lt;/p&gt;

&lt;p&gt;The EPA has emerged as a leader in recent years in the push for opening government data and engaging the developer community in creating apps useful to the public, and this contest is an innovative part of that strategy.&lt;/p&gt;

&lt;p&gt;We’ll be at the &lt;a href=&quot;http://www.epa.gov/appsfortheenvironment/forum.html&quot;&gt;EPA’s Green Apps Forum&lt;/a&gt; in Arlington, VA on November 8 to accept the award and participate in discussions about the future of the growing environmental apps movement. It promises to be a very engaging event, and will be streamed online if you can’t make it in person.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>3 reasons to hack eco-tech at EcoHack NY</title>
   <link href="http://numbers.brighterplanet.com/2011/10/24/three-reasons-to-hack-eco-tech-at-ecohacknyc"/>
   <updated>2011-10-24T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/10/24/three-reasons-to-hack-eco-tech-at-ecohacknyc</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;script type=&quot;text/javascript&quot; src=&quot;http://embedtweet.com/javascripts/embed_v2.js&quot;&gt;&amp;nbsp;&lt;/script&gt;

&lt;ol&gt;
  &lt;li&gt;
    Come at 7:30PM on November 4th to &lt;a href=&quot;http://maps.google.com/maps?q=721+Broadway,new+york&amp;amp;hl=en&amp;amp;ll=40.729145,-73.992877&amp;amp;spn=0.002634,0.003691&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=44.879582,60.46875&amp;amp;vpsrc=0&amp;amp;hnear=721+Broadway,+New+York,+10003&amp;amp;t=m&amp;amp;z=18&quot;&gt;Tisch ITP&#39;s turn-of-the-century industrial loft&lt;/a&gt; and see if there&#39;s a project you want to hack on.
    &lt;br /&gt;
    &lt;div style=&quot;padding: 5px 0 5px 0;&quot;&gt;&lt;a title=&quot;photo gallery of the Tisch ITP space from when Muhammad Yunus visited&quot; href=&quot;http://www.muhammadyunus.org/Photo-Gallery/NYU-Tisch-ITP-with-GCL/&quot;&gt;&lt;img src=&quot;http://www.muhammadyunus.org/images/morfeoshow/nyu_tisch_it-1527/thumbs/IMG_8569.JPG&quot; alt=&quot;photo of the Tisch ITP space from when Muhammad Yunus visited&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    Advance the &lt;a href=&quot;http://sciencecodemanifesto.org/&quot;&gt;new Science Code Manifesto&lt;/a&gt;:
    &lt;blockquote&gt; Software is a cornerstone of science. Without software, twenty-first century science would be impossible. Without better software, science cannot progress.&lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;
    Share food, drinks, and yoga provided by Brighter Planet (who clearly know how to throw a party, e.g. Friday night at CodeConf 2011):
    &lt;a href=&quot;https://twitter.com/codeconf/status/56602812167102464&quot;&gt;(and here&#39;s the tweet to prove it)&lt;/a&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Needless to say, we’re proud to sponsor &lt;a href=&quot;http://www.ecohacknyc.org/&quot;&gt;Eco Hack NY&lt;/a&gt;!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Green Developers: a penny for your thoughts</title>
   <link href="http://numbers.brighterplanet.com/2011/10/19/green-developers-a-penny-for-your-thoughts"/>
   <updated>2011-10-19T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/10/19/green-developers-a-penny-for-your-thoughts</id>
   <author>
     <name>matt</name>
   </author>
   <content type="html">&lt;p&gt;Brighter Planet is working on a paper outlining the growing ecosystem of green apps, and if you are a software developer who’s worked in this area, we want your perspective. By sharing your thoughts about your own apps and the broader movement, you’ll help inform our best practices for engaging developers and could get a bump by having your app covered as a case study in the paper. &lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;The short questionnaire shouldn’t take you more than a few minutes: 
&lt;a href=&quot;https://brighterplanet.wufoo.com/forms/green-apps-developers/&quot;&gt;https://brighterplanet.wufoo.com/forms/green-apps-developers/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Within the broad field of environmental apps, we’re particularly interested in one subset: tools that use hard data to help individuals and small organizations make more informed, sustainable decisions. The EPA has recently put the spotlight on apps like this in their &lt;a href=&quot;http://www.epa.gov/appsfortheenvironment/&quot;&gt;Apps for the Environment Challenge&lt;/a&gt;. At Brighter Planet, our &lt;a href=&quot;http://brighterplanet.github.com/fellowship.html&quot;&gt;Developer Fellowship&lt;/a&gt; also provides support for work in this space. We’d love to hear from developers participating in these initiatives and others.&lt;/p&gt;

&lt;p&gt;The paper will present our thinking on the state of the green apps ecosystem, explore challenges and opportunities in igniting innovation, and highlight examples of cool apps and developer engagement initiatives.&lt;/p&gt;

&lt;p&gt;Thanks for sharing your thoughts. We’ll let you know when the paper is released!&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Effective Sustainability</title>
   <link href="http://numbers.brighterplanet.com/2011/10/19/effective-sustainability"/>
   <updated>2011-10-19T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/10/19/effective-sustainability</id>
   <author>
     <name>Robbie</name>
   </author>
   <content type="html">&lt;p&gt;Last week I joined a panel on effective sustainability at the World Energy Engineering Conference (WEEEC). I used the findings from our 2010 employee engagement in sustainability survey to argue that effective sustainability programs bring sustainability information to the right people in the right places. Something, according to our survey, far too few organizations are doing.&lt;/p&gt;

&lt;p&gt;
  &lt;a href=&quot;/images/2011-10-19-effective-sustainability/weec_conference.pdf&quot; title=&quot;Robbie&#39;s WEEC presentation&quot;&gt;
    &lt;img src=&quot;/images/2011-10-19-effective-sustainability/weec_conference-1.png&quot; alt=&quot;screenshot of Robbie&#39;s WEEC presentation&quot; /&gt;
    &lt;img src=&quot;/images/2011-10-19-effective-sustainability/weec_conference-2.png&quot; alt=&quot;another screenshot of Robbie&#39;s WEEC presentation&quot; /&gt;
  &lt;/a&gt;
&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;We’re undertaking a second survey on sustainability in the workplace to see how/if things have evolved over the last year. We’d love to hear your insight on the &lt;a href=&quot;https://brighterplanet.wufoo.com/forms/how-green-is-your-workplace/&quot;&gt;topic&lt;/a&gt;&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Carbon Nation</title>
   <link href="http://numbers.brighterplanet.com/2011/10/14/carbon-nation"/>
   <updated>2011-10-14T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/10/14/carbon-nation</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/carbon-nation-poster.png&quot; alt=&quot;Carbon Nation movie poster&quot; /&gt;{.wrapped} &lt;em&gt;Here’s a guest post from our good friend and former Planeteer Carolyn Barnwell, who’s now involved, among other things, in &lt;a href=&quot;http://carbonnation.tv&quot;&gt;Carbon Nation&lt;/a&gt;, an important new documentary on climate change. Without further ado . . .&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Sometimes the best way to promote clean energy is to ignore climate change and focus on things like jobs, money and national security.  &lt;a href=&quot;http://carbonnationmovie.com&quot;&gt;Carbon Nation&lt;/a&gt; is a solutions-based, non-partisan documentary that illustrates why it’s smart to be a part of the new, low-carbon economy.  It just came out on DVD and Video On Demand!  The movie’s message dovetails perfectly with the trail-blazing carbon data integration that Brighter Planet is doing.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Award-winning director Peter Byck has traveled around the country with the film for over a year.  He says, “We seem to have cracked the nut of communicating clean energy, energy efficiency, energy &amp;amp; national security to conservatives, even Tea Party folks.”  When it comes to the low-carbon economy, he says, we are not a polarized country.  It’s good business, it emboldens national and energy security, and it improves health and the environment.
 
Carbon Nation features a cast of engaging characters from towns big and small, and introduces us to a new wave of American ingenuity. One-armed Texas cotton farmer Cliff Etheredge &amp;amp; his small farm-owning neighbors create the world’s largest wind farm. &lt;/p&gt;

&lt;p&gt;Colonel Dan Nolan (US Army, Ret.), an outspoken “Green Hawk,” is working to make military bases and the Pentagon more energy efficient, not only saving fuel, but soldiers’ lives.  Col. Nolan says, “Climate change in fact is a national security issue. This is no longer the purview of Birkenstock-wearing tree huggers. Not that there’s anything wrong with that.”&lt;/p&gt;

&lt;p&gt;The cast also includes: Richard Branson (CEO, Virgin Group), Thomas L. Friedman (&lt;em&gt;The New York Times&lt;/em&gt;), James Woolsey (former CIA Director), Bernie Karl (Geothermal pioneer from Alaska), Denis Hayes (Founder of Earth Day), Van Jones (Founder, Green For All) and more climate change pioneers.  I have been fortunate to seen Van Jones speak in person a few times and his openness in this movie showed a more vulnerable and accessible side of him that’s quite moving.&lt;br /&gt;
 
In a final plug, I’ll share the &lt;em&gt;Huffington Post&lt;/em&gt;’s review: “Entertaining … endearing … and exceptional. This is not just a film worth seeing, but it is one that is well worth sharing—as widely as possible.”  You can watch the trailer, buy the DVD, or even sign up to join over 400 others who have hosted a screening at &lt;a href=&quot;http://carbonnationmovie.com/&quot;&gt;their website&lt;/a&gt;.  At the moment I’m writing this, there are only 10 copies left on Amazon . . . I say go for the DVD because it includes tons of special features and even a full second documentary, “Garbage,” which was a Best Documentary winner at SXSW Film Festival!&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Join us at the EPA Apps Forum</title>
   <link href="http://numbers.brighterplanet.com/2011/10/13/join-us-at-the-epa-apps-forum"/>
   <updated>2011-10-13T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/10/13/join-us-at-the-epa-apps-forum</id>
   <author>
     <name>matt</name>
   </author>
   <content type="html">&lt;p&gt;&lt;em&gt;Update: free registration deadline extended to October 28!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Mark your calendars for the &lt;a href=&quot;http://www.epa.gov/appsfortheenvironment/forum.html&quot;&gt;EPA’s Apps for the Environment Forum&lt;/a&gt; in Arlington, Virgina on November 8. Brighter Planet co-founder Andy Rossmeissl is a featured speaker at the event, in addition to EPA Administrator Lisa P. Jackson and others.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.epa.gov/appsfortheenvironment/forum.html#reg&quot;&gt;RSVP now&lt;/a&gt; (deadline is &lt;del&gt;Tuesday&lt;/del&gt; October 28) or read on for more details.&lt;/p&gt;

&lt;!-- more start --&gt;
&lt;p&gt;The &lt;a href=&quot;http://www.epa.gov/appsfortheenvironment/Draft%20Forum%20Agenda%2010%205%202011.pdf&quot;&gt;agenda&lt;/a&gt; includes more than just an award ceremony for the EPA’s Apps for the Environment Challenge—the event will “present a vision for the future of environmental apps and mobile technology.”&lt;/p&gt;

&lt;p&gt;It promises to be a great afternoon, and attendance is free—just note that you have to &lt;a href=&quot;http://www.epa.gov/appsfortheenvironment/forum.html#reg&quot;&gt;register&lt;/a&gt; by Tuesday, October &lt;del&gt;18&lt;/del&gt; 28 to attend. If you can’t make it in person, it will also be &lt;a href=&quot;http://www.epa.gov/appsfortheenvironment/forum.html#streaming&quot;&gt;streamed online&lt;/a&gt;.
&lt;!-- more end --&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Greenhouse Gas Protocol releases new standards</title>
   <link href="http://numbers.brighterplanet.com/2011/10/10/ghg_protocol"/>
   <updated>2011-10-10T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/10/10/ghg_protocol</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;Last week the &lt;a href=&quot;http://ghgprotocol.org&quot;&gt;Greenhouse Gas Protocol&lt;/a&gt; released the final versions of two new accounting standards: the &lt;a href=&quot;http://www.ghgprotocol.org/corporate-value-chain-standard&quot;&gt;Corporate Value Chain (Scope 3)&lt;/a&gt; and &lt;a href=&quot;http://http://www.ghgprotocol.org/standards/product-standard&quot;&gt;Product Life Cycle&lt;/a&gt; standards. The new standards provide a harmonized framework for companies to measure and report indirect greenhouse gas emissions throughout their value chain.&lt;/p&gt;

&lt;p&gt;This news is very exciting to us at Brighter Planet. From the beginning our goal has been to provide companies and individuals with a comprehensive view of their greenhouse gas emissions. So we’re thrilled to see the establishment of a standard set of rules for calculating indirect emissions, especially as they corroborate many of the decisions we’ve made when building our emissions models.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;For example, two of the key challenges identified in the Corporate Value Chain (Scope 3) standard are collecting data on diverse suppliers and activities and providing up-to-date data for calculations. Brighter Planet’s &lt;a href=&quot;http://carbon.brighterplanet.com/models&quot;&gt;emission models&lt;/a&gt; automatically use the most appropriate client-provided primary data or secondary data from &lt;a href=&quot;http://data.brighterplanet.com/&quot;&gt;our databases&lt;/a&gt;. These are kept up-to-date by automated scripts that import updates from authoritative government and industry sources the day they are released. The standard also encourages third-party assurance of calculations. Several of Brighter Planet’s emission models &lt;a href=&quot;http://brighterplanet.com/certified&quot;&gt;have been verfied&lt;/a&gt; by leading carbon validator &lt;a href=&quot;http://www.dnv.com/&quot;&gt;Det Norske Veritas&lt;/a&gt;, an industry first.&lt;/p&gt;

&lt;p&gt;With the new standards in place, we hope that many more companies will begin to measure their indirect as well as direct emissions. As &lt;a href=&quot;http://www.wbcsd.org/&quot;&gt;World Business Council for Sustainable Development&lt;/a&gt; president Björn Stigson points out, this comprehensive view “will help companies make better business decisions and stimulate innovation of products and production methods.”&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Engaging Employees on Sustainability</title>
   <link href="http://numbers.brighterplanet.com/2011/10/07/engaging_employees_on_sustainability"/>
   <updated>2011-10-07T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/10/07/engaging_employees_on_sustainability</id>
   <author>
     <name>Patti</name>
   </author>
   <content type="html">&lt;p&gt;Our second annual workplace sustainability survey, currently underway, is analyzing trends and best practices in the rapidly growing field of employee environmental engagement. My recent post over at Environmental Defense Fund business blog explains the details:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Plenty of government agencies and private businesses boast that they are engaging their employees in sustainability programs to green their workplaces. But which employers are really giving their employees the information they need to make their organizations more environmentally-friendly? […]&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Head here to read the full post: &lt;a href=&quot;http://blogs.edf.org/innovation/2011/10/05/how-green-is-your-workplace/&quot;&gt;http://blogs.edf.org/innovation/2011/10/05/how-green-is-your-workplace/&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Stamp PDFs with Prawn and Pdftk</title>
   <link href="http://numbers.brighterplanet.com/2011/10/06/stamp-pdfs-with-prawn-and-pdftk"/>
   <updated>2011-10-06T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/10/06/stamp-pdfs-with-prawn-and-pdftk</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;In order to generate PDFs with a standard template, Brighter Planet uses a combination of &lt;a href=&quot;https://github.com/sandal/prawn&quot;&gt;Prawn&lt;/a&gt; and &lt;a href=&quot;http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/&quot;&gt;Pdftk&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First, we generate the content pages:&lt;/p&gt;

&lt;p&gt;
  &lt;a href=&quot;/images/2011-10-06-stamp-pdfs-with-prawn-and-pdftk/content.pdf&quot; title=&quot;PDF generated by Prawn&quot;&gt;
    &lt;img src=&quot;/images/2011-10-06-stamp-pdfs-with-prawn-and-pdftk/content-page1.png&quot; alt=&quot;screenshot of PDF generated by Prawn (page 1)&quot; /&gt;
    &lt;img src=&quot;/images/2011-10-06-stamp-pdfs-with-prawn-and-pdftk/content-page2.png&quot; alt=&quot;screenshot of PDF generated by Prawn (page 2)&quot; /&gt;
  &lt;/a&gt;
&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Here’s what the code for that looks like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;prawn&amp;#39;&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Prawn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Document&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;generate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;content.pdf&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:top_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;126&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:right_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;72&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:bottom_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;72&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:left_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;72&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Sustainability report for Acme&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:size&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;18&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;move_down&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Executive summary&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:style&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:bold&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;move_down&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Lorem ipsum&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;start_new_page&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Analysis&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;move_down&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Lorem&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;ipsum&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;sit&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;amet&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:width&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;468&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:header&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number_pages&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Page &amp;lt;page&amp;gt; of &amp;lt;total&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:at&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;432&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:width&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then we apply our standard template:&lt;/p&gt;

&lt;p&gt;
  &lt;a href=&quot;/images/2011-10-06-stamp-pdfs-with-prawn-and-pdftk/template.pdf&quot; title=&quot;blank Brighter Planet template&quot;&gt;
    &lt;img src=&quot;/images/2011-10-06-stamp-pdfs-with-prawn-and-pdftk/template.png&quot; alt=&quot;screenshot of blank Brighter Planet template&quot; /&gt;
  &lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Which creates the &lt;a href=&quot;/images/2011-10-06-stamp-pdfs-with-prawn-and-pdftk/final.pdf&quot;&gt;final product&lt;/a&gt; (94Kb):&lt;/p&gt;

&lt;p&gt;
  &lt;a href=&quot;/images/2011-10-06-stamp-pdfs-with-prawn-and-pdftk/final.pdf&quot; title=&quot;completed sustainability report&quot;&gt;
    &lt;img src=&quot;/images/2011-10-06-stamp-pdfs-with-prawn-and-pdftk/final-page1.png&quot; alt=&quot;screenshot of completed sustainability report (page 1)&quot; /&gt;
    &lt;img src=&quot;/images/2011-10-06-stamp-pdfs-with-prawn-and-pdftk/final-page2.png&quot; alt=&quot;screenshot of completed sustainability report (page 2)&quot; /&gt;
  &lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Here’s the &lt;a href=&quot;http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/&quot;&gt;Pdftk&lt;/a&gt; command to do that:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;go&quot;&gt;pdftk content.pdf stamp template.pdf output final.pdf&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;final-code&quot;&gt;Final code&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;prawn&amp;#39;&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Prawn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Document&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;generate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;content.pdf&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:top_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;126&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:right_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;72&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:bottom_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;72&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:left_margin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;72&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Sustainability report for Acme&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:size&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;18&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;move_down&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Executive summary&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:style&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:bold&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;move_down&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Lorem ipsum&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;start_new_page&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Analysis&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;move_down&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Lorem&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;ipsum&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;sit&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;amet&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:width&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;468&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:header&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number_pages&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Page &amp;lt;page&amp;gt; of &amp;lt;total&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:at&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;432&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:width&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;posix/spawn&amp;#39;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;POSIX&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Spawn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;pdftk&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;content.pdf&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;stamp&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;template.pdf&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;output&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;final.pdf&amp;#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;why-not-use-prawns-native-codetemplatecode-option&quot;&gt;Why not use Prawn’s native &lt;code&gt;:template&lt;/code&gt; option?&lt;/h3&gt;

&lt;p&gt;Prawn &lt;a href=&quot;http://groups.google.com/group/prawn-ruby/browse_thread/thread/93301df14c7f743d&quot;&gt;currently can’t automatically apply a template to every page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You &lt;em&gt;could&lt;/em&gt; force it:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;no&quot;&gt;Prawn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Document&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;generate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;bigger_and_dirtier_final.pdf&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:template&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;template.pdf&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# [...]&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pdf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;start_new_page&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:template&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;template.pdf&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# [...]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;This is not practical for multi-page tables because you don’t control when new pages start.&lt;/li&gt;
  &lt;li&gt;The &lt;a href=&quot;/images/2011-10-06-stamp-pdfs-with-prawn-and-pdftk/bigger_and_dirtier_final.pdf&quot;&gt;resulting PDF&lt;/a&gt; is 200% bigger (180Kb) because the template data is duplicated for every page.&lt;/li&gt;
  &lt;li&gt;Prawn’s text rendering seems less reliable when using a template. For example, &lt;code&gt;pdf.text &quot;This should be bold&quot;, :style =&amp;gt; :bold&lt;/code&gt; sometimes won’t work (sorry for not reproducing that behavior in my example, didn’t have time.)&lt;/li&gt;
  &lt;li&gt;Finally &lt;a href=&quot;https://github.com/sandal/prawn/issues/199&quot;&gt;you may run into problems with Adobe Reader&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bottom line: &lt;strong&gt;Pdftk is more efficient and reliable than the current version of Prawn for stamping templates.&lt;/strong&gt;&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>How Green is Your Workplace?</title>
   <link href="http://numbers.brighterplanet.com/2011/10/04/how_green_is_your_workplace"/>
   <updated>2011-10-04T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/10/04/how_green_is_your_workplace</id>
   <author>
     <name>matt</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img src=&quot;http://attachments.brighterplanet.com/press_items/local_copies/55/thumbnail/employee_engagement_2009.png?1265816076&quot; alt=&quot;Survery report cover&quot; /&gt;{.wrapped} This month we’re conducting our second annual &lt;a href=&quot;https://brighterplanet.wufoo.com/forms/how-green-is-your-workplace/&quot;&gt;employee engagement survey&lt;/a&gt;, co-sponsored by &lt;a href=&quot;http://www.conservation.org/Pages/default.aspx&quot;&gt;Conservation International’s&lt;/a&gt; Business &amp;amp; Sustainability Council. The survey will benchmark what businesses are doing to involve employees in sustainability and analyze evolutions since last year. We hope you’ll participate and also share the survey with your colleagues. To sweeten the deal, we’ll hand out $200 to a randomly selected respondent!&lt;/p&gt;

&lt;p&gt;Survey link after the jump →&lt;/p&gt;

&lt;!-- more start --&gt;
&lt;p&gt;&lt;a href=&quot;https://brighterplanet.wufoo.com/forms/how-green-is-your-workplace/&quot;&gt;Fill out the survey here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As &lt;a href=&quot;http://www.ceres.org/&quot;&gt;Ceres&lt;/a&gt; president Mindy Lubber said in her foreword to our &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/55/original/employee_engagement_2009.pdf?1265816076&quot;&gt;first annual survey report&lt;/a&gt;, “Employees represent a critical element in an organization’s efforts to fuse sustainability with profitability. An organization’s success in meeting these goals can rise or fall with its ability to empower and incentivize its employees to integrate sustainability into their day to day activities and decision making. This does require planning and effort. But institutions that have invested in the right systems and structures find that these are yielding not only environmental and social benefits but also helping the bottom line.”&lt;/p&gt;

&lt;p&gt;Our survey was the first to benchmark how US organizations are interacting with staff on sustainability and energy efficiency. We compared approaches and effectiveness across industries, identified best practices from successful programs, and reported that while most organizations had begun to engage employees on these issues, few were doing so in a coordinated or effective manner.&lt;/p&gt;

&lt;p&gt;Our findings have since been used by municipal governments, businesses, and non-profits to improve their work in this growing and rapidly developing  field. In the past year institutions from Walmart to Intel to eBay have learned from experience with engagement programs, organizations such as the National Environmental Education Foundation have adopted research and advancement of sustainability engagement as major priorities, and federal agencies have begun responding to an executive order for quantified progress on this front.&lt;/p&gt;

&lt;p&gt;Thanks for &lt;a href=&quot;https://brighterplanet.wufoo.com/forms/how-green-is-your-workplace/&quot;&gt;taking part&lt;/a&gt; and helping spread the word!
&lt;!-- more end --&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Presentation at Strata NYC</title>
   <link href="http://numbers.brighterplanet.com/2011/09/30/presentation-at-strata-nyc"/>
   <updated>2011-09-30T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/09/30/presentation-at-strata-nyc</id>
   <author>
     <name>andy</name>
   </author>
   <content type="html">&lt;p&gt;Last week I made a presentation at &lt;a href=&quot;http://strataconf.com/ny&quot;&gt;Strata NYC&lt;/a&gt;, the O’Reilly conference on Big Data. The presentation (embedded below) is in &lt;a href=&quot;http://en.wikipedia.org/wiki/Ignite_(event)&quot;&gt;Ignite&lt;/a&gt; style, so it’s a total of five minutes long.&lt;/p&gt;

&lt;div class=&quot;wide&quot;&gt;
  &lt;object id=&quot;doc_81404&quot; name=&quot;doc_81404&quot; height=&quot;600&quot; width=&quot;100%&quot; type=&quot;application/x-shockwave-flash&quot; data=&quot;http://d1.scribdassets.com/ScribdViewer.swf&quot; style=&quot;outline:none;&quot;&gt;
    &lt;param name=&quot;movie&quot; value=&quot;http://d1.scribdassets.com/ScribdViewer.swf&quot; /&gt;
    &lt;param name=&quot;wmode&quot; value=&quot;opaque&quot; /&gt;
    &lt;param name=&quot;bgcolor&quot; value=&quot;#ffffff&quot; /&gt;
    &lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;
    &lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot; /&gt;
    &lt;param name=&quot;FlashVars&quot; value=&quot;document_id=65921349&amp;amp;access_key=key-25stsxodjqtj97mcq0dl&amp;amp;page=1&amp;amp;viewMode=slideshow&quot; /&gt;
    &lt;embed id=&quot;doc_81404&quot; name=&quot;doc_81404&quot; src=&quot;http://d1.scribdassets.com/ScribdViewer.swf?document_id=65921349&amp;amp;access_key=key-25stsxodjqtj97mcq0dl&amp;amp;page=1&amp;amp;viewMode=slideshow&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; height=&quot;600&quot; width=&quot;100%&quot; wmode=&quot;opaque&quot; bgcolor=&quot;#ffffff&quot; /&gt;
  &lt;/object&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Hipmunk, Amtrak, and sustainability: context is everything</title>
   <link href="http://numbers.brighterplanet.com/2011/09/08/hipmunk"/>
   <updated>2011-09-08T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/09/08/hipmunk</id>
   <author>
     <name>andy</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/2011-09-08-hipmunk/hipmunk.png&quot; alt=&quot;Amtrak on Hipmunk&quot; /&gt;
{.wide}&lt;/p&gt;

&lt;p&gt;Today Hipmunk announced that it has &lt;a href=&quot;http://blog.hipmunk.com/post/9957542991/amtrak-train-travel-search&quot;&gt;added Amtrak trains to flight search results&lt;/a&gt;. Reactions have been positive (e.g. &lt;a href=&quot;http://venturebeat.com/2011/09/08/hipmunk-amtrak-train/&quot;&gt;VentureBeat&lt;/a&gt;, &lt;a href=&quot;http://www.gadling.com/2011/09/08/hipmunk-first-online-travel-agent-to-integrate-amtrak-searches/&quot;&gt;Gadling&lt;/a&gt;, &lt;a href=&quot;http://www.tnooz.com/2011/09/08/news/amtrak-goes-the-hipmunk-route-with-claims-of-exclusive-deal/&quot;&gt;Tnooz&lt;/a&gt;) and have focused on the lower prices and oftentimes better schedules that trains can offer travelers versus planes on certain routes.&lt;/p&gt;

&lt;p&gt;But we like it for a much different reason: it’s a triumph of sustainability.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;right-place-at-the-right-time&quot;&gt;Right place at the right time&lt;/h3&gt;

&lt;p&gt;Take a look at the screenshot above; it’s from a &lt;a href=&quot;http://www.hipmunk.com/#!PHL.WAS,Oct17&quot;&gt;Hipmunk search&lt;/a&gt; from Philadelphia to Washington, DC. Hipmunk does its usual amazing job of showing differences in price and time—here, you’d save at least $10 and an hour and half with the train option. What it doesn’t show you is that taking the train will result in 21 lbs. CO&lt;sub&gt;2&lt;/sub&gt;e; the flight, 1,737 lbs., nearly a ton.&lt;/p&gt;

&lt;p&gt;The dramatic difference between these modes in environmental impact isn’t a new thing; Amtrak’s been &lt;a href=&quot;http://www.amtrak.com/servlet/ContentServer?c=Page&amp;amp;pagename=am/Layout&amp;amp;p=1237405732514&amp;amp;cid=1246042626782&amp;amp;WT.mc_t=Travel%20Green2010_HP_WSP&amp;amp;WT.mc_n=TravelGreenpagelink&amp;amp;WT.mc_r=365&amp;amp;tiid=33371&amp;amp;audienceId=0&amp;amp;rtTracking=1&quot;&gt;touting it for a while now&lt;/a&gt; on its homepage, and it’s one of the stock green travel tips we hear so often. But when you’re trying to get from Point A to Point B, you call up your favorite travel site and hit Search. Let’s face it: who is going to assess the flight options, open another tab for Amtrak.com, run another search, and perform an eyeball comparison of the results between tabs?&lt;/p&gt;

&lt;p&gt;Thanks to Hipmunk, this is no longer necessary. Travelers benefit from the saved time and money, and the planet—and all of us—benefit from the resulting decrease in climate change emissions. Hipmunk surely didn’t add this feature for the environmental effects, but they nevertheless deserve a hearty round of applause for the thousands of tons of CO2 that will &lt;em&gt;not&lt;/em&gt; be emitted as a result.&lt;/p&gt;

&lt;h3 id=&quot;how-big-is-the-impact&quot;&gt;How big is the impact?&lt;/h3&gt;

&lt;p&gt;As a rule of thumb, travelers can assume that Amtrak results will always be lower-impact than flights. But, as they say, there’s safety in numbers, so we added support for this new Hipmunk feature to our &lt;a href=&quot;http://careplane.org&quot;&gt;Careplane impact-transparency browser plugin&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2011-09-08-hipmunk/careplane.png&quot; alt=&quot;Hipmunk with Careplane&quot; /&gt;
{.wide}&lt;/p&gt;

&lt;p&gt;The difference between training and flying is no joke. &lt;a href=&quot;http://careplane.org&quot;&gt;Install Careplane&lt;/a&gt;, run a search, and see for yourself.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>2 easy ways to join the EPA's app challenge</title>
   <link href="http://numbers.brighterplanet.com/2011/08/29/2-easy-ways-to-join-the-epa-s-app-challenge"/>
   <updated>2011-08-29T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/08/29/2-easy-ways-to-join-the-epa-s-app-challenge</id>
   <author>
     <name>matt</name>
   </author>
   <content type="html">&lt;p&gt;As part of Administrator Lisa Jackson’s push to leverage open government data in meeting the its &lt;a href=&quot;http://blog.epa.gov/administrator/2010/01/12/seven-priorities-for-epas-future/&quot;&gt;seven priorities&lt;/a&gt;, the EPA is hosting a great competition that challenges developers to build applications drawing on publicly available EPA data. The &lt;a href=&quot;http://www.epa.gov/appsfortheenvironment/&quot;&gt;&lt;strong&gt;Apps for the Environment&lt;/strong&gt;&lt;/a&gt; challenge is a call for new tools that help individuals and communities address environment and public health issues, with the top apps winning a year of promotion on the EPA website. Submissions are open for another three weeks.&lt;/p&gt;

&lt;p&gt;Haven’t submitted anything yet? Using free Brighter Planet tools, you can get started on your own app super quick.&lt;/p&gt;

&lt;!-- more start --&gt;
&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Use &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;Brighter Planet CM1&lt;/a&gt; for carbon and energy calculations.&lt;/strong&gt; As a green developer, your time is far more valuably spent creating innovative new functionality than it is learning the ins and outs of climate science and reinventing the wheel with your own impact models. CM1’s RESTful JSON/XML API makes it surprisingly easy to build accurate, transparently calculated environmental impact estimates into your app. Since all of CM1’s models involve some use of EPA data, &lt;em&gt;any app you make that uses CM1 will be eligible for the contest&lt;/em&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Pull EPA data from &lt;a href=&quot;http://data.brighterplanet.com&quot;&gt;our reference data clearinghouse&lt;/a&gt;.&lt;/strong&gt; You can get normalized, corrected, bona fide EPA data in a variety of useful formats, oriented around business logic rather than obscure EPA publications.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We’re psyched to be submitting a couple of our own apps (&lt;a href=&quot;http://careplane.org/&quot;&gt;Careplane&lt;/a&gt;, &lt;a href=&quot;http://hootroot.com/&quot;&gt;HootRoot&lt;/a&gt;, and &lt;a href=&quot;http://greenerpastur.es/&quot;&gt;Greener Pastures&lt;/a&gt;), but we’re confident that using CM1 you can create even better projects in the brief time left until the deadline. May the best apps win!
&lt;!-- more end --&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Madison Ruby 5k</title>
   <link href="http://numbers.brighterplanet.com/2011/08/22/madison-ruby-5k"/>
   <updated>2011-08-22T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/08/22/madison-ruby-5k</id>
   <author>
     <name>derek</name>
   </author>
   <content type="html">&lt;h1 id=&quot;healthy-hackers---madison-edition&quot;&gt;Healthy Hackers - Madison Edition&lt;/h1&gt;

&lt;p&gt;Thanks to all of the healthy hackers who ran with us in the Madison Ruby Conference 5k! It was a magnificent run along State Street’s cafes, up Bascom Hill, through the UW campus, and ending along beautiful Lake Mendota on a pier near the Memorial Union.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm7.static.flickr.com/6061/6065169457_460b87550e_b.jpg&quot; alt=&quot;5k Victory Photo&quot; /&gt;
Thanks to &lt;a href=&quot;http://twitter.com/wondible&quot;&gt;Justin Love&lt;/a&gt; for the photo.&lt;/p&gt;

&lt;p&gt;Congratulations to Ryan Horrisberger who finished with an impressive time of 19:49! In second was Collin Schaafsma, followed by our own Andy Rossmeissl in third. Provisional results follow.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;table&gt;
&lt;tr&gt;&lt;th&gt;Position&lt;/th&gt;&lt;th&gt;Time&lt;/th&gt;&lt;th&gt;Number&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;19:49&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;td&gt;Ryan Horrisberger&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;23:42&lt;/td&gt;&lt;td&gt;31&lt;/td&gt;&lt;td&gt;Collin Schaafsma&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;23:43&lt;/td&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;Andy Rossmeissl&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;23:45&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;Chris Schmitz&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;23:55&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;David&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;24:11&lt;/td&gt;&lt;td&gt;28&lt;/td&gt;&lt;td&gt;Randall Thomas&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;25:37&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;Matt Yoho&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;8&lt;/td&gt;&lt;td&gt;25:47&lt;/td&gt;&lt;td&gt;14&lt;/td&gt;&lt;td&gt;Sandro Turriate&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;25:52&lt;/td&gt;&lt;td&gt;26&lt;/td&gt;&lt;td&gt;Paul Kauders&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;26:30&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;Rob Sanheim&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;29:24&lt;/td&gt;&lt;td&gt;21&lt;/td&gt;&lt;td&gt;Derek Kastner&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;29:32&lt;/td&gt;&lt;td&gt;24&lt;/td&gt;&lt;td&gt;Erik Kastman&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;29:33&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;td&gt;Joe Nelson&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;14&lt;/td&gt;&lt;td&gt;29:38&lt;/td&gt;&lt;td&gt;34&lt;/td&gt;&lt;td&gt;Unregistered&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;29:52&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;Clark&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;16&lt;/td&gt;&lt;td&gt;32:47&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;Zach Moneypenny&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;17&lt;/td&gt;&lt;td&gt;32:48&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;Stacy Moneypenny&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;18&lt;/td&gt;&lt;td&gt;32:53&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;Brad Grzeslak&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;19&lt;/td&gt;&lt;td&gt;35:50&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;Justin Love&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;43:26&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;Ben Ortega&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;21&lt;/td&gt;&lt;td&gt;1:38:ish&lt;/td&gt;&lt;td&gt;18&lt;/td&gt;&lt;td&gt;Matt&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;1:46:ish&lt;/td&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;Veezus Kreis&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;1:46:ish&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;Steven Bristol&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;24&lt;/td&gt;&lt;td&gt;1:46:ish&lt;/td&gt;&lt;td&gt;27&lt;/td&gt;&lt;td&gt;Tom&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;1:46:ish&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;Coby&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;26&lt;/td&gt;&lt;td&gt;1:46:ish&lt;/td&gt;&lt;td&gt;33&lt;/td&gt;&lt;td&gt;Brendan&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;27&lt;/td&gt;&lt;td&gt;1:46:ish&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;Ryan Briones&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;28&lt;/td&gt;&lt;td&gt;1:46:ish&lt;/td&gt;&lt;td&gt;17&lt;/td&gt;&lt;td&gt;Ray Hightower&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;29&lt;/td&gt;&lt;td&gt;1:46:ish&lt;/td&gt;&lt;td&gt;29&lt;/td&gt;&lt;td&gt;Josh Mejia&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;30&lt;/td&gt;&lt;td&gt;1:46:ish&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;Tom&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Also, congratulations to our “social runners” who enjoyed the beautiful evening stroll ;)&lt;/p&gt;

&lt;p&gt;Let us know if we got your name wrong or left you out and we’ll fix the list ASAP.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>A Quarter Billion Strong</title>
   <link href="http://numbers.brighterplanet.com/2011/08/17/a-quarter-billion"/>
   <updated>2011-08-17T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/08/17/a-quarter-billion</id>
   <author>
     <name>Robbie</name>
   </author>
   <content type="html">&lt;p&gt;Yesterday, we sent out a note to tens of thousands of &lt;a href=&quot;http://brighterplanet.com/apps/cards&quot;&gt;Brighter Planet Visa cardholders&lt;/a&gt; thanking them for their effort in creating the industry’s leading environmental card program and in turn the largest consumer carbon offset program in the country. Over 180,000 cardholders have helped to provide financing for &lt;a href=&quot;http://brighterplanet.com/projects&quot;&gt;20 clean energy projects&lt;/a&gt; throughout the US. Without their support these projects never would have been built and over a quarter billion pounds of CO2, the equivalent of 9.5 million daily commutes, would have been emitted. These projects not only reduce carbon emissions, they provide additional environmental and social value by mitigating electricity costs for family farms and schools, providing green jobs, preserving biodiversity, and helping to clean our air and water.&lt;/p&gt;

&lt;p&gt;At a time when climate change and renewable energy development seems to have slipped from our national consciousness, Brighter Planet’s community continues to grow and strengthen. So again, thank you for being leaders and helping to create our clean energy future.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Add node.js/CommonJS style require() to client-side JavaScript with browserify</title>
   <link href="http://numbers.brighterplanet.com/2011/08/04/add-node-js-commonjs-style-require-to-client-side-javascript-with-browserify"/>
   <updated>2011-08-04T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/08/04/add-node-js-commonjs-style-require-to-client-side-javascript-with-browserify</id>
   <author>
     <name>Derek</name>
   </author>
   <content type="html">&lt;p&gt;While working on &lt;a href=&quot;http://careplane.org&quot;&gt;Careplane&lt;/a&gt; recently, I ran into a problem that was made easier by &lt;a href=&quot;http://goessner.net/articles/JsonPath/&quot;&gt;JSONPath&lt;/a&gt;. I was already enjoying the ability to test my JavaScript with &lt;a href=&quot;http://nodejs.org&quot;&gt;Node.js&lt;/a&gt;, &lt;a href=&quot;&quot;&gt;Jasmine&lt;/a&gt;, and other &lt;a href=&quot;http://npmjs.org/&quot;&gt;npm&lt;/a&gt; packages. It would be nice if I could get the same package system I have with npm and use it with my client-side JavaScript.&lt;/p&gt;

&lt;p&gt;With &lt;a href=&quot;http://github.com/substack/node-browserify&quot;&gt;browserify&lt;/a&gt;, now I can!&lt;/p&gt;

&lt;p&gt;There are three major benefits to using browserify, which I’ll detail below.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;h3 id=&quot;using-npm-modules-in-your-client-side-scripts&quot;&gt;Using npm Modules in Your Client-Side Scripts&lt;/h3&gt;

&lt;p&gt;In Careplane, I wanted to use the &lt;a href=&quot;&quot;&gt;JSONPath npm package&lt;/a&gt;. With browserify, I can write the following into my client-side code:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;cm&quot;&gt;/* clientside.js */&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;jsonpath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;JSONPath&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;jquery-browserify&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;owned_data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;jsonpath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;eval&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;myData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;$.paths[*].to.data[?(@.owner == &amp;quot;Derek&amp;quot;)]&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;p.important&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;owned_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;From the command-line, I can create a single JavaScript file (I’ll call it application.js) that contains my code and includes the JSONPath package. I can even bake jQuery into application.js!&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&amp;gt; npm install browserify
  &amp;gt; npm install JSONPath
  &amp;gt; npm install jquery-browserify
  &amp;gt; ./node_modules/.bin/browserify -r JSONPath -r jquery-browserify -e clientside.js -o application.js&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now that I have a nicely wrapped application.js, I can include it from a web page, or in this case, the browser plugin I’m developing.&lt;/p&gt;

&lt;p&gt;Here’s an example of use from a web page:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;application.js&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;N.B. Not all npm packages will work client-side, especially ones that depend on core Node.js modules like &lt;code&gt;fs&lt;/code&gt; or &lt;code&gt;http&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;organize-your-code&quot;&gt;Organize Your Code&lt;/h3&gt;

&lt;p&gt;Careplane has a ton of JavaScript split into a separate file for each class. Previously, I was using simple concatenation and a hand-crafted file list to construct an application.js and to determine script load order. Now it can be managed automatically by browserify because each of my class files can require other class files.&lt;/p&gt;

&lt;p&gt;For instance, the Kayak class in &lt;code&gt;src/drivers/Kayak.js&lt;/code&gt; depends on the Driver class in &lt;code&gt;src/Driver.js&lt;/code&gt;. I can now do this:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;cm&quot;&gt;/* src/Driver.js */&lt;/span&gt;

  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Driver&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{};&lt;/span&gt;

  &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exports&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Driver&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;cm&quot;&gt;/* src/Kayak.js */&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Driver&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;../Driver&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Kayak&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;foo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;Kayak&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Driver&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
  
  &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt;
  
  &lt;span class=&quot;nx&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;exports&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Kayak&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;cm&quot;&gt;/* src/main.js */&lt;/span&gt;
  
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Kayak&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;./drivers/Kayak&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// paths are relative to src, main.js&amp;#39; cwd&lt;/span&gt;
  
  &lt;span class=&quot;nx&quot;&gt;Kayak&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getThePartyStarted&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&amp;gt; ./node_modules/.bin/browserify -e src/main.js -o application.js&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Super simple!&lt;/p&gt;

&lt;h3 id=&quot;uniformity-with-testing-environment&quot;&gt;Uniformity With Testing Environment&lt;/h3&gt;

&lt;p&gt;I like to run my &lt;a href=&quot;http://pivotal.github.com/jasmine/&quot;&gt;Jasmine&lt;/a&gt; JavaScript tests from the command-line and so does our &lt;a href=&quot;http://martinfowler.com/articles/continuousIntegration.html&quot;&gt;Continuous Integration&lt;/a&gt; system. With &lt;a href=&quot;http://github.com/mhevery/jasmine-node&quot;&gt;jasmine-node&lt;/a&gt;, I had to maintain a list of files in my src directory that were loaded in a certain order in order to run my tests. Now, each spec file can use Node.js’ CommonJS &lt;code&gt;require&lt;/code&gt; statement to require files from my src directory, and all dependencies are automatically managed.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;cm&quot;&gt;/* spec/javascripts/drivers/KayakSpec.js */&lt;/span&gt;
  
  &lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Kayak&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Kayak&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;src/drivers/Kayak&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&amp;gt; rake examples&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;KayakSpec&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; 
  Starting tests
  ............FFF............FF&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;When I run my specs from the command-line with Node.js (I have an &lt;code&gt;examples&lt;/code&gt; rake task that runs node and jasmine), Node’s built-in CommonJS &lt;code&gt;require&lt;/code&gt; is used and it recognizes the &lt;code&gt;require&lt;/code&gt; statements I wrote into src/drivers/Kayak.js.&lt;/p&gt;

&lt;p&gt;I can also run my Jasmine specs from the standard Jasmine web server. All I have to do is create a browserified script that is included before Jasmine runs its tests in my browser.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;cm&quot;&gt;/* src/jasmine.js */&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Kayak&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;./drivers/Kayak&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;span class=&quot;c1&quot;&gt;// browserify needs a starting point to resolve all dependencies&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# spec/javascripts/support/jasmine.yml&lt;/span&gt;
  &lt;span class=&quot;l-Scalar-Plain&quot;&gt;src_files&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;p-Indicator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;spec/javascripts/support/application.js&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&amp;gt; ./node_modules/.bin/browserify -e src/jasmine.js -o spec/javascripts/support/application.js
  &amp;gt; rake jasmine:server
  your tests are here:
    http://localhost:8888/
  &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;2011-08-04 16:15:56&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; INFO  WEBrick 1.3.1
  &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;2011-08-04 16:15:56&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; INFO  ruby 1.9.2 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2011-02-18&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;x86_64-darwin10.4.0&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;2011-08-04 16:15:56&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; INFO  WEBrick::HTTPServer#start: &lt;span class=&quot;nv&quot;&gt;pid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;61833&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;8888&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;When I visit http://localhost:8888 in my browser, my Jasmine tests all run!&lt;/p&gt;

&lt;p&gt;The only drawback is that my code has to be re-browserified whenever it changes. This only adds about a second of overhead while I wait for my &lt;a href=&quot;http://rubygems.org/gems/watchr&quot;&gt;watchr&lt;/a&gt; script to run the browserification.&lt;/p&gt;

&lt;h3 id=&quot;more&quot;&gt;More&lt;/h3&gt;

&lt;p&gt;If you’d like to take a look at the environment I set up for Careplane, you can check out the &lt;a href=&quot;http://github.com/brighterplanet/careplane&quot;&gt;source&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope you enjoy browserify as much as I have!&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>New in CM1: carbon equivalents</title>
   <link href="http://numbers.brighterplanet.com/2011/08/02/new-in-cm1-carbon-equivalents"/>
   <updated>2011-08-02T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/08/02/new-in-cm1-carbon-equivalents</id>
   <author>
     <name>andy</name>
   </author>
   <content type="html">&lt;p&gt;Something we have learned over our 5+ years at Brighter Planet is that, in certain cases, carbon impact can be described most powerfully when it is given in “real life” units. That is, instead of saying a flight has a footprint of 1,045.77 kg CO2e, you say it’s like &lt;em&gt;adding 69 cars to the road for a day&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;We released a new feature to CM1 a couple of weeks ago that provides dozens of “equivalents” like this with every JSON and XML response we deliver (&lt;a href=&quot;http://carbon.brighterplanet.com/flights.json&quot;&gt;example&lt;/a&gt;). Reactions so far have been positive, so we’re now marking the feature as &lt;em&gt;public beta&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The conversions are part of our new open-source &lt;a href=&quot;http://github.com/dkastner/co2_equivalents&quot;&gt;co2_equivalents&lt;/a&gt; library—check out the source for details, including complete citations.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Tronprint Updates</title>
   <link href="http://numbers.brighterplanet.com/2011/07/22/tronprint-updates"/>
   <updated>2011-07-22T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/07/22/tronprint-updates</id>
   <author>
     <name>Derek</name>
   </author>
   <content type="html">&lt;p&gt;This week, some of our servers that were running &lt;a href=&quot;http://brighterplanet.github.com/tronprint&quot;&gt;Tronprint&lt;/a&gt; started having DNS problems. Tronprint was unable to connect to our MongoHQ database and our sites crashed. We’ve &lt;a href=&quot;https://github.com/brighterplanet/tronprint/compare/da5c208c8799cea84fb0...5d3e57b801add7dc8a45&quot;&gt;updated&lt;/a&gt; the Tronprint gem to handle connection issues to any database. In the case of a lost connection or a problem saving statistics, Tronprint will simply keep running and wait for the connection to become available again. This means that data could be lost if a connection is never recovered and the application process quits. However, the connection failure will not affect the operation of your site.&lt;/p&gt;

&lt;p&gt;We’ve also created a &lt;a href=&quot;http://twitter.com/tronprint&quot;&gt;Twitter account&lt;/a&gt; to keep you updated on new versions and features.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>New biogas offset project</title>
   <link href="http://numbers.brighterplanet.com/2011/07/06/new_landfill_gas_offset_project"/>
   <updated>2011-07-06T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/07/06/new_landfill_gas_offset_project</id>
   <author>
     <name>ian</name>
   </author>
   <content type="html">&lt;p&gt;Our latest offset project, the &lt;a href=&quot;http://brighterplanet.com/projects/21-wewoka_biogas&quot;&gt;Wewoka Biogas Project&lt;/a&gt;, is Brighter Planet’s first ever biogas project. Once again we’re working with our partner &lt;a href=&quot;http://www.nativeenergy.com/&quot;&gt;&lt;i&gt;Native&lt;/i&gt;Energy&lt;/a&gt; to support a small project that fights climate change and strengthens the local community. The project’s emissions reductions will be validated and verified under the &lt;a href=&quot;http://www.v-c-s.org/&quot;&gt;Verified Carbon Standard&lt;/a&gt; using its landfill gas protocol.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Since 1925, the family-owned Commercial Brick Corporation has supplied materials to homes and businesses throughout the country. Today they are the largest employer in rural Wewoka, IL, supporting hundreds of families. With rising Natural Gas prices they looked for an alternative fuel to heat their kilns and found an unexpected source: the landfill next door.&lt;/p&gt;

&lt;p&gt;Municipal solid waste landfills are the second largest source of human-related methane pollution in the United States. As waste in landfills decomposes anaerobically (without oxygen) it produces methane, a powerful greenhouse gas with 21 times the climate impact of CO&lt;sub&gt;2&lt;/sub&gt;. But this polluting biogas can be captured and put to use. In Wewoka, it will provide renewable fuel for Commercial Brick’s kilns.&lt;/p&gt;

&lt;p&gt;To capture the methane, vertical gas wells installed in the landfill will be connected to a central blower. The blower will then push the methane through a half-mile pipeline to the brick kilns, which are being retrofitted to burn biogas just like regular natural gas. If the kilns malfunction, a flare will burn the excess gas at the landfill. The project will avoid the equivalent of about 25,000-30,000 metric tonnes of CO&lt;sub&gt;2&lt;/sub&gt; per year, and this reduction will be validated and verified under the &lt;a href=&quot;http://www.v-c-s.org/&quot;&gt;Verified Carbon Standard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Without revenue from offset sales the kiln retrofits and pipeline and blower construction would be too expensive to justify the investment. It’s thanks to Brighter Planet’s cardholders and customers that this project has become reality.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>A new perspective on air travel management</title>
   <link href="http://numbers.brighterplanet.com/2011/06/28/a-new-perspective-on-air-travel-management"/>
   <updated>2011-06-28T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/06/28/a-new-perspective-on-air-travel-management</id>
   <author>
     <name>matt</name>
   </author>
   <content type="html">&lt;p&gt;These days more and more organizations are measuring the carbon impacts of employee air travel programs. That’s a good thing. Unfortunately, most are using a simplistic approach that leaves one of their hands tied when it comes to managing those programs for reduced carbon impact. Correcting this business intelligence shortfall is the focus of our &lt;a href=&quot;http://brighterplanet.com/research&quot;&gt;latest research paper&lt;/a&gt;, an in-depth modeling analysis of more than a decade of global airline industry data.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Huffington Post ran &lt;a href=&quot;http://www.huffingtonpost.com/2011/06/28/green-airlines-carbon-efficiency_n_885553.html&quot;&gt;an article on the report&lt;/a&gt; today, and the paper should speak for itself, but among the highlights are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Huge efficiency variation.&lt;/strong&gt; Fuel use per passenger per mile varies more than tenfold across the airline industry, a fact most carbon calculations ignore to their detriment in terms of reporting accuracy, and more importantly, in terms of carbon reduction opportunity.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;New sustainability potential.&lt;/strong&gt; Case studies of more than 300,000 employee flights at two major global corporations show that choosing carbon-efficient itineraries on existing routes, without cutting flights or increasing costs, can slash emissions by as much as 40%.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Real-world airline rankings.&lt;/strong&gt; This study is far from the first to rank airlines on sustainability, but few predecessors have accounted for real-world passenger volumes, load factors, freight shares, aircraft efficiencies, seating configurations, and route characteristics to provide as accurate a rating. Ryanair leads the 20 largest airlines in the international market, followed by Singapore Airlines and Continental. In the U.S. domestic market, Continental comes first, followed by JetBlue and Frontier.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Revealing industry trends.&lt;/strong&gt; Air travel efficiency has improved 20% since 2000, preventing the equivalent of an entire year’s worth of flights over that time, and saving airlines (and thus travelers) 33 billion dollars on jet fuel at a time both were struggling in an ailing economy.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We ran this analysis by turning our &lt;a href=&quot;http://carbon.brighterplanet.com/models/flight&quot;&gt;CM1 flight model&lt;/a&gt; on itself to process databases covering more than 9 billion passengers on 130 million worldwide flights over 10 years. That should be sufficient to qualify as data-driven decision making.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Stream parser with Ragel and Ruby</title>
   <link href="http://numbers.brighterplanet.com/2011/06/14/stream_parser_with_ragel_and_ruby"/>
   <updated>2011-06-14T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/06/14/stream_parser_with_ragel_and_ruby</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;You can use Ragel to make simple stream parsers in Ruby. By “stream parser,” I mean one that reads in files a chunk at a time instead of all at once—thereby keeping memory use constant.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Say you have a file like&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer a
tristique lectus. Vestibulum ante ipsum primis in faucibus orci luctus et
aliquet laoreet, iacSTARTFOOThere are lots of great ideas here.ENDFOOulis
a lorem. Integer interdum, dolor aliquam accumsan eleifend, nisl tortor
mollis ipsum, et semper arcu mi nec felis. Nunc scelerisque cursus dolor
eu tristique. Mauris porta pulvinar dolor. Integer egestas lacinia leo, ut
mollis sapien fermentum non. Maecenas ultricies nibh at justo ornare eu
ullamcorper justo aliquet. Cras id augue eget nunc auctor mattis vitae
quis massa. STARTFOOYou just have to look closelyENDFOOMauris suscipit
justo in erat scelerisque imperdiet.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You want to pull out&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;There are lots of great ideas here.
You just have to look closely
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As I show in my &lt;a href=&quot;https://github.com/seamusabshere/ruby_ragel_examples&quot;&gt;ragel_ruby_examples&lt;/a&gt; tests, you could even read the stream 1 byte at a time.&lt;/p&gt;

&lt;p&gt;Here’s the Ragel part:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ragel&quot; data-lang=&quot;ragel&quot;&gt;&lt;span class=&quot;k&quot;&gt;machine&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;simple_tokenizer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MyTs&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    my_ts = p&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MyTe&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    my_te = p&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;Emit&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    emit data[my_ts...my_te].pack(&amp;#39;c*&amp;#39;)&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    my_ts = nil&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    my_te = nil    &lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;STARTFOO&amp;#39;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;any&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MyTs&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;ENDFOO&amp;#39;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;MyTe&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;Emit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;any&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;…and here’s the Ruby reading/buffering mechanism…&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;no&quot;&gt;CHUNK_SIZE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1_000_000&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# bytes (instead of reading in the whole file all at once)&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# Note: use with simple_tokenizer&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;perform&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;pe&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:ignored&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;eof&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:ignored&lt;/span&gt;
    &lt;span class=&quot;sx&quot;&gt;%% write init;&lt;/span&gt;
&lt;span class=&quot;sx&quot;&gt;    # %&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fixes&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;syntax&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;highlighting&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;leftover&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;my_ts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;nil&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;my_te&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;nil&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chunk&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;CHUNK_SIZE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;leftover&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chunk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;unpack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;c*&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;pe&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;length&lt;/span&gt;
        &lt;span class=&quot;sx&quot;&gt;%% write exec;&lt;/span&gt;
&lt;span class=&quot;sx&quot;&gt;        # %&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fixes&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;syntax&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;highlighting&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;my_ts&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;leftover&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my_ts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;my_te&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;my_te&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;my_ts&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;my_te&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;my_ts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;leftover&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Alternatively you could use Ragel’s &lt;strong&gt;scanner&lt;/strong&gt; functionality:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ragel&quot; data-lang=&quot;ragel&quot;&gt;&lt;span class=&quot;k&quot;&gt;machine&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;simple_scanner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;Emit&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;    emit data[(ts+8)..(te-7)].pack(&amp;#39;c*&amp;#39;)&lt;/span&gt;
&lt;span class=&quot;x&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;STARTFOO&amp;#39;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;any&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;ENDFOO&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|*&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;Emit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;any&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*|&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Which requires buffering code like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;no&quot;&gt;CHUNK_SIZE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1_000_000&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# bytes (instead of reading in the whole file all at once)&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# Note: use with simple_scanner&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;perform&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;pe&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:ignored&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;eof&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:ignored&lt;/span&gt;
    &lt;span class=&quot;sx&quot;&gt;%% write init;&lt;/span&gt;
&lt;span class=&quot;sx&quot;&gt;    # %&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fixes&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;syntax&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;highlighting&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;leftover&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chunk&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;CHUNK_SIZE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;leftover&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;chunk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;unpack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;c*&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;pe&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;length&lt;/span&gt;
        &lt;span class=&quot;sx&quot;&gt;%% write exec;&lt;/span&gt;
&lt;span class=&quot;sx&quot;&gt;        # %&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fixes&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;syntax&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;highlighting&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ts&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;leftover&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;.pe&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
          &lt;span class=&quot;nb&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ts&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;ts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;leftover&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt;
          &lt;span class=&quot;nb&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Again, you can see more at &lt;a href=&quot;https://github.com/seamusabshere/ruby_ragel_examples&quot;&gt;ragel_ruby_examples&lt;/a&gt;, specifically &lt;a href=&quot;https://github.com/seamusabshere/ruby_ragel_examples/blob/master/lib/simple_scanner.rl&quot;&gt;simple_tokenizer.rl&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Final note: I realize this isn’t precisely a parser or even a tokenizer… but these sorts of examples are what I would have wanted when I was getting started with Ragel and Ruby. What’s more, hopefully the Ragel community will chime in and improve the examples.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>A Pattern for JavaScript Events</title>
   <link href="http://numbers.brighterplanet.com/2011/06/10/a-pattern-for-javascript-events"/>
   <updated>2011-06-10T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/06/10/a-pattern-for-javascript-events</id>
   <author>
     <name>derek</name>
   </author>
   <content type="html">&lt;p&gt;While working on &lt;a href=&quot;http://hootroot.com&quot;&gt;Hootroot&lt;/a&gt; and &lt;a href=&quot;http://careplane.org&quot;&gt;Careplane&lt;/a&gt;, I found myself getting frustrated with the way I was having handling events. Over time, however, I stopped fighting the language and learned a pattern that I believe is easiest to test and read.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;I’ll work with a simple example to show you my thought process.&lt;/p&gt;

&lt;p&gt;Initially, I started handling my events with standard closures:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;c1&quot;&gt;//Rocket.js&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrub&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/launch_code&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Launching from &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launchCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Not ready to launch!&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Failed to get launch code for &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//RocketSpec.js&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Rocket&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;#launch&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;beforeEach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Cape Canaveral, FL&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;fakeAjax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;urls&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/launch_code&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;successData&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;{ &amp;quot;launchCode&amp;quot;: 12345 }&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}})&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;spyOn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;ignite&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;spyOn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;scrub&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

    &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;ignites if ready&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;waits if not ready&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;not&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;scrubs if a bad launch code is given&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;fakeAjax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;urls&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/launch_code&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;errorMessage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;{ &amp;quot;error&amp;quot;: &amp;quot;too bad&amp;quot; }&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}})&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Because of the way &lt;a href=&quot;http://www.digital-web.com/articles/scope_in_javascript/&quot;&gt;this&lt;/a&gt; works in JavaScript, I had to assign the &lt;code&gt;this&lt;/code&gt; that referred to the current instance of Rocket to a temporary variable that is referenced in the event handlers. This seemed kludgy to me, and I soon discovered the $.proxy() method that jQuery (and other frameworks similarly) provide:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;c1&quot;&gt;//Rocket.js&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrub&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/launch_code&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;proxy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Launching from &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launchCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Not ready to launch!&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;proxy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Failed to get launch code for &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//RocketSpec.js&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Rocket&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;#launch&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;beforeEach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Cape Canaveral, FL&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;fakeAjax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;urls&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/launch_code&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;successData&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;{ &amp;quot;launchCode&amp;quot;: 12345 }&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}})&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;spyOn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;ignite&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;spyOn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;scrub&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

    &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;ignites if ready&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;waits if not ready&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;not&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;scrubs if a bad launch code is given&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;fakeAjax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;urls&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/launch_code&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;errorMessage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;{ &amp;quot;error&amp;quot;: &amp;quot;too bad&amp;quot; }&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}}})&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The problem now is there are all sorts of functions hanging around within &lt;code&gt;Rocket#launch()&lt;/code&gt; that are a bit difficult to test in a straightforward manner. Solution: create some functions on Rocket that act as event handlers.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Rocket.js&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Cape Canaveral, FL&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;igniteWhenReady&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Launching from &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launchCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Not ready to launch!&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;invalidLaunchCode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Failed to get launch code for &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/launch_code&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;proxy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;igniteWhenReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;proxy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;invalidLaunchCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//RocketSpec.js&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Rocket&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;beforeEach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Cape Canaveral, FL&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;spyOn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;ignite&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;spyOn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;scrub&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;#launch&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// we don&amp;#39;t need to test launch() because we&amp;#39;d really just be testing $.ajax&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;#igniteWhenReady&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;ignites if ready&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;igniteWhenReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;launchCode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;12345&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;does not ignite if not ready&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;igniteWhenReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;not&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;#invalidLaunchCode&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;scrubs if a bad launch code is given&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;invalidLaunchCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is much cleaner and easier to test, but those lingering &lt;code&gt;$.proxy()&lt;/code&gt; calls were bugging me. They also made debugging a bit more tedious when having to step through the calls to $.proxy.&lt;/p&gt;

&lt;p&gt;My solution: stop fighting with &lt;code&gt;this&lt;/code&gt; and create my own event proxy pattern. Testing is now much cleaner.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;c1&quot;&gt;//Rocket.js&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrub&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;events&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;igniteWhenReady&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Launching from &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launchCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Not ready to launch!&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;invalidLaunchCode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Failed to get launch code for &amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prototype&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;launch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ajax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/launch_code&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;events&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;igniteWhenReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;events&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;invalidLaunchCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//RocketSpec.js&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Rocket&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;igniteWhenReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;invalidLaunchCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;beforeEach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Cape Canaveral, FL&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;spyOn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;ignite&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;spyOn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;scrub&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;igniteWhenReady&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;events&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;igniteWhenReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;invalidLaunchCode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;events&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;invalidLaunchCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;.events&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;.igniteWhenReady&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;ignites if ready&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;igniteWhenReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;launchCode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;12345&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;does not ignite if not ready&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isReady&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;igniteWhenReady&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ignite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;not&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;describe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;.invalidLaunchCode&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;it&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;scrubs if a bad launch code is given&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;invalidLaunchCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;expect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rocket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scrub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The result is much more readable code, easier debugging (when absolutely necessary), and simpler testing without all those nested closures and AJAX stubs. As an added bonus, you get to keep the &lt;code&gt;this&lt;/code&gt; in your event handlers that refers to the event itself.&lt;/p&gt;

&lt;p&gt;This experience has led me to believe that a lot of the problems CoffeeScript tries to solve (like &lt;a href=&quot;http://jashkenas.github.com/coffee-script/#fat_arrow&quot;&gt;function binding&lt;/a&gt;) can really just be solved using good, simple JavaScript coding practices. I’m happy to hear from anyone who has a better pattern or has had similar experiences.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Bringing sustainability to the heart of commerce</title>
   <link href="http://numbers.brighterplanet.com/2011/05/12/bringing-sustainability-to-the-heart-of-commerce"/>
   <updated>2011-05-12T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/05/12/bringing-sustainability-to-the-heart-of-commerce</id>
   <author>
     <name>Patti</name>
   </author>
   <content type="html">&lt;p&gt;&lt;em&gt;“The world’s most advanced carbon calculator may already be in your wallet.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That’s the tagline on a postcard we’re distributing today here at the &lt;a href=&quot;http://www.ceres.org/conferences&quot;&gt;Ceres conference&lt;/a&gt; in Oakland, where we’re &lt;a href=&quot;http://newsroom.mastercard.com/press-releases/mastercard-and-brighter-planet-announce-new-offering-to-help-companies-manage-their-environmental-footprint/&quot;&gt;announcing a major new partnership&lt;/a&gt; with MasterCard. Powered by Brighter Planet,  MasterCard’s Carbon Emissions Reporting initiative is a first-of-its-kind sustainability solution that will efficiently bring advanced carbon analysis to more businesses worldwide than any other service we know of.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Businesses care more and more about managing travel sustainability for reporting, brand, efficiency, and employee engagement purposes. Last year 39 percent of Global 500 companies analyzed and reported their employee travel footprint, up from 34 percent the year before. But getting good carbon info by traditional means, whether compiled in-house, by an outside consultant, or with specialized software, costs time and money—and that means it’s done less frequently, and less carefully, than it could be, which compromises environmental and economic potential.&lt;/p&gt;

&lt;p&gt;It’s this problem that MasterCard and Brighter Planet are targeting with our new carbon intelligence partnership. The concept is simple:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Companies of all sizes&lt;/strong&gt; use corporate cards for flights, hotel stays, car rentals, etc.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;MasterCard&lt;/strong&gt; helps these companies aggregate and analyze all of this spending data, delivering sophisticated business intelligence through their Enhanced Data offering.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Brighter Planet&lt;/strong&gt; steps in to deliver the science, analyzing all of this accumulated travel transaction data to calculate carbon footprints for flights, rental cars, hotels, and other purchases. Our cloud-based CM1 platform works behind the scenes, adding authoritative footprint data to the other spending details already in the MasterCard system for use by clients.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Corporate card accountholders&lt;/strong&gt; gain access to employee travel carbon data through the same MasterCard software they already use to manage purchasing card business intelligence online. This new value comes with no new costs, no new software programs to adopt, and no new partnerships to manage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the direction we believe the next generation of carbon and energy data management solutions is headed, and it’s just the type of program we built &lt;a href=&quot;http://brighterplanet.com/services&quot;&gt;CM1&lt;/a&gt; to power. As organizations begin to contemplate not just measurement but active management of sustainability—and as global business data ecosystems are increasingly interconnected—we think MasterCard’s program will serve as a powerful example of what’s just now becoming possible.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Tronprint is Now in Public Beta</title>
   <link href="http://numbers.brighterplanet.com/2011/05/05/tronprint-is-now-in-public-beta"/>
   <updated>2011-05-05T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/05/05/tronprint-is-now-in-public-beta</id>
   <author>
     <name>Derek</name>
   </author>
   <content type="html">&lt;p&gt;Our &lt;a href=&quot;http://addons.heroku.com/tronprint&quot;&gt;Tronprint plugin&lt;/a&gt; for &lt;a href=&quot;http://heroku.com&quot;&gt;Heroku&lt;/a&gt;, which &lt;a href=&quot;http://numbers.brighterplanet.com/2011/03/02/tronprint-measure-the-footprint-of-your-cloud-application/&quot;&gt;measures your cloud app’s carbon footprint&lt;/a&gt;, has just graduated from private beta to public beta! This means anyone with a Heroku account can try it out. Of course, if you don’t use Heroku, you can still install the &lt;a href=&quot;http://brighterplanet.github.com/tronprint/&quot;&gt;Tronprint gem&lt;/a&gt; in your existing Ruby or Rails application.&lt;/p&gt;

&lt;p&gt;We’d love to hear your feedback, so feel free to &lt;a href=&quot;http://twitter.com/brighterplanet&quot;&gt;tweet&lt;/a&gt; or &lt;a href=&quot;&amp;#109;&amp;#097;&amp;#105;&amp;#108;&amp;#116;&amp;#111;:&amp;#105;&amp;#110;&amp;#102;&amp;#111;&amp;#064;&amp;#098;&amp;#114;&amp;#105;&amp;#103;&amp;#104;&amp;#116;&amp;#101;&amp;#114;&amp;#112;&amp;#108;&amp;#097;&amp;#110;&amp;#101;&amp;#116;&amp;#046;&amp;#099;&amp;#111;&amp;#109;&quot;&gt;email&lt;/a&gt; us.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Introducing Bombshell: custom interactive consoles for your Ruby libraries</title>
   <link href="http://numbers.brighterplanet.com/2011/04/20/introducing-bombshell-custom-interactive-consoles-for-your-ruby-libraries"/>
   <updated>2011-04-20T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/04/20/introducing-bombshell-custom-interactive-consoles-for-your-ruby-libraries</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;One of the cool features of &lt;a href=&quot;http://github.com/brighterplanet/carbon&quot;&gt;&lt;code&gt;carbon&lt;/code&gt;&lt;/a&gt;, the Ruby library for our &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;CM1&lt;/a&gt; web service, is its built-in interactive console for experimenting with the service. At Brighter Planet we use &lt;code&gt;carbon&lt;/code&gt;’s console all the time to construct one-off calculations and perform simple analyses.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;We think the built-in library console could be a pretty useful pattern for other libraries; they allow developers to explore your library and its API without having to contrive host applications just to test things out.&lt;/p&gt;

&lt;p&gt;Building &lt;code&gt;carbon&lt;/code&gt;’s console, however, was a major pain. IRB, the console’s basis, is infamous for its poor documentation and, with all due respect, antiquated API. So we extracted all the little tricks and nuances that went into &lt;code&gt;carbon&lt;/code&gt;’s console and put them in a library.&lt;/p&gt;

&lt;p&gt;That library is &lt;a href=&quot;http://github.com/rossmeissl/bombshell&quot;&gt;Bombshell&lt;/a&gt;. To use it, just create a class for the console in your library and hook it into Bombshell. Instance methods on your class are “commands” in your console:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;FooGem&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Shell&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Bombshell&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Environment&lt;/span&gt;
    &lt;span class=&quot;kp&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Bombshell&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Shell&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;prompt_with&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fooshell&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;report&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;FooGem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Foo&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;report!&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# Do something with your library here&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;go&quot;&gt;fooshell&amp;gt; report&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;All is well!&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Bombshell provides callback hooks, supports arbitrary-depth subshells, and handles tab-completion automatically.&lt;/p&gt;

&lt;p&gt;Check out the &lt;a href=&quot;https://github.com/rossmeissl/bombshell#readme&quot;&gt;README&lt;/a&gt;, the &lt;a href=&quot;http://rubydoc.info/github/rossmeissl/bombshell/master/frames&quot;&gt;docs&lt;/a&gt;, and &lt;code&gt;carbon&lt;/code&gt;’s &lt;a href=&quot;https://github.com/brighterplanet/carbon/blob/master/lib/carbon/shell.rb&quot;&gt;shell class&lt;/a&gt; (and &lt;a href=&quot;https://github.com/brighterplanet/carbon/blob/master/lib/carbon/shell/emitter.rb&quot;&gt;subshell&lt;/a&gt;) for a more complex (production) example.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;https://github.com/aslakhellesoy&quot;&gt;Aslak Hellesøy&lt;/a&gt;, whose &lt;a href=&quot;https://github.com/aslakhellesoy/aruba&quot;&gt;&lt;code&gt;aruba&lt;/code&gt;&lt;/a&gt; Cucumber steps made it possible to write a pretty thorough test suite for Bombshell.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Healthy Hacker Fun Run photos</title>
   <link href="http://numbers.brighterplanet.com/2011/04/12/healthy-hacker-photos"/>
   <updated>2011-04-12T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/04/12/healthy-hacker-photos</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;Thanks to all who ran!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/brighterplanet/sets/72157626358691683&quot;&gt;&lt;img src=&quot;/images/2011-04-12-healthy-hacker-photos/group.jpg&quot; alt=&quot;Healthy Hacker Fun Run group photo&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>CodeConf 5k Results</title>
   <link href="http://numbers.brighterplanet.com/2011/04/11/code-conf-5k-results"/>
   <updated>2011-04-11T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/04/11/code-conf-5k-results</id>
   <author>
     <name>Derek</name>
   </author>
   <content type="html">&lt;p&gt;The results are in! We sponsored a morning “Healthy Hacker” 5k run along San Francisco’s Embarcadero. It was a beautiful morning for a run, and we all at Brighter Planet had a great time. Thanks to everyone who participated!&lt;/p&gt;

&lt;table&gt;
&lt;tr&gt;&lt;th&gt;Number&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Total Time&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;39&lt;/td&gt;&lt;td&gt;Jeremy Ashkenas&lt;/td&gt;&lt;td&gt;21:03.5&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;49&lt;/td&gt;&lt;td&gt;Mark Headd&lt;/td&gt;&lt;td&gt;21:24.6&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;37&lt;/td&gt;&lt;td&gt;Ian Young&lt;/td&gt;&lt;td&gt;21:27.7&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;43&lt;/td&gt;&lt;td&gt;Ethan Herdrick&lt;/td&gt;&lt;td&gt;21:42.1&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;56&lt;/td&gt;&lt;td&gt;Douglas Sellers&lt;/td&gt;&lt;td&gt;22:10.6&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;26&lt;/td&gt;&lt;td&gt;Jacob Kaplan-Moss&lt;/td&gt;&lt;td&gt;23:09.3&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;51&lt;/td&gt;&lt;td&gt;Kasima Tharnpipitchai&lt;/td&gt;&lt;td&gt;23:16.8&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;02&lt;/td&gt;&lt;td&gt;Sean Bleier&lt;/td&gt;&lt;td&gt;23:20.3&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;Scott Chacon&lt;/td&gt;&lt;td&gt;23:22.6&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;53&lt;/td&gt;&lt;td&gt;Mislav Marohnić&lt;/td&gt;&lt;td&gt;23:23.0&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;05&lt;/td&gt;&lt;td&gt;Seth Fitzsimmons&lt;/td&gt;&lt;td&gt;23:58.3&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;Piet Jaspers&lt;/td&gt;&lt;td&gt;24:12.2&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;83&lt;/td&gt;&lt;td&gt;Jeremy Yun&lt;/td&gt;&lt;td&gt;24:52.1&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;19&lt;/td&gt;&lt;td&gt;Etienne Segonzac&lt;/td&gt;&lt;td&gt;25:25.6&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;29&lt;/td&gt;&lt;td&gt;Florian Le Goff&lt;/td&gt;&lt;td&gt;26:19.9&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;36&lt;/td&gt;&lt;td&gt;Jelle Vandebeeck&lt;/td&gt;&lt;td&gt;27:13.8&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;99&lt;/td&gt;&lt;td&gt;Chris Bowns&lt;/td&gt;&lt;td&gt;27:19.4&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;Clint Shryock&lt;/td&gt;&lt;td&gt;28:00.7&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;Matthew Aebersold&lt;/td&gt;&lt;td&gt;28:21.1&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;04&lt;/td&gt;&lt;td&gt;Derek Kastner&lt;/td&gt;&lt;td&gt;28:51.8&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;30&lt;/td&gt;&lt;td&gt;John Crepezzi&lt;/td&gt;&lt;td&gt;29:07.4&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;34&lt;/td&gt;&lt;td&gt;Aubrey Holland&lt;/td&gt;&lt;td&gt;29:23.2&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;32&lt;/td&gt;&lt;td&gt;Baldur Gudbjornsson&lt;/td&gt;&lt;td&gt;29:53.1&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;85&lt;/td&gt;&lt;td&gt;Jose Fernandez&lt;/td&gt;&lt;td&gt;31:44.5&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;24&lt;/td&gt;&lt;td&gt;Clint Ecker&lt;/td&gt;&lt;td&gt;31:49.4&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;Ryan Williams&lt;/td&gt;&lt;td&gt;33:41.6&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;40&lt;/td&gt;&lt;td&gt;Ilya Shindyapin&lt;/td&gt;&lt;td&gt;33:48.3&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;07&lt;/td&gt;&lt;td&gt;Rob Tsuk&lt;/td&gt;&lt;td&gt;34:36.4&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;We also had a great time at &lt;a href=&quot;http://codeconf.com&quot;&gt;CodeConf&lt;/a&gt;. It was very well put together and the folks at &lt;a href=&quot;http://github.com&quot;&gt;Github&lt;/a&gt; deserve serious kudos. The speakers all had great things to say and the social events were creative and top-notch.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Our carbon models got certified, and what this means for you</title>
   <link href="http://numbers.brighterplanet.com/2011/04/05/our-carbon-models-got-certified-and-what-this-means-for-you"/>
   <updated>2011-04-05T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/04/05/our-carbon-models-got-certified-and-what-this-means-for-you</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;Today we &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/76/original/DNV_BP_press_release.pdf&quot;&gt;announced&lt;/a&gt; that &lt;a href=&quot;http://www.dnv.com/&quot;&gt;Det Norske Veritas&lt;/a&gt; (DNV) has reviewed and certified carbon models in our &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;CM1&lt;/a&gt; web service as complying with the major international carbon standards. This makes Brighter Planet one of the first in the carbon software industry to get a third-party seal of approval for standards compliance, and the first open-source carbon software provider to do so.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;The certification process was quite involved. DNV took months to review our carbon models, examining calculation methodologies, source code, data sources, and documentation to check conformity with three global standards: the Greenhouse Gas Protocol, ISO 14064, and the Climate Registry. This is a crucial piece of our strategy to ensure the highest transparency and integrity in enterprise greenhouse gas calculations.&lt;/p&gt;

&lt;p&gt;It’s big news for Brighter Planet and our clients, because it validates the methodologies and data sources that power the carbon calculations in our &lt;a href=&quot;http://carbon.brighterplanet.com/models/flight&quot;&gt;flight&lt;/a&gt;, &lt;a href=&quot;http://carbon.brighterplanet.com/models/automobile_trip&quot;&gt;automobile&lt;/a&gt;, &lt;a href=&quot;http://carbon.brighterplanet.com/models/meeting&quot;&gt;meeting&lt;/a&gt;, and &lt;a href=&quot;http://carbon.brighterplanet.com/models/lodging&quot;&gt;lodging&lt;/a&gt; modules, among others. Ensuring authoritative carbon accounting practices is becoming increasingly important as the emissions software industry matures, and the report from DNV, the preeminent organization in carbon verification, is a critical step.&lt;/p&gt;

&lt;p&gt;Switching over to certified calculations on CM1 is a breeze—we’ll be showing you how in additional blog posts over the course of the week. (Short version: just submit your calculation queries to &lt;code&gt;certified.carbon.brighterplanet.com&lt;/code&gt; instead of &lt;code&gt;carbon.brighterplanet.com&lt;/code&gt;.)&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Resque, the rand() method, and Kernel.fork</title>
   <link href="http://numbers.brighterplanet.com/2011/03/30/resque-the-rand-method-and-kernel-fork"/>
   <updated>2011-03-30T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/03/30/resque-the-rand-method-and-kernel-fork</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;We had a seemingly impossible number of tmpdir collisions once we switched our &lt;a href=&quot;http://data.brighterplanet.com&quot;&gt;reference data web service&lt;/a&gt; from &lt;a href=&quot;https://github.com/collectiveidea/delayed_job&quot;&gt;DelayedJob&lt;/a&gt; to &lt;a href=&quot;https://github.com/defunkt/resque&quot;&gt;Resque&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The culprit was calling &lt;code&gt;rand()&lt;/code&gt; in worker processes that are forked off the main process by Resque:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;irb&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Kernel&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fork&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;rand&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;536506566371644&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Kernel&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fork&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;rand&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;536506566371644&lt;/span&gt;              &lt;span class=&quot;c1&quot;&gt;# the same&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Kernel&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fork&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;rand&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;536506566371644&lt;/span&gt;              &lt;span class=&quot;c1&quot;&gt;# the same&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Don’t forget to call &lt;code&gt;srand&lt;/code&gt;!&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;irb&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Kernel&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fork&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;srand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;rand&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;232438861240513&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Kernel&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fork&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;srand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;rand&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;363543277594837&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Kernel&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fork&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;srand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;rand&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mo&quot;&gt;0001333&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;87538081786&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now it’s fixed in the &lt;a href=&quot;https://github.com/seamusabshere/remote_table&quot;&gt;remote_table gem&lt;/a&gt; via &lt;a href=&quot;https://github.com/seamusabshere/remote_table/commit/9d0d99872171eb9e310aeccf2349f9f6559fb760&quot;&gt;this commit&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Carbon.js</title>
   <link href="http://numbers.brighterplanet.com/2011/03/18/carbon-js"/>
   <updated>2011-03-18T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/03/18/carbon-js</id>
   <author>
     <name>Derek</name>
   </author>
   <content type="html">&lt;p&gt;Lately, I’ve been working on a Google Maps mashup that calculates CO2 emissions for automobile, bus, and rail trips. Since Google Maps has such a great JavaScript API, I decided to write the application almost entirely in JavaScript. Thus, &lt;a href=&quot;http://github.com/dkastner/Carbon.js&quot;&gt;Carbon.js&lt;/a&gt; was born!&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Carbon.js makes it simple to calculate emissions. Its design is similar to the Ruby &lt;a href=&quot;http://rubygems.org/gems/carbon&quot;&gt;carbon gem&lt;/a&gt;. For any class that represents an “emission activity”, e.g. an &lt;a href=&quot;http://carbon.brighterplanet.com/models/automobile_trip&quot;&gt;automobile trip&lt;/a&gt;, you can extend it with Carbon.js to give it the ability to perform calculations.&lt;/p&gt;

&lt;p&gt;Let’s look at an example.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;RentalCar = function() {};
Carbon.emitter(RentalCar, function(emitter) {
  emitter.emitAs(&#39;automobile&#39;);
  emitter.provide(&#39;make_model&#39;);
  emitter.provide(&#39;weekly_distance&#39;);
  emitter.provide(&#39;timeframe&#39;);
});

var focus = new RentalCar;
focus.make_model = &#39;Ford Focus&#39;;
focus.weekly_distance = 436;
focus.timeframe = &#39;2010-03-08/2010-03-14&#39;;

focus.getEmissionEstimate(function(estimate) {
  alert(&quot;My Focus&#39; emissions for the rental period of March 8th-14th are: &quot; + estimate.value());
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As you can see, the configuration defined in the &lt;code&gt;Carbon.emitter&lt;/code&gt; call maps properties on an instance of RentalCar to characteristics defined in automobile’s &lt;a href=&quot;http://carbon.brighterplanet.com/automobiles/options&quot;&gt;characteristics API&lt;/a&gt;. In order to calculate emissions, a call to &lt;code&gt;getEmissionEstimate&lt;/code&gt; with a callback function parameter is required. Within that callback, you can update HTML on a page with the result.&lt;/p&gt;

&lt;h2 id=&quot;future-improvements&quot;&gt;Future Improvements&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Carbon only maps properties of an object to characteristics. It will be simple to allow an instance function to be mapped to a characteristic.&lt;/li&gt;
  &lt;li&gt;Carbon.js requires that you use jQuery. One improvement would be to use platform-agnostic &lt;a href=&quot;http://en.wikipedia.org/wiki/XHR&quot;&gt;XHR&lt;/a&gt; and &lt;a href=&quot;http://api.jquery.com/jQuery.proxy/&quot;&gt;proxy&lt;/a&gt; functions, or intelligently detect available libraries, like Prototype, MooTools, etc.&lt;/li&gt;
  &lt;li&gt;For &lt;a href=&quot;http://en.wikipedia.org/wiki/DRY&quot;&gt;DRY&lt;/a&gt;ness sake, Carbon.js operates on classes. It may be helpful to be able to decorate any JavaScript object on the fly.&lt;/li&gt;
&lt;/ul&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>What you should know about mysql2 memory usage</title>
   <link href="http://numbers.brighterplanet.com/2011/03/15/what-you-should-know-about-mysql2-memory-usage"/>
   <updated>2011-03-15T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/03/15/what-you-should-know-about-mysql2-memory-usage</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;If you’re using &lt;a href=&quot;http://rubygems.org/gems/mysql2&quot;&gt;mysql2&lt;/a&gt;, you should be aware of a memory usage issue:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# mysql2 gem - no way to avoid using a lot of memory if you&amp;#39;re streaming a lot of rows&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Mysql2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:host&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;localhost&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:username&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;root&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;results&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;SELECT * FROM users WHERE group=&amp;#39;githubbers&amp;#39;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# mysql gem - keep memory usage flat if you&amp;#39;re streaming a lot of rows&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;dbh&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Mysql&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;init&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;dbh&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connect&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;localhost&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;root&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;dbh&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;query_with_result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;false&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;dbh&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;SELECT * FROM users WHERE group=&amp;#39;githubbers&amp;#39;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;results&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dbh&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;use_result&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;!-- more start --&gt;

&lt;p&gt;While working on our &lt;a href=&quot;http://data.brighterplanet.com&quot;&gt;reference data web service&lt;/a&gt;, I ran these benchmarks:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Exporting 5,000 rows using &lt;tt&gt;mysql&lt;/tt&gt; (the “old” gem) &lt;a href=&quot;https://github.com/seamusabshere/mysql2xxxx/blob/master/benchmark/results/0.0.4-20110314190640.txt&quot;&gt;stays flat on memory&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Exporting 5,000 rows using &lt;tt&gt;mysql2&lt;/tt&gt; &lt;a href=&quot;https://github.com/seamusabshere/mysql2xxxx/blob/master/benchmark/results/0.0.3-20110314160922.txt&quot;&gt;takes an ever-increasing amount of memory&lt;/a&gt; (not good!)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;the-problem&quot;&gt;The problem&lt;/h3&gt;

&lt;p&gt;The author of the gem in question, &lt;a href=&quot;http://rubygems.org/gems/mysql2&quot;&gt;mysql2&lt;/a&gt;, knows about &lt;a href=&quot;https://github.com/brianmario/mysql2/issues/87&quot;&gt;the issue&lt;/a&gt;. In a nutshell, the gem’s use of &lt;code&gt;mysql_store_result&lt;/code&gt; (as opposed to &lt;code&gt;mysql_use_result&lt;/code&gt;) leads the underlying &lt;tt&gt;libmysql&lt;/tt&gt; library to always load entire resultsets into memory… &lt;strong&gt;even&lt;/strong&gt; if &lt;code&gt;:cache_rows =&amp;gt; false&lt;/code&gt; is passed as a runtime option. A &lt;code&gt;:streaming =&amp;gt; true&lt;/code&gt; option would make perfect sense!&lt;/p&gt;

&lt;h3 id=&quot;the-solution&quot;&gt;The solution&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;I had to modify my gem, &lt;a href=&quot;http://rubygems.org/gems/mysql2xxxx&quot;&gt;mysql2xxxx&lt;/a&gt; (which provides &lt;tt&gt;mysql2csv&lt;/tt&gt;, &lt;tt&gt;mysql2json&lt;/tt&gt;, and &lt;tt&gt;mysql2xml&lt;/tt&gt;) to use the “old” &lt;tt&gt;mysql&lt;/tt&gt; gem.&lt;/li&gt;
  &lt;li&gt;If you’re using &lt;tt&gt;mysql2&lt;/tt&gt; (it’s the default on Rails 3!) then be aware that processing huge resultsets has a different memory impact than it did with &lt;tt&gt;mysql&lt;/tt&gt;.&lt;/li&gt;
  &lt;li&gt;Vote up &lt;a href=&quot;https://github.com/brianmario/mysql2/issues/87&quot;&gt;the issue&lt;/a&gt; on github… it would be nice to optionally use &lt;code&gt;mysql_use_result&lt;/code&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I believe &lt;tt&gt;mysql2&lt;/tt&gt; has a promising future and this memory problem will probably be gone soon. Thanks &lt;a href=&quot;https://github.com/brianmario&quot;&gt;&lt;tt&gt;brianmario&lt;/tt&gt;&lt;/a&gt;!&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Greensburg named Wind Project of the Year</title>
   <link href="http://numbers.brighterplanet.com/2011/03/09/greensburg-named-wind-project-of-the-year"/>
   <updated>2011-03-09T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/03/09/greensburg-named-wind-project-of-the-year</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://brighterplanet.com/projects/19-greensburg-wind-farm&quot;&gt;Greensburg Wind Farm&lt;/a&gt;, one of the community carbon projects in our offset portfolio, has been named &lt;a href=&quot;http://www.renewableenergyworld.com/rea/news/article/2011/03/2011-excellence-in-renewable-energy-awards-projects-of-the-year&quot;&gt;Wind Project of the Year&lt;/a&gt; by Renewable Energy World. Brighter Planet is a charter supporter of the wind farm—alongside Green Mountain Coffee Roasters, Ben &amp;amp; Jerry’s, Stonyfield, CLIF Bar, Aveda, Clean Air-Cool Planet, and Reverb—providing key funding from groundbreaking in 2009 through through project completion in 2010.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;The Excellence in Renewable Energy awards were granted in five categories—including solar, geothermal, biomass, and hydro in addition to wind—with judges considering “the innovative technology that was employed as well as the projects’ impact on the industry at large and on the communities in which they were installed.”&lt;/p&gt;

&lt;p&gt;We source top-quality projects that meet our rigorous &lt;a href=&quot;http://brighterplanet.com/pdfs/terms/Brighter_Planet-Carbon_Offset_Policy.pdf&quot;&gt;offset policy&lt;/a&gt;, and it’s great to see one of our projects getting this recognition from industry analysts. Kudos to our partner NativeEnergy, whose vision and execution were critical in getting the project built. And many thanks to all you Brighter Planet &lt;a href=&quot;http://giving.bankofamerica.com/brighterplanet?cm_mmc=DEP-Affinity-_-brighterplanet-PAR-_-DA05LT005Y_partnersite_BrighterPlanet_ABE_Productlink-_-MyExpression&quot;&gt;cardholders&lt;/a&gt; out there whose daily support is instrumental in making this and &lt;a href=&quot;http://brighterplanet.com/projects&quot;&gt;other projects&lt;/a&gt; a reality.&lt;/p&gt;

&lt;p&gt;As President Obabma said in a speech last year, Greensburg is “a global example of how clean energy can power an entire community—how it can bring jobs and businesses to a place where piles of bricks and rubble once lay.”&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Virtual servers, real impact</title>
   <link href="http://numbers.brighterplanet.com/2011/03/08/virtual-servers-real-impact"/>
   <updated>2011-03-08T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/03/08/virtual-servers-real-impact</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;Last week we &lt;a href=&quot;http://numbers.brighterplanet.com/2011/03/02/tronprint-measure-the-footprint-of-your-cloud-application&quot;&gt;announced&lt;/a&gt; &lt;a href=&quot;http://brighterplanet.github.com/tronprint&quot;&gt;Tronprint&lt;/a&gt;, our Ruby library for measuring an application’s carbon footprint in real time. There’s a subtlety to the way that my colleague Derek designed Tronprint that didn’t hit me for a while: as a piece of monitoring software it’s “inside-out” rather than “outside-in.” It’s a simple distinction that’s going to let us continue to address sustainability in this new era of cloud computing.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;First, let’s look at an old-school web application:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2011-03-08-virtual-servers-real-impact/diagrams-01.png&quot; alt=&quot;Simple server architecture&quot; /&gt;
{.wide}&lt;/p&gt;

&lt;p&gt;Calculating the application’s footprint in this case is pretty easy—just base your calculation on the electricity used by the server. Unfortunately this infrastructural design is rarely ever seen in the wild anymore. Virtualization presents one challenge:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2011-03-08-virtual-servers-real-impact/diagrams-02.png&quot; alt=&quot;Simple virtualization&quot; /&gt;
{.wide}&lt;/p&gt;

&lt;p&gt;How do you allocate impact among virtual servers? If you control the hypervisor (the coordinating software on the physical host server), presumably you would have access to some data that would help determine this. But oftentimes owners of virtual servers do not have access to this data.&lt;/p&gt;

&lt;p&gt;Let’s take this a step further and add load balancing:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2011-03-08-virtual-servers-real-impact/diagrams-03.png&quot; alt=&quot;Load balancing&quot; /&gt;
{.wide}&lt;/p&gt;

&lt;p&gt;Modern load-balanced architectures can have an arbitrary number of “instances” of the application running on an arbitrary number of virtual machines. At this point you can see our analysis breaking down: the physicality of these computations is both mysterious and irrelevant.&lt;/p&gt;

&lt;p&gt;The abstraction of physical resources reaches a kind of apotheosis with Platform-as-a-Service (PaaS) offerings like &lt;a href=&quot;http://heroku.com/how/architecture&quot;&gt;Heroku&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/2011-03-08-virtual-servers-real-impact/heroku.png&quot; alt=&quot;Heroku architecture&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Routing mesh? Dyno grids? When Seamus, Robbie, and I were having lunch with the Heroku folks last week, they emphasized that they’re trying to keep the Heroku experience entirely free of the notion of physical servers.&lt;/p&gt;

&lt;p&gt;This is a good thing. But as our applications grow ever more distant from the silicon they run on, it’s easy to lose sight of the fact that those circuits are electrical circuits—the server may be virtual, but the impact’s very real.&lt;/p&gt;

&lt;p&gt;So, as the operator of an application that lives inside of a grid inside of a mesh inside of a platform inside of a virtualized datacenter, how are you to know your application’s footprint? Having done everything they can to keep you from the physical, are your service providers unwittingly hamstringing your sustainability agenda?&lt;/p&gt;

&lt;p&gt;The answer to this question, it turns out, is the simple distinction that sets Tronprint apart: monitor your application’s resource use from the inside out. In a supervirtualized architecture, after all, the only thing you have any truly predictable control over is the application itself.&lt;/p&gt;

&lt;p&gt;I like to imagine Tronprint as being a born-and-bred native resident of the cloud. There are dozens of layers of technology keeping the cloud alive: servers, routers, load balancers, datacenters. But just as we don’t need advanced knowledge of astrophysics to carry on our daily lives here on our planet, Tronprint doesn’t care about all that. It lives on the surface, among the applications, helping them out.&lt;/p&gt;

&lt;p&gt;Subtle, right? I wonder if Derek knew just how clever he’d been :)&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Exploring data in partnership with Google</title>
   <link href="http://numbers.brighterplanet.com/2011/03/07/exploring-data-in-partnership-with-google"/>
   <updated>2011-03-07T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/03/07/exploring-data-in-partnership-with-google</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;Google’s &lt;a href=&quot;http://code.google.com/apis/publicdata/&quot;&gt;DSPL&lt;/a&gt; and &lt;a href=&quot;http://www.google.com/publicdata/home&quot;&gt;Public Data Explorer&lt;/a&gt; help us improve our &lt;a href=&quot;http://data.brighterplanet.com&quot;&gt;reference data web service&lt;/a&gt; by visualizing it. Working with Jürgen Schwärzler, a statistician for Google, we laid the foundation for an &lt;a href=&quot;http://www.google.com/publicdata/overview?ds=z1ctl4c7pbob1_&quot;&gt;automobile industry dataset&lt;/a&gt;:&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;&lt;a href=&quot;http://www.google.com/publicdata/overview?ds=z1ctl4c7pbob1_&quot;&gt;&lt;img src=&quot;/images/2011-03-07-exploring-data-in-partnership-with-google/automobile-industry-dataset.small.png&quot; alt=&quot;Screenshot&quot; /&gt;&lt;/a&gt;
{.wide}&lt;/p&gt;

&lt;p&gt;It’s a demonstration of the power of the cloud to drive value-added aggregation, errata cleanup, record linkage, and ultimately &lt;a href=&quot;http://gr.eenerpastur.es/&quot;&gt;creative&lt;/a&gt; and &lt;a href=&quot;http://carbon.brighterplanet.com/&quot;&gt;commercial use&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We look forward to working more with Google in the future to develop more datasets (including an upcoming flight industry dataset) and improve existing ones.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Tronprint: Measure the footprint of your cloud application</title>
   <link href="http://numbers.brighterplanet.com/2011/03/02/tronprint-measure-the-footprint-of-your-cloud-application"/>
   <updated>2011-03-02T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/03/02/tronprint-measure-the-footprint-of-your-cloud-application</id>
   <author>
     <name>Derek</name>
   </author>
   <content type="html">&lt;p&gt;One of the major factors contributing to an organization’s sustainability, especially for web application companies, is the carbon footprint associated with IT operations. Gartner Research has estimated that the IT sector accounts for &lt;a href=&quot;http://www.gartner.com/it/page.jsp?id=503867&quot;&gt;2% of global greenhouse gas emissions&lt;/a&gt; and that, “despite the overall environmental value of IT, Gartner believes this is unsustainable.”&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;One of the ways many organizations cut costs and emissions is by outsourcing and virtualizing their IT operations. For instance, many web startups host their applications with services like &lt;a href=&quot;http://heroku.com&quot;&gt;Heroku&lt;/a&gt; and &lt;a href=&quot;http://engineyard.com&quot;&gt;Engine Yard&lt;/a&gt;. Outsourcing and virtualization helps, but the main disadvantage is that it’s difficult to monitor the power usage (and footprint) of your application.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tronprint.png&quot; alt=&quot;Tronprint logo&quot; style=&quot;float:left; margin: 0 10px 0 0;&quot; /&gt; This is where &lt;a href=&quot;http://brighterplanet.github.com/tronprint&quot;&gt;Tronprint&lt;/a&gt; comes in. Tronprint keeps a running total of your application’s resource usage as it runs. This resource usage &lt;a href=&quot;http://bnrg.eecs.berkeley.edu/~randy/Courses/CS294.F07/20.3.pdf&quot;&gt;translates into the total amount of electricity&lt;/a&gt; used by your application. You can even tell Tronprint where your application is hosted, and it will take the server’s local electricity source into account when coming up with an emission estimate. For instance, a server powered by a coal power plant is dirtier than one powered by natural gas.&lt;/p&gt;

&lt;p&gt;Tronprint allows you to take action in three ways:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Simply knowing your footprint helps you report reliable sustainability metrics.&lt;/li&gt;
  &lt;li&gt;You can use Tronprint to help you choose a hosting location that uses cleaner energy sources.&lt;/li&gt;
  &lt;li&gt;By improving the computational efficiency of your application, you reduce emissions—and have metrics to prove it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you host your application on Heroku, you can add Tronprint as an “Add-On.” The Heroku Add-On is currently in private beta, but will be moving to public beta in the near future.&lt;/p&gt;

&lt;p&gt;You can also install the &lt;a href=&quot;http://rubygems.org/gems/tronprint&quot;&gt;Tronprint gem&lt;/a&gt; today in any Ruby or Rails application. There are detailed instructions at &lt;a href=&quot;http://rubydoc.info/github/brighterplanet/tronprint/master/frames&quot;&gt;rdoc.info&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Bringing carbon calculations to TripIt</title>
   <link href="http://numbers.brighterplanet.com/2011/02/22/bringing-carbon-calculations-to-tripit"/>
   <updated>2011-02-22T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/02/22/bringing-carbon-calculations-to-tripit</id>
   <author>
     <name>Scott</name>
   </author>
   <content type="html">&lt;p&gt;It’s a privilege to be posting here on Safety in Numbers, and particularly exciting to do so as Brighter Planet’s first &lt;a href=&quot;http://brighterplanet.github.com/fellowship.html&quot;&gt;Developer Fellow&lt;/a&gt;. I was an early Brighter Planet cardholder and have watched the team closely, so it’s great to get a chance to work with them.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;For a few weeks now, I have been working with Brighter Planet &lt;a href=&quot;http://carbon.brighterplanet.com/&quot;&gt;CM1 API&lt;/a&gt; to create TripCarbon, an automated tool that calculates carbon output from &lt;a href=&quot;http://www.tripit.com&quot;&gt;TripIt&lt;/a&gt; itineraries.  If you’re not familiar with Tripit, you can send it your travel confirmation emails and it creates amazing online itineraries with real-time status updates, loyalty program points tracker (for pro users), refund tracking, and more. I’ve been using TripIt for several years, and it’s one of the most powerful web tools I use.&lt;/p&gt;

&lt;p&gt;Adding carbon data to TripIt will allow the many users of Tripit to easily and automatically see the carbon use of their trips. Why is this useful? Armed with this knowledge, they can offset their trips or make trip-planning decisions which minimize carbon use. A former employer of mine offset all business travel; with this tool, it will be much easier to offset the appropriate amount of carbon with minimal work. Personally, it’s great to be working on something that I’ll use regularly.&lt;/p&gt;

&lt;p&gt;Working with the CM1 tool has been a breeze. Since I’ve been using Ruby on Rails, I’ve been able to use the &lt;a href=&quot;https://github.com/brighterplanet/carbon&quot;&gt;Carbon gem&lt;/a&gt; to easily extend my Rails models. I’ve also used the handy &lt;a href=&quot;https://github.com/seamusabshere/conversions&quot;&gt;Conversions gem&lt;/a&gt; to handle unit conversions.&lt;/p&gt;

&lt;p&gt;After setting up my API key and adding the Carbon gem to my Gemfile, calculating emissions for my flight model was as simple as providing data from TripIt’s API:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;emit_as&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:flight&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;provide&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:origin_airport&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;provide&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:destination_airport&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;provide&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:airline&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;provide&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:segments_per_trip&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;provide&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:trips&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;provide&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:start_date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:as&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:date&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;provide&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:aircraft&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;provide&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:distance_in_kilometers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:as&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:distance_estimate&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;provide&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:timeframe&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The data I get from TripIt isn’t always consistent, since it gets pulled from confirmation emails, but CM1 is amazingly flexible with data inputs. For instance, it recognize various code types for airlines and aircrafts. Or if the distance isn’t available, it can calculate it automatically from the origin and destination airports. CM1 returns not only the emissions estimate, but also a link to the full methodology, which I can then add to the relevant TripIt note.&lt;/p&gt;

&lt;p&gt;I’m still working on my app, but I look forward to sharing it with you soon. Thanks for reading.&lt;/p&gt;

&lt;p&gt;Scott Bulua&lt;/p&gt;

&lt;p&gt;Developer Fellow
&lt;!-- more end --&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>New electricity model goes live</title>
   <link href="http://numbers.brighterplanet.com/2011/02/11/new-electricity-model-goes-live"/>
   <updated>2011-02-11T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/02/11/new-electricity-model-goes-live</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;We’ve just switched on version 0.0.1 of our newest carbon model, &lt;a href=&quot;http://carbon.brighterplanet.com/models/electricity_use&quot;&gt;Electricity Use&lt;/a&gt;, hosted on our &lt;a href=&quot;http://carbon.brighterplanet.com/&quot;&gt;CM1&lt;/a&gt; footprint calculation platform.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;The new tool takes electricity carbon calculation functionality that’s long been an integral part of many of our existing &lt;a href=&quot;http://carbon.brighterplanet.com/models&quot;&gt;models&lt;/a&gt;, and packages it in a standalone module for use in apps dealing more directly with electricity data.&lt;/p&gt;

&lt;p&gt;The model can be used to measure carbon impacts in any application that processes electricity data, from smart grid metering or billing utilities to corporate accounting and ERP systems. We’ve already got developers working to deploy the new plug-in in their apps. Check out a &lt;a href=&quot;http://carbon.brighterplanet.com/electricity_uses?zip_code=94122&amp;amp;energy=5000&quot;&gt;sample calculation here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Powering the calculations are data from the EPA’s &lt;a href=&quot;http://www.epa.gov/cleanenergy/energy-resources/egrid/index.html&quot;&gt;eGRID&lt;/a&gt;, the definitive source for data on geographic variation in grid electricity sources in the US. Upcoming versions will expand the tool’s functionality to incorporate even higher resolution data on fluctuations in electric sources.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>A closer look at public data cleanup</title>
   <link href="http://numbers.brighterplanet.com/2011/02/08/a-closer-look-at-public-data-cleanup"/>
   <updated>2011-02-08T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/02/08/a-closer-look-at-public-data-cleanup</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;Our CM1 &lt;a href=&quot;http://carbon.brighterplanet.com/models&quot;&gt;carbon models&lt;/a&gt; depend on lots of public energy and emissions data relating to things like buildings and transportation—mostly from government sources like the &lt;a href=&quot;http://www.eia.doe.gov/&quot;&gt;EIA&lt;/a&gt;, &lt;a href=&quot;http://www.bts.gov/&quot;&gt;BTS&lt;/a&gt;, and &lt;a href=&quot;http://www.epa.gov/&quot;&gt;EPA&lt;/a&gt;. Whenever you use or mash up a large dataset you’ll likely run into issues like inconsistent file layouts, awkward formats, and human error. So file cleanup is a large part of the process we go through when plugging data into our system and making them available in our free &lt;a href=&quot;http://data.brighterplanet.com/&quot;&gt;data clearinghouse&lt;/a&gt;. Here’s a quick look at three of the main things we do; we’ll delve into more specifics in subsequent posts:&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Error correction.&lt;/strong&gt; Most datasets are pretty good, but with some containing millions of data points, human error is bound to work its way in. We use search algorithms to identify typos and outliers, and then manually correct or delete flawed entries.&lt;/p&gt;

    &lt;p&gt;&lt;em&gt;For example:&lt;/em&gt; The &lt;a href=&quot;http://www.fueleconomy.gov/&quot;&gt;EPA Fuel Economy Guide&lt;/a&gt; files from 1985 through 2010 contain various typos and inconsistencies. We list corrections to each of these in an errata file that we apply during the import process.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Restructuring.&lt;/strong&gt; Some databases have attribute names that change over time. Others have attributes that contain both numerical data and numerical codes and so require special analysis techniques. In both of these cases we parse the data into a single format that is convenient for calculations.&lt;/p&gt;

    &lt;p&gt;&lt;em&gt;For example:&lt;/em&gt; The EIA’s &lt;a href=&quot;http://www.eia.doe.gov/emeu/cbecs/&quot;&gt;Commercial Buildings Energy Consumption Survey&lt;/a&gt; includes codes like 99999 for nautral gas use when a building never uses natural gas.  The &lt;a href=&quot;http://www.fueleconomy.gov/&quot;&gt;EPA Fuel Economy Guide&lt;/a&gt; uses four different sets of attribute names from 1985 through 2010. &lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Data extraction.&lt;/strong&gt; Some data come from report tables that are only available as a PDF file or in print. We manually extract these data and make them available in formats like CSV, JSON, XML, and SQL that can plug into the modern information ecosystem.&lt;/p&gt;

    &lt;p&gt;&lt;em&gt;For example:&lt;/em&gt; The &lt;a href=&quot;http://www.apta.com/resources/statistics/pages/transitstats.aspx&quot;&gt;APTA Public Transportation Fact Book Appendix A&lt;/a&gt; is only available in PDF format.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We take all the public data we clean up for our clients’ use and post it on &lt;a href=&quot;http://data.brighterplanet.com/&quot;&gt;our data site&lt;/a&gt; so others can benefit as well. It’s available for download in multiple formats. And it’s kept up to date using automated import programs that crawl government agency websites and automatically import the latest data updates as soon as they’re available.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Welcome Matt Colyer, our second Developer Fellow</title>
   <link href="http://numbers.brighterplanet.com/2011/02/07/welcome-matt-colyer-our-second-developer-fellow"/>
   <updated>2011-02-07T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/02/07/welcome-matt-colyer-our-second-developer-fellow</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/matt.jpg&quot; alt=&quot;Matt Colyer headshot&quot; style=&quot;float:left; margin: 0 10px 10px 0;&quot; /&gt; Close on the heels of our &lt;a href=&quot;http://numbers.brighterplanet.com/2011/02/01/introducing-the-brighter-planet-developer-fellowship&quot;&gt;first fellow&lt;/a&gt;, we’re now super happy to welcome our second, Matt Colyer. We’re huge fans of his &lt;a href=&quot;https://github.com/mcolyer/smartermeter&quot;&gt;smartermeter&lt;/a&gt; project and definitely want to see more like it for other energy providers. smartermeter’s roadmap includes carbon calculation (powered by our &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;CM1&lt;/a&gt; service) and a UI for PG&amp;amp;E customers.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Are you working on a project like Matt’s? Or have another idea you want to pursue? The Developer Fellowship accepts unsolicited applications, so visit &lt;a href=&quot;http://brighterplanet.github.com/fellowship.html&quot;&gt;the Fellowship page&lt;/a&gt; for details. &lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>State of Green Business Forum Recap</title>
   <link href="http://numbers.brighterplanet.com/2011/02/07/State-of-Green-Business-Forum-Recap"/>
   <updated>2011-02-07T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/02/07/State-of-Green-Business-Forum-Recap</id>
   <author>
     <name>Robbie</name>
   </author>
   <content type="html">&lt;p&gt;I just got back from two days at the &lt;a href=&quot;http://www.greenbiz.com/stateofgreenbusinessforum2011/sf&quot;&gt;2011 State of Green Business Forum&lt;/a&gt;. Attendees included members of Fortune 500 companies, large private firms, universities, small businesses, and government agencies. The varied representation from industries was a testament to how far sustainability has come in defining 21st century business. &lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Standout presentations included Rob Bernard of Microsoft, who looked at the evolution of cloud computing and the potential it offers for addressing and mitigating environmental damage. He looked at current climate models, which can take a month to run and Microsoft’s work in reducing that down to days and then hours, allowing for greater analysis and more precision. &lt;/p&gt;

&lt;p&gt;The conference highlighted a growing swath of corporate America that is keenly aware of the role that environmental and social issues play in maintaining and strengthening their bottom line. But it remains clear that this leadership alone is insufficient. Too many companies are remaining on the sidelines, awaiting more consistent price signals and a defined regulatory environment before curbing their impact and helping their customers to do the same. The policy failure on climate and energy has clearly placed business at the forefront of carbon mitigation, but the approach remains far too ad hoc to result in the kind of emission reductions needed to prevent catastrophic climate change. The state of green business is one of great innovation hamstrung by government failure.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Introducing our Developer Fellowship program: real financial support for important software projects and their developers</title>
   <link href="http://numbers.brighterplanet.com/2011/02/01/introducing-the-brighter-planet-developer-fellowship"/>
   <updated>2011-02-01T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/02/01/introducing-the-brighter-planet-developer-fellowship</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;We use a whole lot of open source software at Brighter Planet—Ruby, Rails, and Vagrant, just to name a few. A few months ago, we decided that we wanted to take a cue from EngineYard’s &lt;a href=&quot;http://www.engineyard.com/blog/2010/mitchell-hashimoto-joins-engine-yard-oss-community-grant-program/&quot;&gt;OSS Community Grant&lt;/a&gt; program and provide meaningful financial support to the volunteer developers of important software projects.&lt;/p&gt;

&lt;!-- more start--&gt;

&lt;p&gt;We’re now happy to announce the &lt;a href=&quot;http://brighterplanet.github.com/fellowship.html&quot;&gt;&lt;strong&gt;Brighter Planet Developer Fellowship&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Calling all developers: Do you maintain software critical to the GitHub-EngineYard-AWS ecosystem? Working on a scientific library for Ruby? Have an idea for a clever way to use &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;CM1&lt;/a&gt; carbon calculations? Curate an authoritative dataset? We can support and accelerate your good work. Please get in touch (#brighterplanet on Freenode, &lt;a href=&quot;http://twitter.com/brighterplanet&quot;&gt;@brighterplanet&lt;/a&gt; on Twitter, or &lt;a href=&quot;http://github.com/brighterplanet&quot;&gt;brighterplanet&lt;/a&gt; on GitHub).   &lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/scott.jpg&quot; alt=&quot;Scott Bulua headshot&quot; style=&quot;float:left; margin: 0 10px 10px 0;&quot; /&gt; We’re thrilled to welcome our first Developer Fellow, &lt;a href=&quot;http://twitter.com/iamscott&quot;&gt;Scott Bulua&lt;/a&gt;. Scott’s building a plugin for &lt;a href=&quot;http://tripit.com&quot;&gt;TripIt&lt;/a&gt; that tracks the carbon footprints of users’ itineraries using calculations powered by our &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;CM1 web service&lt;/a&gt;. We’ll be hearing from Scott on this blog from time to time as he develops his tool; check back for updates.&lt;/p&gt;

&lt;p&gt;Interested? The Developer Fellowship accepts unsolicited applications, so visit &lt;a href=&quot;http://brighterplanet.github.com/fellowship.html&quot;&gt;the Fellowship page&lt;/a&gt; for details. &lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Climate risk management by the numbers</title>
   <link href="http://numbers.brighterplanet.com/2011/01/18/climate-risk-management-by-the-numbers"/>
   <updated>2011-01-18T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/01/18/climate-risk-management-by-the-numbers</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;As of Monday, we have performed more than 2,000,000 &lt;a href=&quot;http://brighterplanet.com/services&quot;&gt;cloud-based calculations&lt;/a&gt;. After all, climate risk management is about numbers, and Brighter Planet is about delivering those numbers to you.&lt;/p&gt;

&lt;p&gt;You can:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;use your existing systems and software&lt;/li&gt;
  &lt;li&gt;reach out with XML to get results&lt;/li&gt;
  &lt;li&gt;keep the results in your own database, alongside your own data, where it will do the most good&lt;/li&gt;
  &lt;li&gt;get professional consultants to perform the integration, or use your own developers&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://keys.brighterplanet.com&quot;&gt;start immediately&lt;/a&gt; and ping our free tech support &lt;a href=&quot;&amp;#109;&amp;#097;&amp;#105;&amp;#108;&amp;#116;&amp;#111;:&amp;#115;&amp;#117;&amp;#112;&amp;#112;&amp;#111;&amp;#114;&amp;#116;&amp;#064;&amp;#098;&amp;#114;&amp;#105;&amp;#103;&amp;#104;&amp;#116;&amp;#101;&amp;#114;&amp;#112;&amp;#108;&amp;#097;&amp;#110;&amp;#101;&amp;#116;&amp;#046;&amp;#099;&amp;#111;&amp;#109;&quot;&gt;&amp;#115;&amp;#117;&amp;#112;&amp;#112;&amp;#111;&amp;#114;&amp;#116;&amp;#064;&amp;#098;&amp;#114;&amp;#105;&amp;#103;&amp;#104;&amp;#116;&amp;#101;&amp;#114;&amp;#112;&amp;#108;&amp;#097;&amp;#110;&amp;#101;&amp;#116;&amp;#046;&amp;#099;&amp;#111;&amp;#109;&lt;/a&gt; (9–5 EST) when you need help.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every organization has to build its own business case for climate intelligence. To help, we have &lt;a href=&quot;http://brighterplanet.com/demos&quot;&gt;demos&lt;/a&gt;, &lt;a href=&quot;http://brighterplanet.com/research&quot;&gt;whitepapers&lt;/a&gt;, and real results—so far more than 2,000,000 of them.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The wonderful convenience of Earth</title>
   <link href="http://numbers.brighterplanet.com/2011/01/13/the-wonderful-convenience-of-earth"/>
   <updated>2011-01-13T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/01/13/the-wonderful-convenience-of-earth</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;When I was whipping up &lt;a href=&quot;http://yaktrak.org&quot;&gt;Yaktrak&lt;/a&gt; I needed to get a (richly annotated) list of zip codes into the app. This is a familiar problem for web app developers: what’s the easiest way to get auxiliary data from canonical sources loaded and ready to use?&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;Lucky for me we have &lt;a href=&quot;http://github.com/brighterplanet/earth&quot;&gt;&lt;code&gt;earth&lt;/code&gt;&lt;/a&gt;. Look at how easy this is:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; rails new zippy&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In the Gemfile:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;earth&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fastercsv&amp;#39;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# only if you&amp;#39;re on Ruby 1.8&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And in &lt;code&gt;config/environment.rb&lt;/code&gt; or an initializer:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;no&quot;&gt;Earth&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;init&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:locality&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Back at the shell:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; bundle install
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; rails console&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-rbcon&quot; data-lang=&quot;rbcon&quot;&gt;&lt;span class=&quot;go&quot;&gt;1.9.3-p0 :001 &amp;gt; ZipCode.run_data_miner!&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;   (7.2ms)  DROP TABLE &amp;quot;zip_codes&amp;quot;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Receiving schema&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Schema:          0% |                                          | ETA:  --:--:--&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Schema:        100% |==========================================| Time: 00:00:01&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Receiving indexes&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Receiving data&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1 tables, 200 records&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;zip_codes:     100% |==========================================| Time: 00:00:09&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Resetting sequences&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[...it will also add some related tables...]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1.9.3-p0 :002 &amp;gt; ZipCode.find 53703&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  ZipCode Load (22.4ms)  SELECT &amp;quot;zip_codes&amp;quot;.* FROM &amp;quot;zip_codes&amp;quot; WHERE &amp;quot;zip_codes&amp;quot;.&amp;quot;name&amp;quot; = ? LIMIT 1  [[&amp;quot;name&amp;quot;, 53703]]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; =&amp;gt; #&amp;lt;ZipCode name: &amp;quot;53703&amp;quot;, state_postal_abbreviation: &amp;quot;WI&amp;quot;, description: &amp;quot;Madison&amp;quot;, latitude: &amp;quot;43.078646&amp;quot;, longitude: &amp;quot;-89.37727&amp;quot;, egrid_subregion_abbreviation: &amp;quot;MROE&amp;quot;, climate_division_name: &amp;quot;WI8&amp;quot;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Voila! Fresh from the &lt;a href=&quot;http://data.brighterplanet.com/zip_codes&quot;&gt;transparent data crawlers&lt;/a&gt; at &lt;a href=&quot;http://data.brighterplanet.com&quot;&gt;data.brighterplanet.com&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Announcing our new parcel shipment model</title>
   <link href="http://numbers.brighterplanet.com/2011/01/13/announcing-our-new-parcel-shipment-model"/>
   <updated>2011-01-13T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/01/13/announcing-our-new-parcel-shipment-model</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;We just released the initial version of a &lt;a href=&quot;http://carbon.brighterplanet.com/models/shipment&quot;&gt;new carbon model for package shipping&lt;/a&gt;.  It’s designed to help businesses and software developers in the logistics, retail, and IT fields track carbon alongside the other parcel-level data they’re already managing in their existing software systems.  You can find the &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/75/original/parcel_shipment_press_release.pdf?1294940137&quot;&gt;press release here&lt;/a&gt;.&lt;/p&gt;

&lt;!-- more start --&gt;

&lt;p&gt;The notion that shipping packages all over the place has a significant carbon cost isn’t a new thing (although it is an increasing concern, as online shopping and business connectedness drive ongoing increases in parcel shipping volumes).  UPS, FedEx, and now even the Postal Service are many years into a healthy rivalry over low-carbon transport, and some retailers have even started offering green shipping options where shoppers pay a lump sum for carbon offsets to neutralize emissions from an average package.&lt;/p&gt;

&lt;p&gt;But considering the increasing ubiquity of parcel shipping, the scale of the resulting emissions, and the surprising accessibility of data on packages, it’s about time all the parties involved in parcel shipping – retailers, carriers, and customers – have access to quality intel on the carbon impact of individual shipments.  That’s the idea behind the new parcel shipping carbon model, delivered through our cloud-based &lt;a href=&quot;http://carbon.brighterplanet.com/&quot;&gt;CM1 web service&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Our parcel model provides detailed, authoritative, on-demand analyses on the carbon footprints of individual packages.  Whether you know details of a shipment like tracking number, weight, or shipment route, or just basics like destination, carrier, or number of parcels, the model takes the package data you feed it, uses advanced algorithms to find the ideal calculation methodology given your inputs, supplements data where needed with dynamic averages from authoritative sources, and returns an accurate CO2 figure to your system in less than a second, along with custom methodology documentation.  If that sounds like a mouthful, it’s because we’ve put a lot of work into the science and tech behind this system to make our models accurate, transparent, and easy to use.&lt;/p&gt;

&lt;p&gt;To get a feel for the new tool, check out &lt;a href=&quot;http://yaktrak.org/&quot;&gt;Yaktrak&lt;/a&gt;, a little demo mashup we put together that shows how the parcel carbon model can be used to integrate package carbon calculation capability into websites and other web-connected applications.  It lets users type in any FedEx tracking number, and it calculates the shipment’s carbon footprint in real time, displaying emissions figures for every leg of the package’s journey.  Give it a try.&lt;/p&gt;

&lt;p&gt;Shipping emissions can vary substantially according to how a parcel gets from point A to point B.  Carriers have significantly different fleets of vehicles; air and ground packages are routed very differently through hub-spoke networks; and shipments of various shapes and sizes take quite different amounts of energy to transport.  One size does not fit all when it comes to parcel footprints.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Using web services from Excel</title>
   <link href="http://numbers.brighterplanet.com/2011/01/06/using-web-services-from-excel"/>
   <updated>2011-01-06T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/01/06/using-web-services-from-excel</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;h3 id=&quot;of-course-its-easy-in-google-docs&quot;&gt;Of course it’s easy in Google Docs…&lt;/h3&gt;

&lt;p&gt;Still, I got pretty excited when I saw this for the first time:&lt;/p&gt;

&lt;div class=&quot;wide&quot; style=&quot;margin-top: 15px;&quot;&gt;
  &lt;a href=&quot;https://spreadsheets.google.com/ccc?key=0AkCJNpm9Ks6JdGdTMXBwbU8xNHYyZXdnWXZoSjNMZ2c&amp;amp;hl=en&amp;amp;authkey=CMeIkagE&quot;&gt;&lt;img src=&quot;/images/2011-01-06-using-web-services-from-excel/google-docs-importXML.png&quot; alt=&quot;screenshot of Google Docs spreadsheet using importXML&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;!-- more start --&gt;

&lt;p&gt;In Google Docs, &lt;code&gt;importXML&lt;/code&gt; lets you read XML from a web service and then use XPath to select particular elements:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;=importXML(A4, &quot;//emission_estimate/emission&quot;)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;where &lt;code&gt;A4&lt;/code&gt; is the URL &lt;a href=&quot;http://carbon.brighterplanet.com/flights.xml?origin_airport=MSN&amp;amp;destination_airport=ORD&quot;&gt;http://carbon.brighterplanet.com/flights.xml?origin_airport=MSN&amp;amp;destination_airport=ORD&lt;/a&gt;… yielding &lt;code&gt;327.4&lt;/code&gt; kilos of carbon emissions or so.&lt;/p&gt;

&lt;h3 id=&quot;what-about-excel&quot;&gt;What about Excel?&lt;/h3&gt;

&lt;p&gt;I first looked for an equivalent to &lt;code&gt;XMLHttpRequest&lt;/code&gt; for Excel. A &lt;a href=&quot;http://stackoverflow.com/questions/158633/how-can-i-send-an-http-post-request-to-a-server-from-excel-using-vba&quot;&gt;helpful StackOverflow post about &lt;code&gt;Msxml2.ServerXMLHTTP&lt;/code&gt; and &lt;code&gt;WinHttp.WinHttpRequest.5.1&lt;/code&gt;&lt;/a&gt; got me started, but they’re Windows only. You’ll get errors about &lt;code&gt;ActiveX can&#39;t create object&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then, thanks to &lt;a href=&quot;http://discussions.apple.com/thread.jspa?threadID=2106568&quot;&gt;an excellent tip from Kennedy27&lt;/a&gt;, I found &lt;code&gt;QueryTables&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-vbnet&quot; data-lang=&quot;vbnet&quot;&gt;&lt;span class=&quot;k&quot;&gt;With&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ActiveSheet&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;QueryTables&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Connection&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;URL;http://carbon.brighterplanet.com/flights.txt&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Destination&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;A2&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PostText&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;origin_airport=MSN&amp;amp;destination_airport=ORD&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;RefreshStyle&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;xlOverwriteCells&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SaveData&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;True&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Refresh&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;With&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I wrote a VBA function called &lt;code&gt;GetEmissionEstimate&lt;/code&gt; and voilà!&lt;/p&gt;

&lt;div class=&quot;wide&quot; style=&quot;margin-top: 15px;&quot;&gt;
  &lt;img src=&quot;/images/2011-01-06-using-web-services-from-excel/excel-querytables.png&quot; alt=&quot;screenshot of Excel for Mac 2011 using Querytables from VBA&quot; /&gt;
&lt;/div&gt;

&lt;p&gt;It took me a while to remember that Excel is essentially functional programming, so the key to getting the result to auto-refresh is to make sure the output of your VBA function is entirely dependent on the input:&lt;/p&gt;

&lt;div class=&quot;wide&quot; style=&quot;margin-top: 15px;&quot;&gt;
  &lt;img src=&quot;/images/2011-01-06-using-web-services-from-excel/excel-querytables-showing-dependencies.png&quot; alt=&quot;screenshot showing that arguments to VBA function entirely determine its output&quot; /&gt;
&lt;/div&gt;

&lt;p&gt;Now if I change the destination airport, the emission estimate will automatically update.&lt;/p&gt;

&lt;!-- more end --&gt;
</content>
 </entry>
 
 <entry>
   <title>Top 4 CSR trends of 2011</title>
   <link href="http://numbers.brighterplanet.com/2011/01/05/top-4-csr-trends-of-2011"/>
   <updated>2011-01-05T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2011/01/05/top-4-csr-trends-of-2011</id>
   <author>
     <name>Patti</name>
   </author>
   <content type="html">&lt;p&gt;Another article just went up in our sustainability experts series on &lt;a href=&quot;http://www.fastcompany.com/1714526/the-four-keys-to-corporate-sustainability-in-2011&quot;&gt;FastCompany&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As we round out the first decade of the new century, business sustainability in the U.S. is coming of age. The federal carbon regulations that at this time last year seemed likely to shape the next chapter of business sustainability did not emerge, and it&#39;s now clear that the boardroom, more than the halls of congress, will be leading the charge for corporate social responsibility as we forge ahead.&lt;/p&gt;
&lt;p&gt;An overwhelming majority of Fortune 500 companies now voluntarily measure, manage, and publicly disclose their carbon emissions; and a bevy of hi-tech software solutions, clean technologies, and market tools have evolved in recent years to meet these demands.&lt;/p&gt;
&lt;p&gt;So what&#39;s on the horizon for the world of business sustainability management? Four key trends to keep an eye on in 2011 include&amp;#0133;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can see the &lt;a href=&quot;http://www.fastcompany.com/1714526/the-four-keys-to-corporate-sustainability-in-2011&quot;&gt;four key trends on FastCompany&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>How we replaced ParseTree in Ruby 1.9</title>
   <link href="http://numbers.brighterplanet.com/2010/12/17/replacing-parsetree-in-ruby-1-9"/>
   <updated>2010-12-17T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/12/17/replacing-parsetree-in-ruby-1-9</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;Like many Ruby shops, we took for granted &lt;a href=&quot;http://parsetree.rubyforge.org/ParseTree/&quot;&gt;ParseTree&lt;/a&gt;’s ability to show the source code of pretty much any object. As &lt;a href=&quot;http://blog.zenspider.com/2009/04/parsetree-eol.html&quot;&gt;previously explained&lt;/a&gt;, however, ParseTree doesn’t work with Ruby 1.9.2. We fixed the problem by using &lt;a href=&quot;https://github.com/ngty/sourcify&quot;&gt;sourcify&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;## DOESN&amp;#39;T WORK IN RUBY 1.9&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;ParseTree&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:require&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;false&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;parse_tree&amp;#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;parse_tree_extensions&amp;#39;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;## WORKS IN RUBY 1.9&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;sourcify&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;ruby_parser&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;file-tail&amp;#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In particular, we replaced ParseTree’s &lt;tt&gt;Proc#to_ruby&lt;/tt&gt; with sourcify’s &lt;tt&gt;Proc#to_source&lt;/tt&gt;.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;## The old ParseTree way&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;proc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_ruby&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;## The sourcify way - but raised NoMatchingProcError or MultipleMatchingProcsPerLineError&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;proc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_source&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;## The sourcify way - giving :attached_to a symbol to help it find the correct Proc&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;proc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_source&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:attached_to&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:quorum&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;We needed to pass the &lt;tt&gt;:attached_to&lt;/tt&gt; option because our &lt;a href=&quot;https://github.com/brighterplanet/flight/blob/master/lib/flight/carbon_model.rb&quot;&gt;carbon calculation code&lt;/a&gt; has multiply nested procs and we would get &lt;tt&gt;NoMatchingProcError&lt;/tt&gt; or &lt;tt&gt;MultipleMatchingProcsPerLineError&lt;/tt&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;committee&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:distance&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;quorum&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;from airports&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# [...]&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;quorum&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;from cohort&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# [...]&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;quorum&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;default&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# [...]&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Thanks to sourcify’s author, &lt;a href=&quot;https://github.com/ngty&quot;&gt;Ng Tze Yang&lt;/a&gt;, who added the &lt;tt&gt;:attached_to&lt;/tt&gt; option when we showed him the problem. It made it possible to migrate our &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;emission estimate web service&lt;/a&gt;, which comes with detailed &lt;a href=&quot;http://carbon.brighterplanet.com/flights?destination_airport[iata_code]=SFO&amp;amp;origin_airport[iata_code]=JAC&quot;&gt;carbon calculation methodology reports&lt;/a&gt;, to Ruby 1.9! &lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Reindeer, holiday carbon, and cloud computing</title>
   <link href="http://numbers.brighterplanet.com/2010/12/16/reindeer-holiday-carbon-and-the-cloud"/>
   <updated>2010-12-16T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/12/16/reindeer-holiday-carbon-and-the-cloud</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;Every year we send out a little holiday card to our friends.  This go ‘round the Brighter Planet Christmas elves (aka Andy) emerged from the workshop with something a bit more fun and fancy than in years past, so we thought we’d share it around.  It’s a little website called &lt;a href=&quot;http://clausfreight.com&quot;&gt;Claus Freight&lt;/a&gt;.  Give it a try!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://clausfreight.com&quot;&gt; &lt;img src=&quot;/images/claus_freight.png&quot; alt=&quot;Claus Freight parcel&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the risk of spoiling the punchline, we should probably address some questions that have been raised regarding the carbon neutrality of reindeer. It’s been rightfully pointed out that reindeer do in fact inhale oxygen and exhale carbon dioxide. So how can they be carbon neutral? Well, the carbon they exhale comes from the plants they eat (ok so lichens aren’t quite plants, but that’s another topic), plants that quite recently pulled this carbon from the atmosphere and would shortly have released back it into the atmosphere when they died had they not been eaten.  So reindeer are carbon neutral in the same way burning sustainably harvested firewood is carbon neutral—as long as the carbon you’re releasing isn’t depleting long-term reserves, you’re in the clear.&lt;/p&gt;

&lt;p&gt;We’ve also had some inquiries about how the holiday site works.  It’s powered by our new cloud-based Carbon Middleware service, which lets users outfit their applications with carbon calculation capability by plugging into our emissions models behind the scenes. This particular application employs five of the models—shipping, fuels, purchases, pets, and flights.  Every time you enter your info and push go, the site computes the carbon footprint of your gift and its shipping, in real time (you can click the emissions numbers to see detailed calculation methodologies).  Intriguingly, it turns out the naughtier you’ve been, the smaller your holiday footprint…&lt;/p&gt;

&lt;p&gt;Happy Holidays to all!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Nominate Brighter Planet for the Crunchies!</title>
   <link href="http://numbers.brighterplanet.com/2010/12/08/nominate-brighter-planet-for-the-crunchies"/>
   <updated>2010-12-08T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/12/08/nominate-brighter-planet-for-the-crunchies</id>
   <author>
     <name>Derek</name>
   </author>
   <content type="html">&lt;p&gt;We at Brighter Planet are extremely excited about our Carbon Middleware platform that we &lt;a href=&quot;http://numbers.brighterplanet.com/2010/08/13/announcing-carbon-middleware/&quot;&gt;launched&lt;/a&gt; this year. We believe the platform is well positioned to change the way carbon information is gathered, viewed, and assessed. The challenge for us as a small company is getting the word out in this vast sea of information that is the Internet.&lt;/p&gt;

&lt;p&gt;Tech Crunch’s &lt;a href=&quot;http://crunchies2010.techcrunch.com/&quot;&gt;2010 Crunchies Award&lt;/a&gt; is an opportunity to help us do just that. So if you like what we’ve been working on please nominate us for best &lt;a href=&quot;http://crunchies2010.techcrunch.com/nominate/?MzE6QnJpZ2h0ZXIgUGxhbmV0&quot;&gt;CleanTech start-up of the year&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here’s how we’re changing the game:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Carbon information - on demand and integrated.&lt;/strong&gt; What if every time you wanted to know much fat was in your favorite snack you had to call a 1-800 number? Chances are, you probably wouldn’t spend the time. At Brighter Planet, we think that getting carbon information is just as difficult. We designed Carbon Middleware so that you could easily learn about the carbon impact of your decisions contextually, whether that be when you’re booking a flight on &lt;a href=&quot;http://www.careplane.org/&quot;&gt;Kayak&lt;/a&gt;, sending a package with &lt;a href=&quot;http://yaktrak.org&quot;&gt;FedEx&lt;/a&gt;, or charging a hotel room to your &lt;a href=&quot;http://greenback.me&quot;&gt;credit card&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;No more black box.&lt;/strong&gt; If you enter information into ten carbon calculators, chances are you’ll get ten different scores and have no idea why. This creates a trust problem. To combat it, Brighter Planet is embracing radical transparency. Our carbon models are open source. Every calculation we provide includes methodology documentation so you can see how we derived our estimate. Finally, our models are being third-party certified so you can rest, assured we’re not just making this up.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Less than a penny.&lt;/strong&gt; Carbon is so ubiquitous that if you have to pay a fortune to account for it, you’ll probably break the bank long before you reduce your impact. With Carbon Middleware you pay a fraction of a cent per calculation. There’s no large, upfront fee or monthly hosting cost - you just pay as you go.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Confronting climate change is difficult enough as it is. Getting information about your footprint doesn’t have to be.&lt;/p&gt;

&lt;p&gt;So what are you waiting for? &lt;a href=&quot;http://crunchies2010.techcrunch.com/nominate/?MzE6QnJpZ2h0ZXIgUGxhbmV0&quot;&gt;Nominate us now&lt;/a&gt; and please tell your friends!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Zero downtime deploys on the EngineYard AppCloud</title>
   <link href="http://numbers.brighterplanet.com/2010/12/07/zero-downtime-deploys-on-engineyard-appcloud"/>
   <updated>2010-12-07T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/12/07/zero-downtime-deploys-on-engineyard-appcloud</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;One of the ways we maximize our uptime is by tag-teaming two full production clusters:&lt;/p&gt;

&lt;div class=&quot;wide&quot;&gt;
  &lt;img src=&quot;/images/2010-12-07-zero-downtime-deploys-on-engineyard-appcloud/red-and-blue-environments.png&quot; alt=&quot;screenshot of EngineYard AppCloud dashboard with two environments, red and blue&quot; /&gt;
&lt;/div&gt;

&lt;p&gt;Both “red” and “blue” can support 100% of our traffic, but only one of them is in charge of &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;carbon.brighterplanet.com&lt;/a&gt; at a time. That way, we can make updates to the other one, test it at full production capacity, and “tag it in” when it’s ready (by changing DNS).&lt;/p&gt;

&lt;p&gt;This is better for us than using staging environments because we’re not holding our breath for that “final” deploy to production. The tag-team approach lets us keep the old production environment running unchanged, ready to tag back in if the deploy process goes wrong.&lt;/p&gt;

&lt;p&gt;It’s &lt;strong&gt;strong rollback&lt;/strong&gt;, in the sense that all the last-known-good instances are still running (at least until we’re totally comfortable with the new ones.) It’s also &lt;strong&gt;graceful&lt;/strong&gt;, in the sense that clients are not presented with a maintenance page or scheduled outage windows.&lt;/p&gt;

&lt;h3 id=&quot;fact-we-have-to-store-stuff-offsite&quot;&gt;Fact: we have to store stuff offsite&lt;/h3&gt;

&lt;p&gt;If non-replicable data lived in the database master on red or blue, then we would have to export and import it every time we tagged in or out. To solve this, we make sure that all such data is stored offsite in &lt;a href=&quot;http://data.brighterplanet.com&quot;&gt;our reference data web service&lt;/a&gt;, &lt;a href=&quot;http://aws.amazon.com/s3&quot;&gt;Amazon S3&lt;/a&gt;, &lt;a href=&quot;http://mongohq.com&quot;&gt;hosted Mongo&lt;/a&gt;, etc.&lt;/p&gt;

&lt;h3 id=&quot;fact-we-have-to-wait-for-dns&quot;&gt;Fact: we have to wait for DNS&lt;/h3&gt;

&lt;p&gt;When we switch &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;carbon.brighterplanet.com&lt;/a&gt; from red to blue, we have to wait for the DNS change to propagate. If we want to roll back, we might have to wait again. As long as the old production environment worked but just had old code, this is usually OK.&lt;/p&gt;

&lt;h3 id=&quot;fact-we-pay-for-more-compute-hours&quot;&gt;Fact: we pay for more compute hours&lt;/h3&gt;

&lt;p&gt;For a while before and after any deploy, we need both red and blue at full production capacity. That costs compute hours. We think it’s worth it to avoid a single point of failure.&lt;/p&gt;

&lt;h3 id=&quot;fact-we-rebuild-from-scratch-more-often&quot;&gt;Fact: we rebuild from scratch more often&lt;/h3&gt;

&lt;p&gt;When we’re not preparing for a deploy, we may take red or blue down (whichever’s not “it”) to save money. When we prepare for a deploy, therefore, we need to rebuild the instances from scratch. Since we keep our build scripts up-to-date, this has not been a problem.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Github Pages, Rocco, and Rake File Tasks</title>
   <link href="http://numbers.brighterplanet.com/2010/12/02/github-pages-rocco-and-rake-file-tasks"/>
   <updated>2010-12-02T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/12/02/github-pages-rocco-and-rake-file-tasks</id>
   <author>
     <name>Derek</name>
   </author>
   <content type="html">&lt;p&gt;Recently, we spiffed up some of our emitters with enhanced documentation using &lt;a href=&quot;http://rubygems.org/gems/rocco&quot;&gt;Rocco&lt;/a&gt;, a Ruby port of Docco.  We combined this with github’s ability to set up &lt;a href=&quot;http://pages.github.com/&quot;&gt;static html pages for a repo&lt;/a&gt;.  By setting up a branch called gh-pages, Github will serve any html files in that branch.  We use this feature to display Rocco-generated documentation of our carbon models (check out the &lt;a href=&quot;http://brighterplanet.github.com/flight/carbon_model.html&quot;&gt;flight emitter&lt;/a&gt; for an example).&lt;/p&gt;

&lt;p&gt;This was great, but we were missing a way to automate the process by which Rocco will generate its documentation from the code in the master branch and place them in the gh-pages branch.  Ryan Tomayko came to the rescue and &lt;a href=&quot;http://github.com/rtomayko/rocco/blob/cffe49a813bbc083c695997c5d2a7da7f3cf99a1/Rakefile&quot;&gt;wrote a rake task&lt;/a&gt; that creates a docs directory within the project and initializes a new git repository within the directory, which points to the project’s gh-pages branch.  When documentation is generated, it is copied to the docs folder and pushed to gh-pages.&lt;/p&gt;

&lt;p&gt;What intrigued me about the rake task was its use of file tasks.  It’s a feature of rake I had never noticed before, but it’s pretty slick.  A file task says, “if the specified path does not exist, execute the following code.”  Since many unix tools use files for configuration, this feature plays well with many utilities, such as git, your favorite editor, etc. &lt;/p&gt;

&lt;p&gt;For example, you could define a rake task that will create a .rvmrc for your project using your current &lt;a href=&quot;http://rvm.beginrescueend.com/&quot;&gt;RVM&lt;/a&gt;-installed ruby:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Rakefile

file &#39;.rvmrc&#39; do |f|
  File.open(f.name, &#39;w&#39;) do |rvmrc|
    rvmrc.puts &quot;rvm #{ENV[&#39;rvm_ruby_string&#39;]}&quot;
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When you run &lt;code&gt;rake .rvmrc&lt;/code&gt;, your .rvmrc will be generated.  Try it out!&lt;/p&gt;

&lt;p&gt;There is all kinds of magic you can work with a file task.  A novel way in which Ryan’s Rocco tasks use file tasks is when deciding whether to create a git remote based on whether there is a file referencing the remote in the .git configuration directory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Rakefile

file &#39;.git/refs/heads/gh-pages&#39; =&amp;gt; &#39;docs/&#39; do |f|
  `cd docs &amp;amp;&amp;amp; git branch gh-pages --track origin/gh-pages`
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Happy raking!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Lord Stern gets stern, a.k.a. the carrot and the stick</title>
   <link href="http://numbers.brighterplanet.com/2010/11/21/lord-stern-gets-stern-aka-the-carrot-and-the-stick"/>
   <updated>2010-11-21T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/11/21/lord-stern-gets-stern-aka-the-carrot-and-the-stick</id>
   <author>
     <name>Patti</name>
   </author>
   <content type="html">&lt;p&gt;Economist Nicholas Stern, chair of the Grantham Research Institute on Climate Change and the Environment at the London School of Economics, and author of the 2006 Stern Review on the Economics of Climate Change commissioned by the British government, has issued a challenge to the U.S:  &lt;a href=&quot;http://www.theaustralian.com.au/national-affairs/climate/climate-change-action-countries-will-ban-dirty-us-exports-lord-stern-warns/story-e6frg6xf-1225956283593?utm_source=newsletter&amp;amp;utm_medium=email&amp;amp;utm_campaign=sendCarbonHeadlines&quot;&gt;cut emissions or face a ban on U.S. exports&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;CO2 emissions per capita in the U.S.today run twice that of the European Union and almost three times that of China.  Thousands of companies and millions of people in the U.S. are making efforts to cut emissions.  Some are guided by the carrot of being responsible stewards of the planet.  Others by the carrot of reductions in energy costs.  Still others by creating a draw for customers, employees, investors, partners.   All good, but not enough.&lt;/p&gt;

&lt;p&gt;Sticks can also motivate.  Sticks such as &lt;a href=&quot;http://www.environmentalleader.com/2010/11/11/investment-firm-pressures-starbucks-google-for-sustainability-committee/&quot;&gt;investor pressure&lt;/a&gt;, government regulations, or peer pressure.  Now add the stick of a potential ban on exports as the U.S. treads water on emissions actions at the same time as Europe and the Far East advance even further to control emissions and transition from dirty to clean energy.  These countries that have taken climate action do not want American competitors to undermine their own industries.&lt;/p&gt;

&lt;p&gt;How odd to have the U.S. at the other end of the bargaining table.  I think of the economic sanctions the U.S. undertook in the 1980’s to pressure South Africa on apartheid, which many believe lead to a multi-racial political bloodless revolution.  Or more recently, of our economic sanctions against Iran aimed at limiting their use of nuclear power, with mixed results to date.&lt;/p&gt;

&lt;p&gt;Brought on by the failure of climate regulations in Washington, I wonder whether this threat of concrete economic consequences will spur action.  Now, with a massive trade deficit undermining our long-term economic vitality, the specter of a ban on U.S. exports would hit American businesses where it hurts the most: the cash register.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Our latest tool, rapid lifecycle carbon assessment</title>
   <link href="http://numbers.brighterplanet.com/2010/11/17/our-latest-tool-rapid-lifecycle-carbon-assessment"/>
   <updated>2010-11-17T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/11/17/our-latest-tool-rapid-lifecycle-carbon-assessment</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;Calculating the exact lifecycle carbon footprint of everyday goods and services is a laborious and often prohibitively expensive process. A few months ago, we set to work building a tool to help organizations get a jump start on estimating the emissions associated with the things they buy. Our goal was a flexible emissions model that could efficiently process existing data streams to calculate carbon estimates as far back through the value chain as possible for a wide spectrum of goods and services.&lt;/p&gt;

&lt;p&gt;The result is our new &lt;a href=&quot;http://brighterplanet.com/payments&quot;&gt;purchase carbon model&lt;/a&gt;, released today (see the &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/74/original/lifecycle_purchase_carbon_tool.pdf?1290031490&quot;&gt;press release&lt;/a&gt;). It uses an advanced environmental economic input-output model to calculate a full cradle-to-consumer lifecycle carbon footprint. It works for any product or service. And it can be used automatically in a system that, for example, processes financial transaction data already present in your electronic banking records and procurement logs, giving a quick impression of the hotspots in your purchasing patterns.&lt;/p&gt;

&lt;p&gt;To see a demo of the tool in action, check out &lt;a href=&quot;http://fedprint.org/&quot;&gt;Fedprint&lt;/a&gt;, a quick mashup that brings the purchase carbon model to bear on America’s largest consumer the, US federal government. Updated hourly, it spotlights the carbon footprint of the most recently awarded contracts in the Federal Purchase Data System.&lt;/p&gt;

&lt;p&gt;For developers, the purchase model is live for experimentation and production use on Carbon Middleware. A few developer links: &lt;a href=&quot;http://carbon.brighterplanet.com/purchases?industry=336111&amp;amp;cost=15000&quot;&gt;vehicle purchase (methodology)&lt;/a&gt;, &lt;a href=&quot;http://carbon.brighterplanet.com/purchases.json?industry=453210&amp;amp;cost=212.98&quot;&gt;office supplies (in JSON)&lt;/a&gt;, &lt;a href=&quot;https://github.com/brighterplanet/purchase&quot;&gt;carbon model source code&lt;/a&gt;, &lt;a href=&quot;http://carbon.brighterplanet.com/purchases/options&quot;&gt;API documentation&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Tim Juliani joins our advisory board</title>
   <link href="http://numbers.brighterplanet.com/2010/11/10/tim-juliani-joins-our-advisory-board"/>
   <updated>2010-11-10T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/11/10/tim-juliani-joins-our-advisory-board</id>
   <author>
     <name>Robbie</name>
   </author>
   <content type="html">&lt;p&gt;We’re excited to announce that Tim Juliani, Director of Corporate Engagement at the Pew Center on Global Climate Change, has joined our &lt;a href=&quot;http://brighterplanet.com/about/people#advisors&quot;&gt;Advisory Board&lt;/a&gt;. We first met Tim in the summer of 2008, when he stopped by our Middlebury office to discuss carbon offsets.&lt;/p&gt;

&lt;p&gt;Tim brings years of experience working at the crossroads of business and the environment. Amongst many of his roles, he directs the Pew Center’s Business Environmental Leadership Council, (BELC) the largest US-based association of companies devoted to climate related policy and corporate strategies. His perspective and insight will help the development and growth of Carbon Middleware.&lt;/p&gt;

&lt;p&gt;Welcome Tim!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Open carbon code</title>
   <link href="http://numbers.brighterplanet.com/2010/11/09/open-carbon-code"/>
   <updated>2010-11-09T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/11/09/open-carbon-code</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;There’s been a flurry of commentary about opening up climate model code over the past month, mostly centered around an &lt;a href=&quot;http://www.nature.com/news/2010/101013/full/467775a.html&quot;&gt;article in &lt;em&gt;Nature&lt;/em&gt;&lt;/a&gt; back in October. The discussion really broke out into the tech blogs when John Graham-Cumming &lt;a href=&quot;http://blog.jgc.org/2010/11/real-reason-climate-scientists-dont.html&quot;&gt;opined&lt;/a&gt; on the reason for all the secrecy. I’m not sure I agree with his final diagnosis—that it’s just about scientists trying to not look foolish—but his call-to-action is right on:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;If everyone released code then there would be (a) an improvement in code
quality and (b) an ‘all boats rise’ situation as others could build on
reliable code&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here’s what we’re doing at Brighter Planet:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;We release all of our &lt;a href=&quot;http://carbon.brighterplanet.com/science&quot;&gt;carbon models&lt;/a&gt; as open-source code under the AGPL.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;We provide custom-generated methodology documentation &lt;a href=&quot;http://carbon.brighterplanet.com/flights?origin_airport%5Biata_code%5D=JAC&amp;amp;destination_airport%5Biata_code%5D=SFO&quot;&gt;like this&lt;/a&gt; for every one of our calculations.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;We’re now using &lt;a href=&quot;http://rtomayko.github.com/rocco/&quot;&gt;Rocco&lt;/a&gt; to do literate-style documentation of our methodologies (&lt;a href=&quot;http://brighterplanet.github.com/flight/carbon_model.html&quot;&gt;example&lt;/a&gt;), with specific focus on compliance with standard carbon accounting protocols.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The sad truth is that if you enter the same input data into each of the hundreds of carbon calculation software packages available now, you’re going to get a different answer each time. To be fair, all science is uncertain, so this is somewhat to be expected. But with transparency—especially documentation and open-source code—at least we’ll know why.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>We are an XML web service, too</title>
   <link href="http://numbers.brighterplanet.com/2010/10/25/we-are-an-xml-web-service"/>
   <updated>2010-10-25T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/10/25/we-are-an-xml-web-service</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;You can talk to Carbon Middleware in XML:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; curl -v http://carbon.brighterplanet.com/automobiles.xml &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;       -H &amp;#39;Content-Type: application/xml&amp;#39; \&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;       -X POST \&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;       --data &amp;quot;&amp;lt;make&amp;gt;Nissan&amp;lt;/make&amp;gt;&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can receive responses in XML:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-xml&quot; data-lang=&quot;xml&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;hash&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;emission&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;float&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;4017.7826406033573&lt;span class=&quot;nt&quot;&gt;&amp;lt;/emission&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;emission-units&amp;gt;&lt;/span&gt;kilograms&lt;span class=&quot;nt&quot;&gt;&amp;lt;/emission-units&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;make&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;fuel-efficiency&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;float&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;11.7886&lt;span class=&quot;nt&quot;&gt;&amp;lt;/fuel-efficiency&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;fuel-efficiency-units&amp;gt;&lt;/span&gt;kilometres_per_litre&lt;span class=&quot;nt&quot;&gt;&amp;lt;/fuel-efficiency-units&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;name&amp;gt;&lt;/span&gt;Nissan&lt;span class=&quot;nt&quot;&gt;&amp;lt;/name&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/make&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- [...] --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/hash&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;We’re just trying to make it easy to connect with us, whether your application speaks XML, JSON, or even &lt;tt&gt;x-www-form-urlencoded&lt;/tt&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>New redwood forest offset project</title>
   <link href="http://numbers.brighterplanet.com/2010/10/12/new-offset-project-redwood-forest-management"/>
   <updated>2010-10-12T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/10/12/new-offset-project-redwood-forest-management</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;We’ve just added a new project to our carbon offset portfolio, the &lt;a href=&quot;http://brighterplanet.com/projects/20-big_salmon_forest/&quot;&gt;Big River and Salmon Creek forests&lt;/a&gt;.  Comprising a combined 16,000 acres of redwood and Douglas fir forest in Northern California’s Mendocino County, these two tracts of land were recently purchased from a timber company by a consortium of conservation groups and converted to sustainable management.  They represent a hopeful example of nonprofit organizations, state agencies, and private interests coming together to find creative land management solutions that maximize carbon sequestration and forest biodiversity while preserving sustainable forestry jobs and recreation opportunities.  We’re pleased to play a role.&lt;/p&gt;

&lt;p&gt;The project generates offsets by increasing forest carbon reserves.  The transition from traditional logging practices to sustainable management involves halving timber extraction, harvesting trees more selectively to maintain diversity, and increasing and restoring riparian buffers along rivers.  By substantially increasing the density and average size of trees, carbon dioxide is pulled from the atmosphere at higher rates into larger reserves of above- and below-ground carbon stocks.&lt;/p&gt;

&lt;p&gt;The carbon offsets are certified under the Climate Action Registry, an offset standard that includes a rigorous set of protocols to verify the credits represent legitimate carbon reductions.  One important aspect is the verification of additionality, which in this case is established by demonstrating dependency on revenue from offset sales to repay the loan taken out to purchase the land from the timber company.&lt;/p&gt;

&lt;p&gt;In addition to clear climate benefits, the Big River and Salmon Creek project is a major boon for biodiversity and local community, which is also important under our &lt;a href=&quot;http://brighterplanet.com/pdfs/terms/Brighter_Planet-Carbon_Offset_Policy.pdf&quot;&gt;carbon offset policy&lt;/a&gt;.  Restored riparian buffers will improve water quality for threatened stocks of Coho salmon and steelhead trout, and increased forest cover and structural diversity offer improved habitat for Northern Spotted Owls and threatened terrestrial species.  Local communities will benefit from the continued existence of sustainable tibmer jobs, as well as increased recreational access under the new management regime.&lt;/p&gt;

&lt;p&gt;The addition of these projects to Brighter Planet’s portfolio represents a strategic diversification of our carbon offset blend, introducing sink-side forest offsets for the first time.  This move was largely in response to customer demand — our most recent member survey revealed sustainable forestry as a top-ranking project type of interest alongside renewable energy.  We are meeting this demand with these top-notch domestic forestry projects that verifiably reduce carbon pollution while providing key ecological and economic benefits that help to mitigate the effects of climate change.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>10/10/10</title>
   <link href="http://numbers.brighterplanet.com/2010/10/10/10-10-10"/>
   <updated>2010-10-10T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/10/10/10-10-10</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;Just got back from my &lt;a href=&quot;http://www.350.org/node/18302&quot;&gt;10/10/10 work event&lt;/a&gt;: canvassing North Cambridge with free CFLs to give residents in exchange for their incandescents.&lt;/p&gt;

&lt;p&gt;Now i’m watching reports &lt;a href=&quot;http://twitter.com/search/#101010&quot;&gt;streaming in&lt;/a&gt; from around the world and following the &lt;a href=&quot;http://www.350.org&quot;&gt;blog&lt;/a&gt; for some highlights. I was especially proud to see one of our &lt;a href=&quot;http://projectfund.brighterplanet.com/projects/roots_of_change_cooperativa&quot;&gt;Project Fund grant recipients&lt;/a&gt; listed as a featured U.S. project by the 350 staff.&lt;/p&gt;

&lt;div class=&quot;wide&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/350org/5069389670/&quot; title=&quot;San Antonio, USA by 350.org, on Flickr&quot;&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4085/5069389670_29a1b50738_z.jpg&quot; width=&quot;640&quot; height=&quot;480&quot; alt=&quot;San Antonio, USA&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>SoCap Recap</title>
   <link href="http://numbers.brighterplanet.com/2010/10/07/socap-recap"/>
   <updated>2010-10-07T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/10/07/socap-recap</id>
   <author>
     <name>Robbie</name>
   </author>
   <content type="html">&lt;p&gt;Ian and I just got back from &lt;a href=&quot;http://www.socialcapitalmarkets.net/&quot;&gt;SOCAP10&lt;/a&gt;, where Brighter Planet was the in-kind carbon offset sponsor.&lt;/p&gt;

&lt;p&gt;SOCAP10 brings together some of the major thought leaders in the field of “social capital markets.” These are markets such as microfinance and clean technology which use the power and efficiency of market systems to solve pressing social and environmental issues.&lt;/p&gt;

&lt;p&gt;My favorite panel was one in the Metrics/Systems thinking track that focused on creating a universal language and set of metrics to assess social and environmental impact. It asked basic questions such as “What do we mean when we say ‘green job’?” and “How do we compare one company’s social and environmental performance to another’s in a way that is similar to comparing investment ratings?” In more mature fields we take commonality of language and metrics for granted, but in emerging industries this work is elemental and essential.&lt;/p&gt;

&lt;p&gt;I’m happy to report that two organizations are providing the framework for communicating and measuring social and environmental performance. The Global Impact Investing Network has produced &lt;a href=&quot;http://iris.thegiin.org/&quot;&gt;IRIS&lt;/a&gt; (Impact Reporting &amp;amp; Investment Standards), a dictionary for terms describing the social and environmental performance of an organization, while B Lab’s &lt;a href=&quot;http://www.giirs.org/&quot;&gt;GIIRS&lt;/a&gt; (Global Impact Investing Rating Systems) assesses the social and environmental impact of companies and funds using a common ratings system analogous to credit risk ratings.&lt;/p&gt;

&lt;p&gt;This is particularly interesting and valuable to Brighter Planet because carbon is a key environmental metric that is all too often under-reported or ignored. We believe people’s understanding improves when carbon emissions are placed in context alongside other metrics, both traditional and emerging. Efforts such as IRIS and GIIRS help to shed light on what have traditionally been shadow metrics by bringing order and structure to the process.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>EPA releases new guidance on emissions reporting for federal agencies</title>
   <link href="http://numbers.brighterplanet.com/2010/10/07/epa-releases-new-guidance-on-emissions-reporting-for-federal-agencies"/>
   <updated>2010-10-07T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/10/07/epa-releases-new-guidance-on-emissions-reporting-for-federal-agencies</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;This Tuesday the EPA released &lt;a href=&quot;http://www.whitehouse.gov/administration/eop/ceq/sustainability/fed-ghg&quot;&gt;official guidance&lt;/a&gt; for federal agencies on measuring and reporting GHGs. The guidance serves as the government’s official GHG Protocol, outlining precisely what agencies need to measure and report to comply with &lt;a href=&quot;http://www.whitehouse.gov/administration/eop/ceq/sustainability&quot;&gt;Executive Order 13514&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A potential ‘surprise’ is that for Fiscal Year 2010 reporting (due January 2011) the guidance only requires Scope 3 emissions from employee business ground and air travel, employee commuting, contracted solid waste and wastewater disposal, and electricity transportation and distribution losses. Executive Order 13514 originally required agencies to also report emissions from leased buildings, the production of fuels used in agency vehicles, and vendors, contractors, and supply chains. But because Scope 3 accounting is new and “recognized methods for calculating emissions are just emerging,” these and other Scope 3 sources will be phased in over time.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Learning from Climategate</title>
   <link href="http://numbers.brighterplanet.com/2010/10/05/learning-from-climategate-my-web-of-change-presentation"/>
   <updated>2010-10-05T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/10/05/learning-from-climategate-my-web-of-change-presentation</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;I was honored to be invited to the annual technology-and-social-change gathering &lt;a href=&quot;http://webofchange.com&quot;&gt;Web of Change&lt;/a&gt; this year, and even more excited that I was able to make a presentation.&lt;/p&gt;

&lt;p&gt;I’m embedding the slides and a video which was kindly shot by Mr. &lt;a href=&quot;http://www.ianrhett.com&quot;&gt;Ian Rhett&lt;/a&gt;. The presentation is in &lt;a href=&quot;http://en.wikipedia.org/wiki/Ignite_(event)&quot;&gt;Ignite&lt;/a&gt; style, so it’s a total of five minutes long.&lt;/p&gt;

&lt;div class=&quot;wide&quot;&gt;
  &lt;object id=&quot;doc_707371219922220&quot; name=&quot;doc_707371219922220&quot; height=&quot;480&quot; width=&quot;640&quot; type=&quot;application/x-shockwave-flash&quot; data=&quot;http://d1.scribdassets.com/ScribdViewer.swf&quot; style=&quot;outline:none;&quot; class=&quot;scribd&quot;&gt;		&lt;param name=&quot;movie&quot; value=&quot;http://d1.scribdassets.com/ScribdViewer.swf&quot; /&gt;	&lt;param name=&quot;wmode&quot; value=&quot;opaque&quot; /&gt; 		&lt;param name=&quot;bgcolor&quot; value=&quot;#ffffff&quot; /&gt; 		&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt; 		&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot; /&gt; 		&lt;param name=&quot;FlashVars&quot; value=&quot;document_id=38832222&amp;amp;access_key=key-2jg2a2wjogqf7d8hwssq&amp;amp;page=1&amp;amp;viewMode=slideshow&quot; /&gt;	&lt;embed id=&quot;doc_707371219922220&quot; name=&quot;doc_707371219922220&quot; src=&quot;http://d1.scribdassets.com/ScribdViewer.swf?document_id=38832222&amp;amp;access_key=key-2jg2a2wjogqf7d8hwssq&amp;amp;page=1&amp;amp;viewMode=slideshow&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; height=&quot;480&quot; width=&quot;640&quot; wmode=&quot;opaque&quot; bgcolor=&quot;#ffffff&quot; /&gt; 	&lt;/object&gt;

  &lt;object width=&quot;640&quot; height=&quot;385&quot; class=&quot;youtube&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/_YmUMwkLNoI?start=37&amp;amp;fs=1&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;hd=1&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;embed src=&quot;http://www.youtube.com/v/_YmUMwkLNoI?start=37&amp;amp;fs=1&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;hd=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;640&quot; height=&quot;385&quot; /&gt;&lt;/object&gt;
&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Back From JRubyConf</title>
   <link href="http://numbers.brighterplanet.com/2010/10/04/back-from-jrubyconf"/>
   <updated>2010-10-04T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/10/04/back-from-jrubyconf</id>
   <author>
     <name>Derek</name>
   </author>
   <content type="html">&lt;p&gt;I just got back from &lt;a href=&quot;http://jrubyconf.com&quot;&gt;JRubyConf&lt;/a&gt; in Columbus, Ohio.  I had a great time meeting other Rubyists and learned a great deal about how Ruby is being integrated into enterprise environments via JRuby.  It’s really exciting to see “the big guys” embracing a language and ecosystem that we at Brighter Planet enjoy using on a daily basis.&lt;/p&gt;

&lt;p&gt;When I got back home, I decided this would be a good opportunity to try out our new &lt;a href=&quot;http://carbon.brighterplanet.com/meetings/options&quot;&gt;meeting&lt;/a&gt; and &lt;a href=&quot;http://carbon.brighterplanet.com/lodgings/options&quot;&gt;lodging&lt;/a&gt; emissions models to come up with a carbon footprint for my trip to the conference.&lt;/p&gt;

&lt;p&gt;I started out with the meeting space itself.  I fired up Google Earth and measured the square footage of the conference center we were at - about 1,150 square meters.  With the area of the space and the location, I came up with 3.08 tons of CO2e generated by the heating, cooling, and electricity usage of the space: &lt;a href=&quot;http://carbon.brighterplanet.com/meetings?area=1150&amp;amp;zip_code=43240&amp;amp;duration=15.5&quot;&gt;methodology&lt;/a&gt;. Of course, if we considered my individual footprint, it would be 150th of that amount, given that 150 of us shared the space. This comes out to 0.02 tons.&lt;/p&gt;

&lt;p&gt;I then looked at my hotel stay for two nights at the Hampton Inn and came up with 0.09 tons of CO2e: &lt;a href=&quot;http://carbon.brighterplanet.com/lodgings?zip_code=43240&amp;amp;nights=2&amp;amp;lodging_class=Hotel&quot;&gt;methodology&lt;/a&gt;.  I looked up the lodging class from our &lt;a href=&quot;http://data.brighterplanet.com/lodging_classes&quot;&gt;data repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get to the conference, I carpooled with a couple other Rubyists from Ann Arbor, Michigan.  I used 18 gallons of gas, which comes out to 68.1L.  When we developed the automobile trip emitter I was surprised to learn from Seamus and Ian that the type of engine you have doesn’t make a significant difference in the amount of CO2 emitted, it really comes down to how much gasoline is burned.  Therefore, our automobile trip emitter looks at the type of fuel and the quantity burned.  Transportation to and from the conference came out to 0.18 tons of CO2e: &lt;a href=&quot;http://carbon.brighterplanet.com/automobile_trips?fuel_type=Conventional%20Motor%20Gasoline&amp;amp;fuel_use=68.1&quot;&gt;methodology&lt;/a&gt;. Divided by the three of us, my personal transportation footprint was 0.06 tons.&lt;/p&gt;

&lt;p&gt;Of course, no conference weekend is complete without a few good meals with fellow programmers.  Over the course of the weekend, I mostly ate vegetarian, but I splurged on a trip to City Barbecue for a tasty beef brisket sandwich.  I looked at all the food I ate, and calculated the share of each of the food groups I ate.  My foodprint for the weekend was 0.02 tons of CO2e: &lt;a href=&quot;http://carbon.brighterplanet.com/diets?start_date=2010-10-01&amp;amp;end_date=2010-10-03&amp;amp;cereals_and_grains_share=0.24&amp;amp;dairy_share=0.05&amp;amp;eggs_share=0.03&amp;amp;fish_share=0&amp;amp;fruit_share=0.07&amp;amp;nuts_share=0&amp;amp;oils_and_sugars_share=0.14&amp;amp;poultry_share=0&amp;amp;red_meat_share=0.1&amp;amp;vegetables_share=0.37&quot;&gt;methodology&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Overall, my total footprint was 0.19 tons of CO2e.  Had I not carpooled, the biggest factor would have been the car trip to the venue.  With carpooling, most of my emissions came from the hotel stay.&lt;/p&gt;

&lt;p&gt;Over the past few years, there have been more and more regional Ruby conferences, and it’s great to see the community buzzing.  I think it would be really cool if someone could whip up a web app that analyzes Ruby (or other) conference footprints, perhaps based on data gathered from attendees.  We could make a competition out of it to see which conference has the best average per-attendee footprint!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Our carbon gem is now also a command-line carbon calculator</title>
   <link href="http://numbers.brighterplanet.com/2010/10/03/our-carbon-gem-now-also-a-command-line-carbon-calculator"/>
   <updated>2010-10-03T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/10/03/our-carbon-gem-now-also-a-command-line-carbon-calculator</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;Version 0.3.0 of the &lt;a href=&quot;http://github.com/brighterplanet/carbon&quot;&gt;&lt;code&gt;carbon&lt;/code&gt; gem&lt;/a&gt;—our Ruby wrapper for the &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;emission estimates service&lt;/a&gt; API—includes “command-line access” to the web service:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# `carbon`&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;carbon&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;123ABC&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Using&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;123&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;ABC&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;carbon&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flight&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1210&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;66889895298&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;kg&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;CO2e&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;flight&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;origin_airport&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;lax&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1461&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;63846640404&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;kg&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;CO2e&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;flight&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;destination_airport&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;jfk&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1733&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;79410872608&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;kg&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;CO2e&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;flight&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;url&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;carbon&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;brighterplanet&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;com&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flights&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;json?origin_airport&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lax&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;destination_airport&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;jfk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;123&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;ABC&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;flight&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;done&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Saved&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flight&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#0&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;carbon&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;exit&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(Notice that you’ll need a &lt;a href=&quot;http://keys.brighterplanet.com&quot;&gt;developer key&lt;/a&gt; to use this or any other Carbon Middleware-powered library.)&lt;/p&gt;

&lt;p&gt;We think this feature might be especially useful to researchers and scientists who want to make “quick” calculations but still want to rely on our rigorous, transparent &lt;a href=&quot;http://carbon.brighterplanet.com/models&quot;&gt;carbon models&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For complete documentation see the &lt;a href=&quot;http://github.com/brighterplanet/carbon#readme&quot;&gt;README&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Go ahead and give it a try!&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; gem install carbon
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; carbon
&lt;span class=&quot;go&quot;&gt;carbon-&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

</content>
 </entry>
 
 <entry>
   <title>Ruby 1.9.2 Marshal.dump remembers string encoding</title>
   <link href="http://numbers.brighterplanet.com/2010/09/30/ruby-1-9-2-marshal-dump-remembers-string-encoding"/>
   <updated>2010-09-30T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/09/30/ruby-1-9-2-marshal-dump-remembers-string-encoding</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;Ruby 1.9.2 remembers encoding when it marshals a string:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Marshal&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dump&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;hi&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\x04\b&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;I&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;\a&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;hi&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\x06&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\x06&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ET&amp;quot;&lt;/span&gt; 
&lt;span class=&quot;n&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;iconv&amp;#39;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt; 
&lt;span class=&quot;n&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Marshal&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dump&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Iconv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;US-ASCII&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;UTF8&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;hi&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\x04\b&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;I&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;\a&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;hi&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\x06&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\x06&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;EF&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Ruby 1.8 did not:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Marshal&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dump&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;hi&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\004\b\&amp;quot;\a&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;hi&amp;quot;&lt;/span&gt; 
&lt;span class=&quot;n&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;iconv&amp;#39;&lt;/span&gt;
 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt; 
&lt;span class=&quot;n&quot;&gt;ruby&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Marshal&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dump&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Iconv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;US-ASCII&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;UTF8&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;hi&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
 &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\004\b\&amp;quot;\a&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;hi&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

</content>
 </entry>
 
 <entry>
   <title>Calculating hotel emissions</title>
   <link href="http://numbers.brighterplanet.com/2010/09/28/lodging-carbon-calculation-added-to-middleware-toolkit"/>
   <updated>2010-09-28T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/09/28/lodging-carbon-calculation-added-to-middleware-toolkit</id>
   <author>
     <name>Ian</name>
   </author>
   <content type="html">&lt;p&gt;Following up on our &lt;a href=&quot;http://numbers.brighterplanet.com/2010/09/22/event-carbon-calculation-added-to-middleware-toolkit/&quot;&gt;recent release&lt;/a&gt; of an event module for our carbon middleware service, we’re excited to announce the release of a &lt;a href=&quot;http://carbon.brighterplanet.com/lodgings/options&quot;&gt;lodging module&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Developers can now use our &lt;a href=&quot;http://carbon.brighterplanet.com/&quot;&gt;API&lt;/a&gt; to calculate emissions from hotel energy use within their own applications. The calculations use data from the EIA’s &lt;a href=&quot;http://www.eia.doe.gov/emeu/cbecs/&quot;&gt;Commercial Buildings Energy Consumption Survey&lt;/a&gt; and the EPA’s &lt;a href=&quot;http://www.epa.gov/egrid/&quot;&gt;eGRID&lt;/a&gt;, which are automatically imported to our &lt;a href=&quot;http://data.brighterplanet.com/&quot;&gt;database&lt;/a&gt; and updated nightly to ensure currency.&lt;/p&gt;

&lt;p&gt;Possible applications of the lodging emitter include a company calculating Scope 3 emissions from business travel, a hotel booking website calculating your stay’s emissions, a travel agent adding offsets for lodging emissions to a vacation package… but don’t let us limit your thinking!&lt;/p&gt;

&lt;p&gt;We’re hard at work cranking out more emitters, so stay tuned for updates.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Event carbon calculation added to middleware toolkit</title>
   <link href="http://numbers.brighterplanet.com/2010/09/22/event-carbon-calculation-added-to-middleware-toolkit"/>
   <updated>2010-09-22T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/09/22/event-carbon-calculation-added-to-middleware-toolkit</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;For years we’ve been doing custom carbon emissions inventories for meetings and events ranging from conventions and conferences to music festivals and sporting events.  Now we’ve released a new &lt;a href=&quot;http://carbon.brighterplanet.com/meetings/&quot;&gt;meetings module&lt;/a&gt; of our carbon middleware service that lets software developers build event carbon calculation into their own applications.&lt;/p&gt;

&lt;p&gt;The meetings and events emitter, accessed through our &lt;a href=&quot;http://carbon.brighterplanet.com/&quot;&gt;API&lt;/a&gt;, lets users specify a range of &lt;a href=&quot;http://carbon.brighterplanet.com/meetings/options&quot;&gt;characteristics&lt;/a&gt; to calculate emissions from venue energy use.  Used in combination with other carbon middleware emitters like transport, hotel stays, food, and fuel purchases, an event inventory can be expanded to cover the desired emissions scope.  &lt;/p&gt;

&lt;p&gt;Underpinning this event carbon model are authoritative data from the EIA’s &lt;a href=&quot;http://www.eia.doe.gov/emeu/cbecs/&quot;&gt;Commercial Buildings Energy Consumption Survey&lt;/a&gt; and the EPA’s &lt;a href=&quot;http://www.epa.gov/egrid/&quot;&gt;eGRID&lt;/a&gt;, imported automatically to our system on a daily basis to ensure currency.&lt;/p&gt;

&lt;p&gt;We’re excited to see website and software developers put the tools to use.  We’ve got applications in mind ranging from widgets that let wedding and party planners estimate their impact, to platforms that enable corporations to manage all aspects of convention and summit carbon footprints. But IT engineers will no doubt surprise us with innovative ways to integrate this carbon data into their systems.&lt;/p&gt;

&lt;p&gt;Events and meetings can be great opportunities not only to meet your organizations’ own sustainability goals, but also to promote conservation by helping to enlist participants and attendees in the emissions calculation and reduction process.  In working with event organizers we’ve had great success using a four-pronged approach that addresses event carbon inventorying, emissions reduction initiatives, mitigation through offsetting, and attendee participation in measuring, reducing, and offsetting their own event travel emissions. &lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Deborah Baxley joins Brighter Planet Advisory Board</title>
   <link href="http://numbers.brighterplanet.com/2010/09/21/deborah-baxley-joins-brighter-planet-advisory-board"/>
   <updated>2010-09-21T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/09/21/deborah-baxley-joins-brighter-planet-advisory-board</id>
   <author>
     <name>Patti</name>
   </author>
   <content type="html">&lt;p&gt;We’re pleased to announce that financial industry veteran Deborah Baxley has joined our &lt;a href=&quot;http://brighterplanet.com/about/people#advisors&quot;&gt;Advisory Board&lt;/a&gt;.  With her wealth of experience as a strategist for companies including IBM, MasterCard, Bank of America, Visa, and American Express, Debbie’s perspective will help us grow and enhance our offerings at the intersection of financial- and carbon services.&lt;/p&gt;

&lt;p&gt;Debbie is a Principal with Capgemini’s Financial Services Global Business Unit. Widely recognized for her insights on the future of retail payments, she has chaired the Smart Card Alliance Contactless and Mobile Payments Council, and co-chaired the 2009 Alliance Payments Council Summit. She is a frequent keynote speaker and prolific author on topics of mobile and advanced payments innovation, having authored 15 published articles and white papers.&lt;/p&gt;

&lt;p&gt;Welcome, Debbie.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Expanding lifecycle analysis capabilities with EIO-LCA data</title>
   <link href="http://numbers.brighterplanet.com/2010/09/10/expanding_lifecycle_analysis_capabilities_with_EIOLCA_data"/>
   <updated>2010-09-10T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/09/10/expanding_lifecycle_analysis_capabilities_with_EIOLCA_data</id>
   <author>
     <name>Matt</name>
   </author>
   <content type="html">&lt;p&gt;We’re pleased to announce that we’ve just added the &lt;a href=&quot;http://www.eiolca.net/&quot;&gt;Economic Input-Output Life Cycle Assessment (EIO-LCA)&lt;/a&gt; model to our carbon data resources. Licensing this authoritative model further expands our ability to perform lifecycle and supply chain carbon emissions analysis.&lt;/p&gt;

&lt;p&gt;The carbon accounting field is increasingly focusing on Scope 3 emissions, including supply chain and product lifecyle emissions. Supplier sustainability programs by institutions like &lt;a href=&quot;http://walmartstores.com/sustainability/9292.aspx&quot;&gt;Walmart&lt;/a&gt;, &lt;a href=&quot;http://www-03.ibm.com/press/us/en/pressrelease/27174.wss&quot;&gt;IBM&lt;/a&gt;, &lt;a href=&quot;http://www.pgsupplier.com/environmental-sustainability-scorecard&quot;&gt;P&amp;amp;G&lt;/a&gt;, and the &lt;a href=&quot;http://www.whitehouse.gov/the_press_office/President-Obama-signs-an-Executive-Order-Focused-on-Federal-Leadership-in-Environmental-Energy-and-Economic-Performance&quot;&gt;federal government&lt;/a&gt; are driven by the realization that for many organizations, embodied emissions represent the majority of total carbon impact.&lt;/p&gt;

&lt;p&gt;The EIO-LCA model from Carnegie Melon University’s &lt;a href=&quot;http://gdi.ce.cmu.edu/&quot;&gt;Green Design Institute&lt;/a&gt; combines federal &lt;a href=&quot;http://www.census.gov/econ/census07/&quot;&gt;Economic Census&lt;/a&gt; data with research on the environmental impacts of hundreds of economic sectors. It enables lifecycle assessment for all phases of production including raw materials extraction, transport, manufacturing, and retail.&lt;/p&gt;

&lt;p&gt;Through our new partnership with CMU, Brighter Planet will provide rapid environmental impact analysis for goods and services such as electronics, food, healthcare, vehicles, consulting, entertainment, clothing, and supplies.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Finding a GOOD home for Wowcrowd</title>
   <link href="http://numbers.brighterplanet.com/2010/09/01/finding-a-good-home-for-wowcrowd"/>
   <updated>2010-09-01T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/09/01/finding-a-good-home-for-wowcrowd</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;Quick version: &lt;a href=&quot;http://wowcrowd.com&quot;&gt;Wowcrowd&lt;/a&gt;, our web application for crowdsourced funding allocation, has been acquired by our friends at &lt;a href=&quot;http://good.is&quot;&gt;GOOD&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now here’s the background.&lt;/p&gt;

&lt;p&gt;We started &lt;a href=&quot;http://projectfund.brighterplanet.com&quot;&gt;Project Fund&lt;/a&gt; as our main corporate philanthropy initiative a year ago to fill a need we saw in the climate community: neighborhood-scale climate projects needed quick access to small grants, and they were willing to work hard to get them.&lt;/p&gt;

&lt;p&gt;To make a long story short, Project Fund was a runaway success, one we’re very proud of. With 199 projects submitted and over 100,000 votes cast, we were able to give $50,000 in grants to 10 spectacular causes.&lt;/p&gt;

&lt;p&gt;But Project Fund was also successful in another unexpected way: the “crowdsourced funding allocation” model itself was a hit, winning us a Social Innovation award from &lt;em&gt;Financial Times&lt;/em&gt;. When the Pepsi Refresh Project launched in January, it took the concept to a totally different scale. That’s when “How could I start my own Project Fund?” became one of the most common questions we at Brighter Planet heard.&lt;/p&gt;

&lt;p&gt;So this past winter we spun up a new Ruby on Rails app codenamed &lt;code&gt;wlpf1&lt;/code&gt; (“white-label Project Fund”) and started filling it with Project Fund code extracted from our main web application. A few months later &lt;a href=&quot;http://wowcrowd.com&quot;&gt;Wowcrowd&lt;/a&gt; was born.&lt;/p&gt;

&lt;p&gt;Recently we realized that somebody else could probably do a better job of running with Wowcrowd. After all, we’re a climate company. The very first group that came to mind was &lt;a href=&quot;http://good.is&quot;&gt;GOOD&lt;/a&gt;, not only because they’re friends of ours, but also because they are an active partner in the Pepsi Refresh Project and have been closely involved since its launch earlier this year. They’re also probably the world’s best folks at connecting great people with great causes.&lt;/p&gt;

&lt;p&gt;And a handful of weeks later, the ink is dry. &lt;a href=&quot;http://www.prweb.com/releases/2010/09/prweb4452954.htm&quot;&gt;Here’s the press release&lt;/a&gt;. GOOD, she’s in your hands. We can’t wait to see where you take this. &lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Announcing Carbon Middleware</title>
   <link href="http://numbers.brighterplanet.com/2010/08/13/announcing-carbon-middleware"/>
   <updated>2010-08-13T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/08/13/announcing-carbon-middleware</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;Brighter Planet has been building technology for climate change since 2007, including a fully automated carbon offset provision, retirement, and assignment system (to interface with Bank of America and power our &lt;a href=&quot;http://brighterplanet.com/cards&quot;&gt;credit and debit cards&lt;/a&gt;) and what we feel is the world’s best &lt;a href=&quot;http://brighterplanet.com/users/me/footprint&quot;&gt;carbon profiler&lt;/a&gt; for individuals.&lt;/p&gt;

&lt;p&gt;We’re opening up our technology as a platform, and we can’t wait to see what can be done with these systems. Have a look at the &lt;a href=&quot;http://brighterplanet.com&quot;&gt;new site&lt;/a&gt; and tell us what you think.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Use Amazon SQS to get emission estimates</title>
   <link href="http://numbers.brighterplanet.com/2010/08/11/use-amazon-sqs-to-get-emission-estimates"/>
   <updated>2010-08-11T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/08/11/use-amazon-sqs-to-get-emission-estimates</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;You can get emission estimates by queueing up messages on &lt;a href=&quot;http://aws.amazon.com/sqs&quot;&gt;Amazon SQS&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; curl -v https://queue.amazonaws.com/121562143717/cm1_production_incoming -X POST --data &lt;span class=&quot;s2&quot;&gt;&amp;quot;Action=SendMessage&amp;amp;amp;Version=2009-02-01&amp;amp;amp;MessageBody=emitter%3Dautomobile%26make%3DNissan%26guid%3DMyFavoriteCar%26key%3D86f7e437faa5a7fce15d1ddcb9eaeaea377667b8&amp;quot;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;* About to connect() to queue.amazonaws.com port 443 (#0)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;*   Trying 72.21.211.87... connected&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;* Connected to queue.amazonaws.com (72.21.211.87) port 443 (#0)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  # eliding some standard server messages for brevity . . .&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&lt;/span&gt; POST /121562143717/cm1_production_incoming HTTP/1.1
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&lt;/span&gt; User-Agent: curl/7.20.0 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;i386-apple-darwin9.8.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; libcurl/7.20.0 OpenSSL/0.9.8m zlib/1.2.3 libidn/1.16
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&lt;/span&gt; Host: queue.amazonaws.com
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&lt;/span&gt; Accept: */*
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&lt;/span&gt; Content-Length: 158
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&lt;/span&gt; Content-Type: application/x-www-form-urlencoded
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;go&quot;&gt;&amp;lt; HTTP/1.1 200 OK&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt; Content-Type: text/xml&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt; Transfer-Encoding: chunked&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt; Date: Wed, 11 Aug 2010 08:20:56 GMT&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt; Server: AWS Simple Queue Service&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt; &lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;* Connection #0 to host queue.amazonaws.com left intact&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;* Closing connection #0&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;* SSLv3, TLS alert, Client hello (1):&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;SendMessageResponse xmlns=&amp;quot;http://queue.amazonaws.com/doc/2009-02-01/&amp;quot;&amp;gt;&amp;lt;SendMessageResult&amp;gt;&amp;lt;MD5OfMessageBody&amp;gt;fb29551a9e1c36dcf1b8ba624695210a&amp;lt;/MD5OfMessageBody&amp;gt;&amp;lt;MessageId&amp;gt;5d48a63b-5416-4d35-8bc5-65ace74f4d42&amp;lt;/MessageId&amp;gt;&amp;lt;/SendMessageResult&amp;gt;&amp;lt;ResponseMetadata&amp;gt;&amp;lt;RequestId&amp;gt;a3e0d71a-9e47-493b-a92c-29b37393e899&amp;lt;/RequestId&amp;gt;&amp;lt;/ResponseMetadata&amp;gt;&amp;lt;/SendMessageResponse&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You need to use this SQS queue: (but you don’t need an SQS account, it’s just a standard HTTP POST)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;https://queue.amazonaws.com/121562143717/cm1_production_incoming
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As you can see, the MessageBody is the url-encoded form of a querystring:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;emitter=automobile&amp;amp;amp;make=Nissan&amp;amp;amp;guid=MyFavoriteCar&amp;amp;amp;key=86f7e437faa5a7fce15d1ddcb9eaeaea377667b8
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;wait-a-minute-isnt-that-an-empty-response-body&quot;&gt;Wait a minute, isn’t that an empty response body?&lt;/h3&gt;

&lt;p&gt;Correct. This is an asynchronous way of doing things. The &lt;a href=&quot;http://storage.carbon.brighterplanet.com/745c4bcda8234186178e8430ae55f38913a5f042&quot;&gt;result in JSON format&lt;/a&gt; will appear as soon as it is calculated (usually in a few seconds).&lt;/p&gt;

&lt;p&gt;If you need an answer in realtime, then you should skip SQS and hit &lt;a href=&quot;http://carbon.brighterplanet.com/automobiles.json?make=Nissan&amp;amp;guid=MyFavoriteCar&amp;amp;key=86f7e437faa5a7fce15d1ddcb9eaeaea377667b8&quot;&gt;mostly the same querystring&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;why-use-sqs&quot;&gt;Why use SQS?&lt;/h3&gt;

&lt;p&gt;Depending on your environment, you may already have an excellent SQS client library. You’ll have the high availability of Amazon web services combined with competitive Brighter Planet pricing for asynchronous (rather than realtime) emission estimates.&lt;/p&gt;

&lt;p&gt;Depending on your application, set-it-and-forget-it may be a natural fit. We’ll store the result for you in JSON format at an effectively randomized URL, which is perfect for AJAX calls that display results in a browser. In general, if you can queue up the emission estimate now and count on a JSON-enabled client to pull the results later, this is a good way to go.&lt;/p&gt;

&lt;h3 id=&quot;how-did-you-calculate-the-result-url&quot;&gt;How did you calculate the result URL?&lt;/h3&gt;

&lt;p&gt;Just SHA1 the string &lt;tt&gt;key&lt;/tt&gt; plus &lt;tt&gt;guid&lt;/tt&gt;. No salt or separators or anything, just &lt;tt&gt;86f7e437faa5a7fce15d1ddcb9eaeaea377667b8MyFavoriteCar&lt;/tt&gt; in this case.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;go&quot;&gt;ruby-1.8.7-head &amp;gt; require &amp;#39;digest/sha1&amp;#39;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; =&amp;gt; true &lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;ruby-1.8.7-head &amp;gt; Digest::SHA1.hexdigest(&amp;#39;86f7e437faa5a7fce15d1ddcb9eaeaea377667b8MyFavoriteCar&amp;#39;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; =&amp;gt; &amp;quot;745c4bcda8234186178e8430ae55f38913a5f042&amp;quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;other-notes&quot;&gt;Other notes&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;We host the storage on &lt;a href=&quot;http://aws.amazon.com/s3&quot;&gt;Amazon S3&lt;/a&gt;, so you’ll benefit from high-availability there too.&lt;/li&gt;
  &lt;li&gt;If you’re using Ruby, you can use our &lt;a href=&quot;http://rubygems.org/gems/carbon&quot;&gt;carbon gem&lt;/a&gt; with the &lt;tt&gt;:guid&lt;/tt&gt; option.&lt;/li&gt;
  &lt;li&gt;If you would rather have us POST the result back to your waiting servers, you can pass &lt;tt&gt;&amp;amp;callback=http%3A%2F%2Fmyserver.example.com%2Fcallback-receiver.php&lt;/tt&gt;.&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Sharing Rails views with Jekyll</title>
   <link href="http://numbers.brighterplanet.com/2010/08/09/sharing-rails-views-with-jekyll"/>
   <updated>2010-08-09T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/08/09/sharing-rails-views-with-jekyll</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;In my last post I discussed how we &lt;a href=&quot;http://numbers.brighterplanet.com/2010/07/26/sharing-views-across-rails-3-apps&quot;&gt;share a single layout between Rails apps&lt;/a&gt;. This has been a lifesaver for us as we manage a half-dozen production apps. But a couple of our sites—our &lt;a href=&quot;http://brighterplanet.github.com&quot;&gt;developer hub&lt;/a&gt; and this here blog—don’t use Rails. They’re both &lt;a href=&quot;http://github.com/mojombo/jekyll&quot;&gt;Jekyll&lt;/a&gt; sites running on &lt;a href=&quot;http://pages.github.com&quot;&gt;GitHub Pages&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Obviously we can’t rely on the Rails Engine features in our &lt;a href=&quot;http://github.com/brighterplanet/brighter_planet_layout&quot;&gt;shared layout&lt;/a&gt; gem to load the layout into the right places. What are we to do?&lt;/p&gt;

&lt;h3 id=&quot;one-step-at-a-time&quot;&gt;One step at a time&lt;/h3&gt;

&lt;p&gt;Luckily Jekyll already includes the basic building blocks of our solution: layouts and includes. Layouts, described &lt;a href=&quot;http://wiki.github.com/mojombo/jekyll/usage&quot;&gt;here&lt;/a&gt; are &lt;a href=&quot;http://github.com/tobi/liquid&quot;&gt;Liquid&lt;/a&gt; templates, and Jekyll ships with a custom &lt;a href=&quot;http://wiki.github.com/mojombo/jekyll/liquid-extensions&quot;&gt;Liquid extension that enables includes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;All we need to do then is transform our Rails layout into a Jekyll layout and use includes instead of partials. Ready, set, go.&lt;/p&gt;

&lt;h3 id=&quot;when-in-rome&quot;&gt;When in Rome&lt;/h3&gt;

&lt;p&gt;Jekyll is a static site generator. Following this lead, our transformations will be manually executed and staticly stored within your Jekyll site. The easiest way to get started is to set up a task in your Rakefile:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;net/http&amp;#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;uri&amp;#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;erb&amp;#39;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;lib/stubs&amp;#39;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:layout&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:build&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dirname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;_layouts&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;default.html&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;w&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ERB&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Net&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;HTTP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;URI&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http://github.com/brighterplanet/brighter_planet_layout/raw/master/app/views/layouts/brighter_planet.html.erb&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)))&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Layout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get_binding&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pages&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;{ { content } }&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pages&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;empty?&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;What’s going on here? Rake is fetching the raw ERB of your layout from the gem’s repository, sending it to ERB for processing, and then storing the result as your Jekyll site’s &lt;code&gt;default&lt;/code&gt; layout.&lt;/p&gt;

&lt;p&gt;I should call your attention to a couple of tricky bits here.&lt;/p&gt;

&lt;h3 id=&quot;bindings&quot;&gt;Bindings&lt;/h3&gt;
&lt;p&gt;First, this business about bindings. ERB needs a “binding” to work–that is, a context within which it can access instance methods, variables, etc. Rails takes care of this for you, but since we’re invoking ERB here directly, we have to tell it where to bind. Why is this important? Your layout probably uses methods like &lt;code&gt;stylesheet_link_tag&lt;/code&gt; or &lt;code&gt;render&lt;/code&gt; to get its job done. If we don’t provide those methods in ERB’s context, we’ll get &lt;code&gt;NoMethodError&lt;/code&gt; all over the place. The easiest way to fool ERB is with a fake context, which we’ll put in &lt;code&gt;lib/stubs.rb&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Layout&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;stylesheet_link_tag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sheets&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sheets&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;collect&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sheet&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;lt;link rel=&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;stylesheet&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; type=&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;text/css&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; href=&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/stylesheets/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sheet&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.css&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; /&amp;gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;javascript_include_tag&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{})&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&amp;quot;{٪ include &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:partial&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/[a-z_]*$/&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.html ٪}&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;get_binding&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;binding&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can see how we re-interpret these method calls in a way that’s meaningful to Jekyll. (Note that since &lt;code&gt;binding&lt;/code&gt; is a private method we have to publicize it with the &lt;code&gt;get_binding&lt;/code&gt; wrapper.)&lt;/p&gt;

&lt;h3 id=&quot;yields&quot;&gt;Yields&lt;/h3&gt;
&lt;p&gt;The second tricky bit is dealing with your standard Rails layout’s multiple &lt;code&gt;yield&lt;/code&gt; calls, the consequence of using &lt;code&gt;content_for&lt;/code&gt; blocks in your views. We have to anticipate this and set up ERB to act accordingly. Where do we even capture arguments to yield? Turns out the correct place to do this on &lt;code&gt;get_binding&lt;/code&gt;, our wrapper to the private &lt;code&gt;binding&lt;/code&gt; method. Now the &lt;code&gt;yield&lt;/code&gt; we’re interested in—the one where we want Jekyll content to go—is the one called without any arguments. So we set the block to output the &lt;code&gt;content&lt;/code&gt; Liquid tag when it sees &lt;code&gt;yield&lt;/code&gt; called with an empty argument set. Other &lt;code&gt;yield&lt;/code&gt; calls—to dump &lt;code&gt;content_for&lt;/code&gt; material, which could never be prepared by Jekyll anyways—are simply ignored.&lt;/p&gt;

&lt;h3 id=&quot;and-were-done&quot;&gt;And we’re done&lt;/h3&gt;
&lt;p&gt;Your complete layout package will probably include several partials—each with its own fake context class in &lt;code&gt;stubs.rb&lt;/code&gt;—as well as asset files. To build your layout from its source in the cloud, just&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; rake layout:build&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Check out our developer hub’s &lt;a href=&quot;http://github.com/brighterplanet/brighterplanet.github.com/blob/master/Rakefile&quot;&gt;&lt;code&gt;Rakefile&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://github.com/brighterplanet/brighterplanet.github.com/blob/master/lib/stubs.rb&quot;&gt;&lt;code&gt;stubs.rb&lt;/code&gt;&lt;/a&gt; for all the details.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Bundler to the Max</title>
   <link href="http://numbers.brighterplanet.com/2010/07/28/bundler-to-the-max"/>
   <updated>2010-07-28T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/07/28/bundler-to-the-max</id>
   <author>
     <name>Derek</name>
   </author>
   <content type="html">&lt;p&gt;I have been spending the past few weeks creating and refactoring our &lt;a href=&quot;http://carbon.brighterplanet.com/science&quot;&gt;carbon model gems&lt;/a&gt;, with the goal of making them easy to enhance, fix, and test by climate scientists and Ruby developers. I wanted to make contributing a simple process and &lt;a href=&quot;http://rubybundler.com&quot;&gt;bundler&lt;/a&gt; fit the bill quite well.&lt;/p&gt;

&lt;p&gt;A not-so-widely-known feature of the &lt;a href=&quot;http://rubygems.org&quot;&gt;Rubygems&lt;/a&gt; API is the ability to declare a gem’s development dependencies, along with its runtime dependencies. If one planned on making changes to one of the emitter gems and testing it, she could run &lt;code&gt;gem install &amp;lt;emitter_gem&amp;gt; --development&lt;/code&gt; and have any needed testing gems installed for the emitter gem.&lt;/p&gt;

&lt;p&gt;This is all fine and good, but I chose to use bundler to manage our dependencies, as it adds a few extras that have been a tremendous help to us. To contribute to any of our gems, a developer can follow a simple process:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; git clone git://github.com/brighterplanet/&amp;lt;gem&amp;gt;.git
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &amp;lt;gem&amp;gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; gem install bundler --pre  &lt;span class=&quot;c&quot;&gt;# this is needed until bundler 1.0 is released&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; bundle install
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; rake&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And Bob’s your uncle!&lt;/p&gt;

&lt;h3 id=&quot;bundler--gemspecs&quot;&gt;Bundler + Gemspecs&lt;/h3&gt;
&lt;p&gt;The first goodie that bundler provides is the ability to use the gem’s own gemspec to define the dependencies needed for development. For instance, our flight gem has a gemspec with dependencies:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;no&quot;&gt;Gem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Specification&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;activerecord&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 3.0.0.beta4&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;bundler&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;gt;= 1.0.0.beta.2&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;cucumber&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 0.8.3&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;jeweler&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 1.4.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;rake&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;gt;= 0&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;rdoc&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;gt;= 0&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;rspec&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 2.0.0.beta.17&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;sniff&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 0.0.10&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_runtime_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;characterizable&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 0.0.12&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_runtime_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;data_miner&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 0.5.2&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_runtime_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;earth&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 0.0.7&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_runtime_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;falls_back_on&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 0.0.2&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_runtime_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;fast_timestamp&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 0.0.4&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_runtime_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;leap&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 0.4.1&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_runtime_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;summary_judgement&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 1.3.8&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_runtime_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;timeframe&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 0.0.8&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_runtime_dependency&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sx&quot;&gt;%q&amp;lt;weighted_average&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;= 0.0.4&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Instead of defining these dependencies in both flight.gemspec and in Gemfile, we can instead give the following directive in our Gemfile:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;gemspec&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;.&amp;#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;bundler--paths&quot;&gt;Bundler + Paths&lt;/h3&gt;

&lt;p&gt;We have a chain of gem dependencies, where an emitter gem depends on the sniff gem for development, which in turn depends on the earth gem for data models. In the olden days (like, 4 months ago) if I made a change to sniff, I would have to rebuild the gem and reinstall it. With bundler, I can simply tell my emitter gem to use a path to my local sniff repo as the gem source:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;sniff&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;../sniff&amp;#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now, any changes I make to sniff instantly appear in the emitter gem!&lt;/p&gt;

&lt;p&gt;I had to add some special logic (a hack, if you will) to my gemspec definition for this to work, because the above gem statement in my Gemfile would conflict with the dependency listed in my gemspec (remember, I’m using my gemspec to tell bundler what gems I need). To get around this, I added an if clause to my gemspec definition that checks for an environment variable. If this variable exists, the gemspec will not request the gem and bundler will instead use my custom gem requirement that uses a local path:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Rakefile  (we use jeweler to generate our gemspecs)&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Jeweler&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Tasks&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;sniff&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;=0.0.10&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;LOCAL_SNIFF&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# Gemfile&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;sniff&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;LOCAL_SNIFF&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;LOCAL_SNIFF&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So now, if I want to make some changes to the sniff gem and test them out in my emitter, I do:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;sniff
&lt;span class=&quot;go&quot;&gt;  # work work work&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;emitter&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;LOCAL_SNIFF&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;~/sniff
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; rake gemspec
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; bundle update
&lt;span class=&quot;go&quot;&gt;  # ...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;sniff (0.0.13) using path /Users/dkastner/sniff&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  # ...&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And then Bob is my uncle.&lt;/p&gt;

&lt;h3 id=&quot;bundler--rakefile&quot;&gt;Bundler + Rakefile&lt;/h3&gt;

&lt;p&gt;This next idea has some drawbacks in terms of code cleanliness, but I think it offers a good way to point contributers in the right direction. One thing that frustrated me about Jeweler was that if I wanted to contribute to a gem, my typical work flow went like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;project&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  # work work work&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; rake &lt;span class=&quot;nb&quot;&gt;test&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;LoadError: No such file: &amp;#39;jeweler&amp;#39;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; gem install jeweler
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; rake &lt;span class=&quot;nb&quot;&gt;test&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;LoadError: No such file: &amp;#39;shoulda&amp;#39;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  # etc etc&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I attempted to simplify this process, so a new developer who doesn’t read the README should be able to just do:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;emitter&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  # work work work&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; rake &lt;span class=&quot;nb&quot;&gt;test&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;You need to `gem install bundler` and then run `bundle install` to run rake tasks&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; gem install bundler
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; bundle install
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; rake &lt;span class=&quot;nb&quot;&gt;test&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;All tests pass!&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I achieved this by adding the following code to the top of the Rakefile:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rubygems&amp;#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;begin&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;bundler&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Bundler&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;setup&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;rescue&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;LoadError&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;You must `gem install bundler` and `bundle install` to run rake tasks&amp;#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This was convenient, but it created a chicken and egg problem: in order to generate a gemspec for the first time, bundler needed to know which dependencies it needed, which meant that it needed the gemspec, which is generated by the Rakefile, which requires bundler, which requires the gemspec, etc. etc. I overcame this problem by allowing an override:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rubygems&amp;#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;NOBUNDLE&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;begin&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;bundler&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;Bundler&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;setup&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;rescue&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;LoadError&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;You must `gem install bundler` and `bundle install` to run rake tasks&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So, if you’re really desparate, you can run &lt;code&gt;rake test NOBUNDLE=true&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&quot;more-on-local-gems&quot;&gt;More on Local Gems&lt;/h3&gt;

&lt;p&gt;Now that I had a way to easily tell bundler to use an actual gem or a local repo holding the gem, I wanted a way to quickly “flip the switch.” I wrote up a quick function in my ~/.bash_profile:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; mod_devgem&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;LOCAL_`echo $2 | tr &amp;#39;a-z&amp;#39; &amp;#39;A-Z&amp;#39;`&amp;quot;&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;$1&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;disable&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;unset $var&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;unset&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$var&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;dir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;~/$2&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;export $var=$dir&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$var&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$dir&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; devgems &lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;c&quot;&gt;# Usage: devgems [enable|disable] [gemname]&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;cmd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:-&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;enable&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;$1&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;list&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
    env &lt;span class=&quot;p&quot;&gt;|&lt;/span&gt; grep LOCAL
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; -z &lt;span class=&quot;nv&quot;&gt;$2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
    mod_devgem &lt;span class=&quot;nv&quot;&gt;$cmd&lt;/span&gt; characterizable
    mod_devgem &lt;span class=&quot;nv&quot;&gt;$cmd&lt;/span&gt; cohort_scope
    mod_devgem &lt;span class=&quot;nv&quot;&gt;$cmd&lt;/span&gt; falls_back_on
    mod_devgem &lt;span class=&quot;nv&quot;&gt;$cmd&lt;/span&gt; leap
    mod_devgem &lt;span class=&quot;nv&quot;&gt;$cmd&lt;/span&gt; loose_tight_dictionary
    mod_devgem &lt;span class=&quot;nv&quot;&gt;$cmd&lt;/span&gt; sniff
    mod_devgem &lt;span class=&quot;nv&quot;&gt;$cmd&lt;/span&gt; data_miner
    mod_devgem &lt;span class=&quot;nv&quot;&gt;$cmd&lt;/span&gt; earth
  &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
    mod_devgem &lt;span class=&quot;nv&quot;&gt;$cmd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$2&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This gives me a few commands:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; devgems &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;sniff
&lt;span class=&quot;go&quot;&gt;  # sets LOCAL_SNIFF=~/sniff&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; devgems disable sniff
&lt;span class=&quot;go&quot;&gt;  # clears LOCAL_SNIFF&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; devgems list
&lt;span class=&quot;go&quot;&gt;  # lists each LOCAL_ environment variable&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I now have a well-oiled gem development machine!&lt;/p&gt;

&lt;p&gt;Overall, after a few frustrations with bundler, I’m now quite happy with it, especially the power and convenience it gives me in developing gems.&lt;/p&gt;

&lt;p&gt;I’m really interested to hear any of your thoughts on this. Drop me a line at &lt;a href=&quot;http://twitter.com/dkastner&quot;&gt;@dkastner&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Sharing views across Rails 3 apps</title>
   <link href="http://numbers.brighterplanet.com/2010/07/26/sharing-views-across-rails-3-apps"/>
   <updated>2010-07-26T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/07/26/sharing-views-across-rails-3-apps</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;Here at Brighter Planet we run several production Rails 3 apps, including the &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;emission estimates service&lt;/a&gt;, the &lt;a href=&quot;http://data.brighterplanet.com&quot;&gt;climate data service&lt;/a&gt;, and our &lt;a href=&quot;http://keys.brighterplanet.com&quot;&gt;keyserver&lt;/a&gt;. As the person reponsible for much of our recent front-end work, I wasn’t really looking forward to maintaining a half-dozen different versions of what is mostly the same layout. I wanted to &lt;a href=&quot;http://www.c2.com/cgi/wiki?DontRepeatYourself&quot;&gt;DRY&lt;/a&gt; the situation up. What I really wanted was to put all the shared stuff into a gem that I could require from all of our apps that would just sort of insinuate itself into all the right places.&lt;/p&gt;

&lt;p&gt;Luckily Rails 3 makes this possible, after a fashion. The key trick is giving your plugin a Railtie, which isn’t documented very well yet–this &lt;a href=&quot;https://gist.github.com/e139fa787aa882c0aa9c&quot;&gt;gist from Jose Valim&lt;/a&gt; is the best I could find.&lt;/p&gt;

&lt;p&gt;To get started just add a file in &lt;code&gt;lib/gemname/&lt;/code&gt; called &lt;code&gt;railtie.rb&lt;/code&gt; and require it from the main &lt;code&gt;gemname.rb&lt;/code&gt; file:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;BrighterPlanetLayout&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Railtie&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Railtie&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Because it inherits from Rails::Railtie, you don’t have to “declare” the Railtie–Rails automatically keeps track of it and calls the right parts when they’re needed.&lt;/p&gt;

&lt;p&gt;The easy part is telling Rails to add your gem’s view path to the app’s view path:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;BrighterPlanetLayout&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Railtie&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Railtie&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;initializer&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;brighter_planet_layout.add_paths&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;paths&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;push&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BrighterPlanetLayout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;view_path&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Telling ApplicationController to use the layout in your gem’s view path as the default is a little tricker–you have to use a &lt;code&gt;to_prepare&lt;/code&gt; block:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;BrighterPlanetLayout&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Railtie&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Railtie&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;to_prepare&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;no&quot;&gt;ApplicationController&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;layout&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;brighter_planet&amp;#39;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It turns out the hardest part is hooking Rails up to your gem’s static asset files–stylesheets, images, fonts, etc. For that we add another instance of &lt;code&gt;ActionDispatch::Static&lt;/code&gt; to the Rack middleware stack:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;BrighterPlanetLayout&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Railtie&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Railtie&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;app_middleware&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;::ActionDispatch::Static&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BrighterPlanetLayout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;public_path&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is a fine solution in the development environment, but it’s too slow for production–your webserver has to fire up Rails just to push an image binary, for example. So in production we just copy static files to the app’s &lt;code&gt;public&lt;/code&gt; dir:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;BrighterPlanetLayout&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Railtie&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Railtie&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BrighterPlanetLayout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;serve_static_files_using_rack?&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# &amp;quot;if in development environment&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;app_middleware&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;::ActionDispatch::Static&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BrighterPlanetLayout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;public_path&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;initializer&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;brighter_planet_layout.copy_static_files_to_web_server_document_root&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;BrighterPlanetLayout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;copy_static_files?&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# &amp;quot;if in production&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;no&quot;&gt;BrighterPlanetLayout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;copy_static_files_to_web_server_document_root&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And that’s it. Check out &lt;a href=&quot;http://github.com/brighterplanet/brighter_planet_layout&quot;&gt;the gem source&lt;/a&gt; for details on the folder structure and for additional tricks like loading shared helpers. Next time: how to use this shared layout with Jekyll.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Real code examples in our integration guide</title>
   <link href="http://numbers.brighterplanet.com/2010/07/23/real-code-examples-in-our-integration-guide"/>
   <updated>2010-07-23T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/07/23/real-code-examples-in-our-integration-guide</id>
   <author>
     <name>Seamus</name>
   </author>
   <content type="html">&lt;p&gt;I realize that not everybody uses Ruby/Rails, so integration with our &lt;a href=&quot;http://carbon.brighterplanet.com&quot;&gt;emission estimate web service&lt;/a&gt; won’t always be facilitated by &lt;a href=&quot;http://rubygems.org/gems/carbon&quot;&gt;our sharp little carbon gem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Still, if I were a third-party developer, there is nothing I would want more than unfiltered code examples from a real integration, no matter the language.&lt;/p&gt;

&lt;p&gt;Therefore I present our &lt;a href=&quot;http://github.com/brighterplanet/carbon/blob/master/doc/INTEGRATION_GUIDE.rdoc&quot;&gt;unfinished integration guide&lt;/a&gt;, complete with real diffs.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Relaunching the blog</title>
   <link href="http://numbers.brighterplanet.com/2010/07/23/new-blog"/>
   <updated>2010-07-23T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/07/23/new-blog</id>
   <author>
     <name>Andy</name>
   </author>
   <content type="html">&lt;p&gt;We’ve been hosting our own blog for a couple of years now on a custom Wordpress installation, dealing from time to time with all the idiosyncracies of a PHP application. As part of the process of launching our developer ecosystem, we thought we’d take the opportunity to transition to a more convenient, reliable approach.&lt;/p&gt;

&lt;p&gt;After looking at a gazillion options (seriously, where are the blogging platforms that support syntax highlighting out of the box?), we settled on &lt;a href=&quot;http://github.com/mojombo/jekyll&quot;&gt;jekyll&lt;/a&gt;, which we’re already using for our &lt;a href=&quot;http://brighterplanet.github.com&quot;&gt;Developer Hub&lt;/a&gt;. We’re hosting this using &lt;a href=&quot;http://pages.github.com&quot;&gt;GitHub Pages&lt;/a&gt;, so deploys are as simple as&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-console&quot; data-lang=&quot;console&quot;&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; git push&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Anyways, expect to see a greater focus on the technology behind Brighter Planet here on the new blog. Here we go!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Empowering 350.orgâs Climate Action Fund</title>
   <link href="http://numbers.brighterplanet.com/2010/07/20/climate_action_fund"/>
   <updated>2010-07-20T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/07/20/climate_action_fund</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p style=&quot;text-align: center;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img class=&quot;aligncenter&quot; title=&quot;image courtesy of 350.org&quot; src=&quot;http://farm4.static.flickr.com/3618/3431172845_9dd0d80d25_m.jpg&quot; alt=&quot;&quot; width=&quot;187&quot; height=&quot;240&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the latest chapter of our perennial partnership with &lt;a href=&quot;file:///C:/Users/Spencer/Desktop/Brighter%20PLanet/350.org&quot;&gt;350.org&lt;/a&gt;, Brighter Planet will provide the technology and underwriting to make 350’s crowdsourced &lt;a href=&quot;http://www.350.org/funds&quot;&gt;Project Funds for Climate  Action&lt;/a&gt; a reality.&lt;/p&gt;

&lt;p&gt;Last fall, 350.org organized what CNN called “the most widespread day of political action in the planet’s history,” inspiring more than 5,000 events in 181 countries as part of the International Day of Climate Action. They continue to push the issue of climate change to forefront, inspiring a much needed sense of urgency in the fight to prevent catastrophic global change. Their slogan for this year, “Get to Work,” encourages grassroots action around the world, challenging people to step up and be the drivers of change in their communities, forcing our leaders to take action. In conjunction with &lt;a href=&quot;http://www.1010global.org/&quot;&gt;1010global.org&lt;/a&gt;, which has already signed close to 80,000 people since January in demanding a 10% annual reduction in carbon emissions, 350.org has put forth 10/10/10 as a global day of action.&lt;/p&gt;

&lt;p&gt;Beginning today and leading up to the 10/10/10 Work Parties, 350.org will give out eight $1000 microgrants every month through their &lt;a href=&quot;http://www.350.org/funds&quot; target=&quot;_blank&quot;&gt;350 Project Funds for Climate Action&lt;/a&gt;, funding Work Party projects that raise awareness about climate change, promote renewable energy, and show clearly that progress is possible.&lt;/p&gt;

&lt;p&gt;Like Brighter Planet’s &lt;a href=&quot;http://projectfund.brighterplanet.com/&quot;&gt;Project Fund&lt;/a&gt;, the 350 Project Funds for Climate Action will powered by our new &lt;a href=&quot;http://wowcrowd.com/&quot;&gt;wowcrowd&lt;/a&gt; platform, and the contest structure will be similar. Anybody can submit project proposals, anybody can vote on their favorite ideas, and each month the project with the most votes will be awarded a grant. Project ideas range from organized tree plantings to retrofitting buildings with more efficient CFL’s to setting up bike repair workshops.&lt;/p&gt;

&lt;p&gt;As part of our partnership with 350.org, we’ve donated this month’s Project Fund grant money to the 350 Project Climate Action Fund. You can do your part as well—we encourage you to &lt;a href=&quot;http://www.350.org/funds&quot;&gt;cast your ballots&lt;/a&gt; to help determine the winners, and to &lt;a title=&quot;Climate Action Fund&quot; href=&quot;http://www.350.org/funds&quot; target=&quot;_blank&quot;&gt;submit&lt;/a&gt; your climate  project ideas to the fund.  And as 10/10/10 approaches, you can also participate in helping make 350 ppm a reality by joining a local Work Party or registering your own. With your help, thousands of communities will come together to make 10/10 the biggest day of practical action to cut carbon the world has ever seen.&lt;/p&gt;

&lt;p&gt;–the Brighter Planet team&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Case Foundation's Wowcrowd interview</title>
   <link href="http://numbers.brighterplanet.com/2010/07/01/case-foundations-wowcrowd-interview"/>
   <updated>2010-07-01T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/07/01/case-foundations-wowcrowd-interview</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;Last week, our friends at &lt;a href=&quot;http://www.casefoundation.org/about/our-story&quot;&gt;The Case Foundation&lt;/a&gt; sat down with Brighter Planet’s Robbie Adler to talk about the release of our new crowdsourcing technology platform &lt;a href=&quot;http://wowcrowd.com/&quot;&gt;Wowcrowd&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Josh:&lt;/strong&gt; Thanks again for speaking to us today Robbie. Just to clarify for all of those who might be a bit confused, what exactly &lt;em&gt;is&lt;/em&gt; Wowcrowd?&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Robbie:&lt;/strong&gt; Wowcrowd is a social web application that gives organizations the tools to crowdsource the allocation of funds, which helps them engage their stakeholders and surface bright ideas.&lt;/p&gt;

  &lt;p&gt;The concept is simple. An organization with a Wowcrowd account earmarks a  pool of money for a particular mission, and then opens the process to  their users—their employees, members, customers, constituents, or the  general public. Individual users submit proposed ideas for how the  funding could be spent, and then all the users vote to decide which of  the proposals will get funded and be realized.&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Josh:&lt;/strong&gt; What are the benefits of challenges and contests like  the ones being run on Wowcrowd?&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;Robbie:&lt;/strong&gt; A well-run crowdsourced program can provide  some very important benefits for an organization. It opens a slice of  the decision-making process to their stakeholders, which engages them as  active participants in the organization’s mission rather than as  passive donors or members—and an engaged constituent base clearly  offers many advantages.&lt;/p&gt;

  &lt;p&gt;It can also be a strong PR tool, because as we’ve learned, contest  participants (including proposal submitters and voters) end up devoting  their own energy and effort to spreading the word in support of their  cause, effectively creating brand ambassadors for the organization.  Administered through an online tool like Wowcrowd, these programs can be  easily integrated with other social media channels to efficiently  promote the fund and the organization.&lt;/p&gt;

  &lt;p&gt;Of course, another big benefit is the crowdsourced ideas themselves. By tapping into the collective intelligence of their stakeholders, a  contest administrator can efficiently surface creative ideas that are  diverse and compelling—ideas they likely wouldn’t have thought of  themselves.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You’ll find &lt;a href=&quot;http://www.casefoundation.org/blog/citizen-centered-solutions-wowcrowd-lets-every-organization-run-their-own-online-challenge&quot;&gt;the  full interview&lt;/a&gt;, conducted by Joshua Tabb, on the Case Foundation  blog.&lt;/p&gt;

&lt;p&gt;Established in 1997 by Jean and Steve Case, the Case Foundation utilizes a citizen-centered approach to encourage civic engagement in the U.S. and around the Globe. The organization focuses on the “big-swing-for-the-fences ideas” with large potential for change to achieve their mission: “invest in people and ideas that can change the world.”  Recently they conducted the &lt;a href=&quot;http://www.casefoundation.org/projects/giving-challenge&quot;&gt;America’s Giving Challenge&lt;/a&gt;, a one month competition to unite people around the issues they care about, increase awareness for the issues, and attract donors. The challenge was enormously successful, bringing in over 105,000 donations and raising $2.1 million for various nonprofit causes.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Emissions modeling methodology published</title>
   <link href="http://numbers.brighterplanet.com/2010/06/29/emissions-modeling-methodology-published"/>
   <updated>2010-06-29T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/06/29/emissions-modeling-methodology-published</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/70/original/carbon_modeling_methodology.pdf&quot;&gt;&lt;img style=&quot;float: left; border: 1px solid black; width: 185px; margin-right: 10px; margin-top: 5px;&quot; src=&quot;http://farm5.static.flickr.com/4137/4744184898_835ed04dbf_m.jpg&quot; alt=&quot;Methodology Paper&quot; width=&quot;185&quot; height=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The field of carbon emissions modeling is in a period of rapid evolution, shaped by ongoing transformations in climate science, information technology, government regulation, and the business environment. Demand for data about the impacts of carbon-emitting activities is steadily increasing— but so too are the complexity, opacity, and inconsistency of emissions calculation methodologies, undermining advancements in the field.&lt;/p&gt;

&lt;p&gt;At a time when carbon intelligence has an urgent role to play in stemming catastrophic climate change, a more deliberate approach to carbon modeling is warranted. Reactive attempts by authorities to establish consistent, transparent methodology standards have been only marginally successful, more so in the sphere of corporate carbon footprinting than elsewhere. As a small company developing carbon emissions models, Brighter Planet is committed to doing our part in helping transform this field.&lt;/p&gt;

&lt;p&gt;In developing our modeling approach, we were guided by three core principles: rigor, flexibility, and transparency. We knew that our system would need to provide high quality estimates that accounted for an emitter’s full and complete climate impact. We knew that the model would need to operate given huge real-world variability in the quantity and quality of data available about emissions sources. And we knew that radical openness and collaboration would be critical to maintaining trust and quality in a rapidly evolving space at the intersection of multiple fields.&lt;/p&gt;

&lt;p&gt;Our goal for this &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/69/original/modeling_methodology_lowdef.pdf&quot;&gt;methodology paper&lt;/a&gt; was to provide insight into the approach and data that we use to model greenhouse gas emissions, both to help fulfill our commitment to openness by documenting our own practices, and to foster a discussion about best practices in carbon modeling to help advance the field. We welcome discussion and collaboration on this project!&lt;/p&gt;

&lt;p&gt;–The Brighter Planet Team&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>200 million pounds!</title>
   <link href="http://numbers.brighterplanet.com/2010/06/10/200-million-pounds"/>
   <updated>2010-06-10T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/06/10/200-million-pounds</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img class=&quot;alignnone&quot; title=&quot;turbine&quot; src=&quot;http://farm5.static.flickr.com/4012/4688125411_436336a09d.jpg&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;241&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&lt;strong&gt;201,938,091 pounds of carbon dioxide pollution that never was.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;As of today that’s the greenhouse gas emissions that you, the Brighter Planet community, have prevented from being released.  More than &lt;strong&gt;150,000 individuals and businesses&lt;/strong&gt; have come together to support the construction of &lt;strong&gt;19 community renewable energy projects&lt;/strong&gt; (and counting).  These wind turbines and cow power facilities at schools and family farms across the country generate clean electricity and prove the viability of new energy technologies, create green jobs and economic opportunity in rural America, and reduce the environmental and social burdens of fossil fuel use, coal mining, and methane pollution.&lt;/p&gt;

&lt;p&gt;The greenhouse gas emissions you’ve prevented so far is equivalent to:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;4,000,000,000 party balloons&lt;/strong&gt; filled with carbon dioxide -- two for every child on earth&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;6,600,000 cars&lt;/strong&gt; removed from the road for a day&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;23,700,000 tree saplings&lt;/strong&gt; sequestering carbon for a year&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;480 railroad cars&lt;/strong&gt; full of coal never burned&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;3 full days&lt;/strong&gt; of every US home turning off all their lights&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks everybody for doing your part to prove that working together using &lt;a href=&quot;http://brighterplanet.com/products&quot;&gt;innovative tools&lt;/a&gt;, we can make a very real difference!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>2010 on track for record high temps</title>
   <link href="http://numbers.brighterplanet.com/2010/05/19/noaa-warmest-april-on-record"/>
   <updated>2010-05-19T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/05/19/noaa-warmest-april-on-record</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;It’s that time of the month again – the week when NOAA scientists release last month’s “combined global surface temperature” data – and we’ve got yet another winner.  It was the &lt;a href=&quot;http://www.noaanews.noaa.gov/stories2010/20100517_globalstats.html&quot;&gt;warmest April&lt;/a&gt; on record, hot on the tail of the &lt;a href=&quot;http://www.noaanews.noaa.gov/stories2010/20100415_marchstats.html&quot;&gt;warmest March&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The March and April heat was more than enough to pull the entire four-month January–April average into record territory, despite January and February having been merely the &lt;a href=&quot;http://www.ncdc.noaa.gov/sotc/?report=global&amp;amp;year=2010&amp;amp;month=1&amp;amp;submitted=Get+Report&quot;&gt;fourth-&lt;/a&gt; and &lt;a href=&quot;http://www.noaanews.noaa.gov/stories2010/20100316_globalstats.html&quot;&gt;sixth-warmest&lt;/a&gt; on record.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.noaanews.noaa.gov/stories2010/images/Jan-Apr2010.jpg&quot;&gt;&lt;img src=&quot;http://farm2.static.flickr.com/1139/4622312578_325f3eda3e.jpg&quot; alt=&quot;Map&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Yes, you’re reading that correctly: the North American Arctic has been about 9 DEGREES FARENHEIGHT (5 C) warmer than average these last four months.  Yikes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Expect to see more of the same as we move into the rest of 2010: NASA researchers predict the trend to continue, &lt;a href=&quot;http://data.giss.nasa.gov/gistemp/paper/gistemp2010_draft0319.pdf&quot;&gt;forecasting&lt;/a&gt; that 2010 will weigh in as warmest year in recorded history.&lt;/p&gt;

&lt;p&gt;The effects?  Well for one, warmer sea surface temperatures are a key element in predictions by folks at &lt;a href=&quot;http://hurricane.atmos.colostate.edu/Forecasts/2010/april2010/apr2010.pdf&quot;&gt;CSU&lt;/a&gt;, &lt;a href=&quot;http://news.ncsu.edu/releases/hurricane10/&quot;&gt;NCSU&lt;/a&gt;, and &lt;a href=&quot;http://www.accuweather.com/blogs/news/story/25984/joe-bastardi-more-active-2010-1.asp&quot;&gt;Accuweather&lt;/a&gt; that the 2010 Atlantic hurricane season (which opens on June 1) will  be significantly more active than average and “has the chance to be an extreme season.”  Critics have called the Gulf oil spill &lt;a href=&quot;http://www.nytimes.com/2010/05/19/opinion/19friedman.html?hp&quot;&gt;“Obama’s Katrina”&lt;/a&gt;, but chances appear better than average he’ll get a literal Katrina of his own.&lt;/p&gt;

&lt;p&gt;–Matthew&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Update: Greensburg dedication ceremony</title>
   <link href="http://numbers.brighterplanet.com/2010/05/07/update-greensburg-dedication-ceremony"/>
   <updated>2010-05-07T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/05/07/update-greensburg-dedication-ceremony</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;This past Friday, the town of Greensburg, Kansas held an official dedication for their new &lt;a href=&quot;http://brighterplanet.com/projects/19-greensburg-wind-farm&quot;&gt;wind farm&lt;/a&gt;. We’d like to share some photos and video from our partner &lt;em&gt;Native&lt;/em&gt;Energy.&lt;/p&gt;

&lt;object width=&quot;370&quot; height=&quot;278&quot;&gt; &lt;param name=&quot;flashvars&quot; value=&quot;offsite=true&amp;amp;lang=en-us&amp;amp;page_show_url=%2Fphotos%2Fbrighterplanet%2Fsets%2F72157624013963754%2Fshow%2F&amp;amp;page_show_back_url=%2Fphotos%2Fbrighterplanet%2Fsets%2F72157624013963754%2F&amp;amp;set_id=72157624013963754&amp;amp;jump_to=&quot; /&gt; &lt;param name=&quot;movie&quot; value=&quot;http://www.flickr.com/apps/slideshow/show.swf?v=71649&quot; /&gt; &lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; src=&quot;http://www.flickr.com/apps/slideshow/show.swf?v=71649&quot; allowfullscreen=&quot;true&quot; flashvars=&quot;offsite=true&amp;amp;lang=en-us&amp;amp;page_show_url=%2Fphotos%2Fbrighterplanet%2Fsets%2F72157624013963754%2Fshow%2F&amp;amp;page_show_back_url=%2Fphotos%2Fbrighterplanet%2Fsets%2F72157624013963754%2F&amp;amp;set_id=72157624013963754&amp;amp;jump_to=&quot; width=&quot;370&quot; height=&quot;278&quot; /&gt;&lt;/object&gt;

&lt;p&gt;As Steve Maller, Program Manager for John Deere Renewables, said at the ceremony, “the Greensburg wind farm provides a vivid example of how local leaders, governments and private industry can collaborate to develop renewable energy projects that help sustain Americas’ rural communities and our rural heritage.” &lt;/p&gt;

&lt;p&gt;Thanks again to all our members. You’ve made this project possible.&lt;/p&gt;

&lt;p&gt;-&lt;a href=&quot;http://brighterplanet.com/users/ihough&quot;&gt;Ian&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>GOOD infographic: Household Carbon Emissions and What You Can Do</title>
   <link href="http://numbers.brighterplanet.com/2010/04/23/good-infographic-household-carbon-emissions-and-what-you-can-do"/>
   <updated>2010-04-23T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/04/23/good-infographic-household-carbon-emissions-and-what-you-can-do</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;This Earth Day our friends at &lt;a href=&quot;http://www.good.is/&quot;&gt;GOOD&lt;/a&gt; asked for our help illustrating household emissions and tips for reducing them. We shared some data, and they produced this beautiful infographic:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://awesome.good.is/transparency/web/1004/action-sheet-carbon/flash.html&quot;&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4041/4546944676_b89ba0e528.jpg&quot; alt=&quot;GOOD infographic&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>TreeHugger's "Best of Green" awards hit home</title>
   <link href="http://numbers.brighterplanet.com/2010/04/09/treehuggers-best-of-green-awards-hit-home"/>
   <updated>2010-04-09T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/04/09/treehuggers-best-of-green-awards-hit-home</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4023/4506335612_035a37f224.jpg&quot; alt=&quot;Best of Green banner&quot; /&gt;&lt;/p&gt;

&lt;p&gt;TreeHugger has just announced the “Best of Green” awards. And we’re proud and thrilled to see that Brighter Planet has taken the cake for &lt;a href=&quot;http://www.treehugger.com/galleries/2010/04/best-of-green-2010-business-politics.php?page=10&quot;&gt;Small Business of the Year&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;The work we do here is fairly diverse, so it’s nice when somebody captures it succinctly. TreeHugger’s summary observed:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Offering credit and debit cards and carbon offsets, funding several small-scale renewable energy projects such as methane digesters and farmer-owned wind turbines, and also doing some interesting carbon reporting – most recently one on the &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/52/original/carbon_foodprint_wp.pdf?1264533289&quot;&gt;carbon footprint of food&lt;/a&gt;  which clarified some important aspects of the impact of food miles – Brighter Planet’s products, projects and services stood out this year.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Many of our friends and allies were recognized in the Best of Green awards as well. Congrats for your well-deserved wins:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Bill McKibben (member of our advisory board), named Best Political Amabassador&lt;/li&gt;
  &lt;li&gt;Our partners at 1% for the Planet, named Best Non-Profit Partnership&lt;/li&gt;
  &lt;li&gt;Our partners as 350.org, named Best Climate Activism&lt;/li&gt;
  &lt;li&gt;The folks at Greenbiz, named Best Business Website&lt;/li&gt;
  &lt;li&gt;Climate Progress, a favorite blog of ours, named Best Politics Website&lt;/li&gt;
  &lt;li&gt;Gavin Newsom of San Francisco (which we now call home in concert with Vermont), named Best Mayor&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Upcoming SF event: panel discussion on employee sustainability</title>
   <link href="http://numbers.brighterplanet.com/2010/03/29/upcoming-sf-event-panel-discussion-on-employee-sustainability"/>
   <updated>2010-03-29T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/03/29/upcoming-sf-event-panel-discussion-on-employee-sustainability</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;We’re pleased to announce that Brighter Planet is partnering with &lt;a href=&quot;http://www.carboncollaborative.org/&quot;&gt;San Francisco Carbon Collaborative&lt;/a&gt;  to host a lively event in our newest home, San Francisco!  If you’re on the west coast, come join us on Wednesday, April 14 for a high-level panel discussion that will examine findings from our recently published report on employee engagement in corporate sustainability.  We’ll hand the conversation to our panelists, who will share their experiences, strategies, and best practices in an interactive forum.  It will be a great opportunity to learn from companies who are leading the charge in incorporating employees (and their ideas!) into a sustainability strategy.  And yes, there will be &lt;a href=&quot;http://www.climatini.org/about/&quot;&gt;drink&lt;/a&gt;.  Hope you can make it!  See the details below…&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family: Helvetica Neue,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&amp;lt;p style=&quot;text-align: center;&quot;&amp;gt;&lt;strong&gt;Brighter Planet Presents New Employee  Engagement Report:&lt;/strong&gt;&lt;em&gt;
Wednesday, April 14, 2010 at 111 Minna Gallery, San Francisco
6:00pm – 7:30pm, immediately followed by Climatini&lt;/em&gt;&amp;lt;/p&amp;gt;
———-&lt;span style=&quot;font-family: Helvetica Neue,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;img class=&quot;alignnone&quot; title=&quot;brighter planet&quot; src=&quot;http://farm3.static.flickr.com/2773/4464456807_f335ef6505_m.jpg&quot; alt=&quot;&quot; width=&quot;115&quot; height=&quot;36&quot; /&gt;———- &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Helvetica Neue,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;img class=&quot;alignnone&quot; title=&quot;SF Carbon Collaborative&quot; src=&quot;http://farm3.static.flickr.com/2721/4464456863_f04eef1906_t.jpg&quot; alt=&quot;&quot; width=&quot;100&quot; height=&quot;37&quot; /&gt;&lt;/span&gt;&lt;/span&gt;———-&lt;span style=&quot;font-family: Helvetica Neue,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;img class=&quot;alignnone&quot; title=&quot;Climatini&quot; src=&quot;http://farm3.static.flickr.com/2725/4465235610_1bdc3230b9_t.jpg&quot; alt=&quot;&quot; width=&quot;100&quot; height=&quot;31&quot; /&gt;&lt;/span&gt;&lt;/span&gt;———-&lt;span style=&quot;font-family: Helvetica Neue,sans-serif;&quot;&gt; &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Employee Engagement is becoming an increasingly popular means to drive corporate sustainability efforts.  Around the world, companies and communities are mobilizing their workforces to lessen pollution, waste and operational inefficiencies.  However, a new analysis by Brighter Planet suggests that employees are generally dissatisfied with their employers’ sustainability initiatives.  Moreover, many employers are unable to quantify the effects of their internal efforts.  This finding is especially timely in light of increasing executive pressure to measure the impact of sustainability work on bottom line.&lt;/p&gt;

&lt;p&gt;Please join the &lt;a href=&quot;http://www.carboncollaborative.org/&quot;&gt;San Francisco Carbon Collaborative&lt;/a&gt;, &lt;a href=&quot;http://brighterplanet.com/about&quot;&gt;Brighter Planet&lt;/a&gt;, and &lt;a href=&quot;http://www.climatini.org/&quot;&gt;Climatini &lt;/a&gt;on April 14th, for a panel discussion and an exploration of how to better foster Employee Engagement in the sustainability arena.  We’ll preview the new Brighter Planet study and consider the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How can companies enhance CSR strategies by fusing employee initiative and forward green thinking?&lt;/li&gt;
  &lt;li&gt;How does the strategy of sustainable employee engagement ft within the larger theme of CSR?&lt;/li&gt;
  &lt;li&gt;How can we measure CSR/EE impacts upon triple bottom lines?&lt;/li&gt;
  &lt;li&gt;What are the pros and cons of implementing top-down vs. bottom-up sustainability programs?&lt;/li&gt;
  &lt;li&gt;How should companies incentivize employee-led initiatives?&lt;/li&gt;
  &lt;li&gt;Where are the cutting-edge opportunities and best-practice ideas?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This event is free of charge with a cash bar.  Space is limited, so please &lt;a href=&quot;http://www.carboncollaborative.org/index.php?q=civicrm/event/info&amp;amp;reset=1&amp;amp;id=27&quot;&gt;register by clicking here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Patti Prairie, CEO, Brighter Planet&lt;/strong&gt;:  Brighter Planet provides technology-driven climate change solutions that help people and businesses manage their environmental impact.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Andrew Bryson, Senior Director, Saatchi &amp;amp; Saatchi S&lt;/strong&gt;:  Saatchi S is a leader in sustainability consulting, having successfully designed and implemented employee engagement programs for some of the world’s largest corporations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lisa Carpenter, Director of Strategy and Communications for Social and Environmental Responsibility, Gap, Inc.&lt;/strong&gt;:  Gap is a pioneer in the areas of CSR &amp;amp; environmental sustainability, having successfully reduced the social and environmental impacts of their business operations in four key areas: supply chain, environment, employees and community investment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ellen Lee, HR Director, Sun, Light &amp;amp; Power&lt;/strong&gt;: Sun Light &amp;amp; Power is a small solar power integrator based in Berkeley, CA. The company’s culture is built on a commitment to employee engagement that extends the environmental benefit of their core business.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Moderator – David Pascal, President, San Francisco Carbon Collaborative&lt;/strong&gt;: David is co-founder of the SF Carbon Collaborative and was most recently the Clean Tech and Green Business Advocate for the City and County of San Francisco.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Brighter Planet wins 2010 Social Innovation Award!</title>
   <link href="http://numbers.brighterplanet.com/2010/03/25/brighter-planet-wins-2010-social-innovation-award"/>
   <updated>2010-03-25T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/03/25/brighter-planet-wins-2010-social-innovation-award</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p style=&quot;text-align: center;&quot;&gt;
&lt;img class=&quot;alignnone&quot; title=&quot;2010 Social Innovation Award&quot; src=&quot;http://farm5.static.flickr.com/4039/4461874747_f988073cee.jpg&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;248&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;At a  dinner in NYC last night, I learned that we won the 2010 Financial  Times &amp;amp; Justmeans &lt;a href=&quot;http://www.socialinnovationawards.com/&quot;&gt;Social Innovation  Award&lt;/a&gt; for most strategic philanthropy program!&lt;/p&gt;

&lt;p&gt;The  &lt;a href=&quot;http://brighterplanet.com/project_fund_projects&quot;&gt;Project Fund&lt;/a&gt;,  our community-powered monthly grant program for grassroots climate  projects, has gone viral.  The idea is simple: anybody can submit a  grant proposal, and anybody can vote to decide which project will win  the grant.  Our goal in launching it six months ago was to help  communities that lack access to seed money turn their good ideas into  real-world solutions to climate change.&lt;/p&gt;

&lt;p&gt;As I  told the audience at the Hudson Theatre when I accepted the award, the  recognition by the Financial Times, Justmeans, and the distinguished  panel of judges is a tribute to the 150,000 Brighter Planet customers  who endow the Project Fund, to the 100 projects submitted over the past  six months, and to the tens of thousands of voters across the nation.    And, of course, to our Project Fund grantees which range from post-coal  sustainability projects in Appalachia, to youth activism in Copenhagen,  to tree planting in Wisconsin.&lt;/p&gt;

&lt;p&gt;It’s  so satisfying to be able to jump-start deserving projects like these.   So now we’re providing this crowd-sourced philanthropy technology to  other businesses, campaigns, foundations, and non-profits.  Our social  giving platform, &lt;a href=&quot;http://wowcrowd.com/&quot;&gt;wowcrowd&lt;/a&gt; (in private  beta but live soon!), lets organizations engage their members to  propose, discuss, and vote on ideas to receive project funding.&lt;/p&gt;

&lt;p&gt;Thank  you to the Financial Times, Justmeans, and the panel of judges for your  recognition.&lt;/p&gt;

&lt;p&gt;–&lt;a href=&quot;http://brighterplanet.com/users/pattiprairie&quot;&gt;Patti&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Update: clean energy flowing in Greensburg!</title>
   <link href="http://numbers.brighterplanet.com/2010/03/15/update-clean-energy-flowing-in-greensburg"/>
   <updated>2010-03-15T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/03/15/update-clean-energy-flowing-in-greensburg</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p style=&quot;text-align: center;&quot;&gt;
&lt;img class=&quot;alignnone&quot; title=&quot;greensburg turbine construction&quot; src=&quot;http://farm3.static.flickr.com/2701/4423365600_0a8a90e64a.jpg&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;149&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;The answer may be blowin’ in the wind, but it’s not always easy to find.  For Greensburg, Kansas, it took a devastating natural disaster, a visionary commitment by residents, an arduous fund raising effort, and a lengthy planning and building process, to get the clean energy flowing.  But that day is finally here.&lt;/p&gt;

&lt;p&gt;Leveled in 2007 by a EF-5 tornado that destroyed more than 95% of the buildings in this town of 1500 residents, Greensburg vowed to rebuild as the greenest town in America.  Now, less than three years later, that commitment has paid off as the first of ten massive new wind turbines begin to spin outside town.&lt;/p&gt;

&lt;p style=&quot;text-align: center;&quot;&gt;
&lt;img class=&quot;alignnone&quot; title=&quot;greensburg tornato devastation&quot; src=&quot;http://farm5.static.flickr.com/4025/4423383366_7ecc3d3367.jpg&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;168&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;The Greensburg Wind Farm by NativeEnergy came online this month, and we’re thrilled that members of the Brighter Planet community were able to play a key role in making this story a reality.  As charter supporters of this wind farm, every Brighter Planet cardholder helped fund its construction every time you swiped your &lt;a href=&quot;http://brighterplanet.com/products/debit_card&quot;&gt;card&lt;/a&gt; to buy gas and groceries.  Thanks everybody!  It’s great to see another inspiring example of innovative ways we can come together to build a clean energy future.&lt;/p&gt;

&lt;p&gt;The ten turbines, each capable of producing up to 1.25 MW of electricity, will provide enough clean energy to power the town several times over – this allows Brighter Planet members who contributed to the project to claim rights to some of the clean energy produced, with enough left over for the town of Greensburg also to claim carbon neutrality.&lt;/p&gt;

&lt;p&gt;The sheer scale of these turbines is awesome; each one is as tall as a 35-story building, with blades a long as the wingspan of a Boeing 747.  An eyesore for local residents?  Quite the contrary – the only concerns raised during the placement process came from folks who wanted the project located where it could be seen from their homes.&lt;/p&gt;

&lt;p style=&quot;text-align: center;&quot;&gt;
&lt;img class=&quot;alignnone&quot; title=&quot;greensburg turbines&quot; src=&quot;http://farm5.static.flickr.com/4032/4423362762_b97f7313c3.jpg&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;150&quot; /&gt;
&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Employee sustainability survey results:  the good, the bad, the ugly</title>
   <link href="http://numbers.brighterplanet.com/2010/02/10/employee-sustainability-survey-results-the-good-the-bad-the-ugly"/>
   <updated>2010-02-10T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/02/10/employee-sustainability-survey-results-the-good-the-bad-the-ugly</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2682/4343440271_4a509b24bc.jpg&quot; alt=&quot;employee&quot; height=&quot;237&quot; width=&quot;500&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We’ve finally wrapped up the crunching, sifting, charting, and interpreting of the 30,000+ datapoints collected in our recent online survey about the employee engagement practices of US employers.  Thanks to all of you who took the time to respond to the &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/57/original/ee_survey_questions.pdf?1265742090&quot;&gt;survey questions&lt;/a&gt;.  Today we released the report that details our findings.&lt;/p&gt;

&lt;p&gt;Mindy Lubber, president of &lt;a href=&quot;http://www.ceres.org/&quot;&gt;Ceres&lt;/a&gt; (and Brighter Planet advisory board member), signed onto the cause with her contribution of the foreword.  As she says, “This report from Brighter Planet both provides a benchmark for the status of employee sustainability programs in the US as they continue to evolve, and helps to inform their development by highlighting factors that contribute to their success. We look forward to watching employee engagement initiatives play an increasing role in helping our institutions to overcome the challenges of our time.”&lt;/p&gt;

&lt;p&gt;Here are a few of the findings at a glance. &lt;a href=&quot;http://brighterplanet.com/publications&quot;&gt;Download the complete report&lt;/a&gt; to get the full results and insights.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Most employers have only just begun interacting with employees around sustainability, and their efforts leave room for improvement.&lt;/strong&gt; Although 86% of respondents said their organization promotes employee sustainability in some arena, only 16% said their employer collects data related to employee sustainability and just 14% said their employer had an official employee sustainability engagement policy.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Small organizations are leading on employee sustainability engagement.&lt;/strong&gt; Organizations with fewer than 100 people are nearly twice as likely to promote sustainability very frequently, and their efforts are twice as likely to be effective at changing employee behavior. &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;The most effective engagement programs feature an organization’s management or board as the main advocate for employee sustainability.&lt;/strong&gt; These programs are three times as effective as those in which an employee sustainability director was the main advocate.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Employees are generally dissatisfied with their employers’ sustainability engagement efforts.&lt;/strong&gt; Over 60% of respondents want to learn more 	about their employers’ and co-workers’ sustainability efforts, and 67% would like their employers to change their stance on sustainability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;–&lt;a href=&quot;http://brighterplanet.com/users/matthew&quot;&gt;Matthew&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eat your way to a healthy climate: new report</title>
   <link href="http://numbers.brighterplanet.com/2010/01/29/eat-your-way-to-a-healthy-climate-new-report"/>
   <updated>2010-01-29T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/01/29/eat-your-way-to-a-healthy-climate-new-report</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img class=&quot;alignnone&quot; title=&quot;foodprint&quot; src=&quot;http://farm3.static.flickr.com/2757/4310518000_d96c972cea_o.png&quot; alt=&quot;&quot; width=&quot;503&quot; height=&quot;186&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Wanted to share with you all a white paper that we just put out, entitled &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/52/original/carbon_foodprint_wp.pdf?1264533289&quot;&gt;“The American Carbon Foodprint: Understanding and Reducing your Food’s Impact on Climate Change”&lt;/a&gt;.  Using the emissions model that we built to power the footprint calculator on this website, we analyzed the cradle to grave climate impacts of the average diet, and pulled the results together in a report that explains and interprets them.  It turned up some pretty enlightening (and sometimes rather surprising) stuff – good background for anybody who is into understanding the food they eat.&lt;/p&gt;

&lt;p&gt;A few highlights:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The average American’s carbon “foodprint” is 6.1 tons of CO2e a year.  That’s bigger than the combined impact of all their driving and flying.&lt;/li&gt;
  &lt;li&gt;Production accounts for close to half of a meal’s total climate impact, and red meat is by far the most potent emitter of all the food groups.&lt;/li&gt;
  &lt;li&gt;Of all the transportation emissions associated with your food, less than a tenth result from 	delivering food from the producer to the vendor, while more than two thirds result from your own driving to grocery stores and restaurants. That puts the importance of “food miles” in perspective!&lt;/li&gt;
  &lt;li&gt;Kitchen energy accounts for 29% of a meal’s life cycle impact.  Cooking at home is far more 	carbon-efficient than eating in restaurants.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yes, the climate impact of our dining habits is substantial.  But it’s pretty straightforward for each of us to make changes that significantly reduce those impacts.  We distilled the learnings into seven take-home tips:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Eat fewer animals and more plants&lt;/li&gt;
  &lt;li&gt;Buy unprocessed foods with less packaging&lt;/li&gt;
  &lt;li&gt;Grow and harvest your own food&lt;/li&gt;
  &lt;li&gt;Minimize car trips to restaurants and stores&lt;/li&gt;
  &lt;li&gt;Cook at home more and eat out less&lt;/li&gt;
  &lt;li&gt;Cook with efficient appliances and techniques&lt;/li&gt;
  &lt;li&gt;Compost, recycle, and relish leftovers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out the &lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/52/original/carbon_foodprint_wp.pdf?1264533289&quot;&gt;full paper&lt;/a&gt; to get answers to all the carbon foodprint questions you never knew you had, and let us know what you think.&lt;/p&gt;

&lt;p&gt;–&lt;a href=&quot;http://brighterplanet.com/users/matthew&quot;&gt;Matthew&lt;/a&gt;
&amp;lt;p style=&quot;text-align: center;&quot;&amp;gt;&lt;a href=&quot;http://attachments.brighterplanet.com/press_items/local_copies/52/original/carbon_foodprint_wp.pdf?1264533289&quot;&gt;&lt;img class=&quot;aligncenter&quot; title=&quot;foodprint pie chart&quot; src=&quot;http://farm3.static.flickr.com/2690/4310517722_e6478f1b1e.jpg&quot; alt=&quot;&quot; width=&quot;326&quot; height=&quot;400&quot; /&gt;&lt;/a&gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Fly green, for real</title>
   <link href="http://numbers.brighterplanet.com/2010/01/14/fly-green-for-real-2"/>
   <updated>2010-01-14T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2010/01/14/fly-green-for-real-2</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;In a &lt;a href=&quot;http://www.fastcompany.com/blog/patti-prairie/new-climate-economy/fly-green-real&quot;&gt;recent post&lt;/a&gt; on Fast Company, we ranked the major US airlines by climate impact per passenger.&lt;/p&gt;

&lt;p&gt;We started with data from the Bureau of Transportation Statistics’ &lt;a href=&quot;http://www.transtats.bts.gov/Fields.asp?Table_ID=309&quot;&gt;T-100 database&lt;/a&gt;, a collection of monthly reports from every airline that is certified to fly in the US. We took factors like flight distance, aircraft model, number of passengers, and amount of freight carried, combined them with aircraft fuel use equations from the &lt;a href=&quot;http://www.eea.europa.eu/publications/emep-eea-emission-inventory-guidebook-2009&quot;&gt;European Environment Agency&lt;/a&gt;, and ran the lot through our emissions engine. (Fun fact: the calculations took about 15 minutes on a standard household computer.)&lt;/p&gt;

&lt;p&gt;This chart shows the complete ranking, from best to worst in pounds of &lt;a href=&quot;http://brighterplanet.com/entries/7&quot;&gt;CO&lt;sub&gt;2&lt;/sub&gt;e&lt;/a&gt; per passenger-mile.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm5.static.flickr.com/4043/4267487598_efa4c22096.jpg&quot; alt=&quot;airline_chart&quot; width=&quot;500&quot; height=&quot;433&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Note: a passenger-mile is one passenger flying one mile.&lt;/p&gt;

&lt;p&gt;-&lt;a href=&quot;http://brighterplanet.com/users/ihough&quot;&gt;Ian&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Geeking out with carbon footprint calculations: the foodprint of EatingWell holiday recipes </title>
   <link href="http://numbers.brighterplanet.com/2009/12/18/geeking-out-with-carbon-footprint-calculations-the-foodprint-of-eatingwell-holiday-recipes"/>
   <updated>2009-12-18T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/12/18/geeking-out-with-carbon-footprint-calculations-the-foodprint-of-eatingwell-holiday-recipes</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;Sometimes we really geek out with carbon emissions calculations at Brighter Planet.  We crunch numbers down to the thousandth decimal in order to make recommendations about what is better to buy/do/eat in terms of one’s &lt;a href=&quot;http://brighterplanet.com/entries/8-carbon_footprint/&quot;&gt;carbon footprint&lt;/a&gt;. In light of our &lt;a href=&quot;http://blog.brighterplanet.com/sustainable-cooking/tips-to-choose-from/&quot;&gt;Sustainable Cooking Contest&lt;/a&gt;(which runs two more weeks through December 31st!) and the stories we’ve received about reducing impact in the kitchen, we’re going to break down some fantastic &lt;a href=&quot;http://www.eatingwell.com/recipes_menus/collections/holiday_collection_1&quot;&gt;holiday recipes from EatingWell&lt;/a&gt; for you.  &lt;/p&gt;

&lt;p&gt;Here are the general estimates for the carbon footprint of these recipes, measured in lbs. of &lt;a href=&quot;http://brighterplanet.com/entries/7-units_and_measures&quot;&gt;C02e&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2532/4190041803_7a1215ac56_m.jpg&quot; alt=&quot;English roast meat by fire with flames&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.eatingwell.com/recipes/horseradish_beef.html&amp;quot;&quot;&gt;Horseradish crusted beef tenderloin&lt;/a&gt;and &lt;a href=&quot;http://www.eatingwell.com/recipes/vt_cheddar_potatoes.html&quot;&gt;Vermont Cheddar Mashed Yukon Golds&lt;/a&gt;: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Total- 56&lt;/strong&gt; lbs CO2e, or &lt;strong&gt;7&lt;/strong&gt; lbs per serving.              	  	    &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beef&lt;/strong&gt; 
kcal/serving- 220
servings- 8	       &lt;br /&gt;
lbs co2e- 34.5	  &lt;br /&gt;
lbs co2e/serving- 4.3&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Potatoes&lt;/strong&gt;
kcal/serving- 223	          &lt;br /&gt;
servings- 8	       &lt;br /&gt;
lbs co2e- 21.5	      &lt;br /&gt;
lbs co2e/serving- 2.7&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2700/4190801806_de5d016a4e_m.jpg&quot; alt=&quot;blog_veggies&quot; /&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.eatingwell.com/recipes/cheddar_vegetable_tart.html&quot;&gt;Roasted Fall Vegetables in Cheddar Crust&lt;/a&gt; and &lt;a href=&quot;http://www.eatingwell.com/recipes/green_beans_mushrooms.html&quot;&gt;Green and Yellow Beans with Wild Mushrooms&lt;/a&gt;: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Total- 38&lt;/strong&gt; lbs CO2e, or &lt;strong&gt;4.6&lt;/strong&gt; lbs. per serving.	&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vegetable Pie&lt;/strong&gt;	       &lt;br /&gt;
kcal/serving- 378	               &lt;br /&gt;
servings- 8	       &lt;br /&gt;
lbs co2e- 29.8	&lt;br /&gt;
lbs/serving- 3.7&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beans/Mushrooms&lt;/strong&gt;	&lt;br /&gt;
kcal/serving- 75	              &lt;br /&gt;
servings- 10	       &lt;br /&gt;
lbs co2e- 8.3	&lt;br /&gt;
lbs/serving- 0.8&lt;/p&gt;

&lt;p&gt;Choose the veggie-based dishes and you’ll have over 30% reduction in CO2e.  This shows how replacing a few meaty holiday dishes with non-meat dishes, or choosing poultry and fish over red meats, can shave off a significant chunk of your “foodprint.”  The other thing to keep in mind is that 11% of food emissions comes from transportation, so buying locally-sourced produce can decrease total food-miles from dirt to plate and reduce the total emissions.&lt;/p&gt;

&lt;p&gt;If you want to do some more estimating and playing around with food emissions, check out the Food section of our &lt;a href=&quot;http://brighterplanet.com/users/me/footprint/components/food&quot;&gt;Footprint Calculator&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;-&lt;a href=&quot;http://brighterplanet.com/users/Carolyn&quot;&gt;Carolyn&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Add your pets to your carbon footprint!</title>
   <link href="http://numbers.brighterplanet.com/2009/11/17/add-your-pets-to-your-carbon-footprint"/>
   <updated>2009-11-17T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/11/17/add-your-pets-to-your-carbon-footprint</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img class=&quot;alignnone&quot; title=&quot;scrappy scrappy&quot; src=&quot;http://farm3.static.flickr.com/2477/4011879869_4184218fd2.jpg&quot; alt=&quot;&quot; width=&quot;500&quot; height=&quot;185&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Ok folks, the day you’ve been eagerly awaiting has finally arrived. We’ve just turned on a new module in the footprint calculator that gives personalized pet emissions estimates – so go ahead and &lt;a href=&quot;http://brighterplanet.com/users/me/footprint/components/pets&quot;&gt;add your pets&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Believe it or not, pets actually do cause a sizable quantity of greenhouse gas emissions. The &lt;a href=&quot;http://www.avma.org/reference/marketstats/ownership.asp&quot;&gt;AVMA&lt;/a&gt; puts the number of dogs and cats in the US at over 150 million, plus tens of millions more horses, birds, and small animals; that’s a lot of mouths to feed.  The vast majority of your pet’s climate impact comes from producing, transporting, and distributing its food, although we also figure in its share of the emissions from veterinary offices.&lt;/p&gt;

&lt;p&gt;The average dog weighs in at about 2 tons of CO2 a year while the average cat emits about 1000 pounds, making the typical American citizen’s pet footprint about 1.8 tons per year (yes, I’m talking about people-years here). Of course, your pet footprint varies greatly depending on the number of pets you own and their species and size.  As always, the calculator begins by assuming you own an average number of average pets, and incrementally adjusts that estimate as you provide more personalized info on your own pets.&lt;/p&gt;

&lt;p&gt;Having pets does cause emissions, but there are plenty of &lt;a href=&quot;http://brighterplanet.com/conservation-tips/list/tagged_with?tag[name]=pets&quot;&gt;things you can do&lt;/a&gt; to reduce that impact – having your animals fixed, being conscious about the ingredients and packaging in your pet food, and avoiding extraneous pet accessories all make a big difference.  You can even join others in building &lt;a href=&quot;http://brighterplanet.com/projects&quot;&gt;renewable energy projects&lt;/a&gt; to offset your furry friend’s climate impact – that’ll really make her beam in adulation.&lt;/p&gt;

&lt;p&gt;Oh and FYI, we’ll be working to add many more new functions (think recycling, hotels, entertainment, motorcycles, clothing, health care, rental cars…) to the footprint calculator as time goes on, so &lt;a href=&quot;http://blog.brighterplanet.com/feed/&quot;&gt;stay tuned&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;–&lt;a href=&quot;http://brighterplanet.com/users/matthew&quot;&gt;Matt K&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Imperfect Planning and the Best Keys</title>
   <link href="http://numbers.brighterplanet.com/2009/11/11/imperfect-planning-and-the-best-keys"/>
   <updated>2009-11-11T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/11/11/imperfect-planning-and-the-best-keys</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;&lt;a title=&quot;Picture 3 by brighterplanet, on Flickr&quot; href=&quot;http://www.flickr.com/photos/brighterplanet/4095714271/&quot;&gt;&lt;img class=&quot;alignleft&quot; style=&quot;margin-left: 0px; margin-right: 0px;&quot; src=&quot;http://farm3.static.flickr.com/2695/4095714271_d5c79434dd_o.png&quot; alt=&quot;Picture 3&quot; width=&quot;137&quot; height=&quot;310&quot; /&gt;&lt;/a&gt;
I recently received some requests from &lt;a href=&quot;http://www.blendernation.com/microgrants-for-climate-projects/&quot;&gt;BlenderNation&lt;/a&gt; to write a little about how to animate a &lt;a href=&quot;http://vimeo.com/7327532&quot;&gt;bumblebee&lt;/a&gt;.  Toward this goal I can’t help but think about the unpredictability of planning a project under deadline and the importance of keyframing by hand.&lt;/p&gt;

&lt;p&gt;First, the planning.  I could lie and talk about what an ideal planner I am.  I could draw up fake storyboards and draft a fake script to make it look as though I intended every choice of this project from the start as though some twist of genius granted me direct connection to a god-like inspiration.   But it doesn’t work that way, not on any project that I’ve known.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;Given this, one might surmise that my idea of planning is to shoot from the hip and hope for the best.  But that isn’t it either.  That suggests that planning is irrelevant; that good work can come from reckless behavior.  Maybe it can to some people, but not to me, and never under deadline.&lt;/p&gt;

&lt;p&gt;The projects I have taken the time to plan have all succeeded to some degree or another.  The projects I have failed to plan have failed themselves.  But for the ones that worked, there was always a plan.&lt;/p&gt;

&lt;p&gt;Paradoxically, the plan, however good, has always changed at some point between the beginning of production and the end.  For example this bumblebee project began without a single bumblebee.  It was supposed to be about flowers.  I happily started the script, imagining how the beautiful sun would shine its nourishing light on various plants until their seeds fell down to the soil to grow into a garden.&lt;/p&gt;

&lt;p&gt;Then I set to work on a concise voice-over narration script with lots of puns and active verbs.  I sketched out a couple storyboard drawings of the plants, their seeds swelling and dropping.  Everything was going according to plan.  But as I opened up Blender to begin modeling something inside of me groaned.&lt;/p&gt;

&lt;p&gt;The work was boring.  I had seven shots of seven plants relishing in the sunlight and growing their seeds.  After modeling just one I was sick already of the plants and the sunshine and the glory of nature.  My heart sank and I began to look for ways to jettison the entire project without causing too much collateral damage.&lt;/p&gt;

&lt;p&gt;This is when the bee flew in to land on the back of my pollen clogged brain, and when he did everything about the plan changed.  Now there was a protagonist, the glimmer of a story, and an idea worth planning for.&lt;/p&gt;

&lt;p&gt;But before charging through the steps that carry any animation project from beginning to end – write, storyboard, model, rig, animate, etc.  –  I counted the days I had remaining: Ten days till deadline.  With that number in my head I planned a film that I could produce in five.  In the end it took me twelve.
&amp;lt;p style=&quot;text-align: center;&quot;&amp;gt;&lt;a title=&quot;Picture 6 by brighterplanet, on Flickr&quot; href=&quot;http://www.flickr.com/photos/brighterplanet/4095714335/&quot;&gt;&lt;img class=&quot;aligncenter&quot; src=&quot;http://farm3.static.flickr.com/2752/4095714335_7fdde37e7b_o.png&quot; alt=&quot;Picture 6&quot; width=&quot;307&quot; height=&quot;153&quot; /&gt;&lt;/a&gt;&amp;lt;/p&amp;gt;&lt;/p&gt;

&lt;p&gt;Now keyframing.  For those unfamiliar with the animation term, each keyframe is an image that the animator creates to bring meaning to a film.  Every keyframe in a finished film is necessary.  Like the keystone in an arch, if a single keyframe goes missing the whole piece can collapse.&lt;/p&gt;

&lt;p&gt;In 3D computer animation keyframes are an opportunity for human touch.  Keyframes take time to build for they must be made one by one by hand.  The amount of labor it takes to keyframe an animation has turned away many interested people from the field.  It’s just too much work.  In the days of classical hand-drawn animation this labor seemed well understood.  However, 3D computer animation suffers a myth that animation with the help of a enough computers can be easy.  If we could only build the perfect rig, or hire enough helpers or program the perfect animation software then animation could be effortless.&lt;/p&gt;

&lt;p&gt;But if that day ever comes when all one must do is push the animate button and pull the emotion lever to somewhere between happy and sad, then animation will be finished, no longer interesting.&lt;/p&gt;

&lt;p&gt;Take the challenge away from the animators and the viewers will find no joy in watching what they make.  For me it is awe that I experience when I witness animation far greater than my own.  It drives me to improve and allows me to appreciate how far I’ve come.  I am not a great animator by any means, but I know now that animation is worth the effort.&lt;/p&gt;

&lt;p&gt;3D computer animation is a powerful, sophisticated, precise tool.  But it is only a tool.  It is not the art.  It is not the artist.  My older brother Michael said to me recently, “I’ve given up on the ability of computers to solve the problems of the world.”  He went on to suggest that a computer is like a bulldozer.  A bulldozer is very good at pushing dirt around.  Bulldozers have come a long way since their ancestor, the rake.  A modern bulldozer is capable of pushing so much dirt around so quickly it boggles the mind.  But a bulldozer is only beautiful so long as all you need is dirt.  Anything more requires a human being.&lt;/p&gt;

&lt;p&gt;This is the keyframe, that thing that only a single human being can do, that moment of communication between author and audience, the image that makes all your effort into more that a hill of dirt.&lt;/p&gt;

&lt;p&gt;So please, pour all of your energy into those keyframes, all of it.  Your keyframes decide the success of the piece;  the rest will follow.&lt;/p&gt;

&lt;p&gt;In the movie Gattaca, two brothers race by swimming straight out to sea.   The loser is whoever turns back first.   Always the same brother loses, the one not biologically designed for super-human strength.  Over and over growing up they race until one day the weaker brother wins.  The stronger cannot fathom how.  “This is how I did it, Anton: I never saved anything for the swim back.”&lt;/p&gt;

&lt;p&gt;If you have never worked on an animation yourself then to stumble upon someone else’s work-in-progress can be baffling.  The computer monitor becomes a portal into some strange three-dimensional world constantly orbiting a pale gray character wrapped in wire. The unfinished character stares vacantly forward, its arms out stiffly to the sides as though recently crucified.  Even more baffling to the onlooker is how the animator, back hunched, fingers clicking rapidly at the keyboard and mouse, seems not to mind the gruesome monster and even thinks it handsome.&lt;/p&gt;

&lt;p&gt;It is a work in progress.  It does not yet communicate anything to the outside world, but it will.  All that is missing are the keyframes.  Those are the life of the piece.  Once they are in place the arch stands up without support.  The bridge is built.  Communication flows.
&amp;lt;p style=&quot;text-align: center;&quot;&amp;gt;&lt;a title=&quot;Picture 7 by brighterplanet, on Flickr&quot; href=&quot;http://www.flickr.com/photos/brighterplanet/4096475504/&quot;&gt;&lt;img class=&quot;aligncenter&quot; src=&quot;http://farm3.static.flickr.com/2482/4096475504_90212051b9_o.png&quot; alt=&quot;Picture 7&quot; width=&quot;229&quot; height=&quot;212&quot; /&gt;&lt;/a&gt;&amp;lt;/p&amp;gt;&lt;/p&gt;

&lt;p&gt;So that’s how you animate a bee!  I would imagine that solving climate change has an equally logical answer.  If you discover what this answer is, please let me know.  In the meantime I’ll be working at it myself, hoping another bee lands on my brain.&lt;/p&gt;

&lt;p&gt;-Daniel&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Behind the Scenes of the Project Fund Video</title>
   <link href="http://numbers.brighterplanet.com/2009/11/02/behind-the-scenes-of-the-project-fund-video"/>
   <updated>2009-11-02T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/11/02/behind-the-scenes-of-the-project-fund-video</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;object width=&quot;400&quot; height=&quot;225&quot;&gt;&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://vimeo.com/moogaloop.swf?clip_id=7327532&amp;amp;server=vimeo.com&amp;amp;show_title=0&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00A850&amp;amp;fullscreen=1&quot; /&gt;&lt;embed src=&quot;http://vimeo.com/moogaloop.swf?clip_id=7327532&amp;amp;server=vimeo.com&amp;amp;show_title=0&amp;amp;show_byline=0&amp;amp;show_portrait=0&amp;amp;color=00A850&amp;amp;fullscreen=1&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot; width=&quot;400&quot; height=&quot;225&quot; /&gt;&lt;/object&gt;

&lt;p&gt;Check out our latest video made with the wonderful &lt;a href=&quot;http://www.blender.org/&quot;&gt;Blender&lt;/a&gt; animation software.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blog.brighterplanet.com/wp-content/themes/bp/assets/brighter_planet_project_fund.zip&quot;&gt;Download&lt;/a&gt; the behind the scenes files!&lt;/p&gt;

&lt;p&gt;This project began with a script about plants, which turned into a storyboard of pencil sketches, plants, flowers, seeds of all kinds swelling and dropping from their branches.  These sketches evolved into a collection of 3d models, and rigs and everything seemed to be going according to plan.&lt;/p&gt;

&lt;p&gt;Then a bee flew into the room and landed near my desk.  It’s wings slowed from a blur to rest on its back.  When the little guy looked up at me everything changed.  I threw out the script and the storyboard.  I shut down my animation software and started over with pencil and paper to tell the story of the bee.&lt;/p&gt;

&lt;p&gt;Voting for this month’s projects began yesterday and closes on the 15th, so &lt;a href=&quot;http://brighterplanet.com/project_fund_projects&quot;&gt;vote today!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-&lt;a href=&quot;http://brighterplanet.com/users/daniel&quot;&gt;Daniel&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Breaking ground in Greensburg</title>
   <link href="http://numbers.brighterplanet.com/2009/10/23/breaking-ground-at-greensburg"/>
   <updated>2009-10-23T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/10/23/breaking-ground-at-greensburg</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.flickr.com/photos/brighterplanet/4035652754/&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3497/4035652754_3b87df48c1.jpg&quot; alt=&quot;Greensburg Satellite Photo&quot; width=&quot;500&quot; height=&quot;200&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Today is a big day in Greensburg, Kansas. This morning is the official groundbreaking on the &lt;a href=&quot;http://brighterplanet.com/projects/19-greensburg-wind-farm&quot;&gt;Greensburg Wind Farm&lt;/a&gt; by &lt;em&gt;Native&lt;/em&gt;Energy, the most recent offset project funded by Brighter Planet members. The project has been years in the planning, but with construction beginning today the ten 1.25 Mw turbines are set to be operational by this coming spring. They’ll generate enough clean electricity to power the 4,000 homes in the community several times over, and prevent the release of more than a billion pounds of CO2 over twenty years.&lt;/p&gt;

&lt;p&gt;Brighter Planet is excited to stand by other charter supporters in making this project a reality, including Ben &amp;amp; Jerry’s, Clif Bar, Stonyfield Farm, and Green Mountain Coffee Roasters. And we’re also excited to give individuals the opportunity to invest in this project through both and creative channels, like &lt;a href=&quot;http://brighterplanet.com/products&quot;&gt;applying their credit card reward points&lt;/a&gt; to help bring the project to life.&lt;/p&gt;

&lt;p&gt;Discovery Chanel’s Planet Green is set to film the groundbreaking, as they have many other events in their &lt;a href=&quot;http://planetgreen.discovery.com/tv/greensburg/&quot;&gt;inspiring series&lt;/a&gt; chronicling the rebuilding of Greensburg from tornado disaster zone to model green town. We’ll share that video here as soon as it becomes available.&lt;/p&gt;

&lt;p&gt;–&lt;a href=&quot;http://brighterplanet.com/users/matthew&quot;&gt;Matt K&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>First Project Fund grant goes to Sustainable Energy and Economic Diversification project to promote green jobs</title>
   <link href="http://numbers.brighterplanet.com/2009/10/21/first-project-fund-grant-goes-to-seed-to-promote-green-job-alternatives-in-coal-river-valley"/>
   <updated>2009-10-21T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/10/21/first-project-fund-grant-goes-to-seed-to-promote-green-job-alternatives-in-coal-river-valley</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p style=&quot;text-align: center;&quot;&gt;
&lt;img src=&quot;http://brighterplanet.com/stylesheets/images/project_fund/logo.png&quot; alt=&quot;Project Fund Logo&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;We’re pleased to announce that Andrew Munn from Rock Creek, West Virginia is the first recipient of a &lt;a href=&quot;http://brighterplanet.com/project_fund_projects&quot;&gt;Project Fund&lt;/a&gt; grant. His project, &lt;a href=&quot;http://brighterplanet.com/project_fund_projects/17&quot;&gt;Sustainable Energy and Economic Diversification (SEED) in the Coal River Valley&lt;/a&gt;, will receive $5,000 to get a kick-start on fighting climate change. With the support of Coal River Mountain Watch, SEED will reduce local dependency on coal extraction and help educate young students and workers on alternative forms of employment. Over two weeks, the project garnered a whopping total of 4,731 votes.&lt;/p&gt;

&lt;p&gt;The October voting period showcased eighteen project proposals and brought in a total of 13,983 votes from across the country. Other top project submissions included an effort from Green Light New Orleans to install CFL light bulbs in low and middle income communities, and a project from the Burlington Food Council in Vermont to fund a staff position to promote local food networks.&lt;/p&gt;

&lt;p&gt;This is just the first step in Brighter Planet’s grassroots stimulus package for the climate. Six new grassroots submissions from California, Texas, West Virginia, Indiana, and New Hampshire have already been vetted and are on deck. Voting will begin again on November 1&lt;sup&gt;st&lt;/sup&gt;, so be sure to come back and make your voice count!&lt;/p&gt;

&lt;p&gt;-&lt;a href=&quot;http://brighterplanet.com/users/mvaughan&quot;&gt;Matt V&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Curious where the votes came from? This map shows votes for the top five projects.&lt;/p&gt;

&lt;p style=&quot;text-align: center;&quot;&gt;
&lt;a title=&quot;October Project Fund Votes by brighterplanet, on Flickr&quot; href=&quot;http://www.flickr.com/photos/brighterplanet/4033304290/&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3509/4033304290_7771914bcd.jpg&quot; alt=&quot;October Project Fund Votes&quot; width=&quot;500&quot; height=&quot;289&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>âMastering the Art of Sustainable Cookingâ Contest</title>
   <link href="http://numbers.brighterplanet.com/2009/09/23/mastering-the-art-of-sustainable-cooking"/>
   <updated>2009-09-23T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/09/23/mastering-the-art-of-sustainable-cooking</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2550/3940523063_83c435f5f5.jpg&quot; alt=&quot;MASC_logo&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The idea is simple–share your own experiences reducing your “foodprint,” learn how others are making great food that’s also good for the planet, and win some killer prizes!&lt;/p&gt;

&lt;p&gt;These days, it’s hard to miss the hubub about electric cars and fluorescent lights, wind turbines and cash for clunkers.  But it might come as a surprise to learn that in terms of carbon emissions, the impact of the food you eat is on par with the car you drive and the home you inhabit.  This &lt;a href=&quot;http://blog.brighterplanet.com/sustainable-cooking/&quot;&gt;contest&lt;/a&gt; is all about raising that awareness, sharing great ways we can each reduce the climate impact of our diets.&lt;/p&gt;

&lt;p&gt;Here’s how it works.  Just browse through the &lt;a href=&quot;http://brighterplanet.com/personal-actions/list/tagged_with?tag[name]=cooking&quot;&gt;cooking conservation tips&lt;/a&gt;, and submit stories and photos of how you reduce your impact for each category you’re interested in.  As you’re poking around, be sure to give a nod to other experiences you like—at the end of the contest, stories with the most “thumbs up” will be rated against the judging criteria.&lt;/p&gt;

&lt;p&gt;Culinary and conservation heavyweights on our &lt;a href=&quot;http://blog.brighterplanet.com/sustainable-cooking/judges/&quot;&gt;judging panel&lt;/a&gt; include chef and local food pioneer Alice Waters, author and journalist Bill McKibben, and Stonyfield Farms CEO Gary Hirshberg.&lt;/p&gt;

&lt;p&gt;Yes, &lt;a href=&quot;http://blog.brighterplanet.com/sustainable-cooking/prizes/&quot;&gt;there is loot to be won&lt;/a&gt;: random prizes throughout the contest, and top prizes of Amazon Kindle DXs in each category.  The top experiences will be published online, and broadcast here on our blog.  And just as importantly, you’ll learn about ways make delicious, low-impact meals, and inspire others to do the same!&lt;/p&gt;

&lt;p&gt;Join us at the &lt;a href=&quot;http://blog.brighterplanet.com/sustainable-cooking/&quot;&gt;main contest page&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;–&lt;a href=&quot;http://brighterplanet.com/&quot;&gt;the Brighter Planet team&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Climate bill benefit at least double the cost.</title>
   <link href="http://numbers.brighterplanet.com/2009/09/16/climate-bill-benefit-at-least-double-the-cost"/>
   <updated>2009-09-16T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/09/16/climate-bill-benefit-at-least-double-the-cost</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;Everyone talks about the costs of climate legislation. Opponents &lt;a href=&quot;http://www.grist.org/article/2009-04-01-republicans-carbon-lie/&quot;&gt;distort the numbers&lt;/a&gt; to make it seem too costly while supporters point out that cutting greenhouse gas emissions will be &lt;a href=&quot;http://www.grist.org/article/cbo-pollution-cuts-cost-little&quot;&gt;pretty cheap&lt;/a&gt;. But the cost is only half the story – what about the benefit?&lt;/p&gt;

&lt;p&gt;It’s hard to monetize the benefits of avoiding climate change. But as &lt;a href=&quot;http://www.grist.org/article/2009-09-11-counting-the-benefits-of-climate-legislation/&quot;&gt;Grist reported&lt;/a&gt;, a federal interagency task force has been hard at work and they recently released an interim estimate of the ‘social cost of carbon’ - the cost of inaction. They peg this at $19 per metric tonne of CO&lt;sub&gt;2&lt;/sub&gt;.&lt;/p&gt;

&lt;p&gt;What does this mean for pending climate legislation? An NYU law school &lt;a href=&quot;http://www.policyintegrity.org/documents/OtherSideoftheCoin.pdf&quot;&gt;paper&lt;/a&gt; (&lt;a href=&quot;http://climateprogress.org/2009/09/14/waxman-markey-clean-air-clean-water-clean-energy-jobs-bill-creates-1-5-trillion-in-benefits/&quot;&gt;summarized here&lt;/a&gt;) applied the interim estimate to the Waxman-Markey American Clean Energy and Security Act. They found it would create $1.5 trillion in benefits, more than twice the EPA-estimated cost of $660 billion. Strengthening the bill to reduce more emissions would only improve the cost/benefit ratio.&lt;/p&gt;

&lt;p&gt;Now factor in that the EPA says their cost estimate is almost certainly too high while the interagency task force says their benefit estimate is almost certainly too low (it leaves out things like the impacts of weather variability on agriculture, threats to national security, ocean acidification and coral reef death, and the spread of infectious diseases).&lt;/p&gt;

&lt;p&gt;The upshot may have already been obvious to all of us who think it’s worthwhile to avoid catastrophic climate change. But it’s nice to have some numbers to throw around when you say passing strong climate legislation is the investment opportunity of an era.&lt;/p&gt;

&lt;p&gt;-&lt;a href=&quot;http://brighterplanet.com/users/ihough&quot;&gt;Ian&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Behind the Scenes of âYour Planet, Brighterâ</title>
   <link href="http://numbers.brighterplanet.com/2009/09/15/behind-the-scenes-of-your-planet-brighter"/>
   <updated>2009-09-15T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/09/15/behind-the-scenes-of-your-planet-brighter</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;object width=&quot;400&quot; height=&quot;300&quot;&gt;&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://vimeo.com/moogaloop.swf?clip_id=6580315&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; /&gt;&lt;embed src=&quot;http://vimeo.com/moogaloop.swf?clip_id=6580315&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot; width=&quot;400&quot; height=&quot;300&quot; /&gt;&lt;/object&gt;

&lt;p&gt;If you’d like to explore more about how this movie was made, &lt;a href=&quot;http://blog.brighterplanet.com/wp-content/themes/bp/assets/your_planet_brighter.zip&quot;&gt;download&lt;/a&gt; the project file and explore it with &lt;a href=&quot;http://blender.org&quot;&gt;Blender&lt;/a&gt;’s magnificent animation software.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Announcing the Brighter Planet Project Fund to seed grassroots climate projects</title>
   <link href="http://numbers.brighterplanet.com/2009/09/15/announcing-the-brighter-planet-project-fund-to-seed-grassroots-climate-projects"/>
   <updated>2009-09-15T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/09/15/announcing-the-brighter-planet-project-fund-to-seed-grassroots-climate-projects</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;Over the past few years, we have been continually inspired by the thousands of individuals and community organizations growing the climate movement from the ground up. We’re thrilled to announce a new monthly micro-grant fund, the &lt;a href=&quot;http://brighterplanet.com/project_fund_projects&quot;&gt;Brighter Planet Project Fund&lt;/a&gt;, to provide motivated Americans with seed money for projects that help people fight and adapt to climate change.&lt;/p&gt;

&lt;p&gt;As you know we spend quite a bit of time here fussing with &lt;strong&gt;our&lt;/strong&gt; projects—the wind turbines and methane digesters that produce the offsets you earn with our cards. But this fund is about &lt;strong&gt;your&lt;/strong&gt; projects: the neighborhood-scale solutions like weatherization and education that might not produce offsets but are nevertheless critically important to the planet. Think of it like a grassroots stimulus package for the climate.&lt;/p&gt;

&lt;p&gt;One of the things we’re proudest of is that the fund is endowed by our members. Every time you use one of our cards or purchase an offset package from us, a percentage of our revenue gets deposited automatically into the fund. This means that as the Brighter Planet community grows, we’ll be able to do more and more good.&lt;/p&gt;

&lt;p&gt;Know a local school that could use some insulated windows? Maybe your church wants to put a solar panel on its roof? Want to invite a climate leader to speak at your library? You guys have the ideas; let’s make them happen.&lt;/p&gt;

&lt;p&gt;-&lt;a href=&quot;http://brighterplanet.com/about/staff&quot;&gt;the Brighter Planet team&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Think the Volt is greener than the Prius? Think again.</title>
   <link href="http://numbers.brighterplanet.com/2009/08/25/think-the-volt-is-greener-than-the-prius-think-again"/>
   <updated>2009-08-25T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/08/25/think-the-volt-is-greener-than-the-prius-think-again</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;GM recently announced &lt;a href=&quot;http://media.gm.com/servlet/GatewayServlet?target=http://image.emerald.gm.com/gmnews/viewpressreldetail.do?domain=12&amp;amp;docid=56132&quot;&gt;fuel economy figures&lt;/a&gt; for the plug-in hybrid Chevy Volt: a whopping 230 miles per gallon! Using the same EPA standards, a rival automaker, Nissan, &lt;a href=&quot;http://www.nytimes.com/2009/08/03/automobiles/03iht-auto.html&quot;&gt;reported&lt;/a&gt; that their all-electric Leaf would get 367 mpg.  &lt;/p&gt;

&lt;p&gt;Mind-blowing numbers, right? You would think the Volt or the Leaf will blow the &lt;a href=&quot;http://www.fueleconomy.gov/feg/findacar.htm&quot;&gt;50 mpg Prius&lt;/a&gt; off the road. Not true in half of the country. The long and short of it is driving 100 miles in a Prius emits 40 lbs of &lt;a href=&quot;http://brighterplanet.com/entries/7&quot;&gt;CO&lt;sub&gt;2&lt;/sub&gt;e&lt;/a&gt; across all states whereas driving 100 miles in a Volt in Kansas emits 53 lbs, in California 19 lbs, and in Massachusetts 25 lbs. When electricity comes from burning coal, the Prius is hands-down greener than charging your Volt from the garage outlet.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/brighterplanet/3855541375/&quot; title=&quot;prius_vs_volt_map by brighterplanet, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2424/3855541375_68de3002ef_o.png&quot; width=&quot;586&quot; height=&quot;497&quot; alt=&quot;prius_vs_volt_map&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While we applaud products that reduce our dependence on foreign oil, it’s time to put the greenwashing brakes on the spin that electric cars are the environmentally friendliest throughout the land. Just because you can’t see the fossil fuels being burned to make electricity doesn’t mean they’re not being burned when you’re on a dirty grid. Let’s put the pedal to the metal on a new renewable energy infrastructure. Then plug-in hybrids and electric cars will be greener than ever.&lt;/p&gt;

&lt;p&gt;-&lt;a href=&quot;http://brighterplanet.com/users/rksaunders&quot;&gt;Rich&lt;/a&gt; + &lt;a href=&quot;http://brighterplanet.com/users/ihough&quot;&gt;Ian&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this comparison we used:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;2010 Toyota Prius – &lt;a href=&quot;http://www.fueleconomy.gov/&quot;&gt;50 miles per gallon&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Chevrolet Volt – &lt;a href=&quot;http://media.gm.com/servlet/GatewayServlet?target=http://image.emerald.gm.com/gmnews/viewpressreldetail.do?domain=12&amp;amp;docid=56132&quot;&gt;25 kWh per 100 miles&lt;/a&gt; (running on electric only)&lt;/li&gt;
  &lt;li&gt;Gasoline emissions – 19.777 lbs CO2e / gallon (based on &lt;a href=&quot;http://epa.gov/climatechange/emissions/usinventoryreport.html&quot;&gt;US EPA GHG Inventory&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;Electricity emissions – year 2005 data from &lt;a href=&quot;http://www.epa.gov/cleanenergy/energy-resources/egrid/index.html&quot;&gt;eGRID2007 v1.1&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Tame your carbon footprint with the new brighterplanet.com</title>
   <link href="http://numbers.brighterplanet.com/2009/08/14/tame-your-carbon-footprint-with-the-new-brighterplanet-com"/>
   <updated>2009-08-14T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/08/14/tame-your-carbon-footprint-with-the-new-brighterplanet-com</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;We turned on our new website for real this week. &lt;em&gt;w00t! WAHOO!! YEE-HAWW!!!&lt;/em&gt; (Beg pardon — that little celebration has been more than a year in coming.)&lt;/p&gt;

&lt;p&gt;The new &lt;a href=&quot;http://brighterplanet.com&quot;&gt;brighterplanet.com&lt;/a&gt; is a free, fun, and easy-to-use web utility that will help you succeed in living a more planet-friendly lifestyle, in the same way that other online tools help people get a handle on their finances or adopt a diet/fitness regimen. All you need to get rolling is a desire to be part of the solution to environmental challenges. We’ll show you — and help you show others — how personal choices add up, how to get started, and where to pick off low-hanging fruit.&lt;/p&gt;

&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;525&quot; height=&quot;420&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;flashvars&quot; value=&quot;offsite=true&amp;amp;lang=en-us&amp;amp;page_show_url=%2Fphotos%2Fbrighterplanet%2Fsets%2F72157621909325533%2Fshow%2F&amp;amp;page_show_back_url=%2Fphotos%2Fbrighterplanet%2Fsets%2F72157621909325533%2F&amp;amp;set_id=72157621909325533&amp;amp;jump_to=&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;src&quot; value=&quot;http://www.flickr.com/apps/slideshow/show.swf?v=71649&quot; /&gt;&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; width=&quot;525&quot; height=&quot;420&quot; src=&quot;http://www.flickr.com/apps/slideshow/show.swf?v=71649&quot; allowfullscreen=&quot;true&quot; flashvars=&quot;offsite=true&amp;amp;lang=en-us&amp;amp;page_show_url=%2Fphotos%2Fbrighterplanet%2Fsets%2F72157621909325533%2Fshow%2F&amp;amp;page_show_back_url=%2Fphotos%2Fbrighterplanet%2Fsets%2F72157621909325533%2F&amp;amp;set_id=72157621909325533&amp;amp;jump_to=&quot; /&gt;&lt;/object&gt;

&lt;p&gt;Feedback from early-bird users was immensely helpful in refining the app through our beta period. And (now that we’ve danced our little jig, &lt;a href=&quot;http://www.youtube.com/watch?v=sBmyNHiMvR4&quot;&gt;kinda like these guys&lt;/a&gt;), it’s back to work. We’ll  continue to shape brighterplanet.com based on your feedback, and we’re not planning to rest for a long while. There’s lots to do:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;em&gt;Twitter integration.&lt;/em&gt; Soon you&#39;ll be able to link your twitter account to your Brighter Planet profile.  This will give you easy access to sharing your experience with your friends.&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;Facebook integration.&lt;/em&gt; Facebook connect is coming soon.  You&#39;ll be able to interact with your facebook friends right from the Brighter Planet website.&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;Widgets and badges&lt;/em&gt; that can be embedded virtually anywhere.&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;Share your Brighter Planet activity anywhere via a custom RSS feed.&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;Carbon profiler precision:&lt;/em&gt; soon you&#39;ll be able to tell us how much waste you generate, and how much of it is recycled.  You&#39;ll also be able to calculate your pet&#39;s emissions!&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;Carbon profiler UX enhancements:&lt;/em&gt; we&#39;re constantly working on new ways to make entering information easier.&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;Compare your footprint&lt;/em&gt; to others on Brighter Planet.&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;More third-party integration.&lt;/em&gt; We&#39;re all set to start doing data handshakes with some of the big get-things-done services (spots where you pay your bills, do some shopping, make travel plans, etc).&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;Historical data / visualizations.&lt;/em&gt; Set conservation goals and track your progress over time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What’s missing from this list?  What new feature (or change to an existing one) would make you the most excited?&lt;/p&gt;

&lt;p&gt;Leave your thoughts here, or on &lt;a href=&quot;http://getsatisfaction.com/brighterplanet&quot;&gt;our GetSatisfaction.com support site&lt;/a&gt;. Talk to us on &lt;a href=&quot;http://twitter.com/brighterplanet&quot;&gt;Twitter&lt;/a&gt;, or &lt;a href=&quot;http://facebook.com/brighterplanet&quot;&gt;Facebook&lt;/a&gt;. Wait… What?! You’re not signed up yet?!! Good grief, there’s no time for delay — &lt;a href=&quot;https://brighterplanet.com/sign-up&quot;&gt;get thee to the registration page&lt;/a&gt;!!&lt;/p&gt;

&lt;p&gt;- &lt;a href=&quot;http://brighterplanet.com/users/iwilker&quot;&gt;Ian&lt;/a&gt; and &lt;a href=&quot;http://brighterplanet.com/users/adam&quot;&gt;Adam&lt;/a&gt; @ Brighter Planet&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Behind the Scenes of Big Feet, Little Planet</title>
   <link href="http://numbers.brighterplanet.com/2009/08/10/behind-the-scenes-of-big-feet-little-planet"/>
   <updated>2009-08-10T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/08/10/behind-the-scenes-of-big-feet-little-planet</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;There has been some interest in how the video Big Feet, Little Planet was made.  Here is a breakdown of the workflow.&lt;/p&gt;

&lt;object width=&quot;400&quot; height=&quot;300&quot;&gt;&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;http://vimeo.com/moogaloop.swf?clip_id=5938106&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; /&gt;&lt;embed src=&quot;http://vimeo.com/moogaloop.swf?clip_id=5938106&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot; width=&quot;400&quot; height=&quot;300&quot; /&gt;&lt;/object&gt;

&lt;p&gt;&lt;a href=&quot;http://vimeo.com/5938106&quot;&gt;Big Feet, Little Planet&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/brighterplanet&quot;&gt;Brighter Planet&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I was trying to visualize the idea of people stepping onto a scale and finding out the weight of their carbon footprint, so I spent a couple of hours designing a sheet of glass that I could film from beneath which would safely support a full grown human standing on top.&lt;/p&gt;

&lt;p&gt;There were a couple of problems with this approach.  It required more money to build a safe and sturdy structure than I was willing to spend.  And it would result in a shot looking straight up into someone’s crotch.&lt;/p&gt;

&lt;p&gt;Thankfully my colleague Mike had the genius idea of turning the equation on its side.  “Why not have people lay down on the floor and put their feet up against a window?” he suggested.  This solved the safety issue and the crotch issue, so I grabbed an old storm window from my basement and we were off.&lt;/p&gt;

&lt;p&gt;We filmed in three environments: an abstract/hi-tech space, an office space, and a home/outdoor space.  The first two feet were mens’ feet, the final one was a woman’s.  I’m not sure if you can tell a person’s sex just by looking at their feet, but you can definitely tell how hairy a person’s legs are and I wanted at least one nice smooth leg.&lt;/p&gt;

&lt;p&gt;All three shots were filmed on location, so we set up the storm window, set up the lights or the bounce cards and got a couple takes.  It was surprisingly difficult for the models to hit their mark on the glass quickly and accurately.  They could hit the mark if they went slowly, but it was often too slow to work for the shot.  However once their foot was already on the glass they could pull it down out of frame no problem.  So I ended up reversing the footage on two of the shots.  In the finished piece it looks like they’re putting their foot up, in real life they are taking it down.&lt;/p&gt;

&lt;p&gt;With the shots in place I opened up &lt;a title=&quot;Blender&quot; href=&quot;http://www.blender.org&quot; target=&quot;_blank&quot;&gt;Blender&lt;/a&gt;, a fantastic and free animation suite and modeled the effects.&lt;/p&gt;

&lt;p&gt;If you are curious to look deeper into the process, here are the production files.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a title=&quot;scan_lines.blend&quot; href=&quot;http://blog.brighterplanet.com/wp-content/themes/bp/assets/scan_lines.blend &quot; target=&quot;_blank&quot;&gt;scan_lines.blend&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title=&quot;foot1.blend&quot; href=&quot;http://blog.brighterplanet.com/wp-content/themes/bp/assets/foot1.blend &quot; target=&quot;_blank&quot;&gt;foot1.blend&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title=&quot;foot2.blend&quot; href=&quot;http://blog.brighterplanet.com/wp-content/themes/bp/assets/foot2.blend &quot; target=&quot;_blank&quot;&gt;foot2.blend&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title=&quot;foot3.blend&quot; href=&quot;http://blog.brighterplanet.com/wp-content/themes/bp/assets/foot3.blend &quot; target=&quot;_blank&quot;&gt;foot3.blend&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’ve never used Blender feel free to &lt;a title=&quot;download&quot; href=&quot;http://www.blender.org/download/get-blender/&quot; target=&quot;_blank&quot;&gt;download&lt;/a&gt; it.  You’ll need it in order to explore the files above.&lt;/p&gt;

&lt;p&gt;Once you’ve got Blender installed, just double click on a file to open it.  Then tap your left or right arrow keys to step through the animation frame by frame.&lt;/p&gt;

&lt;p&gt;-Daniel&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Sneak peek: the single biggest report on the future of the planet, ever</title>
   <link href="http://numbers.brighterplanet.com/2009/07/13/sneak-peak-the-single-biggest-report-on-the-future-of-the-planet-ever"/>
   <updated>2009-07-13T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/07/13/sneak-peak-the-single-biggest-report-on-the-future-of-the-planet-ever</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;An important 6,700-page report (don’t worry, I’m about to summarize it for you) is coming down the pipeline.  Written by world leaders and drawing on contributions from 2,700 experts from around the globe, this report will be the single biggest report considering the future of planet when it is officially published next month.  &lt;/p&gt;

&lt;p&gt;The 2009 &lt;em&gt;State of the Future &lt;/em&gt;report, &lt;a href=&quot;http://www.independent.co.uk/environment/climate-change/the-planets-future-climate-change-will-cause-civilisation-to-collapse-1742759.html&quot;&gt;obtained by &lt;em&gt;The Independent&lt;/em&gt; on Sunday&lt;/a&gt;, is backed by a diverse range of leading organizations such as Unesco, the World Bank, the U.S. Army and the Rockefeller Foundation.  &lt;/p&gt;

&lt;p&gt;The bad, but probably not surprising news, is first: the findings about climate change are grim.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Half the world could face violence and unrest due to severe unemployment combined with scarce water, food and energy supplies and the cumulative effects of climate change.&lt;/li&gt;
  &lt;li&gt;“The scope and scale of the future effects of climate change – ranging from changes in weather patterns to loss of livelihoods and disappearing states – has unprecedented implications for political and social stability.”  In conclusion, climate change “will cause civilization to collapse.”  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But, there are still some hopeful perspectives.  The authors suggest the threats may end up being catalysts for positive change.  “The good news is that the global financial crisis and climate change planning may be helping humanity to move from its often selfish, self-centered adolescence to a more globally responsible adulthood… Many perceive the current economic disaster as an opportunity to invest in the next generation of greener technologies, to rethink economic and development assumptions, and to put the world on course for a better future.”  &lt;/p&gt;

&lt;p&gt;And it is timely for us at Brighter Planet that the report also praises the web, as we consider ourselves a web-based climate change company.  The web is singled-out as, “the most powerful force for globalization, democratization, economic growth, and education in history.” &lt;/p&gt;

&lt;p&gt;Alongside from the positive force of the web, Jerome Glenn, director of the Millennium Project and one of the report’s authors, offered some concrete suggestions for a better future.  “Three great transitions would help both the world economy and its natural environment– to shift as much as possible from freshwater agriculture to saltwater agriculture; produce healthier meat without the need to grow animals; and replace gasoline cars with electric cars.”&lt;/p&gt;

&lt;p&gt;And, of course, to get to the place we need to be, there will have to be strong global agreements. “This is not only important for the environment; it is also a strategy to increase the likelihood of international peace.  Without some agreement, it will be difficult to get the kind of global coherence needed to address climate change seriously.”&lt;/p&gt;

&lt;p&gt;Here’s to positive forces, global agreements, and the future.  &lt;/p&gt;

&lt;p&gt;-&lt;a href=&quot;http://beta.brighterplanet.com/users/Carolyn/&quot;&gt;Carolyn&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Why Iâm psyched about Brighter Planetâs web app (part 1)</title>
   <link href="http://numbers.brighterplanet.com/2009/06/24/why-im-psyched-about-brighter-planets-web-app-part-1"/>
   <updated>2009-06-24T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/06/24/why-im-psyched-about-brighter-planets-web-app-part-1</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;My name’s &lt;a href=&quot;http://beta.brighterplanet.com/users/iwilker&quot;&gt;Ian Wilker&lt;/a&gt;; I’ve been on the Brighter Planet bandwagon for a couple months now, serving as your friendly neighborhood community manager. (Or “&lt;a href=&quot;http://www.web-strategist.com/blog/2007/11/25/the-four-tenets-of-the-community-manager/&quot;&gt;community advocate&lt;/a&gt;,” ”&lt;a href=&quot;http://www.stoweboyd.com/message/2009/04/unmarketing-and-webful-brands.html&quot;&gt;unmarketer&lt;/a&gt;,” ”&lt;a href=&quot;http://pinkomarketing.pbworks.com/Pinko-Marketing-Manifesto&quot;&gt;pinko marketer&lt;/a&gt;,” &lt;strong&gt;Love Boat&lt;/strong&gt;–style “social director” … I’m here to help Brighter Planet listen to, talk with, and in the end be responsive to our online user community.&lt;/p&gt;

&lt;p&gt;I could have offered up a “Hello world” post here some time ago, but I’m kind of glad I waited – we’ve released the beta version of our new web service, and I’m rarin’ to get out into worlds online and off to talk about it and get a good feedback loop rolling. Now I can get into the nitty-gritty, into the reasons the prospect of joining Brighter Planet made me feel all tingly.&lt;/p&gt;

&lt;p&gt;I grew up in rural Vermont, and my parents got me and brother Josh out into the woods at every opportunity, through all seasons. It wasn’t until much later, as a city-dwelling young adult, that I realized what a gift I’d been given by all that camping, backpacking, fishing, skiing, and so on. I started getting back out into the mountains at every opportunity; there’s just no place I feel more alive than in the woods, soaking in the infinitely rich sights, smells, sounds, textures of the natural world.&lt;/p&gt;

&lt;p&gt;Over time, through stints as a book editor and then as a web nerd, I gravitated toward jobs that brought my abiding interest in the natural world into the work. I’ve done online-communications work for &lt;a href=&quot;http://www.nrdc.org&quot;&gt;a large environmental organization&lt;/a&gt; for going on nine years. And again and again over that time, I’ve puzzled over the problem of how to show more people that doing the right thing by the environment is rarely hard – it’s just different from what most of us are used to. It’s about examining a lot of habitual behavior, and tweaking those behaviors when there’s a more planet-friendly way to get something done.&lt;/p&gt;

&lt;p&gt;And anyone can learn new habits – &lt;em&gt;IF&lt;/em&gt; one goes about it in the right way. It’s &lt;em&gt;process and practice&lt;/em&gt; that we get tangled up in. At least that’s how I’m built, it seems: give me a cut-and-dried blueprint of exactly what I want to do a little differently in a given situation, and I’m a lot more likely to start making the change. Give me a way to track the fruits of choosing a new option at a given decision point – or to see, plain as day, the stagnancy of &lt;em&gt;not&lt;/em&gt; doing that new option, and I’ll be much more likely to really commit to the change.&lt;/p&gt;

&lt;p&gt;We’re still building it out, but this is exactly what this next-generation of &lt;a href=&quot;http://beta.brighterplanet.com&quot;&gt;Brighter Planet&lt;/a&gt; will give me:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What to do next time I’m (&lt;a href=&quot;http://beta.brighterplanet.com/conservation-tips/148-buy-in-season-fruits-and-vegetables-all-week&quot;&gt;buying some fruit&lt;/a&gt;; &lt;a href=&quot;http://beta.brighterplanet.com/conservation-tips/55-take-one-military-shower-this-week&quot;&gt;taking a shower&lt;/a&gt;; &lt;a href=&quot;http://beta.brighterplanet.com/conservation-tips/90-drip-dry-the-dishes-all-week&quot;&gt;running the dishwasher&lt;/a&gt; – on and on, ad infinitum)&lt;/li&gt;
  &lt;li&gt;What making that more-sustainable choice actually does to my overall footprint – e.g. immediate feedback on the consequences of a given behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ain’t that cool? And even better: That’s just for starters. There’s a lot more to come, as I’ll explain soon in Part II of this series.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Test-drive our new site! (And expect âMen at Workâ signs.)</title>
   <link href="http://numbers.brighterplanet.com/2009/06/19/test-drive-our-new-site-and-expect-men-at-work-signs"/>
   <updated>2009-06-19T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/06/19/test-drive-our-new-site-and-expect-men-at-work-signs</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;At 2pm on Wednesday, June 17, &lt;a href=&quot;http://beta.brighterplanet.com&quot;&gt;we opened the doors of Brighter Planet v2.0 to beta testers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We’ve put our all into this. Risked life and limb, I tell you – courted eyestrain, sleep deprivation, carpal tunnel, general crabbiness. Picture, then, the  huge gust of giddy elation that blew through the team when the site went live and didn’t break the entire interwebs! W00t!! Jigs were danced, rafters swung from … I believe the web developers actually emptied the Gatorade jug onto the head of our CTO, &lt;a href=&quot;http://beta.brighterplanet.com/users/adam&quot;&gt;Adam&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;All this went on for about 10 minutes, and then deep breaths were taken and we all got back to work. We turned on the lights with our to-do list still measured in tonnage – and intentionally so. The reason? We know that you, our eagle-eyed and creative beta testers, will think of things we’d never dream up in a million years – you’ll identify software bugs, solve design problems, and suggest new features that we’re not able to see from our swimming-in-the-soup perspective. We’ll wind up with a smarter, more usable, and ultimately more useful set of tools with you all involved in decisions about where to go from here.&lt;/p&gt;

&lt;p&gt;Great feedback has been rolling in from wonderful beta testers like &lt;a href=&quot;http://getsatisfaction.com/people/sarah_franco&quot;&gt;Sarah&lt;/a&gt; and &lt;a href=&quot;http://getsatisfaction.com/people/karen_332923&quot;&gt;Karen&lt;/a&gt;. (We can’t thank you guys enough, and are all ears for whatever additional observations you may come up with.) We hope all ye who read this will &lt;a href=&quot;http://beta.brighterplanet.com&quot;&gt;give the application a whirl&lt;/a&gt; and &lt;a href=&quot;http://getsatisfaction.com/brighterplanet&quot;&gt;get involved in the dialogue&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Meanwhile, there are crews at work everywhere on the beta site – it’s the web-application equivalent of a skyscraper construction site in there. There are functions that aren’t working quite right, that aren’t yet explained well (blame me – I’m the guy who does most of the ‘splainin’ about how things work), and that simply aren’t ripe. Here’s a round-up of high-priority problems we’ll solve asap and sorely needed features we’re committed to releasing in the near future:&lt;/p&gt;

&lt;h3&gt;What&#39;s Broke:&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;STUFF WE’RE FIXING IN THE “YOUR FOOTPRINT” CALCULATOR:&lt;/strong&gt; Our new calculator is the heart of the application, and we’re proud of it – when it’s finished, we’re pretty sure it’ll be the most user-friendly, empowering personal footprint calculator out there. We mean to help you do a &lt;em&gt;complete &lt;/em&gt;accounting of your lifestyle’s climate impact, just as the best money-management and weight-management tools help you take inventory in those areas of your life. After you’ve made a good dent in filling it out, you’ll have – &lt;em&gt;cha-ching! – &lt;/em&gt;a complete, cruising-altitude view of all you do that has an impact, showing you where there’s real room for improvement, and allowing you to register your accomplishments and track your progress toward a lighter footstep.&lt;/p&gt;

&lt;p&gt;So that’s our target for the calculator. At present there are both major and minor things needing fixin’:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Top priority is resolving our suspicion that the calculator is sometimes outputting inaccurate overall footprints – user feedback and our own observations suggest that some calculations are skewing too high. The calculator’s underlying fundamentals are rock-solid but some data-caching problems we’ve been experiencing could be throwing off the web application’s tabulations. Our credibility depends on providing accurate footprint estimates, and our science and tech teams are working hard on this.&lt;/li&gt;
  &lt;li&gt;Also high on the list: bad sums – breakdowns by percentage may not add up to 100; the value displayed for your overall footprint may not match what you get doing your own math adding up the values displayed for your four footprint “components” (Transportation, Shelter, Consumables, Shared Services; etc. Again, data caching issues may be causing the hinky tabulations.&lt;/li&gt;
  &lt;li&gt;Another one: say you tell the calculator you drive a Saturn. Next question posed will be “Select your car’s model” – but the list of models you’re asked to choose from are &lt;em&gt;Toyotas&lt;/em&gt;, not Saturns. Suspected cause? You guessed it – data caching issues.&lt;/li&gt;
  &lt;li&gt;Unwieldy, unalphabetized pulldown lists: “select the airport your flight departed from,” for example. We’re implementing something that will make these much easier to use.&lt;/li&gt;
  &lt;li&gt;Opting out of a particular footprint element, e.g. “I don’t [own a car; own a dishwasher; take ferry trips, etc]”: It’s been reported that crossing off one of these isn’t always causing your footprint to be revised downward – it should, and we’re investigating. (Also, please excuse the sometimes truly inelegant phrasing of these – our favorite is “&lt;em&gt;I never occupy residences.&lt;/em&gt;”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;OTHER STUFF WE’RE FIXIN’:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A grab-bag:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;browser compatibility: We’re trying to resolve some minor weirdness occuring when viewing the site in Safari and Internet Explorer 8. (&lt;em&gt;Note: for now at least, we’re &lt;strong&gt;not&lt;/strong&gt; supporting IE6. We’ll revisit if site traffic suggests that we should.)&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;Design ickyness: Throughout the application, some of the forms look fugly, as do some pages in the Carbon Offsets section, and (according to one user) the homepage itself (yipe!). They work (or should, anyway), but aren’t yet pretty. Some just need to be styled properly and we’re confident you’ll like their looks; others – hey, we’ll consider all suggestions; keep ‘em coming.&lt;/li&gt;
  &lt;li&gt;In Conservation Tips, clicking “I Did This” is still sometimes producing errors. Most likely, this is happening simply because someone’s doing some work that throws off performance until they’re finished, but we’re investigating.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What’s Coming:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once these goodies are in place, we’re confident your experience of the site will be slick and fun indeed:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;More depth and granularity in the calculator, especially in the Consumables area.&lt;/strong&gt; This is a critical one: The goods and services Americans consume are the source of a huge chunk of our individual carbon footprints – and most carbon calculators just sidestep this part of the picture. We want our accounting to consider ALL the lifecycle climate impacts of a person’s lifestyle. My understanding is that while there’s solid data about one’s overall consumables footprint, we’ve got some work to do yet in sourcing and baking into the calculator data about consumables that allows for the same sort of thorough inventory of habits and choices that you’ll experience with, for example, the Transportation-footprint calculator. That’s where we’re headed, for sure, and you’ll see more detail here going forward.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Analytics / visualizations.&lt;/strong&gt; Also critical – we want to provide graphs and other visualizations that give you an at-a-glance handle on what’s creating your footprint, how your footprint ranks compared to national (and global) averages, what sort of progress you’re making, and where the low-hanging fruit lies. Just for starters.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Transparent methodology.&lt;/strong&gt; Every page of the calculator will allow you to peak under the hood and see what our data sources are and how the calculations are being done.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;More robust privacy options.&lt;/strong&gt; You’ll be able to decide, in a granular way, what information about yourself and your footprint you want to share with everyone, with just your friends, or with no one.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are many more, but that’s the short list. Want to leave lots of breathing room for your own ideas to form – if you’re not doing so already, please &lt;a href=&quot;http://beta.brighterplanet.com&quot;&gt;sign up as a beta tester&lt;/a&gt; and &lt;a href=&quot;http://getsatisfaction.com/brighterplanet&quot;&gt;start filing feedback&lt;/a&gt; if you like!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>"Caveat emptor," says GOOD Magazine re carbon offsets. And we agree.</title>
   <link href="http://numbers.brighterplanet.com/2009/06/11/good_carbonoffsets"/>
   <updated>2009-06-11T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/06/11/good_carbonoffsets</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;It’s &lt;a href=&quot;http://blog.brighterplanet.com/2009/05/29/what’re-they-building-in-there/&quot;&gt;all web-app, all the time&lt;/a&gt; here at Brighter Planet world headquarters—we’re totally immersed in making our soon-to-be-unwrapped rebuilt website as good as it can be before we open it up to early birds.&lt;/p&gt;

&lt;p&gt;But I did take a few minutes today to catch up on reading, and now I’m carving out a few more to talk about GOOD Magazine’s &lt;a href=&quot;http://www.good.is/post/carbon-offset-caveat-emptor/&quot;&gt;recent post on carbon offsets&lt;/a&gt;. Writer Ben Jervey has served up a guide for anyone who’s thinking about purchasing carbon offsets, and it’s good stuff. His sage advice is “buyer beware,” and he goes on to name names of some offset providers who are trustworthy and one that, in his opinion, is not.&lt;/p&gt;

&lt;p&gt;In my experience, Jervey’s caution is on target. &lt;strong&gt;Real&lt;/strong&gt; carbon offsets are a legit way to neutralize your remaining carbon impact once you’ve reduced your emissions as much as possible. But there are “&lt;strong&gt;rip&lt;/strong&gt;-offsets” for sale out there as well, and buying them is a terrific way to get nothing for something.&lt;/p&gt;

&lt;p&gt;How to tell the good from the bad?&lt;/p&gt;

&lt;p&gt;As we’ve looked at projects to add to our portfolio over the last 18 months, we’ve subjected each to intense scrutiny. Those selected to date have been the best of the best from &lt;a href=&quot;http://www.nativeenergy.com/&quot;&gt;NativeEnergy&lt;/a&gt;, cited in GOOD’s piece as one of three trusted sellers. The piece also pulls some good questions for buyers to ask, from a report by &lt;a href=&quot;http://cleanair-coolplanet.org/&quot;&gt;Clean Air-Cool Planet&lt;/a&gt;, our partner on retiring carbon offsets once they’ve been used.&lt;/p&gt;

&lt;p&gt;Here’s how we do it at Brighter Planet:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Brighter Planet earns the trust of our 100,000 customers by providing practical education about their &lt;a href=&quot;http://brighterplanet.com/learn&quot;&gt;lifestyle’s impact on climate&lt;/a&gt; and helping them &lt;a href=&quot;http://brighterplanet.com/conservation_recommendations&quot;&gt;find ways to reduce it&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;We make it easy for our customers to &lt;a href=&quot;http://brighterplanet.com/act&quot;&gt;offset their remaining impact&lt;/a&gt; by supporting real, &lt;a href=&quot;http://brighterplanet.com/entries/quality_of_additionality&quot;&gt;additional&lt;/a&gt;, transparent &lt;a href=&quot;http://brighterplanet.com/impact&quot;&gt;projects that help local communities and the environment&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;We meticulously review every project to ensure it meets our &lt;a href=&quot;http://brighterplanet.com/policy&quot;&gt;carbon offset policy&lt;/a&gt; and only accept those that are unanimously approved by the highly respected luminaries who sit on our &lt;a href=&quot;http://brighterplanet.com/groups/4&quot;&gt;project selection committee&lt;/a&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;We work with &lt;a href=&quot;http://cleanair-coolplanet.org/&quot;&gt;Clean Air-Cool Planet&lt;/a&gt;, a non-profit organization, to ensure that every offset we sell is &lt;a href=&quot;http://brighterplanet.com/entries/carbon_offset_retirement&quot;&gt;permanently retired&lt;/a&gt; and can’t be double-sold.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Finally, we &lt;a href=&quot;http://brighterplanet.com/entries/annual_audit&quot;&gt;subject all our processes to an annual third-party audit&lt;/a&gt; to make sure we’ve done what we said we were going to do.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this still-maturing business, a company’s values – its commitment to using the best available science, to complete accountability, to transparent process, to simply doing things the right way – are of paramount importance. We know our offsets are on solid ground, and &lt;a href=&quot;http://brighterplanet.com/policy&quot;&gt;we’ve made sure to implement systems to keep it that way&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Offsets alone clearly aren’t enough to tackle climate change, but they can be an important part of the solution by funding much-needed renewable energy projects. Ultimately, offsets fulfill their potential when they’re held to high standards.&lt;/p&gt;

&lt;p&gt;–&lt;a href=&quot;http://brighterplanet.com/users/717/public&quot;&gt;Ian Hough&lt;/a&gt;, science guy @ Brighter Planet&lt;/p&gt;

&lt;p&gt;p.s. - Ben Jervey’s a good friend of ours; he might be characterized as a James Brown of environmental journalists – the “hardest working man in the [green news] business.” We’ve no idea how he manages to write for &lt;a href=&quot;http://www.good.is/community/BenJervey&quot;&gt;GOOD&lt;/a&gt;, &lt;a href=&quot;http://www.huffingtonpost.com/ben-jervey&quot;&gt;HuffPo Green&lt;/a&gt;, and his own &lt;a href=&quot;http://sustainyc.com/&quot;&gt;SustainNYC&lt;/a&gt;; manages and writes for &lt;a href=&quot;http://www.onearth.org/greenlight&quot;&gt;Greenlight&lt;/a&gt;, a citizen-journalism project from NRDC’s &lt;a href=&quot;http://www.onearth.org&quot;&gt;OnEarth Magazine&lt;/a&gt;; &lt;a href=&quot;http://www.evolvist.com/&quot;&gt;co-founds start-up web enterprises&lt;/a&gt;; and &lt;a href=&quot;http://www.greenapple.northeaststandard.com/&quot;&gt;writes books&lt;/a&gt;. With an overflowing schedule like that, we’ll give him a pass for not including Brighter Planet in his carbon-offsets piece – even though he’s rocking our &lt;a href=&quot;http://350.brighterplanet.com/&quot;&gt;350 Challenge badge&lt;/a&gt; (and thus earning offsets!) on SustainNYC. ;-)&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>More Farmer-Owned Wind Power!</title>
   <link href="http://numbers.brighterplanet.com/2009/05/27/more-farmer-owned-wind-power"/>
   <updated>2009-05-27T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/05/27/more-farmer-owned-wind-power</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;We’ve added five new farmer-owned distributed wind turbines to our project portfolio! By helping fund the purchase of these turbines, Brighter Planet members are reducing emissions, contributing to a more stable electricity grid, and supporting family farms.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://maps.google.com/mapfiles/ms/micons/red.png&quot; alt=&quot;Red Marker&quot; /&gt;  New turbines&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://maps.google.com/mapfiles/ms/micons/green.png&quot; alt=&quot;Green Marker&quot; /&gt;  Original turbines&lt;/p&gt;

&lt;iframe width=&quot;450&quot; height=&quot;450&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; src=&quot;http://maps.google.com/maps/ms?ie=UTF8&amp;amp;hl=en&amp;amp;msa=0&amp;amp;msid=115166487954313047671.00046ad47be5249cbacc7&amp;amp;t=p&amp;amp;ll=46.2,-94.8&amp;amp;spn=5.181696,1.686315&amp;amp;output=embed&quot;&gt;&amp;nbsp;&lt;/iframe&gt;

</content>
 </entry>
 
 <entry>
   <title>Brighter Planet's 2009 Sustainability Report </title>
   <link href="http://numbers.brighterplanet.com/2009/05/20/brighter-planets-2009-sustainability-report"/>
   <updated>2009-05-20T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/05/20/brighter-planets-2009-sustainability-report</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a title=&quot;sustainability_report_cover2 by brighterplanet, on Flickr&quot; href=&quot;http://www.flickr.com/photos/brighterplanet/3548359731/&quot;&gt;&lt;img class=&quot;alignnone&quot; src=&quot;http://farm4.static.flickr.com/3351/3548359731_574396918a.jpg&quot; alt=&quot;sustainability_report_cover2&quot; width=&quot;500&quot; height=&quot;254&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;Brighter Planet is dedicated to engaging people in the fight against climate change. From the individual to the Fortune 500 company, we believe that all must participate vigorously in the development of a more sustainable future. The world faces unprecedented challenges in the 21st century, from global climate change and biodiversity loss to resource depletion and mounting population pressures. Never before has the need for reduced environmental impact and socially responsible corporate actions been of greater necessity. We recognize we are a small player in the business world, but nonetheless we seek to be a global leader in sustainable business practices.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;We do not believe in the either-or proposition of environmental and social benefit versus profit. In fact, we strongly believe that our initial commitment to environmental integrity and social quality was instrumental in our ability to attract talented employees, develop close relationships with climate leaders, select reputable partners, and begin to build a customer base.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;In conducting this sustainability report we are establishing a baseline for our environmental and social performance. In keeping with our core principle of transparency we will make this document public and will actively seek feedback from all of our stakeholders.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;As this report demonstrates, we still have a long way to go in reducing our impact and strengthening our social commitments. We know the challenge and pressures to live up to our sustainable principles will only grow as we grow. Nonetheless, we remain undaunted and as committed as ever to these principles. Let this report serve as our benchmark for evaluating our future performance, while helping to guide our growth.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;Please see the full color report &lt;a href=&quot;http://static.brighterplanet.com/science/Brighter_Planet-Sustainability_Report_2009.pdf&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p style=&quot;text-align: left;&quot;&gt;We welcome your comments and suggestions.&lt;/p&gt;

&lt;p style=&quot;text-align: left;&quot;&gt;Sincerely,
&lt;a href=&quot;http://brighterplanet.com/users/19/public&quot;&gt;Patti Prairie, CEO&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Making a real, permanent difference</title>
   <link href="http://numbers.brighterplanet.com/2009/04/08/making-a-real-permanent-difference"/>
   <updated>2009-04-08T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/04/08/making-a-real-permanent-difference</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;Congratulations to Brighter Planet members – you shut down a dirty, coal-fired power plant for a week!&lt;/p&gt;

&lt;p&gt;And you did it not by waving signs and shouting “No!,” but by saying “Yes!” to finding better answers to the problem of how to meet our energy, economic, and environmental needs.&lt;/p&gt;

&lt;p&gt;Your actions as Brighter Planet members as of December 31, 2008, allowed us to transfer 67,342 tons of carbon offsets to &lt;a href=&quot;http://www.cleanair-coolplanet.org/&quot;&gt;Clean Air - Cool Planet&lt;/a&gt; for retirement – roughly the equivalent of a week’s emissions from that outdated, dirty power plant.&lt;/p&gt;

&lt;p&gt;If you’re reading this and are not yet a part of our program, let me explain: Our members earn high-quality offsets with the Brighter Planet Visa credit and debit cards, and they can also buy Planet Shares to counteract their carbon emissions.&lt;/p&gt;

&lt;p&gt;How do they know they’re making a real, permanent difference? Our policies and practices of &lt;a href=&quot;http://brighterplanet.com/entries/quality_of_additionality&quot;&gt;additionality&lt;/a&gt; at the front-end, &lt;a href=&quot;http://brighterplanet.com/entries/carbon_offset_retirement&quot;&gt;retirement&lt;/a&gt; at the back end, and &lt;a href=&quot;http://blog.brighterplanet.com/category/gogreen/projects/&quot;&gt;transparency&lt;/a&gt; throughout …that’s how. We only invest in projects that meet &lt;a href=&quot;http://brighterplanet.com/policy&quot;&gt;our rigorous carbon offset policy&lt;/a&gt; and survive the expert scrutiny of our &lt;a href=&quot;http://brighterplanet.com/groups/4&quot;&gt;Project Selection Committee&lt;/a&gt;. None of our projects would have been built were it not for the prospect of incentives from the sale of offsets.&lt;/p&gt;

&lt;p&gt;Offsets are legal property rights. The rights to the 67,342 tons we transferred to Clean Air - Cool Planet come from the fifteen offset projects shown in the pie chart below. Clean Air - Cool Planet is a science-based, non-partisan non-profit dedicated solely to finding and promoting solutions to global warming. They will hold these offsets in perpetuity to ensure they can never be sold or used again. That’s how our and our members’ objective of fighting climate change by reducing net emissions is achieved.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3305/3424740650_26d777a60c.jpg&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://brighterplanet.com/users/19/public&quot;&gt;Patti&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Announcing #earthtweet</title>
   <link href="http://numbers.brighterplanet.com/2009/03/31/annoucing-earthtweet"/>
   <updated>2009-03-31T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/03/31/annoucing-earthtweet</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;&lt;img src=&quot;http://static.brighterplanet.com/creative/campaigns/earthtweet/site/images/badge.png&quot; align=&quot;left&quot; style=&quot;padding: 10px;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We just launched &lt;a href=&quot;http://earthtweet.com&quot;&gt;#earthtweet&lt;/a&gt;, a campaign to raise awareness of the fight against climate change in the days leading up to Earth Day (April 22) – and beyond.&lt;/p&gt;

&lt;p&gt;Here’s the idea: #earthtweet uses Twitter – the booming social network of the moment – to bring together tips, news, information about events, and anything else that’s relevant to solving our climate problem. (Yeah, most of us here at Brighter Planet have caught the Twitter bug – it’s the most useful, vibrant, and fun social network we’ve seen to date.)&lt;/p&gt;

&lt;p&gt;If you’re already on Twitter, all you have to do is tell us what you are doing – today – for the planet. Just make sure to use the tag #earthtweet somewhere in each item you’re sharing on Twitter, so everyone else can find it. We’ll also be giving away some eco-friendly prizes throughout the campaign, so follow &lt;a href=&quot;http://twitter.com/earthtweet&quot;&gt;@earthtweet&lt;/a&gt; to stay posted.&lt;/p&gt;

&lt;p&gt;If you’re not yet among the converted, this is a perfect opportunity to give Twitter a try. Twitter is like CB radio, but for text messaging – it’s a great way to stay connected to friends, family, and as many other people as you like. &lt;a href=&quot;http://twitter.com&quot;&gt;Sign up&lt;/a&gt; and then you can “follow” &lt;a href=&quot;http://twitter.com/earthtweet&quot;&gt;@earthtweet&lt;/a&gt; and &lt;a href=&quot;http://twitter.com/brighterplanet&quot;&gt;@brighterplanet&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;In the last few months we’ve seen people achieve amazing things through collective effort on Twitter. Some examples:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Two months ago, a group called &lt;a href=&quot;http://www.charitywater.org/&quot;&gt;charity: water&lt;/a&gt; issued through Twitter a call for help raising awareness and funds to bring clean drinking water to some of the poorest people in the world. The twitter community responded, &lt;a href=&quot;http://www.twestival.com/&quot;&gt;organizing fundraisers in more than 200 cities around the world&lt;/a&gt; and raising a quarter million dollars for the cause.&lt;/li&gt;
  &lt;li&gt;Last Christmas, a TVA coal-burning power plant spilled millions of gallons of toxic coal ash into an East Tennessee river. Advocates on the ground – with support from Twitter folks all over the country – used Twitter to report on the immense scale of the disaster. &lt;a href=&quot;http://www.mnn.com/technology/computers/stories/media-mayhem-can-twitter-save-the-earth&quot;&gt;The buzz grew loud enough that the sluggish national media finally began to cover the story&lt;/a&gt;; since then, the Obama administration has made clean-up of thousands of dangerous coal-ash ponds all over the nation part of its agenda.&lt;/li&gt;
  &lt;li&gt;PowerShift09 organizers and attendees &lt;a href=&quot;http://powershift09.org/node/894&quot;&gt;used Twitter to serve notice that young people are energized and out in force&lt;/a&gt;, working to drive the nation toward a clean energy economy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Well, we want some of that action! We really hope that #earthtweet can make some noise about doing one’s part to solve the climate problem. It’s really up to all of you – #earthtweet will go exactly as far as you take it.&lt;/p&gt;

&lt;p&gt;Have a ball with it. You’ll find badges, a widget, and temporary Twitter avatars available at &lt;a href=&quot;http://earthtweet.com&quot;&gt;http://earthtweet.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;-Ian W.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Carbon Offsets Survey Results</title>
   <link href="http://numbers.brighterplanet.com/2009/02/06/survey-says"/>
   <updated>2009-02-06T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/02/06/survey-says</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;!--[if !mso]&gt;
&lt;mce:style&gt;&lt;!  v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} --&gt;

&lt;!--[endif]--&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;!--[if !mso]&gt; &lt;mce:style&gt;&lt;!  v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} --&gt; &lt;!--[endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt; &lt;w:WordDocument&gt; &lt;w:View&gt;Normal&lt;/w:View&gt; &lt;w:Zoom&gt;0&lt;/w:Zoom&gt; &lt;w:PunctuationKerning /&gt; &lt;w:ValidateAgainstSchemas /&gt; &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt; &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt; &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt; &lt;w:Compatibility&gt; &lt;w:BreakWrappedTables /&gt; &lt;w:SnapToGridInCell /&gt; &lt;w:WrapTextWithPunct /&gt; &lt;w:UseAsianBreakRules /&gt; &lt;w:DontGrowAutofit /&gt; &lt;/w:Compatibility&gt; &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt; &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt; &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt; &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt;&lt;!--[if gte mso 10]&gt; &lt;mce:style&gt;&lt;!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Table Normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} --&gt; &lt;!--[endif]--&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;With our inaugural year under our belt, we did a customer survey.  Respondents split almost evenly between male and female, with 55% under the age of 35.&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;Our online community has continued to grow through our social media campaigns.&lt;span&gt; &lt;/span&gt;We asked customers about how they use the web: almost everyone uses Google, 3 out of 4 use Facebook, and while most people had heard of Twitter, only 20% use it.&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;Top answers to &#39;rate the following factors in your decision to take steps at Brighter Planet&#39; were combating climate change, offsetting my carbon footprint, investing in community-based climate solutions, and trustworthiness of Brighter Planet.&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a title=&quot;Greenness by brighterplanet, on Flickr&quot; href=&quot;http://www.flickr.com/photos/brighterplanet/3258619138/&quot;&gt;&lt;img class=&quot;aligncenter&quot; src=&quot;http://farm4.static.flickr.com/3536/3258619138_6556640cb0.jpg&quot; alt=&quot;Greenness&quot; width=&quot;500&quot; height=&quot;340&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot; align=&quot;center&quot;&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype  id=&quot;_x0000_t75&quot; coordsize=&quot;21600,21600&quot; o:spt=&quot;75&quot; o:preferrelative=&quot;t&quot;  path=&quot;m@4@5l@4@11@9@11@9@5xe&quot; filled=&quot;f&quot; stroked=&quot;f&quot;&gt; &lt;v:stroke joinstyle=&quot;miter&quot; /&gt; &lt;v:formulas&gt; &lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot; /&gt; &lt;v:f eqn=&quot;sum @0 1 0&quot; /&gt; &lt;v:f eqn=&quot;sum 0 0 @1&quot; /&gt; &lt;v:f eqn=&quot;prod @2 1 2&quot; /&gt; &lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot; /&gt; &lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot; /&gt; &lt;v:f eqn=&quot;sum @0 0 1&quot; /&gt; &lt;v:f eqn=&quot;prod @6 1 2&quot; /&gt; &lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot; /&gt; &lt;v:f eqn=&quot;sum @8 21600 0&quot; /&gt; &lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot; /&gt; &lt;v:f eqn=&quot;sum @10 21600 0&quot; /&gt; &lt;/v:formulas&gt; &lt;v:path o:extrusionok=&quot;f&quot; gradientshapeok=&quot;t&quot; o:connecttype=&quot;rect&quot; /&gt; &lt;o:lock v:ext=&quot;edit&quot; aspectratio=&quot;t&quot; /&gt; &lt;/v:shapetype&gt;&lt;v:shape id=&quot;_x0000_i1025&quot; type=&quot;#_x0000_t75&quot; style=&#39;width:306.75pt;  height:210pt&#39;&gt; &lt;v:imagedata src=&quot;file:///C:\tmp\msohtml1\01\clip_image001.emz&quot; mce_src=&quot;file:///C:\tmp\msohtml1\01\clip_image001.emz&quot; o:title=&quot;&quot; /&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;!--[endif]--&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;When asked &quot;how green do you consider yourself,&quot; 3 out of 4 responded that they embrace sustainability in their daily life and recycle, walk, take public transportation, and use CFLs.  Less than a quarter live the greenest lifestyle, defined as driving a hybrid car, composting, and buying local.  The remainder consider themselves light green and do a little but are not focused on it.&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;What was most important in evaluating offset projects?&lt;span&gt; &lt;/span&gt;Benefits to public health and water quality were highest.  A close second was verification by an independent third party.  Rated less important were diversity of project types and additionality of offsets produced. &lt;span&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;Answers to &#39;rate offset projects from high to low interest&#39; yielded wind turbines and solar* installation projects tied for the top ranked spot.&lt;span&gt; &lt;/span&gt;Almost three quarters of respondents prefer offsets from certified international wind projects to uncertified domestic projects.&lt;/p&gt;

&lt;p&gt;&lt;span&gt; &lt;/span&gt;
&amp;lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&amp;gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id=&quot;_x0000_i1026&quot; type=&quot;#_x0000_t75&quot;  style=&#39;width:378pt;height:258pt&#39;&gt; &lt;v:imagedata src=&quot;file:///C:\tmp\msohtml1\01\clip_image003.emz&quot; mce_src=&quot;file:///C:\tmp\msohtml1\01\clip_image003.emz&quot; o:title=&quot;&quot; /&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;!--[endif]--&gt;&amp;lt;/p&amp;gt;
&amp;lt;p class=&quot;MsoNormal&quot;&amp;gt;Thanks to everyone who took the time to fill out our survey.&lt;span&gt; &lt;/span&gt;Your feedback helps us improve our business.&lt;span&gt; &lt;/span&gt;&amp;lt;/p&amp;gt;
&amp;lt;p class=&quot;MsoNormal&quot;&amp;gt;*While we are highly interested in solar offset projects, solar is priced at a 50% + premium and would not currently be a cost-effective addition to our portfolio.&amp;lt;/p&amp;gt;
&amp;lt;p class=&quot;MsoNormal&quot;&amp;gt;-The Brighter Planet team&amp;lt;/p&amp;gt;
&amp;lt;p class=&quot;MsoNormal&quot;&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot; align=&quot;center&quot;&amp;gt;&lt;!--[if gte vml 1]&gt;&lt;v:shapetype  id=&quot;_x0000_t75&quot; coordsize=&quot;21600,21600&quot; o:spt=&quot;75&quot; o:preferrelative=&quot;t&quot;  path=&quot;m@4@5l@4@11@9@11@9@5xe&quot; filled=&quot;f&quot; stroked=&quot;f&quot;&gt; &lt;v:stroke joinstyle=&quot;miter&quot; /&gt; &lt;v:formulas&gt; &lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot; /&gt; &lt;v:f eqn=&quot;sum @0 1 0&quot; /&gt; &lt;v:f eqn=&quot;sum 0 0 @1&quot; /&gt; &lt;v:f eqn=&quot;prod @2 1 2&quot; /&gt; &lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot; /&gt; &lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot; /&gt; &lt;v:f eqn=&quot;sum @0 0 1&quot; /&gt; &lt;v:f eqn=&quot;prod @6 1 2&quot; /&gt; &lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot; /&gt; &lt;v:f eqn=&quot;sum @8 21600 0&quot; /&gt; &lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot; /&gt; &lt;v:f eqn=&quot;sum @10 21600 0&quot; /&gt; &lt;/v:formulas&gt; &lt;v:path o:extrusionok=&quot;f&quot; gradientshapeok=&quot;t&quot; o:connecttype=&quot;rect&quot; /&gt; &lt;o:lock v:ext=&quot;edit&quot; aspectratio=&quot;t&quot; /&gt; &lt;/v:shapetype&gt;&lt;v:shape id=&quot;_x0000_i1025&quot; type=&quot;#_x0000_t75&quot; style=&#39;width:306.75pt;  height:210pt&#39;&gt; &lt;v:imagedata src=&quot;file:///C:\tmp\msohtml1\01\clip_image001.emz&quot; mce_src=&quot;file:///C:\tmp\msohtml1\01\clip_image001.emz&quot; o:title=&quot;&quot; /&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;!--[endif]--&gt;&amp;lt;/p&amp;gt;
&amp;lt;p class=&quot;MsoNormal&quot;&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>New Year, New Offset Policy</title>
   <link href="http://numbers.brighterplanet.com/2009/01/07/new-year-new-offset-policy"/>
   <updated>2009-01-07T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2009/01/07/new-year-new-offset-policy</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;As we kick off 2009, we’d like to introduce you to our new carbon offset policy. As with most new models, you’ll find that little has changed from our &lt;a href=&quot;http://brighterplanet.com/policy&quot;&gt;current PANTS policy&lt;/a&gt;. But the start of a new year, our second since launching, seemed a good time to pause, reflect, and distill our experience into an update of what constitutes a quality carbon offset.&lt;/p&gt;

&lt;p&gt;The result of that process is RATE:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Real offsets are permanent emissions reductions that are properly quantified, audited, and retired. Brighter Planet offsets cannot be invalidated by future events, are tracked and accounted for, and are not double-sold or double-counted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A project that is additional would not have been built were it not for the prospect of receiving proceeds from the sale of offsets. Brighter Planet will not invest in projects that would have occurred anyway, as they produce no extra reduction in emissions and therefore do not produce bona fide carbon offsets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transparent&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Complete transparency throughout the offset lifecycle is essential, given the inherent intangibility of carbon offsets and the absence of regulation in the voluntary market. Brighter Planet’s process includes a public comment period for projects under consideration, disclosure of our Project Selection Committee’s decisions, posting of project documents online, and an annual audit of sales and retirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Environmental and Social Value Added&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Projects with environmental and social value added fight climate change while also helping solve other pressing challenges facing our communities and ecosystems. Brighter Planet invests in community-based climate solutions that also address issues like public health, biodiversity, poverty, and water quality.&lt;/p&gt;

&lt;p&gt;RATE is what our &lt;a href=&quot;http://brighterplanet.com/groups/4&quot;&gt;Project Selection Committee&lt;/a&gt; will use to evaluate new offset projects being considered for inclusion in our portfolio. We like it, but we also want to know what you think. Please let us know by commenting below.&lt;/p&gt;

&lt;p&gt;To see PANTS and RATE side by side, along with an explanation of our changes, &lt;a href=&quot;http://blog.brighterplanet.com/2009/01/07/new-year-new-offset-policy/2/&quot;&gt;click here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

&lt;p&gt;–The Brighter Planet Team&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Bank of Americaâs environmental commitments</title>
   <link href="http://numbers.brighterplanet.com/2008/12/08/bank-of-americas-environmental-commitments"/>
   <updated>2008-12-08T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2008/12/08/bank-of-americas-environmental-commitments</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;We’re glad to see that Bank of America, our partner for the Brighter Planet Visa, has taken some significant steps to become even more environmentally responsible.&lt;/p&gt;

&lt;p&gt;They’ve recently announced that they will:&lt;/p&gt;

&lt;p&gt;1) phase out loans to companies that do mountaintop removal for coal production. (&lt;a href=&quot;http://environment.bankofamerica.com/articles/Energy/COAL_POLICY.pdf&quot;&gt;BoA Coal Policy&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;2) give $1 million to the &lt;a href=&quot;http://www.environment.harvard.edu/index.htm&quot;&gt;Harvard Center for the Environment&lt;/a&gt; for a study on capturing the greenhouse gas emissions from burning coal.&lt;/p&gt;

&lt;p&gt;3) continue to adopt the Carbon Principles. These are guidelines about the risks of investing in greenhouse gas emitting- public utility projects like coal plants.&lt;/p&gt;

&lt;p&gt;In the bigger picture, Bank of America has made a broad environmental commitment of $20 billion over the next ten-years. The money will be used to advance sustainability across the board– in its operations, through its lending and investing, and in new products and services.&lt;/p&gt;

&lt;p&gt;There’s room for eco-improvement in nearly every organization, but these are important steps for BoA and we at Brighter Planet applaud their efforts.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Carbon Offsets for Agents of Change</title>
   <link href="http://numbers.brighterplanet.com/2008/12/01/carbon-offsets-for-agents-of-change"/>
   <updated>2008-12-01T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2008/12/01/carbon-offsets-for-agents-of-change</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;Today is an important day as almost 11,000 participants gather in Poznań, Poland to talk about climate change. The &lt;a href=&quot;http://unfccc.int/meetings/cop_14/items/4481.php &quot;&gt;UN Climate Change Conference&lt;/a&gt; will go on through December 12th. These high-level talks are part of the ongoing negotiations to further enhance Kyoto Protocol agreements and to develop a post-Kyoto climate regime. The hope is that this conference will bring the participating nations one step closer to a formal agreement in December 2009.  &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://sustainus.org/&quot;&gt;SustainUS&lt;/a&gt;, the US Youth Network for Sustainable Development, sent over a delegation of US-based student leaders who will be involved in the sustainable development policymaking process in Poland. Brighter Planet is honored to have donated 69,138 lbs. of carbon offsets to balance out the Agents of Change delegates’ travel emissions to and from the conference. &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/brighterplanet/3073972203/&quot; title=&quot;poland_offsetting_rect.jpg by brighterplanet, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3280/3073972203_6d12ef8ce5_o.png&quot; width=&quot;500&quot; height=&quot;270&quot; alt=&quot;poland_offsetting_rect.jpg&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is an exciting opportunity for these youth to see climate policymaking in action. Offsetting the carbon emissions from their travel helps them to lead by example as they develop climate-responsible policy recommendations. We’re looking forward to hearing how things go in Poland!  &lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Drumroll please: the Climate Matters winners</title>
   <link href="http://numbers.brighterplanet.com/2008/10/21/drumroll-please-the-climate-matters-winners"/>
   <updated>2008-10-21T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2008/10/21/drumroll-please-the-climate-matters-winners</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;Over the last three months, we’ve had the pleasure of running the &lt;span style=&quot;color: #0000ff;&quot;&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;a href=&quot;http://vimeo.com/climatematters&quot;&gt;Climate Matters&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; video contest alongside our partners at &lt;span style=&quot;color: #0000ff;&quot;&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;a href=&quot;http://www.1sky.org/&quot;&gt;1Sky&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;. Today, we’d like to announce our winners.&lt;/p&gt;

&lt;p&gt;Drum roll please…&lt;/p&gt;

&lt;p&gt;1&lt;sup&gt;st&lt;/sup&gt; Place: &lt;em&gt;Climate Matters&lt;/em&gt;, by Steven Dempsey
2&lt;sup&gt;nd&lt;/sup&gt; Place&lt;em&gt;: Ask the Children&lt;/em&gt;, by Barbara Lucas
3&lt;sup&gt;rd&lt;/sup&gt; Place: &lt;em&gt;Green To Blue&lt;/em&gt;, by Elizabeth Klein
3&lt;sup&gt;rd&lt;/sup&gt; Place: &lt;em&gt;This Lawn is Your Lawn&lt;/em&gt;, by Roger Doiron&lt;/p&gt;

&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;400&quot; height=&quot;300&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;src&quot; value=&quot;http://vimeo.com/moogaloop.swf?clip_id=2028138&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; width=&quot;400&quot; height=&quot;300&quot; src=&quot;http://vimeo.com/moogaloop.swf?clip_id=2028138&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; /&gt;&lt;/object&gt;

&lt;p&gt;&lt;a href=&quot;http://vimeo.com/2028138?pg=embed&amp;amp;sec=2028138&quot;&gt;Winning Movies from the Climate Matters Video Contest&lt;/a&gt; from &lt;a href=&quot;http://vimeo.com/brighterplanet?pg=embed&amp;amp;sec=2028138&quot;&gt;Brighter Planet&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com?pg=embed&amp;amp;sec=2028138&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can see them now on our &lt;span style=&quot;color: #0000ff;&quot;&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;a href=&quot;http://vimeo.com/climatematters&quot;&gt;channel&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;These four videos, chosen by our distinguished panel of judges, represent the best of over 100 submissions from all around the country. What we at Brighter Planet found striking about the process has been the diversity of content and perspective. It has been made evermore apparent to us that to frame climate change as a youth issue, an energy issue, an environmental issue, etc. is fundamentally flawed. These videos creatively define climate change as an overarching issue. Some paint a daunting and often terrifying picture, while others seek to provide hope and inspiration. What they make clear is that the challenge of tackling climate change is also an opportunity. They urge our next president to act forcefully for the betterment of not only our planet, but its people.&lt;/p&gt;

&lt;p&gt;So, thank you to all those who participated; thank you for your energy, emotion, for lending your voices, and faces to this issue. You help to humanize this global challenge, making it more accessible and approachable. Now the fun part; please help get the word out about these amazing videos. Check out our winners and other finalist and embed those you like on your blog, facebook or myspace page, and if you’re really feeling active, send it along to your congressional representative.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Climate Matters: Inspire Our Next President!</title>
   <link href="http://numbers.brighterplanet.com/2008/07/31/climate-matters-inspire-our-next-president"/>
   <updated>2008-07-31T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2008/07/31/climate-matters-inspire-our-next-president</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;Well folks, we’ve been waiting for this day for some time now… We’d like to announce the launch of our video contest - &lt;a href=&quot;http://vimeo.com/climatematters&quot;&gt;Climate Matters: Inspire Our Next President&lt;/a&gt;. We’ve partnered with &lt;a href=&quot;http://www.1sky.org&quot;&gt;1Sky&lt;/a&gt;, a climate change organization based in Washington DC, and &lt;a href=&quot;http://www.vimeo.com&quot;&gt;Vimeo&lt;/a&gt;, a premier video-sharing website, to make sure our leaders know why climate change must be addressed by our next president. That’s why we’re calling on Americans (that’s you!) to create a 30 or 60 second video to deliver a clear, creative and compelling message to our leaders to take bold action on climate change.&lt;/p&gt;

&lt;p&gt;Now, our message to you… What are you waiting for? Grab yourself a camera, it doesn’t have to be fancy, and ask yourself what message you want to deliver to our leaders &lt;strong&gt;right now&lt;/strong&gt;. Serious or funny, amateur or professional, we’re opening the political space for you to share that message. Upload your video on &lt;a href=&quot;http://www.vimeo.com/climatematters&quot;&gt;Vimeo’s Climate Matters website&lt;/a&gt;, and be sure to self-promote. The top ten videos will be chosen based on average views per day, so you can help your video get to the top! Winning videos will be broadcast to a central audience of over 50 million people nationwide and will be shown to our leaders in Washington.&lt;/p&gt;

&lt;p&gt;Check out the contest’s introductory video, you might see some familiar faces!&lt;/p&gt;

&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;400&quot; height=&quot;302&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;allowfullscreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot; /&gt;&lt;param name=&quot;src&quot; value=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=1382571&amp;amp;server=www.vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; width=&quot;400&quot; height=&quot;302&quot; src=&quot;http://www.vimeo.com/moogaloop.swf?clip_id=1382571&amp;amp;server=www.vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; /&gt;&lt;/object&gt;

&lt;p&gt;&lt;a href=&quot;http://www.vimeo.com/1382571?pg=embed&amp;amp;sec=1382571&quot;&gt;Climate Matters&lt;/a&gt; from &lt;a href=&quot;http://www.vimeo.com/brighterplanet?pg=embed&amp;amp;sec=1382571&quot;&gt;Brighter Planet&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com?pg=embed&amp;amp;sec=1382571&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;prizes&quot;&gt;Prizes&lt;/h3&gt;

&lt;p&gt;The top video submission will be awarded with $3000 on a preloaded Brighter Planet Visa Gift Card; 2nd Place, $1000 on a preloaded Brighter Planet Visa Gift Card; and 3rd Place, $500 on a preloaded Brighter Planet Visa Gift Card.&lt;/p&gt;

&lt;p&gt;Viewers can also enter a raffle to win a brand new Canon VIXIA HV30 HDV camcorder - next year you’ll have no excuse not to submit a film!&lt;/p&gt;

&lt;h3 id=&quot;judges&quot;&gt;Judges&lt;/h3&gt;

&lt;p&gt;We’ve got a stellar panel of judges that come from all sides of the political spectrum:&lt;/p&gt;

&lt;p&gt;• Gillian Caldwell, Campaign Director and Film Producer, 1Sky
• Leila Conners, President and Co-Founder of Tree Media, Producer/Director 11th Hour
• Nadia Conners, Creative Director and Co-Founder of Tree Media, Producer/Director 11th Hour
• Maggie Gyllenhaal, Actress, Rachel Dawes in Batman the Dark Knight
• Anya Kamenetz, author Generation Debt and Staff Writer Fast Company
• Rory Kennedy, Director and Producer, Moxie Firecracker Films
• David Jenkins, Government Affairs Director Republicans for Environmental Protection
• Tia Lessin, Director and Producer, Fahrenheit 9/11, Bowling for Columbine
• Patti Prairie, President and CEO, Brighter Planet
• Bill Stetson, film producer and environmental consultant&lt;/p&gt;

&lt;p&gt;Be sure to know the rules (the terms and conditions are on the &lt;a href=&quot;http://www.vimeo.com/climatematters&quot;&gt;contest website&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;And don’t doubt yourself for one second, because &lt;strong&gt;one video can change the world&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;-The Brighter Planet team&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>350 and still runningâ¦</title>
   <link href="http://numbers.brighterplanet.com/2008/06/17/350-and-still-running"/>
   <updated>2008-06-17T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2008/06/17/350-and-still-running</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;Well, we did it! After just three and a half weeks, we got over 350 bloggers to participate in the &lt;a href=&quot;http://350.brighterplanet.com&quot;&gt;350 Challenge&lt;/a&gt;. We’re so impressed by the way the badge spread from blog to blog, from California to Canada to Turkey … now thousands of readers from all over the world are united through this campaign!&lt;/p&gt;

&lt;p&gt;I’d like to share for a minute what 122,500 pounds offset means to us, and our vision of building renewable energy in communities across the United States. While a number can sometimes just seem like a number, 122,500 pounds becomes very real when we help families and communities to build renewable energy - to help sustain their livelihood so that they may do their part to stop the country’s addiction to coal and oil.&lt;/p&gt;

&lt;p&gt;To understand the real impact of 122,500 pounds offset, we’ve done some math for everyone. 122,500 pounds offset is like turning off all the power in DC for five minutes, it’s also like making your house off the grid for more than five years!&lt;/p&gt;

&lt;p&gt;Due to the success of this campaign, and our commitment to helping spread the word about &lt;a href=&quot;http://www.350.org&quot;&gt;350.org&lt;/a&gt; we’re going to keep the 350 Challenge going for the time being for any new people that want to post our badge. And we’ll still be donating 350 pounds in their name to &lt;a href=&quot;http://brighterplanet.com/impact&quot;&gt;our renewable energy projects&lt;/a&gt;.&lt;/p&gt;

&lt;p style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;http://350.brighterplanet.com/&quot;&gt;&lt;img src=&quot;http://350.brighterplanet.com/images/badges/BP_badge_180x201.jpg&quot; border=&quot;0&quot; alt=&quot;Brighter Planet&#39;s 350 Challenge&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Many, many thanks to everyone who participated!&lt;/p&gt;

&lt;p&gt;–&lt;a href=&quot;http://brighterplanet.com/users/22/public&quot;&gt;Emily&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Bring on the 350 Challenge!</title>
   <link href="http://numbers.brighterplanet.com/2008/05/20/bring-on-the-350-challenge"/>
   <updated>2008-05-20T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2008/05/20/bring-on-the-350-challenge</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;We’re really excited to announce the official launch of the 350 Challenge, done in association with our friends at &lt;a href=&quot;http://350.org&quot;&gt;350.org&lt;/a&gt;. The idea is simple: for every blog that posts the 350 Challenge badge, we’ll offset 350 pounds of carbon in their honor. Yep, that’s it! &lt;/p&gt;

&lt;p&gt;Our goal is to reach 350 bloggers, which will offset &lt;em&gt;122,500 pounds&lt;/em&gt; of carbon. That’s like turning off the power in Washington, DC for five minutes!&lt;/p&gt;

&lt;p&gt;Just click on the badge to get your own. And if you’ve already done it? Thank you. &lt;/p&gt;

&lt;p style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;http://350.brighterplanet.com/&quot;&gt;&lt;img src=&quot;http://350.brighterplanet.com/images/badges/BP_badge_180x201.jpg&quot; border=&quot;0&quot; alt=&quot;Brighter Planet&#39;s 350 Challenge&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Back from Birkie</title>
   <link href="http://numbers.brighterplanet.com/2008/02/26/back-from-birkie"/>
   <updated>2008-02-26T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2008/02/26/back-from-birkie</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;p&gt;We’ve just returned from the 2008 American Birkebeiner—and what a great event it was. Over 7,000 racers descended on the tiny Wisconsin towns of Cable and Hayward, to compete in the 50km Birkie.&lt;/p&gt;

&lt;p&gt;Last year, the event was cut short due to lack of snow. No problems this year, however, with a two-foot base and fast, cold snow over the whole course. The winning time, posted by Ivan Babikov of Canada, was 2 hours and seven minutes… that’s 24 km/hr over rolling hills and flat fields!&lt;/p&gt;

&lt;p&gt;Kate Whitcomb, a Brighter Planet ambassador, battled a head cold to finish fifth in the women’s Birkie. Through our event offsetting program and direct offset sales, over 48 tons of carbon dioxide were offset— supporting &lt;a href=&quot;http://brighterplanet.com/projects/farmer_owned_distributed_wind&quot;&gt;farmer-owned distributed wind projects&lt;/a&gt; in Minnesota and South Dakota.&lt;/p&gt;

&lt;p&gt;A small recycling program was started, diverting countless bags of cardboard from the landfill. These represent Brighter Planet’s first steps in our Keep Winter White campaign. We hope to return next year, to make the event even greener.&lt;/p&gt;

&lt;!-- #flickr_badge_source_txt {padding:0; font: 11px Arial, Helvetica, Sans serif; color:#666666;} #flickr_badge_icon {display:block !important; margin:0 !important; border: 1px solid rgb(0, 0, 0) !important;} #flickr_icon_td {padding:0 5px 0 0 !important;} .flickr_badge_image {text-align:center !important;} .flickr_badge_image img {border: 1px solid black !important;} #flickr_www {display:block; padding:0 10px 0 10px !important; font: 11px Arial, Helvetica, Sans serif !important; color:#3993ff !important;} #flickr_badge_uber_wrapper a:hover, #flickr_badge_uber_wrapper a:link, #flickr_badge_uber_wrapper a:active, #flickr_badge_uber_wrapper a:visited {text-decoration:none !important; background:inherit !important;color:#3993ff;} #flickr_badge_wrapper {background-color:#ffffff;border: solid 1px #000000} #flickr_badge_source {padding:0 !important; font: 11px Arial, Helvetica, Sans serif !important; color:#666666 !important;} --&gt;
&lt;table id=&quot;flickr_badge_uber_wrapper&quot; border=&quot;0&quot; cellspacing=&quot;10&quot; cellpadding=&quot;0&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a id=&quot;flickr_www&quot; onclick=&quot;window.open(this.href);return false;&quot; href=&quot;http://www.flickr.com&quot;&gt;www.&lt;strong style=&quot;color:#3993ff&quot;&gt;flick&lt;span style=&quot;color: #ff1c92;&quot;&gt;r&lt;/span&gt;&lt;/strong&gt;.com&lt;/a&gt;
&lt;table id=&quot;flickr_badge_wrapper&quot; border=&quot;0&quot; cellspacing=&quot;10&quot; cellpadding=&quot;0&quot;&gt;&lt;script src=&quot;http://www.flickr.com/badge_code_v2.gne?count=3&amp;amp;display=random&amp;amp;size=m&amp;amp;layout=v&amp;amp;source=user_set&amp;amp;user=13949611%40N08&amp;amp;set=72157603995509721&amp;amp;context=in%2Fset-72157603995509721%2F&quot; type=&quot;text/javascript&quot;&gt;&amp;nbsp;&lt;/script&gt;&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Thanks to Ned Zuelsdorff, Executive Director of the American Birkebeiner and his entire team for pulling together such a fantastic event.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Short TV piece on Brighter Planet from NECN</title>
   <link href="http://numbers.brighterplanet.com/2007/12/12/short-piece-on-brighter-planet-from-necn"/>
   <updated>2007-12-12T00:00:00+00:00</updated>
   <id>http://numbers.brighterplanet.com/2007/12/12/short-piece-on-brighter-planet-from-necn</id>
   <author>
     <name>bessie</name>
   </author>
   <content type="html">&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;425&quot; height=&quot;355&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot; /&gt;&lt;param name=&quot;src&quot; value=&quot;http://www.youtube.com/v/tghNnltvsnc&amp;amp;hl=en&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;355&quot; src=&quot;http://www.youtube.com/v/tghNnltvsnc&amp;amp;hl=en&quot; wmode=&quot;transparent&quot; /&gt;&lt;/object&gt;
</content>
 </entry>
 
 
</feed>
