navigation
 Friday, December 14, 2007

I just learnt something new and cool from one of Scott Guthries blogs: the ?? null coalescing operator in C# 2.0. I never noticed it until now, and actually thought it was part of 3.0, until a kind reader corrected me... it's been around ever since the advent of nullable types in C#.

Basically, this operator works like the T-SQL ISNULL or COALESCE function. Read all about it in Scott's blog!

 

posted on December 14, 2007  #    by John Waters  Comments [0] Trackback
 Thursday, December 13, 2007

I recently installed the RTM version of Visual Studio 2008 (previously known as Orcas), which comes with C# 3.0 and .NET Framework 3.5. One of the coolest new things is LINQ, more on that in my next blog. The next coolest thing is the new C# 3.0 language support for lambda expressions, see the node  => part below:

 

XmlHelper.Visit(_rootTOCItem.ParentNode, "tocitem", 
  node => _tocItems.Add((XmlElement)node));

Where _tocItems is a List<XmlElement>  stored in the class that is calling this method.

This works because Visit accepts a delegate, and I am passing in an anonymous delegate above using the new syntax. Visit is just something I wrote that iterates over the nodes in an Xml tree. I could have used Link to Xml for that part, but this is a tree of XmlElements returned by an XmlDataProvider, and Linq to Xml operates on XElements.

 

public class XmlHelper
{
  public delegate void NodeVisitor(XmlNode node);
  
  public static void Visit( XmlNode node, string nodeNameFilter, NodeVisitor visitor )
  {
    if ( node.Name==nodeNameFilter)
      (node);
    if (node.HasChildNodes)
      foreach (XmlNode child in node.ChildNodes)
        (child, nodeNameFilter, visitor);
  }
}
posted on December 13, 2007  #    by John Waters  Comments [0] Trackback
 Tuesday, December 04, 2007
This technique is useful to show a page immediately upon request, then begin loading data after the page appears in the browser.
posted on December 4, 2007  #    by Adam Anderson  Comments [0] Trackback
 Friday, November 30, 2007
Read about how to alter a column in a replicated table without breaking replication.
posted on November 30, 2007  #    by John Waters  Comments [0] Trackback
 Tuesday, November 27, 2007
image Yeah, I bought my new laptop this week after 2 years of using a great Dell Inspiron 9300.  The new XPS M1730 is very fast, very heavy and looks pretty.  With 4 Gig of RAM, 400 Gig of hard disk at 7200 RPM, Intel Core 2 extreme 2.8 GHZ each, 5 speakers, built in Video camera, Dual SLI GeForce Go 8700, Blu-Ray Disc, oh yeah one more thing VISTA ULTIMATE.  It was disappointing to buy the laptop from the Dell web site advertising that 4 Gig will make your Vista Scream, well I ended up the one screaming when I found out that Vista will never be able to see that last Gig of Ram and that the max a Vista machine can see is 3 Gig.  Really bad on both sides:
1- Dell, why do you advertise such a thing when you know it is not possible to do.
2- Microsoft! I have a hard time believing with all the advancement of technologies and the 200 new products you put out a month, that you are having a hard time making your flagship OS of the future see 4 Gig of RAM, that is ridiculous.
posted on November 27, 2007  #    by Lino Tadros  Comments [0] Trackback
 Wednesday, November 21, 2007
What is a sparse column and when do I need one? This blog will bring you up to speed.
posted on November 21, 2007  #    by John Waters  Comments [2] Trackback
 Tuesday, November 20, 2007

Falafel is partnering with Microsoft to offer this free half day seminar at the beautiful Saint Claire hotel in downtown San Jose, CA to celebrate the release of Visual Studio 2008, LINQ, WPF, WCF, WF and other exciting technologies.

ActiveFocus Hosting

Please join us on December 10th from 9:00 AM to 1:00 PM
Register on the Microsoft event site ASAP as space is limited.

Charlie Calvert, the C# Community Project Manager will be there to talk about LINQ and Lino Tadros will present the usefulness of the new technologies.
Hope to see you there!
 |  |  |  |  |  |  |  |  |  | 
posted on November 20, 2007  #    by Lino Tadros  Comments [0] Trackback
 Monday, November 19, 2007

Congrats to the VS Team at Microsoft.  The Visual Studio 2008 bits are being uploaded to the MSDN as I am writing this blog.

Good luck getting it downloaded today or tomorrow, You might as well use Pigeons to transfer the bits from the MSDN :-)

Cheers

posted on November 19, 2007  #    by Lino Tadros  Comments [0] Trackback