User talk:Mathieu

From KitwarePublic
Revision as of 23:38, 15 April 2005 by Mathieu (talk | contribs) (Xvfb + VTK)
Jump to navigationJump to search

Linux

I use Linux. The main reasons are stability and ease of use (I love shells !).

Links:


Debian

Debian is really cool, you have access to billions of package one command line away. The very last package I discover is gcc-snapshot:


 http://packages.debian.org/unstable/devel/gcc-snapshot

Basically you have access to gcc4.0 (+fortran !!) with no hassle. another cool stuff is that gcj comes with libjawt (jawt.h ...) can't wait to compile VTK using gcj.

gVim

Tip #312: Copy, Cut, and Paste

Link I always loose

Zsh

Zsh simply rocks, there absolutely no reason not to switch to zsh from bash since it support all the bash command and is better:

Similarities with bash

Also read From Bash to Z Shell: Conquering the Command Line

Some usefull zsh command:

Eventhought it should be possible to set zsh to behave like vim with 'set -o vi', I am used to the 'emacs' style command in zsh:

Ctrl+a : Start of line
Ctrl+e : End of line
Ctrl+l : Clean screen
Ctrl+u : Delete anything
Ctrl+w : Delete anything on the left side of cursor
Ctr+r  : Historic search
Ctrl+y : Paste buffer
Ctrl+d : delete active character or disconnect if empty line
Alt+b / Alt+f : jump from one word to the other
Ctrl+Backspace (Ctrl+w) : erase previous work
Alt+d : delete next work
Alt+t : exhcange current word and next one
Alt+c : capitalize current letter, and uncapitalize the next letter, and jump to the end of word
Ctrl+t : exchange two letters

UNIX shell differences and how to change your shell

Copy paste from: http://www.faqs.org/faqs/unix-faq/shell/shell-differences/

                                     sh   csh  ksh  bash tcsh zsh  rc   es
Job control                          N    Y    Y    Y    Y    Y    N    N
Aliases                              N    Y    Y    Y    Y    Y    N    N
Shell functions                      Y(1) N    Y    Y    N    Y    Y    Y
"Sensible" Input/Output redirection  Y    N    Y    Y    N    Y    Y    Y
Directory stack                      N    Y    Y    Y    Y    Y    F    F
Command history                      N    Y    Y    Y    Y    Y    L    L
Command line editing                 N    N    Y    Y    Y    Y    L    L
Vi Command line editing              N    N    Y    Y    Y(3) Y    L    L
Emacs Command line editing           N    N    Y    Y    Y    Y    L    L
Rebindable Command line editing      N    N    N    Y    Y    Y    L    L
User name look up                    N    Y    Y    Y    Y    Y    L    L
Login/Logout watching                N    N    N    N    Y    Y    F    F
Filename completion                  N    Y(1) Y    Y    Y    Y    L    L
Username completion                  N    Y(2) Y    Y    Y    Y    L    L
Hostname completion                  N    Y(2) Y    Y    Y    Y    L    L
History completion                   N    N    N    Y    Y    Y    L    L
Fully programmable Completion        N    N    N    N    Y    Y    N    N
Mh Mailbox completion                N    N    N    N(4) N(6) N(6) N    N
Co Processes                         N    N    Y    N    N    Y    N    N
Builtin artithmetic evaluation       N    Y    Y    Y    Y    Y    N    N
Can follow symbolic links invisibly  N    N    Y    Y    Y    Y    N    N
Periodic command execution           N    N    N    N    Y    Y    N    N
Custom Prompt (easily)               N    N    Y    Y    Y    Y    Y    Y
Sun Keyboard Hack                    N    N    N    N    N    Y    N    N
Spelling Correction                  N    N    N    N    Y    Y    N    N
Process Substitution                 N    N    N    Y(2) N    Y    Y    Y
Underlying Syntax                    sh   csh  sh   sh   csh  sh   rc   rc
Freely Available                     N    N    N(5) Y    Y    Y    Y    Y
Checks Mailbox                       N    Y    Y    Y    Y    Y    F    F
Tty Sanity Checking                  N    N    N    N    Y    Y    N    N
Can cope with large argument lists   Y    N    Y    Y    Y    Y    Y    Y
Has non-interactive startup file     N    Y    Y(7) Y(7) Y    Y    N    N
Has non-login startup file           N    Y    Y(7) Y    Y    Y    N    N
Can avoid user startup files         N    Y    N    Y    N    Y    Y    Y
Can specify startup file             N    N    Y    Y    N    N    N    N
Low level command redefinition       N    N    N    N    N    N    N    Y
Has anonymous functions              N    N    N    N    N    N    Y    Y
List Variables                       N    Y    Y    N    Y    Y    Y    Y
Full signal trap handling            Y    N    Y    Y    N    Y    Y    Y
File no clobber ability              N    Y    Y    Y    Y    Y    N    F
Local variables                      N    N    Y    Y    N    Y    Y    Y
Lexically scoped variables           N    N    N    N    N    N    N    Y
Exceptions                           N    N    N    N    N    N    N    Y

Key to the table above.

   Y      Feature can be done using this shell.
          
   N      Feature is not present in the shell.
          
   F      Feature can only be done by using the shells function
          mechanism.
          
   L      The readline library must be linked into the shell to enable
          this Feature.
          
Notes to the table above

    1. This feature was not in the orginal version, but has since become
       almost standard.
    2. This feature is fairly new and so is often not found on many
       versions of the shell, it is gradually making its way into
       standard distribution.
    3. The Vi emulation of this shell is thought by many to be
       incomplete.
    4. This feature is not standard but unoffical patches exist to
       perform this.
    5. A version called 'pdksh' is freely available, but does not have
       the full functionality of the AT&T version.
    6. This can be done via the shells programmable completion mechanism.
    7. Only by specifing a file via the ENV environment variable.

Other link to documentation:

Mac OSX

Some tricks I always forgot on MacOSX:

ldd -> otools -L

strace/ltrace -> ktrace / kdump

Configuring and running X11 on MacOSX


older MacOS

Valgrind

gdb and valgrind

some valgrind 'feature' to gdb an unitialized var you need to use valgrind macro:

From [How to output address of the unitialized value? ]

Your best bet in that case is to inspect the code at the failing location and see if there is an obvious cause, and if not then to try inserting some assertions using the valgrind macros to try and work out what is uninitialised - assertions like this will do it:

  assert( !VALGRIND_CHECK_READABLE( &variable, sizeof( variable ) ) );


file open and valgrind

You can track how many files are open when your programm terminates if you use the flag (works only with recent valgrind version):

 --track-fds=yes

Another approach is to use:

 strace -eopen

GDB

Yet another trick for debugging the destructor of a class: Steps:

 nm --defined-only -C vtkEnSight6Reader.o | grep '~'

copy the hexadecimal for those symbol then do

 nm --defined-only vtkEnSight6Reader.o | grep 'my_symbol'

then you just need to add a breakpoint on that particular symbol, repeat if more than one destructor.


CMake

Another trick when writting regex in CMake, look at:

http://www.aivosto.com/vbtips/regex.html

It's fairly well describe


Xvfb

How to run a VTK dashboards without window poping up (using Xvfb):

sudo apt-get install xvfb
Xvfb :9 -ac  -screen 0 300x300x24
export DISPLAY=:9
ctest -D Experimental

Links: http://lists.debian.org/debian-user/2004/11/msg02220.html

just for the archive: found the solution on the net, the file named by -auth should simply contain host names in cleartest. In my case I made a file
/etc/X99.cfg
containing the single line:
localhost
and call Xvfb thus:
Xvfb :86 -auth /etc/X99.cfg -screen scrn 800x600x32 &


xvfb could not init font path element usr x11r6 lib x11 fonts cid removing list

Clean way to stop Xvfb

Stuff TODO

- I need to setup a guide to cross compile VTK on debian - I ................... install intel icc on debian linux (all versions)

http://people.debian.org/~debacle/cross.html http://colt.projectgamma.com/intel/ixc-debian.html http://www.creatis.insa-lyon.fr/~bellet/creatis/cygwin/cross.html

http://www.atai.org/guitool/

I still canot boot into BeOS using grub:

http://www.linux-sxs.org/administration/grubbeos.html http://f3wm.free.fr/linux/grub.html http://www.linuxforums.org/tutorials/1/tutorial-19999.html http://leaf.sourceforge.net/doc/guide/bugrub.html


Keep an eye on svn:

[ugly problem found while trying to test KDE SVN] http://svn.haxx.se/dev/archive-2005-02/0897.shtml

[How do you tell the compiler to make a member function inline?] http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7

Borland:


Xvfb