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...)即可。


2014年6月5日 星期四

如何保持 PuTTY 的字型與顏色設定

在使用 PuTTY 時,常常會依個人喜好修改字基大小與顏色變化,但在關掉該 Session 後這些設定就消失了,有辦法固定(記憶)住這次的設定並在下次開啟時繼續嗎?

答案是有的。

1. 首先打開 PuTTY 的設定


2. 選擇 Change Setting


在左側 Colors 修改你要的字型大小、顏色、視窗大小…等後,在 Session 標籤中選擇你要存的目標 Session,然後再按 Save 存檔。

這樣下次再開該 Session 時就會套用你的設定。

當然,也可以將設定寫入 Default Setting 。

2014年1月27日 星期一

How To Solve The Link Fatal Error lnk1201 error writing to program database pdb

When Visual Studio 2003 run on Window 7, it occur the following error every time when compile finish:

 Link Fatal error lnk1201 error writing to program database
After survey the solutions on internet,  all the problems point to it's a bug to Visual Studio 2003 on Windows 7. Windows 7 did not delete the .pdb after compile finish last time. You might disable the pdb debugger feature to fix this issue, but it is stupid. All the things we should do is free the file .pdb manually.

Unlocker.exe "$(TargetDir)$(ProjectName).pdb" /S