Swarali Sree

Swarali Sree

48 Articles Published

Articles by Swarali Sree

Page 3 of 5

How to set all the background properties in one declaration with JavaScript DOM?

Swarali Sree
Swarali Sree
Updated on 23-May-2020 158 Views

To set the background in JavaScript, use the background property. It allows you to set the background color, image, position, etc.ExampleYou can try to run the following code to learn how to set all the background properties in a single declaration with JavaScript.Live Demo           Click to Set background                function display() {             document.body.style.background = "url('https://www.tutorialspoint.com/html5/images/html5-mini-logo.jpg') repeat right top";          }          

Read More

How [ ] is converted to String in JavaScript?

Swarali Sree
Swarali Sree
Updated on 23-May-2020 210 Views

Use the String() method in JavaScript to convert to String. You can try to run the following to learn how to convert [ ] to String in JavaScript.ExampleLive Demo           Convert [] to String                var myVal = [];          document.write("String: " + String(myVal));          

Read More

What happens to the current MySQL transaction if the session is killed by DBA?

Swarali Sree
Swarali Sree
Updated on 27-Feb-2020 766 Views

Suppose if a session is killed in the middle of a transaction then that current MySQL transaction will be rolled back by MySQL and ended. It means that all the database changes made in the current transaction will be removed. It is called n implicit rollback when the session is killed.ExampleSuppose we have the following values in the table ‘marks’mysql> Select * from marks; +------+---------+-----------+-------+ | Id   | Name    | Subject   | Marks | +------+---------+-----------+-------+ |    1 | Aarav   | Maths     |    50 | |    1 | Harshit | Maths   ...

Read More

In SAP system, how can I find details of Change Request with modification?

Swarali Sree
Swarali Sree
Updated on 25-Feb-2020 816 Views

You can view Transport request that contains detail about your changes by going to T-Code SE37. You have to enter the name of Function Module and click on Utilities → Versions → Version ManagementAlso note that when you don’t put the changes in $TMP package, the system will ask you to provide a Transport Request to save or activate your changes.You can also check the package by navigating to Goto → Object Directory Entry in Transaction code: SE37 as below:

Read More

Where and how can I create a private constructor in Java?

Swarali Sree
Swarali Sree
Updated on 25-Feb-2020 391 Views

We can use a private contractor in a Java while creating a singleton class. The Singleton's purpose is to control object creation, limiting the number of objects to only one. Since there is only one Singleton instance, any instance fields of a Singleton will occur only once per class, just like static fields. Singletons often control access to resources, such as database connections or sockets.ExampleThe easiest implementation consists of a private constructor and a field to hold its result, and a static accessor method with a name like getInstance().The private field can be assigned from within a static initializer block ...

Read More

How to truncate a file in Java?

Swarali Sree
Swarali Sree
Updated on 20-Feb-2020 2K+ Views

The flush() method of the FileWriter class flushes the contents of the file. You can use this method to truncate a file.Exampleimport java.io.File; import java.io.FileWriter; public class FileTruncate {    public static void main(String args[]) throws Exception {       File file = new File("myData");       FileWriter fw = new FileWriter(file, false);       fw.flush();       System.out.println("File truncated");    } }OutputFile truncated

Read More

How to capture divide by zero exception in Java?

Swarali Sree
Swarali Sree
Updated on 20-Feb-2020 2K+ Views

When you divide a number by zero an Arithmetic Exception number is thrown.ExampleLive Demopublic class DividedByZero {    public static void main(String args[]) {       int a, b;       try {          a = 0;          b = 54/a;          System.out.println("hello");       } catch (ArithmeticException e) {          System.out.println("you cannot divide a number with zero");       }    } }Outputyou cannot divide a number with zero

Read More

Hiding SAP ABAP table control column

Swarali Sree
Swarali Sree
Updated on 18-Feb-2020 4K+ Views

You can use the structure CXTAB_CONTROL that has the following components:INVISIBLE C(1) Flag (X or blank) for visibility of entire table control.You can use sample program: RSDEMO02 that allow you to modify properties of table control and view the results.When you use this Table control INVISIBLE, this changes the content to “xxxxxxxxxxxx” like a hidden password. If you want to hide the complete column including data and header, your code should be like this −MODULE MODIFY_100 OUTPUT.  DATA wa_tabctrl TYPE cxtab_column .looping the table controlLOOP AT TABCTRL-COLS INTO WA_TABCTRL.  IF WA_TABCTRL-NAME =  'POSNR'. When you get on the desired screen you ...

Read More

Getting number of rows in table in an itab in SAP

SAP
Swarali Sree
Swarali Sree
Updated on 18-Feb-2020 1K+ Views

There is a function “LINES” that can be used to get the number of lines in a table. Here is the code that can be used −DESCRIBE TABLE LINES VR1The variable VR1 will contain the number of rows.

Read More

What does a semicolon do after a C++ class name?

Swarali Sree
Swarali Sree
Updated on 11-Feb-2020 520 Views

If you have statements like −Class Person;This is a forward declaration. It lets the following code know that there is are classes with the name Person. This satisfies the compiler when it sees these names used. Later the linker will find the definition of the classes.

Read More
Showing 21–30 of 48 articles
Advertisements