Browsing 7239 questions and answers with Jon Skeet
Sure - ask for just the Node elements: var nodes = xdoc.Root.Elements("Nodes"); foreach (var node in nodes) { ... } Or if you want to do lots of work on the doc without NodeTemplate getting in the... more 3/5/2015 2:29:06 PM
Sounds like you're just looking for File.ReadAllLines - once you've got the filename, of courses. You need to separate out the tasks of "let the user select a file" from "read the contents of the file". OpenFileDialog is probably the... more 3/5/2015 12:52:30 PM
Sure. The constant value of Calendar.MINUTE is 12 The constant value of Calendar.YEAR is 1 So your second call is equivalent to: gc.add(Calendar.YEAR, 12); And this is why we try not to build APIs like this, of course.... more 3/5/2015 12:10:53 PM
No, because in fact you're sleeping for 7 seconds before you print Waiting started. Here's what happens: Main calls ProcessNumber ProcessNumber sleeps for 1 second ProcessNumber calls IncrementNumber IncrementNumber sleeps for 6... more 3/5/2015 11:59:47 AM
SimpleDateFormat takes a Date, not a Calendar - which means it can't be provided the time zone in the value itself. Assuming you need to stick with SimpleDateFormat (rather than using Joda Time or Java 8's java.time, for example) then... more 3/5/2015 10:24:45 AM
No, the value in the ArrayList is just a reference. The fact that you originally referred to it using a different variable is irrelevant. You could use a Map<String, String> instead... but it would be much cleaner to have a Customer... more 3/5/2015 9:48:42 AM
It looks like the result property is effectively a map of results - so you can represent that with a Dictionary<,>. This works: using System; using System.Collections.Generic; using System.IO; using System.Linq; using... more 3/5/2015 9:29:25 AM
Looking at the documentation: Timestamps are stored either as integers, or (deprecated) floating point numbers I don't believe timestamp with timezone could be correctly encoded within 8 bytes if it actually stored a time zone. Just the... more 3/5/2015 8:10:08 AM
Yes, fields will always be initialized. If you don't explicitly chain to any other constructors, you'll chain to base() implicitly. You'll always end up chaining right up the type hierarchy until you hit Object. My point is to... more 3/5/2015 7:58:07 AM
There's no way of doing that - other than the visibility of the class itself, outer classes have no extra access to the members within a nested class. Two options: Keep a cachingEnabled private field within DatabaseConnector instead,... more 3/5/2015 7:00:39 AM