Tuesday, February 05, 2008

my vimrc backup

This is more like a backup for my vimrc file. Whenever I change to a new machine, I start missing my vim settings and memorizing stuff like this is not one of my good habits :).

set nocompatible

set backspace=indent,eol,start " allow backspacing over everything in insert mode
set nu " Set line numbering on
set nobackup " do not keep a backup file, use versions instead
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
map Q gq " Don't use Ex mode, use Q for formatting

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
else
set term=xterm
endif
syntax on
set hlsearch

" Only do this part when compiled with support for autocommands.
if has("autocmd")

" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on

" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78

endif

" toggle paste / mouse mode
map :call InvertPasteAndMouse()
fun! InvertPasteAndMouse()
if &mouse == ''
set mouse=a | set nopaste
echo "mouse mode on, paste mode off"
else
set mouse= | set paste
echo "mouse mode off, paste mode on"
endif
endfunction

set tabstop=2
" set softtabstop=2
set shiftwidth=2
set expandtab
"set mouse=vc
set autoindent " always set autoindenting on
set smartindent

colorscheme desert

Sunday, February 03, 2008

Microsoft Virtual CD-ROM Control Panel for Windows XP

Found this cool virtual cd-rom driver from Microsoft today. Although its not as flexible as free products from Alcohol Software or Daemon Tools, its considerably small and fast. Unfortunately, its probably only for Windows XP.


Microsoft Virtual CD-ROM driver for windows xp (32-bit)

Saturday, June 23, 2007

Using Intel C/C++ Compiler /w kdevelop

I tried out the Intel C/C++ Compiler v10.0 on my Ubuntu/7.04 box. Its free for "personal" use only. Unfortunately, it is a rpm distribution and does not "officially" support Ubuntu Linux. Well, use "alien" to fix that problem and convert the rpm to a debian package. A simple google search will give any1 the steps if interested. So far, it hasn't become painful to use it ... yet. But I did have problems using it out-of-the-box.

First of all, the executable complained about missing "libcxaguard.so.5". Again, google to the rescue and there are several fixes for this problem and obviously I tried the easiest one :). Link with option "-static-libcxa". Unfortunately the executable is bigger than using the shared library. I'll try to post some of the performance comparison with gcc next time.

Secondly, how on earth can I use it with Kdevelop? This one took some time since I'm not very familiar with kdevelop myself and google didn't seem to help much except for other people asking for the same solution. Mingling with kdevelop for about an hour ... got it :D. There is a "iccvars.sh" script in the bin directory ... it sets up the environment vars for the compiler. Just use them in Project->Project Options->Configure Options (I would recommend using a new configuration with gcc's default settings). Here is a snap of the env vars I have set there (same as in the iccvars.sh script):

CC = icc
CXX = icc
INTEL_LICENSE_FILE = ${INTEL_LICENSE_FILE=}:/opt/intel/cc/10.0.023/licenses:/opt/intel/licenses:${HOME}/intel/licenses:/Users/Shared/Library/Application Support/Intel/Licenses
LD_LIBRARY_PATH = LD_LIBRARY_PATH:${LD_LIBRARY_PATH}
MANPATH = /opt/intel/cc/10.0.023/man:${MANPATH}

Also, we need the linker options to link against the
libcxaguard.so.5 ... so add "-static-libcxa -lstdc++" to the LDFLAGS section. Lastly, we need to set the include and lib search path: add "-I/opt/intel/cc/10.0.023/include/ -L/opt/intel/cc/10.0.023/lib" to the C and C++ tabs CXXFLAGS section. Now run automake and friends ... then configure ... build... youre good to go.

















on a last note... i've used the intel directory paths according to my installation. If you have it installed in some other directory... use that one. Happy coding :)