|
Tom,
I LOVE your signature line. DYSLEXIC of BORG!!! I laughed till my stomach hurt.
|
|
|
|
|
I wish I could claim it as my own original line, but I got it from my son. He found it somewhere online, and I loved it.
WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated.
|
|
|
|
|
|
CPallini wrote: The following was mine
Sorry, I am a geometrical Embryo.:->
Please elaborate.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Well, the error isn't in geometry formula by itself.
As an hint, in the following one the bug is fixed:
...
double cosa = cos( alfa );
double sina = sin( alfa );
for (i = 0; i < POINTS; i++)
{
double dx = x[i] - x;
double dy = y[i] - y;
x[i] = x + dx * cosa - dy * sina;
y[i] = y + dx * sina + dy * cosa;
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Sorry, that wasn't a horror, just a classical bug mixing present and future state.
Lots of algorithms offer opportunities for mistakes like this one.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
|
Then any good runtime will return an error stating quite plainly that:
"Sorry. This method is busy. Please call again later."
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
Just got off the blower to a colleague who is having a very bad day
He got a call from a customer whose database seems to have disappeared; now my colleague isn't a technical guy, but I talked him through SQL Server Management Studio. Suprisingly, my collegaue confirmed that the database was present, as was it's entire structure - only all the tables were empty of data.
I asked him the background to the call - as this isn't a system I know much about or deal with. Apparently this database back ends a VB6 application, and one of the features of this 'application' is that it allows users to import data from 'sattelite' Access databases. Like a lead balloon the penny dropped and I remembered why i stopped having anything to do with the system 2 - 2 1/2 years ago.
I asked, "have you got a copy of the last Access database imported"? "Yeah sure," he said as I could feel the laughter rising. I opened Access, and sure enough the imported database was also completely empty I advised to restore last night's backup, while I had a word with our VB *guru*. The conversation went a bit like this:
Me: Remember 2 1/2 years ago I told you your import routine was cretinous? That blindly dropping tables and then recreating them from an unknown, untrusted source is possibly the worst bit of design I have ever encountered? That you are a complete Charlie?
Him: <thinks> Oh, yeah!
Me: Well why didn't you fix it!!!!!!
Him: Err... well... you see... I still thought it was the best way of doing it!
BWHAHAHHAHAHHAHABBAHAHHAHAHHAHAHAHHAHAHAHHAHA!! HAHAHHAHAHAHHAHAHAHHA BWHWHWHWHWWHHWWHAHAHAHAHAHAHAHAHAHA HAHAHAHA!
VB6 Chumps - they should all have their computers taken away from them and be given Etch-a-Sketchs instead!
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
|
There you go. Classic schoolboy error there. VB Guru (isn't that an Oxymoron - or at lease a moronic Ox). Expecting them to think. Tie the two sentences together and you've got the makings of a Bruce Willis movie.
|
|
|
|
|
martin_hughes wrote:
Just got off the blower to a colleague who is having a very bad day
I'm glad I'm not one of your colleagues whose suffering inspires much mirth in you.
Calling all South African developers! Your participation in this local dev community will be mutually beneficial, to you and us.
|
|
|
|
|
Oh, no!...
I have to admit to resembling that remark, however, as I am forced to use VB (usually VBA) on occasion.
|
|
|
|
|
But couldn't this have happened with any programming language, not just VB?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes, quite true, but it has been my experience of C++/Java/C# guys who claim to 10-15 years working with their chosen languages (as does our resident VB "Guru", apparently) that they approach software with a bit more thought
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
I get your point, but...
martin_hughes wrote: C++/Java/C# guys who claim to 10-15 years working with their chosen languages
... would make me a bit hesitant about the trustworthiness of that C# guy.
--
Time you enjoy wasting is not wasted time - Bertrand Russel
|
|
|
|
|
Good catch - or the Java guy claiming 15 years
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Today we had to edit very old code and we ran into this great piece of code
for (int lnIndice = 1; lnIndice <= 1; lnIndice++)
{
switch (lnIndice)
{
case 1:
break;
}
}
We found it very funny
|
|
|
|
|
It would be interesting if the optimizer managed to do anything with this. This is the kind of stuff you end up with, when code gets 'maintained' over a couple of generations of developers.
|
|
|
|
|
Effectively, and no one changed it
|
|
|
|
|
|
The loop one times construct can be useful.
Where I've used it is when I've had to work with a long sequence of if else/if's, and used break to exit. For instance:
while (true)
{
if (set (ifrFragment))
{
result = true;
ifrTerm = ifrFragment;
break;
}
if (errorCode)
break;
if (keyword (TokenSubtype::Not) && term (ifrFragment))
{
result = true;
ifrTerm = TokenSubtype::Not.asString() + " " + ifrFragment;
break;
}
if (errorCode)
break;
break;
}
But the switch/case in your example would lead me to believe that lnIndice had other values at some point, perhaps for debugging.
|
|
|
|
|
lol. Haven't seen that done in a long time. We used to do it to piss off the "never use goto" zealots years ago when forbidden to use 'goto xit' for handling error conditions.
|
|
|
|
|
Robert Surtees wrote: We used to do it to piss off the "never use goto" zealots years ago when forbidden to use 'goto xit' for handling error conditions.
Robert, I use goto's for exactly the same reason.
if (keyword (TokenSubtype::Group))
{
if (!group_label (groupName))
{
errorMessage = myName + ": Missing GROUP label\n" + errorMessage;
errorCode = DL_ERROR;
goto exit_;
}
if (!separator (TokenSubtype::Colon))
{
errorMessage = myName + ": Missing colon following GROUP label";
errorCode = DL_ERROR;
goto exit_;
}
|
|
|
|
|
I use goto only to break out of >1 nested loops... Don't see the need for it anywhere else...
|
|
|
|