Arjun Thakur has Published 1109 Articles

Get only the date in timestamp in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 11:00:02

2K+ Views

In order to get the date from the timestamp, you can use DATE() function from MySQL.The syntax is as follows −SyntaxSELECT DATE(yourTimestampColumnName) as anyVariableName from yourTableName;To understand the above syntax, let us first create a table. The query to create a table is as follows −mysql> create table DateFromTimestamp -> ... Read More

log1p() in C++

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 10:11:47

72 Views

The function log1p() is used to calculate the natural logarithm (base e logarithm) of (a+1) where a is any number. It returns the value of natural logarithm of (a+1). It returns Not a number(Nan) when we pass a value which is less than -1.Here is the mathematical expression of log1p(), ... Read More

How to convert a single character to string in C++?

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 10:09:24

157 Views

There are several methods to convert a single character to a string. In the following example, some of them are used to convert a character to a string.Here is an example of converting a single character to string in C++ language, Example Live Demo#include #include #include int main() { ... Read More

What is the difference between new/delete and malloc/ free in C/ C++?

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 10:07:58

2K+ Views

new/ deleteThe new operator requests for the memory allocation in heap. If the sufficient memory is available, it initializes the memory to the pointer variable and returns its address.The delete operator is used to deallocate the memory. User has the privilege to deallocate the created pointer variable by this delete ... Read More

What does '?' do in C/C++?

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 10:03:05

1K+ Views

The operator ‘?’ is known as ternary operator as it requires three operands to act upon. It can be represented by “ ? : ”. It is also known as conditional operator. The operator improves the performance and reduces the lines of code.Here is the syntax of ternary operator in ... Read More

How to get the dimensions of a view in Android?

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 09:55:03

5K+ Views

There are so many cases, we should create dynamic view rather than creating view in XML. In that scenario, we should need to get the dimensions of a view. So here is a simple solution to get the dimensions of a view in android.To get the height of any view ... Read More

Which property is used to tell the browser what to do if the box's content is larger than the box itself?

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 09:52:58

109 Views

CSS provides a property called overflow which tells the browser what to do if the box's contents are larger than the box itself. This property can take one of the following values −ValueDescriptionvisibleAllows the content to overflow the borders of its containing element.hiddenThe content of the nested element is simply cut ... Read More

Pass an array by value in C

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 09:51:32

654 Views

Here is an example of passing array by value in C language, Example Live Demo#include float avg(float a[]) {    int i;    float avg, sum = 0.0;    for (i = 0; i < 6; ++i) {       sum += a[i];    }    avg = ... Read More

Do you think operator < is faster than <= in C/C++?

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 09:45:25

949 Views

No, the operator < takes same time to execute as operator

isless() in C/C++

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 09:42:06

259 Views

The function isless() is used to check that first argument is less than the second one. It is declared in “math.h” header file in C language. It returns true if successful otherwise it returns false.Here is the syntax of isless() in C language, bool isless(value1 , value2);Here, value1 − This ... Read More

Advertisements