How to compress a String in Java?

Compression algorithms almost always have some form of space overhead, which means that they are only effective when compressing data which is sufficiently large that the overhead is smaller than the amount of saved space. Compressing a string which is only 20 characters long is not too easy, and it is not always possible. If … Read more

Checking Password Code

You almost got it. There are some errors though: you’re not iterating over all the chars of the password (i < password.length() – 1 is wrong) you start with a digit count of 1 instead of 0 you make the check that the count of digits is at least 2 as soon as you meet … Read more

Filling a 2D array in Java

Arrays in Java are zero-based, which means they start at index zero, and range until index array.length-1. Your code starts the row and column at 1—which means you’re skipping the initialization of row/column 0. That’s probably where at least some of the problems are coming from, since you’re using your 5×5 array (rows/columns 0,1,2,3,4) as … Read more

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