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

Tuesday, December 11, 2012

How to make inner float div inside the outer div

When you put some float div inside another div, The outer div will collapse in other words the size of dimension the outer div will small than the inner float div.

The solution is append a div with clear and block style in the end of the other float inner div as below:
<div id="outer_div">
    <div class="float-style">Item 1</div>
    <div class="float-style">Item 2</div>
    <div class="float-style">Item 3</div>
    <div style="clear:both;display:block;"></div>
</div>

Solution 2: using overflow:auto; in the outer div style can also prevent outer div collapsed. But this method may cause outer div appear scroll bar when new div adding to it.
<div id="outer_div" style="overflow:auto;">
    <div class="float-style">Item 1</div>
    <div class="float-style">Item 2</div>
    <div class="float-style">Item 3</div>
    <div style="clear:both;"></div>
</div>


related link: http://css-tricks.com/all-about-floats/

Friday, November 23, 2012

Create log off message for Windows



  1. Click Start > Run, type “regedit” click Ok button. Registry Editor window will popup.
  2. Find this path from left side of Registry Editor window: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  3. Double click LegalNoticeCaption from right side Registry Editor window. This will popup Edit String window. Type in Value data any name that you want to be your message window title. Click Ok button.
  4. Double click LegalNoticeText from right side Registry Editor window. This will popup Edit String window. Type in Value data any message, this message will show up on your message window. Click Ok button. Close your Registry Editor window.
  5. Log off from your computer.