2012年8月27日星期一

amazon s3 signed url timezone problem

It's very simple to resolve it. Amazon s3 server is using GMT time. So you just need to use GMT time.

     Date date2 = new Date();                          //this is gmt time
     Calendar cal = Calendar.getInstance();
     cal.setTime(date2);
     cal.add(Calendar.SECOND, 120);           // after two minutes to expire
     Date newdate = cal.getTime();


TAG: amazon s3 signed url timezone problem

2012年8月23日星期四

How can I add library to Android-Emulator's lib folder

Operation System: Windows 7, Eclipse

Here I present the steps how I add libraries to Android-Emulator's lib folder, it takes a week from me, but I have done all and want to share my results in order you can solve your problem very fast and effectively. So I will present steps how I done this:
  1. Open Eclipse.
  2. Open Command Line (cmd) and go to path there your android SDK located:
    cd C:\android\android-sdk-windows\tools
  3. Now we will run Emulator with given partition size, enter following command:
    C:..\tools> emulator -avd EmulatorName -partition-size 512
    NOTE: EmulatorName - is the name of your emulator.
  4. Wait until emulator starts and minimize Command Line ( don't close it ), open new Command Line (cmd) and go to path:
    cd C:\android\android-sdk-windows\platform-tools
  5. Run the command
    C:..\platform-tools> adb remount
  6. Go to Eclipse and open
    Window -> Open Perspective -> Other ...
  7. Select DDMS in the opened Dialog.
  8. Select "File Explorer" tab.
  9. Select directory \system\lib
  10. Select "Push a file onto Device" and select library(s) witch you want.

All Done !


TAG: android simulator copy file to system folder

2012年8月14日星期二

mysql table name uppercase and lowcase problem


Error: table "xxxxx" doesn't exist

  a . login as root, and vi /etc/mysql/my.cnf
  b.add one line under [mysqld]:lower_case_table_names=1
  c.sudo service mysql restart

Just it