I'm trying to write an MD5 generator (for integrity checks, not actual hashing), but it doesn't seem to be working right. And it only operates on a 512-bit chunk, for now. Hashing the empty string...
I'm planning on making a game which multiple people can play over a network. I've never done any programming involving a network, so I have lots of questions.
I have, but I can't find a pattern that would work. The problem seems to be that infoboxes, tags, and pictures show up before the real body of the text, and I can't figure out how to tell if a link...
After reading the latest xkcd: http://xkcd.com/903/ I started writing a program that will find the first link on each article, and see if it does eventually lead to philosophy. However, I know next...
Oh, right. I keep forgetting about the debug version not being as fast as release. That really sped it up. And yeah, next_permutation() does work. Thanks!
I've tried using that, but it's far too slow. I think that might be because it produces things in a strict order. Also, it produces n! more permutations than I need, and since n is going to be around...
I'm trying to make sets of n k-sided dice, using each number from 1 to n*k once. n and k are known at compile time. So, I thought of making an array with ints recording which die the number belongs...
I'm writing an application which has to know when the user has clicked on a curve that is shown on the screen. I can get a copy of the curve, and the point the user has clicked, but I don't know how...
Yeah, just giving a solution doesn't help. If that solution is explained, that'd be a lot better. On the other hand, you just have to hope they'll read it. :P So, here goes.
The for loop is what...
When I attempt to rescale a JFrame, which has no listeners, and has two JPanels in it, the layout takes a bit to resize itself. It's not slowness due to long calculations, since there's nothing that...
Also, if you want exactly k spaces, not k-or-fewer, you could use a recursive method. I know nothing about its efficiency though. It would go something like this:
Whoops, sorry about that. Too bad there's no printfln(). Also, could he call println() once after each printf()? Or is that slower/less readable than getting the newline separator?
For the formatting, use System.out.printf("Here is some text with a value %.2f and some more text.\n", value). The % means that a value will be inserted into the text. The .2 means to format two...
Is there a way to specify in a base class that the derived class must create a constructor with certain parameters? Kind of like an abstract method, but it appears to be forbidden to create an...
Alright, I went back and looked at the example I saw, and the third comment was not above a method or variable, but above another comment. It went like this:
Is the Yearly Income Tax correct? I think there is an issue in the if-else statements. You have 5 ranges, 0-6000, 6000-25000, 25000-75000, and 75000-150000. For one, you need a 150000+ range. But...
Well, what errors are you getting? When you check if the user entered 'q', you need to use ==, not =. = is assignment, not equals. == is equals. Also, this wasn't much of an issue since the code was...
Well, a is a pointer to the first element in the list, right? So a-1 is one before the beginning of the list, and garbage is stored there. I think you mean *(a+x), which would give the last element...