Re: How to manage around 1000 entries which will constantly be changing

2006-04-01 Thread Mr. Shawn H. Corey
On Sat, 2006-01-04 at 09:57 -0500, Frank Bax wrote: > I'm not the OP, but I have a script with a similar problem. The script has > some logic that generates many (thousands of billions) of combinations from > a little bit of data and only the best 100 combos are output. For each > combination p

logging on for FTP and failing

2006-04-01 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have a process which runs and when it finds a trigger file, then logs on via ftp. The logon is tied to the month and changes accordingly. When there is a month switchover of late this process is failing. The call for the logon: # call to logon process for ftp r

RE: How to manage around 1000 entries which will constantly be changing

2006-04-01 Thread Charles K. Clarkson
Robin Sheat wrote: : Have you considered using a data structure that is always sorted, : such as a tree or a priority queue (backed by a heap or : something). From the Heap::Simple docs: A heap is a partially sorted structure where it's always easy to extract the smallest element. If the

Re: simple profiling?

2006-04-01 Thread Bryan Harris
> On Fri, 31 Mar 2006 18:50:15 -0700, Bryan Harris wrote: I have a script that takes ~5 seconds to run, but I'd like to get it down to <1 sec. My problem is I don't know which part is the slow part. >>> my $start_time = time; (code chunk 1 here) >>> print "chunk 1: ", time -

Re: How to manage around 1000 entries which will constantly be changing

2006-04-01 Thread Robin Sheat
On Sunday 02 April 2006 02:57, Frank Bax wrote: > At the moment, the array is left unsorted.  If I use a sorted array, it > needs to resorted every time a "worst" entry is replaced by a "new" > entry.  Can I avoid sorting the array every iteration? Have you considered using a data structure that is

Re: How to manage around 1000 entries which will constantly be changing

2006-04-01 Thread Frank Bax
At 06:59 PM 3/31/06, Mr. Shawn H. Corey wrote: On Fri, 2006-31-03 at 15:45 -0800, Tom Phoenix wrote: > You should loop over the input, pushing each item on to an array. If > at any time you have 2000 items in the array, sort them and discard > any you don't want to keep. > > $#data = 999 if

Re: simple profiling?

2006-04-01 Thread Peter Scott
On Fri, 31 Mar 2006 18:50:15 -0700, Bryan Harris wrote: >>> I have a script that takes ~5 seconds to run, but I'd like to get it >>> down to <1 sec. My problem is I don't know which part is the slow >>> part. >> my $start_time = time; >>> (code chunk 1 here) >> print "chunk 1: ", time - $start_t