Force MySQL Out of TRADITIONAL Mode

Nishtha Thakur
Updated on 30-Jan-2020 07:09:18

132 Views

With the help of the following command we can force MySQL out of TRADITIONAL mode −mysql> Set SQL_MODE =''; Query OK, 0 rows affected (0.00 sec)

HTML5 checkValidity Method

Sravani S
Updated on 30-Jan-2020 07:08:40

363 Views

The HTML5 checkValidity() works in Google Chrome and Opera as well. This works as well:                    .valid { color: #0B7866; }          .invalid { color: #0B6877; }                            function check(input) {             var out = document.getElementById('result');                         if (input.validity) {                if (input.validity.valid === true) {                   out.innerHTML = "" + input.id + " valid";                } else {                   out.innerHTML = "" + input.id + " not valid";                }             }            console.log(input.checkValidity());          };                      Minimum:                                

Find Recently Assigned Sequence Number by MySQL AUTO_INCREMENT

Sreemaha
Updated on 30-Jan-2020 07:08:29

471 Views

Last_Insert_Id() MySQL function is used to find out which sequence number was assigned recently by AUTO_INCREMENT.Examplemysql> Create table Employee(Id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, Name Varchar(5)); Query OK, 0 rows affected (0.13 sec) mysql> Insert into Employee(Name) Values('Harvinder'); Query OK, 1 row affected (0.06 sec) mysql> Insert into Employee(Name) Values('Suresh'); Query OK, 1 row affected (0.07 sec) mysql> Select* from Employee; +----+---------+ | Id | Name    | +----+---------+ | 1  |Harvinder| | 2  | Suresh  | +----+---------+ 2 rows in set (0.00 sec) mysql> Select Last_insert_id(); +------------------+ | Last_insert_id() | +------------------+ |                2 | +------------------+ 1 row in set (0.00 sec)

OOP Terminology in Python

Mohd Mohtashim
Updated on 30-Jan-2020 07:08:18

3K+ Views

Class − A user-defined prototype for an object that defines a set of attributes that characterize any object of the class. The attributes are data members (class variables and instance variables) and methods, accessed via dot notation.Class variable − A variable that is shared by all instances of a class. Class variables are defined within a class but outside any of the class's methods. Class variables are not used as frequently as instance variables are.Data member − A class variable or instance variable that holds data associated with a class and its objects.Function overloading − The assignment of more than ... Read More

HTML5 Canvas Transformation

Krantik Chavan
Updated on 30-Jan-2020 07:07:31

417 Views

HTML5 canvas provides methods that allow modifications directly to the transformation matrix. The transformation matrix must initially be the identity transform. It may then be adjusted using the transformation methods.ExampleLet us see an example of canvas transformation:                    function drawShape(){             // get the canvas element using the DOM             var canvas = document.getElementById('mycanvas');             // Make sure we don't execute when canvas isn't supported             if (canvas.getContext){                // use getContext to use the canvas for drawing                var ctx = canvas.getContext('2d');                var sin = Math.sin(Math.PI/6);                var cos = Math.cos(Math.PI/6);                ctx.translate(200, 200);                var c = 0;                                for (var i=0; i

Use BIN Function with MySQL WHERE Clause

Moumita
Updated on 30-Jan-2020 07:06:45

287 Views

When BIN() string function is used with WHERE clause, the output returns by it will depend upon the condition given in WHERE clause. In this case, we must have to use binary value in WHERE clause. For example, suppose we have a table named ‘Student’ and we want to get only those rows where the binary value of column ‘id’ is higher than 1010, then we can write following query −mysql> Select *, Bin(id) from student where BIN(id) > 1010 ; +------+---------+---------+-----------+---------+ | Id   | Name    | Address | Subject   | Bin(id) | +------+---------+---------+-----------+---------+ | 15   ... Read More

Save DIV as Image with canvas2image in HTML

Govinda Sai
Updated on 30-Jan-2020 07:05:15

716 Views

DIV content can be saved as image with the help of html2canvas function in javascript. DIV tag defines a section in HTML document. Example:    Hello world This shows division area named as cpimg. Html2canvas function saves div as an image with following code:html2canvas(document.querySelector(“#cpimg”)).then(canvas {    document.body.appendChild(canvas) });It saves the referred div section “cpimg” into the image.

Use FastClick with jQuery Mobile the Right Way in HTML

Lakshmi Srinivas
Updated on 30-Jan-2020 07:01:08

191 Views

There is no need to use 3rd party plugins like Fastclick. jQuery Mobile solved this with vclick event.JQuery works well on mobile and desktop and don’t have 300 ms delay$(document).on('vclick', '#impButton', function(){ });

AUTO_INCREMENT Precedence Over PRIMARY KEY in MySQL

varun
Updated on 30-Jan-2020 07:00:20

210 Views

This can be understood with the help of an example in which NULL value has been inserted in an AUTO_INCREMENT column and MySQL deliver a new sequence number.mysql> Create table employeeinfo(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, Name Varchar(10)); Query OK, 0 rows affected (0.16 sec) mysql> Insert into employeeinfo(id, Name) values(NULL, 'Saurabh'); Query OK, 1 row affected (0.07 sec) mysql> Select * from employeeinfo; +----+---------+ | id | Name    | +----+---------+ | 1  | Saurabh | +----+---------+ 1 row in set (0.00 sec)As we can observe from the above example that the column ‘id’ has been ... Read More

Draw a Circle Filled with Random Color Squares on HTML5 Canvas

Sravani S
Updated on 30-Jan-2020 06:59:59

1K+ Views

When we need to fill a circle with 1x1 pixels, all with different colors in a browser, we can use a simple approach like this: Drawing all pixels with some random colors in a 200x200 grid on a canvas Changing composite mode Drawing circle on topLet us seen an example:var canvas1 = document.getElementById('canvas'), // getting canvas element    ctx1 = canvas1.getContext('2d'), // getting context    x, y = 0, // initializing x and y coordinates    diamet = canvas1.width,    radius = diamet * 0.6;    ctx1.translate(0.6, 0.6); //Making pixels sharper        for(; y < diamet; y++) { // x/y grid ... Read More

Advertisements