Ankith Reddy has Published 1210 Articles

Light Emitting Diodes (LEDs)

Ankith Reddy

Ankith Reddy

Updated on 30-Jun-2020 10:56:34

Light can be obtained from various sources like candles, lamp and sunrays etc. Light bulb had invented by Thomas Edison in 1879. An electric current is passed through a filament inside bulb, it gets heated up and emits light when sufficient current is passed through the filament. That means it converts ... Read More

Style every element that has no children with CSS

Ankith Reddy

Ankith Reddy

Updated on 30-Jun-2020 09:50:29

To style every element that has no children with CSS, use the: empty selector t. You can try to run the following code to implement the: empty selectorExampleLive Demo                    p.demo {             width: ... Read More

Style the active link with CSS

Ankith Reddy

Ankith Reddy

Updated on 30-Jun-2020 09:43:02

To style the active links, use the CSS :active selector. You can try to run the following code to style the active linksExampleLive Demo                    a:active {             background-color: green;          }                     Welcome to Qries       Click on the above link to see the effect.    

Determine the type of an image using Python (imghdr)

Ankith Reddy

Ankith Reddy

Updated on 30-Jun-2020 09:29:38

The imghdr module in Python's standard library determines the type of image contained in a file or byte stream. There is only one function defined in imghdr moduleimghdr.what(filename, h=None):This function tests the image data contained in the file and returns a string describing the image type. The function also accepts ... Read More

Access to Python’s configuration information

Ankith Reddy

Ankith Reddy

Updated on 30-Jun-2020 09:27:46

Configuration information of Python's installation can be accessed by the sysconfig module. For example the list of installation paths and the configuration variables specific to the installation platform.The sysconfig module provides the following functions to access Configuration variablessysconfig.get_config_vars()With no arguments, this function returns a dictionary of all configuration variables relevant ... Read More

Center links in a Navigation Bar with CSS

Ankith Reddy

Ankith Reddy

Updated on 30-Jun-2020 08:48:42

To center links in a navigation bar, you need to add ‘text-align: center’ to ExampleLive Demo                    ul {             list-style-type: none;             margin: 0;             padding: 0;             width: 200px;          }          li a {             display: block;             background-color: #F0E7E7;          }          .active {             background-color: #4CAF50;             color: white;          }          li {             text-align: center;             border-bottom: 1px solid #555;          }                              Home          Company          Product          Services          Contact          

Count values from comma-separated field in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 30-Jun-2020 07:51:30

You can count values from comma-separated field using CHAR_LENGTH() method from MySQL. The syntax is as follows −SELECT *, (CHAR_LENGTH(yourColumnName) - CHAR_LENGTH(REPLACE(yourColumnName, ', ', '')) + 1) as anyVariableName from yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> ... Read More

Repeat the background image both horizontally and vertically with CSS

Ankith Reddy

Ankith Reddy

Updated on 30-Jun-2020 07:49:53

Use the background-image property to repeat an image both horizontally and vertically. You can try to run the following code to repeat the background imageExampleLive Demo                    body {             background-image: url("https://www.tutorialspoint.com/videotutorials/images/tutor_connect_home.jpg");          }                     Background Image    

Style the element that has focused on CSS

Ankith Reddy

Ankith Reddy

Updated on 30-Jun-2020 07:45:24

To select the element that has focus, use the: focus selector. You can try to run the following code to implement the: focus selector −Example                    input:focus {             background-color: green;          }                              Subject          Student:          Age:

MySQL Query to remove all characters after last comma in string?

Ankith Reddy

Ankith Reddy

Updated on 30-Jun-2020 07:40:45

To remove all characters after the last comma in the string, you can use SUBSTRING_INDEX().If you do not know the location of the last comma, then you need to find the last comma dynamically using LENGTH().The syntax is as follows −UPDATE yourTableName set yourColumnName = SUBSTRING_INDEX(yourColumnName, ', ', LENGTH(yourColumnName) - ... Read More

Advertisements