Friday, January 27, 2012

Rich Snippets to improve the display of search results

all most all the Internet user use the search engine to find out the link he/she needs so its an important issue to present a website attractively fro the first glance at the search results pages.
a web developer may control the view of a web page in the search results. If its not controlled by the web developer, then search engines use the default mechanism to show the info about the web page.
One of the mechanisms is Rich Snippets to present a website information in the search result.

The above screen shot is of a search result of a blog powered by blogger.com. Here the rich snippets is used by the blogger.
As the same way we are able to use rich snippets for our web site. Its nothing more than adding the tag to make it sensible to a search engine about the content of the site page to show on the search results.



An important link to a testing tools for Rich snippets of google web master.With rich snippets, webmasters with sites containing structured content such as review sites or business listings—can label their content to make it clear that each labeled piece of text represents a certain type of data: for example, a restaurant name, an address, or a rating.

This kind of markup is designed for sites containing specific types of structured data. Google currently supports the following information types: reviews, people profiles, products, business listings, recipes, and events.
Providing this information doesn't affect the appearance of your content on your own pages, but it does help Google better understand and present information from your page.

The properties supported by Google are based on a number of different formats. For more information, see the following articles:

* About microdata
* About microformats
* About RDFa

MicroData:

# information(specific type item)
# properties related to the item.
#Microdata uses simple html(i.e span, div) tags to assign brief and descriptive names to items and properties.

Exmaple of Microdata html marked up:
<div itemscope itemtype="http://data-vocabulary.org/Person">
My name is <span itemprop="name">Bob Smith</span>
but people call me <span itemprop="nickname">Smithy</span>.
Here is my home page:
<a href="http://www.example.com" itemprop="url">www.example.com</a>
I live in Albuquerque, NM and work as an <span itemprop="title">engineer</span>
at <span itemprop="affiliation">ACME Corp</span>.
</div>


Microformat:

Microformats are simple conventions (known as entities) used on web pages to describe a specific type of information —for example, a review, an event, a product, a business, or a person. Each entity has its own properties. For example, a Person has the properties name, address, job title, company, and email address.

In general, microformats use the class attribute in HTML tags (often span or div) to assign brief and descriptive names to entities and their properties. Here's an example of a short HTML with micro format showing basic contact information for Bob Smith.

<div class="vcard">
<img class="photo" src="www.example.com/bobsmith.jpg" />
<strong class="fn">Bob Smith</strong>
<span class="title">Senior editor</span> at <span class="org">ACME Reviews</span>
<span class="adr">
<span class="street-address">200 Main St</span>
<span class="locality">Desertville</span>, <span class="region">AZ</span>
<span class="postal-code">12345</span>
</span>
</div>

RDF
RDFa is a way to label content to describe a specific type of information, such as a restaurant review, an event, a person, or a product listing. These information types are called entities or items. Each entity has a number of properties. For example, a Person has the properties name, address, job title, company, and email address.

In general, RDFa uses simple attributes in XHTML tags (often span or div) to assign brief and descriptive names to entities and properties. Here's an example of a short HTML with RDF showing basic contact information for Bob Smith.

<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Person">
My name is <span property="v:name">Bob Smith</span>,
but people call me <span property="v:nickname">Smithy</span>.
Here is my homepage:
<a href="http://www.example.com" rel="v:url">www.example.com</a>.
I live in Albuquerque, NM and work as an <span property="v:title">engineer</span>
at <span property="v:affiliation">ACME Corp</span>.
</div>


--
A shared markup vocabulary makes easier for webmasters to decide on a markup schema and get the maximum benefit for their efforts.So, in the spirit of sitemaps.org, search engines have come together to provide a shared collection of schemas that webmasters can use.


We can use the schema.org vocabulary, along with the microdata format, to add information to your HTML content. While the long term goal is to support a wider range of formats, the initial focus is on Microdata. This guide will help get us up to speed with microdata and schema.org, so that we can start adding markup to our web pages.

Thursday, January 26, 2012

To know the databse version in SQl Server

To know the version of the Database by query:


Select @@version as x


another query for a more specific results, we can execute

Select SERVERPROPERTY('productversion') As [Version],
SERVERPROPERTY('productlevel') As [Level],
SERVERPROPERTY('edition') As [Edition]

To save new line to vachar field of SQL Database Table

For various purposes we are in need to multi-line text in the database fields. It differs from OS to OS or databases to databases. Generally to save a multi-line text to a varchar field of a table in sql server database, we can use just two special characters:

char(13)+char(10)

This bondage of 13 years old boy and the 10 years old girl make a new position of the parent's line(Just love story to remember!!!!)



INSERT INTO [TestDB].[dbo].[testTable]
([TestID]
,[TestName]
)
VALUES
('ROW 2',
'Everybody should love his God'
+CHAR(13)+CHAR(10)+'No matter which one he believes'
+CHAR(13)+CHAR(10)+'God loves us so much.'
+CHAR(13)+CHAR(10)+'He is the almighty of this world')





If we execute the above query the table will accepts and holds the 2nd field with the 3 new line also. And the Select query with return them as intact.



Sunday, January 22, 2012

Performance issues for Web Development

Performance is the main concern to develop website or web application. Web developers may follow the following steps for that.
1. Make Fewer HTTP Requests
2. Use a Content Delivery Network
3. Add an Expires or a Cache-Control Header
4. Gzip Components
5. Put Stylesheets at the Top
6. Put Scripts at the Bottom
7. Avoid CSS Expressions
8. Make JavaScript and CSS External
9. Reduce DNS Lookups
10. Minify JavaScript and CSS
11. Avoid Redirects
12. Remove Duplicate Scripts
13. Configure ETags
14. Make Ajax Cacheable
15. Flush the Buffer Early
16. Use GET for AJAX Requests
17. Post-load Components
18. Preload Components
19. Reduce the Number of DOM Elements
20. Split Components Across Domains
21. Minimize the Number of iframes
22. No 404s
23. Reduce Cookie Size
24. Use Cookie-free Domains for Components
25. Minimize DOM Access
26. Develop Smart Event Handlers
27. Choose over @import
28. Avoid Filters
29. Optimize Images
30. Optimize CSS Sprites
31. Don’t Scale Images in HTML
32. Make favicon.ico Small and Cacheable
33. Keep Components under 25K
34. Pack Components into a Multipart Document
The items above has been reference from Yahoo’s Developer Nework. Full details on each of these items is available at:
http://developer.yahoo.com/performance/rules.html

Friday, January 6, 2012

Copy table to a different database on a different SQL Server

Easily information from t table to another table can be copied. If these tables are from two different database on the same server it also be possible to perform query using the following:



INSERT INTO bar.tblFoobar( *fieldlist* )
SELECT *fieldlist* FROM foo.tblFoobar



or

SELECT *
INTO DestinationDB.MyDestinationTable
FROM SourceDB.MySourceTable



The problem arise when we want to copy information from he table of one database to that of another database. And in sqo server this can be performed by a technique known as linked server.
------------------------


Yes. add a linked server entry, and use select into using the four part db object naming convention.

select * into targetTable from [sourceserver].[sourcedatabase].[dbo].[sourceTable]




................
We can add a linked server entry following the below information


1. Click Start, click All Programs, click Microsoft SQL Server 2005 and then click SQL Server Management Studio.


2.In the Connect to Server dialog box, specify the name of the appropriate SQL Server, and then click Connect.


3. In SQL Server Management Studio, double-click Server Objects, right-click Linked Servers, and then click New Linked Server.


4. In the New Linked Server dialog box, on the General page, in Linked server, enter the full network name of the SQL Serveryou want to link to.

5.This procedure often refers to the server you are linking to as the remote server. This is for convenience only, to indicate the relationship of the linked (“remote”) server to the local server. Do not confuse this usage with the obsolete remote server functionality in SQL Server.



Under Server type, click SQL Server.

6. In the left pane of the New Linked Server dialog, under Select a page, choose Security.


7.You will need to map a local server login to a remote server login. On the right side of the Security page, click the Add button.


8. Under Local Login, select a local login account to connect to the remote server. Check Impersonate if the local login also exists on the remote server. Alternatively, if the local login will be mapped to a remote SQL Server login you must supply the Remote User name and Remote Password for the remote server login.

To use impersonation, your SQL Server configuration and login accounts must meet the requirements for delegation. For more information about impersonation and delegation, see http://go.microsoft.com/fwlink/?LinkID=132854.



9. In the left pane of the New Linked Server dialog, under Select a page, choose Server Options. Set the Rpc and Rpc Out parameters to True, and then click OK.