|
Said website is for Psychology 120, as I need to participate in research studies for credits.
I (along with numerous other students) couldn't log in, as we would get an invalid credentials error, no matter what (and yes they were valid).
Yesterday I found out that the issue was a very messed up validation function that failed for seemingly random valid inputs and succeeded for seemingly random invalid inputs.
The function was only supposed to be one line, sent to the person in an email (copy and paste), calling a REST service to match the user ID against the database. The person writing it somehow managed to mess that up and break the site.
The function was apparently about 300 lines when the idjit was done.
Messing something simple like that up requires a special kind of stupid. How do you mess up a F****** ONE LINE FUNCTION, WHEN THE ACTUAL CODE WAS GIVEN TO YOU?!?
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
He refactored it... it didn't meet his design specifications.
|
|
|
|
|
|
Brisingr Aerowing wrote: that failed for seemingly random valid inputs and succeeded for seemingly random invalid inputs. mandatory xkcd[^]
Brisingr Aerowing wrote: Messing something simple like that up requires a special kind of stupid. How do you mess up a F****** ONE LINE FUNCTION, WHEN THE ACTUAL CODE WAS GIVEN TO YOU?!? Gimme codez plzzz, its urgntzzz
On a crazy but serious note:
Scenario one: the mouse can be a bitch and deselect part of the text you have to copy, then if you delete the message and you empty the trash-bin before you paste the copied code... you might end in a situation where you have to finish the code you were given, having no idea of how to do it.
Scenario 2: You copy while you have a remote desktop open, and someone else have filled the clipboard with other kind of code. Then you paste the wrong content due to the remote desktop bug, you don't checked at all what you are pasting and you deploy something compilable that makes no f***ing sense in that place.
And no... it didn't happen to me (but a colleague in other land). I have only suffered the consequences of both scenarios and had to repair one of them
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Brisingr Aerowing wrote: Messing something simple like that up requires a special kind of stupid. How do you mess up a F****** ONE LINE FUNCTION, WHEN THE ACTUAL CODE WAS GIVEN TO YOU?!?
I think that the code which tested your login credentials against every bank site was a friendly security feature, not a bug.
I'm not sure how else I would personally squeeze 300 lines of of a login check.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Was hunting a bug in a PHP plugin, and found this:
do_something($object-id);
PHP told nothing...do_something got the value 1...I spend 20 minutes on that...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
It's missing the critical piece:
do_something($object-id);
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
strNumber = "0"
strResult = FormatNumber(strNumber, 0, TriState.True, TriState.False, TriState.False)
returns "0" as I expected, however
strResult = FormatNumber(strNumber, 0, TriState.False, TriState.False, TriState.False)
did not... What was I not thinking?
"Go forth into the source" - Neal Morse
|
|
|
|
|
kmoorevs wrote: What was I not thinking? You weren't thinking that '0' without the trailing 0 would be ''. It is only so for fractionals, according to the docs, so how is '0' a fractional number?
And what is TryState.UseDefault? Is it the default of the bool-type, or a default that is specific to that function? Which is it, true or false?
FormatNumber Function (Visual Basic)[^]
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote:
And what is TryState.UseDefault? Definitely not something I would try or trust for this function! (at least where I was using it) Supposedly, it's based on the computer's regional settings, but I couldn't nail it down to exactly where.
"Go forth into the source" - Neal Morse
|
|
|
|
|
for (Int16 i = 1; i <= 2; i++)
I suppose this is the DRY principle taken to its logical conclusion
|
|
|
|
|
My first thought was "that will execute three times" and then I noticed it starts at 1
VS2015 would also give the advice to "simplify" Int16 to short (as Int16 is waaaay to esoteric for us simpletons)
|
|
|
|
|
I could just imagine the next few lines being
if (i == 1) {
}
else {
}
(Maybe too much time looking in QA)
Cheers,
Mick
------------------------------------------------
It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
|
|
|
|
|
Fortunately not - though it does have an inner loop that is a foreach and I think it could be refactored away. Got to put some tight unit tests down around it first as there is little or no intent in evidence from code or comment.
|
|
|
|
|
Looks like that'll run fast and stable.
Kitty at my foot and I waAAAant to touch it...
|
|
|
|
|
Never heard of IF-less programming?
|
|
|
|
|
Why On Earth?!?[^]
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
# define begin {
# define end }
|
|
|
|
|
I'm bleeding
Loneliness and cheeseburgers are a dangerous mix.
|
|
|
|
|
Nice and tidy
Would be fun to unindent some statements... someone should really consider a change of language
(yes|no|maybe)*
"Fortunately, we don't need details - because we can't solve it for you." - OriginalGriff
|
|
|
|
|
The real question is; "Is that done with tabs or spaces?"
|
|
|
|
|
Actually, I find it surprisingly readable
Of course putting all the semicolons and brackets there is one hell of a job (unless it's somewhere in the formatting options).
|
|
|
|
|
Sander Rossel wrote: Actually, I find it surprisingly readable
Yeah, but you're Dutch.
|
|
|
|
|
It reads as C# without curly braces.
I have a VB.NET background, which also doesn't have curly braces.
Who needs curly braces anyway
Seems like hell to format though
|
|
|
|
|
Sander Rossel wrote: have a VB.NET background
Ahh, that explains everything!
|
|
|
|