Ankith Reddy has Published 1070 Articles

Logical instructions in 8086 microprocessor

Ankith Reddy

Ankith Reddy

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

7K+ Views

These instructions are used to perform operations where data bits are involved, i.e. operations like logical, shift, etc. We can say that these instructions are logical instructions. In 8086, the destination register may or may not the Accumulator.Let us see the logical instructions of 8086 microprocessor. Here the D, S ... Read More

LongStream builder() method in Java

Ankith Reddy

Ankith Reddy

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

80 Views

The LongStream builder() class in Java is used to return a builder for a LongStream.The syntax is as follows.static LongStream.Builder builder()Here, LongStream.Builder is a mutable builder for a LongStream.To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;The following is an example to implement LongStream builder() method in ... Read More

How to connect to my MongoDB table by command line?

Ankith Reddy

Ankith Reddy

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

152 Views

In order to connect to my table by command line, you need to use db commanddb.yourCollectionName.find();Let’s say we have a database “sample” with some collections. First check the current database> use sample; switched to db sample > db; Sample Now we have reached the database sample. The database “sample” is ... Read More

What is the use of Action in JSP?

Ankith Reddy

Ankith Reddy

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

551 Views

The action can be used to write the template text in JSP pages and documents. Following is the simple syntax for this action −Template dataThe body of the template cannot contain other elements; it can only contain text and EL expressions (Note − EL expressions are explained in a ... Read More

The listIterator() method of Java AbstractSequentialList class

Ankith Reddy

Ankith Reddy

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

60 Views

The listIterator() method of the AbstractSequentialList class returns a list iterator over the elements in this list.The syntax is as followspublic abstract ListIterator listIterator(int index)Here, index is the index of the first element to be returned from the list iterator. The ListIterator here is the iterator for lists.To work with ... Read More

Get distinct values and count them in MySQL

Ankith Reddy

Ankith Reddy

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

418 Views

To get distinct values and count them, you can use GROUP BY clause.The syntax is as followsselect yourColumnName, count(*) as anyAliasName from yourTableName group by yourColumnName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table GroupByAndCountDemo    -> ( ... Read More

Inserting Date() in MongoDB through Mongo shell?

Ankith Reddy

Ankith Reddy

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

1K+ Views

In order to insert Date() in MongoDB through Mongo shell, use the following syntaxvar yourVariableName= new Date(year, month, day, hour, minute); db.yourCollectionName({yourDateFieldName:yourVariableName});Let us first create a date variable> var creatingDate = new Date(2019, 03, 29, 13, 12);Let us create a collection with documents:>db.insertingDateUsingVariableDemo.insertOne({"UserName":"John", "UserMessages":["Hi", "Hello", "Awesome"], "UserPostDate":creatingDate});Following is the query ... Read More

C++ Program to Find the peak element of an array using Binary Search approach

Ankith Reddy

Ankith Reddy

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

768 Views

In this C++ program, we find out one of the peaks in the array can be found Using binary search approach. This algorithm returns the first peak found as a result with time complexity of the algorithm is O(log(n)).AlgorithmBegin    PeakElement() function has ‘arr’ the array of data, start and ... Read More

The contains() method of AbstractSequentialList in Java

Ankith Reddy

Ankith Reddy

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

87 Views

The contains() method of AbstractSequentialList in Java is used to check whether an element is in the Collection.The syntax is as followspublic boolean contains(Object ob)Here, ob is the element to be checked. To work with the AbstractSequentialList class in Java, you need to import the following packageimport java.util.AbstractSequentialList;The following is ... Read More

Can I retrieve multiple documents from MongoDB by id?

Ankith Reddy

Ankith Reddy

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

2K+ Views

Yes, to retrieve multiple docs from MongoDB by id, use the $in operator. The syntax is as followsdb.yourCollectionName.find({_id:{$in:[yourValue1, yourValue2, yourValue3, ...N]}});Let us first create a collection with documents:> db.retrieveMultipleDocsByIdDemo.insertOne({"_id":10, "CustomerName":"John"}); { "acknowledged" : true, "insertedId" : 10 } > db.retrieveMultipleDocsByIdDemo.insertOne({"_id":14, "CustomerName":"Chris"}); { "acknowledged" : true, "insertedId" : 14 } > ... Read More

Advertisements