Showing posts with label Scientific Programming. Show all posts
Showing posts with label Scientific Programming. Show all posts

Friday, February 24, 2012

VIM Quicky: set tabs and spaces behaviour for different files

Never really bothered me before, because I only used Python and C, so I always replaces tabs with spaces.
However, with more C programming lately, I needed to start working with Makefiles. These require tabs instead of spaces.
So here is how to. In the end of my .vimrc file I put:

" python python pyhton
" convert tabs to spaces before writing python files or C files
autocmd! bufwritepre *.py,*.c,*.h set expandtab | retab! 4

" convert spaces to tabs when reading python file or C files
autocmd! bufreadpost *.py,*.c,*.h set noexpandtab | retab! 4


Et viola, not so complicated!

Tuesday, June 21, 2011

The best latex editor Kile 2.1 Released!

This should be really bigger news! Although I don't use KDE at all, Kile is the best editor for Latex, I have tried. The developers released 5 beta versions before, which never gave me any problem.
11 Days ago, kile 2.1 was finally released, here is the release announcement .
I love how simple Kile is, although it is full with goodies and options. I love how it is out of the way when you want it. I tried contributing to Gummi-latex editor. But eventually, I found it useless.
I love the VIM mode in Kile, and I wish it was possible in some GTK+ Editor. Yeah, I know I can use vim-latex-suite. But I am too lazy to learn it :-). So, I use vim for all other programming, and Kile for Latex.
So, bottom line, I really recommend to download and install latest Kile!

Sunday, June 19, 2011

One more python learning resource

This one is pretty cool. It is a learning environment, which allows you also to create more learning environment. I wish I had more time to play with it!
Python Crucny: http://code.google.com/p/crunchy/

Have fun!


Tuesday, May 24, 2011

Building Octave-3.4 on Debian Sid

I wanted to build the latest Octave (3.4) on my Debian Sid. Well, it wasn't as easy as before, since I upgrade it quite often. So now, the GCC-4.6 is used in Octave. However, due to some bugs in GCC-4.6 or Octave(?), it won't build. So, the trick that did it for me:

sudo aptitude build-dep octave3.2
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
sudo aptitude install gcc-4.5 gfortran-4.5 g++-4.5

than, we need to do something ugly, but it does work ... ;-)

sudo mv /usr/bin/gfortran /usr/bin/gfortran.ORG
sudo ln -s /usr/bin/gfortran-4.5 /usr/bin/gfortran

now we tell Octave to build using GCC-4.5:
export CC=/usr/bin/gcc-4.5
export CXX=/usr/bin/g++-4.5

the rest is easy:
./configure
make 
make test
sudo make install
sudo checkinstall

Et viola! A post which is more positive and not ranting! Octave 3.4 is faster, and provides better Matlab comparability. Give it a try and you want look back!



Thursday, March 03, 2011

Matlab Alternative: RStudio

To the list of great Matlab alternative I add today RSTUDIO.
Although, I usually don't program in R, I am glad to see it is not freezing, and continuously develop as a scientific interested language. I am guessing that this fancy IDE for R, would make it easier to accept among people who are deeply rooted in the EXCELLENT MATLAB IDE.
However, doing most of my scientific tasks, and system administration in python, I think Matlab's syntax is equally weird to that of R ;-).

One weird choice of the developers is to call the binary rdesktop instead of rstudio... Maybe they don't know about rdesktop
which is familiar to most system administrators ... oh, well, I guess I'll have to open a bug ...