Browsing 7239 questions and answers with Jon Skeet
If tx.Tag doesn't change its value, that's fine - but presumably the code quality scanner doesn't know that. It's generally better to use as for this, so that you only evaluate the property once, only perform the type test once, and then... more 9/8/2015 12:30:05 PM
The error you're getting really doesn't have anything to do with LINQ. You can see the same thing without using LINQ at all: var anonymous = new { Name = "Fred" }; anonymous.Name = "Joe"; // Error, as properties of anonymous types are... more 9/8/2015 6:39:11 AM
You're setting the time zone as EST - that's Eastern Standard Time, which is UTC-5 all year round. If you actually want "Eastern Time", use America/New_York as your time zone identifier. That will vary between EST and EDT at the... more 9/8/2015 6:03:04 AM
In this case, is it still used as a bitwise operator or does it have a different meaning when in context? It has a different meaning - although it's of the same "flavour" in that it's "if exception X is caught, or exception Y is... more 9/7/2015 6:48:15 PM
You've used -d which says where to put the output, but you haven't told it that the same directory should also be used for input on the classpath. Use the -cp option for that: javac -d classes -cp classes Program.java (It's not clear... more 9/7/2015 1:58:16 PM
Your sender parameter doesn't match the parameter in EventHandler<TEventArgs> - it should be of type object: void FrameIn(object sender, BodyFrameArrivedEventArgs e) If you need the sender as a BodyFrameReader, you can cast to it... more 9/7/2015 11:50:23 AM
This is the problem: queue.offer(new FutureResult()); You're setting the value on one FutureResult, but that's not the one you're waiting for. Just change that line to: queue.offer(result); and it works fine. more 9/6/2015 6:26:32 AM
From section 15.20.2 of the JLS: The type of the RelationalExpression operand of the instanceof operator must be a reference type or the null type; otherwise, a compile-time error occurs. In your case, the case of the... more 9/5/2015 9:09:43 PM
As I noted in a comment, you can do this trivially in LINQ to XML: var projects = XDocument .Load(Server.MapPath("~/Content/abc.xml")) .Root .Elements("Project") .Select(p => new Project { Id = (string)... more 9/5/2015 8:24:41 PM
I suspect you just need to get the current request in a different way, due to being in a static method rather than in a context where you can refer to a Request instance property: var request = HttpContext.Current; var referrer =... more 9/5/2015 8:08:28 AM