To detect Bezier path shape on click, try the following code −Examplevar l = boxes.length; for (var i = l-1; i >= 0; i--) { drawshape(gctx, boxes[i], 'black', 'black'); var imgData = gctx.getImageData(mx, my, 1, 1); var index = (mx + my * imgData.width) * 4; if (imgData.data[3] > 0) { mySel = boxes[i]; offsetx = mx - mySel.x; offsety = my - mySel.y; mySel.x = mx - offsetx; mySel.y = my - offsety; isDrag = true; canvas.onmousemove = myMove; invalidate(); clear(gctx); return; } }
Create an array and convert it to List −Integer[] arr = { 10, 15, 20, 10, 10, 10, 20, 30, 35, 40, 40}; List l = Arrays.asList(arr);Now, let us convert the above array to HashSet −Set s = new HashSet(l);The following is an example to convert array to HashSet −Example Live Demoimport java.util.*; public class Demo { public static void main(String[] argv) throws Exception { Integer[] arr = { 10, 15, 20, 10, 10, 10, 20, 30, 35, 40, 40}; List l = Arrays.asList(arr); Set s = new HashSet(l); for (Iterator i = s.iterator(); i.hasNext();) { Object ele = i.next(); System.out.println(ele); } } }Output35 20 40 10 30 15
The text can be found and replaced with the help of the replace() function. It is explained with the help of the following steps −First, a table is created with the help of the create command which is given as follows −mysql> CREATE table FindAndReplaceDemo -> ( -> FirstName varchar(200) -> ); Query OK, 0 rows affected (0.43 sec)After creating the above table, the records are inserted with the help of the insert command. This is given below −mysql> INSERT into FindAndReplaceDemo values('john'); Query OK, 1 row affected (0.15 sec) mysql> INSERT into FindAndReplaceDemo values('smith'); Query OK, 1 row ... Read More
Appcaches are used by the web browser to specify what files exist on your site that is relevant to the particular page the browser is visiting.Safari follows the AppCache standard more strictly and sees a request for a web address that is not in the AppCache.To avoid the requests to be blocked, use −NETWORK: * http://* https://*
To avoid the double click text issue −var canvas1 = document.getElementById('c'); canvas1.onselectstart = function () { return false; }Note − The Canvas should not fill the width of the page and it is only 100 pixels wide.
Firstly, we need to create a table with some records, then we will use pagination with the help of limit and offset.Creating a table with the help of CREATE command. The query is as follows −mysql> CREATE table limitoffsetDemo -> ( -> id int, -> FisrtName varchar(200) -> ); Query OK, 0 rows affected (0.45 sec)After creating a table, we will insert records with the help of INSERT command.Inserting recordsmysql> INSERT into limitoffsetDemo values(1, 'John'); Query OK, 1 row affected (0.11 sec) mysql> INSERT into limitoffsetDemo values(2, 'Bob'); Query OK, 1 row affected (0.16 sec) mysql> INSERT into ... Read More
To be able to playback video from a specific time using the HTML5 video tag, try these fixes.Your web server should be capable of serving the document using byte ranges. The Google Chrome web browser want this to work. If this is not worked out, then the seeking will be disabled and even if you set the currentTime, it will not work.Test your web server, if it allows this −curl --dump-header - -r0-0 http://theurl
It is not possible to reset the checkbox back to the default native style with some web browsers.You can try this and list every type of input to style −input[type="text"], input[type="password"] { border: 2px solid green; }You can also use the CSS3 pseudo-class, but it may or may not work in IE 11 −input:not([type="checkbox"]) { border: 2px solid green; }
To make it work correctly, you need to work around xhr progress event, which is fired when all list items had been already created.The xhr should know what you want to do −var a = new XMLHttpRequest(); a.upload.li = li; a.upload.addEventListener('progress', function(e) { var pc = parseInt(event.loaded / event.total * 100); this.li.find(".progressbar").width(pc); }, false);
In MySQL, the length of NULL is 0. Here, we will see how NULL can be used with SELECT statement. Let us create a table with the help of CREATE command −Creating a table −mysql> CREATE table NullWIthSelect -> ( -> Name varchar(100) -> ); Query OK, 0 rows affected (0.62 sec)Above, I have created a table successfully. Now I will insert some records with the help of INSERT command −Inserting records −mysql> INSERT into NullWIthSelect values('John'); Query OK, 1 row affected (0.16 sec) mysql> INSERT into NullWIthSelect values('Bob'); Query OK, 1 row affected (0.12 sec) mysql> INSERT ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP