All tags need to be closed
-
I was checking out some random tutorials, and found this little nugget. I think someone is a tad bit confused about how things work in C/C++.
#include <shellapi.h></shellapi.h>
-
I know nothing whatsoever about programming, and even my eyes are watering in sympathy here. I mean, who's the guy around here who says 'Nuke it from orbit!" about pretty much anything that sucks, and can I borrow his catchphrase?
-
Wow.
Just... Wow.
-
Please tell me someone accidentially put that file through some sort of XML cleanup program...
-
And this, gentlemen, is the true meaning of WTF.
-
What's next, <samp>if (i > 0)</samp> ?
-
Does that actually compile?
-
warning: extra tokens at end of #include directive
Otherwise, it compiles and runs in g++.
-
@movzx said:
#include <shellapi.h></shellapi.h>
The very best wtf's truly don't really require a long explanation.
O...M...G...
-
Google led me to Tomy Chen's blog, which unfortunately confirms this wasn't a one-time mistake
#include "stdafx.h"
#include <shellapi.h></shellapi.h>
#include <stdio.h></stdio.h>
-
believe it or not, I think that somebody has a screwed up stylesheet generating the webpage and a validator added the ending tags.
-
@billhead said:
Google led me to Tomy Chen's blog, which unfortunately confirms this wasn't a one-time mistake
#include "stdafx.h"
#include <shellapi.h></shellapi.h>
#include <stdio.h></stdio.h>
So that's how Chinese C/C++ is different than the English one. (Just kidding)
-
mmm... so I was reading through that paula thread, and the last page or so of comments appears to have been linkbotted.
Is there a way to easily report that abuse?
-MBirchmeier
-
@MBirchmeier said:
Is there a way to easily report that abuse?
Check the link at the bottom right corner of these posts .. the that says "report abuse" Feel free to use it :D
-
@OzPeter said:
@MBirchmeier said:
Is there a way to easily report that abuse?
Check the link at the bottom right corner of these posts .. the that says "report abuse" Feel free to use it :DThe one that doesn't exist in front page comments you mean?
-
This HAS to be a misguided auto-formatter. The rest of the code there is too sane to have been written by someone who would write that atrocity.
-
Simply clbuttic!!
-
How the fuck do you screw up <stdio.h> and such O_O;
Even copy and paste code should have that right.
I'm not sure what the bigger WTF is; that horrible horrible include exists, or it compiles ....
-
@movzx said:
#include <shellapi.h></shellapi.h>
Well, still much better than the tutorials that just seem to have "#include", until you happen to look at the page source code.
-
Take a look here: http://www.shield.on.ca/Blog/?p=105 There you'll find the same thing, but it also has does strange things to the ampersand. However, I don't understand why, since the tags are clearly not part of the HTML/whatever code.
-
Ah, I get the joke. It's supposed to be this, right?
#include <shellapi.h />
-
They are both using some html code colorizer that is obviously overzealously closing tags.
-
@rbowes said:
Ah, I get the joke. It's supposed to be this, right?
#include <shellapi.h />
The most correct application would be:
<includes>
<include name="shellapi.h" />
</includes>;)
-
@Soviut said:
The most correct application would be:
<includes>
<include name="shellapi.h"
/>
</includes>I disagree. The usage of attributes for content is becoming deprecated. Attributes should be descriptive of the content within the tag.
@More Correct Example said:<?xml version="1.0" encoding="UTF-8"?>
<includes xmlns="http://forums.thedailywtf.com/xml/includes">
<include type="header">shellapi.h</include>
</includes>
-
@joe.edwards said:
@More Correct Example said:
<?xml version="1.0" encoding="UTF-8"?>
<includes xmlns="http://forums.thedailywtf.com/xml/includes">
<include type="header">shellapi.h</include>
</includes>Ah, ah, but this doesn't even has a schema... how are you supposed to validate it?
Also, in case you wanted to extend the "type" attribute, how would you avoid name collisions?
Obviously, the correct example is:
<includes
xmlns = "http://forums.thedailywtf.com/xml/includes"
xmlns:cinc = "http://forums.thedailywtf.com/xml/C-include-types"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation = "http://forums.thedailywtf.com/xml/includes http://forums.thedailywtf.com/xml/includes.xsd"
>
<include type="cinc:header">shellapi.h</include>
</includes>
-
@PSWorx said:
O...M...G...@joe.edwards said:
@More Correct Example said:
<?xml version="1.0" encoding="UTF-8"?>
<includes xmlns="http://forums.thedailywtf.com/xml/includes">
<include type="header">shellapi.h</include>
</includes>Ah, ah, but this doesn't even has a schema... how are you supposed to validate it?
Also, in case you wanted to extend the "type" attribute, how would you avoid name collisions?
Obviously, the correct example is:
<includes
xmlns = "http://forums.thedailywtf.com/xml/includes"
xmlns:cinc = "http://forums.thedailywtf.com/xml/C-include-types"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation = "http://forums.thedailywtf.com/xml/includes http://forums.thedailywtf.com/xml/includes.xsd"
>
<include type="cinc:header">shellapi.h</include>
</includes>I think you just invented ... ACAX.
-
Nice, all it needs now is a header saying whether it's UTF-8, UTF-32 or some other encoding.
edit: missed it from a previous post XD