User talk:Mathieu: Difference between revisions
(c++) |
(→Zsh) |
||
Line 27: | Line 27: | ||
== Zsh == | == Zsh == | ||
Zsh simply rocks, there absolutely no reason to | Zsh simply rocks, there absolutely no reason not to switch to zsh from bash since it support all the bash command and is better: | ||
[http://www.b2pi.com/zsh/FAQ/zshfaq02.html#l14 Similarities with bash] | [http://www.b2pi.com/zsh/FAQ/zshfaq02.html#l14 Similarities with bash] | ||
Some usefull zsh command: | Also read [http://books.slashdot.org/books/05/04/13/203225.shtml?tid=130&tid=201&tid=192&tid=6&tid=106 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: | 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: | ||
Line 51: | Line 53: | ||
Ctrl+t : exchange two letters | Ctrl+t : exchange two letters | ||
Other link to documentation: | === UNIX shell differences and how to change your shell === | ||
Copy paste from: http://www.faqs.org/faqs/unix-faq/shell/shell-differences/ | |||
<pre> | |||
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. | |||
</pre> | |||
=== Other link to documentation: === | |||
* [http://www.b2pi.com/zsh/Doc/ ZSH Documentation] | * [http://www.b2pi.com/zsh/Doc/ ZSH Documentation] |
Revision as of 03:25, 14 April 2005
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
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:
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
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
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
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