Browsing 7239 questions and answers with Jon Skeet
Well, if you really don't mind re-opening the file each time, you can use: CurrentLine = File.ReadLines("c:\\test.txt").Skip(LastLineNumber).First(); LastLineNumber++; However, I'd advise you to just read the whole thing in one go using... more 2/18/2014 5:51:04 PM
Calendar.WEEK_OF_YEAR is a constant. You wanted cal.get(Calendar.WEEK_OF_YEAR). However, you should note that "week of year" is not as simple as you might expect, as a concept. For example, it can be 53 on January 1st, which belongs to... more 2/18/2014 5:46:24 PM
My understanding is that this Sub Init() procedure works like a main method in C#, in that everytime the Example class is used, this method is initialized automatically. No, that's not a correct understanding of either the Init method... more 2/18/2014 5:36:11 PM
By the time the data has been read within Javascript, it will have the appropriate name. This is just an escape sequence, which doesn't change the value of the data. For example, in a Javascript console: var x = "foo\/bar"; var y =... more 2/18/2014 5:34:18 PM
Others have said how you can avoid the definite assignment problem. Local variables always need to be definitely assigned before they are first read. However, I'd suggest using LINQ to make the code simpler anyway: bool alreadyInList =... more 2/18/2014 5:31:45 PM
You're calling run() on the newly created Thread object in ParserType1.init(). That doesn't start a new thread - it just execute's the thread's run() method in the existing thread. You should be calling start() instead. Fundamentally I... more 2/18/2014 3:28:17 PM
As I can see BigInteger is a ValueType, as much as I know, a ValueType must have a maximum size of 16 bytes. No, that's not true. It's a conventional limit, but it's entirely feasible for a value type to take more than that. For... more 2/18/2014 2:29:17 PM
My question is interface variable is static final Yes. From section 9.3 of the JLS: Every field declaration in the body of an interface is implicitly public, static, and final. It is permitted to redundantly specify any or all of... more 2/18/2014 2:20:11 PM
Don't perform any string conversions. Just use DateTime value = dtCastFrom.Value; Let the Entity Framework itself take care of getting the data to the database. You don't want a string representation, and there's no reason to go via a... more 2/18/2014 2:18:13 PM
I suspect you're seeing the difference between the C# 5 compiler (invoked via msbuild) and the C# 4 compiler (in VS2010). I'm somewhat surprised that msbuild is using the C# 5 compiler, but it appears to be... The rules for how a foreach... more 2/18/2014 9:31:59 AM