Re: (OT) path_helper [was Re: Xterm not reading dotfiles]
Re: (OT) path_helper [was Re: Xterm not reading dotfiles]
- Subject: Re: (OT) path_helper [was Re: Xterm not reading dotfiles]
- From: "Andrew J. Hesford" <email@hidden>
- Date: Mon, 19 Nov 2007 08:41:32 -0600
On Nov 19, 2007, at 4:03 AM, Vernon Williams wrote:
Monday, November 19, 2007, 3:16am
For whatever it is worth, attached below is a little C program I just
hacked out to list its command arguments to standard output,
in order, but with any duplicates (except for the first) removed.
It could readily be converted into a filter as well. It is a fast,
general
purpose program for removing duplicates, using two qsorts,
which might be useful in the current problem, at least for the
algorithm. I have not tested it extensively, but it seems to work
for the cases I have tried. If anybody tries it and finds any
problems,
I would be glad to hear about it.
Vernon Williams
Yes, I have used qsort to remove duplicate data from lists before, and
it is quite useful. In fact, you can remove one of the qsort calls, if
you do a little extra bookkeeping while you are identifying duplicates
in the sorted list. When Perl builds a hash, I would assume it is
using something like qsort to order its arrays, so the underlying
mechanisms might be similar.
--
Andrew J. Hesford <email@hidden>
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden