Browsing 7239 questions and answers with Jon Skeet
Assembly.Load is used to load .NET assemblies. It sounds like you just want to start a new process - so use the Process and ProcessStartInfo classes after saving the file to disk first: File.WriteAllBytes("tmp.exe",... more 5/2/2014 10:16:24 AM
Assuming you're calling the same superconstructor in both cases and just passing in a different argument, you can just use the conditional operator: super(condition ? Foo.class : Bar.class); more 5/2/2014 8:35:54 AM
Does arr1[0].length access the length of the first column, where arr1.length accesses the length of the first row? It depends one exactly how you're viewing the array in terms of "rows" and "columns". The int[][] type is an array of... more 5/2/2014 6:45:52 AM
You're specifying the script both in CreatePipeline(scriptText) and AddScript(scriptText). I'm not a Powershell user, but I'd suggest that either you want using (Pipeline pipeline = runspace.CreatePipeline()) { ... more 5/2/2014 6:41:20 AM
You're specifying fractional seconds, but your format has "seconds past midnight" - which doesn't have 9 digits. You're also specifying a colon in your format string, when your data has a dot. Try: select cast(to_timestamp('21-02-14... more 5/2/2014 6:23:51 AM
Will there be any negative performance implications on the following code due to methods that do not throw exceptions being inside of a try block? No, it won't have any performance implications, but: I would generally put minimal... more 5/1/2014 9:33:02 PM
With the catch clause, if the exception is thrown you're catching it and then it's not propagating out of the method... so execution will get to the end of your try/catch/finally block, reach the end of the method, and you won't be... more 5/1/2014 8:22:02 PM
No - you can't ask another thread to sleep. Apart from anything else, at the time when you want it to sleep it may hold a lock or other resource which really shouldn't be held while sleeping. You'd have to do this cooperatively, with some... more 5/1/2014 7:03:19 PM
The List<T>(IEnumerable<T>) constructor will use ICollection<T>.CopyTo if the collection implements ICollection<T>, which byte[] will do. That's not going to help directly if you only want to extract part of the... more 5/1/2014 5:34:43 PM
Assuming you're just talking about java.util.Date, it's as simple as: public static String toJson(Date date) { return "\\/Date(" + date.getTime() + "-0000)\\/"; } (That's assuming the backslashes should really be part of the... more 5/1/2014 2:04:37 PM