iso

javascript regex iso datetime

依然范特西╮ 提交于 2019-11-29 23:12:08
does anyone have a good regex pattern for matching iso datetimes? ie: 2010-06-15T00:00:00 For the strict, full datetime, including milliseconds, per the W3C's take on the spec .: //-- Complete precision: /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/ //-- No milliseconds: /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/ //-- No Seconds: /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/ //-- Putting it all together: /(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]

Why a variable can't be defined twice in 2 files in C

你说的曾经没有我的故事 提交于 2019-11-29 16:26:24
问题 Why can't I have int a; in 2 C files. I intend to combine both to make executable. I know from experience that I can't, but I want to find where the standard C99 says this and seal my understanding. I am reading ISO C99 standard from http://www.open-std.org/jtc1/sc22/wg...docs/n1256.pdf. It says on page 42: 6.2.2 Linkages of identifiers 1 An identifier declared in different scopes or in the same scope more than once can be made to refer to the same object or function by a process called linkage

What does the [Note] in undefined behavior paragraph in C++ standard mean?

六眼飞鱼酱① 提交于 2019-11-29 16:23:21
As user Tony points out there's a [Note] in paragraph 1.3.12 of C++ standard saying permissible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment... Doesn't this contradict the definition of UB saying that ...this International Standard imposes no requirements ? I mean they say "no requirements" and then say "permissible UB" - right in the same paragraph. How should this note be interpreted? Does it indeed limit UB in any way? From §6.5.1 of

iOS camera: manual exposure duration but auto ISO?

天大地大妈咪最大 提交于 2019-11-29 09:29:45
问题 I'm using the camera video feed for some image processing and would like to optimise for fastest shutter speed. I know you can manually set exposure duration and ISO using setExposureModeCustomWithDuration:ISO:completionHandler: but this requires one to set both the values by hand. Is there a method or clever trick to allow you to set the exposure duraction manually but have the ISO handle itself to try to correctly expose the image? 回答1: I'm not sure if this solution is the best one, since I

Is C++03 a new version of the C++ Standard or just a Technical Corrigendum (TC) of C++98?

十年热恋 提交于 2019-11-29 05:33:50
问题 I'm pretty sure I read on an authoritative source somewhere (I believe it was on the WG21 pages) that C++03 was not a technical corrigendum of C++98 but that it was a new release of the C++ Standard. But nontheless I see only -std=c++98 switch in GCC and others compilers and Alf P Steinbach made a few comments hinting at that it may indeed be a TC of C++98. So when I'm writing about "C++03", does it suffice mentioning C++98? As a related question, is it even wrong to use the term "C++03"?

Can I read the C++ 2011 FDIS anywhere?

眉间皱痕 提交于 2019-11-29 01:54:19
问题 I probably can't, but I really would like to. Can I read the C++ 2011 FDIS anywhere? 回答1: Post-C++11, Stefanus Du Toit (the new editor for the C++ standardization committee) is maintaining the standard draft on github. The github page states: These are the sources used to generate drafts of the C++ standard. These sources should not be considered an ISO publication, nor should documents generated from them unless officially adopted by the C++ working group (ISO/IEC JTC1/SC22/WG21). You can

Detecting integral overflow with scanf

家住魔仙堡 提交于 2019-11-29 01:46:03
When recently answering another question , I discovered a problem with code like: int n; scanf ("%d", &n); With strtol , you can detect overflow because, in that case, the maximum value allowed is inserted into n and errno is set to indicate the overflow, as per C11 7.22.1.4 The strtol, strtoll, strtoul, and strtoull functions /8 : If the correct value is outside the range of representable values, LONG_MIN, LONG_MAX, LLONG_MIN, LLONG_MAX, ULONG_MAX, or ULLONG_MAX is returned (according to the return type and sign of the value, if any), and the value of the macro ERANGE is stored in errno.

What is the __STDC_VERSION__ value for C11?

廉价感情. 提交于 2019-11-29 01:02:06
I know that compilers use __STDC__ to indicate that a compiler is standard C and, from, there, you can use __STDC_VERSION__ to figure out which level of the standard you're using. I also know that C90 had no value, C90 amendment 1 had 199401L and C99 had 199901L . The latest C1x draft I have simply states it as 201ymmL and I'm assuming it was made a less "vague" value in the final standard. My guess is that it will be 201112L since that's when C11 was ratified but I'd like to be certain. I thought I could try using gcc -std=c1x but the version of gcc I'm running doesn't support that yet. Does

Do minor currency units have a ISO standard?

旧时模样 提交于 2019-11-29 00:10:56
问题 ISO 4217 defines 3-letter currency symbols: EUR USD LKR GBP Do currencies' minor units (cent, pence) have a ISO or similar standard, too, that defines codes for those sub-units like ct p ? 回答1: The standard also defines the relationship between the major currency unit and any minor currency unit. Often, the minor currency unit has a value that is 1/100 of the major unit, but 1/1000 is also common. Some currencies do not have any minor currency unit at all. In others, the major currency unit

ISO Standard Street Addresses?

你说的曾经没有我的故事 提交于 2019-11-28 21:17:20
Is there an ISO standard address format? I can't seem to find one, and I'd like to know for object- and database-design purposes. (One interesting document that shows a bunch of formats is this: http://www.bitboost.com/ref/international-address-formats.html , but it's insane!) Jonathan Leffler No; each country defines its own standard. There have been a number of questions about this in times past, including: Best practices for storing postal addresses in an RDBMS Is there a common street address database design for all addresses of the world The second of those itself has references to a