CSS Child Selector

Chandu yadav
Updated on 30-Jun-2020 09:31:25

410 Views

Use the child selector, if you want to select all elements immediate children of a specified element.div > pExampleYou can try to run the following code to implement CSS Child SelectorLive Demo                    div > p {             background-color: orange;          }                              Para 1 in the div.                    Para 2 in the div.             Para 3 outside the div.     Output

Implement Multiple COUNT in a Single MySQL Query

karthikeya Boyini
Updated on 30-Jun-2020 09:31:00

778 Views

For this, use CASE statement. Let us first create a table −mysql> create table DemoTable    -> (    -> LastName varchar(100)    -> ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Smith'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values('Brown'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values('Brown'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Smith'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values('Taylor'); Query OK, 1 ... Read More

Read and Write AIFF and AIFC Files Using Python

Chandu yadav
Updated on 30-Jun-2020 09:30:50

884 Views

Various functions in aifc module provide support for reading and writing AIFF (Audio Interchange File Format) and AIFF-C files. AIFF format is for storing digital audio samples in a file. Its newer version AIFF-C has the ability to compress the audio dataAudio file has number of parameters describing the audio data.The sampling rate or frame rate: number of times per second the sound is sampled.The number of channels: indicate if the audio is mono, stereo, or quadro.frame : consists of one sample per channel.The sample size: size in bytes of each sample.Thus a frame consists of channels * samplesize bytes. ... Read More

CSS overflow-x

Chandu yadav
Updated on 30-Jun-2020 09:30:42

318 Views

The CSS overflow-x allows you to decide what to do with the left right edges of the content.ExampleYou can try to run the following code to implement the overflow-x propertyLive Demo                    div {             background-color: orange;             width: 250px;             height: 45px;             border: 2px solid blue;             overflow-x: hidden;             overflow-y: scroll;          }                     Heading       Overflow property used here. This is a demo text to show the working of CSS overflow-x and overflow-y.     Output

Conversions Between Color Systems Using Python Colorsys

George John
Updated on 30-Jun-2020 09:30:03

384 Views

The RGB color model, named so because of the initials of the three additive primary colors, is an additive color model in which red, green and blue light are added to reproduce various colors.The RGB color model is used in representation and display of images in electronic systems, such as televisions and computers. It is based on human perception of colors. Other alternative representations of color model are:YIQ: Luminance, Chrominance (used by composite video signals)HLS: Hue, Luminance, SaturationHSV: Hue, Saturation, ValueThe colorsys module defines functions for conversion of color values between RGB color model and three other coordinate systems. In ... Read More

Locating and Executing Python Modules using Runpy

Chandu yadav
Updated on 30-Jun-2020 09:29:11

4K+ Views

The –m option of command line option searches for a given module and execute it as the __main__ module. This mechanism is internally supported by runpy module from Python's standard module that allows scripts to be located using the Python module namespace rather than the filesystem.This module defines two functionsrun_module()This function executes the code of the specified module and return the resulting module globals dictionary.The mod_name argument should be an absolute module name. If the module name refers to a package rather than a normal module, then that package is imported and the __main__ submodule within that package is then ... Read More

Determine Type of Sound File Using Python sndhdr

George John
Updated on 30-Jun-2020 09:28:38

276 Views

The sndhdr module in Python's standard library provides utility functions that read the type of sound data which is in a file. The functions return a namedtuple(), containing five attributesfiletypestring representing 'aifc', 'aiff', 'au', 'hcom', 'sndr', 'sndt', 'voc', 'wav', '8svx', 'sb', 'ub', or 'ul'.frameratethe sampling_rate will be either the actual value or 0 if unknown or difficult to decode.nchannelsnumber of channels or 0 if it cannot be determined or if the value is difficult to decodenframeseither the number of frames or -1.sampwidthbits_per_sample, will either be the sample size in bits or 'A' for A-LAW or 'U' for u-LAW.functions in sndhdr ... Read More

Exclude a Specific Row from a Table in MySQL

Sharon Christine
Updated on 30-Jun-2020 09:28:04

676 Views

Use i.e. not equal in MySQL to exclude a specific row from a table. Let us first create a table −mysql> create table DemoTable    -> (    -> Id int,    -> FirstName varchar(100)    -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(1, 'John'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values(2, 'Chris'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values(3, 'Robert'); Query OK, 1 row affected (0.26 sec) mysql> insert into DemoTable ... Read More

Access Python's Configuration Information

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

624 Views

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 for the current platform.>>> import sysconfig >>> sysconfig.get_config_vars() {'prefix': 'E:\python37', 'exec_prefix': 'E:\python37', 'py_version': '3.7.2', 'py_version_short': '3.7', 'py_version_nodot': '37', 'installed_base': 'E:\python37', 'base': 'E:\python37', 'installed_platbase': 'E:\python37', 'platbase': 'E:\python37', 'projectbase': 'E:\python37', 'abiflags': '', 'LIBDEST': 'E:\python37\Lib', 'BINLIBDEST': 'E:\python37\Lib', 'INCLUDEPY': 'E:\python37\Include', 'EXT_SUFFIX': '.pyd', 'EXE': '.exe', 'VERSION': '37', 'BINDIR': 'E:\python37', 'SO': '.pyd', 'userbase': 'C:\Users\acer\AppData\Roaming\Python', 'srcdir': 'E:\python37'}With ... Read More

Detection of Ambiguous Indentation in Python

Arjun Thakur
Updated on 30-Jun-2020 09:27:06

617 Views

Indentation is an important feature of Python syntax. Code blocks in function, class or loops are required to follow same indent level for statements in it. The tabnanny module in Python's standard library is able to detect any violation in this stipulation.This module is primarily intended to be used in command line mode with –m switch. However, it can also be imported in an interpreter session.Command line usagepython –m tabnanny –q example.pyFor verbose output use –v switchpython –m tabnanny –v example.pyFollowing functions are defined in tabnanny module for checking indentation programmatically.check()This function checks for ambiguously indented lines in a given ... Read More

Advertisements