Chandu yadav has Published 1163 Articles

ArrayBlockingQueue peek() Method in Java

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

90 Views

The peek() method of the ArrayBlockingQueue class returns the head of this queue or null if this queue is empty.The syntax is as follows.public E peek()To work with ArrayBlockingQueue class, you need to import the following package.import java.util.concurrent.ArrayBlockingQueue;The following is an example to implement peek() method of Java ArrayBlockingQueue class.Example Live ... Read More

Add to existing value in MySQL column using CONCAT function?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

550 Views

To understand the concept, let us first create a demo table.mysql> create table addToExistingValueDemo    -> (    -> Instructor_Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> Instructor_Name varchar(30),    -> Instructor_TechnicalSubject text    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using ... Read More

Decimal addition in 8085 Microprocessor

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

1K+ Views

In a digital computer, everything is represented using 0s and 1s only. For example, instruction will have a code using only 0s and 1s. Data is also represented using 0s and 1s. Data can be of different types like unsigned numbers, signed numbers, floating point numbers, binary coded decimal (BCD) ... Read More

Is it possible to sum two fields in MongoDB using the Aggregation framework?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

1K+ Views

Yes, it is possible using the $project operator. Let us first create a collection with documents> db.sumTwoFieldsDemo.insertOne({"FirstValue":150, "SecondValue":350}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9b4bfe15e86fd1496b38cd") } > db.sumTwoFieldsDemo.insertOne({"FirstValue":450, "SecondValue":1550}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9b4c1215e86fd1496b38ce") } > db.sumTwoFieldsDemo.insertOne({"FirstValue":2560, "SecondValue":2440}); {    "acknowledged" : true,   ... Read More

Why does MySQL refuse pipe ('|') character in string on INSERT INTO?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

221 Views

To insert pipe(|) character in string on INSERT INTO, let us first see an example and create a table. The query to create a table is as followsmysql> create table PipeInsertDemo -> ( -> UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY, ... Read More

How to select first and last row record using LIMIT in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

1K+ Views

Let us first create a table. The query to create a table is as followsmysql> create table FirstAndLastDataDemo    -> (    -> EmployeeId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> EmployeeName varchar(20),    -> EmployeeAge int    -> ); Query OK, 0 rows affected (0.59 sec)Insert some records ... Read More

Program counter (PC) in 8085 Microprocessor

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

6K+ Views

PC is a 16-bit register. It contains a memory address. PC contains that very memory address from where the next instruction is to be fetched for execution. Suppose the PC contents are 8000H, then it means that the 8085 Desires to fetch the instruction Byte at 8000H. After fetching the ... Read More

exp() function C++

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

597 Views

The C / C++ library function double exp(double x) returns the value of e raised to the xth power. Following is the declaration for exp() function.double exp(double x)The parameter is a floating point value. And this function returns the exponential value of x.Example Live Demo#include #include using namespace std; ... Read More

How can I enforce compound uniqueness in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

40 Views

You can enforce compound uniqueness in MySQL with the help of UNIQUE keyword. Here is the syntax to add UNIQUE keyword to your table column.The syntax is as followsCREATE TABLE yourTableName (    yourColumnName1 datatype,    yourColumnName2 datatype,    yourColumnName3 datatype,    .    .    N    UNIQUE yourConstarintName(yourColumnName2, ... Read More

How to use MongoDB $pull to delete documents within an Array?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:25

183 Views

You need to use update command along with $pull operator to delete documents within an array. Let us create a collection with documents. Following is the query> db.deleteDocumentsDemo.insertOne( ... { ...    "_id":100, ...    "StudentsDetails" : [ ...       { ...          "StudentId" : ... Read More

Advertisements