Chandu yadav has Published 1163 Articles

Can I query on a MongoDB index if my query contains the $or operator?

Chandu yadav

Chandu yadav

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

145 Views

Yes, you can do that. First, you need to create an index and then use explain(). Let us first create a MongoDB index. Following is the query:> db.indexOrQueryDemo.ensureIndex({"First":1});This will produce the following output{    "createdCollectionAutomatically" : false,    "numIndexesBefore" : 2,    "numIndexesAfter" : 3,    "ok" : 1 }The ... Read More

Time Functions in Python?

Chandu yadav

Chandu yadav

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

14K+ Views

Python provides library to read, represent and reset the time information in many ways by using “time” module. Date, time and date time are an object in Python, so whenever we do any operation on them, we actually manipulate objects not strings or timestamps.In this section we’re going to discuss ... Read More

8085 program to multiply two 8 bit numbers using logical instructions

Chandu yadav

Chandu yadav

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

1K+ Views

In this program we will see how to multiply using logical operators.Problem StatementWrite 8085 Assembly language program to multiply two 8-bit numbers using logical operators.DiscussionWe are assuming the first number is in register B, and second number is in register C, and the result must not have any carry.Here we ... Read More

LongStream boxed() method in Java

Chandu yadav

Chandu yadav

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

175 Views

The boxed() method of the LongStream class returns a Stream consisting of the elements of this stream, each boxed to a Long.The syntax is as follows.Stream boxed()Here, Stream represents a sequence of elements. To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;Create an IntStream and add some ... Read More

C++ Program to Compare Binary and Sequential Search

Chandu yadav

Chandu yadav

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

453 Views

Binary Search and Sequential or Linear Search both are used in computer programming to search an element. The time complexity of Binary Search is O(log(n)) and Sequential Search is O(n).AlgorithmBegin    Algorithm for Binary Search:    BinarySearch() function with ‘arr’ the array of data and ‘n’ the number of values, ... Read More

Exclude certain columns from SHOW COLUMNS in MySQL?

Chandu yadav

Chandu yadav

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

231 Views

Let us first create a demo tablemysql> create table excludeCertainColumnsDemo    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentName varchar(100),    -> StudentAge int,    -> StudentMarks int,    -> StudentAddress varchar(200)    -> ); Query OK, 0 rows affected (0.50 sec)Now you can ... Read More

What is the difference between include action and include directive in JSP?

Chandu yadav

Chandu yadav

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

1K+ Views

include action lets you insert files into the page being generated. The syntax looks like this −Unlike the include directive, which inserts the file at the time the JSP page is translated into a servlet, this action inserts the file at the time the page is requested.

LongStream asDoubleStream() method in Java

Chandu yadav

Chandu yadav

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

59 Views

The asDoubleStream() method of the LongStream class in Java returns a DoubleStream consisting of the elements of this stream, converted to double.The syntax is as follows.DoubleStream asDoubleStream()Here, DoubleStream is a sequence of primitive double-valued elements. To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;Create LongStream and add ... Read More

Inplace vs Standard Operators in Python

Chandu yadav

Chandu yadav

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

324 Views

Inplace Operator in PythonInplace operation is an operation which directly changes the content of a given linear algebra or vector or metrices without making a copy. Now the operators, which helps to do this kind of operation is called in-place operator.Let’s understand it with an a simple example -a=9 a ... Read More

8085 program to find square of a 8 bit number

Chandu yadav

Chandu yadav

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

3K+ Views

In this program, we will see how to find the square of an 8-bit number.Problem StatementWrite 8085 Assembly language program to find the square of a number The number is stored at location 8000H, store the result at 8050H.DiscussionIn 8085, we cannot perform the multiplication operation directly. We are performing ... Read More

Advertisements