code-rag-bench/online-tutorials huggingface dataset:
SVG - Polyline

<polyline>  element is used to draw a connected straight lines.
Following is the syntax declaration of <polyline> element. We've shown main attributes only.
<polyline
   points="list of points" >  
</polyline>
<html>
   <title>SVG Polyline</title>
   <body>
      
      <h1>Sample SVG Polyline Image</h1>
      
      <svg width="800" height="800">
         <g>
            <text x="0" y="15" fill="black" >Polyline #1: Without opacity.</text>
            
            <polyline points="150,75 258,137.5 258,262.5 150,325 42,262.6 42,137.5"
            stroke="black" stroke-width="3" fill="none"></polyline>
         </g>
      </svg>
   
   </body>
</html>
Open textSVG.htm in Chrome web browser. You can use Chrome/Firefox/Opera to view SVG image directly without any plugin. Internet Explorer 9  and higher also supports SVG image rendering.
<html>
   <title>SVG Polyline</title>
   <body>
      
      <h1>Sample SVG Polyline Image</h1>
      
      <svg width="800" height="800">
         <g>
            <text x="0" y="15" fill="black" >Polyline #2: With opacity </text>
            
            <polyline points="150,75 258,137.5 258,262.5 150,325 42,262.6 42,137.5"
            style="fill:none;stroke-width:3;
            stroke:rgb(0,0,0);stroke-opacity:0.5;"></polyline>
         </g>
      </svg>
   
   </body>
</html>
Open textSVG.htm in Chrome web browser. You can use Chrome/Firefox/Opera to view SVG image directly without any plugin. Internet Explorer 9 and higher also supports SVG image rendering.

    45 Lectures 
     5.5 hours 

 DigiFisk (Programming Is Fun)
 Print
 Add Notes
 Bookmark this page
Convolutions using Python?

Image recognition used to be done using much simpler methods such as linear regression and comparison of similarities. The results were obviously not very good, even the simple task of recognizing hand-written alphabets proved difficult. Convolution neural networks (CNNs) are supposed to be a step up from what we traditionally do by offering a computationally cheap method of loosely simulating the neural activities of a human brain when it perceives images.
Very similar to how we recognise different objects, computer algorithms need to go through millions of images before it is able to generalize the input and make judgement on image it has never seen before.
Computers see every image as 2D arrays of numbers, known as pixels. To identify objects in images, computer use special kind of Artificial Neural Network: a Convolutional Neural Network (CNN). CNN comes from, one of the most important operations in the network: convolution.
In convolutional neural network, each layers are organised into width, height and depth. Convolution which is the main part of CNNs, combine two functions to create a third function(merge two sets of information). It means consider an (image) convolution where we simply multiply two matrices element-wise followed by a sum.
A convolution is a three step procedure in image processing −
We take the input image.
We take the input image.
Kernel matrix that we are going to apply to the input image.
Kernel matrix that we are going to apply to the input image.
And the final image to store the output of the input image convolved with the kernel.
And the final image to store the output of the input image convolved with the kernel.
Below is small implementation of sobel filter using opencv which is an image processing filter for edge detection.
import cv2
import numpy as np

img = cv2.imread('beach.jpg')
img = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY).astype(float)

edge_x = cv2.Sobel(img,cv2.CV_64F,1,0,ksize = 3)
edge_y = cv2.Sobel(img,cv2.CV_64F,0,1,ksize = 3)
edge = np.sqrt(edge_x ** 2 + edge_y ** 2)

# image can be normalized to
# fit into 0..255 color space
cv2.imwrite('beach_convol.jpg', edge)
Create a Plot Matrix of Scatterplots in R Programming - pairs() Function - GeeksforGeeks

10 Dec, 2021
pairs() function in R language is used to return a plot matrix, consisting of scatter plots corresponding to each data frame.
Syntax: pairs(data)
Parameters: 
data: It is defined as  value of pairs Plot.
Returns: Color, Labels, Panels, and by Group in pairs plot.  
R
# Set seed for reproducibilityset.seed(425340) # Sample size of 800N <- 800 # Create variablex1 <- rnorm(N) # Create correlated variablex2 <- x1 + rnorm(N, 0, 4) # Create another correlated variablex3 <- 2 * x1 - x2 + rnorm(N, 0, 3)    data <- data.frame(x1, x2, x3)   pairs(data)           
Output: 
Here, in the above example, the diagonal shows the names of the three numeric variables. The middle graphic in the first-row shows the relation between x1 and x2 whereas the right graph in the first row shows the relation between x1 and x3 and so on.
R
# Set seed for reproducibilityset.seed(425340) # Sample size of 800N <- 800    # Create variablex1 <- rnorm(N) # Create correlated variablex2 <- x1 + rnorm(N, 0, 4)            # Create another correlated variablex3 <- 2 * x1 - x2 + rnorm(N, 0, 3)    data <- data.frame(x1, x2, x3)    pairs(~ x1 + x3, data = data)   
Output:
R
# Set seed for reproducibilityset.seed(425340) # Sample size of 800N <- 800 # Create variablex1 <- rnorm(N) # Create correlated variablex2 <- x1 + rnorm(N, 0, 4) # Create another correlated variablex3 <- 2 * x1 - x2 + rnorm(N, 0, 3)    data <- data.frame(x1, x2, x3)    pairs(~ x1 + x2 + x3, data = data)pairs(~ x1 + x3, data = data)   pairs(data[, 1:3],    col = "darkgreen", # Change color                       pch = 18,             # Change shape of points             # Change labels of diagonal    labels = c("var1", "var2", "var3"),    main = " pairs plot in R")
Output:
kumar_satyam
R Plot-Function
R Language
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Change Color of Bars in Barchart using ggplot2 in R
How to Change Axis Scales in R Plots?
Group by function in R using Dplyr
How to Split Column Into Multiple Columns in R DataFrame?
How to filter R DataFrame by values in a column?
How to import an Excel File into R ?
How to filter R dataframe by multiple conditions?
Replace Specific Characters in String in R
Time Series Analysis in R
R - if statement
How to handle alert prompts in Selenium Python ? - GeeksforGeeks

15 May, 2020
Selenium’s Python Module is built to perform automated testing with Python. Alerts are a way to show popups in the browser for either accepting data or displaying data. Selenium provides methods to handle alerts of all kinds. class selenium.webdriver.common.alert.Alert(driver) handles all alerts in Selenium Python. It contains methods for dismissing, accepting, inputting, and getting text from alert prompts. The two major tasks in alerts are accepting an alert or dismissing a alert.Selenium provides two methods for the same –
Alert(driver).accept()
Alert(driver).dismiss()
The major methods during handling of alerts in Selenium include –
accept() – Accepts the alert available.
dismiss() – Dismisses the alert available.
send_keys(keysToSend) – Send Keys to the Alert.
text – Gets the text of the Alert.
To illustrate alerts, let’s write manual javascript alert and check various methods on the same. We have created an example link – https://ide.geeksforgeeks.org/tryit.php/WXYeMD9tD4
# import webdriverfrom selenium import webdriver  # import Alert from selenium.webdriver.common.alert import Alert  # create webdriver objectdriver = webdriver.Firefox()  # get ide.geeksforgeeks.orgdriver.get("https://ide.geeksforgeeks.org / tryit.php / WXYeMD9tD4")  # create alert objectalert = Alert(driver)  # get alert textprint(alert.text)  # accept the alertalert.accept()
Output –
Terminal Output –
Python-selenium
selenium
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python Dictionary
Read a file line by line in Python
How to Install PIP on Windows ?
Enumerate() in Python
Different ways to create Pandas Dataframe
Iterate over a list in Python
Python String | replace()
*args and **kwargs in Python
Reading and Writing to text files in Python
Create a Pandas DataFrame from Lists
Tryit Editor v3.6 - Show Node.js

var http = require('http');
​
//create a server object:
http.createServer(function (req, res) {
  res.write('Hello World!'); //write a response to the client
  res.end(); //end the response
}).listen(8080); //the server object listens on port 8080
How to add key/value pair to a JavaScript object? - GeeksforGeeks

22 Apr, 2019
In order to add key/value pair to a JavaScript object, Either we use dot notation or square bracket notation. Both methods are widely accepted.
Example 1: This example adds {“nextFavColor” : “red”} to the GFG_p object by using dot notation.
<!DOCTYPE html> <html>   <head>     <title>         JavaScript | Add a key/value        pair to JavaScript object     </title> </head>       <body style = "text-align:center;">     <h1 style = "color:green;" >         GeeksForGeeks     </h1>               <p id="GFG_up" style="color:red;"></p>              <button onclick = "Geeks()">         Click to add     </button>               <p id="GFG_down" style="color:green;"></p>              <script>         var GFG_p = {fName:"Geeks", lName:"forGeeks",                    age:100, favColor:"green"};        var p_up = document.getElementById("GFG_up");         var p_down = document.getElementById("GFG_down");        p_up.innerHTML = JSON.stringify(GFG_p);                  function Geeks() {            GFG_p.nextFavColor = "Red";            p_down.innerHTML = JSON.stringify(GFG_p);             }     </script> </body>   </html>                    
Output:
Before clicking on the button:
After clicking on the button:
Example 2: This example adds {“thirdFavColor” : “blue”} to the GFG_p object by using square bracket notation.
<!DOCTYPE html> <html>   <head>     <title>         JavaScript | Add a key/value        pair to JavaScript object     </title> </head>       <body style = "text-align:center;">     <h1 style = "color:green;" >         GeeksForGeeks     </h1>               <p id="GFG_up" style="color:blue;"></p>              <button onclick = "Geeks()">         Click to add     </button>               <p id="GFG_down" style="color:green;"></p>              <script>         var GFG_p = {fName:"Geeks", lName:"forGeeks",                     age:100, favColor:"green"};        var p_up = document.getElementById("GFG_up");         var p_down = document.getElementById("GFG_down");        p_up.innerHTML = JSON.stringify(GFG_p);                  function Geeks() {            GFG_p["thirdFavColor"] = "blue";            p_down.innerHTML = JSON.stringify(GFG_p);             }     </script> </body>   </html>                    
Output:
Before clicking on the button:
After clicking on the button:
javascript-object
JavaScript
Web Technologies
Web technologies Questions
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Difference between var, let and const keywords in JavaScript
Convert a string to an integer in JavaScript
Differences between Functional Components and Class Components in React
How to append HTML code to a div using JavaScript ?
How to Open URL in New Tab using JavaScript ?
Top 10 Front End Developer Skills That You Need in 2022
Installation of Node.js on Linux
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to fetch data from an API in ReactJS ?
How to insert spaces/tabs in text using HTML/CSS?
What is CLR (1) Parser?

CLR defines canonical lookahead. CLR parsing use the canonical collection of LR (1) items to construct the CLR (1) parsing table. CLR (1) parsing table makes the more number of states as compare to the SLR (1) parsing. In the CLR (1), it can locate the reduce node only in the lookahead symbols.
Working of CLR Parser
Construction of LR (1) collection of items for Grammar
It requires three things
Augmented Grammar
Closure Function
goto Function
Augmented Grammar  It is a new Grammar G′ which contains a new production
S′ → S with all other productions of given grammar G.
Closure
procedure closure (I)
begin
Repeat
for each item A → α ∙ B β, a in I,
   each production B → γ and
      each terminal b ∈ FIRST (β a)
If B → ∙ γ is not in I
Add B → ∙ γ, b to I
Until no more elements can be joined to I;
end
goto(I, X): If there is a production A → α ∙ X β, a in I then goto(I, X) is the closure
of the set of items of A → α X ∙ β, a.
Algorithm for Construction of LR (1) Set of Items
begin
C = {closure(S′→∙S,$)}
Repeat
for each set of items I in C and each grammar symbol X (terminal or non-terminal)
   Add goto(I, X) to C
Until no more sets of elements can be added to C.
end.
Construction of Canonical LR Parsing Table Algorithm
Input − An Augmented Grammar G.′
Output − CLR Parsing Table
Method
Initially construct set of items C = {I0, I1, I2 ... ... In} where C is a collection of LR (1)
items for G.
Initially construct set of items C = {I0, I1, I2 ... ... In} where C is a collection of LR (1)
items for G.
Parsing actions are based on each item or state I1.
Parsing actions are based on each item or state I1.
Various Actions are −
If A → α ∙ a β is in Ii and goto (Ii, a) = Ij then create an entry in Action table Action [i, a] = shift j".
If A → α ∙, a is in Ii then set in Action table Action [i, a] to reduce A→α. " Here, A should not be S′.
If S′ → S ∙ is in Ii then Action [i, $] = accept".
The goto part of the SLR table can be filled as −
If goto (Ii, A) = Ij then goto [i, A] = j
If goto (Ii, A) = Ij then goto [i, A] = j
All entries not defined by rules 2 and 3 are considered to be "error. "
How can SciPy be used to calculate the eigen values and eigen vectors of a matrix in Python?

Eigen vectors and Eigen values find their uses in many situations. The word ‘Eigen’ in German means ‘own’ or ‘typical’. An Eigen vector is also known as a ‘characteristic vector’. Suppose we need to perform some transformation on a dataset but the given condition is that the direction of data in the dataset shouldn’t change. This is when Eigen vectors and Eigen values can be used.
Given a square matrix (a matrix where the number of rows is equal to the number of columns), an Eigen value and an Eigen vector fulfil the below equation.
Eigen vectors are computed after finding the Eigen values.
Note − Eigen values work well with dimensions 3 or greater as well.
Instead of manually perfroming these mathematical computations, SciPy provides a function in the library called ‘eig’ which helps compute the Eigenvalue and the Eigenvector.
Syntax of ‘eig’ function
scipy.linalg.eig(matrix)
Let us see how the ‘eig’ function can be used −
 Live Demo
from scipy import linalg
import numpy as np
my_arr = np.array([[5,7],[11,3]])
eg_val, eg_vect = linalg.eig(my_arr)
print("The Eigenvalues are :")
print(eg_val)
print("The Eigenvectors are :")
print(eg_vect)
The Eigenvalues are :
[12.83176087+0.j -4.83176087+0.j]
The Eigenvectors are :
[[ 0.66640536 -0.57999285]
[ 0.74558963 0.81462157]]
The required libraries are imported.
A matrix is defined with certain values in it, using the Numpy library.
The matrix is passed as a parameter to the ‘eig’ function that computes the eigenvalues and the eigenvectors of the matrix.
These computed data is stored in two different variables.
This output is displayed on the console.
CSS Background Shorthand

To shorten the code, it is also possible to specify all the background properties in one 
single property. This is called a shorthand property.
Instead of writing:
You can use the shorthand property background:
Use the shorthand property to set the background properties in one 
  declaration:

When using the shorthand property the order of the property values is:
background-color
background-image
background-repeat
background-attachment
background-position
It does not matter if one of the property values is missing, as long as the 
other ones are in this order. Note that we do not use the background-attachment property in the examples above, as it does not have a value.
Set the background color of the <h1> element to "lightblue".
<style>
h1 {
  : lightblue;
}
</style>

<body>
  <h1>This is a heading</h1>
  <p>This is a paragraph</p>
  <p>This is a paragraph</p>
</body>

Start the Exercise
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.
C# | How to change the Input Encoding Scheme of the Console - GeeksforGeeks

28 Jan, 2019
Given the normal Console in C#, the task is to change the Input Encoding Scheme of the Console.
Approach: This can be done using the InputEncoding property in the Console class of the System package in C#. Console.InputEncoding Property gets or sets the encoding the console uses to read input.
Program 1: Getting the value of Input Encoding Scheme
// C# program to illustrate the// Console.InputEncoding Propertyusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;  namespace GFG {  class Program {      static void Main(string[] args)    {          // Get the Input Encoding Scheme        Console.WriteLine("Current Input Encoding Scheme: {0}",                                       Console.InputEncoding);    }}}
Output:
Program 2: Setting the value of Input Encoding Scheme
// C# program to illustrate the// Console.InputEncoding Propertyusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;  namespace GFG {  class Program {      static void Main(string[] args)    {          // Get the Input Encoding Scheme        Console.WriteLine("Current Input Encoding Scheme: {0}",                                       Console.InputEncoding);          // Set the Input Encoding Scheme to ASCII        Console.InputEncoding = Encoding.ASCII;          // Get the Input Encoding Scheme        Console.WriteLine("Current Input Encoding Scheme: {0}",                                        Console.InputEncoding);    }}}
Output:
CSharp-Console-Class
C#
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Extension Method in C#
Partial Classes in C#
Top 50 C# Interview Questions & Answers
HashSet in C# with Examples
Lambda Expressions in C#
C# | Inheritance
C# | .NET Framework (Basic Architecture and Component Stack)
Hello World in C#
Top 50 ASP.NET Interview Questions and Answers
C# | List Class
MySQL query to select top 10 records?

To select top 10 records, use LIMIT in MySQL. Let us first create a table −
mysql> create table DemoTable
-> (
-> PageNumber text
-> );
Query OK, 0 rows affected (2.50 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('Page-1');
Query OK, 1 row affected (0.46 sec)

mysql> insert into DemoTable values('Page-2');
Query OK, 1 row affected (0.11 sec)

mysql> insert into DemoTable values('Page-3');
Query OK, 1 row affected (0.27 sec)

mysql> insert into DemoTable values('Page-4');
Query OK, 1 row affected (0.19 sec)

mysql> insert into DemoTable values('Page-5');
Query OK, 1 row affected (0.27 sec)

mysql> insert into DemoTable values('Page-6');
Query OK, 1 row affected (1.12 sec)

mysql> insert into DemoTable values('Page-7');
Query OK, 1 row affected (1.21 sec)

mysql> insert into DemoTable values('Page-8');
Query OK, 1 row affected (1.15 sec)

mysql> insert into DemoTable values('Page-9');
Query OK, 1 row affected (0.89 sec)

mysql> insert into DemoTable values('Page-10');
Query OK, 1 row affected (1.20 sec)

mysql> insert into DemoTable values('Page-11');
Query OK, 1 row affected (0.86 sec)

mysql> insert into DemoTable values('Page-12');
Query OK, 1 row affected (0.39 sec)

mysql> insert into DemoTable values('Page-13');
Query OK, 1 row affected (0.39 sec)

mysql> insert into DemoTable values('Page-14');
Query OK, 1 row affected (0.47 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
This will produce the following output −
+------------+
| PageNumber |
+------------+
| Page-1     |
| Page-2     |
| Page-3     |
| Page-4     |
| Page-5     |
| Page-6     |
| Page-7     |
| Page-8     |
| Page-9     |
| Page-10    |
| Page-11    |
| Page-12    |
| Page-13    |
| Page-14    |
+------------+
14 rows in set (0.00 sec)
Following is the query to select top 10 records −
mysql> select *from DemoTable limit 0,10;
This will produce the following output −
+------------+
| PageNumber |
+------------+
| Page-1     |
| Page-2     |
| Page-3     |
| Page-4     |
| Page-5     |
| Page-6     |
| Page-7     |
| Page-8     |
| Page-9     |
| Page-10    |
+------------+
10 rows in set (0.00 sec)
Are Python Exceptions runtime errors?

All python exceptions are not runtime errors, some are syntax errors as well.
If you run the given code, you get the following output.
File "C:/Users/TutorialsPoint1/~.py", line 4
else:
^
SyntaxError: invalid syntax
We see that it is syntax error and not a runtime error.
Errors or inaccuracies in a program are often called as bugs. The process of finding and removing errors is called debugging. Errors can be categorized into three major groups:
Syntax errors 2. Runtime errors and 3. Logical errors
Syntax errors 2. Runtime errors and 3. Logical errors
Syntax errors
Python will find these kinds of errors when it tries to parse your program, and exit with an error message without running anything. Syntax errors are like spelling or grammar mistakes in a language like English.
Runtime errors
If a program is free of syntax errors, it will be run by the Python interpreter. However, the program may exit if it encounters a runtime error – a problem that went undetected when the program was parsed, but is only revealed when the code is executed.
Some examples of Python Runtime errors −
 
division by zero
performing an operation on incompatible types
using an identifier which has not been defined
accessing a list element, dictionary value or object attribute which doesn’t exist
trying to access a file which doesn’t exist
C# For Loop

When you know exactly how many times you want to loop through a block of 
code, use the for loop instead of a while loop:
for (statement 1; statement 2; statement 3) 
{
  // code block to be executed
}

Statement 1 is executed (one time) before the execution of the code block.
Statement 2 defines the condition for executing the code block.
Statement 3 is executed (every time) after the code block has been executed.
The example below will print the numbers 0 to 4:
for (int i = 0; i < 5; i++) 
{
  Console.WriteLine(i);
}


Try it Yourself »

Statement 1 sets a variable before the loop starts (int i = 0).
Statement 2 defines the condition for the loop to run (i must be less than 
5). If the condition is true, the loop will start over again, if it is false, 
the loop will end.
Statement 3 increases a value (i++) each time the code block in the loop has 
been executed.
This example will only print even values between 0 and 10:
for (int i = 0; i <= 10; i = i + 2) 
{
  Console.WriteLine(i);
}


Try it Yourself »

There is also a foreach loop, which is used exclusively to loop through elements in an array:
foreach (type variableName in arrayName) 
{
  // code block to be executed
}

The following example outputs all elements in the cars 
array, using a foreach loop:
string[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
foreach (string i in cars) 
{
  Console.WriteLine(i);
}


Try it Yourself »

Note: Don't worry if you don't understand the example above. You will learn more about Arrays in the C# Arrays chapter.
Use a for loop to print "Yes" 5 times:
 (int i = 0; i < 5; ) 
{
  Console.WriteLine("Yes");
}

Start the Exercise
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.
How to create 2-ValueTuple in C#? - GeeksforGeeks

23 Jul, 2019
In C#, a pair or 2 value tuple is a value type tuple which holds two elements in it. You can create a pair of value tuple using two different ways:
Using ValueTuple <T1, T2>(T1, T2) ConstructorUsing Create <T1, T2>(T1, T2) Method
Using ValueTuple <T1, T2>(T1, T2) Constructor
Using Create <T1, T2>(T1, T2) Method
You can create a pair value tuple by using ValueTuple <T1, T2>(T1, T2) constructor. It initializes a new instance of the ValueTuple <T1, T2> struct. But when you create a value tuple using this constructor, then you have to specify the type of the element stored in the value tuple.
Syntax:
public ValueTuple (T1 item1, T2 item2);
Parameters:
item1: It is the value of the first value tuple component.
item2: It is the value of the second value tuple component.
Example:
// C# program to create a pair ValueTuple// using value tuple constructorusing System;  class GFG {      // Main method    static public void Main()    {          // Creating a value tuple with two elements        // Using ValueTuple<T1, T2>(T1, T2) constructor        ValueTuple<string, string> MyTpl = new ValueTuple<string,                                          string>("Geeks", "GFG");          Console.WriteLine("Component 1: " + MyTpl.Item1);        Console.WriteLine("Component 2: " + MyTpl.Item2);    }}
Component 1: Geeks
Component 2: GFG

You can also create a pair value tuple with the help of Create <T1, T2>(T1, T2) method. When you use this method, then there is no need to specify the type of the elements stored in the value tuple.
Syntax:
public static ValueTuple<T1, T2> Create<T1, T2> (T1 item1, T2 item2);
Type Parameters:
T1: It is the type of the value tuple’s first component.
T2: It is the type of the value tuple’s second component.
Parameters:
item1: It is the value of the value tuple’s first component.
item2: It is the value of the value tuple’s second component.
Returns: This method returns a value tuple with two elements.
Example:
// C# program to create a pair value tuple// using Create<T1, T2>(T1, T2) methodusing System;  public class GFG {      // Main method    static public void Main()    {          // Creating a value tuple with two elements        // Using Create<T1, T2>(T1, T2) method        var MyTple = ValueTuple.Create("Geeks123", "gfg");          Console.WriteLine("Component 1: " + MyTple.Item1);        Console.WriteLine("Component 2: " + MyTple.Item2);    }}
Component 1: Geeks123
Component 2: gfg

Reference:
https://docs.microsoft.com/en-us/dotnet/api/system.valuetuple-2.-ctor?view=netframework-4.8
https://docs.microsoft.com/en-us/dotnet/api/system.valuetuple.create?view=netframework-4.8#System_ValueTuple_Create__2___0___1_
CSharp-ValueTuple
C#
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
C# Dictionary with examples
C# | Method Overriding
C# | Class and Object
C# | String.IndexOf( ) Method | Set - 1
Extension Method in C#
C# | Constructors
C# | Delegates
Introduction to .NET Framework
Difference between Ref and Out keywords in C#
C# | Data Types
Euler Totient | Practice | GeeksforGeeks

Consider Ø(n) as the Euler Totient Function for n. You will be given a positive integer N and you have to find the smallest positive integer n, n <= N for which the ratio n/Ø(n) is maximized.
 
Example 1:
Input:
N = 6
Output:
6
Explanation:
For n = 1, 2, 3, 4, 5 and 6 the values of
the ratio are 1, 2, 1.5, 2, 1.25 and 3
respectively. The maximum is obtained at 6.
Example 2:
Input:
N = 50
Output:
30
Explanation:
For n = 1 to 50, the maximum value of the
ratio is 3.75 which is obtained at n = 30.
 
Your Task:
You don't need to read input or print anything. Your task is to complete the function maximizeEulerRatio() which takes an Integer N as input and returns the smallest positive integer (<= N) which maximizes the ratio n/Ø(n) is maximized.
 
Expected Time Complexity: O(constant)
Expected Auxiliary Space: O(constant)
 
Constraints:
1 <= N <= 1012
0
Debarshi Maitra1 year ago
Debarshi Maitra
O(1) Solution : https://ide.geeksforgeeks.o...
0
Rahul Raj2 years ago
Rahul Raj
CPP 0.01 Solutionhttps://ide.geeksforgeeks.o...
0
Kartik Bhatia2 years ago
Kartik Bhatia
if any one can approach his approach ?
0
Surya Prakash Reddy4 years ago
Surya Prakash Reddy
0.01 Solution...https://ide.geeksforgeeks.o...
0
Rishabh Acharya
This comment was deleted.
0
Hemant Dhanuka4 years ago
Hemant Dhanuka
on solving equation, u have to minimize product of ( (p-1)/p) where p is prime no which divides n
0
Dipta Ghosh5 years ago
Dipta Ghosh
http://code.geeksforgeeks.o...
Run time error on submission , but giving correct o/p.
We strongly recommend solving this problem on your own before viewing its editorial. Do you still
                    want to view the editorial?
 Login to access your submissions. 

Problem


Contest

Reset the IDE using the second button on the top right corner.
Avoid using static/global variables in your code as your code is tested against multiple test cases and these tend to retain their previous values.
Passing the Sample/Custom Test cases does not guarantee the correctness of code. On submission, your code is tested against multiple test cases consisting of all possible corner cases and stress constraints.
You can access the hints to get an idea about what is expected of you as well as the final solution code.
You can view the solutions submitted by other users from the submission tab.
Python 3 - List remove() Method

obj − This is the object to be removed from the list.
This method does not return any value but removes the given object from the list.
The following example shows the usage of remove() method.
#!/usr/bin/python3

list1 = ['physics', 'Biology', 'chemistry', 'maths']
list1.remove('Biology')
print ("list now : ", list1)
list1.remove('maths')
print ("list now : ", list1)
When we run above program, it produces the following result −
list now :  ['physics', 'chemistry', 'maths']
list now :  ['physics', 'chemistry']


    187 Lectures 
     17.5 hours 

 Malhar Lathkar

    55 Lectures 
     8 hours 

 Arnab Chakraborty

    136 Lectures 
     11 hours 

 In28Minutes Official

    75 Lectures 
     13 hours 

 Eduonix Learning Solutions

    70 Lectures 
     8.5 hours 

 Lets Kode It

    63 Lectures 
     6 hours 

 Abhilash Nelson
 Print
 Add Notes
 Bookmark this page
Java Examples - Finding Word Occurrence

How to find every occurance of a word?
Following example demonstrates how to find every occurance of a word with the help of Pattern.compile() method and m.group() method.
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
   public static void main(String args[]) throws Exception {
      String candidate = "this is a test, A TEST.";
      String regex = "\\ba\\w*\\b";
      Pattern p = Pattern.compile(regex);
      Matcher m = p.matcher(candidate);
      
      String val = null; 
      System.out.println("INPUT: " + candidate);
      System.out.println("REGEX: " + regex + "\r\n");
      
      while (m.find()) {
         val = m.group();
         System.out.println("MATCH: " + val);
      }
      if (val == null) {
         System.out.println("NO MATCHES: ");
      }
   }
}
The above code sample will produce the following result.
INPUT: this is a test, A TEST.
REGEX: \ba\w*\b

MATCH: a

 Print
 Add Notes
 Bookmark this page
p5.js | split() function - GeeksforGeeks

06 May, 2022
The split() function in p5.js is used to break the input string into pieces using a delimiter. This delimiter could be any string or symbol used between each piece of the input string. Syntax:
split(String, Delimiter)
Parameters: This function accepts two parameters which are described below:
String: This is the input string which are to be splitted.
Delimiter: This is any string or symbol used to separate the data of the input string.
Return Value: It returns the splitted data of the input string. Below programs illustrate the split() function in p5.js. Example 1: This example uses split() function to break the input string into pieces of substring using delimiter. 
javascript
function setup() {      // Creating Canvas size    createCanvas(450, 150);}function draw() {          // Set the background color    background(220);        // Initializing the Strings    let String = 'GeeksforGeeks/Geeks/Geek/gfg';          // Calling to split() function.    let A = split(String, '/');         // Set the size of text    textSize(16);          // Set the text color    fill(color('red'));        // Getting splitted string    text("Splitted string is: " + A[0], 50, 30);     text("Splitted string is: " + A[1], 50, 60);     text("Splitted string is: " + A[2], 50, 90);     text("Splitted string is: " + A[3], 50, 120);}
Output:  Example 2: This example uses split() function to break the input string into pieces of substring using delimiter. 
javascript
function setup() {      // Creating Canvas size    createCanvas(450, 150);}function draw() {          // Set the background color    background(220);        // Initializing the Strings    let String = '0&11&222&3333';          // Calling to split() function.    let A = split(String, '&');         // Set the size of text    textSize(16);          // Set the text color    fill(color('red'));        // Getting splitted string    text("Splitted string is: " + A[0], 50, 30);     text("Splitted string is: " + A[1], 50, 60);     text("Splitted string is: " + A[2], 50, 90);     text("Splitted string is: " + A[3], 50, 120);}
Output:  Reference: https://p5js.org/reference/#/p5/split
rkbhola5
JavaScript-p5.js
JavaScript
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Remove elements from a JavaScript Array
Convert a string to an integer in JavaScript
Difference between var, let and const keywords in JavaScript
Differences between Functional Components and Class Components in React
How to append HTML code to a div using JavaScript ?
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 ?
Top 10 Projects For Beginners To Practice HTML and CSS Skills
GATE | GATE CS 2012 | Question 56 - GeeksforGeeks

17 May, 2019
The cost function for a product in a firm is given by 5q2, where q is the amount of production. The firm can sell the product at a market price of Rs 50 per unit. The number of units to be produced by the firm such that the profit is maximized is(A) 5(B) 10(C) 15(D) 25Answer: (A)Explanation:
Profit = Price - Cost
       = 50q - 5q2
The above function will be maximum for the values on which its first derivative becomes 0.
        50 - 10*q = 0
        50 = 10 * q
        q = 5.
The value of above expression is maximum at q = 5. 
Quiz of this Question
GATE-CS-2012
GATE-GATE CS 2012
GATE
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
GATE | Gate IT 2007 | Question 25
GATE | GATE-CS-2001 | Question 39
GATE | GATE-CS-2000 | Question 41
GATE | GATE-CS-2005 | Question 6
GATE | GATE MOCK 2017 | Question 21
GATE | GATE MOCK 2017 | Question 24
GATE | GATE-CS-2006 | Question 47
GATE | Gate IT 2008 | Question 43
GATE | GATE-CS-2009 | Question 38
GATE | GATE-CS-2003 | Question 90
How to insert values into MySQL server table using Python? - GeeksforGeeks

03 Jan, 2021
Prerequisite: Python: MySQL Create Table
In this article, we are going to see how to get the size of a table in MySQL using Python. Python allows the integration of a wide range of database servers with applications. A database interface is required to access a database from Python. MySQL Connector-Python module is an API in python for communicating with a MySQL database
Approach:
Set up a Database serving either locally or globally.
Install Python Connector inorder to communicate with Databases.
Establish Database Connection using a Connector.
Need to have a Table to insert data, Create a Table if you don’t have any.
Modify Data in Table [ CRUD operation ] using a cursor object returned by Connector.
Close the Database connection If you are done with it.
We are going to use this table:
Example 1: Adding one row into a Table with static values :
Syntax : “INSERT INTO table_name (column_name) VALUES ( valuesOfRow );”
Below is the implementation:
Python3
import mysql.connector  db = mysql.connector.connect(    host="localhost",    user="root",    passwd="root",    database="testdb")# getting the cursor by cursor() methodmycursor = db.cursor()  insertQuery = "INSERT INTO Fruits (Fruit_name) VALUES ('Apple');"  mycursor.execute(insertQuery)  print("No of Record Inserted :", mycursor.rowcount)  # we can use the id to refer to that row later.print("Inserted Id :", mycursor.lastrowid)  # To ensure the Data Insertion, commit database.db.commit()   # close the Connectiondb.close()
 Output:
No of Record Inserted : 1
Inserted Id : 1
How our table looks in SQL after insertion:
Example 2: Adding multiple rows into a table with static values :
Syntax : ”INSERT INTO table_name (column_name) 
                             VALUES ( valuesOfRow1),(valuesOfRow2),....(valuesOfRowN);”
Below is the implementation:
Python3
import mysql.connector  db = mysql.connector.connect(    host="localhost",    user="root",    passwd="root",    database="testdb")  #getting the cursor by cursor() methodmycursor = db.cursor()  insertQuery = '''INSERT INTO             Fruits (Fruit_name, Taste, Production_in )             VALUES ('Banana','Sweet',210);'''  mycursor.execute(insertQuery)  print("No of Record Inserted :", mycursor.rowcount)  # To ensure the data insertion, Always commit to the database.db.commit()  # close the Connectiondb.close()
Output:
No of Record Inserted : 2
How our table looks in SQL after insertion:
Picked
Python-mySQL
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Install PIP on Windows ?
Check if element exists in list in Python
How To Convert Python Dictionary To JSON?
Python Classes and Objects
How to drop one or multiple columns in Pandas Dataframe
Defaultdict in Python
Python | Get unique values from a list
Python | os.path.join() method
Create a directory in Python
Python | Pandas dataframe.groupby()
HTML5 <aside> Tag - GeeksforGeeks

03 Mar, 2021
The <aside> tag is used to describe the main object of the web page in a shorter way like a highlighter. It basically identifies the content that is related to the primary content of the web page but does not constitute the main intent of the primary page. The <aside> tag contains mainly author information, links, related content, and so on.
<aside> vs <div>: Both tags have same behavior with different meaning. 
<div>: It defines or creates division or section in the web page.
<aside>: It does the same job by creating a section or division but it contains only the content that is related to the main web page.
The <aside> tag makes it easy to design the page and it enhances the clarity of HTML document. It let us easily recognize the main text and subordinate text. In both the time <div> and <aside> need CSS to specific design. The <aside> tag supports Global attributes and Event attributes in HTML.
Note: The <aside> tag is new in HTML5. This tag does not render as anything special in a browser you have to use CSS for that.
Syntax:
<aside>
  <h1>Contents...</h1>
  <p>Contents...</p>
</aside>
Example: HTML aside Tag
HTML
<html><body>    <h1>GeeksforGeeks</h1>    <h2>HTML aside Tag</h2>    <h1>This is normal heading Tag</h1>      <p>This is normal paragraph text</p>      <aside>      <h1>This is heading text in aside Tag</h1>        <p>This is paragraph text in aside Tag</p>    </aside></body></html>
Output:  
Example: Using Style in HTML aside Tag:
HTML
<html><head>  <style>    article {      width: 50%;      padding: 10px;      float: left;    }    aside {      width: 40%;      float: right;      background-color: green;      color: white;      padding: 5px;      margin: 10px;      height: 100px;    }  </style></head><body>  <h1>GeeksforGeeks</h1>  <article>    <h1>Heading . . .</h1>    <p>      Aside tag is use to display important       information about the primary page.    </p>  </article>  <aside>    <h1>Aside tag example</h1>    <p>Aside tag content. . .</p>  </aside></body></html>
Output:
Supported Browser : 
Google Chrome 6.0 and above
Internet Explorer 9.0 and above
Firefox 4.0 and above
Opera 11.1 and above
Safari 5.0 and above
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.
nidhi_biet
charles2101
shubhamyadav4
HTML5
Picked
HTML
Web technologies Questions
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to insert spaces/tabs in text using HTML/CSS?
How to update Node.js and NPM to next version ?
How to set the default value for an HTML <select> element ?
Hide or show elements in HTML using display property
Remove elements from a JavaScript Array
Installation of Node.js on Linux
How to insert spaces/tabs in text using HTML/CSS?
How to set the default value for an HTML <select> element ?
File uploading in React.js
Python | Pandas Series.size - GeeksforGeeks

28 Jan, 2019
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index.
Pandas Series.size attribute returns the number of elements in the underlying data for the given series objects.
Syntax:Series.size
Parameter : None
Returns : size
Example #1: Use Series.size attribute to find the number of elements in the underlying data of the given series object.
# importing pandas as pdimport pandas as pd  # Creating the Seriessr = pd.Series(['New York', 'Chicago', 'Toronto', 'Lisbon', 'Rio'])  # Creating the row axis labelssr.index = ['City 1', 'City 2', 'City 3', 'City 4', 'City 5']   # Print the seriesprint(sr)
Output :
Now we will use Series.size attribute to find the number of elements in the underlying data of the given Series object.
# return the number of elementssr.size
Output :As we can see in the output, the Series.size attribute has returned 5 indicating that there are 5 elements in the given series object. Example #2 : Use Series.size attribute to find the number of elements in the underlying data of the given series object.
# importing pandas as pdimport pandas as pd  # Creating the Seriessr = pd.Series(['1/1/2018', '2/1/2018', '3/1/2018', '4/1/2018'])  # Creating the row axis labelssr.index = ['Day 1', 'Day 2', 'Day 3', 'Day 4']  # Print the seriesprint(sr)
Output :Now we will use Series.size attribute to find the number of elements in the underlying data of the given Series object.
# return the number of elementssr.size
Output :As we can see in the output, the Series.size attribute has returned 4 indicating that there are 4 elements in the given series object.
Python pandas-series
Python pandas-series-methods
Python-pandas
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python Dictionary
Read a file line by line in Python
How to Install PIP on Windows ?
Enumerate() in Python
Different ways to create Pandas Dataframe
Iterate over a list in Python
*args and **kwargs in Python
Reading and Writing to text files in Python
Create a Pandas DataFrame from Lists
Check if element exists in list in Python
Ruby | Array delete_if() operation - GeeksforGeeks

13 Jan, 2022
Array#delete_if() : delete_if() is a Array class method which deletes the arrays elements for which the block condition satisfies. 
Syntax:  Array.delete_if()

Parameter:  block - condition for deleting the elements.

Return:  array after deleting the elements
Code #1 : Example for delete_if() method 
Ruby
# Ruby code for delete_if() method   # declaring arraya = [18, 22, 33, 23, 5, 6]   # declaring arrayb = [1, 4, 1, 1, 88, 9]   # declaring arrayc = [18, 22, 12, 24, 50, 6]   # deleteputs "delete : #{a.delete_if{|x| x < 1}}\n\n"   # deleteputs "delete : #{b.delete_if{|b| b==1}}\n\n"
Output : 
delete : [18, 22, 33, 23, 5, 6]

delete : [4, 88, 9] 
Code #2 : Example for delete_if() method  
Ruby
# Ruby code for delete_if() method   # declaring arraya = ["abc", "geeks", "dog"]   # declaring arrayb = ["cow", "1", "dog"]      # deleteputs "delete : #{a.delete_if{|x| x != "dog"}}\n\n"   # deleteputs "delete : #{b.delete_if{|b| b=="1"}}\n\n"
Output : 
delete : ["dog"]

delete : ["cow", "dog"]
 
surinderdawra388
Ruby Array-class
Ruby Collections
Ruby-Methods
Ruby
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Ruby | Array count() operation
Include v/s Extend in Ruby
Global Variable in Ruby
Ruby | Hash delete() function
Ruby | Types of Variables
Ruby | Enumerator each_with_index function
Ruby | Case Statement
Ruby | Array select() function
Ruby | Data Types
Ruby | Numeric round() function
Python | sympy.coeff(x, n) method - GeeksforGeeks

18 Jun, 2019
With the help of sympy.coeff(x, n) method, we are able to find the coefficient of variables in mathematical expressions.
Syntax : sympy.coeff(x, n)Return : Return the coefficient of variables.
Example #1 :In this example, we can see that by using sympy.coeff(x, n) method, we can find the coefficient of mathematical expression.
# import sympyfrom sympy import * x, y, z = symbols('x y z')gfg_exp = x * y + x - 3 + 2 * x**2 - z * x**2 + x**3  # Using sympy.coeff(x, n) methodgfg_exp = gfg_exp.coeff(x, 2)  print(gfg_exp)
Output :
2 – z
Example #2 :
# import sympyfrom sympy import * x, y, z = symbols('x y z')gfg_exp = z * x + x - 3 + 2 * x**2 - y * x**2 + y**3  # Using sympy.coeff(x, n) methodgfg_exp = gfg_exp.coeff(y, 1)  print(gfg_exp)
Output :
-x**2
SymPy
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python Dictionary
Read a file line by line in Python
How to Install PIP on Windows ?
Enumerate() in Python
Different ways to create Pandas Dataframe
Iterate over a list in Python
Python String | replace()
*args and **kwargs in Python
Reading and Writing to text files in Python
Create a Pandas DataFrame from Lists
How to Use setwd and getwd in R? - GeeksforGeeks

19 Dec, 2021
In this article, we will discuss how to use setwd and getwd in the R programming language.
getwd() stands forget working directory. It is used to get the current working directory of the environment.
Syntax:
getwd()
We can also see the total number of files in the present working directory. For that, we have to use the length function.
Syntax:
length(list.files())
If we have to use the display the filenames, then the command is 
list.files()
Example :
In this example, we will be using the getwd() function to get the current working directory.
R
getwd()
Output:
"C:/Users/Ramu/saisri"
Example :
Here, we will be using the getwd() function to get the length of the list of the files present in the working directory of the R console.
R
# get total file countprint(length(list.files()))  # get file namesprint(list.files())
Output:
[1] 2
[1] "ai.R"   "ramu.R"
setwd() stands for set working directory. This is used to set the working environment.
Syntax:
setwd('path')
Example:
Here, we will be using the setwd() function to set the working directory.
R
setwd('C:/Ramu/saisri/')
Picked
R-Functions
R Language
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Change Color of Bars in Barchart using ggplot2 in R
Group by function in R using Dplyr
How to Change Axis Scales in R Plots?
How to Split Column Into Multiple Columns in R DataFrame?
Replace Specific Characters in String in R
How to filter R DataFrame by values in a column?
How to import an Excel File into R ?
R - if statement
Time Series Analysis in R
How to filter R dataframe by multiple conditions?