Here's an interesting little 'gotcha' I encountered a little while ago
-
http://www.yankeeboysoftware.com/wordpress/?p=10 I think I spent about a half an hour working out what the issue was, and onlyfound it when I decided to trace into the hashing function. Of course it was all my own fault, but I still find it interesting and amusing.
-
http://www.yankeeboysoftware.com/wordpress/?p=10 I think I spent about a half an hour working out what the issue was, and onlyfound it when I decided to trace into the hashing function. Of course it was all my own fault, but I still find it interesting and amusing.
-
this aint reddit, you have to tell us here!
xacc.ide - now with IronScheme support
IronScheme - 1.0 alpha 2 out nowHere is a snippet of code which illustrates the bug. set set; stringstream ss; string s; ss << 't' << 'e' << 's' << 't'; s = ss.str(); cout << "inserting [" << s << ']' << endl; set.insert(s); ss << ends; // now add the null terminator s = ss.str(); cout << "looking for [" << s << ']' << endl; if(set.end() == set.find(s)) cout << "NOT FOUND" << endl; else cout << "FOUND" << endl; This was hard to find with the debugger which of course displays a ull terminated string the same way it displays a non-terminated string
-
Here is a snippet of code which illustrates the bug. set set; stringstream ss; string s; ss << 't' << 'e' << 's' << 't'; s = ss.str(); cout << "inserting [" << s << ']' << endl; set.insert(s); ss << ends; // now add the null terminator s = ss.str(); cout << "looking for [" << s << ']' << endl; if(set.end() == set.find(s)) cout << "NOT FOUND" << endl; else cout << "FOUND" << endl; This was hard to find with the debugger which of course displays a ull terminated string the same way it displays a non-terminated string
I've had simmilar issues with C# and VS2008.... Especially when adding new line characters, never easy to fix.... A simple debug tip is to do
String debugString = theString.Replace("\r\n", "@@@");
and then breakpoint the line after.