standards

What is the rationale for the way C++ handles uniform initialization with initialization lists?

為{幸葍}努か 提交于 2020-02-24 14:04:44
问题 C++'s uniform initialization syntax fixes the most vexing parse. Yay. But then it introduces confusion when dealing with initialization lists. Boo. The existing behavior is that: std::vector<int> the_vec{4}; will invoke std::vector(std::initializer_list<T> init) instead of std::vector(size_type count); . What is the rationale for this decision? Especially since the language committee was inventing new syntax, it seems to me the other possible designs could have been: Require initialization

Looking for official docs for all Javascript (BOM, DOM, built-in) Objects

瘦欲@ 提交于 2020-02-23 08:48:32
问题 when I make Web Application. As far as I know, There are three objects(BOM, DOM, built-in Objects) to javascript. If I want to manipulate DOM object. I refer DOM official documentation in w3c.org following this. https://www.w3.org/DOM/DOMTR If I want to know built-in objects. I can refer ECMA-262 documentation. It's very hard to read but it's official documentation. https://www.ecma-international.org/publications/standards/Ecma-262.htm If I want to control browser. I am googleing about BOM. I

How to compute standard error for predicted data in R using predict

烈酒焚心 提交于 2020-02-23 05:43:28
问题 Here is my data: a <- c(60, 65, 70, 75, 80, 85, 90, 95, 100, 105) b <- c(26, 24.7, 20, 16.1, 12.6, 10.6, 9.2, 7.6, 6.9, 6.9) a_b <- cbind(a,b) plot(a,b, col = "purple") abline(lm(b ~ a),col="red") reg <- lm(b ~ a) I would like to use the predict function in order to compute the standard error for the predicted b value at 110. z <- predict(reg, newdata=data.frame(year=110), se.fit=TRUE) This is the output I get, but I think this is just giving me the standard errors for my 10 time points, but

Is there a Java coding standards? If so, is there a tool that will check for those standards?

耗尽温柔 提交于 2020-02-05 14:42:45
问题 Are there Java coding standards? If so, is there a tool that implements and checks for those standards? I'm not familiar but hoping that someone has used Sonar, Checkstyle, PMD, Findbugs, Clover, and/or Cobertura that could tell me if any of those tools or other tools can do that. 回答1: Yes . All of those tools can enforce coding styles (and more). 回答2: Sun's (now Oracle's) coding conventions documentation is here: http://www.oracle.com/technetwork/java/codeconv-138413.html I've used

const reference for temporary lifetime lengthening

断了今生、忘了曾经 提交于 2020-02-03 10:05:52
问题 I have a question about some C++ standard compliance or lack of it. In my project I'm using some simple Guard class that uses the const reference trick. I'm using Visual Studio 2005 and there are two configurations - one for normal release build and the second one for unit tests. In both cases there is some temporary hanging on the const reference in the end, but what happens in the meantime is the problem. For release configuration, the const reference points directly to the temp created in

Is RVO (Return Value Optimization) on unnamed objects a universally guaranteed behavior?

﹥>﹥吖頭↗ 提交于 2020-01-29 13:33:36
问题 This question is in different aspect (also limited to gcc). My question is meant only for unnamed objects . Return Value Optimization is allowed to change the observable behavior of the resulting program. This seems to be mentioned in standard also. However, this "allowed to" term is confusing. Does it mean that RVO is guaranteed to happen on every compiler. Due to RVO below code changes it's observable behavior: #include<iostream> int global = 0; struct A { A(int *p) {} A(const A &obj) { ++

Is RVO (Return Value Optimization) on unnamed objects a universally guaranteed behavior?

梦想与她 提交于 2020-01-29 13:32:55
问题 This question is in different aspect (also limited to gcc). My question is meant only for unnamed objects . Return Value Optimization is allowed to change the observable behavior of the resulting program. This seems to be mentioned in standard also. However, this "allowed to" term is confusing. Does it mean that RVO is guaranteed to happen on every compiler. Due to RVO below code changes it's observable behavior: #include<iostream> int global = 0; struct A { A(int *p) {} A(const A &obj) { ++

W3C document states

孤人 提交于 2020-01-23 03:16:13
问题 Within the standards that W3C create, do they have a set of states they go through before they are a standard and what are those states ? For example HTML 5.1 currently is in Working Draft. 回答1: The process is typically linked in the section "Status of This Document". For HTML 5.1, it says: This document is governed by the 1 August 2014 W3C Process Document. This links to the World Wide Web Consortium Process Document from 2014-08-01 (the latest version is always accessible from http://www.w3

Why are HTML character entities necessary?

扶醉桌前 提交于 2020-01-21 06:38:06
问题 Why are HTML character entities necessary? What good are they? I don't see the point. 回答1: Two main things. They let you use characters that are not defined in a current charset. E.g., you can legally use ASCII as the charset, and still include arbitrary Unicode characters thorugh entities. They let you quote characters that HTML gives special meaning to, as Simon noted. 回答2: " 1 < 2 " lets you put " 1 < 2 " in your page. Long answer: Since HTML uses ' < ' to open tags, you can't just type '

Is reading into uninitialized memory space ALWAYS ill advised?

隐身守侯 提交于 2020-01-17 14:03:13
问题 I am recreating the entire standard C library and I'm working on an implementation for strle n that I would like to be the basis of all my other str functions. My current implementation is as follows: int ft_strlen(char const *str) { int length; length = 0; while(str[length] != '\0' || str[length + 1] == '\0') length++; return length; } My question is that when I pass a str like: char str[6] = "hi!"; As expected, the memory reads: ['h']['i']['!']['\0']['\0']['\0']['\0'] If you look at my