 
 Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 524 of 2650
 
 
			
			221 Views
Suppose, there are 'a' number of matches and 'b' number of press conferences to be held in a stadium in a particular week. There are two cafeterias, one in the player dressing room and one in the press conference area. There are two soft drink dispensers in the cafeterias and they need to be filled at the start of the week. The dressing room cafeteria drink dispenser is used heavily, and it needs to be refilled after every 'c' games and the conference area cafeteria's dispenser needs to be refilled after every 'd' events. The stadium maintenance committee can order ... Read More
 
 
			
			480 Views
Suppose, there are three groups of people coming to a party. The first group of people likes butterscotch ice cream and do not like any other flavors of ice cream, the second group of people only dislikes strawberry ice cream and like every other flavor, and the third group likes all kinds of ice cream. Now, there are x people of the first group, y people of the second group, and z people of the third group are coming to a party, and everyone should have at least one icecream of their liking. The party organizers have brought a packs ... Read More
 
 
			
			240 Views
Suppose, we are given a grid that has 2 rows and n columns. A robot is at position (0, 0) in the grid and wants to visit (1, n - 1) by visiting adjacent and corner cells to its current location. We are given the grid in an array of strings, a cell is blocked if it is marked '#' and it is accessible if it is marked '.'. We have to find out if the robot can visit cell (1, n - 1) from the cell (0, 0).So, if the input is like n = 4, grid = {".##.", ... Read More
 
 
			
			332 Views
An array is a group of similar elements stored together in a single variable which take contiguous memory locations. Arrays help us to store and manage multiple values of the same type, like a list of numbers or names.In this article, we will solve a beginner level problem in C++ that involves decreasing all the even numbers in an array by 1. Program to Decrease Even Numbers in an Array How to Check a if Number is Even in C++? C++ Program to Decrease Even Numbers ... Read More
 
 
			
			220 Views
Suppose, we are given a matrix of n rows and m columns. We have to find out the number of elements present in it. We find out the value and display it as output.So, if the input is like n = 20, m = 15, then the output will be 300.StepsTo solve this, we will follow these steps −return n * mExampleLet us see the following implementation to get better understanding −#include using namespace std; #define N 100 int solve(int n, int m) { return n * m; } int main() { int n = 20, m = 15; cout
 
 
			
			1K+ Views
We can send different HTTP status and responses over the Express.js app endpoint as per the user's requirement. Also we can send a message in case of an error or when the requests are forbidden. The status code 200 is sent by default with the response returned.Syntaxres.status( statusCode )Example 1Create a file with the name "status.js" and copy the following code snippet. After creating the file, use the command "node status.js" to run this code as shown in the example below −// Specifying status code Demo Example // Importing the express module var express = require('express'); // Initializing ... Read More
 
 
			
			949 Views
You need to pass some parameters to skip the middleware in an Express application. On the basis of that parameter with logic in place, you can decide whether to execute a middleware or notSyntaxThere is no syntax defined. You can introduce a parameter and then check based upon that parameter whether to use the middleware or not.ExampleCreate a file with the name "skipMiddleware.js" and copy the following code snippet. After creating the file, use the command "node skipMiddleware.js" to run this code as shown in the example below −// app.set() Demo Example // Importing the express module var express ... Read More
 
 
			
			1K+ Views
res.headersSent returns a Boolean value that indicates if the app has sent HTTP headers for the response or not. If the headers are sent, it returns True; else False.Syntaxres.headersSentExample 1Create a file with the name "headersSent.js" and copy the following code snippet. After creating the file, use the command "node headersSent.js" to run this code as shown in the example below −// res.headersSent Property Demo Example // Importing the express module var express = require('express'); // Initializing the express and port number var app = express(); // Initializing the router from express var router = express.Router(); var ... Read More
 
 
			
			1K+ Views
router.param(name, callback) adds a callback to the route parameters where name defines the name of the parameter and callback is the callback function.Following are the parameters of the callback function −req – the request objectres – the response objectnext -- the next middlewarename – value of the name parameterSyntaxrouter.param( name, callback )ExampleCreate a file with the name "routerParam.js" and copy the following code snippet. After creating the file, use the command "node routerParam.js" to run this code as shown in the example below −// router.param() Method Demo Example // Importing the express module var express = require('express'); // Importing ... Read More
 
 
			
			167 Views
The router.METHOD() is used for providing the method functionality in Express, where METHOD represents one of the HTTP methods such as GET, POST, PUT, and so on, in lowercase. Therefore, the actual methods are represented as following −router.get()router.post()router.put() …… and so on...Syntaxrouter.METHOD( path, [callback ...], callback )Example 1Create a file with the name "routerMETHOD.js" and copy the following code snippet. After creating the file, use the command "node routerMETHOD.js" to run this code as shown in the example below −// router.METHOD() Method Demo Example // Importing the express module const express = require('express'); // Initializing the express and ... Read More