August 2005 - Posts

Installing Visual Studio 2005 on Windows XP without SP2

Aaron Stebner explains a couple of little tweaks you can do to install Visual Studio 2005 on Windows XP without SP 2 installed.

I remember when playing around with the betas/CTPs under VMWare/Virtual PC and having to install Service Pack 2 first, thinking do they really require SP 2 or is it just to cut the testing matrix down.

Well it turns out there are not any technical requirements on SP 2; it is more to encourage everyone to upgrade and to reduce the testing. This is important, especially in a corporate environment where the desktop is heavily customised and often lags the service pack releases by 6-9 months due to testing line of business application compatibility.

The steps are:

1. Navigate to the setup subfolder on the VS 2005 DVD and run VS 2005 as follows to skip all prerequisite checks - setup.exe /NO_BSLN_CHECK

Or

1. Launch regedit.exe
2. Go to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Windows
3. Change the CSDVersion value to be 512 or higher (0x0000200 in hexadecimal)
4. Close regedit.exe and install Visual Studio 2005
5. Rerun regedit.exe and change the CSDVersion value back to what it was originally

Use the registry option to install MSDN for Visual Studio 2005.

with 0 Comments

How many lines of code?

Really interesting statistics on the size of Visual Studio 2005 by Mike Stall.

Visual Studio is over 43 million lines of code, there are over 30 teams working on different pieces, with roughly 700 developers checking-in code to 11 different virtual build labs that are then integrated on a rotating schedule producing over 100 different builds of the product daily.

Between that and Windows source code, Microsoft really is building software on a totally different scale to nearly every company.

We've had a very interesting challenge scaling development and testing techniques up to a product of that size. It seems like most methodologies ("You just write unit tests for everything and then you have no bugs") I hear about are really intended for about 5 person teams. If you had a unit test for every 10 lines of code, that's 4 million unit tests. That's would be a lot of unit tests to run before a single check-in.

Also Scott Guthrie talks about the automated testing that goes into ASP.NET which gives another great insight.

It really is a engineering on a different level, especially how Microsoft manages all this development at the same time as issuing hotfixes across all the different product lines.

It's great some of these practises and what Microsoft have learnt are being shared with the outside community.

with 0 Comments

Optical Illusions, XAML and WinFX

I really like optical illusions and this post by Ian Moulster caught by eye.

If you stare at the central +, you should start to see a green circle and then the purple circles will disappear.

Read the full explanation as to why our vision is affected.

Another favourite of mine is Escher's work especially the Drawing Hands and High & Low.

 

Well Ian wondered when someone would produce a version in XAML, so how could I resist! It's been a while since I've played with XAML, previously I did some Data Visualisation using Treemaps under Longhorn.

I had a Virtual PC with Windows XP SP 2 and the WinFX Beta 1 RC Runtimes installed, so I started mocking it together using Chris Anderson's AVPad and everything was going well until I started trying storyboards for animation. I'd try to cut and paste the examples from the documentation and gave a strange errors, like "The Clr property 'Storyboards' is not defined on 'ContentControl' or one of its base classes".

Most probably the issue was related to "...Although all framework elements have a Storyboards property, you can only define storyboards on root elements. Only Window and Page objects can be root elements". Eventually I gave in with AvPad and decided that I ought to install Visual C# express and the full SDK.

So I downloaded the Visual C# Express Beta 2 edition (Beta 2 NOT the latest August build), WinFX Avalon/Indigo (sorry WPF, WCF) Beta 1 RC Runtimes, WinFX SDK & Visual Studio Extensions for WinFX Beta 1. I thought all this wouldn't be too difficult to install as I'd been keeping on eye on the CTP Madness.

But it was about four hours later I actually got things working. So here is the correct order, install Visual C# Express, then SDK, then WinFX and finally the project extensions. I did try the Visual C# Express August CTP but that didn't work and stupidly I also thought the SDK would include the WinFX runtimes.

My intention was to write the whole thing using only declarative XAML so I was more limited in the animations that could be used. Also I had a bit of pain finding another way to set the TargetName aside from the resource style. Eventually I decided on using SetterTimeline with DoubleAnimation over Keyframes, mainly because it seemed easiest. Also getting the correct RepeatBehavior and AutoReverse setting on the individual elements and the paralleltimeline took a little trial and error.

Using Visual C# Express, I chose to create a new Avalon application; Tim Sneath details the choices for application types.

It's a bit hacky using the hardcoded timelines & cut'n'paste code but it works as a quick example. Eventually the XAML looked similar to this:

<Application.Resources>
  <Style TargetType="{x:Type Ellipse}" x:Key="PurpleGradient">
   <Setter Property="Fill" Value="RadialGradient #FFFD19FD #33F932F9" />
   <Setter Property="Width" Value="50" />
   <Setter Property="Height" Value="50" />
  </Style>         
</Application.Resources>

<Window x:Class="AvalonApplication4.Window1"
  xmlns="
http://schemas.microsoft.com/winfx/avalon/2005"
  xmlns:x="
http://schemas.microsoft.com/winfx/xaml/2005"
  Text="AvalonApplication4"
  Background="#B2B2B2" Width="460" Height="460">

<Window.Storyboards>
  <ParallelTimeline x:Name="myMainTimeline" RepeatBehavior="Forever">
   <SetterTimeline TargetName="e1" Path="(Ellipse.Opacity)">
    <DoubleAnimation From="1" To="0" Duration="0:0:0.1" BeginTime="0:0:0" AutoReverse="True" />
   </SetterTimeline>
   <SetterTimeline TargetName="e2" Path="(Ellipse.Opacity)">
    <DoubleAnimation From="1" To="0" Duration="0:0:0.1" BeginTime="0:0:0.1" AutoReverse="True" />
   </SetterTimeline>
   ...

 </ParallelTimeline>
</Window.Storyboards>
 
<Canvas>
 
<Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="89" Canvas.Left="306" Name="e1" />
  <Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="145" Canvas.Left="363" Name="e2" />
  <Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="221" Canvas.Left="385" Name="e3" />
  <!-- 3 -->
  <Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="297" Canvas.Left="363" Name="e4" />
  <Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="346" Canvas.Left="306" Name="e5" />
  <Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="382" Canvas.Left="220" Name="e6" />
  <!-- 6 -->
  <Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="346" Canvas.Left="134" Name="e7" />
  <Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="297" Canvas.Left="77" Name="e8" />
  <Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="221" Canvas.Left="55" Name="e9" />
  <!-- 9 -->
  <Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="145" Canvas.Left="77" Name="e10" />
  <Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="89" Canvas.Left="134" Name="e11" />
 
<Ellipse Style="{StaticResource PurpleGradient}" Canvas.Top="64" Canvas.Left="220" Name="e12"/>
  <!-- 12 o'click -->
  
  <Line Stroke="Black" StrokeThickness="2" StrokeStartLineCap="Square" StrokeEndLineCap="Square"
    X1="240" Y1="235" X2="240" Y2="255"/>

 
<Line Stroke="Black" StrokeThickness="2" StrokeStartLineCap="Square" StrokeEndLineCap="Square"
    X1="230" Y1="245" X2="250" Y2="245"/>

  </Canvas>
</Window>

Was it easier than an animated GIF? No
Was it easier than doing it in Flash? No
Was it easier than doing it as Win32 GDI code? Yes
But hopefully with proper IDE support and
Sparkle it will become easier.

You can download the full source code here.

Now I'm all configured for Avalon (WPF) maybe I should have a go at developing some my Solitaire for Windows Vista ideas!

with 3 Comments

Useful tip to view the current HTML DOM content of a DHTML page

From an old Web Team talking column; when you are adding and changing HTML DOM content client-side via javascript/DHTML you can't view the current page source.

Selecting 'View Source' only gives you the content as it was when the page loaded and not what's currently in memory/rendered in the browser.

This little trick allows you to view the current HTML, paste it in the address bar:

'<xmp>'+document.documentElement.outerHTML+'</xmp>';

(Note: You need to put the word 'java script:' before the line above. Also remove the space between java and script, I had to have it so Community Server didn't block the post)

It's so useful when debugging AJAX code.

with 1 Comments

Visual Studio 2005 Pricing and MSDN Downloads date announced!


Hot from the MSDN UK Product Manager the release dates for Visual Studio 2005 are:

MSDN Subscriptions
17th/18th October available via MSDN Downloads
Will also physically ship in 'December Update CDs', which goes out at the end of November

Volume Licensing Agreements
1st week of November

Retail Store Product (off the shelf)
1st week of December

Estimated retail pricing (in £) is now live at http://msdn.microsoft.com/howtobuy/vs2005/subscriptions/default.aspx.

We've all been waiting a long time for this!

with 0 Comments

Applied .NET and how blogs have opened up Microsoft to developers

I was talking with someone the other day about .NET and especially the CLR, BCL, JIT & Garbage collection

On a day to day basis developing Enterprise Web applications I'm not directly thinking about these things, it is so easy to forget the internals. So I dusted off Applied Microsoft .NET Framework Programming by Jeffrey Richter and started reading up again about Generations 0, 1, 2!

Also I noticed in the Acknowledgements how many names from the .NET framework team I recognised and read their blogs daily:

... Brad Abrams, Chris Anderson, Chris Brumme, Nikhil Kothari ... (to name a few)

As well as that, I started reading Improving .NET Application Performance and Scalabilty again too. It's really a guide that you can dip into and learn something new each time including ASP.NET data binding differences to maxconnection for Web services. Seems like a security guide for ASP.NET 2.0 has just been released so I'll add to the list to read next too.

with 0 Comments

Find out the real phone number for companies

I came across the website SayNoTo0870 today, it lets you search by company name and it will give you the direct local phone number for them.

Useful if you can't find the customer services number anywhere obvious on Amazon.co.uk!

with 0 Comments

Smart Client articles on MSDN and Code Project

Interesting article about writing smart clients on the .NET framework 2 over at the Code Project. The author, Omar Al Zabir also has an impressive web site. Also, MSDN today has a number of hands on labs and information about smart clients.
with 0 Comments

Default button for a textbox in ASP.NET

This trips people up again & again and I tend to have to look it up too, so I'm linking to the solution by Raj Kaimal.

Hitting the enter key in a TextBox can sometimes has undesired effects like the wrong submit Button being “clicked“. The method described below allows you to specify a default Button to submit when the user hits the enter key in a TextBox.

//client side js
function clickButton(e, buttonid) {
      var bt = document.getElementById(buttonid);
      if (typeof bt == 'object') {
            if(navigator.appName.indexOf("Netscape")>(-1)) {
                  if (e.keyCode == 13) {
                        bt.click();
                        return false;
                  }
            }
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)) {
                  if (event.keyCode == 13) {
                        bt.click();
                        return false;
                  }
            }
      }
}

//code behind
TextBox1.Attributes.Add("onkeypress", "return clickButton(event,'" + Button1.ClientID + "')");

The code behind generates the following code:

<input name="TextBox1" type="text" id="TextBox1" onkeypress="return clickButton(event,'Button1')"  />


Also on the web front, Mikhall Arkhipov notes how you can associate "files-behind" in Visual Web Developer. So where you have .gif files that you have sliced from a mockup in Macromedia Fireworks you can associate the original .png file in the IDE. Guessing this is new to Visual Studio 2005?

with 0 Comments

Crazy ideas for Solitaire to evangalise Windows Vista!

To start this post I need to immediately say the following: I don't have any information on plans for Solitaire in Windows Vista (still getting used to not calling it Longhorn) and I'm not talking about Microsoft pulling resources from other teams or important projects, but Solitaire hasn't had a facelift yet.

With that said I'd like to talk about a few crazy ideas I've had about how Microsoft could use Solitaire to evangelise and have people excited about Vista. So please forgive this entry and treat it with a little pinch of salt. As Winsupersite reported on the Longhorn Geeks Bearing Gifts video, good isn't good enough any more.

I've written before about my interest in information visualisation and hopes for Longhorn as part of my CodeProject article on Squarified Treemaps which Chris Sells so kindly commented on!

I'm thinking more around creating a buzz for Beta 2 or the final release because as Robert Scoble rightly mentions Beta 1 is really for developers to get an update on direction before more news at the PDC.

Everyone knows Solitaire, it's probably one of the first applications people used to learn basic mouse skills like drag'n'drop and resizing windows. So what could we do to give it a complete makeover for 2006 and get people saying you have to see this?

There is always a tricky line when altering an application that people know and possibly play quite often. Some UI changes have been discussed before by Chris Sells in his Longhorn Foghorn series and the work on a set of XAML vector graphic cards using Avalon (Windows Presentation Foundation now!) by Adam Nathan in his look at converting Internet Hearts.

Other ideas could be to add a winnable mode as Eric Sink developed in his MicroISV column. Maybe some tie-in with the SmartPhone & PocketPC version?

Multi-player support similar to that already in MSN Messenger. centralised high scores all communicating using Indigo (sorry WCF) as the messaging transport.

Concentrating further on the graphic side of things, let's make the experience more animated with a dealer spreading the cards out on the table and dealing them into columns. I'm not talking about photo realistic graphics but more like an invisible dealer where the cards slide out of a pack.

Let's use the 3D support in Avalon and bump mapping of DirectX for the green felt of the card table. Use different camera angles as noted by Nate Dunlap:

Everytime the slide would change we would move the camera in 3D space and create this dramatic world pivot to accentuate the change. Really got me thinking about how to use that effect to provide user feedback about what has just happened. Maybe small camera movements will highlight small levels of progress but when you hit submit you get a huge camera movement.

Perhaps a top-down view as the cards are dealt and then pan around to a slightly angled view whilst playing.

As the mouse moves over the cards a corner folding technique could be used to see what the next card is.

Different skill levels could be done by how the dealer animations happen, ie. high skill means vegas style shuffling - merging two halves into each other, passing bettwen two hands and lower level more like slowly chopping cards randomly in one hand.

Following the Aero philosophy:

The Aero philosophy is not only to deliver a user experience that feels great but also to fundamentally change the way usability is measured. In the past, Windows focused heavily on usability as defined by such metrics as discoverability, time to task, and task completion. Aero continues to deliver on these metrics, but it will also enable Windows Vista and WinFX applications to generate a positive connection with users on first sight, on first use, and over the long term.

The cards, especially around the edges, could get more of a worn look as you play further games, making the experience longer lasting than just the normal "first-use" wizard style help and more like the Office menus which change to the functionality you use most often.

How about building a swapping community around skinning the card desks, it is certainly a huge craze for mobile phones and seeming the new Xbox 360 too.

What about releasing the source code as OpenSource similar to Wix or at least elements of it as an example of Avalon, Indigo and Longhorn development.

Finally let us improve the end game sequence, here I'm thinkng of combining the 3D Avalon features with a physics engine. For example, using the Havok engine or the Novodex Rocket engine.

Try the Novodex Rocket demo of the Jenga Tower and then think of a card tower. Quick aside: We had fun at the London .NET Usergroup last week playing the XP game with players trying to create 2 story card towers after Graham Brooks' talk.

The user would then be be able to slowly pull at the different cards using the mouse, with real-time rigid body physics deciding when the tower would fall, just as with the Novodex Rocket demo it would be truly satisfying, stress relieving and enjoyable end game.

Ending with all the cards fallen:

Can we implement a physics engine library which could be added using XAML markup within a 3D scene?

As I said at the start I'm not expecting Microsoft to alter Solitaire as described, this has just been my run-away thoughts on how to get people talking about Windows Vista. Nor am I saying I'm about to code these changes myself either! All these suggestions must be taken as ideas, I like everyone else don't want UIs that are too "flashy" and over use 3D just for the sake of it..

In the meantime we can watch the great work by Karsten Januszewski including the demo at the Flash Forward conference, Carter Maslan's concept videos and Tim Sneath's list of Avalon bloggers. So let's all get developing with the WinFX SDK right away!

(Note: Many photos used to demonstrate ideas are from GettyImages)

with 2 Comments