Public musings, often on software development RSS 2.0
# Sunday, March 01, 2009

I'm in Seattle, WA this week at the Microsoft MVP Global Summit.  Tonight was the kick-off and it was a great opportunity to catch up with many of the other MVPs I've met over the years.  My thanks again to Serge of VB City who provided an excellent event tonight at Rock Bottom.  Serge and I are looking to meet again later this week to discuss one of his products "Code It Right" so that I can put together a review of this Visual Studio Add-In.

I know I mentioned a month back that I felt it was time for those looking to get a new computer to be certain to get Vista and not XP.  I'll quickly add that when I wrote that post I had already ordered my new laptop with the 64-bit version of Vista, and it works great.  There's more to the story, however as part of the MVP Summit we'll be hearing some information related to the next version of Windows, Windows 7.  As a result I'm going to hold off on my discussion of Vista for a few days - I won't be reiterating what I'll hear at the Summit since much of that information is covered by Non-Disclosure Agreement (NDA), but I want to be certain to include any announcements - that might be public - are included.

Sunday, March 01, 2009 10:41:21 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
Musings | Technology

So in the process of setting up my demonstration virtual machine for VSLive I pulled down the materials from the CodePlex site for OBA Sales.  What I realized in the process was that the custom database wasn't included in the materials.  Fortunately as I noted in my earlier post a copy of the database was available from the Wrox site.

I was able this morning to get a new copy of the AdventureworksVSTO database uploaded.  It's a .bak backup file that you will need to restore and it was zipped before uploading.  The download is now significantly larger.

Next updating the current XML web service to be a full on WCF service to generate the documents.  I'll let you know when it's ready.

Sunday, March 01, 2009 10:24:11 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
.NET | Technology | VSTO
# Thursday, February 26, 2009

Beth Massi posted a quick update on some of what was happening at VS Live this year.  Unfortunately she linked to my historical blog site at InterKnowlogy, but she had some great insight into VS Live.

Thursday, February 26, 2009 6:14:39 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
Technology
# Tuesday, February 24, 2009

Thanks to those who attended my session on working with VSTO and SharePoint today at VS Live!  As a reminder all of the code associated with my session is available for download from CodePlex.  Keep in mind that you'll need to update the connection strings in each of the projects (excluding the OFR project which doesn't connect to the database) in order to run the code locally.

The sample database associated with the applications isn't currently part of the CodePlex project, however I will update a copy this weekend after I get back from San Francisco.  Currently you can get a copy of the baseline database from the Wrox site associated with the Professional Office Business Application Development: Using Microsoft Office SharePoint Server 2007 and VSTO book.

Tuesday, February 24, 2009 5:54:09 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
.NET | Technology | VSTO
# Saturday, February 21, 2009

If you've been keeping track of Nerd Notes and or are familiar with me you may be aware that I previously worked with Interknowlogy.  We have chosen to part ways, as a result any email sent to bsheldon@interknowlogy.com or bills@interknowlogy.com email addresses I've used for years will instead be read by someone else at interknowlogy.  I'm currently in the process of getting myself set up both here on the newly hosted NerdNotes as well as on Live.

If you are looking to reach me please contact me at WSheldon at Live . com.

Saturday, February 21, 2009 6:00:33 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
About the Nerd | Musings | Technology
# Wednesday, January 21, 2009

Back in the late nineties we experienced a transition from 16-bit to 32-bit computing.  The transition was neither smooth nor particularly drawn out.  Currently we are in another transition – this one from 32-bit to 64-bit computing, and this time the transition will for the near term be much smoother and much slower.  The reality is this transition started a couple years ago, but the reason I’m now writing a post about it is that in my opinion, if you are considering a new PC, the point of transition has been crossed – purchase a 64-bit version of the desktop or laptop you are considering.

To clarify, except in a very small number of cases that I will address, you should be purchasing a 64-bit PC if you are purchasing a new PC.  Yes, Dell and others will continue to carry 32-bit machines for the foreseeable future, but whether you are a generic PC owner, or more importantly a developer it’s time to order a 64-bit machine.  The reality is that as the world continues to move forward the new development money is on 64-bit applications and slowly even devices.  In fact it is the plethora of hand-held devices which will slow the eventual end of 32 bit computing for a little longer but even handhelds will begin that transition at some point in the near future.

Right now pretty much with the exception of the mobile device world, the development world is focused on 64-bit computing (not 100% but increasing every day).  With 64-bits I can have much more than 2 GB of active memory.  Since the maximum value that can be stored in a 32-bit integer is 2GB and since you have to have a number to address each bit in memory this is the cause of the memory limitation. While the operating system can help to fake out this limit  through a few tricks,(for another 1 or 2 GB) the reality is that your application environment has a 2 GB memory cap on a 32-bit OS.  Plus given the power of that 64 bit machine you can run any vital 32-bit applications in a virtual environment and probably still be getting an upgrade in performance.

The question: What are the cases where I shouldn’t purchase a 64-bit machine?  Well if you need and let me stress need as in, must have to do my job, a new laptop and you are working to write software for a 32-bit device (such as a mobile device or the Microsoft Surface) then you can justify getting a new 32-bit machine for that purpose.  Similarly, if you have certain devices like an external scanner or high end printer and their drivers are 32-bit then you’ll probably want to keep a 32-bit machine available to run those devices.  A good overview of the information related to 64-bit limitations is available here: http://windowshelp.microsoft.com/Windows/en-US/Help/41531554-d5ef-4f2c-8fb9-149bdc5c8a701033.mspx#EEAAC

However, in general while this transition will be smoother than the previous 16-bit to 32-bit transition in the long run it will be just as terminal for the 32-bit machines and software.  What timeframe am I talking – well Microsoft is talking about supporting COM based computing past 2020 although I suspect most of that support will be migrated to environments running on a 64-bit machine in a 32-bit virtual environment. I'm not proclaiming the death of 32-bit systems, rather looking at where things are headed in the next couple years.  After all I’m not making a recommendation based on when 32-bit won’t be available or useful, but for what you SHOULD be doing if buying a new system now. 

My core recommendation is to purchase 64-bit on any new PC, I don’t care if it’s for your Mom or a high-end developer / computer gamer – it’s time to order a 64-bit machine.  As for me, well just before Christmas I ordered my in-laws a new PC, like most casual users they have a 5-10 year turn around on a PC and sure enough there in the very reasonable price range for desktops were an array of 64-bit machines and that’s what they got.  So in case you are wondering yes I am following this same suggestion for myself, because in 2-3 years 32 bit PCs will be a thing of the past and people will talk about supporting them for legacy applications that they haven’t yet managed to port to the 64 bit environment.  After all little by little we are even approaching the point where the current internet address system (IP) will transition to a 64-bit version.  You may need to keep the old computer around so you can print if you printer driver isn't supported but don't let a printer drag you into a PC which will be obsolete the day you buy it, you'll replace that at some point to and guess what - all the new ones support... 64-bit drivers.

By the way if you are getting a new PC, definitely get Vista – the XP downgrade is just that but I’ll put my justification for that recommendation in another post.

Wednesday, January 21, 2009 11:47:03 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
Musings | Technology
# Monday, October 27, 2008

So although I've been heads down, I have noticed that .NET 4.0 and the latest Visual Studio 2010 CTP have been released.  There are alot of great things coming but one which may cause a little confusion based on it's name is CoVariance.  Both C# and VB are getting CoVariance but what does that mean.  Well let's start with generics.  When teaching I like to introduce generics by saying “OK now this feature is called ‘generics’ but it’s all about specifics.”  I then discuss how polymorphism allows us to generically handle an object but how that can introduce two issues (1. minor is boxing 2. major is loss of type checking - since everything is an object)  What ‘generics’ allow us to do is to tell the compiler which specific type will be in a collection and that resolves both of those issues in our benefit.  This is an abreviation of a full explanation and added simply to place CoVariance in context, since it deals strictly with generics.

 

Unfortunately one of the challenges with generics is that you can cast a List<string> into a method thats looking for a list of objects list<integer> and just allow the code to run against whichever generic collection containing either strings or ints you pass in.  Now, even in VB6 it was not uncommon to have several different buttons connected to the same event handler.  In fact if you have a grid or similar construct with embedded controls this is still a common pattern, where the event handler is told which row the event came from.  The reason is very simple, each row will have a similar piece of code that differs only by which row should be impacted and you wouldn’t want to rewrite that code.  

 

Similarly, you probably have several different collections each of which is associated with a specific type through a generic declaration.  There will be certain actions that you want to take on any of those different specific collections.  This new feature allows you to define a single method and tell it to execute on any of the generic collections which support it’s expected interface.  The idea is you can have a single copy of your code that knows how to work generically with the different collections associated with different specific types, that you will pass it.  The good news is the compiler can see the type information for every planned access and even do type checking for each different type, thus you get the power of a polymorphic object with all the compiler based safety of strong typing.

 

 

Monday, October 27, 2008 4:33:28 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
.NET | Technology | Visual Basic
# Wednesday, October 15, 2008

Although apparently the author of the article isn't a big fan - kudos to President Bush for allowing local park managers to decide whether or not to allow mountain bikes within the park.  Note that this doesn't automatically grant Mountain Bike access throughout the park, but rather allows the local park manager who will be familiar with where such access is appropriate (away from endangered flora and fauna) to grant such access and generally manage that portion of the park.  In terms of comparison to something motorized, mountain bikes are significantly lower impact (many of the damages associated with bikers are found with hikers - the only one that would really be different imho is erosion impact)

http://nbcsports.msnbc.com/id/27183753/wid/18298287/?GT1=45002

Wednesday, October 15, 2008 10:04:46 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
Cycling

I ran into some code today which caught me off guard.  In the event handler for the Exit menu item was the command:

Application.Current.Shutdown()

(Note I've omitted the ; for C# syntax vs VB)

Now traditionally I've always used:

Close()

(I've omitted the 'this' or 'me' as well as the ; for those looking for language specifics...)

So is there a difference and is one better?  Well there is definitely a difference and in my opinion each is definitely better in a certain scenario.

The core similarlity is that both need to be called from your main application window thread in order to shut the application.  Thus calling close on a dialog doesn't shutdown your application, although calling shutdown from your main thread even in a dialog will...  each will also call all the appropriate events for closeing windows and disposing of objects.

The core difference comes down to how your main application thread responds to the events which are fired as it prepares to close.  The Shutdown command is unstoppable the app will close regardless of what one of the event handlers attempts.  However, the Window_Closing (in WPF) event allows you to update the status of the CancelEventArgs (e) to indicate that the shutdown should be prevented.  Thus if for example the user asked to exit and then the app said "but you have unsaved changes Save, Continue, Cancel?" which is something typically caught in the Window Closing event (since it's triggered when you click that cute little X in the upper right corner to close your window). 

The problem - if you've called Shutdown, it doesn't matter if the user says - "Cancel" your app is slamming down. 

Thus unless you are attempting to handle a sudden error condition ("Must stop now to avoid corrupting data.") you probably want to rely on the Window.Close() method instead of the Application.Shutdown method.

Wednesday, October 15, 2008 4:05:55 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
.NET | Technology | Visual Basic
# Tuesday, October 14, 2008

Well in theory the correct title for the group is the ASP.NET Special Interest Group of the San Diego .NET Users Group, but that didn't flow in the post title.  I'm speaking at their meeting on the 21st in relation ot SharePoint and ASP.NET.  Here's the description of the session I'll be doing:

SharePoint and its feature enriched cousin Microsoft Office SharePoint Server (MOSS) are becoming a standard part of company web properties.  As such ASP.NET developers need to understand how to create custom applications which can leverage this Microsoft product.  This presentation is going to look at setting up a shared SharePoint and ASP.NET development environment.  It will then look at debugging for custom workflow applications and examine a custom ASP.NET Web Service which leverages the OpenXML office document format to generate a Word document on the server and add that document into a SharePoint document library.  The presentation will leverage the Sales Forecast OBA code base which is publicly available on CodePlex with a focus on the ASP.NET , Visual Studio 2008 and SharePoint integration.  

 

The meetings are held at the Microsoft San Diego offices in La Jolla.  For more information go to their website at:

http://www.sandiegodotnet.com/Meetings/ASPNETSIG/tabid/59/ctl/Details/Mid/387/ItemID/113/Default.aspx?selecteddate=10/21/2008

Tuesday, October 14, 2008 4:38:38 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
.NET | Technology
Archive
<March 2009>
SunMonTueWedThuFriSat
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Bill Sheldon
Sign In
All Content © 2012, Bill Sheldon