Thursday, March 24, 2011

What happens when you navigate to a URL?

Browse the net I found a really interesting article about what actually happens when you type in a URL in your browser.

How does the content of website makes its way to your browser for display?

Full Article : http://igoro.com/archive/what-really-happens-when-you-navigate-to-a-url/

In an nutshell:

1. You enter a URL into the browser

2. The browser looks up the IP address for the domain name

image

The first step in the navigation is to figure out the IP address for the visited domain.

3. The browser sends a HTTP request to the web server

image

4. The Facebook server responds with a permanent redirect

image 

5. The browser follows the redirect

image

The browser now knows that “http://www.facebook.com/” is the correct URL to go to, and so it sends out another GET request

6. The server ‘handles’ the request

image

The server will receive the GET request, process it, and send back a response.

7. The server sends back a HTML response

image

8. The browser begins rendering the HTML

Even before the browser has received the entire HTML document, it begins rendering the website:

image

9. The browser sends requests for objects embedded in HTML

image

10. The browser sends further asynchronous (AJAX) requests

image

Friday, March 18, 2011

Upgrade Internet Explorer 1.0 to 9.0

http://www.winrumors.com/man-upgrades-internet-explorer-1-0-to-9-0-video/

Credits go to Andrew Tait

From the same person who made the video about upgrading from windows 1.0 to 7
another nostalgic video taking us way back into Internet Explorers past.

The video shows the install processes and UI for each version of Internet Explorer.

Andrew also tested the various versions at the Acid test pages.

Wednesday, March 9, 2011

Enable Compiler Extensions in .NET 2.0

If you get an error like shown below; this is probably due to the downgrade of a project from .NET 3.5 or higher to .NET 2.0

Cannot define a new extension method because the compiler required type 'System.Runtime.CompilerServices.ExtensionAttribute' cannot be found. Are you missing a reference to System.Core.dll?

Extension methods are a new feature in .NET 3.5 (C#3/VB9) that let you appear to "spot weld" new methods on to existing classes.
If you think that the "string" object needs a new method, you can just add it and call it on instance variables.

But how do we accomplish this in .NET 2.0?

VB.NET

' you need this once (only), and it must be in this namespace
Namespace System.Runtime.CompilerServices
    <AttributeUsage(AttributeTargets.Assembly Or AttributeTargets.[Class] Or AttributeTargets.Method)> _
    Public NotInheritable Class ExtensionAttribute
        Inherits Attribute
    End Class
End Namespace
' you can have as many of these as you like, in any namespaces
Public NotInheritable Class MyExtensionMethods
    Private Sub New()
    End Sub
    <System.Runtime.CompilerServices.Extension> _
    Public Shared Function MeasureDisplayStringWidth(graphics As Graphics, text As String) As Integer
        ' ... 
 
    End Function
End Class

C#



// you need this once (only), and it must be in this namespace
namespace System.Runtime.CompilerServices
{
    [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class
         | AttributeTargets.Method)]
    public sealed class ExtensionAttribute : Attribute {}
}
// you can have as many of these as you like, in any namespaces
public static class MyExtensionMethods {
    public static int MeasureDisplayStringWidth (
            this Graphics graphics, string text )
    {
           /* ... */
    }
}

Thursday, March 3, 2011

Upgrade Windows 1.0 to Windows 7

http://www.winrumors.com/man-upgrades-windows-1-0-to-windows-7-via-every-other-windows-versions/

I stumbled upon this video of a guy upgrading windows from the first until the last version…
Talk about backward compatibility !!!

The movie  shows all details about the installation process of each version of the windows UI from windows 1.0 until windows 7.
The only exception is Windows ME, missing as you can only upgrade to ME or 2000 and not both.

The video creator, Andrew Tait, used VMWare to install each version and started by installing MS-DOS 5.0 to prepare for the Windows 1.0 installation.

If you’re a Windows fan and have 10 minutes free then check-out the nostalgic video below,
thanks to The Next Web for spotting this classic.