<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pivotal Labs &#187; Brandon Liu</title>
	<atom:link href="http://pivotallabs.com/author/bliu/feed/" rel="self" type="application/rss+xml" />
	<link>http://pivotallabs.com</link>
	<description>Agility Developed</description>
	<lastBuildDate>Wed, 19 Jun 2013 16:27:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Access your database&#8217;s best features with Sequel</title>
		<link>http://pivotallabs.com/access-your-databases-best-features-with-sequel/</link>
		<comments>http://pivotallabs.com/access-your-databases-best-features-with-sequel/#comments</comments>
		<pubDate>Mon, 06 May 2013 06:58:53 +0000</pubDate>
		<dc:creator>Brandon Liu</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[bloggerdome]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/?p=18892</guid>
		<description><![CDATA[<p>Sequel is a wonderful library for interacting with relational databases. Some of my favorite aspects: 1. Out-of-the box support for foreign key constraints. 2. Straightforward migration DSL. 3. Support for all major free RDBMSes and even some proprietary ones. Also JRuby support through JDBC. (although JDBC doesn&#8217;t necessarily give you all the features a native driver would. Projects like jruby-pg are making progress though.) 4. &#8220;One way to do it&#8221; for common operations such as inserts and updates. Parsimonious API (compared to ActiveRecord). 5. bin/sequel executable gives you an interactive ruby session directly from a database URL. 6. Extremely powerful Dataset abstraction lets you write general query code. 7. The source code itself is a pleasure to work with and the maintainer (jeremyevans) is extremely diligent about pull requests. One feature i&#8217;d like to expand upon is the ability to call raw SQL functions from Sequel&#8217;s DSL. Here&#8217;s a migration&#8230;</p><p>The post <a href="http://pivotallabs.com/access-your-databases-best-features-with-sequel/">Access your database&#8217;s best features with Sequel</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a href="https://github.com/jeremyevans/sequel">Sequel</a> is a wonderful library for interacting with relational databases. Some of my favorite aspects:<br />
1. Out-of-the box support for foreign key constraints.<br />
2. Straightforward migration DSL.<br />
3. Support for all major free RDBMSes and even some proprietary ones. Also JRuby support through JDBC. (although JDBC doesn&#8217;t necessarily<br />
give you all the features a native driver would. Projects like <a href="https://github.com/headius/jruby-pg">jruby-pg </a>are making progress though.)<br />
4. &#8220;One way to do it&#8221; for common operations such as inserts and updates. Parsimonious API (compared to ActiveRecord).<br />
5. bin/sequel executable gives you an interactive ruby session directly from a database URL.<br />
6. Extremely powerful Dataset abstraction lets you write general query code.<br />
7. The source code itself is a pleasure to work with and the maintainer (<a href="https://github.com/jeremyevans">jeremyevans</a>) is extremely diligent about pull requests.</p>
<p>One feature i&#8217;d like to expand upon is the ability to call raw SQL functions from Sequel&#8217;s DSL.</p>
<p>Here&#8217;s a migration where I create a speeches table with some full-text search columns:</p>
<pre><code>
Sequel.migration do
  up do
    create_table :speeches do
      primary_key :id
      String :text
      String :speaker
      Integer :year
    end

    run "ALTER TABLE speeches ADD COLUMN ts_text tsvector;"
    run "CREATE INDEX ts_text_idx ON speeches USING gin(ts_text);"
    run "CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE
         ON speeches FOR EACH ROW EXECUTE PROCEDURE
         tsvector_update_trigger(ts_text, 'pg_catalog.english', text, speaker);"
  end
end
</code></pre>
<p>&nbsp;</p>
<p>And here&#8217;s some sample code to query it:</p>
<pre><code>
require 'sequel'

def search(dataset, term)
  results = dataset.select do
    [ts_headline('english',
                 :text,
                 to_tsquery('english', term),
                 'MaxFragments=2').as(headline),
     id,
     speaker]
  end
  results.filter("ts_text @@ to_tsquery('english', ?::text)", term)
end

DB = Sequel.connect('postgres://localhost/blogpost')

DB[:speeches].insert(:year =&gt; 1865, :speaker =&gt; 'President Lincoln', :text =&gt; 'Fourscore and seven years ago')
DB[:speeches].insert(:year =&gt; 1963, :speaker =&gt; 'President Kennedy', :text =&gt; 'I am a Jelly Donut')

p search(DB[:speeches], 'President').all # returns both speeches
p search(DB[:speeches].where("year &gt; ?", 1900), 'President').all # returns only the Kennedy speech
</code></pre>
<p>The search function takes in a dataset and a query term, and returns a new dataset filtered with a body or speaker name matching the query term,<br />
as well as a &#8220;headline&#8221;, or the context around the search term to display in search results. This takes full advantage of a full-text search index.</p>
<p>Sequel is also great as glue code for calling PostGIS functions. I&#8217;ve found it especially useful for DRY-ing up long sets of raw SQL queries into maintainable scripts.</p>
<p>&nbsp;</p>
<p>The post <a href="http://pivotallabs.com/access-your-databases-best-features-with-sequel/">Access your database&#8217;s best features with Sequel</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/access-your-databases-best-features-with-sequel/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Python web testing for the Ruby programmer</title>
		<link>http://pivotallabs.com/python-web-testing-for-the-ruby-programmer/</link>
		<comments>http://pivotallabs.com/python-web-testing-for-the-ruby-programmer/#comments</comments>
		<pubDate>Mon, 29 Apr 2013 05:10:53 +0000</pubDate>
		<dc:creator>Brandon Liu</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[bloggerdome]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/?p=18632</guid>
		<description><![CDATA[<p>Ruby has a couple of well-known libraries for unit testing, mocking and stubbing HTTP interactions. My typical toolset includes RSpec, WebMock and VCR. I had the chance to work on a Python project recently and did some investigation into similar libraries for Python. General testing libraries The two most popular python test libraries + runners are py.test and nose. A neat feature of py.test is that is gets by with only the builtin &#8216;assert&#8217; keyword: the test runner expands assertion failures to show exactly how the assertion failed e.g.: ===================== FAILURES ===================== _____________________ test_web _____________________ def test_web(): resp = c.get('/') &#62; assert resp.status == '404' E assert '200 OK' == '404' E - 200 OK E + 404 lib/test_snack_overflow.py:9: AssertionError ============= 1 failed in 0.24 seconds ============= One gotcha is that py.test silences stdout by default, so you&#8217;ll need to pass the -s flag to see any debugging output. Test&#8230;</p><p>The post <a href="http://pivotallabs.com/python-web-testing-for-the-ruby-programmer/">Python web testing for the Ruby programmer</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Ruby has a couple of well-known libraries for unit testing, mocking and stubbing HTTP interactions. My typical toolset includes RSpec, WebMock and VCR. I had the chance to work on a Python project recently and did some investigation into similar libraries for Python.</p>
<p><strong>General testing libraries</strong></p>
<p>The two most popular python test libraries + runners are <a title="py.test" href="http://pytest.org/">py.test</a> and <a href="https://nose.readthedocs.org/en/latest/">nose</a>. A neat feature of py.test is that is gets by with only the builtin &#8216;assert&#8217; keyword: the test runner expands assertion failures to show exactly how the assertion failed e.g.:</p>
<pre><code>===================== FAILURES =====================
_____________________ test_web _____________________

    def test_web():
      resp = c.get('/')
&gt;     assert resp.status == '404'
E     assert '200 OK' == '404'
E       - 200 OK
E       + 404

lib/test_snack_overflow.py:9: AssertionError
============= 1 failed in 0.24 seconds =============
</code></pre>
<p>One gotcha is that py.test silences stdout by default, so you&#8217;ll need to pass the -s flag to see any debugging output.</p>
<p><strong>Test doubles</strong></p>
<p>The <a href="https://pypi.python.org/pypi/mock">mock</a> library can be installed through pip for Python 2 and comes as part of the standard library of Python 3. As an example of mocking out an environment variable using a context manager:</p>
<pre><code>with mock.patch.dict('os.environ', {'APP_NAME': 'HelloWorld'}):
assert app.name = 'HelloWorld'
</code></pre>
<p>There&#8217;s also a decorator form, nice because it clearly states what modules are being mocked in your tests:</p>
<pre><code>@mock.patch('crazyservice')
def test_nationals_stats(_crazyservice):
_crazyservice.date = "2013-04-06 12:31 AM"
</code></pre>
<p>Another gotcha for newcomers to Python testing: not all methods can be replaced at runtime. A good example is stubbing DateTime.now in ruby: the equivalent monkeypatching in python raises:</p>
<blockquote><p>TypeError: can&#8217;t set attributes of built-in/extension type &#8216;datetime.datetime&#8217;</p></blockquote>
<p>as these methods cannot be replaced in CPython. You&#8217;ll need to write a wrapper function and mock that out instead in your tests.</p>
<p><strong>Web testing</strong></p>
<p>The <a href="http://werkzeug.pocoo.org/">werkzeug</a> WSGI library includes <a href="http://werkzeug.pocoo.org/docs/test/">simple utilities</a> to make request testing as easy as with rack-test. Another library I&#8217;m a big fan of is <a href="https://github.com/gabrielfalcao/HTTPretty">HTTPretty</a>, which is similar to Ruby&#8217;s WebMock or FakeWeb. Finally, Ruby&#8217;s VCR gem is invaluable for recording real HTTP interactions. A port exists on python called <a href="https://github.com/kevin1024/vcrpy">vcr.py</a>.</p>
<p>&nbsp;</p>
<p>The post <a href="http://pivotallabs.com/python-web-testing-for-the-ruby-programmer/">Python web testing for the Ruby programmer</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/python-web-testing-for-the-ruby-programmer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[SF] Standup 1/23</title>
		<link>http://pivotallabs.com/sf-standup-123/</link>
		<comments>http://pivotallabs.com/sf-standup-123/#comments</comments>
		<pubDate>Wed, 23 Jan 2013 17:13:53 +0000</pubDate>
		<dc:creator>Brandon Liu</dc:creator>
				<category><![CDATA[Standup]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/?p=11808</guid>
		<description><![CDATA[<p>Interestings Unwrapping an annotated tag in Git Annotated tags are their own &#34;objects&#34; and the sha does not point to the commit that they are tagging. In order to unwrap the tag, add ^{commit} to the original sha. This will not harm regular shas, so you can use it in scripts where you may encounter annotated tags.</p><p>The post <a href="http://pivotallabs.com/sf-standup-123/">[SF] Standup 1/23</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Interestings</h2>
<h3>Unwrapping an annotated tag in Git</h3>
<p>Annotated tags are their own &quot;objects&quot; and the sha does not point to the commit that they are tagging. In order to unwrap the tag, add <code>^{commit}</code> to the original sha. This will not harm regular shas, so you can use it in scripts where you may encounter annotated tags.</p>
<p>The post <a href="http://pivotallabs.com/sf-standup-123/">[SF] Standup 1/23</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/sf-standup-123/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[SF] Standup 1/22</title>
		<link>http://pivotallabs.com/sf-standup-122/</link>
		<comments>http://pivotallabs.com/sf-standup-122/#comments</comments>
		<pubDate>Tue, 22 Jan 2013 17:16:42 +0000</pubDate>
		<dc:creator>Brandon Liu</dc:creator>
				<category><![CDATA[Standup]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/?p=11806</guid>
		<description><![CDATA[<p>Helps How do I get sprockets to output its dependency graph? Answer: Call &#34;dependency&#34; method on an asset object. What is first step in debugging remote irb that won&#39;t startup because of missing &#34;readline&#34; dependency? Your ruby was compiled and then the readline library was deleted or moved. You probably need to recompile ruby. Likely that you have readline already, otherwise nothing would work.</p><p>The post <a href="http://pivotallabs.com/sf-standup-122/">[SF] Standup 1/22</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Helps</h2>
<h3>How do I get sprockets to output its dependency graph?</h3>
<p>Answer:</p>
<p>Call &quot;dependency&quot; method on an asset object.</p>
<h3>What is first step in debugging remote irb that won&#39;t startup because of missing &quot;readline&quot; dependency?</h3>
<p>Your ruby was compiled and then the readline library was deleted or moved. You probably need to recompile ruby. Likely that you have readline already, otherwise nothing would work.</p>
<p>The post <a href="http://pivotallabs.com/sf-standup-122/">[SF] Standup 1/22</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/sf-standup-122/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Jasmine Gem</title>
		<link>http://pivotallabs.com/new-jasmine-gem/</link>
		<comments>http://pivotallabs.com/new-jasmine-gem/#comments</comments>
		<pubDate>Fri, 03 Aug 2012 14:54:00 +0000</pubDate>
		<dc:creator>Brandon Liu</dc:creator>
				<category><![CDATA[Standup]]></category>
		<category><![CDATA[agile]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/new-jasmine-gem/</guid>
		<description><![CDATA[<p><h2>Helps</h2>

<ul>
<li>New Jasmine Gem</li>
</ul>

<p>There's a new version of jasmine-gem on GitHub - please test it out so we can push a new gem next week. </p>

<p><a href="https://github.com/pivotal/jasmine-gem">https://github.com/pivotal/jasmine-gem</a></p>

<ul>
<li>jQuery opacity</li>
</ul>

<p>Once the CSS opacity is set on an element with jQuery the z-index is no longer respected and the element appears on the bottom. </p>

<p>Leads:
Can it be reproduced in other browsers? Only tried Chrome so far.</p>

<h2>Interestings</h2>

<ul>
<li>Safari doesn't like Rails timestamps</li>
</ul>

<p>my_model.created_at or my_model.create_at.to_i spit out values that when you &#40;in JavaScript&#41; new Date&#40;value&#41;, give crazy dates in Safari.</p>

<p>The workaround is to use:</p>

<p>&#40;Ruby&#41;
value = my_model.created_at.to_f * 1000</p>

<p>&#40;JS&#41;
date = new Date&#40;value&#41;</p>

<p>Discussion:
Try all browsers when dealing with a Date API
There's also DateJS, but has not been maintained in a long time.</p>

<ul>
<li>Jasmine failed to start on latest Chrome</li>
</ul>

<p>If you have an updated version of Chrome and jasmine fails to start Chrome, reinstalling later version of chrome driver &#40;http://code.google.com/p/chromedriver/downloads/list&#41;. </p>

<p>Or alternative is to re-image the machine, which contains later Chrome and later ChromeDriver.</p>

<ul>
<li>bitbucket Tracker integration broken by '&#38;' in author name</li>
</ul>

<p>We spent several hours tracking down this &#40;open&#41; bug in bitbucket's tracker broker. You can change the ampersand to something else in your git-pair script. </p>

<ul>
<li>IE9 svg path click handler</li>
</ul>

<p>IE9's click handler for SVG paths treats two clicks as a single click and six clicks as a double click.</p> <a href="http://pivotallabs.com/new-jasmine-gem/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/new-jasmine-gem/">New Jasmine Gem</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Helps</h2>
<ul>
<li>New Jasmine Gem</li>
</ul>
<p>There&#8217;s a new version of jasmine-gem on GitHub &#8211; please test it out so we can push a new gem next week. </p>
<p><a href="https://github.com/pivotal/jasmine-gem">https://github.com/pivotal/jasmine-gem</a></p>
<ul>
<li>jQuery opacity</li>
</ul>
<p>Once the CSS opacity is set on an element with jQuery the z-index is no longer respected and the element appears on the bottom. </p>
<p>Leads:<br />
Can it be reproduced in other browsers? Only tried Chrome so far.</p>
<h2>Interestings</h2>
<ul>
<li>Safari doesn&#8217;t like Rails timestamps</li>
</ul>
<p>my_model.created_at or my_model.create_at.to_i spit out values that when you &#40;in JavaScript&#41; new Date&#40;value&#41;, give crazy dates in Safari.</p>
<p>The workaround is to use:</p>
<p>&#40;Ruby&#41;<br />
value = my_model.created_at.to_f * 1000</p>
<p>&#40;JS&#41;<br />
date = new Date&#40;value&#41;</p>
<p>Discussion:<br />
Try all browsers when dealing with a Date API<br />
There&#8217;s also DateJS, but has not been maintained in a long time.</p>
<ul>
<li>Jasmine failed to start on latest Chrome</li>
</ul>
<p>If you have an updated version of Chrome and jasmine fails to start Chrome, reinstalling later version of chrome driver &#40;http://code.google.com/p/chromedriver/downloads/list&#41;. </p>
<p>Or alternative is to re-image the machine, which contains later Chrome and later ChromeDriver.</p>
<ul>
<li>bitbucket Tracker integration broken by &#8216;&amp;&#8217; in author name</li>
</ul>
<p>We spent several hours tracking down this &#40;open&#41; bug in bitbucket&#8217;s tracker broker. You can change the ampersand to something else in your git-pair script. </p>
<ul>
<li>IE9 svg path click handler</li>
</ul>
<p>IE9&#8242;s click handler for SVG paths treats two clicks as a single click and six clicks as a double click.</p>
<p>The post <a href="http://pivotallabs.com/new-jasmine-gem/">New Jasmine Gem</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/new-jasmine-gem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Like Dreamcatcher, but for Shapes</title>
		<link>http://pivotallabs.com/like-dreamcatcher-but-for-shapes/</link>
		<comments>http://pivotallabs.com/like-dreamcatcher-but-for-shapes/#comments</comments>
		<pubDate>Wed, 01 Aug 2012 14:21:00 +0000</pubDate>
		<dc:creator>Brandon Liu</dc:creator>
				<category><![CDATA[Standup]]></category>
		<category><![CDATA[agile]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/like-dreamcatcher-but-for-shapes/</guid>
		<description><![CDATA[<p><h2>Helps</h2>

<ul>
<li>capybara-webkit save_and_open_page returns empty DOM after AJAX request</li>
</ul>

<p>Investigate:
Use page.driver.render to save a screenshot.
Look at capybara issue discussed yesterday at <a href="http://pivotallabs.com/users/abruce/blog/articles/2220-rager-party-standup-7-31-12-">http://pivotallabs.com/users/abruce/blog/articles/2220-rager-party-standup-7-31-12-</a></p>

<h2>Interestings</h2>

<ul>
<li>Shapecatcher: draw something, find the closest-matching Unicode character</li>
</ul>

<p><a href="http://shapecatcher.com/">http://shapecatcher.com/</a></p>

<p>Also of note: <a href="http://nice-entity.com/">http://nice-entity.com/</a></p>

<ul>
<li>bundle exec foreman</li>
</ul>

<p>Using bundle exec may solve some Foreman issues teams have been seeing.</p> <a href="http://pivotallabs.com/like-dreamcatcher-but-for-shapes/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/like-dreamcatcher-but-for-shapes/">Like Dreamcatcher, but for Shapes</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Helps</h2>
<ul>
<li>capybara-webkit save_and_open_page returns empty DOM after AJAX request</li>
</ul>
<p>Investigate:<br />
Use page.driver.render to save a screenshot.<br />
Look at capybara issue discussed yesterday at <a href="http://pivotallabs.com/users/abruce/blog/articles/2220-rager-party-standup-7-31-12-">http://pivotallabs.com/users/abruce/blog/articles/2220-rager-party-standup-7-31-12-</a></p>
<h2>Interestings</h2>
<ul>
<li>Shapecatcher: draw something, find the closest-matching Unicode character</li>
</ul>
<p><a href="http://shapecatcher.com/">http://shapecatcher.com/</a></p>
<p>Also of note: <a href="http://nice-entity.com/">http://nice-entity.com/</a></p>
<ul>
<li>bundle exec foreman</li>
</ul>
<p>Using bundle exec may solve some Foreman issues teams have been seeing.</p>
<p>The post <a href="http://pivotallabs.com/like-dreamcatcher-but-for-shapes/">Like Dreamcatcher, but for Shapes</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/like-dreamcatcher-but-for-shapes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SF Standup 7/30</title>
		<link>http://pivotallabs.com/standup-7-30/</link>
		<comments>http://pivotallabs.com/standup-7-30/#comments</comments>
		<pubDate>Mon, 30 Jul 2012 14:40:00 +0000</pubDate>
		<dc:creator>Brandon Liu</dc:creator>
				<category><![CDATA[Standup]]></category>
		<category><![CDATA[agile]]></category>

		<guid isPermaLink="false">http://pivotallabs.com/standup-7-30/</guid>
		<description><![CDATA[<p><h2>Helps</h2>

<ul>
<li>Apache proxy: &#40;502&#41;Unknown error 502: proxy: pass request body failed</li>
</ul>

<p>We need to make requests to a server and these requests have to come from a fixed IP address and be authenticated via SSL. For this purpose we set up a EC2 instance to function as a proxy. We can make cURL requests using our key and certificate from the proxy machine successfully. But when we go through Apache we get:
"&#40;502&#41;Unknown error 502: proxy: pass request body failed"</p>

<h2>Interestings</h2>

<ul>
<li>Backbone's views' $el contains all matched elements</li>
</ul>

<p>If you initialize a Backbone view with an <code>el</code> selector that matches more than one element: within the view <code>$el</code> will refer to a jQuery collection that contains all the matched elements, while <code>el</code> will contain the DOM object for only the first element matched. To achieve consistency, you might want to instantiate your view like so:</p>

<pre><code>new view&#40;{el: '.selector_that_matches_many:eq&#40;0&#41;'}&#41;;
</code></pre> <a href="http://pivotallabs.com/standup-7-30/">Continue reading <span class="meta-nav">&#8594;</span></a></p><p>The post <a href="http://pivotallabs.com/standup-7-30/">SF Standup 7/30</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></description>
				<content:encoded><![CDATA[<h2>Helps</h2>
<ul>
<li>Apache proxy: &#40;502&#41;Unknown error 502: proxy: pass request body failed</li>
</ul>
<p>We need to make requests to a server and these requests have to come from a fixed IP address and be authenticated via SSL. For this purpose we set up a EC2 instance to function as a proxy. We can make cURL requests using our key and certificate from the proxy machine successfully. But when we go through Apache we get:<br />
&#8220;&#40;502&#41;Unknown error 502: proxy: pass request body failed&#8221;</p>
<h2>Interestings</h2>
<ul>
<li>Backbone&#8217;s views&#8217; $el contains all matched elements</li>
</ul>
<p>If you initialize a Backbone view with an <code>el</code> selector that matches more than one element: within the view <code>$el</code> will refer to a jQuery collection that contains all the matched elements, while <code>el</code> will contain the DOM object for only the first element matched. To achieve consistency, you might want to instantiate your view like so:</p>
<pre><code>new view&#40;{el: '.selector_that_matches_many:eq&#40;0&#41;'}&#41;;
</code></pre>
<p>The post <a href="http://pivotallabs.com/standup-7-30/">SF Standup 7/30</a> appeared first on <a href="http://pivotallabs.com">Pivotal Labs</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://pivotallabs.com/standup-7-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using apc
Database Caching using apc
Object Caching 885/951 objects using apc

 Served from: pivotallabs.com @ 2013-06-19 14:42:48 by W3 Total Cache -->