Browsing 7239 questions and answers with Jon Skeet
The second web site is simply using base64 instead of hex to represent the binary data as text. So you can get rid of your bytesToHex method entirely, and just use Base64: String base64Digest = Base64.encodeToString(thedigest,... more 7/24/2014 9:19:08 AM
An array is just stored as a big contiguous block of memory. Accessing an element is a matter of: Finding where the data starts Validating the index Multipying the index by the element size, and adding the result to the start... more 7/24/2014 9:07:23 AM
It sounds like you might just want: private void GenerateData(ThreadStart method) { Thread thread = new ThreadStart(method); thread.Start(); } You could then certainly have: private void DoWork() { ... } private void... more 7/24/2014 8:37:07 AM
Your code is nearly correct - although it can be simplified somewhat, and made more testable, and it should handle the case where there's no such zone... // You should use dependency injection really - that makes the code much more //... more 7/23/2014 6:57:32 PM
You're getting confused between XML documentation files and the time zone (nzd) files. You don't need to update XML files at all. To get the most recent version of the TZDB data, you should: Fetch (and store) the contents of... more 7/23/2014 6:52:51 PM
I suspect you just want to return the results of the recursive calls. So turn these calls: FileSystem.makePath(newParent, newPath); into return FileSystem.makePath(newParent, newPath); Although I think it's worth noting that you have... more 7/23/2014 6:17:30 PM
You haven't shown enough context, but I suspect you've got something like: class Game { Point thePoint = new Point(50, 50); Paintball gun = new Paintball(thePoint); } As the compiler says, a field initializer can't refer to... more 7/23/2014 4:03:15 PM
I wouldn't use the current approach at all, to be honest - you're doing much more work than you need to. LINQ gives you much better tools than this. You can use GroupBy to make it all cleaner: var pairs = array.GroupBy(x => x) ... more 7/23/2014 3:22:22 PM
In the first case, you're introducing a variable called IllegalStateException. It's equivalent to: try { throw new RuntimeException() } catch (Exception IllegalStateException) { println("hello!") } In the second case, you're only... more 7/23/2014 3:01:14 PM
Okay, I think it probably makes sense to have something like a RowView class, which contains a reference to a Row, and the properties you're interested in (a subset of the row's properties). You can then make it implement... more 7/23/2014 2:53:56 PM