Select Equal or Nearest Greater Number from Table in MySQL

AmitDiwan
Updated on 03-Mar-2020 07:04:48

778 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Value int    -> ); Query OK, 0 rows affected (1.33 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(25); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable values(75); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable values(100); Query OK, 1 row affected (0.13 sec)Display all records from the table using select statement −mysql> select * from DemoTable;This will produce the following output −+-------+ | Value | +-------+ |    25 | |   ... Read More

Execute Script When Seeking Attribute is Set to False in HTML

Chandu yadav
Updated on 03-Mar-2020 07:03:46

186 Views

The onseeked attribute executes a script when the user skips or moves to a new position in the audio or video.ExampleYou can try to run the following code to implement onseeked attribute −           Play                                    Your browser does not support the video element.                      function myFunction() {          document.getElementById("test").innerHTML = "Current position: " +          document.getElementById("myid").currentTime;          }          

Execute Script When Media Data Fetching is Stopped in HTML

Abhinanda Shri
Updated on 03-Mar-2020 07:00:28

388 Views

Use the onsuspend attribute in HTML to run the script when the loading of media data suspends, for example, when download completes. It can happen in any of the following situations −When a download is paused When a download completes Media is suspended, etc.The attribute can be used with the and elements and works in all the modern web browsers such as Firefox, Chrome, Opera, Safari, etc.

Execute Script on Opening or Closing Details Element in HTML

Abhinaya
Updated on 03-Mar-2020 06:51:55

178 Views

When a user opens or closes the element, the ontoggle event fires. You can try to run the following code to implement ontoggle event attribute −Example           Details       You need to join office from Feb23                More Information          Timings: 9 to 5:30          Office location: Hyderabad                            function myFunction() {             alert("Timings, office location, etc");          }          

Specify Citation in HTML

usharani
Updated on 03-Mar-2020 06:48:41

231 Views

Use the tag in HTML to specify citation. Cite can be defined as the title of a work. You can try to run the following code to implement tag for adding citation −Example           HTML cite Tag               The learning content can be referred from Data Structures        & Algorithms in Java    

Insert Single Line Break in HTML

George John
Updated on 03-Mar-2020 06:46:12

701 Views

Use the tag to insert a single line break in HTML. You can try to run the following code to insert a line break using the tag −Example           HTML br Tag               This is before the line break       and this after the line break.    

Display a Directory List in HTML

Chandu yadav
Updated on 03-Mar-2020 06:38:02

11K+ Views

Use the dir tag in HTML to display directory list. This is very similar to tag but do not use since it is deprecated now.The following is the attribute −AttributeValueDescriptionCompactcompactDeprecated − Specifies a compact rendering.ExampleYou can try to run the following code to show a directory list in HTML −           HTML dir Tag               The following are the values:                car          bike          ship          

Convert List of Strings to List of Lists in Python

Pradeep Elance
Updated on 03-Mar-2020 06:34:31

1K+ Views

In this article we will see how to create a list of lists which contain string data types. The inner list themselves or of string data type and they may contain numeric or strings as their elements.Using strip and splitWe use these two methods which will first separate out the lists and then convert each element of the list to a string.Example Live Demolist1 = [ '[0, 1, 2, 3]', '["Mon", "Tue", "Wed", "Thu"]' ] print ("The given list is : " + str(list1)) print("") # using strip() + split() result = [k.strip("[]").split(", ") for k in list1] print ("Converting list ... Read More

Python cmp() Method

Pradeep Elance
Updated on 03-Mar-2020 06:30:00

4K+ Views

The cmp() is part of the python standard library which compares two integers. The result of comparison is -1 if the first integer is smaller than second and 1 if the first integer is greater than the second. If both are equal the result of cmp() is zero.Below example illustrates different scenario showing the use of cmp() method.Example Live Demodef cmp(x, y):    return (x > y) - (x < y) #x>y x = 5 y = 3 print("The cmp value for x>y is : ",cmp(x, y),"") #xy is : 1 The cmp value for x

Define an Area in an Image Map with HTML

Abhinanda Shri
Updated on 03-Mar-2020 06:28:47

537 Views

Use the tag to define area in an image map in HTML.The HTML tag supports the following additional attributes −AttributeValueDescriptionAltTextSpecifies an alternate text for the area.coordsif shape = "rect" then coords = "left, top, right, bottom"if shape = "circ" then coords = "centerx, centery, radius"if shape = "poly" then coords = "x1, y1, x2, y2, .., xn, yn"Specifies the coordinates appropriate to the shape attribute to define a region of an image for image maps.download filenameSpecifies that the target gets downloaded when the hyperlink is clicked by the user.HrefURLSpecifies the URL of a page or the name of ... Read More

Advertisements