- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Susan Ivanova: Ambassador, do you really want to know what's going on down there right now? Londo Mollari: Yes, absolutely. Ivanova: Boom. Boom, boom, boom. Boom, boom. BOOM! Have a nice day.
Admin
Gary. Gary! Gary gary, gary. HAHAHAHA GARY! Gaaaarrryyyy! No. Gary???
Also, 101 + 7 = 108.
You either played it, or you didn't.
Admin
I see the problem var srcDatum = datum; if (datum.datum && datum.datum.datum) { datum = datum.datum.datum; } else if (datum.datum) { datum = datum.datum; }
if (!datum) { return; }
Admin
Admin
Malkovich. Malkovich malkovich malkovich, malkovich malkovich.
Malkovich? Malkovich.
Admin
How about recursively?
Admin
In javascript (and many other normal programming languages), you can go data = (data.data && data.data.data) || data.data || data; or even [0,0].foreach(function(){data=data.data||data})
Admin
Nobody does WTF like MS...
this.Form.Form.Form.Form.Form.Form.Close();
Admin
http://isotropic.org/papers/chicken.pdf
Admin
Admin
Data? Not Data!
[image]
Also fuck you Akismet. Fuck you sideways with a chainsaw.
Admin
Did you ever notice everyone else's data is just stuff, but your stuff is DATA... ?
Admin
FTFY
Admin
Malkovich Malkovich Malkovich. Malkovich.
Admin
Smurf smurf = smurf Smurf(smurf); smurf
Admin
Admin
Checking for !Data after calling properties on it (data.data)? THAT is where you are asking for trouble. Everything else seems perfectly fine :)
Admin
Pika? Pikapika! Pika. Pikapikpika. Pika pikachu!
Admin
Wouldn't that be: return data.data.data ?? data.data ?? data;
The last part, "?? null;", is not needed since if data is null, it will be returned anyways, if it's the last part of the statement? :)
Admin
var srcBruce = bruce; if (bruce.bruce&& bruce.bruce.bruce) { bruce= bruce.bruce.bruce; } else if (bruce.bruce) { bruce = bruce.bruce; }
if (!bruce) { return; }
FTFY
Admin
Admin
Admin
data.data.data ?? data.data ?? data [?? null] does not work - it will just throw a NullReferenceException unless all three levels are non-null. Also the article contains only a single return statement returning nothing - no one knows what happens to data.
Admin
Obviously it should read "[...] unless the first two levels [...]".
Admin
Developers, developers, developers, developers!
Admin
Ok, I admit I wrote it, but in my defense, I was stoned.
Admin
Reminds me of planet Marklar.
http://en.wikipedia.org/wiki/Starvin%27_Marvin_in_Space
Admin
This was funny. But, tell us, how did you find this, know about this, etc? Was this a mistake, something intentional - what's the point?
Admin
Haven't you all heard of data driven development? WTF?
Admin
Kyle: “Marklar, these marklars want to change your marklar. They don't want Marklar or any of these marklars to live here because it's bad for their marklar. They use Marklar to try and force marklars to believe they're marklar. If you let them stay here, they will build marklars and marklars. They will take all your marklars and replace them with Marklar. These marklar have no good marklar to live on Marklar, so they must come here to Marklar. Please, let these marklars stay where they can grow and prosper without any marklars, marklars, or marklars.”
Alien: "Young Marklar, your Marklars are wise and true."
Admin
Where's the xkcd reference?
Admin
Shhh = you should use the word "frak". There's a fuck in here that will fuck your fuck if you keep using the word "fuck".
Admin
Data Data Data Data Data Data Data Data Batman!
Admin
Malkovich?
(Captcha: nulla. When data.data.data has no value.value.value, it's nulla.nulla.nulla.)
Admin
Could be an old version of PHP. That blog is undated.
Might also have to do with the way they define TRUE and FALSE in PHP. Normally it should be:
#define FALSE 0 #define TRUE (!FALSE)
But this is not universal. I would suggest trying that test again with something more explicit like:
<?php echo (1 == 2 ? "a" : 1 == 2 ? "b" : "c")."\n"; echo (1 == 2 ? "a" : 1 == 1 ? "b" : "c")."\n"; echo (1 == 1 ? "a" : 1 == 2 ? "b" : "c")."\n"; echo (1 == 1 ? "a" : 1 == 1 ? "b" : "c")."\n"; ?>Also, you could try using parentheses to enforce order of operation:
<?php echo (1 == 2 ? "a" : (1 == 2 ? "b" : "c"))."\n"; echo (1 == 2 ? "a" : (1 == 1 ? "b" : "c"))."\n"; echo (1 == 1 ? "a" : (1 == 2 ? "b" : "c"))."\n"; echo (1 == 1 ? "a" : (1 == 1 ? "b" : "c"))."\n"; ?>I've used multiple stacked ternary expressions plenty of times in PHP with expected results.
Admin
Data data data. I cannot make bricks without clay.
Admin
Never mind that, where's the sidebar reference?
"data processing, data data processing"
Admin
Douglas "Swish" Reemer: Dude! Coop: Dude! Douglas "Swish" Reemer: Dude! Coop: Dude! Douglas "Swish" Reemer: Dude! [Coop looks shocked] Douglas "Swish" Reemer: Dude. Coop: I guess you have a point. (From the movie "BASEketball," 1998)
Admin
Well, it's not quite an exact match. The code only returns things when data is false. I believe a more accurate rewrite would be:
DaveE
Admin
This problem, like all others, could be solved by adding another level of indirection..
Put another wrapper round it: and call it data.
Admin
In Delphi Pascal that would be:
Which, I am confident you will agree, is much more cromulent.
-Harrow.
Admin
I still have nightmares about Gary.
Admin
There are two chickens in the back yard and two chickens in the front yard.
Admin
The problem is actually with the guy who created the data.data.data object, not the poor guy who's had to perform some logic on it. Assuming they're different guys.
Admin
How many d's in "Rudolph the Red Nosed Reindeer"? 7 - d d, d d d d d....
Admin
Admin
Sounds like a Haiku a friend of mine once wrote:
git git git git git git git git git git git git git git git git git
Admin
Hmmm so what about a buffalo called "Buffalo"?
I'm going to add one: "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo Buffalo"
(Modified quote from Wikipedia: -) THE buffalo FROM Buffalo WHO ARE buffaloED BY buffalo FROM Buffalo, buffalo (verb) OTHER buffalo FROM Buffalo NAMED Buffalo.
I guess you could even add some more in there... Though of course the real wtf would be calling a Buffalo buffalo Buffalo.
Admin
It's undated but accurate. The ternary operator in PHP has reversed associativity from any other language. Try it for yourself; you can't get any result but the last two.
Admin
You know, if he'd added one more level in his structure, he could have gotten rid of that silly null. Use of case sensitivity would have helped, too: