PDF Preview Handler from Ryan Gregg

•25Mar07 • 2 Comments

Ryan Gregg has done a nice little hack (and I mean hack as a compliment: the program was small, easy to create, and darn useful) to embed Adobe Reader’s ActiveX control within a Vista/Outlook 2007 Preview Handler. So now you can see what those PDF attachments in Outlook 2007 look like without all that double-clicking. The nice thing about his handler is that it works with Outlook 2007 on XP unlike the FoxIt Preview Handler from Tim Heuer – very handy for me as I prefer to run XP in Parallels. Plus you don’t have to deal with all that FoxIt stuff 🙂

I should warn people that the ActiveX control’s UI wasn’t designed to work with small amounts of screen real estate, so those with smallish laptops might want to wait for a better solution to come along…

Apollo, Competition, and Openness

•24Mar07 • 10 Comments

As pretty much everyone who reads this blog knows by now, Adobe recently announced Apollo, our runtime that brings web applications to the desktop. I’ve been reading a lot of what has been written and I’m generally happy with the things people have been saying – most people seem to “get” the value of Apollo and are at least intrigued by the prospects it opens up.

The people who write less enthusiastically about Apollo generally bring up a few things I want to talk about:

  1. Apollo competes with WPF – this meme is attractive to journalists because its easy to write a sexy story about a war between two large companies. The reality is less confrontational: Apollo is designed to bring web applications to the desktop, and WPF is designed to bring Web-style richness to the Windows programming model. Both approaches have advantages and disadvantages, but they don’t really compete with each other: you probably aren’t going to see a lot of HTML/Flash developers adopting WPF, and you probably aren’t going to see a lot of .NET/Win32 programmers adopting Apollo. Different design centers, different audiences. The only way the “battle” metaphor would make sense is if all programmers and all applications had exactly the same set of platform needs. Apollo’s can succeed even if WPF proves to be extremely popular, and vice versa.
  2. Apollo is no big deal because its “just a mashup” of existing technologies. Its true that Apollo does leverage and depend heavily on existing Web technologies: Flash/Flex, HTML/JavaScript/Ajax, and PDF. That is actually Apollo’s greatest strength: it provides a way to integrate all those technologies into a common programmng model that also leverages the host platform. No one has ever built anything that brings together web technologies in this way, and its a lot harder to do than calling it “just a mashup” makes it sound.
  3. Apollo is closed source and proprietary. Its true that a number of the pieces that make up Apollo are closed source, but how important this is will vary from developer to developer, and the story around Apollo alternatives is generally even worse.

Lets go into that last bit a little deeper. In the last few weeks, a number of other companies have been announcing frameworks, runtimes, and/or other products that are also trying to bring the web to the desktop, leveraging the Apollo publicity to their own advantage (more power to them – just good marketing as far as I’m concerned). I’ve also been reading the coverage of these tools and find it interesting to compare and contrast the features and openess of these platforms:

  • First up is Dekoh, a product that is trying to build a desktop application engine on top of a Java server. Its an ambitious project, and one that is putting a lot of weight on the fact that it is the open source alternative. I think its great that the source for their runtime is freely available, but how does the company that makes it make money? That isn’t at all clear right now. But one thing that they have revealed is that the product relies on a centralized “Dekoh Network Service” for identity, sharing, and so on. The bottom line is that with Dekoh, you are making your application dependent on a closed source, propietary Dekoh service that will own and leverage information about your users and their data. To me, that doesn’t really seem ‘more open’ than Apollo, where the runtime is free and there are no required dependencies on any web services.
  • Next is SlingShot from Joyent and Magnetk. I love Ruby on Rails, so this product is very interesting to me. They basically have taken the all-in-one desktop server approach of Locomotive and turned it into an application runtime. Its a great idea, and one that opens up a lot more power to the local application than Apollo. Downsides are a lot of potential security issues (no sandbox?), the fact that the entire source of your application is distributed to the world whether you like it or not, and the fact that it is limited to Ruby on Rails applications. More disturbing, though, is that it sounds like Joyent will be charging a royalty for distributing applications based on their runtime unless you are a customer for their hosting service. Maybe they just plan on charging a flat fee for the SDK. Either way, this is much less open than the Apollo model where the SDK and runtime are both free of charge.
  • Some have argued that Yahoo! Widgets is also an Apollo competitor. I don’t really get the comparison, but even if you do think they serve similar needs, the fact is that Yahoo! Widgets is just as closed source and proprietary as Apollo, if not moreso (since Apollo has open source components like WebKit and Tamarin).
  • Finally we have FireFox 3. Not really in the same category as the others, since its still fundamentally a web browser and it is nothing but vaporware at the moment. The offline mode and local data store features sound nice, and the open source credentials for Firefox are unimpeachable. But at the end of the day the integration with the host platform is going to be very limited compared to the other things being discussed in this context.

So there you have it: four Apollo competitors. One truly open but serving a different set of needs, the others with significant openness concerns. In this company, I think Apollo’s model is pretty darn attractive, but your mileage may vary.

Call PETA: Microsoft doing animal research!!!!

•07Mar07 • 1 Comment

So I’m reading _Laughing Squid_ (which I love) and I see an article about the “Microsoft Research TechFest”:http://laughingsquid.com/microsoft-research-techfest-2007/ that just happened. I’m scrolling through all the pictures and what do I see:

Picture of a cat in a cage, from Laughing Squid, released under Creative Commons license

OMG, Microsoft is keeping cats in cages and doing experiments on them! I always knew they were evil but this is beyond the pale!

Turns out this is really something much more innocuous and rather cool: the “Assira”:http://research.microsoft.com/asirra/ CAPTCHA solution.

Not only is it a clever idea, but it actually helps find homes for pets via a partnership with “petfinder.com”:http://www.petfinder.com/. Nicely done!

Petzold on WPF Book Structure

•05Mar07 • Comments Off on Petzold on WPF Book Structure

Interesting post from Charles Petzold about why he structured his book Applications = Code + Markup they way he did: with code-based examples first and then XAML-based examples towards the end.

When I read the book, I immediately remarked on the structure and wondered several times while reading it whether or not it made sense the way he did it. I found his article very helpful in explaining why:

The more I explored XAML on my own, the less I seemed to know. How do panels work? Why were some properties bindable but others were not? Why were some properties animatable but others were not? Why do those properties called “attached properties” seem to be in the wrong place? Why can you specify an event handler for children in a parent’s tag? What happens when modifying an existing control with a template isn’t enough and you need to write a custom control with keyboard and mouse handling and drawing?

Of course, answering these questions for myself required a lot of exploration. XAML is not as simple as it first seems. XAML required a whole intrastructure in WPF that involves layout mechanisms, dependency properties, routed events, and other features. It became quite obvious that most WPF programmers would want a familiarity with this infrastructure. Most WPF programmers would also want to gain a facility for working with this infrastructure. This can only be achieved in code.

Just one example: If you see an attached property in XAML — such as Grid.Row=”2” — it really doesn’t make a lot of sense. You’re specifying a property of the Grid panel within a child element of the Grid. If you look at the syntax in code, however, and you’re given an explanation of what’s going on behind the scenes in the context of alternative syntax, then attached properties make perfect sense.

I made a decision to tackle a lot of the WPF infrastructure very early in the book. I have an early chapter on dependency properties and a chapter on routed input events. I show how to write custom elements and custom panels comparatively early in the book. Many of my sample programs contain Window constructors that create and intialize elements and controls, which is a job that is eventually taken over by XAML, but doing it in code is something that every WPF programmer should know. Some stuff — such as defining a template — is incredibly painful in C#, but my book shows examples of that as well, and I hope the reader later comes to appreciate the relative simplicity of doing it in XAML.

He also gives a hint at a WPF feature that never saw the light of day:

I kept a close eye on one very special feature: the ability to embed C# code in a stand-alone XAML file and have it run in the browser. Although this feature was hinted at a bit, it never became real. If it had become real, I might have gone this route — or at least seriously considered it.

Is this where the WPF/E mini-CLR comes in?