<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>rails &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/rails/</link>
	<description>Feed of posts on WordPress.com tagged "rails"</description>
	<pubDate>Sun, 26 May 2013 00:14:26 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Learn Ruby &amp; Rails in 2.5 hours, for FREE!]]></title>
<link>http://programmersunlimited.wordpress.com/2013/05/15/learn-ruby-rails-in-2-5-hours-for-free/</link>
<pubDate>Wed, 15 May 2013 23:14:11 +0000</pubDate>
<dc:creator>programmersunlimited</dc:creator>
<guid>http://programmersunlimited.wordpress.com/2013/05/15/learn-ruby-rails-in-2-5-hours-for-free/</guid>
<description><![CDATA[I&#8217;ve been pretty busy in recent months, but I&#8217;ve finally released my Ruby on Rails cours]]></description>
<content:encoded><![CDATA[<p><a href="http://pluralsight.com/training/Courses/TableOfContents/ruby-rails-dotnet"><img class="alignleft" style="border:5px solid black;" alt="" src="http://s.pluralsight.com/mn/img/cs/lg/ruby-v1.png" width="125" height="125" border="0" /></a>I&#8217;ve been pretty busy in recent months, but I&#8217;ve finally released my Ruby on Rails course. This course is geared at existing .NET developers who want to see what Ruby &#38; Rails is like, but don&#8217;t want to invest the time to learn either. In this course, we go through just enough ruby to get you going and build a Rails applications as quickly as possible, with as little effort as we can get away with. You&#8217;ll leanr just enough to get yourself into trouble.</p>
<p>The best part is, I&#8217;ll let you check it out for free! For those who currently do not have a subscription to <a title="Ruby on Rails for .NET Developers" href="http://pluralsight.com/training/Courses/TableOfContents/ruby-rails-dotnet">Pluralsight</a>, I&#8217;ll give you a 1-week subscription so you can check out my Ruby on Rails course. Send me an email with your name, twitter and what you normally develop with and I&#8217;ll send back a subscription.</p>
<p>Send email to <a href="mailto:programmersunlimited@gmail.com">programmersunlimited@gmail.com</a></p>
<p>Supplies are limited though!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Welcome to the A-list]]></title>
<link>http://andymjiang.wordpress.com/2013/05/15/welcome-to-the-a-list/</link>
<pubDate>Wed, 15 May 2013 20:02:13 +0000</pubDate>
<dc:creator>Andy Jiang</dc:creator>
<guid>http://andymjiang.wordpress.com/2013/05/15/welcome-to-the-a-list/</guid>
<description><![CDATA[Recently, a conversation over dinner about personal life hacks without the direct intention of blata]]></description>
<content:encoded><![CDATA[<p>Recently, a conversation over dinner about personal life hacks without the direct intention of blatant commercialism spawned a neat idea that scratches an itch that us west coast jet setters face occasionally—not only just checking into Southwest flights, but also checking into those flights as early as possible to attain a highly coveted &#8216;A-list&#8217; boarding group.</p>
<p>There have been too many times when the 24 hour period prior to the flight occurs when I&#8217;m away from my computer. This <a href="http://www.andyjiang.com/sw" target="_blank">web application</a>, however, will check into your Southwest flight for you.</p>
<p>Instead of going to a <a href="http://checkintomyflight.com/" target="_blank">website</a> where you input the information necessary for you to check in (name and confirmation number), you now can you just forward your Southwest flight confirmation email (the one with the subject that says &#8216;Your trip is right around the corner!&#8217;) to sw@to.andyjiang.com. Then, when the 24 hour check in window opens up, the web application will check in to the flight for you.</p>
<h2><strong>How does the app work?</strong></h2>
<p>The <a title="Mandrill" href="http://mandrill.com/" target="_blank">Mandrill</a> (hosted by Mailchimp) server receives an inbound email and sends a POST request to the web server. The web server then extracts the text from the body of the email from the POST request and runs several regular expressions on it to get the following pieces of information: first name, last name, confirmation number, your email address, the URL it needs to go to in order to check in for you. It saves this data into a Mongo database (<a href="https://addons.heroku.com/mongohq" target="_blank">MongoHQ add-on</a> with <a title="Heroku" href="http://www.heroku.com" target="_blank">Heroku</a>).</p>
<p>An hourly task runs on the server (<a href="https://addons.heroku.com/scheduler" target="_blank">Heroku Scheduler</a>) to look at all of the records in the mongo database; for each record, if it is time to check in, the web server  uses the <a href="http://mechanize.rubyforge.org/" target="_blank">Mechanize</a> library to get and parse the HTML of the confirmation web site, fill in the required information, and check in for you. Then it takes your boarding group and boarding position and sends you a confirmation email.</p>
<h2><strong>Tools I used</strong></h2>
<p>Since debugging is 90% of any project, it is important to learn to break the project into small, achievable goals, to quickly isolate problems and to iterate through working solutions. Below is a list of some of the tools I used to test quickly and build out the application.</p>
<p><strong><a href="http://rubular.com/" target="_blank">Rubular</a>: </strong>Regular expressions were critical to parsing the body of the inbound email. This nifty website allows you to test all of your regexp patterns against Strings of your choice. Combined with <a href="http://en.wikipedia.org/wiki/Interactive_Ruby_Shell" target="_blank">IRB</a> and <a href="http://ruby-doc.org/core-2.0/Class.html" target="_blank">.class?</a>, you can very quickly determine the right commands to extract the information needed from the text.</p>
<p><strong><a href="http://progrium.com/localtunnel/" target="_blank">Localtunnel</a>: </strong>Localtunnel, hosted by Twilio, allows you to expose an endpoint on your local server to receive HTTP requests from other servers. This is important when you are using a service that will send you <a href="http://en.wikipedia.org/wiki/Webhook" target="_blank">webhooks</a> (Twilio, Mandrill inbound emails, etc.), so you don&#8217;t have to push your changes to a production server in order to test whether your app correctly processes the POST request to your endpoint. With Localtunnel, you just follow the instructions on the <a href="http://progrium.com/localtunnel/" target="_blank">site</a>, copy and paste the localtunnel URL/endpoint generated (tied to your local server), and provide it to the web service so it knows the address to send its request, thereby allowing you to test locally.</p>
<p><strong>View Elements in Developer Tools</strong><strong>:</strong> In Chrome (Firefox and Safari, also), you can view the HTML document of each page you are on by going to <em>View &#62; Developer &#62; Developer Tools</em> (or Option + Command + I). This is important when you are using <a href="http://mechanize.rubyforge.org/" target="_blank">Mechanize</a>, which allows you to parse HTML given the HTML element, id, class, name, etc. I would test code by using <a href="http://en.wikipedia.org/wiki/Interactive_Ruby_Shell" target="_blank">IRB</a>, initialize a Mechanize object, open up the browser, and navigate the web from the terminal.</p>
<h2>Conclusion</h2>
<p>Feedback is always welcome. If you think you are going to forget to use this next time you fly Southwest, go into your Gmail account right now and set up an instant email forwarding. Go to your Gmail&#8217;s Settings &#62; Forwarding and POP/IMAP &#62; Forwarding, then select Add a Forwarding Address. Type in &#8220;sw@to.andyjiang.com&#8221; and send the verification email that will contain the confirmation code.</p>
<div class="wp-caption aligncenter" style="width: 567px"><img alt="Forwarding and POP/IMAP &#62; Forwarding to set up a new email address to auto forward your Southwest itinerary emails&#34; class /&#62; Go to your Gmail's Settings &#62; Forwarding and POP/IMAP &#62; Forwarding to set up a new email address to auto forward your Southwest itinerary emails." src="http://i.imgur.com/TwK8wy6.png" width="557" height="113" /><p class="wp-caption-text">Forwarding and POP/IMAP &#62; Forwarding to set up a new email address to auto forward your Southwest itinerary emails&#8221; class /&#62; Go to your Gmail&#8217;s Settings &#62; Forwarding and POP/IMAP &#62; Forwarding to set up a new email address to auto forward your Southwest itinerary emails.</p></div>
<p>You will receive shortly an email that will provide you with the confirmation code that you can enter in the above field. The return email will also include a link that you can just click on to verify and confirm sw@to.andyjiang.com as the new forwarded email address.</p>
<div class="wp-caption alignnone" style="width: 587px"><img class=" " alt="The generated email with your confirmation code to verify the auto forwarding email address" src="http://i.imgur.com/OoGmbft.png" width="577" height="247" /><p class="wp-caption-text">The generated email with your confirmation code to verify the auto forwarding email address</p></div>
<p>Once you confirmed the email address to allow you to auto forward to it, then you will have to set up the filter for the right emails to be auto forwarded. Click on the link in the tip &#8216;You can also forward only some of your mail by creating a filter!&#8217; and then either copy and paste &#8220;from:southwest subject:(Your trip is around the corner)&#8221; into your Gmail search bar or use the template in your &#8216;Show Search Options&#8217; drop down below.</p>
<div class="wp-caption alignleft" style="width: 234px"><img class=" " title="Setting up autoforward for any Southwest itinerary emails to sw@to.andyjiang.com" alt="Setting up autoforward for any Southwest itinerary emails to sw@to.andyjiang.com" src="http://i.imgur.com/ON1O0xA.png" width="224" height="275" /><p class="wp-caption-text">Setting up autoforward for any Southwest itinerary emails to sw@to.andyjiang.com</p></div>
<div class="wp-caption alignright" style="width: 230px"><img alt="Creating the filter to auto forward specific emails to sw@to.andyjiang.com" src="http://i.imgur.com/iDqFoQe.png" width="220" height="284" /><p class="wp-caption-text">Creating the filter to auto forward specific emails to sw@to.andyjiang.com</p></div>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>That should set it up so that any future email from Southwest with that particular subject will be automatically forwarded to my web app, which should hopefully check you in so you won&#8217;t have to sit in the back between the two fat, sweaty guys.</p>
<p>I will blog more about the actual code in future posts.</p>
<p>If you have any questions, please let me know!</p>
<p>Andy</p>
<p>&#160;</p>
<p>[EDIT]: Please note that this is still not 100% battle tested, but it will improve over time the more emails it receives! Thanks, everyone!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Installing Rails on Clean Ubuntu Machine]]></title>
<link>http://danhcdang.wordpress.com/2013/05/15/installing-ruby-on-clean-linux-machine/</link>
<pubDate>Wed, 15 May 2013 14:30:00 +0000</pubDate>
<dc:creator>danhdang</dc:creator>
<guid>http://danhcdang.wordpress.com/2013/05/15/installing-ruby-on-clean-linux-machine/</guid>
<description><![CDATA[Build prerequisites sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev]]></description>
<content:encoded><![CDATA[<h2>Build prerequisites</h2>
<pre>sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libcurl4-openssl-dev libqt4-dev libmysqlclient-dev libpq-dev openjdk-7-jdk
</pre>
<ul>
<li>libcurl4-openssl-dev is specifically for the &#8216;curb&#8217; gem</li>
<li>libqt4-dev is specifically for the &#8216;capybara-webkit&#8217; gem</li>
<li>libmysqlclient-dev is specifically for the &#8216;mysql&#8217; gem (mysql databases)</li>
<li>libpq-dev is specifically for the &#8216;pg&#8217; gem (postgresql databases)</li>
<li>openjdk-7-jdk is specifically for JRuby (if you want to connect to Oracle/Sybase with JRuby)</li>
</ul>
<h2>rbenv + ruby-build</h2>
<pre>cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' &#62;&#62; ~/.bashrc
echo 'eval "$(rbenv init -)"' &#62;&#62; ~/.bashrc
exec $SHELL
mkdir -p ~/.rbenv/plugins
cd ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git
cd
rbenv install 2.0.0-p195
rbenv rehash
rbenv global 2.0.0-p195</pre>
<h2>Rails</h2>
<pre>gem install bundler rails therubyracer</pre>
<p>make sure your Gemfile has therubyracer if you use the asset_pipeline</p>
<h2>Rails with SQLite</h2>
<pre>rails new *myapp*</pre>
<h2>Rails with MySQL</h2>
<pre>rails new *myapp* -d mysql</pre>
<h2>Rails with PostgreSQL</h2>
<pre>rails new *myapp* -d postgresql</pre>
]]></content:encoded>
</item>
<item>
<title><![CDATA[15.05.13: TDD &amp; Ch3 of Rails]]></title>
<link>http://themountainlow.wordpress.com/2013/05/15/15-05-13-tdd-ch3-of-rails/</link>
<pubDate>Wed, 15 May 2013 11:09:11 +0000</pubDate>
<dc:creator>tom winter</dc:creator>
<guid>http://themountainlow.wordpress.com/2013/05/15/15-05-13-tdd-ch3-of-rails/</guid>
<description><![CDATA[Chapter 3 of the Rails tutorial focuses on working with HTML in Rails apps and also “Test Driven Dev]]></description>
<content:encoded><![CDATA[<p>Chapter 3 of the Rails tutorial focuses on working with HTML in Rails apps and also “Test Driven Development”. Rails can deliver static HTML pages, but also can define ‘views’ containing HTML which rails renders, sending from the web server to the browswer. Every Ruby app come with a default “index.html” file in the “public” directory (anything in here is available to the browser) this is a completely static HTML file with some CSS/Jscript all in one page. The purpose of Ch3 is to utilise ruby actions to identify URIs. </p>
<p>Rails can generate controllers when fed the controller’s name – in this case RSpec is employed throughout the chapter. <a href="http://rspec.info/">RSpec</a> is a testing tool which is employed as part of TDD. TDD involves going from Red (failure) to Green (code working) and refactoring along the way. In generating the StaticPages controller the following files are created </p>
<p><a href="http://themountainlow.files.wordpress.com/2013/05/1.png"><img src="http://themountainlow.files.wordpress.com/2013/05/1.png?w=300&#038;h=145" alt="1" width="300" height="145" class="alignnone size-medium wp-image-247" /></a></p>
<p>The key file used in the chapter is the controller static_pages_controller.rb. The ‘/config/routes.rb’, which guides ‘correspondence between URIs and pages’ file looks like this: </p>
<p><a href="http://themountainlow.files.wordpress.com/2013/05/2.png"><img src="http://themountainlow.files.wordpress.com/2013/05/2.png?w=300&#038;h=67" alt="2" width="300" height="67" class="alignnone size-medium wp-image-248" /></a></p>
<p><a href="http://themountainlow.files.wordpress.com/2013/05/3.png"><img src="http://themountainlow.files.wordpress.com/2013/05/3.png?w=300&#038;h=104" alt="3" width="300" height="104" class="alignnone size-medium wp-image-249" /></a></p>
<p>Any requests to /static_pages/home will be mapped to the home action found within the static_pages_controller file, which looks like this</p>
<p><a href="http://themountainlow.files.wordpress.com/2013/05/4.png"><img src="http://themountainlow.files.wordpress.com/2013/05/4.png?w=300&#038;h=89" alt="4" width="300" height="89" class="alignnone size-medium wp-image-250" /></a></p>
<p>The class StaticPagesController inherets from class ApplicationController and contains the defined methods ‘home’, ‘help’ etc, which appear empty. The home action has a corresponding view home.html.erb (note the double file extension). The approach that emphasises the application’s behaviour is known as Behaviour Driven Development, a variation of TDD. This chapter will involve focusing in ‘integration tests’, in an RSpec context called request specs, which simulate a user/browser interacting with the application. This avoids having to manually check each page by identifying certain criteria that need to be fulfilled, and then testing the pages for this. </p>
<p>You start with the test, a necessarily failing test, but this ensures that we build an application that adheres to the correct framework as we develop it. The book argues that the fail-implement-pass induces flowstate. </p>
<p>An integration test is generated which creates the static pages spec. At the conclusion of this chapter it looks like this:</p>
<p><a href="http://themountainlow.files.wordpress.com/2013/05/5.png"><img src="http://themountainlow.files.wordpress.com/2013/05/5.png?w=300&#038;h=227" alt="5" width="300" height="227" class="alignnone size-medium wp-image-251" /></a></p>
<p>At the command line you can run the tests using the RSpec environment, with the prefix of “bundle exec” to ensure RSpec adheres to the environment identified in the Gemfile. You’re basically running through the whole static_pages_spec file and seeing that the “its” identified are true. </p>
<p>The next stage adds a new page. This requires</p>
<ol>
<li>Adding the ‘about’ page to the route file
<li>Adding the method ‘about’ to the StaticPagesController file
<li>Adding a new file ‘about.html.erb’ to the view/static_pages folder
</ol>
<p>Basically during this part of the chapter I worked with – setting up a ruby application with RSpec to allow for BDD &#38; TDD. Primarily spending time working with the route file, the StaticPagesController file and the static_pages_spec file to write up the tests that were to be undertaken.</p>
<p>The last part of the work is to add an element of dynamic content to the page by<br />
a) having the title change for each page<br />
b) creating a standard HTML framework that you just load particular content into for each page</p>
<p>There is a further condition added to the tests of having a ‘title’ – page.should have_selector. First argument ‘title’ second a Hash with key :text symbol and value the text being sought. </p>
<p>Couple of interesting bits are:</p>
<p><a href="http://themountainlow.files.wordpress.com/2013/05/6.png"><img src="http://themountainlow.files.wordpress.com/2013/05/6.png?w=300&#038;h=47" alt="6" width="300" height="47" class="alignnone size-medium wp-image-252" /></a></p>
<p>This is an example of Embedded Ruby (ERb).  executes the code within and  inserts the code. </p>
<p>In the static_pages_spec file there’s a lot of duplication around the first part of the title. The solution is to use the ‘let’ method to define a string which is then interpolated each time. <a href="http://stackoverflow.com/questions/5359558/when-to-use-rspec-let">The ‘let’ approach is contrasted to instance variables here</a>. </p>
<p>The last part is to alter the application.hml.rb file. The /layout/application.html.rb file in a Rails app dictates the general layout of the views. </p>
<p><a href="http://themountainlow.files.wordpress.com/2013/05/7.png"><img src="http://themountainlow.files.wordpress.com/2013/05/7.png?w=300&#038;h=91" alt="7" width="300" height="91" class="alignnone size-medium wp-image-253" /></a></p>
<p>The title has been added here to it’s replicated in every view page. The  within the body tags inserts the contents of each view page into the layout. This means that you can get read of a lot of the beginning and end tags on each view page and be left with just, for instance</p>
<p><a href="http://themountainlow.files.wordpress.com/2013/05/8.png"><img src="http://themountainlow.files.wordpress.com/2013/05/8.png?w=300&#038;h=67" alt="8" width="300" height="67" class="alignnone size-medium wp-image-254" /></a></p>
<p>I then completed the follow up exercise of adding a Contact page (making sure to edit the route, StaticPagesController and static_pages_spec files), and adding the RSpec ‘let’ function as above.</p>
<p>&#60;strong&#60;background noise</strong>:<br />
Deerhunter – Monomania</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Query actions in Rails controllers]]></title>
<link>http://silkandspinach.net/2013/05/14/query-actions-in-rails-controllers/</link>
<pubDate>Tue, 14 May 2013 19:04:05 +0000</pubDate>
<dc:creator>Kevin Rutherford</dc:creator>
<guid>http://silkandspinach.net/2013/05/14/query-actions-in-rails-controllers/</guid>
<description><![CDATA[Recently some of my controller actions have taken on a definite new shape. Particularly when the act]]></description>
<content:encoded><![CDATA[<p>Recently some of my controller actions have taken on a definite new shape. Particularly when the action is a read-only query of the app&#8217;s state. Such actions tend to make up the bulk of my apps, and they can be simple because they are unlikely to &#8220;fail&#8221; in any predictable way. Here&#8217;s an example from my wiki app:</p>
<script src="https://gist.github.com/kevinrutherford/5578425.js?file=cards_controller.rb"></script>
<p>This has a couple of significant plus points: First, no instance variables, so both the controller action and the view are more readable and easier to refactor. Second, no instance variables! So there&#8217;s a clear, documented, named interface between the controller and the view. And third, this is so transparently readable that I never bother to test it.</p>
<p>The wiki used in the above action is a repository, built in a memoizing helper method that most of the controllers use:</p>
<script src="https://gist.github.com/kevinrutherford/5578425.js?file=application_controller.rb"></script>
<p>In this case the correct kind of repository is created for the current user, and all of the other code in this request sits on top of that. So the controller action, helped by the memoized repository builder, effectively constructs an entire hexagonal architecture for each request, and the domain logic is thus blissfully unaware of its context.</p>
<p>Here&#8217;s a slightly bigger example. This is for a page that shows a variety of informative graphs about the wiki; and because I may want to re-organise my admin pages in the future, each graph&#8217;s data is built independently of the others:</p>
<script src="https://gist.github.com/kevinrutherford/5578425.js?file=statistics_controller.rb"></script>
<p>That&#8217;s the most complex query controller action I have, and I maintain that it&#8217;s so simple I don&#8217;t need to test it. Would you?</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[14.05.13: some notes on rails]]></title>
<link>http://themountainlow.wordpress.com/2013/05/14/14-05-13-some-notes-on-rails/</link>
<pubDate>Tue, 14 May 2013 10:32:17 +0000</pubDate>
<dc:creator>tom winter</dc:creator>
<guid>http://themountainlow.wordpress.com/2013/05/14/14-05-13-some-notes-on-rails/</guid>
<description><![CDATA[Managed to complete Chapter 2 of the Rails Tutorial this morning. As the chapter suggested it was a]]></description>
<content:encoded><![CDATA[<p>Managed to complete Chapter 2 of the <a href="http://ruby.railstutorial.org">Rails Tutorial</a> this morning. As the chapter suggested it was a very high-level approach to demonstrating the deployment of a Rails application. Pushed to both<br />
<a href="https://github.com/tomajwinter/demo_app">Github</a> and <a href="http://still-wave-6215.herokuapp.com/">Heroku</a>. Few bits came up to read around:</p>
<ol>
<li>Rake</li>
<li>REST architecture</li>
<li>Revise HTTP requests</li>
</ol>
<p><b>Rake</b><br />
I already installed Rake. It&#8217;s a program that is effectively RubyMake, used to do bits and pieces around web apps. This morning rake db:migrate was used.</p>
<p><b>REST architecture &#38; HTTP requests</b><br />
“Representational State Transfer” is a style for designing applications. RESTful applications use HTTP protocols Get, Post, Read &#38; Delete (CRUD)</p>
<p>The following is a summary from <a href="http://stackoverflow.com/questions/551933/can-you-explain-the-web-concept-of-restful">stack overflow</a></p>
<p>&#8220;<i>A RESTful application is an application that exposes its state and functionality as a set of resources that the clients can manipulate and conforms to a certain set of principles:</p>
<ul>
<li>All resources are uniquely addressable, usually through URIs; other addressing can also be used, though.
<li>All resources can be manipulated through a constrained set of well-known actions, usually CRUD (create, read, update, delete), represented most often through the HTTP&#8217;s POST, GET, PUT and DELETE; it can be a different set or a subset though &#8211; for example, some implementations limit that set to read and modify only (GET and PUT) for example
<li>The data for all resources is transferred through any of a constrained number of well-known representations, usually HTML, XML or JSON;
<li>The communication between the client and the application is performed over a stateless protocol that allows for multiple layered intermediaries that can reroute and cache the requests and response packets transparently for the client and the application.&#8221;
</ul>
<p></i></p>
<p><b>Extra:</b> Working through the introductory chapters of &#8216;Professional Javascript for Web Developers&#8217;. Mostly historical (and interesting). During the discussion of including Javascript in a page it identifies the problem of XHTML&#8217;s literal syntax. So things like Less Than operators would be seen as an opening of a tag. Rather than use the HTML tag (&#60;) a hack identified is to wrap the code in a &#8216;CDATA&#8217; section within a Javascript comment:</p>
<p><b>background noise:</b><br />
Interpol &#8211; Turn on the Bright Lights<br />
Pavement &#8211; Crooked Rain, Crooked Rain</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[We've Got the Denim Blues @ The Trend Boutique]]></title>
<link>http://thetrendboutique.wordpress.com/2013/05/13/weve-got-the-denim-blues-the-trend-boutique/</link>
<pubDate>Mon, 13 May 2013 18:59:25 +0000</pubDate>
<dc:creator>The Trend Boutique</dc:creator>
<guid>http://thetrendboutique.wordpress.com/2013/05/13/weve-got-the-denim-blues-the-trend-boutique/</guid>
<description><![CDATA[The weather is perfection in Los Angeles today and we are day dreaming of the summer days ahead. Get]]></description>
<content:encoded><![CDATA[The weather is perfection in Los Angeles today and we are day dreaming of the summer days ahead. Get]]></content:encoded>
</item>
<item>
<title><![CDATA[Stately Heat Maps with Style]]></title>
<link>http://behindthefandoor.fandor.com/2013/05/13/stately-heat-maps-with-style/</link>
<pubDate>Mon, 13 May 2013 18:57:50 +0000</pubDate>
<dc:creator>jnixon22</dc:creator>
<guid>http://behindthefandoor.fandor.com/2013/05/13/stately-heat-maps-with-style/</guid>
<description><![CDATA[Our team has been curious for a while about how our viewers are distributed across the United States]]></description>
<content:encoded><![CDATA[<p>Our team has been curious for a while about how our viewers are distributed across the United States.  It is easy enough to pull the data but hard to visualize what it means.  I’m a bit of a map geek myself so I thought it would be nice to display all this data in a viewing heat map.  When browsing around for tools I was happy to find <a href="http://intridea.github.io/stately/">Stately</a>.  Stately is a font made up of the shapes of each state in the United States.  It uses HTML and CSS to arrange these states into a nice map and there is no need to use Javascript, Flash, or any other plugins.</p>
<p><!--more--><strong>Installing Stately</strong></p>
<p>Installing Stately was not too much of a problem.  I downloaded <a href="https://github.com/intridea/stately">Stately</a>, added the four font files to vendor/assets/fonts/ and then added _customizations.scss, _setup.scss, and stately.scss to vendor/assets/stylesheets.  I modified vendor.css.scss to include stately.scss by simply adding &#8216;@import &#8220;stately&#8221;;&#8217;.  I had some trouble getting things to work, but after Googling around I found <a href="http://www.grayducklabs.com/blog/2013/how-to-use-the-stately-webfont-in-a-rails-application/">this post</a> which describes how you need to change the csetup.scss stylesheet so that the @font-face src attribute simply refers to the font name by removing the relative path from &#8216;../font/stately-webfont.eot&#8217; to &#8216;stately-webfont.eot&#8217;.</p>
<p><strong>Using Stately</strong></p>
<p>The Stately instructions tell you to create a big html list of alpha characters representing each state.  I didn’t want to carry that around in my view so I created a helper to do the mapping.  We already have a static list of states sorted alphabetically by state code, and I wanted to use that to map to alpha characters on the fly, but unfortunately the Stately state codes are not quite sorted alphabetically so I had to create my own map:</p>
<pre>module Stately
  STATE_TO_CHAR = {
    "al" =&#62;; "A",
    "ak" =&#62;; "B",
    "ar" =&#62;; "C",
    # ...
    "wy" =&#62; "y"
  }
end
 </pre>
<p>With this done, I can do</p>
<pre>&#60;% Stately::STATE_TO_CHAR.each do &#124;state, char&#124; %&#62;
  &#60;li data-state="&#60;%= state %&#62;" id="&#60;%= state %&#62;"&#62;&#60;%= char %&#62;&#60;/li&#62;
&#60;% end %&#62;
 </pre>
<p>This will give me a nice, if uninteresting map that looks like this:</p>
<p><a href="http://behindthefandoor.files.wordpress.com/2013/05/statelyunstyled.png"><img class="size-medium wp-image-243 aligncenter" alt="StatelyUnstyled" src="http://behindthefandoor.files.wordpress.com/2013/05/statelyunstyled.png?w=300&#038;h=221" width="300" height="221" /></a></p>
<p>Now for the interesting part. We have a model called a ViewingSession that contains a number of attributes including time watched and an IP address.  I can use <a href="http://www.maxmind.com/en/region">MaxMind’s regional GeoIP service</a> to pull out a state code from each ViewingSession like so:</p>
<pre>Net::GeoIP.region_instance.region_by_addr(viewing_session.ip_address).downcase
 </pre>
<p>From here it’s straightforward to build up a hash of state to percent viewing time.  I can assign a specific CSS class to each state:</p>
<pre>&#60;% Stately::STATE_TO_CHAR.each do &#124;state, char&#124; %&#62;
  &#60;% percentage = @state_data[state] ? @state_data[state] : 0 %&#62;
  &#60;li data-state="&#60;%= state %&#62;" id="&#60;%= state %&#62;" class="&#60;%= class_from_percentage(percentage) %&#62;"&#62;&#60;%= char %&#62;&#60;/li&#62;
&#60;% end %&#62;
 </pre>
<p>The class_from_percentage method simply assigns a class level depending on the percentage.  With our data I found seven levels to work best.  In order to get good a good gradient of colors I used the color scale generator I found <a href="http://www.bretttolbert.com/projects/colorscale/">here</a>.</p>
<p>Here&#8217;s the final viewing heat map result:</p>
<p><a href="http://behindthefandoor.files.wordpress.com/2013/05/statelywithstyle.png"><img class="size-medium wp-image-244 aligncenter" alt="StatelyWithStyle" src="http://behindthefandoor.files.wordpress.com/2013/05/statelywithstyle.png?w=300&#038;h=174" width="300" height="174" /></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Back at Trophy lakes!]]></title>
<link>http://tobias-hvaara.com/2013/05/13/back-at-trophy-lakes/</link>
<pubDate>Mon, 13 May 2013 18:26:07 +0000</pubDate>
<dc:creator>tobiashvaara</dc:creator>
<guid>http://tobias-hvaara.com/2013/05/13/back-at-trophy-lakes/</guid>
<description><![CDATA[Finally back at Trophy lakes, stoked to be back and good times on the water! Made a little edit wake]]></description>
<content:encoded><![CDATA[<p>Finally back at Trophy lakes, stoked to be back and good times on the water!</p>
<p>Made a little edit wakeboarding with my roommate and buddy Wes a couple of weeks ago so check it out!</p>
<div class='embed-vimeo' style='text-align:center;'><iframe src='http://player.vimeo.com/video/64776691' width='400' height='300' frameborder='0'></iframe></div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[spree tools and tutorials]]></title>
<link>http://rubyonrailsthrissur.wordpress.com/2013/05/13/spree-tools-and-tutorials/</link>
<pubDate>Mon, 13 May 2013 12:27:42 +0000</pubDate>
<dc:creator>www.klairvoyant.in</dc:creator>
<guid>http://rubyonrailsthrissur.wordpress.com/2013/05/13/spree-tools-and-tutorials/</guid>
<description><![CDATA[1) deface http://guides.spreecommerce.com/view_customization.html http://deface.heroku.com/ https://]]></description>
<content:encoded><![CDATA[<p>1) deface</p>
<p><a href="http://guides.spreecommerce.com/view_customization.html" rel="nofollow">http://guides.spreecommerce.com/view_customization.html</a></p>
<p><a href="http://deface.heroku.com/" rel="nofollow">http://deface.heroku.com/</a></p>
<p><a href="https://github.com/spree/deface" rel="nofollow">https://github.com/spree/deface</a></p>
<p>2)Theams</p>
<p>1) <a href="https://github.com/spree/spree_fancy" rel="nofollow">https://github.com/spree/spree_fancy</a></p>
<p><a href="https://github.com/search?langOverride=&#038;p=5&#038;q=spree+theme&#038;repo=&#038;start_value=1&#038;type=Repositories" rel="nofollow">https://github.com/search?langOverride=&#038;p=5&#038;q=spree+theme&#038;repo=&#038;start_value=1&#038;type=Repositories</a></p>
<p>3) Gem</p>
<p><a href="http://guides.rubygems.org/specification-reference/#licenses=http://docs.rubygems.org/read/chapter/20" rel="nofollow">http://guides.rubygems.org/specification-reference/#licenses=http://docs.rubygems.org/read/chapter/20</a></p>
<p><a href="http://klairvoyant.in">www.klairvoyant.in</a></p>
		<div id="geo-post-717" class="geo geo-post" style="display: none">
			<span class="latitude">10.619223</span>
			<span class="longitude">76.039038</span>
		</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Just Call Me Jet-Setter]]></title>
<link>http://iamlyons.com/2013/05/12/just-call-me-jet-setter/</link>
<pubDate>Mon, 13 May 2013 02:48:56 +0000</pubDate>
<dc:creator>hayleylyons</dc:creator>
<guid>http://iamlyons.com/2013/05/12/just-call-me-jet-setter/</guid>
<description><![CDATA[WORKOUT&#8211; Training Log (Friday) 7 miles (Saturday) 8 miles, 4 hours of walking (today) AM: 30 m]]></description>
<content:encoded><![CDATA[WORKOUT&#8211; Training Log (Friday) 7 miles (Saturday) 8 miles, 4 hours of walking (today) AM: 30 m]]></content:encoded>
</item>
<item>
<title><![CDATA[Pry - An IRB Alternative and a Debugger]]></title>
<link>http://zenonrails.wordpress.com/2013/05/12/pry-an-irb-alternative-and-a-debugger/</link>
<pubDate>Sun, 12 May 2013 05:45:52 +0000</pubDate>
<dc:creator>Yoni</dc:creator>
<guid>http://zenonrails.wordpress.com/2013/05/12/pry-an-irb-alternative-and-a-debugger/</guid>
<description><![CDATA[Today I learned about using Pry as a debugger within a simple ruby app. Just instill the Pry gem gem]]></description>
<content:encoded><![CDATA[<p>Today I learned about using <strong><a href="https://github.com/pry/pry">Pry</a> </strong>as a debugger within a simple ruby app. Just instill the Pry gem</p>
<pre class="brush: plain; title: ; notranslate" title="">gem install pry</pre>
<p>and then insert &#8216;binding.pry&#8217; at the line of code that you want pry to stop and inspect. At run-time, you can inspect all the variables, and even change them on the fly.</p>
<p>Pry is meant not only as a debugging tool &#8211; it&#8217;s a whole replacement for the regular ruby console (irb), and can be invoked in the terminal by typing &#8216;$ pry&#8217;.</p>
<p>And you can use Pry as a <strong>rails</strong> console replacement as well! Just add</p>
<pre class="brush: plain; title: ; notranslate" title="">gem 'pry-rails', :group =&#62; :development</pre>
<p>to your Gemfile, bundle install, and (assuming you have Rails &#62;=3.2.0) create a new initializer with the following code:</p>
<pre class="brush: plain; title: ; notranslate" title="">
MyApplication::Application.configure do
  # Use Pry instead of IRB
  silence_warnings do
    begin
      require 'pry'
      IRB = Pry
    rescue LoadError
    end
  end
end
</pre>
<p>This uses the the &#8216;pry-rails&#8217; gem by the Pry project, which causes &#8216;$ rails console&#8217; or &#8216;$ rails c&#8217; to open pry directly.</p>
<p>For more information, see the <a href="https://github.com/pry/pry/wiki/Setting-up-Rails-or-Heroku-to-use-Pry">Pry-rails Github page</a>.</p>
<p><strong>Edit</strong> (20/5/2013): Switched back to the standard console. I think there&#8217;s a bit of a speed issue &#8211; requests seem to be a bit less snappy. Also the intense colours are lovely, but they&#8217;re a bit much for me.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Corridor]]></title>
<link>http://photoradiante.wordpress.com/2013/05/11/corridor/</link>
<pubDate>Sat, 11 May 2013 18:58:02 +0000</pubDate>
<dc:creator>carmenw503</dc:creator>
<guid>http://photoradiante.wordpress.com/2013/05/11/corridor/</guid>
<description><![CDATA[]]></description>
<content:encoded><![CDATA[]]></content:encoded>
</item>
<item>
<title><![CDATA[REEport goes live an the National Institute of Food and Agriculture (NIFA)]]></title>
<link>http://agile-business-intelligence.com/2013/05/11/reeport-goes-live-an-the-national-institute-of-food-and-agriculture-nifa/</link>
<pubDate>Sat, 11 May 2013 16:30:16 +0000</pubDate>
<dc:creator>Owen Dall</dc:creator>
<guid>http://agile-business-intelligence.com/2013/05/11/reeport-goes-live-an-the-national-institute-of-food-and-agriculture-nifa/</guid>
<description><![CDATA[REEport is the &#8220;Research, Education, and Extension Project Online Reporting Tool.&#8221;   Thi]]></description>
<content:encoded><![CDATA[<p>REEport is the &#8220;Research, Education, and Extension Project Online Reporting Tool.&#8221;   This was a great team effort between the Barquin team and the NIFA Federal team.</p>
<p>&#8220;Barquin International announced today its partnership with the National Institute of Food and Agriculture (NIFA), an agency of the United States Department of Agriculture (USDA), in the development of the recently-launched Research, Education, and Extension Project Online Reporting Tool (REEport). This integrated data collection, analysis and reporting application was successfully developed and deployed by NIFA to provide a singular, consistent method to support oversight and tracking of competitive and formula grant projects managed by the agency.&#8221;</p>
<p>For the full press release, following this link:</p>
<p><a href="http://www.prweb.com/releases/2013/5/prweb10713717.htm" target="_blank">http://www.prweb.com/releases/2013/5/prweb10713717.htm</a></p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[ARTA pushes for rail study]]></title>
<link>http://adirondackcitizen.wordpress.com/2013/05/11/arta-pushes-for-rail-study/</link>
<pubDate>Sat, 11 May 2013 16:23:15 +0000</pubDate>
<dc:creator>ac</dc:creator>
<guid>http://adirondackcitizen.wordpress.com/2013/05/11/arta-pushes-for-rail-study/</guid>
<description><![CDATA[ARTA is asking Governor Cuomo as well DOT, DEC and APA for review of the rail corridor unit manageme]]></description>
<content:encoded><![CDATA[<p>ARTA is asking Governor Cuomo as well DOT, DEC and APA for review of the rail corridor unit management plan.<br />
&#62; <a title="http://www.timesunion.com/business/article/Push-for-rail-study-4492952.php" href="http://www.timesunion.com/business/article/Push-for-rail-study-4492952.php" target="_blank">read the Times Union article</a></p>
<address>Adirondack Citizen says: ARTA failed in its attempt to sell the general public on the fantasy that turning the rail bed into a trail could draw more than 240,000 overnight visitors annually and be paid for by selling the old rails and ties. So now they&#8217;re headed to Albany to pursue legislative and legal avenues. Stay tuned. </address>
]]></content:encoded>
</item>
<item>
<title><![CDATA[PHOTOBLOG: The Fence and the Evening Rainbow]]></title>
<link>http://myxldove.wordpress.com/2013/05/10/photoblog-the-fence-and-the-evening-rainbow/</link>
<pubDate>Fri, 10 May 2013 21:05:30 +0000</pubDate>
<dc:creator>Myxl Dove</dc:creator>
<guid>http://myxldove.wordpress.com/2013/05/10/photoblog-the-fence-and-the-evening-rainbow/</guid>
<description><![CDATA[For the past week, I&#8217;ve been working on building a white picket fence around my front yard as]]></description>
<content:encoded><![CDATA[<p>For the past week, I&#8217;ve been working on building a white picket fence around my front yard as a Mother&#8217;s Day gift to my wife. Some of you may have seen a few of the photos from last Saturday on my FB page. But for those who haven&#8217;t, I&#8217;d like to share with you my progress! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>&#160;</p>
<h1 style="text-align:center;"><strong>Friday, May 3rd</strong></h1>
<p style="text-align:center;"><img alt="" src="http://x34.xanga.com/1bcf85f145633285036540/z227471967.jpg" /></p>
<p style="text-align:center;"><em>So I went to Home Depot and rented an auger the night before we were to begin, so I wouldn&#8217;t kill myself trying to dig post holes in the clay that Los Angeles substitutes for regular dirt.</em></p>
<p style="text-align:center;">
<p style="text-align:center;">
<h1 style="text-align:center;"><strong>Saturday, May 4th</strong></h1>
<p style="text-align:center;"><img alt="" src="http://x12.xanga.com/9bde17e632432285036542/z227471969.jpg" /></p>
<p style="text-align:center;"><em>Got up early on Saturday morning and hauled out said auger. </em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://x9a.xanga.com/b2fe13f745633285036541/z227471968.jpg" /></em></p>
<p style="text-align:center;"><em>My good friend Jonathan was helping me cut the lumber. These boards were being cut in half to be used as fence posts.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://xa8.xanga.com/853e12eb45633285036543/z227471970.jpg" /></em></p>
<p style="text-align:center;"><em>My son Micah using the auger to dig a post hole.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://xa2.xanga.com/d25e10e6c2733285036583/z227472009.jpg" /></em></p>
<p style="text-align:center;"><em>Aaron was lending a hand doing something constructive (destructive?) with this shovel.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://x89.xanga.com/9e5e16f345633285036544/z227471971.jpg" /></em></p>
<p style="text-align:center;"><em>Jonathan wanted a turn with the auger and wound up with a small burn on his arm when the auger kicked back and tagged him with the exhaust. :-/<br />
</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://x03.xanga.com/aa8f85ea45133285036584/z227472010.jpg" /></em></p>
<p style="text-align:center;"><em>Arielle, not one to be left out, was assisting with clay/dirt scattering. Because scattering is a big part of building&#8230; apparently.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://xb1.xanga.com/845e13f245133285036585/z227472011.jpg" /></em></p>
<p style="text-align:center;"><em>I wanted to make sure that each of the posts were not only the same height, but level as well. My dad was supervising.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://xee.xanga.com/24ce04e632435285036547/z227471974.jpg" /></em></p>
<p style="text-align:center;"><em>We decided on an 18 inch inset for the posts near our neighbors driveway so they wouldn&#8217;t have trouble getting into/our of their cars.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://x60.xanga.com/c54e17f045132285036586/z227472012.jpg" /></em></p>
<p style="text-align:center;"><em>Jonathan and I discussing the finer points of cement pouring. This is important as I didn&#8217;t realize cement pouring had fine points.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://x03.xanga.com/8bee36e552435285036549/z227471976.jpg" /></em></p>
<p style="text-align:center;"><em>My dad mixing the cement for us to, well&#8230; pour. Now that we&#8217;d agreed on all the finer points.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://x0d.xanga.com/098e1af145632285036545/z227471972.jpg" /></em></p>
<p style="text-align:center;"><em>Fence building is a family project.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://x90.xanga.com/d8be1be622732285036587/z227472013.jpg" /></em></p>
<p style="text-align:center;"><em>Another check of the post height. With all of the posts in and the cement poured, that was all we were able to do on the first day. We had to let the cement set before we could proceed any further.</em></p>
<p style="text-align:center;">
<p style="text-align:center;">
<h1 style="text-align:center;"><strong>Thursday, May 9th</strong></h1>
<p style="text-align:center;"><em><img alt="" src="http://xb0.xanga.com/8a7e03e632432285036562/z227471989.jpg" /></em></p>
<p style="text-align:center;"><em>My wife wanted to paint the posts before we started adding the rails.</em></p>
<p style="text-align:center;"><em><img alt="" src="http://x5e.xanga.com/a5de16f745633285036551/z227471978.jpg" /></em></p>
<p style="text-align:center;"><em>So she went around to all 15 posts and did just that.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://x69.xanga.com/5bde1ae632432285036552/z227471979.jpg" /></em></p>
<p style="text-align:center;"><em>My wife&#8217;s beautiful handiwork.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://xcd.xanga.com/bc0e15f745632285036561/z227471988.jpg" /></em></p>
<p style="text-align:center;"><em>Avery decided to show up and demonstrate how easy it is to apply fence paint to clothing.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://xe0.xanga.com/ab6e14eb45632285036563/z227471990.jpg" /></em></p>
<p style="text-align:center;"><em>Rail progress!</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://xe9.xanga.com/c67e03f145632285036555/z227471982.jpg" /></em></p>
<p style="text-align:center;"><em>Then, in the middle of everything, we had a beautiful evening rainbow that bloomed out of nowhere.</em></p>
<p style="text-align:center;">
<p style="text-align:center;"><em><img alt="" src="http://xc2.xanga.com/36ae07f745635285036556/z227471983.jpg" /></em></p>
<p style="text-align:center;"><em>We were trying to figure out what caused such an unusual glow and I later found out that there was an eclipse taking place. The residual light reflected off the moisture in the air, causing an ambient glow that lit up the entire neighborhood.</em></p>
<p style="text-align:center;">
<h1 style="text-align:center;"><strong>Friday, May 10th</strong></h1>
<p style="text-align:center;"><em><img alt="" src="http://x22.xanga.com/00de15f345632285036554/z227471981.jpg" /></em></p>
<p style="text-align:center;"><em>By the time we were done, it was too dark to get a good picture. So I took a few this morning before I headed in to work.</em></p>
<p style="text-align:center;"> <img alt="" src="http://x98.xanga.com/0d7e1be622732285036647/z227472073.jpg" /></p>
<p style="text-align:center;"><em><img alt="" src="http://xfe.xanga.com/03ce11eb45633285036553/z227471980.jpg" /></em></p>
<p style="text-align:center;"><em>We worked well into the night and managed to get all of the rails up. Now on Saturday we&#8217;ll start adding the pickets.</em></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Ruby on Rails Tutorial + Ruby Podcast]]></title>
<link>http://tryingabetterday.wordpress.com/2013/05/10/ruby-on-rails-tutorial-podcast/</link>
<pubDate>Fri, 10 May 2013 16:46:38 +0000</pubDate>
<dc:creator>luisvaz</dc:creator>
<guid>http://tryingabetterday.wordpress.com/2013/05/10/ruby-on-rails-tutorial-podcast/</guid>
<description><![CDATA[More on this topic: &gt; Great introdutory tutorial with a very complete explanation of the steps, f]]></description>
<content:encoded><![CDATA[<p>More on this topic:</p>
<p>&#62; Great introdutory <a title="ruby_tutorial" href="http://ruby.railstutorial.org/chapters">tutorial</a> with a very complete explanation of the steps, features used and good practices.</p>
<p>&#62; I&#8217;ve listened to a few episodes of <a title="ruby_podcast" href="http://rubyrogues.com/">this podcast</a> and so far found it very interesting. There&#8217;s a lot of things that they talk about that is alien to me but in the overall of the episodes, it doesn&#8217;t &#8216;scare&#8217; the listener (me <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[google "chef-solo rails deploy git submodule checkout branch sha"]]></title>
<link>http://amolnpujari.wordpress.com/2013/05/10/chef-solo-rails-deploy/</link>
<pubDate>Fri, 10 May 2013 04:52:34 +0000</pubDate>
<dc:creator>amolpujari</dc:creator>
<guid>http://amolnpujari.wordpress.com/2013/05/10/chef-solo-rails-deploy/</guid>
<description><![CDATA[Working with chef resource deploy, faced several issues with Git provider, for examples - enable_sub]]></description>
<content:encoded><![CDATA[<p>Working with chef resource deploy, faced several issues with Git provider, for examples</p>
<p>- enable_submodule does not work properly<br />
- it does not get the latest code from submodules<br />
- it does not allow you to choose specific branch and sha of any submodule<br />
- in fact for main repo it does not allow you to switch to any specific branch and sha<br />
- for some reason it says branch=version, who knows why &#8230;.</p>
<p>I tried correcting all above, and below is one of my examples, its working for me</p>
<p><script src="https://gist.github.com/amolpujari/5507227.js"></script></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[select and pluck]]></title>
<link>http://myrubylearning.wordpress.com/2013/05/09/select-and-pluck/</link>
<pubDate>Thu, 09 May 2013 22:21:04 +0000</pubDate>
<dc:creator>myrubylearning</dc:creator>
<guid>http://myrubylearning.wordpress.com/2013/05/09/select-and-pluck/</guid>
<description><![CDATA[For example, to select only id columns: Client.select(&#8220;id&#8221;) The SQL query used by this f]]></description>
<content:encoded><![CDATA[<p>For example, to select only id columns:<br />
Client.select(&#8220;id&#8221;)</p>
<p>The SQL query used by this find call will be somewhat like:<br />
SELECT id FROM clients</p>
<p>Be careful because this also means you’re initializing a model object with only the fields that you’ve selected. If you attempt to access a field that is not in the initialized record you’ll receive:</p>
<p>example:</p>
<p>a = Person.select(:name).uniq<br />
=&#62; [#&#60;Person name: "Mary"&#62;, #&#60;People name: "John"&#62;]<br />
irb(main):011:0&#62; a.first.name<br />
=&#62; &#8220;Mary&#8221;<br />
irb(main):012:0&#62; a.first.address<br />
ActiveModel::MissingAttributeError: missing attribute: address</p>
<p>pluck can be used to query a single column from the underlying table of a model. It accepts a column name as argument and returns an array of values of the specified column with the corresponding data type.</p>
<p><strong>select returns a Model object with only :column populated</strong><br />
<strong> pluck only returns the values</strong><br />
<strong> select(:id) will return an array of Model</strong><br />
<strong> pluck(:id) will return an array of integers ( suppose the column id has integer type)</strong></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Rails, migrations &amp; models...]]></title>
<link>http://lajackson2.wordpress.com/2013/05/09/rails-migrations-models/</link>
<pubDate>Thu, 09 May 2013 22:07:43 +0000</pubDate>
<dc:creator>mrbandersnatch</dc:creator>
<guid>http://lajackson2.wordpress.com/2013/05/09/rails-migrations-models/</guid>
<description><![CDATA[I really want to like rails. I hear nothing but good things about it and I&#8217;ve felt that I]]></description>
<content:encoded><![CDATA[<p>I really want to like rails. I hear nothing but good things about it and I&#8217;ve felt that I&#8217;ve been doing myself a disservice by not jumping in. So I did do recently&#8230;.and I&#8217;m not too sure I like what I see. </p>
<p>So migrations&#8230;yup, nice idea, keep the database in sync, provide a revision history, database vendor agnostic, fair enough. </p>
<p>Models&#8230;.bare absolutely no resemblance to the underlying schema generated by those migrations, if you look in the class file. That&#8217;s not nice. I shouldn&#8217;t have to keep referring to the schema to understand what underlying data structure the model represents. But okay, I can live with that, I can accept the argument that having an explicit definition in every class model is redundant even if I am not fully convinced. </p>
<p>Data validity&#8230;is enforced entirely at the application level. Seriously? Wahhhh&#8230;&#8230;wwwwww&#8230;w.aaaaaaa??!</p>
<p>I like data. I&#8217;ve been working with relational data models since the 80s. No, we don&#8217;t always need them. But if I&#8217;ve actually specified a relational database as my backend, specified in my &#8220;migrations and models&#8221; (in this case) the essentials to define those relationships, its not unreasonable to expect them to expect them to be honored IF I CHOOSE TO SWITCH ORMs OR FRAMEWORKS. </p>
<p>I guess what I am saying here is that I don&#8217;t expect to trade being database agnostic for being tied to a specific framework. Or as <a href="http://simononsoftware.com/why-ruby-on-rails-migrations-dont-work/">Ignacio Galindo writes</a> &#8220;Also allowing your rails app database to be written by an external app or framework it’s just INSANE!&#8221;. Well, if your <strong>database </strong> schema doesn&#8217;t enforce basic constraints it definitely is.</p>
<p>Look, again, I do get it. I can see the trade offs, and for a lot of applications this would be a non-issue. I see the use cases for NoSQL etc. but for applications where the data IS important, I cant see myself abandoning 30+ years of wisdom when it comes to <strong>enforcing </strong> constants. </p>
<p>Pfft, I guess I really am a dinosaur. Or am I missing the point? Please do tell&#8230;..</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Mass Update / Initialize Database Field]]></title>
<link>http://myrailslearnings.wordpress.com/2013/05/09/mass-update-initialize-database-field/</link>
<pubDate>Thu, 09 May 2013 17:38:13 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid>http://myrailslearnings.wordpress.com/2013/05/09/mass-update-initialize-database-field/</guid>
<description><![CDATA[I have a field that I need to mass update and I was looking for an efficient way to update them.  I]]></description>
<content:encoded><![CDATA[<p>I have a field that I need to mass update and I was looking for an efficient way to update them.  I found it with<a href="http://apidock.com/rails/ActiveRecord/Relation/update_all"> &#8220;update_all&#8221;</a>.  By doing:</p>
<p>Model.update_all :field=&#62;value</p>
<p>It will update all of the records to the value you want.  If you want to do it for only certain records, you can use a where clause like so:</p>
<p>Model.where(&#8220;foo = ?&#8221;, &#8220;bar&#8221;).update_all :field=&#62;value</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Tomb Raider: First Impressions]]></title>
<link>http://angryladyent.wordpress.com/2013/05/09/tomb-raider/</link>
<pubDate>Thu, 09 May 2013 16:15:08 +0000</pubDate>
<dc:creator>angry lady ent</dc:creator>
<guid>http://angryladyent.wordpress.com/2013/05/09/tomb-raider/</guid>
<description><![CDATA[So, it&#8217;s been awhile since I&#8217;ve done any gaming at all. Drawing has just been more of a]]></description>
<content:encoded><![CDATA[<p>So, it&#8217;s been awhile since I&#8217;ve done any gaming at all. Drawing has just been more of a priority.</p>
<p>Last night, however, I found myself with a little time and decided to fire up Tomb Raider.</p>
<p>Two things. I like the game, and I&#8217;m bored of the game.</p>
<p>I like the game because it&#8217;s a cool story so far, and we&#8217;re on a jungle island and jungle islands scare me&#8230;so that&#8217;s a plus. I enjoy the characters and the game looks pretty. And, like I said before, I enjoy playing a realistic female character.</p>
<p>But, mostly&#8230;I find myself bored.</p>
<p>I&#8217;m one of those people who likes to be immersed in a video game world. I love first person shooters and rpg&#8217;s. Hooray for hack and slash! I enjoy feeling like the game needs me in order to function properly. Zelda, Arkham Asylum, Fallout, Elder Scrolls, Torchlight&#8230;they all need the player&#8217;s involvement to keep the action going. I like that.</p>
<p>What I don&#8217;t like is hitting a few buttons and then letting the game play for me. Dragon Age: Origin (my first and only foray into that series) cemented the fact that I hate the cut scene. Like&#8230;hate. There were a few minutes of action, and then cut scene. Action&#8230;cuuuuuut sceeeeeene. Blippy action&#8230;.CUT SCENE.</p>
<p>Fuck me sideways! I just wanna play the game please!</p>
<p>In Tomb Raider I feel like I have a tiny bit more control than that, but a) I can&#8217;t play first person and b) the game takes over for me at nearly every opportunity. What&#8217;s the point of me being there if the game has control like that?</p>
<p>The other thing I&#8217;m not a huge fan of is playing a game with overly controlling rails. DO this, then do that, then do this, we&#8217;re not going to allow you to deviate from this path. I accept that there are reasons game developers have to keep a player concentrated on the quests at hand, but games like Skyrim have spoiled me rotten with the free exploration of the world you&#8217;re in. But, I&#8217;ve played games where the story line and game play are on rails, but it didn&#8217;t <em>feel</em> like it. Tomb Raider feels like it. It&#8217;s a little claustrophobic.</p>
<p>Nonetheless, I&#8217;m going to continue to play it because, like I said, I&#8217;m enjoying the story and want to see what happens. I also want to see if I get more control as the game progresses. If so, then I think I&#8217;ll like it more.</p>
<p>Until then, I&#8217;ll reserve my final judgement.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Rails vs ASP.NET MVC 4 First Impressions]]></title>
<link>http://programmingsportsandfood.wordpress.com/2013/05/08/rails-vs-asp-net-mvc-4-first-impressions/</link>
<pubDate>Thu, 09 May 2013 06:12:02 +0000</pubDate>
<dc:creator>eytanfb</dc:creator>
<guid>http://programmingsportsandfood.wordpress.com/2013/05/08/rails-vs-asp-net-mvc-4-first-impressions/</guid>
<description><![CDATA[I have to be responsible for an ASP.NET MVC 4 project after its development this summer, so one of m]]></description>
<content:encoded><![CDATA[<p>I have to be responsible for an ASP.NET MVC 4 project after its development this summer, so one of my priorities is to learn ASP.NET MVC 4. Even though I worked with ASP.NET before it wasn&#8217;t the MVC framework and my code looked like a simple PHP application, sending SQL queries to the database by actually writing them, or using stored procedures within the database. </p>
<p>Thanks to the <a href="https://www.dreamspark.com/">DreamSpark</a> account USC has, I downloaded Visual Studio 2012 to get familiar with that too. Another thing that comes with the DreamSpark account is a 90-day trial period with <a href="http://www.pluralsight.com/">PluralSight</a>, which has a huge library of tutorials written by Microsoft people. I started with the ASP.NET MVC 4 Fundamentals tutorial and watched the first module and here are the similarities and differences I saw with Rails.</p>
<p>First of all in terms of the basic principles, I found them to be the same. Well, that&#8217;s probably because they both use MVC and <a href="http://en.wikipedia.org/wiki/Convention_over_configuration">Convention over Configuration</a>. The folder structure is pretty similar as well. </p>
<p>Models, Views and Controllers all have their separate folders just like the app/models, app/views and app/controllers in Rails. Configurations have their own file, just like config. </p>
<h1>Routing</h1>
<p>The routing seemed to be almost the same to me, at least for now. The methods in the controller correspond to a view just like in rails. Here is an example:</p>
<pre class="brush: csharp; title: ; notranslate" title="">
public class HomeController : Controller
{
    public void Index()
    {
        return View();
    }
}
</pre>
<p>So the <code>Index</code> method of the <code>HomeController</code> requires an <code>Index.cshtml</code> file to render the necessary html. It could be even blank, as long as it is there. By the way &#8220;cshtml&#8221; is like &#8220;erb&#8221;, you can embed C# code into html, and I will show that new.</p>
<pre class="brush: xml; title: ; notranslate" title="">
@{
    ViewBag.title = &#34;My Title&#34;;
}
&#60;h3&#62;@ViewBag.title&#60;/h3&#62;
</pre>
<p>This code is is a little weird. Here is what I understand from this code and will try to explain in a little bit. But first let me show the Rails code for the same thing which might help those of you who are Rails developers trying to understand ASP.</p>
<pre class="brush: ruby; title: ; notranslate" title="">
class HomeController &#60; ApplicationController
    def index
         @title = &#34;My Title&#34;
    end
end
</pre>
<p>The corresponding view is <code>index.html.erb</code>.</p>
<pre class="brush: xml; title: ; notranslate" title="">
  &#60;h3&#62;&#60;%= @title %&#62;&#60;/h3&#62;
</pre>
<p>These both do the exact same thing (I say this without actually testing so please let me know if they don&#8217;t so I can correct it). They both respond to the <code>../home/index</code> url and display the same thing.</p>
<p>Now the differences are very apparent in terms of syntax so let me explain that a bit. In Rails I am used to passing the variables in the controller by assigning them to an instance variable like <code>@title</code>. However in ASP.NET you pass your variables to a ViewBag object, like so <code>ViewBag.title = </code>. I am assuming this is some kind of a hash with keys and values.</p>
<p>Now I have to just say that even though in this example we used the view of the <code>Index</code> method to assign the title, the same can be done in the controller and accessed in the view the same way. So we can remove the &#8220;@{}&#8221; part in the view and instead do this.</p>
<pre class="brush: csharp; title: ; notranslate" title="">
public void Index()
{
    ViewBag.title = &#34;My Title&#34;;
    return View();
}
</pre>
<p>This without changing the html code in the view would still yield the same result and display the same page.</p>
<h1>Database</h1>
<p>In Rails, we are used to creating migrations and using those to create and update the database. My first impression is the way ASP.NET handles it is almost the same. I don&#8217;t know what goes on in the background and there certainly are differences but here is the overall view on that.</p>
<p>ASP.NET MVC uses Entity Framework 5 to manage the &#8220;code-based migrations&#8221;. When it sees a class that derives from the <code>DbContext</code>, it goes in and looks for <code>DbSet</code> declarations, and then is able to create a database (Wait! Whaat?). Here is a code example: ( This assumes that Employee, and Department have been defined)</p>
<pre class="brush: csharp; title: ; notranslate" title="">
public class DepartmentDb : DbContext
{
    public DbSet&#60;Employee&#62; Employees { get; set; }
    public DbSet&#60;Department&#62; Departments { get; set; }
}
</pre>
<p>Entity Framework is now ready to create a DB called <code>DepartmentDb</code> and add the <code>Employee</code> and <code>Department</code> table in it with whatever attributes they were created with. So it looks into the code and understands what you want in your database, pretty clever I have to say. You can also specify the DB name if you don&#8217;t want it to be DepartmentDb and some other configurations but this is not the place to discuss that. One other nice thing is that you can put data in the database through code. When you enable migrations, the Migrations folders gives you a Configuration file, in which there is a <code>Seed</code> method, which if you will with the <code>AddOrUpdate</code> method. Here is how that goes: (The method signature for <code>Seed</code> is exactly from the auto-generated code)</p>
<pre class="brush: csharp; title: ; notranslate" title="">
public override void Seed(eManager.Web.Infrastructure.DepartmentDb context)
{
    context.Departments.AddOrUpdate(d =&#62; d.name,
             new Department() { Name=&#34;Engineering&#34; },
             new Department() { Name=&#34;Sales&#34; }
}
</pre>
<p>This code will ensure that departments Engineering and Sales will always be in the DB.</p>
<p><code>eManager.Web.Infrastructure.DepartmentDb</code> is just the location of the DepartmentDb file. <code>d =&#62; d.Name</code> tells the database to search the Departments table for names, and if there are no departments in the DB with the given name to add it. Pretty straight forward.</p>
<h1>Conclusion</h1>
<p>I think the first part of learning this framework has been relatively easy, since I didn&#8217;t have to wrap my head around an entirely new concept, like when I was trying to learn Rails as my first web development framework. The use of the controllers and views and models seems to be the same, which is a nice feature for a Rails developer (and I use the term loosely for my case). I will puts some ASP code on my <a href="http://github.com/eytanfb">GitHub</a> shortly, which will be a little different version of what the tutorial is showing.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[TWG]]></title>
<link>http://tomsdailydevelopment.wordpress.com/2013/05/09/twg/</link>
<pubDate>Thu, 09 May 2013 03:20:55 +0000</pubDate>
<dc:creator>Thomas</dc:creator>
<guid>http://tomsdailydevelopment.wordpress.com/2013/05/09/twg/</guid>
<description><![CDATA[So I graduated from Bitmaker Labs last Friday. On Tuesday I started working at The Working Group]]></description>
<content:encoded><![CDATA[<p>So I graduated from Bitmaker Labs last Friday. On Tuesday I started working at <a title="The Working Group" href="http://www.twg.ca" target="_blank">The Working Group</a> &#8211; a dev shop in Toronto. It&#8217;s rad. Surrounded by smart people all day, everyday. The first day was intense. Like jumping head first into a pool of some mysterious liquid. That liquid was composed of 45% awesome, 15% confusion, and 40% learning codes. The confusion being me not knowing how to do hard computer stuff.</p>
]]></content:encoded>
</item>

</channel>
</rss>
