Ramu Prasad

Ramu Prasad

48 Articles Published

Articles by Ramu Prasad

Page 2 of 5

While creating a MySQL table, how can I specify the storage engine of my choice rather than using the default storage engine InnoDB?

Ramu Prasad
Ramu Prasad
Updated on 20-Jun-2020 154 Views

While creating a MySQL table, the storage engine can be specified as follows −mysql> CREATE TABLE Student(id INTEGER PRIMARY KEY, Name VARCHAR(15)) -> ENGINE = 'MyISAM'; Query OK, 0 rows affected (0.28 sec)The ENGINE keyword specifies the storage engine used for this particular table.

Read More

How can we convert TIME and DATETIME values to numeric form in MySQL?

Ramu Prasad
Ramu Prasad
Updated on 19-Jun-2020 720 Views

Conversion of TIME(N) and DATETIME(N) values to numeric form can be done by adding 0(+0) to them. Followings are the rules for such kind of conversion −Converted to INTEGERThe TIME(N) and DATETIME(N) values will be converted to an integer when N is 0.For example, the values of CURTIME() and NOW() can be converted to integer values as follows −mysql> SELECT CURTIME(), CURTIME()+0; +-----------+-------------------+ | CURTIME() | CURTIME()+0       | +-----------+-------------------+ | 19:42:54  | 194254            | +-----------+-------------------+ 1 row in set (0.04 sec) mysql> SELECT NOW(), NOW()+0; +-------------------------+----------------------------------+ | NOW()       ...

Read More

How to compare two JavaScript Date Objects?

Ramu Prasad
Ramu Prasad
Updated on 18-Jun-2020 400 Views

To compare two date objects with JavaScript, create two dates object and get the recent date to compare it with the custom date.ExampleYou can try to run the following code to compare two dates −Live Demo                    var date1, date2;          date1 = new Date();          document.write(date1);          date2 = new Date( "Dec 10, 2015 20:15:10" );          document.write(""+date2);          if (date1 > date2) {             document.write("Date1 is the recent date.");          } else {             document.write("Date 2 is the recent date.");          }           OutputMon May 28 2018 09:48:49 GMT+0530 (India Standard Time) Thu Dec 10 2015 20:15:10 GMT+0530 (India Standard Time) Date1 is the recent date

Read More

How to reverse the elements of an array using stack in java?

Ramu Prasad
Ramu Prasad
Updated on 16-Jun-2020 4K+ Views

Stack is an Abstract Data Type (ADT), commonly used in most programming languages. It is named stack as it behaves like a real-world stack, for example – a deck of cards or a pile of plates, etc.A stack is first in first out, it has two main operations push and pop. Push inserts data in to it and pop retrieves data from it.To reverse an array using stack initially push all elements in to the stack using the push() method then, retrieve them back using the pop() method into another array.ExampleLive Demoimport java.util.Arrays; import java.util.Stack; public class ReversinArrayUsingStack { ...

Read More

How to store the contents of arrays in a file using Java?

Ramu Prasad
Ramu Prasad
Updated on 16-Jun-2020 3K+ Views

You can use write data into a file using the Writer classes. In the example given below, we are writing the contents of the array using the BufferedWriter.ExampleLive Demoimport java.io.BufferedWriter; import java.io.FileWriter; public class WritingStringArrayToFile {    public static void main(String args[]) throws Exception {       String[] myArray = {"JavaFX", "HBase", "OpenCV", "Java", "Hadoop", "Neo4j"};       BufferedWriter writer = new BufferedWriter(new FileWriter("myFile.txt", false));       for(int i = 0; i < myArray.length; i++) {          writer.write(myArray[i].toString());          writer.newLine();       }       writer.flush();     ...

Read More

Checking number of rows in an internal table in SAP

SAP
Ramu Prasad
Ramu Prasad
Updated on 15-Jun-2020 13K+ Views

You can use the LINES function to get the number of rows in an internal table.Use the following syntax to call the function:DESCRIBE TABLE LINES Once the function is executed the variable will hold the number of rows in the internal table.

Read More

How to label a block in JavaScript?

Ramu Prasad
Ramu Prasad
Updated on 15-Jun-2020 560 Views

A block statement groups zero or more statements. In languages other than JavaScript, it is known as a compound statement.SyntaxHere’s the syntax −{    //List of statements }To add a label to a block, use the following −Identifier_for_label: {    StatementList }Let’s use it for break statement. You can try to run the following code to use labels to control the flow, with break statementExampleLive Demo                    document.write("Entering the loop! ");          outerloop:   // This is the label name          for (var i = ...

Read More

How to do bitwise complement on a 16-bit signal using Python?

Ramu Prasad
Ramu Prasad
Updated on 05-Mar-2020 366 Views

If you want to get an inversion of only first 16 bits of a number, you can take a xor of that number with 65535(16 1s in binary). examplea = 3 # 11 in binary b = a ^ 65535 print(bin(b))OutputThis will give the output −0b1111111111111100

Read More

How to create a context menu for an element in HTML5?

Ramu Prasad
Ramu Prasad
Updated on 03-Mar-2020 590 Views

Use the contextmenu attribute in HTML5 to create a context menu for an element. A context menu generates when a user right-clicks. ExampleYou can try to run the following code to create a context menu −           HTML menuitem Tag                        Right click inside here....                                                                              

Read More

What is the Eclipse keyboard shortcut for &quot;public static void main(String[] args) &quot; in Java?

Ramu Prasad
Ramu Prasad
Updated on 20-Feb-2020 9K+ Views

To get public static void main(String[] args) line in eclipse without typing the whole line type main and press Ctrl + space then, you will get the option for the main method select it.

Read More
Showing 11–20 of 48 articles
Advertisements