Articles on Trending Technologies

Technical articles with clear explanations and examples

How to Find the Sum of Natural Numbers using Python?

Jayashree
Jayashree
Updated on 21-Feb-2020 1K+ Views

You can use while loop to successively increment value of a variable i by one and adding it cumulatively.s,i=0,0 n=10 while i

Read More

Which is the best tool to debug JavaScript/jQuery code?

Daniol Thomas
Daniol Thomas
Updated on 21-Feb-2020 225 Views

The following are some of the best browser-based debugging tools for JavaScript −FireBugFireBug is a Firefox addon, widely used to inspect the code. Edit, debug and monitor CSS, HTML, and JavaScript live in any web page.Credit− FirebugDragonFlyDragonFly is a fully-featured suite of developer tools. It supports cross-device and remote debugging, which makes the work of developers easy.Credit − DragonFly

Read More

How to generate armstrong numbers in Python?

Jayashree
Jayashree
Updated on 21-Feb-2020 2K+ Views

Any three digit number is called an Armstrong number of sum of cube of its digits equals the number itself. In order to check if a number satisfies this condition, each digit from it is successively separated from right and its cube is cumulatively added. In the end if the sum is found to be equal to original number, it is called Armstrong number.ExampleFollowing Python code prints all armstrong numbers between 100 to 999for num in range(100, 1000):   temp=num   sum=0   while temp>0:     digit=temp%10     sum=sum+digit**3     temp=temp//10   if sum==num:     ...

Read More

What are the new methods added to an Optional class in Java 9?

raja
raja
Updated on 21-Feb-2020 358 Views

An Optional class provides a container that may or may not contain a non-null value. This Optional class introduced in Java 8 to reduce the number of places in the code where a NullPointerException can be generated. Java 9 added three new methods to Optional class: or(), ifPresentOrElse() and stream() that help us to deal with default values.Optional.or()The or() method introduced in Java 9 and the parameter of this method is a functional interface Supplier. This method always gives us an Optional object that is not empty. If the Optional object is not empty, it returns the Optional object itself. ...

Read More

How MySQL stored GENERATED COLUMNS can work with mathematical expressions?

Samual Sam
Samual Sam
Updated on 21-Feb-2020 208 Views

It can be illustrated with the help of an example in which we are creating a stored generated column in the table named ‘triangle_stored’. As we know that stored generated column can be generated by using the keyword ‘stored’.Examplemysql> Create table triangle_stored(SideA DOUBLE, SideB DOUBLE, SideC DOUBLE AS (SQRT(SideA * SideB + SideB * SideB)) STORED); Query OK, 0 rows affected (0.47 sec) mysql> Describe triangle_stored; +-------+--------+------+-----+---------+------------------+ | Field | Type | Null | Key | Default | Extra | +-------+--------+------+-----+---------+------------------+ | SideA | double | ...

Read More

@SafeVarargs annotation for private methods in Java 9?

raja
raja
Updated on 21-Feb-2020 422 Views

The @SafeVarargs annotation was introduced in Java 7. This annotation applies to both final and static methods or constructors that take varargs parameters. This annotation used to make sure that a method does not perform unsafe operations on its varargs parameters. Since Java 9, @SafeVarargs annotation also applies to private instance methods.Syntax@SafeVarargs private void methodName(...) {    // some statements }Exampleimport java.util.ArrayList; import java.util.List; public class SafevarargsTest {    @SafeVarargs     // Apply @SafeVarargs to private methods    private void display(List... names) {       for(List name : names) {          System.out.println(name);       }    }    public static void ...

Read More

How Can MySQL virtual GENERATED COLUMNS work with built-in functions?

Ayyan
Ayyan
Updated on 21-Feb-2020 354 Views

It can be illustrated with the help of an example in which we are creating a virtual generated column in the table named ‘employee_data’. As we know that virtual generated column can be generated with or without using the keyword ‘virtual’.Examplemysql> Create table employee_data(ID INT AUTO_INCREMENT PRIMARY KEY, First_name VARCHAR(50) NOT NULL, Last_name VARCHAR(50) NOT NULL, FULL_NAME VARCHAR(90) GENERATED ALWAYS AS(CONCAT(First_name, '', Last_name))); Query OK, 0 rows affected (0.55 sec) mysql> DESCRIBE employee_data; +------------+-------------+------+-----+---------+-------------------+ | Field | Type ...

Read More

How do you check if a ResultSet is empty or not in JDBC?

Vikyath Ram
Vikyath Ram
Updated on 21-Feb-2020 9K+ Views

Whenever we execute SQL statements using the executeQuery() method, it returns a ResultSet object which holds the tabular data returned by the SELECT queries(in general).The ResultSet object contains a cursor/pointer which points to the current row. Initially this cursor is positioned before first row (default position).The next() methodThe next() method of the ResultSet interface moves the pointer of the current (ResultSet) object to the next row, from the current position.This method returns a boolean value specifying whether the ResultSet object contains more rows. If there are no rows next to its current position this method returns false, else it returns true.Therefore, ...

Read More

Changing default schema in SQL console in SAP HANA

John SAP
John SAP
Updated on 21-Feb-2020 2K+ Views

To change the default schema, you have to select schema name from Catalog folder and click on SQL tab at the top.You can also right click on Schema in which you want to create Relational objects and select Open SQL Console. In below pic, you can see the Schema AA_HANA11 and right click → Open SQL Console.At the top of SQL console, you can see Schema name where the objects will be created using this console.

Read More

Granting _SYS_REPO with SELECT to user schema in SAP HANA

John SAP
John SAP
Updated on 21-Feb-2020 6K+ Views

In SAP HANA system _SYS_REPO user is required to create run time objects that are saved in HANA database under _SYS_BIC schema. When you activate modeling views in HANA, SYS REPO provides the read access to users on these modeling views. That is why it is required to grant _SYS_REPO with SELECT with GRANT privilege to user schemas.GRANT SELECT ON SCHEMA "SCHEMA_NAME" TO _SYS_REPO WITH GRANT OPTIONThis is required when you use objects of a table/view of a schema to build HANA Modeling Views. You need to grant _SYS_REPO the SELECT WITH GRANT privilege on this schema.

Read More
Showing 54851–54860 of 61,297 articles
Advertisements