code-rag-bench/online-tutorials huggingface dataset:
PHP | ctype_alnum() (Check for Alphanumeric)

07 Jun, 2018
A ctype_alnum() function in PHP used to check all characters of given string/text are alphanumeric or not. If all characters are alphanumeric then return TRUE, otherwise return FALSE.
Syntax:
 bool ctype_alnum ($text)
Parameters Used:
$text : It is a mandatory parameter which specifies the string.
Examples:
Input  : Geeks
Output : Yes
Explanation : String "Geeks" is alphanumeric.
              Note: Read Standard c local letter.
      
Input  : '%%%Contribute_article on GFG!!!'
Output : No
         
Explanation : String contains Special characters.
                 

Note: Except string or digit, if we input anything then it will return FALSE.
Below programs illustrate the ctype_alnum() function.
Program :1Drive a code ctype_alnum()() function for better understand.
<?php  // PHP program to check given string is // all characters are alphanumeric  $string = 'GeeksforGeeks';      if ( ctype_alnum($string))        echo "Yes\n";    else         echo "No\n";  ?>
Yes

Program: 2 Drive a code of ctype_alnum() function where input will be a array of string integers, string with special symbols.
<?php// PHP program to check given string is // all characters are alphanumeric  $strings = array(    'Geeks',    'geek@gmail.com',    '2018',    'GFG2018',    'a b c ',    '@!$%^&*()|2018');  // Checking above given four strings // by used of  ctype_alnum() function .foreach ($strings as $test) {          if (ctype_alnum($test))        echo "Yes\n";    else        echo "No\n";      }  ?>
Yes
No
Yes
Yes
No
No

References :http://php.net/manual/en/function.ctype-alnum.php
PHP-function
PHP
Web Technologies
PHP
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Insert Form Data into Database using PHP ?
How to convert array to string in PHP ?
How to Upload Image into Database and Display it using PHP ?
How to check whether an array is empty using PHP?
PHP | Converting string to Date and DateTime
Installation of Node.js on Linux
Top 10 Projects For Beginners To Practice HTML and CSS Skills
Difference between var, let and const keywords in JavaScript
How to insert spaces/tabs in text using HTML/CSS?
How to fetch data from an API in ReactJS ?
Python | How to get Subtraction of tuples

21 Nov, 2019
Sometimes, while working with records, we might have a common problem of subtracting contents of one tuple with corresponding index of other tuple. This has application in almost all the domains in which we work with tuple records. Let’s discuss certain ways in which this task can be performed.
Method #1 : Using map() + lambdaCombination of above functionalities can solve the problem for us. In this, we compute the subtraction using lambda functions and extend the logic to keys using map().
# Python3 code to demonstrate working of# Subtraction of tuples# using map() + lambda  # initialize tuples test_tup1 = (10, 4, 5)test_tup2 = (2, 5, 18)  # printing original tuples print("The original tuple 1 : " + str(test_tup1))print("The original tuple 2 : " + str(test_tup2))  # Subtraction of tuples# using map() + lambdares = tuple(map(lambda i, j: i - j, test_tup1, test_tup2))  # printing resultprint("Resultant tuple after subtraction : " + str(res))
The original tuple 1 : (10, 4, 5)
The original tuple 2 : (2, 5, 18)
Resultant tuple after subtraction : (8, -1, -13)

 
Method #2 : Using map() + sub()The combination of above functions can help us achieve this task. In this, we first extend the logic to all using map() and then perform subtraction of each index using sub().
# Python3 code to demonstrate working of# Addition of tuples# using map() + sub()import operator  # initialize tuples test_tup1 = (10, 4, 5)test_tup2 = (2, 5, 18)  # printing original tuples print("The original tuple 1 : " + str(test_tup1))print("The original tuple 2 : " + str(test_tup2))  # Addition of tuples# using map() + sub()res = tuple(map(operator.sub, test_tup1, test_tup2))  # printing resultprint("Resultant tuple after subtraction : " + str(res))
The original tuple 1 : (10, 4, 5)
The original tuple 2 : (2, 5, 18)
Resultant tuple after subtraction : (8, -1, -13)

Python tuple-programs
Python
Python Programs
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Different ways to create Pandas Dataframe
Enumerate() in Python
Python String | replace()
How to Install PIP on Windows ?
*args and **kwargs in Python
Defaultdict in Python
Python | Get dictionary keys as a list
Python | Convert a list to dictionary
Python Program for Fibonacci numbers
Python | Convert string dictionary to dictionary
Scala - Anonymous Functions

Scala provides a relatively lightweight syntax for defining anonymous functions. Anonymous functions in source code are called function literals and at run time, function literals are instantiated into objects called function values.
Scala supports first-class functions, which means functions can be expressed in function literal syntax, i.e., (x: Int) => x + 1, and that functions can be represented by objects, which are called function values.
Try the following expression, it creates a successor function for integers −
var inc = (x:Int) => x+1

Variable inc is now a function that can be used the usual way −
var x = inc(7)-1

It is also possible to define functions with multiple parameters as follows −
var mul = (x: Int, y: Int) => x*y

Variable mul is now a function that can be used the usual way −
println(mul(3, 4))

It is also possible to define functions with no parameter as follows −
var userDir = () => { System.getProperty("user.dir") }

Variable userDir is now a function that can be used the usual way −
println( userDir )


    82 Lectures 
     7 hours 

 Arnab Chakraborty

    23 Lectures 
     1.5 hours 

 Mukund Kumar Mishra

    52 Lectures 
     1.5 hours 

 Bigdata Engineer

    76 Lectures 
     5.5 hours 

 Bigdata Engineer

    69 Lectures 
     7.5 hours 

 Bigdata Engineer

    46 Lectures 
     4.5 hours 

 Stone River ELearning
 Print
 Add Notes
 Bookmark this page
How to add DatePicker in NuxtJS ? - GeeksforGeeks

13 Dec, 2021
In this article, we are going to learn how we can add a Datepicker in NuxtJs. Nuxt.js is a free and open-source web application framework based on Vue.js, Node.js, Webpack, and Babel.js. Nuxt is inspired by Next.js, which is a framework of similar purpose, based on React.js.
Approach: To add our DatePicker we are going to use the vuejs-datepicker package. The vuejs-datepicker package helps us to add a DatePicker anywhere in our app. So first, we will install the vuejs-datepicker package and then we will create a vue-datepicker.js file in our plugins folder then we will add the datepicker in our app.
Create NuxtJS Application: You can create a new NuxtJs project using the below command:
npx create-nuxt-app gfg
 
Install the required package: Now we will install the vuejs-datepicker package using the below command:
npm i vuejs-datepicker
Project Structure: It will look like this
Adding the DatePicker: To add our datepicker, we have to follow the below steps:
Step 1: Create a new file with the name ‘vue-datepicker.js‘ inside the plugins folder. After creating the file add the below content in the file.
Javascript
import Vue from 'vue'import Datepicker from 'vuejs-datepicker'Vue.component('date-picker', Datepicker)
Step 2: Inside the nuxt.config.js file add the below line inside the plugins section:
nuxt.config.js
plugins: [    '@/plugins/view-ui',    { src: '~/plugins/vue-datepicker', ssr: false },  ],
Step 3: Now to add the DatePicker inside our app add the below lines inside the index.vue file in pages folder.
index.vue
<template>  <div>    <h4>GeeksforGeeks - NuxtJs DatePicker</h4>    <client-only>      <date-picker      placeholder="MM/DD/YYYY"      format="MM/dd/yyyy"      v-model="date_today" />    </client-only>  </div></template>  <script>  export default {    data() {      return {        date_today:new Date()      }    }  }</script>
Explanation: In the above example first, we created the vue-datepicker file in the plugin folder and added the path in nuxt.config.js file. Now we can use the datepicker package anywhere in our app. To add the datepicker we used the <date-picker> component in our index.vue file.  
Steps to run the application: Run the below command in the terminal to run the app.
npm run dev
Nuxt.js
Vue.JS
JavaScript
Node.js
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Difference between var, let and const keywords in JavaScript
Difference Between PUT and PATCH Request
Remove elements from a JavaScript Array
How to get character array from string in JavaScript?
How to filter object array based on attributes?
Installation of Node.js on Linux
Node.js fs.readFileSync() Method
How to update Node.js and NPM to next version ?
Node.js fs.readFile() Method
Node.js fs.writeFile() Method
How to write long strings in Multi-lines C/C++? - GeeksforGeeks

22 Aug, 2019
Image a situation where we want to use or print a long long string in C or C++, how to do this?
In C/C++, we can break a string at any point in the middle using two double quotes in the middle. Below is a simple example to demonstrate the same.
#include<stdio.h>int main(){   // We can put two double quotes anywhere in a string   char *str1  = "geeks""quiz";      // We can put space line break between two double quotes   char *str2  = "Qeeks"     "Quiz";   char *str3  = "Qeeks"                      "Quiz";     puts(str1);   puts(str2);   puts(str3);     puts("Geeks"        // Breaking string in multiple lines        "forGeeks");   return 0;}
Output:geeksquizQeeksQuizQeeksQuizGeeksforGeeks
Below are few examples with long long strings broken using two double quotes for better readability.
#include<stdio.h>int main(){   char *str = "These are reserved words in C language are int, float, "               "if, else, for, while etc. An Identifier is a sequence of"               "letters and digits, but must start with a letter. "               "Underscore ( _ ) is treated as a letter. Identifiers are "               "case sensitive. Identifiers are used to name variables,"               "functions etc.";   puts(str);   return 0; } 
Output: These are reserved words in C language are int, float, if, else, for, while etc. An Identifier is a sequence ofletters and digits, but must start with a letter. Underscore ( _ ) is treated as a letter. Identifiers are case sensitive. Identifiers are used to name variables,functions etc.
Similarly, we can write long strings in printf and or cout.
#include<stdio.h>int main(){   char *str = "An Identifier is a sequence of"               "letters and digits, but must start with a letter. "               "Underscore ( _ ) is treated as a letter. Identifiers are "               "case sensitive. Identifiers are used to name variables,"               "functions etc.";   printf ("These are reserved words in C language are int, float, "            "if, else, for, while etc. %s ", str);   return 0; }
Output: These are reserved words in C language are int, float, if, else, for, while etc. An Identifier is a sequence ofletters and digits, but must start with a letter. Underscore ( _ ) is treated as a letter. Identifiers are case sensitive. Identifiers are used to name variables,functions etc.
This article is contributed by Ayush Jain. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
rahul1642
nidhi_biet
C Array and String
cpp-string
C Language
C++
CPP
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
TCP Server-Client implementation in C
Multithreading in C
Exception Handling in C++
'this' pointer in C++
Arrow operator -> in C/C++ with Examples
Vector in C++ STL
Initialize a vector in C++ (6 different ways)
Inheritance in C++
Map in C++ Standard Template Library (STL)
C++ Classes and Objects
How to create rounded and circular images with CSS?

Following is the code to create rounded and circular images with CSS −
 Live Demo
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
img {
   border-radius: 50%;
   width: 300px;
   height: 300px;
}
</style>
</head>
<body>
<h1>Rounded Images Example</h1>
<img src="https://i.picsum.photos/id/271/400/400.jpg">
</body>
</html>
The above code will produce the following output −
Print matrix in diagonal pattern

Given a 2d array of n*n and the task is to find the antispiral arrangement of the given matrix
Input : arr[4][4]={1,2,3,4,
   5,6,7,8,
   9,10,11,12
   13,14,15,16}
Output : 1 6 11 16 4 7 10 13
START
Step 1 -> declare start variables as r=4, c=4, i and j
Step 2 -> initialize array as mat[r][c] with elements
Step 3 -> Loop For i=0 and i<r and i++
   Print mat[i][j]
Step 4 -> print \n
Step 5 -> Loop For i=0 and i<r and i++
   Print mat[i][4-1-i]
End
STOP
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
   int R=4,C=4,i,j;
   int mat[R][C] = { {1,2,3, 4}, {5,6,7,8},{9,10,11,12},{13,14,15,16}};
   for(i=0;i<R;i++) {
      cout<<mat[i][i]<<" ";
   }
   cout<<"\n";
   for(i=0;i<R;i++) {
      cout<<mat[i][4-1-i]<<" ";
   }
}
if we run the above program then it will generate the following output
1 6 11 16
4 7 10 13
What is xpath in Selenium?

Xpath is one of the most important locators used in Selenium for identifying web elements. It works in the following ways −
It navigates through the Document Object Model (DOM) with the help of
elements and their attributes for identification.
It navigates through the Document Object Model (DOM) with the help of
elements and their attributes for identification.
Although it helps to locate the elements uniquely, it is slower in terms of speed from the other locators.
Although it helps to locate the elements uniquely, it is slower in terms of speed from the other locators.
An xpath is represented by two ways namely ‘/ ‘and ‘// ‘. A forward single slash means absolute path. Here xpath traverses direct from parent to child in DOM. Thus in absolute xpath we have to travel from the root node to the target.
Syntax −
driver.findElement(By.xpath("/html/body/div/input")).
A double forward ‘// ‘slash means relative path. Here xpath finds the matching element in every corner of DOM. It doesn't have a particular beginning point.
Syntax −
driver.findElement(By.xpath("//input[@name=’Tutorial’]")).

It is always recommended to use relative xpath rather than absolute xpath. In absolute xpath, we need to specify from the root to the desired element so if any of the attributes and its value get changed in between, then our xpath will no longer be correct.
Syntax for xpath −
//tagname[@attribute=’value’] or //*[@attribute=’value’]
Xpath basically locates elements with the help of XML path. XML known as the Extensible Markup Language.
Stub

Stubs are used during Top-down integration testing, in order to simulate the behaviour of the lower-level modules that are not yet integrated. Stubs are the modules that act as temporary replacement for a called module and give the same output as that of the actual product.
Stubs are also used when the software needs to interact with an external system.
The above diagram clearly states that Modules 1, 2 and 3 are available for integration, whereas, below modules are still under development that cannot be integrated at this point of time. Hence, Stubs are used to test the modules. The order of Integration will be:
1,2
1,3
2,Stub 1
2,Stub 2
3,Stub 3
3,Stub 4
+ Firstly, the integration between the modules 1,2 and 3
+ Test the integration between the module 2 and stub 1,stub 2
+ Test the integration between the module 3 and stub 3,stub 4

    80 Lectures 
     7.5 hours 

 Arnab Chakraborty

    10 Lectures 
     1 hours 

 Zach Miller

    17 Lectures 
     1.5 hours 

 Zach Miller

    60 Lectures 
     5 hours 

 John Shea

    99 Lectures 
     10 hours 

 Daniel IT

    62 Lectures 
     5 hours 

 GlobalETraining
 Print
 Add Notes
 Bookmark this page
Set NOT NULL attribute to an existing column in MySQL

To set NOT NULL attribute to an existing column, use ALTER TABLE command. Let us first create a table −
mysql> create table DemoTable1949
   (
   UserId int,
   UserName varchar(20)
   );
Query OK, 0 rows affected (0.00 sec)
Here is the query to set NOT NULL attribute to an existing column −
mysql> alter table DemoTable1949 modify UserName varchar(20) not null;
Query OK, 0 rows affected (0.00 sec)
Records: 0  Duplicates: 0  Warnings: 0
Let us check the description of table −
mysql> desc DemoTable1949;
This will produce the following output −
+----------+-------------+------+-----+---------+-------+
| Field    | Type        | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| UserId   | int(11)     | YES  |     | NULL    |       |
| UserName | varchar(20) | NO   |     | NULL    |       |
+----------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable1949 values(101,NULL);
ERROR 1048 (23000): Column 'UserName' cannot be null
mysql> insert into DemoTable1949 values(101,'Chris');
Query OK, 1 row affected (0.00 sec)
mysql> insert into DemoTable1949 values(102,'Bob');
Query OK, 1 row affected (0.00 sec)
Display all records from the table using select statement −
mysql> select * from DemoTable1949;
This will produce the following output −
+--------+----------+
| UserId | UserName |
+--------+----------+
|    101 | Chris    |
|    102 | Bob      |
+--------+----------+
2 rows in set (0.00 sec)
Password Verification in Node.js - GeeksforGeeks

14 Oct, 2021
In Node for password hashing and verification we can use a npm library known as bcryptjs npm-bcryptjs.
Installation of bcryptjs: Node.js contains an inbuilt crypto module’s randomBytes interface which is used to obtain the secure random numbers.
npm install bcryptjs
Approach:
To hash a password use bcrypt.hash(plainTextPassword, salt, callback) which returns a promise if no callback is passed.
To verify plain text password with hashed password use bcrypt.compare(plainTextPassword, hashedPassword, callback) which also returns a promise if no callback is passed.
Example 1:
// Use bcryptjs moduleconst bcrypt = require("bcryptjs");  // Store the password into variableconst password = "password123";  // Use bcrypt.hash() function to hash the passwordbcrypt.hash(password, 8, (err, hashedPassword) => {    if (err) {        return err;    }          // Display the hashed password    console.log(hashedPassword);          // Use bcrypt.compare() function to compare    // the password with hashed password    bcrypt.compare(password, hashedPassword, (err, isMatch) => {        if( err ) {            return err;        }                  // If password matches then display true        console.log(isMatch);    });});
Output:
$2a$08$PV4rYpBwXUPAGuMedxUnAOxq/TozK9o/QSUWaKE1XL8psOyZ.JL4q
true
Example 2:
// Use bcryptjs moduleconst bcrypt = require("bcryptjs");  // Store the password into variableconst password = "password123";  // Use bcrypt.hash() function to hash the passwordbcrypt.hash(password, 8).then(hashedPassword => {       // Display the hashed password    console.log(hashedPassword);          // Compare the password with hashed password    // and return its value     return bcrypt.compare(password, hashedPassword);   }).then(isMatch => {       // If password matches then display true    console.log(isMatch);}).catch(err => {      // Display error log    console.log(err);});
Output:
$2a$08$LKZU9S9WVs3C.S/zpu2U7eua/ocfzD1ytF68QPT5M600auT6M.SxG
true
Picked
Node.js
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Node.js fs.readFile() Method
Node.js fs.writeFile() Method
How to install the previous version of node.js and npm ?
Difference between promise and async await in Node.js
How to use an ES6 import in Node.js?
Top 10 Front End Developer Skills That You Need in 2022
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to fetch data from an API in ReactJS ?
How to insert spaces/tabs in text using HTML/CSS?
Difference between var, let and const keywords in JavaScript
How to check a variable is an array or not in PHP ? - GeeksforGeeks

22 Oct, 2021
There are two ways for checking whether the variable is an array or not. We can check whether a variable is an array or not by using the PHP is_array() function and by casting the variable to the array.
Approach 1: We can check whether a variable is an array or not using the is_array() function. The PHP is_array() function is a variable handling function that checks whether a variable is an array or not.
Syntax:
is_array( $variable_name );    
Parameter:  It accepts a single parameter. This parameter must be the variable name for which the check is done if it is an array or not.
Return value: It returns true if the boolean value is TRUE else false.
Example 1: The is_array() function returns true(1) when passed parameter is array else it will return false (nothing).
PHP
<?php  $isArr = "friends";  if(is_array($isArr)) {    echo "Array";} else {    echo "Not an Array";}  echo "<br>";  $isArr = array("smith", "john", "josh");  if(is_array($isArr)) {    echo "Array";} else {    echo "Not an Array";}  ?>
Not an Array<br>Array
Approach 2: By casting the variable to an array. We have to cast the variable to an array that we want to check.            
For Array:  type casted array === original array
Original array:
john, johnson, steve
Type casted array:
john, johnson, steve
 For normal variable: type casted array != original array
  Original variable:
friends
 Type casted variable:
friends, , 
Example 2: After typecasting, an index-based array will be formed.
PHP
<?php  $isArr = array("john", "johnson", "steve");  if((array)$isArr === $isArr) {    echo "It is an Array\n";}else {    echo "It is not an Array\n";}  $isArr = "friends";  if((array)$isArr === $isArr) {    echo "It is an Array";}else {    echo "It is not an Array";}  ?>
It is an Array
It is not an Array
PHP-function
PHP-Questions
Picked
PHP
Web Technologies
PHP
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
How to fetch data from localserver database and display on HTML table using PHP ?
How to pass form variables from one page to other page in PHP ?
Create a drop-down list that options fetched from a MySQL database in PHP
How to create admin login page using PHP?
Different ways for passing data to view in Laravel
Top 10 Front End Developer Skills That You Need in 2022
Installation of Node.js on Linux
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to fetch data from an API in ReactJS ?
How to insert spaces/tabs in text using HTML/CSS?
How to free up the memory in JavaScript?

Regardless of the programming language, memory life cycle is pretty much always the same −
Allocate the memory you need
Use the allocated memory (read, write)
Release the allocated memory when it is not needed anymore
The second part is explicit in all languages. Use of allocated memory needs to be done by the developer.
The first and last parts are explicit in low-level languages like C but are mostly implicit in high-level languages like JavaScript.
Hence there is no explicit way to allocate or free up memory in JavaScript. Just initializing objects allocates memory for them. When the variable goes out of scope, it is automatically garbage collected(frees up memory taken by that object.)
function test() {
   // Allocate and use the memory
   let x = {
      name: "John",
      age: 24
   }
   console.log(x);
   return null;
   // As soon as the method goes out of scope, it is garbage collected
   // and it's memory freed.
}
test();
The cycle mentioned in the comments is carried out every time the method is called.
Java Program for Cocktail Sort

Cocktail Sort works in contrast to bubble sort, wherein elements are iterated from left to right, and the largest element is first brought to its correct position and so on. In cocktail sort, elements are iterated over in both the directions (left and right) in an alternating fashion.
Following is the program for Cocktail Sort −
 Live Demo
public class Demo{
   static int temp;
   static void Cocktail(int a[], int n){
      boolean swap = true;
      int begin = 0,i;
      int end = n - 1;
      while (swap) {
         swap = false;
         for (i = begin; i < end; ++i){
            if (a[i] > a[i + 1]){
               temp = a[i];
               a[i]=a[i+1];
               a[i+1]=temp;
               swap = true;
            }
         }
         if (!swap)
         break;
         swap = false;
         for (i = end - 1; i >= begin; --i){
            if (a[i] > a[i + 1]){
               temp = a[i];
               a[i]=a[i+1];
               a[i+1]=temp;
               swap = true;
            }
         }
         ++begin;
      }
   }
   public static void main(String[] args) {
      int my_arr[] = {34, 78, 90, 32, 67, 12, 1, 0, 95};
      Cocktail(my_arr, my_arr.length);
      System.out.println("The sorted array is ");
      for (int i = 0; i < my_arr.length; i++)
      System.out.print(my_arr[i]+" ");
      System.out.println();
   }
}
The sorted array is
0 1 12 32 34 67 78 90 95
In the first step, the loop is run from left to right (similar to bubble sort) during which, the adjacent items are compared. If the left handed value is greater than the right handed value, the values are swapped. Once the first iteration is over, the largest element will be found at the end of the array. In the next step, the loop is run from right to left, by leaving the most recently sorted item. Here again, the adjacent elements are compared and the greater element is added to the end of the array.
MFC - Bitmap Button

A bitmap button displays a picture or a picture and text on its face. This is usually intended to make the button a little explicit. A bitmap button is created using the CBitmapButton class, which is derived from CButton.
Here is the list of methods in CBitmapButton class.
AutoLoad
Associates a button in a dialog box with an object of the CBitmapButton class, loads the bitmap(s) by name, and sizes the button to fit the bitmap.
LoadBitmaps
Initializes the object by loading one or more named bitmap resources from the application's resource file and attaching the bitmaps to the object.
SizeToContent
It resizes the button to the size of the bitmaps.
Here is the list of messages mapping for Bitmap Button control −
Let us look into a simple example by creating a new project.
Step 1 − Add a Bitmap from Add Resource dialog box.
Step 2 − Select Bitmap and click New.
Step 3 − Design your bitmap and change its ID to IDB_BITMAP_START as shown above.
Step 4 − Add a button to your dialog box and also add a control Variable m_buttonStart for that button.
Step 5 − Add a bitmap variable in your header file. You can now see the following two variables.
CBitmap m_bitmapStart;
CButton m_buttonStart;

Step 6 − Modify your OnInitDialog() method as shown in the following code.
m_bitmapStart.LoadBitmap(IDB_BITMAP_START);
HBITMAP hBitmap = (HBITMAP)m_bitmapStart.GetSafeHandle();
m_buttonStart.SetBitmap(hBitmap);
Step 7 − When the above code is compiled and executed, you will see the following output.
 Print
 Add Notes
 Bookmark this page
Convert an Integer to UTF8 in R Programming - intToUtf8() Function - GeeksforGeeks

16 Jun, 2020
intToUtf8() function in R Language is used to convert an integer into UTF8 value.
Syntax: intToUtf8(x, multiple)
Parameters:x: Integer or integer vectormultiple: Boolean value to convert into single or multiple strings
Example 1:
# R program to convert an integer to UTF8  # Calling the intToUtf8() functionintToUtf8(4)intToUtf8(10)intToUtf8(58)
Output:
[1] "\004"
[1] "\n"
[1] ":"

Example 2:
# R program to convert an integer to UTF8  # Creating a vectorx <- c(49, 100, 111)  # Calling the intToUtf8() functionintToUtf8(x)intToUtf8(x, multiple = TRUE)
Output:
[1] "1do"
[1] "1" "d" "o"

R Math-Function
R Language
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Replace specific values in column in R DataFrame ?
Filter data by multiple conditions in R using Dplyr
Loops in R (for, while, repeat)
Change Color of Bars in Barchart using ggplot2 in R
How to change Row Names of DataFrame in R ?
How to Change Axis Scales in R Plots?
Remove rows with NA in one column of R DataFrame
Group by function in R using Dplyr
K-Means Clustering in R Programming
How to Split Column Into Multiple Columns in R DataFrame?
GATE | GATE CS 1996 | Question 15 - GeeksforGeeks

31 Oct, 2017
Which of the following sequences denotes the post order traversal sequence of the given tree?
         a
       /   \
      b     e
     / \   /
    c  d  f
   /
  g

(A) f e g c d b a(B) g c b d a f e(C) g c d b f e a(D) f e d g c b aAnswer: (C)Explanation:Quiz of this QuestionPlease comment below if you find anything wrong in the above post
GATE CS 1996
GATE-GATE CS 1996
GATE
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
GATE | GATE-IT-2004 | Question 66
GATE | GATE-CS-2016 (Set 2) | Question 48
GATE | GATE-CS-2014-(Set-3) | Question 65
GATE | GATE-CS-2006 | Question 49
GATE | GATE-CS-2004 | Question 3
GATE | GATE CS 2010 | Question 24
GATE | GATE CS 2011 | Question 65
GATE | GATE CS 2019 | Question 27
GATE | GATE CS 2021 | Set 1 | Question 47
GATE | GATE CS 2011 | Question 7
How to declare a variable within lambda expression in Java?

A lambda expression is a function that expects and accepts input parameters and produces output results. It is an instance of a functional interface and also known as a single abstract method interface (SAM interface) like Runnable, Comparator, Callable and etc. We can declare a variable as a final string[] array and able to access that array index within a lambda expression.
import java.util.*;

public class LambdaTest {
   public static void main(String args[]) {
      final String[] country = {null};

      List cities = new ArrayList();
      cities.add("Hyderabad");
      cities.add("Ireland");
      cities.add("Texas");
      cities.add("Cape Town");

      cities.forEach(item -> {      // lambda expression
         if(item.equals("Ireland"))
            country[0] = "UK";      // variable array
      });
      System.out.println(country[0]);
   }
}
UK
How to print "Hello World!" using Python?

The basic way to do output to screen is to use the print statement.
>>> print 'Hello, world'
Hello, world
To print multiple things on the same line separated by spaces, use commas between them. For example:
>>> print 'Hello,', 'World'
Hello, World
In Python 3, all print is a function and not a statement. Hence its arguments need to be surrounded by parenthesis. For example,
>>> print("Hello", "world")
Hello world
How to change the file owner and group in Linux?

To change the file owner and group, we use the chown command in the Linux operating system.
We know that Linux is a multiuser operating system so every file or directory belongs to an owner and group.
To change ownership of files or directories we use chown command in the Linux system. This command is also available in the IBM i operating system. The chgrp command is also used to change only the group ownership of the file in the Linux system.
The general syntax of the chown command is as follows
chown [OPTION]... [OWNER] [: [GROUP]] FILE...
chown [OPTION]... --reference=RFILE FILE...
A brief description of options available in the chown command -
To check the ownership of a file in the Linux system, we use the ls -l command as shown below.
$ ls -l <file name>
To change ownership of a file in the Linux system we need to administrative permission or sudo privilege.
The general syntax for changing ownership of a file is as follows:
$ sudo chown <owner name> <file name>
Here, we will change the ownership of a file ‘file.txt’ Vikash to Gautam using the chown command.
First, we will check the ownership of ‘file.txt’ using the below command.
vikash@tutorialspoint:~/shadow$ ls -l file.txt
-rw-rw-r-- 1 vikash vikash 34 Jan 11 20:59 file.txt
vikash@tutorialspoint:~/shadow$
We can see that the owner of ‘file.txt’ is vikash and the group ownership of the ‘file.txt’ is vikash. To change the ownership, we will execute command as shown below.
vikash@tutorialspoint:~/shadow$ sudo chown gautam file.txt
[sudo] password for vikash:
vikash@tutorialspoint:~/shadow$
After changing the ownership of the file, we will again check again the ownership of files to ensure that ownership is changed or not.
vikash@tutorialspoint:~/shadow$ ls -l file.txt
-rw-rw-r-- 1 gautam vikash 34 Jan 11 20:59 file.txt
vikash@tutorialspoint:~/shadow$
To check more information and available options in the chown command, we use the --help option with the chown command as follows:
$ chown --help
Conclusion: In this article, we learned to change the ownership of files using the chown command in the Linux operating system with available options and suitable examples. To change only the group ownership of the file, we use the chgrp command in the Linux system.
Running Selenium WebDriver python bindings in chrome.

We can run Selenium webdriver with Python bindings in Chrome. This
can be done by downloading the chromedriver.exe file. Visit the link: https://chromedriver.chromium.org/downloads. There shall be links available
for download for various chromedriver versions.
Select the version which is compatible with the Chrome browser in the local
system. Click on it. As the following page is navigated, select the zip file available
for download for the operating system which is compatible with our local
operating system.
Once the zip file is downloaded, extract it and save the chromodriver.exe file at a location. To launch the Chrome, we have to add the statement from selenium
import webdriver. Also, we must have a webdriver object created.
With the help of this webdriver object we should be able to access the webdriver.Chrome(). The location of the chromedriver.exe is passed as a parameter to the Chrome class with the help of the property called the executable_path.
from selenium import webdriver
#path of chromedriver.exe
driver = webdriver.Chrome (executable_path="C:\\chromedriver.exe")
#launch browser
driver.get ("https://www.tutorialspoint.com/index.htm")
#close browser
driver.close()
Escape a Large Maze Python

Suppose we have a grid, there are 1 million rows and 1 million columns, we also have one list of blocked cells. Now we will start at the source square and want to reach the target square. In each move, we can walk to a up, down, left, right adjacent square in the grid that isn't in the given list of blocked cells.
We have to check whether it is possible to reach the target square through a sequence of moves or not.
So, if the input is like blocked = [[0,1],[1,0]], source = [0,0], target = [0,3], then the output will be False
To solve this, we will follow these steps −
blocked := make a set of all blocked cells
blocked := make a set of all blocked cells
Define one method dfs(), this will take x, y, target and seen
Define one method dfs(), this will take x, y, target and seen
if (x,y) are not in range of grids or (x,y) is in blocked or (x,y) is in seen thenreturn false
if (x,y) are not in range of grids or (x,y) is in blocked or (x,y) is in seen then
return false
return false
add (x,y) into seen
add (x,y) into seen
if size of seen > 20000 or (x,y) is target, thenreturn true
if size of seen > 20000 or (x,y) is target, then
return true
return true
return dfs(x+1,y,target,seen) or dfs(x-1,y,target,seen) or dfs(x,y+1,target,seen) or dfs(x,y-1,target,seen)
return dfs(x+1,y,target,seen) or dfs(x-1,y,target,seen) or dfs(x,y+1,target,seen) or dfs(x,y-1,target,seen)
return dfs(source[0], source[1], target, empty set) and dfs(target[0], target[1], source, empty set)
return dfs(source[0], source[1], target, empty set) and dfs(target[0], target[1], source, empty set)
Let us see the following implementation to get better understanding −
class Solution(object):
   def isEscapePossible(self, blocked, source, target):
      blocked = set(map(tuple, blocked))
      def dfs(x, y, target, seen):
         if not (0 <= x < 10**6 and 0 <= y < 10**6) or (x, y) in blocked or (x, y) in seen: return             False
         seen.add((x, y))
         if len(seen) > 20000 or [x, y] == target: return True
         return dfs(x + 1, y, target, seen) or \
            dfs(x - 1, y, target, seen) or \
            dfs(x, y + 1, target, seen) or \
            dfs(x, y - 1, target, seen)
         return dfs(source[0], source[1], target, set()) and
dfs(target[0], target[1], source, set())
ob = Solution()
print(ob.isEscapePossible([[0,1],[1,0]], [0,0], [0,3]))
[[0,1],[1,0]], [0,0], [0,3]
False
How does parameters 'c' and 'cmap' behave in a Matplotlib scatter plot?

To get a sense of how the parameters c and cmap behave in a Matplotlib scatterplot, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Initialize a variable N to store the number of sample data.
Create x and y data points using numpy.
Plot x and y data points using scatter() method, color and colormap.
To display the figure, use show() method.
import numpy as np
from matplotlib import pyplot as plt

plt.rcParams["figure.figsize"] = [7.50, 3.50]
plt.rcParams["figure.autolayout"] = True

N = 50
x = np.random.randn(N)
y = np.random.randn(N)

plt.scatter(x, y, c=x, cmap="plasma")

plt.show()
Bootstrap - Helper Classes

This chapter discusses some of the helper classes in Bootstrap that might come in handy.
Use the generic close icon for dismissing content like modals and alerts. Use the class close to get the close icon.
<p>Close Icon Example
   <button type = "button" class = "close" aria-hidden = "true">
      &times;
   </button>
</p>
Close Icon Example
         
            ×
         

Use carets to indicate dropdown functionality and direction. To get this functionality use the class caret with a <span> element.
<p>Caret Example<span class = "caret"></span></p>
Caret Example
You can float an element to the left or right with class pull-left or pull-right respectively the following example demonstrates this.
<div class = "pull-left">Quick Float to left</div>
<div class = "pull-right">Quick Float to right</div>
Use class center-block to set an element to center.
<div class = "row">
   <div class = "center-block" style = "width:200px; background-color:#ccc;">
      This is an example for center-block
   </div>
</div>
To clear the float of any element, use the .clearfix class.

<div class = "clearfix" style = "background: #D8D8D8;border: 1px solid #000; padding: 10px;">
   
   <div class = "pull-left" style = "background:#58D3F7;">
      Quick Float to left
   </div>
   
   <div class = "pull-right" style = "background: #DA81F5;">
      Quick Float to right
   </div>
   
</div>
You can force an element to be shown or hidden (including for screen readers) with the use of classes .show and .hidden.
<div class = "row" style = "padding: 91px 100px 19px 50px;">
   
   <div class = "show" style = "left-margin:10px; width:300px; background-color:#ccc;">
      This is an example for show class
   </div>
   
   <div class = "hidden" style = "width:200px; background-color:#ccc;">
      This is an example for hide class
   </div>
   
</div>
You can hide an element to all devices except screen readers with the class .sr-only.
<div class = "row" style = "padding: 91px 100px 19px 50px;">
   <form class = "form-inline" role = "form">
      
      <div class = "form-group">
         <label class = "sr-only" for = "email">Email address</label>
         <input type = "email" class = "form-control" placeholder = "Enter email">
      </div>
      
      <div class = "form-group">
         <label class = "sr-only" for = "pass">Password</label>
         <input type = "password" class = "form-control" placeholder = "Password">
      </div>
      
   </form>
</div>
Here we can see that the label of both the input types is assigned the class sr-only, hence labels will be visible to only screen readers.

    26 Lectures 
     2 hours 

 Anadi Sharma

    54 Lectures 
     4.5 hours 

 Frahaan Hussain

    161 Lectures 
     14.5 hours 

 Eduonix Learning Solutions

    20 Lectures 
     4 hours 

 Azaz Patel

    15 Lectures 
     1.5 hours 

 Muhammad Ismail

    62 Lectures 
     8 hours 

 Yossef Ayman Zedan
 Print
 Add Notes
 Bookmark this page
How to install Librosa Library in Python? - GeeksforGeeks

06 Oct, 2021
Librosa is a Python package for music and audio analysis. Librosa is basically used when we work with audio data like in music generation(using LSTM’s), Automatic Speech Recognition.
It provides the building blocks necessary to create the music information retrieval systems. Librosa helps to visualize the audio signals and also do the feature extractions in it using different signal processing techniques.
Using PyPI(Python Package Index)Open the command prompt on your system and write any one of them.pip install librosa 
sudo pip install librosa
pip install -u librosa
Open the command prompt on your system and write any one of them.
pip install librosa 
sudo pip install librosa
pip install -u librosa
Conda InstallIf you use conda/Anaconda environments, librosa can be installed from the conda-forge channel. Open the Anaconda prompt and write:conda install -c conda-forge librosaNote: If you’re using a Python 3.5 environment in conda, you may run into trouble with the numba dependency. This can be avoided by installing from the numba conda channel before installing librosa:conda install -c numba numba
If you use conda/Anaconda environments, librosa can be installed from the conda-forge channel. Open the Anaconda prompt and write:
conda install -c conda-forge librosa
Note: If you’re using a Python 3.5 environment in conda, you may run into trouble with the numba dependency. This can be avoided by installing from the numba conda channel before installing librosa:
conda install -c numba numba
how-to-install
python-modules
How To
Installation Guide
Python
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Align Text in HTML?
How to Install OpenCV for Python on Windows?
How to filter object array based on attributes?
Java Tutorial
How to Install FFmpeg on Windows?
Installation of Node.js on Linux
How to Install OpenCV for Python on Windows?
How to Install FFmpeg on Windows?
How to Install Pygame on Windows ?
How to Install and Run Apache Kafka on Windows?
How to scroll down a webpage in selenium using Java?

We can scroll down a webpage in Selenium using Java. Selenium is unable to handle scrolling directly. It takes the help of the Javascript Executor to perform the scrolling action up to an element.
First of all, we have to locate the element up to which we have to scroll. Next, we shall use the Javascript Executor to run the Javascript commands. The method executeScript is used to run Javascript commands in Selenium. We shall take the
help of the scrollIntoView method in Javascript and pass true as an argument to the method.
Syntax −
WebElement elm = driver.findElement(By.name("name"));
((JavascriptExecutor) driver)
.executeScript("arguments[0].scrollIntoView(true);", elm);
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.JavascriptExecutor;
public class ScrollAction{
   public static void main(String[] args) {
      System.setProperty("webdriver.gecko.driver", "C:\\Users\\ghs6kor\\Desktop\\Java\\geckodriver.exe");
      WebDriver driver = new FirefoxDriver();
      //implicit wait
      driver.manage().timeouts().implicitlyWait(4, TimeUnit.SECONDS);
      //launch application
      driver.get
      ("https://www.tutorialspoint.com/about/about_careers.htm ");
      // identify element
      WebElement n=driver.findElement(By.xpath("//*[text()='Contact']"));
      // Javascript executor
      ((JavascriptExecutor)driver)
      .executeScript("arguments[0].scrollIntoView(true);", n);
   }
}
Convert characters of a string to opposite case in C++

We are given a string of any length and the task is to convert the string having uppercase letters to lowercase letters and lowercase letters to uppercase letters.
Input − string str = ”Welcome To The Site!”
Output − wELCOME tO tHE sITE!
Explanation − converted the letters W, T, T, S to lowercase and letters e,l,c,o,m,e,o,,i,t,e to uppercase and it doesn’t perform any operations to the special characters.
Input − string str = ”HELLO”
Output − hello
Explanation − converted the letters H,E,L,L,E to lowercase.
Using inbuilt functions provided by C++ to perform these operations and those are
toLowerCase(char) and toUpperCase(char).
Using inbuilt functions provided by C++ to perform these operations and those are
toLowerCase(char) and toUpperCase(char).
Through the logic, which we are implementing in the below program.
Through the logic, which we are implementing in the below program.
Input the string of any length
Input the string of any length
Calculate the length of the string using the length() function that will return an integer value as per the number of letters in the string including the spaces.
Calculate the length of the string using the length() function that will return an integer value as per the number of letters in the string including the spaces.
The ASCII values of uppercase letters[A-Z] start with 65 till 90 and lowercase letters[a-z] starts with 97 till 122.
The ASCII values of uppercase letters[A-Z] start with 65 till 90 and lowercase letters[a-z] starts with 97 till 122.
Start the loop which will compare each letter in a string. If a letter is in uppercase then add 32 to convert it to lowercase and if the letter is in lowercase then subtract 32 to convert it to uppercase.
Start the loop which will compare each letter in a string. If a letter is in uppercase then add 32 to convert it to lowercase and if the letter is in lowercase then subtract 32 to convert it to uppercase.
Print the string.
Print the string.
 Live Demo
#include<iostream>
using namespace std;
void Convert_case(string &str){
   //calculate the length of a string
   int len = str.length();
   //converting lowercase to uppercase and vice versa
   for (int i=0; i<len; i++){
      if (str[i]>='a' && str[i]<='z'){
         str[i] = str[i] - 32;
      }
      else if(str[i]>='A' && str[i]<='Z'){
         str[i] = str[i] + 32;
      }
   }
}
int main(){
   string str = "What’s Your Name?";
   cout<<"String before conversion is: "<<str;
   Convert_case(str);
   cout<<"\nString after conversion is: "<<str;
   return 0;
}
If we run the above code it will generate the following output −
String before conversion is − What’s Your Name?
String after conversion is &mius; wHAT’S yOUR nAME?
getline (string) in C++

It is used to extracts characters from the stream as unformatted input and stores them into s as a c-string, until either the extracted character is the delimiting character, or n characters have been written to s (including the terminating null character). The declaration is like:
basic_istream& getline (char_type* s, streamsize n );
basic_istream& getline (char_type* s, streamsize n, char_type delim);
The parameters are ‘s’ pointer to an array of characters, where the extracted characters are stored as a c_string. Next parameter is ‘n’ this is the maximum number of characters to write (including the terminating character). The third parameter is ‘delim’ Explicit delimiting character. The operation of extracting successive characters stops as soon as the next character to exact compares equal to this (using traits_type::eq)
This function returns the basic_istream object (*this).
 Live Demo
#include <iostream>
using namespace std;
int main () {
   char name[256], title[256];
   cout << "Please, enter your name: ";
   cin.getline (name,256);
   cout << "Please, enter your favourite movie: ";
   cin.getline (title,256);
   cout << name << "'s favourite movie is " << title;
}
Please, enter your name: Jack
Please, enter your favourite movie: The Boss Baby
Jack's favourite movie is The Boss Baby