|
Gary R. Wheeler wrote: ObjectServiceFactoryServiceObjectAutomationLinkFactoryServiceFactoryObjectMetaObjectBuilderFactory .
You forgot "GoldProTeamEdition"...
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
|
Let me be the first to congratulate you.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Just spent 1,5 hours on error which came out to be just a tupotypo. I had a simple WPF binding:
public static readonly DependencyProperty SopranTextProperty =
DependencyProperty.Register("SopranText", typeof(string), typeof(SeparateVoicesInputVM), new UIPropertyMetadata(""));
In a user-control. Tired of trying to get UserControl-HostWindow binding working (at least 4 hours), I have given up and broke design rules by pastying all the stuff to the MainWindow. Still, it didn't work. Time was passing while I was switching binding parameters with no effect. Finally, I decided to ask CP for this and, while writing a message, I have noticed one detail...
public static readonly DependencyProperty SopranTextProperty =
DependencyProperty.Register("SopranText", typeof(string), typeof(MainWindowVM), new UIPropertyMetadata(""));
Oh dear
Greetings - Jacek
|
|
|
|
|
|
The funny thing is that when get problems like this (not only typos), I too often find the problem when trying to explain it to someone else or while posting to a forum.
If only I would ask for help earlier, I wouldn't need it earlier too
"To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson
"Our heads are round so our thoughts can change direction." ― Francis Picabia
|
|
|
|
|
Let me second this observation. I have lost count of the number of times that I have found (mostly typo) bugs by trying to describe the problem to a coworker.
|
|
|
|
|
Back in school I once spent two days and several hours debugging a problem caused by an 'h' that was supposed to be a 'b', and vice versa.
Software Zen: delete this;
|
|
|
|
|
OK, Let me preface this by saying, I'm NOT a professional programmer. So I may be way off base and just lacking the knowledge as to why this may NOT be a piece of Shame. If there is a reason to do this, I'd love to know it..
Anyhow... Found this in some JavaScript in a vendor's product we pay plenty of money into monthly:
function ReturnFalse()
{
return false;
}
The only place I can find it used it in a couple statements like this:
if (button.onclick != ReturnFalse) {...
and
button.onclick = ReturnFalse;
Am I nuts or are they?
modified 13-Mar-12 14:25pm.
|
|
|
|
|
The shame is not what you think it is.
They are assigning a function to a click event. This function returns false. In JavaScript, this prevents the event from doing what it does by default. So, if you have:
<a href="#">Click Me</a>
And you assign the ReturnFalse function to it, clicking it will not append "#" to the URL. Without assigning that click handler, it would append that to the URL.
The shame is that they don't attach the event and that they compare the event to the function. They should avoid comparing completely, and they should use something like jQuery's $.bind function to add the function as a handler. Assigning a function to an event will replace all existing handlers, which should be avoided. However, if they wan't to remove all existing handlers, that may be the ideal approach.
|
|
|
|
|
Ahhh OK....
So because they are assigning it to an OnClick event, then it needs to be a function instead of just a simple Boolean, and they're trying to have the click do 'nothing', but do this to avoid having the #, instead of just assigning the OnClick to null, or removing the OnClick attribute completely?
Weird... But good to know for sure... Better I learn this trick, than lose faith in the darned supplier I guess.
modified 13-Mar-12 14:36pm.
|
|
|
|
|
That is one confusing sentence, but I think you've got the basic idea.
|
|
|
|
|
The good news is it makes more sense in my brain then in my typing.
I guess the Shame is on me in this case.
Regardless, CP kicks butt at teaching once again, thanks!
|
|
|
|
|
I agree with you. But yet this will do too
<a href="#" onclick='return false'>Click Me</a>
no need to define and entire function hahaha
|
|
|
|
|
Depends on if you want to dynamically toggle the functionality. And there are benefits to keeping your markup clean from inline JavaScript. Also, "önclick" will probably not work.
|
|
|
|
|
it wont work, i wonder how i wrote that character?
|
|
|
|
|
If you are using a "US - International" keyboard layout, you can type that character by typing a quote mark followed by the letter "o".
|
|
|
|
|
Önclick? That definitely sounds Turkish
I'm invincible, I can't be vinced
|
|
|
|
|
because i am Turkish I get it
|
|
|
|
|
I think it would be less misleading if the ReturnFalse function was instead named AbortAction or something closer to the intention.
I think it is better practise to name a function or method for it's intended purpose or meaning than for what it literally does. The intention/meaning and what the method actually does usually are the same, but there can be subtle differences and occasionally vast differences such as in this case.
Oh and a comment for the function would not go amiss either:
function AbortAction()
{
return false;
}
modified 29-Mar-12 16:14pm.
|
|
|
|
|
if (RegistryKeyExists()) {
} else {
CreateRegistryKey();
}
What should we do with such "programmers"?
|
|
|
|
|
|
You should commend them! Seriously, this is good work.
If you consider that most people touching code are idiots, it's always good to duplicate code around, so that if someone messes up one copy, only a small part of your app gets broken, rather then the whole thing.
|
|
|
|
|
Really? is this how you protect your code?
|
|
|
|
|
No - it's how he protects his job
|
|
|
|