standards

Why is javascript the only client side scripting language implemented in browsers? [closed]

こ雲淡風輕ζ 提交于 2019-11-27 11:02:54
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Why don't browsers add support for, say, Python scripting as an alternative to Javascript? Or more general purpose scripting languages? Is there a reason that Javascript is the only one implemented across browsers? After all, the script tag does have support to specify the scripting language used. (I know there

Set element width or height in Standards Mode

丶灬走出姿态 提交于 2019-11-27 10:37:55
问题 Is it possible to set width or height of HTML element (ex. <div> ) in JavaScript in Standards Mode? Note the following code: <html> <script language="javascript" type="text/javascript"> function changeWidth(){ var e1 = document.getElementById("e1"); e1.style.width = 400; } </script> <body> <input type="button" value="change width" onclick="changeWidth()"/> <div id="e1" style="width:20px;height:20px; background-color:#096"></div> </body> </html> When user presses the change width button, the

Existing Standard Style and Coding standard documents [closed]

情到浓时终转凉″ 提交于 2019-11-27 10:36:24
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . The following have been proposed for an upcoming C++ project. C++ Coding Standards, by Sutter and Alexandrescu JSF Air Vehicle C++ coding standards The Elements of C++ Style Effective C++ 3rd Edition, by Scott Meyers Are there other choices? Or is the list above what be

Is std::stoi actually safe to use?

纵然是瞬间 提交于 2019-11-27 10:14:21
问题 I had a lovely conversation with someone about the downfalls of std::stoi . To put it bluntly, it uses std::strtol internally, and throws if that reports an error. According to them, though, std::strtol shouldn't report an error for an input of "abcxyz" , causing stoi not to throw std::invalid_argument . First of all, here are two programs tested on GCC about the behaviours of these cases: strtol stoi Both of them show success on "123" and failure on "abc" . I looked in the standard to pull

What is the best practice when using UIStoryboards?

三世轮回 提交于 2019-11-27 10:10:18
问题 Having used storyboards for a while now I have found them extremely useful however, they do have some limitations or at least unnatural ways of doing things. While it seems like a single storyboard should be used for your app, when you get to even a moderately sized application this presents several problems. Working within teams is made more difficult as conflicts in Storyboards can be problematic to resolve (any tips with this would also be welcome) The storyboard itself can become quite

Is the definition of “volatile” this volatile, or is GCC having some standard compliancy problems?

大兔子大兔子 提交于 2019-11-27 10:04:25
问题 I need a function that (like SecureZeroMemory from the WinAPI) always zeros memory and doesn't get optimized away, even if the compiler thinks the memory is never going to accessed again after that. Seems like a perfect candidate for volatile. But I'm having some problems actually getting this to work with GCC. Here is an example function: void volatileZeroMemory(volatile void* ptr, unsigned long long size) { volatile unsigned char* bytePtr = (volatile unsigned char*)ptr; while (size--) {

Is there a standard C++ grammar?

左心房为你撑大大i 提交于 2019-11-27 10:00:39
问题 Does the standard specify the official C++ grammar? I searched, but did not find it anywhere. Also, I wish to read a bit about C++ grammar in detail, like which category of grammars it falls in, etc. Any links pointing me in the right direction would be helpful. By category, I mean taken from here. 回答1: Yes, it does. The grammar is described in detail throughout the standard and is summarized in Appendix A: Grammar Summary (it's Appendix A in both the C++03 standard and the C++0x final

void, VOID, C and C++

為{幸葍}努か 提交于 2019-11-27 09:26:54
I have the following code: typedef void VOID; int f(void); int g(VOID); which compiles just fine in C (using gcc 4.3.2 on Fedora 10). The same code compiled as C++ gives me the following error: void.c:3: error: ‘<anonymous>’ has incomplete type void.c:3: error: invalid use of ‘VOID’ Now, this is something in external library and I would like the owner to fix that problem. So I have a question - does C++ standard forbids this construct? Could you give me a pointer/citation? The only thing I can recall is that function declaration with (void) to signal empty parameter list is deprecated in C++,

Is the result of a cast an rvalue?

不羁岁月 提交于 2019-11-27 09:04:09
Let int a = 0; Then is (int)a an rvalue in standard C++? Different compilers show different results for this code: #include <iostream> using namespace std; void f(int& x) { cout << "l value" << endl; } void f(int&& x) { cout << "r value" << endl; } int main() { int a = 0; f((int)a); } compilers with different results: 1) http://cpp.sh/2r6 2) http://webcompiler.cloudapp.net/ Shafik Yaghmour The should be an rvalue but webcompiler is running Visual Studio and Visual Studio has an extension which allows temporary objects to be bound to non-const lvalue references . a bug/extension that casues it

Why do the CSS width and height properties not adjust for padding?

依然范特西╮ 提交于 2019-11-27 08:43:39
So first a bit of meat to set the scene: HTML <div id="container"> <div id="inner">test</div> </div> CSS #container { width:300px; height:150px; background-color:#d7ebff; } #inner { width:100%; height:100%; padding:5px; background-color:#4c0015; opacity:.3; } This will produce something that looks like this in all modern browsers: Now I know this is the standards-compliant behavior (as I knew before, but reconfirmed in this post , and I also know that if I include this code in the inner CSS declaration: box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box ...it will