|
My message post is devoted by someone, but why ?
|
|
|
|
|
Voting is turned off at present, as you can see from the lack of 1-5 options at the bottom of this.
The only available option is to report things with the Red Flag which is only supposed to be used for spam and abuse, neither of which is relevant to any of your posts I can see in this thread. I can only assume that someone feels that the subject is not appropriate for this forum (which it isn't really, it should be in the Sugs'n'Bugs forum) but to report it is a little bit of an over-reaction. Still, people are all different!
Ignore it - it doesn't affect you in any real way.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
oks...
|
|
|
|
|
Sorry for replying so late to this message of you dear Sir. Primary reason iz so that we can send you message to say "Send codez. Needz urgentz. Boss on my case to ship product."
LOL
|
|
|
|
|
I thought it might be!
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
This isn't the right forum to post this question. Post this in Bugs & Suggestions[^]
In some cases, my signature will be longer then my message...
<em style="color:red">ProgramFOX</em> ProgramFOX
|
|
|
|
|
I just found this little gem in the same app I'm rewriting. This legacy website is the gift that just keeps on giving.
<span style="font-weight: normal; color: Red; font-size: 11pt; font-family: Arial">
<span style="color: #000000">
This paragraph is black!
<br/>
<a href="" style="color:black">And this link is black!</a>
</span>
<br/>
But this paragraph is red!
<br/>
</span>
<span style="font-weight: normal; color: Red; font-size: 11pt; font-family: Arial">
And this other text is red, but identical in every other way.
</span>
Also, it goes without saying that I cleaned this up for the post. There's no rhyme or reason to the indentation and line breaks in this code.
|
|
|
|
|
AnalogNerd wrote: There's no rhyme or reason to the indentation and line breaks in this code.
I feel your pain.
|
|
|
|
|
throw new ProgrammerIsAnIdiotException("ID-TEN-T ERROR", new BrainException("Brain Not Found", ErrorCodes.NotFound));
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
Try adding some table layout to that HTML code and you got something of which I find at work every day. Ohh... if that wasn't bad enough... try adding some random UI logic in classic ASP!
Fun stuff!
|
|
|
|
|
Looks to me like the code was generated by a tool...
Wysiwyg html editors will often produce ridiculousness like this.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Marcus Kramer wrote:
Looks to me like the code was generated by a tool...
Wysiwyg html editors will often produce ridiculousness like this. |
<blockquote class="FQ"><div class="FQA">Marcus Kramer wrote:</div><table class="quick" cellspacing="0" cellpadding="5" width="100%">
<tbody><tr><td id="prevMsgCnt"><div id="ctl00_MC_PrevContent">Looks to me like the code was generated by a tool...<br>
<br>
Wysiwyg html editors will often produce ridiculousness like this.</div></td></tr></tbody></table></blockquote>
I was about to remove the WYSIWYG line, but decided not to when I saw the quote code. (Listed above for reference)
Bob Dole The internet is a great way to get on the net.
2.0.82.7292 SP6a
|
|
|
|
|
Marcus Kramer wrote: Looks to me like the code was generated by a tool...
Yes, a right tool.
|
|
|
|
|
From some legacy VB6 code I'm in the process of making redundant...
Private Sub Command7_Click()
Dim PolNumb As Long
If Val("" & txtOpenPolicyNo) > 0 Then
PolNumb = Val("" & txtOpenPolicyNo)
Else
PolNumb = Val("" & InputBox("Policy ID "))
If Val("" & PolNumb) > 0 Then
PolNumb = GetPolicyNumberfromID(PolNumb)
End If
End If
If Val("" & PolNumb) > 0 Then
FindPolicy GetPolicyIDfromNumber(PolNumb)
End If
End Sub
I particularly like the lines...
If Val("" & PolNumb) > 0 Then
which effectively convert a number to a string, prepend an empty string, then convert it back again... just for good measure.
|
|
|
|
|
At my current job we've got a lot of legacy code like that. Just put + "" to the end of every object you can imagine. It will effectively convert the object which you already had to a string and from there you can convert it back to whatever you want (but Val() is indeed very popular!).
My company even had its own Val() function which returned 0 if an Exception was thrown
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
}
|
|
|
|
|
I've seen plenty of those "safe cast" functions.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Often those functions easily, if not totally safely, help a developer out of the mire that is VB6.
|
|
|
|
|
... and that, dear friend, is where I've seen them.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Is that irony?
"It's an OO world.
public class Naerling : Lazy<Person>{"
Now, a Person with type specifier "Lazy" is something I can understand, but a "Lazy" with type specifier "Person" does not seem to be good OO design to me.
(just jokes)
|
|
|
|
|
Those aren't type specifiers, at least in any language I'm familiar with (C++, C#, Java).
|
|
|
|
|
Lazy<Something> and what's lazy? The Person. Read it out loud and it makes perfect sense
Besides, I was more worried with signature design than OO design
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
}
|
|
|
|
|
I've seen code like
x = 0 - y;
which, apparently was a workaround for a compiler bug which sometimes generated the wrong code for
x = -y;
I've also seen lots of legacy code of the type you've described but not in VB. The thing is that the concatenation operator is & so think about why they've used + before you change it. Sometimes there is a reason for using the +. Just make sure the item on the right is a string: it may not always be a string. When it isn't, what is happening and what are they doing?
|
|
|
|
|
Member 4608898 wrote: what is happening and what are they doing? No one really knows... There's lots of obscure bugs in code like that Luckily, one of the other 'magical solutions for all your problems' is the wonderful On Error Resume Next command. Really, if it was allowed people would've used On Error Resume Next + ""
It's an OO world.
public class Naerling : Lazy<Person>{
public void DoWork(){ throw new NotImplementedException(); }
}
|
|
|
|
|
That is a programmer's trick to handle null values - it converts a null value to an empty string, which then evaluates to zero. The use of the ampersand (&) makes this work - if the plus sign (+) is used to concatenate, an invalid use of null error will be thrown, as any variable concatenated using + will be nulled if any of the concatenated values are null
It is equivalent to using functions such as IsNull, NZ etc
====================================
Transvestites - Roberts in Disguise!
====================================
|
|
|
|
|
I realize that, but that still doesn't excuse conceding from a long to a string, then back to a long again. That's just sloppy coding.
Regardless, it's an appalling way to do the conversion.
|
|
|
|