Sunday, February 12, 2006

Matlab code time execution

Most people is familiar with tic; toc; commands in matlab to check execution of their code;

But more detail insight into this problem is by profile viewer.


This nice tool shows exactly how much time is used by each line, how many times it is executed. Moreover, profiler also gives some suggestions how to improve execution time.

For example, thanks to profiler I was able to reduce time of one image processing program from few hours to few minutes. Profiler showed me, that very simple operation, takes huge amount of time. Just by removing, changing and rewriting few time consuming lines, I was able to significantly shorten exec time of my program.

Thursday, February 09, 2006

Mac X: Changing bash prompt in X11's xterm

Default bash prompt in my X11's xterm was:PS1="\h:\w \u"This was very annoying as the prompt contained all the path to the current directory, which was especially bed if I went dip into the directory tree. In such a case it is better to use '\W' option instead of '\w', as this option shows only current directory name, and not full path to it. To change bash prompt use:export PS1="\h:\W \u$ "To make it permanent just add this line to ~/.bashrc.

Thursday, February 02, 2006

Unreal Tournament 2004: Make it slower

UT2004 is very nice and one of my favorite games. One nice option it has it is possibility to setup the speed of the game. You cannot do it in game itself, however, to do it, you must edit: UT2004.ini file in: \UT2004\System and change the value of variable GameSpeed Originally: GameSpeed=1.000000

I use GameSpeed=0.650000 My computer is not fast enough to render the game in its original speed. Moreover, with slower action, it is easier to observe all those special effects that game has - you can observer, e.g., rocked heading your way, which is pretty nice.