Microsoft Most Valuable Professional

Chris Pietschmann

An MVP From Wisconsin

Virtualization on the Desktop: VirtualPC 2007 and Hyper-V

About a year ago I started to use VirtualPC 2007 on my Vista x64 box to allow me to run other instances of OS's within isolation without requiring me to purchase anymore hardware for my desk. It's actually rather simple to do and makes it extremely easy to roll back any of your systems to a previous state in case they get screwed up by installing beta software or for any other reason.

Benefits of Virtualization 

To backup a virtual machine, all you do is burn the virtual machines files to a DVD. And, to restore, all you do is copy those backups over the existing files, and things are restored to a previous state. Simple, clean and straight forward.

Also, another benefit to using virtual machines is you only have to install and activate Windows XP or Vista once. Once you've installed and activated, all you need to do to install a new instance is copy the virtual machine files for the "fresh" install from your backup to a folder of their own on your machine and you have a whole new virtual machine to play around with.

How I've been using Virtualization 

One thing that's been lacking in my use of virtualization (using VirtualPC 2007) is the fact that I have still been using the main installation on my machine for my own general purpose (development, testing, some games, etc.) use. And, the only thing I've been using virtualization for, thus far, is for testing out new software or beta software. This is fine and all, but it still puts my machine at risk of getting messed up from the usual install and uninstall of random things, and getting full of alot of software being installed that just plain slows down the machine and such.

What's new in Virtualization?

The latest from Microsoft is Hyper-V for Windows Server 2008. I'm still reading up on exactly what Hyper-V is, and what it's benefit are over Virtual Server 2005 and VirtualPC 2007.

According to Microsoft, Windows Server 2008 Hyper-V is:

"Windows Server 2008 Hyper-V, the next-generation hypervisor-based server virtualization technology, allows you to make the best use of your server hardware investments by consolidating multiple server roles as seperate virtual machines (VMs) running on a single physical machine. With Hyper-V, you can also efficiently run multiple different operating systems -- Windows, Linux and others -- in parallel, on a single server, and fully leverage the power of x64 computing."

Here are some links so you can learn more about Windows Server 2008 Hyper-V:

Windows Server 2008: Virtualization and Server Consolidation
Step-by-Step Guide to Getting Started with Hyper-V
Windows Server 2008 Server Virtualization Webcasts
Microsoft Windows Virtualization Team Blog
Windows Server 2008 Revealed: Hyper-V Virtualization

What I'm looking to do with Virtualization

Lately, I've been thinking about using Windows Server 2008 as the host OS on my main machine and using Vista and XP as guest OS's using virtualization. I'm looking to break out each of the roles I perform into separate virtual machines. So, basically I'm looking to having virtual machines for the following roles:

  • Development - Mainly Visual Studio and SQL Express using Vista
  • Testing - Probably have two virtual machines for this, one Vista and the other XP
  • General Purpose - Mainly Office 2007 and CD/DVD burning software
  • Playground - Use for testing new software and beta/alpha software. Probably have a couple VM's for this, including one with Visual Studio for testing out "found code" and open source code downloaded from internet.
  • Gaming - Install any games I play here

You may be thinking that I could use Virtual Server 2005 to do this, but it doesn't support Vista as the host OS and you can't see Vista's "Aero" Glass while using remote desktop from a non-Vista OS. And, I just plain like the way Vista looks, so that's out of the question.

I can use VirtualPC 2007 with Vista as the host OS to do all this, and everything will be just dandy. However, since we now have Windows Server 2008 and Hyper-V, I might as well look at that as an option.

I'll post an update once I decide what I'm going to do to fill my virtualization needs.
But until then, if you have any virtualization suggestions and/or tips using VirtualPC, Virtual Server or Hyper-V, please post them in the comments.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: General
Posted by crpietschmann on Monday, April 28, 2008 5:11 PM
Permalink | Comments (4) | Post RSSRSS comment feed


Virtual Earth Resources

Here's links to some excellent resources for MS Virtual Earth development:

Virtual Earth Concepts by Mike Garza
These are some excellent concept examples for building rich user experiences with Virtual Earth. Some of the examples include: Draggable Shapes/Pushpins,  Select plotted Shapes using a Selection Box, and Sidebar listing plotted Shapes that highlights the Shape on the map when hovered over. Today he just posted two new examples of adding Drag Handles to Polygons and Polylines to allow the user to easily move/resize the shapes using the Mouse. These are some really excellent example!

ViaVirtualEarth and ViaWindowsLive
Both of these sites are run by the same guys, but both contains some really excellent articles. I don't know if they are still updating ViaVirtualEarth, I believe ViaWindowsLive was created as a replacement.

Virtual Earth Interactive SDK
This is the official interactive SDK for Virtual Earth. I should need to list this since everyone probably already knows about it, but it's such a great resourec I can't leave it out.

Virtual Earth Forums on MSDN
These are the official Microsoft forums for Virtual Earth development

Virtual Earth 3D Team Blog
This is the new blog started by the Virtual Earth 3D Team. It already has a couple nice articles. I hope they keep this one up and keep adding content.

Hannes's Virtual Earth Blog
He has alot of code posted on various topics working with Virtual Earth. Definately a nice resource.

Keith Kinnan's Blog
There is alot of Virtual Earth content posted here. An excellent resource.

And lastly...
You can find a bunch of the articles I've written myself in the Virtual Earth category of my Blog.

If you know of any resources not listed here, please post them in a comment. Happy Mapping!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Virtual Earth
Posted by crpietschmann on Friday, April 25, 2008 2:52 PM
Permalink | Comments (0) | Post RSSRSS comment feed


Virtual Earth: Center Map to Shape during OnClick Event

Here's a short, simple example of wiring up Virtual Earth to zoom/pan the map to showing the best fit to center on a specific Shape object that is clicked on by the user.

This example works in both 2D and 3D map modes.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1"></script>
<script type="text/javascript">
var map = null;


function GetMap()
{
    map = new VEMap('myMap');
    map.LoadMap();



    /// Attach a handler to the Maps OnClick Event


    map.AttachEvent("onclick", Map_OnClick);


 


    /// Add a couple Pushpin Shapes to the map


    var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(49.74999, -99.71));
    shape1.SetTitle("Shape 1");
    shape1.SetDescription("Test Shape 1");
    map.AddShape(shape1);


    var shape2 = new VEShape(VEShapeType.Pushpin, new VELatLong(39.74999, -96.71));
    shape2.SetTitle("Shape 2");
    shape2.SetDescription("Test Shape2");
    map.AddShape(shape2);


    /// Add a Polygon Shape to the map


    var shape3points = new Array();
    shape3points[shape3points.length] = new VELatLong(37.74999, -99.71);
    shape3points[shape3points.length] = new VELatLong(37.74999, -110.71);
    shape3points[shape3points.length] = new VELatLong(32.74999, -111.71);
    var shape3 = new VEShape(VEShapeType.Polygon, shape3points);
    shape3.HideIcon(); // Hide the Polygons Icon Image
    map.AddShape(shape3);


}


function Map_OnClick(e)
{
    // Check if a Shape was clicked
    if (e.elementID != null)
    {
        // Get a reference to the Shape that was clicked
        var shape = map.GetShapeByID(e.elementID);


        // Set the MapView to the Shapes collection of VELatLong points
        // This will zoom and pan the map to the best view to show all the points of this Shape
        map.SetMapView(shape.GetPoints());
    }
}
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
</body>
</html>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Virtual Earth
Posted by crpietschmann on Thursday, April 24, 2008 10:02 PM
Permalink | Comments (0) | Post RSSRSS comment feed


Alpha Geeks Are Still Joe Schmoe! And the Community Leads Itself.

There's been some major discusson back and forth the last few weeks on the state of the .NET Development Community. I even wrote a little on it myself almost a month ago.

Today, I've come to the conclusion that the misconception of the fact that "Alpha Geeks Are Still Joe Schmoe", is in fact the real problem. And the majority of the community hasn't yet realized that in fact they are the ones leading the community in new directions.

Alpha Geeks Are Not Special!

There are alot of "regular" geeks out that seem to think that the community declared Alpha Geeks are somehow better than they are. Because of this, the "regular" geeks flock together to follow the Alpha Geeks and try to put to practice what they are preaching. Some do this so much, they bounce around like a rubber ball as they switch from one preaching to the next as the Alpha Geeks change topics to focus on.

I, myself, used to be one of those geeks that thought this. Over the last couple of years, I've realized that these so called "Alpha" Geeks aren't any different from you or I.

Alpha Geeks Are Still Joe Schmoe!

Once you realize this simple statement, things become a bit simpler. Now, you may be thinking "yeah, duh. That's obvious", but just sit and think about this for a minute.

The ones considered Alpha Geeks in our community are the celebrities of our community, just like in hollywood. The average joe never considers the celebrity as an equal. They always look up to the celebrity and idealize them. This same thing happens with Geeks and Alpha Geeks!

You must realize that the Alpha Geeks are still Joe Schmoe (just like you or I)! Once you realize this, it'll free you up from thinking you must listen and do everything they say. Instead you'll further question what they are preaching, and decide how much, if any, you will follow. And, by doing this you may come up with your own new ideas.

Who's Really Leading The Community?

Now that we've realized that Alpha Geeks aren't really Alpha at all... Who's really leading the community?

The answer to this is simple.. The Community is!

No matter who comes up with the new ideas, the community is still driving the direction of things in the end. If the community doesn't adopt that new development methodology; then the community wont be using it. Plain and simple.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: General
Posted by crpietschmann on Monday, April 21, 2008 7:53 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Deeper in .NET 2008 is less than 15 hours away!

Deeper in .NET 2008 is less than a day away. It's tomorrow already! I am probably more excited about DiDN this year since we didn't have one last year, but it's still going to be awesome.

Do you want to learn about some really awesome stuff?  

Do you want to meet and talk with some of the best developers in the community?

If you said yes to either of the above questions, then you wont want to miss out. If you haven't signed up yet, that is ok, you can still sign up at http://deeperin.net. And remember, it's FREE!

You wont only be learning about some really awesome stuff or be able to meet and talk with some of the best developers in the community... You may even be able to win FREE stuff (door prizes), or even meet (in person) the presenters.

There is also an Attendee Party that will be held after the event. I don't know if you can still register; there is very limited seating at this one. But if you would like to attend this as well, just go to http://deeperin.net and see if you can register. Never mind registering for the Attendee Party; registration for it is now FULL. But, you can still register for Deeper in .NET!

I can't wait!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: General | WI-INETA
Posted by crpietschmann on Friday, April 04, 2008 5:17 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Some ASP.NET AJAX Tips and Tricks

I've been using ASP.NET AJAX alot for a while now, so I thought I'd share some of the Tips and Tricks that I've learned though my adventures. Lately, all the buzz has been around Silverlight, but I know there are still a lot of devs out there that can benefit from these tips and tricks.

UpdatePanel Tips

Use UpdateMode=Conditional

By setting the UpdatePanel's UpdateMode property to Conditional, it will only update its contents when one of its triggers occurs or a control within the UpdatePanel itself raises a Postback.

To do this just do the following:

{code:html}

<asp:UpdatePanel runat="server" ID="UpdatePanel_List" UpdateMode="Conditional">

{/code}

Programmatically Tell the ScriptManager to handle a specific controls postbacks asynchronously

Programmatically telling the ScriptManager to raise a Postbacks Asynchronously can be usefull in some scenarios; such as when you may want to optionally enable ajax for certain things on the page.

To do this you just use the ScriptManagers RegisterAsyncPostBackControl method and pass it the reference to the control you want to make asynchronous.

Here's an example page that does this:

Default.aspx

{code:html}

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="UpdatePanel_01_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>
        <asp:Button runat="server" ID="btnShowTime" Text="Show Time" OnClick="btnShowTime_Click" />
        <br />
        <asp:UpdatePanel runat="server" ID="UpdatePanel1">
            <ContentTemplate>
                <asp:Label runat="server" ID="lblTime"></asp:Label>
            </ContentTemplate>
        </asp:UpdatePanel>
  
    </div>
    </form>
</body>
</html>

{/code}

Default.aspx.cs

public partial class UpdatePanel_01_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        /// Make btnShowTime postback asynchronously
        this.ScriptManager1.RegisterAsyncPostBackControl(btnShowTime);
    }

    protected void btnShowTime_Click(object sender, EventArgs e)
    {
        lblTime.Text = DateTime.Now.ToLongTimeString();
    }
}

WebMethods and PageMethods

Using WebMethods

By attaching the ScriptService and ScriptMethod attributes to your WebServices you can enable them to be accessed from within your pages via JavaScript.

Here's a sample WebService with the ScriptService and ScriptMethod attributes attached:

{code:c#}

[System.Web.Script.Services.ScriptService]
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WSTime : System.Web.Services.WebService
{
    [WebMethod]
    [System.Web.Script.Services.ScriptMethod]
    public string GetServerTime()
    {
        return DateTime.Now.ToLongTimeString();
    }

}

{/code}

Then to access the WebService from within JavaScript you need to first tell the ScriptManager about the WebService by giving it a ServiceReference. This can be done declaratively within the page, like so:

{code:html}

<asp:ScriptManager runat="server" ID="ScriptManager1">
    <Services>
        <asp:ServiceReference Path="~/WebMethods/WSTime.asmx" />
    </Services>
</asp:ScriptManager>

{/code}

Now to acess the WebServices methods you just use the namespace that ASP.NET Ajax creates in the page for the WebService and access its methods like normal JavaScript methods. The namespace that is created is the same name as the WebService, in this case it's WSTime. The whole Ajaxiness of calling the server and getting the results back are handled for you, and all you have to worry about is processing the results. Remember, WebMethods can only be called Asynchronously.

Here's an example of using the WSTime.GetServerTime WebService method from within JavaScript:

{code:js}

function btnGetServerTime_Click()
{
    // call the WebMethod and pass it the method
    // to call once it gets the response from
    // the server.
    WSTime.GetServerTime(SucceededCallback);
}
function SucceededCallback(result, eventArgs)
{
    alert(result);
}

{/code}

Using PageMethods

PageMethods are accessed in the same fashion as WebMethods, except they do not require the creation of a WebService. PageMethods are actually WebMethods that are added to the page itself. Once thing to note is there is No way to embed PageMethods within Custom User Controls or Server Controls, they must be added to the Page; hence the name PageMethods.

Here's the C# code of an example page with a PageMethod defined:

{code:c#}

public partial class PageMethods_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    [WebMethod]
    public static string GetServerTime()
    {
        return DateTime.Now.ToLongTimeString();
    }
}

{/code}

To enable the PageMethods you must first set the ScriptManagers EnablePageMethods property to True.

{code:html}

<asp:ScriptManager runat="server" ID="ScriptManager1" EnablePageMethods="true"></asp:ScriptManager>

{/code}

Then you can call the PageMethods in the same way as WebMethods, except the namespace you use to access the methods is named PageMethods.

Here's the example code of calling the above PageMethod from JavaScript:

{code:js}

function btnGetServerTime_Click()
{
    PageMethods.GetServerTime(SucceededCallback);
}
function SucceededCallback(result, eventArgs)
{
    alert(result);
}

{/code}

Conclusion

I hope these couple of tips help in your endeavors with ASP.NET AJAX. When I get time (in between all the other million things) maybe I'll post some more tips.

Also, if you have your own tips, please post them in the comments.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,
Categories: asp.net
Posted by crpietschmann on Thursday, April 03, 2008 9:56 PM
Permalink | Comments (0) | Post RSSRSS comment feed

I am now a Virtual Earth MVP!

This is an exciting April fools day for me. I recieved the following email from Microsoft:

[MVP] Congratulations! You have received the Microsoft MVP Award

Dear Chris Pietschmann,
Congratulations! We are pleased to present you with the 2008 Microsoft® MVP Award! The MVP Award is our way to say thank you for promoting the spirit of community and improving people’s lives and the industry’s success every day. We appreciate your extraordinary efforts in Virtual Earth technical communities during the past year. Microsoft will soon send your MVP Award gift package. It is our way to say “thank you for making a difference."

Wait a minute... Is this some kind of April Fools joke?
No, this is real. I knew I had gotten nominated back in February; Microsoft had contacted me with a few questions regarding my community contributions over the last year. It seemed like forever that I had to wait until I would find out if I would be awarded MVP or not.

One thing that I'm still wondering is: Since you know your nominated, do they tell you if you didn't win?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: General | Virtual Earth
Posted by crpietschmann on Tuesday, April 01, 2008 11:12 AM
Permalink | Comments (5) | Post RSSRSS comment feed

About the author

I'm Chris Pietschmann, go to the About Me page to learn more about me.

Search

Sponsors

Web.Maps.VE - ASP.NET AJAX Virtual Earth Mapping Server Control

Recent comments

Disclaimer


This work is licensed under a Creative Commons Attribution 3.0 United States License, unless explicitly stated otherwise within the posted content.
© Copyright 2004 - 2008 Chris Pietschmann