Browsing 7239 questions and answers with Jon Skeet
You're only actually populating a single array - and overwriting it every time you call getCol. So the values of cola1 and cola2 end up referring to the same array, whereas you want them to refer to different arrays. You should probably... more 6/21/2014 12:52:56 PM
That "-0500" is the offset from UTC, in RFC822 format. You just want Z, without the SSS. The Android SimpleDateFormat docs have it like this in the table: Symbol: Z Meaning: time zone (RFC 822) Kind: (Time Zone) Example: Z/ZZ/ZZZ:-0800... more 6/20/2014 7:26:27 PM
you return a reference to the private field "name" Well, not quite. You return the current value of the child field. It's important to understand that that's not the same as somehow returning a reference to the field itself. After the... more 6/20/2014 7:16:43 PM
The same branch is being taken in both cases. You can verify that by using very different answers for the different branches: if (value == Math.floor(value)) { result = ((int) value * 100); } else { result = value; } and result... more 6/20/2014 6:46:44 PM
You're nearly there, but as well as creating a copy of the local variable, you need to use it in your lambda expression: for (int i = 0; i < 5; i++) { int localCopy = i; Task.Run(() => { myMethod(myList.Skip(localCopy *... more 6/20/2014 4:15:20 PM
You should be getting it as a compile-time error, not an exception (unless the actual exception is that you've got an unresolved compile-time error). Just importing org.mockito.Matchers means you can use the name Matchers to mean... more 6/20/2014 3:45:43 PM
Well you could use: var results = myFullCsv.Where(line => line.Split(',')[2] == targetValue) .ToList(); That's just doing the "splitting and checking" you mention in the question but it's pretty simple code. It... more 6/20/2014 3:13:34 PM
I don't know whether you can do this in CQL, although even if you can't, you might well be able to do it with Roslyn. However, you might want to consider using a builder pattern instead: var poco = new MyPoco.Builder { FirstName =... more 6/20/2014 8:27:54 AM
What is the actual reason for this behaviour? I can't provide details for exactly what's going on in this specific case, but I understand the general problem, and why using Console.WriteLine can change things. As we saw in your... more 6/20/2014 6:48:42 AM
I would strongly avoid repeatedly adding a particular amount of time - timers aren't going to fire exactly on time, so you'll end up drifting due to that. Instead, remember the difference between the system clock and add that difference... more 6/20/2014 6:05:58 AM