Re: Perl commandments -> index .vs. //

2001-01-15 Thread Robin Szemeti
On Mon, 15 Jan 2001, you wrote: > push @ARGV, '/usr/dict/words'; which reminds me .. is there a /usr/dict/words with correct spellings for english out there somwhere??? ... -- Robin Szemeti The box said "requires windows 95 or better" So I installed Linux!

Re: Perl commandments -> index .vs. //

2001-01-15 Thread Chris Benson
On Tue, Jan 09, 2001 at 12:50:08PM +, Piers Cawley wrote: > David Cantrell <[EMAIL PROTECTED]> writes: > > Also index. These two snippets are equivalent: > > if($foo=~/foo/) { ... } > > if(index($foo, 'foo')!=-1) { ... } > > I always want to do just plain if(index(...)) though. > > ISTR

Re: Perl commandments

2001-01-10 Thread Mike Wyer
On Wed, 10 Jan 2001, Mark Rogaski wrote: >The danger of relying on Moore's law to overcome computational >intractablity is that we fail to account for the fact that the inputs are >increasing at an accelerated rate, too. I'm not sure if it is fair to say >that average datasets increase exponenti

Re: Perl commandments

2001-01-10 Thread Mark Rogaski
An entity claiming to be Greg McCarroll ([EMAIL PROTECTED]) wrote: : : ok, but it gets more interesting as take into account moores law that : reduces the effectiveness of optmisation by halving the improvement : of the optimization every year, this of course then compares to programmers : I'm

Re: Perl commandments

2001-01-10 Thread Mark Rogaski
An entity claiming to be Mark Fowler ([EMAIL PROTECTED]) wrote: : : Maybe that's not quite as snappy as the Brocard's. Hmm. It would be : easier if I could type omegas and stuff. : Unless there is some reason you need the tight bound, big-O is fine. Mark -- Mark Rogaski |

Re: Perl commandments

2001-01-10 Thread Piers Cawley
David Hodgkinson <[EMAIL PROTECTED]> writes: > Greg McCarroll <[EMAIL PROTECTED]> writes: > > > the best way to do this, if you see something is N^2 is to figure out > > how you could do it with a sort and hey presto it usually can be turned > > into NlogN+N .. NlogN > > This would involve beat

Re: Perl commandments

2001-01-10 Thread David Hodgkinson
Greg McCarroll <[EMAIL PROTECTED]> writes: > the best way to do this, if you see something is N^2 is to figure out > how you could do it with a sort and hey presto it usually can be turned > into NlogN+N .. NlogN This would involve beating aforementioned programmers round the head with Programmi

Re: Perl commandments

2001-01-10 Thread Greg McCarroll
* Peter Corlett ([EMAIL PROTECTED]) wrote: > In article <[EMAIL PROTECTED]> you write: > > ok, but it gets more interesting as take into account moores law that > > reduces the effectiveness of optmisation by halving the improvement of the > > optimization every year [...] > > This depends. If yo

Re: Perl commandments

2001-01-10 Thread Peter Corlett
In article <[EMAIL PROTECTED]> you write: > ok, but it gets more interesting as take into account moores law that > reduces the effectiveness of optmisation by halving the improvement of the > optimization every year [...] This depends. If you're just doing an optimisation that changes one O(N) a

Re: Perl commandments

2001-01-10 Thread Greg McCarroll
* Mark Fowler ([EMAIL PROTECTED]) wrote: > > Err... Twice as fast is still twice as fast when it's running on a > > processor that's twice as fast as it would have been. I now can't > > remember where I read a fascinating piece on the value of more > > efficient algorithms as computers got faster.

Re: Perl commandments

2001-01-10 Thread Mark Fowler
> Err... Twice as fast is still twice as fast when it's running on a > processor that's twice as fast as it would have been. I now can't > remember where I read a fascinating piece on the value of more > efficient algorithms as computers got faster. But it was worth > reading. It was by that guy.

Re: Perl commandments

2001-01-10 Thread Piers Cawley
Greg McCarroll <[EMAIL PROTECTED]> writes: > * Mark Fowler ([EMAIL PROTECTED]) wrote: > > > what are O(x(n)) and O(y(n)), i'm not familiar with the x and y notation > > > > Okay, I was making it up on the fly; - They're meant to be the functions > > you're implementing. Hence O(x(n)) is running

Re: Perl commandments

2001-01-10 Thread Greg McCarroll
* Mark Fowler ([EMAIL PROTECTED]) wrote: > > what are O(x(n)) and O(y(n)), i'm not familiar with the x and y notation > > Okay, I was making it up on the fly; - They're meant to be the functions > you're implementing. Hence O(x(n)) is running time of x on the data n, > and the same for y. > > I

Re: Perl commandments

2001-01-10 Thread Mark Fowler
> what are O(x(n)) and O(y(n)), i'm not familiar with the x and y notation Okay, I was making it up on the fly; - They're meant to be the functions you're implementing. Hence O(x(n)) is running time of x on the data n, and the same for y. I think the point I was trying to make about future prog

Re: Perl commandments

2001-01-10 Thread Greg McCarroll
* Mark Fowler ([EMAIL PROTECTED]) wrote: > > Thou shalt optimise for programmer time unless absolutely necessary, > > Thou shalt optimise for programmer time unless O(x(n)) > O(y(n)) and n is what are O(x(n)) and O(y(n)), i'm not familiar with the x and y notation -- Greg McCarroll

Re: Perl commandments

2001-01-10 Thread Mark Fowler
> Thou shalt optimise for programmer time unless absolutely necessary, Thou shalt optimise for programmer time unless O(x(n)) > O(y(n)) and n is a suitably large value, where programmer time is both the time for the current programming task and any future programming time that may be expended mai

Re: Perl commandments

2001-01-09 Thread Leon Brocard
Piers Cawley sent the following bits through the ether: > This time. The discussion has been back and forth on various lists, > usually with benchmarks. Thou shalt optimise for programmer time unless absolutely necessary, when thou shalt Benchmark and quoth both the benchmark and the results. L

Re: Perl commandments

2001-01-09 Thread Piers Cawley
Leon Brocard <[EMAIL PROTECTED]> writes: > Greg McCarroll sent the following bits through the ether: > > > in my original rule it was all to do with good programming style, not > > eeking out every bit of performance, my reply was actually that i > > thought dave choose a very grey area in terms

Re: Perl commandments

2001-01-09 Thread Leon Brocard
Greg McCarroll sent the following bits through the ether: > in my original rule it was all to do with good programming style, not > eeking out every bit of performance, my reply was actually that i > thought dave choose a very grey area in terms of programming style Indeed. And someone mentioned

Re: Perl commandments

2001-01-09 Thread Greg McCarroll
* Leon Brocard ([EMAIL PROTECTED]) wrote: > Greg McCarroll sent the following bits through the ether: > > > nope daves was a bad example > > Benchmark.pm - hard facts are better than guesses (hmm, I could do a > talk on this...) > in my original rule it was all to do with good programming styl

Re: Perl commandments

2001-01-09 Thread Leon Brocard
Greg McCarroll sent the following bits through the ether: > nope daves was a bad example Benchmark.pm - hard facts are better than guesses (hmm, I could do a talk on this...) Leon -- Leon Brocard.http://www.astray.com/ yapc::Europehttp://

Re: Perl commandments

2001-01-09 Thread Greg McCarroll
* Piers Cawley ([EMAIL PROTECTED]) wrote: > Greg McCarroll <[EMAIL PROTECTED]> writes: > > > * Piers Cawley ([EMAIL PROTECTED]) wrote: > > > David Cantrell <[EMAIL PROTECTED]> writes: > > > > On Tue, Jan 09, 2001 at 11:25:18AM +, Greg McCarroll wrote: > > > > > 6.) regular expressions

Re: Perl commandments

2001-01-09 Thread Piers Cawley
Greg McCarroll <[EMAIL PROTECTED]> writes: > * Piers Cawley ([EMAIL PROTECTED]) wrote: > > David Cantrell <[EMAIL PROTECTED]> writes: > > > On Tue, Jan 09, 2001 at 11:25:18AM +, Greg McCarroll wrote: > > > > 6.) regular expressions are not the only way to code, length and > > > >

Re: Perl commandments

2001-01-09 Thread Greg McCarroll
* Piers Cawley ([EMAIL PROTECTED]) wrote: > David Cantrell <[EMAIL PROTECTED]> writes: > > On Tue, Jan 09, 2001 at 11:25:18AM +, Greg McCarroll wrote: > > > 6.) regular expressions are not the only way to code, length and > > > substr are in the language for a reason > > >

Re: Perl commandments

2001-01-09 Thread Piers Cawley
David Cantrell <[EMAIL PROTECTED]> writes: > On Tue, Jan 09, 2001 at 11:25:18AM +, Greg McCarroll wrote: > > 6.) regular expressions are not the only way to code, length and > > substr are in the language for a reason > > Also index. These two snippets are equivalent: >

Re: Perl commandments

2001-01-09 Thread David Cantrell
On Tue, Jan 09, 2001 at 11:25:18AM +, Greg McCarroll wrote: > * Piers Cawley ([EMAIL PROTECTED]) wrote: > > > Thou shalt ensure that everything knows as little as possible about > >anything else. (There's *got* to be a way to condense that...) Thou shalt encapsulate? > ok heres my 10 ru

Re: Perl commandments

2001-01-09 Thread Greg McCarroll
* Piers Cawley ([EMAIL PROTECTED]) wrote: > David Hodgkinson <[EMAIL PROTECTED]> writes: > > > Was it here that we discussed the Perl commandments? You remember, > > things like "thou shalt use strict and -w" and so on... > > I don't think we were.

Re: Perl commandments

2001-01-09 Thread Piers Cawley
David Hodgkinson <[EMAIL PROTECTED]> writes: > Was it here that we discussed the Perl commandments? You remember, > things like "thou shalt use strict and -w" and so on... I don't think we were. But: Thou shalt not write the same thing twice. Thou shalt not use

Perl commandments

2001-01-09 Thread David Hodgkinson
Was it here that we discussed the Perl commandments? You remember, things like "thou shalt use strict and -w" and so on... -- Dave Hodgkinson, http://www.hodgkinson.org Editor-in-chief, The Highway Star http://www.deep-purple.com Apache