Php offers some magical predefined function to handle the variables in real-time applications.In this article we will study about isset() and !empty() function and implementation both of these functions with few examples.isset():The isset() function is a predefined function in PHP which checks whether a variable is declared in the application and is not assigned NULL. This function restores the outcome as true or false.Let's test this with an example.Output:bool(false) bool(TRUE)Explanation:In the above example $var1 is defined as equal to NULLi.e $var1 = NULL, when isset() function performed on $var1, this will evaluate as FALSE, because $var1 is assigned to NULL. ... Read More
Use ORDER BY with DESC to order in descending order. For counting the values, use the COUNT(). For example, if the name “John” appears thrice in the column, then a separate column will display the count 3 and in this way all the count values will be arranged in descending order using the ORDER BY DESC.Let us first create a table −mysql> create table DemoTable -> ( -> EmployeeName varchar(100) -> ); Query OK, 0 rows affected (0.85 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ... Read More
Views are the fundamental building blocks of your app's user interface, and the UIView class defines the behaviors that are common to all views. A view object renders content within its bounds rectangle and handles any interactions with that content. The UIView class is a concrete class that you can instantiate and use to display a fixed background color.It is very important to have complete understanding of UIView as they are the main object user sees.Here we will be seeing how to change the background color of view programmatically and via storyboard.First let us see using storyboard, Open Main.storyboard and ... Read More
The HTML DOM Input Datetime readOnly property sets/returns whether Input Datetime can be modified or not.Following is the syntax −Returning boolean value - true/falseinputDatetimeObject.readOnlySetting readOnly to booleanValueinputDatetimeObject.readOnly = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that the input datetime is readOnly.falseIt defines that the input datetime is not readOnly and can be modified.Let us see an example of Input Datetime readOnly property − Live Demo Input Datetime readOnly Final Exam Datetime: Confirm Datetime var divDisplay = document.getElementById("divDisplay"); var inputDatetime = document.getElementById("datetimeSelect"); divDisplay.textContent = 'Exam Datetime Finalized: '+inputDatetime.readOnly; ... Read More
You can use COUNT(*) along with GROUP BY for this. Let us first create a table −mysql> create table DemoTable ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentAge int ); Query OK, 0 rows affected (0.59 sec)Insert records in the table using insert command −mysql> insert into DemoTable(StudentAge) values(16); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable(StudentAge) values(17); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable(StudentAge) values(18); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable(StudentAge) values(17); Query OK, 1 row affected (0.13 sec) mysql> insert into ... Read More
The getMaxCursorNameLength() method of the DatabaseMetaData interface is used to find out the maximum number of characters that the underlying database allows in the name of a cursor.This method returns an integer value, representing the maximum number of characters allowed in a cursor name. If this value is 0 it indicates that there is no limit or, limit is unknown.To get the DatabaseMetaData object −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() ... Read More
Use regular expression along with CASE statement. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Value varchar(20) ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Value) values('101'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable(Value) values('P'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable(Value) values('A'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable(Value) values('53'); Query OK, 1 row affected (0.13 sec) mysql> ... Read More
Python has an built-in module named Calendar that contains classes and functions to support a different varity of calendar operations, by default the calendar module follows the Gregorian calendar. prmonth() method is one of the methods of TextCalendar instance.is used to print a month’s calendar as returned by formatmonth(). Syntax: prmonth(year, month, width=0, lines=0) The arguments passed to this function are the year (yyyy), month (m), date column width (w), and the number of lines per week (l), respectively. For example, let's use this function to print the calendar of May, 2019:Example#importing calendar import calendar #let say 'i' is an variable i = ... Read More
Here we will see how to implement mathematical function using 8085.Problem StatementWrite a program to implement the following function (a*b) + (c*d) and store the result in memory locations 8204 and 8205. Perform multiplication by using a subroutine. Here a, b, c and d numbers are stored at memory locations 8200H, 8201H, 8202H and 8203 respectively.DiscussionMultiplication instruction is not present in the 8085. So we have to use subroutine to perform multiplication. In this subroutine, it takes number from memory pointed by HL pair, and return result into DE register pair. After multiplying two parts, the intermediate results are stored, ... Read More
The HTML DOM Input Datetime required property determines whether Input Datetime is compulsory to set or not.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputDatetimeObject.requiredSetting required to booleanValueinputDatetimeObject.required = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt defines that it is compulsory to set the datetime field to submit form.falseIt is the default value and to set datetime field is not compulsory.ExampleLet us see an example of Input Datetime required property − Live Demo Input Datetime required Final Exam Datetime: Confirm Datetime var divDisplay = document.getElementById("divDisplay"); var inputDatetime = document.getElementById("datetimeSelect"); ... Read More