Ankith Reddy has Published 1070 Articles

How to find two random documents in a MongoDB collection of 6?

Ankith Reddy

Ankith Reddy

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

134 Views

Let us first create a collection and add some documents to it> db.twoRandomDocumentDemo.insertOne({"StudentId":10}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ec9aad628fa4220163b87") } > db.twoRandomDocumentDemo.insertOne({"StudentId":100}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ec9add628fa4220163b88") } > db.twoRandomDocumentDemo.insertOne({"StudentId":45}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9ec9b0d628fa4220163b89") } > db.twoRandomDocumentDemo.insertOne({"StudentId":55}); { ... Read More

How to create a Hit Counter in JSP?

Ankith Reddy

Ankith Reddy

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

144 Views

Click the Below link to know how to create a hit Counter in Jsphttps://www.tutorialspoint.com/jsp/jsp_hits_counter.htm

How to terminate a MongoDB shell script earlier?

Ankith Reddy

Ankith Reddy

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

385 Views

In order to terminate a MongoDB shell script earlier, you need to use quit. Following is the syntaxquit() quit(1)Let us create a script and try to write quit() or quit(1) in shell. At first, we will create the following collection with documents> db.flightInformation.insertOne({"FlightName":"Flight-1", "ArrivalTime":new ISODate("2019-03-12")}); {    "acknowledged" : true, ... Read More

8086 program to add the content of one segment to another segment

Ankith Reddy

Ankith Reddy

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

644 Views

In this program we will see how to add two 8-bit numbers which are in different segments.Problem StatementWrite 8086 Assembly language program to add content of memory location 2000:500 and 3000:600, and store the final result at 5000:700.DiscussionHere we are initializing the CX register with the base address of first ... Read More

Find minimum unused value in a MySQL table?

Ankith Reddy

Ankith Reddy

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

162 Views

You can use LEFT JOIN to find minimum unused value in a MySQL table. Let us first create a tablemysql> create table FindValue    -> (    -> SequenceNumber int    -> ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command. The query ... Read More

The contains() method of the Java Decade Tuple

Ankith Reddy

Ankith Reddy

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

71 Views

The contains() method is used to search for a value in the Decade Tuple. Let us first see what we need to work with JavaTuples. To work with Decade class in JavaTuples, you need to import the following packageimport org.javatuples.Decade;Note Download JavaTuples Jar library to run JavaTuples program. If you ... Read More

How to convert from string to date data type in MongoDB?

Ankith Reddy

Ankith Reddy

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

669 Views

To convert from String to date data type, you need to write some script. Let us first create a collection with documents>db.stringToDateDataTypeDemo.insertOne({"CustomerName":"Carol", "ShippingDate":"2019- 01-21"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca2071d66324ffac2a7dc60") } >db.stringToDateDataTypeDemo.insertOne({"CustomerName":"Bob", "ShippingDate":"2019- 02-24"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca2073566324ffac2a7dc61") } >db.stringToDateDataTypeDemo.insertOne({"CustomerName":"Chris", "ShippingDate":"2019- 04-01"}); ... Read More

MySQL temporary variable assignment?

Ankith Reddy

Ankith Reddy

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

3K+ Views

You can use SET command for temporary variable assignment.The syntax is as followsSET @anyVariableName=(SELECT yourColumnName FROM yourTableName WHERE yourCondition);To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table tempVariableAssignment    -> (    -> Id int NOT NULL AUTO_INCREMENT ... Read More

8086 program to multiply two 8-bit numbers

Ankith Reddy

Ankith Reddy

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

10K+ Views

In this program we will see how to multiply two 8-bit numbers.Problem StatementWrite 8086 Assembly language program to multiply two 8-bit numbers stored in memory address offset 500 and 501.DiscussiontIn 8086 there is MUL instruction. So the task is too simple. Here we are taking the numbers from memory and ... Read More

Iterate through Decade Tuple in Java

Ankith Reddy

Ankith Reddy

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

117 Views

To iterate through Decade Tuple, work it like any other collection in Java i.e. using a for loop, iterate and display the elements. Let us first see what we need to work with JavaTuples. To work with Decade class in JavaTuples, you need to import the following packageimport org.javatuples.Decade;Note: Download ... Read More

Advertisements