2013年12月19日 星期四

Eclipse cannot load SWT libraries

After installed eclipse in ubuntu 12.04. you may meet the following problem.

Eclipse cannot load SWT libraries

The log looks like belows.
 11         java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
 12         no swt-gtk-3740 in java.library.path
 13         no swt-gtk in java.library.path
 14         Can't load library: ~/.swt/lib/linux/x86_64/libswt-gtk-3740.so
 15         Can't load library: ~/.swt/lib/linux/x86_64/libswt-gtk.so

The solution is: 
echo "-Djava.library.path=/usr/lib/jni/" >> /etc/eclipse.ini




2013年7月18日 星期四

git revert without change-id

We can use git revert to revert a commit. But if you need a change-id, you will find git revert won't invoke commit-msg hooks. And you won't get a change-id for this commit.
Here is a workaround.

git revert -n <<commit-id>>
git commit

refer to git-revert,
-n
--no-commit
Usually the command automatically creates some commits with commit log messages stating which commits were reverted. This flag applies the changes necessary to revert the named commits to your working tree and the index, but does not make the commits. In addition, when this option is used, your index does not have to match the HEAD commit. The revert is done against the beginning state of your index.
This is useful when reverting more than one commits' effect to your index in a row.

2013年7月15日 星期一

how to add an existing git repo. to gerrit project.

1. Create new project in gerrit. command as below.
ssh -p 29418 user@gerrit.server gerrit create-project --name gerrit_project_name

2. Push existing git repo. to gerrit server as below.
git push ssh://user@gerrit.server:29418/gerrit_project_name HEAD:refs/heads/master

2013年5月9日 星期四

如何開啟 windows telnet server (for windows 7)


  1. Click on Start / Control Panel / Program Features / Turn Windows Features on or off.
  2. Check "Telnet Server" and "Telnet Client" on. (as below picture)

You still can NOT telnet to your server until now. just because you will get the following error.
Access Denied: Specified user is not a member of TelnetClients group.
Server administrator must add this user to the above group.
Telnet Server has closed the connection


Please follow the steps to solve the problem.
    1. Open the Local Users and Groups snap-in. In the Start Search box, type mmc lusrmgr.msc.
    2. In the navigation pane, click Groups.
    3. In the details pane, right-click TelnetClients, and then click Properties.
    4. In the TelnetClient Properties dialog box, click Add.
    5. select user who you allows to telnet to your windows7.

    and then enjoy your telnet in win7.

    2013年1月14日 星期一

    MVP in Android

    一個簡單的介紹有關android如何實作MVP pattern.
    An MVP Pattern for Android

    實際範例,可以下載回來自己測試,了解MVP架構。(其中包含了 unit test 的使用)
    mvp-hello-world