Ankith Reddy has Published 1070 Articles

How do I avoid the variable value in a MySQL stored procedure to change when records are updated?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:26

144 Views

We will create a stored procedure that does not change the variable value whenever the value is updated.Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Value int    ); Query OK, 0 rows affected (0.63 sec)Insert some ... Read More

HTML DOM Abbreviation Object

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:26

183 Views

The element is used in HTML to display abbreviations. The Abbreviation object represent this element.In the below example, we will learn how to access an abbreviation object −Example Live Demo Demo Heading BCCI Display the abbreviation title Abbreviation Title    function display() {       var ... Read More

What is the precision of floating point in C++?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:26

819 Views

In C++, the size of the floating point number is either 4-byte or 8-bytes. So it can store up to few decimal places. For example, the 1/3 = 0.333333…… Up to infinity. If we store it inside floating type variable, then it will store some significant digits. The default value ... Read More

How to create a Vertical menu bar in Java?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:26

798 Views

Let us create a MenuBar −JMenuBar menuBar = new JMenuBar();Now, set its layout to create a Vertical Menu Bar with GridLayout −menuBar.setLayout(new GridLayout(0, 1));The following is an example to create a Vertical menu bar in Java −Examplepackage my; import java.awt.GridLayout; import java.awt.event.KeyEvent; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; ... Read More

How to get day name from timestamp in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:26

231 Views

To get the day name from timestamp, use dayname() function −select dayname(yourColumnName) from yourTableName;    Let us first create a table :    mysql> create table DemoTable    (    LoginDate timestamp    ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert command −mysql> ... Read More

How to use range-based for() loop with std::map?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:26

1K+ Views

Here we will see how to use the range based for loop for std::map type objects. In C++, we know that there are map type objects. That can store key value pairs. The map basically stores the pair objects. This pair object is used to store one key and corresponding ... Read More

HTML DOM Anchor password Property

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:26

83 Views

The HTML DOM Anchor password property set or return the password part of the href attribute value. The password part is entered by the user. If you want to display it, then it can be seen after the username and before the hostname i.e. https −//username −password@www.demo.com.Following is the syntax ... Read More

How to create a nested JSplitPane in Java?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:26

192 Views

Let us first create three components −JComponent one = new JLabel("Label One"); one.setBorder(BorderFactory.createLineBorder(Color.yellow)); JComponent two = new JLabel("Label Two"); two.setBorder(BorderFactory.createLineBorder(Color.orange)); JComponent three = new JLabel("Label Three"); three.setBorder(BorderFactory.createLineBorder(Color.blue));Now, we will split one and two components.JSplitPane split1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, one, two); split1.setDividerLocation(0.5); split1.setDividerSize(2);After that the above splitted pane would be splitted ... Read More

How do I split a numerical query result in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:26

102 Views

To split a numerical query result, you can use the CONCAT() function in MySQL. Let us first create a table −mysql> create table DemoTable    (    StudentId int    ); Query OK, 0 rows affected (0.68 sec)Now you can insert some records in the table using insert command −mysql> ... Read More

What do you mean by a dynamic initialization of variables?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:26

7K+ Views

Dynamic initialization of object refers to initializing the objects at run time i.e. the initial value of an object is to be provided during run time. Dynamic initialization can be achieved using constructors and passing parameters values to the constructors. This type of initialization is required to initialize the class ... Read More

Advertisements