Peoplesoft - Why does the "y" in "MMM/y" must be lower case? - peoplesoft

Why does the "y" in "MMM/y" must be lower case?
&monYear = DateTimeToLocalizedString(&curDate, "MMM/y");

Format specifiers are commonly case sensitive (in other languages too; not just in PeopleCode). As one of the comments said, format specifiers are usually lowercase, with uppercase being used so that the same letter can have a different meaning. The common example is m and M for minute and month. You can see the various format specifiers here

Related

What is the valid range for numbers in CSS

I have searched the internet and it seems very hard to find this info.
When I do
div {
width: calc(1e-10 * 1e12px);
}
It sets the width to 100px. But when I do
div {
width: calc(1e-1000 * 1e1002px);
}
It fails. Clearly, 1e1002 is out of range.
What is the valid range of numbers in CSS? Does it depend on the unit? Is it browser specific?
It is up to each browser to pick limits for CSS real numbers. The spec supports a theoretically infinite range but relies on vendors to provide 'reasonable' support.
4.1. Range Restrictions and Range Definition Notation
Properties can restrict numeric values to some range. If the value is outside the allowed range, then unless otherwise specified, the declaration is invalid and must be ignored.
[...]
CSS theoretically supports infinite precision and infinite ranges for all value types; however in reality implementations have finite capacity. UAs should support reasonably useful ranges and precisions. Range extremes that are ideally unlimited are indicated using ∞ or −∞ as appropriate.
Soruce: https://www.w3.org/TR/css-values-3/#numeric-ranges
See also:
4.3. Real Numbers: the <number> type
Number values are denoted by <number>, and represent real numbers, possibly with a fractional component.
When written literally, a number is either an integer, or zero or more decimal digits followed by a dot (.) followed by one or more decimal digits and optionally an exponent composed of "e" or "E" and an integer. It corresponds to the <number-token> production in the CSS Syntax Module [CSS3SYN]. As with integers, the first character of a number may be immediately preceded by - or + to indicate the number’s sign.
Source: https://www.w3.org/TR/css-values-3/#numbers

Single (accented) characters with `str.__len__(x) == 2`

To the best of my understanding, str.__len__(x) counts accented characters double in Python 2 because of their byte representation, but once in Python 3, although I couldn't find proper documentation on str.__len__ on python.org.
Python documentation on stdtypes
Python documentation on len
However, If I run the following on Google Colab, the str.__len__(..) is counted as 2
import sys
test = u'ö'
print(type(test), len(test), sys.version)
Where is str.__len__ documented?
There are two ways to represent the symbol "ö" in Unicode. One is as U+00F6 LATIN SMALL LETTER O WITH DIAERESIS. The other is U+006F LATIN SMALL LETTER O followed by U+0308 COMBINING DIAERESIS. If you restrict your source files to ASCII these can be represented as "\u00f6" and "o\u0308" respectively.
In the first case, I get a length of 1. In the second case, I get a length of 2. (Tested with Python 3.7.2). I suspect your code is using the second representation.
This matches the documentation for the string type which notes that "Strings are immutable sequences of Unicode code points" (emphasis mine). A representation that consists of two code points would therefore have a length of 2.
You can use the unicodedata.normalize function to convert between the two forms. Using "NFC" for the form parameter will convert to the composed representation (length 1), using "NFD" will decompose it into a letter and a combining character (length 2).

max number of decimals allowed by CSS transform scale?

I'm trying to reduce the number of decimals of a JS operation and use the result to set a transform: scale(x) inline CSS to an element.
I can't find any reference to know how many decimals are allowed by such CSS function.
I want to know how many numbers are allowed (and used by the browser in the transformation) after the comma. (0.0000000N)
The specification defines the value for scale as a <number>, which is defined as:
A number is either an <integer> or zero or more decimal digits followed by a dot (.) followed by one or more decimal digits and optionally an exponent composed of "e" or "E" and an integer. It corresponds to the <number-token> production in the CSS Syntax Module [CSS3SYN]. As with integers, the first character of a number may be immediately preceded by - or + to indicate the number’s sign.
Note the lack of how many "more" decimal digits are allowed. So any limit will be imposed by the browser, which will obviously vary by browser.
As it seems it could be useful for others and amending the accepted question by extending it I'll upgrade my comment to an answer:
In the last term, the number of decimals you'll get depends mainly on the browser implementation so, depending on your targets you'll need to do some more research. Here you have an excellent post and a good starting point:
Browser Rounding and Fractional Pixels

Trail "h" in HEX notation

What's the difference between 0x040h and 0x04?
How this difference should be understood? And where/when each should be used?
I've already seen this Rules for when to append -h/-H to hex numbers in assembly?.
What's the difference between 0x040h and 0x04
The latter is an acceptable way to write 4 in a C program, the former is not. The 'h' is also redundant with '0x' prefix, which already implies hexadecimal in many (most?) programming languages.

Precise syntax of CSS3 colors

I couldn't find a precise definition of legal syntax for CSS3 colors, either as regular expression, BNF or whatever strict formal definition there might be. Some info can be derived from the verbal description in the CSS3 Color Module (for example that comma separated lists may contain whitespace), but I don't see whether e.g. leading zeros in something like
rgb(010,005,255)
rgba(050%,1%,01%,0)
are actually legal, or omitting leading zeros of decimal fractions, like
rgba(100,100,100,.5)
I'm not talking about what is tolerated by browsers, I'm asking whether this is officially legal CSS3 syntax as I'm interested in the use of these color definitions in non-browser applications as well.
As you found already, the CSS3 Color Module specification says
The format of an RGB value in the functional notation is 'rgb(' followed by a comma-separated list of three numerical values (either three integer values or three percentage values) followed by ')'
But you then need to look in basic data types section of CSS 2.1 to find out what an integer or a percentage value is and it says...
Some value types may have integer values (denoted by ) or real number values (denoted by ). Real numbers and integers are specified in decimal notation only. An consists of one or more digits "0" to "9". A can either be an , or it can be zero or more digits followed by a dot (.) followed by one or more digits. Both integers and real numbers may be preceded by a "-" or "+" to indicate the sign. -0 is equivalent to 0 and is not a negative number.
So integers and numbers can have leading zeros.
Then later on basic data types says
The format of a percentage value (denoted by in this specification) is a immediately followed by '%'.
So percentages can have leading zeros too.

Resources