|
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!
|
|
|
|
|
|
Ah, I remember writing that when I wrote Sim City. Of course, Sim time is different than our time. A side effect of reticulated splines.
|
|
|
|
|
What is... thread synchronization for dummies?
|
|
|
|
|
That looks more like three shakes of a lamb's tail.
|
|
|
|
|
It seems there's a difference between
Factor *= 10*(256-b(3))
and
Factor *= 10^(256-b(3))
I wish I could blame this snafu on someone else, but I can't.
|
|
|
|
|
Oops!
All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value.
Carl Sagan
|
|
|
|
|
|
Watch out, in some languages the ^ operator is XOR, instead of exponentiation - you still might not have it right!
|
|
|
|
|
I'd like to call a hall of shame on myself - or, rather, my coding practices of about six years ago.
Having just jumped into .NET, I was building a periodic table. I (manually) serialized the element data in a double-separated string (I think the separators were | for elements and ; for each of their attributes).
The only problem was, I'd never heard of String.Split. I'd implemented a one-separator splitter once before using String.Substring, but the two-separator splitter was far more complex.
About six hours of coding later, I had around thirty lines of String.Substring (if I still had the files, I would paste in the function). It worked, but looking back, I realize I could have replaced all that with a single line.
Live and learn, I suppose.
|
|
|
|
|
That happens to everyone. When I started with WinForms the first thing I did was write a nice class for linked lists. And then had my facepalm moment when I discovered the the System.Collections namespace
To my defense: I used to work with C++ before and was used to be on my own for such things. Still, the class did its job and was a nice exercise to get used to managed references and garbage collection. And it gave me some impression about what kind of performance to expect from managed code.
At least artificial intelligence already is superior to natural stupidity
|
|
|
|