Browsing 7239 questions and answers with Jon Skeet
I think you're looking for the ViewBag. The ViewBag property enables you to dynamically share values from the controller to the view. It is a dynamic object which means it has no pre-defined properties. You define the properties you... more 8/4/2015 6:29:50 PM
Will IEnumerable enumerate every item and find the count (O(N)), or will it rely on List's Count property (O(1))? It will use the Count property. Basically the implementation checks whether or not the object implements... more 8/4/2015 5:43:35 PM
If you want a fixed-offset time zone, just use SimpleTimeZone: TimeZone tz = new SimpleTimeZone(TimeUnit.SECONDS.toMillis(-420), "id"); more 8/4/2015 5:40:19 PM
Unless there's an == overload that you haven't shown, you're just comparing whether two references are equal - that's fine. You don't even need to cast wAction and tAction to object, as you can just use the implicit... more 8/4/2015 4:51:06 PM
When an instance of a class is created is there some type of hidden/default "constructor" that sets the fields but does not call the setter of properties? Why would it call the property setters? What would it call them with? (Your... more 8/4/2015 3:42:43 PM
Does the return keyword inside the using statement leaving the connection to opened and hence this issue? No. The using statement is effectively a try/finally block statement a Dispose call in the finally part - so your connection... more 8/4/2015 9:26:11 AM
g is fine as a standard pattern specifier - but only on its own; it can't be part of a custom pattern, which is what you're effectively trying to do here. You're effectively trying to mix and match, which we don't support :( As well as... more 8/4/2015 7:30:16 AM
This is why you should always use @Override when overriding methods... KeyAdapter doesn't have a keyListener method - it has keyPressed, keyReleased and keyTyped. For example, you might want: mntmNewGame.addKeyListener(new KeyAdapter() { ... more 8/4/2015 6:07:11 AM
No, it's not a bug. It's unusual, but it's not a bug. The first thing to do is simplify the example massively: public class Test { public static void main(String[] args) { String start = "Start"; String end = "End"; ... more 8/4/2015 5:20:13 AM
You just need to create a new XElement called value for each name: select new XElement("name", new XElement("value", name)) As an aside, I wouldn't use a query expression for that - I'd just use: new XElement("Entity", new... more 8/3/2015 4:43:16 PM