Skip to content

Instantly share code, notes, and snippets.

View dhpradeep's full-sized avatar
🏠
Working from home

Pradip Dhakal dhpradeep

🏠
Working from home
View GitHub Profile
@dhpradeep
dhpradeep / c++_question.md
Last active August 27, 2021 10:20
Suppose you as a derived class and you mom and dad as a parent class. Relating to this, write a program and explain the concepts of multiple inheritance.

Suppose you as a derived class and you mom and dad as a parent class. Relating to this, write a program and explain the concepts of inheritance, encapsulation and polymorphism of Object oriented programming.

Multiple Inheritance

image2

This relationship explain the multiple inheritance, where one class is derived from two or multiple parent class

Multiple inheritance is the type of inheritance in which a derived class inherits multiple base classes. In multiple inheritance, the derived class combines the members of all the base classes

@dhpradeep
dhpradeep / axios.js
Created October 16, 2020 06:02
Sample
const authLogin = async (email, password) =>
axios.post("/api/token/obtain/", { email, password })
@dhpradeep
dhpradeep / simple-pagination.js
Created August 2, 2020 06:23 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@dhpradeep
dhpradeep / simple-pagination.js
Created August 2, 2020 06:23 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
list=sorted(input().split());val=input();print(list.index(val)if val in list else -1)