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
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?
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 MoreHow can we convert TIME and DATETIME values to numeric form in MySQL?
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 MoreHow to compare two JavaScript Date Objects?
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 MoreHow to reverse the elements of an array using stack in java?
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 MoreHow to store the contents of arrays in a file using Java?
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 MoreChecking number of rows in an internal table in SAP
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 MoreHow to label a block in JavaScript?
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 MoreHow to do bitwise complement on a 16-bit signal using Python?
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 MoreHow to create a context menu for an element in HTML5?
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 MoreWhat is the Eclipse keyboard shortcut for "public static void main(String[] args) " in Java?
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