code-rag-bench/online-tutorials huggingface dataset:
AWS Cloud Computing

The client-server model is an important concept in cloud computing.
It is about many clients using services from a centralized server.
Read about the Benefits of Cloud Computing at: Cloud Benefits
The Client-Server model is about a client that interacts and makes requests to a computer server.
A client is the way that the person interact with the server.
Image created by Amazon Web Services
The server does tasks for the client and returns information.
Cloud computing is a computing service made available over the internet.
Cloud computing is a pay-as-you-go model for delivering IT resources.
You pay only for what you use.
W3schools.com collaborates with Amazon Web Services to deliver digital training content to our students.
There are three different kinds of deployment models:
Cloud-based
On-premises
Hybrid
The models are different ways of accessing compute services - over the internet, locally, or in a combination.
Everything runs in the cloud.
This model allows you to build new applications or move existing ones to the cloud.
There are different levels of services ranging from low to high.
The level of service has different requirements on your management, architecting, and infrastructure.
For example, a company might create an application consisting of virtual servers, databases, and networking components entirely based in the cloud.
Deploy resources by using virtualization and resource management tools.
On-Premises Deployment is also known as private cloud deployment.
For example, you might have applications that run on technology that is fully kept in your on-premises data center.
Though this model is much like legacy IT infrastructure, its application management and virtualization technologies make it more effective.
In a hybrid deployment, you connect cloud resources to an on-premises infrastructure.
This approach is relevant in many situations. 
For example, you are working with sensitive data or are under specific government regulations.
Insert the missing deployment model.
Cloud-based, on-premises, and 
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.
Tryit Editor v3.7

Tryit: Using the animation-delay property
How to use Style Sheet in HTML?

The stylesheet is used in HTML to describe how a document is presented on screen. With CSS, easily specify a number of style properties for an HTML element. Each property has a name and a value, which is separated by a colon (:).
You can use CSS in three ways in your HTML document −
External Style Sheet − Define style sheet rules in a separate .css file and then include that file in your HTML document using HTML <link> tag.
Internal Style Sheet − Define style sheet rules in header section of the HTML document using <style> tag.
Inline Style Sheet − Define style sheet rules directly along-with the HTML elements using style attribute.
Just keep in mind each property declaration is separated by a semi-colon (;). Use the style attribute to add CSS to the HTML elements and attribute. This is how you can add inline style sheet and set text color −
You can try to run the following code to add a style sheet to an HTML page
<!DOCTYPE html>
<html>
   <head>
      <title>HTML style sheet</title>
   </head>
 
   <body>
      <h1 style="color:red">
         Heading
      </h1>
      <p style="color:blue">
         This is demo text
      </p>
   </body>
</html>
java.time.ZonedDateTime. withZoneSameInstant() Method Example

The java.time.ZonedDateTime.withZoneSameInstant(ZoneId zone) method returns a copy of this date-time with a different time-zone, retaining the instant.
Following is the declaration for java.time.ZonedDateTime.withZoneSameInstant(ZoneId zone) method.
public ZonedDateTime withZoneSameInstant(ZoneId zone)

zone − the time-zone to change to, not null.
a ZonedDateTime based on this date with the requested zone, not null.
DateTimeException − if the year value is invalid.
The following example shows the usage of java.time.ZonedDateTime.withZoneSameInstant(ZoneId zone) method.
package com.tutorialspoint;

import java.time.ZoneId;
import java.time.ZonedDateTime;

public class ZonedDateTimeDemo {
   public static void main(String[] args) {
      
      ZonedDateTime date = ZonedDateTime.parse("2017-03-28T12:25:38.492+05:30[Asia/Calcutta]");
      ZonedDateTime result = date.withZoneSameInstant(ZoneId.of("Z"));
      System.out.println(result);  
   }
}
Let us compile and run the above program, this will produce the following result −
2017-03-28T06:55:38.492Z

 Print
 Add Notes
 Bookmark this page
How to change Input characters to Upper Case while typing using CSS/jQuery ? - GeeksforGeeks

20 Dec, 2019
Given an input text area and the task is to transform the lowercase characters into uppercase characters while taking input from user. It can be done using CSS or JavaScript. The first approach uses CSS transform property and the second approach uses JavaScript to convert the lowercase character to upper case character.
Approach 1: This approach uses CSS text-transform property to transform the lowercase characters into uppercase characters while taking input from the user.
Example: This example implements the above approach.
<!DOCTYPE HTML> <html>   <head>     <title>         How to change Input character        to Upper Case while typing        using CSS/JavaScript ?    </title></head>   <body style = "text-align:center;">          <h1 style = "color: green">         GeeksForGeeks     </h1>          <p id = "GFG_UP" style =        "font-size: 20px; font-weight: bold;">        Type in the input box in lower        case to see the effect.    </p>          Type Here: <input id="yourid"         style="text-transform: uppercase"        type="text" />          <br><br>          <p id = "GFG_DOWN" style = "color:green;        font-size: 26px; font-weight: bold;">    </p></body>   </html>
Output:
Before typing in input box:
After typing lowercase letters in input box:
Approach 2:
Use keyup() method to trigger the keyup event when user releases the key from keyboard.
Use toLocaleUpperCase() method to transform the input to uppercase and again set it to the input element.
Example: This example implements the above approach.
<!DOCTYPE HTML> <html>   <head>     <title>         How to change Input character        to Upper Case while typing        using CSS/JavaScript ?    </title>          <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">    </script></head>  <body style = "text-align:center;">           <h1 style = "color: green">         GeeksForGeeks     </h1>          <p id = "GFG_UP" style =         "font-size: 20px; font-weight: bold;">        Type in the input box in lower        case to see the effect.    </p>          Type Here: <input id="yourid" type="text" />          <br><br>          <script>        $(function() {            $('input').keyup(function() {                this.value = this.value.toLocaleUpperCase();            });        });    </script> </body>   </html>
Output:
Before typing in input box:
After typing lowercase letters in input box:
jQuery-Misc
JQuery
Web Technologies
Web technologies Questions
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Show and Hide div elements using radio buttons?
How to prevent Body from scrolling when a modal is opened using jQuery ?
jQuery | ajax() Method
jQuery | removeAttr() with Examples
How to get the value in an input text box using jQuery ?
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 ?
How to insert spaces/tabs in text using HTML/CSS?
JavaScript - Void Keyword

void is an important keyword in JavaScript which can be used as a unary operator that appears before its single operand, which may be of any type. This operator specifies an expression to be evaluated without returning a value.
The syntax of void can be either of the following two −
<head>
   <script type = "text/javascript">
      <!--
         void func()
         javascript:void func()
         or:
         void(func())
         javascript:void(func())
      //-->
   </script>
</head>

The most common use of this operator is in a client-side javascript: URL, where it allows you to evaluate an expression for its side-effects without the browser displaying the value of the evaluated expression.
Here the expression alert ('Warning!!!') is evaluated but it is not loaded back into the current document −
<html>
   <head>      
      <script type = "text/javascript">
         <!--
         //-->
      </script>   
   </head>
   
   <body>   
      <p>Click the following, This won't react at all...</p>
      <a href = "javascript:void(alert('Warning!!!'))">Click me!</a>     
   </body>
</html>
Click the following, This won't react at all...
Take a look at the following example. The following link does nothing because the expression "0" has no effect in JavaScript. Here the expression "0" is evaluated, but it is not loaded back into the current document.
<html>
   <head>   
      <script type = "text/javascript">
         <!--
         //-->
      </script>      
   </head>
   
   <body>   
      <p>Click the following, This won't react at all...</p>
      <a href = "javascript:void(0)">Click me!</a>      
   </body>
</html>
Click the following, This won't react at all...
Another use of void is to purposely generate the undefined value as follows.
<html>
   <head>      
      <script type = "text/javascript">
         <!--
            function getValue() {
               var a,b,c;
               
               a = void ( b = 5, c = 7 );
               document.write('a = ' + a + ' b = ' + b +' c = ' + c );
            }
         //-->
      </script>      
   </head>
   
   <body>
      <p>Click the following to see the result:</p>
      <form>
         <input type = "button" value = "Click Me" onclick = "getValue();" />
      </form>     
   </body>
</html>
Click the following to see the result:

    25 Lectures 
     2.5 hours 

 Anadi Sharma

    74 Lectures 
     10 hours 

 Lets Kode It

    72 Lectures 
     4.5 hours 

 Frahaan Hussain

    70 Lectures 
     4.5 hours 

 Frahaan Hussain

    46 Lectures 
     6 hours 

 Eduonix Learning Solutions

    88 Lectures 
     14 hours 

 Eduonix Learning Solutions
 Print
 Add Notes
 Bookmark this page
How to use both Tailwind CSS and Bootstrap 4 at the same time ?

24 Dec, 2021
In this article, we will know how to use Bootstrap with Tailwind CSS, at a moment, in the same code. We can use both the CSS frameworks together but it is not recommended. Because few classes will contradict with each other like “container”, “clearfix”, etc. As we know that Bootstrap is a known CSS framework. Although the Tailwind CSS framework can also be used parallelly in comparison to Bootstrap. Tailwind CSS is basically a utility-first CSS framework that facilitates rapidly building custom user interfaces. So, in the development field, it is more familiar with the Tailwind rather than Bootstrap. There are significant differences in the Tailwind CSS vs Bootstrap.
Suppose there is a pre-build website where the old developers have used Bootstrap and the new developers want to use Tailwind. In that case, the new developer has to be careful with the used Bootstrap classes, where the classes should not contradict each other. We will be using the below CDN links in the code example in order to use the various applicable Bootstrap & Tailwind CSS classes, & utilize them on a single page.
Bootstrap CDN Link:
<link rel=”stylesheet” href=“ https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css”> <script src=“ https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js”></script> <script src=“ https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js”></script> <script src=“ https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js”></script>  
Tailwind CSS CDN Link:
<link href=“ https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css” rel=”stylesheet”> 
Example: In this example, we will use Bootstrap for content alignment, & for text and background color, we will use Tailwind CSS. So both the frameworks will applicable.
HTML
<!DOCTYPE html><html> <head>    <!-- Bootstrap CDN Links -->    <link rel="stylesheet"          href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">    </script>    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js">    </script>    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js">    </script>     <!-- Tailwind CSS CDN Links -->    <link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"          rel="stylesheet"></head> <body>       <!-- Bootstrap Class -->    <div class="col">        <div class="col-md-4">                       <!-- Tailwind CSS Class -->            <p class="bg-purple-300 p-2">                <b class="text-green-700">GeeksforGeeks</b>                <br>This example illustrates the use of                    Bootstrap and Tailwind side by side.            </p>         </div>    </div></body> </html>
 Output:
surindertarika1234
Bootstrap-Questions
Picked
Tailwind CSS-Questions
CSS
HTML
Web Technologies
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Program for Area Of Square

21 Jun, 2022
A square is a flat shape, in one plane, defined by four points at the four corners. A square has four sides all of equal length, and four corners, all right angles (90 degree angles). A square is a kind of rectangle.  
Examples :  
Input : 4
Output :16

Input :8
Output :64
 
Formula  
C++
Java
Python3
C#
PHP
Javascript
// CPP program to find// the area of the square#include <iostream>using namespace std; int areaSquare(int side){    int area = side * side;    return area;} // Driver Codeint main(){    int side = 4;    cout << areaSquare(side);    return 0;}
// Java program to find// the area of the squareimport java.util.*; class GFG{    static int areaSquare(int side)    {    int area = side * side;    return area;    }         // Driver Code    public static void main(String[] args)    {        int side = 5;        System.out.println(areaSquare(4));    }}
# Python3 code to find# the area of the square def areaSquare( side ):    area = side * side    return area # Driver Codeside = 4print(areaSquare(side)) # This code is contributed# by "Sharad_Bhardwaj".
// C# program to find// the area of the squareusing System; class GFG{    static int areaSquare(int side)    {        int area = side * side;        return area;    }         // Driver code    public static void Main()    {        int side = 4;                 Console.WriteLine(areaSquare(side));    }} // This code is contributed by vt_m
<?php// PHP program to find// the area of the square function areaSquare($side){    $area = $side * $side;    return $area;} // Driver Code$side = 4;echo(areaSquare($side)); // This code is contributed by Ajit.?>
<script> // Javascript program to find// the area of the square function areaSquare(side){    let area = side * side;    return area;} // Driver Code     let side = 4;    document.write(areaSquare(side)); // This code is contributed by Mayank Tyagi</script>
Output :  
16
Time complexity : O(1) Auxiliary Space : O(1)
This article is contributed by Ajay Puri. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to review-team@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.. 
Rajinikanth Maila
jit_t
mayanktyagi1709
surinderdawra388
ajaymakvana
Inautix
Geometric
School Programming
Geometric
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Program for distance between two points on earth
Find if two rectangles overlap
Line Clipping | Set 1 (Cohen–Sutherland Algorithm)
Check whether triangle is valid or not if sides are given
Program for Point of Intersection of Two Lines
Python Dictionary
Reverse a string in Java
Arrays in C/C++
Introduction To PYTHON
Interfaces in Java
Python String – removesuffix()

01 Nov, 2020
If the string ends with the suffix and the suffix is not empty, the str.removesuffix(suffix, /) function removes the suffix and returns the rest of the string. If the suffix string is not found then it returns the original string. It is introduced in Python 3.9.0 version.
Syntax: str.removesuffix(suffix, /)
Parameters:
Suffix– suffix string that we are checking for.
Return value:
Returns: string[ : – len (suffix) ] if the string ends with suffix string and that suffix is not empty. Else it returns the copy of original string.
Example 1:
Python3
# Python 3.9 code explaining# str.removesuffix()  # suffix existsprint('ComputerScience'.removesuffix('Science'))  # suffix doesn't existprint('GeeksforGeeks'.removesuffix('for'))
Output:
Computer
GeeksforGeeks

Example 2:
Python3
# Python 3.9 code explaining# str.removesuffix()  # String for removesuffix()# If suffix exists then# then it remove suffix from the string# otherwise return original string  string1 = "Welcome to python 3.9"print("Original String 1 : ", string1)  # suffix existsresult = string1.removesuffix("3.9")print("New string : ", result)  string2 = "Welcome Geek"print("Original String 2 : ", string2)  # suffix doesn't existresult = string2.removesuffix("Welcome")print("New string : ", result)
Output:
Original String 1 :  Welcome to python 3.9
New string :  Welcome to python 
Original String 2 :  Welcome Geek
New string :  Welcome Geek

python-string
Technical Scripter 2020
Python
Technical Scripter
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
PHP | array_count_values() Function

09 Aug, 2019
The array_count_values() is an inbuilt function in PHP which is used to count all the values inside an array. In other words we can say that array_count_values() function is used to calculate the frequency of all of the elements of an array.
Syntax:
array array_count_values( $array )

Parameters: This function accepts single parameter $array. This parameter is the array for which we need to calculate the count of values present in it.
Return Value: This function returns an associative array with key-value pairs in which keys are the elements of the array passed as parameter and values are the frequency of these elements in an array.
Note: If the element is not a string or integer then an E_WARNING is thrown.
Examples:
Input : array = ("Geeks", "for", "Geeks", "Geeks", "Welcome", "for")
Output : 
        Array
        (
          [Geeks] => 3
          [for] => 2
          [Welcome] => 1
        )

Input : array = (1, 1, 2, 3 , 1 , 2 , 4, 5)
Output :
       Array
       (
         [1] => 3
         [2] => 2
         [3] => 1
         [4] => 1
         [5] => 1
       ) 

Below program illustrates the working of array_count_values() function in PHP:
<?php  // PHP code to illustrate the working// of array_count_values() functionfunction Counting($array){    return(array_count_values($array));}  // Driver Code$array = array("Geeks", "for", "Geeks", "Geeks", "Welcome", "for");print_r(Counting($array));  ?>
Output:
Array
(
    [Geeks] => 3
    [for] => 2
    [Welcome] => 1
)

Reference: http://php.net/manual/en/function.array-count-values.php
PHP-array
PHP-function
PHP
Web Technologies
PHP
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Java Math max() method with Examples

16 Apr, 2018
The Java.lang.math.max() function is an inbuilt function in Java which returns maximum of two numbers. The arguments are taken in int, double, float and long.If a negative and a positive number is passed as argument then the positive result is generated. And if both parameters passed are negative then the number with the lower magnitude is generated as result.
Syntax:
dataType max(dataType num1, dataType num2)
The datatypes can be int, float, double or long.

Parameters : The function accepts two parameters num1 and num2 
among which the maximum is returned

Return value:The function returns maximum of two numbers. The datatype will be the same as that of the arguments.
Given below are the examples of the function max()
// Java program to demonstrate the use of max() function// when two double data-type numbers are// passed as argumentspublic class Gfg {      public static void main(String args[])    {        double a = 12.123;        double b = 12.456;          // prints the maximum of two numbers        System.out.println(Math.max(a, b));    }}
Output:
12.456

// Java program to demonstrate the use of max() function// when one positive and one negative// integers are passed as argumentpublic class Gfg {      public static void main(String args[])    {        int a = 23;        int b = -23;          // prints the maximum of two numbers        System.out.println(Math.max(a, b));    }}
Output:
23

// Java program to demonstrate the use of max() function// when two negative integers are passed as argument.public class Gfg {      public static void main(String args[])    {        int a = -25;        int b = -23;          // prints the maximum of two numbers        System.out.println(Math.max(a, b));    }}
Output:
-23

Java-lang package
java-math
Java
Java
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python | Pandas Index.is_unique

20 Feb, 2019
Pandas Index is an immutable ndarray implementing an ordered, sliceable set. It is the basic object which stores the axis labels for all pandas objects.
Pandas Index.is_unique attribute return True if the underlying data in the given Index object is unique else it return False.
Syntax: Index.is_unique
Parameter : None
Returns : boolean
Example #1: Use Index.is_unique attribute to find out if the underlying data in the given Index object is unique or not.
# importing pandas as pdimport pandas as pd  # Creating the indexidx = pd.Index(['Melbourne', 'Sanghai', 'Lisbon', 'Doha', 'Moscow'])  # Print the indexprint(idx)
Output :
Now we will use Index.is_unique attribute to find out if the underlying data in the given Index object is unique or not.
# check if the values in the Index# is unique or not.result = idx.is_unique  # Print the resultprint(result)
Output :
As we can see in the output, the Index.is_unique attribute has returned True indicating that the underlying data of the given Index object is unique. Example #2 : Use Index.is_unique attribute to find out if the underlying data in the given Index object is unique or not.
# importing pandas as pdimport pandas as pd  # Creating the indexidx = pd.Index([900, 700, 620, 388, 900])  # Print the indexprint(idx)
Output :
Now we will use Index.is_unique attribute to find out if the underlying data in the given Index object is unique or not.
# check if the values in the Index# is unique or not.result = idx.is_unique  # Print the resultprint(result)
Output :As we can see in the output, the Index.is_unique attribute has returned False indicating that the underlying data of the given Index object is not unique.
Python pandas-indexing
Python-pandas
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Scala List contains() method with example

26 Jul, 2019
The contains() method is utilized to check whether a certain element is present in the list or not.
Method Definition: def contains(elem: Any): Boolean
Return Type: It returns true if the element present in the contains method as argument is also present in the stated list else it returns false.
Example #1:
// Scala program of contains()// method  // Creating objectobject GfG{       // Main method    def main(args:Array[String])    {              // Creating a list        val m1 = List(1, 3, 5, 2)                  // Applying contains method        val res = m1.contains(1)                  // Displays output        println(res)          }}
true

Example #2:
// Scala program of contains()// method  // Creating objectobject GfG{       // Main method    def main(args:Array[String])    {              // Creating a list        val m1 = List(1, 3, 5, 2)                  // Applying contains method        val res = m1.contains(7)                  // Displays output        println(res)          }}
false

Scala
Scala-list
Scala-Method
Scala
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python String isalnum() Method

12 Aug, 2021
Python String isalnum() method checks whether all the characters in a given string are alphanumeric or not. Alphanumeric means a character that is either a letter or a number.
Syntax: 
string_name.isalnum() 
Parameter: 
isalnum() method takes no parameters 
Return: 
True: If all the characters are alphanumeric 
False: If one or more characters are not alphanumeric 
Python
# Python program to demonstrate the use of# isalnum() method    # here a,b and c are characters and 1,2 and 3# are numbersstring = "abc123"print(string.isalnum())  # here a,b and c are characters and 1,2 and 3 # are numbers but space is not a alphanumeric # characterstring = "abc 123" print(string.isalnum())
Output: 
True
False
AmiyaRanjanRout
python-string
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
C# Program to Print the Names that Contain ‘MAN’ Substring Using LINQ

06 Mar, 2022
LINQ is known as Language Integrated Query and it is introduced in .NET 3.5. It gives the ability to .NET languages to generate queries to retrieve data from the data source. It removes the mismatch between programming languages and databases and the syntax used to create a query is the same no matter which type of data source is used. In this article, we will learn how to print those names contains ‘MAN’ substring from the given array using LINQ. So to do our task we use Contains() method in the Where() method. 
Syntax:
Where(employee => employee.Contains("MAN"))
Here, the Contains() method is used to check whether the given string contains the “MAN” word in it or not, and then the Where() method filters the array accordingly. 
Example:
Input  : [("MANVITHA"),("SRIMANTH"),("RAVI"),("MANASA"),("MOUNIKA")("MANAS");]
Output : [("MANVITHA"),("SRIMANTH"),("MANASA"),("MANAS")]

Input  : [("bobby"),("ramya"),("sairam");]
Output : No Output
Approach
To print the list of  names contains “MAN” as a substring follow the following steps:
Create a list(i.e., XEmployee) that will holds the name of the employees.Add the names to the list.Now find the names whose contains “MAN” as a substring by using XEmployee.Where(employee => employee.Contains(“MAN”))Display the employee names.
Create a list(i.e., XEmployee) that will holds the name of the employees.
Add the names to the list.
Now find the names whose contains “MAN” as a substring by using XEmployee.Where(employee => employee.Contains(“MAN”))
Display the employee names.
Example:
C#
// C# program to display those names that// contain 'MAN' substringusing System;using System.Collections.Generic;using System.Linq; class GFG{ static void Main(string[] args){         // Define a list    List<string> XEmployee = new List<string>();         // Add names into the list    XEmployee.Add("MANVITHA");    XEmployee.Add("SRIMANTH");    XEmployee.Add("RAVI");    XEmployee.Add("MANASA");    XEmployee.Add("MOUNIKA");    XEmployee.Add("MANAS");     // Choose the employee's name that    // contains MAN as a sub string    IEnumerable<string> final = XEmployee.Where(                                employee => employee.Contains("MAN"));     Console.WriteLine("Names that contain MAN substring:");         // Display employee names    foreach (string stname in final)    {        Console.WriteLine(stname);    }}}
Names that contain MAN substring:
MANVITHA
SRIMANTH
MANASA
MANAS

kalrap615
sumitgumber28
CSharp LINQ
CSharp-programs
Picked
C#
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to create two dimensional array in JavaScript?

26 Jul, 2021
The two-dimensional array is a collection of items which share a common name and they are organized as a matrix in the form of rows and columns. The two-dimensional array is an array of arrays, so we create an array of one-dimensional array objects.The following program shows how to create an 2D array : Example-1:  
Javascript
<script>  // Create one dimensional array    var gfg = new Array(2);  document.write("Creating 2D array <br>");  // Loop to create 2D array using 1D arrayfor (var i = 0; i < gfg.length; i++) {    gfg[i] = new Array(2);}  var h = 0;  // Loop to initialize 2D array elements.for (var i = 0; i < 2; i++) {    for (var j = 0; j < 2; j++) {        gfg[i][j] = h++;    }}  // Loop to display the elements of 2D array. for (var i = 0; i < 2; i++) {    for (var j = 0; j < 2; j++)    {        document.write(gfg[i][j] + " ");    }    document.write("<br>");} </script>                    
Output:  
Creating 2D array
0 1 
2 3 
 
Example-2:  
javascript
<script>  // Create one dimensional arrayvar gfg = new Array(3);  // Loop to create 2D array using 1D arraydocument.write("Creating 2D array <br>");for (var i = 0; i < gfg.length; i++) {    gfg[i] = [];}var h = 0;var s = "GeeksforGeeks";  // Loop to initialize 2D array elements.for (var i = 0; i < 3; i++) {    for (var j = 0; j < 3; j++) {          gfg[i][j] = s[h++];    }}  // Loop to display the elements of 2D array.for (var i = 0; i < 3; i++) {    for (var j = 0; j < 3; j++)      {        document.write(gfg[i][j] + " ");    }    document.write("<br>");}  </script>                    
Output:  
Creating 2D array
G e e 
k s f 
o r G 
 
 
JavaScript is best known for web page development but it is also used in a variety of non-browser environments. You can learn JavaScript from the ground up by following this JavaScript Tutorial and JavaScript Examples.
arorakashish0911
javascript-array
Picked
JavaScript
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Difference between var, let and const keywords in JavaScript
Remove elements from a JavaScript Array
Roadmap to Learn JavaScript For Beginners
Differences between Functional Components and Class Components in React
Difference Between PUT and PATCH Request
Installation of Node.js on Linux
Top 10 Projects For Beginners To Practice HTML and CSS Skills
Difference between var, let and const keywords in JavaScript
How to fetch data from an API in ReactJS ?
How to insert spaces/tabs in text using HTML/CSS?
How to Install and Use Hydra in Linux?

06 Oct, 2021
Weak passwords are still a big problem in security, nowadays guessing passwords and cracking algorithms is becoming easy and brute-forcing is a major kind of attack in the boom. A general rule for making a strong password is using a combination that is long(more than 8 letters) with capitals, symbols, and numeric’s.
To crack passwords a great tool to brute force is a hydra. It is a parallelized login cracker or password cracker. It was faster and flexible where adding modules is easy. Hydra usually comes preinstalled in the Kali Linux system but if in any case it is not installed or you are using any other distribution you can follow the steps in this article.
sudo apt-get install hydra-gtk
This command will directly install hydra from repositories, this will install the command-line version of hydra with front end GUI on your Linux system. The major drawback of using this command is that you will not be able to get the latest version, so in case you used this command or hydra was preinstalled on your system you can remove it using:
sudo apt-get purge hydra-gtk && sudo apt-get autoremove && sudo apt-get autoclean
Before doing anything first we need to get our system up to date by using command:
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
Once our system is up to date we need to install some essential things required for hydra.
sudo apt-get -y install build-essential
sudo apt-get install git

When we are using ubuntu/debian based distribution there are some supplementary libraries needed for some optional modules, these can be installed using this command (note than some may not be available for your distribution
sudo apt-get install libssl-dev libssh-dev libidn11-dev libpcre3-dev \ libgtk2.0-dev libmysqlclient-dev libpq-dev libsvn-dev \ firebird-dev libncp-dev
It will enable all the optional modules and features with the exception of Oracle, SAP R/3, NCP, and the apple filling protocol. Once it is done now we need to clone the repository from git hub, use the command:
git clone https://github.com/vanhauser-thc/thc-hydra.git
Locate to the cloned folder directory in your terminal.
cd thc-hydra
After locating to the directory we need to configure it
./configure
Now if you see this kind of screen with a message “make”, follow the instructions. Use root privileges for “make install”.
Go to your home directory and use “hydra -help” ensure hydra is installed properly and working well.
how-to-install
How To
Installation Guide
Linux-Unix
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Connecting to MySQL database from the command line?

To connect MySQL from the command line, firstly open command prompt. You can do this with the help of shortcut key “Windows + R”. On clicking, a panel will open and you need to type CMD and need to press OK button as shown below −
After pressing the OK button, you will get command line window.
Reach the MySQL Server “bin” directory as shown in the following screenshot −
Now you have reached the bin directory. Type the following statement in order to connect with MySQL.
mysql -u yourUserName -p
Apply the above statement to connect with MySQL. The snapshot is as follows with username “Manish” and password −
SQL Tryit Editor v1.6

SELECT * FROM Customers
WHERE City LIKE '[!bsp]%';
​
Edit the SQL Statement, and click "Run SQL" to see the result.
This SQL-Statement is not supported in the WebSQL Database.
The example still works, because it uses a modified version of SQL.
Your browser does not support WebSQL.
Your are now using a light-version of the Try-SQL Editor, with a read-only Database.
If you switch to a browser with WebSQL support, you can try any SQL statement, and play with the Database as much as you like. The Database can also be restored at any time.
Our Try-SQL Editor uses WebSQL to demonstrate SQL.
A Database-object is created in your browser, for testing purposes.
You can try any SQL statement, and play with the Database as much as you like. The Database can be restored at any time, simply by clicking the "Restore Database" button.
WebSQL stores a Database locally, on the user's computer. Each user gets their own Database object.
WebSQL is supported in Chrome, Safari, Opera, and Edge(79).
If you use another browser you will still be able to use our Try SQL Editor, but a different version, using a server-based ASP application, with a read-only Access Database, where users are not allowed to make any changes to the data.
How to insert Date value into table in JDBC?

You can insert date values in SQL using the date datatype, The java.sql.Date class maps to the SQL DATE type.
The PreparedStatement interface provides a method named setDate(). Using this you can insert date into a table. This method accepts two parameters −
An integer representing the parameter index of the place holder (?) to which we need to set date value.
An integer representing the parameter index of the place holder (?) to which we need to set date value.
a Date object representing the date value to be passed. The constructor of java.sql.Date class accepts a variable of long type representing the number of milliseconds from the epoch (standard base time I.e. January 1, 1970, 00:00:00 GMT).
a Date object representing the date value to be passed. The constructor of java.sql.Date class accepts a variable of long type representing the number of milliseconds from the epoch (standard base time I.e. January 1, 1970, 00:00:00 GMT).
Assume we have created a table named Emp in MySQL database with the following description −
+----------+--------------+------+-----+---------+-------+
| Field    | Type         | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+-------+
| Name     | varchar(255) | YES  |     | NULL    |       |
| DOB      | date         | YES  |     | NULL    |       |
| Location | varchar(255) | YES  |     | NULL    |       |
+----------+--------------+------+-----+---------+-------+
Following JDBC program inserts records in to this table −
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.Date;
public class InsertingDate {
   public static void main(String args[])throws Exception {
      //Getting the connection
      String mysqlUrl = "jdbc:mysql://localhost/sampleDB";
      Connection con = DriverManager.getConnection(mysqlUrl, "root", "password");
      System.out.println("Connection established......");
      //Inserting values to a table
      String query = "INSERT INTO Emp(Name, DOB, Location) VALUES (?, ?, ?)";
      PreparedStatement pstmt = con.prepareStatement(query);
      pstmt.setString(1, "Amit"); pstmt.setDate(2, new Date(622790105000L));
      pstmt.setString(3, "Hyderabad");
      pstmt.execute();
      pstmt.setString(1, "Sumith"); pstmt.setDate(2, new Date(620611200000L));
      pstmt.setString(3, "Vishakhapatnam");
      pstmt.execute();
      pstmt.setString(1, "Sudha");
      pstmt.setDate(2, new Date(336614400000L));
      pstmt.setString(3, "Vijayawada");
      pstmt.execute();
      System.out.println("Records inserted......");
   }
}
Connection established......
Records inserted......
If you verify the table in MySQL database, you can observe the contents of the table as −
mysql> select * from Emp;
+--------+------------+----------------+
| Name   | DOB        | Location       |
+--------+------------+----------------+
| Amit   | 1989-09-26 | Hyderabad      |
| Sumith | 2019-03-19 | Vishakhapatnam |
| Sudha  | 2019-03-19 | Vijayawada     |
+--------+------------+----------------+
3 rows in set (0.00 sec)
SQL BETWEEN Operator

The BETWEEN operator selects values within a given range. The values can be numbers, text, or dates.
The BETWEEN operator is inclusive: begin and end values are included. 
Below is a selection from the "Products" table in the Northwind 
sample database:
The following SQL statement selects all products with a price between 10 and 20:
To display the products outside the range of the previous example, use 
NOT BETWEEN:
The following SQL statement selects all products with a price between 10 and 
20. In addition; do not show products with a CategoryID of 1,2, or 3:
The following SQL statement selects all products with a ProductName between Carnarvon 
Tigers and Mozzarella di Giovanni:
The following SQL statement selects all products with a ProductName between Carnarvon 
Tigers and Chef Anton's Cajun Seasoning:
The following SQL statement selects all products with a ProductName not 
between Carnarvon 
Tigers and Mozzarella di Giovanni:
Below is a selection from the "Orders" table in the Northwind 
sample database:
The following SQL statement selects all orders with an OrderDate between '01-July-1996' and 
'31-July-1996':
OR:
Use the BETWEEN operator to select all the records where the value of the Price column is between 10 and 20.
SELECT * FROM Products
WHERE Price ;

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.
Python String isnumeric() Method

Python string method isnumeric() checks whether the string consists of only numeric characters. This method is present only on unicode objects.
Note − To define a string as Unicode, one simply prefixes a 'u' to the opening quotation mark of the assignment. Below is the example.
Following is the syntax for isnumeric() method −
str.isnumeric()

NA
NA
This method returns true if all characters in the string are numeric, false otherwise.
The following example shows the usage of isnumeric() method.
#!/usr/bin/python

str = u"this2009";  
print str.isnumeric()

str = u"23443434";
print str.isnumeric()
When we run above program, it produces following result −
False
True


    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
How to store and retrieve a date into MySQL database using Python?

To insert a date in a MySQL database, you need to have a column of Type date or datetime in your table. Once you have that, you'll need to convert your date in a string format before inserting it to your database. To do this, you can use the datetime module's strftime formatting function.
from datetime import datetime
now = datetime.now()
id = 1
formatted_date = now.strftime('%Y-%m-%d %H:%M:%S')
# Assuming you have a cursor named cursor you want to execute this query on:
cursor.execute('insert into table(id, date_created) values(%s, %s)', (id, formatted_date))
Running this will try to insert the tuple (id, date) in your table.
When you fetch a date from a database using a select query, you'll need to parse it back to a datetime object using functions like strptime.
from datetime import datetime
# Assuming you have a cursor named cursor you want to execute this query on:
cursor.execute('select id, date_created from table where id=1')
# if you inserted the row above, you can get it back like this
id, date_str = cursor.fetchone()
# date is returned as a string in format we sent it as. So parse it using strptime
created_date = datetime.strptime(date_created, '%Y-%m-%d %H:%M:%S')
This will get the created date and parse it to a datetime object.
What would be a query to remove \n\r from the text in MySQL?

To remove \n\r from the text, you need to use REPLACE command. The syntax is as follows −
UPDATE yourTableName SET yourColumnName=REPLACE(yourColumnName,’\r\n’,’ ‘);
To understand the above syntax, let us create a table. The query to create a table is as follows −
mysql> create table removeDemo
-> (
-> Id int NOT NULL AUTO_INCREMENT,
-> Name text,
-> PRIMARY KEY(Id)
-> );
Query OK, 0 rows affected (0.79 sec)
Now insert some records in the table using insert command. The query is as follows −
mysql> insert into removeDemo(Name) values('John\r\nSmithCarol');
Query OK, 1 row affected (0.13 sec)
mysql> insert into removeDemo(Name) values('LarryMike\r\nSam');
Query OK, 1 row affected (0.34 sec)
mysql> insert into removeDemo(Name) values('David\r\nBobJames');
Query OK, 1 row affected (0.10 sec)
Display all records from the table using select statement. The query is as follows −
mysql> select *from removeDemo;
The following is the output in a format that includes \r\n, therefore the output isn’t looking properly formatted −
+----+------------------+
| Id | Name             |
+----+------------------+
| 1  | John SmithCarol  |
| 2  | LarryMike Sam    |
| 3  | David BobJames   |
+----+------------------+
3 rows in set (0.00 sec)
Here is the query to remove \r\n from text −
mysql> update removeDemo set Name=replace(Name,'\r\n','');
Query OK, 3 rows affected (0.12 sec)
Rows matched: 3 Changed: 3 Warnings: 0
Now check the table records once again. The query is as follows −
mysql> select *from removeDemo;
The following is the output −
+----+----------------+
| Id | Name           |
+----+----------------+
| 1 | JohnSmithCarol  |
| 2 | LarryMikeSam    |
| 3 | DavidBobJames   |
+----+----------------+
3 rows in set (0.00 sec)
How to set axis ticks in multiples of pi in Python Matplotlib?

To set axis ticks in multiples of pi in Python, we take following steps −
Initialize a pi variable, create theta and y data points using numpy.
Initialize a pi variable, create theta and y data points using numpy.
Plot theta and y using plot() method.
Plot theta and y using plot() method.
Get or set the current tick locations and labels of the X-axis using xticks() method.
Get or set the current tick locations and labels of the X-axis using xticks() method.
Convenience method to set or retrieve autoscaling margins using margins() method.
Convenience method to set or retrieve autoscaling margins using margins() method.
To display the figure, use show() method.
To display the figure, use show() method.
import numpy as np
from matplotlib import pyplot as plt
plt.rcParams["figure.figsize"] = [7.00, 3.50]
plt.rcParams["figure.autolayout"] = True
pi = np.pi
theta = np.arange(-2 * pi, 2 * pi+pi/2, step=(pi / 2))
y = np.sin(theta)

plt.plot(theta, y)
plt.xticks(theta, ['-2π', '-3π/2', 'π', '-π/2', '0', 'π/2', 'π', '3π/2', '2π'])
plt.margins(x=0)
plt.show()
C# Program to Demonstrate the Example of LINQ Union() Method with StringComparer - GeeksforGeeks

08 Dec, 2021
LINQ is known as Language Integrated Query and it is introduced in .NET 3.5. It gives a feature to .NET languages to create queries to retrieve data from the data source. Here in this article, we will demonstrate the example of the LINQ Union() method with the StringComparer.
1. Union() Method: This method is used to get the unique elements from the given lists. Or we can say that this method returns the union of two lists. The function takes two lists as input and then it will get the elements only once in repeating elements.
Syntax:
data1.Union(data2)
Where data1 is the first list and data2 is the second list.
2. StringComparer: It is a class that is used to compare the strings that use some specific case or ordinal comparison rules. We can use this StringComparer in the Union() function to get the elements with string(case sensitive). It will compare the strings from the two lists and return the strings.
Syntax:
StringComparer.OrdinalIgnoreCase
If we are using union() function with StringComparer, then we have to first use Union() function then apply stringcomparer function with the given syntax.
Syntax:
data1.Union(data2, StringComparer.OrdinalIgnoreCase);
Where data1 is the second list and data2 is the second list.
Example:
Input: { "Hello", "Geeks", "For", "Geeks" };
       { "Hello", "geeks" , "python" }
Output:
Hello 
Geeks 
For 
python 

Input: { "Hello", "Geeks" }
       { "Hello", "geeks" , "python" };
Output:
Hello 
Geeks 
python
Approach:
1. Create two lists of string types named data1 and data2.
2. Perform the Union Operation with StringComparer
data1.Union(data2, StringComparer.OrdinalIgnoreCase);
3. Display the results using foreach loop
foreach(var j in final)
{
    Console.WriteLine(j + " ");
} 
Example:
C#
// C# program to illustrate how to use// Union() Method with StringComparer in LINQusing System;using System.Linq;using System.Collections.Generic; class GFG{ static void Main(string[] args){         // Create first list with 4 elements    List<string> data1 = new List<string>(){        "Hello", "Geeks", "For", "Geeks" };             // Create first list with 3 elements    List<string> data2 = new List<string>(){        "Hello", "geeks", "python" };     // Perform union operation    var final = data1.Union(data2,                            StringComparer.OrdinalIgnoreCase);     // Display the result    foreach(var j in final)    {        Console.WriteLine(j + " ");    }}}
Output:
Hello 
Geeks 
For 
python 
sweetyty
CSharp LINQ
Picked
C#
C# Programs
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Extension Method in C#
Top 50 C# Interview Questions & Answers
HashSet in C# with Examples
C# | How to insert an element in an Array?
Partial Classes in C#
Convert String to Character Array in C#
Socket Programming in C#
Getting a Month Name Using Month Number in C#
Program to Print a New Line in C#
Program to find absolute value of a given number