|
do you think i spent all day? not at all, i found it right away. but can i blame micro-controller for this?
|
|
|
|
|
Yes, of course you can. It will not help very much and you will not find out very much that way, but if it makes you feel better...
At least artificial intelligence already is superior to natural stupidity
|
|
|
|
|
That's happened to me a few times (occasionally with C++ Builder too!). In each case it has been a variation on:
Different memory (especially heap space) allocations between the debug and live environment (even on the same machine). Debugger initialising memory to something sensible, thus hiding an uninitialised variable somewhere in my code, debugger locating the program in a different area of physical memory, thus avoiding a faulty patch of RAM that - by coincidence - wasn't used by the OS normally either, and so on
In other words, this type of problem is almost always memory related in some way, or possibly due to uninitialised use of a physical device or internal queue in some that way the debugger covers up when it sets up the debug environment.
One technique that can sometimes help catch this is to use a remote debugging session run from a second machine - often the remote debug stub will not do as much pre-execution setup as an integrated debugger, thus leaving the problem undisturbed, or at least different.
I remember one particular problem porting a program from C++ builder to Linux, where the C++ Builder program loader initialised class memory to 0 before starting the program, whereas GNU C++ didn't - took me a while to spot that, as the program only failed when loaded without gdb (which placed it in an area of memory that was, by chance, all 0s!)
Oh, happy days...
8)
|
|
|
|
|
|
There is nothing to hate about C++. C++ doesn't written for winning prize for "Standards". It came to solve real world problem and solving it very well, since long time.
Happy Programming
|
|
|
|
|
As a C/C++ coder who started as a .NET coder, I hated C++ to start with. I can honestly say that over the last few years it has really grown on me. I am forced to agree that a well-done c++ application is a thing of beauty. I am still more productive using .Net though, as it generally requires less code to get stuff done.
|
|
|
|
|
If you wanted to teach a monkey how to code you wouldn't use C/C++.
You'd use VB or C#
|
|
|
|
|
code_junkie wrote: If you wanted to teach a monkey how to code... Is that right after it writes out the entire works of Shakespeare on a typewriter?
Uhh, do you know what a typewriter is?
|
|
|
|
|
That's nothing. It happened to me twice, in different environments (one using MSVC and one using gcc): the binary runs flawlessly when compiled in debug mode, and fails highly reproductibly when compiled in optimized mode. Both times the culprit was some smartass programmer who controlled what code gets compiled depending on build type in some libraries.
|
|
|
|
|
I can sympathize (in terms of trying to find some elusive “error”).
The other day, I could not compile a new C# COM server I was building … kept getting errors like: “expecting this …” or “expecting that …”. I counted brackets; braces; everything lined up, but it still wouldn’t compile. (I should mention that some of the code was copied from MSDN).
So, I started refactoring. If I typed it out, it would compile; if I copied and pasted snippets, the compile would fail.
In the end, it turned out to be a “subtract” (i.e. “ - “) in a math statement.
The code I had copied contained an “unprintable” character after the “-“ (which happened to be at the end of a line due to a copied MSDN statement that spanned multiple lines) … retyping the “-“ made the problem go away. You could only “see” the problem if you hit “End” on that particular line because the cursor would land over one extra position.
|
|
|
|
|
When 19 people (at least until now) vote you 1 it's time to accept you are either mistaken or plain different.
What you are doing is to blame a language for problems that are caused maybe by a compiler, the way you wrote the code, 3rd party library, ... . I bet you don't hate C++ but the whole set of tools that you are using to write code in C++. Then to talk back to people when you don't seem to know about release and debug versions it doesn't look well.
I hate a tiny bit C++ but I hate it for what really belongs to it: the "*", the "&" and the "->". It is brutal to understand C++ code sometimes. That's why C# came as a blessing for me.
Stop being frustrated and revisit your code, you'll make it better and learn in the process.
Cheers.
giuchici
|
|
|
|
|
|
Would it not be a real horror to let the poor thread really sleep for one minute (= 0,00000134 dog years or 250000 processor years)?
At least artificial intelligence already is superior to natural stupidity
|
|
|
|
|
I like the measure microfortnight personally.
|
|
|
|
|
Every day, I work a micromillenium.
Just think of it as evolution in action.
|
|
|
|
|
|
Perhaps the application is designed for use deep in a gravity well?
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Most have been up to today. At least as welly as our planet can make it
At least artificial intelligence already is superior to natural stupidity
|
|
|
|
|
That would work, because the people inside the gravity well would experience the passage of time normally. Only an outside observer would see time passing by slower inside the gravity well.
|
|
|
|
|
Grrr....you beat me to the punch line!
|
|
|
|
|
The comment has been truncated. I think it originally read
Thread.Sleep(3000);
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Optimisation opportunity? I've heard stories of people leaving those in so they can present a 'quick win' when they're under pressure.
|
|
|
|
|
Yep, it was here on CP. A "performance loop" it was call or sth like this (for int i=0;i<10000000;i++)
Greetings - Jacek
|
|
|
|
|
Pascal Ganaye wrote: Thread.Sleep(3000); just a tick!
FTFY, no, wait, that's not right either!
|
|
|
|
|