code-rag-bench/online-tutorials huggingface dataset:
Statistical - CONCATENATE Function

The CONCATENATE function joins two or more text strings into one string. In Excel 2016, CONCATENATE Function has been replaced with the CONCAT Function. The CONCATENATE Function is still available for backward compatibility.
CONCATENATE (text1, [text2] ...)

Additional text items to join.
You can have up to 255 items, up to a total of 8,192 characters.
Use commas to separate adjoining text items.
Use commas to separate adjoining text items.
Numbers do not need to have quotation marks.
Numbers do not need to have quotation marks.
Without designated spaces between separate text entries, the text entries will run together. You can add extra spaces as part of the CONCATENATE formula in two ways −

Add double quotation marks with a space between them " "
Add a space after the Text argument


Without designated spaces between separate text entries, the text entries will run together. You can add extra spaces as part of the CONCATENATE formula in two ways −
Add double quotation marks with a space between them " "
Add double quotation marks with a space between them " "
Add a space after the Text argument
Add a space after the Text argument
If quotation marks are missing from a Text argument, CONCATENATE returns #NAME? error value.
If quotation marks are missing from a Text argument, CONCATENATE returns #NAME? error value.
Excel 2007, Excel 2010, Excel 2013, Excel 2016

    296 Lectures 
     146 hours 

 Arun Motoori

    56 Lectures 
     5.5 hours 

 Pavan Lalwani

    120 Lectures 
     6.5 hours 

 Inf Sid

    134 Lectures 
     8.5 hours 

 Yoda Learning

    46 Lectures 
     7.5 hours 

 William Fiset

    25 Lectures 
     1.5 hours 

 Sasha Miller
 Print
 Add Notes
 Bookmark this page
Object and Dynamic Array in C# - GeeksforGeeks

23 Jan, 2019
An array is a group of like-typed variables that are referred to by a common name. And each data item is called an element of the array. The data types of the elements may be any valid data type like char, int, float, etc. and the elements are stored in a contiguous location.
Object array is used to store elements of the different types in a single array. In C#, an object reference may point to any derived type instance.
Disadvantages of Object array:
It makes code more complex.
It decrease the run-time of the program.
Example:
// C# program to illustrate the// concept of object arrayusing System;  class GFG {      // Main method    static public void Main()    {          // Creating and initializing         // object array        object[] arr = new object[6];          arr[0] = 3.899;        arr[1] = 3;        arr[2] = 'g';        arr[3] = "Geeks";          // it will display         // nothing in output        arr[4] = null;          // it will show System.Object        // in output        arr[5] = new object();          // Display the element of         // an object array        foreach(var item in arr)        {            Console.WriteLine(item);        }    }}
3.899
3
g
Geeks

System.Object

The dynamic array provides dynamic memory allocation, adding, searching, and sorting elements in the array. Dynamic array overcomes the disadvantage of the static array. In a static array, the size of the array is fixed but in a dynamic array, the size of the array is defined at run-time. List<T> is the dynamic arrays in C#.
Example:
// C# program to illustrate the// concept of dynamic arrayusing System;using System.Collections;using System.Collections.Generic;  class GFG {      // Main method    static public void Main()    {          // Creating and initializing         // the value in a dynamic list        List<int> myarray = new List<int>();        myarray.Add(23);        myarray.Add(1);        myarray.Add(78);        myarray.Add(45);        myarray.Add(543);          // Display the element of the list        Console.WriteLine("Elements are: ");        foreach(int value in myarray)        {            Console.WriteLine(value);        }          // Sort the elements of the list        myarray.Sort();          // Display the sorted element of list        Console.WriteLine("Sorted element");        foreach(int i in myarray)        {            Console.WriteLine(i);        }    }}
Elements are: 
23
1
78
45
543
Sorted element
1
23
45
78
543

CSharp-Arrays
C#
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
C# | Class and Object
Difference between Ref and Out keywords in C#
C# | Constructors
Introduction to .NET Framework
Extension Method in C#
C# | Delegates
C# | Abstract Classes
C# | Data Types
HashSet in C# with Examples
Top 50 C# Interview Questions & Answers
Remove last char if it's a specific character in MySQL?

To remove last char if it is a specific character then use SUBSTRING(). Let us first create a table −
mysql> create table DemoTable
   (
   SubjectName varchar(100)
   );
Query OK, 0 rows affected (0.47 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('MySQL');
Query OK, 1 row affected (0.12 sec)
mysql> insert into DemoTable values('MongoDB?');
Query OK, 1 row affected (0.16 sec)
mysql> insert into DemoTable values('Java?');
Query OK, 1 row affected (0.19 sec)
mysql> insert into DemoTable values('C');
Query OK, 1 row affected (0.16 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
+-------------+
| SubjectName |
+-------------+
| MySQL       |
| MongoDB?    |
| Java?       |
| C           |
+-------------+
4 rows in set (0.00 sec)
Here is the query to remove last char if it's a specific character, for example question mark (?) here −
mysql> update DemoTable SET SubjectName = SUBSTRING(SubjectName, 1, CHAR_LENGTH(SubjectName) - 1)
   where SubjectName like '%?';
Query OK, 2 rows affected (0.25 sec)
Rows matched : 2 Changed : 2 Warnings : 0
Let us check the table records once again −
mysql> select *from DemoTable;
+-------------+
| SubjectName |
+-------------+
| MySQL       |
| MongoDB     |
| Java        |
| C           |
+-------------+
4 rows in set (0.00 sec)
How to add Timestamp in Mongodb Collection using Node.js ? - GeeksforGeeks

10 Mar, 2021
Timestamp: With the help of timestamp document in the collection of the MongoDB can be differentiated on the basis of time. We can add Timestamp in Mongodb Collection in Node.js using the following approach:
Installing Module: Install the mongoose module using the following command:
npm install mongoose
Project Structure: Our project structure will look like this.
Running the server on Local IP: Data is the directory where MongoDB server is present.
mongod --dbpath=data --bind_ip 127.0.0.1
Example: Inserting out of limit value.
Filename:  
index.js
// Importing mongoose moduleconst mongoose = require("mongoose");  // Database Addressconst url = "mongodb://localhost:27017/GFG";  // Connecting to databasemongoose  .connect(url)  .then((ans) => {    console.log("Connected Successful");  })  .catch((err) => {    console.log("Error in the Connection");  });  // Calling Schema classconst Schema = mongoose.Schema;  // Creating Structure of the collectionconst collection_structure = new Schema({  name: {    type: String,    required: true,  },  marks: {    type: Number,    min: 10,    max: 100,  },});  // Creating collectionconst collections = mongoose.model("GFG2", collection_structure);  // Inserting one documentcollections  .create({      // Inserting value of only one key    name: "GFG",    marks: 1001,  })  .then((ans) => {    console.log(ans);  })  .catch((err) => {    console.log(err.message);  });
Run index.js file using below command:
node index.js
Output:
Mongoose
NodeJS-Questions
Technical Scripter 2020
MongoDB
Node.js
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
How to connect MongoDB with ReactJS ?
MongoDB - limit() Method
MongoDB - FindOne() Method
Create user and add role in MongoDB
MongoDB Cursor
Installation of Node.js on Linux
How to update Node.js and NPM to next version ?
Node.js fs.readFileSync() Method
Express.js express.Router() Function
Node.js fs.readFile() Method
Angular 10 formatPercent() Method - GeeksforGeeks

24 May, 2021
In this article, we are going to see what is formatPercent in Angular 10 and how to use it. formatPercent is used to format a number as a percentage according to locale rules.
Syntax:
formatPercent(value, locale, digitsInfo)
Parameters:
value: The number to format.
locale: A locale code for the locale format.
digitsInfo: Decimal representation options.
Return Value:
string: the formatted percent string.
NgModule: Module used by formatPercent is:
CommonModule
Approach: 
Create the Angular app to be used.
In app.module.ts import LOCALE_ID because we need locale to be imported for using get formatPercent.
import { LOCALE_ID, NgModule } from '@angular/core';
In app.component.ts import formatPercent Zand LOCALE_ID
inject LOCALE_ID as a public variable.
In app.component.html show the local variable using string interpolation
Serve the angular app using ng serve to see the output.
Example 1:
app.component.ts
import {  formatPercent }  from '@angular/common';  import {Component,  Inject,  LOCALE_ID }  from '@angular/core';  @Component({selector: 'app-root',templateUrl: './app.component.html'})export class AppComponent {curr = formatPercent(31,this.locale,          '3.0-4');constructor(  @Inject(LOCALE_ID) public locale: string,){}}
app.component.html
<h1>  GeeksforGeeks</h1>  <p>Locale Percent is : {{curr}}</p>
Output:
Example 2:
app.component.ts
import {  formatPercent }  from '@angular/common';  import {Component,  Inject,  LOCALE_ID }  from '@angular/core';  @Component({selector: 'app-root',templateUrl: './app.component.html'})export class AppComponent {curr = formatPercent(31,this.locale,          '3.2-4');constructor(  @Inject(LOCALE_ID) public locale: string,){}}
app.component.html
<h1>  GeeksforGeeks</h1>  <p>Locale Percent is : {{curr}}</p>
Output:
Example 3:
app.component.ts
import {  formatPercent }  from '@angular/common';  import {Component,  Inject,  LOCALE_ID }  from '@angular/core';  @Component({selector: 'app-root',templateUrl: './app.component.html'})export class AppComponent {curr = formatPercent(31.21,this.locale,          '3.0-4');constructor(  @Inject(LOCALE_ID) public locale: string,){}}
app.component.html
<h1>  GeeksforGeeks</h1>  <p>Locale Percent is : {{curr}}</p>
Output:
Reference: https://angular.io/api/common/formatPercent
Angular10
AngularJS-Basics
AngularJS-Function
AngularJS
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Angular PrimeNG Dropdown Component
Angular PrimeNG Calendar Component
Angular 10 (blur) Event
Angular PrimeNG Messages Component
How to make a Bootstrap Modal Popup in Angular 9/8 ?
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?
How to Sort by Date in Excel? - GeeksforGeeks

06 Sep, 2021
Excel is providing various types of sorting formats e.g. “sort A to Z”, “Sort Z to A”, “Sort by color” and “Sort by date” etc. Sorting in Excel is nothing but arranging data into some meaningful order to make it easier to understand, analyze or visualize. 
Chronological or reverse chronological order is the easiest way to sort data by date. This sorts the data in ascending or descending order. In Excel, must have the dates in one single format to sort the data by date otherwise they do not correctly work always.
To sorting the dates in chronological order follow the below steps:
Step 1:  Select the dates which you want to sort in ascending or descending order.
Step 2: Click Home tab >click on the arrow under Sort & Filter, and then click Sort Oldest to Newest.
As a result, data is sorted from oldest to newest.
Step 3:  If you want to sort dates from Newest to Oldest, then Click Home tab >click on the arrow under Sort & Filter, and then click Sort Newest to Oldest.
As a result, data is sorted by newest to oldest.
If you want to sort dates by month, ignoring the year, then you have to add a helper column, extract the month number, and sort by that column because the default Excel sort feature always considers the year.
You can use the “MONTH” function to get a month from the date.
Syntax:
=MONTH (serial_number)
Now follow the below steps to sort by month in Excel:
Step 1: Extract the month number from the date column.
In the above example, the month number is extracted from the “date of birth” column by using the =MONTH(D3) formula:
Step 2: Sort the table by the Month column, select the month range which you want to sort. Then Click Home tab >click on the arrow under Sort & Filter, and then click Sort Smallest to Largest.
As a result, data is sorted by month smallest to largest.
Excel TEXT functions are assisting for it. It converts a date into a text string in the specified format. For our function, the “mm-dd” format code will work.
Syntax:
=Text(Value, format_text)
Now follow the below steps to sort the by Month and day in Excel: 
Step 1: Extract the month and day from the date column.
In the above example, the “month and date” is extracted from the “date of birth” column by using the =TEXT(D3,”mm-dd”) formula:
Step 2: Sort the table by the Month and Day column, select the Month and Day column range which you want to sort. Then Click Home tab >click on the arrow under Sort & Filter, and then click Sort Z to A.
As a result, data is now sorted by “month and day”, largest to smallest.
Excel-functions
Picked
Excel
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Use Solver in Excel?
How to Find the Last Used Row and Column in Excel VBA?
How to Get Length of Array in Excel VBA?
Using CHOOSE Function along with VLOOKUP in Excel
Macros in Excel
Introduction to Excel Spreadsheet
How to Extract the Last Word From a Cell in Excel?
How to Show Percentages in Stacked Column Chart in Excel?
How to Remove Duplicates From Array Using VBA in Excel?
How to Sum Values Based on Criteria in Another Column in Excel?
Blank Final in Java - GeeksforGeeks

07 Jun, 2016
A final variable in Java can be assigned a value only once, we can assign a value either in declaration or later.
    final int i = 10;
    i = 30; // Error because i is final.
A blank final variable in Java is a final variable that is not initialized during declaration. Below is a simple example of blank final.
    // A simple blank final example 
    final int i;
    i = 30;
How are values assigned to blank final members of objects?Values must be assigned in constructor.
// A sample Java program to demonstrate use and// working of blank finalclass Test{    // We can initialize here, but if we    // initialize here, then all objects get    // the same value.  So we use blank final    final int i;      Test(int x)    {        // Since we have initialized above, we        // must initialize i in constructor.        // If we remove this line, we get compiler        // error.        i = x;    }}  // Driver Codeclass Main{    public static void main(String args[])    {        Test t1 = new Test(10);        System.out.println(t1.i);          Test t2 = new Test(20);        System.out.println(t2.i);    }}
Output:
10
20

If we have more than one constructors or overloaded constructor in class, then blank final variable must be initialized in all of them. However constructor chaining can be used to initialize the blank final variable.
// A Java program to demonstrate that we can// use constructor chaining to initialize// final membersclass Test{    final public int i;      Test(int val)    {  this.i = val;  }      Test()    {        // Calling Test(int val)        this(10);    }      public static void main(String[] args)    {        Test t1 = new Test();        System.out.println(t1.i);          Test t2 = new Test(20);        System.out.println(t2.i);    }}
Output:
10
20
Blank final variables are used to create immutable objects (objects whose members can’t be changed once initialized).
This article is contributed by Himanshi Gupta. If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
Java
Java
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Stream In Java
Interfaces in Java
Singleton Class in Java
Set in Java
Multithreading in Java
Collections in Java
Queue Interface In Java
Initializing a List in Java
LinkedList in Java
Overriding in Java
Python | Print the common elements in all sublists - GeeksforGeeks

18 Feb, 2019
Given a list of lists, the task is to find the elements which are common in all sublist.
There are various approaches to do this task. Let’s discuss the approaches one by one.
Method #1: Using set
# Python code to find duplicate element in all # sublist from list of list  # List of list initializationInput = [ [10, 20, 30, 40],          [30, 40, 60, 70],          [20, 30, 40, 60, 70],          [30, 40, 80, 90], ]  Output = set(Input[0])for l in Input[1:]:    Output &= set(l)  # Converting to listOutput = list(Output)  # Printing answerprint(Output)
[40, 30]

 Method #2: Using reduce and map
# Python code to find duplicate element in all # sublist from list of listimport operatorfrom functools import reduce  # List of list initializationInput = [ [10, 20, 30, 40],          [30, 40, 60, 70],          [20, 30, 40, 60, 70],           [30, 40, 80, 90], ]  # using reduce and mapout = reduce(operator.iand, map(set, Input))  # Converting into listout = list(out)  # Printing outputprint(out)
[40, 30]

 Method #3: Using set.intersection
# Python code to find duplicate element in all # sublist from list of list  # importing reduce from functools import reduce  # function for set intersectiondef func(a, b):    return list(set(a).intersection(set(b)))  # List of list initializationInput = [ [10, 20, 30, 40],          [30, 40, 60, 70],          [20, 30, 40, 60, 70],           [30, 40, 80, 90], ]  # using reduce and set.intersectionout = reduce(func, Input)  # Printing outputprint(out)
[40, 30]

Python list-programs
python-list
Python
Python Programs
python-list
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Install PIP on Windows ?
Check if element exists in list in Python
How To Convert Python Dictionary To JSON?
How to drop one or multiple columns in Pandas Dataframe
Python Classes and Objects
Defaultdict in Python
Python | Get dictionary keys as a list
Python | Split string into list of characters
Python | Convert a list to dictionary
How to print without newline in Python?
How to use TreeView Component in ReactJS ? - GeeksforGeeks

08 Apr, 2021
As the name suggests, a tree view widget presents a hierarchical list. Material UI for React has this component available for us, and it is very easy to integrate. We can use the following approach in ReactJS to use TreeView Component.
Creating React Application And Installing Module:
Step 1: Create a React application using the following command:
npx create-react-app foldername
Step 2: After creating your project folder i.e. foldername, move to it using the following command:
cd foldername
Step 3: After creating the ReactJS application, Install the material-ui module using the following command:
npm install @material-ui/core
npm install @material-ui/lab
npm install @material-ui/icons
Project Structure: It will look like the following.
Project Structure
Example: Now write down the following code in the App.js file. Here, App is our default component where we have written our code.
App.js
import React from 'react';import ExpandMoreIcon from '@material-ui/icons/ExpandMore';import ChevronRightIcon from '@material-ui/icons/ChevronRight';import TreeItem from '@material-ui/lab/TreeItem';import TreeView from '@material-ui/lab/TreeView';  export default function App() {    return (    <div style={{ display: 'block', padding: 30 }}>      <h4>How to use TreeView Component in ReactJS?</h4>      <TreeView        style={{          height: 240,          maxWidth: 400,          flexGrow: 1,        }}        defaultExpandIcon={<ChevronRightIcon />}        defaultCollapseIcon={<ExpandMoreIcon />}      >        <TreeItem nodeId="0" label="States">          <TreeItem nodeId="1" label="Madhya Pradesh" />          <TreeItem nodeId="2" label="Goa" />          <TreeItem nodeId="3" label="Delhi" />          <TreeItem nodeId="4" label="Mumbai, etc" />        </TreeItem>      </TreeView>    </div>  );}
Step to Run Application: Run the application using the following command from the root directory of the project:
npm start
Output: Now open your browser and go to http://localhost:3000/, you will see the following output:
Reference: https://material-ui.com/components/tree-view/
Material-UI
React-Questions
JavaScript
ReactJS
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Remove elements from a JavaScript Array
Difference between var, let and const keywords in JavaScript
Difference Between PUT and PATCH Request
JavaScript | Promises
How to get character array from string in JavaScript?
How to fetch data from an API in ReactJS ?
How to redirect to another page in ReactJS ?
How to pass data from child component to its parent in ReactJS ?
How to pass data from one component to other component in ReactJS ?
ReactJS Functional Components
Path getParent() method in Java with Examples - GeeksforGeeks

16 Jul, 2019
The Java Path interface was added to Java NIO in Java 7. The Path interface is located in the java.nio.file package, so the fully qualified name of the Java Path interface is java.nio.file.Path. A Java Path instance represents a path in the file system. A path can use to locate either a file or a directory.path of an entity could be of two types one is an absolute path and other is a relative path. The absolute path is the location address from the root to the entity while the relative path is the location address which is relative to some other path.
getParent() method of java.nio.file.Path used to return the parent path of current path object, or null if this path does not have a parent. The parent path of this path object consists of this path’s root component and each element in the path except for the farthest from the root in the directory hierarchy. If this path has more than one element, and no root component, then this method is equivalent to evaluating the expression:
subpath(0, getNameCount()-1);
Syntax:
Path getParent()

Parameters: This method accepts nothing.
Return value: This method returns a path representing the path’s parent.
Below programs illustrate getParent() method:Program 1:
// Java program to demonstrate// java.nio.file.Path.getParent() method  import java.io.IOException;import java.nio.file.Path;import java.nio.file.Paths;  public class GFG {    public static void main(String[] args)        throws IOException    {          // create object of Path        Path path            = Paths.get("D:/workspace/AmanCV.docx");          // call getParent() to get parent path        Path parentPath = path.getParent();          // print ParentPath        System.out.println("Parent Path: "                           + parentPath);    }}
Parent Path: D:/workspace

Program 2:
// Java program to demonstrate// java.nio.file.Path.getParent() method  import java.io.IOException;import java.nio.file.Path;import java.nio.file.Paths;  public class GFG {    public static void main(String[] args)        throws IOException    {          // create object of Path        Path path = Paths.get("D:/Resume.pdf");          // call getParent() to get parent path        Path parentPath = path.getParent();          // print ParentPath        System.out.println("Parent Path: "                           + parentPath);    }}
Parent Path: D:

References: https://docs.oracle.com/javase/10/docs/api/java/nio/file/Path.html#getParent()
Java-Functions
Java-Path
java.nio.file package
Java
Java
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Object Oriented Programming (OOPs) Concept in Java
HashMap in Java with Examples
Stream In Java
Interfaces in Java
How to iterate any Map in Java
Initialize an ArrayList in Java
ArrayList in Java
Stack Class in Java
Singleton Class in Java
Multidimensional Arrays in Java
SSL Certificate Verification - Python requests - GeeksforGeeks

09 Sep, 2021
Requests verifies SSL certificates for HTTPS requests, just like a web browser. SSL Certificates are small data files that digitally bind a cryptographic key to an organization’s details. Often, a website with a SSL certificate is termed as secure website. By default, SSL verification is enabled, and Requests will throw a SSLError if it’s unable to verify the certificate.
Let us try to access a website with an invalid SSL certificate, using Python requests 
Python3
# import requests moduleimport requests # Making a get requestresponse = requests.get('https://expired.badssl.com/') # print request objectprint(response)
Output :-  
This website doesn’t have SSL setup so it raises this error.To disable certificate verification, at the client side, one can use verify attribute.  
Python3
# import requests moduleimport requests # Making a get requestresponse = requests.get('https://expired.badssl.com/', verify = False) # print request objectprint(response)
Output 
Since output response 200 is printed, we can assume that request was successful.  
one can also pass the link to the certificate for validation via python requests only.  
Python3
# import requests moduleimport requests # Making a get requestresponse = requests.get('https://github.com', verify ='/path / to / certfile') # print request objectprint(response)
This would work in case the path provided is correct for SSL certificate for github.com. 
You can also specify a local cert to use as client side certificate, as a single file (containing the private key and the certificate) or as a tuple of both files’ paths: 
>>> requests.get('https://kennethreitz.org', cert=('/path/client.cert', '/path/client.key'))
or persistent:  
s = requests.Session()
s.cert = '/path/client.cert'
If you specify a wrong path or an invalid cert, you’ll get a SSLError: 
>>> requests.get('https://kennethreitz.org', cert='/wrong_path/client.pem')
SSLError: [Errno 336265225] _ssl.c:347: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib
 
kushagrathegame1
Python-requests
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Python Dictionary
How to Install PIP on Windows ?
Enumerate() in Python
Different ways to create Pandas Dataframe
Python String | replace()
*args and **kwargs in Python
Create a Pandas DataFrame from Lists
Convert integer to string in Python
Check if element exists in list in Python
sum() function in Python
How to Convert a Byte value to String value in Java with Examples - GeeksforGeeks

30 Jan, 2020
Given a Byte value in Java, the task is to convert this byte value to string type.
Examples:
Input: 1
Output: "1"

Input: 3
Output: "3"

Approach 1: (Using + operator)One method is to create a string variable and then append the byte value to the string variable with the help of + operator. This will directly convert the byte value to a string and add it in the string variable.
Below is the implementation of the above approach:
Example 1:
// Java Program to convert// byte value to String value  class GFG {      // Function to convert    // byte value to String value    public static String    convertByteToString(byte byteValue)    {          // Convert byte value to String value        // using + operator method        String stringValue = "" + byteValue;          return (stringValue);    }      // Driver code    public static void main(String[] args)    {          // The byte value        byte byteValue = 1;          // The expected string value        String stringValue;          // Convert byte to string        stringValue            = convertByteToString(byteValue);          // Print the expected string value        System.out.println(            byteValue            + " after converting into string = "            + stringValue);    }}
1 after converting into string = 1

Approach 2: (Using String.valueOf() method)The simplest way to do so is using valueOf() method of String class in java.lang package. This method takes the byte value to be parsed and returns the value in String type from it.
Syntax:
String.valueOf(byteValue);

Below is the implementation of the above approach:
Example 1:
// Java Program to convert// byte value to String value  class GFG {      // Function to convert    // byte value to String value    public static String    convertByteToString(byte byteValue)    {          // Convert byte value to String value        // using valueOf() method        return String.valueOf(byteValue);    }      // Driver code    public static void main(String[] args)    {          // The byte value        byte byteValue = 1;          // The expected string value        String stringValue;          // Convert byte to string        stringValue            = convertByteToString(byteValue);          // Print the expected string value        System.out.println(            byteValue            + " after converting into string = "            + stringValue);    }}
1 after converting into string = 1

Java-Byte
Java-Data Types
Java-String-Programs
Java
Java Programs
Java
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Object Oriented Programming (OOPs) Concept in Java
HashMap in Java with Examples
Stream In Java
Interfaces in Java
How to iterate any Map in Java
Initializing a List in Java
Convert a String to Character Array in Java
Java Programming Examples
Convert Double to Integer in Java
Implementing a Linked List in Java using Class
Move last element to front of a given Linked List in C++

Given a linked list, we have to move the last element to the front. Let's see an example.
Input
1 -> 2 -> 3 -> 4 -> 5 -> NULL
Output
5 -> 1 -> 2 -> 3 -> 4 -> NULL
Initialise the linked list.
Initialise the linked list.
Return if the linked list is empty or it has single node.
Find the last node and second last nodes of the linked list.
Find the last node and second last nodes of the linked list.
Make the last node as new head.
Make the last node as new head.
Update the link of second last node.
Update the link of second last node.
Following is the implementation of the above algorithm in C++
#include <bits/stdc++.h>
using namespace std;
struct Node {
   int data;
   struct Node* next;
};
void moveFirstNodeToEnd(struct Node** head) {
   if (*head == NULL || (*head)->next == NULL) {
      return;
   }
   struct Node* secondLastNode = *head;
   struct Node* lastNode = *head;
   while (lastNode->next != NULL) {
      secondLastNode = lastNode;
      lastNode = lastNode->next;
   }
   secondLastNode->next = NULL;
   lastNode->next = *head;
   *head = lastNode;
}
void addNewNode(struct Node** head, int new_data) {
   struct Node* newNode = new Node;
   newNode->data = new_data;
   newNode->next = *head;
   *head = newNode;
}
void printLinkedList(struct Node* node) {
   while (node != NULL) {
      cout << node->data << "->";
      node = node->next;
   }
   cout << "NULL" << endl;
}
int main() {
   struct Node* head = NULL;
   addNewNode(&head, 1);
   addNewNode(&head, 2);
   addNewNode(&head, 3);
   addNewNode(&head, 4);
   addNewNode(&head, 5);
   addNewNode(&head, 6);
   addNewNode(&head, 7);
   addNewNode(&head, 8);
   addNewNode(&head, 9);
   moveFirstNodeToEnd(&head);
   printLinkedList(head);
   return 0;
}
If you run the above code, then you will get the following result.
1->9->8->7->6->5->4->3->2->NULL
ConcurrentLinkedQueue in Java

The ConcurrentLinkedQueue class in Java is used to implement a queue using a concurrent linked list. This class implements the Collection interface as well as the AbstractCollection class. It is a part of the Java Collection Framework.
A program that demonstrates this is given as follows −
 Live Demo
import java.util.concurrent.*;
public class Demo {
   public static void main(String[] args) {
      ConcurrentLinkedQueue<String> clQueue = new ConcurrentLinkedQueue<String>();
      clQueue.add("Amy");
      clQueue.add("John");
      clQueue.add("May");
      clQueue.add("Harry");
      clQueue.add("Anne");
      System.out.println("The elements in ConcurrentLinkedQueue are: " + clQueue);
   }
}
The output of the above program is as follows −
The elements in ConcurrentLinkedQueue are: [Amy, John, May, Harry, Anne]
Now let us understand the above program.
The ConcurrentLinkedQueue is created and then elements are added to it. Finally, it is displayed. A code snippet that demonstrates this is given as follows −
ConcurrentLinkedQueue<String> clQueue = new ConcurrentLinkedQueue<String>();
clQueue.add("Amy");
clQueue.add("John");
clQueue.add("May");
clQueue.add("Harry");
clQueue.add("Anne");
System.out.println("The elements in ConcurrentLinkedQueue are: " + clQueue);
cerr - Standard Error Stream Object in C++ - GeeksforGeeks

11 Jan, 2021
Standard output stream(cout): cout is the instance of the ostream class. cout is used to produce output on the standard output device which is usually the display screen. The data needed to be displayed on the screen is inserted in the standard output stream(cout) using the insertion operator(<<).
Standard error stream (cerr): cerr is the standard error stream which is used to output the errors. It is an instance of the ostream class. As cerr stream is un-buffered so it is used when we need to display the error message immediately and does not store the error message to display later. The object of class ostream that represents the standard error stream oriented to narrow characters(of type char). It corresponds to the C stream stderr.The “c” in cerr refers to “character” and ‘err’ means “error”, Hence cerr means “character error”. It is always a good practice to use cerr to display errors.
Below is the program to illustrate cerr:
// C++ program to illustrate std::cerr  #include <iostream>using namespace std;  // Driver Codeint main(){      // This will print "Welcome to GfG"    // in the error window    cerr << "Welcome to GfG! :: cerr";      // This will print "Welcome to GfG"    // in the output window    cout << "Welcome to GfG! :: cout";    return 0;}
In the above program the Output of Line 11 will display an error window as:RunTime Error in CPP code:
Welcome to GfG! :: cerr

CPP-Library
C++
C++ Programs
CPP
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Operator Overloading in C++
Sorting a vector in C++
Friend class and function in C++
Polymorphism in C++
List in C++ Standard Template Library (STL)
Header files in C/C++ and its uses
C++ Program for QuickSort
How to return multiple values from a function in C or C++?
Program to print ASCII Value of a character
C++ program for hashing with chaining
How to filter a query on specific date format with MongoDB?

To filter a query on specific date format, use $dateToString. Let us create a collection with documents −
> db.demo433.insertOne({"DueDate":new Date("2019-11-23")});
{
   "acknowledged" : true,
   "insertedId" : ObjectId("5e771278bbc41e36cc3cae91")
}
> db.demo433.insertOne({"DueDate":new Date("2020-01-03")});
{
   "acknowledged" : true,
   "insertedId" : ObjectId("5e771290bbc41e36cc3cae92")
}
Display all documents from a collection with the help of find() method −
> db.demo433.find();
This will produce the following output −
{ "_id" : ObjectId("5e771278bbc41e36cc3cae91"), "DueDate" : ISODate("2019-11-23T00:00:00Z") }
{ "_id" : ObjectId("5e771290bbc41e36cc3cae92"), "DueDate" : ISODate("2020-01-03T00:00:00Z") }
Following is the query to filter a query on specific date format in MongoDB −
> db.demo433.aggregate([
... { $addFields: {stringDate: { $dateToString: { format: "%Y-%m-%d", date: "$DueDate" } } } },
... { $match: {"stringDate":"2020-01-03"}},
... { $project:{"stringDate":0}}
... ])
This will produce the following output −
{ "_id" : ObjectId("5e771290bbc41e36cc3cae92"), "DueDate" : ISODate("2020-01-03T00:00:00Z") }
Tryit Editor v3.7

HTML Input types
Tryit: input type = file
Print Reverse a linked list using Stack

Given with a linked list program must print the list starting from the end till the front using the stack data structure
Input : 10 -> 5 -> 3 -> 1 -> 7 -> 9
Output: 9 -> 7 -> 1 -> 3 -> 5 -> 10
Here the user can use the approach of poping elements from the stack pointing top at the stack[0] location and than going till stack[n] element
START
Step 1 -> create structure Linked_list
   Declare int data
   Declare struct linked_list *next
End
Step 2 -> declare int stack[30], top = -1
Step 3 -> declare struct linked_list* head = NULL
Step 4 -> create function int printfromstack(int stack[])
   Loop While top>=0
   Print stack[--top]
End
Step 5 -> create function int push(struct linked_list** head, int n)
   declare struct linked_list* newnode = (struct linked_list*)malloc(sizeof(struct linked_list))
   set newnode->data = n
   set newnode->next = (*head)
   set (*head) = newnode
step 6 -> create function int intostack(struct linked_list* head)
   Loop While head!=NULL
      Print head->data
   Set stack[++top] = head->data
   Set head = head->next
   End
End
Step 7 -> goto main()
   Call push(&head, 10)
   Call push(&head, 20)
   Call push(&head, 30)
   Call push(&head, 40)
   Call intostack(head)
   Call printfromstack(stack)
STOP
#include <stdio.h>
#include <stdlib.h>
struct linked_list {
   int data;
   struct linked_list *next;
};
int stack[30], top = -1;
struct linked_list* head = NULL;
int printfromstack(int stack[]) {
   printf("\nStack:\n");
   while(top>=0) {
      printf("%d ", stack[top--]);
   }
}
int push(struct linked_list** head, int n) {
   struct linked_list* newnode = (struct linked_list*)malloc(sizeof(struct linked_list));
   newnode->data = n;
   newnode->next = (*head);
   (*head) = newnode;
}
int intostack(struct linked_list* head) {
   printf("Linked list:\n");
   while(head!=NULL) {
      printf("%d ", head->data);
      stack[++top] = head->data;
      head = head->next;
   }
}
int main(int argc, char const *argv[]) {
   push(&head, 10);
   push(&head, 20);
   push(&head, 30);
   push(&head, 40);
   intostack(head);
   printfromstack(stack);
   return 0;
}
if we run the above program then it will generate the following output
Linked list:
40 30 20 10
Stack:
10 20 30 40
CloneNotSupportedException in Java with Examples - GeeksforGeeks

24 Sep, 2021
CloneNotSupportedException is thrown to show that the clone method in class Object has been called to clone an object, but that the object’s class does not implement the Cloneable interface.
Hierarchy:
Those applications which override the clone method can also throw this type of exception to indicate that an object couldn’t or shouldn’t be cloned.
Syntax:
public class CloneNotSupportedException extends Exception
Example of CloneNotSupportedException :
Java
// Java program to demonstrate CloneNotSupportedException class TeamPlayer {     private String name;     public TeamPlayer(String name)    {        super();        this.name = name;    }     @Override public String toString()    {        return "TeamPlayer[Name= " + name + "]";    }     @Override    protected Object clone()        throws CloneNotSupportedException    {        return super.clone();    }} public class CloneNotSupportedExceptionDemo {     public static void main(String[] args)    {         // creating instance of class TeamPlayer         TeamPlayer t1 = new TeamPlayer("Piyush");        System.out.println(t1);         // using try catch block        try {                          // CloneNotSupportedException will be thrown             // because TeamPlayer class not implemented             // Cloneable interface.                          TeamPlayer t2 = (TeamPlayer)t1.clone();            System.out.println(t2);        }         catch (CloneNotSupportedException a) {            a.printStackTrace();        }    }}
Output : 
sagartomar9927
Java-Exceptions
Picked
Java
Java
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Functional Interfaces in Java
Stream In Java
Constructors in Java
Different ways of Reading a text file in Java
Exceptions in Java
Generics in Java
Comparator Interface in Java with Examples
Strings in Java
Difference between Abstract Class and Interface in Java
How to remove an element from ArrayList in Java?
How to align views at the bottom of the screen in Android?

This example demonstrate about How to align views at the bottom of the screen in Android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.java
<? xml version= "1.0" encoding= "utf-8" ?>
<RelativeLayout xmlns: android = "http://schemas.android.com/apk/res/android"
   xmlns: tools = "http://schemas.android.com/tools"
   android :layout_width= "match_parent"
   android :layout_height= "match_parent"
   android :orientation= "vertical"
   tools :context= ".MainActivity" >
   <TextView
      android :layout_width= "match_parent"
      android :layout_height= "wrap_content"
      android :layout_alignParentBottom= "true"
      android :gravity= "center"
      android :padding= "16dp"
      android :text= "Bottom of the screen"
      android :textAppearance= "@style/Base.TextAppearance.AppCompat.Large" />
</RelativeLayout>
Step 3 − Add the following code to src/MainActivity.java
package app.tutorialspoint.com.sample ;
import android.os.Bundle ;
import android.support.v7.app.AppCompatActivity ;
public class MainActivity extends AppCompatActivity {
   @Override
   protected void onCreate (Bundle savedInstanceState) {
      super .onCreate(savedInstanceState) ;
      setContentView(R.layout. activity_main ) ;
   }
}
Step 4 − Add the following code to androidManifest.xml
<? xml version= "1.0" encoding= "utf-8" ?>
<manifest xmlns: android = "http://schemas.android.com/apk/res/android"
   package= "app.tutorialspoint.com.sample" >
   <uses-permission android :name= "android.permission.INTERNET" />
   <application
      android :allowBackup= "true"
      android :icon= "@mipmap/ic_launcher"
      android :label= "@string/app_name"
      android :roundIcon= "@mipmap/ic_launcher_round"
      android :supportsRtl= "true"
      android :theme= "@style/AppTheme" >
      <activity android :name= ".MainActivity" >
         <intent-filter>
            <action android :name= "android.intent.action.MAIN" />
            <category android :name= "android.intent.category.LAUNCHER" />
         </intent-filter>
      </activity>
   </application>
</manifest>
Let's try to run your application. I assume you have connected your actual Android Mobile device with your computer. To run the app from android studio, open one of your project's activity files and click Run  icon from the toolbar. Select your mobile device as an option and then check your mobile device which will display your default screen –
Armstrong number in Java.

Following is the required program.
 Live Demo
public class Tester {
   public static void main(String[] args) {
      int c = 0, a, temp;
      int m = 153;
      int n = m;
      temp = n;
      while (n > 0) {
         a = n % 10;
         n = n / 10;
         c = c + (a * a * a);
      }
      if (temp == c)
         System.out.println(m + " is an armstrong number");
      else
         System.out.println(m + "is not an armstrong number");
   }
}
153 is an armstrong number
Python - Descending Sort String Numbers - GeeksforGeeks

11 May, 2020
Reverse Sorting a list is easy task and has been dealt with in many situations. With Machine Learning and Data Science emerging, sometimes we can get the data in the format of list of numbers but with string as data type. Generic Sort functions give erroneous result in that case, hence several other methods have to employed to perform these particular task. Lets discuss ways in which this is performed.
Method #1 : Naive MethodIn the naive method requires the type conversion of all the elements into integers of the list iterated through a loop. After that generic sort function is employed to perform the task. The descending sorting is done by passing reverse.
# Python3 code to demonstrate # Descending Sort String Numbers# using naive method   # initializing list test_list = [ '4', '6', '7', '2', '1']  # printing original list print ("The original list is : " + str(test_list))  # Descending Sort String Numbers# numeric string sortingfor i in range(0, len(test_list)) :    test_list[i] = int(test_list[i])test_list.sort(reverse = True)  # printing resultprint ("The resultant reverse sorted list : " + str(test_list))
The original list is : ['4', '6', '7', '2', '1']
The resultant reverse sorted list : [7, 6, 4, 2, 1]

 
Method #2 : Using sort() using key + reverseThe generic sort() can be used to perform this particular task, but has to be specified with the key as integer to convert it to integer while performing sort function internally. The descending sorting is done by passing reverse.
# Python3 code to demonstrate # Descending Sort String Numbers# using sort() + key  # initializing list test_list = [ '4', '6', '7', '2', '1']  # printing original list print ("The original list is : " + str(test_list))  # using sort() + key# Descending Sort String Numberstest_list.sort(key = int, reverse = True)  # printing resultprint ("The resultant reverse sorted list : " + str(test_list))
The original list is : ['4', '6', '7', '2', '1']
The resultant reverse sorted list : ['7', '6', '4', '2', '1']

Python list-programs
Python-sort
Python
Python Programs
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
Python program to convert a list to string
Defaultdict in Python
Python | Get dictionary keys as a list
Python | Split string into list of characters
Python | Convert a list to dictionary