Welcome to TechNet Blogs Sign in | Join | Help

I've moved!

Apologies for the slight (well alright, massive) delay since my last post - a lot has happened in the last few months. Not least of which that I've swallowed the red pill and have moved over to developer land, as an Associate Consultant in the Delivery Developer team of Microsoft Consulting Services UK.

So it's farewell to my technet blog and the crazy world of MOM, Monad and Machinima (though I'm sure I'll sneak a play with those things while no-one here is looking). But don't fret, all is not lost - I now have a shiny new blog over at MSDN, where I'll be pondering on such topics as WPF, WF, and exactly how many times I can have a fry-up in the MS canteen before I give myself a heart attack walking to the first floor.

Come over and say hi, don't let me get lonely over there. I promise I'll post more often now that things have settled down a bit :-)

Posted by sthorne | 1 Comments

Mashups?

It's been a while since my last video, but hopefully the wait has been worth it - for this time I have voice actors who aren't me! This time we investigate the highly important question everyone's dying to know; that is - what is a mashup?

(Yes, I know Macs run more than three applications, it's a joke).

Posted by sthorne | 1 Comments

Lock-out

So I managed to lock myself out of my flat this weekend.  Whilst I was stood there shivering in my woefully inappropriate attire, hoping my flatmates would turn up before I ended up a frozen statue, it gave me time to consider how totally reliant we are on technology.  I had no phone, no laptop, no MP3 player, no PSP...I felt naked and totally helpless.  How our forefathers coped without instant mobile communication I don't know...I honestly can't remember the last time I was completely cut off from the world like that.  It got me thinking about how on earth one would survive outside armed only with their wits, you don't realise how totally reliant you are on technology until it's gone.

I imagine a few Second Life residents are also feeling cut-off from their world after this weekend, when Linden Labs had to close their systems temporarily due to a grey goo attack.  For those who aren't familiar with this sort of scenario, it involves a self-replicating entity being unleashed on a system and consuming all available resources.  SL is supposed to have systems in place to prevent this sort of thing but it's difficult to prevent all attacks given the wide amount of flexibility given to script writers.  I believe it's all back up and running now though.

Posted by sthorne | 2 Comments

Free .NET 3.0 online training

For a limited time only you can take part in free eLearning clincs on .NET 3.0, covering Windows Presentation Foundation, Windows Communication Foundation and Windows Workflow Foundation.

Requirements (lifted from the site):

  • Experience (2 years) as a full time developer using Visual Studio 2005 / Visual Studo 2003
  • Experience developing one or more of the following:
    • Web Applications
    • Windows Forms Applications
    • Server Components
    • XML Web Services
Posted by sthorne | 0 Comments

Ms Dewey

If you're bored and in need of some brief entertainment, head over to msdewey.com

Here's a few queries to start you off with:

  • Lord of the Rings
  • Microsoft
  • Axis of evil
  • iPod

There's probably loads of others I haven't found, happy searching.  Don't leave her alone though, she gets bored easily...

Posted by sthorne | 0 Comments

Presenting...

WPF, or Windows Presentation Foundation, is a fundamental component of the new .NET 3.0 framework. It offers a huge amount of potential for creating whizzy new user interfaces, but can be a little daunting to the first time developer. In this post I'm going to show you the building blocks of a basic WPF application.

In order to build a WPF application you need the .NET 3.0 framework and the Windows SDK. It's also helpful if you have Visual Studio - you can build applications from the command-line, but in all these examples I'll be using Visual Studio. You can use Visual Studio 2005, or the free Visual Studio Express products. You can get everything you need from MSDN; it's recommended you install Visual Studio before the framework and SDK. Once you have an appropriate development environment set up, you can begin developing your first WPF application.

Start Visual Studio, and select File -> New -> Project. Under Project types select Visual C# / NET Framework 3.0, and then in the right-hand pane select Windows Application (WPF). Hit OK once you've chosen a name for your new WPF project.

Once you've created your new WPF project, you should see something like the following screenshot.

As with a normal Windows Forms application we have a form on the screen, which we can drag and drop controls onto in order to create our application. However, underneath we also have a bunch of XML code, and this in fact is the markup representation of our form. This markup code is written in eXtensible Application Markup Language, or XAML. XAML is a powerful XML based declarative language, which can be used for defining objects and their properties. Whilst XAML is not specific to WPF, it's primary use is currently in defining the visual elements of WPF applications. External tools can be used to manipulate the XAML in order to create the right visual feel, and this allows the often mixed roles of visual design and development to be conducted seperately by people with expertise in those different areas.

To add controls to your WPF application, you can either use the Rapid Application Development tools that Visual Studio provides you with, or you can modify the XAML directly. Drag and drop a button from the left-hand toolbox onto the form (you may have to hover over the toolbox menu to make it appear). A new button should appear on the form, along with a new line of XAML representing that button similar to the following:

<Button Height="23" Margin="109,110,108,0" Name="button1" VerticalAlignment="Top">Button</Button>

Note that various properties of the button are defined in the button tag's attributes. The button text is defined in the textual content of the Button tag. Changes made to the XAML here will be reflected in the preview window; try changing the button text to 'Hello', and clicking in the Design window to update the form preview.

So we now have a visual aspect to our WPF application, but it doesn't have a great deal of functionality. You may have noticed that there appear to be two files relating to our Window1 class; Window1.xaml and Window1.xaml.cs. The former, Window1.xaml, is what we have been working on so far and typically contains everything relating to the visual style of the application. The functionality is then implemented by the code-behind file Window1.xaml.cs. A feature of C# 2.0 called partial classes is used to combine these two files into a single class, Window1.

Switch to the Window1.xaml.cs window. You should see code similar to the following:

public partial class Window1 : System.Windows.Window

{

    public Window1()

    {

        InitializeComponent();

    }

}

The call to InitializeComponent in the constructor is what processes the XAML and generates the parts of the class that are defined there. We can access objects defined in the XAML just as if they were defined in this file (note though that for Intellisense to pick these up the project must have been compiled at least once). Let's add some functionality to the button we added. After the call to InitializeComponent, add the following line:

button1.Click += new RoutedEventHandler(button1_Click);

This adds an event handler to the button1 object we created in Window1.xaml. We could have instead set this in the XAML, by using the Click attribute of the Button element. Finally, we need to write a method to execute when the button is clicked - a simple WPF messagebox will do.

void button1_Click(object sender, RoutedEventArgs e)

{

    System.Windows.MessageBox.Show("Hello, world");

}

Build, execute, and there you have it - a fully functional WPF application. Admittedly not the most exciting application ever, but in subsequent posts I hope to show the sorts of cool and powerful things you can do using these simple techniques.

Posted by sthorne | 0 Comments

Off with his head

There's an interesting video on Port 25 about Windows Server Core, an installation of Windows Server 2003 which does away with the GUI and allows the bare minimum to be installed to serve basic functions. Headless servers are something the Linux world has had for a long time, and are often seen to provide an easier administrative and security burden due to the ability to choose precisely what is installed.

Actually (as the video explains), this isn't quite headless, and we don't lose all of the GUI code. Due to the way Windows is architected programs still require the ability to pass and process windowing messages, and this in turn requires the GDI. But it should offer an attractive option to those who complain Windows comes with too much unnecessary fluff that causes headaches in administration and security.

I also think it's way past time for someone to spruce up the console window - the default 80-char wide thing that's graced our screens since Windows 95 is looking decidedly long in the tooth, particularly now Powershell has given the platform a real CLI to work with. Also I believe including an SSH server with Windows would help establish credibility among those used to administrating their server in this fashion...the argument up until now has been that Remote Desktop provides all that functionality, but now a non-GUI server has been provided there's a case to be made for a non-GUI access method.

Posted by sthorne | 0 Comments

Quest for the Halo Grail

Okay, I admit the next video's taking a little while but in the interim here's a take on Monty Python and the Holy Grail, Halo style. Enjoy :-)

 

 

(Incidentally, I'm trying out Windows Live Writer to publish my blog, so far so good.)

Posted by sthorne | 0 Comments

Making nice

Last Tuesday Microsoft announced the Open Specification Promise, which boils down to a permanent agreement not to sue anyone implementing web services for patent violation. This has been done in consultation with the open source community - to quote Red Hat's deputy general counsel Mark Webbink:

Red Hat believes that the text of the OSP gives sufficient flexibility to implement the listed specifications in software licensed under free and open source licenses. We commend Microsoft’s efforts to reach out to representatives from the open source community and solicit their feedback on this text, and Microsoft's willingness to make modifications in response to our comments.

There's more detail in this CNET article. We also spoke at the php|works conference, attempting to persuade PHP developers that they might at least want to consider running their applications on Windows. One interesting thing mentioned are the efforts to create a PHP to .NET compiler called Phalanger, which should hopefully bring all the inherent benefits of the .NET platform to PHP.

These are interesting examples of how the company is trying to talk to and work with these groups, and improve its image in this area. Okay, so don't expect the NT kernel to go open-source anytime soon - Microsoft still invests a huge amount in R&D and recognises the value of intellectual property. However it's all a good shift away from "open source is bad" to "we think our stuff can do a better job, and here's why"; things definitely appear to be moving the right direction.

Posted by sthorne | 0 Comments

Roll over Sony

Pah, who needs a PSP when you can have an Xbox 360 on your lap! The creator of this beast is Ben Heckendorn (he must have strong knees...)

NB: Cutting up your Xbox 360 and rearranging the innards may void your warranty

Posted by sthorne | 2 Comments

Second Life hacked

This weekend the database of online game Second Life got hacked, exposing usernames, passwords and addresses of thousands of players. If you play and use the same password anywhere else, make sure you change it ASAP (Second Life will require you change it next time you log in). The press release from Linden Labs can be found here. Despite hiccups like this it's definitely making headway into the mainstream; there was an article on BBC breakfast news featuring Second Life only yesterday.

In happier news now I'm back in the country for a bit I've got a chance to play around with the beta of XNA Game Studio Express. For those who've missed it this is a new framework aimed at developing games for Windows and the XBox 360, and the express edition is free! So anyway, watch this space :-)

Posted by sthorne | 0 Comments

Do we care?

The Register ran a somewhat vitriolic piece by Guy Kewney on his various bad experiences with our software last week. His first was Windows Update restarting his computer after he'd left it with programs open - despite setting it to ask him when to restart. Oops. I don't know which update this was, but I'm guessing it was security related.

It's a difficult balance to strike between keeping a machine secue and providing a good user experience. We have to remember though that ultimately the computer is there to serve the user, and whilst security is absolutely critical it shouldn't be stupid or obstructive - after all a computer that's encased in concrete and buried a mile underground can be considered fairly secure, but it's not terribly useful. Security is about ensuring availability as well as confidentiality, and being denied service due to the very thing trying to protect your PC is clearly frustrating.

The last thing that I want to suggest is that security is unimportant, but it's all about keeping it proportional and relevant. With the current world climate I think there's an inclination to implement inappropriate security purely to be seen to doing something. Privacy International is awarding gongs for stupid security, such as the Most Egregiously Stupid Award, and the Most Stupidly Counter Productive Award. Certainly when you hear stories of security desks complaining when paramedics rushing to a heart attack victim fail to sign in, it makes you wonder whether people have their priorities quite right.

To return to Guy's pains, dialog boxes that are the equivalent of a train's "dead man's pedal", and force people to keep clicking them else the machine reboots are extremely irritating. Whilst some people may never reboot and update their machine, I'm not sure that this means other people should suffer for this. (Incidentally, the nag reminder can be disabled or the delay period lengthened via Group Policy; if you tend to only reboot when it bugs you though then obviously it's a good idea to leave it on).

Guy ends his article complaining that Microsoft regards itself above criticism and that issues such as his are considered irritating procedural trivia. I honestly don't believe that this is the case (happy users are much more likely to stay with our software than unhappy ones, after all), but we obviously still have work to do in convincing people of this. Anyway, sorry Guy :-(

Posted by sthorne | 0 Comments

Hunting Vista

So I returned from our global sales conference in Orlando a few weeks ago, MGX (Microsoft Global eXchange, no convoluted acronyms for the sake of coolness here). There were lots of cool demos of upcoming technology, but I think the thing that grabbed everyone's attention the most was Photosynth. This software basically lets you take a bunch of photos of some object, and stitch them together into a fully interactive 3D model. Obviously the potential for something like this is incredible; imagine if all the images in the world were woven together to create a 3D virtual image of the entire planet? Mapping and aerial photos seem a little tame now :-)

Another thing that really blew me away was the awesome demo of Windows Vista by Jim Allchin, showing off all sorts of cool stuff I never even knew was there. Of course we're still a while away from the retail release of Vista, so while we're all drumming our fingers waiting for that here's another machinima video:

I can't take credit for this one, instead that goes to my friend Richard Coleman who has clearly spent far too much time playing The Sims :-) Thanks Rich.

Posted by sthorne | 4 Comments

Open the box!

A colleague recently told me about Pandora Internet Radio, an extremely cool service that builds a personalized streaming radio station based on your listening habits. You tell it the artists you like and then based on this it plays music it thinks you might also enjoy. It does this by identifying various characteristics of the music you like such as tempo, rhythm and melody, through a project they describe as the Music Genome Project.

The service is currently supported by adverts and completely legal, but sadly only available in the US at this time. However they say they are working on sorting out the licensing issues in other countries, so I'm really looking forward to seeing that over here in the UK and giving it a try.

Posted by sthorne | 0 Comments

Size doesn't matter

Showing my age here, but I remember how enormous standard density 3.5" floppy disks seemed when I got my first Amiga, with their amazing capacity of 720 kilobytes.  This sort of capacity meant you could fit huge (by those day's standards) graphics files on disk and really changed the face of gaming.

These days games are millions of times larger, typically in the order of four or five gigabytes. The majority of this size is often down to large media files; textures and models take up a significant amount of space. So when I heard about .kkrieger, an FPS crammed into 96 kilobytes of space, I was understandably skeptical. But having checked it out I'm stunned - my poor laptop can barely cope with the graphics, but it shows the power of procedurally generated graphics - code is used to build up media at runtime rather than storing it all statically with the game. Okay so it needs lots of support in the form of an OS and DirectX, but as the makers say few Windows games don't.

Check it out - this sort of thing may also have big implications for the distribution of machinima and other video content; entire graphics engines could be encoded into a small amount of data and sent at the beginning of a streaming clip. Movies could become truly interactive and allow you to view them from any angle and any detail you liked. The potential implications of this technology are staggering.

Posted by sthorne | 3 Comments
More Posts Next page »
 
Page view tracker