I already solved this but thought I'd ask anyway...
I have a large application with a reasonably comprehensive test suite and unit test system. I was working on it and made a change that shouldn't have broken anything and suddenly dozens of test are failing. What should I do?
I'm looking for a list of things that help isolate bugs. Tip...
Consider the following two ways of writing a loop in Java to see if a list contains a given value:
Style 1
boolean found = false;
for(int i = 0; i < list.length && !found; i++)
{
if(list[i] == testVal)
found = true;
}
Style 2
boolean found = false;
for(int i = 0; i < list.length && !found; i++)
{
found = (list[i] == testV...
Is there a fixed point in the MD5 transformation, i.e. does there exist x such that md5(x) == x?
...
Suppose that you have two huge files (several GB) that you want to concatenate together, but that you have very little spare disk space (let's say a couple hundred MB). That is, given file1 and file2, you want to end up with a single file which is the result of concatenating file1 and file2 together byte-for-byte, and delete the origina...
Since reading this question, I'm wondering: What would be the Right ThingTM to do to associate a UNIX file (ie, blob of data) with a file type? We have file extensions (DOS), data/resource forks (Apple) and ... err, file extensions and file(1) (UNIX), and MIME types (html et. al.).
Given all your griefs about handling files of various...
I was just wondering how the PHP is behaving in the background.
Say I have a PHP which creates an array and populates it with names.
$names = Array("Anna", "Jackson" .... "Owen");
Then I have a input field which will send the value on every keypress to the PHP, to check for names containing the value.
Will the array be created on e...
Or, equivalently, how would you design such an API. Expected/example usage would be illustrative as well.
My curiosity comes directly from the comments (and subsequent editting on my part) of this answer. Similar questions/discussions in the past provide a bit of inspiration to actually asking it.
Executive summary:
I don't feel a mu...
This is a totally hypothetical question, but I have to know the answer.
I assume most C++ compilers are written in assembly. Which makes them different languages entirely (I could be wrong). That being said if I were going to create a cout style function for plain old C, how would I do it? cout has some very impressive features take thi...
That is a hypothetical question. If there existed a machine with infinite memory that could execute any set of instructions within the blink of an eye, what would programming that machine be like?
I remember the old days, when i wrote x<<8 + x<<6 instead of x*320 because multiplying was a little more expensive than performing two bit sh...
Greetings Stack Overflowers,
A while back, I was working on a program that hashed values into a hashtable (I don't remember the specifics, and the specifics themselves are irrelevant to the question at hand). Anyway, I had the following code as part of a "recordInput" method.
tempElement = new hashElement(someInt);
while(in.hasNex...
UTF-8 requires 4 bytes to represent characters outside the BMP. That's not bad; it's no worse than UTF-16 or UTF-32. But it's not optimal (in terms of storage space).
There are 13 bytes (C0-C1 and F5-FF) that are never used. And multi-byte sequences that are not used such as the ones corresponding to "overlong" encodings. If these h...
A hypothetical organization (we'll call them Sprockets Incorporated) spent millions of dollars to rewrite a product. The rewrite ended with lost time, more bugs, and a harder to maintain version of the product. Does anyone here have anecdotal precedence for convincing upper management to support a rerewrite? Or even a rewrite? How can su...