Critical Development

Language design, framework development, UI design, robotics and more.

Archive for October, 2008

A First Look at Windows 7

Posted by Dan Vanderboom on October 30, 2008

During the keynote on Tuesday, Ray Ozzie made a point of stressing the advantages of each of three user interaction modes: desktop, phone, and web; and all the speakers’ topics revolved around this central theme.  The key points were that systems which use all three are capable of delivering the greatest value, that providing an integrated experience across all three will become increasingly common, and that Microsoft is committed to encouraging these platforms to work together.  This will be accomplished through Windows Azure (cloud services), Live Services, SQL Services, and so on.  (See my article on Windows Azure for more details.)

Ray Ozzie did a great job presenting.  I’ve seen Bill Gates speak, and while he’s obviously very intelligent, he left a lot to be desired when it came to projecting a presence in front of an audience.  I have a lot of faith in Microsoft under Ray’s direction; he’s obviously a charismatic leader with a passion for technology and the value it provides.  Humorously enough, Ray’s favorite big word during his Tuesday keynote was “nascent”, which became a talking point for several of the speakers: notably Don Box and Chris Anderson.  So let’s talk more about these nascent technologies!

RIMG0086

The Taskbar & UAC Improvements

You have to admit, in looking at the taskbar of Windows 7, that it looks a bit more like the Mac’s.  Icons can be reordered by dragging them, similar to Taskbar Shuffle, and text describing the task name is conspicuously absent.  This is a welcome change; as many windows as I have open throughout the day, this text and the horizontal space it occupies has always been a nuisance, especially as it becomes squished and abbreviated to the point of uselessness.  The icons can be large or small, and the space between them adjusts depending on how many there are.

Just as multiple windows in the same application can be grouped together in the taskbar, windows are grouped into these new icon-only buttons.  Hovering over one brings up a submenu in the form of a set of large window thumbnails.  Hovering over one of these brings that full window temporarily into view.  You can also close any of these windows from their thumbnail representation (with a small X that appears when hovered over).  Although it sounded like a good idea when window grouping was announced for Vista, I’ve always found the actual implementation annoying, and I always turn this feature off, but Windows 7 provides a superior experience of grouping windows that I’m actually looking forward to using.

System tray notifications can be customized, putting the user in complete control over these pop-ups.  You can even control which icons, on an individual basis, appear in your system tray, and which remain hidden.  This is a subtle change, but is nevertheless nice if you have a lot of these icons.

User Access Control (UAC) has also been improved.  A joke was made of the negative feedback they had received about this intrusive feature, and in response, Microsoft has now included a way to control the level of protection UAC provides, similar to the security level in Internet Explorer.

Media, Multiple Monitors, and Multi-Touch Support

Media in Windows 7 can be shared across all computers in your house.  You can play them from Windows Explorer, Media Player, and a lightweight version of Media Player.  Music, videos, and other media can be played to a specific device, such as another computer, or on your home entertainment system.  A new Explorer context menu option named Play To provides a list of discovered devices.

As a user and strong supporter of multiple monitors, some of the most exciting announcements were the improved support for multiple monitor scenarios.  There have been several enhancements to multiple monitor setup and configuration, including support for connecting to multiple projectors for presentations.  This feature was demonstrated and used during the keynote itself.  Another impressive addition is support for multiple monitors in Remote Desktop.  Hopefully this ability will also filter down to Vista and XP.

The multi-touch HP computer was shown off, which has been commercially available for about $1,500.  Special drivers and updates have been made to enable touch for things like scrolling through lists and other containers, without applications needing to be aware of the multi-touch hardware, and applications taking advantage of the new Windows 7 multi-touch API can do more, such as the pinch gestures for zooming or throwing objects around the screen with simulated physics effects.  The HP computer uses two cameras in the upper corners of the screen, which means it is subject to shadow points that four-camera and (to a greater extent) rear-projected multi-touch panels do not have.  Shadow points occur when one touch happens higher on the screen (within view of the cameras), and a touch or motion occurs below that, obstructed by the higher touch point.  Some of this can be compensated for by algorithms that make good guesses of touch and motion based on position, velocity, and the assumption of continuity of motion, similar to the way our own brains fill in details that we’re unable to perceive.

The primary disadvantage of the HP touch computer is the tight coupling between the multi-touch screen and the rest of the computer hardware.  I personally feel this is a bad design, though I’m sure it serves some business need to lock in consumers to HP computers at least this early in the game, when there aren’t many multi-touch monitor options out there.  At the Windows 7 booth on the conference floor, however, they did have a 42 inch LG monitor set up with a multi-touch add-on screen that fit right over the monitor.  The company that manufactures these, NextWindow, has offerings for screens as large as 120 inches, and companies like Identity Mine are already developing software for these units.

Surface

Surface was a big hit.  With multi-person games to play, a photo hunt for attendees at PDC, and hands-on labs to explore multi-touch development, everyone got really got into these fun devices, which were scattered all over the conference.  I believe there was one at Tech Ed, but they really went big for PDC.  Unfortunately, these table devices have a price tag of about $13,500.  So compared to open source versions that go for $1,500 (albeit with some assembly required), and other options like the overlay screens offered by NextWindow, I won’t be jumping into Surface development anytime soon.

The application in the photo below is a digital DJ.  Sound loops can be tossed into the center.  Outside the circle, they’re silent.  The closer they get to the center of the blue area, the louder and more dominant they are.  Different styles of music were presented, and here we were playing some funky techno.

RIMG0071

Microsoft Research’s keynote presentation on Wednesday was really fantastic.  In addition to a new version of the World Wide Telescope (which has the potential to change the way students discover, explore, and learn about astronomy), they revealed a new technology (in early stages) called Second Light, which builds upon Surface, and is able to project two images: one of them which you see on the surface computer itself, and a second that only becomes visible when another diffuse surface is placed above the Surface table.  This can be a cheap piece of plastic or even some tracing paper.  One example displayed satellite images on the primary surface, and when the tracing paper was moved above it, you could see a map-only view overlaid on top.  The amazing part was that you could raise the second surface off the table, into the air, and place it at virtually any angle, and the Surface computer compensated for the angle by pre-distorting the image.  In addition, when using a piece of plastic, the infrared camera was able to perceive and interpret touch and multi-touch on the second surface that hovered several inches or better off the table!

Devices and Printers

Devices on your network, such as printers and other computers, appear in a nice visual explorer where they can be manipulated.  When a laptop is moved from your home to your office (and back), your default printer will change depending on your current environment.  Will they do the same thing with auto-detection of monitors, including multiple-monitor arrangements?  Let’s hope so!

 RIMG0093

Performance & Miscellaneous

Windows Seven uses the same kernel and driver model that Windows Server 2008 and Windows Vista uses, so there will be no need for a huge reworking of these fundamentals.  However, a great deal of work has gone into, and continues to be done, in the areas of optimizing performance and minimizing resource requirements: for Windows startup, application startup, and much more.  Windows 7 was shown running on a tiny Netbook, running at 1 GHz with 1 GB of RAM.  Try doing that with Vista!

RIMG0102

Virtualization is another key technology with many improvements, such as Window 7’s ability to boot off virtual hard drives, the ability to keep a boot image frozen (see my article on setting up such an environment with VMWare in this article), and application virtualization (versus whole-machine virtualization).  Any virtual hard drive file (a .vhd) can be mounted in the Disk Management Utility.

Conclusion

Windows 7 promises a lot of great new features.  Whether they’ll be compelling enough for businesses to upgrade from XP and Vista, especially for those that didn’t see the ROI on Vista, we have yet to see.  As a lucky attendee of the PDC, I’ll be running the Windows 7 CTP they gave me to learn all I can about it.  As I discover both its great features and buggy failures, I’ll be writing more about it.  For the rest of you, it will be available around April 2009 when it reaches beta release.

Other news and discussion can be found on the Engineer Windows 7 blog, and there’s a good article at Ars Technica with screen shots.

Advertisements

Posted in Conferences, Research, Virtualization, Windows 7 | 2 Comments »

Windows Azure: Internet Operating System

Posted by Dan Vanderboom on October 27, 2008

image

As I write this during the keynote of PDC 2008, Ray Ozzie is announcing (with a great deal of excitement) a new Windows-branded Internet operating system called Windows Azure.  Tipping their hats to work done by Amazon.com with their EC2 (Elastic Cloud Computing) service, Microsoft is finally revealing their vision for a world-wide, scalable, cloud services platform that looks forward toward the next fifty years.

Windows Azure, presumably named for the color of the sky, is being released today as a CTP in the United States, and will be rolled out soon across the rest of the planet.  This new Internet platform came together over the past few years after a common set of scalable technologies emerged behind the scenes across MSN, Live, MSDN, XBox Live, Zune, and other global online services.  Azure is the vehicle for delivering that expertise as a platform to Microsoft developers around the world.

SQL Server Data Services, now called SQL Services (storage, data mining, reporting), .NET Services (federated identity, workflows, etc.), SharePoint Services, Live Services (synchronization), and Dynamics/CRM Services are provided as examples of services moving immediately to Windows Azure, with many more on their way, both from Microsoft and from third parties such as Bluehoo.com, a social networking technology using Bluetooth on Windows Mobile cell phones to discover and interact with others nearby.

The promise of a globally distributed collection of data centers offering unlimited scalability, automatic load-balancing, intelligent data synchronization, and model-driven service lifecycle management is very exciting.  Hints of this new offering could be seen from podcasts, articles, and TechEd sessions earlier this year on cloud services in general, talk of Software-As-Service (SAS), Software+Services, the Internet Service Bus, and the ill-named BizTalk Services.

The development experience looks pretty solid, even this early in the game.  Testing can be done on your local development machine, without having to upload your service to the cloud, and all of the cloud services APIs will be available, all while leveraging existing skills with ASP.NET, web services, WCF and WF, and more.  Publishing to the cloud involves the same Publish context menu item you’re used to in deploying your web applications today, except that you’ll end up at a web page where you’ll upload two files.  Actual service start time may take a few minutes.

Overall, this is a very exciting offering.  Because of Microsoft’s commitment to building and supporting open platforms, it’s hard to imagine what kinds of products and services this will lead to, how this will catalyze the revolution to cloud services that has already begun.

Posted in Conferences, Distributed Architecture, Service Oriented Architecture, Software Architecture, Virtualization | Leave a Comment »

Technology Research Highlights: C5, YIIHAW, and MemJet

Posted by Dan Vanderboom on October 7, 2008

When I’m not designing or writing code, I’m usually doing some kind of research.  Looking for new gadgets, toys, technologies, groundbreaking research, or following my favorite blogs and podcasts.  Because I haven’t been highly focused on any single project lately, I thought I’d share some of the more interesting things I’ve come across.

Peter Sestoft, C5 Generics Collection Library, and YIIHAW

Peter Sestoft is a brilliant professor at the very old (founded 1479) Copenhagen IT University in Denmark, which actually has a student body consisting of a female majority (59%)!  I discovered Sestoft’s works while doing research for some new, more powerful collection class I was working on (Tree<T> and Set<T>).  He was featured on Channel 9 back in January on a show primarily about the C5 Collection Library.

C5 Generics Collection Library

The C5 Collection Library is an extremely powerful and well-designed library, based on earlier Java and Smalltalk collection library designs, and completely blows away the standard collection classes delivered as part of the .NET Framework.  An earlier version was covered well in a Dr. Dobb’s article, but to summarize: C5 is interface-based, provides convenient but hard-to-implement functionality (such as persistent sorted collections and sublist views), provides useful abstractions such as lists, sets, bags, priority queues, double-ended queues, stacks, dictionaries, and optimizes access of these data structures for asymptotic complexity.

Unless you’re an expert—as with encryption—if you find yourself creating your own complex data structures, chances are you’re going to do it wrong.  So it’s nice to know that the mathematical experts have taken the time to very carefully design and construct a wide assortment of useful data structures for the rest of us to use, complete with unit tests.  And the best part, in the spirit of true science, C5 has a very liberal open source license, so it can be used in open source and commercial software alike.  It’s reportedly being used by the military, video game shops, web server software, and more.

Sestoft and his colleagues have the excellent habit of providing copious documentation: a book’s worth, in fact!  It can be found online here.

I think it’s an excellent candidate for being included in the .NET Framework itself, and I highly recommend that you check it out the next time you need a fancy data structure and are tempted to write it yourself, and to consider for optimizing performance of existing code that relies heavily on data structures (which is almost everywhere).

Getting the fundamentals right is probably the hardest thing to do.  It’s easy (and tempting) to build as tall as we can, but getting a firm foundation in place is much more important.  That’s why the C5 Collections Library is so amazing.  So what are you waiting for?  Go download it!

YIIHAW Is an Intelligent and High-performing Aspect Weaver

What really gets me excited is Sestoft’s YIIHAW, a high-performance static aspect weaver for .NET.

Aspect Oriented Programming (AOP) is a paradigm for addressing cross-cutting concerns in software.  That is, logic that operates orthogonally to business logic, such as logging, security, configuration, and more.  There are a number of open source aspect weavers available today, and they generally fall into two camps: static or compile-time weavers, and dynamic or runtime weavers.

While incredibly useful, several factors have kept AOP from entering the mainstream.  For one, a good set of tools hasn’t yet emerged to enable easy debugging of aspects.  When we step through lines of code in Visual Studio, the debugger has no way of knowing if or when some other injected piece of code should pick up the thread of execution, since weaving isn’t a natively recognized and supported activity within the debugger.

Another hindrance is performance: aspect weavers typically inject logic (called advices) in the form of method calls at the beginning and/or ending of existing methods (the locations are called join points) which are selected with special selector statements (called pointcuts).  The typical trick, as I just alluded to, is to include a new method in the class (called an introduction) and then insert method invocation statements at the beginning and end of the methods to be modified.  This isn’t a big deal in many cases, but in performance-critical sections of calls, the additional method calls and the stack manipulations that accompany them prevent these techniques from being practical in performance-critical scenarios.

Data structures play a pivotal role in high-performance algorithms, of course, and Sestoft’s experience in building the C5 Collections Library provided the perfect context in which to consider how some of the specific features of his data structures might adversely affect performance.  For example: his collections fire events to inform any interested parties that a collection had an item inserted, deleted, or modified in some other way, eliminating the need for defining specialized collections that trigger specific actions outside of that collection (see my article on a Tree<T> structure I created that makes use of this).

If the C5 library could start with the basic, slimmed down, super high-performant data structures, and then “weave in” aspects to include features such as event notifications only when needed, the problem might be solved.  The problem with the typical approach, however, is that insertion of method calls provides as much or more overhead than the simple checks to activate those features to begin with (if not null, then invoke event), so he knew he’d have to go with a different approach.

After evaluating the capabilities and measuring the performance of existing open source aspect weavers, they were all found to be inadequate, and the YIIHAW thesis project was born.  You can find the fascinating thesis (which I just finished reading) here.  In a nutshell, YIIHAW employs an advanced technique called advice inlining, in which CIL instructions are woven directly into their target methods.  There are a surprising number of challenges to this approach, including the need to convert the original methods RET (return) instructions to jumps, remapping jump addresses, updating the method stack size, and much more.  The students who worked on this thesis (Rasmus Johansen and Stephan Spangenberg), under Sestoft’s direction, did a masterful job of overcoming all of these challenges, the result of which is a highly-capable static aspect weaver with no performance penalty!

This is truly amazing, and it enables aspects to be woven into an assembly repeatedly: one for feature A, another for feature B, etc., all with the assurance of type safety and performance equivalent to writing the code by hand with all features included in the first place.

Another positive of the YIIHAW thesis is the light it shines on CIL instructions, their organization and function.  The advice inlining techniques provide a great tutorial for those wanting a deeper understanding of how to manipulate things at the CIL level.  Many who have attempted AOP have either not considered this approach, or else turned away from this path due to the complexity and challenge.  Not so with the YIIHAW team, who faced the problem head on and accomplished something fundamentally great as a result.  The fantastic Mono.Cecil library, despite being poorly documented, is used for analysis and manipulation of CIL code, and several other ideas came to mind as I saw how this tool was put to use.

My only criticism of their application of this technology for the generation of specialized data structures at compile time is that you may find yourself needing different versions of the same data structure in different parts of your application.  In a class that performs analysis of visual data for extracting spatial cues, you may need a Tree with as little overhead as possible (i.e., no event notifications, no serialization capability), and in the user interface, you may need another Tree with those additional characteristics.  By making a single decision at compile/weave time, your options will be limited at runtime.

There’s also the issue of supporting the debugging process, which can’t be dismissed lightly.  But YIIHAW has gone to extreme measures to overcome some of AOP’s largest obstacles; and in addition to interceptions (weaving logic into existing methods), YIIHAW also supports introductions (adding new types and members), and typestructure modifications (changing a class’s base class, or making a class implement an interface).

Overall, YIIHAW’s potential is huge, and I believe that it won’t be long before the tooling catches up to the point where AOP becomes a mainstream approach to complex cross-cutting systems problems, simplifying designs and the engineering process overall.

Memjet Printer

Color printing is about to get a whole lot faster.  At 60 pages per minute (ppm), the Memjet printer, developed by Kia Silverbrook, a prolific inventor with over 1400 patents.  Check out the YouTube video to see it in action.

I’ve seen a lot of speculation that Memjet is a hoax, and a technological leap forward this large certainly warrants skepticism.  However, the technology was written about in a very respectable science magazine, one of my favorites: Scientific American, in June 2007.  It’s also been covered in several articles by PC Magazine, for example in May 2007, which mentions the Memjet appearing at the 2007 Global Ink Jet Printing Conference.  (Talk about specific conferences!)

The print heads are page-width, so they don’t have to move back and forth across the page.  The “MEM” in Memjet stands for microelectromechanical, and refers to the fabrication process that involves CMOS chips on a silicon wafer for precision layout.

With ink spraying at 900 million 1-2 picoliter drops per second, drop size small enough to dry within a second, and an estimated price tag under $200 (compared to the comparable HP Edgeline at $16,000), waiting around for long documents to print will soon be a thing of the past for everyone.  The first devices are expected to appear in 2009.

Posted in Algorithms, Aspect Oriented Programming, Data Structures, Design Patterns, Research | Leave a Comment »