What are all the escape characters?

You can find the full list here. \t Insert a tab in the text at this point. \b Insert a backspace in the text at this point. \n Insert a newline in the text at this point. \r Insert a carriage return in the text at this point. \f Insert a formfeed in the text … Read more

What does “|=” mean? (pipe equal operator)

|= reads the same way as +=. is the same as where | is the bit-wise OR operator. All operators are referenced here. A bit-wise operator is used because, as is frequent, those constants enable an int to carry flags. If you look at those constants, you’ll see that they’re in powers of two : So you can use bit-wise OR to … Read more

Change date format in a Java string

Use LocalDateTime#parse() (or ZonedDateTime#parse() if the string happens to contain a time zone part) to parse a String in a certain pattern into a LocalDateTime. Use LocalDateTime#format() (or ZonedDateTime#format()) to format a LocalDateTime into a String in a certain pattern. Or, when you’re not on Java 8 yet, use SimpleDateFormat#parse() to parse a String in a certain pattern into a Date. Use SimpleDateFormat#format() to format a Date into a String in a certain pattern. See also: Java string to date … Read more

How to decrypt a SHA-256 encrypted string?

SHA-256 is a cryptographic (one-way) hash function, so there is no direct way to decode it. The entire purpose of a cryptographic hash function is that you can’t undo it. One thing you can do is a brute-force strategy, where you guess what was hashed, then hash it with the same function and see if … Read more

How to implement a tree data-structure in Java?

Is there any standard Java library class to represent a tree in Java? Specifically I need to represent the following: The sub-tree at any node can have an arbitrary number of children Each node (after the root) and it’s children will have string value I need to get all the children (some sort of list … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)