2012年10月26日星期五

apnata jquery autocomplete doesn't work

I also did not want to download 127MB plugin, and I am doing a big PDT project in Eclipse so I was wary of a new perspective. I spent a bunch of time on Aptana and it never worked, so am sharing my steps to save someone else time. Note I have PDT installed already and some other notes say you have to install Aptana first. That doesn't help me too much.
  1. Help > Install New Software
  2. Add Aptana download site (http://update.aptana.com/install/studio/)
  3. Important - Uncheck "Group Items By Category"
  4. Select Aptana Web Development Tools (Subset of entire studio)
  5. Complete Installation
  6. On Restart of Eclipse you get a "Customize Aptana Studio" popup
  7. Under AJAX Libraries select JQuery
  8. Get "Aptana Support for jQuery"
  9. Complete installation (second restart of Eclipse)
  10. Open a JS file, Window - Open Perspective - Other - Aptana
  11. Still doesn't work, so Window - Preferences - Aptana / Editors / JavaScript / Code Assist
  12. Check JQuery
  13. File Restart
  14. File New Project - Aptana - Web Project
  15. Create JS file and paste whatever you were working on here, or start new
I tried all kinds of stuff to get the code-complete to work, I copied over entire htm and js files, saved them, waited a long time after typing a period, etc.
Now I am going to work on uninstalling Aptana.

2012年9月28日星期五

fw: Change wireless MAC address in Windows 7

Under Windows 7, the possible range of spoofed addresses for wireless adapters that can be set is limited. To be used by Windows 7, a spoofed MAC address should have 0 as a least significant bit (unicast) and 1 as a second least significant bit (locally administered) in the second nibble. Thus possible values for the second nibble are limited to 2, 6, A and E.
In other words
MAC address: “XY-XX-XX-XX-XX-XX” “X” can be anything hexadecimal. The hexadecimal “Y”, written in binary format, is Y: “kmnp”, where “p” is the least significant bit;
        p=0 --> unicast; 
        p=1 --> multicast; 
        n=0 --> globally assigned MAC; 
        n=1 --> locally administered; 
So, actually MAC can be changed to any combination in which p=0 and n=1;
“Y” can be 2, 6, A or E.
So the possible MAC addresses in Windows 7 for wireless adapters:
  • X2-XX-XX-XX-XX-XX
  • X6-XX-XX-XX-XX-XX
  • XA-XX-XX-XX-XX-XX
  • XE-XX-XX-XX-XX-XX
It is limitation from Microsoft.
Sometimes the problem can be fixed by downgrading driver for wireless adapter and installing its version for Windows XP. And then the MAC address can be changed to any MAC address without limitation. But downgrade may cause incorrect work of device.
Additional information about changing MAC address - Tutorial "Changing MAC address in Windows 7".

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

2012年7月27日星期五

fw: How to Enable Remote Access to MySQL

MySQL remote access is disabled by default, but with a few simple steps, you should be up and running with remote MySQL in just a few minutes. This is especially useful when working with multiple developers in an Agile project environment, so that you all use the same data set, and can focus on just writing the application.

Login to SSH to edit remote MySQL config

First, we need to edit the mysql config file to accept and bind remote connections to your server. We do this by editing your my.conf file located on most unix systems at /etc/my.conf or /etc/mysql/my.conf. I’m going to hope and assume you know the basics to ssh into your remote server and vi or nano the conf file.
ssh root@yourserver.com
vi /etc/my.conf

Replace mysqld Defaults

You can either set this up as a new connection or override the default, in this case, I replaced the default connection with my own remote connection settings:
[mysqld]
bind-address    = 255.112.324.12
port            = 3306
user   = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
language        = /usr/share/mysql/English
# skip-networking
# skip-external-locking
After your done editing, just save and close the file and restart mysql services:
# Ubuntu
service mysql restart
# Other Unix
/sbin/init.d/mysql restart
# Test that your connection is allowed with telnet on your local machine:
telnet 255.112.324.12 3306

Granting Remote Access to MySQL Users

Now we’ve created our remote config for MySQL, we have to grant access to this server to other machines.
mysql -uroot -pMyPass
CREATE DATABASE mydb;
# Grant permission to root from any host:
GRANT ALL ON mydb.* TO root@'%' IDENTIFIED BY 'MyPASSWORD';

Open Up MySQL Remote Ports

Now that our user has been granted access from any host, all thats left is to make sure our OS will allow connections to the default MySQL port
/sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
And now we should be able to login to our server from our local machine:
mysql -h255.112.324.12 -uroot -pMyPASSWORD