Java Array Sort descending?

You could use this to sort all kind of Objects sort(T[] a, Comparator<? super T> c) Arrays.sort(a, Collections.reverseOrder()); Arrays.sort() cannot be used directly to sort primitive arrays in descending order. If you try to call the Arrays.sort() method by passing reverse Comparator defined by Collections.reverseOrder() , it will throw the error no suitable method found … Read more

Leading zeros for Int in Swift

Assuming you want a field length of 2 with leading zeros you’d do this: import Foundation for myInt in 1 … 3 { print(String(format: “%02d”, myInt)) } output: 01 02 03 This requires import Foundation so technically it is not a part of the Swift language but a capability provided by the Foundation framework. Note … Read more

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