jQuery HTML Singular / Plural Text based on select multiple

I’m trying to get the singular/plural for the text before the array, based on how many options are selected in the array. For example, if only one selected option, it should be Result in Category 1 if two or more are selected: Results in Category 1, Category 2, and Category 3 Working demo: https://jsfiddle.net/baidoct/xnjf9b0t/12/ $("#selectKat").change(function… Read More jQuery HTML Singular / Plural Text based on select multiple

`LL` vs `i64` suffix in C++ Visual studio compiler

I’m trying to refactor an old C++ code. At some point I’ve something like: #if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) # define I64_CONST(X) X ## i64 #else # define I64_CONST(X) X ## LL #endif So for defining a 64 bit literal in the code there’s something like: (uint32_t)((data_in >> 32) & I64_CONST(0x00000000ffffffff)); This for using… Read More `LL` vs `i64` suffix in C++ Visual studio compiler

Typescript create key constrained type for object literal with inferred number values

Let’s say we have object literal like: export const SOURCE = { UNKNOWN: ‘Unknown’, WEB: ‘Web’, MOBILE: ‘Mobile’, … } as const; and export const OTHER_SOURCE = { UNKNOWN: 0, WEB: 1, MOBILE: 2, // values might be not sequential or incrementing at all … } as const; OTHER_SOURCE.UNKNOWN // inferred to 0 How to… Read More Typescript create key constrained type for object literal with inferred number values