November 2004 Entries

I was doing my part restoring the content of some pages that some idiot decided to spam with links this evening, but man is the Channel9 Wiki sloooow. It's 12:45 ET right now and there are like ten people on the Channel9 site according to the stats, so what's up with the weak performance? :\

Maybe the Scobleizer will hear my cry and come to the rescue? ;)

posted Tuesday, November 30, 2004 10:01 PM | Comments |

Someone asked a good question in the WinFx newsgroups about how to go from a the result of a hit test (via UIElement::InputHitTest) to a Button. Now InputHitTest returns IInputElement which you can then cast to FrameworkElement. At first you might think you can just walk up the logical tree from there using FrameworkElement::Parent until you run into the Button, but here's where the trickyness comes in: the logical tree of the Button is separate from the logical tree of whatever contains it, but the Button's visual “branch” is merged into the main visual tree. Therefore once you hit the top level element of the Button's logical tree (Grid if you're using the default style), it will have no Parent of its own.

So then, how do you get at the Button when coming up through the tree in this case? The answer to that is the FrameworkElement::StyledParent property. This property returns the element whose Style.VisualTree caused this visual “branch” to be created.

Disclaimer: This is my interpretation and understanding based on research and experimentation. Some of my terms may be wrong and I may not be explaining everything 100% correctly.

posted Tuesday, November 30, 2004 9:13 PM | Comments | Filed Under [ WinFx/Vista ]

It would seem that the latest drop of Avalon is still missing the concept of a “VisualBrush”. A VisualBrush would be used to paint other surfaces with any other visual definition. An example would be painting a <Canvas>'s contents onto a 3D surface. Not only that but I should still be able to interact with that set of visuals while it's on the surface. For example, if I had a <Button> on a <Canvas> mapped to the surface of a <Sphere> I should still be able to click that <Button>. Animations should also continue to run while mapped onto the surface.

Am I just missing it? Does it have another name? This feature existed back in Chrome. You could map a web page to any 3D surface and still interact with it. I'm no DirectX developer, but I remember playing with it back in the day and remember something like support for drawing an DirectAnimation/DirectDraw “scene”(?) onto a 3D objects surface.

posted Wednesday, November 24, 2004 10:33 PM | Comments | Filed Under [ WinFx/Vista ]

This is really not a huge deal, but I was surprised to see that this latest drop still uses the “Definition” namespace URI. I know there was some discussion about this even at the PDC when Avalon was unveiled, being that it's not exactly the greatest URI on the face of the Earth.

I realize we're not in beta yet and of course nothing's set in stone, so I figured I'd raise the flag again so that it doesn't accidentally fall by the wayside without at least some discussion around it. The simplest thing would just be to tag it right onto the main XAML URI and end up with: http://schemas.microsoft.com/2003/xaml/definition.

posted Wednesday, November 24, 2004 8:28 AM | Comments | Filed Under [ WinFx/Vista ]

Woah, this seems to have come out of left field. This is the version that runs on Window XP SP2 and 2003. Read all about it here and then go download it on MSDN subscriptions under  “Tools, SDKs, and DDKs -> Platform Tools, SDKs, DDKs -> Tools, SDKs, and DDKs | Platform Tools, SDKs, DDKs”.

I guess we know what most of us will be busy playing with this weekend! ;)

posted Friday, November 19, 2004 4:19 PM | Comments | Filed Under [ .NET WinFx/Vista ]

Betrand Le Roy made a post called “Why you shouldn't expose public properties from your pages”. For the 99% of the scenarios I agree with him since it would obviously prevent your control from being reused ubiquitously, but there is at least one scenario where I see this as acceptable: when creating a shell environment scenario like Windows Explorer or MMC.

We have the concept of a Library at Mimeo. The Mimeo Library implementation behaves a lot like MMC. You can plug in folder providers (analogous to MMC snap-ins or Explorer Shell Extensions) for the tree view on the left and then each of those folders have specific “item view” controls associated with them that get loaded into the right hand pane when the folder is selected. So these “item view” controls are specialized and are meant to be hosted in a certain environment that mandates certain behavior from them, as dictated by a abstract base control class they all derive from and provide specific behavior for, as well as provides a base set of hosting behvaior for them. I'd love to show a screen shot to provide better visualization of what I mean, but since we've only recently entered a beta process I can't.

Now the only real question is: Why should the page be the shell? Why not another control? In actuality, it could and probably should be since I'm a big fan of componentizing, but that's just the way it started since we didn't need to reuse the whole browser anywhere else. Now we're into the beta process so it's not worth taking the risk of introducing bugs while extracting it. Hopefully after v1.0 release it'll be a medium priority for v1.1.

posted Wednesday, November 17, 2004 9:10 PM | Comments | Filed Under [ .NET Web Development ]

Jeff Putz asks “What happend to the Whidbey hype?”. It's a great question and a few people have already commented on the post with their thoughts, but I figured I'd chime in with my thoughts here.

I think the biggest reason things have died down is that back then the features were new to the runtime or our favorite language so everyone was excited about learning about how they work. Usually those of us geeky enough to even be interested in hype like this grok how things work relatively quickly. So we've gotten past the "ooohs and ahhhs" stage where someone posts a snippet that shows how to use do something cool with something like generics or an anonymous delegate in C#. Now it's back to "How can I actually use these features to solve real world problems?" and, as usual, that's a lot harder to come up with articles for.

For me the Whidbey hype is now mainly about the IDE. I am dying to use it in my every day work. I actually need Visual Studio features, especially Team System, more than I need any of the new C# language features right now.

posted Wednesday, November 17, 2004 2:38 PM | Comments | Filed Under [ .NET ]

Man, am I a happy customer right about now lemme tell ya!

I'm trying to install Half-Life 2 and am on the fourth installation CD (of five, since for some reason they only sell the DVD as a special edition for $20 dollars more) and it's trying to copy the HL2 icon for the game. The error message indicates that it's looking in a CAB file for it. The only problem, as this picture shows, is that the icon (1) isn't in the damn CAB file (2 & 3), it's just right there in the install directory.

Once I click the OK button (great option btw, no ignore or retry??) I get a fatal installation error and can't play the game. It copied 3.5gigs of all the necessary game data to my machine, but I can't play the game because of an icon. You've got to be freakin' kiddin' me.

They've been working on this game for years. How the hell does something like this get to the shelves?

Update: Hahahahah, amazing! So here's the deal. HL2 comes with the multiplayer game Counter Strike. I don't play this game, so I choose not to install it by deselecting it during installation options. This particular install scenario is the one that fails. If I leave Counter Strike selected for installation, it succeeds. Are you kidding me? Fire the installer and it's QA team now.

posted Tuesday, November 16, 2004 11:56 AM | Comments | Filed Under [ Personal ]

I've looked around and haven't seen this described anywhere. It's a tough bug to come up with a succint search query for though, so maybe I just missed someone else reporting it. In any case here are the details in case anyone else ever runs into this.

Basically, if you create a UserControl, decorate it's code-behind class with [ParseChildren(true, “Content”)] where “Content” is a property of the control of type ControlCollection that redirects the controls to a region within the UserControl (say a PlaceHolder), then use this control inside of your WebForm and define an <input> as a child element it will blow up with a Parser Error of “Object reference not set to an instance of an object”. If instead you nest the form element inside of a non-form element, such as a <div> it all works. So there's definitely something funky with the UserControlControlBuilder implementation.

It will fail with any type of form element: <input> <select> or <textarea>. The work around for today is to be explicit instead of counting on the ControlBuilder to correctly interpret the ParseChildrenAttribute. Here's the code to repro. If anyone can tell me what I'm missing or confirm this is a bug that would be great.

posted Monday, November 15, 2004 9:34 PM | Comments | Filed Under [ .NET Web Development ]

Shawn Van Ness posted a list called “101 Uses for Nested Classes”. I found it informative so maybe you will too.

Utilty classes is my personal main usage for them, but one use that Shawn didn't list was to provide concrete implementations of interfaces that don't require any exposing any public members of their own. The main examples I can think of are IList/IDictionary/ICollection implementations where you provide some kind of specific storage or lazy load implementation. Really nobody ever needs to know about your internal guts and, unless you're into strongly typing all of yours IList implementations, there's no reason to expose that class to the outside world. You could obviously accomplish this without nesting the class, but I like it for the strong association it creates with the owner class.

posted Monday, November 15, 2004 8:09 PM | Comments | Filed Under [ .NET ]

I don't blog about my company very often, but I'm pretty pshyced about this. We made Inc. Magazine's Top 500 Fastest Growing Companies List and we're up there at #186! We've had some really amazing growth this year that seems to be snowballing more and more. I'm proud to see this company go from the nothing it was when we started in '98 to becoming a service that people can depend upon for their every day work.

As Chief Architect, the best part is right around the corner for me though. We've been doing some serious crunch work for the past three months on the next version of the site which is adding a ton of new features and setting us up to be able to add even more features very quickly from now on. This version is also our first move into a 100% .NET code base. “What? You're own software hasn't been running on .NET all this time?” I hear people scream. Yes, it's very hard as a young company with only three dedicated developers to both add features to an existing product as well as develop a new product. We actually doubled the size of our team for the first time ever when we started this new product and now have a whopping six developers! Anyway, we've done some really cool stuff with .NET and ASP.NET and it's just gonna make our life so much easier when it comes to bugfixes or adding new features. It should also make adding new developers to the team much easier since they won't have such a learning curve coming into the custom architectures we had to invent back in the day when we started with nothing but ASP and VBScript.

Learning to manage a larger team certainly is the most challenging thing that I've had to deal with during this project. I'm extremely anal about my coding practices and architectual decisions. I expect an almost ubiquitous code base that follows my knowledge of various best practices. I've worked the original developers with for upwards of 10 years now and I trust them and they trust me and we've harmonized on just about everything. Bringing in new people has definitely been... an experience. :) Building trust is the hardest part, but I'm sure with time that will work itself out.

Anyway, congratulations Mimeo! *pats back* ;)

posted Monday, November 15, 2004 6:25 PM | Comments | Filed Under [ Personal ]

So I jumped into a discussion on microsoft.public.dotnet.framework.webservices where the author asked the best way to send DataSets over web services. One of the initial responses was basically (to paraphrase) “...just pass it as strings and use GetXml, ReadXml to dehydrate/rehydrate the DataSet...”. The author of said post has, IMHO, been trying to tap dance out of that statement, but he only seems to be digging himself deeper. Anway, I leave the reading of that thread up to you if you're interested.

The real reason for this post is the ever increasing scenario where I see people recommending passing strings of XML around. The worst case, IMO, is in the web services (SOAP) space. You're playing in a world of pure XML here. You have full control over strong typing of your web method messages using XML Schema, so why would you choose to hide your glorious XML inside of a string? How are clients supposed to discover what they're supposed to send to you if you've basically designed your web service like a C++ method that takes void*? Would you design your .NET APIs to take all strings? Why not? That's essentially what you're doing when you take this approach with your web services.

Ok, so the truth is not that many people are passing strings around in .NET web services, but what they are passing around is DataSets. Basically passing a DataSet around results in the following XML Schema message type being generated for your web service using the default/built-in WSDL generator invoked by the ?wsdl querystring to your web service:

<s:sequence>
     <s:elementminOccurs="0"maxOccurs="1" name="test"> 
<s:complexType>
<s:sequence
<s:elementref="s:schema"/> 
       <s:any/> 
</s:sequence
</s:complexType
</s:element> </s:sequence>

Literally that translates to: “Pass me an XML schema followed by any well-formed XML element.”. This is light years more structured than the string approach at least, but still doesn't provide any insight to consumers as to what you expect in terms of data. Remember, your consumers are not only going to be using .NET (that's the whole idea!). They may not have an class that understands this pattern. In fact, the only reason wsdl.exe proxy generation for a web method with the afforementioned signature even translates to a DataSet is because it's basically a well known pattern that it's hardcoded to detect. There's no proof that's actually a .NET DataSet on the other end of the wire. It just so happens that as long as you have a schema followed by a xsd:any, DataSet would be a damn good candidate for parsing it.

That's why I always say to people who want to go this route: “Sure, feel free to use a DataSet in your .NET signature, just make sure to define your WSDL contract and message schemas by hand.”. WSDL first! :)

posted Monday, November 15, 2004 2:11 PM | Comments | Filed Under [ .NET Web Services ]

Microsoft Research is at it again. They're working on an experimental language called Spec#. Generics used to be an MSR project, now they're one of the staples of .NET 2.0, so ya never know just which features of Spec# might be showing up in C# 3.0. Then again the famed data centric language features (X#/Xen/C-Omega) still haven't made the light of day.

posted Thursday, November 11, 2004 8:35 PM | Comments | Filed Under [ .NET ]

After reading this post on IEBlog, particularily this part:

“I’d love to say more about what we’re working on right now on this front. I can’t.”

... I just felt I needed to vent a little frustration and make a request to the team.


I don't understand why you guys can't talk about what you're doing with IE. It seems like every other important development effort inside Microsoft has opened up and embraced the community by sharing all the latest and greatest things they're working on (VS.NET 2005, SqlServer 2005, Longhorn, etc.). So why not they IE team? You're product, more than any other has been under heavy fire for the past few years and it's almost like you're not willing to stand up for it and prove to us that you're working towards better standards support.

I don't blame IE for the non-standards they had implemented. I'm not some anti-MS, Mozilla zealot that doesn't understand that IE had most of the features at least two years before the W3C actually defined a standard for them (e.g. DOM Level 2 Events). I actually support you, but, and I think I speak for a lot of people here, I feel like you've abandoned IE. I realize you must be doing something. I can't imagine Microsoft would have actually stopped all work on the browser, but... being that it's been so long since there was any buzz around the product, I'm beginning to wonder.

Open up. Share with us. IEBlog is a good start, but it's been relatively quiet and (currently) lacks any real detail on what the IE team is doing. Take a hint from the Whidbey team and get IE into a public bug tracking/feature request database. My first two requests (and I'm sure most would agree with these) would be to deliver rock solid CSS2 and DOM level 2 Events in the next release. There are some utterly frustrating bugs with the former and having two client side code paths because you lack support the latter is just... well... annoying.

posted Tuesday, November 09, 2004 12:38 PM | Comments |

I just noticed Amazon is beta testing a Message Queuing Web Service (via TSS.NET). What has me scratching my head here is, what exactly is Amazon doing here? Are they getting into the software business now? Previously everything they've released has been to enable them to sell more goods, but this service seems like it's a pure software product completely separated from any of their other business activities.

Anyway, it's worth checking out and should be interesting to keep track of...

posted Friday, November 05, 2004 3:24 PM | Comments | Filed Under [ Web Services ]