standards

Do I need to wrap email messages longer than 72 characters in a line?

萝らか妹 提交于 2019-12-08 17:07:59
问题 Occasionally I've seen code wrapping email messages to make sure a single line is no more than 72 characters long. Is there really need for this and what is this all about? 回答1: To expand on Joe's response, the 72-char limit basically allows for bodies to then be quoted, so it gives room for the additional chars added to a line, e.g., From "scratch": > From Joe Bloggs, 24 Sept 1985 > > > Probably some flame about emacs vs vi, eulogising one over the other. > > The quote chars have added four

Should I completely stop using inline JavaScript?

笑着哭i 提交于 2019-12-08 17:05:33
问题 In a discussion elsewhere on SO, I was informed that "[m]ost browsers will not execute inline javascript... these days." This is news to me, and I have been researching to try to verify this statement, in order to understand if I need to adjust the code on some of the websites I maintain in order to make them compatible with future browsers. As far as I can tell, the commenter is referring to Content Security Policy, a relatively new proposal that would, if implemented, restrict or totally

How to represent regex number ranges (e.g. 1 to 12)?

拟墨画扇 提交于 2019-12-08 15:42:14
问题 I'm currently using ([1-9]|1[0-2]) to represent inputs from 1 to 12. (Leading zeros not allowed.) However it seems rather hacky , and on some days it looks outright dirty . ☞ Is there a proper in-built way to do it? ☞ What are some other ways to represent number ranges? 回答1: I tend to go with forms like [2-9]|1[0-2]? which avoids backtracking, though it makes little difference here. I've been conditioned by XML Schema to avoid such "ambiguities", even though regex can handle them fine. 回答2:

Are there any use cases relying on integer representation of two allocations being different in C?

荒凉一梦 提交于 2019-12-08 15:19:12
问题 For example, consider the following C code snippet: void *p = malloc(1); void *q = malloc(1); bool question = (uintptr_t) p == (uintptr_t) q; I expect everyone expects question be always false. (Surprisingly, the C11 standard does not require it, though. The only restriction on uintptr_t is e.g. ((void *) ((uintptr_t) p)) == p . See 7.20.1.4 of the C11 standard for details.) My question is: is there any realistic use case that actually relies on the guarantee that question be false, or more

typemap rule is confusing

不打扰是莪最后的温柔 提交于 2019-12-08 12:22:59
问题 According to MPI 2.2 standard Section 4.1: to create a new data type we have to define a typemap which is a sequence of (type, displacement) pairs. The displacements are not required to be positive, increasing, nor distinct. Suppose I define a typemap of the following sequence: {(double, 0), (char,0)} this does not make sense, yet possible, how can a standard provide so much flexibility? 回答1: If that's the only thing you find confusing about typemaps, you're smarter than I am. But as to this

Event Bindings The AngularJS Way?

瘦欲@ 提交于 2019-12-08 07:28:57
问题 Ok, so I know that it is considered bad practice to do any DOM manipulation in a controller when working with AngularJS, you should be using directives and $scope for that stuff, but what about event binding? From the looks of it, that is also frowned upon considering all the built-in event directives like ngClick, ngMousedown, ngMouseenter, etc... but if that is the case then I have a piece of code that I don't know how to do the AngularJS way. The application I am building has infinite

How can I find out which JavaScript engines/platforms support which features of ES6 Unicode regular expressions?

空扰寡人 提交于 2019-12-07 16:43:07
问题 I often work with many human languages and writing systems and I try to use the most modern features of JavaScript that I can. I often find I would like to use modern Unicode regular expression such as Unicode Property Escapes: /\p{L}/ It seems that though many JS platforms are including more and more ES6 features, these Unicode regex features are lagging behind. How can I found out which engines/platforms support which of these features? By "platform" I include things like transpilers. I'm

Is there any current proposal I can follow about adding proper locale support to JavaScript?

故事扮演 提交于 2019-12-07 16:38:40
问题 Even though all major operating systems and programming languages/APIs have had locale support for at least a couple of decades, it seems that JavaScript still does not! With JavaScript becoming more and more of a full application programming language both in the browser and on the server, the lack of real locale support is becoming a real problem. Are there any proposals to add locale support as it exists in other languages to the EcmaScript standard? As part of the "harmony" project or

Appropropriate URN namespace now that X- is deprecated?

僤鯓⒐⒋嵵緔 提交于 2019-12-07 15:56:58
问题 As recently as 2002 the IETF was recommending in RFC 3406 that we should use x- prefixes for URN namespaces we didn't want to register, e.g. urn:x-acme:foobar . Now that the IETF has deprecated the x- prefix in RFC 6648, how are we supposed to construct URNs for namespaces we don't intend to register? As an aside, I note that RFC 6648 specifically mentions URNs: "In almost all application protocols that make use of protocol parameters (including ... URNs ...), the name space is not limited or

C string append

感情迁移 提交于 2019-12-07 14:47:36
问题 I've got two C strings that I want to append and result should be assigned to an lhs variable. I saw a static initialization code like: char* out = "May God" "Bless You"; . The output was really "May GodBless You" on printing out. I understand this result can be output of some undefined behaviour. The code was actually in production and never gave wrong results. And it was not like we had such statements only at one place. It could be seen at multiple places of very much stable code and were