Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Kumar Varma
Page 2 of 9
How to get Euler's constant value in JavaScript?
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 MoreWhat is the difference between single and double quotes in JavaScript?
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 MoreReplacing multiple occurrence by a single occurrence in SAP HANA
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 MoreConnecting to SAP HANA using odbc_connect() on PHP
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 MoreFind the 3rd smallest number in a Java array.
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 MoreMember variables in Java
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 MoreQuery MySQL with unicode char code?
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 MoreHow to get total occurrences of a value within its own MySQL query?
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 MoreHow to remove all instances of a specific character from a column in MySQL?
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 MoreSelect all rows except from today in MySQL?
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