Monday, 12 June 2017

DATA TYPES IN JAVA

CORE JAVA

DATA TYPES:

There are two data types available in Java
· Primitive Data Types
· Reference/Object Data Types


Primitive Data Types:

byte

Byte data type is an 8-bit signed two's complement integer
Minimum value is -128 (-2^7)
Maximum value is 127 (inclusive)(2^7 -1)
Default value is 0
Byte data type is used to save space in large arrays, mainly in place of integers, since a byte is four times smaller than an integer.
Example: byte a = 100, byte b = -50

short

Short data type is a 16-bit signed two's complement integer
Minimum value is -32,768 (-2^15)
Maximum value is 32,767 (inclusive) (2^15 -1)
Short data type can also be used to save memory as byte data type. A short is 2 times smaller than an integer
Default value is 0.
Example: short s = 10000, short r = -20000

int

Int data type is a 32-bit signed two's complement integer.
Minimum value is - 2,147,483,648 (-2^31)
Maximum value is 2,147,483,647(inclusive) (2^31 -1)
Integer is generally used as the default data type for integral values unless there is a concern about memory.
The default value is 0
Example: int a = 100000, int b = -200000

long

Long data type is a 64-bit signed two's complement integer
Minimum value is -9,223,372,036,854,775,808(-2^63)
Maximum value is 9,223,372,036,854,775,807 (inclusive)(2^63 -1)
This type is used when a wider range than int is needed
Default value is 0L
Example: long a = 100000L, long b = -200000L

float

Float data type is a single-precision 32-bit IEEE 754 floating point
Float is mainly used to save memory in large arrays of floating point numbers
Default value is 0.0f
Float data type is never used for precise values such as currency
Example: float f1 = 234.5f

double

double data type is a double-precision 64-bit IEEE 754 floating point
This data type is generally used as the default data type for decimal values, generally the default choice
Double data type should never be used for precise values such as currency
Default value is 0.0d
Example: double d1 = 123.4

boolean

boolean data type represents one bit of information
There are only two possible values: true and false
This data type is used for simple flags that track true/false conditions
Default value is false
Example: boolean one = true

char

char data type is a single 16-bit Unicode character
Minimum value is '\u0000' (or 0)
Maximum value is '\uffff' (or 65,535 inclusive)
Char data type is used to store any character
Example: char letterA = 'A'

Reference/Object Data Types:
Class objects and various type of array variables come under reference datatype.

Default value of any reference variable is null.

Java Literals:


A literal is a source code representation of a fixed value. They are represented directly in the code without any computation.
Literals can be assigned to any primitive type variable. For example −
byte a = 68;char a = 'A'


Saturday, 11 July 2015

Search Engine Optimisation

Search Engine Optimisation
Optimisation of google search engine
Introduction
                Search engine optimisation is the way of modifying the existing search engine to obtain the best. In this way the existing google search engine is currently getting modified in different ways such as voice input and output,  touch sensation etc., but the way of search done by google is never modified.

Search engines work in three different phases
1.    Web Crawling
Web search engine stores information about webpages which they retrieve from html itself. These pages are retrieved by web crawlers most of time we call as Spider. Web crawlers crawls site and follows each indexed link of every site. You can restrict these web crawlers from robot.txt which is made for these web crawlers. These crawlers then extract all the information about web page from title , meta tags, headings & content and stores in database.
When user types a search query then first of all search engines check results in database file if they have already incurred query ,Google uses cache mechanism for that where they store result of search queries to minimize time. Increased search relevance makes these cached pages very useful, even beyond the fact that they may contain data that may no longer be available elsewhere.


2.   Indexing
When a user enters a query into a search engine (typically by using key words), the engine examines its index and provides a listing of best-matching web pages according to its criteria, usually with a short summary containing the document’s title and sometimes parts of the text. The index is built from the information stored with the data and the method by which the information is indexed. Unfortunately, there is no one search engine that allows you to search documents by date. Most search engines support the use of the Boolean operators AND, OR and NOT to further specify the search query. Boolean operators are for literal searches that allow the user to refine and extend the terms of the search. The engine looks for the words or phrases exactly as entered. Some search engines provide an advanced feature called proximity search which allows users to define the distance between keywords. There is also concept-based searching where the research involves using statistical analysis on pages containing the words or phrases you search for. As well, natural language queries allow the user to type a question in the same form one would ask it to a human. A site like this would be ask.com.
Working of   Search Engine is shown as below,



3.   Searching
The usefulness of a search engine depends on the relevance of the result set it gives back. While there may be millions of web pages that include a particular word or phrase, some pages may be more relevant, popular, or authoritative than others. Most search engines employ methods to rank the results to provide the “best” results first. How a search engine decides which pages are the best matches, and what order the results should be
shown in, varies widely from one engine to another. The methods also change over time as Internet usage changes and new techniques evolve. There are two main types of search engine that have evolved: one is a system of predefined and hierarchically ordered keywords that humans have programmed extensively. The other is a system that generates an “inverted index” by analysing texts it locates. This second form relies much more heavily on the computer itself to do the bulk of the work.

This is the process by which post of the search engines work now a days though we see many changes in algorithm and searching mechanism, every search engine is focused on relevancy and better load time.

Search type followed by google search engine:
                   The search type followed by the google search engine is search by word type.
It means
Ø When any sentence is entered is google search
                                                                                i.            It will separate each word entered in that sentence
                                                                              ii.            It matches each word in a global database
                                                                            iii.            It obtains the different kinds of result as web links
                                                                           iv.            Then it displays the web links as an output
Let us make a search in google search engine
·        Enter the query in google search
What is the population of china?
The google will take the query input and it will separate each and every word and it finds the key words in the sentence such as population, china and then it will search for the record globally. Then it matches some on the entities with the input query.
The predefined attributes of the google database are some of the websites web links and others wed related sources
Now it will display the web links that matches with the user query.
All these actions are taken place by means of internet.

The Output obtained by the google search


v Now you must have to go with the required web link and then you can obtain your answer for your query

There is any other way to get the answer as the result of the search.
Yes, for this the Search by dictionary method must have to be implemented in the google search engine.

How is Search by dictionary type works?
                                    It is a step by step process and the execution of search  is narrated as follows

             
              Schematic representation of search by dictionary type



Dictionary implementation process:
Query:
          Query means question. If a user has any question, in order to find the solution for his/her question, the query has been given as an input into the search engine. The user query can be in any form such as voice, video, text…
Dictionary:
          Dictionary is a thing which helps us to find the meaning the meaning for each and every thing across the world. The Dictionary which is going to be implemented on the google search must not contain only the meaning of each world, it must be capable of
·        Finding the meaning for a sentence
·        Finding idioms and phrases, verbs, nouns in a sentence
·        Tenses must be properly understood
·        Translating the language into British or American English
·        Understanding the abbreviation

Now the query given by the user is being converted into appropriate meaning. The meaning generated by the dictionary is being used in the future operation done by search engine.

Search by Meaning:
          Now the query has been converted into a meaning in a machine understandable format. The search operation done in the google database has been made through the meaning generated by dictionary.
            There is no change in the search operation made by google search engine. Instead of performing the search with the word we are just making to perform searching with the meaning generated by the dictionary. This is mode of searching operation which gets executed during search in the google database.



                                                                                                                 Searching…
 




Now output generated by google is based on the meaning. Therefore the output that we are expecting will come in the first page itself and it may also be able to come as a first suggestion.
Will the dictionary system work?
          Yes, definitely we are not changing the search type of google search engine we are just modifying the searching algorithm of the google search engine. Instead of running the query the query directly into google database we are just making it pass through the dictionary and the output of the dictionary is made to pass through the google database.
Advantage:
Ø Required result can be obtained accurately
Ø Reduce the multiple search made by user
Ø View of next pages by the user can be avoided


Disadvantage:
Ø Response time may get increased
Ø Construction cost.

Conclusion:
                        At present google is our guide which direct the way to obtain our answer but we are transforming google to be as our friend which takes us to the result.


Thank you