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

May 20, 2010

Access Windows XP files from Windows 7

I spent 4 hours today to figure out how to enable the file sharing of Windows XP.
The key difficulty is that there are too many possible reasons to make the file sharing stop working.
Microsoft should make it easier for such a common task.

Basically, all you need is to follow the instruction from
http://www.crn.com/white-box/59200376


1. To enable the network Guest account on XP Home and Pro, click Start, click Run, type: net user guest /active:yes, and hit Enter.
2. Ensure there is no password for the Guest account: click Start, click Run, type: control userpasswords2, and hit Enter. Click once on Guest, click Reset Password, and then click OK without entering a new password.
3. Be aware that Windows XP, when installed on an NTFS disk partition and using simple file sharing, blocks network access to the Program Files and Windows directories as well as users folders within the Documents and Settings directory. This behavior is by design.
4. There are two registry keys to check on XP that have the potential to cause network headaches. The first is: HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/Lsa
5. Ensure that restrictanonymous is set to 0. Ignore the restrictanonymoussam entry that looks similar and may also appear.
6. Older versions of Norton Anti-Virus set a value for IRPStacksize in the registry that is too low for XP. In fact, XP doesn't even need this registry key. If you have it in your registry, thank Symantec (NSDQ:SYMC) and then delete it. If you determine that the XP registry has this unneeded entry, check this registry location:
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Lanmanserver/Parameters. You can read more about this issue from Symantec and Microsoft.


Basically, all you need is to follow the instruction from
But it is not enough. You also need to turn "simple file sharing" on.

from http://support.microsoft.com/?scid=kb;en-us;304040&x=5&y=10
To turn Simple File Sharing on or off in Windows XP Professional, follow these steps:

  1. Double-click My Computer on the desktop.
  2. On the Tools menu, click Folder Options.
  3. Click the View tab, and then select the Use Simple File Sharing (Recommended)check box to turn on Simple File Sharing. (Clear this check box to turn off this feature.)

Mar 14, 2010

Why does nobody understand my work?


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