The data link layer in the OSI (Open System Interconnections) Model, is in between the physical layer and the network layer. This layer converts the raw transmission facility provided by the physical layer to a reliable and error-free link. The main functions and the design issues of this layer are Providing services to the network layer Framing Error Control Flow Control Services to the Network Layer In the OSI Model, each layer uses the services of the layer below it and provides services to the layer above it. The data link layer uses the services offered by the ... Read More
Java Garbage collector tracks the live object and objects which are no more need are marked for garbage collection. It relieves developers to think of memory allocation/deallocation issues. JVM uses the heap, for dynamic allocation. In most of the cases, the operating systems allocate the heap in advance which is then to be managed by the JVM while the program is running. It helps in following ways: Faster object creation as Operating system level synchronization is no more needed for each object. Object Allocation takes some memory and increases the offset. When an object is not required, garbage collector ... Read More
In the OSI (Open System Interconnections) Model, each layer uses the services of the layer below it and provides services to the layer above it. The primary function of the data link layer is to provide a well-defined service interface to the network layer above it. Virtual Communication versus Actual Communication The main service provided is to transfer data packets from the network layer on the sending machine to the network layer on the receiving machine. Data link layer of the sending machine transmits accepts data from the network layer and sends them to the data link layer of ... Read More
We can pass an array with the help of where IN clause. Let us first create a new table for our example. mysql> create table PassingAnArrayDemo -> ( -> id int, -> Firstname varchar(100) -> ); Query OK, 0 rows affected (1.60 sec) Let us now insert records. mysql> insert into PassingAnArrayDemo values(1, 'John'), (2, 'Carol'), (3, 'Smith'), (4, 'Bob'), (5, 'Johnson'), (6, 'David'), (7, 'Sam'), (8, 'Jessica'); Query OK, 8 rows affected (0.32 sec) Records: 8 Duplicates: 0 Warnings: 0 To display all records. mysql> select *from PassingAnArrayDemo; The ... Read More
The Backtracking is an algorithmic-technique to solve a problem by an incremental way. It uses recursive approach to solve the problems. We can say that the backtracking is used to find all possible combination to solve an optimization problem. In this Section We are going to cover Hamiltonian Cycle M-Coloring Problem N Queen Problem Rat in Maze Problem Cryptarithmetic Puzzle Subset Sum Problem Sudoku Solving Algorithm Knight-Tour Problem Tug-Of-War Problem Word Break Algorithm Maximum number by swapping problem
In Python there are some additional standard library methods for mathematical operations, like arithmetic, logical, relational, bitwise etc. operations. These methods can be found under the operator module. To use it at first we need to import it the operator standard library module. import operator In this section we will see some operator functions for bitwise operations and container operations. Arithmetic Operations At first we will see the arithmetic operating functions. These are like below. Sr.No Functions & Description 1 add(x, y) The add() method is used to add two numbers x and y. ... Read More
Using Python, we can easily convert data into different types. There are different functions for Type Conversion. We can convert string type objects to numeric values, perform conversion between different container types etc. In this section we will see how the conversions can be done using Python. Converting String to Numeric Types To convert from String type objects to Numeric Objects, there are different methods like int(), float() etc. Using the int() method we can convert any number as string to integer value (base 10). It takes the string type argument, default base is 10, We can also specify the ... Read More
The hashed password data type depends upon which hashing algorithm we are using. The hashing algorithm does not depends upon the input size because it produces a result of the same length. It gives the result in a series of hexadecimal digits, and we can reduce the hexadecimal digits by half with the help of UNHEX() function. There are various algorithms and data types to store values. MD5 − It can use char(32) or BINARY(16). SHA-1 − It can use data type char(40) or BINARY(20). Example of MD5 The following is an example − mysql> select MD5('This ... Read More
To install python MySQLdb module, we need to install Python current version i.e. 3.7 We need to find the location of Python Scripts where pip command is located. First, open the cmd and reach the location of Python Scripts. To open cmd, press “Windows+R” and type cmd. Here is the snapshot − Now reach where scripts are located. We will now install “MySQLdb” module. The steps are displayed in the following screenshot.
We can use a conditional clause called the WHERE Clause to filter out the results. Using this WHERE clause, we can specify a selection criteria to select the required records from a table. The HAVING clause specify filter conditions for a group of rows or aggregates WHERE clause cannot be used with aggregate function while HAVING can be used with aggregate function. The following is an example − Let us now create a table. mysql> create table WhereDemo -> ( -> Price int -> ); Query OK, 0 rows affected (0.64 sec) Inserting records into table. ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP