code-rag-bench/online-tutorials huggingface dataset:
How to set default date time as system date time in MySQL?

You can use CURRENT_TIMESTAMP to set system date time.
 Let us first create a table −
mysql> create table DemoTable
(
   Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
   ClientFirstName varchar(20),
   ClientLastName varchar(20),
   ClientAge int
);
Query OK, 0 rows affected (0.66 sec)
Following is the query to set default datetime as system date time in MySQL −
mysql> alter table DemoTable add column ClientProjectDeadline timestamp default current_timestamp;
Query OK, 0 rows affected (0.46 sec)
Records: 0 Duplicates: 0 Warnings: 0
Let us check the description of table once again −
mysql> desc DemoTable;
This will produce the following output −
+-----------------------+-------------+------+-----+-------------------+----------------+
| Field                 | Type        | Null | Key | Default           | Extra          |
+-----------------------+-------------+------+-----+-------------------+----------------+
| Id                    | int(11)     | NO   | PRI | NULL              | auto_increment |
| ClientFirstName       | varchar(20) | YES  |     | NULL              |                |
| ClientLastName        | varchar(20) | YES  |     | NULL              |                |
| ClientAge             | int(11)     | YES  |     | NULL              |                |
| ClientProjectDeadline | timestamp   | YES  |     | CURRENT_TIMESTAMP |                |
+-----------------------+-------------+------+-----+-------------------+----------------+
5 rows in set (0.22 sec)
Tryit Editor v3.7

Tryit: HTML page as an embed object
Final keyword in C#

Java has a final keyword, but C# does not have its implementation. For the same implementation, use the sealed keyword.
With sealed, you can prevent overriding of a method. When you use sealed modifiers in C# on a method, then the method loses its capabilities of overriding. The sealed method should be part of a derived class and the method must be an overridden method.
The following example won’t allow you to override the method display() because it has a sealed modifier for the ClassTwo derived class.
ClassOne is our base class, whereas ClassTwo and ClassThree are derived classes −
class ClassOne {
   public virtual void display() {
         Console.WriteLine("Baseclass");
   }
}

class ClassTwo : ClassOne {
   public sealed override void display() {
      Console.WriteLine("ClassTwo:derivedClass");
   }
}

class ClassThree : ClassTwo {
   public override void display() {
      Console.WriteLine("ClassThree: Another Derived Class");
   }
}
How to get the current username in Python - GeeksforGeeks

23 Jan, 2022
In this article, we will discuss how to get the current username in python.
getlogin() method of OS library is used to get the current username.
Syntax : os.getlogin( ) 
In order to use this function we need to import os library first .
Python3
# importing os moduleimport os  # using getlogin() returning usernameos.getlogin()
Output :
'KRISHNA KARTHIKEYA'
There is another method available in os library named path.expanduser() method. In this function, we need to pass the Tilde operator within single quotes as an argument.
syntax : os.path.expanduser( ) 
Note: In this method, we need to pass the tilde operator as an argument.
Python3
# importing required moduleimport os # using path.expanduser() getting usernameos.path.expanduser('~')
Output :
'C:\\Users\\KRISHNA KARTHIKEYA'
This method is also available in the os module. We need to pass USERNAME as an argument into this method. Let us see the syntax and example .
syntax : os.environ.get( ” USERNAME” )
note : In some cases we need pass USER instead of USERNAME . Most of the cases we pass USERNAME as argument .
Python3
# importing os moduleimport os # using environ.get() method getting# current usernameos.environ.get('USERNAME')
Output :
'KRISHNA KARTHIKEYA'
In this module, we need to use getuser() method to return the current username. This getuser() method is available in getpass library.
syntax : getpass.getuser( )
Example :
Python3
# importing getpass library using import command# Here gt is a alias name for getpass# Instead of writing getpass we can use gtimport getpass as gt # using getuser() method , returning current# usernamegt.getuser()
Output :
'KRISHNA KARTHIKEYA'
pwd module works only with Linux environment. But os works with both Windows and Linux. This means some methods work with only windows and some methods work with only Linux. If we execute this method in Linux we will get output as root. Let us see the syntax and example of getpwuid() method.
syntax : getpwuid( os.getuid() )[0]
Here [0] is like index. Generally this function returns many outputs like system name , password , uid , bash..etc . Here we need username . It is at index 0 . so we are specifying [0] .
Example  : 
Python3
# importing required modulesimport osimport pwd # Using getpwuid() and getuid we are# printing current usernamepwd.getpwuid(os.getuid())[0]
Output :
'root'
sumitgumber28
Picked
python-utility
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
How To Convert Python Dictionary To JSON?
Check if element exists in list in Python
Python | Get unique values from a list
Defaultdict in Python
Python OOPs Concepts
Python | os.path.join() method
Python | Pandas dataframe.groupby()
Python Program to Form a Dictionary from an Object of a Class

When it is required to form a dictionary with the help of an object and class, a class is defined. An ‘init’ function is defined, that assigns values to variables. An instance of the class is created, and the init function is called.
Below is a demonstration for the same −
 Live Demo
class base_class(object):
   def __init__(self):
      self.A = 32
      self.B = 60
my_instance = base_class()
print("An instance of the class has been created")
print(my_instance.__dict__)
An instance of the class has been created
{'A': 32, 'B': 60}
A ‘base_class’ is defined, and an object is passed to it.
An ‘init’ method is defined, and it assigns values to variables.
An instance of the method is created.
The method is called using the obect created, using ‘.’ operator
Google Charts - Basic Sankey Chart

Following is an example of a basic sankey diagram. We've already seen the configuration used to draw this chart in Google Charts Configuration Syntax chapter. So, let's see the complete example.
We've used Sankey class to show sankey diagram.
//Map chart
var chart = new google.visualization.Sankey(document.getElementById('container'));

googlecharts_sankey_basic.htm
<html>
   <head>
      <title>Google Charts Tutorial</title>
      <script type = "text/javascript" src = "https://www.gstatic.com/charts/loader.js">
      </script>
      <script type = "text/javascript" src = "https://www.google.com/jsapi"></script>
      <script type = "text/javascript">
         google.charts.load('current', {packages: ['sankey']});     
      </script>
   </head>
   
   <body>
      <div id = "container" style = "width: 550px; height: 400px; margin: 0 auto">
      </div>
      <script language = "JavaScript">
         function drawChart() {
            // Define the chart to be drawn.
            var data = new google.visualization.DataTable();   
            data.addColumn('string', 'From');
            data.addColumn('string', 'To');
            data.addColumn('number', 'Weight');

            data.addRows([
               [ 'Brazil', 'Portugal', 5 ],
               [ 'Brazil', 'France', 1 ],
               [ 'Brazil', 'Spain', 1 ],
               [ 'Brazil', 'England', 1 ],
               
               [ 'Canada', 'Portugal', 1 ],
               [ 'Canada', 'France', 5 ],
               [ 'Canada', 'England', 1 ],
               
               [ 'Mexico', 'Portugal', 1 ],
               [ 'Mexico', 'France', 1 ],
               [ 'Mexico', 'Spain', 5 ],
               [ 'Mexico', 'England', 1 ],
               
               [ 'USA', 'Portugal', 1 ],
               [ 'USA', 'France', 1 ],
               [ 'USA', 'Spain', 1 ],
               [ 'USA', 'England', 5 ]
            ]);	

            // Set chart options
            var options = {width: 550};
                  
            // Instantiate and draw the chart.
            var chart = new google.visualization.Sankey(document.getElementById('container'));
            chart.draw(data, options);
         }
         google.charts.setOnLoadCallback(drawChart);
      </script>
   </body>
</html>
Verify the result.
 Print
 Add Notes
 Bookmark this page
Python - tensorflow.math.reduce_variance() - GeeksforGeeks

31 Aug, 2021
TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks.
reduce_variance() is used to find variance of elements across dimensions of a tensor.
Syntax: tensorflow.math.reduce_variance( input_tensor, axis, keepdims, name)
Parameters:
input_tensor: It is numeric tensor to reduce.
axis(optional): It represent the dimensions to  reduce. It’s value should be in range [-rank(input_tensor), rank(input_tensor)). If no value is given for this all dimensions are reduced.
keepdims(optional): It’s default value is False. If it’s set to True it will retain the reduced dimension with length 1.
name(optional): It defines the name for the operation.
Returns: It returns a tensor.
Example 1:
Python3
# importing the libraryimport tensorflow as tf # Initializing the input tensora = tf.constant([1, 2, 3, 4], dtype = tf.float64) # Printing the input tensorprint('Input: ', a) # Calculating resultres = tf.math.reduce_variance(a) # Printing the resultprint('Result: ', res)
Output:
Input:  tf.Tensor([1. 2. 3. 4.], shape=(4, ), dtype=float64)
Result:  tf.Tensor(1.25, shape=(), dtype=float64)
Example 2:
Python3
# importing the libraryimport tensorflow as tf # Initializing the input tensora = tf.constant([[1, 2], [3, 4]], dtype = tf.float64) # Printing the input tensorprint('Input: ', a) # Calculating resultres = tf.math.reduce_variance(a, axis = 1, keepdims = True) # Printing the resultprint('Result: ', res)
Output:
Input:  tf.Tensor(
[[1. 2.]
 [3. 4.]], shape=(2, 2), dtype=float64)
Result:  tf.Tensor(
[[0.25]
 [0.25]], shape=(2, 1), dtype=float64)
sooda367
Python Tensorflow-math-functions
Python-Tensorflow
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 ?
How to drop one or multiple columns in Pandas Dataframe
How To Convert Python Dictionary To JSON?
Check if element exists in list in Python
Python | Pandas dataframe.groupby()
Defaultdict in Python
Python | Get unique values from a list
Python Classes and Objects
Python | os.path.join() method
Create a directory in Python
CSS Opacity / Transparency

For CSS Opacity/ Transparency, the opacity property is used. For example,
opacity: 0.3;
Following is the code showing Opacity/ Transparency using CSS −
 Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
body {
   font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
div {
   width: 200px;
   height: 200px;
   background-color: rgb(0, 0, 255);
   color: white;
   display: inline-block;
}
.transparent {
   background-color: rgba(0, 0, 255, 0.582);
}
img{
   width: 200px;
   height: 200px;
}
.transparent-img{
   opacity: 0.3;
}
</style>
</head>
<body>
<h1>Tansparency/Opacity Example</h1>
<div class="transparent">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic, accusantium.
</div>
<div>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum, nisi!
</div>
<hr>
<img src="https://i.picsum.photos/id/487/300/300.jpg">
<img class="transparent-img" src="https://i.picsum.photos/id/487/300/300.jpg">
</body>
</html>
The above code will produce the following output −
Build a Voice Recorder GUI using Python - GeeksforGeeks

01 Oct, 2020
Prerequisites: Python GUI – tkinter, Create a Voice Recorder using Python
Python provides various tools and can be used for various purposes. One such purpose is recording voice. It can be done using the sounddevice module. This recorded file can be saved using the soundfile module
Sounddevice: The sounddevice module provides bindings for the PortAudio library and a few convenience functions to play and record NumPy arrays containing audio signals. To install this type the below command in the terminal.
pip install sounddevice

SoundFile:  SoundFile can read and write sound files. To install this type the below command in the terminal.
pip install SoundFile

Approach:
Import the required module.
Set frequency and duration.
Record voice data in NumPy array, you can use rec().
Store into the file using soundfile.write().
Implementation:
Step 1: Import modules
import sounddevice as sd
import soundfile as sf
Step 2: Set frequency and duration and record voice data in NumPy array, you can use rec()
fs = 48000
duration = 5 
myrecording = sd.rec(int(duration * fs), samplerate=fs,
                     channels=2)
Note: fs is the sample rate of the recording (usually 44100 or 44800 Hz)
Step 3: Now store these array into audio files.
# Save as FLAC file at correct sampling rate
sf.write('My_Audio_file.flac', myrecording, fs)
Let’s create a GUI application for the same. We’ll be using Tkinter for doing the same.
Python3
import sounddevice as sdimport soundfile as sffrom tkinter import *    def Voice_rec():    fs = 48000          # seconds    duration = 5    myrecording = sd.rec(int(duration * fs),                          samplerate=fs, channels=2)    sd.wait()          # Save as FLAC file at correct sampling rate    return sf.write('my_Audio_file.flac', myrecording, fs)    master = Tk()  Label(master, text=" Voice Recoder : "     ).grid(row=0, sticky=W, rowspan=5)    b = Button(master, text="Start", command=Voice_rec)b.grid(row=0, column=2, columnspan=2, rowspan=2,       padx=5, pady=5)  mainloop()
Output:
Python-projects
python-utility
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Python Dictionary
Read a file line by line in Python
Enumerate() in Python
How to Install PIP on Windows ?
Iterate over a list in Python
Different ways to create Pandas Dataframe
Python String | replace()
Python program to convert a list to string
Reading and Writing to text files in Python
sum() function in Python
What is strcat() Function in C language?

The C library function char *strcat(char *dest, const char *src) appends the string pointed to by src to the end of the string pointed to by dest.
An array of characters is called a string.
Following is the declaration for an array −
char stringname [size];
For example − char string[50]; string of length 50 characters
Using single character constant −
char string[10] = { ‘H’, ‘e’, ‘l’, ‘l’, ‘o’ ,‘\0’}
Using string constants −
char string[10] = "Hello":;
Accessing − There is a control string "%s" used for accessing the string till it encounters ‘\0’.
This is used for combining or concatenating two strings.
This is used for combining or concatenating two strings.
The length of the destination string must be greater than the source string.
The length of the destination string must be greater than the source string.
The result concatenated string is the source string.
The result concatenated string is the source string.
The syntax is as follows −
strcat (Destination String, Source string);
The following program shows the usage of strcat() function.
 Live Demo
#include <string.h>
main(){
   char a[50] = "Hello \n";
   char b[20] = "Good Morning \n";
   strcat (a,b);
   printf("concatenated string = %s", a);
}
When the above program is executed, it produces the following result −
Concatenated string = Hello Good Morning
Let’s see another example.
Following is the C program to concatenate source string to destination string using strcat library function −
#include<stdio.h>
#include<string.h>
void main(){
   //Declaring source and destination strings//
   char source[45],destination[50];
   //Reading source string and destination string from user//
   printf("Enter the source string : \n");
   gets(source);
   printf("Enter the destination string : \n");
   gets(destination);
   //Concatenate all the above results//
   strcat(source,destination);
   //Printing destination string//
   printf("The modified destination string :");
   puts(source);
}
When the above program is executed, it produces the following result −
Enter the source string :Tutorials Point
Enter the destination string :C programming
The modified destination string :Tutorials Point C programming
Laravel - Errors and Logging

This chapter deals with errors and logging in Laravel projects and how to work on them.
A project while underway, is borne to have a few errors. Errors and exception handling is already configured for you when you start a new Laravel project. Normally, in a local environment we need to see errors for debugging purposes. We need to hide these errors from users in production environment. This can be achieved with the variable APP_DEBUG set in the environment file .env stored at the root of the application.
For local environment the value of APP_DEBUG should be true but for production it needs to be set to false to hide errors.
Note − After changing the APP_DEBUG variable, you should restart the Laravel server.
Logging is an important mechanism by which system can log errors that are generated. It is useful to improve the reliability of the system. Laravel supports different logging modes like single, daily, syslog, and errorlog modes. You can set these modes in config/app.php file.
'log' => 'daily'

You can see the generated log entries in storage/logs/laravel.log file.

    13 Lectures 
     3 hours 

 Sebastian Sulinski

    35 Lectures 
     3.5 hours 

 Antonio Papa

    7 Lectures 
     1.5 hours 

 Sebastian Sulinski

    42 Lectures 
     1 hours 

 Skillbakerystudios

    165 Lectures 
     13 hours 

 Paul Carlo Tordecilla

    116 Lectures 
     13 hours 

 Hafizullah Masoudi
 Print
 Add Notes
 Bookmark this page
What are the types of variables a class can have in Java?

There are three different types of variables a class can have in Java are local variables, instance variables, and class/static variables.
A local variable in Java can be declared locally in methods, code blocks, and constructors. When the program control enters the methods, code blocks, and constructors then the local variables are created and when the program control leaves the methods, code blocks, and constructors then the local variables are destroyed. A local variable must be initialized with some value.
public class LocalVariableTest {
   public void show() {
      int num = 100; // local variable
      System.out.println("The number is : " + num);
   }
   public static void main(String args[]) {
      LocalVariableTest test = new LocalVariableTest();
      test.show();
   }
}
The number is : 100

An instance variable in Java can be declared outside a block, method or constructor but inside a class. These variables are created when the class object is created and destroyed when the class object is destroyed.
public class InstanceVariableTest {
   int num; // instance variable
   InstanceVariableTest(int n) {
      num = n;
   }
   public void show() {
      System.out.println("The number is: " + num);
   }
   public static void main(String args[]) {
      InstanceVariableTest test = new InstanceVariableTest(75);
      test.show();
   }
}
The number is : 75

A static/class variable can be defined using the static keyword. These variables are declared inside a class but outside a method and code block. A class/static variable can be created at the start of the program and destroyed at the end of the program.
public class StaticVaribleTest {
   int num;
   static int count; // static variable
   StaticVaribleTest(int n) {
      num = n;
      count ++;
   }
   public void show() {
      System.out.println("The number is: " + num);
   }
   public static void main(String args[]) {
      StaticVaribleTest test1 = new StaticVaribleTest(75);
      test1.show();
      StaticVaribleTest test2 = new StaticVaribleTest(90);
      test2.show();
      System.out.println("The total objects of a class created are: " + count);
   }
}
The number is: 75
The number is: 90
The total objects of a class created are: 2
ArrayList clear() Method in Java with Examples - GeeksforGeeks

23 Nov, 2021
The clear() method of ArrayList in Java is used to remove all the elements from a list. The list will be empty after this call returns so do whenever this operation has been performed all elements of the corresponding Arraylist will be deleted so it does it becomes an essential function for deleting elements in ArrayList from memory leading to optimization.
Syntax: 
clear()
Return Type: It does not return any value as it removes all the elements in the list and makes it empty. 
Tip: It does implement the following interfaces as follows: Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess
Example 1:
Java
// Java Program to Illustrate Working of clear() Method// of ArrayList class  // Importing required classesimport java.util.ArrayList;  // Main classpublic class GFG {      // Main driiver method    public static void main(String[] args)    {        // Creating an empty Integer ArrayList        ArrayList<Integer> arr = new ArrayList<Integer>(4);          // Adding elements to above ArrayList        // using add() method        arr.add(1);        arr.add(2);        arr.add(3);        arr.add(4);          // Printing the elements inside current ArrayList        System.out.println("The list initially: " + arr);          // Clearing off elements        // using clear() method        arr.clear();          // Displaying ArrayList elements        // after using clear() method        System.out.println(            "The list after using clear() method: " + arr);    }}
The list initially: [1, 2, 3, 4]
The list after using clear() method: []
 
Akanksha_Rai
solankimayank
Java - util package
Java-ArrayList
Java-Collections
Java-Functions
java-list
Java
Java
Java-Collections
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Initialize an ArrayList in Java
Object Oriented Programming (OOPs) Concept in Java
HashMap in Java with Examples
Interfaces in Java
ArrayList in Java
How to iterate any Map in Java
Multidimensional Arrays in Java
Stack Class in Java
Stream In Java
Singleton Class in Java
PHP - Hash hmac() Function

The hash_hmac() function is used to generate keyed hash value using HMAC method.
HMAC stands for keyed-hash message authentication code or hash-based message authentication code. It makes use of  cryptographic hash function like md5, sha-256 and a secret key to return the message digest hash of the given data.
hash_hmac ( string $algo , string $data , string $key [, bool $raw_output = FALSE ] ) : string

algo
Name of the hashing algorithm. There is a big list of algorithm available with hash, some important ones are md5, sha256, etc.
To get the full list of algorithms supported check for hash_hmac_algos()
data
The data you want to hash.
key
Secret key to generate HMAC vaiant of the message digest.
raw_output
By default, the value is false and hence it returns lowercase hexits values. If the value is true, it will return raw binary data.
The hash_hmac() function returns a string containing calculated message digest that will be in the form of lowercase hexits if raw_output is false otherwise it will return raw binary data.
This function will work from PHP Version greater than 5.1.2.
Using hash_hmac() −
<?php
   echo hash_hmac('md5', 'Welcome to Tutorialspoint', 'any_secretkey');
?>
This will produce the following result −
3e89ca31da24cb046c9d11706be688c1

Using hash_hmac() with ripemd128 algorithm −
<?php
   echo hash_hmac('ripemd128', 'Welcome to Tutorialspoint', 'any_secretkey');
?>
This will produce the following result −
c9b5c68b72808f31b4524fbd46bf87d0

To generate hash_hmac with raw_output as true −
<?php
   echo hash_hmac('ripemd128', 'Welcome to Tutorialspoint', 'any_secretkey', true);
?>
This will produce the following result −
ɵƋr��1�RO�F���


    45 Lectures 
     9 hours 

 Malhar Lathkar

    34 Lectures 
     4 hours 

 Syed Raza

    84 Lectures 
     5.5 hours 

 Frahaan Hussain

    17 Lectures 
     1 hours 

 Nivedita Jain

    100 Lectures 
     34 hours 

 Azaz Patel

    43 Lectures 
     5.5 hours 

 Vijay Kumar Parvatha Reddy
 Print
 Add Notes
 Bookmark this page
Non-deterministic PDA

Theory of Computation
A non-deterministic PDA is used to generate a language that a deterministic automata cannot generate. It is more powerful than a deterministic PDA. So, a push down automata is allowed to be non-deterministic.
M = (Q,Σ,Γ,δ,q0,Z0,F)
Q- It is the finite set of states, Σ - finite set of input alphabet, Γ - finite set of stack alphabet, δ - transition function, q0 - initial state, Z0 - stack start symbol, F - finite states.
General Sibling Selectors in CSS

The CSS general sibling selector is used to select all elements that follow the first element such that both are children of the same parent.
The syntax for CSS general sibling selector is as follows
element ~ element {
   /*declarations*/
}
The following examples illustrate CSS general sibling selector −
 Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
* {
   float: left;
   padding-left: 14px;
   list-style: none;
}
p ~ ul {
   box-shadow: inset 4px 0 3px lime;
}
</style>
</head>
<body>
<ul>
<li><img src="https://www.tutorialspoint.com/images/pl-sql.png"></li>
</ul>
<p>We provide learning tutorials, quizzes and video tutorials.</p>
<ul>
<li>Tutorials on databases and programming languages.</li>
<li>Quizzes to check knowledge of databases and languages.</li>
<li>Video Tutorials to easily understand the technologies.</li>
</ul>
<ul>
<li><img src="https://www.tutorialspoint.com/images/mongodb.png"></li>
<li><img src="https://www.tutorialspoint.com/images/db2.png"></li>
<li><img src="https://www.tutorialspoint.com/images/sql.png"></li>
</ul>
</body>
</html>
This gives the following output −
 Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
* {
   float: left;
   padding: 10px;
   list-style: none;
}
img ~ p {
   background-color: burlywood;
}
</style>
</head>
<body>
<p>This is demo text.</p>
<img src="https://www.tutorialspoint.com/big_data_analytics/images/big-data-analytics-mini-logo.jpg">
<p>Learn Big Data Analytics at no cost.</p>
</body>
</html>
This gives the following output −
What is the difference between an int and a long in C++?

The datatype int is used to store the integer values. It could be signed or unsigned. The datatype int is of 32-bit or 4 bytes. It requires less memory area than long to store a value. The keyword “int” is used to declare an integer variable.
The following is the syntax of int datatype.
int variable_name;
Here,
variable_name − The name of variable given by user.
The following is an example of int datatype.
 Live Demo
#include <iostream>
using namespace std;
int main() {
   int a = 8;
   int b = 10;
   int c = a+b;
   cout << "The value of c : " << c;
   return 0;
}
The value of c : 18
The datatype long is used to store the long integer values. It could be signed or unsigned. The datatype long is of 64-bit or 8 bytes. It requires more memory area than int to store the value. The keyword “long” is used to declare a long integer variable.
The following is the syntax of long datatype.
long variable_name;
Here,
variable_name − The name of variable given by user.
The following is an example of long datatype.
 Live Demo
#include <iostream>
using namespace std;
int main() {
   int a = 8;
   long b = 28;
   long c = long(a+b);
   cout << "The value of c : " << c;
   return 0;
}
The value of c : 36
HTML | <input> multiple Attribute

28 May, 2019
The HTML <input> multiple Attribute is a Boolean Attribute. It specifies that the user is allowed to select more than one value that presents in an element. The multiple attributes work with many input fields such as email, file, etc.
Syntax:
<input multiple> 
Example:
<!DOCTYPE html><html>  <body>    <center>        <h1 style="color:green;font-style:italic;">          GeeksForGeeks      </h1>        <h2 style="color:green;font-style:italic;">          HTML input multiple Attribute      </h2>        <form action=" ">            Select images:            <input type="file" name="img" multiple>            <input type="submit">        </form>  </center>  </body>  </html>
Output:
Supported Browsers:
Google Chrome 6.0
Firefox 3.6
Edge 10.0
Opera 11.0
Apple Safari 5.0
HTML-Attributes
HTML
Web Technologies
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Delete Google Browser History using Python - GeeksforGeeks

16 Jul, 2020
In this article, you will learn to write a Python program which will take input from the user as a keyword like Facebook, amazon, geeksforgeeks, Flipkart, youtube, etc. and then search your google chrome browser history for that keyword and if the keyword is found in any of the URL then it will delete it. For example, suppose you have entered the keyword ‘geeksforgeeks’, so it will search your google chrome history, like ‘www.geekforgeeks.org’, it’s very obvious that this URL contains the keyword ‘geeksforgeeks’, then it will delete it, it will also search for articles (like “Is geeksforgeeks a good portal to prepare for competitive programming interview?”) containing ‘geeksforgeeks’ in their title and delete it. First of all, get the location in your system where the google chrome history file is located.
Note: Google chrome history file location in windows generally is: C:\Users\manishkc\AppData\Local\Google\Chrome\User Data\Default\History.
Implementation:
import sqlite3   # establish the connection with# history database file which is # located at given location# you can search in your system # for that location and provide # the path hereconn = sqlite3.connect("/path/to/History")  # point out at the cursorc = conn.cursor()     # create a variable id # and assign 0 initiallyid = 0     # create a variable result # initially as True, it will# be used to run while loopresult = True   # create a while loop and put# result as our conditionwhile result:          result = False          # a list which is empty at first,    # this is where all the urls will    # be stored    ids = []           # we will go through our database and     # search for the given keyword    for rows in c.execute("SELECT id,url FROM urls\    WHERE url LIKE '%geeksforgeeks%'"):                  # this is just to check all        # the urls that are being deleted        print(rows)                  # we are first selecting the id        id = rows[0]                  # append in ids which was initially        # empty with the id of the selected url        ids.append((id,))               # execute many command which is delete    # from urls (this is the table)    # where id is ids (list having all the urls)    c.executemany('DELETE from urls WHERE id = ?',ids)          # commit the changes    conn.commit()      # close the connection conn.close()
Output:
(16886, 'https://www.geeksforgeeks.org/')
Python-projects
python-utility
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()
Create a Pandas DataFrame from Lists
Reading and Writing to text files in Python
*args and **kwargs in Python
How to save a Python Dictionary to CSV file?

CSV (Comma Separated Values) is a most common file format that is widely supported by many platforms and applications.
Use csv module from Python's standard library. Easiest way is to open a csv file in 'w' mode with the help of open() function and write  key value pair in comma separated form.
import csv
my_dict = {'1': 'aaa', '2': 'bbb', '3': 'ccc'}
with open('test.csv', 'w') as f:
    for key in my_dict.keys():
        f.write("%s,%s\n"%(key,my_dict[key]))
The csv module contains DictWriter method that requires name of csv file to write and a list object containing field names. The writeheader() method writes first line in csv file as field names. The subsequent for loop writes each row in csv form to the csv file.
import csv
csv_columns = ['No','Name','Country']
dict_data = [
{'No': 1, 'Name': 'Alex', 'Country': 'India'},
{'No': 2, 'Name': 'Ben', 'Country': 'USA'},
{'No': 3, 'Name': 'Shri Ram', 'Country': 'India'},
{'No': 4, 'Name': 'Smith', 'Country': 'USA'},
{'No': 5, 'Name': 'Yuva Raj', 'Country': 'India'},
]
csv_file = "Names.csv"
try:
    with open(csv_file, 'w') as csvfile:
        writer = csv.DictWriter(csvfile, fieldnames=csv_columns)
        writer.writeheader()
        for data in dict_data:
            writer.writerow(data)
except IOError:
    print("I/O error")
CSS | scaleX() Function - GeeksforGeeks

20 Aug, 2019
The scaleX() function is an inbuilt function which is used to resize an element along the x-axis in a 2D plane. It scales the elements in a horizontal direction.
Syntax:
scaleX() = scaleX( number )
Parameters: This function accepts single parameter number which holds the scaling factor along x-axis.
Below examples illustrate the scaleX() function in CSS:
Example 1:
<!DOCTYPE html> <html>   <head>     <title>CSS scaleX() function</title>       <style>         body {            text-align:center;        }        h1 {            color:green;        }        .scaleX_image {            transform: scaleX(2);        }    </style> </head>   <body>     <h1>GeeksforGeeks</h1>    <h2>CSS scaleX() function</h2>          <br><br>          <img class="scaleX_image" src= "https://media.geeksforgeeks.org/wp-content/cdn-uploads/20190710102234/download3.png"        alt="GeeksforGeeks logo"> </body>   </html>
Output:
Example 2:
<!DOCTYPE html> <html>   <head>     <title>CSS scaleX() function</title>           <style>         body {            text-align:center;        }        h1 {            color:green;        }        .GFG {            font-size:35px;            font-weight:bold;            color:green;            transform: scaleX(1.5);        }    </style> </head>   <body>     <h1>GeeksforGeeks</h1>    <h2>CSS scaleX() function</h2>      <div class="GFG">Welcome to GeeksforGeeks</div> </body>   </html>
Output:
Supported Browsers: The browsers supported by scaleX() Function are listed below:
Google Chrome
Internet Explorer
Firefox
Opera
Safari
CSS-Functions
CSS
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to create footer to stay at the bottom of a Web page?
Types of CSS (Cascading Style Sheet)
How to position a div at the bottom of its container using CSS?
Create a Responsive Navbar using ReactJS
Design a web page using HTML and CSS
Roadmap to Become a Web Developer in 2022
Installation of Node.js on Linux
How to fetch data from an API in ReactJS ?
Convert a string to an integer in JavaScript
Difference between var, let and const keywords in JavaScript
SAP HANA Admin - Table Replication

In SAP HANA system, it is also possible to replicate tables on multiple hosts. When you need to join the tables or partition tables on multiple hosts, table replication is useful to improve the performance, to reduce the load on the network in a distributed environment.
SAP HANA table replication has certain limitations −
You can’t replicate Partitioned Tables.
You can’t replicate Partitioned Tables.
When you are using SAP BW on HANA, it doesn’t support Table replication.
When you are using SAP BW on HANA, it doesn’t support Table replication.
When you perform table replication, it consumes the main memory and disk space to store persistence of each replica.
When you perform table replication, it consumes the main memory and disk space to store persistence of each replica.
Column store tables with history tables and text columns without a primary key can’t be replicated.
Column store tables with history tables and text columns without a primary key can’t be replicated.
CREATE COLUMN TABLE Table_Name (I INT PRIMARY KEY) REPLICA AT ALL LOCATIONS 

This command will create a column store table with a replica on each host. You can also replicate an existing column base table on each available host using ALTER table command as follows −
ALTER TABLE Table_Name ADD REPLICA AT ALL LOCATIONS 

It is also possible to drop replica of an existing table using ALTER table drop replica command as follows.
ALTER TABLE Table_name DROP REPLICA AT ALL LOCATIONS 

Note −
You can perform Table Replication on row store tables.
You can perform Table Replication on row store tables.
In a distributed environment, you can perform table replications on row store tables stored in master node.
In a distributed environment, you can perform table replications on row store tables stored in master node.
In SAP HANA system, you can also perform consistency check on replicated tables using the following SQL command −
CALL CHECK_TABLE_CONSISTENCY('CHECK_REPLICATION', '<schema>', '<table'>) 


    25 Lectures 
     6 hours 

 Sanjo Thomas

    26 Lectures 
     2 hours 

 Neha Gupta

    30 Lectures 
     2.5 hours 

 Sumit Agarwal

    30 Lectures 
     4 hours 

 Sumit Agarwal

    14 Lectures 
     1.5 hours 

 Neha Malik

    13 Lectures 
     1.5 hours 

 Neha Malik
 Print
 Add Notes
 Bookmark this page
How to create a Disabled Option Select using jQuery Mobile ? - GeeksforGeeks

20 Dec, 2020
jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be creating a Disabled Option Select using jQuery Mobile.
Approach: First, add jQuery Mobile scripts needed for your project.
<link rel=”stylesheet” href=”http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css”/><script src=”http://code.jquery.com/jquery-1.11.1.min.js”></script><script src=”http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js”></script>
Example:
HTML
<!DOCTYPE html><html>  <head>    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />      <script src=        "http://code.jquery.com/jquery-1.11.1.min.js">    </script>      <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js">    </script></head>  <body>    <center>        <h1>GeeksforGeeks</h1>          <h4>            Disabled Option Select            using jQuery Mobile        </h4>    </center>          <form>        <div data-role="fieldcontain">            <label for="Geeks">                Select Element:            </label>            <select name="Geeks" id="Geeks">                <option value="1">Geeks1</option>                <option value="2" disabled="disabled">                    Geeks2                </option>                <option value="3">Geeks3</option>                <option value="4">Geeks4</option>            </select>        </div>    </form></body>  </html>
Output:
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.
jQuery-Mobile
HTML
JQuery
Web Technologies
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
REST API (Introduction)
HTML Cheat Sheet - A Basic Guide to HTML
Design a web page using HTML and CSS
Form validation using jQuery
Angular File Upload
JQuery | Set the value of an input text field
Form validation using jQuery
How to change selected value of a drop-down list using jQuery?
How to change the background color after clicking the button in JavaScript ?
How to fetch data from JSON file and display in HTML table using jQuery ?
jQuery | param() Method - GeeksforGeeks

21 Feb, 2019
The param() Method in jQuery is used to create a serialized representation of an object.
Syntax:
$.param( object, trad )
Parameters: This method accepts two parameters as mentioned above and described below:
object: It is a mandatory parameter which is used to specify an array or object to serialize.
trad: It is an optional parameter and used to specify whether or not to use the traditional style of param serialization.
Example 1: This example use param() method to create serialized representation of an object.
<!DOCTYPE html><html>  <head>     <title>        jQuery param() Method    </title>          <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">    </script></head>   <body style="text-align:center;">          <h1 style = "color:green;" >          GeeksForGeeks    </h1>            <h2>jQuery param() Method</h2>      <button>Click</button>          <div></div>          <!-- Script using param() method -->    <script>        $(document).ready(function() {                          personObj = new Object();                          personObj.Firstword = "Geeks";            personObj.Secondword = "For";            personObj.Thirdword = "Geeks";            personObj.Wordcolor = "Green";                           $("button").click(function() {                $("div").text($.param(personObj));            });        });    </script></body>  </html>  
Output:Before click on the button:After click on the button:
Example 2: This example use param() method to create serialized representation of an object.
<!DOCTYPE html><html>  <head>     <title>        jQuery param() Method    </title>          <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">    </script></head>   <body style="text-align:center;">          <h1 style = "color:green;" >          GeeksForGeeks    </h1>            <h2>jQuery param() Method</h2>      <button>Click</button>          <div></div>          <!-- Script using param() method -->    <script>        $(document).ready(function() {                          personObj = new Object();                          personObj.Fullword = "GeeksForGeeks ";            personObj.Wordcolor = " Green";                           $("button").click(function(){                $("div").text($.param(personObj));            });        });    </script></body>  </html>  
Output:Before click on the button:After click on the button:
jQuery-Basics
JQuery
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
JQuery | Set the value of an input text field
Form validation using jQuery
How to change selected value of a drop-down list using jQuery?
How to change the background color after clicking the button in JavaScript ?
How to fetch data from JSON file and display in HTML table using jQuery ?
Remove elements from a JavaScript Array
Installation of Node.js on Linux
Convert a string to an integer in JavaScript
How to fetch data from an API in ReactJS ?
How to insert spaces/tabs in text using HTML/CSS?
Flat Panel Display - GeeksforGeeks

22 Jul, 2019
Flat-Panel Devices are the devices that have less volume, weight, and power consumption compared to Cathode Ray Tube (CRT). Due to the advantages of the Flat-Panel Display, use of CRT decreased. As Flat Panel Devices are light in weights that’s why they can be hang on walls and wear them on our wrist as a watch. Flat Panel Display (FPD) allow users to view data, graphics, text and images.
Types of Flat Panel Display:
Emissive Display:The Emissive Display or Emitters are the devices that convert electrical energy into light energy.Examples: Plasma Panel, LED (Light Emitting Diode), Flat CRT. Non-Emissive Display:Non-Emissive Display or Non-Emitters are the devices that use optical effects to convert sunlight or some other source into graphic patterns.Examples: LCD (Liquid Crystal Display) 
Emissive Display:The Emissive Display or Emitters are the devices that convert electrical energy into light energy.Examples: Plasma Panel, LED (Light Emitting Diode), Flat CRT. 
Examples: Plasma Panel, LED (Light Emitting Diode), Flat CRT. 
Non-Emissive Display:Non-Emissive Display or Non-Emitters are the devices that use optical effects to convert sunlight or some other source into graphic patterns.Examples: LCD (Liquid Crystal Display) 
Examples: LCD (Liquid Crystal Display) 
Advantages of Flat Panel Devices:
Flat Panel Devices like LCD produces high quality digital images.
Flat Panel monitor are stylish and have very space saving design.
Flat Panel Devices consumes less power and give maximum image size in minimum space.
Flat Panel Devices use its full color display capability.
Full motion video can be viewed on Flat Panel Devices without artifacts or contrast loss.
computer-graphics
Misc
Misc
Misc
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to write Regular Expressions?
Minimax Algorithm in Game Theory | Set 3 (Tic-Tac-Toe AI - Finding optimal move)
fgets() and gets() in C language
Association Rule
Recursive Functions
Activation Functions
Java Math min() method with Examples
Software Engineering | Prototyping Model
OOPs | Object Oriented Design
Characteristics of Internet of Things
Digit Separator in C++14 - GeeksforGeeks

21 Jan, 2021
In this article, we will discuss the use of a digit separator in C++. Sometimes, it becomes difficult to read numbers that contain many digits. For example, 1000 is readable but what if more zeros are added to it, let’s say 1000000, now it becomes a little difficult to read, and what will happen if more zeros are added to it.  In real life, commas (, ) are added to the number. For Example: 10, 00, 000. Now it is easy to read, that is ten lakhs.
Now the question arises that C++ doesn’t accept such separators (comma) so how to deal with big numbers. To deal with it, C++14 has introduced a feature and its name is Digit Separator and denoted by a simple quotation mark (‘). This can make it easier for users to read large numbers.
Program 1:
Below is the implementation to show that single quote marks are ignored when determining their value:
C++14
// C++ program to demonstrate// the above approach#include <iostream>using namespace std; // Driver codeint main(){    long long int a = 10'00'000;     // Print the value    cout << a;     return 0;}
1000000
Program 2:
Below is the program to show that Single quote marks are just for users. Using them in any position does not affect the compiler.
C++14
// C++ program to demonstrate// the above approach#include <iostream>using namespace std; // Driver Codeint main(){    long long int a = 1'23'456;    long long int b = 12'34'56;    long long int c = 123'456;      // Print all the value    cout << "a:" << a << endl;    cout << "b:" << b << endl;    cout << "c:" << c << endl;     return 0;}
a:123456
b:123456
c:123456
harshit17
Technical Scripter 2020
C++
C++ Programs
Technical Scripter
CPP
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Operator Overloading in C++
Polymorphism in C++
Friend class and function in C++
Sorting a vector in C++
std::string class in C++
Header files in C/C++ and its uses
Program to print ASCII Value of a character
How to return multiple values from a function in C or C++?
C++ Program for QuickSort
Sorting a Map by value in C++ STL