Sunday, July 31, 2016

Saturday, July 30, 2016

Bloom's Taxonomy for Software Development

You can read the basics of Blooms Taxonomy. Bloom’s revised taxonomy of cognitive processes for our purpose of software development education is as follows:

  1. Remember
  2. Understand 
  3. Apply 
  4. Analyze 
  5. Evaluate and
  6. Create

For self-learning, we can use this revised Bloom's taxonomy of learning outcomes. Note that we don't use the knowledge dimension and cognitive process dimension. We stay at the highest level.

References

Project-centric Evolutionary Teaching in Software Development Education
Bloom’s Taxonomy wrt Software Development Education

Friday, July 29, 2016

RubyPlus Screencast Feed

Learn practical tips and techniques on how to develop web applications using Ruby on Rails web framework. The episodes are short to minimize the amount of content to avoid overwhelming learners. The episodes are designed to give developers a quick way to get their feet wet and learn by building web apps.

Wednesday, July 27, 2016

How to find out where ruby executable is installed

$ irb --simple-prompt -rrbconfig
> RbConfig::CONFIG['bindir']
 => "/Users/bparanj/.rvm/rubies/ruby-2.2.3/bin"
> exit
~ bparanj$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
~ bparanj$ which ruby
/Users/bparanj/.rvm/rubies/ruby-2.2.3/bin/ruby
~ bparanj$

Key Ruby Directories and their RbConfig Terms

~ bparanj$ irb --simple-prompt -rrbconfig
> RbConfig::CONFIG['vendordir']
 => "/Users/bparanj/.rvm/rubies/ruby-2.2.3/lib/ruby/vendor_ruby"
> RbConfig::CONFIG['sitedir']
 => "/Users/bparanj/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby"
> RbConfig::CONFIG['archdir']
 => "/Users/bparanj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/x86_64-darwin14"
> RbConfig::CONFIG['rubylibdir']
 => "/Users/bparanj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0"

Beautiful Markup Rails Conf Presentation Notes

Learn the html elements. Download HTML 5 and CSS 3 smashingmagazine cheatsheets.
Don't use div_for?.
Use content_tag only if necessary.
Avoid markup in helpers.
Web accesibility: Use alt tags in link_to and image_tag.
Use CSS Sprites with Rails helper methods. SVN 37signals blog article.
image_sprite :email, class: 'email', title: 'Email'
Checkout deadweight and startups gems.
Dust Me Selectors Firefox add on.
Checkout rack-tidy gem

RubyPlus Podcast Episode 10


Sunday, July 24, 2016

Unit Test and Number of Assertions

Good unit tests should fail for exactly one reason, that's why you should be using one assert per unit test. 
Test one logical concept per test. You can have multiple asserts on the same object. They will usually be the same concept being tested. Roy Osherove.

Tuesday, July 19, 2016

Movie Review Rails 5 App Screencasts

The first 6 episodes of RubyPlus screencasts is based on the following articles.

1. Integrating Twitter Bootstrap 4 with Rails 5
2. Twitter Bootstrap 4 Forms and Navigation in Rails 5

- Tab highlighting
- Border and Box Shadow Effect

3. Implementing Search Feature using Searchkick, Twitter Bootstrap 4 and Rails 5

- ElasticSearch
- Searchkick

4. Using Star Rating jQuery Plugin Raty with Twitter Bootstrap 4 in Rails 5 Apps

- JQuery Raty Plugin for Star Rating

ReferenceError: Stripe is not defined

1. Make sure you have:
<body data-no-turbolink>

2. <script src="https://js.stripe.com/v2/"></script>



Possible Problem:
<script src="https://js.stripe.com/v2/"></script>

Possible Fix: 



Remove the comma in the form:




<form action="create" method="POST" id="payment-form", class='form-horizontal'>

Friday, July 15, 2016

RailsConf 2016 - Get a Whiff of This by Sandi Metz

The Problem

If you have watched this video:  https://www.youtube.com/watch?v=PJjHfa5yxlU  you will see around 30 mins mark, the code that looks like this:





This test does not test anything. She has stubbed her test, so it is meaningless. The test proves that a double class you created returns 47 in the assertion. You should never stub yourself out in a test. State based testing in this case is not the right choice. You can also pass junk values for the starting and ending values, the test will still pass. You can even pass empty params, the test will still pass.

You want exactly one test to fail for any given bug. This test will fail if you change 47 to any other number, string, nil or anything else. The emphasis of the current test is not on whether the message to total was sent or not.

Tests that are not written with their role as specifications in mind can be very confusing to read. The difficulty in understranding what they are testing can greatly reduce the velocity at which a codebase can be changed. Nat Pryce and Steve Freeman "Are your tests really driving your development?"

The Solution

What is the fix? The total class method belongs to our application and not ActiveRecord, so we can safely mock this method and still keep our tests running fast without hitting the database. I am shocked by how some of the speakers get their talks approved for a Railsconf with technical errors like this in their presentation.


Thursday, July 14, 2016

acts-as-taggable-on and Rails 5

Bundler could not find compatible versions for gem "activerecord":
  In snapshot (Gemfile.lock):
    activerecord (= 5.0.0)

  In Gemfile:
    acts-as-taggable-on (~> 3.4) was resolved to 3.4.0, which depends on
      activerecord (< 5, >= 3.2)

    rails (~> 5.0.0) was resolved to 5.0.0, which depends on
      activerecord (= 5.0.0)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

Resolution:

gem 'acts-as-taggable-on', :git => 'https://github.com/mbleigh/acts-as-taggable-on'

Wednesday, July 13, 2016

div_for deprecated

You don't need any gem replace div_for with html tags. For example:

div_for(comment) becomes


<div id="comment_1234" >
  <td>My Comment</td>
</div>

Ruby Plus Podcast Episode 9





Simple Example for Value Capture in a Business

Almost everyone knows that a business needs to create value, but they probably don't know about capturing value. The simplest example is the CoinStar. Do you have a piggy bank that’s ready to burst, or a bag of change that you’d like to deposit into your account? CoinStar® machines quickly count up your coins and provide you with cash. A fee of 10% will be deducted from your deposit. The business captures value by charging a percentage of fees. CoinStar considers it's service to be of value, some of the people would consider that it adds enough value to give 10% of their deposit.

Friday, July 08, 2016

How to write technical articles

More I wrote, easier it became to create content. Whenever I encounter problems during development, I document the steps I took to resolve them and package it as an article. It also helps me to think clearly because I create a rough draft of the article by documenting every step I try and the outcome of my experiment.  I know it will save readers ton of time because I had to spend a fair amount of time to research and try different suggestions from other developers. I enjoy it a lot. Learning from other blogs, the research process and the satisfaction of resolving tough problems is very fulfilling.