standards

What's the best “file format” for saving complete web pages (images, etc.) in a single archive? [closed]

被刻印的时光 ゝ 提交于 2019-11-28 03:49:30
I'm working on a project which stores single images and text files in one place, like a time capsule. Now, most every project can be saved as one file, like DOC, PPT, and ODF. But complete web pages can't -- they're saved as a separate HTML file and data folder. I want to save a web page in a single archive, and while there are several solutions, there's no "standard". Which is the best format for HTML archives? Microsoft has MHTML -- basically a file encoded exactly as a MIME HTML email message. It's already based on an existing standard, and MHTML as its own was proposed as rfc2557 . This is

What is the rationale for parenthesis in C++11's raw string literals R“(…)”?

空扰寡人 提交于 2019-11-28 03:45:35
There is a very convenient feature introduced in C++11 called raw string literals, which are strings with no escape characters. And instead of writing this: regex mask("\\t[0-9]+\\.[0-9]+\\t\\\\SUB"); You can simply write this: regex mask(R"(\t[0-9]+\.[0-9]+\t\\SUB)"); Quite more readable. However, note extra parenthesis around the string one have to place to define a raw string literal. My question is, why do we even need these? For me it looks quite ugly and illogical. Here are the cons what I see: Extra verbosity, while the whole feature is used to make literals more compact Hard to

Are pointers allowed as keys in ordered STL containers?

允我心安 提交于 2019-11-28 03:41:18
问题 There's this other question asking about how comparing pointers is supposed to be interpreted wrt the C++ Std. So I was wondering what the C++ Std has to say about using pointers as keys in ordered standard library (STL) containers -- i.e. is one allowed to have std::map<T1*, T2> and is this due to the specification of std::less or builtin operator < ? 回答1: Yes, because it uses std::less , which is required to result in a total order even if < doesn't. ( < would be allowed to treat different

Vertical alignment of empty inline-block elements

纵然是瞬间 提交于 2019-11-28 03:40:14
问题 Consider the following html/css: <style> span { display:inline-block; width:5em; height:5em; padding:1em; } </style> a <span style="background-color:blue;">b</span> <span style="background-color:green;"></span> <span style="background-color:red;">c</span> d The blue and red boxes, plus the text both inside and surrounding the boxes lines up horizontally. The empty green box does not; it appears above the other two boxes. If I add some text to the green box, this behavior stops and everything

Image map support in firefox, chrome and other browsers

匆匆过客 提交于 2019-11-28 03:32:59
问题 Are image maps supported in chrome and firefox? w3schools seems to suggest they are. Given this, why would the following HTML fail? (Image is displayed but no links work - It does work correctly in IE) <img src="Images/backgroundFinal.png" usemap="#mainImageMap" alt="MainBackground" style="border: none;" /> <map id="mainImageMap"> <area shape="rect" alt="Home Page" title="Home Page" coords="309,198,413,223" href="Default.aspx" target="" /> <area shape="rect" alt="About me" title="About me"

Checking for empty arrays: count vs empty

旧巷老猫 提交于 2019-11-28 03:22:02
This question on ' How to tell if a PHP array is empty ' had me thinking of this question Is there a reason that count should be used instead of empty when determining if an array is empty or not? My personal thought would be if the 2 are equivalent for the case of empty arrays you should use empty because it gives a boolean answer to a boolean question. From the question linked above, it seems that count($var) == 0 is the popular method. To me, while technically correct, makes no sense. E.g. Q: $var, are you empty? A: 7 . Hmmm... Is there a reason I should use count == 0 instead or just a

Java/Swing GUI best practices (from a code standpoint) [closed]

无人久伴 提交于 2019-11-28 03:21:18
As a contrast to this wiki , I am looking for the proper way to implement Swing GUI controls from a coding standpoint. I have been on a quest to learn Java and its GUI tools but I find internet tutorial after internet tutorial that throws everything in main and I know this isn't right. I've also tried RAD systems like Netbeans and other "visual" editors but by the time I get to coding I've got a heap of code that I don't know half of what it does, so I'm intent on learning to hand code swing, and I know the basic controls and layout, but want to do it the right way. Is there a model or

“as if” in language standards

你离开我真会死。 提交于 2019-11-28 02:49:56
问题 What is the exact meaning of the phrase "as if" in the standard and how does it work when a user can modify individual parts of the behavior. The question is in regards to the C++ standard when talking about the nothrow version of operator new . 18.4.1.1/7 reads (my emphasis): This nothrow version of operator new returns a pointer obtained as if acquired from the ordinary version. My understanding is that "as if" does not require a specific implementation as long as the behavior is

Converting a non-`void` pointer to `uintptr_t` and vice-versa

爱⌒轻易说出口 提交于 2019-11-28 02:48:31
问题 There are two related C standard rules: C99 standard, 6.3.2.3 : A pointer to void may be converted to or from a pointer to any incomplete or object type. A pointer to any incomplete or object type may be converted to a pointer to void and back again; the result shall compare equal to the original pointer. And 7.20.1.4 : The following type designates an unsigned integer type with the property that any valid pointer to void can be converted to this type, then converted back to pointer to void,

Lat Long or Long Lat

耗尽温柔 提交于 2019-11-28 02:24:29
问题 There seems to be no standard whether Longitude,Latitude or Latitude,Longitude should be used. WSG84 and stuff based directly on it, seem to prefer Long,Lat. "Normal people" always tend to speak of Lat, Long - so I've very often seen code or frameworks that use Lat, Long (e.g. google Maps) Is there any strong argument for either way? 回答1: You are correct, there is no standard on the order: In mathematical functions which do an universal conversion, between x,y or lon,lat or inverse, the lon