George John has Published 1167 Articles

C++ program to convert Fahrenheit to Celsius

George John

George John

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

3K+ Views

In this program we will see how to convert Celsius to Fahrenheit using C++. As we know the formula is simple.AlgorithmBegin Take the Celsius temperature in C calculate F = (9C/5)+32 return F EndExample Code#include using namespace std; main() { float f, c; cout > c; f = (9.0*c/5.0)+32; cout

Search for a value in Java Decade Tuple

George John

George John

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

66 Views

To search a value in Java Decade Tuple, use the contains() method. It returns a booleans value i.e. TRUE if the element exist, else FALSE.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 ... Read More

How to update the current delimiter in MySQL?

George John

George John

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

230 Views

At first, let us determine the current delimiter in MySQL using the following syntax\sThe above syntax will let you know about the current delimiter. Let us implement the above syntax.The query is as followsmysql> \sThe following is the outputC:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe Ver 8.0.12 for Win64 on x86_64 (MySQL Community ... Read More

8086 program to subtract two 16-bit numbers with or without borrow

George John

George John

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

7K+ Views

In this program we will see how to subtract two 16-bit numbers with and without borrow.Problem StatementWrite 8086 Assembly language program to subtract two 16-bit number stored in memory location 3000H – 3001H and 3002H – 3003H.Discussion8086 is 16-bit register. We can simply take the numbers from memory to AX ... Read More

How to prevent MongoDB from returning the object ID while finding a document?

George John

George John

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

480 Views

To prevent MongoDB from returning the Object ID while finding a document, you need to set _id to 0. Let us first create a collection with documents> db.preventObjectIdDemo.insertOne( ...    { ... ...       "StudentName" : "Chris", ...       "StudentDetails" : [ ...       ... Read More

What is the use of page object in JSP? Need an example.

George John

George John

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

149 Views

JSP gives you an option to specify Error Page for each JSP using page attribute. Whenever the page throws an exception, the JSP container automatically invokes the error page.Following is an example to specifiy an error page for a main.jsp. To set up an error page, use the directive. ... Read More

Add a value in Ennead Tuple in Java

George John

George John

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

74 Views

To add value in Ennead class in JavaTuples, you need to use the addAtX() method. Here, X represents the index wherein you need to add the value i.e. for index 2, use addAt2() method. Add the specific value as the parameter value of the method. For exampleaddAt2(“John”);Let us first see ... Read More

What is the return type of a “count” query against MySQL using Java JDBC?

George John

George John

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

363 Views

The return type of count is long. The Java statement is as followsrs.next(); long result= rs.getLong("anyAliasName");First, create a table with some records in our sample database test3. The query to create a table is as followsmysql> create table CountDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY ... Read More

How to return today's records using DATE from DATETIME Field?

George John

George John

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

204 Views

Let us first create a table in which one of the column is of datetime type;mysql> create table DemoTable (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ShippingDate datetime ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command.mysql> insert into DemoTable(ShippingDate) ... Read More

Set max on MongoDB capped collection?

George John

George John

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

126 Views

Capped collections are fixed-size collections that support high-throughput operations that insert and retrieve documents based on insertion order. In order to set max on mongo capped collection, use the following syntaxdb.createCollection("yourCollectionName", {capped:true, size:yourSizeValue, max:yourMaxValue});Let us implement the above syntax in order to set max on mongo capped collection. Following is ... Read More

Advertisements