Browsing 7239 questions and answers with Jon Skeet
Formatting is irrelevant. Internally it won't be in a text format at all, and I'd hope that the query doesn't end up sending the query value to the database as text either. If you're only interested in the date part, you need to say that... more 11/27/2013 10:15:30 PM
Look at the overloads of DirectoryInfo.EnumerateFiles - there's no overload taking just a SearchOption, but you can give a string and a SearchOption: var files = di.EnumerateFiles("*", SearchOption.AllDirectories) .Where(f... more 11/27/2013 10:04:44 PM
You shouldn't have the \ at the start of the second argument. You want: string filepath = Path.Combine(arg1, "tf1.dat"); Otherwise it thinks you want an absolute filename, basically. more 11/27/2013 9:04:54 PM
If you're trying to use the same value throughout the loop, just use the return value of incrementAndGet(): int index = q.incrementAndGet(); if (index >= Xdisc.length) { break; } // I'm assuming you meant there to be a brace... more 11/27/2013 6:02:59 PM
Instead of foreach, a more efficient solution? Nope. Fundamentally, if you want to round all the values, you've got to round all the values. There's no magic that will make that simpler. Of course, if you're only going to access a... more 11/27/2013 5:48:06 PM
Well you could use BitArray.CopyTo: byte[] bytes = new byte[4]; ba.CopyTo(bytes, 0); Or: int[] ints = new int[1]; ba.CopyTo(ints, 0); It's not clear what you'd want the string representation to be though - you're dealing with... more 11/27/2013 4:14:11 PM
Well you're really interested in the year, right? So try: where e.delDate.Year == 2013 EDIT: As we now know that delDate is a DateTime? it would be: where e.delDate != null && e.delDate.Value.Year == 2013 more 11/27/2013 3:10:51 PM
You can't. Packets can be of different sizes, so there's no single mapping from "number of packets" to "number of bytes". (That class only gives the numbers of packets - not the contents of the packets themselves.) more 11/27/2013 10:21:41 AM
No, Java doesn't have anything like that. While the compiler can strip out code which is guaranteed not to be executed, it's still got to be valid code. So you can have: private static final FOO_ENABLED = false; ... if (FOO_ENABLED) { ... more 11/27/2013 10:00:35 AM
You shouldn't build up your SQL like this - you should use parameterized SQL instead: // TODO: Closing the statement etc String sql = "select sc.* from SubCategory sc where sc.CategoryCode = ?"; PreparedStatement statement =... more 11/27/2013 8:42:26 AM