specifications

ECMAScript Specification: meaning of question mark in the spec

泪湿孤枕 提交于 2019-12-11 02:37:07
问题 I have see many occurrence of Let value be ? , Return ? sth in the specification.example Anyone know what is the meaning of the ?. 回答1: From Algorithm Conventions, Abstract operations referenced using the functional application style and the method application style that are prefixed by ? indicate that ReturnIfAbrupt should be applied to the resulting Completion Record. For example, ? operationName() is equivalent to ReturnIfAbrupt(operationName()). Similarly, ? someValue .operationName() is

Is it safe to include extra columns in the SELECT list of a SQLite GROUP BY query?

心已入冬 提交于 2019-12-11 02:15:07
问题 I have a simple SQLite table called "message": sequence INTEGER PRIMARY KEY type TEXT content TEXT I want to get the content of the last message of each type (as determined by its sequence). To my surprise, the following simple query works: SELECT MAX(sequence), type, content FROM message GROUP BY type Surprise, because I know that MSSQL or Postgres would refuse to include a column in the SELECT list that is not part of the GROUP BY clause or an aggregate function and I'd have to do a join,

Why does RFC 6797 forbid sending of the Strict-Transport-Security header over plain HTTP responses?

限于喜欢 提交于 2019-12-11 02:00:26
问题 When reading the spec for HSTS (Strict-Transport-Security), I see an injunction in section 7.2 against sending the header when accessed over http instead of https: An HSTS Host MUST NOT include the STS header field in HTTP responses conveyed over non-secure transport. Why is this? What are the risks if this is violated? 回答1: The danger is to the availability of the website itself. If the website is able to respond (either now or in the future) over HTTP but not over HTTPS, it will semi

Is the conversion from '(signed) -1' to 'unsigned long' standardized? [duplicate]

大兔子大兔子 提交于 2019-12-10 19:48:58
问题 This question already has answers here : What happens if I assign a negative value to an unsigned variable? (5 answers) Closed last year . In this answer, you can find this comment: Strictly speaking the bit representations of the two numbers before conversion being the same doesn't matter. Even with 1's complement or signed magnitude representations, the conversion of (signed) -1 to unsigned long will always result in ULONG_MAX . (The bit pattern will be the same after conversion of course).

C Prototype scope

老子叫甜甜 提交于 2019-12-10 18:38:54
问题 I learnt that the type specifier that declares the identifier in the list of parameter declarations in a function prototype (not part of a function definition), the identifier has function prototype scope, which terminates at the end of the function declarator. Please see the C program mentioned below. void fn (struct st {int a;} a, struct st b) ; struct st obj ; Compilers promptly issues an error as 'obj' size is unknown (or) struct st is not a 'type'. That's right! the declaration of the

CORS obsolete, what does that mean?

只谈情不闲聊 提交于 2019-12-10 10:13:09
问题 I just read on Wikipedia (based on W3 minutes) that CORS is now obsolete: https://en.wikipedia.org/wiki/Cross-origin_resource_sharing From the meeting minutes at https://www.w3.org/2017/08/16-webappsec-minutes.html#item03 Obsoleting CORS dveditz: I raised on the list obsoleting CORS. The spec is old and doesn't reflect what browsers actually do scribe ... ongoing work is in Fetch UNKNOWN_SPEAKER: so it's not useful to have CORS sitting around ... mark as Obsolete and point to replacement ...

MPEG-4 Part 2 had some awesome face- and body- motion concepts, but they disappeared in MPEG-4 Part 10 (H.264). Why?

被刻印的时光 ゝ 提交于 2019-12-10 02:34:50
问题 During the last few weeks, I had the opportunity to read two documents: The MPEG-4 Part 2 specification (ISO/IEC 14496-2), which people just call "mpeg-4" The MPEG-4 Part 10 specification (ISO/IEC 14496-10), which is also called "h.264" or "AVC" After having read all the cool ideas in "mpeg-4" like identifying facial expression, motion of limbs of people, and sprites, I got really excited. The ideas sound very fun, maybe even fantastic, for an idea from 1999. But then I read the "h.264"

Why is there no “NULL reference” in C++?

最后都变了- 提交于 2019-12-09 17:07:11
问题 I was reading the C++ FAQ - "8.6 - When should I use references, and when should I use pointers?" and in particular this statement: Use references when you can, and pointers when you have to. ... The exception to the above is where a function's parameter or return value needs a "sentinel" reference — a reference that does not refer to an object. This is usually best done by returning/taking a pointer, and giving the NULL pointer this special significance (references must always alias objects,

Rspec: how to spec request.env in a helper spec?

时光总嘲笑我的痴心妄想 提交于 2019-12-09 07:53:48
问题 In my helper module, I have: def abc(url) ... if request.env['HTTP_USER_AGENT'] do something end end In my spec file, I have: describe "#abc" do before(:each) do @meth = :abc helper.request.env['HTTP_USER_AGENT'] = "..." end it "should return the webstart jnlp file" do @obj.send(@meth, "some_url").should .... end end When I run the spec I have this error: undefined local variable or method `request' for <ObjectWithDocHelperMixedIn:0x00000103b5a7d0> How do I stub for request.env['...'] in my

What exactly is a Specification?

大憨熊 提交于 2019-12-09 04:20:23
问题 I read or hear sentences such as: The Java Persistence API (JPA) is a Java application programming interface specification... or JavaServer Faces (JSF) is a Java specification... but I am not sure if I understand what a specification exactly is.. Lets say I create a new specification JMA, Java Math API, which is a Java Math Specification.. Is it enough that I define my specification as follows: JMA must provide a method that adds two integers? or, do I have to create a document something like