Monday, April 20, 2009

Linux: how to change background color of xdvi

If you want to change background color or whatever other settings of one application under X windows, for example, xdvi, you could set it in your file: ~/.Xdefaults by

xdvi*background: white
xdvi*foreground: black

.

Note: your changes will be starting after you log out and in.

ROOT: how to set TGraph Xaxis range.

It seems that I cannot set the x-axis range of TGraph by

graph->GetXaxis()->SetRangeUser(0,1);

. I have to use

graph->GetXaxis()->SetLimits(0,1);

to do this task. But the former way is working for y-axis.

Thursday, April 9, 2009

Linux:shell:BASH: How to delete one line by sed

If you want to delete one line containing one word "ThisWord" by sed, then you can do in the way:

sed -i "/ThisWord/d" YourTextFile.txt

Note, here '-i' is to delete it from the original file. Without it, sed only prints the file on screen. So before using '-i', make sure you are doing correct things.

Locations of visitors to this page