standards

Does the C++ standard requires signed integers to have exactly one sign bit?

╄→гoц情女王★ 提交于 2019-12-06 15:46:23
Consider the fundamental signed integer types of C++, namely: signed char , short int , int , long int and long long int , what does the current C++ standard require about their underlying bit representation? Does the constraints on their bit representation specify that they should include: optional padding bits mandatory value bits a mandatory sign bit that is 0 for positive values, and 1 for negative value if it exists, the sign bit should be the most significant bit Is this true? If not, then what are the constaints? I am searching for quotes from the standard that proves or disproves this.

What are the key decisions to get right when designing a fully Unicode-aware language or library?

蹲街弑〆低调 提交于 2019-12-06 15:30:27
Looking at Tom Christiansen's talk 🔫 Unicode Support Shootout 👍 The Good, the Bad, & the (mostly) Ugly 👎 working with text seems to be so incredibly hard, that there is no programming language (except Perl 6) which gets it even remotely correct. What are the key design decisions to make to have a chance to implement Unicode support correctly on a clean table (i. e. no backward-compatibility requirements). What about default file encodings, which transfer format and normalization format to use internally and for strings? What about case-mapping and case-folding? What about locale- and RTL

unary minus for 0x80000000 (signed and unsigned)

China☆狼群 提交于 2019-12-06 13:40:20
The n3337.pdf draft, 5.3.1.8, states that: The operand of the unary - operator shall have arithmetic or unscoped enumeration type and the result is the negation of its operand. Integral promotion is performed on integral or enumeration operands. The negative of an unsigned quantity is computed by subtracting its value from 2ⁿ, where n is the number of bits in the promoted operand. The type of the result is the type of the promoted operand. For some cases it is enough. Suppose unsigned int is 32 bits wide, then (-(0x80000000u)) == 0x80000000u , isn't it? Still, I can not find anything about

Storage Commitment Service (push model): how i get the result back to my SCU?

心已入冬 提交于 2019-12-06 13:29:26
I planned to implement a Storage Commitment Service to verify if files previously sent to the storage were safely stored. My architecture is very simple and straightforward my SCU sends some secondary capture images to the storage and I want to be sure they are safely stored before delete them. I am going to adopt push model and I wonder what steps/features I need to implement to accomplish the service What I understood is I need to issue a N-ACTION request with SOP Class UID 1.2.840.10008.1.20.1 and add to the request a transaction identifier together with a list of Referenced SOP Class UID –

Can I write to a const member of a non-const struct?

為{幸葍}努か 提交于 2019-12-06 12:43:18
问题 Is this code legal?: #include <stdio.h> typedef struct a_d{ int const x; } a_d; int a_d__ctor(a_d *X) { *(int*)&X->x = 42; //<-- legal or not? return 0; } int main() { a_d a; a_d__ctor(&a); printf("a.x=%d\n", a.x); } 回答1: Modyfing an object declared with const qualifier invokes undefined behavior. According to the Standard (emphasis mine): C11 6.7.3/6 Type qualifiers If an attempt is made to modify an object defined with a const-qualified type through use of an lvalue with non-const-qualified

Chaining operation and order of evaluation on the same object

拈花ヽ惹草 提交于 2019-12-06 11:23:19
Consider a class MyClass with: a member function myClass& myFunction1(int) that modifies the object and returns *this a member function int myFunction2() const that does not modify the object Does the C++11/14 standard guarantee that: myclass.myFunction1(myclass.myFunction2()).myFunction1(myclass.myFunction2()); is equivalent to: myclass.myFunction1(myclass.myFunction2()); myclass.myFunction1(myclass.myFunction2()); No. The compiler can first call myclass.myFunction2() twice and then do the two myFunction1 calls in the first example code. But not in the second example code. There is nothing

Displaying a message to Internet explorer 8 and Below Users

我是研究僧i 提交于 2019-12-06 09:32:32
So I have been working on a site (http://getcours.tk/), recently, It works fine in Chrome (So webkit) and Firefox (So Gecko) but I just tried it out in Internet explorer 8 and Since it doesn't seem to follow CSS3 standards, It is incapable of rendering it properly. I just want to display a message to users of internet explorer 8 and below (ie9 works) to say that the site will display incorrectly in their browser, and that if they wish to see it properly they should Use a Modern browser. Really hoping for a hand here, thanks to anyone who can help -jman6495 It's really simple actually. You can

Is there a RPM File naming convention in LSB?

孤人 提交于 2019-12-06 09:24:27
问题 RPM is the package format in LSB but does LSB force any naming standard for RPMs similarly to this: http://www.rpm.org/max-rpm/ch-rpm-file-format.html 回答1: In the relevant section of the "LSB Book", Packaging, it's only required to prefix your package with lsb- to register the portion of your package name up to the first hyphen in LANANA (or for it to be your domain name). However, the standard LSB packaging tool wrapper, makelsbpkg , is said to generate package names in the form mypackage-1

Does using ignore(numeric_limits<streamsize>::max()) in the IOStreams library handle arbitrarily massive streams?

和自甴很熟 提交于 2019-12-06 07:45:13
问题 In the C++ standard (section 27.6.1.3\24), for the istream ignore() function in the IOStreams library, it implies that if you supply an argument for 'n' of numeric_limits::max() , it will continue to ignore characters forever up until the delimiter is found, even way beyond the actual max value for streamsize (i.e. the 'n' argument is interpreted as infinite). For the gcc implementation this does indeed appear to be how ignore() is implemented, but I'm still unclear as to whether this is

An alternative to the ancient “marquee” tag?

别说谁变了你拦得住时间么 提交于 2019-12-06 07:35:57
What is the standard equivalent of the "marquee" tag? I'm looking for a solution in HTML, C#, asp.NET or ASPX, jquery, java script The "marquee" tag was not included in the standard because it's a "visual" tag, not a "semantic" tag. As such, none of the languages that you want have an exact equivalent. I suggest using Javascript to do animations on your webpage. (I hear that jQuery is a great framework to get started with.) Note: As someone pointed out in MSO chat , there is actually a jQuery plugin already written to do what you want. See then jQuery marquee plugin . Also, there is this demo