|
Huh. Useful in some situations, eh?
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image.
Stephen Hawking
|
|
|
|
|
Thanks for this, Chris, I think there could be a lot more to it than is immediately apparent.
The older I get the better I was
mikeo
|
|
|
|
|
Nice. Are there any (*: doesn't work in browser X) conditions on this? I know the conditional selectors generally don't play nicely with IE.
|
|
|
|
|
BobJanova wrote: Are there any (*: doesn't work in browser X) conditions on this
No support on IE8 and earlier, unfortunately.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Bah... No one uses old browsers like that anyway...
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
+5, it's nice to see some wonderful code, as oposed to the waves of weirdos...
EDIT: if you can, make this really a OTD series, as a CSS Selector OTD has really a great potential...
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
|
|
|
|
|
|
Thanks for posting this, and to CP for hilighting it in their newsletter email today. This is a pretty cool thing that I had not seen before, probably hidden in plain site right in front of me though.
|
|
|
|
|
Is this what you are using to prevent anchored headings in CodeProject articles from being shown in blue instead of orange?
|
|
|
|
|
yeah
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Non-CSS version - as used in Netscape Navigator 4, Internet Explorer 4, and many later browsers:
<a name=...></a>text to be bookmarked
or
<span id=...>text to be bookmarked</span>
|
|
|
|
|
Empty anchors don't always work. They should. They don't.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
From the main form of a simple XSD validator app..
void executeButton_click(object sender, EventArgs e)
{
if (userTooStupid(schema == null, "You gotta load an XSD first, genius.") ||
userTooStupid(fileBrowser1.SelectedFiles.Length == 0, "You've selected zero files. And they're all valid!!"))
return;
bool userTooStupid(bool condition, string insult)
{
if (condition)
MessageBox.Show(insult, "User Too Stupid");
return condition;
}
|
|
|
|
|
And the problem with that is what, exactly?
|
|
|
|
|
I think it isn't too polite when you show a message box to your user which is telling him that he is too stupid .
Just a gues
|
|
|
|
|
Ah, I see - empathy etc. I've heard of that!
|
|
|
|
|
Mark Springsteen wrote: I think it isn't too polite when you show a message box to your user which is telling him that he is too stupid . Is politeness or honesty preferred?
"Replace Application Operator" is sometimes the best advice an application can give.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Is politeness or honesty preferred?
Honesty is important. Why can't you insult your user in a honest way ?
|
|
|
|
|
The user would probably complain that "Too" and "Stupid" should be lowercase only, and that pressing "Tab" button should close the message box.
|
|
|
|
|
Should you do it? All depends if the client is stupid enough to pay you for the work!
|
|
|
|
|
|
I once wrote some code that checked for a condition that was impossible (just to be funny) and added an error message that went something like this:
"It seems that an impossible condition has been perceived to have occurred while processing your data. If you are receiving this error, then please do nothing, as you you obviously do not exist. Authorities have been notified of your non-conformity."
So far, I'm not aware that anyone else has seen it...
|
|
|
|
|
few functional language compiler (i know) have this ability to track the side effects and wont compile unless there is a fall back handler.
|
|
|
|
|
Programmer sure seems to heve a high opinion of themselves. After all, it's not like they disabled that execute button until the user had loaded an XSD and selected at least one file. And to top it off, they tried to cover up their shortcomings by insulting the user. Stupid programmer.
Programmer: -1
User: 0
We can program with only 1's, but if all you've got are zeros, you've got nothing.
|
|
|
|
|
A good point. Such easily pre-checkable conditions can be coded around, in a UI at least, so that the user can't make that stupid mistake.
|
|
|
|