standards

Giving the script tag an ID

旧时模样 提交于 2019-11-27 19:34:44
I came across a scenario where giving a script element an id attribute would solve a problem easily. However, after reading about the script element at w3schools and quirksmode , it seems doing so could have some unforeseen consequences. Has anyone come across any of these issues with browsers such as Chrome, Safari, FF3 up and IE 7 up? It's fine in all current browsers. The only browser that got <script id> wrong was Netscape 4, which we stopped caring about a long, long time ago. That quirksmode page seems to be badly out of date, what with its use of language attributes, script <!-- hiding,

Can a CSV file have a comment?

谁说胖子不能爱 提交于 2019-11-27 18:54:17
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 straight away with no need for a consumer to have to customize the import process. So, thoughts? The CSV

C++11 Compiler: Closest to the standard and how close?

百般思念 提交于 2019-11-27 18:06:39
I'm interested in learning C++ more thoroughly now that C++11 is apparently ratified. What compiler currently implements the closest thing available to full C++11 support? How close is said compiler to full support? Are there still major features missing or just language lawyer minutiae? There's a support matrix on the Apache wiki. I think the one Scott Meyers maintains on his homepage is pretty good: http://www.aristeia.com/C++0x/C++0xFeatureAvailability.htm The llvm C++ compiler "clang" has partial C++11 support; you can see its current state at http://clang.llvm.org/cxx_status.html . There

Possible ambiguity with extern “C”, overloading, and function pointers

耗尽温柔 提交于 2019-11-27 17:59:54
问题 With normal functions, one can write extern "C" int Frotz(int); // in a header int Frotz(int x) { return x; } With function pointers, however, this appears to have been implemented inconsistently between compilers. extern "C" int Klutz(int (*)(int), int); int Klutz(int (*fptr)(int), int x) { return (*fptr)(x); } In the declaration, the argument is also extern "C" . In the definition, most compilers appear to match these functions and make Klutz an extern "C" function. The Sun and Cray

SQL formatting standards

拟墨画扇 提交于 2019-11-27 17:41:23
In my last job, we worked on a very database-heavy application, and I developed some formatting standards so that we would all write SQL with a common layout. We also developed coding standards, but these are more platform-specific so I'll not go into them here. I'm interested to know what other people use for SQL formatting standards. Unlike most other coding environments, I haven't found much of a consensus online for them. To cover the main query types: select ST.ColumnName1, JT.ColumnName2, SJT.ColumnName3 from SourceTable ST inner join JoinTable JT on JT.SourceTableID = ST.SourceTableID

window.innerWidth vs document.documentElement.clientWidth

☆樱花仙子☆ 提交于 2019-11-27 17:37:05
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.documentElement.clientWidth; var client_h = document.documentElement.clientHeight; var debug_msg =

Clean way to launch the web browser from shell script?

∥☆過路亽.° 提交于 2019-11-27 17:11:50
In a bash script, I need to launch the user web browser. There seems to be many ways of doing this: $BROWSER xdg-open gnome-open on GNOME www-browser x-www-browser ... Is there a more-standard-than-the-others way to do this that would work on most platforms, or should I just go with something like this: #/usr/bin/env bash if [ -n $BROWSER ]; then $BROWSER 'http://wwww.google.com' elif which xdg-open > /dev/null; then xdg-open 'http://wwww.google.com' elif which gnome-open > /dev/null; then gnome-open 'http://wwww.google.com' # elif bla bla bla... else echo "Could not detect the web browser to

Recommended website resolution (width and height)? [closed]

谁说胖子不能爱 提交于 2019-11-27 16:34:59
Is there any standard on common website resolution? We are targeting newer monitors, perhaps at least 1280px wide, but the height may varies, and each browser may have different toolbar heights too. Is there any sort of standard to this? Karl Fast The advice these days is: Optimize for 1024x768 . For most sites this will cover most visitors. Most logs show that 92-99% of your visits will be over 1024 wide. While 1280 is increasingly common, there are still lots at 1024 and some below that. Optimize for this but don't ignore the others. 1024 = ~960 . Accounting for scrollbars, window edges, etc

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

穿精又带淫゛_ 提交于 2019-11-27 16:06:14
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 the same value representation, but I can't see anything in the standard that therefore allows me to

Must a deleted constructor be private?

别等时光非礼了梦想. 提交于 2019-11-27 15:51:27
问题 class A { public: A() = default; A(const A&) = delete; }; class A { public: A() = default; private: A(const A&) = delete; }; Are these two definitions always identical to each other in any cases? 回答1: They are different only wrt the produced diagnostics . If you make it private , an additional and superfluous access violation is reported: class A { public: A() = default; private: A(const A&) = delete; }; int main() { A a; A a2=a; } results in the following additional output from GCC 4.8: main