Ankith Reddy has Published 995 Articles

Convert number INT in minutes to TIME in MySQL?

Ankith Reddy

Ankith Reddy

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

7K+ Views

To convert number INT in minutes to TIME in MySQL, you can use SEC_TO_TIME() function.The syntax is as followsselect SEC_TO_TIME(yourIntColumnName*60) AS `anyAliasName` from yourTableName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table convertNumberToMinute    -> (    -> ... Read More

How to drop a numeric collection from MongoDB?

Ankith Reddy

Ankith Reddy

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

186 Views

In order to remove the numeric collection name, use the following syntaxdb.getCollection("yourNumericCollectionName").drop();First, create a numeric collection. Following is the query> db.createCollection("2536464"); { "ok" : 1 }Now insert some documents in the above collection. Following is the query> db.getCollection("2536464").insertOne({"Record":1}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca254a46304881c5ce84b8e") } > db.getCollection("2536464").insertOne({"Record":2}); ... Read More

C program to print digital clock with current time

Ankith Reddy

Ankith Reddy

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

3K+ Views

In this section we will see how to make a digital clock using C. To work with time we can use the time.h header file. This header file has some function signatures that are used to handle date and time related issues.The four important components of time.h is like belowsize_t ... Read More

How to read form data using JSP via POST Method?

Ankith Reddy

Ankith Reddy

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

3K+ Views

Below is the main.jsp JSP program to handle the input given by web browser using the GET or the POST methods.Infact there is no change in the above JSP because the only way of passing parameters is changed and no binary data is being passed to the JSP program. File ... Read More

Get the sum of multiple row (not all) values from a MySQL table?

Ankith Reddy

Ankith Reddy

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

942 Views

You can use aggregate function SUM() from MySQL for this. Let us first create a table −mysql> create table DemoTable (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Amount int ); Query OK, 0 rows affected (0.65 sec)Insert some records in the table using insert command −mysql> insert ... Read More

How to use a filter in JSP?

Ankith Reddy

Ankith Reddy

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

697 Views

Following example shows how to print the client's IP address and the current date time, each time it would access any JSP file. This example will give you a basic understanding of the JSP Filter, but you can write more sophisticated filter applications using the same concept −// Import required ... Read More

Floor the decimal values in MySQL instead of round?

Ankith Reddy

Ankith Reddy

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

193 Views

You can use TRUNCATE() method to floor the values instead of round. Let us first create a table −mysql> create table DemoTable (    Value DECIMAL(20, 8) ); Query OK, 0 rows affected (0.54 sec)Insert records in the table using insert command −mysql> insert into DemoTable values(23.5654433); Query OK, 1 ... Read More

How can I profile C++ code running on Linux?

Ankith Reddy

Ankith Reddy

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

500 Views

In Linux platform there are many great profiling tools for profiling C++ programs. Valgrind is one of them. It is widely used. It is a programming tool for memory debugging, memory leak detection, and profiling. We can use Valgrind by passing the binary to it and setting the tool to ... Read More

The contains() method of CopyOnWriteArrayList in Java

Ankith Reddy

Ankith Reddy

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

162 Views

The contains() method of the CopyOnWriteArrayList class is used to get the specified element. It returns TRUE if the element is in the List, else FALSE is returned.The syntax is as followsboolean contains(Object ob)Here, ob is the element to be checked for existence. To work with CopyOnWriteArrayList class, you need ... Read More

8086 program to search a number in a string

Ankith Reddy

Ankith Reddy

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

3K+ Views

In this program we will see how to find a number n from a string (an array of numbers).Problem StatementWrite 8086 Assembly language program to find a number in a string (an array of numbers). The numbers are stored at memory offset 600 onwards.DiscussionIn this program we are taking only ... Read More

Advertisements