Extract substring in Bash
Use cut: More generic:
Self Join to get employee manager name
EDIT: Left Join will work if emp_mgr_id is null.
what is the difference between uint16_t and unsigned short int incase of 64 bit processor?
uint16_t is unsigned 16-bit integer. unsigned short int is unsigned short integer, but the size is implementation dependent. The standard only says it’s at least 16-bit (i.e, minimum value of UINT_MAX is 65535). In practice, it usually is 16-bit, but you can’t take that as guaranteed. Note: If you want a portable unsigned 16-bit integer, … Read more
How do I copy to the clipboard in JavaScript?
What is the best way to copy text to the clipboard (multi-browser)? I have tried: But in Internet Explorer it gives a syntax error. In Firefox, it says unsafeWindow is not defined. A nice trick without using Flash: How does Trello access the user’s clipboard?
What do < and > stand for?
< stands for the less-than sign: < > stands for the greater-than sign: > ≤ stands for the less-than or equals sign: ≤ ≥ stands for the greater-than or equals sign: ≥
How can I validate an email address using a regular expression?
The fully RFC 822 compliant regex is inefficient and obscure because of its length. Fortunately, RFC 822 was superseded twice and the current specification for email addresses is RFC 5322. RFC 5322 leads to a regex that can be understood if studied for a few minutes and is efficient enough for actual use. One RFC … Read more
Passing an array by reference
How does passing a statically allocated array by reference work? Does (&myArray)[100] have any meaning or its just a syntax to pass any array by reference? I don’t understand separate parenthesis followed by big brackets here. Thanks.
Converting array to list in Java
In your example, it is because you can’t have a List of a primitive type. In other words, List<int> is not possible. You can, however, have a List<Integer> using the Integer class that wraps the int primitive. Convert your array to a List with the Arrays.asList utility method. See this code run live at IdeOne.com.