Browsing 7239 questions and answers with Jon Skeet
You can use the fact that the CLR allows you to convert between byte[] and sbyte[] "for free" even though C# doesn't: sbyte[] data = ...; byte[] equivalentData = (byte[]) (object) data; // Then write equivalentData to the stream Note... more 8/6/2015 10:50:43 AM
Well, there are two problems here. First, you've got: this.Type = Type.split("\\."); ... which uses Type instead of type. Next, you're using type[0] which is referring to the parameter called type, not the field. You could fix it... more 8/6/2015 10:34:02 AM
You've misunderstood the meaning of an element that looks like this: <PDBx:atom_siteCategory> That's an element with a local name of atom_siteCategory in the namespace with the URI of "http://pdbml.pdb.org/schema/pdbx-v40.xsd" as... more 8/6/2015 8:40:19 AM
DoubleMalt's answer (accepted at the time of writing) is unfortunate, because it's sort of using two wrongs to make a right. It doesn't help that Apache Commons Codec makes it so easy to do the wrong thing :( Base64 is fundamentally an... more 8/6/2015 7:16:40 AM
Assuming this is a Windows Forms app, the problem is that the Visual Studio WinForms designer has created another file (e.g. Main.designer.cs) with: public partial class Main : Form to contain designer-generated code. Your partial... more 8/5/2015 12:15:53 PM
Is it possible that the jitter might optimize the code of thread 1 that way that tempParams is not a memory address but a CPU register? I suspect that's possible - but that won't stop the garbage collector from treating it as a use of... more 8/5/2015 11:52:35 AM
It's unclear what you mean by "converting FilterItems into a list" when we don't know anything about it, but you could definitely consider sorting after you've got all the items, rather than as you go: var strings =... more 8/5/2015 11:01:29 AM
It looks like you just want a LINQ inner join: var query = from score in scores join exp in experiences on score.Id equals exp.Id select new Total { Id = score.Id, Name =... more 8/5/2015 8:15:41 AM
Reader.read() just returns a single character - but as an int, so you can tell if you've reached the end of the data. Now there isn't any Integer.parseInt(int) method, which is why the calling is failing - there isn't even... more 8/5/2015 6:13:46 AM
I think you're assuming that the parameter values will be injected into the SQL and that what ends up being sent to the server is a single string. There's no reason why that needs to be the case - although it could be in some... more 8/4/2015 7:43:00 PM