standards

@ sign as url parameter separator?

北城以北 提交于 2019-12-02 07:16:02
问题 While browsing the new Google Maps I saw that they are using an @ sign instead of ? to seperate the url-path from the query parameters, like: https://www.google.com/maps/@38.1158476,-96.2044115,6z The coordinates after the @ change as you are navigating around the map, but without a browser refresh. Bookmarking works fine with this. Wikipedia does not mention anything about this, RFC3986 only shows the @ sign as a possibility for username/password authentication. Is this a standardised

C++11 Allocation Requirement on Strings

岁酱吖の 提交于 2019-12-02 05:54:09
问题 I had heard that C++11 was going to require string s to be allocated in contiguous memory. I even thought I saw a stack overflow question on it, but I can't seem to find it. I know that in practice both gcc and Visual Studio do allocate string s contiguously, I'm just asking as to the standard's requirements. 回答1: Section 21.4.1.5 of the 2011 standard states: The char-like objects in a basic_string object shall be stored contiguously. That is, for any basic_string object s , the identity &*(s

Are “Statement and Declarations in Expressions” specific to GNU C?

老子叫甜甜 提交于 2019-12-02 05:25:14
Are Statement and Declarations in Expressions specific to GNU C ? Or this feature is also included in C99 standard ? It's a GCC extension. (See the GCC docs, e.g. here for gcc 4.3.3 , for a full list of GCC extensions; and the C99 spec is available here .) GCC will warn about such things if you use the -pedantic -std=c99 flags, e.g.: $ cat foo.c int main(void) { return ({ int a = 0; a; }); } $ gcc -pedantic -std=c99 -c foo.c foo.c: In function 'main': foo.c:3: warning: ISO C forbids braced-groups within expressions While this is not a C99 standard, this extension is not specific to gcc either.

COALESCE or CASE more efficient and/or standard

耗尽温柔 提交于 2019-12-02 02:44:03
In terms of x compared to y. Does x comply with sql standards better? [apologies if subjective] Is x more efficient than y? Or are these scripts completely different and to be used in different contexts? x SELECT * FROM a INNER JOIN b ON COALESCE(b.columntojoin, b.alternatecolumn) = a.columntojoin y SELECT * FROM a INNER JOIN b ON (case when b.columntojoin is null then b.alternatecolumn else b.columntojoin end) = a.columntojoin COALESCE is essentially a shorthanded CASE statement. Both are exactly the same. There is also ISNULL in SQL Server (differs in other DBMSs), but that's actually a non

C++11 Allocation Requirement on Strings

孤人 提交于 2019-12-02 02:30:15
I had heard that C++11 was going to require string s to be allocated in contiguous memory. I even thought I saw a stack overflow question on it, but I can't seem to find it. I know that in practice both gcc and Visual Studio do allocate string s contiguously, I'm just asking as to the standard's requirements. Section 21.4.1.5 of the 2011 standard states: The char-like objects in a basic_string object shall be stored contiguously. That is, for any basic_string object s , the identity &*(s.begin() + n) == &*s.begin() + n shall hold for all values of n such that 0 <= n < s.size() . The two parts

Should we bother about IE < 8?

回眸只為那壹抹淺笑 提交于 2019-12-01 23:53:26
It might look like philosophical question, however it really bother me. We're expecting HTML 5, we're using JS, Ajax, Flex, all this stuff, but when older browsers were devleoped, nooone even dreamed about such technologies. IE6 can't see transparency in PNG's. Some correct W3C techniques, are bad interpreted by IE6. It's just too old for our "new" world. IE7 is sight better better than IE6, but it still has some weird errors. How many people use IE6 now? And if someone upgraded to IE7, doesn't he already upgraded to IE8? Should we bother about those browsers? (sorry for bad eng, but noone in

Is there a standard procedure for passing class objects by value?

雨燕双飞 提交于 2019-12-01 23:48:51
问题 Is there a standard procedure for passing classes by value? In other words, if I do this: struct Test { int a; double b; } void DoSomething(Test t) { std::cout << t.a << std::endl; std::cout << t.b << std::endl; } //... Test myObj; myObj.a = 5; myObj.b = 10.5; DoSomething(myObj); Assuming standard packing and layout, does the standard provide any guarantees that the class will be sent and received in a consistent manner regardless of compiler? Because I anticipate questions along the lines of

Does using leading underscores actually cause trouble?

你离开我真会死。 提交于 2019-12-01 22:37:33
The C/C++ standard reserves all identifiers that either lead with an underscore (plus an uppercase letter if not in the global namespace) or contain two or more adjacent underscores . Example: int _myGlobal; namespace _mine { void Im__outta__control() {} int _LivingDangerously; } But what if I just don't care? What if I decide to live dangerously and use these "reserved" identifiers anyway? Just how dangerously would I be living? Have you ever actually seen a compiler or linker problem resulting from the use of reserved identifiers by user code? The answers below, so far, amount to, "Why break

C++ primary expressions - Is it primary expression or not?

独自空忆成欢 提交于 2019-12-01 22:23:45
Why are they called "primary"? In the order of evaluence they are the first? C++03 standard defines the expression in chapter 5 (Note 1): An expression is a sequence of operators and operands that specifies a computation. Then the 5.1 "Primary expressions" defines the list of primary expressions: (1) primary-expression: literal this ( expression ) id-expression My main question is in connection the third point: ( expression ) So, according to the standard, every expression with brackets are primary expressions and they are calculated firstly. It looks logical, and gives an exact explanation of

Is this the correct way of putting HTML in PHP?

社会主义新天地 提交于 2019-12-01 21:23:52
I'm new to PHP, and most of the time I have been 'echo'ing my HTML. Today, I found this way of doing it, which makes things 1000 times easier: <?php if(get_field('field_name')){ ?> <p>HTML can go here without echo'ing it</p> <?php } ?> But is it an accepted way? It seems to work every time. Thanks. Sampo Sarrala It's mostly about how you like to read your code. With IDE that has autocomplete/code suggestions it is best to use <?php if (...) { ?> so that autocompletion/suggestion features know when to use html and when php suggestions for your code. And of course it's nice to select coding