Thursday, March 23, 2006

Power of valgrind and cgdb combined

I just found out how to make valgrind ask if it should invoke cgdb when it finds an error:

valgrind --db-attach=yes --db-command="cgdb -nw %f %p"

This is incredibly useful. For those of you who don't know, cgdb is a curses interface to gdb, which displays a split view between the code and the gdb console. A bonus is that it uses vim-ish keys and commands. Valgrind is a very powerful memory debugger, which can find memory leaks and find illegal writes and reads to/from memory done by an application.

Sunday, March 19, 2006

Addicted to vim and screen

I've become addicted to vim and screen. With it, I can get a very powerful development environment over one ssh connection. I switch between windows in screens with ctrl-a [0-9]. I switch between splits in vim with some custom bound key combos, ctrl-j and ctrl-k. I can issue regular expressions and I can use all the powerful and flexible editing commands vim offers. Just try pressing d and then any 'movement'. For example dt;. That one will cut all text before the next ;. Then there's the visual modes, v and V. Try selecting some code with it and pressing =. That will reindent that code. And this is just poking on the surface of what's possible with vim.

Friday, March 17, 2006

Artificial Stupidity

seqseq & int: error (7)
seqseq & float: error (7)
byteseq & seq: error (7)
byteseq & byte: error (7)
byteseq & int: error (7)
byteseq & float: error (7)
intseq & seq: error (7)
intseq & byte: error (7)
intseq & int: error (7)
intseq & float: error (7)
floatseq & seq: error (7)
floatseq & byte: error (7)
floatseq & int: error (7)
floatseq & float: error (7)
seqseq & seq: error (7)
seqseq & byte: error (7)
seqseq & int: error (7)
seqseq & float: error (7)
byteseq & seq: error (7)
byteseq & byte: error (7)
byteseq & int: error (7)
byteseq & float: error (7)
intseq & seq: error (7)
intseq & byte: error (7)
intseq & int: error (7)
intseq & float: error (7)
floatseq & seq: error (7)
floatseq & byte: error (7)
floatseq & int: error (7)
floatseq & float: error (7)
seqseq & seq: error (7)
seqseq & byte: error (7)
seqseq & int: error (7)
seqseq & float: error (7)
byteseq & seq: error (7)
byteseq & byte: error (7)
byteseq & int: error (7)
byteseq & float: error (7)
intseq & seq: error (7)
intseq & byte: error (7)
intseq & int: error (7)
intseq & float: error (7)
floatseq & seq: error (7)
floatseq & byte: error (7)
floatseq & int: error (7)
floatseq & float: error (7)
seqseq & seq: error (7)
seqseq & byte: error (7)
seqseq & int: error (7)
seqseq & float: error (7)
Passed Test!


...