Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

gregoryw gregoryw
  • Help... V6.0

    You want to use the Mid function instead of the Left function.

  • VS2008 rule change on variable declaration?

    Adding braces for each case should solve this:

                /*******************/
                switch (cmd)
                {
                    case "A":
                        {
                            string temp = "ABC";
                            // use temp to do something here...
                            break;
                        }
                    case "B":
                        {
                            string temp = "DEF";
                            // use temp to do something here...
                            break;
                        }
                    default:
                        {
                            string temp = "GHI";
                            // use temp to do something here...
                            break;
                        }
                }
                /*******************/

  • Introspecti​on - Getting started

    The Code Analysis forums would be a good place to start:

    http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=98&SiteID=1


  • MSDN Problems

    I can access the Benefits Management page, but not Downloads.

  • Guid Versus numbers

    Well, if you ever wanted to replicate the data to somewhere else that it could be written then GUIDs would be a good way to eliminate potential conflict in the allocated IDs.

    The downside is that because the IDs are no longer sequential then you can't use it to ask simple questions like which client was added most recently; you'd use some sort of date column instead.

    Using GUIDs makes it very difficult for an end user to consume (though you shouldn't be exposing internal IDs to your end users, anyhow.). Numbers, or strings that are partially based on the client name are easier for end users to use. However, I'm not a particular fan of them because of the scenario where the client changes their name.

    If your data is ordered by the ID then you could observe the following:

    • GUIDs should give you a more even distribution across spindles.
    • Sequential IDs might give you performance gains by resulting  in cache hits to adjacent records. Of course this assumes that you are more likely to want to access a record added recently than one added further back.
    • Queries that execute across a range of dates that a client was added will benefit from the records being adjacent - less seeks.

  • Unit Testing EventArgs classes

    You could use InternalsVisibleToAttribute, to allow your unit tests access.

  • Hashing Algorithms

    Like W3bbo says, mathematicians unlike us. It takes a great deal of skill and experience to design an algorithm that isn't flawed in some way. It's better to leave that to the experts.

  • Opinions on null return vs ​argumentexc​eption

    Null is better for the reasons that others have pointed out. I'd also make sure that you add an XML comment to document the return value when the item isn't found.

  • FxCop 1.35 help broken ?

    They're moving the documentation over to the wiki:

    http://blogs.msdn.com/fxcop/archive/2006/06/29/fxcop-1-35-rule-documentation-now-on-msdn-wiki-david-kean.aspx

  • PIX 506 E

    jsampsonPC wrote:
    Open a top-secret port? Put VNC on that port...?


    You'd have to wire through several ports if you need to access multiple hosts on the inside network. Anyway, a "top-secret" port just reads as security through obscurity to me.