standards-compliance

.NET doesn't support non-standard XMLDSIG signature element names

走远了吗. 提交于 2019-12-10 12:13:53
问题 I'm trying to implement an industry spec that requires enveloped XML digital signatures (XMLDSIG). Instead of conforming to the examples ( <Signature> ) my spec uses its own name for the signature element: <xs:element name="ensembleSignature" type="dsig:SignatureType" /> <!-- wish this was: <xs:element ref="dsig:Signature" /> --> So the element isn't named 'Signature' and is in the domain's XML namespace instead of the dsig XML namespace. With a lot of extra work I can create this custom

Is std::vector::push_back permitted to throw for any reason other than failed reallocation or construction?

痞子三分冷 提交于 2019-12-10 02:14:20
问题 Consider: std::vector<int> v; v.reserve(1); v.push_back(1); // is this statement guaranteed not to throw? I've chosen int because it has no constructors that could throw - obviously if some copy constructor of T throws, then that exception escapes vector<T>::push_back . This question applies as much to insert as push_back , but it was inspired by Is it safe to push_back 'dynamically allocated object' to vector?, which happens to ask about push_back . In the C++03 and C++0x standard/FCD, the

Gnu C++ macro __cplusplus standard conform?

依然范特西╮ 提交于 2019-12-09 07:34:51
问题 The Gnu C++ compiler seems to define __cplusplus to be 1 #include <iostream> int main() { std::cout << __cplusplus << std::endl; } This prints 1 with gcc in standard c++ mode, as well as in C++0x mode, with gcc 4.3.4, and gcc 4.7.0. The C++11 FDIS says in "16.8 Predefined macro names [cpp.predefined]" that The name __cplusplus is defined to the value 201103L when compiling a C++ translation unit. (Footnote: It is intended that future versions of this standard will replace the value of this

multipart/form-data, what is the default charset for fields?

自闭症网瘾萝莉.ら 提交于 2019-12-09 02:40:00
问题 what is the default encoding one should use to decode multipart/form-data if no charset is given? RFC2388 states: 4.5 Charset of text in form data Each part of a multipart/form-data is supposed to have a content- type. In the case where a field element is text, the charset parameter for the text indicates the character encoding used. For example, a form with a text field in which a user typed 'Joe owes <eu>100' where <eu> is the Euro symbol might have form data returned as: --AaB03x content

May pointer to members circumvent the access level of a member?

浪尽此生 提交于 2019-12-08 23:01:48
问题 Our infamous litb has an interesting article on how to circumvent the access check. It is fully demonstrated by this simple code: #include <iostream> template<typename Tag, typename Tag::type M> struct Rob { friend typename Tag::type get(Tag) { return M; } }; // use struct A { A(int a):a(a) { } private: int a; }; // tag used to access A::a struct A_f { typedef int A::*type; friend type get(A_f); }; template struct Rob<A_f, &A::a>; int main() { A a(42); std::cout << "proof: " << a.*get(A_f())

g++ vs intel/clang argument passing order?

♀尐吖头ヾ 提交于 2019-12-08 19:53:49
问题 Consider the following code (LWS): #include <iostream> #include <chrono> inline void test( const std::chrono::high_resolution_clock::time_point& first, const std::chrono::high_resolution_clock::time_point& second) { std::cout << first.time_since_epoch().count() << std::endl; std::cout << second.time_since_epoch().count() << std::endl; } int main(int argc, char* argv[]) { test(std::chrono::high_resolution_clock::now(), std::chrono::high_resolution_clock::now()); return 0; } You have to run it

Standards mode in IE7 with HTML5?

筅森魡賤 提交于 2019-12-08 17:37:58
问题 Is there a way to trigger standards mode in IE7 when using the HTML5 doctype? My document starts like this: <!DOCTYPE html> <html> <head> ... 回答1: F12 opens Developer Tools in IE 9. Alt+7, Alt+8, & Alt 9 will allow you to toggle between browser versions. There are also menus that allow you to change both document and standards modes. A couple things: If you are trying to view the DOM tree using the developer tools and switching between different versions in compatibility mode, you should know

Sharepoint 2007 and <!DOCTYPE html>

一个人想着一个人 提交于 2019-12-08 03:16:41
问题 Greetings... I'm trying to get my Sharepoint 2007 site to render in Standards mode when browsing in IE. Since "!DOCTYPE html" makes every browser that I might be worrying about do just that, I decided to use it. I've read here and there that Standards mode could cause unwanted behavior to some OOTB functionality and style (fly-outs, calendar items, etc...), but can't find a full list containing error reference and ways to correct it. So, I'm looking for any kind of info and guidance on the

compliant variable length struct in C++

别说谁变了你拦得住时间么 提交于 2019-12-07 02:56:42
问题 In standard C you can end a struct with an array of size 0 and then over allocate it to add a variable length dimension to the array: struct var { int a; int b[]; } struct var * x=malloc(sizeof(var+27*sizeof(int))); How can you do that in C++ in a standard (portable) way? It is okay to have a constraint of max posible size and obviously doesn't have to work on the stack I was thinking of: class var { ... private: int a; int b[MAX]; }; and then use allocators or overload new/delete to under

Is this method of pointer tagging in C standard-compliant?

只愿长相守 提交于 2019-12-06 19:41:23
问题 (Recap on pointer tagging: where the size of an object means that a limited number of bits in its pointer will always go unused and can be re-purposed for other uses, such as marking the object's type.) An excellent answer to my previous question on this subject confirmed that the naive method of converting pointers to integers and doing things to those integers cannot technically be relied upon to work (disregarding its popularity in practice). Upon thinking about it some more, I think I