Articles on Trending Technologies

Technical articles with clear explanations and examples

C++ Program to find an array satisfying an condition

Arnab Chakraborty
Arnab Chakraborty
Updated on 07-Apr-2022 683 Views

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

Getting the Domain Info for Request in Express.js

Mayank Agarwal
Mayank Agarwal
Updated on 06-Apr-2022 3K+ Views

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

What is a Photometer? – Principle, working and Types

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Apr-2022 5K+ Views

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

What is Seam Welding? – Working and Applications

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Apr-2022 12K+ Views

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

What is Polar Curve in Illumination?

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Apr-2022 11K+ Views

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

Express.js – req.subdomains Property

Mayank Agarwal
Mayank Agarwal
Updated on 06-Apr-2022 626 Views

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

What is Laser Beam Welding? – Process, Advantages, Disadvantages and Applications

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Apr-2022 7K+ Views

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

Express.js – req.signedCookies Property

Mayank Agarwal
Mayank Agarwal
Updated on 06-Apr-2022 391 Views

req.signedCookies contains the signed cookies (ready for use) sent by the request while using the cookie-parser middleware. Signed cookies exist in a different object to show the developer intent, else a malicious attack could be made on the request.cookie values that are relatively easy to spoof.The property defaults are set to "{ }", if no cookies are sent.Syntaxreq.signedCookiesInstalling the cookie-parser modulenpm install cookie-parserExample 1Create a file with the name "reqSignedCookies.js" and copy the following code snippet. After creating the file, use the command "node reqSignedCookies.js" to run this code as shown in the example below −// req.signedCookies() Method Demo Example ...

Read More

Express.js – req.originalUrl Property

Mayank Agarwal
Mayank Agarwal
Updated on 06-Apr-2022 1K+ Views

The req.originalUrl property is similar to the req.url property. This property retains the original URL and lets us rewrite the same to redirect the request further to some other network or as needed. The app.use() method will rewrite the req.url to strip the mount point.Syntaxreq.originalUrlExample 1Create a file with the name "reqOriginalUrl.js" and copy the following code snippet. After creating the file, use the command "node reqOriginalUrl.js" to run this code as shown in the example below −// req.originalUrl Property Demo Example // Importing the express var express = require('express'); // Initializing the express and port number var app ...

Read More

What is Lambert's Cosine Law? (Laws of Illumination)

Manish Kumar Saini
Manish Kumar Saini
Updated on 06-Apr-2022 15K+ Views

The light received by any surface depends upon the angle made by the normal to the surface, to the light flux. The Lambert's cosine law of illumination explains the relation between the illumination of the surface and the cosine of the angle.StatementThe Lambert's cosine law of illumination states that"The illumination of a surface is directly proportional to the cosine of the angle between the normal to the surface and the direction of incident light".That is, $$\mathrm{\mathit{E}\propto cos\, \theta \: \: \: \cdot \cdot \cdot \left ( 1 \right )}$$ExplanationCase I – Consider a surface that is normal to the luminous ...

Read More
Showing 44531–44540 of 61,297 articles
Advertisements