Tuesday, November 4, 2014

Android 5.0 Lollipop is available for public now


The long wait has come to end for those of you who eagerly wanted to see android lappypop on there devices. The Android Official Blog has put out a post saying that Android 5.0 Lollipop has started rolling out today. Google has confirmed that Android 5.0 Lollipop would be coming to all the Nexus devices – Nexus 4, Nexus 5 and tablets Nexus 7 (2012 and 2013 editi0ns) and Nexus 10. The Nexus 9 which has launched internationally comes baked in with Lollipop and so will the Google Nexus 6 when it comes out.




For those of you who already own Nexus devices and can’t wait for the Lollipop update notification can manually check for one.

Just head to Settings>About Phone>System Update>Check Now.


Here are best features announced in the latest Android OS:

1. Pick up where you left off: Similar to Continuity in iOS 8, Lollipop lets you pick up where you left off, so the songs, photos, apps, and even recent searches from one of your Android devices can be immediately accessed across devices.

2. Multiple device compatibility: Lollipop will support devices with different screen sizes including wearables such as smartwatches, TVs and cars. According to Google, it is designed to be flexible, so that it can work on all your devices and customised for your needs.

3. Material Design: In order to maintain a consistent design experience across all Android devices, Lollipop uses the Material Design interface across devices it runs on.With Material Design, elements can dynamically shrink and expand, there’s more white space between elements, and gives a 3D appearance overall. While we are yet to try it out ourselves, Google claims that the new design is more intuitive and transitions between tasks are more fluid.


4. Updated camera: Lollipop makes it easier to support features like burst mode and fine settings tuning. You’ll be able to capture full resolution frames around 30fps, and shoot in raw formats like YUV and Bayer RAW. There’s also support for UHD 4K video playback, tunneled video for high quality video playback on Android TV and improved streaming. Lollipop adds professional features to control settings for the sensor, lens and flash per individual frame.

5. Battery settings: There’s a new battery-saver feature that extends the life of your device by up to 90 minutes—helpful if you’re far from a power outlet. It’s also easier to manage your power usage. The OS adds a feature which gives the estimated time left before you need to charge and, when it’s charging, it tells you approximately how much time it will need to charge before it’s ready to go.

6. Improved security: Share your device securely with guest user mode, create multiple user accounts to enable friends to log in on your device. In either case, no one will be able to access your private files. There’s Android Smart Lock to secure your phone or tablet by pairing it with a trusted device like your wearable or even your car. Google has enforced the SELinux security module for all apps to give better protection against vulnerabilities and malware.

7. Updated notifications screen: You can now view and respond to messages directly from your lock screen, or hide notifications for sensitive content. Turning on Priority mode through your device’s volume button will allow only certain people and notifications get through.You can also choose to avoid calls from interrupting the game you are playing or the movie you are watching.

8. New Quick Settings: The updated Quick Settings on the notification screen has new handy controls such as flashlight, hotspot, screen rotation and cast screen controls. While these settings were not on older stock-Android devices, they may already be present on other customised Android devices. Similarly, you can manually adjust the brightness for certain conditions, while adaptive brightness will kick in based on ambient lighting.

9. Smoother experience: Google uses a new runtime on Android (called ART), which claims to improve app performance, battery life and responsiveness. Google claims that the new OS improves Android’s performance by four times. It compacts background apps and services so you can do more at once. There’s also support for 64-bit chips now.

10. Tap and Go: Tap and Go for NFC devices lets you set up your new Android phone or tablet instantly by simply tapping it to your old one. Whenever you get a new Android phone or tablet, you can sync your apps from Google Play automatically from any of your old Android devices.

Monday, October 27, 2014

Future of a Software Engineer ?

The Big Question on My Mind nowadays is 'What is the future of a  Software Engineer ?'

His career starts at 22, if he is placed immediately after college or he gets a job in off campus campaigns. By the time he reaches 35, he has to plan for his future. But is there future for a software engineer after 35 in his own sector. Every one cannot become a CEO or reach a manager level and continue to work for 20 to 25 years and then retire as it happens in many government or other management related jobs.

Software Engineer was a most wanted person in all the matrimony websites few years back. Now people are slowly moving towards grooms in other sectors like government sector.

So is this downfall of software jobs or people are no more interested to give their daughters to software engineers because of the insecurity in there jobs.

Well that is one of the reason which is considered by most of the people but the fact is that IT people are still highly paid employees and have good chances of settling abroad.




Wednesday, August 10, 2011

Agile Software Development Methodology

Agile is software development methodology. It is very effective where Client frequently changes his
requirement.Since it has more iteration so you can assure a solution that meets clients requirement.
More than one build deployment for a project.It involves more client interaction and testing effort.

There are two methods by which this methodology can be implemented:-

1) Scrum: Each iteration would called a scrum which can be a 1-2 Months.In Scrum Client prioritize
his requirements what he want first. If developer did not meets all the requirement which was being fixed for a particular scrum than rest of the development part would be transferred to the next scrum (would be delivered in the next build),  means developer can't increase time decided for a scrum.

2) Extreme Programming (XP): here iteration period would be less then in scrum , which is being 2-4
weeks.Here developer prioritize what to do first on the basis of client requirement. This duration which
was being fixed for a iteration, can be increase if the some development part is still pending. The build would deployed with having all the client needs.Thus iteration period is not fixed here it can be increase.but iteration should meets all the client's requirement in this build.More attention is required for testing in XP.

It is a methodology to satisfy the customer through early and continuous delivery of valuable software. This is useful when we don't have a clear idea of the client's requirements.The development activities can be carried out using the iterative actions.

The following table enumerates the reasons for choosing Agile methodology over the Waterfall method.
 
1) Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical program, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire program rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.

2) Another Agile method advantage is one has a launch-able product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.
 
3) Agile’s modular nature means employing better suited object-oriented designs and programs, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.    
 
4) Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.   
 
5) However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.

NUnit - A Unit Testing Framework for .Net Applications

What is NUnit 

NUnit is an open-source unit-testing tool built for .NET, which follows in a long line of similar xUnit testing tools built for other platforms. It provides an easy-to-use framework for writing and running unit tests for your .NET applications. NUnit is an automated unit testing framework for .NET. NUnit is free to use with your .NET projects. NUnit is ported from another product called JUnit, which is a unit testing framework for Java applications. NUnit provides a class library which includes some classes and methods to help you write test scripts. NUnit provides graphical user interface application to execute all the test scripts and show the result as a success/failure report (instead of message boxes from the test script). NUnit is the most popular unit testing framework for .net applications. NUnit does not create any test scripts by itself. You have to write test scripts by yourself, but NUnit allows you to use it's tools and classes to make the unit testing easier.

Test Driven Development

Improved Productivity

A key principle of TDD is that developers are most productive when they are in the process of fixing a bug in an application (note: not looking for the bug). This is one of the few times during development that measurable progress is being made on the project. While developers spend time on other things, like finding bugs, they aren't able to spend as much time writing code to correct defects (for example, fixing bugs). A key benefit of test driven development (TDD) is to maximize the time developers spend in bug-fix mode, thus maximizing their productivity.

Improved Quality

In TDD, all non-trivial features of an application are tested. These tests are written before the actual code is written, and they are run all the time. Whenever a test fails, the developer immediately corrects the failure. So, when the time comes to add new functionality, the developer assumes the functionality exists and writes a test. He then runs the tests (which often won't even compile if they rely on as-yet-undefined classes and methods), and when they fail, he enters bug-fix mode and begins adding code to the application until he can get all tests to pass once more. Often, the process of writing the test for the functionality will provide the developer with a better understanding of how the production code should be designed, resulting in improved final code quality.
TDD also makes code easier to maintain, upgrade, and redesign, and has other benefits which the reader is encouraged to research.


NUnit: A Test Framework for .NET

NUnit provides a simple way for developers to write unit tests of the .NET classes, and comes with a small, sample application that demonstrates its use. The current version is written in C# and relies on attributes rather than inheritance and/or naming conventions to define tests and test suites. The main attributes involved are TestFixture, which applies to a class containing tests, SetUp and TearDown, which are run before and after each test, and Test.

NUnit also provides a simple graphical user interface that lets you select which assembly you want to test and which set of tests within that assembly you want to run. It then runs all of the tests in the assembly (or namespace or class) selected, displaying a green bar if everything passes and a red bar if any tests failed. Details of each failed test are also displayed, making it very easy to locate the cause of the failure.

Aa479010.aspnet-testwithnunit-01(en-us,MSDN.10).gif

Figure 1. NUnit's GUI tool provides instant feedback that everything is running as it should be, according to the tests defined so far.

Aa479010.aspnet-testwithnunit-02(en-us,MSDN.10).gif

Figure 2. NUnit shows the details of a failure caused by an invalid connection string.

There are other testing tools coming to market for .NET, but today NUnit has the largest support base, and is both free and open source, making it something you may want to try first.

Related Tools

NUnit Visual Studio .NET Addin

This addin, which requires NUnit, allows you to run your tests without leaving the Visual Studio .NET IDE. Simply right-click on a project or solution in the Solution Explorer to run all tests within that project or solution. The results are displayed in the Output window. Unfortunately, there are no pretty green or red bars, but if having one less program open is important to you, this can be a useful tool.

Aa479010.aspnet-testwithnunit-03(en-us,MSDN.10).gif

Figure 3. Run tests in Visual Studio .NET with a simple right-click.

Aa479010.aspnet-testwithnunit-04(en-us,MSDN.10).gif

Figure 4. Output from NUnit tests run within Visual Studio .NET

NUnitASP

NUnitASP allows TDD to be extended to the user interface in ASP.NET, by providing a means of testing Web controls. Its usage is beyond the scope of this article, but you may learn more about it from the NUnitASP Web site.

A Simple Application

To demonstrate TDD, I've used it to help me redevelop a multi-tier sample application for ASP.NET. The application demonstrates how to register a user for an application, how to grant them access to secure web pages, and how to allow them to sign in and sign out. The data access layer for this application is concerned with adding users to the database, retrieving user information, and verifying that user logins are correct. I’ve used this sample for a couple of years now and built it with TDD several times, learning new things with each iteration.

Windows Workflow Foundation?

What is Windows Workflow Foundation?

WWF is a programming model for building workflow-enabled applications on windows. System. Workflow namespace has all the necessary modules to develop any type of workflow.

What is a Workflow?

A Workflow is a set of activities, which is stored as model and they depict a process. Below figure depicts clearly the difference between Workflow and Activity. Every task is an activity and group of activity depicts a complete workflow. Workflow is run by the Workflow runtime engine.

What are different types of Workflow in Windows Workflow foundation?

There are two basics type of workflow Sequential Workflow and State machines workflow.
A sequential workflow has clear start and finish boundaries. Workflow controls execution in Sequential workflow. In sequential execution, one task is executed after other. Sequential workflow is more rigid in format and execution path has a deterministic nature.

A State machine workflow is more dynamic in nature. Workflow has states and the state waits for events to help it move to next state. In State machine execution path is undeterministic nature.
Below figure shows visual conceptualization of fundamentals. You can see in Sequential workflow the execution path is very determent. Shiv performs the entire task sequentially and these tasks are very determent. Now have a look at the second workflow. Every state goes to other state when it receives some external events. For instance when Shiv is seeing star trek there is an event of flashing news which triggers him to see the flashing new.

Monday, August 1, 2011

Ajax Minifier reduces the size of javascript and css files

Ajax Minifier is a Microsoft program which mifys js and css files. Minification is the process of reducing the size of a CSS or JS file by removing whitespaces, comments and other optimization. This is a free tool and it can be used in command line or MSBuild tasks.

The idea behind this tool is to improve the load time whenever the site is requested. Most of the times, about 70-90% of time spent waiting for a page on the average web site is actually due to the number of HTTP requests for images, JS and CSS files. To improve this, we can use this tool and it minify's the css, js files so that the download time will be considerably lesser than the actual file.

So whenever you trigger a new build from visual studio its going to execute a build and before moving that build to deployment server its going to execute this build task to minify and combine the css and javascript files in your site as mentioned by you in the target folder. After combining, its going to creat a single javascript and a single css file for entire site and name it with this version of build.

When the user requests for your site on the next time the name of previous js file and this js file is going to be different because of this version number change and the browser is going to download it to local cahe, so for subsequent requests it will use it from the cache. This is how it makes the site very faster.

Ranking Functions in Sql Server 2008

There are four ranking functions in sql server. They are Row_Number(), Rank(), Dense_Rank(), Ntile().

Row_Number()

Row_Number function gives the sequential order of numbers starting from 1 for the specified row. This function is used to split the table based on this row number.


 
select *, ROW_NUMBER() over(partition by part order by value) AS Partition
from Ranker

Rank()

Rank() function consider the repeating values in the column. If two values are same in the column means both values are given the same rank and the next value gets the respected rank.

Dense_Rank()

Dense_Rank() is as same as rank function the only difference is the next value to the repeating value should take the rank in sequence order.

Ntile()

Ntile() function is different from others. It splits the table based on the given range and rank the number for the partitions.



create table Ranker(value int)

Insert into Ranker values(8),(1),(6),(2),(3),(6),(4),(5),(8),(9),(3),(7)

select *,
	ROW_NUMBER() over(order by value) AS Row_No,
	RANK() over(order by value) AS Rank ,
	DENSE_RANK() over(order by value) AS Dense_Rank,
	NTILE(4) over(order by value) AS Ntile
from Ranker  
 
 
Value	Row_No	Rank	D_Rank	Ntile
1	1	1	1	1
2	2	2	2	1
3	3	3	3	1
3	4	3	3	2
4	5	5	4	2
5	6	6	5	2
6	7	7	6	3
6	8	7	6	3
7	9	9	7	3
8	10	10	8	4
8	11	10	8	4
9	12	12	9	4


Sunday, March 20, 2011

Configure Secure Socket Layer (SSL) in IIS 7 or IIS 7.5 in Windows 7

HTTPS is a secure communications channel that is used to exchange sensitive information like User Credentials, Credit Card details etc. between a client computer and a server. It uses SSL which encrypts communication over a network like the internet.

In this article, we will see how to configure Secure Socket Layer (SSL) in IIS 7.x in a Windows 7 machine. To enable SSL in IIS, you must first obtain a certificate that is used to encrypt and decrypt the information transferred over a network.

I assume you have configured IIS 7 on your Windows 7 box and have ASP.NET registered on your IIS server. If you have not yet configured IIS on your Windows 7 box, I strongly suggest you to read these two posts before continuing further

Install IIS 7 on Windows 7

Resolving ASP.NET 4.0 has not been Registered on the Web Server Error

Assuming you are all set, go to Start > All Programs > Accessories > Run. Type Inetmgr and hit enter. This opens up the IIS Manager. In the IIS Manager > Select the root node > Double click ‘Server Certificates’

IIS Server Certificates

If you have a list of Server Certificates installed on your server, you will be able to view them now. But it happens that I do not have any on my server. In that I can either ‘Create Certificate Request’ or use a ‘Self-Signed Certificate’ for testing purpose.

Self Signed Certificate

Note: If you choose the ‘Create Certificate Request’ option, IIS creates a Base64 encoded request. You can then submit this request to a Certificate Authority (like Verisign) and receive a SSL certificate which can be registered on your web server using the ‘Complete Certificate Request’ that you see in the screenshot above.

However if you choose the ‘Create Self-Signed certificate option, then IIS creates a self-signed certificate for your own server. It is an easy option if you plan to use HTTPS for local testing purpose. Remember that you can access this certificate only from your machine.

We will go ahead with creating a Self-Signed certificate for testing purpose. Click the ‘Create Self-Signed certificate’ link > Enter a friendly name for the certificate request and hit OK.

Self Signed Certificate Name

As you can see in the screenshot below, we have a self-signed certificate that we can use for testing purpose.

Sample Cert

The last step is to set the protocol for SSL for your website. To do so, select your website in the IIS Manager > In the Action pane, select Bindings > Add Site Binding

Https Site Binding

Select the Type https and ‘SampleCert’ as SSL certificate and click OK

AddIis Site Binding

Your Website is now SSL enabled. To test, type https://localhost/YourSiteName and you should be able to see the default page.

I hope you liked the article and I thank you for viewing it.

Friday, March 4, 2011

Difference between WPF and WCF in .Net

Window presentation foundation (WPF)is to help developers create attractive and effective user interfaces. The WPF is included in version 3.0 of the Microsoft .NET Framework, allows building interfaces that incorporate documents, media, two- and three-dimensional graphics, animations, Web-like characteristics, and much more.

Wherein,Windows Communication Foundation (WCF) is a framework for distributed programming. The WCF is designed to offer a manageable approach to distributed computing, broad interoperability, and direct support for service orientation. It includes serialization facilities that enable loose coupling and versioning, and it provides integration and interoperability with existing .NET Framework distributed systems technologies such as Message Queuing (MSMQ), COM+, ASP.NET Web services, Web Services Enhancements (WSE), and a number of other functions.

Convert Time in Different TimeZones in ASP.NET

In this article, we will see how to convert time from one time zone to another, in an ASP.NET application.
Step 1: Fire up Visual Studio > File > New Website. Drag and drop a DropDownList and two Label controls to the page and add a ‘SelectedIndexChanged’ event to the DropDownList (we will code this event later). The DropDownList will display the different Timezones and the Label controls will display the Local time as well as the Converted time. Here’s how the markup would look like.
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="ddlTimeZone" runat="server" AutoPostBack="True"
onselectedindexchanged="ddlTimeZone_SelectedIndexChanged"
AppendDataBoundItems="true" >
<asp:ListItem Text="Select a TimeZone" Value="Default value" />
asp:DropDownList>
<br /><br />
Local Time: <asp:Label ID="lblLocalTime" runat="server" Text="">asp:Label>
<br /><br />
Converted Time: <asp:Label ID="lblTimeZone" runat="server" Text="">asp:Label>
div>
form>
Step 2: We will now populate the DropDownList with the different TimeZones available. A simple way to do that is to use the TimeZoneInfo.GetSystemTimeZones method. This method returns a generic ReadOnlyCollection(Of T) collection of TimeZoneInfo objects.
Write the following code in the Page_Load method
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
lblLocalTime.Text = DateTime.Now.ToString();
ReadOnlyCollection<TimeZoneInfo> tzi;
tzi = TimeZoneInfo.GetSystemTimeZones();
foreach (TimeZoneInfo timeZone in tzi)
{
ddlTimeZone.Items.Add(new ListItem(timeZone.DisplayName, timeZone.Id));
}
}
}
VB.NET (Converted Code)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not Page.IsPostBack Then
lblLocalTime.Text = Date.Now.ToString()
Dim tzi As ReadOnlyCollection(Of TimeZoneInfo)
tzi = TimeZoneInfo.GetSystemTimeZones()
For Each timeZone As TimeZoneInfo In tzi
ddlTimeZone.Items.Add(New ListItem(timeZone.DisplayName, timeZone.Id))
Next timeZone
End If
End Sub
As you can see, we first extract the different TimeZones available on the machine using TimeZoneInfo.GetSystemTimeZones and then loop through the collection and add the name and value to the DropDownList. The TimeZoneInfo.DisplayName is the Name and the TimeZoneInfo.Id is the value added to the DropDownList.
image_2
Step 3: The last step is to convert the local time into the TimeZone selected by the user in the DropDownList. We will do the conversion using the TimeZoneInfo.ConvertTimeBySystemTimeZoneId. This method converts a time from one time zone to another based on the ‘time zone identifier’ without the need to know whether the converted time is standard or daylight saving time. Remember we used the TimeZoneInfo.Id that formed the ‘value’ of the DropDownList in Step 2. We will use that value here as shown below:
C#
protected void ddlTimeZone_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlTimeZone.SelectedIndex > 0)
{
DateTime dt = DateTime.Now;
lblTimeZone.Text = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(dt,
TimeZoneInfo.Local.Id, ddlTimeZone.SelectedValue).ToString();
}
}
VB.NET (Converted Code)
Protected Sub ddlTimeZone_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
If ddlTimeZone.SelectedIndex > 0 Then
Dim dt As Date = Date.Now
lblTimeZone.Text = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(dt, TimeZoneInfo.Local.Id, ddlTimeZone.SelectedValue).ToString()
End If
End Sub
That’s it. Run the application and convert the local time into the desired TimeZone as shown below
image_1

Tuesday, February 8, 2011

SQL DISTINCT on Multiple Columns

The DISTINCT clause works in combination with SELECT and gives you unique date from a database table or tables. The syntax for DISTINCT is show below

SELECT DISTINCT "column_name"
FROM "table_name"

If you want a DISTINCT combination of more than one column then the syntax is

SELECT DISTINCT column1, column2
FROM "table_name"

Let's look at some examples to understand the usage of the DISTINCT keyword. First, let's create a table for our illustration and insert some data.

CREATE TABLE DuplicateTest(
Firstname
nvarchar (30) NOT NULL,
Lastname
nvarchar(30) NOT NULL,
PostalCode
nvarchar(15) NOT NULL,
City
nvarchar(30) NOT NULL
)
insert into DuplicateTest
(Firstname,Lastname,PostalCode,City)
values
('Param', 'Singh', 'B283SP', 'Birmingham'),
('Steve', 'White', 'EC224HQ', 'London'),
('Mark', 'Smith', 'L324JK', 'Liverpool'),
('Claire', 'whitehood', 'M236DM', 'Manchester'),
('Param', 'Singh', 'B283SP', 'Birmingham')

select * from DistinctTutorial
DuplicateTest
Firstname Lastname PostalCode City
Sarvesh Singh B263SP Birmingham
Steve White EC224HQ London
Mark Smith L324JK Liverpool
Claire whitehood M236DM Manchester
Param Singh B283SP Birmingham

In the result set above there are repetitions in the City Column. Let's get a list of all cities without repeating them using DISTINCT.

select DISTINCT City from DuplicateTest
City
Birmingham
Liverpool
London

Manchester


You can see 'Birmingham' is just returned once in this result, even though it appears more than once in the table. You can get the same result using GROUP BY as shown below.

select city from DuplicateTest
group by city

Let's now use DISTINCT with more than one column. We will add the Lastname column in as well.

select DISTINCT City,Lastname from DuplicateTest
Distinct City and lastname
City Lastname
Birmingham Singh
Liverpool Smith
London White
Manchester whitehood

We get a list of results that have multiple rows, none of which are duplicated.

Again, you can get the same result by using GROUP BY as shown below:

select city,lastname from DuplicateTest
group by city, lastname

If you look at the original data, there are two users with same Lastname (Singh) who live in the same city (Birmingham). With the DISTICT keyword you get one unique row. Let's now add another column to our SELECT query.

select DISTINCT City,Lastname,Postalcode from DuplicateTest

This returns:

City Lastname PostalCode
Birmingham Singh B263SP
Birmingham Singh B283SP
Liverpool Smith L324JK
London White EC224HQ
Manchester whitehood M236DM

You will notice now that you are seeing two rows with the same lastname of Singh. This is because their 'Postalcode' is different, and the addition of that column makes the rows unique.

Again you will get the same result using GROUP BY as shown below:


select city, lastname, postalcode
from DuplicateTest
group by city, lastname, postalcode

Let's look at another example where you can use DISTINCT on multiple columns to find duplicate addreses. I've taken this example from the post. Please refer to this post for more detail.

SELECT PostCode, COUNT(Postcode)
FROM
(
SELECT DISTINCT Address1, Address2, City, Postcode
FROM AddressTable
) AS Sub
GROUP BY Postcode
HAVING COUNT(Postcode) > 1

Or you can use GROUP BY as follows:

SELECT Address1,Address2,City,PostCode,Count(PostCode)
FROM AddressTable
GROUP BY Address1,Address2,City,PostCode
HAVING Count(PostCode) > 1

In both of these cases, we are using DISTINCT to find those rows that are duplicates, based on the columns we include in the queries.

DISTINCT can also be used to get unique column values with an aggregate function. In the example below, the query gets the unique values of reorderpoint and then does a SUM.

USE AdventureWorks
GO
SELECT SUM(DISTINCT ReorderPoint) as DistinctSum
FROM Production.Product
GO

Result: 1848 rows

In the example below query is doing a SUM of ReorderPoint including the duplicates.

SELECT SUM(ReorderPoint) as WithoutDistinct
FROM Production.Product
GO

Result: 202287 rows

As you can see from the above two examples the importance of DISTINCT with an aggregate function. The user could end up un-knowingly using completely incorrect SUM had he used the result from the second query if the requirement was to get the SUM of unique values of ReorderPoint.

The purpose of the article was to show a user simple usage of DISTINCT. I hope you would find this article useful.

Sunday, September 19, 2010

Good Backlinks for your website

What are Backlinks?
Backlinks are links on other websites pointing at your website. Without adequate links pointing at your website it will likely never achieve higher keyword ranking.
How to Find Good Backlinks
Website ranking involves more than just putting your website online. The old addage, "Build it and they will come" is no longer true. You need to not only have quality content on your website but also focus on getting good backlinks but also relevant backlinks. The kind of links you gather and where the link is placed on the other site will also determine the amount of traffic you get and your ranking in the search engines.

Google and Yahoo rank websites according to how many quality backlinks they find pointing at your website. Quality is determined by how relevant the other site is to your site and where the link is placed on their page (within the content is best) and how many other links are on the page (less is better). A large number of links pointing at your site does not guarantee success. You need quality backlinks in order to rise to the first page of results and the more you can find the better.

Google started devaluing traded links in Fall of 2007 and started penalizing directories that used dishonest means to raise their own PR so they could sell links. Google penalized those directories by dropping their PR (Page Rank) to Zero and Keyword Rank so far that they didn't even rank for their own business name. This also affected the rank of sites that bought links from those directories because their link count dropped.

If you have been buying links from directories and your PR or keyword rank is dropping it may be because of Google penalizing those directories. This causes those sites to put rel="nofollow" on the links to protect themselves, thus you are no longer credited for those links you bought which reduces your PR and thus your Keyword Rank.

Google also penalizes sites for getting involved in Triangular Linking Schemes, i.e., "I'll link to your site from my site if you link to my other site" (they do this so it doesn't look like a link trade but Google knows how to spot these also).

Therefore the best way to encourage people to link to your content is to provide information that is useful to your visitors.

What are Quality Backlinks?

* Few links on a page
* A link within the body content
* Link from a relevant site

Google recently changed it's algorighym so that if there is an excess of traded links, purchased links, or if you get involved in triangular linking schemes, or buy hundreds or thousands of links all at once, then it will draw a red flag for Google and then Google may apply a filter to your site to prevent it from ranking well.

An occasional, relevant link trade is ok and having to buy a link in Yahoo directory or another directory that is human reviewed where you have to pay for the review (and not the submission) is OK, but anything in exess can cause you problems with your ranking in Google because they can tell when link gathering is not normal.

Google is having to do this due to too many finding some new trick that helps their keyword rank (like hidden text) and then everyone else follows suit and then Google has to clamp down on that practice — until next time someone comes up with a "bright idea".

So anything you do to try and manipulate your rank in Google can draw a red flag and your site could be banned, penalized or have your keyword rank filtered out, i.e., you won't be able to rank for anything no matter what you do.

Best Linking Practice
The best, and easiest, method to gather links is to provide something on your website that people will want to link to, i.e., if you build bridges offer free bridge building plans, if you sell dessert products offer free recipies of products you don't offer, if you provide a service write up a FAQ about your service, etc. You can also provide a service or product for free if they will provide a backlink to your site . On LWD, I provide a lot of HTML tips, Css Tips, graphics tutorials and articles on keyword ranking and other topics which bring in a lot of my traffic and backlinks without my even asking.

Finding Backlinks For Your Website
Find friends, businesses, individuals, or organizations who are willing to link to your website as soon as it's online, then you won't need to submit to search engines because the search engines can find your link on a site they have indexed already. Some of them may require a link trade but try to get mostly one-way links.

Find Good Backlinks
Google uses age of the site, backlinks as well as PR to rank sites (along with many other factors) so, unless you want to PayPerClick for the life of the site, you need to get gather a lot of links and write a lot of content to get rank as high as possible.

Look for websites relevant to what your site offers but have a different focus, i.e., submit to a gardening site if you sell garden tools.

Another way to find good backlinks is to search for your major keyword in your favorite search engine and take note of which of your competitors is ranking highest. Then search for their domain name and look for sites that have accepted their link then try and submit your website there also.
Other Methods of Getting Good Backlinks

* Find Directories in Your Own Niche Submit to directories in your own niche, i.e., if you sell or offer information about vitamins then look for directories focused on health products.

* Free Submission Directories If you aim for free submissions from directories you may need to request about 10 times as many backlinks as you actually need as very few free links are accepted by directories claiming to accept free submissions. They do this so they won't be penalized for only offering paid links. When submitting, change your anchor text (title of your site) frequently so there is a wide variety of keywords to rank for, however you will probably have to pay for anything other than your official site name.

Also see:
Directories that Pass PR
and
Directories to Avoid
* Write Articles Write quality articles related to the focus of your website and submit to other sites. Provide a link within the article to your site related to the focus in the article -- not necessarily your home page. Do NOT post the same article on your own website or you may be penalized for duplicate content.

* Submit Press Releases Only submit press releases when you have a valid reason for one--any new development on your site or an original focus with your products that the customers on the press release will be interested in.

* Blogging Set up a blog on a separate site related to the topic of your site and provide information of value to your visitors (that you don't provide on your own site) with a link to your website within the post where appropriate. Don't link from your website to your blog or it will be discounted.

* Participate in Forums Find forums related to your website's focus and post often so you will get noticed and build up trust so people will click on the link in your profile or signature and possibly link to your site from their own site or in other forums showing where they found valuable information. Most forums now put a rel="nofollow" on all outgoing links so this may not benefit you other than getting some traffic.

How Many Backlinks is Enough?
That depends on your major keywords. Are they popular? If so, you will have a struggle to beat your competition and may have to resort to PayPerClick along with backlinks.

If very few websites advertise what you offer then you may not need very many backlinks to rank high in the search engines but your traffic may still be minimal because of your site being so specialized. In that case diversify and add more information.

Getting Backlinks is an On-going Process
Your backlinks need to be replenished each year because some sites along with their backlinks go offline. Your competitors are probably eagerly seeking more backlinks to outrank you so unless you actively seek more backlinks each year your rank may drop.

Also see
Backlinks to Avoid
and
Keyword Ranking Strategy
Pay Per Click is only temporary
Getting good quality backlinks is a lengthy process and can take several months--unless you want to utilize PayPerClick (Google's AdWords) and then it can achieve almost immediate results but those results will end as soon as you quit paying so it's a good idea to gather links at the same time.

If you would like your web site analyzed for keyword ranking please check out the Website Evaluations page. If you are looking for a web designer see the How to Find a Web Designer page first.

Monday, July 12, 2010

GZip compression with ASP.NET Content

After I posted the GZip Script Compression module code a while back, I’ve gotten a number of questions regarding GZip and compression in ASP.NET applications so I thought I show a couple of other ways you can use the new GZipStream class in ASP.NET.


The beauty of this new GZip support is how easy it is to use in your own ASP.NET code. I use the GZip functionality a bit in my WebLog code. For example the the cached RSS feed is GZip encoded which uses GZipStream on the Response.OutputStream fed to an XmlWriter():



Response.ContentType = "text/xml";



Stream Output = Response.OutputStream;



if (Westwind.Tools.wwWebUtils.IsGZipSupported())

{

GZipStream gzip = new GZipStream(Response.OutputStream, CompressionMode.Compress);

Response.AppendHeader("Content-Encoding", "gzip");

Output = gzip;

}



Encoding Utf8 = new UTF8Encoding(false); // No BOM!

XmlTextWriter Writer = new XmlTextWriter(Output,Utf8);



Writer.Formatting = Formatting.Indented;



Writer.WriteStartElement("rss");



…



Writer.WriteEndElement(); // rss



Writer.Close();

Response.End();





GZipStream is a stream acts like a stream filter so you can assign it to an existing stream like ResponseStream can intercept all inbound data then write the updated data into the actual Response stream. It’s super easy to do.



You should always check however if GZip is enabled which is done by this helper method IsGZipSupported() which looks like this:



///

/// Determines if GZip is supported

///


///

public static bool IsGZipSupported()

{

string AcceptEncoding = HttpContext.Current.Request.Headers["Accept-Encoding"];

if (!string.IsNullOrEmpty(AcceptEncoding) &&

AcceptEncoding.Contains("gzip") || AcceptEncoding.Contains("deflate") )

return true;

return false;

}



This ensures that you don’t encode content when the client doesn’t understand GZip and would be unable to read the encoded GZip content. Note that the code checks for either gzip or deflate so this assumes before encoding you’ll pick the right encoding algorithm.

GZip in Page Content

Speaking of encoding - above was XML and raw ResponseStream encoding, but you can also apply GZip content very, very easily to your page level or any ASP.NET level code (such as in an HTTP handler). In fact, you can use a very generic mechanism to encode any output by using a Response.Filter which the following helper method (also in wwWebUtils) demonstrates:



///
/// Sets up the current page or handler to use GZip through a Response.Filter
/// IMPORTANT:
/// You have to call this method before any output is generated!
///

public static void GZipEncodePage()
{
HttpResponse Response = HttpContext.Current.Response;

if (IsGZipSupported())
{
string AcceptEncoding = HttpContext.Current.Request.Headers["Accept-Encoding"];
if (AcceptEncoding.Contains("deflate"))
{
Response.Filter = new System.IO.Compression.DeflateStream(Response.Filter,
System.IO.Compression.CompressionMode.Compress);
Response.AppendHeader("Content-Encoding", "deflate");
}
else
{
Response.Filter = new System.IO.Compression.GZipStream(Response.Filter,
System.IO.Compression.CompressionMode.Compress);
Response.AppendHeader("Content-Encoding", "gzip");
}
}

// Allow proxy servers to cache encoded and unencoded versions separately
Response.AppendHeader("Vary", "Content-Encoding");
}



You can now take this helper function and use this in page level code. For example, the main page in my blog which is HUGE (frequently around 500k) uses it like this:



protected void Page_Load(object sender, EventArgs e)

{

wwWebUtils.GZipEncodePage();



Entry = WebLogFactory.GetEntry();



if (Entry.GetLastEntries(App.Configuration.ShowEntryCount, "pk,Title,Body,Entered,Feedback,Location") < 0)

throw new ApplicationException("Couldn't load WebLog Entries: " + Entry.ErrorMessage);



this.repEntries.DataSource = this.Entry.EntryList;

this.repEntries.DataBind();

}



That’s it. One line and the page will now conditionally GZip encode if the client supports it.



If you really wanted to you can take this even one step further and create a module that automatically sets the Response.Filter early in the pipeline and based on that automatically compresses all content.



However, remember GZip encoding applies compression on the fly so there’s some overhead in the GZip encoding – you are basically adding more CPU processing to your content to reduce the output size. If your content is not that large to start with there’s probably not that much sense in compressing in the first place so I don’t think that whole-sale compression of dynamic content is a good idea.


Caching

But one thing that can mitigate the overhead of GZip compression is caching.



Ah yes, both the RSS feed and the home page are usually heavily cached – the content doesn’t change all that frequently so there’s no reason to keep re-generating it right? If you use GZip on your content you have to be careful to cache both the GZipped content and the non-encoded content or else you’ll feed garbage to clients that don’t understand GZip.



So for example the default page has:



<%@ OutputCache Duration="60" VaryByParam="none" VaryByCustom="GZIP" %>



And then a custom Global.asax handler that looks like this:



public override string GetVaryByCustomString(HttpContext context, string custom)

{

if (custom == "GZIP")

{

if (Westwind.Tools.wwWebUtils.IsGZipSupported())

return "GZip";

return "";

}



return base.GetVaryByCustomString(context, custom);

}



Which results in possibly two different versions of the GZipped page being cached.



And there you have it - GZipped content is easy to create now in ASP.NET 2.0/.NET 2.0 and if judiciously applied it can save some significant bandwidth. On my homepage which is close to 500k of blog text content (gotta review that) the GZipped size is 55k or so – nearly a 90% reduction in size. I’d say that’s plenty of worth it, especially when caching is added.

Sunday, April 11, 2010

Image resize code in c#

public byte[] imagereduce(System.Drawing.Image imgInput, int maxImageSize)
    {
        int tWidth;
        int tHeight;
        double widthHeightRatio = (double)imgInput.Width / (double)imgInput.Height;
        // If width greater than height, then width should be max image size, otherwise height should be.
        // Image should keep the same proportions.
        //tWidth = maxImageSize;
        //tHeight = (int)(maxImageSize / widthHeightRatio);
        if (widthHeightRatio > 1.0)
        {
            tWidth = maxImageSize;
            tHeight = (int)(maxImageSize / widthHeightRatio);
        }
        else
        {
            tWidth = (int)(maxImageSize * widthHeightRatio);
            tHeight = maxImageSize;
        }
        //Session["imgheight"] = tHeight;
        //Session["imgwidth"] = tWidth;
        System.Drawing.Image.GetThumbnailImageAbort myCallBack = new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
        System.Drawing.Image myThumbnail = imgInput.GetThumbnailImage(tWidth, tHeight, myCallBack, IntPtr.Zero);
        //System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(myThumbnail);

        //gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
        //gr.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
        //gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;

        //System.Drawing.Rectangle rectDestination = new System.Drawing.Rectangle(0, 0, tWidth, (int)tHeight);

        //System.Drawing.Imaging.ImageCodecInfo codec = System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders()[1];

        ////Set the parameters for defining the quality of the thumbnail... here it is set to 100%
        //System.Drawing.Imaging.EncoderParameters eParams = new System.Drawing.Imaging.EncoderParameters(1);
        //eParams.Param[0] = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L);

        //gr.DrawImage(myThumbnail, rectDestination, 0, 0, tWidth, tHeight, System.Drawing.GraphicsUnit.Pixel);
        ////myThumbnail.Save(Server.MapPath(sSavePath + sThumbFile));
        System.IO.MemoryStream ms = new System.IO.MemoryStream();
        //myThumbnail.Save(ms, codec,eParams);
        myThumbnail.Save(ms, ImageFormat.Jpeg);
        byte[] bitmapData = ms.ToArray();
        return bitmapData;
    }
    public bool ThumbnailCallback()
    {
        return false;
    }
    public bool checkext(string ext)
    {
        ext = ext.ToLower();
        if (ext == ".jpg"){return true;}
        else if (ext == ".bmp"){ return true;}
        else if (ext == ".gif"){ return true;}
        else if (ext == "jpg") { return true;}
        else if (ext == ".png")
        {
            return true;
        }
        else if (ext == ".jpeg")
        {
            return true;
        }
        else if (ext == "png")
        {
            return true;
        }
        else if (ext == "bmp")
        {
            return true;
        }
        else if (ext == "gif")
        {
            return true;
        }
        else if (ext == "jpeg")
        {
            return true;
        }
        else
        {
            return false;
        }

    }

--
www.cinehour.com

Wednesday, April 7, 2010

DATE MANIPULATIONS IN T-SQL QUERIES

Many times when working with date types in SQL we need to remove the time portion and leave just the date. There are a number of ways to accomplish this, but this article will focus on my favorite, the DATEADD/DATEDIFF (hereafter referred to as DADD) method.

For a long time, I knew about this method but I could never remember exactly where all the commas and zeroes and parens and everything went (I always had to look it up) and so I didn't always use it. Until I really sat down and looked at it and figured out how it worked, it was very hard to remember. With this article, I intend to explain the concept behind the method,give quite a few useful examples of how to apply it and a couple of the things to watch out for with it.

My most common usage involves stripping the time portion off of a day or GETDATE(). The DADD method of doing that is:

SELECT DATEADD(dd, DATEDIFF(dd,0,GETDATE()), 0). 

I'm writing this article on February 27, 2010 and as of right now,

GETDATE() = 2010-02-27 17:31:42.670
DADD: = 2010-02-27 00:00:00.000

While that may appear a bit bewildering at first, it's really quite basic. Let's break it down. First, take the inner DATEDIFF portion.

SELECT DATEDIFF(dd,0,GETDATE()) = 40234

What this portion is doing is figuring out the number of days that have passed between 0 (If you cast 0 as a date in SQL you get 01/01/1900) and today. That number is 40234.

The second portion of the equation is adding that number of days to 0. Because it is only adding the days and not the time portion, you get the very start of the day. With that in mind, it's a bit easier to remember the entire thing because you can just start from the datediff and add the dateadd. You're figuring out the number of days between 0 and today and then adding that back to 0.

DATEDIFF(dd,0,GETDATE()) -- Days between 0 and Today
DATEADD(dd, , 0) -- Add that number of days back to 0

The same concept works for many different time calculations. For instance, you can sub out Days for Week, month or Year:

SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 0)
--: 2010-02-22 00:00:00.000 First day of the week.

SELECT DATEADD(mm, DATEDIFF(mm,0,GETDATE()), 0)
--: 2010-02-01 00:00:00.000 First day of the month.

SELECT DATEADD(yy, DATEDIFF(yy,0,GETDATE()), 0)
--: 2010-01-01 00:00:00.000 First day of the Year.

You can use a value other than zero in the dateadd portion to add or remove time. The below adds or removes 2 days. Because you're literally adding days, you don't need to worry about whether or not you cross over into a different month.

SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 2) 
--: 2010-03-01 00:00:00.000 Start of the day 2 days from now

SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), -2)
--: 2010-02-25 00:00:00.000 Start of the day 2 days ago.

Note that if you change the values that are 0's in all of these, you are only offshifting by days. What if you want to add/subtract a week or month? You can do that by adding it right after the datediff portion.

SELECT DATEADD(mm, DATEDIFF(mm,0,GETDATE()) +2, 0) 
--: 2010-04-01 00:00:00.000 Start of the Month 2 Months from now.

In case you were wondering, this DOES work even if the days would have overflowed. For instance, adding a month to January 31 would still give you February.

SELECT DATEADD(mm, DATEDIFF(mm,0,'20100131') +1, 0) 
--: 2010-02-01 00:00:00.000 Start of next Month

You can use the 'first' theory to find the 'last' of something else. For example, if you wanted the last day of the prior month, you can start with the first day of the month and then subtract a day.

SELECT DATEADD(mm, DATEDIFF(mm,0,GETDATE()), 0) 
--: 2010-02-01 00:00:00.000 First day of the month.

SELECT DATEADD(dd,-1, DATEADD(mm, DATEDIFF(mm,0,GETDATE()), 0))
--: 2010-01-31 00:00:00.000 Add -1 days (Subtract a day).

You could also have just added the number of months to -1 days, effectively subtracting a day here.

SELECT DATEADD(mm, DATEDIFF(mm,0,GETDATE()), -1) 
--: 2010-01-31 00:00:00.000 Add -1 days (Subtract a day).

When you go smaller than a day you can find the "end" of a day by using milliseconds* (SQL 2000/2005) or (if you use datetime2) microseconds/nanoseconds (SQL 2008). It is very important to note when doing this that the datetime data type is only accurate to 3 ms, not to 1. Subtracting 1 or 2ms here would do nothing as it would round back up to the start of the next day. With Datetime you will only ever have .990,.993 and .997 for ms. If you use datetime2 (available in SQL 2008), you can be accurate to 100 ns. By default though, GETDATE() resolves to a datetime data type and you have to cast/convert the value before you can use mcs or ns with dateadd.

SELECT DATEADD(ms,-3, DATEADD(dd, DATEDIFF(dd,0,GETDATE()), 0)) 
--: 2010-02-26 23:59:59.997 End of the Previous Day(Datetime)

SELECT DATEADD(ns,-100,CAST(DATEADD(dd, DATEDIFF(dd,0,GETDATE()), 0) as datetime2))
--: 2010-02-26 23:59:59.9999999 End of the Previous Day (Datetime2)

While the above queries get you as close to the end of the day as possible for the appropriate types, it is usually advised that you avoid this all together whenever possible. For example, if you wanted all the values for today's date, instead of using >= the start of the day and <= the end of the day, it is recommended that you use >= the start of the day and < the start of tomorrow. This protects you in situations where the types can become more accurate than you were taking into account before. For instance, if datetime became accurate to 1ms (or the field was changed to a datetime2 field) and you were using this method, your queries would suddenly have the potential to miss data for just under 2ms each day.



--
www.cinehour.com

Friday, April 2, 2010

SEO LINK Building

The SEO Tutorial: Link Building


Search engines have always been the primary way of finding information on the internet. And once upon a time, these search engines were many and had names like Lycos, Altavista, and Hotbot. Furthermore, these engines all worked very similarly, listing their results based mostly on website content and keyword use. Of course, this made the results fairly easy to manipulate -- you only had to stuff more keywords in your meta tags and on your webpage. Then one day, a new search engine arose, one with the curious name of Google. Google decided that the current way of finding the best results was lacking. So they focused on a new technique: they began looking at the links that came into your website. Each link, they figured, was a "vote" for your site; the more people that "voted" for your site, the more likely it was that your site was useful and should be listed high in the results for the keywords that linked to it. Thus began the rise of Google, as webmasters tried a multiplicity of ways to get links to their site. A few years back, many sites could manipulate this new link aspect simply by trading links with hundreds of others. But as all smart companies do, Google adapted and nowadays, all links to your site are analyzed to find out what quality of "vote" each link is. In other words, the more quality links you get to your site, the better your site does. So with that in mind, let's consider two points: first, what makes a quality link, and second, how you get these links.


What makes a quality link
Here are a few key aspects of a good inbound link. Some of these aspects are out of your control, but you can still improve how people choose to link to you:


How to get quality links
So how do you get sites to link to you? Or rather, how do you get quality sites to link to you?

Directory Links - This is the easiest way to get links, but perhaps the worst. Do not submit your site to 200 directories -- those links are usually worthless and associate your site with low-quality sites. However, submitting your site to a few quality directories is advised (you can sort of determine a site's quality by their Alexa rating). Directories like JoeAnt.com and BlogCatalog.com fall into this category of "free high-quality directories."

Social Links - When you think you have a great piece of content, submit it to the socialsphere -- sites like Digg, Reddit, del.icio.us, StumpleUpon, and any smaller social sites you know of. Don't bank on hitting it big, but you never know, and furthermore, you will still get a little traffic. Also, on any forums or blogs you are active on, make sure your signature file has a link. Just don't become a forum/blog/comment spammer. It doesn't work, makes you and your site look bad, and takes away time from building good links.

Ask for Links - If you have friends online (and most people do), why not ask for a link? Most people are kind enough to do so and it's rather easy. It gets a bit tougher when asking strangers for links, but if you have some sort of "social link" (members of the same forum, similar website focus, etc.), write a quick email asking for a link. If they like your content, they might link to you -- just don't ask them more than once and stay transparent (anything else is usually insulting).

Pay for Links - In recent years, this has become a popular mode of link-building, although Google frowns upon it (and in a recent Page Rank update, has punished various websites for participating). So proceed with caution, but know that many people use this option. You just have to search for "paid text links" to find a slew of services and information. (There are exceptions to this rule: sites like Best of the Web and Yahoo provide paid listing/reviews that actually do help you in SEO.)

Link Bait - The current buzzword of link-building, "link bait" is any content that gives people reason to link to you. What makes good link bait? Contests, free stuff, great articles (like "101 ways to _______"), or anything else people find worth linking to. Of course, make sure your great idea gets in front of people by utilizing the social websites and any contacts you might have in the industry.


--
www.cinehour.com