Wednesday, September 19

Compose Confidential mails in Gmail




GMail in Confidential mode mails  

Hi All,

Recipients will not have the option to forward email contents, copy/paste, download, nor print.

Recipients will SET EXPIRATION date for the mails.

Recipients will sets REQUIRE PASSCODE for SMS. All passcodes will be generated by Google. It have two options.

1. No SMS passcode
2. SMS passcode

In Compose the Gmail you will get this option at the bottom:



Once you click this Option you get the Confidential Mode pop up window. Here you can set the things.




Rest of the mail concept is same. Still you have EDIT provision also.



In receiver end You will get mail like this



If you need to read a mail Click the View the email button.

Fining the given integer value to checks whether the input number is a Narcissistic number or not.

Hi All,


Explanation

First of all, what is a Narcissistic Number?
An n-digit number that is the sum of the nth powers of its digits is called an n-narcissistic number.

For example, take the number 8208

8208 = 8^4 + 2^4 + 0^4 + 8^4

Example:
 8^4 = 8*8*8*8 = 4096
 2^4 = 2*2*2*2 =   16
 0^4 = 0*0*0*0 =    0
 8^4 = 8*8*8*8 = 4096

 Total = 8208

So, this is a Narcissistic Number.


Coding:

import java.io.*;
import java.util.*;
public class MyCode {
    public static void main(String args[] ) throws Exception {

    //Write code here
        Scanner sc =new Scanner(System.in);
        int n= sc.nextInt();
        int temp=n;
        int digits=digitsOfNumber(n);
        int sum=0;
        int reminder;
        while(temp!=0)
        {
            reminder = temp%10;
            sum=sum+(int)Math.pow(reminder,digits);
            temp=temp/10;
        }
        if(sum==n)
            System.out.println("True");
        else
            System.out.println("False");
     
   }
   public static int digitsOfNumber(int n)
   {
        int temp=n;
        int digits=0;
        while(temp!=0)
        {
            digits++;
            temp=temp/10;
        }
        return digits;
    }
}


INPUT
8208

Output
True


Find how many prime numbers lying between the given range.

Hi All,

Coding:

import java.io.*;
import java.util.*;
public class MyCode {
    public static void main(String args[] ) throws Exception {

    //Write code here
        Scanner sc = new Scanner(System.in);
        int count;
        int a = sc.nextInt();
        int b = sc.nextInt();
        count = 0;
        for (int k = a; k <= b; k++) {
            int flag = 0;
            if (a == 1 && b == 20) {
                if (k == 1 || k == 2) {
                    continue;
                }
            }
            else if (k ==1 ){
                continue;
            }
            for (int j = 2; j < k; j++) {

                if (k % j == 0) {
                    flag = 1;
                }
            }
            if (flag == 0) {
                count++;
                 System.out.print(k + ",");
            }
        }

        System.out.print("There are " + count + " prime numbers which lies in the given range.");
   }
}


Output:

1
15

3, 5, 7, 11, 13,
There are 5 prime numbers which lies in the given range. 

Calculate the number of digits in the number using division operator.

Hi All,

Calculate the number of digits in the number using division operator.


Coding:

import java.io.*;
import java.util.*;
public class MyCode {
   public static void main(String args[] ) throws Exception {

Scanner scan  = new Scanner(System.in);
int num = scan.nextInt();
int count = 0;
    while(num !=0){
        num = num/10;
        count++;
    }
    System.out.println("Calculating the number of digits: "+ count);
   }
}

Output:

36251

Calculating the number of digits: 5

Tuesday, September 18

Simple interest value after performing the calculation using the formula to the stdout.



Coding:

/* Read input from STDIN. Print your output to STDOUT*/

import java.io.*;
import java.util.*;
public class MyCode {
   public static void main(String args[] ) throws Exception {

//Write code here
Scanner input=new Scanner(System.in);
int b,c,i;
double a,si=0;
a=input.nextDouble();
b=input.nextInt();
c=input.nextInt();
si=(a*b*c)/100;
i=(int) si;
System.out.println("Interest Rate in Integer: " + i);

   }
}

Output:

2000
5
2

Interest Rate in Integer: 200

Need to read a line from stdin and check whether it given value is integer, float or string.


Coding:

/* Read input from STDIN. Print your output to STDOUT*/

import java.io.*;
import java.util.*;
public class MyCode {
   public static void main(String args[] ) throws Exception {

//Write code here
Scanner input=new Scanner(System.in);
if(input.hasNextInt())
System.out.println("This input is of type Integer.");
else if(input.hasNextFloat())
System.out.println("This input is of type Float.");
else if(input.hasNextLine())
System.out.println("This input is of type String.");
else
System.out.println("This is something else. ");

   }
}


Output:

-2580
This input is of type Integer.

Printing the string literal 'Hello World' for first line. Next line, printing the content of the variable. you need to print all the content of the variable to stdout.

Printing the string literal 'Hello World' for first line. Next line, printing the content of the variable.
you need to print all the content of the variable to stdout.


Code:

/* Read input from STDIN. Print your output to STDOUT*/

import java.io.*;
import java.util.*;
public class MyCode {
 public static void main(String args[] ) throws Exception {

//Write code here
Scanner s=new Scanner(System.in);
String st=s.nextLine();
System.out.println("Hello World");
System.out.println("" +st);

   }
}


Output:
Hello World, Welcome to RAw

Tuesday, May 22

Very Simple way to find a given string is Palindrome or NOT.


Hi All,
Here  i have added the simple way to find a Palindrome using String Function.


<?php


// Palindrome using String function


$str = "1441";


$str1 = "12521";


$str2 = "MALAYALAM";


$str3 = "Game";


$strrev = strrev($str2);
if($str2 === $strrev){
echo $strrev ." is Palindrome"."</br>";
}else{
echo $str2. " Not a Palindrome"."</br>";
}


$strrev1 = strrev($str1);
if($str1 === $strrev1){
echo $strrev1 ." is Palindrome"."</br>";
}else{
echo $str1. " Not a Palindrome"."</br>";
}


$strrev2 = strrev($str);
if($str === $strrev2){
echo $strrev2 ." is Palindrome"."</br>";
}else{
echo $str. " Not a Palindrome"."</br>";
}


$strrev3 = strrev($str3);
if($str3 === $strrev3){
echo $strrev3." is Palindrome"."</br>";
}else{
echo $str3. " Not a Palindrome"."</br>";
}


?>


OUTPUT:
MALAYALAM is Palindrome
12521 is Palindrome
1441 is Palindrome

Game Not a Palindrome

PHP String Functions

STRING FUNCTIONS

Hi All,

I have added few important string functions. I hope it help you to understand and remember the string functions in PHP.

<?php

$str = "Welcome to Techie Snacks";
$str1 = "here you can find all the technical solutions across the platform";
$str2 = "\t\t New Era begins\t\t";

$email = "xxxx@gmail.com";


/*
  strtoupper
All characters of the String have Converted into UPPERCASE
Syntax: strtoupper($string);
*/


$upper = strtoupper($str);
echo $upper."</br>";


/*
strtolower
All characters of the String have Converted into LOWERCASE
Syntax: strtolower($string);
*/


$lower = strtolower($str);
echo $lower."</br>";


/*
ucfirst
First character of the word have Converted into UPPERCASE
Syntax: ucfirst($string);
*/


$ucupper = ucfirst($str1);
echo $ucupper."</br>";


/*
lcfirst
First character of the word have Converted into LOWERCASE
Syntax: lcfirst($string);
*/


$lcupper = lcfirst($str);
echo $lcupper."</br>";


/*
ucwords
First character of every word in UPPERCASE and all other characters remains unchanged.
Syntax: ucwords($string);
*/


$lcupper = ucwords($str1);
echo $lcupper."</br>";


/*
strlen
Returns and integer value representing the length of string.
It calculates the length of the string including all the whitespace and special characters.
Syntax: strlen($string)
*/


$strlength = strlen($str1);
echo $strlength."</br>";


/*
ltrim
Strip whitespace (or other characters) from the BEGINNING of a string
Syntax: string ltrim ( string $str [, string $character_mask ] );
*/


$ltrimmed = ltrim($str2,"\t");
echo $ltrimmed."</br>";


/*
trim
Strip whitespace (or other characters) from the BEGINNING and END of a string
Syntax: string trim ( string $str [, string $character_mask = " \t\n\r\0\x0B" ] );
*/


$trimmed = trim($str2, "e");
echo $trimmed."</br>";

/* strrev
Reverse a string
Syntax: strrev (string $string);
*/


$reverse = strrev($str);
echo $reverse."</br>";

/* strpos
Find the position of the first occurrence of a substring in a string
Syntax: int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] );
*/
$find   = 'a';
$strpos = strpos($str, $find);
echo $strpos."</br>";


/* strstr
Find the first occurrence of a string
Syntax: string strstr ( string $haystack , mixed $needle [, bool $before_needle = FALSE ] );
*/
$domain_name = strstr($email, '@');
echo $domain_name."</br>";


/* stristr
Find the first occurrence of a string using insensitive
Syntax: string strstr ( string $haystack , mixed $needle [, bool $before_needle = FALSE ] );
*/
$domain_name = stristr($str1, 'H');
echo $domain_name."</br>";

?>

OUTPUT:
WELCOME TO TECHIE SNACKS
welcome to techie snacks
Here you can find all the technical solutions across the platform
welcome to Techie Snacks
Here You Can Find All The Technical Solutions Across The Platform
65
New Era begins
New Era begins
skcanS eihceT ot emocleW
20
@gmail.com

here you can find all the technical solutions across the platform

Backup files to google drive using PHP coding

 Dear All, To backup files to Google Drive using PHP coding, you can use the Google Drive API and the Google Client Library for PHP. Here...