code-rag-bench/online-tutorials huggingface dataset:
PL/SQL - CONTINUE Statement

The CONTINUE statement causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating. In other words, it forces the next iteration of the loop to take place, skipping any code in between.
The syntax for a CONTINUE statement is as follows −
CONTINUE;

DECLARE 
   a number(2) := 10; 
BEGIN 
   -- while loop execution  
   WHILE a < 20 LOOP 
      dbms_output.put_line ('value of a: ' || a); 
      a := a + 1; 
      IF a = 15 THEN 
         -- skip the loop using the CONTINUE statement 
         a := a + 1; 
         CONTINUE; 
      END IF; 
   END LOOP; 
END; 
/ 
When the above code is executed at the SQL prompt, it produces the following result −
value of a: 10 
value of a: 11 
value of a: 12 
value of a: 13 
value of a: 14 
value of a: 16 
value of a: 17 
value of a: 18 
value of a: 19  

PL/SQL procedure successfully completed.
How to Install SQLmap in Windows?

09 Nov, 2021
Sqlmap is an open-source penetration testing tool. It comes with a powerful detection engine. It automates the process of detecting & taking over the database server. There is total of six SQL injection tool techniques are present. This is the highest amount of tool present than others. When we are going to extract the password from a vulnerable database, often the passwords are in hash form. It can detect the hash & can mention which type of hash was that.
It supports extracting user, password hashes, table,s etc.
We can download & update any file from the database server underlying file system.
Step 1: Browse to this link. 
Step 2: Click on the zip file on the right side & download the file.
Step 3: Then you have to extract the zip file. And then rename it to ‘sqlmap’
Step 4: Then cut the folder & paste it to your pc C drive
Step 5: Open Command Prompt from the start menu.
Step 6: Write down the following command one by one
cd ../ ../
dir
Step 7: Then write another some commands
cd sqlmap
sqlmap.py
It will give the proper output & hence your installation is successful.
DBMS-SQL
Picked
How To
Installation Guide
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to download and install Python Latest Version on Android
How to Add External JAR File to an IntelliJ IDEA Project?
How to Fix “passwd: Authentication token manipulation error” in Linux
Spring Boot | How to publish JSON messages on Apache Kafka
How to install Python on Windows?
Installation of Node.js on Linux
Installation of Node.js on Windows
How to Install Jupyter Notebook on MacOS?
How to Install and Use NVM on Windows?
How to Install Pygame on Windows ?
JavaScript Promise finally() Method

17 Mar, 2021
The finally() method of the Promise object is used to return a Promise when a Promise is settled, that is, it is either fulfilled or rejected. A Promise is a JavaScript object which generates a value after an asynchronous function executes successfully. When it does not execute successfully due to a timeout, then it generates an error.
It can be used to perform cleanup tasks once the promise is settled as it is always executed irrespective of whether the promise is fulfilled or rejected. It also prevents the duplication of code in the then() and catch() methods of the Promise.
Syntax:
task.finally(function() {
  // Task to be performed when
  // the promise is settled 
});
Parameters: This method has a single parameter as mentioned above and described below:
onFinally: It is the function that will be called when the Promise is settled.
Return Value: It returns a Promise whose finally handler is set to the specified function.
The below example demonstrates the finally() method:
Example:
Javascript
// Define the Promiselet task = new Promise((resolve, reject) => {  setTimeout(() => {      // Reject the Promise    reject("Promise has been rejected!");  }, 2000);});  task  .then(    (data) => {      console.log(data);    },      // Handle any error    (error) => {      console.log("Error:", error);    }  )    // Specify the code to be executed   // after the Promise is settled  .finally(() => {    console.log(      "This is finally() block that is " +      "executed after Promise is settled"    );  });
Output:
Error: Promise has been rejected!
This is finally() block that is executed after Promise is settled
JavaScript-Methods
Picked
JavaScript
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Difference between var, let and const keywords in JavaScript
Remove elements from a JavaScript Array
Roadmap to Learn JavaScript For Beginners
Difference Between PUT and PATCH Request
JavaScript | Promises
Installation of Node.js on Linux
Top 10 Projects For Beginners To Practice HTML and CSS Skills
Difference between var, let and const keywords in JavaScript
How to insert spaces/tabs in text using HTML/CSS?
How to fetch data from an API in ReactJS ?
How to Show All Columns of a Pandas DataFrame?

19 Dec, 2021
In this article, we will discuss how to Show All Columns of a Pandas DataFrame.
We will use the pandas set_option() method. This method will set the specified option’s value.
Syntax :
 pandas.set_option(pat, value)
Parameters :
pat : Regexp which should match a single option.
value : New value of option.
Returns :
 None
Raises : 
if no other option exists, the OptionError is raised
To view and download the CSV file used in the below example click train.csv.
Example:
Without using the set_option() method: 
Python3
# importing packagesimport pandas as pd  # importing 'train.csv'data = pd.read_csv('train.csv')data.head()
Output:
Example:
After using the set_option() method:
Here we have given ‘display.max_columns’ as an argument to view the maximum columns from our dataframe.
Python3
# importing packagesimport pandas as pd  # importing 'train.csv'data = pd.read_csv('train.csv')  pd.set_option('display.max_columns', None)data.head()
Output:
We can view all columns, as we scroll to the right, unlike when we didn’t use the set_option() method. If we only want to view a certain number of columns:
Syntax:
pd.set_option(‘display.max_columns’, n)
where, n is an integer.
Example:
Python3
# importing packagesimport pandas as pd  # importing 'train.csv'data = pd.read_csv('train.csv')pd.set_option('display.max_columns', 4)data.head()
Output:
pandas-dataframe-program
Picked
Python pandas-dataFrame
Python-pandas
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
VB.Net - Bit Shift Operators

Assume that the variable A holds 60 and variable B holds 13, then −
Try the following example to understand all the bitwise operators available in VB.Net −
Module BitwiseOp
   Sub Main()
      Dim a As Integer = 60       ' 60 = 0011 1100   
      Dim b As Integer = 13       ' 13 = 0000 1101
      Dim c As Integer = 0
      c = a And b       ' 12 = 0000 1100 
      Console.WriteLine("Line 1 - Value of c is {0}", c)
      c = a Or b       ' 61 = 0011 1101 
      
      Console.WriteLine("Line 2 - Value of c is {0}", c)
      c = a Xor b       ' 49 = 0011 0001 
      
      Console.WriteLine("Line 3 - Value of c is {0}", c)
      c = Not a          ' -61 = 1100 0011 
      
      Console.WriteLine("Line 4 - Value of c is {0}", c)
      c = a << 2     ' 240 = 1111 0000 
      
      Console.WriteLine("Line 5 - Value of c is {0}", c)
      c = a >> 2    ' 15 = 0000 1111 
      
      Console.WriteLine("Line 6 - Value of c is {0}", c)
      Console.ReadLine()
   End Sub
End Module
When the above code is compiled and executed, it produces the following result −
Line 1 - Value of c is 12
Line 2 - Value of c is 61
Line 3 - Value of c is 49
Line 4 - Value of c is -61
Line 5 - Value of c is 240
Line 6 - Value of c is 15
Swift - For Loop

A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.
The syntax of for loop in Swift programming language is as follows −
for init; condition; increment {
   statement(s)
}

The flow of control in a for loop is as follows −
The init step is executed first, and only once. This step allows you to declare and initialize any loop control variables. You are not required to put a statement here, as long as a semicolon appears.
The init step is executed first, and only once. This step allows you to declare and initialize any loop control variables. You are not required to put a statement here, as long as a semicolon appears.
Next, the condition is evaluated. If it is true, the body of the loop is executed. If it is false, the body of the loop does not execute and flow of control jumps to the next statement just after the for loop.
Next, the condition is evaluated. If it is true, the body of the loop is executed. If it is false, the body of the loop does not execute and flow of control jumps to the next statement just after the for loop.
After the body of the for loop executes, the flow of control jumps back up to the increment statement. This statement allows you to update any loop control variables. This statement can be left blank, as long as a semicolon appears after the condition.
After the body of the for loop executes, the flow of control jumps back up to the increment statement. This statement allows you to update any loop control variables. This statement can be left blank, as long as a semicolon appears after the condition.
The condition is now evaluated again. If it is true, the loop executes and the process repeats itself (body of loop, then increment step, and then again condition). After the condition becomes false, the for loop terminates.
The condition is now evaluated again. If it is true, the loop executes and the process repeats itself (body of loop, then increment step, and then again condition). After the condition becomes false, the for loop terminates.
import Cocoa

var someInts:[Int] = [10, 20, 30]

for var index = 0; index < 3; ++index {
   println( "Value of someInts[\(index)] is \(someInts[index])")
}
When the above code is executed, it produces the following result −
Value of someInts[0] is 10
Value of someInts[1] is 20
Value of someInts[2] is 30
K’th Non-repeating Character in Python using List Comprehension and OrderedDict

23 Nov, 2020
Given a string and a number k, find the k-th non-repeating character in the string. Consider a large input string with lacs of characters and a small character set. How to find the character by only doing only one traversal of input string?
Examples:
Input : str = geeksforgeeks, k = 3
Output : r
First non-repeating character is f,
second is o and third is r.

Input : str = geeksforgeeks, k = 2
Output : o

Input : str = geeksforgeeks, k = 4
Output : Less than k non-repeating
         characters in input.

This problem has existing solution please refer link. We can solve this problem quickly in python using List Comprehension and OrderedDict.
# Function to find k'th non repeating character # in string from collections import OrderedDict   def kthRepeating(input,k):       # OrderedDict returns a dictionary data         # structure having characters of input     # string as keys in the same order they         # were inserted and 0 as their default value     dict=OrderedDict.fromkeys(input,0)       # now traverse input string to calculate         # frequency of each character     for ch in input:         dict[ch]+=1      # now extract list of all keys whose value         # is 1 from dict Ordered Dictionary     nonRepeatDict = [key for (key,value) in dict.items() if value==1]           # now return (k-1)th character from above list     if len(nonRepeatDict) < k:         return 'Less than k non-repeating characters in input.'     else:         return nonRepeatDict[k-1]   # Driver function if __name__ == "__main__":     input = "geeksforgeeks"    k = 3    print (kthRepeating(input, k)) 
Output:
r

This article is contributed by Shashank Mishra (Gullu). If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Python dictionary-programs
Python list-programs
python-dict
python-list
Python
Strings
python-dict
python-list
Strings
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Install PIP on Windows ?
Python Classes and Objects
Python OOPs Concepts
Introduction To PYTHON
How to drop one or multiple columns in Pandas Dataframe
Write a program to reverse an array or string
Reverse a string in Java
Write a program to print all permutations of a given string
C++ Data Types
Check for Balanced Brackets in an expression (well-formedness) using Stack
How to use TypeScript on backend ?

04 Jul, 2021
TypeScript was developed by Microsoft to simplify the JavaScript code, making it easier to read and debug. Its type checking prevents many horrendous bugs during runtime. In this article, we will see how to set up typescript in the backend with NodeJS and express.
Prerequisites
Basics of NodeJS
Basics of Express
Basics of JavaScript
Project Setup and Module Installation:
Step 1: Run the following command in command prompt/bash/console to create a node project
npm init -y
 
Step 2: Adding the required dependencies using the following command.
npm i express 
npm i typescript ts-node @types/node @types/express --save-dev
npm i -D @types/express
Notice the devDependency for typescript. Typescript is only required through the development process, In the end, It will be compiled to VanillaJS for runtime. Learn more about types of dependencies.
Project Structure: It will look like this
Step 3: Configure Typescript using the following command.
npx tsc --init
It will generate tsconfig.json where you can define parameters for typescript like which ECMAScript version to use (like ES3 (default), ES5, ES2015), enable strict type checking or not. Learn more about typescript configuration.
Step 4: Creating an express server, here we have named it server.ts
server.ts
// Importing moduleimport express from 'express';  const app = express();const PORT:Number=3000;  // Handling GET / Requestapp.get('/', (req, res) => {    res.send('Welcome to typescript backend!');})  // Server setupapp.listen(PORT,() => {    console.log('The application is listening '          + 'on port http://localhost:'+PORT);})
Step 6: Configure package.json
Add the following line of code in package.json file, tsc command compiles typescript code to Vanilla JavaScript, while node server.js will take the generated Vanilla JavaScript file and start the server.
"scripts": {
 "build": "tsc",
 "start": " node server.js"
}
Step 7: Run the server using the following command.
npm run build
npm start
Output: Now open the http://localhost:3000 in any browser to see the server running.
JavaScript-Questions
Picked
TypeScript
JavaScript
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Monkey Patching in Python (Dynamic Behavior)

04 Dec, 2020
In Python, the term monkey patch refers to dynamic (or run-time) modifications of a class or module. In Python, we can actually change the behavior of code at run-time.
# monk.pyclass A:     def func(self):          print ("func() is being called")
We use above module (monk) in below code and change behavior of func() at run-time by assigning different value.
import monkdef monkey_f(self):     print ("monkey_f() is being called")   # replacing address of "func" with "monkey_f"monk.A.func = monkey_fobj = monk.A()  # calling function "func" whose address got replaced# with function "monkey_f()"obj.func()
Examples:
Output :monkey_f() is being called

Python-Functions
python-modules
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python Dictionary
Different ways to create Pandas Dataframe
Enumerate() in Python
Python String | replace()
How to Install PIP on Windows ?
*args and **kwargs in Python
Python Classes and Objects
Python OOPs Concepts
Convert integer to string in Python
Introduction To PYTHON
Python – API.home_timeline() in Tweepy

08 Jun, 2020
Twitter is a popular social network where users share messages called tweets. Twitter allows us to mine the data of any user using Twitter API or Tweepy. The data will be tweets extracted from the user. The first thing to do is get the consumer key, consumer secret, access key and access secret from twitter developer available easily for each user. These keys will help the API for authentication.
The home_timeline() method of the API class in Tweepy module is used to get the 20 most recent statuses, including retweets, posted by the authenticating user and that user’s friends. This is the equivalent of /timeline/home on the Web.
Syntax : API.home_timeline(parameters)
Parameters :
since_ids : Fetch only the statuses newer than the specified ID.
max_ids : Fetch only the statuses older than or equal to the specified ID.
count : The number of statuses to be fetched, the default value is 20.
Returns : a list of objects of the class Status
Example 1 :Using the home_timeline() method without any parameters.
# import the moduleimport tweepy  # assign the values accordinglyconsumer_key = ""consumer_secret = ""access_token = ""access_token_secret = ""  # authorization of consumer key and consumer secretauth = tweepy.OAuthHandler(consumer_key, consumer_secret)  # set access to user's access key and access secret auth.set_access_token(access_token, access_token_secret)  # calling the api api = tweepy.API(auth)  # fetching the statusesstatuses = api.home_timeline()  # printing the screen names of each statusfor status in statuses:    print(status.user.screen_name)
Output :
republic
AapGhumaKeLeLo_
vijaita
ABPNews
1911_1913_BakUp
BBCPolitics
SwarajyaMag
WIONews
YourAnonNews
thehill
AP
TimesNow
krystalball
People4Bernie
Holbornlolz
RealSaavedra
BenjaminPDixon
BJP4Haryana
BuzzFeed
MixedRaita

Example 2: Using the home_timeline() method with the count parameter to fetch only a specified number of statuses.
# number of statuses to be fetchedcount = 5  # fetching the statusesstatuses = api.home_timeline(count = count)  # printing the screen names of each statusfor status in statuses:    print(status.user.screen_name)
Output :
ANI
alexkotch
chrislongview
CNN
CGTNOfficial

Python-Tweepy
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python Dictionary
Different ways to create Pandas Dataframe
Enumerate() in Python
Python String | replace()
How to Install PIP on Windows ?
*args and **kwargs in Python
Python Classes and Objects
Python OOPs Concepts
Convert integer to string in Python
Introduction To PYTHON
HTML - <menuitem> tag

The HTML <menuitem> tag is used for defining a menu item for a menu.
<!Doctype html>
<html>

   <head>
      <title>HTML menuitem Tag</title>
   </head>

   <body>

      <div style = "border:1px solid #000; padding:20px;" contextmenu = "clickmenu">
         <p>Right click inside  here....</p>

         <menu type = "context" id = "clickmenu">
            <menuitem label = "Tutorialspoint" onclick = ""></menuitem>
         </menu>
         
      </div>
   </body>

</html>
This will produce the following result in Firefox browser only −
Right click inside  here....
This tag supports all the global attributes described in − HTML Attribute Reference
The HTML <menuitem> tag also supports the following  additional attributes −
checkbox
command
radio
This tag supports all the event attributes described in − HTML Events Reference

    19 Lectures 
     2 hours 

 Anadi Sharma

    16 Lectures 
     1.5 hours 

 Anadi Sharma

    18 Lectures 
     1.5 hours 

 Frahaan Hussain

    57 Lectures 
     5.5 hours 

 DigiFisk (Programming Is Fun)

    54 Lectures 
     6 hours 

 DigiFisk (Programming Is Fun)

    45 Lectures 
     5.5 hours 

 DigiFisk (Programming Is Fun)
 Print
 Add Notes
 Bookmark this page
Add custom borders to matrix in Python - GeeksforGeeks

05 Apr, 2021
Given a Matrix, the task is to write a python program to print each row having custom borders.
Input : test_list = [[4, 5, 6], [1, 4, 5], [6, 9, 1], [0, 3 ,1]], bord = "|"
Output : | 4 5 6 |
         | 1 4 5 |
         | 6 9 1 |
         | 0 3 1 |
Explanation : Matrix is ended using | border as required.

Input : test_list = [[4, 5, 6], [1, 4, 5], [6, 9, 1], [0, 3 ,1]], bord = "!"
Output : ! 4 5 6 !
         ! 1 4 5 !
         ! 6 9 1 !
         ! 0 3 1 !
Explanation : Matrix is ended using ! border as required.
Method #1 : Using loop
In this, we perform task of printing the row elements using inner loop, separated by space. The main step of adding custom borders is concatenated using + operator.
Python3
# Python3 code to demonstrate working of# Custom Matrix Borders# Using loop  # initializing listtest_list = [[4, 5, 6], [1, 4, 5],              [6, 9, 1], [0, 3, 1]]  # printing original listprint("The original list is : " + str(test_list))  # initializing borderbord = "|"  for sub in test_list:    temp = bord + " "      # inner row    for ele in sub:        temp = temp + str(ele) + " "      # adding border    temp = temp + bord    print(temp)
Output:
The original list is : [[4, 5, 6], [1, 4, 5], [6, 9, 1], [0, 3, 1]]
| 4 5 6 |
| 1 4 5 |
| 6 9 1 |
| 0 3 1 |
Method #2 : Using * operator + loop
In this, the task of joining inner characters is performed using * operator. 
Python3
# Python3 code to demonstrate working of# Custom Matrix Borders# Using * operator + loop  # initializing listtest_list = [[4, 5, 6], [1, 4, 5],              [6, 9, 1], [0, 3, 1]]  # printing original listprint("The original list is : " + str(test_list))  # initializing borderbord = "|"  for sub in test_list:      # * operator performs task of joining    print(bord, *sub, bord)
Output:
The original list is : [[4, 5, 6], [1, 4, 5], [6, 9, 1], [0, 3, 1]]
| 4 5 6 |
| 1 4 5 |
| 6 9 1 |
| 0 3 1 |
Python list-programs
Python
Python Programs
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()
Defaultdict in Python
Python | Get dictionary keys as a list
Python | Split string into list of characters
Python program to check whether a number is Prime or not
Python | Convert a list to dictionary
How do you round up a float number in Python?

Python has an in-built function round() for this purpose. The function takes two arguments, the number to be rounded and the places upto which it is to be rounded. If the number is to be rounded to nearest integer, the second argument is not given.
>>> round(1.7456)
2
>>> round(1.4756)
1
If however, it is to be rounded up, 0.5 is added to it before rounding
>>> round(1.7456+0.5)
2
>>> round(1.4756+0.5)
2
ES6 - for in loop

The for...in loop is used to loop through an object's properties.
Following is the syntax of ‘for...in’ loop.
for (variablename in object) {
   statement or block to execute
}

In each iteration, one property from the object is assigned to the variable name and this loop continues till all the properties of the object are exhausted.
var obj = {a:1, b:2, c:3};

for (var prop in obj) {
   console.log(obj[prop]);
}
The above example illustrates iterating an object using the for... in loop. The following output is displayed on successful execution of the code.
1
2
3


    32 Lectures 
     3.5 hours 

 Sharad Kumar

    40 Lectures 
     5 hours 

 Richa Maheshwari

    16 Lectures 
     1 hours 

 Anadi Sharma

    50 Lectures 
     6.5 hours 

 Gowthami Swarna

    14 Lectures 
     1 hours 

 Deepti Trivedi

    31 Lectures 
     1.5 hours 

 Shweta
 Print
 Add Notes
 Bookmark this page
What does double underscore prefix do in Python variables?

In Python, we use double underscore i.e., __ before the attribute's name and those attributes will not be directly accessible/visible outside. Double underscore mangles the attribute's name. However, that variable can still be accessed using some tricky syntax but it's generally not a good idea to do so. Double underscores are used for fully private variables.
According to Python documentation −
If your class is intended to be subclassed, and you have attributes that you do not want subclasses to use, consider naming them with double leading underscores and no trailing underscores. This invokes Python's name mangling algorithm, where the name of the class is mangled into the attribute name. This helps avoid attribute name collisions should subclasses inadvertently contain attributes with the same name. 
The code below shows use of double underscore.
class MyClass:
    __hiddenVar = 0
    def add(self, increment):
       self.__hiddenVar += increment
       print (self.__hiddenVar)
myObject = MyClass()
myObject.add(3)
myObject.add (8)
print (myObject.__hiddenVar)
3
Traceback (most recent call last):
11
  File "C:/Users/TutorialsPoint1/.PyCharmCE2017.2/config/scratches/scratch_1.py", line 12, in <module>
    print (myObject.__hiddenVar)
AttributeError: MyClass instance has no attribute '__hiddenVar'
In the above program, we tried to access hidden variable outside the class using object and it threw an exception.
Check if a given string is a valid number in C++

It should be validated if a given string is numeric.
Input − str = "12.5"
Output − true
Input − str = "def"
Output − false
Input − str = "2e5"
Output − true
Input − 10e4.4
Output − false
We have to handle the following cases in the code.
We have to ignore the leading and trailing white spaces.
We have to ignore the leading and trailing white spaces.
We have to ignore the ‘+’, ‘-‘ and’.’ at the start.
We have to ignore the ‘+’, ‘-‘ and’.’ at the start.
We have to ensure that the characters in the string belong to {+, -, ., e, [0-9]}
We have to ensure that the characters in the string belong to {+, -, ., e, [0-9]}
We have to ensure that no ‘.’ comes after ‘e’.
We have to ensure that no ‘.’ comes after ‘e’.
A digit should follow a dot character ‘.’.
A digit should follow a dot character ‘.’.
We have to ensure that the character ‘e’ should be followed either by ‘+’, ‘-‘, or a digit.
We have to ensure that the character ‘e’ should be followed either by ‘+’, ‘-‘, or a digit.
 Live Demo
// C++ program to check if input number
// is a valid number
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int valid_number1(string str1){
   int i = 0, j = str1.length() - 1;
   while (i < str1.length() && str1[i] == ' ')
      i++;
   while (j >= 0 && str1[j] == ' ')
      j--;
   if (i > j)
      return 0;
   if (i == j && !(str1[i] >= '0' && str1[i] <= '9'))
      return 0;
   if (str1[i] != '.' && str1[i] != '+' && str1[i] != '-' && !(str1[i] >= '0' && str1[i] <= '9'))
      return 0;
   bool flagDotOrE = false;
   for (i; i <= j; i++) {
      // If any of the char does not belong to
      // {digit, +, -, ., e}
      if (str1[i] != 'e' && str1[i] != '.'
      && str1[i] != '+' && str1[i] != '-'
      && !(str1[i] >= '0' && str1[i] <= '9'))
      return 0;
      if (str1[i] == '.') {
         if (flagDotOrE == true)
            return 0;
         if (i + 1 > str1.length())
            return 0;
         if (!(str1[i + 1] >= '0' && str1[i + 1] <= '9'))
            return 0;
      }
      else if (str1[i] == 'e') {
         flagDotOrE = true;
         if (!(str1[i - 1] >= '0' && str1[i - 1] <= '9'))
            return 0;
         if (i + 1 > str1.length())
            return 0;
         if (str1[i + 1] != '+' && str1[i + 1] != '-'
            && (str1[i + 1] >= '0' && str1[i] <= '9'))
         return 0;
      }
   }
   return 1;
}
// Driver code
int main(){
   char str1[] = "0.1e10";
   if (valid_number1(str1))
      cout << "true";
   else
      cout << "false";
   return 0;
}
true
Math.Floor() Method in C#

The Math.Floor() method in C# is used to return the largest integral value less than or equal to the specified number.
public static decimal Floor (decimal val);
public static double Floor (double val)
For the first syntax above, the value val is the decimal number, whereas Val in the second syntax is the double number.
Let us now see an example to implement Math.Floor() method −
using System;
public class Demo {
   public static void Main(){
      decimal val1 = 7.10M;
      decimal val2 = -79.89M;
      Console.WriteLine("Result = " + Math.Floor(val1));
      Console.WriteLine("Result = " + Math.Floor(val2));
   }
}
This will produce the following output −
Result = 7
Result = -80
Let us see another example to implement Math.Floor() method −
using System;
public class Demo {
   public static void Main(){
      double val1 = 8.9;
      double val2 = 88.10;
      double val3 = -31.98;
      Console.WriteLine("Result = " + Math.Floor(val1));
      Console.WriteLine("Result = " + Math.Floor(val2));
      Console.WriteLine("Result = " + Math.Floor(val3));
   }
}
This will produce the following output −
Result = 8
Result = 88
Result = -32
How does default virtual behavior differ in C++ and Java ? - GeeksforGeeks

22 Mar, 2017
Default virtual behavior of methods is opposite in C++ and Java:
In C++, class member methods are non-virtual by default. They can be made virtual by using virtual keyword. For example, Base::show() is non-virtual in following program and program prints “Base::show() called”.
#include<iostream>  using namespace std;  class Base {public:            // non-virtual by default    void show() {           cout<<"Base::show() called";    }};  class Derived: public Base {public:          void show() {         cout<<"Derived::show() called";    }      };  int main(){  Derived d;  Base &b = d;     b.show();   getchar();  return 0;}
Adding virtual before definition of Base::show() makes program print “Derived::show() called”
In Java, methods are virtual by default and can be made non-virtual by using final keyword. For example, in the following java program, show() is by default virtual and the program prints “Derived::show() called”
class Base {      // virtual by default    public void show() {       System.out.println("Base::show() called");    }}  class Derived extends Base {    public void show() {       System.out.println("Derived::show() called");    }}  public class Main {    public static void main(String[] args) {        Base b = new Derived();;        b.show();    }}
Unlike C++ non-virtual behavior, if we add final before definition of show() in Base , then the above program fails in compilation.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Java
Java
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Initialize an ArrayList in Java
Object Oriented Programming (OOPs) Concept in Java
HashMap in Java with Examples
Interfaces in Java
ArrayList in Java
How to iterate any Map in Java
Multidimensional Arrays in Java
Stack Class in Java
Stream In Java
Singleton Class in Java
Output Iterators in C++

Here we will see what are the Output iterators in C++. The Output iterators has some
properties. These are like below:
The output iterators are used to modify the value of the containers.
We cannot read data from container using this kind of iterators
This is One-Way and Write only iterator
It can be incremented, but cannot be decremented.
There are two sub-parts of Output iterators. These are Insert Iterator and ostream
iterator.
The insert iterator is used to insert some element inside the container. The assignment
operator on this type of iterator inserts new element at current position. The syntax of insert
iterator is like below:
template<class Container, class Iterator>
insert_iterator<container> inserter(Container &x,Iterator it);
This iterator takes two parameters, x and it. The x is the container, on which the iterator will
work. The second argument is an iterator object, which is pointing the position which is to be
modified.
#include <iostream>
#include <iterator>
#include <vector>
#include <algorithm>
using namespace std;
int main () {
   vector<int> vec1,vec2;
   for (int i=1; i<=10; i++) { //insert elements into vectors
      vec1.push_back(i);
      vec2.push_back(i+3);
   }
   vector<int>::iterator it = vec1.begin(); //iterator works on vector1
   advance (it,5); //advance it to 5 position
   copy (vec2.begin(),vec2.end(),inserter(vec1,it));
   cout<<"Elements of vec1 are :";
   for ( it = vec1.begin(); it!= vec1.end(); ++it )
      cout << ' ' << *it;
      cout << endl;
   return 0;
}
Elements of vec1 are : 1 2 3 4 5 4 5 6 7 8 9 10 11 12 13 6 7 8 9 10
The ostream iterator is used to write to the output stream like cout. The ostream
iterator can be created using basic_ostream object. When the assignment operator is used with
this type of iterator, it inserts new element to the output stream. The syntax is like below.
template<class T, class charT=char, class traits=char_traits<charT>>
class ostream_iterator;
The member functions of ostream iterator class is like below.
ostream_iterator<T, charT, traits>& operator=(const T& value);
ostream_iterator<T, charT, traits>& operator*();
ostream_iterator<T, charT, traits>& operator++();
ostream_iterator<T, charT, traits>& operator++(int);
The parameters are: T. This is the type of elements that will be inserted, chart, this is the type
of elements that ostream can handle, and traits. These are character traits that can be handled
by the stream.
#include <iostream>
#include<iterator>
#include<vector>
#include<algorithm>
using namespace std;
main() {
   vector<int> vector;
   for(int i=1;i<=10;i++)
      vector.push_back(i*i); //make square and insert
      ostream_iterator<int> out(cout,",");
      copy(vector.begin(),vector.end(),out);
}
1,4,9,16,25,36,49,64,81,100,
Another example,
#include <iostream>
#include<iterator>
#include<vector>
#include<algorithm>
using namespace std;
main() {
   ostream_iterator<int> os_out(cout,",");
   *os_out = 10;
   os_out++; //point to next
   *os_out = 20;
   os_out++;
   *os_out = 30;
}
10,20,30,
Swing Examples - Adding vertical scrollbar

Following example showcase how to show a Scroll Pane with a vertical bar always on a Panel in a Java Swing application.
We are using the following APIs.
JScrollPane(Component view) − To create a scrollPane on a component.
JScrollPane(Component view) − To create a scrollPane on a component.
JScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS) − To show a vertical bar always.
JScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS) − To show a vertical bar always.
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
 
public class SwingTester {
   private JFrame mainFrame;
   private JLabel headerLabel;
   private JLabel statusLabel;
   private JPanel controlPanel;
   
   public SwingTester(){
      prepareGUI();
   }
   public static void main(String[] args){
      SwingTester  swingControlDemo = new SwingTester();      
      swingControlDemo.showScrollPaneDemo();
   }
   private void prepareGUI(){
      mainFrame = new JFrame("Java Swing Examples");
      mainFrame.setSize(400,400);
      mainFrame.setLayout(new GridLayout(3, 1));
      
      mainFrame.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent windowEvent){
            System.exit(0);
         }        
      });    
      headerLabel = new JLabel("", JLabel.CENTER);        
      statusLabel = new JLabel("",JLabel.CENTER);    
      statusLabel.setSize(350,100);

      controlPanel = new JPanel();
      controlPanel.setLayout(new FlowLayout());

      mainFrame.add(headerLabel);
      mainFrame.add(controlPanel);
      mainFrame.add(statusLabel);
      mainFrame.setVisible(true);  
   }
   
   private JTextArea outputTextArea;
   
   private void showScrollPaneDemo(){
      headerLabel.setText("Control in action: ScrollPane");
      outputTextArea = new JTextArea("",5,20);
      JScrollPane scrollPane = new JScrollPane(outputTextArea);    
      scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
      controlPanel.add(scrollPane);
      mainFrame.setVisible(true);  
   }   
}
 Print
 Add Notes
 Bookmark this page
How to Install xlrd in Python on Linux? - GeeksforGeeks

18 Oct, 2021
In this article, we will learn how to install xlrd in Python on Linux. The xlrd is a library for reading data and formatting information from Excel files in the historical .xls format.
Follow the below steps to install the xlrd package on Linux using pip:
Step 1: Install the latest Python3 in Linux
Step 2: Check if pip3 and python3 are correctly installed.
python3 --version
pip3 --version
Step 3: Upgrade your pip to avoid errors during installation.
pip3 install --upgrade pip
Step 4: Enter the following command to install xlrd using pip3.
pip3 install xlrd
Follow the below steps to install the xlrd package on Linux using the setup.py file:
Step 1: Download the latest source package of xlrd for python3 from here.
curl https://files.pythonhosted.org/packages/a6/b3/19a2540d21dea5f908304375bd43f5ed7a4c28a370dc9122c565423e6b44/xlrd-2.0.1.tar.gz > xlrd.tar.gz
Step 2: Extract the downloaded package using the following command.
tar -xvzf xlrd.tar.gz
Step 3: Go inside the folder and Enter the following command to install the package.
cd xlrd-2.0.1
python3 setup.py install
Make the following import in your python terminal to verify if the installation has been done properly:
import xlrd
If there is any error while importing the module then is not installed properly.
how-to-install
Picked
How To
Installation Guide
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Align Text in HTML?
How to filter object array based on attributes?
How to Install OpenCV for Python on Windows?
Java Tutorial
How to Install FFmpeg on Windows?
Installation of Node.js on Linux
How to Install OpenCV for Python on Windows?
How to Install FFmpeg on Windows?
How to Install Pygame on Windows ?
How to Add External JAR File to an IntelliJ IDEA Project?
Matplotlib.axis.Axis.get_major_locator() function in Python - GeeksforGeeks

03 Jun, 2020
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. It is an amazing visualization library in Python for 2D plots of arrays and used for working with the broader SciPy stack.
The Axis.get_major_locator() function in axis module of matplotlib library is used to get the locator of the major ticker.
Syntax: Axis.get_major_locator(self)
Parameters: This method does not accepts any parameters.
Return value: This method returns the locator of the major ticker.
Below examples illustrate the matplotlib.axis.Axis.get_major_locator() function in matplotlib.axis:
Example 1:
Python3
# Implementation of matplotlib function import numpy as npfrom matplotlib.axis import Axis  import matplotlib.pyplot as plt       x = np.linspace(0, 10, 1000) y = np.sin(2 * x)     fig = plt.figure() ax = fig.add_subplot(111)     ax.plot(x, y)ax.grid()  print(Axis.get_major_locator(ax.yaxis))  plt.title("Matplotlib.axis.Axis.get_major_locator()\n\Function Example", fontsize = 12, fontweight ='bold') plt.show()
Output:
<matplotlib.ticker.AutoLocator object at 0x07D67ED0>

Example 2:
Python3
# Implementation of matplotlib function import numpy as npfrom matplotlib.axis import Axis  import matplotlib.pyplot as plt       np.random.seed(19680801)      fig, ax = plt.subplots()        x, y, s, c = np.random.rand(4, 100)  s *= 100      ax.scatter(x, y, s, c)ax.grid()    print(Axis.get_major_locator(ax.xaxis))  plt.title("Matplotlib.axis.Axis.get_major_locator()\n\Function Example", fontsize = 12, fontweight ='bold') plt.show()
Output:
<matplotlib.ticker.AutoLocator object at 0x07CA9FD0>

Matplotlib-Axis Class
Python-matplotlib
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Install PIP on Windows ?
How To Convert Python Dictionary To JSON?
Check if element exists in list in Python
How to drop one or multiple columns in Pandas Dataframe
Python Classes and Objects
Python | os.path.join() method
Create a directory in Python
Defaultdict in Python
Python | Pandas dataframe.groupby()
Python | Get unique values from a list
Difference between structured and unstructured programming - GeeksforGeeks

13 Jul, 2021
Structured Programming
Structured Programming is a type of programming that generally converts large or complex programs into more manageable and small pieces of code.
These small pieces of codes are usually known as functions or modules or sub-programs of large complex programs.
It is known as modular programming and minimizes the chances of function affecting another.
Below is the program to illustrate the structured programming:
C
// C program to demonstrate the// structured programming#include <stdio.h> // Function for additionint sum(int a, int b){    return a + b;} // Function for Subtractionint sub(int a, int b){    return a - b;} // Driver Codeint main(){    // Variable initialisation    int a = 10, b = 5;     int add, minus;     // Function Call    add = sum(a, b);    minus = sub(a, b);     printf("Addition = %d\n", add);    printf("Subtraction = %d\n", minus);    return 0;}
Addition = 15
Subtraction = 5
 
Unstructured Programming: 
Unstructured Programming is a type of programming that generally executes in sequential order i.e., these programs just not jumped from any line of code and each line gets executed sequentially.
It is also known as non-structured programming that is capable of creating turning-complete algorithms.
Below is the program to illustrate the unstructured programming:
C
// C program to demonstrate the// unstructured programming #include <stdio.h> // Driver Codeint main(){    // Variable initialisation    int a = 10, b = 5;    int add, minus;     // Operations performed    add = a + b;    minus = a - b;     printf("Addition = %d\n", add);    printf("Subtraction = %d\n", minus);    return 0;}
Addition = 15
Subtraction = 5
 
Tabular difference between structured vs unstructured programming:  
Structured Programming
Unstructured Programming
labeshsharma2001
Programming Basics
Difference Between
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Difference between var, let and const keywords in JavaScript
Difference Between Method Overloading and Method Overriding in Java
Difference between Prim's and Kruskal's algorithm for MST
Difference between Internal and External fragmentation
Differences and Applications of List, Tuple, Set and Dictionary in Python
Difference between HashMap and HashSet
Difference between Compile-time and Run-time Polymorphism in Java
Similarities and Difference between Java and C++
Difference between List and ArrayList in Java
Difference Between map() And flatMap() In Java Stream
Java Math abs() Method

❮ Math Methods

Return the absolute (positive) value of different numbers:
System.out.println(Math.abs(-4.7));
System.out.println(Math.abs(4.7));
System.out.println(Math.abs(3)); 

Try it Yourself »

The abs() method returns the absolute (positive) value of a number.
One of the following:
public static double abs(double number)

public static float abs(float number)

public static int abs(int number)

public static long abs(long number)

We just launchedW3Schools videos
Get certifiedby completinga course today!
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
help@w3schools.com
Your message has been sent to W3Schools.
Difference between Applets and Servlets in Java.

In java, both Applets and servlets are the programs or applications that run in a java environment. The main difference in both the programs is in their processing is done in different environments.
The following are the important differences between Applets and Servlets.
AppletDemo.java
import java.applet.Applet;
import java.awt.Graphics;
public class AppletDemo extends Applet {
   // Overriding paint() method
   @Override
   public void paint(Graphics g){
      g.drawString("AppletDemo", 20, 20);
   }
}
AppletDemo
ServletDemo.java
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ServletDemo extends HttpServlet {
   private String message;
   public void init() throws ServletException{
      // Do required initialization
      message = "Servlet Demo";
   }
   public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException{
      response.setContentType("text/html");
      PrintWriter out = response.getWriter();
      out.println(message);
   }
}
Servlet Demo
How can we return multiple values from a function in C#?

In c# multiple values can be returned using the below approaches −
Reference parameters
Reference parameters
Output parameters
Output parameters
Returning an Array
Returning an Array
Returning a Tuple
Returning a Tuple
class Program{
   static int ReturnMultipleValuesUsingRef(int firstNumber, ref int secondNumber){
      secondNumber = 20;
      return firstNumber;
   }
   static void Main(){
      int a = 10;
      int refValue = 0;
      var res = ReturnMultipleValuesUsingRef(a, ref refValue);
      System.Console.WriteLine($" Ref Value {refValue}");
      System.Console.WriteLine($" Function Return Value {res}");
      Console.ReadLine();
   }
}
Ref Value 20
Function Return Value 10
class Program{
   static int ReturnMultipleValuesUsingOut(int firstNumber, out int secondNumber){
      secondNumber = 20;
      return firstNumber;
   }
   static void Main(){
      int a = 10;
      int outValue = 0;
      var res = ReturnMultipleValuesUsingOut(a, out outValue);
      System.Console.WriteLine($" Out Value {outValue}");
      System.Console.WriteLine($" function Return Value {res}");
      Console.ReadLine();
   }
}
Out Value 20
Function Return Value 10
class Program{
   static int[] ReturnArrays(){
      int[] arrays = new int[2] { 1, 2 };
      return arrays;
   }
   static void Main(){
      var res = ReturnArrays();
      System.Console.WriteLine($"{res[0]} {res[1]}");
      Console.ReadLine();
   }
}
1 2
class Program{
   static Tuple<int, int>ReturnMulitipleVauesUsingTuples(){
      return new Tuple<int, int>(10, 20);
   }
   static void Main(){
      var res = ReturnMulitipleVauesUsingTuples();
      System.Console.WriteLine($"{res.Item1} {res.Item2}");
      Console.ReadLine();
   }
}
10 20