Browsing 7239 questions and answers with Jon Skeet
It's doing exactly the right thing - you're saving a properties file, which escapes things like colons using backslashes. From the documentation for Properties.store: Then every entry in this Properties table is written out, one per... more 5/10/2014 12:51:21 PM
You need to quote the T because you want it to match literally. You also want X as the format specifier for the time zone, not Z: yyyy-MM-dd'T'HH:mm:ss.SSSSSSX Or you could specify the time zone as UTC, and quote the Z as... more 5/10/2014 10:24:10 AM
You don't need to cast to the concrete class - just cast to the interface you're interested in (or use as to perform a conditional cast, and check it for success): Interface1 x = (Interface1) Activator.CreateInstance(type); Interface2 y =... more 5/9/2014 9:49:18 PM
You're creating a new BufferedWriter each time you recursively call the method. I'm surprised that's working at all, but it certainly makes it hard to tell what the output is likely to be. I suggest you change the code to have an "outer"... more 5/9/2014 5:19:11 PM
I think you're just looking for the is operator: if (this is SubClass) In particular, that will also continue if this is an instance of a subclass of SubClass. If you then want to use this as SubClass, e.g. to get at a member declared... more 5/9/2014 4:26:34 PM
I believe this is basically stopping the timer No, it's removing a single handler. If there are any other handlers, those will keep firing. Or maybe the developer wants to be able to re-add the handler later on, with the timer keeping... more 5/9/2014 1:10:55 PM
Logically your first method should capture this. This line: Sequence<T> collection = this; ... will only execute on the first call to MoveNext(), so it really does need to capture it, and it can only capture it in an instance... more 5/9/2014 12:48:34 PM
You can't, basically. Java generics don't work with primitive types. You could do it with reflection, but it would be ugly. You could also do it with the boxed types, like this: public <T> void verify(T[] array, T value) { if... more 5/9/2014 12:40:03 PM
Your current attempt doesn't work because you're trying to declare a variable of type void - the equivalent would fail in C# too. You need to declare a variable of a suitable functional interface, just like you use a delegate type in... more 5/8/2014 11:45:44 PM
I suspect this is the problem: cells[x][y] = update(cells,x,y) You've only got one grid, which you're updating while you're still computing from it. Generation n+1 should only take account of information from generation n - whereas... more 5/8/2014 10:04:23 PM