code-rag-bench/online-tutorials huggingface dataset:
VBScript LCase Function

The LCase Function returns the string after converting the entered string into lower case letters.
Lcase(String)

<!DOCTYPE html>
<html>
   <body>
      <script language = "vbscript" type = "text/vbscript">
         var = "Microsoft VBScript"
         document.write("Line 1 : " & LCase(var) & "<br />")
         
         var = "MS VBSCRIPT"
         document.write("Line 2 : " & LCase(var) & "<br />")
         
         var = "microsoft"
         document.write("Line 3 : " & LCase(var) & "<br />")
      </script>
   </body>
</html>
When you save it as .html and execute it in Internet Explorer, then the above script will produce the following result −
Line 1 : microsoft vbscript
Line 2 : ms vbscript
Line 3 : microsoft


    63 Lectures 
     4 hours 

 Frahaan Hussain
 Print
 Add Notes
 Bookmark this page
Copy Constructor in Java - GeeksforGeeks

17 May, 2021
Prerequisite – Constructors in Java Like C++, Java also supports copy constructor. But, unlike C++, Java doesn’t create a default copy constructor if you don’t write your own. 
Following is an example Java program that shows a simple use of copy constructor. 
Java
// filename: Main.java class Complex {     private double re, im;         // A normal parameterized constructor    public Complex(double re, double im) {        this.re = re;        this.im = im;    }         // copy constructor    Complex(Complex c) {        System.out.println("Copy constructor called");        re = c.re;        im = c.im;    }          // Overriding the toString of Object class    @Override    public String toString() {        return "(" + re + " + " + im + "i)";    }} public class Main {     public static void main(String[] args) {        Complex c1 = new Complex(10, 15);                 // Following involves a copy constructor call        Complex c2 = new Complex(c1);           // Note that following doesn't involve a copy constructor call as        // non-primitive variables are just references.        Complex c3 = c2;           System.out.println(c2); // toString() of c2 is called here    }}
Output: 
Copy constructor called
(10.0 + 15.0i)
Now try the following Java program: 
Java
// filename: Main.java class Complex {     private double re, im;     public Complex(double re, double im) {        this.re = re;        this.im = im;    }} public class Main {         public static void main(String[] args) {        Complex c1 = new Complex(10, 15);         Complex c2 = new Complex(c1);  // compiler error here    }}
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above. 
gabaa406
Java
School Programming
Java
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Split() String method in Java with examples
Arrays.sort() in Java with examples
Reverse a string in Java
Initialize an ArrayList in Java
How to iterate any Map in Java
Python Dictionary
Arrays in C/C++
Inheritance in C++
Reverse a string in Java
C++ Classes and Objects
Dart - String toUpperCase() Function with Examples - GeeksforGeeks

14 Jul, 2020
The string toUpperCase() method converts all characters of the string into an uppercase letter. The string toUpperCase() function returns the string after converting all characters of the string into the uppercase letter. 
Syntax: Str.toUpperCase()
Parameter: The string toUpperCase() function doesn’t accept any parameter.
Return Value: The string toUpperCase() function returns the string afterconverting all characters of the string into the uppercase letter.
Example1:  
Dart
void main() {         // str1 stores the string "geeks"   String Str1 = "geeks";      // str2 stores the string "fOr GEeks"   String Str2 = "fOr GEeks";         // print str1 in uppercase letter   print(Str1.toUpperCase());         // print str2 in uppercase letter   print(Str2.toUpperCase()); }
Output: 
GEEKS
FOR GEEKS

Example 2:  
Dart
void main() {      // str1 stores the string "COMPUTER"   String Str1 = "COMPUTER";      // str2 stores the string "laPToP"   String Str2 = "laPToP";         // print str1 in uppercase letter   print(Str1.toUpperCase());         // print str2 in uppercase letter   print(Str2.toUpperCase()); }
Output: 
COMPUTER
LAPTOP

Dart-String
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
ListView Class in Flutter
Android Studio Setup for Flutter Development
Flutter - Flexible Widget
Flutter - Stack Widget
Flutter - BorderRadius Widget
What is widgets in Flutter?
Flutter - Dialogs
Format Dates in Flutter
Dart - Static Keyword
Reverse all the words of sentence JavaScript

We are required to write a JavaScript function that takes in a string and returns a new string
which has all the words reversed from the original string.
For example −
If the original string is −
"Hello World how is it outside"
Then the output should be −
"olleH dlroW woH si ti edistuo"
Now, let's write the code for this function −
const str = 'Hello World how is it outside';
const reverseSentence = str => {
   const arr = str.split(" ");
   const reversed = arr.map(el => {
      return el.split('').reverse().join("");
   });
   return reversed.join(" ");
};
console.log(reverseSentence(str));
The output in the console will be −
olleH dlroW woh si ti edistuo
Unity - The Button

In this chapter, we will earn how to insert UI elements into our scene and go about working with them.
Let us start off with a Button. To insert a button, right click in the Scene Hierarchy and go to Create → UI → Button. If you do not have an existing Canvas and an EventSystem, Unity will automatically create one for you, and place the button inside the Canvas as well.
Remember that in Overlay rendering mode, which is the default mode, the size of the Canvas is independent of the size of the camera. You can test this by clicking on the Game tab.
If you play the scene, you will notice the button already has some standard functionality such as detecting when the mouse is hovering over it, and changing color when pressed.
A Button requires functionality to be actually useful in the UI. This functionality can be added through its properties.
Let us create a new script, and call it ButtonBehaviour.
public class ButtonBehaviour : MonoBehaviour {
   int n;
   public void OnButtonPress(){
      n++;
      Debug.Log("Button clicked " + n + " times.");
   }
}
We have made a simple method that logs how many times we have hit the button.
Note − This method has to be public; it will not be noticed by the Button’s functionality otherwise.
Let us create an empty GameObject and attach this script to it. We do this because a button will not do anything on its own; it only calls the specified method in its scripting.
Now, go into the Button’s properties, and find the OnClick() property.
Hit the + icon on the bottom tab, and a new entry should show up in the list.
This entry defines what object the button press acts on, and what function of that object’s script is called. Because of the event system used in the button press, you can trigger multiple functions simply by adding them to the list.
Drag and drop the empty GameObject, which contains the ButtonManager script we created, onto the None (Object) slot.
Navigate the No Function dropdown list, and look for our OnButtonPress method. (Remember that it can be named anything you want, OnButtonPress is simply a standardized naming convention.) You should find it in the ButtonBehaviour section.
If you play the game now, you can test the button and surely enough, the console prints out how many times you have pressed the button.

    119 Lectures 
     23.5 hours 

 Raja Biswas

    58 Lectures 
     10 hours 

 Three Millennials

    16 Lectures 
     1 hours 

 Peter Jepson

    23 Lectures 
     2.5 hours 

 Zenva

    21 Lectures 
     2 hours 

 Zenva

    43 Lectures 
     9.5 hours 

 Raja Biswas
 Print
 Add Notes
 Bookmark this page
Get all the Documents of the Collection using PyMongo - GeeksforGeeks

10 Jul, 2020
To get all the Documents of the Collection use find() method. The find() method takes a query object as a parameter if we want to find all documents then pass none in the find() method. To include the field in the result the value of the parameter passed should be 1, if the value is 0 then it will be excluded from the result.
Note: If we pass no parameter in find() method .it works like select * in MYSQL .
Sample Database:Let’s suppose the database looks like this
Example 1:
import pymongo         # establishing connection # to the databaseclient = pymongo.MongoClient("mongodb://localhost:27017/")     # Database name db = client["mydatabase"]     # Collection name col = db["gfg"]   # if we don't want to print id then pass _id:0for x in col.find({}, {"_id":0, "coursename": 1, "price": 1 }):     print(x)
Output:
Example 2:
import pymongo         # establishing connection # to the databaseclient = pymongo.MongoClient("mongodb://localhost:27017/")     # Database name db = client["mydatabase"]     # Collection name col = db["gfg"]   # if we don't want to print id then pass _id:0 and price :0for x in col.find({}, {"_id":0, "coursename": 1, "price": 0 }):     print(x)
Output:
Python-mongoDB
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Python Dictionary
Read a file line by line in Python
Enumerate() in Python
How to Install PIP on Windows ?
Iterate over a list in Python
Different ways to create Pandas Dataframe
Python String | replace()
Python program to convert a list to string
Create a Pandas DataFrame from Lists
Reading and Writing to text files in Python
Binary Search on Singly Linked List in C++

A singly linked list is a linked list (a data structure that stores a node’s value and the memory location of the next node) which can go only one way.
A binary search is a search algorithm based on divide and rule. That finds the middle element of the structure and compares and uses recursive calls to the same algorithm for inequality.
Here, we are given a singly linked list and an element to be found using a binary search.
Since the singly linked list is a data structure that uses only one pointer, it is not easy to find its middle element. To mid of singly linked list, we use two pointer approaches.
Step 1 : Initialize, start_node (head of list) and last_node (will have last value) , mid_node (middle node of the structure).
Step 2 : Compare mid_node to element
   Step 2.1 : if mid_node = element, return value “found”.
   Step 2.2 : if mid_node > element, call binary search on lower_Half.
   Step 2.3 : if mid_node < element, call binary search on upper_Half.
Step 3 : if entire list is traversed, return “Not found”.
 Live Demo
#include<stdio.h>
#include<stdlib.h>
struct Node{
   int data;
   struct Node* next;
};
Node *newNode(int x){
   struct Node* temp = new Node;
   temp->data = x;
   temp->next = NULL;
   return temp;
}
struct Node* mid_node(Node* start, Node* last){
   if (start == NULL)
      return NULL;
   struct Node* slow = start;
   struct Node* fast = start -> next;
   while (fast != last){
      fast = fast -> next;
      if (fast != last){
         slow = slow -> next;
         fast = fast -> next;
      }
   }
   return slow;
}
struct Node* binarySearch(Node *head, int value){
   struct Node* start = head;
   struct Node* last = NULL;
   do{
      Node* mid = mid_node(start, last);
      if (mid == NULL)
         return NULL;
      if (mid -> data == value)
         return mid;
      else if (mid -> data < value)
         start = mid -> next;
      else
         last = mid;
   }
   while (last == NULL || last != start);
      return NULL;
}
int main(){
   Node *head = newNode(54);
   head->next = newNode(12);
   head->next->next = newNode(18);
   head->next->next->next = newNode(23);
   head->next->next->next->next = newNode(52);
   head->next->next->next->next->next = newNode(76);
   int value = 52;
   if (binarySearch(head, value) == NULL)
      printf("Value is not present in linked list\n");
   else
      printf("The value is present in linked list\n");
   return 0;
}
The value is present in linked list
Raising an Exceptions in Python

You can raise exceptions in several ways by using the raise statement. The general syntax for the raise statement is as follows.
raise [Exception [, args [, traceback]]]
Here, Exception is the type of exception (for example, NameError) and argument is a value for the exception argument. The argument is optional; if not supplied, the exception argument is None.
The final argument, traceback, is also optional (and rarely used in practice), and if present, is the traceback object used for the exception.
An exception can be a string, a class or an object. Most of the exceptions that the Python core raises are classes, with an argument that is an instance of the class. Defining new exceptions is quite easy and can be done as follows −
def functionName( level ):
   if level < 1:
      raise "Invalid level!", level
      # The code below to this would not be executed
      # if we raise the exception
Note − In order to catch an exception, an "except" clause must refer to the same exception thrown either class object or simple string. For example, to capture above exception, we must write the except clause as follows −
try:
   Business Logic here...
except "Invalid level!":
   Exception handling here...
else:
   Rest of the code here...
How to run matplotlib in Tkinter?

One of the well-known use-cases of Python is in Machine Learning and Data Science. In order to visualize and plot a dataset, we use the Matplotlib library. To plot a matplotlib graph in a Tkinter application, we have to import the library by initializing "from matplotlib.pyplot as plt". The plot can be drawn either by defining a range value or importing the dataset in the notebook.
#Import the required Libraries
from tkinter import *
from tkinter import ttk
import numpy as np
import matplotlib.pyplot as plt

#Create an instance of Tkinter frame
win= Tk()

#Set the geometry of the window
win.geometry("700x250")

def graph():
   car_prices= np.random.normal(50000,4000,2000)
   plt.figure(figsize=(7,3))
   plt.hist(car_prices, 25)
   plt.show()

#Create a Button to plot the graph
button= ttk.Button(win, text= "Graph", command= graph)
button.pack()

win.mainloop()
Running the above code will display a window that contains a button.
When we click the "Graph" button, it will display a graph on the main window.
colorsys module in Python

This module allows bidirectional conversions of color values between colors expressed in the RGB (Red Green Blue) and other color spaces. The three other color spaces it uses are YIQ (Luminance (Y) In-phase Quadrature), HLS (Hue Lightness Saturation) and HSV (Hue Saturation Value). All the coordinates can be between 0 and 1 except the I and Q values in the YIQ color space.
The below tables shows the functions and their purpose.
import colorsys as csys
# "Electric Blue"
r, g, b = 0.47, 0.91, 1.00
print("The RGB Values for Electric Blue: ", (r, g, b))
#
y, i, q = csys.rgb_to_yiq(r, g, b)
print("YIQ", (y, i, q), "becomes", csys.yiq_to_rgb(y, i, q))
h, s, v = csys.rgb_to_hsv(r, g, b)
print("HSV", (h, s, v), "becomes", csys.hsv_to_rgb(h, s, v))
h, l, s = csys.rgb_to_hls(r, g, b)
print("HLS", (h, l, s), "becomes", csys.hls_to_rgb(h, l, s))

Running the above code gives us the following result:
The RGB Values for Electric Blue: (0.47, 0.91, 1.0)
YIQ (0.7879, -0.292513, -0.06563100000000005) becomes (0.47, 0.9100000000000001, 1.0)
HSV (0.5283018867924528, 0.53, 1.0) becomes (0.47, 0.9099999999999999, 1.0)
HLS (0.5283018867924528, 0.735, 1.0) becomes (0.4700000000000001, 0.9099999999999998, 0.9999999999999999)
Write a C# program to check if a number is divisible by 2

To check if a number is divisible by2 or not, you need to first find the remainder.
If the remainder of the number when it is divided by 2 is 0, then it would be divisible by 2.
Let’s say our number is 10, we will check it using the following if-else −
// checking if the number is divisible by 2 or not
if (num % 2 == 0) {
   Console.WriteLine("Divisible by 2 ");
} else {
   Console.WriteLine("Not divisible by 2");
}
The following is an example to find whether the number is divisible by 2 or not −
 Live Demo
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Demo {
   class MyApplication {
         static void Main(string[] args) {
         int num;
         num = 10;

         // checking if the number is divisible by 2 or not
         if (num % 2 == 0) {
            Console.WriteLine("Divisible by 2 ");
         } else {
            Console.WriteLine("Not divisible by 2");
         }
         Console.ReadLine();
      }
   }
}
Divisible by 2
How to show two figures using Matplotlib?

We can use the method, plt.figure(), to create the figures, and then, set their titles by passing strings as arguments.
Create a new figure, or activate an existing figure, with the window title “Welcome to figure 1”.
Create a new figure, or activate an existing figure, with the window title “Welcome to figure 1”.
Draw a line using plot() method, over the current figure.
Draw a line using plot() method, over the current figure.
Create a new figure, or activate an existing figure, with the window title “Welcome to figure 2”.
Create a new figure, or activate an existing figure, with the window title “Welcome to figure 2”.
Draw a line using plot() method, over the current figure.
Draw a line using plot() method, over the current figure.
Using plt.show(), show the figures.
Using plt.show(), show the figures.
from matplotlib import pyplot as plt

plt.figure("Welcome to figure 1")
plt.plot([1, 3, 4])
plt.figure("Welcome to figure 2")
plt.plot([11, 13, 41])

plt.show()
Bootstrap - Code

Bootstrap allows you to display code with two different key ways −
The first is the <code> tag. If you are going to be displaying code inline, you should use the <code> tag.
The first is the <code> tag. If you are going to be displaying code inline, you should use the <code> tag.
Second is the <pre> tag. If the code needs to be displayed as a standalone block element or if it has multiple lines, then you should use the <pre> tag.
Second is the <pre> tag. If the code needs to be displayed as a standalone block element or if it has multiple lines, then you should use the <pre> tag.
Let us see an example below −
<p><code>&lt;header&gt;</code> is wrapped as an inline element.</p>
<p>To display code as a standalone block element use &lt;pre&gt; tag as:</p>

<pre>
   &lt;article&gt;
      &lt;h1&gt;Article Heading&lt;/h1&gt;
   &lt;/article&gt;
</pre>
<header> is wrapped as an inline element.
To display code as a standalone block element use <pre> tag as:
      
         <article>
            <h1>Article Heading</h1>
         </article>
      

    26 Lectures 
     2 hours 

 Anadi Sharma

    54 Lectures 
     4.5 hours 

 Frahaan Hussain

    161 Lectures 
     14.5 hours 

 Eduonix Learning Solutions

    20 Lectures 
     4 hours 

 Azaz Patel

    15 Lectures 
     1.5 hours 

 Muhammad Ismail

    62 Lectures 
     8 hours 

 Yossef Ayman Zedan
 Print
 Add Notes
 Bookmark this page
Tryit Editor v3.7

Tryit: box-shadow with blur effect
Command line arguments example in C

It is possible to pass some values from the command line to your C programs when they are executed. These values are called command line arguments and many times they are important for your program especially when you want to control your program from outside instead of hard-coding those values inside the code.
The command line arguments are handled using main() function arguments where argc refers to the number of arguments passed, and argv[] is a pointer array which points to each argument passed to the program. Following is a simple example which checks if there is any argument supplied from the command line and take action accordingly −
#include <stdio.h>
int main( int argc, char *argv[] ) {
   if( argc == 2 ) {
      printf("The argument supplied is %s\n", argv[1]);
   } else if( argc > 2 ) {
      printf("Too many arguments supplied.\n");
   } else {
      printf("One argument expected.\n");
   }
}
$./a.out testing
The argument supplied is testing
$./a.out testing1 testing2
Too many arguments supplied.
$./a.out
One argument expected
turtle.distance() function in Python - GeeksforGeeks

26 Nov, 2021
The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support.
This method is used to return the distance from the turtle to (x,y) in turtle step units. 
Syntax : turtle.distance(x, y=None)  
Parameters:
x: x coordinate of Vector 2DVec. 
y: y coordinate of Vector 2DVec.
This method can be called in different formats as given below :
distance(x, y) # two coordinates

distance((x, y)) # a pair (tuple) of coordinates

distance(vec) # e.g. as returned by pos()

distance(mypen) # where mypen is another turtle
Below is the implementation of the above method with some examples :
Example 1 :
Python3
# importing packageimport turtle # print the distance# before any motionprint(turtle.distance()) # forward turtle by 100turtle.forward(100) # print the distance# after a motionprint(turtle.distance())
Output :
0.0
100.0
Example 2 :
Python3
# importing packageimport turtle # print distance (default)print(turtle.distance()) for i in range(4):         # draw one quadrant    turtle.circle(50,90)         # print distance    print(turtle.distance())
Output :
0.0
70.7106781187
100.0
70.7106781187
1.41063873243e-14 
Example 3: 
Python3
# importing packageimport turtle # print distance with arguments# in different formatsprint(turtle.distance(3,4))print(turtle.distance((3,4)))print(turtle.distance((30.0,40.0)))
Output :
5.0
5.0
50.0
sagar0719kumar
clintra
Python-turtle
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?
How to drop one or multiple columns in Pandas Dataframe
Python Classes and Objects
Python | Get unique values from a list
Python | os.path.join() method
Defaultdict in Python
Create a directory in Python
Python | Pandas dataframe.groupby()
Python - Change Datatype of Tuple Values - GeeksforGeeks

26 May, 2020
Sometimes, while working with set of records, we can have a problem in which we need to perform a data type change of values of tuples, which are in its 2nd position, i.e value position. This kind of problem can occur in all domains that include data manipulations. Let’s discuss certain ways in which this task can be performed.
Input : test_list = [(44, 5.6), (16, 10)]
Output : [(44, '5.6'), (16, '10')]

Input : test_list = [(44, 5.8)]
Output : [(44, '5.8')]

Method #1 : Using enumerate() + loopThis is brute force way in which this problem can be solved. In this, we reassign the tuple values, by changing required index of tuple to type cast using appropriate datatype conversion functions.
# Python3 code to demonstrate working of # Change Datatype of Tuple Values# Using enumerate() + loop  # initializing listtest_list = [(4, 5), (6, 7), (1, 4), (8, 10)]  # printing original listprint("The original list is : " + str(test_list))  # Change Datatype of Tuple Values# Using enumerate() + loop# converting to string using str()for idx, (x, y) in enumerate(test_list):    test_list[idx] = (x, str(y))  # printing result print("The converted records : " + str(test_list)) 
The original list is : [(4, 5), (6, 7), (1, 4), (8, 10)]
The converted records : [(4, '5'), (6, '7'), (1, '4'), (8, '10')]

 
Method #2 : Using list comprehensionThe above functionality can also be used to solve this problem. In this, we perform similar task as above method, just in one liner way using list comprehension.
# Python3 code to demonstrate working of # Change Datatype of Tuple Values# Using list comprehension  # initializing listtest_list = [(4, 5), (6, 7), (1, 4), (8, 10)]  # printing original listprint("The original list is : " + str(test_list))  # Change Datatype of Tuple Values# Using list comprehension# converting to string using str()res = [(x, str(y)) for x, y in test_list]  # printing result print("The converted records : " + str(res)) 
The original list is : [(4, 5), (6, 7), (1, 4), (8, 10)]
The converted records : [(4, '5'), (6, '7'), (1, '4'), (8, '10')]

Python list-programs
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?
Strings in Dart - GeeksforGeeks

10 Jun, 2021
A Dart string is a sequence of UTF-16 code units. With the same rule as that of Python, you can use either single or double quotes to create a string. The string starts with the datatype Var : 
var string = "I love GeeksforGeeks";
var string1 = 'GeeksforGeeks is a great platform for upgrading skills';
Both the strings above when running on a Dart editor will work perfectly.
You can put the value of an expression inside a string by using ${expression}. It will help the strings to concatenate very easily. If the expression is an identifier, you can skip the {}. 
Dart
void main () {var string = 'I do coding';var string1 = '$string on Geeks for Geeks';print (string1);}
 Output :
I do coding on Geeks for Geeks.
Dart also allows us to concatenate the string by + operator as well as we can just separate the two strings by Quotes. The concatenation also works over line breaks which is itself a very useful feature.
Dart
var string = 'Geeks''for''Geeks';var str = 'Coding is ';var str1 = 'Fun';print (string);print (str + str1);
Output :
GeeksforGeeks
Coding is Fun
We can also check whether two strings are equal by == operator. It compares every element of the first string with every element of the second string.
Dart
void main(){var str = 'Geeks';var str1 = 'Geeks';if (str == str1){print (True);}}
Output : 
True
Raw strings are useful when you want to define a String that has a lot of special characters. We can create a raw string by prefixing it with r . 
Dart
void main() {     var gfg = r'This is a raw string';  print(gfg);}
Output:
This is a raw string
almostsagar
Dart-String
strings
Dart
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Flutter - Custom Bottom Navigation Bar
ListView Class in Flutter
Flutter - Flexible Widget
Flutter - Stack Widget
Flutter - Dialogs
Android Studio Setup for Flutter Development
Flutter - Positioned Widget
Format Dates in Flutter
Flutter - Managing the MediaQuery Object
What is widgets in Flutter?
Get Bank details from IFSC Code Using Python - GeeksforGeeks

11 Oct, 2020
The Indian Financial System Code (IFSC) is an 11-digit alpha-numeric code used to uniquely classify bank branches within the National Electronic Fund Transfer (NEFT) network by the Central Bank.
In this article, we are going to write python scripts to get details of the Bank from the given IFSC code.
Module Used:
ifscapi: The IfscApi Module will help to collect the details of the bank. The IFSC API was designed to easily get the specifics of the BANK from the IFSC code.
Installation:
pip install ifscApi

Step-by-step Approach:
Import module.
Parse the IFSC code into getdata() function (object of FetchData).
Above step returns a dictionary approach along with timeto fetch the details.
Display bank details
Below is complete program of the above approach:
Python3
# Import required modulefrom ifscApi.getDetails import FetchData  # Assign IFSC codeifsc = 'KKBK0005652'  # Parse the ifsc codedata = FetchData().getdata(ifsc)  # Display detailsprint(data)
Output:
Note: The dbFilePath parameter of getdata() function can be overwritten with IFSC code Database which has a table named data and consists of three columns Ifsc, bank, address.
In this method, we are going to use Razorpay IFSC Toolkit to fetch IFSC code. 
Modules:
requests: This module allows you to send HTTP/1.1 requests extremely easily. The get() method of this module is used to get bank details from IFSC code.
Installation:
pip install requests

Below is working of Razorpay IFSC Toolkit to fetch bank details from IFSC code.
Step-by-step Approach:
Import module.
Pass URL and IFSC code into requests.get() function.
Fetch this JSON response.
And it returns bank details in a Dict data-type.
Below is complete program of the above approach:
Python3
# Import required modulesimport requests  # Assign IFSC code and URLIFSC_Code = 'KKBK0005652'URL = "https://ifsc.razorpay.com/"  # Use get() methoddata = requests.get(URL+IFSC_Code).json()  # Display bank detailsprint(data)
Output:
python-utility
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?
How to drop one or multiple columns in Pandas Dataframe
Python Classes and Objects
Python | Get unique values from a list
Python | os.path.join() method
Defaultdict in Python
Create a directory in Python
Python | Pandas dataframe.groupby()
C# | String.ToUpperInvariant Method - GeeksforGeeks

21 Jun, 2021
String.ToUpperInvariant Method is used to get a copy of this String object converted to uppercase using the casing rules of the invariant culture. Here “invariant culture” represents a culture that is culture-insensitive.Syntax: 
public string ToUpperInvariant ();
Return Value: The return type of this method is System.String. This method will return a string which is the uppercase equivalent of the current string.Below given are some examples to understand the implementation in a better way: Example 1: 
CSharp
// C# program to illustrate// ToUpperInvariant() methodusing System; public class GFG {     // Main method    static public void Main()    {         // variables        string strA = "WelCome tO GeeKSfOrGeeKs";        string strB;         // Convert strA into lowercase        // using ToLowerInvariant() method        strB = strA.ToUpperInvariant();         // Display string before ToUpperInvariant() method        Console.WriteLine("String before ToUpperInvariant:");        Console.WriteLine(strA);        Console.WriteLine();         // Display string after ToUpperInvariant() method        Console.WriteLine("String after ToUpperInvariant:");        Console.WriteLine(strB);    }}
String before ToUpperInvariant:
WelCome tO GeeKSfOrGeeKs

String after ToUpperInvariant:
WELCOME TO GEEKSFORGEEKS
 
Example 2: 
CSharp
// C# program to illustrate// ToUpperInvariant() Methodusing System; public class GFG {     // Main method    static public void Main()    {         // Calling function        Convert("GEeks");        Convert("geeks");        Convert("GEEKS");    }     static void Convert(String value)    {         // Display  strings        Console.WriteLine("string 1:  {0}", value);         // Convert sting into Uppercase        // using ToUpperInvariant() method        value = value.ToUpperInvariant();         // Display the Lowercase strings        Console.WriteLine("string 2:  {0}", value);    }}
string 1:  GEeks
string 2:  GEEKS
string 1:  geeks
string 2:  GEEKS
string 1:  GEEKS
string 2:  GEEKS
 
Note:  
The invariant culture represents a culture that is culture-insensitive. It is associated with the English language but not with a specific country or region.
ToUpperInvariant() method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to uppercase.
This method can’t be overloaded if you try to overload this method, it will give you compile time error.
Reference: https://docs.microsoft.com/en-us/dotnet/api/system.string.toupperinvariant?view=netframework-4.7.2 
akshaysingh98088
CSharp-method
CSharp-string
C#
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
C# | Delegates
C# | Abstract Classes
Extension Method in C#
C# | String.IndexOf( ) Method | Set - 1
C# | Replace() Method
Introduction to .NET Framework
C# | Data Types
C# | Arrays
HashSet in C# with Examples
Common Language Runtime (CLR) in C#
HTML | <video> src Attribute - GeeksforGeeks

28 Jun, 2019
The HTML <video> src Attribute is used to specify the URL of the video file. This attribute uses Ogg file on Firefox, Opera and Chrome browsers and MPEG4 file on Internet Explorer and Safari browsers. This attribute is new in HTML5.
Syntax:
<video src="URL">
Attribute Values: It contains a single value URL which specifies the link of source video. There are two types of URL link which are listed below:
Absolute URL: It points to another webpage.
Relative URL: It points to other files of the same web page.
Example:
<!DOCTYPE html><html>  <head>    <title>HTML video srcsrc Attribute</title></head>  <body>    <center>        <h1 style="color:green;">GeeksforGeeks</h1>          <h3>HTML video src Attribute</h3>          <video width="400" height="200" controls src="https://media.geeksforgeeks.org/wp-content/uploads/20190616234019/Canvas.move_.mp4">         Browser not supported        </video>    </center></body>  </html>
Output:
Note: Always specify the width and the height of the video else web page will be confused that how much space that video will be required due to that reason web page become slow down.
Supported Browsers: The browser supported by HTML <video> src Attribute are listed below:
Google Chrome 4.0
Internet Explorer 9.0
Firefox 3.5
Safari 4.0
Opera 10.5
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.
REST API (Introduction)
HTML Cheat Sheet - A Basic Guide to HTML
Design a web page using HTML and CSS
Form validation using jQuery
Angular File Upload
Remove elements from a JavaScript Array
Installation of Node.js on Linux
Convert a string to an integer in JavaScript
How to fetch data from an API in ReactJS ?
Difference between var, let and const keywords in JavaScript
Getting square root of a number in Julia - sqrt() and isqrt() Methods - GeeksforGeeks

26 Mar, 2020
The sqrt() is an inbuilt function in julia which is used to return the square root of the specified number and throws DomainError for negative Real parameter. It also accept complex negative parameter.
Syntax: sqrt(x)
Parameters:
x: Specified values.
Returns: It returns the square root of the specified number and throws DomainError for negative Real parameter. It also accept complex negative parameter.
Example:
# Julia program to illustrate # the use of sqrt() method  # Getting the square root of the # specified number and throws DomainError# for negative Real parameterprintln(sqrt(9))println(sqrt(16))println(sqrt(complex(-25)))println(sqrt(-49))
Output:
3.0
4.0
0.0 + 5.0im
ERROR: LoadError: DomainError:
sqrt will only return a complex result if called with a complex argument. Try sqrt(complex(x)).
Stacktrace:
 [1] sqrt(::Int64) at ./math.jl:434
while loading /home/cg/root/9093667/main.jl, in expression starting on line 10

The isqrt() is an inbuilt function in julia which is used to return integer square root of the specified value. The largest returned integer value m(say) such that 
Syntax:isqrt(n::Integer)
Parameters:
n::Integer: Specified values.
Returns: It returns integer square root of the specified value.
Example:
# Julia program to illustrate # the use of isqrt() method  # Getting integer square root of the specified value.println(isqrt(12))println(isqrt(17))println(isqrt(5))println(isqrt(227))
Output:
3
4
2
15

Julia
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Decision Making in Julia (if, if-else, Nested-if, if-elseif-else ladder)
Get array dimensions and size of a dimension in Julia - size() Method
Exception handling in Julia
Searching in Array for a given element in Julia
Find maximum element along with its index in Julia - findmax() Method
Get number of elements of array in Julia - length() Method
Join an array of strings into a single string in Julia - join() Method
File Handling in Julia
Working with Excel Files in Julia
Getting last element of an array in Julia - last() Method
Python | Interconversion between Dictionary and Bytes

19 Jul, 2019
Interconversion between data is quite popular and this particular article discusses about how interconversion of dictionary into bytes and vice versa can be obtained. Let’s look at the method that can help us achieve this particular task.
Method : Using encode() + dumps() + decode() + loads()The encode and dumps function together performs the task of converting the dictionary to string and then to corresponding byte value. This can be interconverted using the decode and loads function which returns the string from bytes and converts that to the dictionary again.
# Python3 code to demonstrate working of# Interconversion between Dictionary and Bytes# Using encode() + dumps() + decode() + loads()import json  # initializing dictionarytest_dict = {'Gfg' : 1, 'is' : 2, 'best' : 3}  # printing original dictionaryprint("The original dictionary is : " + str(test_dict))  # using encode() + dumps() to convert to bytesres_bytes = json.dumps(test_dict).encode('utf-8')  # printing type and binary dict print("The type after conversion to bytes is : " + str(type(res_bytes)))print("The value after conversion to bytes is : " + str(res_bytes))  # using decode() + loads() to convert to dictionaryres_dict = json.loads(res_bytes.decode('utf-8'))  # printing type and dict print("The type after conversion to dict is : " + str(type(res_dict)))print("The value after conversion to dict is : " + str(res_dict))
The original dictionary is : {'Gfg': 1, 'best': 3, 'is': 2}
The type after conversion to bytes is : <class 'bytes'>
The value after conversion to bytes is : b'{"Gfg": 1, "best": 3, "is": 2}'
The type after conversion to dict is : <class 'dict'>
The value after conversion to dict is : {'Gfg': 1, 'best': 3, 'is': 2}

Python dictionary-programs
Python
Python Programs
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
Read a file line by line in Python
Python String | replace()
Python program to convert a list to string
Defaultdict in Python
Python | Get dictionary keys as a list
Python | Convert a list to dictionary
Python Program for Fibonacci numbers
Python Numerize Library

07 Feb, 2022
Numerize is that library of python which is used to show large numbers into its readable format. It basically converts numerical format into the compact short format. There is no need to show how many zeroes are behind the number. It itself checks the numeric digits behind the coefficient and then provides output in the compact short form accordingly. 
It enhances the understanding as there is no need to write a number of zeroes behind the number coefficient(also called as trailing zeroes).Examples:  
1 -> 1
10 -> 10
100 -> 100
1000 -> 1k
1500 -> 1.5k
1000000 -> 1M
1000000000 -> 1B
1000000000000 -> 1T
Note:  
Here k represents thousand (i.e. coefficient will have 3 trailing digits ), M represents Million (i.e. coefficient will have 6 trailing digits), B represents Billion (i.e. coefficient will have 9 trailing digits)and T represents Trillion (i.e. coefficient will have 12 trailing digits).  
It will convert numerical numbers only up to 100T.  
 
To install this module type the below command in the terminal. 
pip install numerize 
Example 1:  
Python3
from numerize import numerize a = numerize.numerize(100)print(a) a = numerize.numerize(1000)print(a) a = numerize.numerize(1500)print(a) a = numerize.numerize(1000000)print(a) a = numerize.numerize(1123456)print(a) a = numerize.numerize(10000000000)print(a)
Output:  
100
1k
1.5k
1M
1.12M
10B
Example 2:  
Python3
from numerize import numerize  # Here we can also get number upto# any decimal placea = numerize.numerize(1234567.12, 2)print(a) a = numerize.numerize(1247854, 4)print(a) a = numerize.numerize(12134.123, 3)print(a)
Output: 
1.23M
1.2479M
12.134K
 
varshagumber28
python-modules
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Java variables and data types

A variable provides us with named storage that our programs can manipulate. You must declare all variables before they can be used. Following is the basic form of a variable declaration -
data type variable [ = value][, variable [ = value] ...] ;
data type is one of Java's data types and the variable is the name of the variable. To declare more than the one variable of the specified type, you can use a comma-separated list.
Following are valid examples of variable declaration and initialization in Java -
int a, b, c;         // Declares three ints, a, b, and c.
int a = 10, b = 10;  // Example of initialization
byte B = 22;         // initializes a byte type variable B.
double pi = 3.14159; // declares and assigns a value of PI.
char a = 'a';        // the char variable a iis initialized with value 'a'
There are three kinds of variables in Java -
Local variables - Local variables are declared in methods, constructors, or blocks.
Instance variables - Instance variables are declared in a class, but outside a method, constructor or any block.
Class/Static variables - Class variables also known as static variables are declared with the static keyword in a class, but outside a method, constructor or a block.
Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in the memory.
Based on the data type of a variable, the operating system allocates memory and decides what can be stored in the reserved memory. Therefore, by assigning different data types to variables, you can store integers, decimals, or characters in these variables.
There are two data types available in Java -
Primitive Data Types - There are eight primitive data types supported by Java. Primitive data types are predefined by the language and named by a keyword.
Reference/Object Data Types - Reference variables are created using defined constructors of the classes. They are used to access objects. These variables are declared to be of a specific type that cannot be changed. For example, Employee, Puppy, etc.
time.Time.Zone() Function in Golang with Examples

21 Apr, 2020
In Go language, time packages supplies functionality for determining as well as viewing time. The Time.Zone() function in Go language is used to determine the time zone that is in work at time “t”. Moreover, this function is defined under the time package. Here, you need to import the “time” package in order to use these functions.
Syntax:
func (t Time) Zone() (name string, offset int)

Here, “t” is the stated time, “name” returned is of type string, and “offset” returned is of type int.
Return value: It returns the shortened zone name and its offset which is in seconds east of UTC.
Example 1:
// Golang program to illustrate the usage of// Time.Zone() function  // Including main packagepackage main  // Importing fmt and timeimport "fmt"import "time"  // Calling mainfunc main() {      // Defining location using FixedZone method    loc := time.FixedZone("UTC-7", 1*13*16)      // Declaring t for Zone method    t := time.Date(2014, 6, 5, 11, 56, 45, 05, loc)      // Calling Zone() method    zone_name, offset := t.Zone()      // Prints zone name    fmt.Printf("The zone name is: %s\n", zone_name)      // Prints offset    fmt.Printf("The offset returned is: %d\n", offset)}
Output:
The zone name is: UTC-7
The offset returned is: 208

Here, we have used FixedZone() method in order to specify zone name and offset.
Example 2:
// Golang program to illustrate the usage of// Time.Zone() function  // Including main packagepackage main  // Importing fmt and timeimport "fmt"import "time"  // Calling mainfunc main() {      // Defining location using FixedZone method    loc := time.FixedZone("UTC-6", -4*23*16)      // Declaring t for Zone method    t := time.Date(2014, 32, 35, 64, 76, 98, 3432, loc)      // Calling Zone() method    zone_name, offset := t.Zone()      // Prints zone name    fmt.Printf("The zone name is: %s\n", zone_name)      // Prints offset    fmt.Printf("The offset returned is: %d\n", offset)}
Output:
The zone name is: UTC-6
The offset returned is: -1472

Here, the “t” stated above has values that are out of usual range but they are normalized while conversion.
GoLang-time
Go Language
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
strings.Replace() Function in Golang With Examples
fmt.Sprintf() Function in Golang With Examples
Arrays in Go
Golang Maps
How to Split a String in Golang?
Interfaces in Golang
Slices in Golang
Different Ways to Find the Type of Variable in Golang
How to Parse JSON in Golang?
How to convert a string in lower case in Golang?
HSQLDB - Regular Expressions

HSQLDB supports some special symbols for pattern matching operation based on regular expressions and the REGEXP operator.
Following is the table of pattern, which can be used along with REGEXP operator.
Let us try different example queries to meet our requirements. Take a look at the following given queries.
Try this Query to find all the authors whose name starts with '^A'.
SELECT author FROM tcount_tbl WHERE REGEXP_MATCHES(author,'^A.*');

After execution of the above query, you will receive the following output.
+-----------------+
|     author      |
+-----------------+
|     Abdul S     |
|    Ajith kumar  |
+-----------------+

Try this Query to find all the authors whose name ends with 'ul$'.
SELECT author FROM tcount_tbl WHERE REGEXP_MATCHES(author,'.*ul$');

After execution of the above query, you will receive the following output.
+-----------------+
|     author      |
+-----------------+
|    John Poul    |
+-----------------+

Try this Query to find all the authors whose name contains 'th'.
SELECT author FROM tcount_tbl WHERE REGEXP_MATCHES(author,'.*th.*');

After execution of the above query, you will receive the following output.
+-----------------+
|     author      |
+-----------------+
|    Ajith kumar  | 
|     Abdul S     |
+-----------------+

Try this query to find all the authors whose name starts with vowel (a, e, i, o, u).
SELECT author FROM tcount_tbl WHERE REGEXP_MATCHES(author,'^[AEIOU].*');

After execution of the above query, you will receive the following output.
+-----------------+
|     author      |
+-----------------+
|     Abdul S     |
|    Ajith kumar  |
+-----------------+

 Print
 Add Notes
 Bookmark this page