Showing posts with label Difference between. Show all posts
Showing posts with label Difference between. Show all posts

Thursday, 1 December 2016

Difference between channel and playlist on youtube

Difference between channel and playlist on youtube

A channel is your identity on YouTube, like your name, your upload videos and comment as well.
OR
A channel  is the home page for an your account.

Question: What details on Available on home Channel page
--- Basic information like Your Name, Account type etc.
--- Your public videos which you have uploaded.
--- Listing of playlist.


Question: What we can do on on my Channel page
--- Update your information. --- upload videos.
--- customize the color theme of your channel.
--- Others can subscribe your channel.
Question: Sample of Channel?
https://www.youtube.com/channel/UCFPS0qKgr-GbSRAppOkdpUA





Question: What is playlist?
A playlist is a collection of videos you may saved.


Question: List of Playlist (After Login on youtube.com with your gmail.com account)
https://www.youtube.com/view_all_playlists


Create a New Playlist (After Login on youtube)
https://www.youtube.com/view_all_playlists
Click on "New Playlist", an popup will prompt, just add the your playlist name


Question: How to add videos in playlist?
Go to playlist page (Like https://www.youtube.com/playlist?list=PLREKFLRZTg5xJJHmLiKZ0VBTKpubGXksb).
Click on "Add Videos" (Middle Right side).
An Popup will prompt.
Just add the YouTube video URL (Any video which you like) and follow Steps.


Question: You can do following things with your playlist
--- Make the playlist as public/private.
--- Add notes to each videos.
--- Re-ordering the videos.
--- AutoPlay on/off for videos.
--- Share your playlist on Fb.
--- Embed your playlist videos in your website/blog.
Question: Need Playlist Sample URL
https://www.youtube.com/playlist?list=PLREKFLRZTg5xJJHmLiKZ0VBTKpubGXksb



Question: Can we earn money with playlist? No, You can't earn money on other's video (Uploaded by other).
You can earn money with your own videos (uploaded by you)

Saturday, 28 November 2015

Comparison between MySQL and MongoDB

Comparison between MySQL and MongoDB

Features MySQL MongoDB
Logo


Type of Database? Relational Database Document-oriented database
Initial release 23 May 1995 13 October 2015
Current Stable Version 5.7.18 / 10 April 2017 3.4.5 / 14 June 2017
Written in C/C++ C/C++, JavaScript
Open Source Yes Yes
License GPL (version 2) or proprietary GNU AGPL v3.0 (drivers: Apache license)
Offical Website http://www.mysql.com https://www.mongodb.org
How stored Data In Structed, data is stored in tables. Unstructed, data is stored in Collection in JSON Format.
Terminology Table
Row
Column
Joins
Collection
Document
Field
Embedded documents, linking
Normalization used to minimize data redundancy Normalization is obsolete for MongoDB
Get data from two different tables Joins are used References are used
Transactions vs Atomic Updates MySQL Support No supported
How to get data SQL Query is used you need to used functions with parameter
Security MySQL uses privilege-based security model. MongoDB security features include authentication, authorization and auditing
Select Query
SELECT * FROM users
 WHERE name LIKE "%Web%";
db.books.find({"name": { 
"$regex":  "Web" }});
Insertion Query
INSERT INTO users (user_id, age, status) 
VALUES ("100", 20, "Active")
db.users.insert({  user_id: "100",
  
age: 20,  status: "Active"})
Update Query
UPDATE users SET status = "Active" 
WHERE age > 25
db.users.update( {
age: { $gt: 25 } }, { $set: { 
status: "Active" } }, { multi: true }
)
Insert data Speed Normall Much Faster as compare to MySQL
Best Database for Very-2 Heavy Site Not MongoDB is better
DBA Required Yes, For better performance Not required
Rich Data Model No Yes
Dyamic Schema No Yes
Typed Data Yes Yes
Data Locality No Yes
Field Updates Yes Yes
Easy for Programmers No Yes
Complex Transactions Yes No
Auditing Yes Yes
Auto-Sharding No Yes

Tuesday, 8 September 2015

What are differences between $(document).ready and $(window).load?


What are differences between $(document).ready and $(window).load?

$(document).ready();
$(document).ready(function() {
 /** Add your code here **/
            


/** Add your code here **/

 console.log("HTML Document is fully load. HTML, javaScript and CSS is fully loaded.");
});

JavaScript code written inside $(document).ready will be called when HTML Document is fully loaded. It means JavaScript code will be called just after HTML, JavaScript & CSS is fully loaded.



$(window).load();
$(window).load(function() { 
 /** Add your code here **/
            


/** Add your code here **/


 console.log("Web page fully Loaded. HTML, Javascript, CSS, Images, Iframes and objects are fully loaded.");
});


JavaScript code written inside $(window).load will be called when Web page fully Loaded. It means JavaScript code will be called just after HTML, Javascript, CSS, Images, Iframes and objects are fully loaded.

Following document ready have same meaning and work as same.
$(document).ready(function(){

});
OR
$(function(){

});
OR
$(document).on('ready', function(){
})



Monday, 1 June 2015

Differences between Stored Procedures and Functions in MYSQL

Differences between Stored Procedures and Functions in MYSQL

  1. Stored Procedure can return zero or n values whereas function can return one value which is mandatory.
  2. Functions can be called from procedure whereas procedures cannot be called from function.
  3. Procedures can have input/output parameters for it whereas functions can have only input parameters.
  4. Procedure allows select as well as DML statement in it whereas function allows only select statement in it.
  5. Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
  6. We can go for transaction management in procedure whereas we can't go in function.
  7. Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.

Monday, 30 March 2015

Difference between MVC and MVP design pattern

Difference between MVC and MVP design pattern


MVC and MVP both are design pattern and used to do development the project.


S.No MVC MVP
1 Full form is Model View Controller Full form is Model View Presenter
2 MVC is Front Controller based approach. MVP is Page Controller based approach
3 When request comes, Controller interact with Model (and get data) and then send the data to view. When request comes, View interact with Presenter (presenter interact with model for get data and do format) and presenter sent back the data to view.
4 Controller is responsible for displaying the view and controller can change the view also. Controller does not exist.
View is more loosely coupled to the model. The presenter is responsible for binding the model to the view.
5 View can interact with model directly. View can't interact with model directly. View must use presenter to interact with Model.
6 Limited Support Unit Testing Highly Support Unit Testing
7. It is design pattern used to separate the view from model. Advance form of MVC.
8. Following are working:
Model View Controller

Following are working:

Model View Presenter



Tuesday, 24 March 2015

What is difference between event.preventDefault() and return false in Javascript?

What is difference between event.preventDefault() and  return false in Javascript?


e.preventDefault() will prevent the default event from occuring.
Means If this method is called, the default action of the event will not be triggered.

This method does not accept any arguments.
Example:
jQuery(document).ready(function(){
    $('a.link').click(function (e) {
        e.preventDefault();
    });
});



e.stopPropagation() will prevent the event from bubbling.
Means If this method is called, It Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.

This method also does not accept any arguments.
Example:
jQuery(document).ready(function(){
    $('a.link').click(function (e) {
        e.stopPropagation();
    });
});



return false: Will do above both that is preventDefault & stopPropagation.
Example:
jQuery(document).ready(function(){
    $('a.link').click(function (e) {
        return false;
    });
});




What is the difference between call and apply in javascript?


What is the difference between call and apply in javascript?


In Javascript, call() and apply() are predefined methods. Both methods can be used to invoke a function & must have the owner object as first parameter. See More detail below:


apply lets you invoke the function with arguments as an array.
View Example:
            function myFunction1(a, b) {
                return a + b;
            }
            var myobj1 = new Object();
            var result1 = myFunction1.call(myobj1, 5, 6);
            console.log('Result with call function: ' + result1);



call requires the parameters be listed explicitly one by one.
View Exmple:
            function myFunction2(a, b) {
                return a + b;
            }
            myArray = [5, 6];
            var myobj2 = new Object();
             var result2 = myFunction2.apply(myobj2, myArray);   
             console.log('Result with Apply function: ' + result2);





Sunday, 22 March 2015

Difference between inner join and outer join in MySQL

Difference between inner join and outer join in MySQL


Joins are used to get the records from two OR more tables. Following are different type of joins  used in mysql.
  • Left Join
  • Right Join
  • Inner Join
  • Self Join
  • Outer Join


Following are difference between Inner Join & Outer Join.

Inner Join: It is used to get the common records from two table or more tables.

MySQL Inner Join Example:
SELECT * FROM `geo_cities` as gc INNER JOIN meta_data AS md on md.city_id=gc.id;


Outer Join: It is used to get the all records from two tables or more tables.
MySQL Outer Join Example:
MySQL does not provide the FULL JOIN.
You need to UNION the result of Right Join and Left Join from both tables.
SELECT * FROM `geo_cities` as gc LEFT JOIN meta_data AS md on md.city_id=gc.id
UNION
SELECT * FROM `geo_cities` as gc RIGHT JOIN meta_data AS md on md.city_id=gc.id




Wednesday, 11 March 2015

Difference between theme and template in website


Difference between theme and template in website

Template:
A website template is a set of HTML webpages (It have Own JS/CSS/Images) that gives a beautiful look of website. An Website can be more than one template and each template will have different design.

For Example:
 Desktop version: We show full fledge content of website with lot of other options like View Related post, What other are viewing, Big images and Big Font size etc.
 Mobile version:  We show full fledge content of website with limited option like View Related post, and What other are viewing, show small images and small fount etc


Theme:
A Theme is a part of Template. One template can have one or more themes. Each theme can have its own JS/CSS/Images. Two different themes of same template will have same design but their color combinations and images may be different.




Tuesday, 10 March 2015

Difference between in_array and array_key_exists in php with example

Difference between in_array and array_key_exists in php with example

in_array: Checks if a value exists in an array OR not.
bool in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] );

Parameters
needle: The searched value.
haystack: The array.
strict: If the third parameter strict is set to TRUE then the in_array() function will also check the types of the needle in the haystack.

Return: Returns TRUE if needle is found in the array, FALSE otherwise.

Example:
$array = array("Web", "Technology", "Experts", "Notes");
if (in_array("Technology", $array)) {
    echo "Record Found in value";
}



array_key_exists: Checks if the given key/index exists in the array.
bool array_key_exists ( mixed $key , array $array );
Parameters key: Value to check.
array: An array with keys to check.

Return: Returns TRUE on success or FALSE on failure.

Example:
$searchArray = array('Web' => 1, 'Technology' => 4);
if (array_key_exists('Web', $searchArray)) {
    echo "Record Found in key";
}

Monday, 19 January 2015

Difference between SSL and HTTPS


Difference between SSL and HTTPS

Today, We all do the online shopping, money transfer, different types of recharge (Mobile/DTH etc) and login to bank website etc. These all action are done on web browser (like google chrome, mozilla, internet explorer etc). When we are doing online stuff, its very necesary that the website we are using is 100% secure, So you must do online stuff when your website page start with https, like https://gmail.com.

There are two protocols (SSL and Https) which secure our online transactions. SSL and HTTPS can be seen as complementary rather than competing. Both protocols (SSL and HTTPS) works for security at different leavel and have been approved by the Internet Engineering Task Force (IETF) as a standard.


Following are main Difference between SSL and HTTPS:


S.No SSL HTTPS
1 Full form of Secure Sockets Layer Full form of HTTPS is HyperText Transfer Protocol Secure.
2 SSL is Transport layer protocol. HTTPS is application layer protocol.
3 Encryption by SSL is application-independent. Encryption by SSL is application-dependent.
4 Cryptographic Protocol that is used to provide security for the communications over the internet. HTTPS is a protocol created by combining HTTP and SSL/TLS to provide security for the communications over the internet.
5 HTTPS is less flexible as compare to HTTPS HTTPS is more flexible







Monday, 5 January 2015

Difference between Notice and warning and fatal error

Difference between Notice and warning and fatal error


Notice
  • A notice is an advisory message like "You probably shouldn't be doing what you're doing"
  • Execution of the script is not halted
  • Example
    echo $undefinedVariable;



Warning
  • A warning is a message like "You are doing something wrong and it is very likely to cause errors in the future, so please fix it." Execution of the script is not halted;
  • Example
    echo 1/0;



Fatal Error
  • Fatal run-time errors
  • Execution of the script is not halted
  • Example  
    require_once "notexistfile.php"

Saturday, 20 December 2014

Difference between overloading and overriding in php with Example

Difference between overloading and overriding in php with Example


Overloading: In Real world, overloading means assigning some extra stuff to someone. As as in real world Overloading in PHP means calling extra functions.
Example of Overloading:
class testclass {
    public $_data;
    public function __get($name) {
        echo "Getting '$name'\n ";
        return $this->data[$name];
    }
}

$obj = new testclass();
/** Magic method Example * */
echo $obj->a; //As __get function called - Overloading example 2
/** Magic method Example * */ 

We can do overloading with magic methods and are following:
__construct(), __destruct(), __call(), __callStatic(), __get(), __set(), __isset(), __unset(), __sleep(), __wakeup(), __toString(), __invoke(), __set_state(), __clone() and __debugInfo()



Overriding: In Real world, Overriding means changing the parental behaviour in Child. As as in real world Overriding in PHP means calling of child function instead of parent function, both class's function have same name.
Example of Overriding:
class parentclass {
    function name() {
        return 'Parent';
    }
}

class childclass extends parentclass {
    function name() {
        return 'Child';
    }
}

$obj = new childclass();
echo $obj->name();//It called child function instead of parent parent function - Overriding Example


Thursday, 9 October 2014

What is difference between natcasesort and sort?

What is difference between natcasesort and sort?


Question: What is difference between natcasesort and sort?
$arrayData1 = $arrayData2 = array('Test1', 'Test10', 'Test20', 'Test30', 'Test00', 'Test5');

sort($arrayData1);
echo "Standard sorting\n";
print_r($arrayData1);

natcasesort($arrayData2);
echo "\nnatcasesort Sorting\n";
print_r($arrayData2);

Output
Standard sorting
Array
(
    [0] => Test00
    [1] => Test1
    [2] => Test10
    [3] => Test20
    [4] => Test30
    [5] => Test5
)

natcasesort Sorting
Array
(
    [4] => Test00
    [0] => Test1
    [5] => Test5
    [1] => Test10
    [2] => Test20
    [3] => Test30
)

Friday, 3 October 2014

Difference Between Hadoop and Big-Data

Difference Between Hadoop and Big-Data


Big data is a term, everything where you stored lots of data which is unstructured is bigdata. For example computer hard drive where we put movies, songs, excel file, doc file, application file and reports in just one folder.

Big data is simply the large sets of data that business person and other parties put together to serve specific goals and operations. Big data can include many different kinds of data in many different kinds of formats.

Big data is just a storage system where we stored millons of millions files.




Hadoop: It is open-source software framework for storage and large-scale processing of data-sets based on mapReduce. MapReduce splits big Data over several nodes in order to achieve a parallel computing.

Hadoop is software program which works on big data to provide you useful information.

Hadoop is just a software which filter the required information from tons of information.

Hadoop Interview Questions And Answers



Monday, 18 August 2014

Difference Between Primary Key And Unique Key And Foreign Key And Composite Key

Difference Between Primary Key And Unique Key And Foreign Key And Composite Key

Primary Key
  1. Primary Key can identify a row as uniquely 
  2. A table can have  only one primary key
  3. It can't be Null
  4. Indexing added automatically to Primary key


Foreign Key
  1. A FOREIGN KEY in one table reference to a Primary Key in another table
  2. A table can have  one OR more foreign key.
  3. It can be Null 
  4. Indexing not added automatically to Foreign key


Unique Key
  1. Unique Key can identify a row as uniquely.
  2. A table can have  one OR more unique key.
  3. It can be Null
  4. Indexing not added automatically to Unique Key


Composite Key
  1. A composite key contains at least one compound key and one more attribute. Composite keys may also include simple keys and non-key attributes.
  2. A table can have one OR more composite Key
  3. It can also be null.

See Example:
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `phone` varchar(100) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `user_profile` (
  `user_id` int(11) NOT NULL,
  `address1` varchar(100) NOT NULL,
  `address2` varchar(100) NOT NULL,
  KEY `user_id` (`user_id`),
FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1

Primary Key: users.id
Foreign Key: user_profile.user_id
Unique Key:  users.email