Anvi Jain

Anvi Jain

427 Articles Published

Articles by Anvi Jain

Page 9 of 43

Why HTML5 Web Workers are useful?

Anvi Jain
Anvi Jain
Updated on 29-Jan-2020 217 Views

JavaScript was designed to run in a single-threaded environment, meaning multiple scripts cannot run at the same time. Consider a situation where you need to handle UI events, query and process large amounts of API data, and manipulate the DOM.JavaScript will hang your browser in situation where CPU utilization is high. Let us take a simple example where Javascript goes through a big loop:           Big for loop                function bigLoop(){             for (var i = 0; i

Read More

How can I add one day to DATETIME field in MySQL query?

Anvi Jain
Anvi Jain
Updated on 29-Jan-2020 2K+ Views

With the help of DATE_ADD() function, we can add one day to the DATETIME field of a table.mysql> Select StudentName, RegDate, Date_ADD(RegDate, INTERVAL +1 day) AS 'NEXT DAY'        from testing where StudentName = 'gaurav'; +-------------+---------------------+---------------------+ | StudentName | RegDate             | NEXT DAY            | +-------------+---------------------+---------------------+ | Gaurav      | 2017-10-29 08:48:33 | 2017-10-30 08:48:33 | +-------------+---------------------+---------------------+ 1 row in set (0.00 sec)Above query will add one day to the RegDate where StudentName is Gaurav in MySQL table named ‘testing’.

Read More

How can I store ‘0000-00-00’ as a date in MySQL?

Anvi Jain
Anvi Jain
Updated on 28-Jan-2020 2K+ Views

For storing the date like ‘0000-00-00’ in a column of MySQL table, we must have to set the SQL mode to ‘allow_invalid_date’. Following example will demonstrate it −mysql> SET sql_mode = 'allow_invalid_dates'; Query OK, 0 rows affected, 1 warning (0.03 sec) mysql> Create table test_date(date_order date); Query OK, 0 rows affected (0.45 sec) mysql> Insert into test_date(date_order) values('0000-00-00'); Query OK, 1 row affected (0.04 sec) mysql> Select * from test_date; +------------+ | date_order | +------------+ | 0000-00-00 | +------------+ 1 row in set (0.00 sec)

Read More

HTML5 meta name = “viewport” doesn't work as expected

Anvi Jain
Anvi Jain
Updated on 28-Jan-2020 812 Views

To solve the issue for HTML5 meta viewport, you can any of the following fix:You can also try this:Let us say you have a site width of 100px, then it won’t display the whole page, withinitial-scale = 1

Read More

Creating content with HTML5 Canvas much more complicated than authoring with Flash

Anvi Jain
Anvi Jain
Updated on 28-Jan-2020 173 Views

Flash provides amazing GUI and lots of visual features for animations. It allows the user build everything inside a particular platform without a full integration into the browser wrapped inside the browser with the main scopes that are multimedia and other kinds of animation.HTML5 element gives you an easy and powerful way to draw graphics using JavaScript. It can be used to draw graphs, make photo compositions or do simple (and not so simple) animations.Here is a simple element which has only two specific attributes width and height plus all the core HTML5 attributes like id, name, and ...

Read More

How to format JavaScript date into yyyy-mm-dd format?

Anvi Jain
Anvi Jain
Updated on 16-Jan-2020 4K+ Views

To format a JavaScript date into “yyyy-mm-dd” format, use the toISOString() method. It converts using ISO standard i.e.YYYY-MM-DDTHH:mm:ss.sssExampleYou can try to run the following code to format a date. Live Demo           JavaScript Dates                    var date, res;          date = new Date();          res = date.toISOString();          document.write(res);           Output2018-12-15T08:13:47.648Z

Read More

How to redirect website after certain amount of time without JavaScript?

Anvi Jain
Anvi Jain
Updated on 08-Jan-2020 6K+ Views

To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value of the content is the number of seconds; you want the page to redirect after.Through this, you can automatically redirect your visitors to a new homepage. Set the content attribute to 0, if you want it to load immediately.ExampleThe following is an example of redirecting current page to another page after 2 seconds.Live Demo           Redirection                     This page will redirect in 2 seconds.    

Read More

Using SQL statements in ABAP Programming and Database performance

Anvi Jain
Anvi Jain
Updated on 18-Dec-2019 352 Views

The basic principle for performance is that there should be minimal data transferred between application server and database.For your first question, I would suggest to select only the fields that are required. So, don’t use SELECT * in case you don’t require all the fields. But in specific scenarios, if you have multiple SELECT statements at various parts of your program querying the same table but different columns, it is advisable to use SELECT * as the output is stored in a buffer till your program execute. In that case, when you come to subsequent select, the system uses the ...

Read More

What are the differences between JavaScript and PHP cookies?

Anvi Jain
Anvi Jain
Updated on 03-Oct-2019 879 Views

JavaScript CookiesUsing JavaScript cookies is the most efficient method of remembering and tracking preferences, purchases, commissions, and other information required for better visitor experience or site statistics.PHP CookiesCookies are text files stored on the client computer and they are kept for tracking purpose. PHP transparently supports HTTP cookies.How JavaScript cookies work?Your server sends some data to the visitor's browser in the form of a cookie. The browser may accept the cookie. If it does, it is stored as a plain text record on the visitor's hard drive. Now, when the visitor arrives at another page on your site, the browser ...

Read More

Implement Conditional MySQL Query in a stored procedure?

Anvi Jain
Anvi Jain
Updated on 30-Jul-2019 768 Views

For conditional MySQL query, you can use IF ELSE concept in stored procedure. Let us first create a table −mysql> create table DemoTable1    (    Id int    ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values(10); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable1 values(20); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable1 values(30); Query OK, 1 row affected (0.12 sec)Display all records from the table using select statement −mysql> select *from DemoTable1;This will produce the following output ...

Read More
Showing 81–90 of 427 articles
« Prev 1 7 8 9 10 11 43 Next »
Advertisements