October 2008 - Posts

VSLive! Dallas is approaching (Dec 8 - 11 2008). I'll be there, again, along with many other excellent speakers. 

If you use the priority code SPGET, you'll receive $300 off your registration!

Here's the info:

VSLive! Dallas – The Adolphus Hotel, Dallas, TX – www.vslive.com/dallas
December 8-11, 2008

Register online or call 800-280-6218 using Priority Code SPGET and receive $300 off the package of your choice.

VSLive! Dallas

For 15 years, VSLive Events have led the ranks as the trusted independent conference for .NET professionals. No other conference, no corporate trainers, no one else will compare to VSLive's standard of editorial excellence and commitment to real-world, practical information designed to take your skills to the next level. Join me and other professional developers, Microsoft product teams and executives at VSLive Dallas, December 8-11, 2008.

At VSLive! Dallas, the old Windows/Web/SQL delineations are gone and we have 50% more breakout sessions to choose from. This improved format allows us to offer a huge range of topics, including cloud computing, WPF, ASP.NET ALM, and SQL Server Data Services.  Deep material on mainstream Web development, Architecture, and Data Management honor our tradition of supporting your production needs with today’s technology.

If you’ve only one opportunity to attend a conference this Fall or Winter: VSLive! Dallas is it!

www.vslive.com/dallas


 

 

Posted by KenG | with no comments

In case you were looking for the two articles I wrote on the System.Linq.Enumerable class (taking into account the fixes in the recent blog post here), you can find the articles here:

 

http://msdn.microsoft.com/en-us/magazine/cc700332.aspx
http://msdn.microsoft.com/en-us/magazine/cc793963.aspx

Posted by KenG | with no comments

Yes, it's true. I have become an iPhone fanboy. I love this thing, and feel totally disconnected when I don't have it with me (which isn't very often).

There was originally one single feature that I felt Windows Mobile did better than the iPhone: Dialing contacts based on just typing their names. For some reason, on the iPhone, you need to look up contacts, or have them in your Favorites list, to dial them (other than memorized numbers, of course). Finally, the gap has been closed: QuickDial for the iPhone is out, and it's a gloriously simple (and effective) piece of $0.99 software. You can find information here: http://iphone.pinpointsolutionsinc.com/, but just take your iPhone, head to the App Store, and search for QuickDial. 

I've replaced the Phone icon with the QuickDial icon on the bottom of the home screen. That's how much I like it.

Posted by KenG | 2 comment(s)

I finally worked out the details to fix the errors in the Enumerable article on MSDN because of breaking changes in the .NET Framework 3.5 SP1 (thanks to Bob Schild for pointing out the problem!)

In Part II of the article, replace Figure 6 with the following:

    Dim items As New ArrayList
    items.Add("January")
    items.Add("August")
    items.Add("October")
    items.Add("April")

    ' Cast the ArrayList as a queryable group of strings
    ' (if the cast to String failed for any element,
    ' this would raise an exception):
    Dim query = items.Cast(Of String)()

    ' Now, use the Enumerable class to query the data:
    Dim results = _
      query.Where(Function(item) item.StartsWith("A"))

In Part II of the article, add the following paragraph, near the discussion of the Enumerable.Cast method:


(The behavior of the Enumerable.Cast method changed between the original version of Visual Studio 2008 and SP1. Originally, the Cast method performed a conversion from the original type to the type specified in the generic parameter. Starting in SP1, the Cast method performs a cast, not a conversion.  In other words, if the TryCast method would return True in an attempt convert from the original type to the new type for each element of the collection, the Cast method will succeed. The Cast method triggers an exception when you execute the query if any element within the collection can’t be implicitly cast to the new type.)

In the sample application, replace the CastDemo procedure with the following:

  Private Sub CastDemo(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Dim items As New ArrayList
    items.Add("January")
    items.Add("August")
    items.Add("October")
    items.Add("April")

    ' Cast the ArrayList as a queryable group of strings
    ' (if the conversion to String failed for any element,
    ' this would raise an exception):
    Dim query As IEnumerable(Of String) = items.Cast(Of String)()

    ' Now, use the Enumerable class to query the data:
    Dim results = _
      query.Where(Function(item) item.StartsWith("A"))

    DisplayResults(GetList(results))
  End Sub

Replace the GetList and GetCommaList procedures:

  Private Function GetList(ByVal items As IEnumerable) As String
    Dim newItems = From item In items Select value = item.ToString()

    Return newItems.DefaultIfEmpty(). _
      Aggregate(Function(current, item) _
        If(String.IsNullOrEmpty(current), _
           item, current & vbCrLf & item))
  End Function

  Private Function GetCommaList(ByVal items As IEnumerable) As String
    ' Convert the list into a list of strings:
    Dim newItems = From item In items Select value = item.ToString()

    Return newItems.DefaultIfEmpty(). _
      Aggregate(Function(current, item) _
        If(String.IsNullOrEmpty(current), _
           item, String.Format("{0}, {1}", current, item)))
  End Function

Sorry for all the hassles--because of the long lead time, I hadn't even considered installing SP1 (nor was I concerned that it would break code!) when I wrote the article.

Posted by KenG | with no comments

I recently ran a two-part article on the Enumerable class in MSDN magazine. Unfortunately, there's a significant lead time on these articles, and I wrote it using VS 2008 RTM. VS 2008 SP1 introduced a breaking change in the Enumerable.Cast method, so the demo has a number of procedures that fail with exceptions. I'll post revised versions of those procedures as soon as I can, but for now, just know that I'm aware of the problem, and will need to fix the code.

 The article starts here:

http://msdn.microsoft.com/en-us/magazine/cc700332.aspx

 

Posted by KenG | with no comments

Finished up presentations today for VSLive Las Vegas--if you need to download presentation content for any of my talks, drop by http://www.mcwtech.com/2008/vslive to download the content for the sessions.

 In the "Build a WPF Application in an Hour" presentation, I mentioned that you cannot sort the Properties windows' content. This was, of course, true in the RTM version of VS 2008. If I had slowed down for a moment to look, I would have noticed that installing VS 2008 SP1 on my demo machine right before the conference, and not trying this particular demo using SP1, led me to not notice that the A-Z button appeared on the Properties window. In other words, you CAN sort the properties for WPF objects now. (SP1 also added the Events tab to the Properties window, giving you yet another way to add event handlers for an object's events).

 Sorry for the error, for those that were at the session. 

Posted by KenG | with no comments