code-rag-bench/online-tutorials huggingface dataset:
UInt64.MaxValue Field in C# with Examples - GeeksforGeeks

01 May, 2019
The MaxValue field of UInt64 Struct is used to represent the maximum value of the 64-bit unsigned long integer. The value of this field is constant means that the user cannot change the value of this field. The value of this field is 18446744073709551615. Its hexadecimal value is 0xFFFFFFFFFFFFFFFF. It is used to avoid the OverflowException at runtime.
Syntax:
public const ulong MaxValue = 18446744073709551615;
Return Value: This field always returns 18446744073709551615.
Example:
// C# program to illustrate the// UInt64.MaxValue Fieldusing System;  class GFG {      // Main Method    static public void Main()    {        // display the Maximum        // value of UInt64 struct        Console.WriteLine("Maximum Value is: " + UInt64.MaxValue);          // taking a variable        ulong var1 = 93422337368375807;          if (var1.Equals(UInt64.MaxValue))        {            Console.WriteLine("Equal..!!");            Console.WriteLine("Type of var1 is: {0}",                                 var1.GetTypeCode());        }          else         {            Console.WriteLine("Not equal..!!");            Console.WriteLine("Type of var1 is: {0}",                                 var1.GetTypeCode());        }    }}
Output:
Maximum Value is: 18446744073709551615
Not equal..!!
Type of var1 is: UInt64

Reference:
https://docs.microsoft.com/en-us/dotnet/api/system.uint64.maxvalue?view=netstandard-2.1
CSharp-UInt64-Struct
C#
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
C# | Class and Object
C# | Constructors
Introduction to .NET Framework
Difference between Ref and Out keywords in C#
C# | Abstract Classes
C# | Delegates
Extension Method in C#
C# | Data Types
HashSet in C# with Examples
Common Language Runtime (CLR) in C#
Draw any polygon in Turtle - Python - GeeksforGeeks

10 Feb, 2020
Prerequisite: Python Turtle Basics
Turtle is an inbuilt module of python. It enables us to draw any drawing by a turtle and methods defined in the turtle module and by using some logical loops. turtle drawings are basically drawn using four methods defined in the turtle module.
forward(x): moves the turtle(pen) in the forward direction by x unit.
backward(x): moves the turtle(pen) in the backward direction by x unit.
right(n): rotate the turtle(pen) by n degree in clockwise direction.
left(n): rotate the turtle(pen) by n degree in anticlockwise direction.
In this article, we will learn how to draw different shaped Polygons using Turtle module. Given the number of sides (n) and length of sides (l), one can easily draw any polygon shape. Let’s try to understand it better with the help of examples.
# draw any polygon in turtle  import turtle  # creating turtle pent = turtle.Turtle()  # taking input for the no of the sides of the polygonn = int(input("Enter the no of the sides of the polygon : "))  # taking input for the length of the sides of the polygonl = int(input("Enter the length of the sides of the polygon : "))    for _ in range(n):    turtle.forward(l)    turtle.right(360 / n)
Input :
10
100
Output :
Input :
3
150
Output :
Input :
4
150
Output :
Python-turtle
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python Dictionary
Read a file line by line in Python
Enumerate() in Python
How to Install PIP on Windows ?
Iterate over a list in Python
Different ways to create Pandas Dataframe
Python String | replace()
Python program to convert a list to string
Create a Pandas DataFrame from Lists
Reading and Writing to text files in Python
Display <div> or <span> over image on :hover in HTML

In order to allow div or span element to appear over an image when mouse hover over the image, this can be done with the help of .image:hover overlay,
To position .overlay element absolutely relative to the parent element we give height and width to 100% for all image sizes making parent element inline-block
<div class="image">
   <img src="..." />
   <div class="overlay">Content to be displayed on hover</div>
</div>
By hiding the .overlay element by default, we use the selector .image:hover .overlay to change the styling on hover. Due to the HTML structure, this works well because .overlay is a descendant element.
.image {
   position:relative;
   display:inline-block;
}
.overlay {
   display:none;
}
.image:hover .overlay {
   width:100%;
   height:100%;
   background:rgba(0,0,0,.5);
   position:absolute;
   top:0;
   left:0;
   display:inline-block;
   -webkit-box-sizing:border-box;
   -moz-box-sizing:border-box;
   box-sizing:border-box;

   /* All other styling - see example */
   img {
      vertical-align:top;
   }
}
Update the date and time values while inserting them in MySQL

Here, we will see an example wherein we are inserting datetime and updating them while using INSERT query.
Let us first create a table −
mysql> create table DemoTable816 (DueDate datetime);
Query OK, 0 rows affected (0.45 sec)
Insert some records in the table using insert command. Here is the query to add (minutes / hours / days / months / years) to date when performing INSERT −
mysql> insert into DemoTable816 values(date_add(now(),interval 3 minute));
Query OK, 1 row affected (0.16 sec)
mysql> insert into DemoTable816 values(date_add('2018-01-21 00:00:00',interval 3 Hour));
Query OK, 1 row affected (0.52 sec)
mysql> insert into DemoTable816 values(date_add('2016-11-11 12:40:00',interval 3 Day));
Query OK, 1 row affected (0.17 sec)
mysql> insert into DemoTable816 values(date_add('2018-12-01 11:00:00',interval 3 Month));
Query OK, 1 row affected (0.18 sec)
mysql> insert into DemoTable816 values(date_add('2011-03-21 10:00:00',interval 3 Year));
Query OK, 1 row affected (0.16 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable816;
This will produce the following output -
+---------------------+
| DueDate             |
+---------------------+
| 2019-08-03 13:08:43 |
| 2018-01-21 03:00:00 |
| 2016-11-14 12:40:00 |
| 2019-03-01 11:00:00 |
| 2014-03-21 10:00:00 |
+---------------------+
5 rows in set (0.00 sec)
C++ | Exception Handling | Question 11 - GeeksforGeeks

28 Jun, 2021
What happens in C++ when an exception is thrown and not caught anywhere like following program.
#include <iostream>using namespace std;  int fun() throw (int){    throw 10;}  int main() {    fun();    return 0;}  
(A) Compiler error(B) Abnormal program termination(C) Program doesn’t print anything and terminates normally(D) None of the aboveAnswer: (B)Explanation: When an exception is thrown and not caught, the program terminates abnormally.Quiz of this Question
C++-Exception Handling
Exception Handling
C Language
C++ Quiz
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
fork() in C
Command line arguments in C/C++
Function Pointer in C
Substring in C++
Structures in C
C++ | Inheritance | Question 7
C++ | new and delete | Question 4
C++ | Operator Overloading | Question 10
C++ | Inheritance | Question 1
C++ | Virtual Functions | Question 2
Explain the equals() method of the Object, String and, StringBuffer classes.

To compare two objects the object class provides a method with name equals(), this method accepts an object and compares it with the current object. If the references of these two objects are equal, then it returns true else this method returns false.
In the following example we have a class Employee with two variables name, age and a parameterized constructor.
From the main method we are creating two objects by passing same values and, comparing both values using the equals() method.
Since the equals() method of the Object class returns true only if the references of the two objects are equal, this program returns false.
 Live Demo
import java.util.Scanner;
class Employee {
   private String name;
   private int age;
   Employee(String name, int age){
      this.name = name;
      this.age = age;
   }
}
public class EqualsExample {
   public static void main(String[] args) {
      Scanner sc =new Scanner(System.in);
      System.out.println("Enter your name ");
      String name = sc.next();
      System.out.println("Enter your age ");
      int age = sc.nextInt();
      Employee emp1 = new Employee(name, age);
      Employee emp2 = new Employee(name, age);
      //Comparing the two objects
      boolean bool = emp1.equals(emp2);
      System.out.println(bool);
   }
}
Enter your name
Krishna
Enter your age
20
false
The equals() method of the String class is not same as the equals() method of the Object class. It is overridden, this method accepts a String value and compares it with the current object and returns true only if the character sequences in the both String objects are exactly same.
In the following example we are accepting values from the user, creating two String objects and comparing them using the equals() method and displaying the results.
Since the equals method returns true only if you enter same character sequences. You need to enter same values to print true.
 Live Demo
import java.util.Scanner;
public class StringEquals {
   public static void main(String[] args) {
      Scanner sc =new Scanner(System.in);
      System.out.println("Enter a name ");
      String name1 = sc.next();
      System.out.println("Enter another name ");
      String name2 = sc.next();
      //Comparing the two objects
      boolean bool = name1.equals(name2);
      System.out.println(bool);
   }
}
Enter a name
Krishna
Enter another name
Krishna
true
But, unlike the Sting class the StringBuffer does not override the equals() method. Its functionality is same as in the Object class.
Therefore, to get true you need to compare references pointing to the same value using the equal method.
 Live Demo
import java.util.Scanner;
public class StringEquals implements Cloneable{
   public static void main(String[] args) {
      Scanner sc =new Scanner(System.in);
      System.out.println("Enter a name ");
      StringBuffer name1 = new StringBuffer(sc.next());
      StringBuffer name2 = name1;
      //Comparing the two objects
      boolean bool = name1.equals(name2);
      System.out.println(bool);
   }
}
Enter a name
krishna
true
How to horizontally center a widget using a grid() in Tkinter?

As the name suggests, a grid is nothing but a set of rows and columns. Tkinter grid manager works similarly; it places the widget in a 2-dimensional plane to align the device through its position vertically and horizontally.
Let us consider an example where we want to make the widget centered in the window while resizing it. The grid(row, column) property will help to make the label widget centered horizontally, and the sticky property will avoid resizing the widget in the window.
#Import tkinter library
from tkinter import *
#Create an instance of Tkinter frame or window
win= Tk()
#Set the geometry of tkinter frame
win.geometry("750x250")
#Make the window sticky for every case
win.grid_rowconfigure(0, weight=1)
win.grid_columnconfigure(0, weight=1)
#Create a Label
label=Label(win, text="This is a Centered Text",font=('Aerial 15 bold'))
label.grid(row=2, column=0)
label.grid_rowconfigure(1, weight=1)
label.grid_columnconfigure(1, weight=1)
win.mainloop()
The above code will display a window containing a text label widget centered horizontally. When we resize the window, it will not affect the widget’s position.
How to set up your python development environment on AWS?

You need to have Python, pip, virtualenv, awswebcli and a SSH client installed to set up your Python Development Environment on AWS. You can follow instructions at http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html to install these.
Once you have all those installed, you need to set up a virtual environment so that your global packages do not get polluted. Use the following command to set up a virtual environment:
$ virtualenv -p python2.7 /tmp/hello-world
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in /tmp/hello-world/bin/python2.7
Also creating executable in /tmp/hello-world/bin/python
Installing setuptools, pip...done.
Once your virtual environment is ready, start it by running the activate script located in the environment's bin directory. For example, to start the hello-world environment created in the previous step, you would type:
$ . /tmp/hello-world/bin/activate
Once created, you can restart the virtual environment at any time by running its activate script again.
To configure a Python application for deployment, from within your virtualenv, return to the top of your project's directory tree and create a requirements.txt file that contains your app's requirements(third party modules you are importing) with their version numbers(or without if you need latest one). For example,
Flask==0.8
Jinja2==2.6
Werkzeug==0.8.3
certifi==0.0.8
chardet==1.0.1 :
...
Alternatively you can use pip to get all installed packages from your machine to the requirements.txt file using:
$ pip freeze >requirements.txt
This allows AWS to replicate your application's Python environment using the same packages and same versions that you used to develop and test your application.
Now configure AWS EB CLI repository with the 'eb init' command.
$ eb init -p python2.7 hello-world
Application hello-world has been created.
This command creates a new application named hello-world and configures your local repository to create environments with the latest Python 2.7 platform configuration. Run eb init again to configure a default keypair so that you can connect to the EC2 instance running your application with SSH
$ eb init
Do you want to set up SSH for your instances?
(y/n): y
Select a keypair.
1) my-keypair
2) [ Create new KeyPair ]
Select a key pair if you have one already, or follow the prompts to create a new one. If you don't see the prompt or need to change your settings later, run eb init -i. Create an environment and deploy you application to it with eb create:
$ eb create hello-env
This command creates a load balanced Elastic Beanstalk environment named hello-env.
If you face any issues, you can check more detailed documentation here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html#python-django-configure-for-eb
Python Pandas – Check for Null values using notnull()

The notnull() method returns a Boolean value i.e. if the DataFrame is having null value(s), then False is returned, else True.
Let’s say the following is our CSV file with some NaN i.e. null values −
Let us first read the CSV file −
dataFrame = pd.read_csv("C:\\Users\\amit_\\Desktop\\CarRecords.csv")
Checking for not null values −
res = dataFrame.notnull()
Now, on displaying the DataFrame, the CSV data will be displayed in the form of True and False i.e. boolean values because notnull() returns boolean. For Null values, False will get displayed. For Not-Null values, True will get displayed.
Following is the complete code −
import pandas as pd

# reading csv file
dataFrame = pd.read_csv("C:\\Users\\amit_\\Desktop\\CarRecords.csv")
print("DataFrame...\n",dataFrame)

# count the rows and columns in a DataFrame
print("\nNumber of rows and column in our DataFrame = ",dataFrame.shape)

res = dataFrame.notnull()
print("\nDataFrame displaying False for Null (NaN) value = \n",res)

dataFrame = dataFrame.dropna()
print("\nDataFrame after removing null values...\n",dataFrame)
print("\n(Updated) Number of rows and column in our DataFrame = ",dataFrame.shape)
This will produce the following output −
DataFrame...
           Car       Place   UnitsSold
0         Audi   Bangalore        80.0
1      Porsche      Mumbai       110.0
2   RollsRoyce        Pune         NaN
3          BMW       Delhi       200.0
4     Mercedes   Hyderabad        80.0
5  Lamborghini  Chandigarh         NaN
6         Audi      Mumbai         NaN
7     Mercedes        Pune       120.0
8  Lamborghini       Delhi       100.0

Number of rows and column in our DataFrame = (9, 3)

DataFrame displaying False for Null values =
    Car   Place   UnitsSold
0  True    True        True
1  True    True        True
2  True    True       False
3  True    True        True
4  True    True        True
5  True    True       False
6  True    True       False
7  True    True        True
8  True    True        True

DataFrame after removing null values...
           Car      Place   UnitsSold
0         Audi  Bangalore        80.0
1      Porsche     Mumbai       110.0
3          BMW      Delhi       200.0
4     Mercedes  Hyderabad        80.0
7     Mercedes       Pune       120.0
8  Lamborghini      Delhi       100.0

(Updated)Number of rows and column in our DataFrame = (6, 3)
How can we sort a JTable on a particular column in Java?

A JTable is a subclass of JComponent class for displaying complex data structures. A JTable component can follow the Model View Controller (MVC) design pattern for displaying the data in rows and columns. A JTable can generate TableModelListener, TableColumnModelListener, ListSelectionListener, CellEditorListener, RowSorterListener interfaces. We can sort a JTable in a particular column by using the method setAutoCreateRowSorter() and set to true of JTable class.
import java.awt.*;
import javax.swing.*;
public final class JTableSorterTest extends JFrame {
   private JTable table;
   private JScrollPane scrollPane;
   public JTableSorterTest() {
      setTitle("JTableHeaderHide Test");
      String[] columnNames = {"Name", "Age", "City"};
      Object[][] data = {{"Raja", "35", "Hyderabad"}, {"Adithya", "25", "Chennai"}, {"Vineet", "23",       "Mumbai"}, {"Archana", "32", "Pune"}, {"Krishna", "30", "Kolkata"}};
      table = new JTable(data, columnNames);
      scrollPane= new JScrollPane(table);
      table.setAutoCreateRowSorter(true); // sorting of the rows on a particular column
      add(scrollPane, BorderLayout.CENTER);
      setSize(375, 250);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      setLocationRelativeTo(null);
      setVisible(true);
   }
   public static void main(String[] args) {
      new JTableSorterTest();
   }
}
Get the minimum value from a list with multiple columns in MySQL?

Let us first create a table −
mysql> create table DemoTable756 (
   Value1 int,
   Value2 int,
   Value3 int
);
Query OK, 0 rows affected (0.62 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable756 values(10,20,14);
Query OK, 1 row affected (0.22 sec)
mysql> insert into DemoTable756 values(20,34,17);
Query OK, 1 row affected (0.12 sec)
mysql> insert into DemoTable756 values(200,134,789);
Query OK, 1 row affected (0.19 sec)
mysql> insert into DemoTable756 values(139,98,99);
Query OK, 1 row affected (0.17 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable756;
This will produce the following output -
+--------+--------+--------+
| Value1 | Value2 | Value3 |
+--------+--------+--------+
|     10 |     20 |     14 |
|     20 |     34 |     17 |
|    200 |    134 |    789 |
|    139 |     98 |     99 |
+--------+--------+--------+
4 rows in set (0.00 sec)
Following is the query to get minimum value from a list with multiple columns −
mysql> select least(Value1,Value2,Value3) from DemoTable756;
This will produce the following output -
+-----------------------------+
| least(Value1,Value2,Value3) |
+-----------------------------+
|                          10 |
|                          17 |
|                         134 |
|                          98 |
+-----------------------------+
4 rows in set (0.00 sec)
How to make the corners of a button round in iOS?

You might come across a scenarios where you received a UI where the buttons are rounded, and you might wonder how to do that? So here we will see how to make corners of a button round.
We will be seeing both the ways to make the button rounded, one using Storyboard and another programmatically.
Let’s get started! First we will make the corners of button rounded using Storyboard.
Step 1 − Open Xcode → New Projecr → Single View Application → Let’s name it “RoundedButton”
Step 2 − Open Main.storyboard and add a button as show below
Step 3 − Now select the button and tap on Utility area and update the User Defined Runtime Attributes to below value.
Now this value you can modify i.e increase or decrease based on requirement.
In the second method we are going to make the corner rounded Programmatically.
From the Main.storyboard get the @IBOutlet in ViewController.swift and name it “doButtonRounded” and update the same property layer.cornerRadius.
Use the below code for complete reference.
import UIKit
class ViewController: UIViewController {
   @IBOutlet var doButtonRounded: UIButton!
   override func viewDidLoad() {
      super.viewDidLoad()
      doButtonRounded.layer.cornerRadius = 20
   }
}
Pseudo-terminal Utilities in Python

The Pseudo-terminal utility module pty is defined to handle pseudo-terminal concepts. Using this we can start another process, and also can read or write from controlling terminal using programs.
This module is highly platform oriented. We should use UNIX systems to perform these operations.
To use the pty module, we should import it using −
import pty

There are some modules of the pty module, these are −
This method is used to connect the child controlling terminal to pseudo-terminal. This method returns the pid and the fd. The child process gets the pid 0, but the fd is invalid. The return value of the parent is the pid of the child process and the fd holds the child controlling terminal.
This method is used to open a new pseudo-terminal pair. It returns a file descriptor for the master and the slave.
The spawn process is used to connect its controlling terminal with current processes standard io. The master_read and stdin_read read from the file descriptor. The default size is 1024 bytes.
import pty, os
def process_parent_child():
   (process_id, fd) = pty.fork()
   print("The Process ID for the Current process is: " + str(os.getpid()))
   print("The Process ID for the Child process is: " + str(process_id))
process_parent_child()
master, slave = pty.openpty()
print('Name of the Master: ' + str(os.ttyname(master)))
print('Name of the Slave: ' + str(os.ttyname(slave)))
The Process ID for the Current process is: 12508
The Process ID for the Child process is: 12509
Name of the Master: /dev/ptmx
Name of the Slave: /dev/pts/2
How to create a sticky image with CSS?

Following is the code to create a sticky image with CSS −
 Live Demo
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
img {
   position: sticky;
   top: 0;
   width: 300px;
   height: 300px;
}
</style>
</head>
<body>
<h1>Some header text</h1>
<img src="https://i.picsum.photos/id/721/400/400.jpg">
<h1>Some header text</h1>
<h1>Some header text</h1>
<h1>Some header text</h1>
<p style="font-size: 40px;">Lorem ipsum dolor sit amet consectetur adipisicing elit. Fugiat odio ratione officia quod qui blanditiis animi! Repudiandae culpa recusandae dolor id soluta porro commodi quidem, incidunt voluptatum vitae similique nesciunt obcaecati odit enim repellat doloribus. Explicabo quisquam in beatae earum?</p>
</body>
</html>
The above code will produce the following output −
On scrolling down a little the image will stay at its place as shown in the below output −
How to count and sum a field between 2 dates in MongoDB?

Use aggregation gteandlte along with $sum to count and sum a field between 2 dates. Let us first create a collection with documents −
> db.countandsumdemo.insertOne({"Value":10,"created_at":ISODate('2019-10-11')});
{
   "acknowledged" : true,
   "insertedId" : ObjectId("5e038e6df5e889d7a51994fa")
}
> db.countandsumdemo.insertOne({"Value":50,"created_at":ISODate('2019-01-31')});
{
   "acknowledged" : true,
   "insertedId" : ObjectId("5e038e77f5e889d7a51994fb")
}
> db.countandsumdemo.insertOne({"Value":100,"created_at":ISODate('2019-06-31')});
{
   "acknowledged" : true,
   "insertedId" : ObjectId("5e038e8af5e889d7a51994fc")
}
Following is the query to display all documents from a collection with the help of find() method −
> db.countandsumdemo.find().pretty();
This will produce the following output −
{
   "_id" : ObjectId("5e038e6df5e889d7a51994fa"),
   "Value" : 10,
   "created_at" : ISODate("2019-10-11T00:00:00Z")
}
{
   "_id" : ObjectId("5e038e77f5e889d7a51994fb"),
   "Value" : 50,
   "created_at" : ISODate("2019-01-31T00:00:00Z")
}
{
   "_id" : ObjectId("5e038e8af5e889d7a51994fc"),
   "Value" : 100,
   "created_at" : ISODate("2019-07-01T00:00:00Z")
}
Following is the query to count and sum a field between 2 dates −
> db.countandsumdemo.aggregate(
...    [{
...       $match: {
...          created_at: {
...             $gte: new Date('2019-05-01'),
...             $lte: new Date('2019-12-31')
...          }
...       }
...    }, {
... $group: {
...    _id: null,
...    SUM: {
...       $sum: "$Value"
...    },
...    COUNT: {
...       $sum: 1
...    }
... }
... }]
... );
This will produce the following output −
{ "_id" : null, "SUM" : 110, "COUNT" : 2 }
How to map C++ enums to strings?

Here we will see how to map some enum type data to a string in C++. There is no such direct function to do so. But we can create our own function to convert enum to string.
We shall create a function that takes an enum value as the argument, and we manually return the enum names as a string from that function.
 Live Demo
#include <iostream>
using namespace std;

enum Animal {Tiger, Elephant, Bat, Dog, Cat, Mouse};

string enum_to_string(Animal type) {
   switch(type) {
      case Tiger:
         return "Tiger";
      case Elephant:
         return "Elephant";
      case Bat:
         return "Bat";
      case Dog:
         return "Dog";
      case Cat:
         return "Cat";
      case Mouse:
         return "Mouse";
      default:
         return "Invalid animal";
   }
}

int main() {
   cout << "The Animal is : " << enum_to_string(Dog) << " Its number: " << Dog <<endl;
   cout << "The Animal is : " << enum_to_string(Mouse) << " Its number: " << Mouse << endl;
   cout << "The Animal is : " << enum_to_string(Elephant) << " Its number: " << Elephant;
}
The Animal is : Dog Its number: 3
The Animal is : Mouse Its number: 5
The Animal is : Elephant Its number: 1
JavaScript - Date getTime() Method

Javascript date getTime() method returns the numeric value corresponding to the time for the specified date according to universal time. The value returned by the getTime method is the number of milliseconds since 1 January 1970 00:00:00.
You can use this method to help assign a date and time to another Date object.
Its syntax is as follows −
Date.getTime()

Returns the numeric value corresponding to the time for the specified date according to universal time.
Try the following example.
<html>
   <head>
      <title>JavaScript getTime Method</title>
   </head>
   
   <body>   
      <script type = "text/javascript">
         var dt = new Date( "December 25, 1995 23:15:20" );
         document.write("getTime() : " + dt.getTime() ); 
      </script>      
   </body>
</html>

    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
Python Program to delete a file

29 Dec, 2020
Ever wanted to delete a file, that too from a Python program, with a few lines of code? Well, you are in the right place. Today we are going to learn how we are going to be deleting a file by using Python.
Note: We will be importing the os library and going to use the os.remove() function to remove the desired file. If you don’t have os library, then open Command Prompt and write pip install os, to install the required os library.
Below is the Python implementation –
import osprint ("Enter 'quit' for exiting the program")filename = input('Enter the name of the file, that is to be deleted : ')if filename == 'quit':    exit()else:    print ('\nStarting the removal of the file !')    os.remove(filename)          print ('\nFile, ', filename, 'The file deletion is successfully completed !!')               
Output:The desired file to be deleted:
Sample run of the program
When we enter the name of the file to be deleted:
The deletion:
The Working:
Python os-module-programs
python-os-module
python-utility
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
How to drop one or multiple columns in Pandas Dataframe
Defaultdict in Python
Python | Get dictionary keys as a list
Python | Convert a list to dictionary
Python Program for Fibonacci numbers
Python | Split string into list of characters
Eigenvalues and Eigenvectors in MATLAB

20 Nov, 2021
Eigenvalues and Eigenvectors are properties of a square matrix.
Let is an N*N matrix, X be a vector of size N*1 and  be a scalar.
Then the values X,  satisfying the equation    are eigenvectors and eigenvalues of matrix A respectively.
A matrix of size N*N possess N eigenvalues
Every eigenvalue corresponds to an eigenvector.
Matlab allows the users to find eigenvalues and eigenvectors of matrix using eig() method. Different syntaxes of eig() method are:
e = eig(A)
[V,D] = eig(A)
[V,D,W] = eig(A)
e = eig(A,B)
Let us discuss the above syntaxes in detail:
It returns the vector of eigenvalues of square matrix A.
Matlab
% Square matrix of size 3*3A = [0 1 2;    1 0 -1;    2 -1 0];disp("Matrix");disp(A);  % Eigenvalues of matrix Ae = eig(A);disp("Eigenvalues");disp(e);
Output :
It returns the diagonal matrix D having diagonals as eigenvalues.
It also returns the matrix of right vectors as V.
Normal eigenvectors are termed as right eigenvectors.
V is a collection of N eigenvectors of each N*1 size(A is N*N size) that satisfies A*V = V*D
Matlab
% Square matrix of size 3*3A = [8 -6 2;    -6 7 -4;    2 -4 3];disp("Matrix");disp(A);  % Eigenvalues and right eigenvectors of matrix A[V,D] = eig(A);disp("Diagonal matrix of Eigenvalues");disp(D);disp("Right eigenvectors")disp(V);
Output :
Along with the diagonal matrix of eigenvalues D and right eigenvectors V, it also returns the left eigenvectors of matrix A.
A left eigenvector u is a 1*N matrix that satisfies the equation u*A = k*u, where k is a left eigenvalue of matrix A.
W is the collection of N left eigenvectors of A that satisfies W’*A = D*W’.
Matlab
% Square matrix of size 3*3A = [10 -6 2;    -6 7 -4;     2 -4 3];disp("Matrix :");disp(A);  % Eigenvalues and right and left eigenvectors % of matrix A[V,D,W] = eig(A);disp("Diagonal matrix of Eigenvalues :");disp(D);disp("Right eigenvectors :")disp(V);disp("Left eigenvectors :")disp(W);
Output :
It returns the generalized eigenvalues of two square matrices A and B of the same size.
A generalized eigenvalue λ and a corresponding eigenvector v satisfy Av=λBv.
Matlab
% Square matrix A and B of size 3*3A = [10 -6 2;    -6 7 -4;     2 -4 3];B = [8 6 1;     6 17 2;    -1 4 3];      disp("Matrix A:");disp(A);disp("Matrix B:");disp(B);  % Generalized eigen values % of matrices A and Be = eig(A,B);disp("Generalized eigenvalues :")disp(e);
Output :
surindertarika1234
Picked
Advanced Computer Subject
MATLAB
Matrix
Matrix
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
ML | Monte Carlo Tree Search (MCTS)
Copying Files to and from Docker Containers
Basics of API Testing Using Postman
Markov Decision Process
Getting Started with System Design
How to Find Index of Element in Array in MATLAB?
How to Remove Nan Values from a Matrix in MATLAB?
Edge detection using Prewitt, Scharr and Sobel Operator
Installing MATLAB on Linux
Turn a Matrix into a Row Vector in MATLAB
SQL - COUNT Function

SQL COUNT function is the simplest function and very useful in counting the number of records, which are expected to be returned by a SELECT statement.
To understand COUNT  function, consider an employee_tbl table, which is having the following records −
SQL> SELECT * FROM employee_tbl;
+------+------+------------+--------------------+
| id   | name | work_date  | daily_typing_pages |
+------+------+------------+--------------------+
|    1 | John | 2007-01-24 |                250 |
|    2 | Ram  | 2007-05-27 |                220 |
|    3 | Jack | 2007-05-06 |                170 |
|    3 | Jack | 2007-04-06 |                100 |
|    4 | Jill | 2007-04-06 |                220 |
|    5 | Zara | 2007-06-06 |                300 |
|    5 | Zara | 2007-02-06 |                350 |
+------+------+------------+--------------------+
7 rows in set (0.00 sec)
Now suppose based on the above table you want to count total number of rows in this table, then you can do it as follows −
SQL>SELECT COUNT(*) FROM employee_tbl ;
+----------+
| COUNT(*) |
+----------+
|        7 |
+----------+
1 row in set (0.01 sec)
Similarly, if you want to count the number of records for Zara, then it can be done as follows −
SQL>SELECT COUNT(*) FROM employee_tbl
   -> WHERE name="Zara";
+----------+
| COUNT(*) |
+----------+
|        2 |
+----------+
1 row in set (0.04 sec)
NOTE − All the SQL queries are case insensitive, so it does not make any difference if you give ZARA or Zara in WHERE CONDITION.
HTML | <link> target Attribute

13 Dec, 2021
The HTML <link> target Attribute is used to specify the window or a frame where the linked document is loaded. It is not supported by HTML 5.
Syntax:
<link target="_blank|_self|_parent|_top|framename">
Attribute Values:
_blank: It opens the link in a new window.
_self: It is the default value. It opens the linked document in the same frame.
_parent: It opens the linked document in the parent frameset.
_top: It opens the linked document in the full body of the window.
framename: It opens the linked document in the named frame.
Example:
<!DOCTYPE html> <html>       <head>    <title>        HTML link target Attribute    </title></head>  <body>     <center>         <h1 style="color:green;">             GeeksforGeeks         </h1>                   <h2>             HTML <link> target Attribute        </h2>                   <link href="geeksforgeeks.org" target="_blank">    </center> </body>   </html> 
Output:
Supported Browsers: The HTML <link> target attribute is not supported by any browsers.
chhabradhanvi
HTML-Attributes
HTML
Web Technologies
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
REST API (Introduction)
CSS to put icon inside an input element in a form
Design a Tribute Page using HTML & CSS
Types of CSS (Cascading Style Sheet)
How to Insert Form Data into Database using PHP ?
Installation of Node.js on Linux
Difference between var, let and const keywords in JavaScript
How to fetch data from an API in ReactJS ?
Differences between Functional Components and Class Components in React
Remove elements from a JavaScript Array
PostgreSQL – COALESCE

28 Aug, 2020
In PostgreSQL, the COALESCE function returns the first non-null argument. It is generally used with the SELECT statement to handle null values effectively.
Syntax: COALESCE (argument_1, argument_2, ...);
The COALESCE function accepts an unlimited number of arguments. It returns the first argument that is not null. If all arguments are null, the COALESCE function will return null. he COALESCE function evaluates arguments from left to right until it finds the first non-null argument. All the remaining arguments from the first non-null argument are not evaluated.
Example:For the purpose of demonstration let’s first create a table (say, items) using the below statement:
CREATE TABLE items (
    ID serial PRIMARY KEY,
    product VARCHAR (100) NOT NULL,
    price NUMERIC NOT NULL,
    discount NUMERIC
);
There are four fields in the items table:
id: the primary key that identifies the item in the items table.
product: the product name.
price: the price of the product.
discount: the discount of the product.
Now we insert some records into the items table using INSERT statement as follows:
INSERT INTO items (product, price, discount)
VALUES
    ('A', 1000, 10),
    ('B', 1500, 20),
    ('C', 800, 5),
    ('D', 500, NULL);
Finally we query the net prices of the products using the following:
SELECT
    product,
    (price - discount) AS net_price
FROM
    items;
This will lead to the following:f you look at the fourth row, you will notice that the net price of the product D is null which seems not correct. The issue is the discount of the product D is null, therefore when we take the null value to calculate the net price, PostgreSQL returns null. The get the right price, we need to assume that if the discount is null, it is zero. Then we can use the COALESCE function as follows:
SELECT
    product,
    (price - COALESCE(discount, 0)) AS net_price
FROM
    items;
Output:
postgreSQL-operators
PostgreSQL
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
PostgreSQL - Psql commands
PostgreSQL - Change Column Type
PostgreSQL - For Loops
PostgreSQL - Function Returning A Table
PostgreSQL - LIMIT with OFFSET clause
PostgreSQL - ARRAY_AGG() Function
PostgreSQL - DROP INDEX
PostgreSQL - Create Auto-increment Column using SERIAL
PostgreSQL - Copy Table
How to use PostgreSQL Database in Django?
What are shift operators in C++?

The bitwise shift operators are the right-shift operator (>>), which moves the bits of shift_expression to the right, and the left-shift operator (<<), which moves the bits of shift_expression to the left.
The left-shift operator causes the bits in shift-expression to be shifted to the left by the number of positions specified by additive-expression. The bit positions that have been vacated by the shift operation are zero-filled. A left shift is a logical shift (the bits that are shifted off the end are discarded, including the sign bit).
The right-shift operator causes the bit pattern in shift-expression to be shifted to the right by the number of positions specified by additive-expression. For unsigned numbers, the bit positions that have been vacated by the shift operation are zero-filled. For signed numbers, the sign bit is used to fill the vacated bit positions. In other words, if the number is positive, 0 is used, and if the number is negative, 1 is used.
#include<iostream>
using namespace std;
int main() {
   int a = 1, b = 3;
   
   // a right now is 00000001
   // Left shifting it by 3 will make it 00001000, ie, 8
   a = a << 3;
   cout << a << endl;
   
   // Right shifting a by 2 will make it 00000010, ie, 2
   a = a >> 2;
   cout << a << endl;
   return 0;
}
This will give the output −
8
2
Note that these operators behave very differently with negative numbers. The result of a right-shift of a signed negative number is implementation-dependent. If you left-shift a signed number so that the sign bit is affected, the result is undefined.
There are also 2 complex operators that can be used to assign the value directly to the value on left. These are the <<= operator and the >>= operator.
Refer to https://msdn.microsoft.com/en-us/library/336xbhcz.aspx for a much detailed inspection of the shift operators.
What is the difference between String.Copy() and String.Clone() methods in C#?

The String.Copy() method creates a new instance of String. This is same as the specified String.
The following is an example of Copy() method −
 Live Demo
using System;
class Demo {
   static void Main(String[] args) {

      string str1 = "mark";
      string str2 = "marcus";

      Console.WriteLine("str1 = '{0}'", str1);
      Console.WriteLine("str2 = '{0}'", str2);

      Console.WriteLine("After using String.Copy...");
      str2 = String.Copy(str1);

      Console.WriteLine("str1 = '{0}'", str1);
      Console.WriteLine("str2 = '{0}'", str2);
   }
}
str1 = 'mark'
str2 = 'marcus'
After using String.Copy...
str1 = 'mark'
str2 = 'mark'
The String.Clone() method returns a reference to the instance of String. The following is an example of Clone() method −
 Live Demo
using System;
class Demo {
   static void Main(String[] args) {
     
      string str1 = "amy";
      string str2 = "emma";

      Console.WriteLine("str1 = '{0}'", str1);
      Console.WriteLine("str2 = '{0}'", str2);

      Console.WriteLine("After using String.Clone...");
      str2 = (String)str1.Clone();

      Console.WriteLine("str1 = '{0}'", str1);
      Console.WriteLine("str2 = '{0}'", str2);
   }
}
str1 = 'amy'
str2 = 'emma'
After using String.Clone...
str1 = 'amy'
str2 = 'amy'
turtle.showturtle() function in Python - GeeksforGeeks

28 Jul, 2020
The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support.
This method is used to makes the turtle visible. It doesn’t require any argument.
Syntax:
turtle.showturtle() 
or 
turtle.st()

Below is the implementation of the above method with an example :
Example:
Python3
# import packageimport turtle  # set speed to slowest for# better understandingsturtle.speed(1)  # motionturtle.forward(100)turtle.right(90)  # hide the turtleturtle.hideturtle()  # motionturtle.forward(100)turtle.right(90)turtle.forward(100)turtle.right(90)  # show the turtleturtle.showturtle()  # motionturtle.forward(100)turtle.right(90)
Output :
Python-turtle
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Python Dictionary
Read a file line by line in Python
Enumerate() in Python
How to Install PIP on Windows ?
Iterate over a list in Python
Different ways to create Pandas Dataframe
Python program to convert a list to string
Reading and Writing to text files in Python
sum() function in Python
How to drop one or multiple columns in Pandas Dataframe
How to write custom Python Exceptions with Error Codes and Error Messages?

We can write custom exception classes with error codes and error messages as follows:
class ErrorCode(Exception):
    def __init__(self, code):
        self.code = code
   
try:
    raise ErrorCode(401)
except ErrorCode as e:
    print "Received error with code:", e.code
We get output
C:/Users/TutorialsPoint1/~.py
Received error with code: 401
We can also write custom exceptions with arguments, error codes and error messages as follows:
class ErrorArgs(Exception):
    def __init__(self, *args):
        self.args = [a for a in args]
try:
    raise ErrorArgs(403, "foo", "bar")
except ErrorArgs as e:
    print "%d: %s , %s" % (e.args[0], e.args[1], e.args[2])
We get following output
C:/Users/TutorialsPoint1/~.py
403: foo , bar
How to Escape Square Brackets in a LIKE Clause in SQL Server?

15 Oct, 2021
Here we will see, how to escape square brackets in a LIKE clause. LIKE clause used for pattern matching in SQL using wildcard operators like %, ^, [], etc. If we try to filter the record using a LIKE clause with a string consisting of square brackets, we will not get the expected results.
For example:
For a string value Romy[R]kumari in a table. If we try to apply LIKE ‘Romy[R]%’ to the select statement, it will not return anything.
Explanation:
Square brackets[], is among the wildcard operators used in SQL with the LIKE clause. It is used to match any single character within the specified range like ([b-h]) or set ([ghijk]).
We can escape square brackets using two methods:
Escape using one more square bracket
Escape using Escape character
Step 1: Create a database
The database can be created using CREATE command.
Query:
CREATE DATABASE geeks;
Step 2: Using a database
Use the below SQL statement to switch the database context to geeks:
Query:
USE geeks;
Step 3:  Table definition
We have the following demo_table in our geek’s database.
Query:
CREATE TABLE demo_table(
FIRSTNAME VARCHAR(20), LASTNAME VARCHAR(20),
EMPCODE VARCHAR(20));
Step 4: Inserting data into the table
Query:
INSERT INTO demo_table VALUES
('ROMY', 'Kumari', 'ROMY[78]KUM'),
('Rinkle', 'Arora', 'RINKLE[78}ARO'),
('Nikhil', 'Kalra','NIKHIL[90]Kal'),
('Pushkar', 'Jha', 'PUSHKAR[91]JHA'),
('Sujata', 'jha', 'SUJATA[98]JHA'),
('Roshini', 'Kumari','ROSHINI[78]');
Step 5:  For a view a table data
Query:
SELECT * FROM demo_table;
Output:
Syntax:
For matching ‘ROMY[78]’ 
SELECT *  
  FROM table_name 
  WHERE column_name LIKE 'ROMY[[]78]%'
Query: To match EMPCODE having [78] 
SELECT *  
  FROM demo_table  
  WHERE EMPCODE LIKE '%[[]78]%'
Output:
In this method, we have to specify the character with the ESCAPE keyword after the LIKE clause.
Syntax:
For matching ‘ROMY[78]’ 
SELECT *  
  FROM table_name  
  WHERE column_name LIKE 'ROMY\[78]%' ESCAPE '\';
Query:
SELECT *  
  FROM demo_table
  WHERE EMPCODE LIKE '%\[78]%' ESCAPE '\';
Output:
Picked
SQL-Server
TrueGeek-2021
SQL
TrueGeek
SQL
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Update Multiple Columns in Single Update Statement in SQL?
SQL | Sub queries in From Clause
Window functions in SQL
What is Temporary Table in SQL?
SQL Query to Find the Name of a Person Whose Name Starts with Specific Letter
How to redirect to another page in ReactJS ?
Basics of API Testing Using Postman
How to Convert Char to String in Java?
How to remove duplicate elements from JavaScript Array ?
Types of Internet Protocols
The Hidden Wiki

25 Jan, 2021
The Dark Web is that part of the internet where all the illegal works are done. You can access to the dark web through TOR(The Onion Router). The Hidden Wiki is the name used by censorship-resistant wikis operating as Tor hidden services that anyone can anonymously edit after registering on the site. The main page here serves as a directory of links to other .onion sites. So, the hidden wiki is also accessed from the TOR browser. 
Early stage: The hidden wiki was first recorded in 2007 when it was located at 6sxoyfb3h2nvok2d.onion. But later in 2011, a full-fledged website with many of the links found. Prior to August 2013, the site was hosted on domain “Freedom Hosting”. In March 2014 the site and its kpvz7ki2v5agwt35.onion domain was hacked and redirected to a new domain “Doxbin”. Why it is used? Hidden wiki is operated and run at .onion domains which are only accessed by TOR or TOR gateway. Hidden wiki is a website that has a link to all the hidden and secret/ illegal works such as money laundering, contract killing, cyber-attacks for hire, contraband chemicals, and bomb-making. Fact: It is said that hidden wiki is a collection of links of websites, but many more thousands more websites are there on Darkweb which do not shows up on the hidden wiki. How to Access: You can access the hidden wiki for educational purposes using this link:  
http://zqktlwiuavvvqqt4ybvgvi7tyo4hjl5xgfuvpdf6otjiycgwqbym2qad.onion/wiki/Main_Page
Is HiddenWiki Illegal? Hidden Wiki is not illegal to access in many countries. But doing Illegal work on Hidden wiki is illegal. How hidden wiki work?  
On the hidden wiki, once you registered you can edit itSo people add more links to there services on Hidden Wiki. 
On the hidden wiki, once you registered you can edit it
So people add more links to there services on Hidden Wiki. 
lamar2
Web technologies
GBlog
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.