Sunday, 22 December 2013

Odesk Seo Test Answers 2013-2014



1. Some words, when followed by a colon, have special meanings to yahoo. What is performed by the link:Operator?

a. it shows all the outbound links from the url
b. It shows how many pages of the site yahoo is pointing to
c.It shows all the pages that point to that url
d. It show url's with broken links

answer: C

2. Which blackhat Seo techniques is characterized by a method to deceive search engine, by detecting the search engine bot and "feeding" it with a different HTML code than the HTML actually served to users?

a.Coaling
b.Foisting
c.Slighting
d.Cloaking

answer: D

3. Why is it bad idea from SEO perspective to host free articles and write ups that are very common on the internet?

a.Because they will not lead to fresh traffic
b.Because you could be penalize by search engine for using duplicate contents
c.Because you will not get the benefits of proper keyword targeting
d.because people could turn up claiming copyright infirigement

answer: B

4. What will happen if you type the word 'Certification-Networking' in the google search box?

a.Google will find the web pages about "certification" and also containing the word "networking"
b.Google will find ALL the web pages containing the word word "Certification" and "Networking"
c.Google will find ALL the web pages in which the words "Certification" and "Networking" appear together.
d.Google will find the web pages about Certification that do not contain the word Networking

answer: C

5. Which of the following factors does google take into account while accessing whether or not a website is an authority website?

a. The frequency with which the contents of the website is updated
b. the number of web pages containing relevant information on the main theme of the website
c.The number of in-bound natural links related to the website's theme (or keywords)
d. None of the above

answer: C


6. What is keyword density?

a.The number of times the keyword is used / (divided by) the total word count on page - (minus) the total words in HTML on the page
b.The number of times the keyword is used x (multiply by) the total word count on page.
c.The number of times the keyword is used in the page description
d.The number of times the keyword is used in the page title
e.The number of times the keyword is used / (divided by) the total word count on the page.

answer: E

7. Which of the following statement about FFA pages are true?

a.They are greatly beneficial to SEO
b.They are also called Link Farms
c.They are Paid Listings
d.They contain numerous inbound links

answer: B

8. What is the illegal act of copying of a page by unauthorized parties in order to filter off traffic to another site called?

a.Traffic jacking
b.Visitors Jacking
c.View Jacking
d. Page Jacking

answer: D

9. What is the most likely time period required for getting a google page ranking?

a.1 week
b. 3 weeks
c. 1 month
d. More than 3 months

answer: D

10. Which of the following can be termed as a good keyword selection and placement strategies?

a.Targeting synonyms of the main keyword, A & D
b.Targeting the highest searched keywords only
c.Copying competitor keywords
d.Optimizing 5 or more keywords per page (check)

answer: A

11. Some words, when followed by a colon, have special meanings to yahoo. What is perfermed by the link:Operator?

a. it shows all the outbound links from the url
b. It shows how many pages of the site yahoo is pointing to
c. It shows all the pages that point to that url
d. It show url's with broken links
answer: C

12. Which blackhat Seo techniques is characterized by a method to decieve search engine, by detecting the search engine bot and "feeding" it with a different HTML code than the HTML actually served to users?

a.Coaling
b.Foisting
c.Slighting
d.Cloaking

answer: D

13. Why is it bad idea from SEO perspective to host free articles and write ups that are very common on the internet?

a.Because they will not lead to fresh traffic
b.Because you could be penalize by search engine for using duplicate contents
c.Because you will not get the benefits of proper keyword targeting
d.because people could turn up claiming copyright infirigement

answer: B

14. What will happen if you type the word 'Certification-Networking' in the google search box?

a.Google will find the web pages about "certification" and also containing the word "networking"
b.Google will find ALL the web pages containing the word word "Certification" and "Networking"
c.Google will find ALL the web pages in which the words "Certification" and "Networking" appear together.
d.Google will find the web pages about Certification that do not contain the word Networking

answer: C

15. Which of the following factors does google take into account while accessing whether or not a website is an authority website?

a. The frequency with which the contents of the website is updated
b. the number of web pages containing relevant information on the main theme of the website
c.The number of in-bound natural links related to the website's theme (or keywords)
d. None of the above

answer: C

16. What is keyword density?

a.The number of times the keyword is used / (divided by) the total word count on page - (minus) the total words in HTML on the page
b.The number of times the keyword is used x (multiply by) the total word count on page.
c.The number of times the keyword is used in the page description
d.The number of times the keyword is used in the page title
e.The number of times the keyword is used / (divided by) the total word count on the page.

answer: E

17. Which of the following statement about FFA pages are true?

a.They are greatly beneficial to SEO
b.They are also called Link Farms
c.They are Paid Listings
d.They contain numerous inbound links

answer: B

18. What is the illegal act of copying of a page by unauthorized parties in order to filter off traffic to another site called?

a.Traffic jacking
b.Visitors Jacking
c.View Jacking
d. Page Jacking

answer:D

19. What is the most likely time period required for getting a google page ranking?

a.1 week
b. 3 weeks
c. 1 month
d. More than 3 months

answer: D

20. Which of the following can be termed as a good keyword selection and placement strategies?

a. Targeting synonyms of the main keyword (ans) A & D
b.Targeting the highest searched keywords only
c.Copying competitor keywords
d*Optimizing 5 or more keywords per page (check)

answer: D

21. Google displays up to ------------------------ characters of a web pages title tag

a.56
b.60 * B & C
c.66
d.80

answer: B

22. Which of the following fact about Alexa are correct ?

a.Alexa provides free data on relative website visitors traffic
b. Alexa and Quancast provide information on visitors household income
c.Alexa is baised towards US based traffic
d.Quantcast only track people who have installed the quantcast toolbar

answer: A

23. What is the name of the search engine technology due to which a query for the word "actor" will aslo show search result for related word such as actress, acting or act?

a.Spreading
b.Dilating
c.RSD (real time synonyms detection)
d.Stemming
e.Branching

answer: D

24.Do search engine such as google detect unnatural linking patterns by checking the class C IP address of the page where the link to the website originates

a. Yes
b. No

answer: A

25. Which of the following conditions will google treat favorably from the "Relevancy" perspective.

a.The website offering product and services to the visitors country
b.A website that provides Free content for related keywords
c.Hidden keywords on the homepage matching search term
d.Image alt tag on the homepage matching search term

answer: B

26. Which of the following website design guideline has been recommended by google?

a.Having a clear hierachy and text links
b.Every page should be reachable from atleast one static text link
c.If the sitemap is larger than 100 or so links, you should break the sitemap into separate pages
d.Keep the links on a given page to a reasonable number (fewer than 100)
e. Use less than 30 images or graphics per page

answer: A

27. What is the main reason for the effectiveness of Optimizing a web page towards a long tails keyword search? Recheck

a.There are more long tail searches than shorter keyword queries
b.*Search engine often pass on long tail searches to lesser or new website
c.Search engine do not pass on long tail search traffic to website that rank high for shorter keyword searches (check)
d.There are fewer webvsite that have targeted such keyword's

answer: D

28 Which of the following statement is correct with regard's to the images within a web page?

a.Images can not be spidered by the search engine (check)
b.Important keywords related to the image should be plcaed in the ALT text
c.Images should always be kept close to the top of a web page
d. Image maps should be used while including the images

answer: B

29. What does the 302 server Response Code signify?

a.It signifies conflict, too many people wanting the same file at the same time
b.The page has been permanently removed
c.The method you are using to access the file is not allowed
d.The page has temporarily moved
e.What you requested is just too big to process

answer: D


30. State whether the following statement is true or false. A sitemap provide a list of natural links to user accessible pages on a website

a.True
b.False

answer: B

31.  State whether true or false.
The Yahoo Directory listing is a free service for commercial site?

a.True
b.False

answer: A

Friday, 20 December 2013

login example using struts 2 and hibernate with mysql

 CREATE TABLE `login_master` (
  `login_id` int(10) NOT NULL,
  `login_name` varchar(30) NOT NULL,
  `login_password` varchar(30) NOT NULL,
  `hint_password` varchar(50) NOT NULL,
  `temp` varchar(30) NOT NULL,
  PRIMARY KEY  (`login_id`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1;

Login.jsp

<%@taglib uri="/struts-tags" prefix="s"%>
<html>
<head>
<title>Login</title>
</head>
<body>
<h1>Login</h1>
<div id="login">
    <s:form action="Login" id="form1" method="post">
    <h2>
    <p><s:textfield name="username" label="username" id="textfield" /></p>
    <br>
    <p><s:password name="password" label="password" id="textfield2"></s:password></p>
    </h2>
    <s:submit value="Authentification" />
</s:form> <s:if test="hasActionErrors()">
    <s:div id="errror1" cssStyle="color:red ">
        <p><s:actionerror /></p>
        <br>
    </s:div>
</s:if> <br clear="all" /></body>
</html>

struts.xml

<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
  <package name="default" extends="struts-default">
          <action name="Login" class="Action.LoginAction">
            <result name="Home">Login.jsp</result>
            <result name="success">Home.html</result>
            <result name="input">Login.jsp</result>
        </action>
 </package>
</struts>

Action.java

package Action;

import java.util.Map;

import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.SessionAware;

import DAO.Logindao;
import bean.Loginbean;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class LoginAction extends ActionSupport implements ModelDriven<Loginbean>,SessionAware{

    /**
     *
     */
    private static final long serialVersionUID = 1L;
    Logger logger = Logger.getLogger(LoginAction.class);
    Loginbean bean=new Loginbean();
    private Map<String, Object> session = null;
    Logindao dao=new Logindao();
    boolean isValidat;
   
    public String execute()
    {
         if(dao.find(bean.getUsername(),bean.getPassword()))
             
             return "success";
           
         else
            
          this.addActionError("The username or password  is incorrect.");       
           return "Home";
        }
   
    public String Logout()
    {
       
        return "Logout";
    }
   
 public Loginbean getModel()
{
    return bean;
}
public void setSession(Map<String, Object> session) {
    this.session = session;
}
public Map<String, Object> getSession() {
    return session;
}

}





Loginbean.java

package bean;

public class Loginbean {
    private String username;
    private String  password;
   
   
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
}

Logindao.java

package DAO;

import java.util.Iterator;
import java.util.List;
import master.LoginMaster;
import org.hibernate.Query;
import org.hibernate.Session;
import util.HibernateUtil;

public class Logindao{

    Session session;
   
      @SuppressWarnings("unchecked")
       public boolean find(String name, String password) {
          session = HibernateUtil.getSession();                         
 String     SQL_QUERY=  " from LoginMaster u where u.loginName='" + name + "' and u.loginPassword='" + password + "'";
    
                System.out.println(SQL_QUERY);
                Query query = session.createQuery(SQL_QUERY);
                Iterator<LoginMaster> it = query.iterate();
                List<LoginMaster> list = query.list();
                if (list.size() > 0) {
                    session.close();
                    return true;
                }
                session.close();
                return false;
               
        }
}

HibernateUtil.java

package util;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {
      private static SessionFactory sessionFactory;
       
        public static void createSessionFactory() {
        sessionFactory = new Configuration().configure().buildSessionFactory();
        System.out.println("Value of sessionFactory is==="+sessionFactory);
        }

        public static Session getSession() {
        return sessionFactory.openSession();
        }

    }

Struts2dispatcher.java

package util;


import javax.servlet.FilterConfig;
import javax.servlet.ServletException;

import org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter;
import org.hibernate.HibernateException;
public class Struts2dispatcher extends StrutsPrepareAndExecuteFilter{
   
    public void init(FilterConfig filterConfig) throws ServletException {
    super.init(filterConfig);
    try {
    HibernateUtil.createSessionFactory();
    System.out.println("application initializing successfully");
    } catch (HibernateException e) {
    throw new ServletException(e);
    }

    }
   
}

hibernate.cfg.xml
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
 <hibernate-configuration>
    <session-factory>
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="connection.url">jdbc:mysql://localhost:330/LoginMasterdatabase</property>
        <property name="connection.username">root</property>
        <property name="connection.password">root</property>
        <property name="connection.pool_size">1</property>
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="current_session_context_class">thread</property>
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
        <property name="show_sql">true</property>
        <property name="hbm2ddl.auto">validate</property
        <mapping resource="master/LoginMaster.hbm.xml" />
    </session-factory>
</hibernate-configuration>






LoginMaster.java

package master;


/**
 * LoginMaster generated by hbm2java
 */
public class LoginMaster implements java.io.Serializable {

    private int loginId;
    private String loginName;
    private String loginPassword;
    private String hintPassword;
    private String temp;

    public LoginMaster() {
    }

    public LoginMaster(int loginId, String loginName, String loginPassword,
            String hintPassword, String temp) {
        this.loginId = loginId;
        this.loginName = loginName;
        this.loginPassword = loginPassword;
        this.hintPassword = hintPassword;
        this.temp = temp;
    }

    public int getLoginId() {
        return this.loginId;
    }

    public void setLoginId(int loginId) {
        this.loginId = loginId;
    }

    public String getLoginName() {
        return this.loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getLoginPassword() {
        return this.loginPassword;
    }

    public void setLoginPassword(String loginPassword) {
        this.loginPassword = loginPassword;
    }

    public String getHintPassword() {
        return this.hintPassword;
    }

    public void setHintPassword(String hintPassword) {
        this.hintPassword = hintPassword;
    }

    public String getTemp() {
        return this.temp;
    }

    public void setTemp(String temp) {
        this.temp = temp;
    }

}