| Michael Latta's profileMichael's CornerBlogLists | Help |
|
|
December 07 Security workAs part of my WPF / WCF application I am adding crypto based security between the peers. I am still working out the details, but have learned a lot in the process.
1) The class RSACryptoSecurityProvider can be used to create public/private key pairs.
2) RSA encryption can only encrypt about 117 bytes, and is slow. Symetrical encryption is much faster, and the key for symetric encryption can be encrypted using RSA.
3) There are methods and classes that make exchanging a symetric key only a few lines of code.
I use this to encrypt an invitation to a sharing space. The invitation is used to add an account as a member of a space. Once added, a peer can use the account to join the space.
I was surprised by the speed. Encrypting the change messages between peers does not appear to have much effect on the interactive response of the system. This is a good thing, because reasonable speed means it is possible to simply encrypt all data, rather than giving a user the option of better performance and less security.
I am still working out the handshake to ensure that invitations only come from the intended party, and only are readable by existing members. I am also working out how to transmit the private key of the space to new account holders so they can encrypt data for the space. I may end up giving up on that, and simply using the account holder's private key for all data. That just requires that all peers have the public key for all accounts, and can determine which account sent the data, before decrypting it.
When I get it all worked out I can post a more definitive solution and code samples. December 03 Humorus bug fixAs the saying goes: "Be careful about what you wish for. You might get it."
In my case I found that out today.
I am working on a WPF based collaborative application that combines WCF peer channels, speach, ink, and WPF rendering to produce a multi-media near-real-time collaborative environment. I intend to use IronPython for scripting along with some inference and pattern matching to produce a supportive environment for whiteboarding about content, with the computer providing assistance to the collaborators. I will be writing more about this in the future.
This summer I submitted a bug report about RichTextBox not issuing a change notification under all circumstances, because the user could make changes I did not get notified about. Without the notification I could not share the changes over the collaborative mesh. The problem is that with the November CTP they fixed the problem too well. Even programatic changes fire the notification. This means that when program A detects a change it fires a notification. This gets shared over the mesh and program B replicates the change locally. This fires the notification, which gets shared with A. A replicates the change, which gets notified, which gets shared to B. You get the picture. An endless cycle of changes results where each member of the mesh repeats the changes causing new changes to go out.
The technical fix is of course to disable notification when replicating changes. But, the first example of this was quite amusing as 2 programs repeated each other's changes endlessly. Because changes are animated using WPF it was fun to watch each program errase and retype the same text over and over. November 26 WPF and BitmapEffectsThe Nov CTP comes with some improved effects. In partciular the drop shadow effect is now a soft shadow, which looks quite nice. Unfortunately it currently resutls in software rendering. And more to the point, it forces all enclosed visuals to be software rendered as well. A common case is a drop shadow on a rectangular opaque area. This could be optimized, but even the general case such as text (currently not supported), could be done in hardware with a special shader. It might require multiple render targets which is not a tier currently detected in WPF. I urge the WPF team to consider a Tier 3 that has what ever it takes to do effects in hardware.
I am using an M4 laptop/tablet. This is tier 2 with a NV6600 and 128MB of VRAM. The difference between software and hardware rendering is quite noticeable. With software rendering caused by the drop shadow creation and dragging of shapes seems sluggish. With hardware rendering (no drop shadow) the create/drag actions are very snappy.
I do not know if the release version will be able to render drop shadows in hardware, but the hardware can certainly do it. I hope that if it does not make the cut, it at least is not precluded by the design.
P.S. Au usual first impressions can be deceiving. It turns out that some forms of drop shadow are rendered in hardware. At least one case is where enclosed shapes cause the element with a shadow to be software rendered. On another case, as canvas/border with a shadow was hardware rendered, but the enclosed text block was done in software. All menu popups seem to be in software, as are the drag targets of tool strips. Even one software rendered element will make the interactivity sluggish in even simple cases like dragging or simple animations, when compared to hardware. September 25 The new Ink Analysis API Rocks!In an afternoon I have replaced the ad hoc analysis I was doing with the new Ink Analysis API delivered at PDC in the new Mobility SDK. This API Rocks! It is doing a much better job of dealing with mixed text and graphics and handles the background analysis much better/more simply than my home-brew system. I expect that just like other aspects of WPF this is going to make many more applications add ink recognition to their apps because it is so easy to do so. September 16 Back from PDCI am back from the PDC! It was a great show. I learned a lot, and met some other great developers. After only about 6 hours of fixing breaking / compile errors from the switch to the Sept CTP bits my application again works. Well works might be too strong. It really limps. I need to redo the resize editing because GrabHandleAdorner went away. I need to redo ink analysis to use the new API (that looks much better). I already have the new peer resolver working, and that seems much simpler than beta 1 was to use. Even though I will spend most of the weekend getting back to where I was, the new bits are an improvement, and I look forward to using them. September 07 PDC05 BOF Sessions ConfirmedAll 3 of my BOF submissions were accepted! I am going to be busy after hours!
Monday, September 12, 2005 at 7:00 PM: Integrating P2P into Applications
Tuesday, September 13, 2005 at 9:00 PM: Avalon Extreme - New GUIs made possible
Thursday, September 15, 2005 at 10:15 PM: Modeling vs. Coding
Come join the discussion. As requested, I am not preparing any slides or presentations. I do have a lot to say on the topics and a lot to learn from others. My intent is to create an open on-topic dialog where we can all share our experience and hopes for the future in these areas. September 03 PDC05/OneNote what were they thinking?Not to seem ungratefull, but what were they thinking? The idea of using OneNote at a conference like PDC is very tempting in concept. But, the reality is just not there. My tablet gets 2.5 hours of battery life with 2 batteries (because I am a developer and have 2GB of ram, a 2Ghz processor and a 5200rpm disk). Even a more modest machine for a developer is going to be under 4 hours. Only those "manager" type laptops get 5-6 (you know those ultra light jobs that have the processors from 2 years ago). So, even in the best case scenario you might maike it to lunch before the power runs out. Now if they had announced that all seats at the conference will have access to power strips, THEN I would really be impressed. I would like to use OneNote, but it just seems like the technology is not there yet. August 12 PDC05 Schedule outThe session schedule for PDC05 is out. I had to be brutal about conflicts. The main question is "Can I get enough of this from the DVD or the Web?" In most cases I could get it down to one session per time slot. I tried to get a balance between the various technologies that I am following. Being a generalist is a bitch when it comes to conferences because those carefully crafted tracks do me no good. I am into too many different technologies. I wanted all the Avalon, Indigo, P2P, C#, and Vista sessions. But, of course, that would not work at all. The SharePoint and BizTalk sessions were the first to go, along with almost all the Vista sessions. I had to give preference to the nearer term stuff, which for me is Avalon, Indigo, and P2P.
2 of my BOF submissions are up on the site as well, so go vote for them!
My tenative schedule leaves about 3 slots open to check out the booths, and talk to folks in the BA room. The sessions I have currently are:
FUNL02 Lap around the WinFX and Win32 SDKs 406 AB
TLN301 VSTS: Behind the Scenes of Visual Studio 2005 Team Foundation Server 502 AB COM311 Developing P2P Applications using Windows Vista and the Windows Communication Foundation (“Indigo”) PeerChannel 409 AB PRS305 Windows Presentation Foundation ("Avalon"): A Lap around the Windows Presentation Foundation Hall EF PRS317 Windows Presentation Foundation ("Avalon"): Beautiful Code, Beautiful Design - Applications Your Designers Can Work With 152/153 (Hall F) PRS309 Windows Presentation Foundation ("Avalon"): Overview of Windows Vista Graphics 502 AB COM307 Windows Communications Foundation ("Indigo"): Writing Reliable and Transacted Distributed Applications 403 AB PRS315 Windows Vista ("Longhorn") Tablet PC: Advances in Creating Tablet Enabled Applications 501 ABC TLN311 Visual Studio 2005 Team Edition for Software Architects and Future Directions in Modeling Tools Halls C & D (Petree Hall) PRS319 Building Applications That Look Great in Windows Vista: The AERO Experience 152/153 (Hall F) TLN213 Future Directions for Building Windows Presentation Foundation ("Avalon") Interfaces 502 AB PRSL03 Ten Amazing Ways to Speech-Enable Your Application Halls C & D (Petree Hall) COM423 Windows Communications Foundation ("Indigo"): Web Services Interoperability with Java/J2EE 406 AB PRS325 Windows Presentation Foundation ("Avalon"): Advanced Graphics (Part 1)—2D, 3D and Text 515 AB PRS328 Windows Presentation Foundation ("Avalon"): Advanced Graphics (Part 2)—Animations, Imaging, Effects and Media 403 AB DAT323 Using the .NET Language Integrated Query Framework with Relational Data 408 AB DAT324 Using the .NET Language Integrated Query Framework with XML Data 408 AB PRS435 Windows Presentation Foundation ("Avalon"): Going Under the Hood To Understand the Architecture 403 AB August 04 WinFX Components all out nowThe last part of WinFX Beta 1 is out, time to upgrade:
Microsoft Visual Studio Extensions for WinFX Beta 1 http://www.microsoft.com/downloads/details.aspx?FamilyID=45f9be99-3264-4bf1-8879-78a7a95d9217 Provides developers with support for building WinFX applications using Beta 2 of Visual Studio 2005. July 19 PDC05I am registered for PDC05. The hotels are already filling up. There look to be many more sessions I want to attend than I will be able to attend. I hope the actual schedule comes out soon so I can plan my time. Sessions on Indigo, Avalon, VSTS, and Longhorn in general are top on my list. July 10 Avalon is FastI have worked with a number of UI frameworks, including directly with OpenGL, and Avalon is FAST. It is able to handle screen updates with much better performance than any system I have used before. While most 2D rendering systems have problems with updates that require most of the screen to be repainted, Avalon has no problem with this at all. Most of my applications are diagram type applications, and having live update of connections has been a performance issue in all past environments. That is why Visio does not do live updates, and many environments that do this are slow. With Avalon I have not been able to make it miss a beat. I am sure this has to do with the GPU resident animation and the display list orientation. Avalon approaches the UI like a game, it layered the work and places the updates as close to the GPU as possible. And because it is vectors much lower in the stack less pixel updates are required. At every step Avalon impresses. June 15 Avalon - First ImpressionsI have been using Avalon after hours for a while now, and I am quite impressed. I have yet to use some of the more powerfull features to full advantage, but I would say this is the best UI framework on the planet. I have worked in a lot of them (SubArctic, Swing, AWT, SWT, Phigs, OpenGL, NeXTStep, OS/X, MacOS, Apollo, Smalltalk, Squeak, etc.). Avalon has a very uniform and well thought-out design. The features work together to result in more than the sum of the parts. The quality of both the result and the implementation are very high. I look forward to building rich client applications on this framework for the next decade. And it is not even in beta yet!! Congratulations to the Avalon team. June 13 Layout gotchaWatch out for canvas layouts and Decorators. While changes to Width/Height made to the Child element of the Decorator will be visible as the Decorator adjusts to size changes of the Child, changes to the Canvas attached properties are NOT reflected in the Decorator. It would be more uniform in some cases if the Decorator just decorated the element, and took all layout properties from the Child. I expect the same issue will happen with DockPanel or others. The layout of the decorated element is dependent on properties set on the Decorator not the Child. While it is correct behavior as currently designed, it is not exactly the Decorator pattern I would expect. Decorators should decorate, not override some of the layout and not others. June 11 Avalon's General DesignUnlike many UI frameworks Avalon has a very general design. In many frameworks like Swing or SWT a Button has text and possibly an Icon, Menus have text, icon, and a key binding, tool bars have icons, and possibly text, etc. The presentation of an element is tied to what it does, and that is often rigid text and possibly an icon. In Avalon the content of these elements can be other elements. I can put a TextBlock or a StackPanel in a button or menu item. I can create rich content with styles and animations as the presentation for these elements. The event model for the two is pretty different, which could be unified as well. Why do menu items have commands that can be enabled/disabled, but buttons do not? Why do buttons use Click event, when menu items use the command to make something happen? Just something to think about. But, the visual unification is a big step ahead of any other framework on the planet. Thank God for the samplesThe documentation on WinFX is still in pretty bad shape. This is not surprising when the product is not even in beta yet, but still not what I would have preferred. Unlike most programmers, I write the comments first. I consider it bad form to turn over any code to a build that does not have full comments. Those comments help me later when reading the code, and help anyone else that has to do the same. My usual method of learning a new API like Avalon is to start with the overviews, to get a good high level understanding of the API in general, and any area I am working on in particular. Then I learn the details of the API as needed by browsing the documentation, class hierarchy, etc. For Avalon this has not been working out so well. The class specific documentation is mostly missing any details not generated from the code, and that means no commeints at this stage. And there are no overviews for the most part. But, there are some samples. The one I ran into today is fonts. The documentation makes it very hard to see where the pieces fit together, but the FontDialog sample does a good job of putting many of the commonly needed pieces together. All I had to do is read the code, and ignore the documentation. Not as bad as trying to figure out Fortran code that was writen in swedish with 6 letter variable names that are appreviations of the swidish words, and no comments (a job I had early in my carreer). |
|
|