1.
build/core/combo/HOST_linux-x86.mk
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
2.
external/oprofile/libpp/format_output.h
-mutable counts_t & counts;
+counts_t & counts;
3.
external/gtest/src/../include/gtest/internal/gtest-param-util.h
+#include <cstddef>
4.
external/llvm/llvm-host-build.mk
+LOCAL_LDLIBS := -lpthread -ldl
5.
frameworks/compile/slang/Android.mk
-local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
+local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
6.
external/mesa3d/src/glsl/linker.cpp
+#include <cstddef>
7.
build/core/definitions.mk
-$(if $(findstring windows,$(HOST_OS)),,-JXms16M -JXmx1536M) \
+$(if $(findstring windows,$(HOST_OS)),,-JXms16M -JXmx2048M) \
參考資料:
http://hcleon.iteye.com/blog/1461352
2012年11月30日 星期五
2012年11月29日 星期四
2012年11月28日 星期三
從Win7讀取ext4
在Windows上讀取Linux partition一直是一件麻煩的事,尤其大部分的utility對ext4的支援都不好。試了幾個工具,例如Explore2fs,Ext2Read,Ext2Fsd都不能正確讀出資料。最後終於讓我找到了DiskInternals Linux Reader這個可以正常工作的小程式。
移除舊kernel
$ uname -r
找出現在使用中的kernel
$ dpkg --list | grep linux-image
列出所有kernel
找出現在使用中的kernel
$ dpkg --list | grep linux-image
列出所有kernel
$ sudo apt-get purge linux-image-3.2.0-23-generic
移除第一個
$ sudo update-grub2
更新開機grub2
參考資源:
2012年11月23日 星期五
打開Compiz cube旋轉的功能
安裝Compiz Config Setting Manager
$ sudo apt-get install ccsm
勾選桌面立方體 (Enable Desktop Cube)
勾選旋轉立方體 (Enable Rotate Cube)
Disable Desktop Wall
在Rotate Cube裡的zoom改成0.7
在General Options裡Desktop Size改成Horizontal:4, Vertical: 1
然後Ctrl-Alt-right就可以開始旋轉了
參考資料:
http://www.ghacks.net/2009/05/25/enabling-the-cube-in-compiz/
http://www.omgubuntu.co.uk/2011/04/compiz-cube-natty
$ sudo apt-get install ccsm
勾選桌面立方體 (Enable Desktop Cube)
勾選旋轉立方體 (Enable Rotate Cube)
Disable Desktop Wall
在Rotate Cube裡的zoom改成0.7
在General Options裡Desktop Size改成Horizontal:4, Vertical: 1
然後Ctrl-Alt-right就可以開始旋轉了
參考資料:
http://www.ghacks.net/2009/05/25/enabling-the-cube-in-compiz/
http://www.omgubuntu.co.uk/2011/04/compiz-cube-natty
2012年11月21日 星期三
git使用外部diff tool
以使用meld作為git的diff tool為例:
$ sudo apt-get install meld
$ sudo gvim /bin/meld-diff.sh
$ sudo chmod +x /bin/meld-diff.sh
$ git config --global diff.external meld-diff.sh
$ git config --global merge.tool meld
參考資料:
How do I view 'git diff' output with a visual diff program?
How to: Meld for Git diffs in Ubuntu Hardy
$ sudo apt-get install meld
$ sudo gvim /bin/meld-diff.sh
$ sudo chmod +x /bin/meld-diff.sh
$ git config --global diff.external meld-diff.sh
1 #!/bin/sh 2 meld $2 $5$ git config --global diff.external /bin/meld-diff.sh
$ git config --global merge.tool meld
參考資料:
How do I view 'git diff' output with a visual diff program?
How to: Meld for Git diffs in Ubuntu Hardy
2012年11月20日 星期二
ibu-chewing 新酷音打字時被清空
在ibus-chewing打字時,如果超過四個字沒有flush時,就會消失
解決方法:
$ apt-get install gconf-editor gconf-defaults-service
$ gconf-editor
把/desktop/ibus/engine/Chewing/maxChiSymbolLen 改成30
然後登出再登入
參考資料:
1. ibus-chewing 新酷音輸入法選字數目太少的解決方式
2. http://koukaipan.pixnet.net/blog/post/28238383-%5B%E8%A7%A3%E6%B1%BA%5D-ubuntu-12.04-%E6%96%B0%E9%85%B7%E9%9F%B3%E6%96%87%E5%AD%97%E7%B7%A9%E8%A1%9D%E5%8D%80%E5%8F%AA%E6%9C%893%E5%80%8B%E5%AD%974
解決方法:
$ apt-get install gconf-editor gconf-defaults-service
$ gconf-editor
把/desktop/ibus/engine/Chewing/maxChiSymbolLen 改成30
然後登出再登入
參考資料:
1. ibus-chewing 新酷音輸入法選字數目太少的解決方式
2. http://koukaipan.pixnet.net/blog/post/28238383-%5B%E8%A7%A3%E6%B1%BA%5D-ubuntu-12.04-%E6%96%B0%E9%85%B7%E9%9F%B3%E6%96%87%E5%AD%97%E7%B7%A9%E8%A1%9D%E5%8D%80%E5%8F%AA%E6%9C%893%E5%80%8B%E5%AD%974
wine找不到gnome-keyring-pkcs11.so
解決的方法是:
$ wget https://launchpad.net/~jcollins/+archive/jaminppa/+build/1482994/+files/getlibs_2.06-0ubuntu1%7Eppa2_all.deb
$ sudo dpkg -i getlibs_2.06-0ubuntu1~ppa2_all.deb
$ sudo getlibs -p gnome-keyring:i386
$ sudo mkdir -p /usr/lib/i386-linux-gnu/pkcs11/
$ sudo ln -s /usr/lib32/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so
參考資料:
http://askubuntu.com/questions/127848/wine-cant-find-gnome-keyring-pkcs11-so
$ wget https://launchpad.net/~jcollins/+archive/jaminppa/+build/1482994/+files/getlibs_2.06-0ubuntu1%7Eppa2_all.deb
$ sudo dpkg -i getlibs_2.06-0ubuntu1~ppa2_all.deb
$ sudo getlibs -p gnome-keyring:i386
$ sudo mkdir -p /usr/lib/i386-linux-gnu/pkcs11/
$ sudo ln -s /usr/lib32/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so
參考資料:
http://askubuntu.com/questions/127848/wine-cant-find-gnome-keyring-pkcs11-so
2012年11月19日 星期一
Flashplayer的畫面偏藍
在Firefox裡flash player的畫面會偏藍的問題
解決的方法如下
$ sudo add-apt-repository ppa:tikhonov/misc
$ sudo apt-get update
$ sudo apt-get install libvdpau1
據說是flash player的問題
參考資料:
Flash video appears blue
解決的方法如下
$ sudo add-apt-repository ppa:tikhonov/misc
$ sudo apt-get update
$ sudo apt-get install libvdpau1
據說是flash player的問題
參考資料:
Flash video appears blue
Using git with Vim
把github上檔案抓到local端
由於我只需要最新的版本所以
$ git clone git://github.com/motemen/git-vim.git --depth=1
然後
$ cd git-vim
$ cp -r plugin syntax doc ~/.vim/
在.vimrc裡加入下列
set laststatus=2
set statusline=%{GitBranch()}
參考資源:
1. Using Git with Vim
2. 在Vim中使用Git
由於我只需要最新的版本所以
$ git clone git://github.com/motemen/git-vim.git --depth=1
然後
$ cd git-vim
$ cp -r plugin syntax doc ~/.vim/
在.vimrc裡加入下列
set laststatus=2
set statusline=%{GitBranch()}
參考資源:
1. Using Git with Vim
2. 在Vim中使用Git
更換Ubuntu預設的Server
http://tw.archive.ubuntu.com經常會連不上
這時候可以經由
$ sudo /usr/bin/software-properties-gtk
更改預設的apt server
參考資源:
Ubuntu Linux 挑選最佳的 Mirror Site (APT Repository)
這時候可以經由
$ sudo /usr/bin/software-properties-gtk
更改預設的apt server
參考資源:
Ubuntu Linux 挑選最佳的 Mirror Site (APT Repository)
2012年11月16日 星期五
2012年11月12日 星期一
簡單的ctags/cscope/gtags script
1 #!/bin/bash 2 c=false 3 C=false 4 java=false 5 function usage 6 { 7 cat << EOF 8 usage: $0 options 9 This script generate tag files for C, C++ and JAVA files. 10 OPTIONS: 11 -h Show this message 12 -c generate tags for C files 13 -C generate tags for C++ files 14 -j generate tags for JAVA files 15 EOF 16 } 17 18 if [ $# = 0 ] 19 then 20 usage 21 fi 22 23 while getopts "hcCj" opt; 24 do 25 case "$opt" in 26 c) c=true 27 ;; 28 C) C=true 29 ;; 30 j) java=true 31 ;; 32 h) usage 33 exit 34 ;; 35 *) echo 1>&2; 36 usage 37 exit 1 38 ;; 39 esac 40 done 41 42 if [ $c = true ] 43 then 44 rm c.tags 45 rm c.cscope* 46 find . -name .svn -prune -o -name .repo -prune -o -name .git -prune -o ! -type l -type f -name '*.c' -o ! -type l -name '*.h' > c_files 47 ctags -f c.tags -L c_files & 48 cscope -bkq -i c_files -f c.cscope & 49 fi 50 if [ $C = true ] 51 then 52 rm cc.tags 53 rm cc.cscope* 54 find . -name .svn -prune -o -name .repo -prune -o -name .git -prune -o ! -type l -type f -name '*.cc' -o ! -type l -name '*.cpp' > cc_files 55 ctags -f cc.tags -L cc_files & 56 cscope -bkq -i cc_files -f cc.cscope & 57 fi 58 59 if [ $java = true ] 60 then 61 rm java.tags 62 rm java.cscope* 63 find . -name .svn -prune -o -name .repo -prune -o -name .git -prune -o ! -type l -type f -name "*.java" > java_files 64 ctags -f java.tags -L java_files & 65 cscope -bkq -i java_files -f java.cscope & 66 fi 67 68 cat c_files > all_files 69 cat cc_files >> all_files 70 cat java_files >> all_files 71 gtags -f all_files & 72 for job in `jobs -p` 73 do 74 wait $job 75 done 76 echo "TAGS GENERATED" 77
2012年11月8日 星期四
gVim 在Ubuntu12.04的問題
在Ubuntu 12.04裡,如果用terminal啟動gVim,GUI在initialization的時候會卡住無法執行,據說這是gtk的bug,所以不論是vim-gnome或vim-gtk都有這個問題
現在有一個簡單的workaround就是開啟時使用gvim -f&,這樣當gVim開啟時就不會自動fork一個shell
參考資料:
http://www.ch-linghu.me/blog/entry/324
https://gist.github.com/2576464
現在有一個簡單的workaround就是開啟時使用gvim -f&,這樣當gVim開啟時就不會自動fork一個shell
參考資料:
http://www.ch-linghu.me/blog/entry/324
https://gist.github.com/2576464
移除Ubuntu裡的訪客帳號
Ubuntu加了一個很莫名其妙的功能
那就是讓訪客不用密碼就可以登錄你的電腦
我想不出任何一個理由需要這種功能
還好取消的方法很簡單只要
$ gksudo gedit /etc/lightdm/lightdm.conf
然後在lightdm.conf裡輸入
allow-guest=false
然後
$ sudo restart lightdm
後就行了
那就是讓訪客不用密碼就可以登錄你的電腦
我想不出任何一個理由需要這種功能
還好取消的方法很簡單只要
$ gksudo gedit /etc/lightdm/lightdm.conf
然後在lightdm.conf裡輸入
allow-guest=false
然後
$ sudo restart lightdm
後就行了
simple .vimrc
1 set number 2 set showcmd 3 set showmatch 4 set hlsearch 5 set incsearch 6 syntax on 7 filetype indent on 8 filetype plugin on "~/.vim/syntax "omni-complete ~/.vim/autoload ^x^n 9 colors koehler 10 set sw=2 11 set ts=2 12 set smarttab 13 set sidescroll=1 14 set guifont=Inconsolata\ Medium\ 16 15 set guifontwide=YaHei\ Mono\ 16 16 set laststatus=2 17 set statusline=%F%m%r%h%w\ [%{&ff}]\ [%Y]\ [%{(&fenc==\"\")?&enc:&fenc}%{(&bomb?\",BOM\":\"\")}]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]\ %=[%{GitBranch()}] 18 set backspace=2 19 set clipboard=unnamed 20 set autoindent 21 set smartindent 22 set cindent 23 "set spell 24 set encoding=utf-8 25 set tags=java.tags,c.tags 26 set makeprg= 27 set smartcase 28 set ruler 29 set cursorline 30 "set cursorcolumn 31 set fileencodings=ucs-bom,utf-8,big5,euc-jp,cp936,gb18030,euc-kr,latin1 32 autocmd BufNewFile,BufRead *.mip :set syntax=mips 33 autocmd BufNewFile,BufRead *.S :set syntax=mips 34 set langmenu=zh_TW.UTF-8 35 source $VIMRUNTIME/delmenu.vim 36 source $VIMRUNTIME/menu.vim 37 language messages zh_TW.utf-8 38 39 let g:LargeFile=10 40 "let g:p4ClientRoot = 'd:/workspace/' 41 "let g:p4EnableActiveStatus = 0 42 "let g:p4Presets = 'P4CONFIG' 43 "let g:p4DefaultPreset = 0 44 "let loaded_perforce = 1 45 "let Grep_Path='c:/GnuWin32/bin/grep.exe' 46 "let Grep_Find_Path='c:/GnuWin32/bin/find.exe' 47 "let Grep_Xargs_Path='c:/GnuWin32/bin/xargs.exe' 48 "let Grep_Skip_Files = '*.bak *~ *.cscope *.tags *.o' 49 "let VCSCommandSVNDiffExt='C:/"Program Files"/KDiff3/kdiff3.exe' 50 cs a java.cscope . -C 51 cs a c.cscope . -C 52 "let g:EclimTaglistEnabled=0 53 set csto=1 " this flag decides the order of ctags and cscope 54 set csprg=gtags-cscope " use fake cscope 55 cs a GTAGS . -C-->
更改Ubuntu預設的名稱
1 #!/bin/bash 2 mv 下載 download 3 mv 公共 publicshare 4 mv 桌面 desktop 5 mv 圖片 pictures 6 mv 模板 templates 7 mv 音樂 music 8 mv 文件 documents 9 mv 影片 videos 10 vim ~/.config/user-dirs.dirs 11 XDG_DESKTOP_DIR="$HOME/desktop" 12 XDG_DOWNLOAD_DIR="$HOME/download" 13 XDG_TEMPLATES_DIR="$HOME/templates" 14 XDG_PUBLICSHARE_DIR="$HOME/publicshare" 15 XDG_DOCUMENTS_DIR="$HOME/documents" 16 XDG_MUSIC_DIR="$HOME/music" 17 XDG_PICTURES_DIR="$HOME/pictures" 18 XDG_VIDEOS_DIR="$HOME/videos"
2012年11月7日 星期三
gVim字型
我現在看到最適合用來Programming的字型就屬Incosolata了
至於顯示中文而言,在Vim裡最好的就是MS的雅黑體了,但Vim不接受非Mono的字體,其實即使是非Mono的字體Vim也會自行將間距拉齊。所以只要修改font的資訊讓Vim誤認為Mono字體就可以使用了
在gVim裡,set guifont是用來顯示單字元字體而set guifontwide則是用來顯示多字元字體,所以我們可以將guifont設成Incosolata而guifontwide設成Yahei Mono
例如:
至於顯示中文而言,在Vim裡最好的就是MS的雅黑體了,但Vim不接受非Mono的字體,其實即使是非Mono的字體Vim也會自行將間距拉齊。所以只要修改font的資訊讓Vim誤認為Mono字體就可以使用了
在gVim裡,set guifont是用來顯示單字元字體而set guifontwide則是用來顯示多字元字體,所以我們可以將guifont設成Incosolata而guifontwide設成Yahei Mono
例如:
1 set guifont=Inconsolata\ Medium\ 16 2 set guifontwide=YaHei\ Mono\ 16 3
2012年11月5日 星期一
android basics
$ android avd //open virtual device manager
產生build.xml for ant
Buildfile: build.xml does not exist!
$ android update project -p . //create build.xml for ant
$ android list target //列出已安裝的target
$ android update project -n MyProjectName --target 5 --path .
import 既有的project to Eclipse
import-->General-->Existing Projects into Workspace //指到 project root
$ adb install [-r] [apk] //install apk file
dependencies 的jar file必須放在lib folder裡
system image在android-14以後移到/android-sdk-linux/system-images/armeabi-v7a/system.img
在android-14之前被放在/android-sdk-linux/platforms/android-13/images/system.img
產生build.xml for ant
Buildfile: build.xml does not exist!
$ android update project -p . //create build.xml for ant
$ android list target //列出已安裝的target
$ android update project -n MyProjectName --target 5 --path .
import 既有的project to Eclipse
import-->General-->Existing Projects into Workspace //指到 project root
$ adb install [-r] [apk] //install apk file
dependencies 的jar file必須放在lib folder裡
system image在android-14以後移到/android-sdk-linux/system-images/armeabi-v7a/system.img
在android-14之前被放在/android-sdk-linux/platforms/android-13/images/system.img
2012年11月1日 星期四
eclim ( vim + eclipse )
eclim 可以將gvim與eclipse整合在一起,是一套能夠使用Eclipse強大功能,並且使習慣用Vim編輯的人必備的工具
安裝概要:
Prerequisite:
1. JDK 1.6+
2. gVim7+
3. Eclipse 4.2x
$ java -jar eclim_2.2.3.jar
Window ‣ Show View ‣ Other ‣ Eclim ‣ eclimd
elcim 的模式:
1. headless mode
在這個模式下eclim將eclipse當成一個backend server來使用,所有在vim下的指令都會回傳給eclipse來處理
優點: 非常vim-like
缺點: 需要記憶許多eclim的指令,且無法利用到許多eclipse的功能
2. headed mode
在headless mode中由於eclimd會將eclipse的workspace lock起來,所以無法再將eclipse 的gui打開, 而headed mode裡,由於eclimd是經由eclipse啟動的所以不會有這個問題
Window->Show View->Others->Eclim->eclimd
只需要將eclimd的window關閉就可以將eclim server hang up
優點: vim-like,且可以使用eclipse的功能
缺點:需要在不同視窗間切換
3. embedded gvim mode
這個模式是藉由vim-plugin將gvim整合進入eclipse成為內部的editor. 需要安裝gvim 7.1以上的版本,由於是使用gtk2所以不支援MacOS
可以在Window->Preference->Vimplugin裡更改設定
然後在Package Explorer裡右鍵點選Open With Vim就會以gvim開啟文件
http://eclim.org/eclimd.html#gvim-embedded
優點: Compromise的solution
缺點:經常需要使用到滑鼠
常用命令:
:ProjectList //show active projects
:ProjectOpen xxx //open project
:ProjectCD //cd to project
:ProjectTree xxx //show project tree
<Ctrl-X><Ctrl-U> //omni completion
:JavaSearch -p <pattern> [-t <type> -x <context> -s <scope> -i] // pattern searching
:%JavaFormat // source code formatting
:JavaImpl // show all overridable methods
:Ant debug install //build debug version and install it on simulator
參考資料:
http://eclim.org/
安裝概要:
Prerequisite:
1. JDK 1.6+
2. gVim7+
3. Eclipse 4.2x
$ java -jar eclim_2.2.3.jar
Window ‣ Show View ‣ Other ‣ Eclim ‣ eclimd
elcim 的模式:
1. headless mode
在這個模式下eclim將eclipse當成一個backend server來使用,所有在vim下的指令都會回傳給eclipse來處理
優點: 非常vim-like
缺點: 需要記憶許多eclim的指令,且無法利用到許多eclipse的功能
2. headed mode
在headless mode中由於eclimd會將eclipse的workspace lock起來,所以無法再將eclipse 的gui打開, 而headed mode裡,由於eclimd是經由eclipse啟動的所以不會有這個問題
Window->Show View->Others->Eclim->eclimd
只需要將eclimd的window關閉就可以將eclim server hang up
優點: vim-like,且可以使用eclipse的功能
缺點:需要在不同視窗間切換
3. embedded gvim mode
這個模式是藉由vim-plugin將gvim整合進入eclipse成為內部的editor. 需要安裝gvim 7.1以上的版本,由於是使用gtk2所以不支援MacOS
可以在Window->Preference->Vimplugin裡更改設定
然後在Package Explorer裡右鍵點選Open With Vim就會以gvim開啟文件
http://eclim.org/eclimd.html#gvim-embedded
優點: Compromise的solution
缺點:經常需要使用到滑鼠
常用命令:
:ProjectList //show active projects
:ProjectOpen xxx //open project
:ProjectCD //cd to project
:ProjectTree xxx //show project tree
<Ctrl-X><Ctrl-U> //omni completion
:JavaSearch -p <pattern> [-t <type> -x <context> -s <scope> -i] // pattern searching
:%JavaFormat // source code formatting
:JavaImpl // show all overridable methods
:Ant debug install //build debug version and install it on simulator
參考資料:
http://eclim.org/
訂閱:
文章 (Atom)