Dispatches from Maine

Just another person of little note writing about ordinary things. That I reside in Maine is icing on the cake.

22 September 2005

Fall Fishing Trip

I returned from the PDC to a Saturday I can hardly remember. I just sat on the couch most of the day and dozed. After three extremely busy days at work, I am ready for a vacation! Thankfully, this weekend is my Fall fishing trip. Tom, Zach, Shevis and I are headed up to the Dead and Kennebec Rivers to try and catch some fish. As usual, chubs and bass count for me, but no one else (that I can tell) and I hope not to hook my thumb this time! I do have a net which my youngest bought me.
May the Lords of the Landlocked Salmon and Trout be kind!

17 September 2005

PDC05: Day Five (Little Tokyo)

PDC05: Day Five (Developing Windows Vista Sidebar Gadgets)

David Streams and Bubba somebody

PDC05: Day Five (Five Things Every Win32 Developer Should Know)

It is probably fair to say that every Win32 knows, or ought to know, the writings of Raymond Chen (blog). I am a huge fan of his blog, titled "The Old New Thing." The five "things" were broken into two categories:
  • Performance
    • What you learned in school is wrong.
    • Playing friendly with others.
  • UI Issues
    • Large fonts.
    • Parent & owner windows.
    • Asynchronous & synchronous input
The performance talk was primarily focused on disabusing us all of the notions teachers inclucated during our college years: the algorithm is the key limiter of performance. We often go to great pains to select between a linked list at O(n) or a tree at O(log n). Chen argued that CPU speed, and therefore algorithm, is not the most significant factor, latency to storage is. The latency chart he used was:
  • WAN (1e9 - 2e9)
  • CD (1e9)
  • LAN (1e7-1e8)
  • Hard drive (1e7)

  • Main memory (25-50)
  • L2 cache (5-10)
  • L1 cache (1-2)
  • CPU (1)
You can see the huge leap in latency when your application moves from memory to the hard drive, to fetch pages ejected from your working set for instance. On a smaller level, it is also clear from the chart that pointers are expensive. A data structure made of pointers, like a tree or linked list, is unlikely to have the next object in the cache, since it probably is not stored nearby to the original object. You can see this when your process has a high page fault count during particularly taxing processing. Arrays and some kinds of trees are cache-friendly because they collect nearby items together (called locality).

The discussion of playing friendly with others largely focused around not polling, since it hurts all processes on the machine, proper threading and the somewhat more controversial topic of scaling your feature set based on the system's metrics. Windows Vista offers a new API called IWinSat which allows you to interrogate the performance behaviors of the machine you are running on. Chen suggested you could enable or disable various features of the application based on those results. I guess I could imagine ruling out a complex range analysis, like a natural breaks, if the machine falls below certain performance thresholds. This would be a difficult position to mantain, since it goes against the It Just Works view.

The only item in the UI discuss which really engaged me was the breaking changes in Vista regarding DPIs. First off, the idea of "Large Fonts' is being removed from Windows with the advent of Vista. Instead, Vista will now support arbitrary DPIs, but largely in the set 96, 120, 144, 192. As a result, all applications should be tested in these DPI configurations. Also, an application should call the method "SetProcessDPIAware()" if it can handle different DPIs, otherwise Windows Vista will just lie to the application telling it the DPI is always 96 and then stretch the bitmap to fit the real resolution. Applications which are already DPI-aware will have to be patched by the vendors or risk loosing their hard work when Vista comes out. Chen firmly believes that DPI is the new "multi-monitor" feature. Developers should look hard at this area...

PDC05: Day Four (Windows Presentation Foundation "Avalon" in Win32/MFC Applications"

The next step was the session which pushed me over the edge and made my brain bubble over with ideas. Nick Kramer presented his excellent session, "Windows Presentation Foundation ("Avalon")in Win32/MFC Applications." His lead off made me cheer, "So, you have seen all this good stuff about WPF and XAML, but you have a big application back at work. You aren't going to be able to go back and rewrite it all, so now what" (paraphrased). He then share the secret of how to move to Avalon without throwing away your investment: HwndSource and HwndHost.

If you have an existing application and you want to be able to add Avalon objects to it, then you make use of HwndSource to place Avalon objects into an existing HWND. A good example of this would be taking an existing dialog, removing the UI code and replacing it with XAML and managed code. This is a great way to add Avalon to an existing application, particular for us here at DeLorme. If you are going to do this, be sure to associate "[System:STAThreadAttribute]" with the "main()" method to ensure it loads the CLR properly at startup. Another caveat is that you cannot have compiled XAML and unmanaged code in the same assembly. You could have uncompiled XAML and then compile it at runtime, you could have two assemblies to separate the two, or you could create the WPF controls by hand rather than with XAML.

// WPF inside an HWND.
HwndSource source = new HwndSource(…);
source.RootVisual = myWpfStuff;
HWND hwnd = source.Handle;

If, on the other hand, you want to write a new Avalon application, but draw your special Win32/MFC controls into it, then you would use HwndHost. It is worth noting that though Avalon supports HRGNs, it does not support layered windows.

16 September 2005

PDC05: Day Four (Extending Explorer by Providing Metadata, Rich Previews and Thumbnails for Your File Types)

I headed to Marc Miller's (blog) presentation "Windows Vista: Extending Explorer by Providing Metadata, Rich Previews and Thumbnails for Your File Types." It went over precisely the same code I had just been working in the instructor lead lab, but in significantly greater depth. It detailed how the property handlers system works including more information about PROPERTYKEYs and the PROPVARIANT structure. The PROPVARIANT is effectively the same as VARIANT, but with the addtion of new types like 'vector' and 'wide character string."

I am getting a little ahead of myself. Under the Windows Vista API there are now three elements to a file's metadata:
  • Properties
    These are simple elements which the user can view, and hopefully change. Examples would include author, description, ratings, etc. If you are going to implement a special property handler, then try to add write support so new interface elements (like ratings) can be supported.

  • Thumbnails (also called LiveIcons)
    This is not your 32x32 bitmap, but a scalable version of the file's content. DeLorme, for instance, would show a copy of the last map the user looked at.

  • Previews
    This should show more detailed information from inside the file. The Outlook 'Reading Pane' would be a place this would be rendered.
Back to the technical details, the property keys are little more than hierarchically structured strings, for instance, if we wanted to add a property called 'Region' it should be called "DeLorme.StreetAtlasUSA.Region" (Vendor.App.Property). This appears to ignore the idea of common properties across product lines, but I would imagine "DeLorme.General.Region" would suffice. During the question and answer period there was some discussion about whether there would be a central registry for new types. Miller thought this was properly allocated to associations, rather than Microsoft to maintain. The property collection is intended to be dynamic, so you can use SHGetPropertyDescription() to obtain more details about a property by name. To add vendor-specific properties, create a .PROPDESC file and install it via SHInstallSchema().

To read, and hopefully write, properties implement the IPropertyStore method. Miller was quite strong in recommending that people who write properties should also implement the IInitializeWithStream interface. This latter interface is super hot, at least to anyone who has worked with structured storage during a fault. When a developer writes directly to a structured storage (IStorage/IStream), they are effectively streaming binary out to a file. When a fault occurs (network goes down, out of space, application implodes, user removes their USB drive) the file is partly written. Since the file is binary and since many developers fail to handle the host of possible errors, serious and unexepected problems may result. I have seen a missing error handler result in a structured storage which crashes an appplication at startup. That is no fun. The new IInitializeWithStream resolves this problem by proving a stream which implements atomic writes. As you write out to the stream, it is actually writing to a temp file. When the stream is closed it replaces the original with the temp file in a single copy action.

The thumbnails are the most interesting feature for most developers. The view should scale from a tiny image, like you might see in details, to a nearly full size image which fills the explorer view. The handler would implement IThumbnailProvider to offer out thumbnails for a file. Most of the examples we see now are simple photographs, resulting in thumbnails which are indistinguishable from the original photo thumbnail. Miller went to great pains to assure us that Microsoft will be decorating these thumbnails we generate with borders and a copy of the file icon in a corner of the bitmap. This shell in the present Windows Vista build does not contain this decoration. If we also try to decorate the file, then by the time Windows Vista is released, our decorationg will be conflicting with Microsoft's.

The previews are provided via the IPreviewProvider interface. The implementer is given a window handle and the window rectangle to draw inside. Most of the demonstration code uses this to render into a richtext area which fills that region, but other options are possible. This area is not intended to be interactive.

During the question and answer period there was some discussion about the process model for these providers. Miller indicated that it was hard to isolate the process due to the chatty nature of the interface. Marshalling those calls across process boundaries would become quite expensive. I pushed on that answer a bit by asking if this was just a nice vector for virus and spyware injection, particularly considering it is being written in unmanaged code. There was no immediate answer, but when I sat back down the fellow beside my said, "Good question." I thought it was just another developer, but it turned out to by Chris Guzak. He told me that they had been able to resolve the process model issue recently, but no one told Marc Miller about it. I was really glad to hear it. I offered to try and beta the change when they had a build with it enabled.

As you can tell from the length of this post, this is probably one of my favorite new Windows Vista features. I like it far more than Sidebar. For the record, Mark, I appreciate your suffering for me!

15 September 2005

PDC05: Day Four (Ask the Experts still more)

After the C++ session I went back to the Tools & Languages Lounge to see if I could turn up either Anson Tsao or Jeff Peil. As I walked up to the lounge they were talking to each other! I asked them about my COM/CLR interop inside my "framework." The next ten minutes filled my head to the bursting point; I probably looked like a victim from the movie "Scanners." They said that I can host managed objects in the "framework" by compiling it with the /CLR switch. It can then discover the objects to load by assembly (strong name). There are System.Runtime services for finding the COM interfaces. You can also request a managed interop wrapper from the runtime. Interfaces created in the managed code wizard may need to be manually converted to MIDL, but when you do retain the detailed types. As a side note, it will be easier to host Avalon (WPF) than WinForms because of simpler hosting. Unless we need to use WinForms, we should try to stick to Avalon.

When they finished filling my brain, I stumbled off to take notes about the detail. There were a number of folks playing Halo 2 and when they finished none other than Sara Ford (blog) offered her spot to me. I wish I could still play games, but a weekend of solid Hexen taught me I better not or I stop working. Isn't addiction terrible?

PDC05: Day Four (Enhancing Your Win32 Application for Windows Vista)

I have not enjoyed the hands-on-labs in previous years, but this year I thought I should try an "instructor-led-lab." I was already very interested in adding the ability to view the content of a map file through the new Vista preview system. This feature was heavily demonstrated during the keynote. Because the site was near the lounges and the expo floor it was very loud. We wore wireless headsets (shared headphones, ick, I used my iPod earbuds) to better hear the instructor during the session. We went through the process of reading and writing properties from/to a file: author, subject, rating, etc. We added a support for a preview thumbnail which shows the content of the file. Then we added support for rich text output to go into a reading pane, like Outlook uses. The code was a lot of fun to write and the instructor did a great job keeping us all together.

I did notice that Windows Vista's explorer looks pretty unstable with it needing to be terminated after hanging on more than one occasion. Then I headed off to find Anson Tsao or Jeff Peil for help with my "framework" problem.

PDC05: Day Four (C++ Optimization Best Practices)

Kang Su Gatlin (blog) gave this presentation on "C++ Optimization Best Practices." The unmanaged code optimizations were largely the same as what I saw during the keynote, with a few additions:
  • OpenMP helps with multithreaded programming, use it.
  • Avoid Double-Thunks - you cannot dllexport managed calls without paying the double-thunk cost.
  • Compiling managed C++ with /clr:pure or marking dllexported calls as _clrcall improves performance by a factor of seven.

PDC05: Day Four (Ask the Experts more)

After I listening to as much of the keynote as I can tolerate, I went back to the Tools & Languages area of The Big Room. I started by talking to Jim Hogg about how to begin to integrate managed objects into our "framework." The big risk is migrating too much code, since moving code from unmanaged to managed has a performance penalty of around 10-15%. For interface code, this kind of penalty is minor compared to the benefit of easy development. For engine code, on the other hand, the code penalty can be quite severe. They will continue to make gains in optimization, but it will never be as fast as unmanaged code. He had some suggestions once we start using managed code, like using ngen to get a better optimized assembly. I asked some specific COM/Win32 to managed code interop questions and he refered me to either Anson Tsao or Jeff Peil.

Robert and I chatted briefly with the folks at ESRI. I had met their company president, Jack Dangermond, at GITA last March. I have a photo of Adrian and I standing with him and each of us has signed t-shirts. It was nice to talk to them, but strange to see them in such a small booth. ESRI is to GITA as Intel is to the PDC.

I then went to talk to Brandon Bray about how to load managed objects into our "framework," since I could not find Jeff Peil yet. He indicated that we might do it by storing a list of assembly names (strong name) then load those assembly and ask for all of the objects which implement interface "IDeLorme_Foo." You can obtain IUnknown interfaces from them and then give them IUnknown interfaces to work with. This is all good news. I asked more detailed question about that exchange process and he too pointed to Jeff Peil.

PDC05: Day Three (BoF: Managing Programmers & Deep Coder)

The Birds of a Feather sessions were great, but they ran until very late at night. I was already exhausted when I headed off for the first of them, but it was worth the loss of sleep.

The session called "Help I Have to Manage Programmers" was moderated by the redoubtable John Moody (blog). He did a great job keeping the previous discussion on track, and this session covered material far more incindiary showing him at his best. There was a lot of great exchange of ideas. I talked about using Evo to help improve estimation on developer-by-developer basis and to manage short-horizon planning. Another guy shared his planning and management tactic:
  • senior developers
    can design classes
    works about a week without synchronizing
  • intermediate developers
    can implement a class
    works about two days without synchronizing
  • junior developers
    can implement a single method in a class
    works about two hours without synchronizing

When the discussion turned to software cost estimation (scheduling), the disagreements started to heat up. Moody showed his real skills be putting out the fires and encouraging discussion without creating any winners or loosers. He was a superb moderator, particularly given the topic.

The session "Fate of the Deep Programmer" was fairly interesting. There was a lot input by everyone with all reaching the same basic conclusion. To be an effective deep programmer you have to be trusted, to be trusted you have to be visible, to be visible you have to go to meetings, to go to meetings you lack the time for deep coding.

PDC05: Day Three (Ask the Experts & Expo Floor)

It is the "Ask the Experts" element which draws me to the PDC year after year. The chance to talk to the actual engineers working on the products or technologies you are using or planning to use is a treasure beyond price. I split my time between the TracekLounges (like Tools & Languages) and swag bagging on the Expo Floor. I started by talking with Jeff Peil, who had given a presentation on optimization earlier the previous day, about stale optimization flags. We had upgraded directly from Visual Studio 6.0 to Visual Studio 2003. We had previously disabled several optimization flags because of a problem between Dinkumware STL and VC6, and those flags were restored to their normal state. We had not, however, reviewed all of our optimization flags to see if there were other stale disabled flags or even bad processor targetting. Jeff suggested we really ought to review it for two reasons. First, there is a real risk of a poorly optimized object file being produced by ten-year-old optimization flags. Second, the upgrade tools from VC6 to VC7.1 injected duplicate configuration details under each file in the project. We can safely clean those out except the precompiled header and gain a fair bit of compile speed.

I wandered around the Expo Floor for a while picking up information and swag. I talked with folks from Altova about their XML Schema (XSD) tools and their relational mapping tools. The XSD tool would be great since none of us are really XSD gurus, but we have a fair amount of XSD. We talked to the ISV folks about the Windows Error Reporting (WER) Database. We are absolutely going to sign up for that when we get back.

The Server Track Lounge had a few SQL Server 2005 folks in it. I sat with one, whose name I have forgotten, to talk about SQL Server 2005 features:
  • I asked him if there were plans to add geospatial datatypes now or in the near future. The short answer was 'no.' There is apparently a debate inside the team about whether user defined datatypes are sufficient for that purpose, with the people who believe that presently winning out.
  • I asked about the problems with lock promotion and reads being blocked in SQL Server 2000. He outline a few new read styles and lock types which will allow for better read response with possibly less consistency, since the version read is not the value at the start of the SELECT statement, just the value when the row is reached.
  • Finally, I asked about the servicing story. Under MSDE the situation was terrible with the ISVs having to deal with the servicing issue. The new SQL Server Express package, when installed via the MSI, will be serviced by Windows Update. Yippee!!
In the Expo Hall I met the crew from IIS 7.0. They had a hot new IIS7 t-shirt and when I went up to ask for one to go with my IIS 6.0 shirt, they said they were raffling them. Drat! I talked to their head guy and told him about my IIS 6.0 t-shirt. I knew it was rare and I had hoped for a 7.0 shirt as well. He knew what I was talking about, but tested my by saying, "It says DFU on the back, what does that stand for?" I knew that it was a repeat of what was printed on the front, "Destined for Ubiquity." He gave me a shirt without having to raffle. Rock on!

Most of the companies I talked to have lots of tools for managed code, including managed C++, but the available tools for native C++ is dropping rapidly. Even a little help authoring tool which just extracts comments from code does not support native C++. Maybe DeLorme needs to take managed C++, and managed code in general, more seriously.

PDC05: Day Three (WPF "Avalon": a lap around the Windows Presentation Foundation")

The topic of Rob Relyea's (blog) presentation was quite engaging for me "WPF ("Avalon"): A Lap around Windows Presentation Foundation". The entire presentation was a long demo of making a small application using WPF. There was a lot of focus on the capabilities of XAML files and how to connect XAML to your managed code. The presentation and demo is worth reviewing later to provide a nice baseline. The real software star was actually Mobiform's Aurora XAML authoring tool. The demo would have been much harder to follow without that tool. I did notice that Whidbey (Visual Studio 2005) looked really unstable on his machine. I hope it stablizes a bit more before release. The neat trick of the session was using Illustrator to export a vector graphic to XAML and then inserting that into the window's XAML file. This gives you scalable graphics rather than stretched bitmaps as you change the window size. Hot, Hot Hot!

13 September 2005

PDC05: Day Three (Bad News on VSTS Pricing)

All of the high energy I had built up over the last two days was almost completely extinguished when I found out that Visual Studio Team System (VSTS) pricing is still out of whack. To move from our present development environment to VSTS would increase our annual Microsoft tools budget at DeLorme by an order of magnitude. Though I can no longer find my link to it, I had thought I read a posting from blogs.microsoft.com that you could use Visual Studio 2005 Professional with Team Foundation Server. That would have added only about 20,000 to our budget, which is a case that can reasonably be made. I realize this technology was expensive for Microsoft to develop, but by having such a steep price it forces a number of ISVs to continue cobbling together a solution.

I spoke with people at the Tools & Languages track about the pricing situation. They were extremely helpful, but even the least expensive option, Team Foundation Server plus CALs for each developer, is still quite expensive. In doing research, I also discovered that with the change in licensing, moving to the new MSDN Premium call will still double our costs. It is probably time to start looking at alternative SCM systems again.

After all of this, I attended "Windows Server 'Longhorn': What's new for developers", but the focus was primarily on the security model and I was too bummed out to pay attention.

PDC05: Day Three (Behind the Scenes of Visual Studio 2005 Team Foundation Server)

Doug Neumann (channel 9) gave a good presentation on "Behind the Scenes of Visual Studio 2005 Team Foundation Server" which discussed how Team Foundation Server can be customized to add features particular to your organization. The number of events which you can hook are quite substantial, one of the better examples was having the checkin process run smoke tests prior to acceptance. If the smoke test fail, the checkin is blocked. The relationship between work items (defects, bugs, whatever you call them) and checkins is very flexible. The relationship is many-to-many: one checking fixes many work items, many checkins fix one work item, etc. Among the coolest features here is the connection between work items being resolved and tasks in MS Project being marked as completed, WOW! The workspace concept is fundamentally the same as AccuRev, which preceeded VSTS. The checkin reporting feature uses stylesheets to customize

MSBuild looks really interesting, though not well polished. We are presently using Visual Build Pro from Kinook Software, and we are very fond of it. MSBuild's real power comes from its integration with VSTS, rather than its natural capabilities.

The new SCM of VSTS and the work item integration makes it worthwhile for us to investigate using it at DeLorme.

PDC05: Day Three (Keynote & Inside Virtual Earth)

Bill Gates' keynote was excellent as always. The video this year with Gates waking up back at college with a guy named Napoleon was absolutely hilarious. The user interface of Windows Vista is super hot. I plan to install the beta 2 release on my laptop when it comes out and experiment with some changes to our applications to integrate them into the new UI. I am very much looking forward to getting my hands on it. The interface changes in Office 12 are also very exciting. I work with Word, Excel and PowerPoint a lot and I am certain to learn more about Excel because of the new interface design.

I watched Jim Allchin's talk for a while, but the lack of effective wireless networking drove me out into the hallway to publish my "Day Two" blog postings. At one point a rush of developers came flying out of the keynote and hussled over to the CommNet machines. Apparently, Allchin announced that a fancy little device, which normally costs $1,000, was available for $150 in limited quantities. He may have wanted to wait until later in the keynote.

The lunch sessions were moved to a different time, but Steve Lombardi went ahead and gave his presentation "Inside Virtual Earth" as a dry run. The plans for Virtual Earth are very interesting. I am particularly intrigued at the "Eagle Eye" feature. They are contracting with Pictometry to take 45 degree, low-altitude aerial photographs so Virtual Earth will show the sides rather than the tops of buildings. Since we compete with Microsoft in the desktop mapping application market, I think I will keep the remainder of my observations to myself.

PDC05: Day Two (Passing the Joel Test BoF)

We left the session and went to find David McKenzie, who had just arrived from Chicago, and then head to dinner. We wanted to find something close and quick since the Birds of a Feature sessions were due to start soon. After a little walking we opted for the California Pizza Company. As we waited for our table, we noticed literally thousands of bats flying overhead in a huge circle. I took to photographs, uploaded to my flickr set, but the bats are nothing more than hazy black dots. It was an incredible scene. The pizza was reasonable, and fortunately the bats had gone away by the time our pizza came. We headed back in time to arrive late for the first Birds of a Feather session, so I took a break to blog and relax until the second session.

The session I attended was "Passing the Joel Test" hosted by John Moody ("With All My Mind" blog). I have been a fan of his blog for some time and I am already a big fan of Joel on Software, so the combination was just perfect. The topic at hand was discussing how your team fares on the Joel Test and how you plan, or do not plan, to improve your score. Coming into the session I had rated DeLorme's team at either a 9 or 10 out of a possible 12. I had thought we would rate very badly, but when everyone was asked to shout out their scores the average was about 3 to 5. How could that be?

We then had a great discussion about several of the line items. We started with #12, "Do you do hallway usability testing?" At Delorme we have experienced two limiting factors with this form of testing. First, the people you bring tend to learn your style of UI design and gradually pick up on subtle hints that most users will not notice. Thus the design is usable for a co-worker, but not usable for someone less familiar with your particular style. Second, developers often fail to heed the advice of co-workers. We found the results of a usability test conducted were almost the same as advice already given by co-workers but ignored. The other points we discussed including the relationship between #5 "Do you fix bugs before writing new code?" and #10 "Do programmers have quiet working conditions?". Most people felt the two rules expressed the idea, "All things being equal, fix a bug before adding a new feature." This is a good rule of thumb from my point of view. Finally, we had a long discussion about #2 "Can you make a build in one step?" and #3 "Do you make daily builds?" Our practices at DeLorme were well ahead of most of the other companies in the session. We have an extensive one-step build process and run multiple nightly builds. The session was well worthwhile; I wish more people have been able to attend.

Lastly, it was a real hoot to meet John Moody. He is a pleasant, bright guy and did a great job as a presenter. We had a good chat on the way back to the last bus out of the conference center. Heck, he even referenced me as "the guy from Maine" in his blog posting last night.

    PDC05: Day Two (C++ Performance)

    The next talk by Bob Davidson, "C++ Internals: Performance" cemented his skill as a very engaging presenter and all around smart guy. The new compiler has a tool called "Performance Guided Optimization" (PGO, pronounced pogo), which was originally built as a tool for the Itanium compiler. Before you make use of it, the key phrase to memorize is "Common User Scenarios." To make use of PGO you instrument your build and then exercise the application. If you use the application in way that triggers error conditions, then those are the code paths which will be optimized. If, on the other hand, you remember to exercise the application with "Common User Scenarios" then the normal uses of the application will have their code paths optimized. The Windows XP kernel was run with PGO enabled and they obtained an 18-20% performance gain. Just as Davidson finished uttering that line his demonstration platform blue screened. I hope that is not the PGO optimized build at work!

    He then jumped into some very serious detail on new mechanisms for developers to give hints to the compiler which are ordinarily hard, or even impossible, for the compiler to discover. The easiest to describe, since aliasing is hard to explain with a few words, is the Named Return Value Optimization (NRVO). This optimization will make copy constructors faster since it eliminates the additional object ctor/dtor in the copy constructor call. The Frame Pointer Omission FPO) optimization can also produce a 3-5% gain, generally more on the 3% size. He also remarked on the need for developers to identify the most computationally expensive part of their projects and ensure that both the data and code can fit into the cache. The performance boost due to a good sizing is measurable (See "Cache-conscious structure definition" by Davidson, Bob, et al).

    The last topic which arose before we left for dinner was the effect of exception handling on the optimizer. He opened with this statement, "If you do not care about performance, use exceptions all you want." Having studied exceptions and optimization in several languages, I was familiar with the effects he discussed. Toward the end, I asked him to elucidate on the effect of the ISO C++ exception specification on the optimizer. This has been a point of hot debate at work with most people coming down against using exception specifications with the belief that it seriously harms optimization. Davidson passed off this issue to Brandon Bray. Bray outlined the behavior as described by the standard: throw(), normally called nothrow, requires the compiler to wrap the decorated method with an exception handler and call terminate() if an exception is emitted from the method. Bray felt this was an absolutely stupid requirement, because of its severe consequences to performance. Microsoft has instead implemented this as an alias to __declspec(nothrow) which promises the compiler no method will be thrown. The compiler then uses this information to better optimize calls which use the method. This makes throw() a performance enhancer with VC++ rather than a performance killer, as it is in ISO C++. I cannot wait to go flex at George S's office at work.

    PDC05: Day Two (Startup Initialization and AppDomains)

    Having come in late to the second session I missed the start of Bob Davidson's "Internals of Startup Initialization" talk. Davidson is an excellent presenter, but without the fundamentals from the begining of the talk I was constantly lost.

    The next talk was "C++ Internals: AppDomains" by Jeff Peil. The material was extremely detailed and very interesting. Unfortunately, Peil spoke with almost breathless speed. I had some difficulty following the topic in general, since the relationship between AppDomains and processes are not straightfoward, but the style of the presentation made it a bit worse. The two pieces of information I walked away with were:
    • AppDomains and _clrcall are hard
      plan on not really understanding it and encountering really difficult problems that are hard to solve.

    • Startup time for 500 clr vtbls with 10 methods each is 200ms
      Jeff felt this was really fast, but both Robert and I were a little wowed about how slow that really is. Robert's 3D code can process a whole mesh in 200ms.

    12 September 2005

    PDC05: Day Two (The Blackout)

    With the talk by Jim Hogg running about thirty minutes into lunch, when it ended we all headed rapidly to the dining area. The lunch options included several good salads; I selected the Cobb Salad and chatted with Robert. His session on Architecting .NET Frameworks was very informative. As we walked to the second part of the session the lights all over the conference center went out. We looked out the window and saw the traffic lights were out as well. With there being no power, we decided to head back to the hotel and drop off some items. I also wanted to change into my PDCC 1997 (San Diego) t-shirt.

    LOS ANGELES, Sept 12 (Reuters) - A utility worker overloaded an electrical circuit and caused a massive power blackout across much of Los Angeles on Monday, snarling traffic, stranding office workers in elevators and sending fire trucks with blaring sirens racing around the city

    Some two million people were hit by the outage, which plunged busy intersections into chaos, jammed cars on the freeways and sent office workers streaming out of downtown buildings to mill about on sidewalks. Those trapped in elevators made frantic calls for help.

    The utility worker "directed too much amperage into a circuit that did not have the capacity to handle it," said Kim Hughes, a spokeswoman for the Los Angeles Department of Water and Power. ...

    Robert and I sat down in the "Tools & Languages" area of the Big Room to blog while we waited for the sessions to be reset to new times. Unfortunately, there was no announcement of the sessions being restarted and I missed Brandon Bray's second presentation. I did manage to see the presentation by Jeff Peil.

    PDC05: Day Two (C++ Managed Object Model)

    I have seen Jim Hogg give presentations in the past and they are always the same: beautiful. He manages to lay out a very complex scenario with startling clarity, leading you step by step to a real understanding of difficult material. The topic at hand today was "C++ Internals: Managed Object Model." A excellent example of this skill is his demonstration of the GC compacting the generation-0 (gen0) heap. He created a small group of temporary objects then a single long-lived object with gcnew. We looked at its location on the GC heap by walking through the handle's double-indirect pointer. and looked at its location on the gc heap. Hogg then created a large group of transient objects on the gen0 heap, which triggered the GC to compact the gc heap. We looked again through the double-indirect pointer and found that though our root pointer was the same, the pointer it pointed to had been relocated.

    The next step was what make Hogg's talks so nice. He added a little tiny bit of very informative technical detail. He also told us that researched indicated that a compacting generational GC should collect gen0 frequently, since that is the site of most object lifetime churn, but collect gens1-N much less often. Addding a finalizer to your object automatically promotes it to gen1, so this leads it to collect far less often.

    There was a great question about the difference between "R r;" and "R^ r;" where R is always a managed type. It turns out that since managed types are always handled as double-indirect pointers, it follows that "R^ r;" == "R r;" with the "^" being largely a notational convenience for the developer. At a core level there are really two notations:
    • R ^ r - a pointer-style managed handle, it can be NULL and can be reassigned.
    • R% r - a reference-style managed handle, it cannot be NULL and cannot be reassigned.
    The C++/CLR replaces the common C++ lexical packing design with a more space-efficient packing design. In a single object the CLR will pack "fields" (also know as data members) from largest to smallest so that small members will live together inside 4-byte alignments. The CLR goes one step further and will look at an derived objects fields and pack them efficiently with those of the base class. A future CLR may likely change this by analyzing the code paths and packing hot, frequently used, fields together and placing cold, infrequently used, fields elsewhere.

    The implementation of stub based dispatch (SVTM from Lippman's talk)

    PDC05: Day Two (C++/CLI Object Model Intro)

    Stanley Lippman (blog) once again opened the C++ pre-conference session by leading us on a historical tour of the C++ Object Model. He contrasted the two original styles of vtbl architectures: STVM (Stroustrup) and KVTM (Kay). The former style uses the familiar static dispatch of C++, while the latter uses the dynamic dispatch of languages like Smalltalk and Objective-C. Lippman did a good job of being both informative and entertaining using the line "Well, I won't event get into it." whenever he was about to say something he ought not.

    The need to support C++/CLI required the team to use a new dispatching system (SVTM or Stub VTbl Model), which we will learn more about later today. The next decision for the team was how to integrate the new CLI references into C++. For designating that typename T is a reference, they saw three possible options:
    • Use the normal T* type
      This option appeared to create more problems than it solved. For instance, what would T** mean in that context?
    • Create a a library to support CLI types
      This was the tradition C++ answer from the old Bell Labs days
    • Change the language and add a new symbol
      This is the option they selected and created the new symbol T^ (called a "hat") representing a pointer-style reference and T% (what is this called?) representing a C++ reference-style reference. Remember that a C++ reference cannot be NULL and cannot be changed once set.
    They immediately started taking flack for destroying C++ and damaging the language. Lippman recognizes this criticism and accepts it, but noted that C++ is not sacrosanct, it is a simple invention so it should be changable at any point. He also remarked that there have been several paradigm shifts in C++'s history:
    • 1988 - multiple inheretance
    • 1991 - generic programming
    • 1996 - ISO C++
    • 2005 - dynamic programming (C++/CLR)
    From here we jumped off into a history of the evolution of the C++ object model and Lippman's work with Bjarne Stroustrup at Bell Labs (Area 11 in Murray Hill). The C++ object model project was originally called "the simplifier" by Stroustrup, but Lippman renamed it "C++ object model" so he would be able to sell his book, "Inside the C++ Object Model," to Addison-Wesley. By this time the talk was somewhere more than thirty minutes past its time slot and Lippman simply stopped in the middle of the slide and handed the show over to Jim Hogg.

    PDC05: Day Two (PDC T-Shirts)

    This year I brought my old PDC t-shirts with me to wear. I brough 1996, 1997, 2000 and 2001. I am missing the shirt from the last PDC here in Los Angeles. I plan to wear this starting with my Long Beach PDC 1996 on Tuesday. Remember 1996 was the "Dawn of Distributed Computing."

    PDC05: Day Two (Breakfast & Lounging)

    I managed to sleep until 5:30am today, so at least I am shifting to my new timezone quickly. After posting all of my blog entries from yesteday and cleaning up some bag tagging (naughty blogger.com), Robert brought my PDC bag down from his room. For the record I agree with John Moody, the bag is too small for a full sized laptop. We went to The Coffee Bean & Tea Leaf for a cup of Gold Tip Assam, then walked to the conference.

    The contintental breakfast really hit the spot for both of us, but with time to kill we went over and chilled out in the "Tools & Languages Lounge" area. The couches are great, but not as nice as "Soft Seating" back at work. Today I am signed up for the "C++ Internals" talk, which I gather from yesterday is part two from the same crowd. Robert is still tossed up between "C++ Internals" or "Framework Design Guidelines: Designing a reusable class library." Based on my experience yesterday, I fully expect the "C++ Internals" session to be packed full of technical detail. Anson Tsao and Brandon Bray are tops in my book and that is reflected in my session evaluation.

    PDC05: Day One (Korean Barbecue & Billiards)

    I was out of my last session almost an hour after Robert finished. As soon as we met up dinner was the only thing on our minds: Korean barbecue at Seoul Jung. We met up with two guys from Pitney Bowes, one of whom was in the same session as I. On the way back to the Wilshire Grand we passed this car, which Robert and I had seen earlier as part of a movie set. At the Wilshire I fetched my bag from the bell captain and made the nervous treck to my new room. It is absolutely perfect. The whole floor is set aside for non-smoking rooms so there is only good to say about it. Thank you front desk! After unpacking I went downstairs to meet Robert for dinner.

    The Seoul Jung was the adventure we had hoped for when we picked the restaurant. We were seated in just a few minutes at a table near a carved granite sphere which was spinning on a bed of water. The menu had a number of interesting items, but the Robert seized on the dak bool go gi (marinated chicken breast) and I eventually settled on ka ri bi gui (marinated jumbo sea scallops). Somehow Robert and I had managed to exude a certain "we know all about Korean barbecue" air so as dishes started to arrive there was no explanation. I looked over to Robert and asked if he knew what he was doing, "Nope." I was in precisely the same boat. When the waitress came back by I confessed our utter ignorance of the dishes before us and she said "That is salad," which made both of us laugh a little bit. She then gave a thorough introductiont to the various items we were to snack on while the barbecue was cooked in the center of the table.

    Robert enjoying some of the dak bool goo gi (barbecued chicken).
    I am looking frighteningly wired and posing with a tasty morsel of ka ri bi gui (scallops).

    We both ate heartily after so many trips back an forth to the Wilshire and extremely long sessions today. The sound of the barbecue was the dominant one at the table until we had finished. After dinner we decided to head over to Point Moorea again for a nightcap. The two pool tables were free and so we played, quite terribly, until I noticed one of the guys from Pitney Bowes walk in. Pete indicated that he had not played pool regularly in a long time. I too have not played regularly in a a long time, but the difference between our games could not be more striking. He had a long, clean stroke with perfect follow, great selection and excellent leaves. It turned out that a long time for Pete was four months and a long time for me was nine years. Robert enjoyed contemplating the mechanics of the game as we three played cutthroat. Actually, Robert and I mostly watched in awe as he consistently won game after game. Finally, time to hit the sack arrived and I gave him a card in hopes that we might watch him play again. Pete was a great guy who we both look forward to meeting again soon.

    PDC05: Day One (Versioning & Servicing in VC++)

    At first I thought this was going to be another presentation with a topic just outside of my area, but boy was I wrong. The topic "Versioning & Servicing in VC++" by Nikola Dudar was focused around the new deployment story for Microsoft. Now, I am no expert in deployment, but the people who were experts got hot about what was said. There are presently three ways to deploy DLLs to the Microsoft platform:

    • System32 (or path)
      The oldest technique, and the very source of the phrase "DLL Hell," is the first option. Windows redistributables are all installed in a common area, which can lead to other packages replacing your stable versions of say MFC42.DLL with a different version. This is the least preferred option for installation.

    • App-Local
      This technique allows ISVs to install even redistributable DLLs into the application directory, effectively ignoring the shared versions elsewhere. This means that no other application will overwrite your stable versions of the DLL and cause you problems.
      Nikola told of the recent GDI+ problem and how, since it was deployed app-local by so many vendors, servicing it was next to impossible for Microsoft. This is where the story really heats up later...

    • Side-by-Side
      The newest plan from Microsoft for recent operating systems only. This technique has specific versions of a DLL installed in a common location and applications contain a "manifest" which says "load this version of this DLL set." It is probably a good approach, but it is somewhat related to DLL Hell.
      The VC++ 2005 compiler includes some new tools and mechanisms to make Side-by-Side much easier to handle as a deployment story.
    The tale heats up when Dudar mentions that once developers upgrade to VC++ 2005 App-Local deployment will no longer be: recommended, supported, or within the terms of the VC++ 2006 EULA.

    The question and answer period went on for about an hour with a back and forth about Microsoft's effective ban on the App-Local deployment, which was the preferred strategy until very recently. The final analysis is that Microsoft promises not to make breaking changes to shared redistributable DLLs. While I wish that were true, I suspect ISVs are now stuck with this deployment problem just to make Microsoft's servicing problem easier. The discussion continued until 6:30pm, when all parties gave up out of a desire to eat.

    PDC05: Day One (Resource Management in Managed Code)

    After a brief break, Anson Tsao took the stage again with "Resource Management in Managed Code." Much like his previous talk, he began with a core position which the talk would be based on: "garbage collection is not resource management." He made an excellent case that the focus of garbage collection is memory in particular rather than resources in general. Since developers new to garbage collected systems often overlook this distinction, resources are the new major element being leaked. For instance, failing to explicitly release WinForms objects, which are really wrappers around an HWND, can lead to HWND depletion and a resource shortfall.

    He provided a list of common pitfalls:
    • Keeping references to dead objects (always NULL your handles)
    • Implicit boxing
    • Pinning young objects (causes gc heap fragmentation since it blocks compacting)
    • GC.Collection considered harmful (it screws up the heuristics)
    • Finalization (too late for releasing resources)
    The last point is more complex than it seems. He indicated that even though finalization is not where you ought to release resources, you should still do it there as well as a "just in case" step, however, your handles might already be gone.

    He then provided a list of new tools available in Visual Studio 2005 which can help with resource management:
    • auto_handle (smart pointers for managed objects)
    • SafeHandle (deals with releasing OS handles in long-running processes)
    • HandleCollector (hints to the gc to run a collection cycle when the handle count is too high)
    • AddMemoryPressure()/RemoveMemoryPressure() (tells the gc to ignore blocks of native memory, which would otherwise signal a memory shortfall to the gc)
    • msclr::com::ptr<> (provides a smart pointer system for managed code using COM objects)
    • protected regions (still not clear about this one...)
    • CLR Profiler Beta 2 (download)
    The talk was simply excellent and I walked away with a large number of tools which will be essential when we start to switch from unmanaged to managed code. Of all the presenters so far, Anson is the best on technical depth and clarity.

    11 September 2005

    PDC05: Day One (Managed/Native Interop Patterns)

    Anson Tsao picked up where Bray left off with "Managed/Native Interop Patterns." His core position was that most developers will not be in a position to completely rewrite some significant block of code. The best approach to get the new libraries like WCF (Windows Communication Framework) and WPF (Windows Presentation Framework) and WinFX (the new Win32?) into usage is refactoring. With this baseline he proposed a number of great patterns to make refactoring the new model into place much easier. They all seemed to fall into Facade, Bridge or Adapter extensions. From what I can tell interface-based-programming is the new coding religion in Redmond, which is by no means a bad thing.

    There is one particular slide which outlines a design for a WinFX adapter pattern which I really want to show people at work, but the slides are not online for me to reproduce here. During the question and answer period a vital caveat came out. One of the attendees asked about how much would have to be recompiled with the /CLR switch to implement some of these suggestions. Tsao leaned toward as little as possible and pointed out that Quake II is 15% slower if you compile the code unchanged with the /CLR flag. The process working set is also significantly affected. A good rule of thumb for the cost of managed code interop is that the cost is proportional to the number of parameters in the method.

    Unfortunately, the next person Nikola Dudar (blog) spoke about MFC and WPF, and since I do no work with MFC I am instead sitting here writing this entry.

    PDC05: Day One (C++ Considerations in .NET)

    The second presentation was "C++ Considerations in .NET" by Brandon Bray (blog). My brain still hurts from this presentation! It was absolutely excellent. He talked a lot about the new C++/CLI language extensions for experienced C++ developers. His example code was for an Adapter which makes STL iterators available as an IEnumerator object. I wish I had written down the Current() method from his code sample, it was astounding. He was a smooth presenter with some excellent content, and did a good job peparing us for the next person who would speak after lunch.

    Robert and I walked up to the Wilshire since breakfast was still sitting heavy for both of us. The same front desk clerk was able to move me to a new non-smoking room. He asked me worriedly if a two bed room was alright, but provided it was smoke-free there could be a cot in there! I thought about going up to check out the room until I noticed that we were running out of time. We rushed back to the conference with thoughts of Korean barbeque for dinner tonight. We arrived in time for the next block of presentations.

    PDC05: Day One (Putting Patterns in Perspective)

    The first presenter was Stanley Lippman (blog) whose talk was called "Putting Patterns in Perspective." His presentation style catches you off-guard right away. At first he sounds a little lost and rambling, but then with a sudden switch everything he said before all makes a lot of sense. He made a very convincing argument that all information goes to entropy and that code is information, so all code goes to entropy. I was particularly moved by his way of explaining how developers are unavoidably embedded in the code they write. In a 2D animation the perspective of the artist is built into the way the picture is rendered (he said, "[their] eye is baked into the picture"). I think developers and their software are really the same way. A particular pattern he discussed was Cargill's Pattern ("Localized Ownership: Managing Dynamic Objects in C++" by Tom Cargill).

    The talk then took a very interesting step into a higher altitude. The first step was a pattern for projects which he called the Innovation/Polish Index (IPIx). His view was that in the begining of a difficult project the question is more about "is this possible" rather than "is this the best design." For this phase you need pioneer/scout-style developers. Once the project is established the focus turns to polish, which shows the original design errors. The types of developers on this second phase are quite different. From my point of view this was the difference between invention and production, but I can say I had never contemplated it as a pattern. He then turned the discussion to careers. Many developers take the management track when they reach a certain point. The other option, as he saw it, for people not interested in management is the "Guild Manager" or an expert and trusted maintainer of a large, difficult codebase. He then turned to languages as a pattern and the idea that all languages will fade from popularity. Perhaps, he suggested, that if languages compiled to MSIL then even when the language ceases to be popular, devotees could continue to use it in a multi-language context.

    The question and answer period was very interesting and entertaining. Another attendee asked if there was any plan to have tools which take MSIL and display it in a user configurable language: I write C++/CLR, compile to MSIL and then Bob reads that same MSIL and displays is as VB.NET. Lippman found that to be a very interesting idea. Then I asked a question and got into trouble. I said I was trying to build a career as a Guild Master, or something, because "I had been on the mangement track and it sucked." Lippman chastised me for being vulgar, for which I did apologize. I reminded me of the PDC at Long Beach where Don Box walked up behind me while I was saying a pre-conference session was boring since it review much material most of us already knew, though it was a hoot to see someone so well known in distributed systems giving it. Don was apparently very fond of this person and proceeded to verbally whip me a good one. I felt pretty bad then too. I better never go for a job at Microsoft, that is for certain! After Lippman was done telling me I should not be vulgar, since it alienates people, he did give a good answer. He suggested that the Guild Master's job was really to keep a valuable corporate asset (the code) from going to entropy. This is a substantial task and requires real, difficult to replace skill. I was too embarrassed to follow up the question, but I would have asked if Guild Masters also need to be pioneer/scouts so they can reinvent themselves periodically. I wonder what he would say...

    PDC05: Day One (Breakfast & Registration)

    Robert and I went down to The Original Pantry Cafe for breakfast. We each ordered two pancakes, they are huge, one egg over and hash browns. I took the next step and added bacon, thick cut and cooked to perfection, which I shared. The restaurant was just as great as I remembered it. The breakfast was big and delicious and fast.

    We then walked down to the conference center to register and pick up our gear. This year there is a great bag and it can fit my laptop! The t-shirt is less interesting than in previous years having been inspired by the new less-is-more design style popular since the iPod. It may grow on me. We stopped to take pictures of the finish line for the Los Angeles Triathlon.

    As the morning front desk person suggested I returned at 9am to try for a new, non-smokey room. We arrived a little early and sat in an inactive lounge area to fire up the laptops and paw through our gear. Just as I went to check out some code I found myself shut off from the corporate network. I had forgotten to change my password before leaving work Thursday and my 90 day timeout had expired! I am such an idiot. Though I felt terribly about it I called our systems manager on his cell and asked, when he got the chance, to help me out. The fellow I spoke with had nothing available yet and suggested I check later.

    Robert and I left for the first pre-conference session (Windows Internals for him and C++ Patterns and Practices for me). Back at the conference and just before the session started the systems manager called back and I was saved. He described what to do and before you know it I had access to the corporate network again. What a hero!

    PDC05: Day One #1

    I failed to stay up late enough last night so here I am at 3:45 am local time unable to sleep any further. At least I had gone to bed at 8:30pm local time, so I have had more than enough rest. I was added to the PDCBloggers.net attendee blog directory, so now my pointless nattering will be shared. Today is the start of the PDC Pre-Conference. I have signed up for the two C++ tracks: C++ Patterns and Practices and C++ Internals. Ooh! The Birds of a Feather tracks have been announced, this is what I signed up for:

    9:00pm-10:00pm.NET vs. Java (I ought to attend the Avalon UI BOF)
    All zealots are welcome! Let the religious wars begin! What's better, .NET or Java? Is one stealing ideas from another? Both platforms have recently released new versions, which one provides better strategic vision and foundation for development? Join our friendly debate.
    Visual Studio 2005 Team System -- Blessing or Anathema?
    Visual Studio 2005 Team System clearly plays a role in increasing the productivity and predictability of software development through the careful integration of tools and process. There are many positive aspects the product suite professes that may very likely herald a new era of efficiency for software architects and developers. Is all what Team System promises a good thing? Are there drawbacks to this approach? Join us to discuss what you feel are the best and worst things about the Team System vision.

    Tuesday is a split between tracks I really ought to attend and tracks I really want to attend. I am going to .NET vs. Java so I can just to sit back and watch the feathers fly, a sort of WWF for geeks. I probably ought to be going to the Avalon UI session. The Visual Studio 2005 Team System I really need to attend to hear both sides of the VSTS story, but I also want to attend Future of the Deep Coder.

    We are split at work between going to VSTS or moving away from back-end Microsoft tools and using something else. We already moved to Visual Build Pro for our nightly builds when we made the switch to Visual Studio.NET (2003). I cannot say enough good things about Visual Build Pro: easy to learn easy to configure, capable of quite rich builds and just all-around awesome.

    9:00pm-10:00pmSQLCLR - Best Practices
    SQLCLR integration creates great opportunities to develop and define your own datatypes, aggregates and functions. But these opportunities also have a dark side, so it is very important to discuss principles of architecture, deployment, versioning and especially defining/checking the compliance to SQL - Standard rules of custom datatypes and functions.
    Your Favorite Design Patterns (error in vCalendar)
    The idea of this session is to give the audience an opportunity to talk about their favorite design patterns in .NET, and how people can benefit best by using them. The patterns do not have to fit the designs mentioned in the "Gang of Four" book, they just have to be something that can be used for day-to-day problems faced by developers. The patterns should focus more on increasing developer productivity than just be cool. I am more than willing to moderate :)

    The vCalendar file associated with this session is marked as a "lunar schedule," so Outlook cannot import it.

    I voted for three of the four Birds of a Feather sessions I am attending: VSTS, SQLCLR and Design Patterns. I feel like I just got a good answer from the Magic 8-ball: "Signs point to yes."

    Now I have to check-in the code changes I made on the plane. If the developers who worked on Visual Studio's "Work Offline" feature read this: YOU ROCK! When we upgraded to Visual Studio .NET (2003) it was the new interface feature I loved most (remembering that "interface" excludes better ISO C++ and a new STL). I have used the feature extensive when I code away from a network connection, my many thanks go out to the mystery coders of "Work Offline."

    10 September 2005

    PDC05: Day Zero #2

    Robert and I took some air by walking around a bit in LA. The entire city looks essentially abandoned on Saturday evening with most shops closed. We did spy the planned site of our morning breakfast: Pantry Cafe. I intend to get up and hit the Coffee Bean and Tea Leaf for a good cup of tea. Once Robert and I are both up and ready we are going to have breakfast at the Pantry Cafe and then walk to the convention center for the first pre-conference session. All that happens tomorrow...

    After our walk we headed back to the hotel for some food. We did not want a big meal at one of the fancier places here in the hotel, though Korean barbecue sounds good. After looking around we opted for hearty snacks at the Tiki place (Point Moorea). We split a block of small snacks, all of which were good. At least the food is redeeming this hotel.

    PDC05: Day Zero #1

    The first flight, from Portland, Maine to Newark, New Jersey, was largely uneventful except for the genuinely funny flight attendant. She made the in-flight safety lecture quite entertaining to listen to; heck even my air-jaded co-worker listened for the first time in ages. After some initial delays we landed just in time to grab some sushi and iced green tea from a shop called "Wok & Roll." The sushi was passable and the green tea iced tea was excellent. How could it be otherwise? The second flight provided a bulkhead seat which gave me ample legroom to get three hours of work in. I finally found and fixed a performance problem with the topological analyzer I have been working on. The issue has been on my plate for some time but meetings, meetings, meetings.

    The second flight went by invisibly due to the concentration I had on the code mystery before me. The only notice I took was of a strange habitation style somewhere between Texas and Arizona. From 35,000 feet it looked like a network: long roads connection geographically diverse small land plots. This was not the grid-oriented land arrangement I am used to from the Midwest, but rather warren-like in appearance. I wonder what it was. We arrived early in Los Angeles, hopped onto the Super Shuttle and zoomed to the Wilshire Grand. I know it has only been a few hours, but here is my immediate take. The restaurants look quite good: City Grill (American), Cardini Ristorante (Mediterranean), Kyoto (Japanese), Seoul Jung (Korean barbecue) and Point Moorea (Tiki bar). The location is excellent: quite close to the conference and to the city center. All good points so far, but...

    The room is small, smells like cigarette smoke and is a little dirty and worn. It reminds me of the Boston Park Plaza which exists largely on its historical reputation. The front desk assures me this is not a smoking room. Do they even exist anymore in California? I still smells like hell and I probably will too before the end. Now I wish I had stayed in the Omni Los Angeles again as I did last time.

    I am meeting Robert to decide on dinner soon, here is to hoping it comes out better than my room has...

    PS. They are also struggling to provide the bandwidth already being consumed by pre-conference attendees. I wonder how that is going to shake out later in the week. At least it is free! Which should be listed as another positive.

    09 September 2005

    PDC05: My Schedule

    When some people think of technical conferences they imagine corporate junkets for geeks. While I will admit there is a certain amount of that, one need look no further than the Wednesday schedule to see how much work is really involved. On that day I have a mere 15 minutes to depart "IIS 7 Extensibility", grab a quick lunch pack, and find a seat for "C++ Optimization". The Thursday schedule includes sessions all day and then "Ask the Experts" and "Birds of a Feather" until midnight.


    C++ Patterns and Practices
    C++ Patterns and Practices (continued)


    C++ Internals

    C++ Internals (continued)

    Birds of a Feather (I voted for these sessions)


    Keynotes (Jim Allchin?)
    11:45am-12:30pmTLNL01Tips & Tricks: Extending MSBuild with Tasks, Loggers, and Targets
    "Building" on the fundamentals of MSBuild, this tips and tricks talk takes you through ten super cool ways you can optimize your build process-from using the MSBuild object model, to adding new types. In the end you'll walk away with a toolbelt full of knowledge that will make your application build process sing!
    VSTS: Behind the Scenes of Visual Studio 2005 Team Foundation Server
    Drill into Visual Studio Team Foundation Server. Learn how it works under the covers. Hear about how the Version Control System leverages SQL Server. See new and enhanced features since beta 2. Walk the 'core' Team Foundation Server services, learning how to customize and extend the server using registration, linking, evening and security/authorization services. Finally, Brian Harry, Microsoft's Product Unit Manager of the project, shares lessons learned building this high scale distributed application (multiple cooperating servers and clients, geographically distributed) on Windows .NET 2.0 a...
    Windows Server "Longhorn": What's New for Developers
    Longhorn Server is Microsoft's next version of Windows Server. In addition to describing all the developer oriented technologies shipping in Longhorn Server, this session also demonstrates how these technologies will work together. In this session, gain a deeper understanding of the overall application platform by going through specific scenarios that highlight the benefits of combining these technologies. Finally, this session discusses techniques and technologies you can use to ensure that your applications are well behaved citizens in the data center.
    Windows Presentation Foundation ("Avalon"): A Lap Around the Windows Presentation Foundation
    Windows Presentation Foundation (formerly codename "Avalon") is Microsoft's new presentation technology for Windows that provides an integrated way to interact with the user interface, documents, and media technolgies used in your application. This session introduces many of the core concepts in the Windows Presentation Foundation programming model, such as XAML, layout, controls, resources, styling, and databinding. Using Visual Studio, we build a Windows Presentation Foundation based application from scratch. If you have never seen an introduction to Windows Presentation Foundation, this se...

    Expo Hall reception

    Birds of a Feather (I voted for these sessions)


    General Session
    COM406IIS 7 Extensibility (Part 1): Building New Core Server Modules
    IIS 7 lets you easily extend the Web server in ways that have never before been possible. In this session, learn how to take advantage of the new extensibility model to quickly build and deploy very powerful server components that can extend or replace almost every aspect of the server. If you have ever written an ISAPI filter, an ASP.NET HTTP module, or wanted to implement your own custom authentication, URL forwarding, or logging infrastructure, this session is for you. In part one of this two-part series, we cover how to build core server modules with both the native APIs and managed code, ...
    Tips & Tricks: C++ Optimization Best Practices
    Learn new tips and tricks for using the C++ compiler to generate the best performing and most optimized code possible. These tips span both unmanaged and managed C++ optimization.
    "WinFS" Future Directions: An Overview
    "WinFS" bridges the traditional gap between databases and file systems to enable new scenarios for developers. In this session, learn how "WinFS" will unify data of all types across applications, enable new organizational constructs for working with data that go beyond folders, and provide new mechanisms for exploring data that go beyond traditional browsing and search.
    C#: Future Directions in Language Innovation from Anders Hejlsberg
    Join Anders Hejlsberg, Distinguished Engineer and chief architect of the C# language, for an in-depth walkthrough of the new language features in C# 3.0. Understand how features like extension methods, lambda expressions, type inference, and anonymous types make it possible to create powerful APIs for expressing queries and interacting with objects, XML, and databases in a strongly typed, natural way. It is suggested that you attend "The .NET Language Integrated Query Framework: An Overview" before attending this session.
    Windows Presentation Foundation ("Avalon"): Integrating with Your Win32/MFC Application
    Windows Presentation Foundation (formerly codename &quot;Avalon") is great for writing a completely new application, but what if you have an existing Win32/MFC code base? Learn how you can create mixed Win32-Windows Presentation Foundation applications, both by putting Windows Presentation Foundation content inside of Win32 HWNDs and by putting HWNDs inside Windows Presentation Foundation content. See how to integrate Windows Presentation Foundation into your DirectX applications (by using DirectX on an HWND). A related talk is PRS321, which covers combining Windows Presentation ...

    Attendee Party: Universal Studios


    General Session
    FUN412Five Things Every Win32 Developer Should Know
    The top two factors that control performance are I/O and memory. After exploring the relationship between physical memory, virtual memory, and the virtual address space with popular Win32 blogger and Microsoft developer Raymond Chen, we mix in some knowledge of how CPUs work and see how an O(n) algorithm can outperform an O(log n) algorithm: Why much of what you learned in school simply doesn't matter. Shift gears to Win32 and the window manager and after a brief discussion of the difference between parent and owner windows, we discuss the hazards of attaching thread input (and how it happens ...
    empty timeslot
    Tips & Tricks: Common Memory Management Pitfalls and Profiling for Managed Applications
    This tips and tricks session covers common mistakes with micro and macro (i.e. long running) perf scenarios. We also discuss how to measure and profile your applications to locate sources of memory leaks and/or large pockets of consumption.
    Using the .NET Language Integrated Query Framework and Relational Data
    SQL Server 2005 CLR: Under the Hood on How We host the CLR
    Database-centric applications have traditionally had to rely on two distinct programming languages: one for the database and one for the application. This session introduces future advances Microsoft is making for the "Orcas" release of Visual Studio in programming languages and frameworks to help integrate relational data and queries with C# and Visual Basic. These advances enable developers to express queries and updates in terms of their local programming language without sacrificing the server-side execution model of today's high-performance SQL-based approaches. Using these advances, data...
    SQL Server hosts the Common Language Runtime (CLR) in process. This session explores the inner workings of the SQL Server-CLR relationship and discusses how SQL Server ensures that CLR code runs more safely, securely, and efficiently. In addition, this session covers how database administrators and developers can use various tools such as performance counters, dynamic management views and catalog views to monitor and troubleshoot the execution of CLR code inside SQL Server.
    Windows Vista & "Longhorn" Server: Under the Hood of the Operating System - System Internals and Your Application
    Ever wondered what drives all the cool things you see in Windows? Want to know more about new technologies that power Windows Vista and "Longhorn" Server? In this session, experts from the core architecture team review several significant enhancements to the service model that will help you write more reliable Windows services. We discuss what 64-bit development means to you, as well as cover how your 32-bit application can work even better in the Win32-On-Win64 subsystem (WOW64). Lastly, we dig into what is new with that most venerable store, the registry, and tell you about the new infrastru...
    Windows Vista: Using Win32/WinFX Integration to Light-Up on Windows Vista: A Cast Study
    Wondering how to integrate Windows Presentation Foundation (formerly code named "Avalon") for rich UI, Windows Communications Foundation (formerly code named "Indigo") for flexible communication and other great Windows Vista features into your application? Want to see what's really involved in making your software "light up on Windows Vista?" Using the Windows XP version of the Internet Hearts game as a case study, this session highlights strategies and best practices in augmenting large Win32 code bases to incrementally take advantage of new WinFX and Windows Vista specific functionality.

    Ask the Experts

    Birds of a Feather

    The A9 Problem

    So I am off to Los Angeles for the Microsoft Professional Developer's Conference (PDC). It is worth noting that I am a tea junkie, occasionally called a "tea punk" by my friends. Whenever I travel I like to find a good place to have a cup of tea in the morning before the conference starts up. The last time I was in LA I went to a fine little establishment called "The Coffee Bean and Tea Leaf." They had wonderful tea, delightful scones and friendly staff, the perfect morning combo. I wanted to find out if the store was still there and if not where else I ought to go for tea. This is where A9 comes into the picture.

    A9 is an Amazon company whose mission statement sounds more like bragging than corporate direction. People at work are unbelievably excited about A9 and the possibilities of storefront mapping. If you aren't familiar the idea is to have a truck with a GPS and a camera or video recorder fastened to the top of the vehicle. As the truck drives down the street it takes a constant stream of pictures and associates the images with a location from the GPS. There is fancy software in the van which makes up for the "urban canyon effect", which prevents a GPS from accurately reporting position. The pictures taken at, or near, a location are then tied with the location of a business by geocoding and viola for a given business you can show a picture of the storefront.

    As a cynical guy, I found the whole idea totally unworkable and so I tested A9 a few weeks ago. In two words "it sucked." I searched for Chinese restaurants in New York City. Of the top ten results, nine of them had pictures listed. I examined each of the nine pictures and found that six of them, the top six, showed vacant lots, sides of trucks or the wrong location. For instance, the first result is Kam Sung Chinese Restaurant with a picture depicting the spray-painted side of a building. The actual restaurant is four photos to the right and even that picture is partially blocked by an SUV.

    This time I searched for "tea" and "figueroa st, 90017" (I had to use the ZipCode since "figueroa st, los angeles, ca" failed). The results page included a reference to 'The Coffee Bean and Tea Leaf,' in the lower right-hand corner. The picture it showed was the intersection four pictures to the right of the store. If I did not know what I was looking for the picture would not have helped. I noticed, however, there was a series of checkboxes below the image with icons allowing me to "walk left" or "walk right."

    Since I had been there before I knew it was left a few steps, so I clicked "walk left" and found another A9 problem. The direct shot of the store was bathed in bright sunlight for the right hand 50% of the picture. Though I knew the store was there, the sign was hard to read because the camera had been overwhelmed by the sunlight reflecting off of the building. This is one of the problems encountered by aerial photography. The cloudcover, sunlight level and angle of the sun are all vitally important. You can see this mistake in the aerial photography of Los Angeles in Google Maps (and Google Earth). The poor sun angle of the imagery in Google make the buildings look like the are leaning over, an optical illusion created by the extreme shadows. In the case to the right, however, the problem is created by the sun angle being two low relative to the truck and lighting the building. If the sun where more overhead the shadows would be on the ground rather than on the wall of the building. I suspect the A9 folks are probably being more careful about driving only when the sun is directly overhead, particularly in large cities.

    A9 did manage to redeem itself with what appears to be a new feature. I noticed a row of checkboxes below the image list, when I hovered the picture a piece of text showed beside the box: "Best Image?". I selected the picture one more to the left, which depicts the store in 80% shadow. The sign was more readable even though the store was not filling the photo region and the doorway was hidden by contrast. I selected the checkmark and A9 registered this particular picture as best representing the store. This allows people using the site to fix the geocoding by marking the appropriate picture, a good way to handle data quality issues. It is susceptible to misuse since a competing business could shift away from the proper image by checking a box which does not properly depict a location. I imagine A9 will work that out down the road.

    In the end, my view on A9 is interesting but not useful. With more experience, better geocoding and a better corrections system A9 might become useful in the future, but that is probably a bit further in the future.

    08 September 2005

    iTunes 5.0 Upgrade and Podcasts

    It seems like each time I upgrade my iPod firmware or the iTunes application, there is some terrible consequence. The last firmware upgrade scrambled my play count and ratings on the songs in my library. I had to start over with no play counts and no ratings, which screwed up a number of playlists.

    This time after upgrading from iTunes 4.9 to iTunes 5.0 I found my podcasts directory was empty. The forum at Apple has a useful customer suggestion involving dragging around playlist. Now I admit the problem was not too severe and the features and look of the new iTunes is excellent, BUT how about getting that QA department in gear, Apple? I work in software development so I realize development misses problems and QA misses problems and usually some number reach the customer. The podcasting feature is the newest hot feature of iTunes, so I would have expected it to recieve a little more QA attention than it apparently did.

    Better luck next time.

    PS. The iPod Nano is h-o-t hot!

    07 September 2005

    Adrian's Honeymoon Blog

    Adrian has finally broken out into the blogging world with "Maiden Voyage". He and Heather are going to write about their twelve-day honeymoon cruise through the Mediterranean. The first post is about their visit to the Vatican and worst cannot convey how totally jealous I am (now I have to put in freezing water during my stay in Hell). They are having a great time and I cannot wait for him to get back and share the pictures of the amazing places they have been. Best wishes for the best trip ever!

    Their wedding, which I attended last weekend, was totally awesome. It now tops out as the most kid-friendly wedding we have ever been to. It also tops out as the strangest. Adrian won $100 by stripping down to his jockeys and diving into the cove at the Merriman Compound. A moment never to be forgotten and me without batteries for the camera!!

    02 September 2005

    PDC05 Birds of a Feather Voting

    This year you can cast your vote for the Birds of a Feather sessions which most interest you (see CommNet). Previously I had voted for only two, but with the voting period extended for a few more days, I selected a few more. These are the candidates I voted for:

    • The idea of this session is to give the audience an opportunity to talk about their favorite design patterns in .NET, and how people can benefit best by using them. The patterns do not have to fit the designs mentioned in the "Gang of Four" book, they just have to be something that can be used for day-to-day problems faced by developers. The patterns should focus more on increasing developer productivity than just be cool.

    • Visual Studio 2005 Team System clearly plays a role in increasing the productivity and predictability of software development through the careful integration of tools and process. There are many positive aspects the product suite professes that may very likely herald a new era of efficiency for software architects and developers. Is all what Team System promises a good thing? Are there drawbacks to this approach?
    • SQLCLR - Best Practices
      SQLCLR integration creates great opportunities to develop and define your own datatypes, aggregates and functions. But these opportunities also have a dark side, so it is very important to discuss principles of architecture, deployment, versioning and especially defining/checking the compliance to SQL - Standard rules of custom datatypes and functions.
    • What does this PDC mean for Mort? Is it a .NET PDC (i.e., will it change your world) or is it a Hailstorm PDC (i.e., much sound and fury, signifying nothing)? Come discuss the impact of Microsoft's latest technology with other Morts. You can bring your Elvis and Einstein friends, if they promise to behave themselves.
    • Discuss ways to make applications return "smart" information when dealing with multiple nationalities that need to be viewed at the global level as a common entity, but at the regional level as the local nationality. Discussion could include currency exchange conversions (how to implement, when to convert), combining data from different systems, and more.
    • A recent article proclaimed that deep coding is on the decline with little chance of revival. The days of locking yourself in a room and exclusively coding are slowly fading. The industry seems to be moving toward systems driven by "software connectors" allowing users to customize programs to their needs with less developer intervention. What is the future of developers who thrive in the depths of code? How scarce will jobs for deep coders become? How will these developers adapt to a more modularized and component based future of software development? And, finally, is the future of software going to become a plug-and-play proposition where the need for deep coding is gone?

    PDC Bloggers and PDC Underground

    I am going to attend Microsoft's Professional Developer's Conference (PDC) in Los Angeles this year. Though I was contemplating it skipping it after the disappointing initial announcements regarding Microsoft Visual Studio.NET 2005, the content looks great and the developer tools story is improving so I changed my mind. In an upcoming blog entry I will list my breakout itinerary, but there are two sites I just ran across which are pretty interesting:
    • PDC Bloggers
      This is a site which filters news from the media, Microsoft bloggers and geek bloggers. It provides a steady stream of interesting content about the PDC. I just registered "Dispatches from Maine" on PDC Bloggers since I plan to write quite a bit about the breakouts while I am there.
    • PDC Underground
      What on earth is this? It sounds like a cool geek party with possibly worthwhile content. I might register for it.