2015年5月12日 星期二

Java : Arrarys

Arrays in Java are also objects.we use the following syntax:
int[ ] arry; // There is no size

We create new size like below
arry = new int[5]



To show array length

arry.length


To see the array value

int[ ] arry = { 1, 2, 3, 4, 5}
or 
arry[1] = 20;

Here is example code :





public class Demo {
           public static void main(String[ ] args) {
                  int[ ] arry ;

                  arry = new int[5];
                  arry[0] = 33;
                  arry[1] = 34;
                  arry[2] = 35;
                  arry[3] = 36;
                  arry[3] = 37;    
  
                  for ( int i = 0; i < arry.length; i++)

                  {
                         System.out.println(arry[i]);
                  }
 
                  
           }
}

2013年6月5日 星期三

mount samba on ubuntu



sudo mount.cifs //hostname/sharename ~/mounts/sharename -o user=username,pass=password

sshfs on ubuntu

Use sshfs instead, there is no setup necessary at all and you get "proper" mount points that are recognized by any application:
sudo apt-get install sshfs
Mount the remote filesystem with
sshfs user@host:/path /local/mount/point
and unmount with
fusermount -u /local/mount/point

2013年5月9日 星期四

更新git

使用的是ubuntu 10.04,出現這個問題
fatal: git 1.7.2 or later required
git版本太舊
處理的方法如下:
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git
就可以更新到新版的git

2013年4月3日 星期三

Android CTS test

step1 :  download tool ;
http://source.android.com/compatibility/cts-intro.html

step2:



Added the below in cts-tradefed
CTS_ROOT=/home/test/projects/cts


CTS/android-cts/tools$ ./cts-tradefed
cts-tf > run cts -c android.permission2.cts.ProtectedBroadcastsTest -m testSendProtectedBroadcasts

2013年3月25日 星期一

tcpdump

Using tcpdump to capture wireless packet

git auto completion

git clone git://git.kernel.org/pub/scm/git/git.git
$cp git/contrib/completion/git-completion.bash ~/.git-completion.bash
 在 .bashrc 中加入:
source ~/.git-completion.bash
 
 
$ git co
config commit