Monday, September 28, 2015

Ruby 2.2.3 Object Basics : Part 7

Ruby 2.2.3 Object Basics such as enum_for, to_enum, tainted? and taint. Click on the image below to watch the video.

Ruby 2.2.3 Object Basics : Part 6

Ruby 2.2.2 Object methods such as singleton_methods, tainted?, taint and tap is covered in this video. Click the image below to watch it.

Ruby 2.2.3 Object Basics : Part 5

Ruby 2.2.3 Object methods such as public_send, send, remove_instance_variable, respond_to?, singleton_class, and singleton_method. Click on the image below to view the video.

Sunday, September 27, 2015

Ruby 2.2.3 Object Basics : Part 4

Ruby 2.2.3 Object methods such as method, methods, nil?, freeze, object_id, protected_methods, public_methods and private_methods. Click the image below to watch the video.

Ruby 2.2.3 Object Basics : Part 3

Ruby 2.2.3 Object methods such as instance_variable_defined?, instance_variable_get, instance_variable_set, is_a?, kind_of?, itself and instance_variables. Click on the image below to watch the video.

Ruby 2.2.3 Object Basics : Part 2

Ruby 2.2.3 Object methods such as ==, equal?, eql?, extend, freeze, frozen?, instance_of? and inspect. Click on the image below to watch the video.

Ruby 2.2.3 Object Basics : Part 1

Ruby 2.2.3 Object basics such as available constants, data section, clone and define_singleton_method. Click on the image below to view the video.

Wednesday, September 23, 2015

Ruby 2.2.3 BasicObject Basics : Part 2

Ruby 2.2.3 BasicObject methods such as singleton_method_added, singleton_method_removed and singleton_method_undefined. Click on the image below to view the video.

Ruby 2.2.3 BasicObject Basics : Part 1

Ruby 2.2.3 basic methods such as ==, equal?, eql?, object_id, send, instance_eval and instance_exec. Click the image below to watch the video.

Sunday, September 20, 2015

Ruby 2.2.3 Symbol Basics : Part 2

Ruby 2.2.3 Symbol methods such as <=>, casecmp, empty?, intern, encoding, id2name, inspect, to_sym, length, slice, succ, swapcase and match . Click on the image below to watch the video.

Ruby 2.2.3 Symbol Basics : Part 1

Ruby 2.2.3 Symbol methods such as object_id, to_s, ==, <=>, to_s, [] and all_symbols. Click on the image below to watch the video.

Ruby 2.2.3 Hash Basics : Part 7

Ruby 2.2.3 Hash methods such as to_a, to_h, to_s, inspect, merge!, has_value?, values and values_at. Click the image below to view the video.

Ruby 2.2.3 Hash Basics : Part 6

Ruby 2.2.3 hash methods such rehash, reject, replace, select, shift and store. Click the image below to view the video.

Ruby 2.2.3 Hash Basics : Part 5

Ruby 2.2.3 Hash methods such as key, has_key?, delete, member?, merge and rassoc. Click the image below to view the video.

Ruby 2.2.3 Hash Basics : Part 4

Ruby 2.2.3 hash methods such as default proc, delete, delete_if, each and each_key. Click on the image below to watch the video.

Ruby 2.2.3 Hash Basics : Part 3

Ruby 2.2.3 hash methods such as assoc, key, any?, default and compare_by_identity?. Click on the image below to watch the video.

Ruby 2.2.3 Hash Basics : Part 2

Ruby 2.2.3 hash methods such as default, ==, upcase and try_convert. Click on the image below to view the video.

Ruby 2.2.3 Hash Basics : Part 1

Ruby 2.2.3 Hash methods such as default, comparison and access. Click on the image below to watch the video.

Saturday, September 19, 2015

Ruby 2.2.2 Array Basics : Part 12

Ruby 2.2.3 methods such as zip, values_at, unshift, uniq! and to_h. Click the image below to view the video.

Ruby 2.2.2 Array Basics : Part 11

Ruby 2.2.2 Array methods such as sort, take, take_while, uniq, transpose, to_h and transpose. Click the image below to watch the video.

Ruby 2.2.2 Array Basics : Part 10

Ruby 2.2.2 Array methods such as repeated_permutation, replace, reverse, reverse_each, rindex, rotate, sample, select, shift and shuffle.

Ruby 2.2.2 Array Basics : Part 9

Ruby 2.2.2 Array methods such as pack, permutation, pop, product, push, rassoc, reject and repeated_combination. Click on the image to watch the video.

Friday, September 18, 2015

Ruby 2.2.2 Array Basics : Part 8

Ruby 2.2.2 Array methods such as frozen?, freeze, hash, include?, index, replace, insert, join, keep_if, last, collect, map and map with_index. Click on the image below to watch the video.

Ruby 2.2.2 Array Basics : Part 7

Ruby 2.2.2 Array methods such as drop_while, each_index, empty?, fetch, fill, index, first and flatten is covered. Click on the image below to watch the video.

Ruby 2.2.2 Array Basics : Part 6

Ruby 2.2.2 Ruby methods such as collect, map with index, map, combination, compact, concat, delete_at and delete_if. Click the image below to watch the video.





Problem Solving Techniques for Developers

Learn how to use :

1. Fish Bone Diagram
2. Why-Why Diagram and
3. How-How Diagram

to solving problems. Read the article here: Problem Solving Techniques for Developers





Ruby 2.2.2 Array Basics : Part 5

Ruby 2.2.2 Array methods such as any?, assoc, at, bsearch and clear. Click the image below to view the video.

Thursday, September 17, 2015

Ruby 2.2.2 Include and Extend Basics

Pre-requisites

 - Instance method and class method
 - included() hook method

Concepts Covered

1. Using Mixin to invoke an instance method in a module using include.
2. Using extend to to invoke a class method in a module
3. Using Plugin idiom to invoke instance and class methods in a module from a class.

Click the image below to watch the video.



Ruby 2.2.2 Array Basics : Part 4

Ruby 2.2.2 Array manipulations using &, *, +, -, <<, <=> and ==. Click the image below to watch the video.

Ruby 2.2.2 Array Basics : Part 3

Ruby 2.2.2 array methods such as equal?, try_convert and []. Click the image below to watch the video.

Ruby 2.2.2 Array Basics : Part 2

This video covers methods such as insert, pop, shift, delete_at, delete, compact, uniq, select, reject, drop_while, delete_if and keep_if. Click the image below to watch the video.

Wednesday, September 16, 2015

Ruby Interview Questions : Include vs Extend

How to implement extend with include?

  
  module Laughable
    def laugh
      p 'ha ha'
    end
  end

  class Clown
    class << self
      include Laughable
    end
  end

  Clown.laugh

  class Tiger
    extend Laughable
  end


  Tiger.laugh



Click the image below to watch the video.

Ruby 2.2.2 Array Basics : Part 1

Ruby 2.2.2 Array : push, unshift, include? and indexing. Click the image below to view the video.

Tuesday, September 15, 2015

Ruby Interview Question : Calculate Word Frequency

Two different solutions to calculating word frequency for a given text in Ruby. Click the image below to watch the video.

Monday, September 14, 2015

Ruby Interview Questions : Part 1

Logical and operator precedence, true and false boolean values and three different ways to call a method. Click on the image below to view the video.

Error installing mysql2 gem on Ubuntu

apt-get install libmysqlclient-dev

Error during json gem installation on Ubuntu 14

Error : /usr/bin/ld: cannot find -lgmp Solution: sudo apt-get install libgmp3-dev

Sunday, September 13, 2015

Ruby 2.2.3 String Basics : Ruby Silent Cast Part 13

Ruby 2.2.3 string methods ==, ===, chars, each_char, getbytes, setbytes, lines and next.

Friday, September 11, 2015

Ruby 2.2.3 String Basics : Ruby Silent Cast Part 12

Covers Ruby 2.2.3 tr_s, unpack, upcase, upto, force_encoding and valid_encoding? . Click the image below to view the video.

Ruby 2.2.3 String Basics : Ruby Silent Cast Part 11

Covers Ruby 2.2.3 to_r and tr . Click the image below to view the video.

Ruby 2.2.3 String Basics : Ruby Silent Cast Part 10

Covers Ruby 2.2.3 sum, swapcase, to_c and to_f. Click the image below to view the video.

Ruby 2.2.3 String Basics : Ruby Silent Cast Part 9

Covers Ruby 2.2.3 start_with?, strip and sub. Click the image below to view the video.

Ruby 2.2.3 String Basics : Ruby Silent Cast Part 8

Ruby 2.2.3 slice, split and squeeze. Click the image below to view the video.

Ruby 2.2.3 String Basics : Ruby Silent Cast part 7

Ruby 2.2.3 scan, scrub and indexing using regex. Click the image below to view the video.

Thursday, September 10, 2015

mysql2 gem error during Rails 4.2.4 upgrade

Error `rescue in spec': Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError) Solution Add the following version of mysql2 gem to Gemfile. gem 'mysql2', '~> 0.3.18' run bundle.

Ruby String Basics Silent Cast : Part 6

Ruby 2.2.3 string basics such as oct, ord, partition, prepend, replace, reverse, rindex, rjust, rpartition and rstrip. Click the image below to watch the video.

Ruby String Basics Silent Cast : Part 5

Click on the image below to play the silent cast.
This episode covers Ruby 2.2.3 basics such as converting string to symbols, symbol comparison, ljust, lstrip, regular expression match and succ.

Object Reuse vs Component Reuse

In the 1992 book 'Object Oriented Software Engineering: A Use Case Driven Approach' Ivar Jacobson talks about three types of objects and one of the types he talks about is Entity. Let's say we have a product, the intention is to reuse this object in different applications such as Order Entry, Fulfillment, Inventory Management, Catalog etc.

There are several problems with this object reuse:

1. The object becomes big.
2. Only some methods are used in some applications.

 From the perspective of the developer of that
object, it is difficult to figure out which applications will be affected when a certain method changes. It is easier to reuse if a group of objects provides a service that is focused on doing one thing really well. In this approach you may end up with different components that have the product object, but they will be small since they are focused on doing only one thing. We can namespace the product so that there will be no conflicts in applications that use them.

Ruby String Basics : Part 4

Click the image below to watch the Ruby SilentCast and learn Ruby 2.2.3 String methods : empty?, size, gsub, ord, hex, include?, index, replace, insert and inspect.

Tuesday, September 08, 2015

Ruby String Basics : Part 3

Ruby 2.2.3 methods char, clear, concat, count, crypt, delete, downcase, dump, each_byte, each_char, each_codpoint and each_line.

Ruby 2.2.3 String Basics : Part 2

Ruby 2.2.3 String basics that covers force_encoding, bytesize, byteslice, capitalize, casecmp, center, chomp and chop.