When the Schwartzian Transform gets out of control...

2003-02-11 Thread Bennett Todd
I recently hacked up a quick-n-dirty helper for selectively mirroring or updating RPMs. The algorithm I wanted was - collect the list available from the remote server; - collect the list installed locally; - for those packages available from the remote server, where the same-name package is

Re: Converting a textfile-like string to an array and back

2003-02-11 Thread Ian Phillipps
On Tue, 11 Feb 2003 at 10:39:53 +1100, Andrew Savige wrote: In case anyone is unaware of (-ugene's status in world golf, you can find out by typing in Eugene van der Pijll at www.googlism.com. I just typed in 'Eugene' to check. eugene is the fastest and most pleasant eugene is about the size

Re: Converting a textfile-like string to an array and back

2003-02-11 Thread Andrew Savige
Ian Phillipps sprak: I just typed in 'Eugene' to check. eugene is the fastest and most pleasant eugene is about the size of a dog eugene is devastated But, most relevantly, eugene is right In my experience, Eugene (and Ton) are always right. I just noticed that Yitzchak's email

Re: When the Schwartzian Transform gets out of control...

2003-02-11 Thread Randal L. Schwartz
Bennett == Bennett Todd [EMAIL PROTECTED] writes: Bennett When I got around to writing the thing, here's what came out. Sort Bennett of an elaborated and extended Schwartzian Transform. The naughty Bennett bits can be found quickly by searching for map and sort. I Bennett think the maps with big

Re: When the Schwartzian Transform gets out of control...

2003-02-11 Thread Kripa Sundar
Randal writes: = If you need only the best (or worst) of the list, a sort is probably = overkill. Just do a high-water mark scan, keeping the best = candidate as you compare it with each other candidate. For fixed (but arbitrarily large) K, it is possible to find the K smallest or K largest

Re: When the Schwartzian Transform gets out of control...

2003-02-11 Thread A. Pagaltzis
Sorting 1000 items involves a _lot_ more than 1000 comparisons - which is really all you need. If you insist on your approach you should memoize vercmp() or use the orcish maneuver in your sort() callback. (Memoizing will accelerate it across all of your script, but the orcish maneuvre will

Re: When the Schwartzian Transform gets out of control...

2003-02-11 Thread A. Pagaltzis
* A. Pagaltzis [EMAIL PROTECTED] [2003-02-12 07:35]: and -1 == vercmp($2,$3, @{$installed{$_}}); That is, of course, and -1 == vercmp($2,$3, @{$installed{$1}}); -- Regards, Aristotle

RE: Converting a textfile-like string to an array and back

2003-02-11 Thread Winter Christian
Andrew Savige [mailto:[EMAIL PROTECTED]] wrote: Winter Christian wrote: # String to array: @lines=$x=~/[^\n]/g; This one splits into array of chars not array of lines. Shame on me, seems like I was unable to read what the question was. -Christian