standards

JQuery class selectors like $(.someClass) are case sensitive?

霸气de小男生 提交于 2019-12-17 16:30:22
问题 Given this HTML: <div class="OpenIDSelector">some text</div> Why does this JQuery selector match it on some browsers and some pages, but not on others? $('.OpenIdSelector') NOTE: I ran into this problem and solved it myself, but it was annoying and I didn't find it on StackOverflow already, so I'm posting it as a Q&A pair so someone else won't waste an hour like I did. 回答1: Turns out JQuery's class selector uses the new javascript method getElementsByClassName if the browser supports it. This

What is singular and non-singular values in the context of STL iterators?

筅森魡賤 提交于 2019-12-17 16:28:41
问题 The section §24.1/5 from the C++ Standard (2003) reads, Just as a regular pointer to an array guarantees that there is a pointer value pointing past the last element of the array, so for any iterator type there is an iterator value that points past the last element of a corresponding container. These values are called past-the-end values. Values of an iterator i for which the expression *i is defined are called dereferenceable. The library never assumes that past-the-end values are

Difference between scanf() and strtol() / strtod() in parsing numbers

∥☆過路亽.° 提交于 2019-12-17 16:18:30
问题 Note: I completely reworked the question to more properly reflect what I am setting the bounty for. Please excuse any inconsistencies with already-given answers this might have created. I did not want to create a new question, as previous answers to this one might be helpful. I am working on implementing a C standard library, and am confused about one specific corner of the standard. The standard defines the number formats accepted by the scanf function family (%d, %i, %u, %o, %x) in terms of

Can a CSV file have a comment?

岁酱吖の 提交于 2019-12-17 15:35:15
问题 Is there any official way to allow a CSV formatted file to allow comments, either on its own line OR at the end of a line? I tried checking wikipedia on this and also RFC 4180 but both do not mention anything which leads me to believe that it's not part of the file format so it's bad luck to me and I should then use a seperate ReadMe.txt file thingy to explain the file. Lastly, i know it's easy for me to add my own comments in, but i was hoping that something like Excel could just import it

window.innerWidth vs document.documentElement.clientWidth

旧城冷巷雨未停 提交于 2019-12-17 15:16:40
问题 Regarding window.innerWidth and document.documentElement.clientWidth , Webkit (Chrome / Safari) claims innerWidth is smaller than clientWidth . Trident and Presto claim innerWidth is bigger than clientWidth . Gecko claims innerWidth is the same size as clientWidth . What is the correct behavior stated by W3C (or silimar "authority")? Test Script (on JSFiddle) (on GoogleHost): setInterval(function() { var inner_w = window.innerWidth; var inner_h = window.innerHeight; var client_w = document

Can I legally reinterpret_cast between layout-compatible standard-layout types?

孤街浪徒 提交于 2019-12-17 14:44:09
问题 I'm writing a class that, assuming the answer to Are enumeration types layout compatible with their underlying type? is "yes", is layout-compatible struct kevent but uses enum class es for filter , flags , etc. with the proper underlying types for the relevant fields. It is also standard-layout (the fields are all private and all themselves standard layout, there are no virtual members, there are no base classes). From my reading of n3690 , I can determine that my class and struct kevent have

Is using an union in place of a cast well defined?

余生长醉 提交于 2019-12-17 12:47:35
问题 I had a discussion this morning with a colleague regarding the correctness of a "coding trick" to detect endianness. The trick was: bool is_big_endian() { union { int i; char c[sizeof(int)]; } foo; foo.i = 1; return (foo.c[0] == 1); } To me, it seems that this usage of an union is incorrect because setting one member of the union and reading another is not well-defined. But I have to admit that this is just a feeling and I lack actual proofs to strengthen my point. Is this trick correct ? Who

Which section in C89 standard allows the “implicit int” rule?

耗尽温柔 提交于 2019-12-17 12:18:08
问题 While using gcc , the code: register a = 3; static b = 3; it is allowed while using the -std=c89 -pedantic-errors flags, although there is a warning. However it receive an error with the -std=c99 -pedantic-errors flags. I wonder which section of the C89 standards allows the "implicit int" rule? 回答1: The section that allowed the implicit int rule in C89 would be section 3.5.2 Type specifiers which says ( emphasis mine ): int , signed , signed int , or no type specifiers Keith Thompson in the

ISO C++ standard draft

淺唱寂寞╮ 提交于 2019-12-17 11:02:52
问题 In the ISO standard C++ : the latest working draft is n3291 ,it is not publicly available. But n3290 is Available. up-to February the draft is n3242 . May i know now .. which draft is more correct to become an final draft? Because there are many differences in n3242 compared with n3290 ? in this link also they gave ..: current working draft as n3242 ? (why not n3290 ) http://www.open-std.org/jtc1/sc22/wg21/ http://en.wikipedia.org/wiki/C%2B%2B0x please tell me which draft is correct one to

ISO C++ standard draft

只愿长相守 提交于 2019-12-17 11:02:42
问题 In the ISO standard C++ : the latest working draft is n3291 ,it is not publicly available. But n3290 is Available. up-to February the draft is n3242 . May i know now .. which draft is more correct to become an final draft? Because there are many differences in n3242 compared with n3290 ? in this link also they gave ..: current working draft as n3242 ? (why not n3290 ) http://www.open-std.org/jtc1/sc22/wg21/ http://en.wikipedia.org/wiki/C%2B%2B0x please tell me which draft is correct one to