[27169] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9000 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 27 18:05:51 2006

Date: Mon, 27 Feb 2006 15:05:04 -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           Mon, 27 Feb 2006     Volume: 10 Number: 9000

Today's topics:
    Re: A Problem With GD <1usa@llenroc.ude.invalid>
    Re: A Problem With GD <1usa@llenroc.ude.invalid>
    Re: A Problem With GD <1usa@llenroc.ude.invalid>
    Re: A Problem With GD <rvtol+news@isolution.nl>
        Import other perl files <robin.wilson@16pentlandclose.com>
    Re: Import other perl files <1usa@llenroc.ude.invalid>
    Re: References as Hash Keys, Tree Structures (Newbie) ( <vtatila@mail.student.oulu.fi>
    Re: References as Hash Keys, Tree Structures (Newbie) ( <tassilo.von.parseval@rwth-aachen.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 27 Feb 2006 19:14:34 +0000 (UTC)
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: A Problem With GD
Message-Id: <Xns977790E34C4A2asu1cornelledu@132.236.56.8>

Ch Lamprecht <christoph.lamprecht.no.spam@web.de> wrote in
news:dtvg60$s6c$1@online.de: 

> Mark Manning wrote:
> 
> 
>>  There is a problem in the colorAllocate routine which causes it to
>>  over 
>> write a section of the image.  
>
>
> Sorry, but that's not true.

He can't handle the truth! ;-)

Sinan


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

Date: Mon, 27 Feb 2006 19:58:53 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: A Problem With GD
Message-Id: <Xns9777987F99118asu1cornelledu@127.0.0.1>

Mark Manning <markem@airmail.net> wrote in
news:120635qmka1si39@corp.supernews.com: 

> Uri Guttman wrote:
> 
>> he insulted your code, not you. seems you have major difficulties
>> separating those two. see a professional therapist to help you
>> overcome your identity crisis. you are not your code. code posted
>> here is open for review no matter how or who wrote it. didn't you see
>> the sign on the door when you came int?
> 
> Yes he did - but >I< did not ask him to.

You might be missing the point of UseNet: When I have a question/issue, 
I find a group where my question is relevant, and then post it to 
receive any feedback anyone on that group can give.

Each group has its own rules. As I try to stay away from the alt.* 
hierarchy, it is not hard to find out what those rules are and follow 
them.

c.l.p.m. also has rules. One of those is that you need to provide enough 
information with your post. IMNSHO, that is especially true when you are 
blaming mistakes in the code on imagined defects in someone else's 
library in a public forum.

>> you haven't traded insults with anyone. you have acted like a jerk
>> defending your bad code. as of conforming, that isn't the
>> issue. awareness of code quality it. but your blind eye won't see
>> that so you take code review as a personal insult. bad to be you and
>> worse to be your code.
> 
> Again, it was TEST CODE.  An example.  It was never meant to be some 
> super-duper, ass kissing, way of doing something.  It was just some 
> thrown together code.

In that case, how can you make the claim that there is a bug in GD.pm?

By the way, you seem to have a fascination with rear-ends? Why do you 
have to mention them every few words? Could you stop cursing maybe?

> But the real problem is - why didn't Mr. Unur focus on fixing the 
> problem?  

Now, this is puzzling me: Why, after calling me an ass several times in 
an earlier post, do you think calling me Mr. is going change the fact 
that you act like a six year old kid?

> He has absolutely no way of knowing who I am or what I do

This is not about you.

> yet he made snide comments that I feel are unbecoming of someone who 
> professes to offer their help. Do you REALLY think offering up 
> criticisms is a great way to go about helping someone?  Do you call a 
> help desk expecting them to say if you'd only conform to how they
> think you're supposed to be life would be better?

It would take quite a salary for me to leave my current job, and work at 
a help desk. I do not think you could afford it.

> Therefore, the problem isn't that I took insult from his rudeness.  It
> is that I am standing up to him and you think he's right.  Which tells
> me a lot about your mental unwellness.  

Well, let me see, you call people names,

> And you do know what assumed means don't you?  It makes an ASS out of 
> YOU and ME.

Half-right. That is good enough for me.

> Nope.  No problems.  

Right.

> There is a problem in the colorAllocate routine which causes it to 
> over write a section of the image.  Once started, the more you do
> things with the image - the more dots get written to the image.  So
> ha! back to ya boyo!

Even with this attitude, there are people in this group who are trying 
to help you. You would be well advised to read the most recent posts by 
Ch Lambert, for example.

> here is the pin prick 

 ...

> I post when and where I please.

Exactly. Do you think others do not have that right.

> "We own Usenet!" 

Yep, that's exactly what you sound like.

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: Mon, 27 Feb 2006 20:05:37 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: A Problem With GD
Message-Id: <Xns977799A442F21asu1cornelledu@127.0.0.1>

"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in 
news:Xns9777987F99118asu1cornelledu@127.0.0.1:

> Ch Lambert, 

Apologies, Christoph, for butchering your name. I, of course, had meant to 
write 'Lamprecht'.

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: Mon, 27 Feb 2006 23:30:21 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: A Problem With GD
Message-Id: <du02i5.u0.1@news.isolution.nl>

Ch Lamprecht schreef:

> $fg = ($fg_r << 16) | ($fg_g << 8) | $fg_b;

Variant:

$fg = unpack 'L', pack 'C4', $fg_b, $fg_g, $fg_r

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: Mon, 27 Feb 2006 22:06:09 GMT
From: "Robin Wilson" <robin.wilson@16pentlandclose.com>
Subject: Import other perl files
Message-Id: <lJKMf.5852$Ru5.4826@newsfe6-gui.ntli.net>

I have a perl file which I would like to divide up into 2 perl files so that 
the content is seperate

I created 2 files and then moves some variables into the other file but I 
cannot work out how to include the second file

I thought the syntax was:

USE FILE.PL

but that's not working

Please can someone tell me the correct syntax

Thanks
Robin 




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

Date: Mon, 27 Feb 2006 22:09:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Import other perl files
Message-Id: <Xns9777AEABEC502asu1cornelledu@127.0.0.1>

"Robin Wilson" <robin.wilson@16pentlandclose.com> wrote in
news:lJKMf.5852$Ru5.4826@newsfe6-gui.ntli.net: 

> I have a perl file which I would like to divide up into 2 perl files
> so that the content is seperate
> 
> I created 2 files and then moves some variables into the other file
> but I cannot work out how to include the second file
> 
> I thought the syntax was:
> 
> USE FILE.PL

use not USE. Case matters.

perldoc use

> but that's not working
> 
> Please can someone tell me the correct syntax

Reading the docs will tell you that.

You should also read:

perldoc perlmod

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: Mon, 27 Feb 2006 21:39:42 +0200
From: "Veli-Pekka Tätilä" <vtatila@mail.student.oulu.fi>
Subject: Re: References as Hash Keys, Tree Structures (Newbie) (Was: simple pointer operations (newbe))
Message-Id: <dtvki0$6l2$1@news.oulu.fi>

Tassilo v. Parseval wrote:
> You are blurring the distinction between the key that is to be hashed
> and the result of this hashing, namely the hash code.
Umm yes, the equals method in the Java example applies to the object to be 
hashed but the hash code returned by that object is used as the index. Which 
naturally leads to the question, what are hashed objects as keys good for if 
anything? So far I haven't been able to think of any real good uses.

> Think of a hash as an array where a key/value pair is stored inside one of 
> the array's element.
<code snipped>
Thanks for the explanation, actually I knew most of this already and yet 
again realized my mistake only some time after having hit the send message 
menu item. THe first good explanation I read on hashes was in the K&R book. 
They say quite compactly that a hash is an array of pointers to linked lists 
holding data. You index to this array based on a hash code computed from the 
data to be hashed in some way, such as using modulo. And just the other day 
I was reading the book Fundamentals of Database Systems, which also talks 
about various collision resolving methods and indexing in general.

Which reminds me, why do most programming languages including Perl stop to 
vectors and hashes as far as the fancy out-of-the-box data structures go? 
Why not extend this to, say, B plus trees, among others, as people willl 
have to code them sooner or later. Yep, I know there are B-trees for Perl, I 
just read an excellent tutorial on one. But it would be nice to have 
efficient, balanced tree structures available by default as modules, 
especially as they aren't that trivial to implement well.

> can now use a hash with only two buckets and yet store an arbitrary amount 
> of key/value pairs
Which reminds me what's the origin of the term bucket when talking about 
Hashes? K&R didn't mention it so I was initially pretty confused when I saw 
the term. As far as I've understood it, a bucket is just the head of a 
linked list stored in the array.

-- 
With kind regards Veli-Pekka Tätilä (vtatila@mail.student.oulu.fi)
Accessibility, game music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila/ 




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

Date: Mon, 27 Feb 2006 22:40:21 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: References as Hash Keys, Tree Structures (Newbie) (Was: simple pointer operations (newbe))
Message-Id: <46h9u8Fb19siU1@news.dfncis.de>

Also sprach Veli-Pekka Tätilä:

> Tassilo v. Parseval wrote:
>> You are blurring the distinction between the key that is to be hashed
>> and the result of this hashing, namely the hash code.
> Umm yes, the equals method in the Java example applies to the object to be 
> hashed but the hash code returned by that object is used as the index. Which 
> naturally leads to the question, what are hashed objects as keys good for if 
> anything? So far I haven't been able to think of any real good uses.

Nowadays they are commonly used for the implementation of inside-out
objects. Whenever you want to associate some additional data with an
object, the ability to use it as hash-key is useful.

>> Think of a hash as an array where a key/value pair is stored inside one of 
>> the array's element.
><code snipped>
> Thanks for the explanation, actually I knew most of this already and yet 
> again realized my mistake only some time after having hit the send message 
> menu item. THe first good explanation I read on hashes was in the K&R book. 
> They say quite compactly that a hash is an array of pointers to linked lists 
> holding data. You index to this array based on a hash code computed from the 
> data to be hashed in some way, such as using modulo. And just the other day 
> I was reading the book Fundamentals of Database Systems, which also talks 
> about various collision resolving methods and indexing in general.

Indeed. There are many different methods to resolve collisions. Another
common one gets away without using a linked list: On a collision, the
moduloed hash-code is simply incremented till a free array element has
been found. If you have a good hashing function which evenly distributes
keys across the array, this yields a similar performance but uses less
memory as all the overhead imposed by linked list is avoided. This can
be crucial on 64bit machines where a single pointer is already 8 bytes.

> Which reminds me, why do most programming languages including Perl stop to 
> vectors and hashes as far as the fancy out-of-the-box data structures go? 
> Why not extend this to, say, B plus trees, among others, as people willl 
> have to code them sooner or later. Yep, I know there are B-trees for Perl, I 
> just read an excellent tutorial on one. But it would be nice to have 
> efficient, balanced tree structures available by default as modules, 
> especially as they aren't that trivial to implement well.

I believe the STL internally uses balanced trees for their
implementation of the 'map' container. One reason might be that it's
more difficult to built a B-tree type that is generic enough. When you
insert something into it, it's at first not clear where this element
ought to be added so you additionally need at least an additional
function argument that determines which of the child-branches to follow.

To me the B-tree is not so much a type but some mixture of data-type,
algorithm and arrangement of data in memory. Same with linked lists
which you rarely find in the core of a language. They could be used
behind the scenes to implement arrays or for collision handling in
hashes, but I don't see them as first class data-types.

>> can now use a hash with only two buckets and yet store an arbitrary amount 
>> of key/value pairs
> Which reminds me what's the origin of the term bucket when talking about 
> Hashes? K&R didn't mention it so I was initially pretty confused when I saw 
> the term. As far as I've understood it, a bucket is just the head of a 
> linked list stored in the array.

For me a bucket is first and foremost just a container for something
with a more or less defined structure or size. I haven't come across a
usage where it would specifically denote the head element of a linked
list. Also, the perl source calls the containers for key/value pairs
buckets in various places (just grep hv.c).

Tassilo
-- 
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);


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

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 9000
***************************************


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