<?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></title>
	<atom:link href="http://blazingcloud.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blazingcloud.net</link>
	<description></description>
	<lastBuildDate>Thu, 29 Dec 2011 00:39:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>OpenLaszlo Syntax Highlighting for MacVim/Vim</title>
		<link>http://blazingcloud.net/2011/12/28/openlaszlo-syntax-highlighting-for-macvimvim/</link>
		<comments>http://blazingcloud.net/2011/12/28/openlaszlo-syntax-highlighting-for-macvimvim/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 00:39:18 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[OpenLaszlo]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2731</guid>
		<description><![CDATA[The OpenLaszlo documentation isn&#8217;t specific about how to install syntax highlighting for vim on mac. So we thought we would write up a little blurb about how to do it! Copy the lzx.vim syntax file to dot vim directory in your home directory cp openlaszlo/trunk/tools/lzx.vim ~/.vim/syntax/ Create a file called .vimrc.local for your custom vim [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>The OpenLaszlo documentation isn&#8217;t specific about how to install syntax highlighting for vim on mac. So we thought we would write up a little blurb about how to do it!</p>
<p>Copy the <a href="http://svn.openlaszlo.org/openlaszlo/trunk/tools/lzx.vim">lzx.vim syntax file</a> to dot vim directory in your home directory<br />
<code>cp openlaszlo/trunk/tools/lzx.vim ~/.vim/syntax/</code></p>
<p>Create a file called .vimrc.local for your custom vim modifications also in your home directory<br />
<code>mvim ~/.vimrc.local</code></p>
<p>Finally, add an autocommand that will auto detect the file type<br />
<code>au BufRead,BufNewFile *.lzx set ft=lzx</code></p>
<p>Reference:<br />
For more information about vim file types you might want to check out <a href="http://vimdoc.sourceforge.net/htmldoc/filetype.html">http://vimdoc.sourceforge.net/htmldoc/filetype.html</a></p>
<p>OpenLaszlo documentation on how to install Vim Syntax highlighting on linux based systems<br />
<a href="http://wiki.openlaszlo.org/Editing_LZX#Installing_VIM_Syntax_Highlighting">http://wiki.openlaszlo.org/Editing_LZX#Installing_VIM_Syntax_Highlighting</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blazingcloud.net/2011/12/28/openlaszlo-syntax-highlighting-for-macvimvim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sprint vs AT&amp;T vs Verizon iPhone Speed Test</title>
		<link>http://blazingcloud.net/2011/10/27/sprint-vs-att-vs-verizon-iphone-speed-test/</link>
		<comments>http://blazingcloud.net/2011/10/27/sprint-vs-att-vs-verizon-iphone-speed-test/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 20:04:16 +0000</pubDate>
		<dc:creator>bill</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2621</guid>
		<description><![CDATA[In the not so distant past, iPhone users had limited options when it came to their choice of cell providers. Until Verizon received the iPhone 4 in February 2011, AT&#038;T was the only contender in the iPhone market. With the recent release of the iPhone 4S on Sprint, consumers now have another option, but each [...]]]></description>
			<content:encoded><![CDATA[<p>In the not so distant past, iPhone users had limited options when it came to their choice of cell providers. Until Verizon received the iPhone 4 in February 2011, AT&#038;T was the only contender in the iPhone market. With the recent release of the iPhone 4S on Sprint, consumers now have another option, but each option comes with trade-offs.</p>
<p>We at Blazing Cloud are excited by the new iPhone 4S; however, we&#8217;ve found the decision on which provider to choose to be challenging. Many of us currently have AT&#038;T, and consequently can&#8217;t make a reliable call or receive data in the office while off wi-fi. With the initial excitement around the iPhone 4S on Sprint, we ordered a few devices and signed up for a group plan.</p>
<p>When a late lunch led to missing the delivery of our devices, some of the more eager employees at Blazing Cloud took off in a mad dash towards what they suspected was our UPS truck. Luckily they caught the right UPS carrier at the right time and returned with our new iPhone 4Ss. After trying out just about every appropriate and in-appropriate combination of phrases with Siri, we got into more day-to-day use and discovered what many others were discovering&#8211; slow data speeds.</p>
<p>After a week of poor voice calls on Sprint, we decided to take a methodical approach to comparing the providers. To conduct a test of data speeds, we took a Verizon iPhone 4S, Sprint iPhone 4S, and an AT&#038;T 4 around town to test popular locations. We&#8217;ll update this post when we get ahold of an AT&#038;T iPhone 4S since speeds should be higher with the new device.</p>
<p>We found that even with the slower iPhone 4, AT&#038;T blew Verizon and Sprint out of the water. We ran a speed test using the mobile <a href="http://itunes.apple.com/us/app/speedtest.net-mobile-speed/id300704847?mt=8">Speedtest.net app</a> which is free on iTunes.</p>
<p><center><br />
<img src="https://img.skitch.com/20111026-qui621meikkacp2krwqfaj1nxi.png" alt="" width ="160px" height ="240px"/><img src="https://img.skitch.com/20111026-riq11dnjnk3tyufehnc7fquhtk.jpg" alt="" width ="160px" height ="240px" /><img src="https://img.skitch.com/20111026-xpgakm3a21muiuy174ubb5q6j3.jpg" alt="" width ="160px" height ="240px"/><br />
</center></p>
<p>Japan Town:<br />
Sprint 4S: .26 Mbps<br />
Verizon 4S: .16 Mbps<br />
<strong>AT&#038;T 4: 3.39 Mbps</strong></p>
<p>Union Square:<br />
Sprint 4S: 1.08 Mbps<br />
Verizon 4S: .46 Mbps<br />
<strong>AT&#038;T 4: 2.77 Mbps</strong></p>
<p>Powell and Market:<br />
Sprint 4S: .41 Mbps<br />
Verizon 4S: 1.09 Mbps<br />
<strong>AT&#038;T 4: 3.85 Mbps </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blazingcloud.net/2011/10/27/sprint-vs-att-vs-verizon-iphone-speed-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lauren Ipsum: CS Fiction for Kids</title>
		<link>http://blazingcloud.net/2011/10/10/lauren-ipsum-cs-fiction-for-kids/</link>
		<comments>http://blazingcloud.net/2011/10/10/lauren-ipsum-cs-fiction-for-kids/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 14:14:35 +0000</pubDate>
		<dc:creator>sarah</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2594</guid>
		<description><![CDATA[We just backed the Lauren Ipsum project on KickStarter. This children&#8217;s story is an adventure through computer science concepts. The main character, Lauren Ipsum, meets a Wandering Salesman in the first chapter who is finding his way home using the algorithm of that name. It&#8217;ll be interesting to read the rest of the book and [...]]]></description>
			<content:encoded><![CDATA[<p>We just backed the <a href="http://www.kickstarter.com/projects/512752850/lauren-ipsum-computer-science-for-kids">Lauren Ipsum project</a> on KickStarter.  <iframe align="right" frameborder="0" scrolling="no" height="380px" src="http://www.kickstarter.com/projects/512752850/lauren-ipsum-computer-science-for-kids/widget/card.html" width="220px"></iframe></p>
<p>This children&#8217;s story is an adventure through computer science concepts. The main character, Lauren Ipsum, meets a Wandering Salesman in the first chapter who is finding his way home using the algorithm of that name. It&#8217;ll be interesting to read the rest of the book and to see whether it can inspire children to think about algorithms and data from a fun perspective without introducing them as computing concepts.</p>
<p>Pledges on KickStarter go towards translating the book into Spanish, Portuguese, and other languages. This is pretty awesome, since much of software development lingo is taken from English, it is great to evangelize learning computer science concepts in kids&#8217; native languages.  </p>
<p>We applaud this effort and look forward to hanging one of the book&#8217;s illustrations in our office after the completion of the project.</p>
<p>Even though they have already met their goal, more funding will enable translation in more languages.  </p>
<p>Learn more about <a href="http://www.kickstarter.com/projects/512752850/lauren-ipsum-computer-science-for-kids">Lauren Ipsum on KickStarter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blazingcloud.net/2011/10/10/lauren-ipsum-cs-fiction-for-kids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Udemy Class: JavaScript for Programmers</title>
		<link>http://blazingcloud.net/2011/10/07/udemy-class-javascript-for-programmers/</link>
		<comments>http://blazingcloud.net/2011/10/07/udemy-class-javascript-for-programmers/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 23:07:12 +0000</pubDate>
		<dc:creator>tabitha</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2592</guid>
		<description><![CDATA[Programmers today are seeking a disciplined approach to learning JavaScript as a language, but there are surprisingly few web resources that provide in depth training options. Udemy is an online academy that enables anyone to teach and learn online. Its goal is to &#8220;democratize online education by making it fast, easy and free to create [...]]]></description>
			<content:encoded><![CDATA[<p>Programmers today are seeking a disciplined approach to learning     JavaScript as a language, but there are surprisingly few web  resources that provide in depth training options.</p>
<p>Udemy is an online academy that enables anyone to teach and learn     online. Its goal is to &#8220;democratize online education by making it fast, easy and free to create online courses.&#8221; Courses are wide-ranging in subject, but the most exciting for us are the tech training programs. Blazing Cloud has just announced its first JavaScript course through Udemy: <a href="http://ude.my/qCkIRF">Javascript for Programmers:  Behavior Driven Development. </a></p>
<p>Blazing Cloud also offers <a href="http://staging.blazingcloud.net/training/">in person programming classes</a> at several locations in San Francisco. Upcoming classes include a six week <a href="http://www.eventbrite.com/event/2012057117">CoffeeScript class</a>, taught by Curtis Schofield, instructor for the Udemy JavaScript class.</p>
]]></content:encoded>
			<wfw:commentRss>http://blazingcloud.net/2011/10/07/udemy-class-javascript-for-programmers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I got an external service to talk to my local Rails server</title>
		<link>http://blazingcloud.net/2011/09/27/how-i-got-an-external-service-to-talk-to-my-local-rails-server/</link>
		<comments>http://blazingcloud.net/2011/09/27/how-i-got-an-external-service-to-talk-to-my-local-rails-server/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 22:59:36 +0000</pubDate>
		<dc:creator>pablokang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2526</guid>
		<description><![CDATA[We&#8217;re currently on a project where we had to integrate Twilio. One of the services Twilio provides is a way for clients to call a phone number that reroutes back to your web application for further instructions. When I first got started, the first challenge was figuring out how to develop with Twilio and get [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re currently on a project where we had to integrate <a title="Twilio" href="http://www.twilio.com">Twilio</a>. One of the services Twilio provides is a way for clients to call a phone number that reroutes back to your web application for further instructions. When I first got started, the first challenge was figuring out how to develop with Twilio and get it to talk back to my local development Rails server.</p>
<p>The first solution I went with was <a title="Localtunnel" href="http://progrium.com/localtunnel/">Localtunnel</a>. It was pretty easy to install the gem and run it. You basically call:</p>
<pre style="padding-left: 30px;">$ localtunnel 3000</pre>
<p>Then Localtunnel provides an external URL you can insert for your callback URLs in your Twilio account.</p>
<pre style="padding-left: 30px;">$ localtunnel 3000
Port 3000 is now accessible from http://8bv2.localtunnel.com ...</pre>
<p>This was pretty cool, except for the bit where I had to constantly update the callback URL on my Twilio account every time I restarted Localtunnel. I had to find a better way.</p>
<p>The solution I settled on was remote SSH port forwarding. I had originally gone down this path but the part that had tripped me up was that by default, remote port forwarding is disabled. To enable it, you have add the following line on the forwarding server&#8217;s <strong>/etc/ssh/sshd_config</strong> file:</p>
<pre style="padding-left: 30px;">GatewayPorts yes</pre>
<p>Once you make the change and restart sshd, you can run the remote port forwarding command:</p>
<pre style="padding-left: 30px;">ssh -R 3333:localhost:3000 external.host.com</pre>
<p>What this means is that the local process on port 3000 (Rails) can be accessed via port 3333 on the port forwarding server&#8217;s address. That is, <em>http://external.host.com:3333</em> is &#8220;rerouted&#8221; to <em>http://localhost:3000</em>.</p>
<p>Here&#8217;s a simple diagram explaining how the whole thing works (local port 8080, remote port 8888).</p>
<p><img class="aligncenter" title="remote ssh port forwarding" src="http://www.gliffy.com/pubdoc/2941072/L.png" alt="remote ssh port forwarding" width="485" height="576" /></p>
<p>Related resources you may find useful:</p>
<div style="padding-left: 30px;"><a title="http://www.snailbook.com/faq/gatewayports.auto.html" href="http://www.snailbook.com/faq/gatewayports.auto.html">http://www.snailbook.com/faq/gatewayports.auto.html</a></div>
<div id="_mcePaste" style="padding-left: 30px;"><a title="http://www.debianadmin.com/howto-use-ssh-local-and-remote-port-forwarding.html" href="http://www.debianadmin.com/howto-use-ssh-local-and-remote-port-forwarding.html">http://www.debianadmin.com/howto-use-ssh-local-and-remote-port-forwarding.html</a></div>
<p>That&#8217;s all folks!</p>
]]></content:encoded>
			<wfw:commentRss>http://blazingcloud.net/2011/09/27/how-i-got-an-external-service-to-talk-to-my-local-rails-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Lean UX</title>
		<link>http://blazingcloud.net/2011/08/14/mobile-lean-ux/</link>
		<comments>http://blazingcloud.net/2011/08/14/mobile-lean-ux/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 18:56:51 +0000</pubDate>
		<dc:creator>sarah</dc:creator>
				<category><![CDATA[Lean Startup]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2431</guid>
		<description><![CDATA[Agile development is an ideal way to create production software, but how do we apply agile methodologies to the design of the user experience? User experience design benefits from a holistic approach and if we aren&#8217;t careful, doing iterative development can result in a disjointed and confusing user experience or expensive re-designs. I gave a [...]]]></description>
			<content:encoded><![CDATA[<p>Agile development is an ideal way to create production software, but how do we apply agile methodologies to the design of the user experience?  User experience design benefits from a holistic approach and if we aren&#8217;t careful, doing iterative development can result in a disjointed and confusing user experience or expensive re-designs.  I gave a talk last week at <a href="http://founderlabs.org/">Founder Labs</a> about how to apply agile and &#8220;lean startup&#8221; to the definition of the user experience. I shared some details about tools that can be used for both prototyping and building production software and talked about how to choose between developing for the mobile web, native apps or taking a hybrid approach.</p>
<p>Here are the slides from my talk at Founder Labs:</p>
<div style="width:425px" id="__ss_8848451"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/blazingcloud/mobile-lean-ux" title="Mobile Lean UX" target="_blank">Mobile Lean UX</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8848451" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more presentations from <a href="http://www.slideshare.net/blazingcloud" target="_blank">Blazing Cloud</a> </div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blazingcloud.net/2011/08/14/mobile-lean-ux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rack for Easy HTTP redirect</title>
		<link>http://blazingcloud.net/2011/08/04/rack-for-easy-http-redirect/</link>
		<comments>http://blazingcloud.net/2011/08/04/rack-for-easy-http-redirect/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 18:05:15 +0000</pubDate>
		<dc:creator>sarah</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2419</guid>
		<description><![CDATA[We recently moved our class sign-up to EventBrite.  It used to be hosted on heroku with the subdomain classes.blazingcloud.net.  However, when we changed our DNS to direct to eventbrite, it didn&#8217;t end up targetting our eventbrite subdomain: blazingcloud.eventbrite.com &#8212; hitting the EventBrite homepage instead.  Rack to the rescue! We set up another Heroku app with [...]]]></description>
			<content:encoded><![CDATA[<p>We recently moved our <a href="http://blazingcloud.eventbrite.com/">class sign-up</a> to EventBrite.  It used to be hosted on heroku with the subdomain <a href="http://classes.blazingcloud.net/">classes.blazingcloud.net</a>.  However, when we changed our DNS to direct to eventbrite, it didn&#8217;t end up targetting our eventbrite subdomain: <a href="http://blazingcloud.eventbrite.com/">blazingcloud.eventbrite.com</a> &#8212; hitting the EventBrite homepage instead.  Rack to the rescue!</p>
<p>We set up another Heroku app with just a one-line rack application.  All it needed was a rackup config file, called &#8220;config.ru&#8221; with the following line:</p>
<pre>
run Proc.new { [ 302, {'Location'=> 'http://blazingcloud.eventbrite.com' }, [] ] }
</pre>
<p>and voila! It does a simple re-direct to the new site.</p>
]]></content:encoded>
			<wfw:commentRss>http://blazingcloud.net/2011/08/04/rack-for-easy-http-redirect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>remarkable validations for rails 3</title>
		<link>http://blazingcloud.net/2011/07/21/remarkable-validations-for-rails-3/</link>
		<comments>http://blazingcloud.net/2011/07/21/remarkable-validations-for-rails-3/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 17:26:21 +0000</pubDate>
		<dc:creator>sarah</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2390</guid>
		<description><![CDATA[I&#8217;ve been working on upgrading an app from Rails 2.3.11 to Rails 3.1.  It was using the old rspec-on-rails-matchers plugin to get validators like: it 'verifies that login is between 3 and 40 characters' do User.new.should validate_length_of(:login, :within =&#62; 3..40) end I like that validation syntax, but lately when I see a plugins, I worry [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on upgrading an app from Rails 2.3.11 to Rails 3.1.  It was using the old rspec-on-rails-matchers plugin to get validators like:</p>
<pre class="brush: plain; title: ;">
it 'verifies that login is between 3 and 40 characters' do
   User.new.should validate_length_of(:login, :within =&gt; 3..40)
end
</pre>
<p>I like that validation syntax, but lately when I see a plugins, I worry that I&#8217;m in for some archaeology.  I did find a replacement gem, but it didn&#8217;t work on first try, so I read up on my options.  I briefly considered shoulda, which is now compatible with rspec, but I settled on <a href="https://github.com/remarkable/remarkable">remarkable</a> because it seems to match the syntax already in use.  I wrote a little test <a href="https://github.com/blazingcloud/remarkable_example">rails app with a couple of models</a> and was pleased the results.  </p>
<h2>Setup</h2>
<pre class="brush: plain; title: ;">
rails new remarkable_app -T&quot;
cd remarkable_app
</pre>
<p>add to Gemfile:</p>
<pre class="brush: plain; title: ;">
    group :development, :test do
      gem &quot;rspec&quot;, &quot;2.6.0&quot;
      gem &quot;rspec-rails&quot;, &quot;2.6.1&quot;
      gem &quot;remarkable_activerecord&quot;, &quot;4.0.0.alpha4&quot;
    end
</pre>
<p>Then back on the command line, set up rspec:</p>
<pre class="brush: plain; title: ;">
rails g rspec:install
</pre>
<p>edit spec/spec_helper.rb to include (after require &#8216;rspec/rails&#8217;):</p>
<pre class="brush: plain; title: ;">
    require 'remarkable/active_record'
</pre>
<h2>Create a Model</h2>
<p>Then make a model to play with (on the command line):</p>
<pre class="brush: plain; title: ;">
rails g model person name:string email:string
rake db:migrate
rake spec
/Users/sarah/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -S bundle exec rspec ./spec/models/person_spec.rb
*

Pending:
  Person add some examples to (or delete) /Users/sarah/src/mv/experiment/remarkable_app/spec/models/person_spec.rb
    # Not Yet Implemented
    # ./spec/models/person_spec.rb:4

Finished in 0.00026 seconds
1 example, 0 failures, 1 pending
</pre>
<p>yay! ready to get started test driving some remarkable validations&#8230;</p>
<h2>Test Driven Validation</h2>
<p>Let&#8217;s test drive our first validation..</p>
<pre class="brush: plain; title: ;">
describe Person do
  should_validate_length_of :name, :within =&gt; 3..40
end
</pre>
<p>note that remarkable also supports:<br />
<code>it { should validate_length_of :name, :within => 3..40 }</code><br />
For my new code I&#8217;ll probably write the more concise version, but it is nice that my old code should work.</p>
<pre class="brush: plain; title: ;">
$ rake spec
/Users/sarah/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -S bundle exec rspec ./spec/models/person_spec.rb
F

Failures:

  1) Person
     Failure/Error: send(should_or_should_not, send(method, *args, &amp;block))
       Expected Person to be invalid when name length is less than 3 characters
     # ./spec/models/person_spec.rb:4:in `block in &lt;top (required)&gt;'
     # ./spec/models/person_spec.rb:3:in `&lt;top (required)&gt;'

Finished in 0.30367 seconds
1 example, 1 failure

Failed examples:

rspec /Users/sarah/.rvm/gems/ruby-1.9.2-p290@remarkable_rails3/gems/remarkable-4.0.0.alpha4/lib/remarkable/core/macros.rb:26 # Person
rake aborted!
ruby -S bundle exec rspec ./spec/models/person_spec.rb failed
</pre>
<p>add validation to my model&#8230;</p>
<pre class="brush: plain; title: ;">
class Person &lt; ActiveRecord::Base
  validates_length_of :name, :within =&gt; 3..40
end
</pre>
<p>Test passes!</p>
<pre class="brush: plain; title: ;">
$ rake spec
/Users/sarah/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -S bundle exec rspec ./spec/models/person_spec.rb
.

Finished in 0.27601 seconds
1 example, 0 failures
</pre>
<p>More validations:</p>
<pre class="brush: plain; title: ;">
describe Person do
  should_validate_length_of :name, :within =&gt; 3..40
  should_allow_values_for :email, &quot;sarah@foo.com&quot;
  should_not_allow_values_for :email, &quot;sarah&quot;, &quot;@foo&quot;, &quot;whatever.com&quot;
end
</pre>
<p>Reasonably nice error output:</p>
<pre class="brush: plain; title: ;">
$ rake spec
/Users/sarah/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -S bundle exec rspec ./spec/models/person_spec.rb
..F

Failures:

  1) Person
     Failure/Error: send(should_or_should_not, send(method, *args, &amp;block))
       Did not expect Person to be valid when email is set to &quot;sarah&quot;
     # ./spec/models/person_spec.rb:6:in `block in &lt;top (required)&gt;'
     # ./spec/models/person_spec.rb:3:in `&lt;top (required)&gt;'

Finished in 0.29054 seconds
3 examples, 1 failure

Failed examples:

rspec /Users/sarah/.rvm/gems/ruby-1.9.2-p290@remarkable_rails3/gems/remarkable-4.0.0.alpha4/lib/remarkable/core/macros.rb:26 # Person
rake aborted!
ruby -S bundle exec rspec ./spec/models/person_spec.rb failed
</pre>
<p>Cheated a little on implementation by copying email validation from ActiveRecord docs&#8230; all good.</p>
<h2>Now let&#8217;s add an association!</h2>
<p>In app/model/person.rb:</p>
<pre class="brush: plain; title: ;">
describe Person do
  should_validate_length_of :name, :within =&gt; 3..40
  should_allow_values_for :email, &quot;sarah@foo.com&quot;
  should_not_allow_values_for :email, &quot;sarah&quot;, &quot;@foo&quot;, &quot;whatever.com&quot;
  should_have_many :addresses
end
</pre>
<p>Watch it fail:</p>
<pre class="brush: plain; title: ;">
$ rake spec
/Users/sarah/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -S bundle exec rspec ./spec/models/person_spec.rb
...F

Failures:

  1) Person
     Failure/Error: send(should_or_should_not, send(method, *args, &amp;block))
       Expected Person records have many addresses, but the association does not exist
     # ./spec/models/person_spec.rb:7:in `block in &lt;top (required)&gt;'
     # ./spec/models/person_spec.rb:3:in `&lt;top (required)&gt;'

Finished in 0.32615 seconds
4 examples, 1 failure
</pre>
<p>Make it pass:</p>
<pre class="brush: plain; title: ;">
$ rails g model address street:string person:belongs_to
      invoke  active_record
      create    db/migrate/20110721161741_create_addresses.rb
      create    app/models/address.rb
      invoke    rspec
      create      spec/models/address_spec.rb
$ rake db:migrate

.

Pending:
  Address add some examples to (or delete) /Users/sarah/src/mv/experiment/remarkable_app/spec/models/address_spec.rb
    # Not Yet Implemented
    # ./spec/models/address_spec.rb:4

Finished in 0.2998 seconds
5 examples, 0 failures, 1 pending
</pre>
<p>the rest is left as an exercise for the reader :)</p>
<h2>Summary</h2>
<p>Overall, I like the remarkable syntax. It seems reliable and on its way to a good release for Rails 3.</p>
]]></content:encoded>
			<wfw:commentRss>http://blazingcloud.net/2011/07/21/remarkable-validations-for-rails-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test Driven Development at Blazing Cloud</title>
		<link>http://blazingcloud.net/2011/07/20/test-driven-development-at-blazing-cloud/</link>
		<comments>http://blazingcloud.net/2011/07/20/test-driven-development-at-blazing-cloud/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 19:37:50 +0000</pubDate>
		<dc:creator>tabitha</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2375</guid>
		<description><![CDATA[Blazing Cloud will be offering a class on Efficient Rails Test Driven Development this October, taught by Wolfram Arnold. Wolf is an experienced Rails engineer who applies test-driven development in his consulting practice, and is returning to teach this highly successful class for the fourth time at Blazing Cloud. For information or to sign up, [...]]]></description>
			<content:encoded><![CDATA[<p>Blazing Cloud will be offering a class on Efficient Rails Test Driven Development this October, taught by Wolfram Arnold. Wolf is an experienced Rails engineer who applies test-driven development in his consulting practice, and is returning to teach this highly successful class for the fourth time at Blazing Cloud.</p>
<p>For information or to sign up, please visit our class page at</p>
<p><a href="http://classes.blazingcloud.net">http://classes.blazingcloud.net</a></p>
<p>For an idea of what to expect from this class, check out this video episode from the first session of a previous class, complete with course outline and objectives:</p>
<p>1st Episode</p>
<p><object style="height: 300px; width: 580px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100" height="100" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/ra8Q0M3DJYk?version=3" /><param name="allowfullscreen" value="true" /><embed style="height: 300px; width: 580px;" type="application/x-shockwave-flash" width="100" height="100" src="http://www.youtube.com/v/ra8Q0M3DJYk?version=3" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>For a complete list of episodes, visit <a href="http://www.rubyfocus.biz/">Wolf&#8217;s blog</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blazingcloud.net/2011/07/20/test-driven-development-at-blazing-cloud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Client Side Validations</title>
		<link>http://blazingcloud.net/2011/07/05/client-side-validations/</link>
		<comments>http://blazingcloud.net/2011/07/05/client-side-validations/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 00:35:05 +0000</pubDate>
		<dc:creator>chromaticbum</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2359</guid>
		<description><![CDATA[TL;DR Luke Wroblewski did some sweet research on inline validations and found out that people think they are totally awesome. Brian Cardarella implemented that research in the gem client_side_validations. The gem automatically generates lots of client validations based on your rails model validations. I wrote an application showing some of its capabilities and how to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>TL;DR</strong></p>
<p>Luke Wroblewski did some sweet research on inline validations and found out that people think they are totally awesome. Brian Cardarella implemented that research in the gem client_side_validations. The gem automatically generates lots of client validations based on your rails model validations. I wrote an application showing some of its capabilities and how to extend its functionality. Alright guy, <a href="https://github.com/chromaticbum/Torri">show me some source</a> for how to use this gem<a href="https://github.com/chromaticbum/Torri"></a>. I don&#8217;t need the stinking source, just <a href="http://fierce-water-70.heroku.com/">let me see your app</a>.</p>
<p><strong>The Long Version</strong></p>
<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px} -->Back in 2009, Luke Wroblewski performed some <a title="Research on inline form validation by Luke Wroblewski" href="http://www.alistapart.com/articles/inline-validation-in-web-forms/">research on inline form validation</a> and how users respond to different types of inline validations (i.e. javascript validations that give immediate feedback). People complete forms quicker, make fewer mistakes, and are more satisfied when filling out forms with inline validations.  When asked to fill out a registration form, people were 42% quicker at completing the form when inline validations were present. Awesome!</p>
<p>This is great information to have about the way people interact with forms on our websites. Imagine we are building our own registration form for our next sweet application and we add inline validation. Our users are going to be happier with the experience of registering, they will make fewer mistakes, and they will be able to start ACTUALLY using our totally-awesome application quicker. There is just one problem… Manually coding inline validations can be a somewhat cumbersome process. First, we have to make sure that our server-side validations are working properly. After we have tested the backend, we then need to manually code up a fair bit of javascript in order to get the inline validations working. Not only is writing this inline validation code often uninteresting (we want to get the real features like that cool video player implemented). There is also a very big maintenance issue with this approach; we are actually going to write the same validation code twice: once in Rails and once in Javascript. So now, whenever we update our backend validation logic, we need to remember to update our client validation logic as well. Wouldn&#8217;t it be great if there were a way to automatically generate our client validations based on our backend code?</p>
<p>Enter the shiny new (very-appropriately named) gem <a title="client_side_validations gem" href="https://github.com/bcardarella/client_side_validations">client_side_validations</a>. Brian Cardarella wrote the client_side_validations gem as a result of Luke Wroblewski&#8217;s research. Check out Brian&#8217;s <a title="Brian Caradarella's blog post on his client_side_validations gem" href="http://bcardarella.com/post/4211204716/client-side-validations-3-0">blog post on his gem</a>. With a few simple lines of code, we can add inline validations to our forms. The validations are generated with the default form builder, <a title="Formtastic form builder gem" href="https://github.com/justinfrench/formtastic">formtastic</a>, or <a title="simple_form form builder gem" href="https://github.com/plataformatec/simple_form">simple_form</a>. A lot of the rails model validations, including (but not limited to) length_of, presence_of, uniqueness_of, and format_of are all supported out of the box, so your forms will be making these validations as soon as you install and setup the gem. You can also add your own custom validators if what comes out of the box is not enough for your bleeding-edge rockin&#8217; Rails application.</p>
<p>So how does it work? What does an application that uses this gem look like? How the heck can I use this thing with existing technologies? These are some questions your are undoubtedly asking yourself this second, and I will answer them (sort of).</p>
<p><strong>How does it work?</strong></p>
<p>It&#8217;s simple! The gem extends the Rails default form builder, and all you have to do is set a <em>:validate =&gt; true</em> option on any form_for (or simple_form_for for simple form users) tag that you want the inline validations for. The form builder uses some rails reflections on your model validations to generate some json that gets included in a script tag after your form. The json is then used by the gem&#8217;s Javascript framework to perform the validations that need to be performed.</p>
<p><strong>What does an application that uses this gem look like?</strong></p>
<p>I have built a sample application that uses this gem to perform inline validations on a very contrived user registration form. Here is the <a title="Sample application on github" href="https://github.com/chromaticbum/Torri">github source</a> and here is the <a title="Heroku application of Torri" href="http://fierce-water-70.heroku.com/">Heroku application</a>. You can create a state in the database, then you can add cities to that state. Once you have done this, you can register with the system as a user. The state and city that you enter when registering validates against the database you create. Also, this site is very selective, and you must be born on a Monday in order to register (just to show off how date validations can work). The application is a little contrived (only aliens, or time travelers would use it), but it does illustrate some more advanced ways that you can use custom remote and local inline validators with your forms.</p>
<p><strong>How does it integrate with existing technologies?</strong></p>
<p>As stated previously, it integrates nicely with formtastic and simple form. The sample application also shows how to integrate with <a title="Devise user authentication gem" href="https://github.com/plataformatec/devise">devise</a>. Take special note of the regular expression that was added to the user model. This is necessary because the default regular expression that devise uses to validate an email address does not compile in the Javascript regular expression engine.</p>
<p>Check out <a title="Source for Torrie sample application on github" href="https://github.com/chromaticbum/Torri">the source</a>.</p>
<p>See it in action on <a title="Heroku sample application" href="http://fierce-water-70.heroku.com/">Heroku here</a>.</p>
<p>Make sure to add your states and cities before you register! Also, I know you are supposed to be born on a Monday to use the site, but you can fake your birthday, I won&#8217;t get mad (I wasn&#8217;t even born on a Monday).</p>
]]></content:encoded>
			<wfw:commentRss>http://blazingcloud.net/2011/07/05/client-side-validations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

