Browsing 7239 questions and answers with Jon Skeet
You're calling Writer.write(int): Writes a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored. My guess is that's not what you want to... more 4/9/2014 7:03:48 PM
The problem is very simple... From your C# code: SHA256Managed sha256hasher = new SHA256Managed() SHA-256 != SHA-1. Use the SHA1 class instead in C#, or use SHA-256 in Java as well. As you apparently can't change the C# code, you should... more 4/9/2014 3:51:25 PM
Just wrap the whole method in another one: public String handleEditRequest(...) { Timer timer = new Timer().start(); try { return handleEditRequestImpl(...); } finally { timer.stop(); ... more 4/9/2014 2:17:43 PM
The general rule in C# is "the default is as private as you can explicitly declare it". So: namespace Foo { class Bar // Implicitly internal class Bar { int x; // Implicitly private int x void Baz() {} //... more 4/9/2014 2:06:47 PM
Your current code doesn't do anything with the local time zone - everything is in UTC, effectively (certainly in terms of your code, which is dealing in "milliseconds since the Unix epoch"). If you want to make your code... more 4/9/2014 1:59:01 PM
It's basically allowing the category filter to be optional - if the category parameter is non-null, then it has to match whatever you're looking at. Otherwise, just include all categories. more 4/9/2014 12:55:59 PM
This isn't a constructor: public Void AddCstmrForm(Runnable myFunc) throws Exception { initComponents(); ... } It's a method called AddCstmrForm with a Void return type. I think you meant: public AddCstmrForm(Runnable myFunc)... more 4/9/2014 12:43:18 PM
As you're using .NET 4, you can make your life much simpler by using TimeSpan.ToString(string) to do the formatting for you: using System; class Test { static void Main() { int minutes = 31; TimeSpan ts =... more 4/9/2014 12:37:24 PM
You can never instantiate a TenantType - so the only value you could possibly pass into DemoMethod would be null. Think about how you'd be calling the method - if you were expecting to call (say) DemoMethod(10, TenantType.TenantUser) then... more 4/9/2014 10:41:36 AM
The code you've written just assigns a value to a variable. It doesn't return anything, and it doesn't have any inherent string representation. A DateTime value is just a date/time. It can be displayed in whatever format you want, but... more 4/9/2014 10:24:31 AM