Skip to main content

Posts

Showing posts from December, 2021

How to check if the user is connected to the internet or not?

 The following code can be used to check whether the user is connected to the internet or not? Method 1: if  (navigator . onLine)  {   console . log ( " Online " ) ; }   else   {   console . log ( " OffLine " ) ; } Method 2: window . addEventListener ( " offline " ,   ()   =>   {   console . log ( " Offline " ) ; } ) ; window . addEventListener ( " online " ,   ()   =>   {   console . log ( " Online " ) ; } ) ; So, Next time when you want to check whether the user is connected to the internet or not then use these methods. Thank you, Learn every day something new.

Should You learn Bootstrap in 2022?

Should you learn Bootstrap in 2022? or Should you learn Bootstrap for your Resume Projects or Serious Projects? Personally, I really love to use Bootstrap and I used it very often. But there are too many down points in Bootstrap if you are using Bootstrap as it is or as a CSS framework. Then you will see all Bootstrap powered websites look the same. If you had built any website using Bootstrap then you know what I have to say? Like navbar, accordions and other components which have copypasted look same in all Bootstrap powered websites. If you used Bootstrap for your project then you may lose your professionalism as people will think that this website is built using a template. Is there any problem with this? Absolutely not, because if you want to build a quick prototype and you don't care about design then it is totally fine to use Bootstrap. But if you use Bootstrap then your site will not look professional design-wise  in 2022. So, if you are serious to build a good project, the...

Operations on Matrix using OOP concepts in Python | Addition | Subtraction | Multiplication | Transpose

      This is the same problem Statement as mentioned in  Operations on Matrix using Python | Addition | Subtraction | Multiplication | Transpose but, in this solution, we used oop concepts like class and member function, etc.   Problem:-  Write a Python program to compute the following computation on the matrix:     a) Addition of two matrices     b) Subtraction of two matrices     c) Multiplication of two matrices     d) transpose of a matrix Note: Scroll Horizontally to see the full line of code. class Matrix :     def __init__ ( self ):         self . matrix = None         self . r = None         self . c = None     def addelem ( self ):         self . r = int ( input ( " Enter the no. of rows: " ))         self . c = int ( input ( " Enter the no. of columns: " ))       ...

Set Theory Operations using OOP concepts in Python

    This is the same problem statement mentioned in    SET THEORY USING LIST IN PYTHON but, in this solution, we used Object-Oriented Programming Concepts like classes and class functions. Problem Statement :- In second-year computer engineering class, group A student's play cricket, group B students play badminton and group C students play football.  Write a Python program using functions to compute the following:-     a) List of students who play both cricket and badminton     b) List of students who play either cricket or badminton or both     c) Number of students who play neither cricket nor badminton     d) Number of students who play cricket and football but not badminton. (Note- While realizing the group, duplicate entries should be avoided, Do not use SET built-in functions) Note :- Scroll horizontally to see the full line of code. class Set :     def addElems ( self ):         sel...

Implementation Queue Data Structure to visualize JOB Queue by an Operating System using C++

  Problem Statement: Queues are frequently used in computer programming, and a typical example is the creation a job queue by an operating system. If the operating system does not use priorities, then jobs are processed in the order they enter the system. Write C++ program for simulating job queue. Write functions to add delete job from queue. Note: Scroll Horizontally to see the full line of code. #include < iostream > using namespace std ; class node {     public :     int data ;     node * next ;     node ( int x ){         data = x ;         next = NULL ;     } }; class queue {     public :     node * front ;     node * rear ;     queue (){         front = NULL ;         rear = NULL ;     }     void enqueue (){         int x ;       ...

C++ Program for expression conversion as Infix to Postfix and Postfix Evaluation using Stack Data Structure

  Problem Statement: Implement C++ program for expression conversion as infix to postfix and its evaluation using stack based on given conditions:     1. Operands and operator, both must be single character.     2. Input Postfix expression must be in a desired format.     3. Only '+','-','*' and '/' operators are expected. Note: Scroll Horizontally to see full line of code. #include < iostream > #include < string > using namespace std ; class stack {     char * arr ;     int top = - 1 ; public :     stack ()     {         arr = new char [ 100 ];         top = - 1 ;     }     void push ( char x )     {         top ++ ;         arr [ top ] = x ;     }     void pop ()     {         top -- ;     }     char Top ...