The target attribute of the element allows you to set where the linked document will open, for example, new window, same frame, parent frame, etc.Following is the syntax −Here, _blank is used to open the linked document in new window or tab, _self opens the linked document in the same frame as it was clicked, _parent opens the document in the parent frame, _top opens the linked document in the entire body of the window, frame opens the linked document in a named frame.Let us now see an example to implement the target attribute of the elemen −Example Live ... Read More
Using the CONCAT() function, we can work with user variables in LIKE clause. The syntax is as follows.set @anyVariableName='anyValue'; select yourColumnName1, yourColumnName2, yourColumnName3, ...N from yourTableName whereyourColumnName like CONCAT('%', @anyVariableName, '%');To understand the above syntax, let us first create a table. The query to create a table is as follows.mysql> create table UserVariableInLike -> ( -> id int, -> Name varchar(100), -> Age int -> ); Query OK, 0 rows affected (0.83 sec)Insert records in the table using insert command. The query is as follows.mysql> insert into UserVariableInLike values(101, 'John', 23); Query OK, 1 row affected (0.23 sec) mysql> ... Read More
Definition and UsageThe is_finite() function returns a boolean value. It checks whether given parameter is a legal finite number and if so the function returns TRUE, otherwise FALSESyntaxis_finite ( float $val ) : bool ParametersSr.NoParameter & Description1valThe value to be verified if finite or notReturn ValuesPHP is_finite() function returns TRUE if val is within accepted range of float, otherwise it returns FALSE.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example shows that 100 is a finite numberOutputThis will produce following result −100 is a finite numberExample Live DemoValue of log(0) is undefined. ... Read More
Definition and UsageThe intdiv() function returns integer quotient of two integer parameters. If x/y results in i as division and r as remainder so thatx = y*i+r In this case, intdiv(x, y) returns i Syntaxintdiv ( int $x , int $y ) : int ParametersSr.NoParameter & Description1xThis parameter forms numerator part of division expression2yThis parameter forms denominator part of division expressionReturn ValuesPHP intdiv() function returns integer quotient of division of x by y. The return value is positive if both parameters are positive or both parameters are negative.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live ... Read More
To concat a string, use the CONCAT() function from MySQL as shown in the below syntaxSELECT CONCAT(yourColumnName1, ’anyConcatenationString’), CONCAT(yourColumnName2, ’anyC oncatenationString’), ....N from yourTableName;To understand the above syntax, let us first create a table. The query to create a table is as followsmysql> create table selectConcat -> ( -> StudentId int, -> StudentName varchar(100), -> StudentAge int -> ); Query OK, 0 rows affected (1.32 sec)Insert some records in the table using insert command. The query is as followsmysql> insert into selectConcat values(1, 'Carol', 23); Query OK, 1 row affected (0.19 sec) mysql> insert into selectConcat values(2, 'John', 24); ... Read More
Definition and UsageThe hypot() function calculates length of hypotenus of a right angled triangle. Hypoteneuse is calculated as per following formula −h=sqrt(x2+y2) where x and y are other two sides of a right angled triangleFor example, if x=3 and y=4, hypot(x, y)=5 which is equal to sqrt(32+42) = sqrt(25) =5This function always returns a float.Syntaxhypot ( float $x , float $y ) : floatParametersSr.NoParameter & Description1xone side of right angled triangle2yother side of right angled triangleReturn ValuesPHP hypot() function returns length of hypotenuse of a right angled triangle with given values of x and yPHP VersionThis function is available in ... Read More
The cancelable event property in HTML checks whether an event is a cancelable event or not. The values include TRUE if it is a cancelable event, else FALSE is returned.Following is the syntax −event.cancelableLet us now see an example to implement the cancelable event property −Example Live Demo Checking cancelable event The below button will display whether the event is cancelable or not. Click me function myFunction(event) { var val = event.cancelable; document.getElementById("myid").innerHTML = val; } OutputNow, click on the button to display whether the event is cancelable or not. A boolean value would be returned −
Definition and UsageThe hexdec() function returns a decimal number equivalent of a hexadecimal number embedded in a string.This function returns a a decimal integer, though larger values may result in floats.Syntaxhexdec ( string $hex_string ) : numberParametersSr.NoParameter & Description1hex_stringA decimal number to be converted in equivalent octal representationReturn ValuesPHP hexdec() function returns a decimal number.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates decimal equivalent of '100' and returns 256 −OutputThis will produce following result −hexdec(100) = 256Example Live DemoIf the string contains invalid characters (other than 0-9 and a-f) they ... Read More
To set max_connections in MySQL programmatically, you can use SET command. The syntax is as follows −SET GLOBAL max_connections=yourIntegerValue;Let us implement the above query to set maximum connections. The query is as follows −mysql> set global max_connections=1000; Query OK, 0 rows affected (0.04 sec)Check maximum connections are set or not, using the show variables command. The query is as follows.mysql> show variables like 'max_connections';The following is the output.+-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 1000 | +-----------------+-------+ 1 row in set (0.18 sec)
Global namespace pollutionPolluting Global namespace causes name collision. This name collision is very common in large projects where we may be using several javascript libraries. Let's discuss in detail what a name collision is.let's take a scenario in which 2 teams named A1 and A2 are working on a project. They both prepared their own javascript files that is TeamA1.js and TeamA2.js as shown below.TeamA1.jsTeamA1 has created a student function and has 2 parameters fname and lname(firstname & lastname).function student(fname, lname){ this.fname = fname; this.lname = lname; this.getFullName = function (){ return this.fname + " " ... Read More