code-rag-bench/online-tutorials huggingface dataset:
How to use Avatar Component in ReactJS?

05 Mar, 2021
Avatars are found throughout material design with uses in everything from tables to dialog menus. Material UI for React has this component available for us, and it is very easy to integrate. We can use the Avatar Component in ReactJS using the following approach.
Creating React Application And Installing Module:
Step 1: Create a React application using the following command.
npx create-react-app foldername
Step 2: After creating your project folder i.e. foldername, move to it using the following command.
cd foldername
Step 3: After creating the ReactJS application, Install the material-ui modules using the following command.
npm install @material-ui/core
Project Structure: It will look like the following.
Project Structure
Example: Now write down the following code in the App.js file. Here, App is our default component where we have written our code.
App.js
import React from "react";import Avatar from "@material-ui/core/Avatar";  export default function App() {  return (    <div style={{ display: "flex" }}>      <h4>How to use Avatar Component in ReactJS?</h4>      <Avatar        style={{ border: "2px solid gray", margin: 10 }}        alt="GeeksforGeeks Pic 1"        src="https://write.geeksforgeeks.org/static/media/Group%20210.08204759.svg"      />      <Avatar        style={{ border: "1px solid black", margin: 20 }}        alt="GeeksforGeeks Pic 2"        src="https://write.geeksforgeeks.org/static/media/Group%20210.08204759.svg"      />    </div>  );}
Step to Run Application: Run the application using the following command from the root directory of the project.
npm start
Output: Now open your browser and go to http://localhost:3000/, you will see the following output.
Reference: https://material-ui.com/components/avatars/
Material-UI
React-Questions
ReactJS
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
SQL Trigger | Book Management Database

01 Feb, 2019
Prerequisite – SQL Trigger | Student DatabaseFor example, given Library Book Management database schema with Student database schema. In these databases, if any student borrows a book from library then the count of that specified book should be decremented. To do so,
Suppose the schema with some data,
mysql> select * from book_det; 
+-----+-------------+--------+ 
| bid | btitle      | copies | 
+-----+-------------+--------+ 
|   1 | Java        |     10 | 
|   2 | C++         |      5 | 
|   3 | MySql       |     10 | 
|   4 | Oracle DBMS |      5 | 
+-----+-------------+--------+ 
4 rows in set (0.00 sec) 

mysql> select * from book_issue; 
+------+------+--------+ 
| bid  | sid  | btitle | 
+------+------+--------+ 
1 row in set (0.00 sec)
To implement such procedure, in which if the system inserts the data into the book_issue database a trigger should automatically invoke and decrements the copies attribute by 1 so that a proper track of book can be maintained.
Trigger for the system –
create trigger book_copies_deducts 
after INSERT 
on book_issue 
for each row 
update book_det set copies = copies - 1 where bid = new.bid; 
Above trigger, will be activated whenever an insertion operation performed in a book_issue database, it will update the book_det schema setting copies decrements by 1 of current book id(bid).
Results –
mysql> insert into book_issue values(1, 100, "Java");
Query OK, 1 row affected (0.09 sec) 

mysql> select * from book_det; 
+-----+-------------+--------+ 
| bid | btitle      | copies | 
+-----+-------------+--------+ 
|   1 | Java        |      9 | 
|   2 | C++         |      5 | 
|   3 | MySql       |     10 | 
|   4 | Oracle DBMS |      5 | 
+-----+-------------+--------+ 
4 rows in set (0.00 sec) 

mysql> select * from book_issue; 
+------+------+--------+ 
| bid  | sid  | btitle | 
+------+------+--------+ 
|    1 |  100 | Java   | 
+------+------+--------+ 
1 row in set (0.00 sec)
As above results show that as soon as data is inserted, copies of the book deducts from the book schema in the system.
mayankchauhan
DBMS-SQL
SQL-basics
DBMS
SQL
DBMS
SQL
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python | Convert mixed data types tuple list to string list

29 Nov, 2019
Sometimes, while working with records, we can have a problem in which we need to perform type conversion of all records into a specific format to string. This kind of problem can occur in many domains. Let’s discuss certain ways in which this task can be performed.
Method #1 : Using list comprehension + tuple() + str() + generator expressionThe combination of above functions can be used to perform this task. In this, we extract each tuple element using generation expression and perform the conversion using str(). The iteration to each tuple is done by list comprehension.
# Python3 code to demonstrate working of# Convert tuple mixed list to string list# using list comprehension + tuple() + str() + generator expression  # initialize list test_list = [('gfg', 1, True), ('is', False), ('best', 2)]  # printing original list print("The original list : " + str(test_list))  # Convert tuple mixed list to string list# using list comprehension + tuple() + str() + generator expressionres = [tuple(str(ele) for ele in sub) for sub in test_list]  # printing resultprint("The tuple list after conversion : " + str(res))
The original list : [('gfg', 1, True), ('is', False), ('best', 2)]
The tuple list after conversion : [('gfg', '1', 'True'), ('is', 'False'), ('best', '2')]

 
Method #2 : Using map() + tuple() + str() + list comprehensionThe combination of above functions can be used to perform this task. In this, we perform the task performed by generator expression above using map().
# Python3 code to demonstrate working of# Convert tuple mixed list to string list# using map() + tuple() + str() + list comprehension  # initialize list test_list = [('gfg', 1, True), ('is', False), ('best', 2)]  # printing original list print("The original list : " + str(test_list))  # Convert tuple mixed list to string list# using map() + tuple() + str() + list comprehensionres = [tuple(map(str, sub)) for sub in test_list]  # printing resultprint("The tuple list after conversion : " + str(res))
The original list : [('gfg', 1, True), ('is', False), ('best', 2)]
The tuple list after conversion : [('gfg', '1', 'True'), ('is', 'False'), ('best', '2')]

Python list-programs
Python
Python Programs
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Install PIP on Windows ?
Python Classes and Objects
Python OOPs Concepts
Introduction To PYTHON
Python | os.path.join() method
Defaultdict in Python
Python | Get dictionary keys as a list
Python | Convert a list to dictionary
Python Program for Fibonacci numbers
Python | Convert string dictionary to dictionary
Java Program to Rename a File

09 Nov, 2020
Changing the name of the file is known as Renaming the file. Rename operation is possible using renameTo() method belongs to the File class in java.
A. renameTo() Method
The renameTo() method is used to rename the abstract pathname of a file to a given pathname. The method returns a boolean value i.e. returns true if the file is renamed else returns false.
Approach
Create an object of the File class and replace the file path with the path of the directory.Create another object of the File class and replace the file path with the renaming path of the directory.Use renameTo() method.If rename operation successful then the function returns true.Else returns false.
Create an object of the File class and replace the file path with the path of the directory.
Create another object of the File class and replace the file path with the renaming path of the directory.
Use renameTo() method.
If rename operation successful then the function returns true.
Else returns false.
Below is the implementation of the above approach.
Java
// Java Program to rename a fileimport java.io.File;public class GFG {    public static void main(String[] args)    {        // Create an object of the File class        // Replace the file path with path of the directory        File file = new File("/home/mayur/Folder/GFG.java");          // Create an object of the File class        // Replace the file path with path of the directory        File rename = new File("/home/mayur/Folder/HelloWorld.java");          // store the return value of renameTo() method in        // flag        boolean flag = file.renameTo(rename);          // if renameTo() return true then if block is        // executed        if (flag == true) {            System.out.println("File Successfully Rename");        }        // if renameTo() return false then else block is        // executed        else {            System.out.println("Operation Failed");        }    }}
Output:
File Successfully Rename
Before Program Execution
After Program Execution
B. move() Method
Rename of file can be done using move the contents of the first file to a new file and deleting the previous file. Java is handling this operation using resolveSibiling method. It is used to resolve the given path against this path’s parent path
Java
// Java Program to rename a fileimport java.nio.file.*;import java.io.IOException;  public class GFG {    public static void main(String[] args)        throws IOException    {          Path oldFile            = Paths.get("/home/mayur/Folder/GFG.java");          try {            Files.move(oldFile, oldFile.resolveSibling(                                    "HelloWorld.java"));            System.out.println("File Successfully Rename");        }        catch (IOException e) {            System.out.println("operation failed");        }    }}
Output:
File Successfully Rename
Before Program Execution
After Program Execution
Java-Files
Technical Scripter 2020
Java
Java Programs
Technical Scripter
Java
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Package getImplementationVersion() method in Java with Examples

25 Jan, 2022
The getImplementationVersion() method of java.lang.Package class is used to get the version of the implementation of this package. The method returns the implementation version of the package as a String.Syntax:  
public String getImplementationVersion()
Parameter: This method does not accept any parameter.Return Value: This method returns the implementation version of the package as a String, if known. Else it returns nullBelow programs demonstrate the getImplementationVersion() method.Example 1: 
Java
// Java program to demonstrate// getImplementationVersion() method public class Test {    public static void main(String[] args)    {         // returns the Package object        // for this package        Package myPackage            = Package.getPackage("java.lang");         System.out.println(            "Package represented by myPackage: "            + myPackage.toString());         // Get the implementation version of myPackage        // using getImplementationVersion() method        System.out.println(            "Implementation version of myPackage: "            + myPackage.getImplementationVersion());    }}
Package represented by myPackage: package java.lang, Java Platform API Specification, version 1.8
Implementation version of myPackage: 1.8.0_181
 
Example 2: 
Java
// Java program to demonstrate// getImplementationVersion() method public class Test {    public static void main(String[] args)    {         // returns the Package object        // for this package        Package myPackage            = Package.getPackage("java.io");         System.out.println(            "Package represented by myPackage: "            + myPackage.toString());         // Get the name of myPackage        // using getImplementationVersion() method        System.out.println(            "Implementation version of myPackage: "            + myPackage.getImplementationVersion());    }}
Package represented by myPackage: package java.io, Java Platform API Specification, version 1.8
Implementation version of myPackage: 1.8.0_181
 
Reference: https://docs.oracle.com/javase/9/docs/api/java/lang/Package.html#getImplementationVersion– 
adnanirshad158
Java-Functions
Java-lang package
java.lang.Package Class
Java
Java
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Difference Between Traits and Abstract Classes in Scala - GeeksforGeeks

13 Feb, 2019
In Scala, an abstract class is constructed using the abstract keyword. It contains both abstract and non-abstract methods and cannot support multiple inheritances.Example:
// Scala program to illustrate how to // create an abstract class  // Abstract classabstract class Abstclass{          // Abstract and non-abstract method    def portal    def tutorial()    {         println("Scala tutorial")    }  }  // GFG class extends abstract classclass GFG extends Abstclass{    def portal()    {        println("Welcome!! GeeksforGeeks")    }}  object Main {          // Main method    def main(args: Array[String])     {        // object of GFG class        var obj = new GFG ();        obj.tutorial()        obj.portal()    }}
Output:
Scala tutorial
Welcome!! GeeksforGeeks

Like a class, Traits can have methods(both abstract and non-abstract), and fields as its members. Traits are just like interfaces in Java. But they are more powerful than the interface in Java because in the traits we are allowed to implement the members.Example:
// Scala program to illustrate how to // create traits  // traitstrait mytrait{          // Abstract and non-abstract method    def portal    def tutorial()    {         println("Scala tutorial")    }  }  // GFG class extends traitclass GFG extends mytrait{    def portal()    {        println("Welcome!! GeeksforGeeks")    }}  object Main {          // Main method    def main(args: Array[String])     {                  // object of GFG class        var obj = new GFG ();        obj.tutorial()        obj.portal()    }}
Output:
Scala tutorial
Welcome!! GeeksforGeeks

Scala
Scala-OOPS
Scala
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Scala Lists
Scala List filter() method with example
Scala Tutorial – Learn Scala with Step By Step Guide
Scala Map
Type Casting in Scala
Scala List contains() method with example
Throw Keyword in Scala
Scala String substring() method with example
Lambda Expression in Scala
Scala | Option
How to delete all the tags of the azure resource using PowerShell?

To delete all the tags of the Azure VM using PowerShell, we need to use the Remove-AZTag command.
To delete the azure resource tags, we need its resource ID but before that, it is always better to take azure resource tags backup. You can search the question on the TutorialPoints site or google,
Site − TutorialsPoint.com How to Export the Azure VM tags using PowerShell?
To delete the azure Resource Tags,
PS C:\> $vm = Get-AzVM -Name Testmachine2k16
PS C:\> Remove-AzTag -ResourceId $vm.Id -Verbose
To remove the azure resourceGroup tags,
PS C:\> $rg = Get-AzResourceGroup AnsibleTestRG
PS C:\> Remove-AzTag -ResourceId $rg.ResourceId -Verbose
To remove the individual tag, you can directly apply the tag name but be cautious as it will remove the given tag name across all the subscriptions.
The below command will remove the tag from the entire subscription if it is not associated with multiple resources.
Remove-AzTag -Name 'Owner' -Value 'Chirag' -Verbose
If you have done something wrong while removing tags and if you have already a TAGS backup, you can search on the google article to import the tags again.
Site − TutorialsPoint.com How to import tags in Azure?
How to Install Flutter For Web? - GeeksforGeeks

13 Oct, 2021
Flutter is Google’s platform-independent technology for creating applications that can run on multiple platforms. This open-source UI software development kit allows you to reuse most of your code across platforms, which can significantly lower your budget costs.
Cross-Platform DevelopmentHot ReloadRich Widgets
Cross-Platform Development
Hot Reload
Rich Widgets
In this article, we will show you the installation process of Flutter.  
The steps for installing Flutter are as follows:
Step1: Click on this link and select your operating system.
Select your operating system
Step 2: Get the latest stable version of Flutter SDK by downloading the following installation package 
Click on the blue button
Unzip the zip file and place it in your desired installation location. (Eg: Documents folder)
Warning: Do not install Flutter in a directory like C:\Program Files\ that requires elevated privileges. 
Step 3: Update your path
To run Flutter commands from the normal Windows console, follow these steps to add Flutter to the PATH environment variable:  
From the start search bar, type env and select Edit environment variables for your account.  
Click on Environment Variables
In User Variables, look for an entry named Path : 
Double click on Path 
On double-clicking on Path (or click on Path and then click on Edit button), another tab will pop- up:
Click on the ‘New’ button on the left side and add C:\flutter\bin. Click OK.
You must close and reopen any existing console windows for these changes to take effect.
Step 4: Set up an IDE
You can create applications with Flutter using any text editor combined with command-line tools. However, it is recommended to use Flutter editor plugins for an even better experience. These plugins give you code completion, syntax highlighting, widget editing aids, launch and debugging support, and more.
Step 5: Install Flutter plugin
Start VS Code.Invoke View > Command Palette....Type “install”, and select Extensions: Install Extensions.Type “flutter” in the extensions search field, select Flutter in the list and click Install. This also installs the required Dart plugin.
Start VS Code.
Invoke View > Command Palette....
Type “install”, and select Extensions: Install Extensions.
Type “flutter” in the extensions search field, select Flutter in the list and click Install. This also installs the required Dart plugin.
Install Flutter plugin
Now you can start building your application using Flutter.
how-to-install
Picked
TrueGeek-2021
How To
Installation Guide
TrueGeek
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
How to Install FFmpeg on Windows?
How to Set Git Username and Password in GitBash?
How to Add External JAR File to an IntelliJ IDEA Project?
How to Install Jupyter Notebook on MacOS?
How to Create and Setup Spring Boot Project in Eclipse IDE?
Installation of Node.js on Linux
How to Install FFmpeg on Windows?
How to Install Pygame on Windows ?
How to Add External JAR File to an IntelliJ IDEA Project?
How to Install Jupyter Notebook on MacOS?
Fade In Up Animation Effect with CSS

To implement Fade In Up Animation Effect on an image with CSS, you can try to run the following code −
Live Demo
<html>
   <head>
      <style>

         .animated {
            background-image: url(/css/images/logo.png);
            background-repeat: no-repeat;
            background-position: left top;
            padding-top:95px;
            margin-bottom:60px;
            -webkit-animation-duration: 10s;
            animation-duration: 10s;
            -webkit-animation-fill-mode: both;
            animation-fill-mode: both;
         }

         @-webkit-keyframes fadeIn {
            0% {opacity: 0;}
            100% {opacity: 1;}
         }

         @keyframes fadeIn {
            0% {opacity: 0;}
            100% {opacity: 1;}
         }

         .fadeIn {
            -webkit-animation-name: fadeIn;
            animation-name: fadeIn;
         }
      </style>
   </head>
   <body>

      <div id="animated-example" class="animated fadeIn"></div>
      <button onclick="myFunction()">Reload page</button>

      <script>
         function myFunction() {
            location.reload();
         }
      </script>
   </body>
</html>
How to create three-dimensional arrays of different sizes in R?

A three-dimensional array can have matrices of different size and they are not necessarily to be square or rectangular. Also, all the elements in an array are of same data type. To create a three-dimensional array of different size we would need to use the proper number of rows and columns within the array function.
 Live Demo
A1<-array(c(1:4,5:8,9:12),c(2,2,3))
A1
, , 1
[,1] [,2]
[1,] 1 3
[2,] 2 4
, , 2
[,1] [,2]
[1,] 5 7
[2,] 6 8
, , 3
[,1] [,2]
[1,] 9 11
[2,] 10 12
 Live Demo
A2<-array(c(rpois(4,1),rpois(4,5),rpois(4,8)),c(2,2,3))
A2
, , 1
[,1] [,2]
[1,] 1 2
[2,] 1 0
, , 2
[,1] [,2]
[1,] 2 4
[2,] 4 6
, , 3
[,1] [,2]
[1,] 8 2
[2,] 5 9
 Live Demo
A3<-array(c(rpois(10,1),rpois(10,5),rpois(10,8)),c(2,5,3))
A3
, , 1
[,1] [,2] [,3] [,4] [,5]
[1,] 1 0 1 1 0
[2,] 2 0 1 1 1
, , 2
[,1] [,2] [,3] [,4] [,5]
[1,] 7 4 8 5 4
[2,] 4 4 6 4 6
, , 3
[,1] [,2] [,3] [,4] [,5]
[1,] 5 4 11 9 7
[2,] 3 9 10 11 4
 Live Demo
A4<-array(c(rnorm(25,1,0.25),rnorm(25,5,3.2),rnorm(25,125,8)),c(5,5,3))
A4
, , 1
         [,1]       [,2]    [,3]       [,4]    [,5]
[1,] 0.9965280 1.2496879 1.0314247 0.708599 0.8077254
[2,] 0.7922626 1.0025704 0.7009782 1.142506 0.7445184
[3,] 1.0053649 0.5531278 1.4328092 1.385334 1.0892912
[4,] 0.9793857 1.3234864 0.5553419 1.215801 1.1023305
[5,] 1.3995579 1.0262346 1.2721514 1.394952 0.6184446
, , 2
         [,1]    [,2]       [,3]     [,4] [,5]
[1,] 6.174299 6.038592 12.470821 1.722607 1.069005
[2,] 3.789770 8.430932 8.747260 7.552801 3.886604
[3,] 1.730295 2.493142 3.465323 3.507519 3.834119
[4,] 6.075908 7.348407 4.118381 6.081857 4.167369
[5,] 4.130724 6.829041 7.469443 3.409544 5.808045
, , 3
      [,1]       [,2]     [,3]    [,4]    [,5]
[1,] 110.6113 119.8429 121.6303 122.9954 140.5715
[2,] 125.5317 122.1797 135.2451 119.5165 122.9406
[3,] 124.0559 119.0249 135.1922 114.0559 112.1363
[4,] 118.1446 119.0530 134.6688 118.8334 124.4825
[5,] 120.2941 109.3362 119.8095 129.1414 127.6529
 Live Demo
A5<-array(c(rexp(25,1.25),rexp(25,3.2),rexp(25,1.37)),c(5,5,3))
A5
, , 1
      [,1]       [,2]       [,3]       [,4]       [,5]
[1,] 1.3964752 0.14365375 0.1244120 0.006844883 0.1649243
[2,] 0.4146687 0.74798876 1.3172895 0.273072680 1.9675031
[3,] 0.5640029 0.05317204 0.1365023 1.139974748 0.4691554
[4,] 3.4377135 0.40737835 0.1296337 3.827344957 0.3062992
[5,] 0.5489296 0.68912311 0.9960337 1.891826684 0.6505368
, , 2
         [,1]        [,2]       [,3]       [,4]    [,5]
[1,] 0.461391444 0.14704248 1.7219179 0.26808968 0.01277777
[2,] 0.002633461 0.02843441 0.5924807 0.59324483 1.34762650
[3,] 0.296192070 0.38350989 0.3453407 0.14514950 0.21145723
[4,] 0.137173681 0.34683067 0.9046680 0.05949873 0.42690397
[5,] 0.171683422 0.12761626 0.3183557 0.01596812 0.04222600
, , 3
         [,1]       [,2]       [,3]       [,4]    [,5]
[1,] 0.7641526 0.78719016 0.96282362 0.02212902 0.3261842
[2,] 1.1584192 1.20147453 0.03766346 0.30549609 1.1452613
[3,] 0.5849248 1.97291039 0.52678525 0.78435948 0.0107882
[4,] 2.1916248 0.09176414 1.40056593 1.11841176 0.7624021
[5,] 0.1565796 1.35400081 0.26728881 0.36045571 0.3076494
Python - Pretty Print Numbers

The python module pprint is used for giving proper printing formats to various data objects in python. Those data objects can represent a  dictionary data type or even a data object containing the JSON data. In the below example we see how that data looks before applying the pprint module and after applying it.
import pprint

student_dict = {'Name': 'Tusar', 'Class': 'XII', 
     'Address': {'FLAT ':1308, 'BLOCK ':'A', 'LANE ':2, 'CITY ': 'HYD'}}

print student_dict
print "\n"
print "***With Pretty Print***"
print "-----------------------"
pprint.pprint(student_dict,width=-1)

When we run the above program, we get the following output −
{'Address': {'FLAT ': 1308, 'LANE ': 2, 'CITY ': 'HYD', 'BLOCK ': 'A'}, 'Name': 'Tusar', 'Class': 'XII'}


***With Pretty Print***
-----------------------
{'Address': {'BLOCK ': 'A',
             'CITY ': 'HYD',
             'FLAT ': 1308,
             'LANE ': 2},
 'Class': 'XII',
 'Name': 'Tusar'}

 Pprint can also handle JSON data by formatting them to a more readable format.
import pprint

emp = {"Name":["Rick","Dan","Michelle","Ryan","Gary","Nina","Simon","Guru" ],
   "Salary":["623.3","515.2","611","729","843.25","578","632.8","722.5" ],   
   "StartDate":[ "1/1/2012","9/23/2013","11/15/2014","5/11/2014","3/27/2015","5/21/2013",
      "7/30/2013","6/17/2014"],
   "Dept":[ "IT","Operations","IT","HR","Finance","IT","Operations","Finance"] }

x= pprint.pformat(emp, indent=2)
print x
   
When we run the above program, we get the following output −
{ 'Dept': [ 'IT',
            'Operations',
            'IT',
            'HR',
            'Finance',
            'IT',
            'Operations',
            'Finance'],
  'Name': ['Rick', 'Dan', 'Michelle', 'Ryan', 'Gary', 'Nina', 'Simon', 'Guru'],
  'Salary': [ '623.3',
              '515.2',
              '611',
              '729',
              '843.25',
              '578',
              '632.8',
              '722.5'],
  'StartDate': [ '1/1/2012',
                 '9/23/2013',
                 '11/15/2014',
                 '5/11/2014',
                 '3/27/2015',
                 '5/21/2013',
                 '7/30/2013',
                 '6/17/2014']}


    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
What are table rowspan and colspan in HTML?

The rowspan and colspan are <td> tag attributes. These are used to specify the number of rows or columns a cell should span. The rowspan attribute is for rows as well as the colspan attribute is for columns.
These attributes have numeric values, for example, colspan=3 will span three columns.You can try to run the following code to work with the rowspan and colspan attribute in HTML
<html>
   <head>
      <style>
         table, th, td {
            border: 1px solid black;
            width: 100px;
            height: 50px;
         }
      </style>
   </head>

   <body>
      <h1>Heading</h1>
      <table>
         <tr>
            <th colspan="2"></th>
            <th></th>
         </tr>
         <tr>
            <td></td>
            <td></td>
            <td rowspan="3"></td>
         </tr>
         <tr>
            <td></td>
            <td></td>
         </tr>
         <tr>
            <td></td>
            <td></td>
         </tr>
      </table>
   </body>
</html>
Print the given pattern recursively

Here, as per the given problem pattern needs to be displayed using recursive approach.
Recursive function is the one that calls itself n number of times. There can be ‘n’ number of recursive function in a program. The problem working with recursive function is their complexity.
START
Step 1 -> function int printpattern(int n)
   If n>0
      Printpattern(n-1)
      Print *
   End IF
End
Step 2 -> function int pattern(int n)
   If n>0
      pattern(n-1)
   End IF
   Printpattern(n)
   Print \n
End
STOP
#include <stdio.h>
int printpattern(int n) {
   if(n>0) {
      printpattern(n-1);
      printf("*");
   }
}
int pattern(int n) {
   if(n>0) {
      pattern(n-1); //will recursively print the pattern
   }
   printpattern(n); //will reduce the n recursively.
   printf("\n"); //for new line
}
int main(int argc, char const *argv[]) {
   int n = 7;
   pattern(n);
   return 0;
}
if we run above program then it will generate following output.
*
**
***
****
*****
******
*******
CSS | @page rule - GeeksforGeeks

24 Jan, 2022
The CSS @page rule defines the dimension of the page which is gonna be print. There are few important things should be under control when you want to print a web page those are listed below:  
The page size, orientation, margins, border, and padding.
Page breaks.
Headers and footers.
Page counters.
Orphans.
All the above things are controllable when you follow the @page rule.Syntax:  
@page [:left | :right | :first] {
    /* print-specific rules */
} 
Page Descriptor: There are three Descriptor in @page rule those are: 
size: Specify the size of page box’s containing block. 
html
@page {      size: A4; }
marks: It helps to trim the page that you want to print. 
html
@page {      marks: crop cross; }
bleed: It extend the bleed area of the box 
html
@page {      bleed: 7pt; }
Example: 
html
<!DOCTYPE html><html lang="en"><head><title>CSS @page rule</title><style type="text/css">     /* default for all pages */    @page {        margin: 2in;       }     /* margin on left page */    @page :left {        margin: 1in;       }         /* margin on right page */    @page :right {        margin: 3in;       }         /* top margin on first page */    @page :first {        margin-top: 5in;       }    h1{        color:green;    }</style></head><body>    <center>    <h1>GeeksforGeeks</h1>    <h2>CSS Page At-rule</h2>    <p>     If you open output in a new window and print the page     the margin around the text content appears differently     than it appears on the screen.    </p>    </center>     </body></html>
Output: When you choose to print the output screen of the above code. 
Supported Browsers: The browsers supported by CSS @page rule are listed below: 
Google Chrome 2.0
Internet Explorer 8.0
Safari 5.1
Opera 6.0
sumitgumber28
CSS-Properties
CSS
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
How to create footer to stay at the bottom of a Web page?
Types of CSS (Cascading Style Sheet)
Design a web page using HTML and CSS
Create a Responsive Navbar using ReactJS
How to Upload Image into Database and Display it using PHP ?
Roadmap to Become a Web Developer in 2022
Installation of Node.js on Linux
How to fetch data from an API in ReactJS ?
Top 10 Angular Libraries For Web Developers
Convert a string to an integer in JavaScript
float() in Python

17 Sep, 2021
Python float() function is used to return a floating-point number from a number or a string. 
Syntax:  float(x)
The method only accepts one parameter and that is also optional to use. Let us look at the various types of argument, the method accepts: 
A number: Can be an integer or a floating-point number.
A String :
Must contain numbers of any type.
Any left or right whitespaces or a new line is ignored by the method.
Mathematical Operators can be used.
Can contain NaN, Infinity or inf (any cases)
Values that the float() method can return depending upon the argument passed
If an argument is passed, then the equivalent floating-point number is returned.
If no argument is passed then the method returns 0.0.
If any string is passed that is not a decimal point number or does not match any cases mentioned above then an error will be raised.
If a number is passed outside the range of Python float then OverflowError is generated.
Python3
# Python program to illustrate# Various examples and working of float()# for integersprint(float(21.89)) # for floating point numbersprint(float(8)) # for integer type stringsprint(float("23")) # for floating type stringsprint(float("-16.54")) # for string floats with whitespacesprint(float("     -24.45   \n")) # for inf/infinityprint(float("InF"))print(float("InFiNiTy")) # for NaNprint(float("nan"))print(float("NaN")) # Error is generated at lastprint(float("Geeks"))
Output: 
21.89
8.0
23.0
-16.54
-24.45
inf
inf
nan
nan
All lines are executed properly but the last one will return an error: 
Traceback (most recent call last):
  File "/home/21499f1e9ca207f0052f13d64cb6be31.py", line 25, in 
    print(float("Geeks"))
ValueError: could not convert string to float: 'Geeks'
Python3
# Python program to illustrate# Various examples and working of float() # for inf/infinityprint(float("InF"))print(float("InFiNiTy")) # for NaNprint(float("nan"))print(float("NaN"))
Output:
inf
inf
nan
nan
Python3
# python code to convert int# floatnumber = 90result = float(number) print(result)
Output:
90.0
Python3
# python code to convert string# to floatstring = "90"result = float(string) print(result)
Output:
90.0
Python3
number = "geeks"try:    print(float(number))except ValueError as e:    print(e)
Output:
could not convert string to float: 'geeks'
kumar_satyam
Python-Built-in-functions
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Zoho Interview | Set 1 (On-Campus)

11 Aug, 2014
First Round: (Aptitude written round)This round consisted of two sections “Reasoning Aptitude” and “Technical Aptitude”. Reasoning section was more like puzzles so do concentrate on logical puzzles. Technical Aptitude dealt more with “operator precedence”, “pointers”, “iterations”, “dynamic memory allocations”.
Second Round: (Normal Programming round)1. Print the word with odd letters as
P         M
 R      A
   O  R
     G
  O    R
 R       A
P          M 
2. Given a set of numbers like <10, 36, 54,89,12> we want to find sum of weights based on the following conditions    1. 5 if a perfect square    2. 4 if multiple of 4 and divisible by 6    3. 3 if even number
And sort the numbers based on the weight and print it as follows
<10,its_weight>,<36,its weight><89,its weight>
Should display the numbers based on increasing order.
3. Save the string “WELCOMETOZOHOCORPORATION” in a two dimensional array and search for substring like “too” in the two dimensional string both from left to right and from top to bottom.
w	e	L	C	O
M	E	T	O	Z
O	H	O	C	O
R	P	O	R	A
T	I	O	n	  
And print the start and ending index as
Start index : <1,2>
End index: <3, 2>
4. Given a 9×9 sudoku we have to evaluate it for its correctness. We have to check both the sub matrix correctness and the whole sudoku correctness.
5. Given a two dimensional array of string like
  <”luke”, “shaw”>
  <”wayne”, “rooney”>
  <”rooney”, “ronaldo”>
  <”shaw”, “rooney”> 
Where the first string is “child”, second string is “Father”. And given “ronaldo” we have to find his no of grandchildren Here “ronaldo” has 2 grandchildren. So our output should be 2.
Third Round: (Advanced Programming Round)Here they asked us to create a “Railway reservation system” and gave us 4 modules. The modules were:    1. Booking    2. Availability checking    3. Cancellation    4. Prepare chartWe were asked to create the modules for representing each data first and to continue with the implementation phase.
Fourth Round: (Technical Round)Technical question which revolved around “data structures” and “OOPS”
Fifth Round: (HR round)Some general hr questions asked mainly about our projects and about certifications if we had one.
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Zoho
Interview Experiences
Strings
Zoho
Strings
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Tensorflow.js tf.data.zip() Function

09 Mar, 2022
Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js.
The tf.data.zip() function is used for creating a dataset by zipping together a dict, array, or nested structure of Dataset.
Syntax: 
tf.data.zip(datasets)
Parameters:
dataset: It is the set of data.
Return Value: It returns the tf.data.Dataset.
Example 1:
Javascript
// Importing the tensorflow.js libraryimport * as tf from "@tensorflow/tfjs" // Initializing Array dataset.let geek1 = tf.data.array([1, 2, 3, 4]);let geek2 = tf.data.array([5, 6, 7, 8]); // Zipping dataset of objects.let geek3 = tf.data.zip([geek1, geek2]); // Printing the returned promise. await geek3.forEachAsync(function(geek){  console.log(JSON.stringify(geek))});
Output:
[1,5]
[2,6]
[3,7]
[4,8]
Example 2:
Javascript
// Importing the tensorflow.js libraryimport * as tf from "@tensorflow/tfjs" // Zipping two array dataset.let geek = tf.data.zip({    geek1: tf.data.array([1, 2, 3, 4]),    geek2: tf.data.array([5, 6, 7, 8])}); // Printing the result.await geek.forEachAsync(function(e){  console.log(JSON.stringify(e))});
Output:
{"geek1":1,"geek2":5}
{"geek1":2,"geek2":6}
{"geek1":3,"geek2":7}
{"geek1":4,"geek2":8}
Reference:   https://js.tensorflow.org/api/3.6.0/#tf.data.zip
sagartomar9927
Picked
Tensorflow.js
JavaScript
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
SGML Full Form - GeeksforGeeks

16 Dec, 2021
SGML stands for Standard Generalized Markup Language. It can be defined as the standard for defining generalized markup language for documents. 
It was developed and designed by the International Organization for Standards i.e ISO. HTML was theoretically an example of an SGML-based language until HTML 5, which browsers cannot parse as SGML for compatibility reasons. The SGML is extended from GML and later on it is extended to HTML and XML.
The extension of SGML files is:  
.sgml
Syntax:  
<NAME TYPE="user">
    Geeks for Geeks
</NAME>
SGML code typically looks like:  
HTML
<EMAIL>    <SENDER>        <PERSON>            <FIRSTNAME>GEEKSFOR GEEKS</LASTNAME>        </PERSON>    </SENDER>    <BODY>          <p>Hello, Welcome to GEEKF FOR GEEKS</p>      </BODY></EMAIL>
The SGML Declarations.
The Prologue, containing a DOCTYPE declaration with the various markup declarations that together make a DTD i.e Document Type Definition. 
The instance itself, containing one top-most element and its contents
Components of an SGML Document :
There are mainly three components of SGML document. They are – 
SGML DeclarationPrologDocument instance.
SGML Declaration
Prolog
Document instance.
It has the capability to encode the full structure of the document and can support any media type.
It is of much more use than HTML which provides capabilities to code visual representation and not to structure the real piece of information.
Separates content from appearance.
SGML files encoding is allowed for more complex formatting as compared to HTML.
The Stylesheets present in SGML make the content to use for different purposes.
Extremely flexible.
Well supported with many tools available because of ISO standard.
It may be typical to code software in SGML.
Tools that are used in SGML are expensive.
It may not be used widely.
Special software is required to run or to allow the document to display.
Creating DTD’s requires exacting software engineering.
jyoti369
gabaa406
ManasChhabra2
Picked
Full Form
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
RFID Full Form
BLOB Full Form
JPEG Full Form
CIDR Full Form
ODBC Full Form
FCFS Scheduling Full Form
DML Full Form
ASP Full Form
LRU Full Form
DBSCAN Full Form
How to create a client-side image-map in HTML5 ? - GeeksforGeeks

20 Oct, 2020
In this article, we will create a client-side image map by using an <img> tag. The <img> tag is used to add images on a webpage. This tag is an empty tag which means it can contain only a list of attributes and it has no closing tag.
Syntax:
<img src="url" alt="some_text" usemap="#mapname">
Example:
<!DOCTYPE html><html>  <head>    <title>        Define a client-side        image-map    </title></head>  <body>    <h2>        HTML5: How to define a        client-side image-map?    </h2>      <h4>        Inserted image        using <img> tag:    </h4>    <img src="https://www.geeksforgeeks.org/wp-content/uploads/gfgLogo.png"    alt="GeeksforGeeks logo"></body>  </html>
Output:
Supported Browsers:
Google Chrome
Internet Explorer
Firefox
Opera
Safari
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.
arorakashish0911
HTML-Misc
HTML5
HTML
Web Technologies
Web technologies Questions
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
HTML Cheat Sheet - A Basic Guide to HTML
REST API (Introduction)
Design a web page using HTML and CSS
Form validation using jQuery
Angular File Upload
Remove elements from a JavaScript Array
Installation of Node.js on Linux
Convert a string to an integer in JavaScript
How to fetch data from an API in ReactJS ?
Difference between var, let and const keywords in JavaScript
How to change the PyGame icon? - GeeksforGeeks

30 Apr, 2021
While building a video game, do you wish to set your image or company’s logo as the icon for a game? If yes, then you can do it easily by using set_icon() function after declaring the image you wish to set as an icon. Read the article given below to know more in detail. 
Syntax:
pygame_icon = pygame.image.load('#Enter the image')
pygame.display.set_icon(pygame_icon)
Step 1: First, import the library Pygame.
import pygame
Step 2: Now, construct the GUI game.
pygame.init()
Step 3: Further, set the dimensions of your GUI game.
screen = pygame.display.set_mode([#width of game, #height of game])
Step 4: Next, take the image as input that we wish to set as an icon.
img = pygame.image.load('#Enter the image')
Step 5: Then, set the image as an icon. The icon set will appear in the top-left corner when the game is in running state.
pygame.display.set_icon(img)
Step 6: Later on, set the running value for running the game.
running = True
Step 7: Set the things which you want your game to do when it is in a running state
while running:
   for event in pygame.event.get():
Step 7.1: Once the app is in a running state, make it quit if the user wants to quit.
       if event.type == pygame.QUIT:
           running = False
Step 7.2: Moreover, set the background color which you wish to see in your app.
   screen.fill(# RGB Value of Color)
Step 7.3: Then, make your app do whatever you want it do while being in a running state.
Step 7.4: After doing everything you wish to do, update the changes done.
   pygame.display.update()
Step 8: Finally, quit the GUI game
pygame.quit()
Below is the implementation.
Python
# Python program to change # the Pygame icon  # Import the library Pygameimport pygame  # Construct the GUI gamepygame.init()  # Set dimensions of game GUIscreen = pygame.display.set_mode([600, 400])  # Take image as inputimg = pygame.image.load('gfg_image.jpg')  # Set image as iconpygame.display.set_icon(img)  # Set running valuerunning = True  # Setting what happens when game # is in running statewhile running:    for event in pygame.event.get():          # Close if the user quits the game        if event.type == pygame.QUIT:            running = False      # Set the background color    screen.fill((255, 255, 0))      # Draw a circle on the screen    pygame.draw.circle(screen, (0, 0, 0), (300, 200), 75)      # Update the GUI game    pygame.display.update()  # Quit the GUI gamepygame.quit()
Output:
Picked
Python-PyGame
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
How to Install PIP on Windows ?
Selecting rows in pandas DataFrame based on conditions
How to drop one or multiple columns in Pandas Dataframe
Python | Get unique values from a list
Check if element exists in list in Python
How To Convert Python Dictionary To JSON?
Defaultdict in Python
Python | os.path.join() method
Create a directory in Python
Bar Plot in Matplotlib
CSS :focus Selector - GeeksforGeeks

21 Oct, 2021
The :focus CSS pseudo-class Selector is used to target the focused element ie., it selects an element that is currently focused by the user. This selector works on user input elements, generally used in forms, and is triggered as soon as the user clicks on it or taps on an element, or selects any keyboard events.
Syntax:
:focus {
  // CSS property
}
Example: This example illustrates the :focus selector to target the selected element.
HTML
<!DOCTYPE html><html><head>    <style>    input:focus {        background-color: limegreen;    }    </style></head> <body>    <h3>Fill this form</h3>    <form> Full name:        <input type="text"               placeholder="Enter Name"               name="name">        <br> User Id:        <input type="text"               placeholder="Enter Username"               name="uid">        <br> Password:        <input type="password"               placeholder="Enter Password"               name="pass">        <br>        <button type="button"                onclick="#">Sign Up</button>    </form></body></html>
Output:
Supported Browsers:
Google Chrome 4.0
Microsoft Edge 12.0
Internet Explorer 8.0
Firefox 2.0
Safari 3.1
Opera 9.6
bhaskargeeksforgeeks
CSS-Selectors
CSS
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to insert spaces/tabs in text using HTML/CSS?
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to update Node.js and NPM to next version ?
How to create footer to stay at the bottom of a Web page?
How to apply style to parent if it has child with CSS?
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?
AngularJS - First Application

Before creating actual Hello World ! application using AngularJS, let us see the parts of a AngularJS application. An AngularJS application consists of following three important parts −
ng-app − This directive defines and links an AngularJS application to HTML.
ng-app − This directive defines and links an AngularJS application to HTML.
ng-model − This directive binds the values of AngularJS application data to HTML input controls.
ng-model − This directive binds the values of AngularJS application data to HTML input controls.
ng-bind − This directive binds the AngularJS Application data to HTML tags.
ng-bind − This directive binds the AngularJS Application data to HTML tags.
Being a pure JavaScript framework, it can be added using <Script> tag.
<script 
   src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js">
</script>

<div ng-app = "">
   ...
</div>

<p>Enter your Name: <input type = "text" ng-model = "name"></p>

<p>Hello <span ng-bind = "name"></span>!</p>

Use the above-mentioned three steps in an HTML page.
<html>
   <head>
      <title>AngularJS First Application</title>
   </head>
   
   <body>
      <h1>Sample Application</h1>
      
      <div ng-app = "">
         <p>Enter your Name: <input type = "text" ng-model = "name"></p>
         <p>Hello <span ng-bind = "name"></span>!</p>
      </div>
      
      <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js">
      </script>
      
   </body>
</html>
Open the file testAngularJS.htm in a web browser. Enter your name and see the result.
Enter your Name: 
Hello !
The ng-app directive indicates the start of AngularJS application.
The ng-app directive indicates the start of AngularJS application.
The ng-model directive creates a model variable named name, which can be used with the HTML page and within the div having ng-app directive.
The ng-model directive creates a model variable named name, which can be used with the HTML page and within the div having ng-app directive.
The ng-bind then uses the name model to be displayed in the HTML <span> tag whenever user enters input in the text box.
The ng-bind then uses the name model to be displayed in the HTML <span> tag whenever user enters input in the text box.
Closing</div> tag indicates the end of AngularJS application.
Closing</div> tag indicates the end of AngularJS application.

    16 Lectures 
     1.5 hours 

 Anadi Sharma

    40 Lectures 
     2.5 hours 

 Skillbakerystudios
 Print
 Add Notes
 Bookmark this page
How to remove an element from a list by index in Python?

There are two options to remove an element by its index in list. Using del statement, and using pop() method.
The del statement needs index of the element to remove.
>>> L1=[11,22,33,44,55,66,77]
>>> del L1[2]
>>> L1
[11, 22, 44, 55, 66, 77]
The pop() method of built-in list class requires index as argument. The method returns the removed elements and reduces contents of list by one element.
>>> L1=[11,22,33,44,55,66,77]
>>> x=L1.pop(2)
>>> x
33
>>> L1
[11, 22, 44, 55, 66, 77]