Nov 17, 2011

Goodbye Firefox!!!

Firefox was a good browser. However, the newer versions of Firefox have very poor compatibility with existing extensions. I am tired of finding new extensions for every new update. New technologies should help us finish our tasks efficiently, instead of giving us more tasks to do.

My #1 candidate for browser is Google Chrome. It is fast, stable and has the replacements for all of  my current Firefox extensions. Good job Google!

Jul 11, 2011

A Sleep function for VIM

I need to let VIM wait for cscope.exe to rebuild the tag file, but there are no build-in sleep function for VIM, so I made one here:

"a sleep function which allows vim to wait for the other processes to finish
com! -complete=command -nargs=+ Sleep call s:Sleep(<q-args>)
fun! s:Sleep(millisec)
  let ct = localtime()
  let dt = 0
  while dt < (a:millisec/1000)
    let dt = localtime() - ct
  endwhile
endfun

Just put it into your _vimrc.
To invoke it, type ":Sleep 10000" to let VIM wait for 10 secs.

Apr 1, 2011

igoogle gadget malfunction

After my firefox is upgraded to 3.6.16, the igoogle compound gadget suddenly disappears, and all of my gadget spreads all over my igoogle homepage. I tried to add it back, but the system says "The Compound gadget is no longer supported and the individual gadgets that it contained have been added to your iGoogle page."

Solution: delete all cookies in my firefox.

Nov 20, 2010

Ubuntu notes

Install GVIM: sudo apt-get install gnome-vim
Install boost: sudo apt-get install libboost*

Link a boost library: g++ -lboost_filesystem
Location of boost header: /usr/include
Location of boost lib: /usr/lib

Modify "autoexec.bat": sudo vim /etc/profile
Modify environment variable: export RCSSBASEDIR=/home/username/rcss

Remove resource limitation: ulimit -s unlimited

Aug 5, 2010

Draw confusion matrix in Matlab

Generate confusion matrix in Matlab:
data = rand(10, 10)
imagesc(data)
colormap(gray)
colorbar

Result:

Jun 25, 2010

My neocomplcache setting

As requested, here is my .vimrc setting for neocomplcache.
Beware that the following setting works only for "ver.5" branch.
You have to check it out from github.

"------------------------------neocomplcache---------------------------------------

" Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1
" Use smartcase.
let g:neocomplcache_enable_smart_case = 1
" Use camel case completion.
let g:neocomplcache_enable_camel_case_completion = 1
" Use underbar completion.
let g:neocomplcache_enable_underbar_completion = 1

let g:neocomplcache_auto_completion_start_length = 3
let g:neocomplcache_manual_completion_start_length = 3
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'

" Define keyword.
if !exists('g:neocomplcache_keyword_patterns')
    let g:neocomplcache_keyword_patterns = {}
endif
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'

" snippets expand key
imap  <silent><expr><TAB>  neocomplcache#plugin#snippets_complete#expandable() ? "\<Plug>(neocomplcache_snippets_expand)" : (pumvisible() ? "\<C-e>" : "\<TAB>")
"imap  <silent><expr><TAB>  neocomplcache#plugin#snippets_complete#expandable() ? "\<Plug>(neocomplcache_snippets_expand)" : "\<C-e>"
smap  <TAB>  <RIGHT><Plug>(neocomplcache_snippets_jump)
inoremap <expr><C-e>     neocomplcache#complete_common_string()

Jun 17, 2010

SuperTab complete for neocomplcache

As I said in my previous post, neocomplcache is a very powerful vim plugin.
It incoporates the funtionality of SnipMate and  AutoComplPop while providing efficient search
for potential completion items.

However, SuperTab does not support neocomplcache. It is very bad since I like to tab complete
everything, including snippets. Here is the solution -- put the following in you .vimrc:

imap  <silent><expr><tab>  neocomplcache#sources#snippets_complete#expandable() ? "\<plug>(neocomplcache_snippets_expand)" : (pumvisible() ? "\<c-e>" : "\<tab>")
smap  <tab>  <right><plug>(neocomplcache_snippets_jump) 
inoremap <expr><c-e>     neocomplcache#complete_common_string()

The above setting allows you to trigger a snippet with "tab" key when possible. If not, it will simply trigger omni completion. I set it to complete the longest common string. It is just a personal taste. You can set it to other type of completion as well.

*Update 2010/12/11 for necomplcache V5.2 compatiblity
*Update 2012/04/24 for necomplcache V7 compatiblity

 
TEMPLATE HACKS AND TWEAKS BY [ METAMUSE ] BLACKCAT 1.1
/scripts/shBrushJScript.js'/>