Mike Taulty's Blog
Bits and Bytes from Microsoft UK

January 2009 - Mike Taulty's Blog

Blogs

Mike Taulty's Blog

Elsewhere

  • Catching up on some blog reading

    Just some links that I caught up with today that struck me as interesting. Ribbon UI in Silverlight Tim’s List of Silverlight Controls Keith’s got a new certificate creation tool The Road to Windows Workflow V4.0
    Filed under:
  • Professional Silverlight 2 for ASP.NET Developers

    Crikey. This is a “first” for me – I came across this Wrox Press  book; and 3 of the 4 guys on the front cover are from the UK Microsoft development consulting team where I used to work. I sometimes pick up a book and know an author on the front cover but never quite as many as this :-) That’s Jonathan Chris Salvador I’ve not read it yet, I’m currently wading through Joe Duffy’s “Concurrent Programming on Windows” and if you’ve seen that book you’ll know that I’ve got my work cut out as it’s a pretty weighty book but it’s looking pretty good at this point.
    Filed under: ,
  • Mesh Squared

    Ahh…..this post lets me have my developer Mesh and my consumer Mesh. Use Mesh Client Beta and Live Framework Client Side by Side Lovely.
  • Live Framework SDK – Revised WPF Photo Sharing Application

    I’ve taken the application that I last mentioned here and I’ve been working on it a little more. I’m not quite where I want to be just yet but I thought I’d walk through it a little and share the code. The application runs up like this; and it immediately tries to connect to the Local Live Operating Environment ( it depends on a Local Live Operating Environment ( LOE ) and will fail if you don’t have one ). It pulls the user id from that Local LOE and offers a chance to log in but you can skip it if you like as it’s only needed for Contacts which have to come from the Cloud LOE as the Live Framework doesn’t make them available from the Local LOE yet. Either way, it then shows something like this; one that UI is present I can drag and drop single photos or multiple photos from the desktop to the UI as in; It’s not possible to see the drop location on the screen capture above but it’s over the window on the left where I’m about to drop the 3 selected image files. On the right is a Virtual PC where I have a Windows...
  • Anonymous Methods, Lambdas, Confusion

    In talking about Parallel FX yesterday , I was using syntax such as; Task t = new Task(() => { Console.WriteLine( "Hello World" ); }); and it generated some puzzled looks from the attendees. Not surprisingly, not everyone out there is on .NET Framework V3.5 Service Pack 1 and not everyone is yet writing LINQ queries and using Lambdas and so on and so there’s still a need to try and catch up with some of what’s been going on. This is going to be particularly true in the VB world where some of the language features are not present until Visual Studio 2010 ships. I thought I’d try and write a “potted history” of what’s been going on in with all these lambdas and anonymous methods and so on to see if that’s of any help. In .NET, from day 1 we had this idea of the delegate which is a type-safe function pointer. So, in C++ I used to write stuff like; class Foo { public : int Add( int x, int y) { return (x + y); } }; int _tmain( int argc, _TCHAR* argv[]) { Foo* pFoo = new Foo(); int (Foo::*fn_ptr)( int ...
  • Why is Deleting Code so Satisfying?

    If I was a plumber then I guess if I hit a situation where I’d put in place a big heating system and a bunch of pipework and I then suddenly thought; Wait a minute, I’ve just spotted a much better way of doing this! then I doubt that my next thought would be to rip out all the work that I’ve done and do it all again. But, if I spend hours and hours writing some code and then suddenly think; Wait a minute, I’ve just spotted a much better way of doing this! then it feels great to delete all the work I’ve done, re-do it all again and end up with something more “elegant”. Is it just because plumbing involves something physical or is there something more going on?
  • Slides from .NET DevNet Talk on Parallel Extensions

    I’ve published the slides from my . NET Dev Net talk this evening on the Parallel Extensions to .NET. They’re here; http://www.slideshare.net/ukdpe/miketaultypfxslideshare The slides aren’t too bad – to be honest, the talk wasn’t my best ever as I broke one of my own golden rules in that I hadn’t got accurate timings for all the pieces of the talk which meant that the timings were off so apologies that it could have been better – I’ll improve :-) I also spent too long on a preamble and perhaps a little too long on Task meaning that PLINQ and the Coordination Data Structures got squashed – I’ll address that in the future. I used to do a lot of these kinds of developer sessions but, of late, that activity has dropped quite a lot and so I’m getting a little rusty! If you’re down in the South West of the country then you might also want to think about the DeveloperDeveloperDeveloper day that’s happening on the 23rd May;
  • static constructors, thread affinity, debugging

    Or, perhaps a better title would be; “ Why it’s better to debug with the Threads window visible” I puzzled over something in a debugger for about 5 minutes the other day so I thought I’d share. I had some WPF code where I had a static class in which I wanted to share a common Image which is sort of a “default image” if the class instance itself can’t find the right image to use. So, in pseudo-code it was something like this; class MyClass() { static MyClass() { image = new Image(); // ... } static Image image; } and that Image then goes on to be used elsewhere. Whenever I was running this code, I was getting the familiar “You’re using the UI widget from the wrong thread” exception and I was puzzled because I thought I’d taken some care to try and not do that and I couldn’t figure out which widget it was that was complaining. The call-stack soon showed that it was the Image above but I was really struggling to see how I’d touched the Image from anything other than my UI thread. A bit more debugging showed that...
    Filed under:
  • Live Framework SDK - “Concurrent Operations are Not Supported”

    I’m trying to write some code against the Live Framework SDK and I was trying to avoid hanging my UI so I figured that what I’d do is to use all the async options within the object model. So…as a for instance – if I have data backed by 5 MeshObjects on the screen and the user selects 3 of them and presses Delete then I’d want to delete those items and I’d want to do it asynchronously. However…more than one “in flight” async operation against the current Live Framework object model seems to hit you with a; “Concurrent Operations are Not Supported” error so this post is just a word of warning if you encounter this. It’s tricky for me because I have other instances where I want to display N images on the screen. These are data-bound with WPF and the original intention in the property accessor that supplies the Image was something like this; public BitmapImage Image { get { if (image == null ) { MeshData.GetMediaStreamForPhotoAsync( this , s => { image = new BitmapImage(); image.BeginInit(); image.StreamSource...
  • C#, Lambdas, closures, value types

    Blogging this in order that I remember in the future that I have been around this “loop” many times and that this code; int x = 1; Action a = new Action( ( ) => { x++; }); a( ); Console.WriteLine( x ); prints a value of 2 whereas this code; int x = 1; Action< int > a = new Action< int >( ( i) => { i++; }); a( x ); Console.WriteLine( x ); prints a value of 1 and that means that this code; struct MyStruct { public void Set() { flag = true ; } public void Print() { Console.WriteLine(flag); } public bool flag; } class Program { static void Main( string [] args) { MyStruct myStruct = new MyStruct(); Action action = new Action ( () => { myStruct.Set(); }); action(); myStruct.Print(); } } prints a value of true whereas this code; struct MyStruct { public void Set() { flag = true ; } public void Print() { Console.WriteLine(flag); } public bool flag; } class Program { static void Main( string [] args) { MyStruct myStruct = new MyStruct(); Action<MyStruct> action = new Action<MyStruct> ...
    Filed under: ,
  • Windows:7, Channel:9

    Wow, I guess today is "Windows 7 Day". If you're trying to get the bits then "good luck" as all I'm seeing right now is; which has to be representative of how many people are trying to grab that beta :-) So, if you're frustrated with that or you're downloading and want to know some more about Windows 7 then check out what Yochay has been doing on Channel 9 around Windows 7 - there's a bunch of new info gone out there just today; and, with this being Channel9, you can always subscribe in order to stay up to date.
    Filed under:
  • Live Framework SDK - more on inviting others

    This previous post had me thinking that the WPF application that I built across these posts; Live Framework SDK - More Steps Live Framework SDK - Having a Single MeshObject Live Framework SDK - Adding a Silverlight MEWA would start to improve if I offered the opportunity to "invite others" to shared groups of photographs. So, I re-worked the code. There were a couple of things that I came across whilst doing it; It's a bit painful that you can't do everything whilst created to the Local LOE. I wanted to write 100% of my code against the Local LOE but, because you can't get a list of Contacts from the Local LOE right now it means that you have to connect to the Cloud LOE to get them. Additionally, as far as I could tell you also need to use the Cloud LOE to send a user an invitation to share a MeshObject. I don't think you can do that with the Local LOE even if you already have gathered Contact information from the Cloud LOE. That was my finding, anyway. Mappings. I'm still not 100% sure about Mappings, MeshObjects...
  • MSDNEvents.Publicise()

    We have some events coming up in February in the UK that I want to try and promote a little. Here's the list of events we've got coming up under the MSDN banner ( click the picture to go to the page and sign-up ); As you can see, it's largely centred around Client technologies ( Silverlight and WPF ) and would provide a good place to get an introduction to those technologies if you've been letting the rich client story pass you by :-) These won't be re-run and it's not likely that we'll have any more MSDN events in the UK for "the foreseeable" so if the topics interest you then sign up to these deliveries rather than waiting on re-runs.
    Filed under:
  • Live Framework SDK - Inviting Others

    Following on from this previous post , the WPF and Silverlight code that I've been running tries to access a MeshObject ( containing a DataFeed of photos ) that the code itself creates at initialisation time. What I wasn't sure about at all was how that'd work if I wanted to make the same data available to another person altogether. As it stands, my WPF code runs up and does; Check local mesh for "photos" MeshObject. If not present, check cloud mesh for the same. If not present, create it. If I want to share my photos with lots of other users of the same application then is that what I want? All my users will end up with their own MeshObjects with their own photos and none of them will ever see each other. So...I set about trying to figure out what the "shared data story" is. There's a sample in the walkthroughs called MeshageBoard ( no, really :-) ) which helps quite a lot with this in that it shows the way in which one user can send invitations to another. In order to experiment with this, I decided that it...
  • Live Framework SDK - Adding a Silverlight MEWA

    Having written a small amount of WPF code for the previous post , I was wondering how hard it'd be to now write a Silverlight Mesh Enabled Web Application ( MEWA ) and access the same data that I was using from my WPF application. I set off down the route of building a Silverlight MEWA. So, in Visual Studio with the Live Framework Tools installed that's File->New Project; and then I did a quick Build to make sure I had something that was basically working and then I pressed F5 which sprung up this dialog; and that launched this dialog; which led me through visiting the developer portal; creating a new project up there; entering some details like the name (TestMewa), choosing to create a "MEWA" rather than a "Web Site", and then revisiting the dialog in Visual Studio and clicking the "Copy Link to ZIP file" entry; and then using that to upload the package on the website; which then gave me the Application's Self-Link to paste back into the dialog in Visual Studio; Visual Studio then did some uploading and launched...
1 2 Next >