Public musings, often on software development RSS 2.0
# Friday, April 16, 2010

So a quick story from home because it’s one of those things that I’ll forget in the years ahead but might remember if I write it down.  Plus in years ahead my son won’t believe it.

Billy of late has had some issues with going to bed on time.  Usually he asks me to stay or wants his door left open, or wanders out of his room after bed… if you’re a parent you know the drill.  For those not personally familiar with us, Billy is the older of my two boys, and almost 4.

Earlier in the week Billy had watched “Horton Hears a Who”, if you aren’t familiar this is an adaptation of a Dr. Suess book.  The main character Horton is an elephant who hears voices from a small ‘flower’.  The story is about how the town of ‘Whoville’ exists on this flower and Horton’s struggle to protect the flower and town.  The book’s climax is when everyone in town get’s together to call out ‘We are here, We are here’ to make enough noise for others to recognize they are there and spare the flower.

Last night bed time rolled around and we put the boys down. I had stayed in Billy’s room for about 5 minutes (once lights were out we were counting – I’ve been teaching him that counting is a good way to fall asleep, so we had counted to 100 and then again by 5’s.) but then it was time for me to leave.  He protested (of course) but it was time, so I closed his door to his complaints and headed downstairs.

A short while later I could hear something from upstairs.  Listening closer it was Billy ‘yelling’, so I asked Tracie which of us would be headed up to deal with Billy and she volunteered.  A little while later she came down and let me know that she had left Billy’s door open.   When Tracie got to Billy last night he was laying in bed calling out “I am here, I am here”.

Friday, April 16, 2010 9:59:12 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
Family
# Thursday, April 15, 2010

Not mine… rather a quick thought that occurred to me today looking at some Science Fiction books on sale.  I was thinking about how much fun it will be to share many of the books and stories I grew up reading with my sons.  The good stories are still a few years off, but I look forward to moving past Mickey Mouse, Thomas the Tank Engine and similar cartoon characters and picture books for some real literature… not that I’ve been doing such a great job keeping up with the latest stories.  It must be time for me to read a good novel. 

Thursday, April 15, 2010 12:55:14 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
Musings
# Monday, April 12, 2010

Well the full namespace for this method is System.ComponentModel.DesignerProperties.GetIsInDesignMode(Me)

In the spirit of my last post discussing how Visual Studio 2010 (VS2010) lets the developers get access to a visual designer for Silverlight, lets look at why if you are doing Silverlight 3 with Visual Studio 2010 you need to get familiar with GetIsInDesignMode.

If you are like me, when my application opens I have it start loading data.  I don’t typically open an empty application and then ask a user to take an action to load some data, I typically default to some level of data that the user will act on.  Typically this is done by adding code to the Loaded event for your form or control. 

This is still a valid implementation, however VS 2010 brings with it full designer support for Silverlight 3 (Silverlight 4 as well when it releases).  As part of this when a Silverlight page/form is loaded into the designer, the designer fires the Loaded event to get any key data that is part of the running application.  This is great because it is not uncommon to have certain key settings within this first event, key settings that are related to your design.

However, that also means code which by default loads data will also be called.  That isn’t what most of us intend.  In fact if your services are hosted within the same solution odds are good that your service isn’t running while you are in design mode.  To avoid paying the price of having unnecessary code run when you put your XAML application (Silverlight 3 which you’ve probably built without a designer in particular) is to leverage GetIsInDesignMode().

Simply place your code within an if block like:

If Not System.ComponentModel.DesignerProperties.GetIsInDesignMode(Me) Then

‘My custom Code

End If

Of course I’ve put all my code in Visual Basic syntax, so let me slow down a second and make sure I don’t leave C# developers out:

if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))

{

// My custom code;

}

Regardless of your implementation language, taking a moment to optimize your designer experience and keep from loading or trying to load default data while in the designer is a good idea.

Monday, April 12, 2010 9:34:19 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
.NET | C# | Technology | Visual Basic | Silverlight

Visual Studio 2010 launches today.  Tomorrow, is the launch (if not the release) of Silverlight 4. Neither of these launches involves the launch of XAML, yet in my opinion the release/launch of Visual Studio 2010 brings XAML into the mainstream.  It does this by providing a visual designer within Visual Studio which truly supports the design of business applications.

While Blend exists for those looking to develop a creative and/or complex user interface, and while certain customer facing applications might see value in such an interface.  For the majority of software even that which is public facing, isn’t looking for a creative user interface.  Most software applications simply look to provide a simple yet distinctive user interface.

The difference is important because a creative user interface focuses on having unique behavior and display characteristics, while the later focuses on having predictable behavior with a distinctive identity.  Up until now to get either of these you were looking at either having someone use Blend or someone who could build the user interface with little or (in the case of Silverlight) no designer support.

Visual Studio 2010 doesn’t replicate the raw creative power of Blend, but again in my opinion it doesn’t need to.  Look most of us that are software engineers/developers have some level of design capability but are quick to step aside from someone who spends full time doing design work.  The majority of software engineers are not looking to design a set of color schemes, logo and branding components.  Blend is designed however to support the creation and application of these items.

What most software engineers do find themselves doing for the majority of applications is laying out controls, assigning background coloring, applying branding, logos and color schemes.  Up until Visual Studio 2010 it was difficult to carry out even these simple design tasks for WPF; and Silverlight 3.0 simply didn’t support visual layout.

Visual Studio 2010 makes it possible for engineers to carry out the core layout of application user interface elements such that many of the people and organizations who either considered the use of these technologies to require over priced consultants or who attempted and shelved such projects to take on these projects.  Moving forward WPF and Silverlight will become the common user interface implementations because just as Windows 7 brought touch capabilities into the mainstream, Visual Studio 2010 brings XAML user interface design into the mainstream.

Monday, April 12, 2010 3:36:30 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
.NET | C# | Musings | Technology | Visual Basic
# Friday, February 19, 2010

No I haven’t been online much…. been busy with Professional Visual Basic 2010 (http://www.wiley.com/WileyCDA/WileyTitle/productCd-047050224X.html).  I finally finished my last chapter (someday I’ll post the list of chapters which I did.)  and we’re now just in edits.  This week was the MVP Summit so I’ve been tweeting more than blogging, but learning and giving feedback on Visual Basic.

Many thanks to two groups in particular.  First to Nestor Portillo, Emilie Freet, Susanna Moran, PJ Forgione and everyone else in Microsoft’s MVP organization.  As usual they spent a great deal of time setting up an awesome event.  They helped facilitate a great deal of face time for us with the product teams, made sure we saw compelling content and coordinated a host of logistics.  This remains one of the top 2 or three features of being an MVP. – Special thanks to Emilie and the Developer Evangelist field org for the new MVP jackets a great surprise on Tuesday (and for getting me one even though I hadn’t scheduled anything because that’s when my flight arrived)

I’d also like to thank the whole Visual Studio languages team, and in particular:

- We had a surprise on Tuesday when Anthony Green let us know that he was now a “blue badge” (ie. Microsoft employee) so congratulations on your new role as a PM for the Visual Basic compiler.  His passion for the language should help him have great success.

- Charlie Calvert and Lisa Feigenbaum (who’s name I’ve probably misspelled) these two people took the lead on coordinating the interactions for the language MVPs at the Summit, including in the case of Charlie working to support the ever popular MVP to MVP sessions, and for Lisa for the great swag. (photos to follow)

- To the entire languages org, the Help and Community contacts, the CLR team and everyone else who met with us.  Thanks for taking the time to give us an idea of where you are headed and letting us give you some feedback on where we hope you are headed.  You openness and willingness to consider and respond to our thoughts is great.  btw, Lucian has a portion of this discussion available on his blog at: http://blogs.msdn.com/lucian/default.aspx

Overall this year’s MVP Summit has been a great event and as always I come away motivated to do more.

Friday, February 19, 2010 3:43:34 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
.NET | Technology | Visual Basic
# Wednesday, January 06, 2010

I managed to note on Twitter that I was speaking last night to the San Diego .NET Developers Group.  The session went well, it was an updated version of the presentation I did last year related to working with Boot to VHD and it's usefulness in working with Beta software and in this case actually digging into Visual Studio 2010 Beta 2.  The slides have been updated (and will be again prior to code camp) so for those who are interested here are my slides.  You'll note a couple that are heavy on graphics - yes those are the ones I incorporated from Microsoft materials, I don't make pretty pictures -especially not if my face is in them :-)

VS2010_1_5._2010.pdf (2.01 MB)
Wednesday, January 06, 2010 11:22:14 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
.NET | C# | PresentationMaterials | Technology | Visual Basic
# Sunday, October 18, 2009

A few weeks ago I presented to the San Diego .NET User Group.  Let me say I really like their new meeting location at Intuit, and below my post those of you who attended my presentation will find a copy of my slides.

The title of the presentation is of course a play on an old saying about being adrift at sea “Water, water everywhere, but not a drop to drink.”  It occurred to me that there was a parallel to this situation and beta software.  After all while you may here about all sorts of new features within beta software, for most corporate developers; deploying solutions that leverage these technologies isn’t always possible.  In fact for some the organizations are so short term focused that even working with these technologies may be difficult, since I’ve seen developer’s install beta software on their primary work system, corrupt it and as a result the organization starts to take a ‘no beta’ approach to reviewing new technology.

Given that even a few weeks ago, the beta 1 release of Visual Studio 2010 was starting show its age I wanted a presentation that would better explain to developers some best practices when working with Beta and Community Technology Preview (CTP) software.  After all while part of the session was to look at some of the new features of Visual Studio 2010, I wanted attendees to come away with some best practices in terms of working with the array of beta products that Microsoft is making available in this release wave. Unlike beta 1 or earlier CTP versions from Microsoft, my experience is that when you get to Beta 2 or RC you have something that’s usable for more than just planning.  In fact I really believe that if you are developing a new solution and looking at 3-6 months for a release timeframe you should be using the Beta 2 technology and considering leveraging a ‘Go Live’ license if you are ready before the product releases.

Every few years the product groups align such that whether it is a new OS plus a new Office plus a new Visual Studio or a new version of SQL Server or new versions of a bunch of other products that what you get from Redmond is a wave of new products.  Most of these products spend some overlapping time in beta release, for example Visual Studio Beta 1 came out while Windows 7 was in RC, and since coming out there has been a CTP of Office 2010.  This week we’ll see Windows 7 launch (it’s release was back in August) and soon we should see a beta 2 for Visual Studio 2010 (no later than the PDC)(http://visualstudiomagazine.com/Blogs/RDN-Express/2009/09/VS2010-and-.NET-4-Beta-2-Expected-Soon.aspx), and of course updates to the Office 2010 pre-release versions (isn’t there a SharePoint conference coming up, not to mention PDC… there ought to be something prior to the holidays. http://www.mssharepointconference.com/Pages/default.aspx)

So at this rate if you want to try an keep up and work with the new technology you probably are thinking VPC.  As most of us are aware, over the past few years virtual machines have been to Beta software what the Internet was to networked computing.  However, the one disadvantage of VPC was that of performance.  The fact is things like Windows 7 Beta and Visual Studio 2010 Beta 1 run agonizingly slow on VPC.  Here you are trying to follow best practice and not risk corrupting your core system, but as a result working with the technology borders on impossible.  Fortunately Windows 7 took a huge step toward resolving this issue with BootToVHD.

Boot to VHD makes allows you to set up a virtual machine and then during the boot process select it as the boot partition instead of your primary OS.  As you might imagine this implementation is closer to another way of handling multiple operating systems on a singly physical system’s hardware – multiple partitions.  What’s really being virtualized however is the partition.  In the past you would tell the physical hard drive that the a given percentage of it’s space was to be treated as logically separated from the rest of the hard drive.  There are several disadvantages to these physical partitions, including the ability to resize them, the fact they lock in a percentage of the hard drive even if you won’t use that much space, the fact that refreshing them isn’t easy.  Let’s face it there were enough issues that VPC was easily the solution of choice.

A VHD for those unfamiliar with the acronym is a Virtual Hard Drive, and it is the format used by VPC (but not VMWare) to represent a virtual machine’s disk drive.  The advantages are many, I can set the drive to expand only as space is required.  Once I’ve pointed my boot options to a VHD file, I can swap it out for a different VHD file and the operating system is none the wiser.  This alone allows me to create a baseline image, prep it and then when I need to I can replace my VHD to quickly start on a clean system.

However, it gets better – as noted by Scott Hanselman there is a CScript tool which will allow you to create that Baseline image using the tools from the Windows 7 Automated Installation Kit (AIK).  The focus of the slides below is to leverage information I found in 3 different blog posts (two from Scott and one from Michael Waterman. While I identify how to find Scott’s posts via Bing in the slides, I don’t mention Michael’s excellent PDF document specifically. The order I worked with them was to first read Scott’s posts which helped me get a baseline, and I then download the PDF file from Michael Waterman located at the bottom of his blog post here: http://blogs.technet.com/michw/archive/2009/08/01/windows-native-vhd-boot-deployment-scenarios.aspx  Of course Michael’s document goes at if from the lowest level and as you’ll learn from Scott’s postings, teh Wim2VHD script makes this unnecessary.

While Michael’s post and PDF go through the details of manually creating a VHD to support the Native VHD Boot scenario they are still great reference.  Plus there is one take-away remaining from his post/pdf; the use of the tool DISM.exe.  To quote from his PDF: “The tool we will use is new to Windows 7 and is called the DISM tool, which stands for ‘Deployment Image Servicing and Management’.” This tool allows you to retrieve the names of the images which are available on your DVD.  This becomes important as you’ll see with the enclosed instructions in order to tell the Wim2VHD.wsf. 

The net result as I point out in the slides, is that although images created to support Boot to VHD aren’t as portable as those which are truly virtual a new image can be spun up in under an hour as opposed to a lengthy set up, and by following another tip – don’t activate the image until you need to it becomes possible to quickly spin up, test and replace images.  Rather than run through everything else, with regard to the advantages and disadvantages of VHD images for native boot, let me give you a link to the slides here: NetUGSeptPresentation.pdf (479.09 KB)

and mention my configuration.  I’m running a Dell laptop as my primary development machine.  On it I have a reasonably nice solid state hard drive.  Which means when I configured my laptop I chose disk speed over space.  I’ve had the laptop about 10 months and let I’m as certain as ever I made the correct choice due to another enabling technology.  The drive on my laptop is limited, however, I purchased a relatively inexpensive external WD hard drive.  The 1TB WD My Book series supports e-Sata connectivity.  For those that aren’t aware it essentially provides the access speed of an internal drive (not quite but about 3x USB or Firewire speeds).  This means I can and do place multiple different images out on the external drive.  Just like the laptop the external drive is portable, I just need to have electrical for two devices instead of two.  If you have eSata and you are still using USB for a primary external drive you are missing out on usable access speeds.

At any rate, feel free to dig through the slides and get a feel on what is coming in Visual Studio 2010 and more importantly how to leverage today’s technology to allow you to quickly and safely leverage all of the Beta software coming from Microsoft as the next release wave of new technology rolls into use.

Sunday, October 18, 2009 2:28:01 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
.NET | C# | PresentationMaterials | Technology | Visual Basic | Windows
# Friday, October 09, 2009

As I believe I noted in the past we’ve started a series of .NET Fundamentals presentation at the start of each user group meeting at the San Diego .NET Developers group.  I was the presenter for the October 6th meeting.  Keep in mind these sessions aren’t about ‘new’ features but rather about reviewing some of the fundamentals which you as a .NET developer need to know.

Attached to this post is a copy of my slides.

NET FundamentalsEvents.pdf (559.42 KB)
Friday, October 09, 2009 9:29:55 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
.NET | C# | PresentationMaterials | Technology | Visual Basic

I’ll publish some of the blog posts which I finish and then think – nope not ready to share that with the world… someday – maybe… or maybe I’ll just leave them somewhere the boys can find them.

Friday, October 09, 2009 9:17:43 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
About the Nerd | Musings
# Monday, July 20, 2009

Yes my blogging frequency is down... fact is I've been getting set up on Twitter... I'll be getting a few posts out over the next week as I process some blog related updates.  Up until about a month or so ago I tended to follow Billy Hollis's school in that Twitter seemed pointless.  However, in reviewing what's been going on I see it CAN be pointless (and for many people is), but managed as a live connection network you can get questions answered, updates on items of interest etc.  For example Kathleen McGrath (http://twitter.com/kathleenmcgrath) is posting a link to a video a day related to VS2010, this was my inspiration for finally signing up.

You can follow me on Twitter as: http://www.twitter.com/nerdnotes I'm working to keep up a regular (3+ times per week) feed of updates for VB developers tagged as #VBDevTips... given that twitter seems to have the memory of a goldfish however (ie. short term only) I may also consolidate these 140< word tips in aggregate blog posts on an irregular basis.

Finally for those interested in the vast array of VB related twitterers there is an index page at:

http://www.cto20.com/home/entryid/112/tweeps-list-microsoft-visual-basic-mvp-rsquo-s-and-influencers.aspx

Monday, July 20, 2009 2:37:26 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] -
About the Nerd | Visual Basic
Archive
<April 2010>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678
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