|
I have a new requirement for a content based routing thing, if a value in an xml message is true then it goes to two places, otherwise it goes to just the one.
Capture a message, find the node, look at the value - false.
So I code for true and false.
It doesn't work.
Capture a message that didn't behave as I thought it should, look at the value - yes.
Look at a few more.
Yep, for reasons that I cannot begin to imagine the value of the node I am trying to route on is false or yes.
yes or no, true or false, 1 or 0, penis or vagina.
What kind of sick mind goes for yes or false?
Some men are born mediocre, some men achieve mediocrity, and some men have mediocrity thrust upon them.
|
|
|
|
|
This is a good example of DDD - Drug Driven Development.
|
|
|
|
|
Now that's funny, that explains a lot!
As I grow older I've found that pleasing everyone is impossible but pissing everyone off is a piece of cake.
|
|
|
|
|
It's an OO world.
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
|
|
|
|
|
Yes, your code needs to be more flexible:
if (messageValue.ToLower().MatchesOneOf("1", "yes", "true", "vb sucks"))
{
message.SendToTwoPlaces();
}
else if (messageValue.ToLower().MatchesOneOf("0", "no", "false", "vb rocks"))
{
message.SendToOnePlace();
}
else
{
throw new UserTooUncertainException(messageValue);
}
Probably should really add all the trew/falls options to a couple of dictionaries but I couldn't be bothered; you get the idea!
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
Quote: 0", "no", "false", "vb rocks
are really sure, really...
|
|
|
|
|
Sounds like a good entry for "Weird and Wonderful"
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
I'll take a whack at it.
I am a Masm developer. I write my own runtime functions. Any API accesses are through my runtime wrappers. In my world, I preserve all used registers (and the flags if I call any system APIs), and this includes the EAX register. If you want a return value from a function, you must supply a pointer to the location to receive the return value. Each function returns a success value in a common cell called dError (use it or loose it), and ends by comparing dError to 0, thus the flags on return from the function reflect whether the function succeeded or failed - 0 or "jz Good" - non-zero or "jnz Bad".
Now, as defined by "C", TRUE is a non zero value and False is zero, just the opposite of my checks.
To get around this annomoly, I never use TRUE or FALSE, just GOOD (0) or BAD (non zero).
It all depends on your point of view. There can only be a single case of GOOD, but there can be multiple cases of BAD.
Dave.
|
|
|
|
|
It was Richard...
|
|
|
|
|
chriselst wrote: penis or vagina What kind of software are you making and is your company currently hiring?
It's an OO world.
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
|
|
|
|
|
chriselst wrote: What kind of sick mind goes for yes or false? True.
... I mean... er...
Oh, bugger.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Why is every message in the lounge being marked as SPAM / ABUSIVE?
Just curious. If it is a CPer, then STOP IT!
|
|
|
|
|
newton.saber wrote: If it is a CPer If they're not, they cannot vote.
newton.saber wrote: then STOP IT Why?
Off topic; giving a down-vote does not give one points, it costs a point. Mass-downvoting means that it's just a matter of time before he/she gets to a point where they can only downvote a specific amount.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: giving a down-vote does not give one points, it costs a point.
1. We can't downvote in Lounge anymore, not for a long time. Do you mean mark as SPAM/Abusive?
2. It does not cost a point, or what do you mean? If I mark something as SPAM it does not cost me a point.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Downvoting costs a point. Forgot for a minute that we can't downvote here
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Downvoting costs a point. It sounds like you are saying if you downvote someone it costs you a point. Surely you can't be saying that?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
That's how I once read it in the FAQ.
Seems downvoting is now 2 points worth, but it doesn't "cost" you any point to downvote someone. Strange, I've long been assuming it cost you a point, even checked that once or twice.
..soo, downvoting is free, hrm?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: soo, downvoting is free, hrm? Yes, have at it.
I actually downvoted something in a forum today and I got 0 points. Not sure if that was +0 or -0 but it didn't seem to affect me.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I just check my rep history and I can't see any abuse / spam kicks being applied to me recently.
How are you sure that "every message in the lounge being marked"?
Or is it just yours? Have you annoyed anybody recently?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
OriginalGriff wrote: Have you annoyed anybody recently? Yeah... He wrote an other book
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
That'll do it every time!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I'll second that. I try to annoy as often as possible. But I'm trying to get this message across which will probably annoy more people and the message is that
EVERYTHING IS MARKED AS SPAM!!!!
Can you hear me now!!!???!!!
|
|
|
|
|
|
I think you are right -- and I am wrong. I saw the little red flags next to everything.
I'm a dunce. Sorry. But this was a lot of fun, wasn't it?
wasn't it? Wasn't...
|
|
|
|
|
newton.saber wrote: But this was a lot of fun, wasn't it? Oh yes, haven't laughed so hard since I marked all the Lounge messages as spam oh, er, um ...
|
|
|
|