I haven't used MySQL for a while. After reinstalled my laptop with Ubuntu 12.04 Beta 2, I decided to use MySQL instead of PostgreSQL to continue my JPA study.
sudo apt-get install mysql-server
I used MySQL Administrator long time ago and now it's replaced with powerful MySQL Workbench. If you have difficulties in installing it, please follow this tutorial.
Everything seems fine, just like when I developed myTunes 6 years ago, except that % for any host doesn't work any more. So if you get
ERROR 1045 (28000): Access denied for user 'user'@'localhost' (using password: YES)
Update Host column from % to localhost for your user account and restart MySQL will solve it.
Update: you can also remove anonymous accounts by executing delete from user where user=''; (Thank you, Dan)
Saturday, April 14, 2012
Sunday, March 04, 2012
Everybody Loves FizzBuzz
One of my career objectives is implementing business requirements in a way that makes
Update (06/12/2014): https://github.com/codingsince1985/FizzBuzz
- customer / employer happy
- developers happy, and
- infrastructure happy
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
public class FizzBuzz {
public static void main(String[] args) {
boolean fizzOrBuzz;
for (int i = 1; i <= 100; i++) {
fizzOrBuzz = false;
if (i % 3 == 0) {
fizzOrBuzz = true;
System.out.print("Fizz");
}
if (i % 5 == 0) {
fizzOrBuzz = true;
System.out.print("Buzz");
}
if (!fizzOrBuzz) {
System.out.print(i);
}
System.out.println();
}
}
}
Update (06/12/2014): https://github.com/codingsince1985/FizzBuzz
Subscribe to:
Posts (Atom)