- Feature Articles
- CodeSOD
-
Error'd
- Most Recent Articles
- Monkeys
- Killing Time
- Hypersensitive
- Infallabella
- Doubled Daniel
- It Figures
- Three Little Nyms
- Tangled Up In Blue
- 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
The fact is nobody told us how would it be possible that perfectly valid XHTML doesn't validate as HTML, being its subset at the same time. Actually nobody proved me wrong (apart this xml:lang attribute, my bad). :D
Admin
Ok, first, XHTML is not a subset of SGML it's an XML application (or an XML dialect), and HTML is an SGML dialect.
XML is designed to be a subset of SGML, in that every XML document should also be a conforming SGML document as stated by the eXtended Markul Language 1.0 version 3 Recommandation, appendix C (that's a first formal even though indirect relation between HTML and XHTML here btw), and XHTML 1.0 [...] is a reformulation of the three HTML 4 document types as applications of XML 1.0 as stated by the XHTML 1.0 Recommandation, second edition. Considering that there is no new element in XHTML 1.0 compared to HTML 4, one can, with a bit of logic, understand that reformulating HTML (an SGML dialect) in XML (a subset of SGML) will yield a subset of HTML.
Admin
If it was XHTML then that would be true but plainly it isn't.
In that case *YOU* should go read the HTML spec
http://www.w3.org/TR/REC-html40/
3.2.1 Elements
Element names are always case-insensitive.Some HTML element types allow authors to omit end tags (OPTION is one of these)
In certain cases, authors may specify the value of an attribute without any quotation marks. The attribute value may only contain letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45), periods (ASCII decimal 46), underscores (ASCII decimal 95), and colons (ASCII decimal 58). We recommend using quotation marks even when it is possible to eliminate them.
Admin
It will throw a null pointer exception which is appropriate. Better than returning some random country.
Admin
That's exactly what you do with new StringBuffer(int) in Java. Also a good example of a premature optimization that will almost certainly have no noticeable effect.
Admin
I think that soon we are going to need to add, "it was done to solve a concurrency issue"
It is amazing to me how much people complain about the forum software though.
Just register, never use preview, proofread your post before you click the button and everything will be fine.
Admin
Nope, doing that works most of the time, but when you're toying with the HTML view to actually make something readable, the forum software will fuck it up one day.
Admin
Thank god he used a stringbuffer...
Admin
Dude the real WTF is that he never used a server side scripting language. Although I can appreciate why youd want to use an applet or some flash: Obviousley thats where your skills lie, and good on you ....
Admin
Hahahaha, the country that will max this buffer........ Dude, he sort of uses the StringBuffer for all the countries and the html combined, I recon that could hit 5000 characters, but thats just a guess.
Admin
readers! i'd like you to change that to posters please. Now look what you've made me do, i'm now a poster too.
Admin
sorry forgot quote!
Admin
At first I thought my country (Belgium) wasn't in the list, apperently it's only available if it's selected, otherwise it's turned into belarus
Admin
It's a Catch-22 of countries.
You want to select Belarus.
Yet, upon selecting, Belarus is wrenched from grasp and turned into Belgium, which cannot be selected because it is onyl available when selected.
Accomplished: nothing.
THIS CODE IS FANTASTIC.
Admin
She is not using countryString to store a country's name, but the whole <SELECT> sentence
Sincerely,
not Gene Wirchenko
Admin
The bigger WTF (if I am reading the code correctly) is that the pulldown will have ONLY ONE OPTION.
Based on the series of IF statements, only that single country code will be available as an option (obviously in an HTML SELECT).
So WTF is the point of the pulldown?
Admin
You're reading the code incorrectly then :)
Admin
Yea, you're not. The If/Elses are independent. One statement from each If/Else will be executed. This is not a giant if/else-if/else-if structure (which would behave like a switch statement and would append only one thing to the stringbuffer). It took me a few minutes of looking at the code to figure that out when I first saw it myself since I'm so used to seeing curly braces around the body of an if or else even if it is only one line.
Admin
you also said "try an solve"...
Admin
Your logic is invalid.
Disregarding whether or not it is true for this specific case that XHTML is a subset of HTML (I haven't bothered verifying who's right), you have not demonstrated it with the above.
Let's look at your statements, and assume they are facts:
1. XML is a subset of SGML
2. XHTML is an XML application
3. XHTML's tags is a subset of HTML 4's tags
4. HTML is an SGML dialect
From that you are trying to assert that if 1,2,3,4, then the following statement is true:
"XHTML is a subset of HTML"
The problem with that, is that given the set A, if you take two subsets B and C, you do not know if B is a subset of C, C is a subset of B or if they even intersect.
In this case, (3) above means we know there is some overlap between XHTML and HTML, and the syntax is obviously similar. But none of your statements support the claim you made, because none of them exclude the possibility of XML making use of a subset of SGML that is not supported by HTML (that is the sets we get from taking the XML subset of SGML features and the HTML subset of SGML features could very well only partially intersect)
To logically arrive at your conclusion, you need to also either assert tfor instance that XML does not support any SGML features not supported by HTML, that HTML supports all of SGML, or that XHTML specifically disallows the use of any such XML features. (I'm giving examples, not asserting any of them)
Yes, I am being pedantic, but you did try to answer a request for explicit documentation of the claim that XHTML is a subset of HTML, and you haven't provided it.
V
Admin
...I like pie.
Admin
http://www.w3.org/TR/REC-html40/struct/global.html#edef-META
Notice in HTML the end tag is forbidden (there are a few of HTML tags with a forbidden end tag). In XML and therefore XHTML, all end tags are required. Therefore, XHTML is not a subset of HTML (unless you are going to stop using meta tags and the like).
Or should I say, invert_bool(XHTML is HTML).
Admin
Haven't tried using HTML so I really don't know.
I'll take your word for it and just not use HTML.
I can use the bold, italic and other stuff from the toolbar and that has worked for me before.
Admin
StringBuffer is a dynamic storage class. WTF are people complaining about other people's code when they themselves don't know what they are talking about.
Admin
I don't see how your method is any better that the previous poster's proposal. Your way still requires the an 'if' check for every country to see if it's the selected one. In fact, your method would be slower since it first requires sorting the unselected countries before you insert them into the list. There's no reason to sort out the unselected ones if you are always going to be inserting them in the same order, you just waste time.
Admin
What is really funny on this site is posters sometimes are not too far from wtf code authors. And how often do you think I'll have to perform sort? I'm too lazy to post code for item 1, but believe me there would be no if's there at all. There can even be no loops there.
Admin
Maybe AP could just boilerplate all the above into an automatic first post.
Admin
Then you can just output something like this:
Admin
Admin
It may be the cool thing to bash Americans these days, but it's still gauche to generalize. For example, this American remembered that over eight months ago this point was already mentioned. Also, the description says "the business would switch to ISO-3166 country codes" (emphasis added). Seeing as how this section was pre-switch, they were likely using FIPS, or possibly NATO, which would be correct for these two countries. Reference the page linked in that previous post: http://en.wikipedia.org/wiki/Country_codes:_A#Australia
So we have several poor assumptions here. 1. that Austria's ISO 3166-1 Alpha-2 code is "AS" (it's "AT"), 2. that this list was ISO 3166-1 Alpha-2 codes anyway, and 3. that Americans wouldn't know the difference between Salzburg and Sydney.
Admin
That's not the case at all, the infinite loop incident was merely part of the introduction to the wtf, it wasn't the WTF itself. Pay better attention before posting..
Admin
Howdy! Would you mind if I share your blog with my twitter group? Theres lots of people that I believe would really enjoy your content. Please let me know. Thanks fcdgebkkkbdecaec