standards

Is XForms still a live standard?

ぐ巨炮叔叔 提交于 2019-12-05 01:35:37
The XForms standard page seemed to indicate that it was no longer live, and that html5 kinda sorta does the job now. Is this the case? I'm looking at storing heterogenous data nuggets as XML fragments - generating a editor page according to the datatype. ebruchez To add to Phil's answer: The XForms Working Group at W3C is active and currently working on XForms 2.0. See in particular the proposed 2.0 features on the wiki and the in-progress draft of the spec as of Feburary, 2012 . Also I don't think it's fair to say that HTML 5 "does the job". HTML 5 forms bring small and welcome improvements

Implicit conversion operator priority

随声附和 提交于 2019-12-05 01:07:43
In the following piece of code ( live on coliru ): #include <iostream> #include <string> int main() { struct S { operator bool () const { return false; } operator std::string () const { return "false"; } } s; std::cout << s << "\n"; // outputs 0 } How does the compiler choose to pick the implicit conversion to bool over std::string ? My hypothesis is that in this case, it might be purely the order of declaration of the different flavours of std::basic_ostream::operator<< , but is it all? Does the standard say something about picking a specific implicit conversion? Recall that std::string is

In C is there any guarantee with code prior to undefined behavior?

南楼画角 提交于 2019-12-05 01:05:49
In the following code is is guaranteed that "0\n" be printed? #include <stdio.h> int main(void) { int c = 0; printf("%d\n",c); printf("%d,%d\n",++c,++c); } More generally, if a program has undefined behavior does the entire program become undefined or only from the sequence point that begins the problematic code? Please note: I am not asking about what the compiler does with the second printf. I am asking if the first printf is guaranteed to occur. I know that undefined behavior is capable of blowing up your computer, crashing your program, or whatnot. Well even ignoring things like "Anything

& operator definition for arrays in C

大兔子大兔子 提交于 2019-12-05 01:03:14
问题 A recent question prompted a discussion centering on arrays and pointers. The question was in reference to scanf("%s", &name) vs scanf("%s", name) . For the following code, Microsoft actually resolves this for you in VS2010 (and maybe earlier versions?), #include <stdio.h> int main() { char name[30]; printf("Scan \"name\" - "); scanf("%s", name); printf("Print \"&name\" - %s\n", &name); printf("Print \"name\" - %s\n", name); printf("Pointer to &name - %p\n", &name); printf("Pointer to name -

Why does std::exception have extra constructors in VC++?

江枫思渺然 提交于 2019-12-04 23:49:38
Something I noticed just now. Definition of exception in the standard (18.6.1): class exception { public : exception() throw(); exception(const exception &) throw(); exception& operator=(const exception&) throw(); virtual ~exception() throw(); virtual const char* what() const throw(); }; Definition of exception in MSDN : class exception { public: exception(); exception(const char *const&); exception(const char *const&, int); exception(const exception&); exception& operator=(const exception&); virtual ~exception(); virtual const char *what() const; }; It would seem that Microsoft's version

H1 tags, SEO and semantics

谁都会走 提交于 2019-12-04 23:25:22
问题 I'm using the H1 tag in my document as the main title, as you do. The text in the H1 is the title of the company, which needs to be shown on every page. I'm using the H2 tag for the title of the main content on each page. So the H1 is the same on every page, and the H2 changes. Example http://dev.darrenhall.info/temp/stackoverflow/h1/h1.gif I know that a lot of sites use the H1 to do what I'm doing with the H2, am I losing out by not doing this? I know that semantically I can't make the H1

In proper HTML, must an <input> be in a <form>?

和自甴很熟 提交于 2019-12-04 23:09:27
I need a few input elements, but their values won't be submitted anywhere - they're just going to be manipulated by some client-side JavaScript. Do I have to place them in a <form> to have legit HTML, or can they just be free-standing? For additional information, in xhtml strict you have to place in one of these elements: "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset" No. You only need a form if you're submitting to a server. 来源: https://stackoverflow.com/questions/2862050/in-proper-html-must-an-input-be-in-a-form

Does the C++11 standard formally define acquire, release, and consume operations?

流过昼夜 提交于 2019-12-04 22:29:01
In the C++11 standard, section 1.10/5 mentions, but does not formally define the terms acquire operation , release operation , and consume operation . It then goes on in Section 29 to use these terms to describe the actions of certain memory orderings, atomic operations, and memory fences. For instance, 29.3/1 on "Order and Consistency" states: memory_order_release , memory_order_acq_rel , and memory_order_seq_cst : a store operation performs a release operation [emphasis added] on the affected memory location. This type of language is repeated throughout section 29, but it bothers me a bit

What is the intended effective ordering of `set -o` options in bash? Does `histexpand` trump `posix`?

久未见 提交于 2019-12-04 21:49:38
问题 I attempted to answer a question a couple hours ago which I believed revealed a somewhat obscure bug in bash POSIX mode. I was hastily and vehemently told this was not so. The contradicting answer, which explicitly says this is not a bug, was selected as the correct answer. So I've been combing over the bash documentation, and I'm still coming away with very much the same impression, so I thought I should ask. My (alleged) bug: set -o histexpand (which is typically implicit) set -o posix echo

Can I write to a const member of a non-const struct?

佐手、 提交于 2019-12-04 20:53:15
Is this code legal?: #include <stdio.h> typedef struct a_d{ int const x; } a_d; int a_d__ctor(a_d *X) { *(int*)&X->x = 42; //<-- legal or not? return 0; } int main() { a_d a; a_d__ctor(&a); printf("a.x=%d\n", a.x); } Modyfing an object declared with const qualifier invokes undefined behavior . According to the Standard (emphasis mine): C11 6.7.3/6 Type qualifiers If an attempt is made to modify an object defined with a const-qualified type through use of an lvalue with non-const-qualified type , the behavior is undefined. 来源: https://stackoverflow.com/questions/42056823/can-i-write-to-a-const