Monday, 4 November 2019

How to use module as Namespace in ruby?

 Module or Mix-in used as a Namespace in ruby. It is used to avoid collision between two classes.


module Rajkumar
    class Uthayaa
        attr_accessor :email

        def display_email
            puts "my email is #{@email}"
        end
    end
end

module Somu
    class Uthayaa
        attr_accessor :email

        def display_email
            puts "my email 2 is #{@email}"
        end
    end
end

puts raj = Rajkumar::Uthayaa.new
puts raj.email='rajutaya@gmail.com'
puts raj.display_email
puts raj = Somu::Uthayaa.new
puts raj.email='lalalslsls@gmail.com'
puts raj.display_email

How Database index is functioning?


Indexing is a way to optimize the performance of a database by minimizing the number of disk accesses required when a query is processed. It is a data structure technique which is used to quickly locate and access the data in a database.

Indexes are created using a few database columns.
  1. The first column is the Search key that contains a copy of the primary key or candidate key of the table. These values are stored in sorted order so that the corresponding data can be accessed quickly.
  2. Note: The data may or may not be stored in sorted order.
  3. The second column is the Data Reference or Pointer which contains a set of pointers holding the address of the disk block where that particular key value can be found.


Sunday, 3 November 2019

How to install skype on ubuntu 16.04


Kindly run the below commands in terminal for skype installation.

1. Add skype linux repository in your system.

   $ echo "deb [arch=amd64] https://repo.skype.com/deb stable main" | sudo tee /etc/apt/sources.list.d/skype-stable.list

2. To fetch and install Skype public key so that APT package manager verify from repository.

   $ wget https://repo.skype.com/data/SKYPE-GPG-KEY
$ sudo apt-key add SKYPE-GPG-KEY

3. To use https
$ sudo apt install apt-transport-https

4. Update the software source and install skype
$ sudo apt update
 $ sudo apt install skypeforlinux

5. Once installed type skypeforlinux in your application. You can use your skype.

Interactor in Rails

What is interactor? Interactor provides a common interface for performing complex user interactions An interactor is a simple, sin...