Friday, May 30, 2008

Google Analytics

After adding google analytics to my blog, I was curious to know my site's analytics, I know , I know its too early to look at those numbers.

I really liked the way google analytics gives you feed back about your site.

G analytics generates a report about Visitor loyalty. So, you see I've got 1 time visitors,2 time...4 time...



Looks like I have equal number of Firefox and IE users. 50% IE and 50% Firefox.





What Flash Version are my visitors using, 80% are using 9.0r115 and 20% are using 9.0447



Data about Page visits



Benchmark, this is in Beta stage, gives oyu data about #of Visits, %bounce rate, PageViews, Avg.Time spent on the site, etc....



Traffic Source: It tells you about how people reached your website. So, I've got 60% direct traffic and 40% from either referrer sites or from the search engines.



DashBoard, this is prettly cool. Its got this world map and countries painted in green, which means, those are the countries from where people visited my blog. And you can drill down to each country and then to each state.

These are just few of many features I could find in Google analytics. Its really amazing how google comes up with these new tools. Give it a shot, Iam sure you will appreciate these cool tools as well.

Vista's Features on XP

I know many of us still dont find Vista navigation friendly, and I know many of my colleagues still prefer XP over vista. So, here is a link http://lifehacker.com/389735/get-vistas-best-features-in-xp, which tells you how you can get the best of Vista features on your XP machine.

I use Vista and I agree that there was a bit of learning curve to get used to the new vista, but I love it now, more than xp.

Personally, I would try to get these features on my old XP laptop

  1. Better Explorer , it is so much improved on vista
  2. I love task switching atl-tab, and its 3D
  3. Integrated start menu search, IT IS Intelligent, but Iam so used to using SlickRun, I barely use it, except when I dont bookmark them in slickrun, thats when Integrated search comes to play.
  4. Thumbnail previews, its nice.
  5. and last but not least, Renaming of files, you hit F2,name the file , dont put the extension, it just gets it, cool huh!

so get those features on your XP Box.

Friday, May 23, 2008

301 Redirect

Why do we need a 301 redirect?
I would say, if you have redesigned your website (may be you redesigned using the new .Net 3.5), may be reskinned etc etc...

Will I lose my page ranking if i implement 301 redirect?
No, you wont lose you page rank, 301 is the best method to preserve you page rank while redirecting the traffic to the new webpage.It usually takes 2 weeks for 301's to pass page rank and all related information. It is a SEO friendly redirection

How to implement it?
response.StatusCode = 301;
response.Status = "301 Moved Permanently";
response.RedirectLocation = http://www.newurl.com/;
response.End();

done!

Thursday, May 22, 2008

What is Frame-Busting /Frame-killer

What are Frames used for?
HTML frames (FRAMESETs and IFRAMEs) are a feature of all modern web browsers that enable content from multiple pages to be displayed within a single view. Historically, frames were primarily used to enable partial page updates, where page navigation was contained in one frame, and page content was contained in another. Over time, use of frames expanded to include advertising, mashup, and AJAX scenarios. Today, the majority of popular websites use IFRAMEs for various reasons.

What is Frame Busting?
A framebusting page is a web page that will open your page within a frame from an "external" web page.
What actually happens is your site is aggregated, which is ok, but there is more to it, they will start framing your website and will show "ads" , like they run google adsense beside the pages they stole from you,which is not good. So its your content, he stole your content and added google adsense and all the revenue will go to him.
Besides, your website's pagerank may go down, and I imagine all the stats tagged to google analytics will drop. Also, I read somewhere that it is against the Adsense TOS (Terms of Service).
So essentially they benefit from your content.

How to bust them?
Solution is simple.
Add Frame Busting code, add these three lines of code and it will fix it.
the basic idea is :
if (your site is in someone else's frameset)
{ top frame location = your frameset/homepage}


<script type="text/javascript">
if(top.location != location)
{
top.location.href = document.location.href;
}
</script>

So you have to find out if your site is framed, and if it is you should change the top frame location. Finding out if you're framed is easy, but changing the top frame location is not allowed in Safari, even though all other browsers support it.

That is all it takes to "bust" out of a frame and ensure your site is displayed on top.

Wednesday, May 21, 2008

C#: Shallow Copy

In C#, the shallow copy is also referred as memberwise copy.

A shallow copy creates a new instance of the same type as the original object, and then copies the nonstatic fields of the original object. If the field is a value type, a bit-by-bit copy of the field is performed. If the field is a reference type, the reference is copied but the referred object is not; therefore, the reference in the original object and the reference in the clone point to the same object. In contrast, a deep copy of an object duplicates everything directly or indirectly referenced by the fields in the object.

Refer to this article for more details.

http://blogs.msdn.com/brada/archive/2004/05/03/125427.aspx