Paul - The Programmer

simple & stupid

Replace tab with space in VIM

To remove the annoying tab space in the code:

%s/^I/    /g

# ^I  means input Ctrl+v  then input Tab.

List files in tar.gz file

1)  zcat  your_file.tar.gz  | tar --list

2)  tar -ztvf  your_file.tar.gz

Always debug seriously

When something unexpected happens:

  • Read the code carefully.
  • In patient.
  • Never assume anything.
  • Follow the code step by step.
  • Watch the variates change.
  • Run code in debug enviorement.  Print function is far to sufficient.

Help yourself first!

Proxy server with multiplexing socket by select function

Performance is not so good as forking server. Remote address connecting is a time consuming action and blocks the main operating loop. The good of select function is to avoid spawning a bunch of child processes. Did not try the non-block model socket with select function. Since the non-block model socket seems not be well supported by ActivePerl on Win32. Maybe the performance will be better. At least, the conneting action won't block main loop. But still brings a little complication.

merge code with vimdiff

#update difference

:diffupdate

# merge difference from another buffer to current buffer

:diffget                

do

#merge difference from current buffer to another buffer

:diffput

dp