Browsing 7239 questions and answers with Jon Skeet
You're escaping far too much. You should only escape the query value - not the key/value pair separators. So the URL should be something like: string url = string.Format( ... more 4/24/2014 6:24:08 AM
Your suggestion would encourage the implementation detail of how the state is represented within the class to be made public. Using one level of indirection - properties - allows you to separate out the public API of a type from its... more 4/24/2014 5:51:56 AM
But isn't false the default value of bool[ean]s? For fields (instance variables and static variables), yes. But local variables don't have default values, regardless of their type. They have to be definitely assigned before they're... more 4/23/2014 4:35:34 PM
This is probably the issue: Trace.Listeners.Add(new TextWriterTraceListener(swLog)); Every time you add a log entry, you're adding an extra trace listener... so the first time, you'll get one log entry. The second time, you'll get two... more 4/23/2014 12:57:07 PM
You haven't specified any capturing groups. If you change your pattern like this: Pattern pattern = Pattern.compile("(@)"); then you'll have a capturing group - but it will still only return 1, as each match only has a single group.... more 4/23/2014 12:36:33 PM
It converts to whichever type you've asked it to. For example: Func<int> del = () => 0; // Conversion to delegate Expression<Func<int>> expression = () => 0; // Conversion to expression tree In your case, you're... more 4/23/2014 10:57:37 AM
For a generic method, the caller can specify the type argument - so I should be able to use: Connection foo = new IoConnectionStub(); Integer x = foo.<Integer>getVersion(); That's clearly not going to work in your case. It sounds... more 4/23/2014 8:37:44 AM
I suspect you want: var sorted = meetings.OrderByDescending(m => m.ActualStartDate ?? m.StartDate); Note that calling the method won't change meetings - you need to use the return value which will be a sorted sequence of results.... more 4/23/2014 6:06:04 AM
video here is the alias for a namespace. As per the example: <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> <url> ... more 4/22/2014 3:01:14 PM
First, you need to understand that this isn't just a display issue - if you want to avoid displaying incorrect values, it helps to have the right values to start with. You should use BigDecimal instead of float. That stores the value as... more 4/22/2014 2:28:50 PM