- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Updated on 30-Jul-2019 22:30:25
The tag formats a URL into a string and stores it into a variable. This tag automatically performs URL rewriting when necessary. The var attribute specifies the variable that will contain the formatted URL.The JSTL url tag is just an alternative method of writing the call to the response.encodeURL() method. The only real advantage the url tag provides is proper URL encoding, including any parameters specified by children param tag.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueBase URLYesNonecontext/ followed by the name of a local web applicationNoCurrent applicationvarName of the variable to expose the processed URLNoPrint to pagescopeScope of ... Read More 
Updated on 30-Jul-2019 22:30:25
An immutable copy of a LocalDate with the month altered as required is done using the method withMonth() in the LocalDate class in Java. This method requires a single parameter i.e. the month that is to be set in the LocalDate and it returns the LocalDate with the month altered as required.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Main { public static void main(String[] args) { LocalDate ld1 = LocalDate.parse("2019-02-15"); System.out.println("The LocalDate is: " + ld1); ... Read More 
Updated on 30-Jul-2019 22:30:25
The boxed() method of the IntStream class returns a Stream consisting of the elements of this stream, each boxed to an Integer.The syntax is as follows.Stream boxed()At first, create an IntStreamIntStream intStream = IntStream.range(20, 30);Now, use the boxed() method to return a Stream consisting of the elements of this stream, each boxed to an Integer.Stream s = intStream.boxed();The following is an example to implement IntStream boxed() method in Java.Example Live Demoimport java.util.*; import java.util.stream.Stream; import java.util.stream.IntStream; public class Demo { public static void main(String[] args) { IntStream intStream = IntStream.range(20, 30); Stream s = ... Read More 
Updated on 30-Jul-2019 22:30:25
To get the storage size of a database in MongoDB, use the stats() method.At first, check the current database with the help of the following query −> db;The following is the output −testHere is the query to get the storage size of the database in MongoDB −> db.stats()The following is the output displaying the stats including the storage size −The following is the output −{
"db" : "test",
"collections" : 114,
"views" : 0,
"objects" : 391,
"avgObjSize" : 83.0076726342711,
"dataSize" : 32456,
"storageSize" : 3211264,
"numExtents" : 0,
"indexes" : 120,
"indexSize" : 2494464,
"fsUsedSize" : 126172377088,
"fsTotalSize" : 199229435904,
"ok" : 1
}
Updated on 30-Jul-2019 22:30:25
To add a new MySQL table column and index, you can use ALTER TABLE command.The syntax is as followsALTER TABLE yourTableName ADD COLUMN yourColumnName dataType, ADD INDEX(yourColumnName );To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table AddColumnAndIndexDemo -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(100), -> Address varchar(200) -> ); Query OK, 0 rows affected (0.81 sec)Now you can check the description of table. The query is as follows −mysql> desc AddColumnAndIndexDemo;The following is the output+---------+--------------+------+-----+---------+----------------+ | Field ... Read More 
Updated on 30-Jul-2019 22:30:25
A vector of a vector is called 2D vector.AlgorithmBegin
Declare a variable v to the 2D vector type.
Initialize values to the vector v.
Print “the 2D vector is:”.
for (int i = 0; i < v.size(); i++)
for (int j = 0; j < v[i].size(); j++)
print the value of 2D vector v[i][j].
End.Example Live Demo#include
#include //header file for 2D vector in C++
using namespace std;
int main() {
vector v{ { 4,5, 3, 10 }, // initializing 2D vector with values.
{ 2, 7, 11 },
{ 3, 2, 1, 12 } };
cout
Updated on 30-Jul-2019 22:30:25
This is a C++ program to find Maximum Number of Edge Disjoint Paths which means shortest subset path or maximum flow between two vertices.Algorithms:Begin function bfs() returns true if there is path from source s to sink t in the residual graph which indicates additional possible flow in the graph. End Begin function findDisPath() is used to return maximum flow in given graph: A) Initiate flow as 0. B) If there is an augmenting path from source to sink, add the path to flow. C) Return flow. EndExample Code#include #include ... Read More 
Updated on 30-Jul-2019 22:30:25
To concatenate strings from two fields into a third field, you can use the following syntaxdb.yourCollectionName.aggregate( [ { $project: { "yourNewFieldName": { $concat: [ "$yourFieldName1", " yourDellimiterValue ", "$yourFieldName2" ] } } } ] );Let us first create a collection with documents>db.concatenateStringsDemo.insertOne({"StudentFirstName":"John", "StudentLastName":"Doe"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9bb7362d66697741252444") } >db.concatenateStringsDemo.insertOne({"StudentFirstName":"John", "StudentLastName":"Smith"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9bb7402d66697741252445") } >db.concatenateStringsDemo.insertOne({"StudentFirstName":"Carol", "StudentLastName":"Taylor"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9bb74c2d66697741252446") } >db.concatenateStringsDemo.insertOne({"StudentFirstName":"David", "StudentLastName":"Miller"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9bb7752d66697741252447") } >db.concatenateStringsDemo.insertOne({"StudentFirstName":"James", "StudentLastName":"Williams"}); { "acknowledged" : ... Read More 
Updated on 30-Jul-2019 22:30:25
To output fixed number of array elements in a line, we should check for a condition and if that is true, we should place System.out.println(); properly to get a line and the process goes on.Here, we will display 5 elements in a line. At first, create a new integer array and add some elements −int[] list = new int[50]; for (int i = 0; i < list.length; i++) { list[i] = (int)(i + 20); }Now, declare a new variable and initialize it to 0. This variable is checked in a for loop that loops until the length of the ... Read More 
Updated on 30-Jul-2019 22:30:25
Here we will see how to sort using some condition on some member variables of the structure in C++. In this example we will take a structure called book. The book will hold name, number of pages, and price. We will sort them based in the price.For comparing two structures, we have to define a function. This function will compare them with these parameters. This comparison function is used inside the sort function to sort the values.Example#include #include using namespace std; struct book { string title; int pages; float price; }; bool compareBook(book b1, book b2) { if(b1.price Read More Advertisements