2015年5月22日 星期五

Asus Nexus 7 can't find device in adb debug mode.


Asus Nexus 7 cannot found in Android device chooser.
Besides, adb devices also not list in.

The root cause is computer can not recognize your device (Nexus 7),
When device plugged in computer, it will make a selection of MTP / PTP

If you didn't see the dialog, you can find it in:
Settings --> Storage --> Top Right Option (Computer USB Connection) tap--> choose MTP
Note: I can success in recognize device in choose PTP mode, too.

如果你的 Asus Nexus 7 插上電腦後怎麼通都找不到 Debug  裝置,除了先打開偵錯模式外,也有可能是你沒有選擇 MTP 或 PTP 模式,從
[設定] --> [儲存空間] --> 右上角選項 (USB電腦連線) --> 選 MTP
但有時候 PTP 也能抓到裝置,呵呵。

2015年3月12日 星期四

Ububtu iBus icon disapear 圖示消失

某一天 iBus 的圖示突然消失了,害我心慌慌,雖然仍然可以打字,但是你知道人對於未見的東西總是有恐懼感,而且很不方便。

在網路上找到以下方法‥



killall ibus-daemon (結束程序)
ibus-daemon -d (重啟ibus)

ibus-daemon -d -x -r

資料來源:http://blog.sina.com.cn/s/blog_4d3559c701012lem.html

2015年1月29日 星期四

Update Google Chrome in Ubuntu

參考這裡(ref here )http://superuser.com/questions/130260/how-to-update-google-chrome-in-ubuntu
You must have http://dl.google.com/linux/deb/ in repo list
Now open a terminal. Type following -
sudo apt-get --only-upgrade install google-chrome-stable
This will install the current stable version of it. Now you have to kill all instances (may be hidden) of old Google Chrome.
sudo pkill -15 google-chrome
sudo pkill -15 chrome
Then start google-chrome as you start it.

2014年11月6日 星期四

Ubable to execute dex: Cannot merge new index

 [solution on stackflow]


Android Error in Eclipse: “Unable to execute dex: Cannot merge new index 65799 into a non-jumbo instruction!”



One solution that I found that got it working for me was to add dex.force.jumbo=true to my project.properties.
This is assuming you are running ADT 21 as this feature wasn't available in previous versions.

http://stackoverflow.com/questions/13439882/android-error-in-eclipse-unable-to-execute-dex-cannot-merge-new-index-65799-i

2014年10月28日 星期二

ubuntu 12.04 fix tooltips dark problem

problem like:
http://askubuntu.com/questions/70599/how-to-change-tooltip-background-color-in-unity

1. install GNOME Color Chooser
2. edit shortcut(link)

http://blog.vogella.com/2012/12/04/eclipse-papercut-10-eclipse-on-ubuntu-fixing-the-black-background-color-in-hover/

FIX ECLIPSE (LUNA) DISPLAY ON UBUNTU 14.04

http://www.kaibader.de/fix-eclipse-luna-display-on-ubuntu-14-04/





In case of starting Eclipse from a console two environment variables need to be set in advance  to avoid a corrupted Eclipse window:
export SWT_GTK3=0
export UBUNTU_MENUPROXY=0
In my case I created a desktop entry~/.local/share/applications/eclipse.desktop to facilitate the startup. Adapt it to your needs:
[Desktop Entry]
Version=4.4
Name=Eclipse
Comment=Eclipse IDE
Exec=env UBUNTU_MENUPROXY=0 SWT_GTK3=0 /home/kai/eclipse/eclipse
Icon=/home/kai/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=Utility;Application

2014年8月28日 星期四

repo error: syntax error near unexpected token `newline' repo problem

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo


執行 repo init -u git://android.googlesource.com/platform/manifest.git 可能會出現下面的錯誤

~/bin/repo: line 1: syntax error near unexpected token `newline'
~/bin/repo: line 1: `<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

可能是下載的 repo 壞掉了。從官方下載的 repo 檔案可能壞掉了,只要重新下載一次就好了。


curl http://git-repo.googlecode.com/files/repo-1.13 > ~/bin/repo


[1]http://blog.csdn.net/kai46385076/article/details/17460563


Update(2016/06/22)
有另一種可能是要將 https 改為 http

REPO_URL='https://gerrit.googlesource.com/git-repo'
改為
REPO_URL='http://gerrit.googlesource.com/git-repo'

2014年7月14日 星期一

解決 Windows 7 啟動時撥號 PPPoE 無效 (使用rasdial)

如果我們想在 Windows 7 開機後想直接撥號 PPPoE 連線,網路上有些教學是將捷徑放到啟動的資料夾內以便啟動
但不曉得為什麼我的就是沒辦法這麼做
首先將連線的「提示名稱」該項取消打勾,再放入啟動的資料夾
如下圖:


結果發現命令是「空的」



難怪怎麼開機都無法自動執行!

於是這裡提供另一個方法

編輯一個新的純文字檔並將它隨意命名,只要副檔名是 .bat 即可

內容如下:

rasdial.exe "你的連線名稱" "帳號" "密碼"


再將這個*.bat放置到

C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ 下即可



2014年6月30日 星期一

Convert Hex to Unicode String by Java SDK or python

If there is a file include charsequence such like: \u53f0\u7063 and how to convert it to Unicode? There are two ways to achieve this requirement: Python and Java SDK 1.Java SDK: ref this link: http://blog.xuite.net/jameschih/java/5089783 use the java sdk tool in the bin folder native2ascii -reverse src.txt dist.txt then "\u53f0\u7063" convert to "台灣" on the other hand you can convert unicode string to hex native2ascii src.txt dist.txt ======================================================================== 2.Python ref: http://stackoverflow.com/questions/447107/what-is-the-difference-between-encode-decode print u'\\u53f0\\u7063'.decode('unicode-escape') then output 台灣

2014年6月19日 星期四

Make the TAB be 4 character instead 8 character in Nano.

NANO is a common plain text editor in Linux.

When we edit Python code, the default TAB is 8 character(space).

How to make it to be 4 character(space)?

Create/Edit the file ~/.nanorc and Save it


set tabsize 4
set tabstospaces

由於最近在 Linux 中開發 Python,使用 Nano 預設的 TAB 是8個空白,因此要將它修改為4個空白。

簡的地說就是編輯 ~/.nanorc 這個檔案,並修改成上述內容

2014年6月17日 星期二

When occur Unable to resolve target 'android-xx' error

It's often occurs this error when we developed on different Eclipse ( or Android SDK Manager)

refer to the stackoverflow:

Android error in eclipse: Unable to resolve target 'android-xx'


and 


Download the target SDK in Android SDK Manager can resolve this problem. 

簡單而言是因為使用不同的 SDK 版本或是 SDK Manager 裡沒裝對應的 SDK 導致,重新安裝對應的版本後再 Clean Project ( Eclipse > Project > Clean...)即可。