code-rag-bench/online-tutorials huggingface dataset:
How to check if an element is hidden in jQuery?

28 Mar, 2019
To check if an element is hidden or not, jQuery :hidden selector can be used. .toggle() function is used to toggle the visibility of an element.
Syntax:
$(element).is(":hidden");
Example:
<!DOCTYPE html><html lang="en">  <head>    <meta charset="utf-8">    <title>        Jquery Hidden element Checking    </title>    <style>        h1 {            color: green;        }                  table,        th,        td {            border: 1px solid black;        }    </style>    <script src="https://code.jquery.com/jquery-1.12.4.min.js">    </script>        <script type="text/javascript">        $(document).ready(function() {            $("button").click(function() {                $("table").toggle("slow", function() {                    if ($("table").is(":hidden")) {                          alert(" Hidden Element.");                    } else {                        alert("Element Visible.");                    }                });            });        });    </script></head>  <body>    <center>        <h1>Geeks for Geeks</h1>        <button type="button">            Click!        </button>        <table style="width:60%">            <tr>                <th>Language Index</th>                <th>Language Name</th>            </tr>            <tr>                <td>1</td>                <td>C</td>            </tr>            <tr>                <td>2</td>                <td>C++</td>            </tr>            <tr>                <td>3</td>                <td>Java</td>            </tr>            <tr>                <td>4</td>                <td>Python</td>            </tr>            <tr>                <td>5</td>                <td>HTML</td>            </tr>        </table>    </center></body>  </html>
Output:Before Clicking:
After Clicking:
Picked
JQuery
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
HTML <b> Tag

17 Mar, 2022
Example: This simple code example illustrates highlighting the text by making it as bold text in HTML.
HTML
<!DOCTYPE html><html><body>    <h1>GeeksforGeeks</h1>    <h3>HTML b tag</h3>    <p>      A <b>Computer Science portal</b> for geeks.       It contains well written, well thought and      well explained <b>computer science and       programming articles.</b>    </p>  </body></html>
Output:
The <b> tag in HTML is used to specify the bold text without any extra importance. The text is written within <b> tag display in bold size. You can do that by using font-weight: bold; property in CSS. It is a container tag that contains an opening tag, content & closing tag. There is a similar tag, <strong> tag that is the parsed tag and used to show the importance of the text & has a similar effect on content. 
As per the HTML5 specification, the <b> tag should be used as a last option to resort when no other tag is more appropriate. The HTML5 specification states that for headings, it should be depicted by the <h1> to <h6> tags, for emphasized text, it must be depicted by the <em> tag & similar wise, the important text by the <strong> tag, & for marked/highlighted text, it should be denoted with the <mark> tag.
Syntax:
<b> Contents... </b>
Accepted Attributes: This is a Global attribute, and can be used on any HTML element.
Example 1: In this example, we have used the <b> tag & <p> tag to illustrates the difference in the text appearance & their sizes.
HTML
<!DOCTYPE html><html><body>    <h1>GeeksforGeeks</h1>      <h3>HTML b tag</h3>        <!--paragraph Tag -->    <p>This is normal paragraph Tag text</p>        <!--bold Tag -->    <b>This is bold Tag text</b></body></html>
Output:
Example 2: In this example, we have used the CSS font-weight property whose value is set to bold to make the text bold.
HTML
<!DOCTYPE html><html><body>    <h1>GeeksforGeeks</h1>      <h3>HTML b tag</h3>        <!--paragraph Tag -->    <p>This is normal paragraph Tag text</p>        <!--Using CSS in paragraph Tag for making text bold  -->    <p style ="font-weight: bold">This is bold text using CSS</p>  </body></html>
Output:
Supported Browsers: 
Google Chrome 93.0
Internet Explorer 11.0
Microsoft Edge 93.0
Firefox 92.0
Opera 78.0
Safari 14.1
shubhamyadav4
bhaskargeeksforgeeks
vshylaja
HTML-Tags
HTML
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python program for sum of consecutive numbers with overlapping in lists

01 Oct, 2020
Given a List, perform summation of consecutive elements, by overlapping.
Input : test_list = [4, 7, 3, 2] Output : [11, 10, 5, 6] Explanation : 4 + 7 = 11, 7 + 3 = 10, 3 + 2 = 5, and 2 + 4 = 6. 
Input : test_list = [4, 7, 3] Output : [11, 10, 7] Explanation : 4+7=11, 7+3=10, 3+4=7.  
Method 1 : Using list comprehension + zip()
In this, we zip list, with consecutive elements’ using zip() and then perform summation using + operator. The iteration part is done using list comprehension.
Python3
# initializing listtest_list = [4, 7, 3, 2, 9, 2, 1]  # printing original listprint("The original list is : " + str(test_list))  # using zip() to get pairing.# last element is joined with first for pairingres = [a + b for a, b in zip(test_list, test_list[1:] + [test_list[0]])]  # printing resultprint("The Consecutive overlapping Summation : " + str(res))
The original list is : [4, 7, 3, 2, 9, 2, 1]
The Consecutive overlapping Summation : [11, 10, 5, 11, 11, 3, 5]


Method #2 : Using sum() + list comprehension + zip()
In this, we perform the task of getting summation using sum() and rest all functionalities kept similar to the above method.
Python3
# Python3 code to demonstrate working of # Consecutive overlapping Summation# Using sum() + list comprehension + zip()  # initializing listtest_list = [4, 7, 3, 2, 9, 2, 1]  # printing original listprint("The original list is : " + str(test_list))  # using sum() to compute elements sum# last element is joined with first for pairingres = [sum(sub) for sub in zip(test_list, test_list[1:] + [test_list[0]])]    # printing result print("The Consecutive overlapping Summation : " + str(res))
  
The original list is : [4, 7, 3, 2, 9, 2, 1]
The Consecutive overlapping Summation : [11, 10, 5, 11, 11, 3, 5]


 
Python list-programs
Python
Python Programs
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python | sympy.eigenvals() method - GeeksforGeeks

29 Jun, 2019
With the help of sympy.eigenvals() method, we can find the eigenvalues of a matrix by using sympy.eigenvals() method.
Syntax : sympy.eigenvals()Return : Return eigenvalues of a matrix.
Example #1 :In this example, we can see that by using sympy.eigenvals() method, we are able to find the eigenvalues of a matrix.
# import sympyfrom sympy import *  # Use sympy.eigenvals() methodmat = Matrix([[1, 0, 1], [2, -1, 3], [4, 3, 2]])d = mat.eigenvals()   print(d)
Output :
{2/3 + 46/(9*(241/54 + sqrt(36807)*I/18)**(1/3)) + (241/54 + sqrt(36807)*I/18)**(1/3): 1, 2/3 + 46/(9*(-1/2 + sqrt(3)*I/2)*(241/54 + sqrt(36807)*I/18)**(1/3)) + (-1/2 + sqrt(3)*I/2)*(241/54 + sqrt(36807)*I/18)**(1/3): 1, 2/3 + (-1/2 – sqrt(3)*I/2)*(241/54 + sqrt(36807)*I/18)**(1/3) + 46/(9*(-1/2 – sqrt(3)*I/2)*(241/54 + sqrt(36807)*I/18)**(1/3)): 1}
Example #2 :
# import sympyfrom sympy import *  # Use sympy.eigenvals() methodmat = Matrix([[1, 5, 1], [12, -1, 31], [4, 33, 2]])d = mat.eigenvals()   print(d)
Output :
{2/3 + 3268/(9*(16225/54 + sqrt(15482600967)*I/18)**(1/3)) + (16225/54 + sqrt(15482600967)*I/18)**(1/3): 1, 2/3 + 3268/(9*(-1/2 + sqrt(3)*I/2)*(16225/54 + sqrt(15482600967)*I/18)**(1/3)) + (-1/2 + sqrt(3)*I/2)*(16225/54 + sqrt(15482600967)*I/18)**(1/3): 1, 2/3 + (-1/2 – sqrt(3)*I/2)*(16225/54 + sqrt(15482600967)*I/18)**(1/3) + 3268/(9*(-1/2 – sqrt(3)*I/2)*(16225/54 + sqrt(15482600967)*I/18)**(1/3)): 1}
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
How to Install PIP on Windows ?
How to drop one or multiple columns in Pandas Dataframe
How To Convert Python Dictionary To JSON?
Check if element exists in list in Python
Python | Pandas dataframe.groupby()
Python | Get unique values from a list
Defaultdict in Python
Python | os.path.join() method
Python Classes and Objects
Create a directory in Python
How to remove windows features using PowerShell?

To remove windows features, we can use command Remove-WindowsFeature command is used along with feature name.
Remove-WindowsFeature Search-Service -Verbose
VERBOSE: Uninstallation started...
VERBOSE: Continue with removal?
VERBOSE: Prerequisite processing started...
VERBOSE: Prerequisite processing succeeded.
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True No Success {Windows Search Service}
VERBOSE: Uninstallation succeeded.
If the windows feature has the management tools like as in Web-Server (IIS) feature, you can add the same in the command line. If the server requires restart then you can add the -Restart parameter. For example,
Remove-WindowsFeature Web-Server -IncludeManagementTools -Restart -Verbose
If we check the -Name parameter, it supports the string array. This means we can remove multiple roles and features together.
help Remove-WindowsFeature -Parameter Name -Name <Feature[]>
Example of removal of multiple features together and with -LogPath parameter to log the output on the local computer.
PS C:\Users\Administrator> Remove-WindowsFeature Windows-Server-Backup, Search-Service -LogPath C:\Temp\Uninstallfeatures.txt -Verbose
VERBOSE: Uninstallation started...
VERBOSE: Continue with removal?
VERBOSE: Prerequisite processing started...
VERBOSE: Prerequisite processing succeeded.
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True No Success {Windows Search Service, Windows Server Ba...
VERBOSE: Uninstallation succeeded.
To remove windows features on the remote computer, you need to use -ComputerName parameter. For example,
Remove-WindowsFeature Windows-Server-Backup, Search-Service -ComputerName Test1-Win2k16 -Verbose
PS C:\Scripts\IISRestart> Remove-WindowsFeature Windows-Server-Backup, Search-Service -ComputerName Test1-Win2k16 -Verbose
VERBOSE: Uninstallation started...
VERBOSE: Continue with removal?
VERBOSE: Prerequisite processing started...
VERBOSE: Prerequisite processing succeeded.

Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True No Success {Windows Search Service, Windows Server Ba...
VERBOSE: Uninstallation succeeded.
This -ComputerName parameter is a string parameter, not an array as shown below with the help command.
help Remove-WindowsFeature -Parameter ComputerName -ComputerName [<String≫]
So to remove the windows features from the multiple computers, we need to use the foreach loop and -ComputerName parameter or through the Invoke-Command. Using Invoke-Command will be easier.
Invoke-Command -ComputerName Test1-Win2k16,Test1-Win2k12 -ScriptBlock{Remove-WindowsFeature Windows-Server-Backup,Search-Service}
The above command will ensure to remove multiple features on the multiple remote computers.
Remove new line characters from rows in MySQL?

The Trim() function is used to remove new line characters from data rows in MySQL. Let us see an example. First, we will create a table. The CREATE command is used to create a table.
mysql> create table tblDemotrail
- > (
- > id int,
- > name varchar(100)
- > );
Query OK, 0 rows affected (0.57 sec)
Let us now insert some records.
mysql> insert into tblDemotrail values(1,'John ');
Query OK, 1 row affected (0.15 sec)

mysql> insert into tblDemotrail values(2,' Carol');
Query OK, 1 row affected (0.32 sec)

mysql> insert into tblDemotrail values(3,' Sam ');
Query OK, 1 row affected (0.17 sec)

mysql> insert into tblDemotrail values(4,' Tom\n ');
Query OK, 1 row affected (0.18 sec)

mysql> insert into tblDemotrail values(5,' \nTim ');
Query OK, 1 row affected (0.12 sec)
Let us display all the records.
mysql> select *from tblDemotrail;
The following is the output that doesn’t look like normal record, since we included newline characters while adding records.
+------+------------------+
| id   | name             |
+------+------------------+
| 1    |John              |
| 2    | Carol            |
| 3    | Sam              |
| 4    | Tom              |
| 5    |Tim               |
+------+------------------+
5 rows in set (0.00 sec)
To remove new line characters, you need to use the following query.
mysql> update tblDemotrail SET name = TRIM(TRAILING '\n' FROM name);
Query OK, 0 rows affected (0.00 sec)
Rows matched: 5 Changed: 0 Warnings: 0
C Program for Program for array rotation?

Write a C program to left rotate an array by n position. How to rotate left rotate an array n times in C programming. Logic to rotate an array to left by n position in C program.
Input: arr[]=1 2 3 4 5 6 7 8 9 10
N=3
Output: 4 5 6 7 8 9 10 1 2 3
Read elements in an array say arr.
Read elements in an array say arr.
Read number of times to rotate in some variable say N.
Read number of times to rotate in some variable say N.
Left Rotate the given array by 1 for N times. In real left rotation is shifting of array elements to one position left and copying first element to last.
Left Rotate the given array by 1 for N times. In real left rotation is shifting of array elements to one position left and copying first element to last.
#include <iostream>
using namespace std;
int main() {
   int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
   int i, N, len, j;
   N=3;
   len=10;
   int temp=0;
   for (i = 0; i < N; i++) {
      int x = arr[0];
      for (j = 0; j < len; j++) {
         temp=arr[j];
         arr[j] = arr[j + 1];
         arr[j+1]=temp;
      }
      arr[len - 1] = x;
   }
   for (i = 0; i < len; i++) {
      cout<< arr[i]<<"\t";
   }
}
Python Program to Merge Two Lists and Sort it

When it is required to merge two lists and sort them, a method can be defined that sorts the list using ‘sort’ method.
Below is the demonstration of the same −
 Live Demo
def merge_list(list_1, list_2):
   merged_list = list_1 + list_2
   merged_list.sort()
   return(merged_list)

list_1 = [20, 18, 9, 51, 48, 31]
list_2 = [28, 33, 3, 22, 15, 20]
print("The first list is :")
print(list_1)
print("The second list is :")
print(list_2)
print(merge_list(list_1, list_2))
The first list is :
[20, 18, 9, 51, 48, 31]
The second list is :
[28, 33, 3, 22, 15, 20]
[3, 9, 15, 18, 20, 20, 22, 28, 31, 33, 48, 51]
A method named ‘merge_list’ is defined that takes two lists as parameters.
A method named ‘merge_list’ is defined that takes two lists as parameters.
The two lists are concatenated using the ‘+’ operator.
The two lists are concatenated using the ‘+’ operator.
It is assigned to a variable.
It is assigned to a variable.
The sort method is used to sort the final result.
The sort method is used to sort the final result.
Outside the method, two lists are defined, and displayed on the console.
Outside the method, two lists are defined, and displayed on the console.
The method is called by passing these two lists.
The method is called by passing these two lists.
The output is displayed on the console.
The output is displayed on the console.
How to Use Pandas apply() inplace? - GeeksforGeeks

28 Nov, 2021
In this article, we are going to see how to use Pandas apply() inplace in Python.
In Python, this function is equivalent to the map() function. It takes a function as an input and applies it to a DataFrame as a whole. If you’re dealing with data in the form of tables, you’ll need to choose which axis your function should act on ( 0 for columns; and 1 for rows). 
No, the apply() method doesn’t contain an inplace parameter, unlike these pandas methods which have an inplace parameter:
df.drop()
df.rename( inplace=True)
fillna()
dropna()
sort_values()
reset_index()
sort_index()
rename()
The data is edited in place when inplace = True, which means it will return nothing and the data frame will be updated. When inplace = False, which is the default, the operation is carried out and a copy of the object is returned.
in the below code. we first imported the pandas package and imported our CSV file using pd.read_csv(). after importing we use the apply function on the ‘experience’ column of our data frame. we convert the strings of that column to uppercase.
Used CSV file:
Python3
# codeimport pandas as pd  # importing our datasetdf = pd.read_csv('hiring.csv')# viewing the dataFrameprint(df)  # we change the case of all the strings# in experience column to uppercasedf['experience'] = df['experience'].apply(str.upper)  # viewing the modified columnprint(df['experience'])
Output:
0      FIVE
1       TWO
2     SEVEN
3     THREE
4    ELEVEN
Name: experience, dtype: object
In this example, we use apply() method on multiple columns. we change the datatype of the columns from float to int. Used CSV file click here.
Python3
import pandas as pdimport numpy as np  # importing our datasetdata = pd.read_csv('cluster_blobs.csv')  # viewing the dataFrameprint(df)  # we convert the datatype of columns from float to int.data[['X1', 'X2']] = data[['X1', 'X2']].apply(np.int64)  # viewing the modified columnprint(data[['X1', 'X2']])
Output:
in this example, we use the same CSV file as before. here we use the apply() method on the entire data frame. we change the datatype of the columns from float to int.
Python3
import pandas as pdimport numpy as np  # importing our datasetdata = pd.read_csv('cluster_blobs.csv')  # viewing the dataFrameprint(data)  # we convert the datatype of# columns from float to int.data = data.apply(np.int64)  # viewing the modified columnprint(data)
Output:
Picked
Python pandas-methods
Python-pandas
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Install PIP on Windows ?
Check if element exists in list in Python
How To Convert Python Dictionary To JSON?
Python Classes and Objects
How to drop one or multiple columns in Pandas Dataframe
Defaultdict in Python
Python | Get unique values from a list
Python | os.path.join() method
Create a directory in Python
Python | Pandas dataframe.groupby()
Python | Check if substring present in string - GeeksforGeeks

24 Nov, 2018
Lets solve this general problem of finding if a particular piece of string is present in a larger string in different ways. This is a very common kind of problem every programmer comes across aleast once in his/her lifetime. This article gives various techniques to solve it.
Method 1 : Using in operatorThe in operator is the most generic, fastest method to check for a substring, the power of in operator in python is very well known and is used in many operations across the entire language.
# Python 3 code to demonstrate # checking substring in string# using in operator  # initializing string test_str = "GeeksforGeeks"  # using in to test# for substringprint ("Does for exists in GeeksforGeeks ? : ")if "for" in test_str :    print ("Yes, String found")else :     print ("No, String not found")
Output :
Does for exists in GeeksforGeeks ? : 
Yes, String found

Method 2 : Using str.find()str.find() method is generally used to get the lowest index at which the string occurs, but also returns -1, if string is not present, hence if any value returns >= 0, string is present, else not present.
# Python 3 code to demonstrate # checking substring in string# using str.find()  # initializing string test_str = "GeeksforGeeks"  # using str.find() to test# for substringres = test_str.find("for")if res >= 0:    print ("for is present in GeeksforGeeks")else :    print ("for is not present in GeeksforGeeks")
Output :
for is present in GeeksforGeeks

Method 3 : Using str.index()This method can be used to performs the similar task, but like str.find(), it doesn’t return a value, but a ValueError if string is not present, hence catching the exception is the way to check for string in substring.
# Python 3 code to demonstrate # checking substring in string# using str.index()  # initializing string test_str = "GeeksforGeeks"  # using str.index() to test# for substringtry :     res = test_str.index("forg")    print ("forg exists in GeeksforGeeks")except :    print ("forg does not exists in GeeksforGeeks")
Output :
forg does not exists in GeeksforGeeks

Method 4 : Using operator.contains()This is lesser known method to check for substring in a string, this method is also effective in accomplishing this task of checking a string in a string.
# Python 3 code to demonstrate # checking substring in string# using operator.contains()import operator  # initializing string test_str = "GeeksforGeeks"  # using operator.contains() to test# for substringif operator.contains(test_str, "for"):    print ("for is present in GeeksforGeeks")else :    print ("for is not present in GeeksforGeeks")
Output :
for is present in GeeksforGeeks

Python string-programs
python-string
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python Dictionary
Read a file line by line in Python
How to Install PIP on Windows ?
Enumerate() in Python
Different ways to create Pandas Dataframe
Iterate over a list in Python
*args and **kwargs in Python
Reading and Writing to text files in Python
Create a Pandas DataFrame from Lists
Convert integer to string in Python
Python program to check if a given string is Keyword or not - GeeksforGeeks

07 Feb, 2019
Given a string, write a Python program that checks if the given string is keyword or not.
Keywords are reserved words which cannot be used as variable names.
There are 33 keywords in Python programming language.(in python 3.6.2 version)
Examples:
Input: str = "geeks"
Output: geeks is not a keyword

Input: str = "for"
Output: for is a keyword

We can always get the list of keywords in the current Python version using kwlist method in keyword module.
# import keyword libraryimport keyword  keyword_list = keyword.kwlistprint("No. of keywords present in current version :",                                   len(keyword_list))  print(keyword_list)
No. of keywords present in current version : 33[‘False’, ‘None’, ‘True’, ‘and’, ‘as’, ‘assert’, ‘break’, ‘class’, ‘continue’, ‘def’, ‘del’, ‘elif’, ‘else’, ‘except’, ‘finally’, ‘for’, ‘from’, ‘global’, ‘if’, ‘import’, ‘in’, ‘is’, ‘lambda’, ‘nonlocal’, ‘not’, ‘or’, ‘pass’, ‘raise’, ‘return’, ‘try’, ‘while’, ‘with’, ‘yield’]
Below is the Python code to check if a given string is Keyword or not:
# include keyword library in this programimport keyword  # Function to check whether the given # string is a keyword or not def isKeyword(word) :      # kwlist attribute of keyword    # library return list of keywords    # present in current version of    # python language.    keyword_list = keyword.kwlist      # check word in present in    # keyword_list or not.    if word in keyword_list :        return "Yes"    else :        return "No"    # Driver Codeif __name__ == "__main__" :      print(isKeyword("geeks"))    print(isKeyword("for"))
No
Yes

python-string
Python
Python Programs
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Install PIP on Windows ?
Check if element exists in list in Python
How To Convert Python Dictionary To JSON?
Python Classes and Objects
How to drop one or multiple columns in Pandas Dataframe
Defaultdict in Python
Python | Get dictionary keys as a list
Python | Split string into list of characters
Python | Convert a list to dictionary
How to print without newline in Python?
Lex program to check whether the input is digit or not - GeeksforGeeks

30 Apr, 2019
Lex is a computer program that generates lexical analyzers. Lex reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in the C programming language.
Prerequisite: Flex (Fast lexical Analyzer Generator).
Given an input, the task is to check if the input is digit or not.
Examples:
Input:  28
Output: digit

Input: a
Output: not a digit. 

Input: 21ab
Output: not a digit. 

Below is the implementation:
/* Lex program to check whether input is digit or not. */%{#include<stdio.h>#include<stdlib.h>%}/* Rule Section */%%^[0-9]*  printf("digit");^[^0-9]|[0-9]*[a-zA-Z]  printf("not a digit");. ;%%int main(){        // The function that starts the analysis    yylex();        return 0;}
Output:
Lex program
Compiler Design
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Symbol Table in Compiler
Code Optimization in Compiler Design
Directed Acyclic graph in Compiler Design (with examples)
Intermediate Code Generation in Compiler Design
Introduction of Compiler Design
Types of Parsers in Compiler Design
Ambiguous Grammar
Difference between Compiler and Interpreter
Peephole Optimization in Compiler Design
S - attributed and L - attributed SDTs in Syntax directed translation
HTML <input> disabled Attribute - GeeksforGeeks

04 Jan, 2019
The disabled attribute for <input> element in HTML is used to specify that the input field is disabled. A disabled input is un-clickable and unusable. It is a boolean attribute. The disabled <input> elements are not submitted in the form.
Syntax:
<input disabled>

Example:
<!DOCTYPE html> <html>     <head>         <title>HTML input disabled Attribute</title>     </head>       <body style = "text-align:center">            <h1 style = "color: green;">GeeksforGeeks</h1>        <h2>HTML input disabled Attribute</h2>          <label>Input:              <!--A disabled input-->            <input type="text" name="value" value = "This input field                    is disabled" disabled>        </label>    </body> </html>    
Output:
Supported Browsers: The browser supported by <input> disabled attribute are listed below:
Apple Safari 1.0
Google Chrome 1.0
Firefox 1.0
Opera 1.0
Internet Explorer 6.0
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.
HTML-Attributes
HTML
Web Technologies
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to insert spaces/tabs in text using HTML/CSS?
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to set the default value for an HTML <select> element ?
How to update Node.js and NPM to next version ?
How to set input type date in dd-mm-yyyy format using HTML ?
Roadmap to Become a Web Developer in 2022
Installation of Node.js on Linux
How to fetch data from an API in ReactJS ?
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to insert spaces/tabs in text using HTML/CSS?
abstract keyword in C#

The abstract keyword in C# is used for abstract classes. An abstract class in C# includes abstract and nonabstract methods. You cannot instantiate an abstract class.
Example of an abstract class Vehicle and abstract method display() −
public abstract class Vehicle {
   public abstract void display();
}
The abstract class has derived classes: Bus, Car, and Motorcycle. The following is an implementation of the Car derived class −
public class Car : Vehicle {
   public override void display() {
      Console.WriteLine("Car");
   }
}
The following is an example of abstract classes in C# −
Live Demo
using System;
public abstract class Vehicle {
   public abstract void display();
}
public class Bus : Vehicle {
   public override void display() {
      Console.WriteLine("Bus");
   }
}
public class Car : Vehicle {
   public override void display() {
      Console.WriteLine("Car");
   }
}
public class Motorcycle : Vehicle {
   public override void display() {
      Console.WriteLine("Motorcycle");
   }
}
public class MyClass {
   public static void Main() {
      Vehicle v;
      v = new Bus();
      v.display();
      v = new Car();
      v.display();
      v = new Motorcycle();
      v.display();
   }
}
Bus
Car
Motorcycle
Convert IP address to integer and vice versa - GeeksforGeeks

01 Nov, 2020
We will use the ipaddress module for this purpose. ipaddress is a module that helps in the creation, manipulation and operation on IPv4 and IPv6 addresses and networks.
The motivation of converting IP Addresses to integers and vice versa is that other modules that use IP addresses (such as socket) usually won’t accept objects from ipaddress module directly. Instead, they must be converted to string or an integer that the other module will accept.
Syntax: ipaddress.ip_address(address)
Parameter: Passing IP address in form of integer or string. Integers value less than 2**32 are considered as IPv4 addresses.
Returns: IPv4Address or IPv6Address object is returned depending on the IP address passed as argument. If address passed does not represent a valid IPv4 or IPv6 address, a ValueError is raised.
Program to convert integers to IP Address : 
Python3
# importing the moduleimport ipaddress  # converting int to IPv4 addressprint(ipaddress.ip_address(3221225000))print(ipaddress.ip_address(123))  # converting int to IPv6 addressprint(ipaddress.ip_address(42540766400282592856903984001653826561))
Output:
191.255.254.40
0.0.0.123
2001:db7:dc75:365:220a:7c84:d796:6401
For converting IP addresses to integers: 
Python3
# importing the moduleimport ipaddress  # converting IPv4 address to intaddr1 = ipaddress.ip_address('191.255.254.40')addr2 = ipaddress.ip_address('0.0.0.123')print(int(addr1))print(int(addr2))  # converting IPv6 address to intaddr3 = ipaddress.ip_address('2001:db7:dc75:365:220a:7c84:d796:6401')print(int(addr3))
Output:
3221225000
123
42540766400282592856903984001653826561
python-modules
python-utility
Technical Scripter 2020
Python
Technical Scripter
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Install PIP on Windows ?
How to drop one or multiple columns in Pandas Dataframe
How To Convert Python Dictionary To JSON?
Check if element exists in list in Python
Defaultdict in Python
Python | Get unique values from a list
Python | os.path.join() method
Selecting rows in pandas DataFrame based on conditions
Create a directory in Python
Python | Pandas dataframe.groupby()
Private and final methods in C#

To set private methods, use the private access specifier.
Private access specifier allows a class to hide its member variables and member functions from other functions and objects. Only functions of the same class can access its private members. Even an instance of a class cannot access its private members.
For final methods, use the sealed modifier.
When you use sealed modifiers in C# on a method, then the method loses its capabilities of overriding. The sealed method should be part of a derived class and the method must be an overridden method.
Let us see an example −
The following example won’t allow you to override the method display() because it has a sealed modifier for the ClassTwo derived class.
ClassOne is our base class, whereas ClassTwo and ClassThree are derived classes.
class ClassOne {
   public virtual void display() {
      Console.WriteLine("baseclass");
   }
}

class ClassTwo : ClassOne {
   public sealed override void display() {
      Console.WriteLine("ClassTwo: DerivedClass");
   }
}

class ClassThree : ClassTwo {
   public override void display() {
      Console.WriteLine("ClassThree: Another Derived Class");
   }
}
Above, under ClassThree derived class we have tried to override the sealed method. This will show an error since it is not allowed when you use the sealed method.
Python - RSS Feed

RSS (Rich Site Summary) is a format for delivering regularly changing web content. Many news-related sites, weblogs and other online publishers syndicate their content as an RSS Feed to whoever wants it. In python we take help of the below package to read and process these feeds. 
pip install feedparser
In the below example we get the structure of the feed so that we can analyze further about which parts of the feed we want to process.
import feedparser
NewsFeed = feedparser.parse("https://timesofindia.indiatimes.com/rssfeedstopstories.cms")
entry = NewsFeed.entries[1]

print entry.keys()
When we run the above program, we get the following output −
['summary_detail', 'published_parsed', 'links', 'title', 'summary', 'guidislink', 'title_detail', 'link', 'published', 'id']

 In the below example we read the title and head of the rss feed.
import feedparser

NewsFeed = feedparser.parse("https://timesofindia.indiatimes.com/rssfeedstopstories.cms")

print 'Number of RSS posts :', len(NewsFeed.entries)

entry = NewsFeed.entries[1]
print 'Post Title :',entry.title
When we run the above program we get the following output −
Number of RSS posts : 5
Post Title : Cong-JD(S) in SC over choice of pro tem speaker

Based on above entry structure we can derive the necessary details from the feed using python program as shown below. As entry is a dictionary we utilize its keys to produce the values needed.  
import feedparser

NewsFeed = feedparser.parse("https://timesofindia.indiatimes.com/rssfeedstopstories.cms")

entry = NewsFeed.entries[1]

print entry.published
print "******"
print entry.summary
print "------News Link--------"
print entry.link
When we run the above program we get the following output −
Fri, 18 May 2018 20:13:13 GMT
******
Controversy erupted on Friday over the appointment of BJP MLA K G Bopaiah as pro tem speaker for the assembly, with Congress and JD(S) claiming the move went against convention that the post should go to the most senior member of the House. The combine approached the SC to challenge the appointment. Hearing is scheduled for 10:30 am today.
------News Link--------
https://timesofindia.indiatimes.com/india/congress-jds-in-sc-over-bjp-mla-made-pro-tem-speaker-hearing-at-1030-am/articleshow/64228740.cms


    187 Lectures 
     17.5 hours 

 Malhar Lathkar

    55 Lectures 
     8 hours 

 Arnab Chakraborty

    136 Lectures 
     11 hours 

 In28Minutes Official

    75 Lectures 
     13 hours 

 Eduonix Learning Solutions

    70 Lectures 
     8.5 hours 

 Lets Kode It

    63 Lectures 
     6 hours 

 Abhilash Nelson
 Print
 Add Notes
 Bookmark this page
Represent Int32 as a Hexadecimal String in C#

To represent Int32 as a Hexadecimal string in C#, use the ToString() method and set the base as the ToString() method’s second parameter i.e. 16 for Hexadecimal.
Int32 represents a 32-bit signed integer.
Firstly, set an Int32 variable.
int val = 9898;
Now, convert it to a hexadecimal string by including 16 as the second parameter.
Convert.ToString(val, 16)
 Live Demo
using System;
class Demo {
   static void Main() {
      int val = 9898;
      Console.WriteLine("Integer: "+val);
      Console.Write("Hex String: "+Convert.ToString(val, 16));
   }
}
Integer: 9898
Hex String: 26aa
Elasticsearch - IngestNode

Sometimes we need to transform a document before we index it. For instance, we want to remove a field from the document or rename a field and then index it. This is handled by Ingest node.
Every node in the cluster has the ability to ingest but it can also be customized to be
processed only by specific nodes.
There are two steps involved in the working of the ingest node −
Creating a pipeline
Creating a doc
First creating a pipeline which contains the processors and then executing the pipeline, as
shown below −
PUT _ingest/pipeline/int-converter
{
   "description": "converts the content of the seq field to an integer",
   "processors" : [
      {
         "convert" : {
            "field" : "seq",
            "type": "integer"
         }
      }
   ]
}
On running the above code, we get the following result −
{
   "acknowledged" : true
}

Next we create a document using the pipeline converter.
PUT /logs/_doc/1?pipeline=int-converter
{
   "seq":"21",
   "name":"Tutorialspoint",
   "Addrs":"Hyderabad"
}
On running the above code, we get the response as shown below −
{
   "_index" : "logs",
   "_type" : "_doc",
   "_id" : "1",
   "_version" : 1,
   "result" : "created",
   "_shards" : {
      "total" : 2,
      "successful" : 1,
      "failed" : 0
   },
   "_seq_no" : 0,
   "_primary_term" : 1
}

Next we search for the doc created above by using the GET command as shown below −
GET /logs/_doc/1
On running the above code, we get the following result −
{
   "_index" : "logs",
   "_type" : "_doc",
   "_id" : "1",
   "_version" : 1,
   "_seq_no" : 0,
   "_primary_term" : 1,
   "found" : true,
   "_source" : {
      "Addrs" : "Hyderabad",
      "name" : "Tutorialspoint",
      "seq" : 21
   }
}

You can see above that 21 has become an integer.
Now we create a document without using the pipeline.
PUT /logs/_doc/2
{
   "seq":"11",
   "name":"Tutorix",
   "Addrs":"Secunderabad"
}
GET /logs/_doc/2
On running the above code, we get the following result −
{
   "_index" : "logs",
   "_type" : "_doc",
   "_id" : "2",
   "_version" : 1,
   "_seq_no" : 1,
   "_primary_term" : 1,
   "found" : true,
   "_source" : {
      "seq" : "11",
      "name" : "Tutorix",
      "Addrs" : "Secunderabad"
   }
}

You can see above that 11 is a string without the pipeline being used.

    14 Lectures 
     5 hours 

 Manuj Aggarwal

    20 Lectures 
     1 hours 

 Faizan Tayyab
 Print
 Add Notes
 Bookmark this page
What are Reserved Keywords in Python?

Reserved words (also called keywords) are defined with predefined meaning and syntax in the language. These keywords have to be used to develop programming instructions. Reserved words can’t be used as identifiers for other programming elements like name of variable, function etc.
Following is the list of reserved keywords in Python 3
Python 3 has 33 keywords while Python 2 has 30. The print has been removed from Python 2 as keyword and included as built-in function.
To check the keyword list, type following commands in interpreter −
>>> import keyword
>>> keyword.kwlist
Program to find number of tasks can be finished with given conditions in Python

Suppose we have a list of tasks and another list of people. The tasks[i] determines the amount of strength required to perform the ith task. And the people[i] determines the amount of strength the ith person has. Finally, we have to find the number of tasks that can be finished if one person can perform at most one task.
So, if the input is like tasks = [4, 3, 9, 15], people = [10, 5, 3, 2], then the output will be 3, as the first person can perform task 9, second person can perform task 4, third person can perform task 3, and fourth person can't perform any tasks.
To solve this, we will follow these steps −
sort the list tasks, sort the list people
ct:= 0, ind:= 0
for i in range 0 to size of people, dofor j in range ind to size of tasks, doif people[i] >= tasks[j], thenct := ct + 1ind := ind + 1come out from the loopotherwise,come out from the loop
for j in range ind to size of tasks, doif people[i] >= tasks[j], thenct := ct + 1ind := ind + 1come out from the loopotherwise,come out from the loop
if people[i] >= tasks[j], thenct := ct + 1ind := ind + 1come out from the loop
ct := ct + 1
ind := ind + 1
come out from the loop
otherwise,come out from the loop
come out from the loop
return ct
Let us see the following implementation to get better understanding −
 Live Demo
class Solution:
   def solve(self, tasks, people): tasks.sort()
      people.sort()
      ct=0
      ind=0
      for i in range(len(people)):
         for j in range(ind,len(tasks)):
            if people[i]>=tasks[j]:
               ct+=1
               ind+=1
               break
            else:
               break
         return ct
ob = Solution()
tasks = [4, 3, 9, 15]
people = [10, 5, 3, 2] print(ob.solve(tasks, people))
[4, 3, 9, 15], [10, 5, 3, 2]
3
Basics of Numbers in Dart - GeeksforGeeks

14 Jul, 2020
Like other languages, Dart Programming also supports numerical values as Number objects. The number in Dart Programming is the data type that is used to hold the numeric value. Dart numbers can be classified as:  
int: The int data type is used to represent whole numbers.
Syntax: int var_name;
double: The double data type is used to represent 64-bit floating-point numbers.
Syntax: double var_name;
Example 1:  
Dart
void main() {       // declare an integer   int num1 = 2;                       // declare a double value   double num2 = 1.5;       // print the values   print(num1);   print(num2);}
Output: 
2
1.5

Note: The num type is an inherited data type of the int and double types.
Parsing in Dart: The parse() function is used parsing a string containing numeric literal and convert to the number.  
Example 2:  
Dart
void main(){      var a1 = num.parse("1");    var b1 = num.parse("2.34");      var c1 = a1+b1;     print("Product = ${c1}");  }  
Output: 
Product = 3.34

Properties: 
hashcode: This property is used to get the hash code of the given number.
isFinite: If the given number is finite, then this property will return true.
isInfinite: If the number is infinite, then this property will return true.
isNan: If the number is non-negative then this property will return true.
isNegative: If the number is negative then this property will return true.
sign: This property is used to get -1, 0, or 1 depending upon the sign of the given number.
isEven: If the given number is an even then this property will return true.
isOdd: If the given number is odd then this property will return true.
Methods: 
abs(): This method gives the absolute value of the given number.
ceil(): This method gives the ceiling value of the given number.
floor(): This method gives the floor value of the given number.
compareTo(): This method compares the value with other numbers.
remainder(): This method gives the truncated remainder after dividing the two numbers.
round(): This method returns the round of the number.
toDouble(): This method gives the double equivalent representation of the number.
toInt(): This method returns the integer equivalent representation of the number.
toString(): This method returns the String equivalent representation of the number
truncate(): This method returns the integer after discarding fraction digits.
Dart-basics
Dart
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Flutter - Custom Bottom Navigation Bar
Flutter - Flexible Widget
ListView Class in Flutter
Flutter - Stack Widget
Android Studio Setup for Flutter Development
Format Dates in Flutter
Flutter - Positioned Widget
Simple Calculator App using Flutter
Flutter - Dialogs
Flutter - Managing the MediaQuery Object
How to change the root directory of an Apache server on Linux?

Apache web server is one of the most used web servers across all the platforms even after including different Linux distributions and windows. Apache server is an open source HTTP server that is mainly used to deliver web content and can also be used to serve many queries at once.
In this article, I will try to explain how to change the root directory for Apache web server.
It is usually the case that to change the root directory we must first be aware of its exact location and in the case of the Apache server, the root directory which is also known as DocumentRoot is present inside the folder −
/var/www/html
The DocumentRoot is the directory from which the Apache server will read the contents that the visitor will access over the internet.
Sometimes it is the case that the default DocumentRoot can also be present inside the directory.
/var/www
Now the next step is to locate the file in which this DocumentRoot is configured. Just type the following command in the terminal −
/etc/apache2/sites-available/000-default.conf
Now next step is to open this .conf file in your favorite text editor, I am making use of nano, and so the command for me looks something like this −
sudo nano /etc/apache2/sites-available/000-default.conf
and now we need to find the text “DocumentRoot” in the above file and change the location that might look something like this −
DocumentRoot /var/www/html
To whatever destination you want.
We also need to make a similar change in the apache2.conf file, for that just type the following command to the terminal
sudo nano /etc/apache2/apache2.conf
And then, try to find the following content in the above file
<Directory /var/www/html/>
   Options Indexes FollowSymLinks
   AllowOverride None
   Require all granted
</Directory>
Now just change the /var/www/html to the directory that you changed to in the default.conf file and save your file and restart the server with the command shown below −
sudo service apache2 start
Deterministic PDA 

Theory of Computation
The Deterministic Pushdown Automata is a variation of pushdown automata that accepts the deterministic context-free languages.
A language L(A) is accepted by a deterministic pushdown automata if and only if there is a single computation from the initial configuration until an accepting one for all strings belonging to L(A). It is not as powerful as non-deterministic finite automata. That's why it is less in use and used only where determinism is much easier to implement.
A PDA is said to be deterministic if its transition function δ(q,a,X) has at most one member for -
a ∈ Σ U {ε}
So, for a deterministic PDA, there is at most one transition possible in any combination of state, input symbol and stack top.
A Deterministic PDA is 5 tuple -
M = (Σ,Γ,Q,δ,q)
Σ - It is a finite set which does not contain a blank symbol, Γ - a finite set of stack alphabet, Q - set of states, q - start state, δ - a transition function, denoted as -
Array of ArrayList in Java - GeeksforGeeks

11 Dec, 2018
We often come across 2D arrays where most of the part in the array is empty. Since space is a huge problem, we try different things to reduce the space. One such solution is to use jagged array when we know the length of each row in the array, but the problem arises when we do not specifically know the length of each of the rows. Here we use ArrayList since the length is unknown.Following is a Java program to demonstrate the above concept.
// Java code to demonstrate the concept of // array of ArrayList  import java.util.*;public class Arraylist {    public static void main(String[] args)    {        int n = 5;          // Here al is an array of arraylist having        // n number of rows.The number of columns on        // each row depends on the user.        // al[i].size() will give the size of the        // i'th row        ArrayList<Integer>[] al = new ArrayList[n];          // initializing        for (int i = 0; i < n; i++) {            al[i] = new ArrayList<Integer>();        }          // We can add any number of columns to each        // rows as per our wish        al[0].add(1);        al[0].add(2);        al[1].add(5);        al[2].add(10);        al[2].add(20);        al[2].add(30);        al[3].add(56);        al[4].add(34);        al[4].add(67);        al[4].add(89);        al[4].add(12);          for (int i = 0; i < n; i++) {            for (int j = 0; j < al[i].size(); j++) {                System.out.print(al[i].get(j) + " ");            }            System.out.println();        }    }}
Output :
1 2 
5 
10 20 30 
56 
34 67 89 12 

The above code works fine, but shows below warning.
prog.java:15: warning: [unchecked] unchecked conversion
        ArrayList[] al = new ArrayList[n];
                                  ^
  required: ArrayList[]
  found:    ArrayList[]
1 warning

The warning comes basically due to below line.
ArrayList<Integer>[] al = new ArrayList[n];
How to fix above warning?We cannot use array of ArrayList without warning. We basically need to use ArrayList of ArrayList.
Java - util package
Java-Array-Programs
Java-ArrayList
Java-Arrays
Java-Collections
Java-List-Programs
Java
Java
Java-Collections
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Stream In Java
Interfaces in Java
Initialize an ArrayList in Java
Stack Class in Java
Singleton Class in Java
Multithreading in Java
Multidimensional Arrays in Java
Collections in Java
Set in Java
Initializing a List in Java