To apply CSS properties using jQuery, use the css() method. It’s easy to apply any CSS property using jQuery method css( PropertyName, PropertyValue ).Here is the syntax for the method −selector.css( PropertyName, PropertyValue );ExampleHere you can pass PropertyName as a JavaScript string and based on its value, PropertyValue could be string or integer.Live Demo jQuery css() method $(document).ready(function() { $("li").eq(4).css("color", "green"); }); list item 1 list item 2 list item 3 list item 4 list item 5 list item 6
Suppose we have an arithmetic expression without parentheses. Our task is to find all possible outcomes of that expression. Suppose the expression is like 1+2*3-4, this can be interpreted like below −1+(2*(3-4)) = 1 + (2* -1) = -1(1+2)*(3-4) = 3 * -1 = -31+((2*3)-4) = 1 + (6 - 4) = 3((1+2)*3)-4 = (3 * 3) - 4 = 51+(2*3)-4 = 1 + 6 – 4 = 3To solve this problem, we have to follow these steps −Initially set res as emptyFor every operator x, do the following −Recursively evaluate all possible values on left of x, let the ... Read More
Suppose we have a n ranges containing L and R. We have to check or find the index of 0 – based of the range which covers all the other given n – 1 ranges. If there is no such range, display -1. For example, if L = [2, 4, 3, 1], and R = [4, 6, 7, 9], then the output is 3. So it means the range at 3rd index (1 to 9) covers all the elements of other n – 1 ranges.Since all L and R points are distinct, find the range of smallest L and largest ... Read More
Suppose we have a number n. We have to find the range of positive integers, where all the numbers in the range is composite, and the length of the range is n. If there are more than one range, then print any one range. The composite number is a number where it has at least one divisor other than 1 and itself.As the length of the range is n, then if the first number is a, then the other numbers are a + 1, a + 2, …, a + n – 1, all should be composite. If we see ... Read More
Suppose we have two integers N and K. We have to find first permutation of 2N number of natural numbers, such that the following equation is satisfied.$$\displaystyle\sum\limits_{i=1}^N\lvert A_{2i-1}-A_{2i}\rvert+\lvert \displaystyle\sum\limits_{i=1}^N A_{2i-1}-A_{2i} \rvert=2K$$The value of K should be less than or equal to N. For example, if N = 4 and K = 1, then output will be 2 1 3 4. The result of the given expression will be (|2 – 1| + |3 – 4|) – (|2 – 1 + 3 – 4|) = 2.The idea is simple, consider we have a sorted sequence like 1, 2, 3, 4, 5, ... Read More
Suppose we have an array A with n elements. We have to find the local minima of the array. In array A, the element A[x] is said to be local minima if it is less than or equal to both of its neighbors. For corner elements only one neighbor will be considered. And if there are more than one local minima available, then return only one. For example, if the array is like [9, 6, 3, 14, 5, 7, 4], then the local minima can be 3, 5 and 4, so this algorithm can return only one of them.To solve ... Read More
Let us first create a table −mysql> create table DemoTable -> ( -> DueDate date -> ); Query OK, 0 rows affected (0.73 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-01-11'); Query OK, 1 row affected (0.08 sec) mysql> insert into DemoTable values('2019-04-19'); Query OK, 1 row affected (0.14 sec)Display all records from the table using select statement −mysql> select *from DemoTable;This will produce the following output −+------------+ | DueDate | +------------+ | 2019-01-11 | | 2019-04-19 | +------------+ 2 rows in set (0.00 sec)Following is the query to display ... Read More
You can use For loop as below:FOR START_CID IN 1..1000 DO INSERT INTO "TEST_TABLE" VALUES(START_CID,''); END FOR;You can also use a Generator like this:INSERT INTO "TEST_TABLE" SELECT GENERATED_PERIOD_START as CID, '' as CNAME from SERIES_GENERATE_INTEGER(1,1,1001);
To drop a primary key, use ALTER at first to alter the table. With that, use DROP to drop the key as in the belowSyntaxalter table yourTableName drop primary key;Let us first create a table −mysql> create table DemoTable -> ( -> StudentId int NOT NULL, -> StudentName varchar(20), -> StudentAge int, -> primary key(StudentId) -> ); Query OK, 0 rows affected (0.48 sec)Here is the query to check the description of table −mysql> desc DemoTable;This will produce the following output−+-------------+-------------+------+-----+---------+-------+ | Field | Type | Null | ... Read More
To get the database name, use the below given syntax −select database();Let us implement the above syntax in the stored procedure −mysql> delimiter // mysql> create procedure get_procedure_database_name() -> begin -> select concat('The database name=',database()); -> end -> // Query OK, 0 rows affected (0.34 sec) mysql> delimiter ;Now you can call a stored procedure using CALL command −mysql> call get_procedure_database_name();This will produce the following output −+-----------------------------------------+ | concat('The database name=',database()) | +-----------------------------------------+ | The database name=web | +-----------------------------------------+ 1 row in set (0.05 sec) Query OK, 0 rows affected (0.08 sec)
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP