Monthly Archives: June 2004

Knowing what you want and GETTING it too!

Kate Gregory has two fantastic posts about knowing what you want and getting it. Kate has a lot of incredibly valuable experience not only as a programmer, but as a consultant and a business person. I have been fortunate enough to have Kate be somewhat of a mentor to me and have learned some of these gems from her in the past. At the Women In I.T. luncheon at TechEd, many more people were able to benefit from Kate’s insights as well as those of the other incredible panelists.

Kate is now sharing some of these thoughts in her weblog.

What you want to get could be what I need to give

Know what you want from the Meeting

A better way to store user preferences in .NET apps?

It is definitely a conundrum. Do you use the registry? (easy as pie to code to, with lots of potential security and other issues) Do you leverage Isolated Storage? (a very secure way to write and read local files in managed code, but designed for files – which means a lot of coding to get info in and out.)

I started out with the easy way I was already familiar with – the registry. Then when I got bit with my first registry permission problem, I learned how to use Isolated Storage and had to code up all of the file stream, read line, write line business which is a PIA (though I suppose I could create an xml file, store it in isolated storage, open it up in a datarow and grab what I need). So I was happy to see what looks like an awesome article in this month’s MSDN Mag (as of this writing  – most of the articles are not online yet) called User Preferences: Manage User Settings in Your .NET App with a Custom Preferences API by Ray Djajadinata. I have read enough of the article so far to recognize all of the same walls I have encountered with this, so I look forward to digging further in to read about how Ray has solved this problem.

Tablet PC Developer Tour to arrive in Boston on Wednesday

This is a half day free seminar from the Microsoft Tablet Team and the Leszynski Group that is targetted to developers. It hits Boston this Wednesday, June 9th.

The sessions focus on core features of the Tablet SDK and will be code and API intensive. 

Date: Wednesday, June 9 2004, Start Time: 1:45 PM, End Time: 5:00 PM

Tremont Hotel   275 Tremont Street, Boston, Massachusetts 02116, Room: Empire Room

Here is the description of the event

The Microsoft Tablet PC Developer Tour
The Tablet PC is a next-generation PC—the evolution of the notebook PC. Tablet PCs run the Microsoft® Windows® XP Tablet PC Edition operating system, which incorporates the convenient and intuitive aspects of pen and paper into the PC experience. The Tablet PC provides all the performance and features of today’s notebook PCs in an ultra-light form factor, and has the ability to run full versions of standard Windows applications. Providing advanced handwriting recognition and a natural interface for entering data using a digital pen in addition to your keyboard, the Tablet PC opens exciting new opportunities for mobile computing.

This free course provides an overview of Windows XP Tablet PC Edition features for developers, architects, systems integrators, and solution providers. Plan to spend a few hours with us and we’ll teach you what you need to know to get started. The sessions will cover:

  • Tablet PC Platform Overview
  • The Tablet APIs, Object Model, and available components and controls
  • Complete coverage of the new features available with Windows XP Tablet PC 2004 Edition
  • Code samples and demonstrations across all the main features
  • Discussions around designing and deploying Tablet PC Applications
  • Q & A time for more in-depth questions
  • Each session will be delivered by Microsoft Tablet Employees or a Recognized Tablet PC Expert from the Leszynski Group. This is an opportunity you don’t want to miss. Register soon, as space is limited.

Who Should Attend?   
   All developers interested in a detailed overview of the Tablet PC Platform should plan on attending. These sessions focus on core features of the Tablet SDK and will be code and API intensive. 
 
You can still register for this event from the www.tabletpctraining.com/microsoft site.

I had planned to go but since it is a 4 hour drive each way, and I just attended similar sessions at TechEd, I think I am going to skip it and work on my demos for my own tablet PC SDK talk at DevTeach in a few weeks.

VB Refactoring Menu: Don’t click that link!!

Back in November, Leon Bambrick posted his now famous VB Refactoring Menu on his little Brinkster hosted weblog. The links to this post were so many that Brinkster shut him down. As soon as the site came back up, I copied and pasted the image to my own blog (with all credit to Leon of course). He finally moved to his own domain a month or so ago.

Don Box just discovered the menu on the Brinkster site and pointed to it. Then Chris Sells saw Don’s post and did it again.

Eeek! This for SURE will do Leon’s site in again. If you haven’t seen it, do him a favor and follow this link instead. And definitely subscribe to this guy’s blog!

Erasing Ink and Undo

The proper method of erasing ink with the Tablet PC SDK is to set the pen to delete or Eraser mode. There are two methods of erasing: stroke, which deletes whatever stroke you touch on (ink collection is a collection of strokes) or point by point. The point by point method works like an eraser. As you move the mouse around it affect the touched strokes by breaking them apart. So if you have a stroke that goes from point a to point b and erase in the middle, the original stroke is modified to end where the eraser started and a new stroke is created that begins at the end of the erasure and ends where the original stroke ended.

Since I have an UNDO method in my BLInk application, this is important to me. My method of undoing is to go to the top of the stack of strokes and remove them one at a time. Those get stored and can be used to “redo” as well. However, this method of erasing totally mucks up my stroke collection and without a lot more work, I can’t “undo” erasures.

The other way I can go about this is by sleight of hand. Rather than breaking up the strokes, my “eraser” can be an additional stroke that is the same color as the background. That way, I can undo and redo to my hearts content. The only consideration is the affect that this method will have on my resources and the size of my image when all is done.

There is probably a better way – or just the harder way of creating an additional store to capture all strokes and all erasures. ANd then undo and redo from that stack instead. I think I’m going to have to do a little more research on this one.

Why bother with the TabletPC SDK?

This is probably the most common question that I hear from developers:

“Why do I need to program with the SDK if the tablet already does handwriting recognition? I can just put my existing data entry forms on a tablet pc without having to change a thing and they will work, so what’s the point of learning to program for tablets?“

There is a LOT of information collected when someone works in ink on a TabletPC. The SDK gives you access to this information whether you want to read it, store it or even manipulate it. And there is a lot more to the ink than just handwriting recognition. But even if that is all you are interested, looking at the object model of the tablet api might give you some ideas to think out of the box even with this one particular function.

I’m curious about how other people would answer this question…. what does the API give you that the O/S doesn’t already do on it’s own?

Nullable Types in VB and C#

I read with great interest Paul Vick’s post on “The truth about Nullable types in VB“ vs. C# as I am talking about nullable types in my revised Whidbey BCL talk that I am doing at VTdotNET in a week and then at DevTeach in a few weeks.

I have played with nullable in the March preview bits, but not yet in the May and disappointed with the current (but slated for serious improvement by the bcl team!!!) performance when I compared the using nullable<t> over current options. So for example with value types: 

 – comparing myNullableInt.HasValue to (in VB) is myInt < 0

or with reference types

 – comparing myNullableThing.HasValue to “if not myThing=null”

the nullable type is currently much much slower. I have been promised by a few on the BCL team that the plan is to make the nullable MUCH more performant as it is their “best practices” suggestion (see Krzysztof’s Generics guidelines) to use nullable types.

I have also been given the hint that in the future, the following will be possible:

Nullable<T> Parse(string value);
Nullable<Int32> i = Int32.Parse( some String );

And will be more performant than TryParse. So that, too will be interesting.

It’s interesting to see all the groovy little shortcuts that C# is getting now and VB will be getting someday hopefully, though for now, all we really get of value (please correct me if there is more…) is the “hasvalue“ property which benefits us mostly for the value types coming back from databases.