Sunday, December 15, 2013

How to remote debug android emulator for windows


For Remote Machin run with SDK and Android Emulator
1. Install freeSSHd on remote machin
    2.1 start freeSSHd. don't run freeSSHd more than one time, It will
        make the second freeSSHd instance show SSH Server start faile.
    2.2 in the windows taskbar bottom right corner find out freeSSHd
        icon and click setting menu item.
    2.3 in the Server status tab make sure SSH server is running
    2.4 In Users tab add new user for ssh login
    2.5 In Tunneling tab checked 'Allow local port forwarding'
2. Install android SDK and run emulator in remote machin.


For Development Machin run with Eclipse and SDK
3. Setup putty SSH client
    3.1 open putty go to 'Connection -> SSH -> Tunnel' add forward port as follow:
        option: Local, Auto
        L5554  Localhost:5554
        L5555  Localhost:5555
        5554 is the first running emulator in remote machin, if you wanna connect more emulators
        you have to add addtional pairs of port as above.
    3.2 go to 'Session' add remote machin IP with SSH 22 port, Then save it to session name, the tunnel
        setting you do above will save into this session name.
4. connect to remote machin, type login name and password to login.
   and just keept putty running here as a SSH tunnle connector.
5. stop adb server in develop machin, and restart it again or let step 6. do it automatically.
    adb kill-server
6. relocate devices, remote emulator should be show.
   adb devices

Sunday, July 7, 2013

Relocate All Folders Setting in Visual Studio


Change all location settings in the Registry below

Visual Studio 2010
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0

Visual Studio 2008
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0
HKEY_CURRENT_USER\Software\Microsoft\MSDN\9.0

Microsoft SQL Server Management Studio
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server
HKEY_CURRENT_USER\Software\Microsoft\MSDN\8.0

Monday, May 20, 2013

jQuery append() not work in IE 7, IE8

Shame the MS IE bad ass once again trying to break down the web developers...

When you using jQuery .apend() function in IE 7 or 8, It will throw a error and break the web page function down.

for example the code below will throw an error and stop to continue execute the rest of the code after this line:
    elm.append("<elm2></elm2>");

There is a example can solve this problem which is using XML DOM.

var strXml = "<root>"
                       + "<publish>"
                       + "    <store>"
                       + "        <book title=\"How to fix IE\"/>"
                       + "    </store>"
                       + "</publish>"
                       + "</root>";
         
// Build XML document
var xDoc = $.parseXML(strXml);

// create new child element using XML Document
var xBook = xDoc.createElement("book");

// setting the attributes of child element using XML DOM method 
xBook.setAttribute("title", "How to fix bad ass IE!");

// setting the attributes of child element using jQuery
$(xBook).attr("authr", "Bill ...");

// Append child element to some where in the XML Document
var xStore = $(xDoc).find("store");
xStore.append(xBook);




Sunday, February 17, 2013

How to Take Ownership of a locked folders in Windows 7



takeown /f "C:\Locked Directory" /r /d y
icacls "C:\Locked Directory" /grant administrators:F /t