[27178] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9004 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 28 18:05:47 2006

Date: Tue, 28 Feb 2006 15:05:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 28 Feb 2006     Volume: 10 Number: 9004

Today's topics:
    Re: A Problem With GD <tadmc@augustmail.com>
    Re: Import other perl files <tadmc@augustmail.com>
    Re: Keith Keller - Coward currys favour <tadmc@augustmail.com>
    Re: Keith Keller - Coward currys favour <rr@rrrrrr.org>
    Re: References as Hash Keys, Tree Structures (Newbie) ( <abigail@abigail.nl>
        Searching a sorted array of strings <newsAT@screenlightDOT.com>
    Re: Searching a sorted array of strings <1usa@llenroc.ude.invalid>
        The Perl Review, Spring 2006: The Sudoku Issue <brian.d.foy@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 28 Feb 2006 15:30:38 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: A Problem With GD
Message-Id: <slrne09g7u.brf.tadmc@magna.augustmail.com>

Mark Manning <markem@airmail.net> wrote:
> Tad McClellan wrote:


>> The newsgroup does not exist to serve you, it exists to serve
>> the community.
> 
> Didn't ask it to do so.


Yes you did.


>> Being disingenuous like that weakens your argument.
> 
> It is not being disingenuous.  


You snipped the "it" that is the object of your sentence. The it was:

   It was never meant to be some super-duper, ass kissing, 
   way of doing something.


>> Observing the basics such as pragmas and indenting is hardly
>> super-duperizing things. 


You claimed that pragmas and indenting are super-duperizing things
when they are nothing more than common courtesty.

Hence, being disingenuous.


>> Errr, yes, we could all tell.


You again snipped what it was that we could all tell, what
we could all tell was:

   It was just some thrown together code.


> Obviously not.  


Obviously so, by your own admission (the one you snipped).


> Otherwise - why all of the fuss?  


Because it was, as you said, just thrown together.


> I guess your mom never taught you the basics of kindness and 
> consideration - did she?


My mother passed away just two weeks ago.

Thanks for that.


>> If you are not willing to invest a little bit in making it
>> easier to help you solve your problem, then it is unreasonable 
>> to expect volunteers to invest in it.
> 
> No.  


Yes.


> It is unreasonable for volunteers to try to force their view on the 
> rest of the world.  


No it isn't. They are _volunteers_.

They can put any preconditions they care to on getting some of their time.


> Do you truly believe that anyone wants to post here 
> and get the response you are giving me?  


Of course not.

That is exactly why the group collected together a list of
things to do that help avoid getting such responses.


>> This newsgroup is NOT A HELP DESK!
> 
> You are mis-quoting.  I did not say it WAS a help desk.  I said IF it 
> was a help desk.  That is what this is like.  
                                 ^^^^^^^^^^^^

This newsgroup is NOT like a help desk.


>> The social dynamic is very different from a help desk.
> 
> By "social dynamic" I take it to mean it's more like a gang meeting 
> where the toughest acting person gets their way?


No, it's more like a society where folks that follow the social
mores are accepted into the society while those that don't
are ostracised.

Just like every other society.


>   I can see that.


No you can't.


>> It is *you* who are acting as if you own Usenet by flat-out
>> refusing to do things in a socially acceptable manner, and
>> attempting to change all of us to conform to "your way".
> 
> Ah!  The "you must conform" statement again.  Beehive mentality.  


No, "human interaction" mentality.


> I've disrupted the hive and now the bees are all angry. 


If you fart at the dinner table, you are not likely to
be invited to dinner in the future.


>> Just format code for human consumption, and ask the machine for
>> help before asking hundreds of live humans for help. It isn't
>> much to ask.
> 
> I didn't ask for help.  


Yes you did.

You asked for help with finding someone to report your "bug" to.


> No - it is me asserting my right to do as I please.  


If it pleases you to fart at the dinner table, then you must
be prepared to take the consequences like a man rather than
arguing that farting should be OK instead of frowned upon.


>> If you take cuts in line, then don't whine when someone
>> calls you on it.
> 
> Eh?  Can you maybe explain this?


Yes I can.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 28 Feb 2006 15:32:55 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Import other perl files
Message-Id: <slrne09gc7.brf.tadmc@magna.augustmail.com>

eeeeee eeeeeeee <ee@eeeeee.org> wrote:
> A. Sinan Unur <1usa@llenroc.ude.invalid> trolled:
>> Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote in 
> 
> [deleteia]
> 
>> Of course. Thanks for catching that.
> 
> Please do not respond to Coward Keith Keller.


Please do not post to our newsgroup.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 28 Feb 2006 15:35:26 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Keith Keller - Coward currys favour
Message-Id: <slrne09ggu.brf.tadmc@magna.augustmail.com>

rrrrrr rrrrrrrr <rr@rrrrrr.org> wrote:

> Keith Keller is a coward fit for killfiles.


Roger Maynard is a fool fit for killfiles.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 28 Feb 2006 22:14:20 GMT
From: rrrrrr rrrrrrrr <rr@rrrrrr.org>
Subject: Re: Keith Keller - Coward currys favour
Message-Id: <0X3Nf.2764$RM2.310669@news20.bellglobal.com>

Tad McClellan <tadmc@augustmail.com> trolled:
> rrrrrr rrrrrrrr <rr@rrrrrr.org> wrote:

> > Keith Keller is a coward fit for killfiles.

> Roger Maynard is a fool fit for killfiles.

?!?



------------------------------

Date: 28 Feb 2006 20:02:46 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: References as Hash Keys, Tree Structures (Newbie) (Was: simple pointer operations (newbe))
Message-Id: <slrne09b36.h1.abigail@alexandra.abigail.nl>

Tassilo v. Parseval (tassilo.von.parseval@rwth-aachen.de) wrote on
MMMMDLXIV September MCMXCIII in <URL:news:46ihi4Fb1mfsU1@news.dfncis.de>:
:)  
:)  Yes, inside-out indeed seems to be Perl-centric. On the other hand, it's
:)  nothing that would have been invented by the Perl folks. They are a
:)  variation on the flyweight-pattern where an object is a very lightweight
:)  entity ($dummy in the above article) and it is used to look up the real
:)  data from some static container outside the caller's scope.
:)  
:)  Besides avoiding typos, they have some other advantages. One is that
:)  subclassing becomes easier and safer as the access to an object's
:)  innards happens exlusively through accessor methods.

That's not quite right. The essence of avoiding name clashes doesn't
lie in exclusive access through accessor methods, it lies in storing
attributes in a structure that's bound to the class that uses the
attributes, and not the object.

Now usually this means you use a lexical hash, and you use one class
per file, so accessors is the only feasible access. But it doesn't have
to. If you do something like:

    package MyClass;

    our %attribute;    # Instead of 'my %attribute'.

    ...

you can access attributes defined in another class without accessor methods,
and still enjoy all the benefits InsideOut objects give you. Using 'our'
instead of 'my' maybe handy if you want to write a serialiser.

Remember, inside-out objects aren't about enforcing encapsulation, it's
all about preventing *accidental* globbering someone elses internals.



Abigail
-- 
BEGIN {my $x = "Knuth heals rare project\n";
       $^H {integer} = sub {my $y = shift; $_ = substr $x => $y & 0x1F, 1;
       $y > 32 ? uc : lc}; $^H = hex join "" => 2, 1, 1, 0, 0}
print 52,2,10,23,16,8,1,19,3,6,15,12,5,49,21,14,9,11,36,13,22,32,7,18,24;


------------------------------

Date: Tue, 28 Feb 2006 21:01:57 GMT
From: one man army <newsAT@screenlightDOT.com>
Subject: Searching a sorted array of strings
Message-Id: <newsAT-F2B04B.13015428022006@newsclstr02.news.prodigy.com>

Hi All-
  I am an infrequent user of Perl. I sat down this morning to do a 
simple task, which started with referring to some data. It took me a 
while to write this simple routine, making most every mistake on the 
way. Perhaps it will be useful to someone. 
I tried to use qw( "name" "name space" ); and had problems, so I use the 
long form. Constructive comments welcome.

  The array is almost a thousand elements actually, edited for usenet
<- snip ->
#! /usr/bin/perl -w

use strict;
use warnings;

my @CA_Cities = (
   "adelanto", "agoura hills", "alameda", "alamo", "albany", "alhambra",    
"newman", "newport beach", "nipomo", "norco", "north auburn", 
   "north highlands", "norwalk", "novato", "oakdale", "oakland",    
"oceanside", "oildale", "ojai", "olivehurst", "ontario", "opal cliffs",    
"orange cove", "orangevale", "orcutt", "orinda", "orland", "orosi",    
"oroville east", "oxnard", "pacific grove", "pacifica", "palm desert",    
"palmdale", "palo alto", "palos verdes estates", "paradise", "paramount",
   "parkway-south sacramento", "parlier", "pasadena", "patterson",    
"petaluma", "pico rivera", "piedmont", "pinole", "pismo beach",    
"placentia", "placerville", "pleasant hill", "pleasanton", "pomona",    
"porterville", "portola hills", "poway", "prunedale", "quartz hill", 
"ramona",
   "rancho cordova", "rancho cucamonga", "rancho mirage", 
   "rancho san diego", "rancho santa margarita", "red bluff", "redding", 
"redlands", "redondo beach",
   "redwood city", "reedley", "rialto", "richmond", "ridgecrest", 
   "rio del mar", "ripon", 
   "west whittier-los nietos", "westlake village", "westminster", 
"westmont",
   "whittier", "wildomar", "willowbrook", "willows", "windsor", "winter 
gardens","winters", "winton", "woodcrest", "woodlake", "woodland", 
"yorba linda", "yreka", "yuba city", "yucaipa", "yucca valley"
);

sub match_City {
   
   my( $findme ) = @_;
   my( $start, $end ) = ( 0, $#CA_Cities );
   my( $idx );
   my $cnt = 0;
   
   # convert to lowercase
   $findme =~ s/([A-Z]+)/\L$1/g;
   print "\nSEARCH\n";
   print "findme= " . $findme . "\n";
      
   while ( $start != $end && $cnt < $#CA_Cities)  {
   
      #note start and end never become equal in alot of cases
      $idx = int (( $end - $start ) / 2) + $start;
      
      print "a[i]= " . $CA_Cities[ $idx ] . " ";
      
      if ( $CA_Cities[ $idx ] eq $findme ) {
         return $findme;
   
      } elsif ( $CA_Cities[ $idx ] gt $findme ) {
         $end = $idx;
   
      } elsif ( $CA_Cities[ $idx ] lt $findme ) {
         $start = $idx;
      }
   
      print "idx= " . $idx . " start= " . $start . " end= " . $end . " 
cnt= " . $cnt ."\n";
      $cnt++;
   }
   
   return "not found\n"; 
}

## Test this
print "\n" . match_City( "ripon" );
print "\n" . match_City( "riPoN" );
print "\n" . match_City( "Ripon" );
print "\n" . match_City( "yorba linda" );
print "\n" . match_City( $CA_Cities[ int(rand $#CA_Cities) ] );
print "\n" . match_City( $CA_Cities[ int(rand $#CA_Cities) ] );
print "\n" . match_City( $CA_Cities[ int(rand $#CA_Cities) ] );
print "\n" . match_City( "Fred" );


------------------------------

Date: Tue, 28 Feb 2006 22:12:34 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Searching a sorted array of strings
Message-Id: <Xns9778AF2985FA2asu1cornelledu@127.0.0.1>

one man army <newsAT@screenlightDOT.com> wrote in
news:newsAT-F2B04B.13015428022006@newsclstr02.news.prodigy.com: 

> It took me a while to write this simple routine, making most every 
> mistake on the  way. Perhaps it will be useful to someone. 

Not likely. 

> Constructive comments welcome.

Don't reinvent the wheel.

> #! /usr/bin/perl -w
> 
> use strict;
> use warnings;
> 
> my @CA_Cities = (

As the Paul mentioned, use a hash.

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html



------------------------------

Date: Tue, 28 Feb 2006 13:34:47 -0600
From: brian d  foy <brian.d.foy@gmail.com>
Subject: The Perl Review, Spring 2006: The Sudoku Issue
Message-Id: <280220061334473937%brian.d.foy@gmail.com>

The next issue of The Perl Review is just around the corner, and it's
almost completely devoted to Sudoku, including programs to create
puzzles, solve puzzles, and several puzzles to solve on your own.

If you haven't subscribed, now's the time to get your name on the
list. If you're a subscriber who hasn't renewed, do so now or risk
missing an issue.

TPR is the only print magazine devoted to Perl.

   http://www.theperlreview.com/

Issue 2.2, Spring 2006

   * Working with Bit Vectors - brian d foy

   * Function Anti-Patterns - Alberto Manuel Simões

   * Generating Sudoku - Eric Maki

   * Sudoku from PDF::API2 - brian d foy

   * A Perl-based Sudoku Solver - Mark Haselup
   
   plus book reviews, news, commentary, and more.
   
-------------------------------------------------------------------------

Issue 2.1, Winter 2005

   * Seven Sins of OO Programming - chromatic
   * Hash Anti-Patterns - Alberto Manuel Simões
   * PerlWar - Yanick Champoux
   * Haskell for Perlers - Frank Antonsen
   
-------------------------------------------------------------------------

Issue 2.0, Fall 2005

   * Logic Programming in Perl - Curtis "Ovid" Poe
   * Object-oriented Perl - Alberto Manuel Simões
   * The Visitor Design Pattern - brian d foy
   * Pod Indexing Project - Ivan Tubert-Broham
   * TPF: Google Summer of Code - Jim Brandt
   
-------------------------------------------------------------------------

Issue 1.3, Summer 2005

   * Programming Glade in Perl - Grant McLean
   * Array Anti-Patterns - Alberto Manuel Simões
   * Test::Random - David Golden
   * Serious Perl - Henning Koch
   
-------------------------------------------------------------------------

Issue 1.2, Spring 2005

   * Hashes with History -- Alberto Manuel Simões
   * Test::Number::Delta -- David Golden
   * 9-Block Quilt Patterns in Perl -- Daniel Allen
   * Packet Sniffing with Perl -- Gerry Finkel

-------------------------------------------------------------------------

Issue 1.1, Winter 2004

   * Down Translating XML -- Alberto Manuel Simões
   * Module::Release and Beyond -- brian d foy
   * Functional Perl Programming -- Frank Antonsen
   * Faking Stored Procedures -- Zach Thompson

-------------------------------------------------------------------------

The first print issue ( 1.0 ) is still available to subscribers online
as a PDF file, and some back issues are available.

   * Test Driven Development -- Denis Kosykh
   * Just do{} it -- brian d foy
   * Extending XML::XPath -- Michel Rodriguez
   * Test::More in 20 Seconds -- brian d foy
   * Magick Tile Puzzles -- Grant McLean

Before that, The Perl Review was a digital only version with
eight issues which are still available for free download as
PDF files.

   http://www.theperlreview.com/Issues/

-------------------------------------------------------------------------

RSS Feeds are available too.

   Subscriber only (current) issues
      http://www.theperlreview.com/RSS/tpr-subscribers.rdf

   Free Issues and articles
      http://www.theperlreview.com/RSS/tpr-free.rdf

   The Perl Review news
      http://www.livejournal.com/users/perl_review/data/rss

   The Perl Review public discussion
      http://www.livejournal.com/community/the_perl_review/data/rss

-------------------------------------------------------------------------

Want to write for TPR? Send us a note, or submit an idea online

   http://www.theperlreview.com/Authors/submit.html

-------------------------------------------------------------------------

Prices: $16 in the US, $30 outside the US.  Web only subscriptions
are $16. If we can get enough subscribers in the European Union, we'll
start printing there too and lower the cost. If you like, you can
start your subscription with the Winter 2004 issue and save money
by not having to buy the back issue later.

TPR accepts MasterCard, Visa, American Express, PayPal, Amazon.com
Honors System, and check or money order in US dollars.  Sorry, but we
can only accept advance payment since we're too small to do handle
individual billing.

Samples to Perl user groups, Perl instructors, and other worthy causes
are available.
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 9004
***************************************


home help back first fref pref prev next nref lref last post