Suppose, we are given two arrays a and b that each contain n integer numbers. From the arrays, we have to create integer pairs where one number is from array a and another one is from array b, and the addition of the numbers is always unique. We print all such integer pairs.Problem CategoryThe above-mentioned problem can be solved by applying Greedy problem-solving techniques. The greedy algorithm techniques are types of algorithms where the current best solution is chosen instead of going through all possible solutions. Greedy algorithm techniques are also used to solve optimization problems, like its bigger brother ... Read More
Suppose, we have n number of strings given to us in an array 'stringArr'. We iterate through the string elements one by one and find out if a string has appeared before in the array. If such occurs, we print 'Seen Before!' or otherwise, we print 'Didn't see before!'Problem CategoryTo solve this problem, we need to manipulate strings. Strings in a programming language are a stream of characters that are stored in a particular array-like data type. Several languages specify strings as a specific data type (eg. Java, C++, Python); and several other languages specify strings as a character array ... Read More
Suppose, we are given an array of n integers 'x'. We have to find out another array of integers 'y', so that x[1].y[1] + x[2].y[2] +...+ x[n].y[n] = 0. We print the contents of array y.Problem CategoryVarious problems in programming can be solved through different techniques. To solve a problem, we have to devise an algorithm first, and to do that we have to study the particular problem in detail. A recursive approach can be used if there is a recurring appearance of the same problem over and over again; alternatively, we can use iterative structures also. Control statements such ... Read More
We need to get the DNS information to track the address from where we receive the requests. This feature also provides an added layer of security, protecting the application from different type of DOS and DDOS attacks.We can use the following functions to get the domain and host information.SyntaxGetting the origin info:var origin = req.get('origin');Getting the host info:var host = req.get('host');Example 1Create a file with the name "dnsInfo.js" and copy the following code snippet. After creating the file, use the command "node dnsInfo.js" to run this code as shown in the example below −// Getting the Host info Demo Example ... Read More
Photometry and PhotometerThe measurement of light's brightness or luminous intensity is known as photometry. Photometry focuses on the perceived brightness to the human eyes. The photometry takes into account the eye's sensitivity to varying degrees of light and focuses primarily on the visible light spectrum.Thus, the photometry involves the measurement of candle power. The candle power of a given source of light in any given direction is measured by comparison with a standard source. In order to eliminate the errors in the measurement of the candle power, the measurement is performed in a dark room with dead black walls."The device ... Read More
Spot WeldingThe welding process which is used for welding two or more metal sheets together by applying pressure and heat from an electric current to the weld area is known as spot welding.Spot welding is a type of resistance welding process, which is why it is also known as the resistance spot welding.Schematic DiagramThe figure below shows the schematic diagram of resistance spot welding −Spot welding is the simplest and most universally adopted method of making lap joints in thin sheet up to a maximum thickness of 12.7 mm.A typical spot welding machine consists of a transformer to produce high ... Read More
Seam WeldingThe welding process in which two similar or dissimilar materials are joined at the seam by the application of heat generated from electrical resistance is known as seam welding. The seam welding is a types of resistance welding, in which weld is produced by roller electrodes instead of tipped electrodes.Most seam welding processes produce a continuous or intermittent seam weld near the edge of two overlapped metals by using two machine driven roller electrodes. As in the seam welding process, the roller electrodes move over the metal workpieces, the workpieces are under pressure and the current passing through them ... Read More
Polar CurvesThe plots drawn between the candle power and angular position are known as polar curves. Due to unsymmetrical shape of the lamps, the luminous intensity is not uniform in all directions. The luminous intensity in all directions can be represented with the help of polar curves.The polar curves are drawn by taking the luminous intensities in various directions at an equal angular displacement in the sphere. A radial ordinate pointing in any particular direction on a polar curve represents the luminous intensity of the source when it is viewed from the direction.Therefore, the polar curves are classified into two ... Read More
req.subdomains returns an array of all the subdomains in the domain name of the request. The application property subdomain offset is used for determining the beginning of the subdomain segments. The default value of the subdomain offset property is 2.Syntaxreq.subdomainsExampleCreate a file with the name "reqSubdomains.js" and copy the following code snippet. After creating the file, use the command "node reqSubdomains.js" to run this code as shown in the example below −// req.subdomains Property Demo Example // Importing the express var express = require('express'); // Initializing the express and port number var app = express(); // Initializing the ... Read More
Laser Beam Welding (LBW) is a fusion welding process in which multiple pieces of metal are joined together through the use of laser. In LBW, the laser beam acts as a concentrated source of heat, which allows narrow, deep welds and high welding rates. The laser beam welding process is frequently used in high volume applications, such as in the automotive industry.Laser Beam Welding ProcessThe figure shows the schematic diagram of the laser beam welding (LBW).The main parts of the set up used for the laser beam welding are as follows −Laser Machine – It is the machine that is ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP