standards

Why is the HTML SCRIPT tag not subject to the same origin policy

两盒软妹~` 提交于 2019-11-26 19:59:45
问题 I am asking this questions because we will develop an application that is supposed to share cross origin data via javascript. One possible solution seems JSONP as it uses SCRIPT tags pull data from other domains. However, I would like to avoid the situation that we implement our awesome code on the assumption that the SCRIPT tag is not subject to sop and at some point browsers prohibit this functionality. Can anybody shed some light on what is the reason for the SCRIPT tag to allow cross

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

对着背影说爱祢 提交于 2019-11-26 19:22:42
问题 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? 回答1: There's a support matrix on the Apache wiki. 回答2: I think the one Scott Meyers maintains on his homepage is pretty good: http://www.aristeia.com/C++0x/C++0xFeatureAvailability.htm 回答3: The llvm C++

Declare main prototype

假如想象 提交于 2019-11-26 19:11:14
Is there any reason why I never see main's prototype declared in C programs, ie: int main(int argc, char* argv[]); int main(int argc, char* argv[]) { return 0; } Always seemed inconsistent.. C language standard, draft n1256 : 5.1.2.2.1 Program startup 1 The function called at program startup is named main . The implementation declares no prototype for this function . It shall be defined with a return type of int and with no parameters: int main(void) { /* ... */ } or with two parameters (referred to here as argc and argv , though any names may be used, as they are local to the function in

SQL formatting standards

烂漫一生 提交于 2019-11-26 19:05:40
问题 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

Clean way to launch the web browser from shell script?

不想你离开。 提交于 2019-11-26 18:53:25
问题 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

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

梦想的初衷 提交于 2019-11-26 18:42:39
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Is there any standard on common website resolution? We are targeting newer monitors, perhaps at least 1280px wide, but the height may

Why is `i = ++i + 1` unspecified behavior?

﹥>﹥吖頭↗ 提交于 2019-11-26 18:31:49
Consider the following C++ Standard ISO/IEC 14882:2003(E) citation (section 5, paragraph 4): Except where noted, the order of evaluation of operands of individual operators and subexpressions of individual expressions, and the order in which side effects take place, is unspecified. 53) Between the previous and next sequence point a scalar object shall have its stored value modified at most once by the evaluation of an expression. Furthermore, the prior value shall be accessed only to determine the value to be stored. The requirements of this paragraph shall be met for each allowable ordering

double negation in C : is it guaranteed to return 0/1?

前提是你 提交于 2019-11-26 18:31:19
问题 Is !!(x) guaranteed by the standard to return 0/1? Note that I am not asking about c++, where a bool type is defined. 回答1: Yes, in C99, see §6.5.3.3/4: The result of the logical negation operator ! is 0 if the value of its operand compares unequal to 0, 1 if the value of its operand compares equal to 0. The result has type int . The expression !E is equivalent to (0==E). So !x and !!y can only yield 0 or 1, as int s. For other operators, in C99, see also Is the "true" result of >, <, !, &&, |

Denormalized Numbers - IEEE 754 Floating Point

醉酒当歌 提交于 2019-11-26 18:24:23
问题 So I'm trying to learn more about Denormalized numbers as defined in the IEEE 754 standard for Floating Point numbers. I've already read several articles thanks to Google search results, and I've gone through several StackOverFlow posts. However I still have some questions unanswered. First off, just to review my understanding of what a Denormalized float is: Numbers which have fewer bits of precision, and are smaller (in magnitude) than normalized numbers Essentially, a denormalized float

Why do compilers allow string literals not to be const?

十年热恋 提交于 2019-11-26 17:56:19
And where are literals in memory exactly? (see examples below) I cannot modify a literal, so it would supposedly be a const char*, although the compiler let me use a char* for it, I have no warnings even with most of the compiler flags. Whereas an implicit cast of a const char* type to a char* type gives me a warning, see below (tested on GCC, but it behaves similarly on VC++2010). Also, if I modify the value of a const char (with a trick below where GCC would better give me a warning for), it gives no error and I can even modify and display it on GCC (even though I guess it is still an