Nishtha Thakur

Nishtha Thakur

398 Articles Published

Articles by Nishtha Thakur

Page 8 of 40

How can it be possible to add 3 months interval in a MySQL date without using the word ‘Months’ with interval?

Nishtha Thakur
Nishtha Thakur
Updated on 29-Jan-2020 444 Views

It is possible with the help of keyword Quarter as follows −mysql> Select '2017-06-20' + INTERVAL 1 Quarter AS 'After 3 Months Interval'; +-------------------------+ | After 3 Months Interval | +-------------------------+ | 2017-09-20              | +-------------------------+ 1 row in set (0.00 sec)

Read More

HTML5 validity of nested tables

Nishtha Thakur
Nishtha Thakur
Updated on 28-Jan-2020 201 Views

The validator considers the following table as valid:                 Example                                                                                                                                                My                            Table                                                                                                                

Read More

Improve performance of a HTML5 Canvas with particles bouncing around

Nishtha Thakur
Nishtha Thakur
Updated on 28-Jan-2020 217 Views

To enhance the performance of Canvas with particles bouncing around, try the following:Separate the calculations from the drawing.Request a redraw after you have updated your calculations.Optimize collision detection by not testing evert particle against each other.Reduce callback usage.Reduce function calls.Inline.

Read More

Stop Web Workers in HTML5

Nishtha Thakur
Nishtha Thakur
Updated on 28-Jan-2020 1K+ Views

Web Workers allow for long-running scripts that are not interrupted by scripts that respond to clicks or other user interactions and allows long tasks to be executed without yielding to keep the page responsive.Web Workers don't stop by themselves but the page that started them can stop them by calling terminate() method.worker.terminate();A terminated Web Worker will no longer respond to messages or perform any additional computations. You cannot restart a worker; instead, you can create a new worker using the same URL.

Read More

How to detect all active JavaScript event handlers?

Nishtha Thakur
Nishtha Thakur
Updated on 09-Jan-2020 818 Views

The simplest solution is to use jQuery to detect all active JavaScript event handlers.ExampleYou can try to run the following code to detect active event handlersLive Demo                          var myEvent = $("#demo");          myEvent.mouseover(function() {});          $.each(myEvent.data("events"), function(i, e) {             alert(i);          });                     Demo Text    

Read More

Join using CE functions in SAP HANA database

Nishtha Thakur
Nishtha Thakur
Updated on 18-Dec-2019 392 Views

You can try using projection node as followsExampletable1 = CE_PROJECTION(:T1,["ACCT_ID","SALARY"]); table2 = CE_PROJECTION(:T2,["EMPL_ID" AS “ACCT_ID”,"ADD","ZIP","STATE"]); var_out = CE_JOIN(:table1,:table2,[“ACCT_ID”])Using Projection node, you can rename the column names. Note that EMPL_ID has been renamed to ACCT_ID

Read More

Preserve select order within MySQL UNION?

Nishtha Thakur
Nishtha Thakur
Updated on 30-Jul-2019 345 Views

It’s a good choice to use CASE statement. Do not use UNION. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ShippingDate datetime    ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(ShippingDate) values('2019-04-21'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable(ShippingDate) values('2019-01-01'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable(ShippingDate) values('2019-05-11'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable(ShippingDate) values('2018-12-31'); Query OK, 1 row ...

Read More

C++ Program to Perform integer Partition for a Specific Case

Nishtha Thakur
Nishtha Thakur
Updated on 30-Jul-2019 195 Views

This is a C++ program to perform integer partition for a specific case. In this program, a positive integer n is given, and shall have to generate all possible unique ways to represent n as sum of positive integers.AlgorithmBegin    function displayAllUniqueParts(int m):    1) Set Index of last element k in a partition to 0    2) Initialize first partition as number itself, p[k]=m    3) Create a while loop which first prints current partition, then generates next partition. The loop stops    when the current partition has all 1s.    4) Display current partition as displayArray(p, k + ...

Read More

How to search by specific pattern in MySQL?

Nishtha Thakur
Nishtha Thakur
Updated on 30-Jul-2019 183 Views

You can use regular expression for this. Let us first create a table −mysql> create table DemoTable    (    UserId varchar(100)    ); Query OK, 0 rows affected (1.28 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('User-123-G'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('Us-453-GO'); Query OK, 1 row affected (0.08 sec) mysql> insert into DemoTable values('TRUE-908-K'); Query OK, 1 row affected (0.20 sec)Display all records from the table using select statement −mysql> select *from DemoTable;This will produce the following output −+------------+ | UserId     | ...

Read More

How to center align component using BoxLayout with Java?

Nishtha Thakur
Nishtha Thakur
Updated on 30-Jul-2019 7K+ Views

Let us first create a panel and set some buttons −JPanel panel = new JPanel(); JButton btn1 = new JButton("One"); JButton btn2 = new JButton("Two"); JButton btn3 = new JButton("Three"); JButton btn4 = new JButton("Four"); JButton btn5 = new JButton("Five"); panel.add(btn1); panel.add(btn2); panel.add(btn3); panel.add(btn4); panel.add(btn5);Now, use the setAlignmentX() and within that specify alignment to the center of the component −panel.setAlignmentX(Component.CENTER_ALIGNMENT);The following is an example to center align component using BoxLayout −Examplepackage my; import java.awt.Component; import java.awt.Dimension; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class SwingDemo {    public static void main(String[] args) {       ...

Read More
Showing 71–80 of 398 articles
« Prev 1 6 7 8 9 10 40 Next »
Advertisements