-
关于eclipse和IDEA的工程管理
一直对eclipse的工程管理有些看法,觉得在这方面idea做得更好。
首先其实我认为将project作为最小单位来管理就是个悲剧,idea里,最小的管理单元是module,新建project时可以建立默认的module,这应当是更符合现实场景的。
在实际的稍大些的项目里,可能会有很多类型不同的“工程”,比如java“工程”、web“工程”,在eclipse里要想统一管理,初级的做法是使用独立的workspace来和其他项目的“工程”隔离开,但似乎working set似乎是一个更好的选择。而在idea里,项目的概念完全被project接管,而在eclipse里所谓的不同类型的工程则全部作为idea里project的module。
综上,如果是eclipse,则建议使用working set,在视觉上提高工程管理质量,如果是idea,则自然就从本质上享受高质量的工程管理了~
-
JNI初探
终于有机会必须写点JNI的代码了,不过目前只是在凑一个Demo,所以里面的逻辑相当简单。这里先谈下大致的步骤,最后再谈一下遇到的问题。
首先编写Java类,比如我们需要一个类FaceAuth,它要实现一个字符串比较的功能,当然这里要声明为native的:
1 2 3 4 5 6 7 8 9
public class FaceAuth { static { System.loadLibrary("face"); } public static native float compareFace(String face, String sample); }
-
Golang玩家的Emacs配置
虽然自golang一发布便关注起来,但前阵子才算稍微认真地玩了玩golang,最终我选择了Emacs作为editor,用起来蛮习惯。这里附上我的.emacs配置,备份一下。用了几个不错的插件,很多配置都是针对我的个人习惯,仅供参考。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
;;golang mode (add-to-list 'load-path "~/.emacs.d/plugins/go-mode") (require 'go-mode) (require 'go-mode-load) ;;linum (add-to-list 'load-path "~/.emacs.d/plugins/linum") (require 'linum) (global-linum-mode) ;;color theme (add-to-list 'load-path "~/.emacs.d/plugins/color-theme") (require 'color-theme) (eval-after-load "color-theme" '(progn (color-theme-initialize) (color-theme-deep-blue))) ;;yasnippet (add-to-list 'load-path "~/.emacs.d/plugins/yasnippet") (require 'yasnippet) (yas/initialize) (yas/load-directory "~/.emacs.d/plugins/yasnippet/snippets") ;;auto complete (add-to-list 'load-path "~/.emacs.d/plugins/auto-complete") (add-to-list 'load-path "~/.emacs.d/plugins/gocode/emacs") (require 'auto-complete) (require 'go-autocomplete) (require 'auto-complete-config) (ac-config-default) (add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/auto-complete/dict") ;;tab width (setq default-tab-width 4) (setq tab-width 4) ;;custom shortcut (global-set-key [f1] 'shell);F1进入Shell ;;(global-set-key [C-return] 'kill-this-buffer);C-return关闭当前buffer !too dangerous (global-set-key [f11] 'my-fullscreen);F12 全屏 ;;(global-set-key (kbd "C-,") 'backward-page);文件首 ;;(global-set-key (kbd "C-.") 'forward-page);文件尾 ;;normal setting (auto-image-file-mode t);打开图片显示功能 (fset 'yes-or-no-p 'y-or-n-p);以 y/n代表 yes/no (tool-bar-mode nil);disable toolbar (menu-bar-mode nil);disable menubar (column-number-mode t);显示列号 (show-paren-mode t);显示括号匹配 (display-time-mode 1);显示时间,格式如下 (setq display-time-24hr-format t) (setq display-time-day-and-date t) (setq x-select-enable-clipboard t);支持emacs和外部程序的粘贴 (setq frame-title-format '("" buffer-file-name "@emacs" ));在标题栏显示buffer名称 (scroll-bar-mode nil);;disable scrollbar ;;(setq default-fill-column 80);默认显示 80列就换行 ;全屏 (defun my-fullscreen () (interactive) (x-send-client-message nil 0 nil "_NET_WM_STATE" 32 '(2 "_NET_WM_STATE_FULLSCREEN" 0))) ;最大化 (defun my-maximized-horz () (interactive) (x-send-client-message nil 0 nil "_NET_WM_STATE" 32 '(1 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))) (defun my-maximized-vert () (interactive) (x-send-client-message nil 0 nil "_NET_WM_STATE" 32 '(1 "_NET_WM_STATE_MAXIMIZED_VERT" 0))) (defun my-maximized () (interactive) (x-send-client-message nil 0 nil "_NET_WM_STATE" 32 '(1 "_NET_WM_STATE_MAXIMIZED_HORZ" 0)) (interactive) (x-send-client-message nil 0 nil "_NET_WM_STATE" 32 '(1 "_NET_WM_STATE_MAXIMIZED_VERT" 0))) (my-maximized);;fullscreen when starts
-
Subversion Native Library Not Available Error
-
VIM中文文档配置
虽然平时一直用各种英文系统,但有时也需要看看中文文档。Vi便是如此。
在http://vimcdoc.sf.net/可以下载到最新的中文文档,然后
1
tar xf vimcdoc.xxx.tar.gz;cd vimcdoc.xxx
如果你想默认使用英文,那么
1
sudo sh vimcdoc.sh -I
此时如果需要中文可以set helplang=cn,或者:help some_tag@cn
具体的安装步骤参阅:
-
Hello!