Thursday, 12 November 2015

Unable to Download WhatsApp on My Samsung MObile

Unable to Download WhatsApp on My Samsung Mobile


I am getting an Error Retrieving Information from the server when I try to Search WhatsApp from PlayStore and hit Install, then Accept And  Download.

This what I tried first

1-Unlink and relink my google account .
2-Got to Settings-->Applications-->All.
3-Clear Data for the following
      Google PlayStore
      Data Manager
      Google Service FrameWork
4-Open Playstore .Follow the popups . Try installing Whatsapp.

But it didn't work for me .

So I opened the browser and went to http://www.whatsapp.com/android/  and downloaded the whatsapp software and then Installed it .

This worked for me .

Thanks

Monday, 31 August 2015

HOW TO CONVERT NOTES FROM IMAGE TO TEXT


HOW TO  CONVERT FROM IMAGE TO TEXT


Sometimes we find many good books written in PDF format online .
There are many things in the books which we need to keep separately as notes for our future reference or for printing only the important content relevant to us .

We cannot do this as the PDF file is often COPY and PRINT protected .


Just for making notes  what I do is :

1-Open the book section which you want to jot down.
2-Open the Snipping Tool on your Windows Laptop /Dsktop.
3-Hit New on Snipping Tool .and select the text which you want to note.
4-Hit Save on the Snipping Tool.Save it as something like Notes1.png.
5-Now open any online ocr. I used  http://www.onlineocr.net/
6-Select the file as  Notes1.png and give other details on  http://www.onlineocr.net/ and hit CONVERT, your image gets converted to text


PS:This work-around is only for making small notes and not converting the whole PDF book.

NOTES ON ORACLE SQL | SQL PAPER-1Z051 | 11G

VIEWS


You cannot delete the row if the view contains the following :

--Group functions
--A GROUP BY clause
--The DISTINCT keyword
--The pseudocolumn ROWNUM keyword

You cannot modify the data in the view if it contains:

--Group functions
--A GROUP BY clause
--The DISTINCT keyword
--The pseudocolumn ROWNUM keyword
--Columsn with expressions

You cannot add  data thru the view if it contains:
--Group functions
--A GROUP BY clause
--The DISTINCT keyword
--The pseudocolumn ROWNUM keyword
--Columsn with expressions
--NOT NULL columns in the base tables whcih are not selected by the view.

View with CHECK OPTION
VIEW with READ ONLY

Thursday, 28 May 2015

Java | Output of a program Concepts

Printing  int array  /string array


Find out the output for the following program:

public class Test3
{
  public static void main(String[] args)
  {
    int[] array = {10,20,30};
    System.out.println(array);
  }
}
  1. 10 20 30
  2. 10
  3. Some random value representing the address of the handle array
  4. Runtime error
Anwser is c

Notes:
Anytime you use "System.out.println()" and pass in an object reference, java will call that underlying object's toString() method. It doesn't matter if it's an array, a String, an Integer, a Dog, a Fubar or what. 

In your example, you are passing in an object that is an array (doesn't matter what the specific type is). Since the Arrays class does not override the Object class' toString() method, you get the default behavior of the Object class' toString() method. 

You would see something VERY similar if you created your own Fubar class and did a System.out.println on it. 

However, if in your class definition, you override the toString() method with something meaningful, when you sent it to S.o.p(), you will get your newly defined toString() behavior.

Thursday, 9 April 2015

Simple Java Programs

One of the ways is to use the Scanner class


Scanner class is present in java.util package so we import this package in our program. We first create an object of Scanner class and then we use the methods of Scanner class. Consider the statement
 Scanner a = new Scanner(System.in);
Here Scanner is the class name, a is the name of object, new keyword is used to allocate the memory and System.in is the input stream. Following methods of Scanner class are used in the program below :-
1) nextInt to input an integer
2) nextFloat to input a float
3) nextLine to input a string

Points to remember :

>>Please import the package using the below command in your code
import java.util.Scanner;

>>In case you are using Jdeveloper and still you are not getting an option to enter user's input after you did everything correct ,please check the following setting.
Project properties->Run/Debug configuration->Edit button->Tools settings -> Allow Program Inputs.
by doing this you should have a small input box a the bottom of  the Run window  @ runtime

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sample Code

import java.util.Scanner;
 
class GetInputFromUser
{
   public static void main(String args[])
   {
      int a;
      float b;
      String s;
 
      Scanner input = new Scanner(System.in);
 
      System.out.println("Enter a string");
      s = input .nextLine();
      System.out.println("You entered string "+s);
 
      System.out.println("Enter an integer");
      a = input .nextInt();
      System.out.println("You entered integer "+a);
 
      System.out.println("Enter a float");
      b = input .nextFloat();
      System.out.println("You entered float "+b);   
   }
}


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

PRIME NUMBER PROGRAM IN JAVA

import java.util.Scanner;
public class Prime{

     public static void main(String []args){
        System.out.println("Hello World");
        Scanner input = new Scanner(System.in);
        double a;
        int flag=1;
        double srnum;
        System.out.println("Enter the Integer");
        a = input.nextInt();
        srnum=Math.sqrt(a);
        for(int i=2;i<=srnum;i++)
    {
         if((a%i)!=0){continue;}
         else{flag=0;System.out.println("Number not prime"); break;}
     }
    if (flag==1){System.out.println("Number"+ a +"is prime");} 
    }
     

}


+++++++++++++++++++++++++++++++++++++++++++++


PALINDROME  NUMBER PROGRAM IN JAVA



import java.util.Scanner;
public class Palindrom{
    
     public static void main(String []args){
     int a[] =new int[3];
     int b[] =new int[3];
     System.out.println("Enter the number ");
     Scanner input = new Scanner(System.in);
     int j=a.length-1;
     for (int i=0 ;i<=a.length-1;i++)
        {  a[i]=input.nextInt();}
    for (int i=0 ;i<=a.length-1;i++){
         b[i]=a[j];
           j--;
        }
      int  flag=1;
     for (int i=0 ;i<a.length;i++){if (a[i]==b[i]) continue; else {flag=0; break;}}       
     if(flag==1) System.out.println("This Number is a palindrome");
     else System.out.println("This Number is NOT a palindrome");
}
}


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Write a program that will read a character and display its numeric value.


import java.util.Scanner;
public class chartoint{

     public static void main(String []args){
     // String c=args[0];
    Scanner input=new Scanner(System.in);
     String c1=input.nextLine();
     char ch=c1.charAt(0);
     int ctoint=(int)ch;
     System.out.println(ctoint);
     }
}


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Reverse a given integer.

import java.util.Scanner;
public class RevNumber{

     public static void main(String []args){
     // String c=args[0];
    Scanner input=new Scanner(System.in);
     int num=input.nextInt();
     System.out.println("The number is  "+num);
     System.out.print("The rev number is  ");
     //int i=0;
     while (num>0){
        int rem=num%10;
        System.out.print(rem);
        num=num/10;
        //i++;
     }
     System.out.println();
     //if(i==2)
     //System.out.println("Its a "+ i + " digit number");
     //else System.out.println("Its NOT  2 digit number");
     }

}

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Reverse a given string.

 import java.util.Scanner;
public class RevString{

     public static void main(String []args){
     // String c=args[0];
      Scanner input=new Scanner(System.in);
     System.out.println("Enter a string");
      String s = input.nextLine();
      System.out.println("You entered string "+s);
      System.out.println("You Reversed string is :  ");
      for (int i=s.length()-1;i>=0;i--){
          System.out.print(s.charAt(i));
      }
      System.out.println();
      
     
     }
      
     }


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Check the given character is lowercase or not.


import java.util.Scanner;
public class Lower{

     public static void main(String []args){
     String c=args[0];char c1=c.charAt(0);
       int ctoi =(int)c1;
       if(ctoi>=97 && ctoi <=122 )System.out.println("The character entered is lower case");
      else      System.out.println("The character entered is NOT lower case");
      
     
     }
      //As per ASCII table Lower case is from 97=122
      //Upper case is from 65-90

     }

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Swap the values of two integers without a temporary variable.

import java.util.Scanner;
public class Swap{

     public static void main(String []args){
        System.out.println("Hello World");
        Scanner input= new Scanner(System.in);
        int a;int b;
        a=input.nextInt();
        b=input.nextInt();
        System.out.println("The numbers are " + a + " " + b);
        a=a+b;//Stire the sum in one of the variable
        b=a-b;//Deduct the second var from the sum so we get the first var value
        a=a-b;//Since nw the second var has the previous val of the  first var.
        //So deduct it from the sum againto get the previous val of second var.
        System.out.println("The exchanged numbers are " +a +" " + b);
     }

}

NOTE:
Please refer to the following link for details regarding this swapping without using 3rd variable:
http://www.geeksforgeeks.org/swap-two-numbers-without-using-temporary-variable/



++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Reverse the order of 1D array without a temporary array.


import java.util.Scanner;
public class ReverseArray{

     public static void main(String []args){
        int[] a= new int[5];
        int k;int b;
        Scanner input=new Scanner(System.in);
        for (int i=0;i<=a.length-1;i++){
            a[i]=input.nextInt();
        }
       //below is to check whether the array has odd or even elements.here its  5,odd
        if((a.length)%2==0) 
       {
        k=0;b=a.length-1;int t;
        while(k<b){t=a[k];a[k]=a[b];a[b]=t;k++;b--;}
        }
        else
       {
        k=0;b=a.length-1;int t;
        while(k<=b){t=a[k];a[k]=a[b];a[b]=t;k++;b--;}
        }
        System.out.print("The reversed Array is   ");
        for (int i=0;i<=a.length-1;i++){
        System.out.print(a[i]+ " ");}
     }

}


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Find the most frequent element in a given 1D array.



import java.util.Scanner;
public class MostFrequentElement{
     static final int n=5;
     public static void main(String []args){
        int[] a= new int[n];
        int k;//this is used to hold the element being compared
        int cmax;//this is to hold the maximum count for an element
        int element;//this is the counter for element being compared in one pass
        int count;//for counting the element occurences in one pass
        int f=0;//storing the element which has maximmum occurences so far.must be initalise
        Scanner input=new Scanner(System.in);
        for (int i=0;i<=a.length-1;i++){
            a[i]=input.nextInt();
        }
        cmax=0;element=0;
        while(element<=a.length-1)
        {count=1; 
         k=a[element];
        for (int i=0;i<=a.length-1;i++){
            if (i==element) continue;
            if (a[i]==k) count++;
        } 
        if (cmax<count) {f=a[element];cmax=count;}
        element++;
            
        }
        System.out.println("The element " +f+" has come a maximium of "+cmax+" times");
        
     }
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++