Kumar Varma

Kumar Varma

88 Articles Published

Articles by Kumar Varma

Page 2 of 9

How to get Euler's constant value in JavaScript?

Kumar Varma
Kumar Varma
Updated on 15-Mar-2026 902 Views

To get Euler's constant value in JavaScript, use the Math.E property. This represents Euler's constant and the base of natural logarithms, approximately 2.718281828459045. Syntax Math.E Example: Basic Usage You can access Euler's constant directly from the Math object: JavaScript Math E Property var property_value = Math.E; document.write("Euler's constant value is: " + property_value); ...

Read More

What is the difference between single and double quotes in JavaScript?

Kumar Varma
Kumar Varma
Updated on 15-Mar-2026 273 Views

In JavaScript, you can use either single quotes or double quotes to define strings. Both are functionally identical, but it's important to maintain consistency throughout your code. Syntax let singleQuoted = 'Hello World'; let doubleQuoted = "Hello World"; Basic Examples let message1 = "Hello, JavaScript!"; let message2 = 'Hello, JavaScript!'; console.log(message1); console.log(message2); console.log(message1 === message2); // Both are identical Hello, JavaScript! Hello, JavaScript! true Escaping Quotes When your string contains quotes, you need to escape them or use the opposite quote type: // Escaping ...

Read More

Replacing multiple occurrence by a single occurrence in SAP HANA

Kumar Varma
Kumar Varma
Updated on 13-Mar-2026 1K+ Views

The code you are using \1+ just removes consecutive occurrences only. To replace multiple occurrences of any character with a single occurrence, you can use the following approach with REPLACE_REGEXPR function in SAP HANA. Using Regular Expression to Remove Multiple Occurrences The regular expression pattern (.)(?=.*\1) works by capturing any character and looking ahead to see if the same character appears later in the string. This allows us to remove all duplicate occurrences while keeping only the last one − SELECT REPLACE_REGEXPR('(.)(?=.*\1)' IN '22331122' WITH '' ...

Read More

Connecting to SAP HANA using odbc_connect() on PHP

Kumar Varma
Kumar Varma
Updated on 13-Mar-2026 819 Views

The error you are getting is because there are no ODBC drivers installed for your PHP client. You would require downloading the appropriate drivers to establish a connection with SAP HANA database. Installing ODBC Drivers for SAP HANA Following steps can be performed to download and install the drivers − Download the drivers from https://www.easysoft.com/cgi-bin/account/login.cgi after registration or alternatively check the ODBC-ODBC Bridge Client platforms at ...

Read More

Find the 3rd smallest number in a Java array.

Kumar Varma
Kumar Varma
Updated on 11-Mar-2026 5K+ Views

ExampleFollowing is the required program.public class Tester {    public static int getThirdSmallest(int[] a) {       int temp;       //sort the array       for (int i = 0; i < a.length; i++) {          for (int j = i + 1; j < a.length; j++) {             if (a[i] > a[j]) {                temp = a[i];                a[i] = a[j];                a[j] = temp;             }          }       }       //return third smallest element       return a[2];    }    public static void main(String args[]) {       int a[] = { 11,10,4, 15, 16, 13, 2 };       System.out.println("Third Smallest: " +getThirdSmallest(a));    } }OutputThird smallest: 10

Read More

Member variables in Java

Kumar Varma
Kumar Varma
Updated on 11-Mar-2026 11K+ Views

Member variables are known as instance variables in java.Instance variables are declared in a class, but outside a method, constructor or any block.When space is allocated for an object in the heap, a slot for each instance variable value is created.Instance variables are created when an object is created with the use of the keyword 'new' and destroyed when the object is destroyed.Instance variables hold values that must be referenced by more than one method, constructor or block, or essential parts of an object's state that must be present throughout the class.Instance variables can be declared in a class level ...

Read More

Query MySQL with unicode char code?

Kumar Varma
Kumar Varma
Updated on 30-Jun-2020 588 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Value int    -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(0x41); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values(0x30); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values(0x61); Query OK, 1 row affected (0.27 sec)Display all records from the table using select statement −mysql> select *from DemoTable;OutputThis will produce the following output −+-------+ | Value | +-------+ |    65 | | ...

Read More

How to get total occurrences of a value within its own MySQL query?

Kumar Varma
Kumar Varma
Updated on 30-Jun-2020 262 Views

For this, you can use subquery. Let us first create a table −mysql> create table DemoTable    -> (    -> Value int    -> ); Query OK, 0 rows affected (0.61 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(20); Query OK, 1 row affected (0.23 sec) mysql> insert into DemoTable values(30); Query OK, 1 row affected (0.36 sec) mysql> insert into DemoTable values(20); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable values(40); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values(30); Query OK, ...

Read More

How to remove all instances of a specific character from a column in MySQL?

Kumar Varma
Kumar Varma
Updated on 30-Jun-2020 1K+ Views

Let us first create a table −mysql> create table DemoTable    -> (    -> FirstName varchar(100)    -> ); Query OK, 0 rows affected (0.41 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Adam^^^'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('^^^^^^^^Carol'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values('Robert^^^^^^'); Query OK, 1 row affected (0.14 sec)Display all records from the table using select statement −mysql> select *from DemoTable;OutputThis will produce the following output −+---------------+ | FirstName     | +---------------+ | Adam^^^   ...

Read More

Select all rows except from today in MySQL?

Kumar Varma
Kumar Varma
Updated on 30-Jun-2020 569 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Name varchar(100),    -> DueDate datetime    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command. Let’s say the current date is “2019-07-03” −mysql> insert into DemoTable values('Chris', '2019-06-24'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values('Chris', '2018-01-01'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Robert', '2019-07-03'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable values('Carol', '2019-08-03'); Query OK, 1 row affected (0.22 ...

Read More
Showing 11–20 of 88 articles
« Prev 1 2 3 4 5 9 Next »
Advertisements