George John has Published 1081 Articles

Hidden features of C++

George John

George John

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

512 Views

Here we will see some good features and tricks of C++ programming language that can help us in different area. Like if we want to participate in some competitive programming events, then these tricks will help us to reduce the time for writing codes. Let us see some of these ... Read More

How to get the date between TODAY and TODAY-7”?

George John

George John

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

7K+ Views

To get the date between dates, you need to use. Here, we are getting the dates between today and today-7 days −select *from yourTableName where DATE(yourColumnName) > (NOW() - INTERVAL 7 DAY);Note : Let’s say the current date is '2019-06-02’ Let us first create a table.mysql> create table DemoTable   ... Read More

IPC using Message Queues

George John

George John

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

4K+ Views

Why do we need message queues when we already have the shared memory? It would be for multiple reasons, let us try to break this into multiple points for simplification −As understood, once the message is received by a process it would be no longer available for any other process. ... Read More

How to create a top-bottom split pane in Java?

George John

George John

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

331 Views

To create a top-bottom split pane, let us create two components and split them −JComponent one = new JLabel("Top Split"); one.setBorder(BorderFactory.createLineBorder(Color.MAGENTA)); JComponent two = new JLabel("Bottom Split"); two.setBorder(BorderFactory.createLineBorder(Color.ORANGE));Now, we will split them. The two components will be split one on top of the other using VERTICAL_PANE constant −JSplitPane splitPane = ... Read More

Is name a reserved word in MySQL?

George John

George John

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

386 Views

No, name is not a reserved word in MySQL, you can use without backtick symbol. If you are working on a reserved word then use backtick symbol. Let us first create a table −mysql> create table name    (    name varchar(10)    ); Query OK, 0 rows affected (0.78 ... Read More

I/O Redirection in C++

George John

George John

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

725 Views

In C, we can use the freopen() function for redirection purposes. Using this function, we can redirect existing FILE pointer to another stream. The syntax of the freopen is like below:FILE *freopen(const char* filename, const char* mode, FILE *stream)In C++ also, we can do the redirection. In C++, the streams ... Read More

HTML DOM Anchor pathname Property

George John

George John

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

131 Views

The HTML DOM Anchor pathname property is used to set or return the path name of the href attribute.Following is the syntax to set the pathname property −anchorObj.pathname = pathAbove, path is the pathname of the URL.Following is the syntax to return the pathname property −anchorObj.pathnameLet us now see an ... Read More

Java Program to set different height for multiple rows in JTable

George John

George John

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

212 Views

To set different height for multiple rows, use the setRowHeight() method for separate rows for which you want to increase the row height. Let us first see an example to create a table with same height for all the rows −Examplepackage my; import java.awt.Color; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JScrollPane; ... Read More

MySQL automatic conversion on lowercase? Is this possible?

George John

George John

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

381 Views

Yes, it is possible with triggers. You can create trigger for automatic conversion on lower case. Let us first create a table −mysql> create table DemoTable    (    StudentSubject text    ); Query OK, 0 rows affected (0.61 sec)Let us create a trigger for automatic conversion on lower case ... Read More

How can I view the indexes I have set up in MySQL?

George John

George John

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

135 Views

To view the indexes, you can use SHOW command.Following is the syntax −show index from yourTableName;Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    FirstName varchar(20),    LastName varchar(20)    ); Query OK, 0 rows affected (0.46 sec)Following ... Read More

Advertisements