ACME-QuoteDB

 view release on metacpan or  search on metacpan

lib/ACME/QuoteDB.pm  view on Meta::CPAN

  "Quote", "Attribution Name", "Attribution Source", "Category", "Rating"
 
  for example:
  "Quote", "Attribution Name", "Attribution Source", "Category", "Rating"
  "I hope this has taught you kids a lesson: kids never learn.","Chief Wiggum","The Simpsons","Humor",9
  "Sideshow Bob has no decency. He called me Chief Piggum. (laughs) Oh wait, I get it, he's all right.","Chief Wiggum","The Simpsons","Humor",8

=item 1 if these dont suit your needs, ACME::QuoteDB::LoadDB is sub-classable, 

  so one can extract data anyway they like and populate the db themselves. 
  (there is a test that illustrates overriding the stub method, 'dbload')

   you need to populate a record data structure:

    $self->set_record(quote  => q{}); # mandatory
    $self->set_record(name   => q{}); # mandatory
    $self->set_record(source => q{}); # optional but useful
    $self->set_record(catg   => q{}); # optional but useful
    $self->set_record(rating => q{}); # optional but useful

   # then to write the record you call

lib/ACME/QuoteDB.pm  view on Meta::CPAN

=head2 Quote

=head2 Catg

=head2 QuoteCatg

=end comment

=head1 DIAGNOSTICS

An error such as:

C<DBD::SQLite::db prepare_cached failed: no such table: ,...>

probably means that you do not have a database created in the correct format.

basically, you need to create the database, usually, on a first run

you need to add the flag (to the loader):

create_db => 1, # first run, create the db

lib/ACME/QuoteDB.pm  view on Meta::CPAN



=head1 AUTHOR

David Wright, C<< <david_v_wright at yahoo.com> >>

=head1 TODO

=over 2

=item 1 if the database cannot be found, no error is printed!!!

or if you have no write access to it!
"you'll just get 'no attribute can be found,,...", which is cryptic to say
the least!

=item 1 add a dump backup to csv

a backup mechanism for your db to a regular text csv file.

=item 1 clean up tests 'skip if module X' not installed

lib/ACME/QuoteDB/LoadDB.pm  view on Meta::CPAN

      $self->write_record;
  }
  close $source or carp $!;

  return $self;
}

# sub class this - i.e. provide this method in your code (see test
# 01-load_quotes.t)
sub dbload {
  croak 'Override this. Provide this method in a sub class (child) of this object';
  # see tests: t/01-load_quotes.t for examples
}

sub _to_utf8 {
    my ($self) = @_;

    RECORD:
    foreach my $r (@QUOTE_FIELDS){
        my $val = $self->{record}->{$r};
        if (ref $val eq 'ARRAY'){

lib/ACME/QuoteDB/LoadDB.pm  view on Meta::CPAN


#sub create_db_mysql {
#    my ($self) = @_;
#
#     # hmmmm, what about priv's access, etc
#     # maybe user need to supply a db, they have 
#     # access to, already created (just the db though)
#     ## create our db
#     #my $dbhc = DBI->connect('DBI:mysql:database=mysql;host='
#     #                           .$self->{host}, $self->{user}, $self->{pass})
#     #      || croak "db cannot be accessed $! $DBI::errstr";
#
#     #my $dbn = $self->{db};
#     #my $db = qq(CREATE DATABASE $dbn CHARACTER SET utf8 COLLATE utf8_general_ci);
#     # eval {
#     #     $dbhc->do($db) or croak $dbhc->errstr;
#     # };
#     # $@ and croak 'Cannot create database!';
#     # $dbhc->disconnect; $dbhc = undef;
#
#     my $drh = DBI->install_driver('mysql');
#     my $rc = $drh->func("dropdb", $self->{db}, 
#                    [$self->{host}, $self->{user}, $self->{password}],
#                    'admin'
#                );
#

lib/ACME/QuoteDB/LoadDB.pm  view on Meta::CPAN

#}

# XXX refactor with sqlite
sub create_db_tables_mysql {
    my ($self) = @_;

     # connect to our db
     my $c = $self->{db}.';host='.$self->{host};
     my $dbh = DBI->connect(
             "DBI:mysql:database=$c", $self->{user}, $self->{pass})
               || croak "db cannot be accessed $! $DBI::errstr";

    eval {
        $dbh->do('DROP TABLE IF EXISTS quote;') or croak $dbh->errstr;

        $dbh->do('CREATE TABLE IF NOT EXISTS quote (
            quot_id        INTEGER NOT NULL AUTO_INCREMENT, 
            attr_id        INTEGER,
            quote          TEXT,
            source         TEXT,
            rating         REAL,
            PRIMARY KEY(quot_id)
            );')
            #)CHARACTER SET utf8 COLLATE utf8_general_ci;
            #) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci; 
            or croak $dbh->errstr;

        $dbh->do('DROP TABLE IF EXISTS attribution;') or croak $dbh->errstr;

        $dbh->do('CREATE TABLE IF NOT EXISTS attribution (
            attr_id  INTEGER NOT NULL AUTO_INCREMENT,
            name     TEXT,
            PRIMARY KEY(attr_id)
            );') or croak $dbh->errstr;

        $dbh->do('DROP TABLE IF EXISTS category;') or croak $dbh->errstr;

        $dbh->do('CREATE TABLE IF NOT EXISTS category (
            catg_id    INTEGER NOT NULL AUTO_INCREMENT, 
            catg       TEXT,
            PRIMARY KEY(catg_id)
            );') or croak $dbh->errstr;

        $dbh->do('DROP TABLE IF EXISTS quote_catg;') or croak $dbh->errstr;

        $dbh->do('CREATE TABLE IF NOT EXISTS quote_catg (
            id    INTEGER NOT NULL AUTO_INCREMENT, 
            catg_id    INTEGER, 
            quot_id    INTEGER, 
            PRIMARY KEY(id)
            );') or croak $dbh->errstr;


       $dbh->disconnect or warn $dbh->errstr;

       $dbh = undef;
    };

    return $@ and croak 'Cannot create database tables!';

}

sub create_db_tables_sqlite {

     my $db = QDBI->get_current_db_path;

     #XXX is there really no way to do this with the existing 
     # connection?!(class dbi)
     my $dbh = DBI->connect('dbi:SQLite:dbname='.$db, '', '')
       || croak "$db cannot be accessed $! $DBI::errstr";

    #-- sqlite does not have a varchar datatype: VARCHAR(255)
    #-- A column declared INTEGER PRIMARY KEY will autoincrement.
    eval {
        $dbh->do('DROP TABLE IF EXISTS quote;') or croak $dbh->errstr;

        $dbh->do('CREATE TABLE IF NOT EXISTS quote (
            quot_id        INTEGER PRIMARY KEY, 
            attr_id        INTEGER,
            quote          TEXT,
            source         TEXT,
            rating         REAL
            );')
            or croak $dbh->errstr;

        $dbh->do('DROP TABLE IF EXISTS attribution;') or croak $dbh->errstr;

        $dbh->do('CREATE TABLE IF NOT EXISTS attribution (
            attr_id  INTEGER PRIMARY KEY,
            name     TEXT
            );') or croak $dbh->errstr;

        $dbh->do('DROP TABLE IF EXISTS category;') or croak $dbh->errstr;

        $dbh->do('CREATE TABLE IF NOT EXISTS category (
            catg_id    INTEGER PRIMARY KEY, 
            catg       TEXT
            );') or croak $dbh->errstr;

        $dbh->do('DROP TABLE IF EXISTS quote_catg;') or croak $dbh->errstr;

        $dbh->do('CREATE TABLE IF NOT EXISTS quote_catg (
            id         INTEGER PRIMARY KEY,
            catg_id    INTEGER,
            quot_id    INTEGER
            );') or croak $dbh->errstr;

        $dbh->disconnect or carp $dbh->errstr;

        $dbh = undef;
    };

    return $@ and croak 'Cannot create database tables!';

}

q(My cat's breath smells like cat food. --Ralph Wiggum);

lib/ACME/QuoteDB/LoadDB.pm  view on Meta::CPAN


* csv file (pre determined format)

     pros: quick and easy to load.
     cons: getting the quotes data into the correct format need by this module

=item 2

* any source.

    One can take quote data from any source, override
    L<ACME::QuoteDB::LoadDB/dbload> loader methods to populate a record
    and write it to the db.
     pros: can get any quote data into the db.
     cons: you supply the method. depending on the complexity of the data
           source and munging required this will take longer then the other 
           methods.

=back

=head3 load from csv file

lib/ACME/QuoteDB/LoadDB.pm  view on Meta::CPAN

   
   $load_db->data_to_db;

   if (!$load_db->success){print 'failed'}


=head3 load from any source

If those dont catch your interest, ACME::QuoteDB::LoadDB is sub-classable, 
so one can extract data anyway they like and populate the db themselves. 
(there is a test that illustrates overriding the stub method, 'dbload')

you need to populate a record data structure:

    $self->set_record(quote  => q{}); # mandatory
    $self->set_record(name   => q{}); # mandatory
    $self->set_record(source => q{}); # optional but useful
    $self->set_record(catg   => q{}); # optional but useful
    $self->set_record(rating => q{}); # optional but useful

    # then to write the record you call

lib/ACME/QuoteDB/LoadDB.pm  view on Meta::CPAN


=head2 dbload

if your file format is set to 'html' or 'custom' you must 
define this method to do your parsing in a sub class.

Load from html is not supported because there are too many 
ways to represt the data. (same with 'custom')
(see tests for examples - there is a test for loading a 'fortune' file format)

One can subclass ACME::QuoteDB::LoadDB and override dbload,
to do our html parsing

=head2 debug_record

dump record (show what is set on the internal data structure) 

e.g. Data::Dumper

=head2 set_record

lib/ACME/QuoteDB/LoadDB.pm  view on Meta::CPAN

 
=head2 write_record

takes the data structure 'record' '$self->get_record'
(which must exist). checks if attribution name ($self->get_record('name')) exists, 
if so, uses existing attribution name, otherwsie creates a new one

Load from html is not supported because there are too many 
ways to represt the data. (see tests for examples)

One can subclass ACME::QuoteDB::LoadDB and override dbload,
to do our html parsing

=head2 create_db_tables
 
create an empty quotes database (with correct tables). 

(usually only performed the first time you load data)

B<NOTE: will overwrite ALL existing data>

lib/ACME/QuoteDB/LoadDB.pm  view on Meta::CPAN

    know about them, so I will obfuscate them here

=head2 create_db_tables_sqlite

=head2 create_db_tables_mysql

=end comment

=head1 DIAGNOSTICS

An error such as:

C<DBD::SQLite::db prepare_cached failed: no such table: ,...>

probably means that you do not have a database created in the correct format.

basically, you need to create the database, usually, on a first run

you need to add the flag:

create_db => 1, # first run, create the db

t/01-load_quotes.t  view on Meta::CPAN

           'Grandpa Simpson',
           'Ralph Wiggum',
          );
  
  is( $sq->list_attr_names, join("\n", sort(@expected_attribution_list)));
}

{ # load from html is not supported because there are too many 
  # ways to represt the data.
  # this is an example of extracting quotes from html:
  # subclass ACME::QuoteDB::LoadDB and override dbload,
  # to do our html parsing
  package LoadQuoteDBFromHtml;
  use base 'ACME::QuoteDB::LoadDB';
  use Carp qw/croak/;
  use Data::Dumper qw/Dumper/;
  use HTML::TokeParser;

    sub dbload {
      my ($self, $file) = @_;

t/01-load_quotes.t  view on Meta::CPAN

            'From Kim "Howard" Johnson\'s',
            'Gareth McCaughan',
            'Gordon McMillan',
            'Guido van Rossum',
            'GvR',
            'Jack Jansen',
            'Jeremy Hylton',
            'Jim Ahlstrom',
            'Jim Fulton and Paul Everitt on the Bobo list',
            'Jim Fulton and Tim Peters',
            'John Eikenberry on the Bobo list',
            'John Holmgren',
            'John J. Lehmann',
            'John Redford',
            'Joseph Strout',
            "Kristj\x{E1}n J\x{F3}nsson",
            'Larry Wall',
            'Mark Jackson',
            'Matthew Lewis Carroll Smith',
            'Michael Palin',
            'Mike Meyer',

t/01-load_quotes.t  view on Meta::CPAN

            'Told by Nick Leaton',
            'Tom Christiansen',
            'Vladimir Marangozov and Tim Peters',
        );
  
  is( $sq->list_attr_names, join "\n", sort @expected_attribution_list);
}

{ # prove load a fortune format file
  # this is an example of importing a file in the 'fortune' format
  # subclass ACME::QuoteDB::LoadDB and override dbload, to do our parsing
  package Fortune2QuoteDB;
  use base 'ACME::QuoteDB::LoadDB';
  use Carp qw/croak/;
  use Data::Dumper qw/Dumper/;

  sub dbload {
    my ($self, $file) = @_;

    open my $source, '<:encoding(utf8)', $file || croak $!;

t/data/python_quotes.txt  view on Meta::CPAN


One of the things that makes it interesting, is exactly how much Guido has
managed to exploit that *one* implementation trick of 'namespaces'.
      -- Steven D. Majewski, 17 Sep 1993

Anyone familiar with Modula-3 should appreciate the difference between a
layered approach, with generic Rd/Wr types, and the Python 'C with foam
padding' approach.
      -- John Redford, 24 Nov 1993

People simply will not agree on what should and shouldn't be "an error", and
once exception-handling mechanisms are introduced to give people a choice, they
will far less agree on what to do with them.
      -- Tim Peters, 17 Dec 1993

Note that because of its semantics, 'del' *can't* be a function: "del a"
deletes 'a' from the current namespace. A function can't delete something from
the calling namespace (except when written by Steve Majewski :-).
      -- Guido van Rossum, 1 Aug 1994

    I don't know a lot about this artificial life stuff -- but I'm suspicious

t/data/python_quotes.txt  view on Meta::CPAN


I mean, just take a look at Joe Strout's brilliant little "python for
beginners" page. Replace all print-statements with sys.stdout.write(
string.join(map(str, args)) + "\n") and you surely won't get any new beginners.
And That Would Be A Very Bad Thing.
      -- Fredrik Lundh, 27 Aug 1996

Ya, ya, ya, except ... if I were built out of KSR chips, I'd be running at 25
or 50 MHz, and would be wrong about ALMOST EVERYTHING almost ALL THE TIME just
due to being a computer! Think about it -- when's the last time you spent 20
hours straight debugging your son/wife/friend/neighbor/dog/ferret/snake? And
they *still* fell over anyway? Except in a direction you've never seen before
each time you try it? The easiest way to tell you're dealing with a computer is
when the other side keeps making the same moronic misteakes over and misteakes
over and misteakes over and misteakes over and misteakes over and misteakes
CTRL-C again.
      -- Tim Peters, 30 Apr 1997

BTW, a member of the ANSI C committee once told me that the only thing rand is
used for in C code is to decide whether to pick up the axe or throw the dwarf,
and if that's true I guess "the typical libc rand" is adequate for all but the

t/data/python_quotes.txt  view on Meta::CPAN

of it, it probably was. Hee hee.
      -- Gordon McMillan, 8 Jun 1998

The majority of programmers aren't really looking for flexibility. Most
languages that enjoy huge success seem to do so not because they're flexible,
but because they do one particular thing *extremely* well. Like Fortran for
fast number-crunching in its day, or Perl for regexps, or C++ for compatibility
with C, or C for ... well, C's the exception that proves the rule.
      -- Tim Peters, 11 Jun 1998

It has also been referred to as the "Don Beaudry *hack*," but that's a
misnomer. There's nothing hackish about it -- in fact, it is rather elegant and
deep, even though there's something dark to it.
      -- Guido van Rossum, _Metaclass Programming in Python 1.5_

Just point your web browser at http://www.python.org/search/ and look for
"program", "doesn't", "work", or "my". Whenever you find someone else whose
program didn't work, don't do what they did. Repeat as needed.
      -- Tim Peters, on python-help, 16 Jun 1998

Now some people see unchecked raw power and flee from perceived danger, while

t/data/python_quotes.txt  view on Meta::CPAN

far it appears to be a beast that's compatible with cuddly pythons.
      -- Tim Peters, 6 Aug 1998

I wonder what Guido thinks he might do in Python2 (assuming, of course, that he
doesn't hire a bus to run over him before then <wink>).
      -- Tim Peters, 26 Aug 1998

After writing CGI scripts the traditional way for a few years, it is taking
awhile to reshape my thinking. No sledgehammer to the head yet, but lots of
small sculpting hammers...
      -- John Eikenberry on the Bobo list, 27 Aug 1998

I believe sometimes numbers creep into my programs as strings, so '4'/2 needs
to also be 2. Other languages do this. Since this is due in part to user input,
I guess 'four'/2, 'quattro/2', 'iv/2' etc. need to be 2 as well; don't know any
other language that does so, but Python could take the lead here in software
reliability. Any white space should be ignored, including between my ears. I
don't have time to write any useful software, so I've decided to devote myself
to proposing various changes to the Python interpreter.
      -- Donn Cave uses sarcasm with devastating effect, 28 Aug 1998

t/data/python_quotes.txt  view on Meta::CPAN


    "Can we kill this thread? The only thing it does as far as I'm concerned is
increase the posting statistics. :-)"
    "don't-open-cans-of-worms-unless-you're-looking-for-a-new-diet-ly y'rs"
      -- Guido van Rossum and Tim Peters, 6 Jan 1999

    Hey, that was the first truly portable laptop! Of course I'm nostalgic.
Came with a mighty 24Kb RAM standard, & I popped the extra $80 to max it out at
32Kb. Much of Cray's register assigner was developed on that beast: unlike the
prototype Crays of the time, the M100 was always available and never crashed.
Even better, I could interrupt it any time, poke around, and resume right where
it left off <wink>.
    m100-basic-reminded-me-a-lot-of-python-except-that-it-sucked-ly y'rs
      -- Tim Peters remembering the Model 100, 10 Jan 1999

    "Heh -- all it really broke so far was my resistance to installing Tk. I
suppose wizardry is inevitable after one installs something, though <wink>."
    "Spoken like a truly obsessive-compulsive wizard! It-takes-one-to-know
-one..."
      -- Tim Peters and Guido van Rossum, 6 Jan 1999

t/data/python_quotes.txt  view on Meta::CPAN

and prototype, until you've got clean separation of the system into managable
pieces, then code in whatever language most suits the need of each piece.
      -- Gordon McMillan, 15 Dec 1999

When Jim [Fulton] says "tricky" it means your brain could explode.
      -- Michel Pelletier, 15 Dec 1999

You have start-tags, attributes, end-tags and character data. We have all seen
"XML applications" and "XML parsers" which handle this gang- of-four concepts.
... Now we can peer over the parapet and shout "your parser smells of
elderberries" or "I wave my mixed content at your ankles", as long as we like
but the simple gang-of-four base apps will not go away.
      -- Sean McGrath, 19 Dec 1999

Abstraction is one of those notions that Python tosses out the window, yet
expresses very well.
      -- Gordon McMillan, 6 Jan 2000

The set of naming conventions has a cardinality equal to the number of Python
users.
      -- Gordon McMillan, 6 Jan 2000

t/data/python_quotes.txt  view on Meta::CPAN

The way to build large Python applications is to componentize and
loosely-couple the hell out of everything.
      -- Aahz Maruch, 6 Jan 2000

It's not the mail volume that bothers me -- I can ignore 100s of messages a day
very quickly. It's the time it takes to respond to all of them.
      -- Guido van Rossum, 20 Jan 2000

This is the way of Haskell or Design by Contract of Eiffel. This one is like
wearing a XV century armor, you walk very safely but in a very tiring way.
      -- Manuel Gutierrez Algaba, 26 Jan 2000

Life's better without braces.
      -- Unofficial motto of IPC8, coined by Bruce Eckel

"Aggressive" means "sometimes wrong".
      -- John Aycock at IPC8, during his "Agressive Type Inferencing" talk

Do I do everything in C++ and teach a course in advanced swearing?
      -- David Beazley at IPC8, on choosing a language for teaching

t/data/python_quotes.txt  view on Meta::CPAN

dictator, but also wants to treat people like grownups. This probably worked
better before Python got a large American audience <0.9 wink>.
      -- Tim Peters, 10 Feb 2000

I have formal proofs that any change of the indentation rules results in 35%
increase of the page faults for only 63.7% of the cache misses. The net effect
is an overall slowdown of 10%.
      -- Vladimir Marangozov after Yet Another indentation flamewar, 16 Feb
         2000

... let me just say that my least-favourite Python error message is
"SyntaxError: invalid syntax", which somehow manages to be both overly terse
and redundant at the same time.
      -- Greg Ward, 15 Feb 2000

    See, functional programmers are an insular lot. You rarely see them in
public, except at parades when they all have antler- hats and silly shoes on.
So they completely missed the infamous "goto considered harmful" thread and
didn't even realize they were doing anything wrong.
    Now, let's pretend you're writing a 'bot that can pass as a functional
programmer. There's a complex protocol here. When two functional programmers

t/data/python_quotes.txt  view on Meta::CPAN

You didn't say what you want to accomplish. If the idea of "provably correct"
programs appeals to you, Eiffel will give you more help than any other
practical language I know of. But since your post didn't lay out your
assumptions, your goals, or how you view language characteristics as fitting in
with either, you're not a *natural* candidate for embracing Design by Contract
<0.6 wink>.
      -- Tim Peters, 3 Jun 2001

    The static people talk about rigorously enforced interfaces, correctness
proofs, contracts, etc. The dynamic people talk about rigorously enforced
testing and say that types only catch a small portion of possible errors. The
static people retort that they don't trust tests to cover everything or not
have bugs and why write tests for stuff the compiler should test for you, so
you shouldn't rely on *only* tests, and besides static types don't catch a
small portion, but a large portion of errors. The dynamic people say no program
or test is perfect and static typing is not worth the cost in language
complexity and design difficulty for the gain in eliminating a few tests that
would have been easy to write anyway, since static types catch a small portion
of errors, not a large portion. The static people say static types don't add
that much language complexity, and it's not design "difficulty" but an
essential part of the process, and they catch a large portion, not a small
portion. The dynamic people say they add enormous complexity, and they catch a
small portion, and point out that the static people have bad breath. The static
people assert that the dynamic people must be too stupid to cope with a real
language and rigorous requirements, and are ugly besides.
    This is when both sides start throwing rocks.
      -- Quinn Dunkan, 13 Jul 2001

I am becoming convinced that Unicode is a multi-national plot to take over the

t/data/www.amk.ca/quotations/python-quotes/index.html  view on Meta::CPAN

<p class='source'>Tim Peters, 16 Sep 1993</p>
<p class='quotation' id='q17'>One of the things that makes it
interesting, is exactly how much Guido has managed to exploit that
<em>one</em> implementation trick of 'namespaces'.</p>
<p class='source'>Steven D. Majewski, 17 Sep 1993</p>
<p class='quotation' id='q18'>Anyone familiar with Modula-3 should
appreciate the difference between a layered approach, with generic
Rd/Wr types, and the Python 'C with foam padding' approach.</p>
<p class='source'>John Redford, 24 Nov 1993</p>
<p class='quotation' id='q19'>People simply will not agree on what
should and shouldn't be "an error", and once exception-handling
mechanisms are introduced to give people a choice, they will far
less agree on what to do with them.</p>
<p class='source'>Tim Peters, 17 Dec 1993</p>
<p class='quotation' id='q20'>Note that because of its semantics,
'del' <em>can't</em> be a function: "del a" deletes 'a' from the
current namespace. A function can't delete something from the
calling namespace (except when written by Steve Majewski :-).</p>
<p class='source'>Guido van Rossum, 1 Aug 1994</p>
<p class='quotation' id='q21'>I don't know a lot about this
artificial life stuff -- but I'm suspicious of anything Newsweek

t/data/www.amk.ca/quotations/python-quotes/page-2.html  view on Meta::CPAN

Strout's brilliant little "python for beginners" page. Replace all
print-statements with <code>sys.stdout.write( string.join(map(str,
args)) + "\n")</code> and you surely won't get any new beginners.
And That Would Be A Very Bad Thing.</p>
<p class='source'>Fredrik Lundh, 27 Aug 1996</p>
<p class='quotation' id='q43'>Ya, ya, ya, except ... if I were
built out of KSR chips, I'd be running at 25 or 50 MHz, and would
be wrong about ALMOST EVERYTHING almost ALL THE TIME just due to
being a computer! Think about it -- when's the last time you spent
20 hours straight debugging your
son/wife/friend/neighbor/dog/ferret/snake? And they <em>still</em>
fell over anyway? Except in a direction you've never seen before
each time you try it? The easiest way to tell you're dealing with a
computer is when the other side keeps making the same moronic
misteakes over and misteakes over and misteakes over and misteakes
over and misteakes over and misteakes CTRL-C again.</p>
<p class='source'>Tim Peters, 30 Apr 1997</p>
<p class='quotation' id='q44'>BTW, a member of the ANSI C committee
once told me that the only thing rand is used for in C code is to
decide whether to pick up the axe or throw the dwarf, and if that's
true I guess "the typical libc rand" is adequate for all but the

t/data/www.amk.ca/quotations/python-quotes/page-3.html  view on Meta::CPAN

come to think of it, it probably was. Hee hee.</p>
<p class='source'>Gordon McMillan, 8 Jun 1998</p>
<p class='quotation' id='q71'>The majority of programmers aren't
really looking for flexibility. Most languages that enjoy huge
success seem to do so not because they're flexible, but because
they do one particular thing <em>extremely</em> well. Like Fortran
for fast number-crunching in its day, or Perl for regexps, or C++
for compatibility with C, or C for ... well, C's the exception that
proves the rule.</p>
<p class='source'>Tim Peters, 11 Jun 1998</p>
<p class='quotation' id='q72'>It has also been referred to as the
"Don Beaudry <em>hack</em>," but that's a misnomer. There's nothing
hackish about it -- in fact, it is rather elegant and deep, even
though there's something dark to it.</p>
<p class='source'>Guido van Rossum, <cite>Metaclass Programming in
Python 1.5</cite></p>
<p class='quotation' id='q73'>Just point your web browser at
http://www.python.org/search/ and look for "program", "doesn't",
"work", or "my". Whenever you find someone else whose program
didn't work, don't do what they did. Repeat as needed.</p>
<p class='source'>Tim Peters, on python-help, 16 Jun 1998</p>

t/data/www.amk.ca/quotations/python-quotes/page-3.html  view on Meta::CPAN

pythons.</p>
<p class='source'>Tim Peters, 6 Aug 1998</p>
<p class='quotation' id='q86'>I wonder what Guido thinks he might
do in Python2 (assuming, of course, that he doesn't hire a bus to
run over him before then &lt;wink&gt;).</p>
<p class='source'>Tim Peters, 26 Aug 1998</p>
<p class='quotation' id='q87'>After writing CGI scripts the
traditional way for a few years, it is taking awhile to reshape my
thinking. No sledgehammer to the head yet, but lots of small
sculpting hammers...</p>
<p class='source'>John Eikenberry on the Bobo list, 27 Aug 1998</p>
<p class='quotation' id='q88'>I believe sometimes numbers creep
into my programs as strings, so '4'/2 needs to also be 2. Other
languages do this. Since this is due in part to user input, I guess
'four'/2, 'quattro/2', 'iv/2' etc. need to be 2 as well; don't know
any other language that does so, but Python could take the lead
here in software reliability. Any white space should be ignored,
including between my ears. I don't have time to write any useful
software, so I've decided to devote myself to proposing various
changes to the Python interpreter.</p>
<p class='source'>Donn Cave uses sarcasm with devastating effect,



( run in 0.525 second using v1.01-cache-2.11-cpan-cba739cd03b )