Browsing 7239 questions and answers with Jon Skeet
Sure, it's easy: using (var stream = File.Open(path, FileMode.Append)) { stream.Write(extraData); } No need to read the file first. I wouldn't class this as steganography though - that would involve making subtle changes to the... more 1/12/2015 2:44:14 PM
Is the method java.util.Date method .equals indifferent in what concerns the date format or not? A Date object doesn't have a format - it has no notion of where the information came from. It is just a number of milliseconds since the... more 1/12/2015 10:02:22 AM
i would expect to see special JVM instructions like wait I wouldn't. That would be inconsistent, in my view - in the source code, you're just calling a method, so it makes sense that you're just calling a method in the bytecode as... more 1/12/2015 9:06:14 AM
Look at your loop: while (in.hasNext()) { array[k] = in.next().charAt(k); k++; } This reads one token at a time, and takes the kth character from that token. So from "Good Morning" it retrieves character 0 of "Good" (G) and... more 1/11/2015 11:12:15 AM
From the original version of the question: I've declared it static since I will only ever need a single application-wide accessible instance of the class. That's not what a static class is. You can never have any instance of a static... more 1/10/2015 7:50:48 PM
The two operands are going through binary numeric promotion as per JLS section 5.6.2 in order to get to a single type for both operands. The rules are like this: If any operand is of a reference type, it is subjected to unboxing... more 1/10/2015 7:45:09 PM
I want to override and hide this method with a method which takes certain number of parameters instead of params in inheriting class. You can't. That would break inheritance. Consider the following code: BaseClass bc = new... more 1/10/2015 3:05:52 PM
This sounds like the perfect job for a producer/consumer queue. You only want one thread parsing the XML - but as it parses items (presumably converting them into some object type ready for insertion) it can put the converted objects onto... more 1/10/2015 12:48:28 PM
Matt's answer is spot on for Noda Time 1.x. In Noda Time 2.0, I'm introducing a ZonedClock, which is basically a combination of IClock and a DateTimeZone. As you're likely to want the current time in the same time zone multiple times, you... more 1/10/2015 12:43:10 PM
This is the problem: // BROKEN (will give query such as "select * from details where FIRSTNAME=Jon" rs=st.executeQuery("select *from details where FIRSTNAME="+name+""); I suspect you meant to add a single quote around the value of name,... more 1/10/2015 12:19:41 PM