Browsing 7239 questions and answers with Jon Skeet
Yes, because a regular string literal can't include a line break in the source code. You can include one in a verbatim string literal however: string sql = @"SELECT FOO FROM BAR WHERE X=Y"; Or break it with... more 5/17/2014 8:00:58 AM
In the above code, why it is not considering the final qualifier while overriding a method? Because it's an implementation detail. It's completely irrelevant to callers. All it means is that within the method, the code can't assign a... more 5/17/2014 7:41:14 AM
No, just avoid using arrays. Arrays are always mutable, and even if you create a new array each time, that means your callers will have to perform defensive copies if they pass the sets around. Firstly, I'd change your Move class to an... more 5/16/2014 6:17:42 PM
You need to specify the working directory when you run cmd. There are overloads of Runtime.exec() which allow you to specify a working directory. For example: Runtime.getRuntime().exec("cmd /c start C:\\temp\\test.bat", null, ... more 5/16/2014 2:25:50 PM
Don't try to change the data - instead, if you're certain that your class is still compatible with the old version (and if only one version has data out in the wild), change your declared serialVersionUID to -477189107700903771L to match... more 5/16/2014 12:40:12 PM
If you create a variable, you'll then get code complaining that it's unused, which can be annoying. For benchmarking cases, I've sometimes added a generic Consume() extension method, which just does nothing: public static void... more 5/16/2014 12:34:44 PM
Something that could be useful is that i know exactly the size of each string to be read and each byte array to be read. Exactly. That's very common. Basically you length-prefix each message - and you might want to provide more header... more 5/15/2014 6:48:30 PM
This is your value: 2014-02-07 00:00:00 This is your format: yyyy-MM-dd'T'HH:mm:ss They don't match. Your format has a T in the middle - your value doesn't. If all your values have a space instead of a T, just use: yyyy-MM-dd... more 5/15/2014 2:06:30 PM
Well it sounds like you just want the handler itself as the parameter: public void WatchConfigFile(FileSystemEventHandler handler) { ... this.watcher.Changed += handler; ... } That should be fine. There'll be a method group... more 5/15/2014 1:57:16 PM
I suspect you've basically got your lambda expression and your method call the wrong way round. You may want: @Html.DisplayFor(modelItem => objmajor.FindMajorById(int.Parse(modelItem.MajorId)).MajorName) In other words, you're... more 5/15/2014 1:18:44 PM