|
Thanks. Hope it was a compliment;)
|
|
|
|
|
Of course it is.
Ignorance of the ability brings disability.
|
|
|
|
|
|
P1l19r1m wrote: #define TRUE (rand() > 0.1 ? TRUE : FALSE) // happy debugging losers
Shouldn't that just be #define TRUE (rand() > 0.1) ?
I guess I haven't used c++ in a while, but what happens when you use a circular define like that?
|
|
|
|
|
can we do that ??
i will put this in my mate's code 
|
|
|
|
|
You should do it!!! 
|
|
|
|
|
that's pure evil hopefully, there is no switch statement using this constant...
|
|
|
|
|
I've made some kind of mistake "Copypasting" is evil . As MSDN ( http://msdn.microsoft.com/en-us/library/398ax69y.aspx ) claims, rand() function returns a pseudorandom integer in the range 0 to RAND_MAX (32767). So, the preferable way is to use the following "working code":
#define REALLYTRUE 1
#define REALLYFALSE 0
#define TRUE (rand() > (32762/2) ? REALLYTRUE : REALLYFALSE) // happy debugging losers
P.S. If to compile this code:
#define TRUE (rand() > 0.1 ? TRUE : FALSE) // happy debugging losers
we will have an error like:
c:\temp\win32\randex\randex.cpp(19) : error C2065: 'TRUE' : undeclared identifier
But using the new version of code it will be "all right" 
|
|
|
|
|
Actually I liked the original version better as it will work in 32766 out of 32767 cases. Now try to reproduce that odd error! 
|
|
|
|
|
da(14) = i + 1
I have absolutely no idea what it means, but I think it will require that my mind bend.
EDIT: Found this in the same codebase (keep in mind, it's VB.NET):
EDIT 2: Aside from the function names (I replaced sensitive info with "XXX"), I changed nothing:
#Region "Functions to write after main functions"
Public Function GetXXXByXXX(ByVal MyStrin As String) As System.Array
Dim myEmpty As System.Array = Nothing
Return myEmpty
End Function
Public Function GetXXXByXXX(ByVal MyStrin As String) As System.Array
Dim myEmpty As System.Array = Nothing
Return myEmpty
End Function
Public Function getXXX(ByVal MyStrin As String) As System.Array
Dim myEmpty As System.Array = Nothing
Return myEmpty
End Function
#End Region
|
|
|
|
|
Jeeez... don't you recognize art when you see it?
'pleaswe make sure that there is no empty
'we can add even more informations
I like it
(yes|no|maybe)*
|
|
|
|
|
AspDotNetDev wrote: I changed nothing
If you changed Nothing then what did those Functions Return before you changed it?
It's an OO world.
|
|
|
|
|
AspDotNetDev wrote: I changed nothing
one cannot change nothing, it is a very stubborn constant, and that is what makes it so popular.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I suppose you can't break anything if you don't change anything or do anything. Sounds like JSL to me.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
This little gem comes courtesy of Q&A:
If TextBox9.Text > TextBox8.Text Then
GoTo bob
Else : TextBox9.Text = TextBox8.Text
End If
Bob: Lovely, no?
Not only that, but he wanted to know why it didn't put the largest number in TextBox9 when TextBox9 had "999" and TextBox8 had "1000".
Sometimes, I get the feeling we should ask who these people are learning from, and have a "hall of shame" just for them...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
OriginalGriff wrote: GoTo bob
He came to the right place 
|
|
|
|
|
It's about the only thing he did do right!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
I hope he does not read this. Poor guy came here asking for help, but instead he gets flamed in the hall of shame.
Of course it is something to be ashamed of
OriginalGriff wrote: we should ask who these people are learning from
Judging from the code I think this guy's mentor is called Bob
It's an OO world.
|
|
|
|
|
It’s really bad when they don't get even the most basic things. I sincerely hope this was from a beginning student, not someone with a degree in Computer Science.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
In reality, I have seen people with a masters degree in Computer Science writing this kind of code.
|
|
|
|
|
OriginalGriff wrote:
If TextBox9.Text > TextBox8.Text Then
GoTo bob
Else : TextBox9.Text = TextBox8.Text
End If
Bob:
What I get out of this is that your real name is 'bob'. Wherein lies the mystery?
|
|
|
|
|
Just saw this code at work:
if( A==B )
{
if( B==C && A!=C)
{
DoABC();
}
else
{
DoWork();
}
}
else if (C==A || C == B)
{
DoWork();
}
I have examined, tested over and over, but code never goes or will go to DoABC();
// ♫ 99 little bugs in the code,
// 99 bugs in the code
// We fix a bug, compile it again
// 101 little bugs in the code ♫
|
|
|
|
|
|
Woaw that code definitely sucks!
And I'm not sure if you are being serious about this so I will put this explanation anyway...
But it's testing if A equals B and afterwards if B equals C (and that means both A and B equals C)... And then it only calls DoABC if A don't equals C...
|
|
|
|
|
If equality is transitive (and I really hope it is), it can indeed never execute DoABC.
Given A == B and B == C, it follows from transitivity that A == C, so A != C must be false.
|
|
|
|
|
Under normal circumstances equality is transitive; but it also isn't permanent...
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|