Tuesday, December 29, 2009

Clear command in Cygwin

http://abhisanoujam.blogspot.com/2008/06/bash-cleaar-command-not-found-on-cygwin.html

Basically, install ncurses package from Util and Libs.

Setup OpenSSH on Windows

http://www.petri.co.il/setup-ssh-server-vista.htm

Basically, install cygwin with OpenSSH selected. Then run "ssh-host-config" to configure it. "net start sshd" to start it.

Very easy to use and install. Then you can use "ssh" and "scp"!

Monday, December 28, 2009

Android Dev Notes

Attach android source to Eclipse:



http://stuffthathappens.com/blog/2008/11/01/browsing-android-source-in-eclipse/

Basically, download source from google and copy frameworks/base/core/java/ to android-sdk/platforms/android-version/sources.

But it didn't work at first attempt. It turns out eclipse's cache is preventing source from showing up. Deleted some directories (don't remember exactly what I deleted :) under eclipse-workspace/.metadata/.plugins/org.eclipse.core.resources/.history and .projects directory. Then the source file begins to show up.

The link for downloading source code is like this: http://git.source.android.com/?p=platform/frameworks/base.git;a=snapshot;h=HEAD;sf=tgz (Thanks for http://geekycoder.wordpress.com/2009/07/03/how-to-download-latest-zip-android-source-code-and-using-it-in-intellij/) This link is for HEAD, if you want to download tagged version, such as 1.5, you have to find the correct value for "h" as in "h=HEAD". It can be found here: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=summary. Click any version you want, then in the URL, you can see the parameter value for "h".

Code Optimization for Dalvik VM



Accessing a local variable is much more efficient than accessing a field in the Dalvik VM. So creating a new local variable to refer to field variable will make the routine much more efficient. It is recommended that you use this optimization when possible.

Monday, December 21, 2009

Can not fix width for SPAN

SPAN is inline element, so you can not set the width for SPAN. Even you set it, it will be ignored by spec compatible browser. Use DIV instead.