[17805] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5225 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 4 14:56:29 2001

Date: Thu, 4 Jan 2001 11:55:48 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <978638148-v9-i5225@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 4 Jan 2001     Volume: 9 Number: 5225

Today's topics:
    Re: bitwise operation to find the inversion of a color (Abigail)
    Re: bitwise operation to find the inversion of a color (Abigail)
    Re: bitwise operation to find the inversion of a color (Ben Okopnik)
    Re: bitwise operation to find the inversion of a color (Tad McClellan)
    Re: bitwise operation to find the inversion of a color <nospam@nospam.com>
    Re: bitwise operation to find the inversion of a color (Abigail)
    Re: bitwise operation to find the inversion of a color (Ben Okopnik)
    Re: bitwise operation to find the inversion of a color <nospam@nospam.com>
    Re: bitwise operation to find the inversion of a color (Abigail)
    Re: bitwise operation to find the inversion of a color (El Nadie)
    Re: bitwise operation to find the inversion of a color <adam.walton@btconnect.com>
    Re: bitwise operation to find the inversion of a color (El Nadie)
    Re: bitwise operation to find the inversion of a color (Tad McClellan)
    Re: bitwise operation to find the inversion of a color (El Nadie)
    Re: bitwise operation to find the inversion of a color <adam.walton@btconnect.com>
    Re: bitwise operation to find the inversion of a color (Marc Spitzer)
    Re: bitwise operation to find the inversion of a color (Tad McClellan)
    Re: bitwise operation to find the inversion of a color (Tad McClellan)
    Re: bitwise operation to find the inversion of a color <monty@primenet.com>
    Re: bitwise operation to find the inversion of a color <nospam@nospam.com>
    Re: bitwise operation to find the inversion of a color <adam.walton@btconnect.com>
    Re: bitwise operation to find the inversion of a color (Tad McClellan)
    Re: bitwise operation to find the inversion of a color <flavell@mail.cern.ch>
    Re: bitwise operation to find the inversion of a color georgebailey@my-deja.com
    Re: bitwise operation to find the inversion of a color (Martien Verbruggen)
    Re: bitwise operation to find the inversion of a color <bart.lateur@skynet.be>
    Re: bitwise operation to find the inversion of a color <bart.lateur@skynet.be>
    Re: bitwise operation to find the inversion of a color <iltzu@sci.invalid>
    Re: bitwise operation to find the inversion of a color <nospam@david-steuber.com>
    Re: bitwise operation to find the inversion of a color (El Nadie)
    Re: bitwise operation to find the inversion of a color <joe+usenet@sunstarsys.com>
    Re: bitwise operation to find the inversion of a color (El Nadie)
    Re: bitwise operation to find the inversion of a color (Mark W. Schumann)
    Re: bitwise operation to find the inversion of a color (Tad McClellan)
    Re: bitwise operation to find the inversion of a color (Tad McClellan)
    Re: bitwise operation to find the inversion of a color (Tad McClellan)
    Re: bitwise operation to find the inversion of a color <nospam@nospam.com>
    Re: bitwise operation to find the inversion of a color (Martien Verbruggen)
    Re: bitwise operation to find the inversion of a color (El Nadie)
    Re: bitwise operation to find the inversion of a color (Martien Verbruggen)
    Re: bitwise operation to find the inversion of a color <terahippo@my-deja.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 30 Dec 2000 15:51:45 GMT
From: abigail@foad.org (Abigail)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94s14h.8df.abigail@tsathoggua.rlyeh.net>

Adam T Walton (adam.walton@btconnect.com) wrote on MMDCLXXVII September
MCMXCIII in <URL:news:ig_26.4651$nu5.23912@NewsReader>:
?? 
?? Obviously I haven't delved too far into the world of bitwise operators!


And you haven't delved anywhere in the man page about operators either.
If you won't help yourself, why do you expect us to do it for you?


Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


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

Date: 30 Dec 2000 15:59:06 GMT
From: abigail@foad.org (Abigail)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94s1ia.8df.abigail@tsathoggua.rlyeh.net>

Bart Lateur (bart.lateur@skynet.be) wrote on MMDCLXXVII September
MCMXCIII in <URL:news:0tuo4t403js7udppo2ca40o8r5skea0dg5@4ax.com>:
:) Adam T Walton wrote:
:) 
:) >I thought it might be as simple as:-
:) >
:) >my $bg_color=0xffffff;
:) >my $font_color=(!$bg_color);
:) >
:) >Obviously I haven't delved too far into the world of bitwise operators!
:) 
:) Close. You're using the wrong kind of invertor, you want "~" not "!",
:) because that's a logical invertor. And second, mask out uninteresting
:) bits, so do a bitwise AND of that result with 0xFFFFFF:
:) 
:) 	my $bg_color=0xffffff;
:) 	my $font_color= ~$bg_color & 0xffffff;
:) 
:) Or, simply do a bitwise XOR with 0xffffff:
:) 
:) 	my $bg_color=0xffffff;
:) 	my $font_color= $bg_color ^ 0xffffff;
:) 
:) Only the bits that are set in the second argument will be inverted in
:) the first. Or vice versa, same thing.
:) 
:) p.s. You'll get a rather uninteresting result for this particular
:) example: 0.

Note also that this doesn't give anything related to contrasting colours.
0x808080 is some form of gray. Inverting the bits yields 0x7f7f7f, which
is almost as close to 0x808080 as you can get.



Abigail
-- 
perl -wlpe '}$_=$.;{' file  # Count the number of lines.


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

Date: 30 Dec 2000 17:52:00 GMT
From: fuzzybear@pocketmail.com (Ben Okopnik)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94s86l.6ad.fuzzybear@Odin.Thor>

The ancient archives of 30 Dec 2000 15:59:06 GMT showed
Abigail of comp.lang.perl.misc speaking thus:

>perl -wlpe '}$_=$.;{' file  # Count the number of lines.


Yet another example of "Abigail's deadly one-liner". Sent me searching 
through the FAQs, as usual. :)

What in the heck is that '}...{' syntax? I've even grepped my $PODS 
directory, and only came up with '} else {' which is a different sort of 
animal altogether. I've tried reversing the brockets and see the effect - 
but what's the mechanism?


Ben Okopnik
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
I prefer to think that God is not dead, just drunk. -- John Huston


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

Date: Sat, 30 Dec 2000 11:33:22 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94s3ii.448.tadmc@magna.metronet.com>

Ben Okopnik <fuzzybear@pocketmail.com> wrote:
>The ancient archives of 30 Dec 2000 15:59:06 GMT showed
>Abigail of comp.lang.perl.misc speaking thus:
>
>>perl -wlpe '}$_=$.;{' file  # Count the number of lines.
>
>
>Yet another example of "Abigail's deadly one-liner". Sent me searching 
>through the FAQs, as usual. :)


Abigail is using a feature that is only tangentially documented.

It is "trick code" suitable for impressing folks (eg. golf, JAPH...),
but shouldn't be used in "real" programs.


>What in the heck is that '}...{' syntax?
[snip]
>but what's the mechanism?


The docs for the -p switch (perldoc perlrun) give this code:

    while (<>) {
        ...             # your program goes here
    } continue {
        print or die "-p destination: $!\n";
    }

Put in "your program" (from -e) 

    while (<>) {
        }$_=$.;{
    } continue {
        print or die "-p destination: $!\n";
    }

and adjust the indenting:

    while (<>) 
    { }
    $_=$.;
    { } 
    continue {
        print or die "-p destination: $!\n";
    }

The while() reads _all_ the lines, updating $. along the way
as a side effect. The while() does _not_ have a continue
block associated with it.

Then $. is saved in the default variable so it will be there
later for the print().

Docs for "continue BLOCK"s (perldoc -f continue) describe where you
can have one. Abigail's use is not one of the ones noted as "typical"
in the docs  :-)

The naked block serves as a BLOCK to attach the continue to.

Then the continue prints out the number of lines (and -l
supplies a newline).

Tah dah!


Pretty slick, eh?


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


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

Date: 30 Dec 2000 23:50:20 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <92lsbs$qhi$0@216.155.32.19>

In article <slrn94s1ia.8df.abigail@tsathoggua.rlyeh.net>, 
abigail@foad.org wrote:

 | Note also that this doesn't give anything related to contrasting colours.
 | 0x808080 is some form of gray. Inverting the bits yields 0x7f7f7f, which
 | is almost as close to 0x808080 as you can get.
 | 

I'm guessing that you know a better way to produce complementary colors 
for arbitrary R G B values?? 

I'd be interested in such a result as well for curiosity purposes, as 
well as my growing archive of potentially useful snippets.

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: 31 Dec 2000 03:11:48 GMT
From: abigail@foad.org (Abigail)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94t8vk.e2g.abigail@tsathoggua.rlyeh.net>

The WebDragon (nospam@nospam.com) wrote on MMDCLXXVIII September MCMXCIII
in <URL:news:92lsbs$qhi$0@216.155.32.19>:
`' In article <slrn94s1ia.8df.abigail@tsathoggua.rlyeh.net>, 
`' abigail@foad.org wrote:
`' 
`'  | Note also that this doesn't give anything related to contrasting colours.
`'  | 0x808080 is some form of gray. Inverting the bits yields 0x7f7f7f, which
`'  | is almost as close to 0x808080 as you can get.
`' 
`' I'm guessing that you know a better way to produce complementary colors 
`' for arbitrary R G B values?? 

The question was about *contrasting* colours, not complementary colours.

Please learn to read before writing.

`' I'd be interested in such a result as well for curiosity purposes, as 
`' well as my growing archive of potentially useful snippets.

Buy a book about basic colour theory and have someone read it to you. 



Abigail
-- 
BEGIN {$^H {q} = sub {$_ [1] =~ y/S-ZA-IK-O/q-tc-fe-m/d; $_ [1]}; $^H = 0x28100}
print "Just another PYTHON hacker\n";


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

Date: 31 Dec 2000 04:32:58 GMT
From: fuzzybear@pocketmail.com (Ben Okopnik)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94tdor.72v.fuzzybear@Odin.Thor>

The ancient archives of Sat, 30 Dec 2000 11:33:22 -0500 showed
Tad McClellan of comp.lang.perl.misc speaking thus:
>Ben Okopnik <fuzzybear@pocketmail.com> wrote:
>>The ancient archives of 30 Dec 2000 15:59:06 GMT showed
>>Abigail of comp.lang.perl.misc speaking thus:
>>
>>>perl -wlpe '}$_=$.;{' file  # Count the number of lines.
>>
>>
>>Yet another example of "Abigail's deadly one-liner". Sent me searching 
>>through the FAQs, as usual. :)
>
>
>Abigail is using a feature that is only tangentially documented.

<deadpan> That's a surprise. </deadpan>

<*grin*>


>It is "trick code" suitable for impressing folks (eg. golf, JAPH...),
>but shouldn't be used in "real" programs.

Aw, rats. That one was *fun*...


>The docs for the -p switch (perldoc perlrun) give this code:
>
>    while (<>) {
>        ...             # your program goes here
>    } continue {
>        print or die "-p destination: $!\n";
>    }

<snip>

I'm so proud of myself, I could bust. Believe it or not, I actually 
figured all that out (after Garry T. Williams clued me in by telling me to 
check "-p" in "perlrun".) Having you confirm my guesses was _truly_ cool;
thank you both.

>Tah dah!
>
>
>Pretty slick, eh?

Oh yeah, definitely; 'slick' is certainly more than applicable here. 


Ben Okopnik
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Skeptical scrutiny is the means, in both science and religion, by which
deep insights can be winnowed from deep nonsense. -- Carl Sagan


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

Date: 31 Dec 2000 05:11:34 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <92mf66$rq1$0@216.155.32.188>

In article <slrn94t8vk.e2g.abigail@tsathoggua.rlyeh.net>, 
abigail@foad.org wrote:

 | `'  | Note also that this doesn't give anything related to 
 | contrasting colours. `'  | 0x808080 is some form of gray. Inverting 
 | the bits yields 0x7f7f7f, which `'  | is almost as close to 0x808080 
 | as you can get. `' `' I'm guessing that you know a better way to 
 | produce complementary colors `' for arbitrary R G B values?? 
 | 
 | The question was about *contrasting* colours, not complementary 
 | colours.
 | 
 | Please learn to read before writing.

HE is interested in CONTRASTING colors.

*I* am interested in COMPLEMENTARY colors. 

please learn to tell the difference between someone making a choice of 
his own, using his own very real intelligence, and one that couldn't 
shoot his way out of a paper sack with a blowtorch. 

 | `' I'd be interested in such a result as well for curiosity 
 | purposes, as `' well as my growing archive of potentially useful 
 | snippets.
 | 
 | Buy a book about basic colour theory and have someone read it to 
 | you. 

Can I get you a saucer of cream to go with that comment, Abigail? 

It's nice to know I don't have the market cornered on rampant egotism.

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: 31 Dec 2000 11:24:20 GMT
From: abigail@foad.org (Abigail)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94u5r4.e2g.abigail@tsathoggua.rlyeh.net>

The WebDragon (nospam@nospam.com) wrote on MMDCLXXIX September MCMXCIII
in <URL:news:92mf66$rq1$0@216.155.32.188>:
|| In article <slrn94t8vk.e2g.abigail@tsathoggua.rlyeh.net>, 
|| abigail@foad.org wrote:
|| 
||  | `'  | Note also that this doesn't give anything related to 
||  | contrasting colours. `'  | 0x808080 is some form of gray. Inverting 
||  | the bits yields 0x7f7f7f, which `'  | is almost as close to 0x808080 
||  | as you can get. `' `' I'm guessing that you know a better way to 
||  | produce complementary colors `' for arbitrary R G B values?? 
||  | 
||  | The question was about *contrasting* colours, not complementary 
||  | colours.
||  | 
||  | Please learn to read before writing.
|| 
|| HE is interested in CONTRASTING colors.
|| 
|| *I* am interested in COMPLEMENTARY colors. 
|| 
|| please learn to tell the difference between someone making a choice of 
|| his own, using his own very real intelligence, and one that couldn't 
|| shoot his way out of a paper sack with a blowtorch. 

Yeah, sure. Then please tell me what you are referring to when you are
asking for a _better way_. Better than what?



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Sun, 31 Dec 2000 12:10:21 GMT
From: nadie@latino-2000.com (El Nadie)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <nadie3a4f2194624f@news.latino-2000.com>

On 31 Dec 2000 03:11:48 GMT, Abigail <abigail@foad.org> wrote:
> The WebDragon (nospam@nospam.com) wrote on MMDCLXXVIII September MCMXCIII
> in <URL:news:92lsbs$qhi$0@216.155.32.19>:
> `'
> `' [ ... snip ... ]
> `' 
> `' I'm guessing that you know a better way to produce complementary colors 
> `' for arbitrary R G B values?? 
> 
> The question was about *contrasting* colours, not complementary colours.
> 
> Please learn to read before writing.
> 
> `' I'd be interested in such a result as well for curiosity purposes, as 
> `' well as my growing archive of potentially useful snippets.
> 
> Buy a book about basic colour theory and have someone read it to you. 

Abigail,

Buy a book about manners and respect for others, and have someone
read it to you while you try to grow up.


-- 
El Nadie
nadie@latino-2000.com


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

Date: Sun, 31 Dec 2000 13:24:35 -0000
From: "Adam T Walton" <adam.walton@btconnect.com>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <nqG36.5595$nu5.42518@NewsReader>

>And you haven't delved anywhere in the man page about operators either.
>If you won't help yourself, why do you expect us to do it for you?

I am not presumptuous enough to EXPECT help [I post because I HOPE someone
can help me]... but, if I was in a position to give it, I think I would be
gracious enough to do it without acrimony. Whilst I am aware that your
(plural) time is very precious, and a question that can be answered via the
manpages or an FAQ, theoretically, has no place in this newsgroup, the
subject line clearly stated what I was looking for and no-one was forcing
you, Abigail, to read it. Plus, you took the time to reply without
furnishing a viable answer... why????

I don't want anyone here to give me a free-ride, and have spent the last
year burrowing through text-books, FAQ's and manpages in an effort to learn
Perl... frequently I find the manpages and FAQs presume a level of
familiarity with programming (C especially) and servers that just isn't
apparent to those of us taking our first tentative steps into programming. I
was always taught that the best way to learn something was to ask questions,
and then listen to the answer... I wager that even you, Abigail, had to ask
someone a question that necessitated a glaringly obvious answer... I hope
that you were given a straight answer without any undue barbs of criticism.

Whilst I can only dream of knocking out obfuscated one-liners, right now I'm
concentrating on getting my head around references, OOP, installing modules
and, of course, finding the best way to generate a high contrast foreground
color from a user supplied background color... forgive me if I ask a
question on any of these subjects when the answer is glaringly obvious to
you, especially if you know the exact location of that answer in the FAQ -
but, please remember, it is your perogative as to whether you choose to
answer it or not. If you magnanimously decide to share your knowledge, I
will be extremely grateful... I think that probably goes for all of us
newbies who want to learn / use / ( and eventually contribute?) to this
wonderful, idiosyncratic language.

Thanks and Happy New Year

Adam




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

Date: Sun, 31 Dec 2000 13:55:25 GMT
From: nadie@latino-2000.com (El Nadie)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <nadie3a4f3ac283a2@news.latino-2000.com>

On Sun, 31 Dec 2000 13:24:35 -0000,
Adam T Walton <adam.walton@btconnect.com> wrote:
> >And you haven't delved anywhere in the man page about operators either.
> >If you won't help yourself, why do you expect us to do it for you?
> 
> I am not presumptuous enough to EXPECT help [I post because I HOPE someone
> can help me]... but, if I was in a position to give it, I think I would be
> gracious enough to do it without acrimony. Whilst I am aware that your
> (plural) time is very precious, and a question that can be answered via the
> manpages or an FAQ, theoretically, has no place in this newsgroup, the
> subject line clearly stated what I was looking for and no-one was forcing
> you, Abigail, to read it. Plus, you took the time to reply without
> furnishing a viable answer... why????

Because Abigail is in love with his/her own immature attempts at wit.

Or probably more to the point: Abigail likes to project his/her own
insecurity and self-hatred onto others, and then tries to build
himself/herself up by dumping on them.  This is much more important
to him/her than actually promoting the use of Perl.

It's always been amazing to me that the regulars and gurus in this
newsgroup put up with him/her.


> I don't want anyone here to give me a free-ride, and have spent
> the last year burrowing through text-books, FAQ's and manpages in
> an effort to learn Perl...  [ ... snip ... ] ... I wager that even
> you, Abigail, had to ask someone a question that necessitated a
> glaringly obvious answer... I hope that you were given a straight
> answer without any undue barbs of criticism.

I'm speculating here, but I wouldn't be surprised if it turns out
that Abigail grew up with lots of harsh criticism, possibly even
severe abuse -- or maybe even s/he has had one or more horrible
tragedies in his/her life.  If so, this is very sad, and I sincerely
hope that s/he is getting professional help -- s/he and we all will
be better off for it.  However, even if all this is the case about
Abigail, it doesn't excuse his/her behaviour here.

This is all the more sad, because Abigail truly knows a lot about
Perl and programming, and s/he could actually make some wonderful,
positive contributions to this newsgroup if only s/he could overcome
her misguided habit of trying to hurt others.

You don't need to explain or defend yourself.  Your attitude and
approach are admirable, your questions are quite reasonable, and you
and many others here do not deserve Abigail's barbs.


> Whilst I can only dream of knocking out obfuscated one-liners,
> right now I'm concentrating on getting my head around references,
> OOP, installing modules and, of course, finding the best way to
> generate a high contrast foreground color from a user supplied
> background color... forgive me if I ask a question on any of these
> subjects when the answer is glaringly obvious to you, especially
> if you know the exact location of that answer in the FAQ - but,
> please remember, it is your perogative as to whether you choose to
> answer it or not. If you magnanimously decide to share your
> knowledge, I will be extremely grateful... I think that probably
> goes for all of us newbies who want to learn / use / ( and
> eventually contribute?) to this wonderful, idiosyncratic language.

In writing this sincere, reasonable, fair, even-handed, respectful
message to Abigail, I fear that you are casting your pearls before
swine.

But hope springs eternal, and I know that everyone has the
capability for self-examination and growth, and I know that
underneath his/her barbed exterior, Abigail has a heart.  Therefore,
I sincerely hope that Abigail proves me wrong and shows me that I
have been quite unfair in my characterizations of him/her.


> Thanks and Happy New Year
> 
> Adam

I, for one, thank you for posting.  I hope that your message is
received by Abigail in the spirit in which it was intended.


-- 
El Nadie
nadie@latino-2000.com


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

Date: Sun, 31 Dec 2000 07:45:40 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94uajk.a6i.tadmc@magna.metronet.com>

Adam T Walton <adam.walton@btconnect.com> wrote:
>>And you haven't delved anywhere in the man page about operators either.
>>If you won't help yourself, why do you expect us to do it for you?
>
>I am not presumptuous enough to EXPECT help [I post because I HOPE someone
>can help me]... but, if I was in a position to give it, I think I would be
>gracious enough to do it without acrimony. Whilst I am aware that your
>(plural) time is very precious, and a question that can be answered via the
                                                ^^^^^^^^^^^^^^^^^^^^

That is not the criteria.

   whose answer can be easily found

is the criteria.

Answers that are in the docs, but not easily found should earn
you a polite pointer to where in the docs to look.

Answers that *are* easily found, yet were not found, lead to
the conclusion that they were not looked for at all.

Your Subject talked about bitwise operators. perlop.pod has
sections about bitwise operators. The operator you used is
not listed as a bitwise operator, yet you used it as such.

Yet another data point leading to the conclusion that you did not
look at all.

If you had checked the relevant parts of perlop.pod, you would
not have posted what you posted, you would have been trying to
use some bitwise operator rather than a logical operator.


>manpages or an FAQ, theoretically, has no place in this newsgroup, the
                     ^^^^^^^^^^^^^

You seem to be saying that it is (sometimes) OK to reask things easily found 
in the standard documentation that came with the software that you are using.

Including that word was a big mistake. It got you *plonk*ed. So long.


>subject line clearly stated what I was looking for and no-one was forcing
>you, Abigail, to read it. Plus, you took the time to reply without
>furnishing a viable answer... why????


Because if you just _let_ someone take cuts in line, others will start
taking cuts too. There are hundreds (thousands?) of people here watching
to see what will happen.

There are *dozens* of questions with easily found answers here every day!
(you probably already knew that from the lurking that you did before posting)

Abigail has been here a long time, but let's say just 3 years
for the sake of argument, and we'll go with just 1 dozen/day:

   12 * 365 * 3 = 13,140

So Abigail has seen over thirteen thousand abuses of the newsgroup.
Every body has a limit. Abigail's must be somewhere below ten thousand.

 ... and that is just *one* of the newsgroup readers. If we assume
only 100 participants who have been here 3 years, then time has been wasted 
answering an already-answered question 1,314,000 times.

Abigail isn't picking on you in particular. Abigail is picking
on you and tens of thousands of others who have done what you did.

You are hanging with an unsavory crowd and being tarred with the same brush.


>frequently I find the manpages and FAQs presume a level of
>familiarity with programming (C especially) and servers that just isn't
>apparent to those of us taking our first tentative steps into programming.


They were not written for non-programmers, so that is not surprising.

This is not a "teach me programming" newsgroup.

This is a programming newsgroup.

Programmers (including self-taught ones) check the documentation included
with the software that they use.

Non-programmers are certainly welcome here, particularly if they want to
become programmers. One of the most fundamental tenants of programming
that must be picked up is that "documentation" is a contract between
the provider of the SW and the user of the SW.

Ignoring the docs is like signing a contract without reading it.

If you do not read up on "!", then you do not know what behavior you will 
get when you use "|". Guessing what it means from "trying stuff" very
often leads to wasting lots of time. Checking the docs would take 5 or 10
minutes.

Work smart, use the docs.


>and then listen to the answer... I wager that even you, Abigail, had to ask
>someone a question that necessitated a glaringly obvious answer... I hope
>that you were given a straight answer without any undue barbs of criticism.
                                                   ^^^^^

But you _were_ due some criticism. You took cuts. Folks are not
likely to just lay down and let you do it. You should expect
some angry shouting when you do that. So either take it (and
maybe just say "Oops. Sorry."), or don't take cuts in the first place.


----------------------------------
In article <1995Nov9.193745.13694@netlabs.com>, lwall@netlabs.com (Larry
Wall) wrote: ...

<Larry>  [snip]  I view a programming language as a place to be
<Larry>  explored, like Disneyland. You don't need to have a lot of preparation
<Larry>  to explore a theme park.  You do have to go along with the crowd
<Larry>  control measures, though.  In a sense, each ride has its own
<Larry>  prerequisites--if you cut in line, you risk getting tossed out of the
<Larry>  park.
<Larry> 
<Larry>  What we have here in this newsgroup is a failure in crowd control.
<Larry>  Reading the FAQ is like staying in line--it's something you should
<Larry>  learn in kindergarten.  Usenet needs a better kindergarten.
----------------------------------


>If you magnanimously decide to share your knowledge, 


That seems unlikely in the extreme now though.


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


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

Date: Sun, 31 Dec 2000 16:40:53 GMT
From: nadie@latino-2000.com (El Nadie)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <nadie3a4f5677a797@news.latino-2000.com>

On Sun, 31 Dec 2000 07:45:40 -0500, Tad McClellan <tadmc@metronet.com> wrote:
> Adam T Walton <adam.walton@btconnect.com> wrote:
> >>And you haven't delved anywhere in the man page about operators either.
> >>If you won't help yourself, why do you expect us to do it for you?
> >
> >I am not presumptuous enough to EXPECT help [I post because I HOPE someone
> >can help me]... but, if I was in a position to give it, I think I would be
> >gracious enough to do it without acrimony. Whilst I am aware that your
> >(plural) time is very precious, and a question that can be answered via the
>                                                 ^^^^^^^^^^^^^^^^^^^^
> 
> That is not the criteria.
> 
>    whose answer can be easily found
> 
> is the criteria.
> 
> Answers that are in the docs, but not easily found should earn
> you a polite pointer to where in the docs to look.

Abigail does not even try to give "polite" pointers.  S/he delights
in behaving like an immature little blowhard.

If Abigail could learn how to conduct himself/herself in the same
polite way that you (Tad McClellan) are behaving here, this
newsgroup would be a much better place.

You don't like superfluous questions any more than Abigail and many
others here like them.  Yet, you manage to figure out a way to let
people know how you feel about this without coming across like a
narcissist with a chip on your shoulder.  And in fact, almost all of
the regulars here who correct the "newbies" seem to have much more
than the minimal level of social skills and respectfulness needed to
behave like mature adults when giving this correction.

This is not the case with Abigail.  S/he is quite an intelligent
person, and therefore, s/he doesn't have the excuse of not knowing
better how to treat his/her fellow human beings.  Therefore, I can
only conclude that Abigail is deliberately acting like a
third-grader with an ego problem, and that s/he gets some sort of
misguided satisfaction out of behaving in this manner.

No matter how intelligent a person is, I have no respect for this
person if s/he goes out of his/her way to act like an asshole.


> [ ... snip ... ]
>
> So Abigail has seen over thirteen thousand abuses of the newsgroup.
> Every body has a limit. Abigail's must be somewhere below ten thousand.

I'd be willing to bet that Abigail has no limit whatsoever, and that
s/he has treated most of his/her fellow posters with this same
condescending disdain since his/her very first usenet post.


> ... and that is just *one* of the newsgroup readers. If we assume
> only 100 participants who have been here 3 years, then time has been wasted 
> answering an already-answered question 1,314,000 times.

How much time does Abigail spend writing his/her cute little bons
mots and immature little insults, in comparison to the time s/he
spends actually contributing Perl knowledge to this group? Perhaps
if I have some spare time this coming week, I'll go to DejaNews and
tabulate the ratio of immature trash to useful Perl posts that
Abigail contributes.

And please don't forget that I'm only talking about Abigail.  You
and many others here behave in a much more reasonable manner when
pointing out to people that they should try to find their answers
elsewhere.  And as I mentioned, you and most of the other regulars
here treat people with much more respect and use much more maturity
than I have ever seen coming from Abigail.


> Abigail isn't picking on you in particular. Abigail is picking
> on you and tens of thousands of others who have done what you did.

I'm convinced that Abigail doesn't do this out of exasperation, but
rather, s/he has an axe to grind and a chip on his/her shoulder, and
seems to constantly go out of his/her way to find new "newbies" to
dump on -- and s/he gets great pleasure out of this, just like a
schoolyard bully.  This is what sets Abigail apart from the rest of
you, who for the most part are decent human beings who are sincerly
frustrated by the tens of thousands of posts that bother you here.

I have sympathy for all of you, since I know how hard it is to
maintain decorum and composure when faced, day in and day out, with
the same frustrating happenings.  However, I have no sympathy at all
for Abigail, who simply delights in trashing others.


I can only hope that you (Mr. McClellan) and other regulars here are
communicating offline with Abigail and trying to prevail on him/her
to learn how to behave with the same level of maturity and respect
that you all exhibit.


> [ ... snip ... ]
>
>     Tad McClellan                          SGML consulting
>     tadmc@metronet.com                     Perl programming
>     Fort Worth, Texas


-- 
El Nadie
nadie@latino-2000.com


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

Date: Sun, 31 Dec 2000 17:17:44 -0000
From: "Adam T Walton" <adam.walton@btconnect.com>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <XQJ36.47359$_h.306313@NewsReader>

Message received and understood, Tad. My intention wasn't to start a flaming
war, merely to point out that sometimes, in my experience, the 'manpages'
add to my confusion rather than relieve it... I don't think I am the only
person who has been intimidated by the documentation. I am aware that this
is down to my own lack of experience (but not, necessarily, stupidity) and
do my best to improve every day. Is it forbidden to ask a question here if
you can't find an answer you can understand in the documentation?

re: your point that Abigail (and many others) must wade through a vast
amount of pointless postings, I would contend that anyone whose time is as
precious, and expertise as valuable, as Abigail's, would surely vet which
postings to read and offer consideration to. My subject line made it quite
clear what I was asking, there was no need for her to respond in such an
undecorous way.

I have knowledge in many fields, and in the course of my work (which isn't
computing related) I am called upon to advise regularly... in the
non-usenet, #real# world people who ask for help are generally treated with
respect, not disdain... I don't see why things should be different here. The
argument that "this is the way it's always been, get used to it" doesn't
hold any water... if that was the case, humankind's ancestors would never
have climbed out of the sea... fire wouldn't have been 'invented'... we
wouldn't be sitting here having this discussion etc etc

Anyway, time is equally valuable to all of us, so I will waste yours no
longer. Back to the 'manpages', and my ultimate quest... to write a program
that can take the most basic question, search through perldocs and give a
civil, accessible (to non-programmers) answer without getting its cyber
knickers in a twist. Don't hold your breath :)

Adam




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

Date: Sun, 31 Dec 2000 17:53:16 GMT
From: marc@oscar.noc.cv.net (Marc Spitzer)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94usb9.sf3.marc@oscar.noc.cv.net>

In article <XQJ36.47359$_h.306313@NewsReader>, Adam T Walton wrote:
>Message received and understood, Tad. My intention wasn't to start a flaming
>war, merely to point out that sometimes, in my experience, the 'manpages'
>add to my confusion rather than relieve it... I don't think I am the only
>person who has been intimidated by the documentation. I am aware that this
>is down to my own lack of experience (but not, necessarily, stupidity) and
>do my best to improve every day. Is it forbidden to ask a question here if
>you can't find an answer you can understand in the documentation?

try this when the docs confuse you and you feel the need to post:
1: reread everything and think about it some more
2: when you post follow this 3 step procedure:
2.1: state clearly what docs/faqs/books you have used to resolve this
problem.
2.2: state clearly what does not make sence to you.
2.3: do not complain about the answers you get if you think
they are not polite enough.  REMEMBER you are asking for free
help, this is like asking for free leagle advice from a lawyer.


>
>re: your point that Abigail (and many others) must wade through a vast
>amount of pointless postings, I would contend that anyone whose time is as
>precious, and expertise as valuable, as Abigail's, would surely vet which
>postings to read and offer consideration to. My subject line made it quite
>clear what I was asking, there was no need for her to respond in such an
>undecorous way.

Abigail donates her time to help people for free who are asking for it.
perhaps (s)?he is not the most polite person in the world, if this is
true so what.  Her answers seem to be directly proportional to the 
amount of work, that was demonstrated in the post, that was put in to
the orignal question as far as help goes.
 

>
>I have knowledge in many fields, and in the course of my work (which isn't
>computing related) I am called upon to advise regularly... in the
>non-usenet, #real# world people who ask for help are generally treated with
>respect, not disdain... I don't see why things should be different here. The
>argument that "this is the way it's always been, get used to it" doesn't
>hold any water... if that was the case, humankind's ancestors would never
>have climbed out of the sea... fire wouldn't have been 'invented'... we
>wouldn't be sitting here having this discussion etc etc

In the real world, are these people customers/clients of yours(past, present
, future)?  Are these people you have regular contact with? 

>
>Anyway, time is equally valuable to all of us, so I will waste yours no
>longer. Back to the 'manpages', and my ultimate quest... to write a program
>that can take the most basic question, search through perldocs and give a
>civil, accessible (to non-programmers) answer without getting its cyber
>knickers in a twist. Don't hold your breath :)
>

good luck

marc


>Adam
>
>


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

Date: Sun, 31 Dec 2000 11:17:43 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94un17.alo.tadmc@magna.metronet.com>

Adam T Walton <adam.walton@btconnect.com> wrote:
>Message received and understood, Tad. My intention wasn't to start a flaming
>war, merely to point out that sometimes, in my experience, the 'manpages'
>add to my confusion rather than relieve it... I don't think I am the only
>person who has been intimidated by the documentation. 


Not understanding the docs is OK. Not checking the docs before
posting is not OK. You did not check the docs before posting.


>I am aware that this
>is down to my own lack of experience (but not, necessarily, stupidity) 


Of course not.


>and
>do my best to improve every day. Is it forbidden to ask a question here if
>you can't find an answer you can understand in the documentation?


No, but you did not do that. You didn't ask for a clarification
of something in the docs. You "made stuff up" and then posted
when it didn't work.


>there was no need for her to respond in such an
>undecorous way.


Rudeness begets rudeness begets yet more rudeness.

The solution is for people to check the docs before posting.
People will not check the docs before posting. The newsgroup
is going to remain rude. That's just the way it is. You either
live with the rude people reasking already-answered questions
and the followups they invite while trying to learn some Perl,
or you unsubscribe.

Getting free Perl consulting isn't truly free. Everything has
a price.


>I have knowledge in many fields, and in the course of my work (which isn't
>computing related) I am called upon to advise regularly... in the
>non-usenet, #real# world people who ask for help are generally treated with
>respect, not disdain... I don't see why things should be different here. 


This is not the real world. This is Usenet, a little society
unto itself, with its own evolved rules of what is socially
acceptable.

"Manners" evolve to avoid conflict in crowded situations.
Usenet (and this newgroup in particular) is crowded.


>The
>argument that "this is the way it's always been, get used to it" doesn't
>hold any water...


It has not always been this way. I remember a time when FAQ asking
was an infrequent occurance here. That time is not this time and
things will never be like they were. Folks that were here when
we only discussed Perl instead of netiquette (because
everybody _knew and followed_ netiquette then) are bitter
about the loss.

The newsgroup ran smoothly when netiquette was followed, and now
does not run smoothly (could that be perhaps because netiquette
accomplishes its intended purpose?).


>Anyway, time is equally valuable to all of us, so I will waste yours no
>longer. 


Yes, I have taken the appropriate steps to help with that.


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


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

Date: Sun, 31 Dec 2000 11:34:43 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94uo13.alo.tadmc@magna.metronet.com>

El Nadie <nadie@latino-2000.com> wrote:
>On Sun, 31 Dec 2000 07:45:40 -0500, Tad McClellan <tadmc@metronet.com> wrote:

>> Answers that are in the docs, but not easily found should earn
>> you a polite pointer to where in the docs to look.
>
>Abigail does not even try to give "polite" pointers.  S/he delights
>in behaving like an immature little blowhard.


Then you should followup to a posting where that happened.

That did not happen anywhere in _this_ thread.

What happened in _this_ thread was the other case (that you snipped):

Tad> Answers that *are* easily found, yet were not found, lead to
Tad> the conclusion that they were not looked for at all.


The OP _earned_ flames. The OP got flames. Things are as they should be.


>> So Abigail has seen over thirteen thousand abuses of the newsgroup.
>> Every body has a limit. Abigail's must be somewhere below ten thousand.
>
>I'd be willing to bet that Abigail has no limit whatsoever, and that


You'd lose the bet. I have personally seen Abigail pre-limit. 
That was some years ago though.


>s/he has treated most of his/her fellow posters with this same
>condescending disdain since his/her very first usenet post.


You have observed Abigail's posting behavior for many years then?


>How much time does Abigail spend writing his/her cute little bons
>mots and immature little insults, in comparison to the time s/he
>spends actually contributing Perl knowledge to this group? 


The contributions are in proportion to the quality of the questions.
Used to be "good" (i.e. unanswered) questions, not nowadays.

Abigail's attitude is a symptom. It is not the disease.
Symptoms do not cause disease.

Posting easily answered questions is the disease.


>And please don't forget that I'm only talking about Abigail.


You have chosen your battles poorly then.

If you had launched this in response to a snippety followup
where the answer was NOT easily found in the docs, then you
could have survived intact.

But since it is in this thread, where that did not happen, it
sounds to me like you are defending the original post.

I know what to do when I see that happen. So long.


>I can only hope that you (Mr. McClellan) and other regulars here are
>communicating offline with Abigail and trying to prevail on him/her
>to learn how to behave with the same level of maturity and respect
>that you all exhibit.


I can only hope that "someone" is communicating offline with the
FAQ askers so that we can cure the disease (ain't gonna happen)
rather than attempt to merely treat the symptoms.


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


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

Date: 31 Dec 2000 22:35:57 GMT
From: Jim Monty <monty@primenet.com>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <92occd$q7t$1@nnrp2.phx.gblx.net>

Tad McClellan <tadmc@metronet.com> wrote:
> I remember a time when FAQ asking was an infrequent occurance here.

When was asking frequently-asked questions an infrequent occurrence?

-- 
Jim Monty
monty@primenet.com
Tempe, Arizona USA


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

Date: 31 Dec 2000 22:46:07 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <92ocvf$7rs$3@216.155.33.14>

In article <92occd$q7t$1@nnrp2.phx.gblx.net>, Jim Monty 
<monty@primenet.com> wrote:

 | Tad McClellan <tadmc@metronet.com> wrote:
 | > I remember a time when FAQ asking was an infrequent occurance here.
 | 
 | When was asking frequently-asked questions an infrequent occurrence?

*roaring with laughter* :D

thanks Jim, that made my Millennium :D

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Mon, 1 Jan 2001 01:18:31 -0000
From: "Adam T Walton" <adam.walton@btconnect.com>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <GTQ36.47561$_h.309906@NewsReader>

frankly Marc, or everyone else concerned with this thread, I asked an
(obviously) simple question, and only required a direct, and simple answer.
Tad, amongst others, has answered my questions without villification
before... if you (gurus, masters or non-gurus) truly wish this newsgroup to
be a haven for those of you who already know the answers to everything, then
good luck to you... frankly, you will become members of an ever decreasing
circle. I thought that Perl differentiated itself from other languages by
being 'for the people, and of the people'... obviously this altruism only
extends to people who already know the language inside out already.

I am aware that my initial request might have been insultingly stupid to
some, but I am not willing to be patronised.... I have earned my stripes in
arenas where I was NEVER made to feel like a child... arenas where
communication, rather than knowledge, were the prerequisite... obviously, I
misread the intent behind, not only usenet, but Perl...

Do not assume that people who aren't intimate with Perl's most obvious
attributes are stupid... many of us are attracted to Perl because it is not
necessarily a "programmer's" language... given time even I will contribute
more to this newsgroup than mere (FAQ) questions.

Whilst I am more than content to be redirected to the FAQ's (again),
sometimes (at the risk of never getting a question answered here again) I am
sure that some of you could do with a good blow-job, rather than a flaming
war with a newbie. If you can't help us, don't insult us. We have as much
right to be here as you... not trying to cause waves, or ruin the Status
Quo, but trying to make this language as ALIVE as possible.

Adam




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

Date: Sun, 31 Dec 2000 18:29:24 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn94vgak.b0b.tadmc@magna.metronet.com>

The WebDragon <nospam@nospam.com> wrote:
>In article <92occd$q7t$1@nnrp2.phx.gblx.net>, Jim Monty 
><monty@primenet.com> wrote:
>
> | Tad McClellan <tadmc@metronet.com> wrote:
> | > I remember a time when FAQ asking was an infrequent occurance here.
> | 
> | When was asking frequently-asked questions an infrequent occurrence?
>
>*roaring with laughter* :D


OTFL.


>thanks Jim, that made my Millennium :D


Me too.


( it was relative. 2 FAQs a day then, 30 a day now. )


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


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

Date: Mon, 1 Jan 2001 03:13:52 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <Pine.LNX.4.30.0101010307020.25219-100000@lxplus003.cern.ch>

On Mon, 1 Jan 2001, Adam T Walton wrote:

> frankly Marc, or everyone else concerned with this thread, I asked an
> (obviously) simple question, and only required a direct, and simple answer.

This looks to me like a bid for killfile status.  However, I'm not
going to do that straight away.

> I am aware that my initial request might have been insultingly stupid to
> some, but I am not willing to be patronised....

Then that seems to be your problem.  (Rather than being anything that
the group needs to worry about).

> I have earned my stripes in
> arenas where I was NEVER made to feel like a child...

My previous boss (now enjoying his well-deserved retirement) was never
afraid to make himself look silly if it was a step to acquiring new
knowledge, and we all respected him for that.

happy new year



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

Date: Mon, 01 Jan 2001 04:44:41 GMT
From: georgebailey@my-deja.com
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <92p1vo$9uh$1@nnrp1.deja.com>

Can I post something off the topic of Perl and this newsgroup but
on the topic of web color?

1) Conscientious people should only be using a subset of 216
colors in their webpages, those colors where the hex values are
00,33,66,99,CC or FF -- so Abilgail's example of the inverse of
808080 being 7f7f7f or whatever should never come up -- the
worst possible contrast you can achieve using this set of colors is
something like:

     bgcolor="#666666" text="#999999"

which is hideous but still readable if you have OK eyesight.

2) Not everyone has OK eyesight, in fact some people are
colorblind, so despite the fact that the putative Perl script that
started this all off could come up with strongly contrasting colors,
if they were contrasting reds and greens, that could have the effect
of gray on gray for some people.


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 1 Jan 2001 17:36:08 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn9509an.6lr.mgjv@martien.heliotrope.home>

On 31 Dec 2000 05:11:34 GMT,
	The WebDragon <nospam@nospam.com> wrote:

[snippage of flame crud]

> HE is interested in CONTRASTING colors.
> 
> *I* am interested in COMPLEMENTARY colors. 

Surprisingly, there is some (and this is the surprising part) reasonably
decent Microsoft Frontpage documentation available on the Web[1] that
talks a bit about contrasting and complementary colours.

You wouldn't really want to discuss contrast and complement in RGB color
space, because it is failry unsuitable for it. What you'd do is define
what exactly you mean by contrast (and yes, there are several
definitions, some of which you will need to take into account to create
your computation, probably hue and brightness both), and do your
calculations in HSV space.

Something like the following could be used to compute contrasting
colors, but even that isn't 'the best' or the most correct. There is no
single contrasting color unless you talk about pure primaries or
secondaries (and they always have at least two contrasting colours), the
most commonly used definition of contrasting colours are the colours
that can be found 120 degrees away on the colour circle, so:

convert RGB to HSV
rotate hue 120 degrees clockwise and anticlockwise
value becomes 1 - value
convert both results back to RGB, and pick one.

Of course, for colours with middle values of value or brightness and
little saturation, this won't really result in good contrasting colors.
For pure grays, this is next to useless. It may be better to always pick
a V of 1 if the current V < 0.5, and a V of 0 for V >= 0.5, or something
like that. Many ways can lead to a 'valid' soltion. Contrast is not an
absolute when talking about colours.

Complementary colours are slightly easier: Rotate the hue by 180
degrees. Or, in other words, pick the colour on the opposite side of the
colour circle.

You might also be interested in this article: /Matrix Operations for
Image Processing/, http://www.sgi.com/grafica/matrix/index.html, which
talks about doing these sorts of things in RGB space.

Martien

[1] One such place is
http://vclass.mtsac.edu/fp/books/runfp98/00000/00060.htm. For more
detailed information, get a good book on colour theory; start with the
color FAQ by Poynton, at http://www.inforamp.net/~poynton/ColorFAQ.html,
it's got a good bibliography
-- 
Martien Verbruggen              | 
Interactive Media Division      | Can't say that it is, 'cause it
Commercial Dynamics Pty. Ltd.   | ain't.
NSW, Australia                  | 


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

Date: Mon, 01 Jan 2001 12:36:50 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <vau05tgei2j3kngt62l1oq30cstcgvs4ge@4ax.com>

The WebDragon wrote:

>*I* am interested in COMPLEMENTARY colors. 

I think that indeed, the grays 0x7F7F7F and 0x808080 are indeed
complementary. What other color than gray could be complementary to
gray? The fact that it's nearly the same color, doesn't make a
difference.

Note that binary NOT does indeed work for complementing, because adding
a number and it's binary inversion, results in a number with all bits
set. In this case: 3 bytes 255, or pure white.

-- 
	Bart.


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

Date: Mon, 01 Jan 2001 14:40:53 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <pp415t0ctmao7rtsl89ddfudb6m163nth7@4ax.com>

Abigail wrote:

>Note also that this doesn't give anything related to contrasting colours.
>0x808080 is some form of gray. Inverting the bits yields 0x7f7f7f, which
>is almost as close to 0x808080 as you can get.

True. I'm not sure there's an easy fix.

Now, you can say that the question about finding a contrasting colour,
is not Perl related, hence off topic for this newsgroup. However, once
you've decided on an algorithm, implementing it efficiently (as in "neat
Perl", not "fast Perl"), is on topic.  ;-)

Now, of the top of my head, I can think of two schemes.

First, you can select a color, which is 128 steps away (in a 256 step
range from completely dark to light) for each of the three primary
colors. Implementing that is dead simply: imply toggle the highest bit
for each color.

	$color = 0xC08040;
	$contrast = $color ^ 0x808080;
	printf "#%06X\n", $contrast;
-->
	#4000C0

Route 2: pick a color that is a far away from the original color as
possible. That is, at least 128 steps away for every primary color, but
if more is possible, go for more. In practice, this means that a value
of 0x80 above will be saturated at 0, and of 0x7F or less, will be
saturated at 0xFF. As a result, only 8 colors are possible:

	black	0x000000
	red	0xFF0000
	green	0x00FF00
	blue	0x0000FF
	magenta	0xFF00FF
	yellow	0xFFFF00
	cyan	0x00FFFF
	white	0xFFFFFF

Now, the big question: how to implement this scheme? Binary AND with
0x80 is a start. Replace the byte with 0 if this result is 128, and with
255 if it is 0.

An attempt:

	$_ = pack 'V', $color;
	for my $i (0 .. 2) {
	    if(vec($_, $i, 8) & 0x80) {
	        vec($_, $i, 8) = 0;
	    } else {
	        vec($_, $i, 8) = 0xFF;
	    }
	}
	$contrast = unpack 'V', $_;

I would not call this very elegant.

-- 
	Bart.


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

Date: 1 Jan 2001 17:12:31 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <978364630.3005@itz.pp.sci.fi>

In article <pp415t0ctmao7rtsl89ddfudb6m163nth7@4ax.com>, Bart Lateur wrote:
>
>	$_ = pack 'V', $color;
>	for my $i (0 .. 2) {
>	    if(vec($_, $i, 8) & 0x80) {
>	        vec($_, $i, 8) = 0;
>	    } else {
>	        vec($_, $i, 8) = 0xFF;
>	    }
>	}
>	$contrast = unpack 'V', $_;
>
>I would not call this very elegant.

  sub contrast {
      my $bits = pack V => 0x808080 & shift;
      $bits =~ tr/\0\x80/\xFF\0/;
      return 0xFFFFFF & unpack V => $bits;
  }

  sub contrast {
      my $color = 0x808080 & ~shift;
      $color |= $color >> $_ for 1, 2, 4;
      return $color;
  }

But having only 8 possible return values does seem a little dull.
Projecting the complement of a color to the surface of the RGB cube
seems like a much nicer approach:

  sub contrast2 {
      my ($r, $g, $b) = map 2 * (255 & $_[0] >> $_), 16, 8, 0; 
      my $max = ( abs($r - 255) > abs($g - 255) ?
                  ( abs($r - 255) > abs($b - 255) ? $r : $b ) :
                  ( abs($g - 255) > abs($b - 255) ? $g : $b ) );
      $_ = int(127.5 - 127.5 * ($_ - 255) / abs($max - 255))
          for $r, $g, $b;
      return( ($r << 16) + ($g << 8) + $b );
  }

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post
 something, we discuss its implications.  If the discussion happens to
 answer a question you've asked, that's incidental." -- nobull in clpm



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

Date: Mon, 01 Jan 2001 21:09:26 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <m3n1dbkmij.fsf@solo.david-steuber.com>

Why am I doing this? <rhetorical>

tadmc@metronet.com (Tad McClellan) writes:

' I can only hope that "someone" is communicating offline with the
' FAQ askers so that we can cure the disease (ain't gonna happen)
' rather than attempt to merely treat the symptoms.

I've noticed that a number of NEWBE and HELP type posts have munged
addresses, making it difficult to answer off line.  My address looks
weird, but it is real.

Abigail's response seems entirely appropriate to the original post.
I've followed some of the code snippets that Abigail has posted.
Figuring out why they work provides some insite into how Perl works.
It would be a great shame if Abigail and other Perl gurus decided to
pack it in because people didn't do their homework first.

The subject of this thread and the OP don't even work well together.
The OP wants to find a way to get a high contrast font for a given
background color.  Applying a bit-wise not to the numerical value of
the color will not accomplish that goal.  So not only is the OP asking
a question using the wrong operator and wihtout regard to string ->
number conversion, he is asking the wrong question independent of the
Perl language.

So many people are asking off topic posts in this news group.  Most of
the questions I see that are off topic seem to belong in
comp.infosystems.www.authoring.cgi or possibly comp.lang.perl.modules
(for those using CGI.pm or a related module).  I believe I've even
seen a number of HTML questions.

Mostly I am a lurker here.  I get great value from the on topic
questions that do not have obvious answers and get replies from the
luminaries in this group.  I would really hate to see the signal to
noise ratio of this group drop to the point where it is not worth the
effort to follow anymore.

Well, I've said my peace.  Everyone have a happy new millennium.  At
least now we don't have to debate whether or not it is the 21st
century anymore ;-)

-- 
David Steuber | Perl apprentice.  The axe did not stop the
NRA Member    | mops and buckets from flooding my home.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


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

Date: Mon, 01 Jan 2001 21:36:47 GMT
From: nadie@latino-2000.com (El Nadie)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <nadie3a50f25312bc2@news.latino-2000.com>

On Mon, 01 Jan 2001 21:09:26 GMT,
	David Steuber <nospam@david-steuber.com> wrote:
> 
> [ ... snip ... ]
> 
> Abigail's response seems entirely appropriate to the original
> post. I've followed some of the code snippets that Abigail has
> posted. Figuring out why they work provides some insite into how
> Perl works. It would be a great shame if Abigail and other Perl
> gurus decided to pack it in because people didn't do their
> homework first.

It would be even better if Abigail would continue to post his/her
wonderful and instructive code snippets, without the often immature
and cruel insults which s/he likes to supply along with so many of
them.

You make it seem as if the only choices available are for us to
receive the code snippets along with the childish insults, or for
Abigail and other Perl gurus to go away.  Those are but two of
several ways things could go.

The gurus rightfully would like the newbies to make the effort learn
how to look things up in the FAQs before posting here, and I contend
that in addition to this (*not* instead of this), a few of the gurus
also should make the effort learn how to behave like mature adults
when giving this advice to the newbies.

Here's what I'd like to see:

(1)  The gurus still encourage the newbies to develop the habit
     of looking things up before coming here with FAQs.

(2)  The very few gurus who behave like immature bullies learn new
     and more adult and respectful ways to encourage the newbies to
     look things up, as in (1), above.

(3)  The newbies learn how to look things up, as in (1), above.

(4)  The few newbies who act like spoiled brats learn new and more
     adult and respectful ways to respond to the encouragment given
     to them by the gurus.

I believe that all four of these are necessary, *including*
number (2).

Can anyone suggest a good reason why number (2) should *not*
be part of the overall effort to make c.l.p.misc a better
place?

Most gurus are already behaving admirably, like the adults they are.
But there indeed are a few who could stand some self-examination and
some self-improvement, and I don't believe that they should be
exempt from this, just because they are considered to be gurus here.


> [ ... snip ... ]


-- 
El Nadie
nadie@latino-2000.com


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

Date: 01 Jan 2001 17:09:37 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <m3u27i53ha.fsf@mumonkan.sunstarsys.com>

nadie@latino-2000.com (El Nadie) writes:

> The gurus rightfully would like the newbies to make the effort learn
> how to look things up in the FAQs before posting here, and I contend
> that in addition to this (*not* instead of this), a few of the gurus
> also should make the effort learn how to behave like mature adults
> when giving this advice to the newbies.
> 
> Here's what I'd like to see:
> 
> (1)  The gurus still encourage the newbies to develop the habit
>      of looking things up before coming here with FAQs.

They already do.
 
> (2)  The very few gurus who behave like immature bullies learn new
>      and more adult and respectful ways to encourage the newbies to
>      look things up, as in (1), above.

With all due respect, I disagree, strongly.

> (3)  The newbies learn how to look things up, as in (1), above.

Being polite doesn't work; but impoliteness adds to possibility of a
flame war.
 
> (4)  The few newbies who act like spoiled brats learn new and more
>      adult and respectful ways to respond to the encouragment given
>      to them by the gurus.

How does someone know they're acting childish unless you treat them
like one? That's the $10,000 question, and there's no way to avoid
offending someone when a childish post appears.  Ignoring the 
problem will not make it go away.

> I believe that all four of these are necessary, *including*
> number (2).
> 
> Can anyone suggest a good reason why number (2) should *not*
> be part of the overall effort to make c.l.p.misc a better
> place?

While I haven't been here long, and certainly don't speak for
anyone but myself, I would be quite surprised if at some point
in the distant past the gurus in this group acted a bit more 
benevolently.  Their reward for this no doubt was more inanity,
and have decided that a harsher tone is appropriate.

Recently I experienced a similar phenomenon.  Someone posted a 
question about problems with DBI, and I was apparently too polite
in telling this person that among the problems with their code,
they needed to include error checking in their DBI calls.  This
was my mistake, since it encouraged more inanity posted to this
newsgroup, instead of some behavior modification on the part of
the OP.

So what happened?  Well, they ignored what I told them and 
reposted the same fscking code (with less errors the second time
round).  Everybody loses.

> Most gurus are already behaving admirably, like the adults they are.
> But there indeed are a few who could stand some self-examination and
> some self-improvement, and I don't believe that they should be
> exempt from this, just because they are considered to be gurus here.

You seem to prefer imposing your own view of what is socially
acceptable in this particular society.  Please stop. There are 
many ways to accomplish something, and what's sorely needed in
clp.misc is behavior modification.

Things are the way they are because of the ceaseless inanity
and ad-hominem bullshit that fills this thread.

It doesn't belong on usenet from anyone.  Personal attacks 
are the sole reason I killfile anyone, and unless you stop
your tirade, you will become the very first entry.

-- 
Joe Schaefer



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

Date: Mon, 01 Jan 2001 23:56:44 GMT
From: nadie@latino-2000.com (El Nadie)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <nadie3a5103cf140a9@news.latino-2000.com>

On 01 Jan 2001 17:09:37 -0500,
	Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
> nadie@latino-2000.com (El Nadie) writes:
> 
> [ ... snip ... ]
>
> > Here's what I'd like to see:
> > 
> > (1)  The gurus still encourage the newbies to develop the habit
> >      of looking things up before coming here with FAQs.
> 
> They already do.

Agreed.


> > (2)  The very few gurus who behave like immature bullies learn new
> >      and more adult and respectful ways to encourage the newbies to
> >      look things up, as in (1), above.
> 
> With all due respect, I disagree, strongly.

Understood, and I'll reply to your longer discussion, below.


> > (3)  The newbies learn how to look things up, as in (1), above.
> 
> Being polite doesn't work; but impoliteness adds to possibility of a
> flame war.

I agree that impoliteness usually increases the possibility of
flames.  But I must respectfully tell you that I don't entirely
agree that being polite doesn't work.  Once again, I'll elaborate
below.


> > (4)  The few newbies who act like spoiled brats learn new and more
> >      adult and respectful ways to respond to the encouragment given
> >      to them by the gurus.
> 
> How does someone know they're acting childish unless you treat them
> like one? That's the $10,000 question, and there's no way to avoid
> offending someone when a childish post appears.  Ignoring the 
> problem will not make it go away.

Well, I can think of several ways to let someone know they are
childish. Here are two:

(A)  Tell them something like this: "I believe that you're being
     childish continuing to refuse to go to the FAQ.  Several people
     here have suggested that you do so, and yet, you haven't.  If
     you continue, the very people who are here to help you will
     probably put you into their killfiles, and you will not get the
     help you're looking for, thereby defeating your own purpose.
     Therefore, please go to the FAQ [or to a more appropriate
     newsgroup, etc.]."

     This is already the way that most of the gurus and other people
     here communicate, IMO.

(B)  Insult and/or talk down to the person when requesting that
     he or she go to the FAQ or other newsgroups.

     I truly believe that there are, unfortunately, a small number
     of people here (including one or two gurus) who repeately do
     this.

In my years of reading and contributing to this newsgroup and usenet
in general, I see number (A) working equally well as (B) in terms of
getting people to check the FAQ, etc.  Also during these years, I
have seen (B) start many more flame wars than (A) has ever done.

Therefore, in my experience, (A) is much more effective at keeping
the bandwidth down than (B).

And it seems to me that behaving as (A) is not ignoring the problem,
by any means.


> > I believe that all four of these are necessary, *including*
> > number (2).
> > 
> > Can anyone suggest a good reason why number (2) should *not*
> > be part of the overall effort to make c.l.p.misc a better
> > place?
> 
> While I haven't been here long, and certainly don't speak for
> anyone but myself, I would be quite surprised if at some point
> in the distant past the gurus in this group acted a bit more 
> benevolently.  Their reward for this no doubt was more inanity,
> and have decided that a harsher tone is appropriate.

I have come in and out of this group as a reader and contributor for
some 7 or more years (well, comp.lang.perl before this).  And yes, I
agree with you that in the past, many of the gurus behaved with more
patience and equanimity than they do now.  And also, I agree with
you that they have had to learn to be more strict and unyielding as
time went on, in response to the increasing numbers of people who
come here asking the same questions over and over.  Furthermore, I
believe that the Perl documentation effort and the FAQs have become
top-notch as a result of the admirable efforts of many of these
gurus to provide resources outside of c.l.p.misc for the new Perl
users to go to, in lieu of coming here with their repeated
questions.

And so yes, believe it or not, I totally agree with you about the
following points:

-- That the gurus are justified in being firm about sending
   new posters to the FAQs and to other newsgroups.

-- That most of the gurus used to be more patient and that
   their increasing strictness is completely justified in
   response to the continuous influx of newbies with FAQs.

And I will add here something that I have said before but deserves
to be repeated: it appears to me that the vast majority of gurus
here, despite their long-term frustration, are patient and polite
and respectful in almost all cases when they tell someone to read
the FAQs ... and that when they occasionally do lose their "cool",
it almost always is justfied by the recalcitrant way that the other
person has been behaving.

However, I have to also make it clear that in my long number of
years in and out of this newsgroup, I have seen a very small number
of gurus who *always* have appeared to me to have had a
consdescending, chip-on-the-shoulder attitude towards most of the
others who post.  This was occuring far in the past, even when most
of the other gurus were being a lot more patient then they are now.

In my recent posts here, I am *only* referring to this tiny minority
of gurus, not the vast majority whom, as I mentioned above, I
consider to be totally justified in how they behave.


> Recently I experienced a similar phenomenon.  Someone posted a 
> question about problems with DBI, and I was apparently too polite
> in telling this person that among the problems with their code,
> they needed to include error checking in their DBI calls.  This
> was my mistake, since it encouraged more inanity posted to this
> newsgroup, instead of some behavior modification on the part of
> the OP.
> 
> So what happened?  Well, they ignored what I told them and 
> reposted the same fscking code (with less errors the second time
> round).  Everybody loses.

I have seen the same phenomenon that you have just related. However,
I would bet you any amount of money that if you could do it over
again, you would find a firm but respectful way to admonish the
person in a manner more or less like my (A) example above, and that
you would not lower yourself to talking down to the person or
insulting him or her.  I am willing to make this bet because I can
see from your message here and others that you've written, that you
are a person who makes an effort to communicate in a respectful
manner to others enve when you are furstrated or have strong
feelings -- and I repeat: IMO almost all the gurus here behave in
the same respectful manner.

All I'm advocating here is that the tiny minority of gurus who don't
behave in this way make an effort to change their communication
style.  And I contend that this alone will cause a decrease in flame
wars here.


> You seem to prefer imposing your own view of what is socially
> acceptable in this particular society.  Please stop. There are 
> many ways to accomplish something, and what's sorely needed in
> clp.misc is behavior modification.

I don't have the power to impose my view, and I'm not trying to do
so.  I'm just another voice in the crowd.  All I'm doing is
*expressing* my view, as are you and just about everyone else here.

However, if my expositions^H^H^H^H^H^H^H^H^H^H^Hrants are generally
upsetting, I will indeed stop. You are the very first person who has
responded to any of my recent posts, so before your message, I
couldn't be sure how most people here feel about what I've been
saying -- well, to be more precise, I was pretty sure that a few
individuals might not like what I'm saying and advocating, but I
truly wasn't sure how the majority of c.l.p.misc contributors would
feel.

I've made my points and they're here for anyone to read.  I don't
need to continue elaborating and over-elaborating.  Without having
received your request that I stop, I might have continued a bit more
before settling down, but I do honor your request, and I will from
now on back off and let others debate the points I have raised ...
if indeed there are others at all who wish to discuss this.


> Things are the way they are because of the ceaseless inanity
> and ad-hominem bullshit that fills this thread.

I agree.


> It doesn't belong on usenet from anyone.  Personal attacks 
> are the sole reason I killfile anyone, and unless you stop
> your tirade, you will become the very first entry.

Well, I hope you can see, maybe a bit better than before, where I'm
coming from. And also, I hope you have read what I wrote above about
settling down and letting others continue this topic.  But I still
believe what I believe about that tiny minority of gurus here, and
although I doubt that I will feel like spouting off in long rants in
the future, there still might be occasional times where I might
again feel it's necessary to make a few short comments along these
lines.  Therefore, if you or anyone else still wants to killfile me,
so be it.

Whether or not you decide to give me a *plonk*, I have just one
final question for you and anyone else who might want to reply. This
may sound like a challenge or a rhetorical question, but I assure
you that it's not ... I truly would like to know your answer and
that of other people here. And if indeed any of you would like to
reply, you're welcome to write me privately so as to keep this out
of the newsgroup.

The question is this: you said that ad-hominem bullshit doesn't
belong on usenet, and believe it or not, I totally agree with you. I
know a lot of newbies and others do engage in such antics, as do
many others of us net denizens.  In general, the gurus here are
pretty good about staying away from this sort of thing, but as you
know, I truly believe there are one or two gurus here who seem to
actually enjoy making ad-hominem attacks. And so I ask any and all
of you, if you wish to reply, if you should ever happen to see gurus
engaging in ad-hominem bullshit, would be be as opposed to this as
you are when others do it? ... and if not, why not?

Once again, this is a real question whose answer I'm truly
interested in, not a rhetorical challenge.

And now, finally, as they say in Spanish, "eso es".


> Joe Schaefer

-- 
El Nadie
nadie@latino-2000.com


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

Date: 1 Jan 2001 19:29:49 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <92r7dt$67d@junior.apk.net>

In article <nadie3a4f2194624f@news.latino-2000.com>,
El Nadie <nadie@latino-2000.com> wrote:
>On 31 Dec 2000 03:11:48 GMT, Abigail <abigail@foad.org> wrote:
>> Buy a book about basic colour theory and have someone read it to you. 
>
>Buy a book about manners and respect for others, and have someone
>read it to you while you try to grow up.

Look, it's just the way Abigail is.  You will never change Abigail.
Don't bother trying.

I happen to enjoy Abigail's wit--but if you don't, oh well, just set
your newsreader to ignore Abigail's posts.  You'll miss out on the
sarcasm and some genuinely cool Perl stuff.  Your choice.



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

Date: Mon, 1 Jan 2001 15:57:33 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn951rps.d5s.tadmc@magna.metronet.com>

David Steuber <nospam@david-steuber.com> wrote:
>tadmc@metronet.com (Tad McClellan) writes:
>
>' I can only hope that "someone" is communicating offline with the
>' FAQ askers so that we can cure the disease (ain't gonna happen)
>' rather than attempt to merely treat the symptoms.
>
>I've noticed that a number of NEWBE and HELP type posts have munged
>addresses,


I've noticed that too. My newsreading software make use of the 
information provided by the presence of a munged address.


>Abigail's response seems entirely appropriate to the original post.


You know that. I know that. Everybody who is a regular reader
of the newsgroup knows that. Many of the followups in this thread
are from people that just do not know what they are talking about.

They are new here, don't like what they see, and are going to
instruct us on how to fix it. Pretty cute really.


>It would be a great shame if Abigail and other Perl gurus decided to
>pack it in because people didn't do their homework first.


This has already happened many times over. I used to get my
Perl questions answered on Usenet by Larry Wall himself.


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


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

Date: Mon, 1 Jan 2001 17:37:06 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn9521ki.d5s.tadmc@magna.metronet.com>

Joe Schaefer <joe+usenet@sunstarsys.com> wrote:

>While I haven't been here long, and certainly don't speak for
>anyone but myself, I would be quite surprised if at some point
>in the distant past the gurus in this group acted a bit more 
>benevolently.  


You will not be surprised.


>Their reward for this no doubt was more inanity,
>and have decided that a harsher tone is appropriate.


That is what the more *tolerant* ones got. That's right, the
experienced folks who are still here are the _tolerant_ ones.

Consider it for a moment...

 ... the _in_tolerant ones just don't come back here. 

You never see them, and you never see them cast light on some
corner of Perl anymore either  :-(

A valuable resource now gone (of course some leave for 
reasons besides FAQ flooding too).


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


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

Date: Mon, 1 Jan 2001 17:22:00 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn9520o8.d5s.tadmc@magna.metronet.com>

El Nadie <nadie@latino-2000.com> wrote:
>On Mon, 01 Jan 2001 21:09:26 GMT,
>	David Steuber <nospam@david-steuber.com> wrote:
>> 
>> [ ... snip ... ]
>> 
>> Abigail's response seems entirely appropriate to the original
>> post.

>It would be even better if Abigail would continue to post his/her
>wonderful and instructive code snippets, without the often immature
>and cruel insults which s/he likes to supply along with so many of
>them.


Better yet would be if there were less Frequently Asked Questions!

Are we going to get the "best"? No.

Are we going to get the second "best"? Probably not.

It is not going to get better. It just isn't. This same discussion
has been held here *dozens* of times. The fuel for this fire
comes from the people who have not seen this discussion played
out a few times before, and they're working it out for themselves.

You should lurk (and contribute if you like) for at least
six months before you presume to know enough about this
society to start recommending how to modify it.

(if you had already done that, you would have seen 3-4 of
 these threads already and addressed what is different
 that would justify reopening the issue.
)

Busting in here and telling us we're not doing it right, and
that we must change to your better way is presumptuous in
the extreme. Your opinions will not be well-received when
offered under such circumstances.


clpmisc has been reduced to a "half a loaf is better than none"
choice. Subscribers want "half a loaf", many (unsubscribed) experts
opted for "none".

Applying social pressure against FAQ asking is an attempt
to stem the tide. The pitiful few left could decide to opt
out too. Less people looking at future questions does not
favorably influence getting an answer.

The organism that is clpmisc begins to atrophy.


>Here's what I'd like to see:
             ^
             ^

Is this your newsgroup or something? Do you even have a stake here?

Who are you?

If you want your own newsgroup, then create your own newsgroup, 
take it to news.groups.


>(2)  The very few gurus who behave like immature bullies learn new
>     and more adult and respectful ways to encourage the newbies to
>     look things up, as in (1), above.
>
>(3)  The newbies learn how to look things up, as in (1), above.


But step 3 does not follow from step 2. It would be nice if
that happened. But it didn't happen. Many times it didn't
happen.

Being nice about FAQ asking does not work. We have seen it here.

There are lots of FAQs asked here now. We used to be nice about
FAQ asking. So to get from "used to" to "now", that being
polite stuff must not have worked.

Do not assume that it has not _already_ been as you would like,
just because you were not around to see it when it happened.

I have seen it. You have to go back at least 3 or 4 years to
see a nice and useful clpmisc rather than the slum that
presents itself today.


>Can anyone suggest a good reason why number (2) should *not*
>be part of the overall effort to make c.l.p.misc a better
>place?


Because it did not work before.

What is different this time?


>Most gurus are already behaving admirably, like the adults they are.
>But there indeed are a few who could stand some self-examination and
>some self-improvement, and I don't believe that they should be
>exempt from this, just because they are considered to be gurus here.

You: I want the gurus to be nice

Us: We want the newbies to be nice

You: gurus should stop being mean

Us: newbies should stop repeating FAQs


You are free to want what you want, and gurus can still be mean.

We are free to want what we want, and newbies can still ask FAQs.

Usenet is anarchy. 


One unheard of anonymous poster is not likely to revolutionize
clpmisc society anyways. Give up.


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


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

Date: 2 Jan 2001 02:17:43 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <92rdo7$h5s$1@216.155.33.34>

In article <slrn9509an.6lr.mgjv@martien.heliotrope.home>, 
mgjv@tradingpost.com.au wrote:

[snip of excellent helpful response to my query] 

Thank you Martien; a most helpful and informative post .. I'll look into 
the links you suggested and see what I can come up with while I play 
with the ideas that the research generates. 

I'm glad to see that some people are not afraid to give other folks a 
'leg up', I was beginning to fear such things had gone the way of the 
Dodo. 

Have a happy New Year :)

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Tue, 2 Jan 2001 13:29:42 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn952f8m.6lr.mgjv@martien.heliotrope.home>

[This is not specifically directed to the poster of the article I'm
following up to, but more generally]

On Mon, 01 Jan 2001 23:56:44 GMT,
	El Nadie <nadie@latino-2000.com> wrote:
> 
>      This is already the way that most of the gurus and other people
>      here communicate, IMO.

I am not going to add anything to the age-old discussion on how people
whould or shouldn't behave on this group. I've been there, done that,
and am now utterly bored by it.  I will make one or two remarks about
what I think should happen to this thread.

However, this thread has been using the word 'guru' repeatedly, and I
believe it's not entirely appropriate. Most Perl gurus (or above) don't
post here anymore, or have decreased the frequency of posts here to
almost nil.  Of the people remeaining many have a high Perl mastery
status, but only very few would claim guru-dom.

You might be interested to read 'the seven steps of Perl mastery', which
is available from many places on the Web, as well as from Usenet
archives.

I just felt I had to make sure we weren't all forgetting what guru
really means.

Martien

PS. There are still gurus posting here. Whether they'd claim this title
themselves is another matter. 

PPS. Please, if you haven't been here for at least half a year, but even
better, a year, don't keep these discussions alive, because you don't
know what you are talking about yet. If you have been here for at least
that period, all you need to do is refer to Usenet archives. you've seen
at least 2 of these threads before, more likely 4.
-- 
Martien Verbruggen              | 
Interactive Media Division      | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd.   | password?
NSW, Australia                  | 


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

Date: Tue, 02 Jan 2001 03:07:51 GMT
From: nadie@latino-2000.com (El Nadie)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <nadie3a513f6702bd@news.latino-2000.com>

On Tue, 2 Jan 2001 13:29:42 +1100,
	Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> [This is not specifically directed to the poster of the article I'm
> following up to, but more generally]

This reply is specifically directed to the poster of the article
I'm replying to, although anyone else who wishes to eavesdrop
is certainly welcome to.  :)


> On Mon, 01 Jan 2001 23:56:44 GMT,
> 	El Nadie <nadie@latino-2000.com> wrote:
> > 
> >      This is already the way that most of the gurus and other people
> >      here communicate, IMO.
> 
> I am not going to add anything to the age-old discussion on how people
> whould or shouldn't behave on this group. I've been there, done that,
> and am now utterly bored by it.  I will make one or two remarks about
> what I think should happen to this thread.
> 
> However, this thread has been using the word 'guru' repeatedly, and I
> believe it's not entirely appropriate. Most Perl gurus (or above) don't
> post here anymore, or have decreased the frequency of posts here to
> almost nil.  Of the people remeaining many have a high Perl mastery
> status, but only very few would claim guru-dom.

Actually, I took a vacation from the group for maybe a year or so,
and now that you mention it, since I've come back, most of the gurus
do seem to be more absent than I remember.


> You might be interested to read 'the seven steps of Perl mastery', which
> is available from many places on the Web, as well as from Usenet
> archives.

I believe that I've read it, but I'll check again in case I've got
it mixed up with something else.  Yes, I've been playing fast and
loose with the word "guru" in my recent posts.  It was used by one
of the people I originally responded to, and I just kept using it in
the same context as that poster.  Probably shouldn't have done that.


> I just felt I had to make sure we weren't all forgetting what guru
> really means.

You're right ... I need to be more precise about that word.

And therefore, all occurences of the word guru in my recent posts
should be replaced with "c.l.p.m contributor with a high Perl
mastery status and maybe also a real guru here and there."  :)

> 
> Martien
> 
> PS. There are still gurus posting here. Whether they'd claim this title
> themselves is another matter. 

Well, in my book (which is rather zen-like), a true guru would never
claim that status him- or herself.  :)

And that's a necessary but not sufficient condition for being a
guru, of course.


> PPS. Please, if you haven't been here for at least half a year, but even
> better, a year, don't keep these discussions alive, because you don't
> know what you are talking about yet. If you have been here for at least
> that period, all you need to do is refer to Usenet archives. you've seen
> at least 2 of these threads before, more likely 4.

Well, I've been reading/contributing to c.l.p.m on and off for more
than 7 years, and to usenet for something like 13 or 14, and so the
number of threads like this that I've seen is probably more like 100
or more, and maybe 20 or so in c.l.p.m and c.l.p in the past.
However, I haven't been posting under this ID, which is a new one
that I created mostly as spam bait, although I do receive and reply
to email at this new address.

And even so, I decided, for better or for worse, to make a handful
of posts in that thread.  Perhaps it was bad judgment, perhaps it
will have some small positive effect.  Either way, though, I'm done
with it, and back to more prosaic postings.

And I do remember that this post wasn't directed specifically at me,
but being part of the general population for whom it was intended, I
wanted to reply as I did.  :)

And thank you very much.


> -- 
> Martien Verbruggen              | 
> Interactive Media Division      | Hi, Dave here, what's the root
> Commercial Dynamics Pty. Ltd.   | password?
> NSW, Australia                  | 


-- 
El Nadie
nadie@latino-2000.com


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

Date: Wed, 3 Jan 2001 17:48:08 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <slrn955ip8.edk.mgjv@martien.heliotrope.home>

[It's bad taste to follow up to one's own posts, but in this case there
is some more information to add to my previous reply.]

On Mon, 1 Jan 2001 17:36:08 +1100,
	Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> On 31 Dec 2000 05:11:34 GMT,
> 	The WebDragon <nospam@nospam.com> wrote:
> 
> [snippage of flame crud]
> 
>> HE is interested in CONTRASTING colors.
>> 
>> *I* am interested in COMPLEMENTARY colors. 

I got intrigued by these questions, and started looking around to see if
I could find a generally accepted algorithm to find the color(s) that
contrast most with a given other color, and the color that could be
considered a color's complement[1]. I have some interest in these questions
myself, so i could spare some time on it. I mostly came up with a blank.

If you go to www.deja.com, and find the articles

Subject: Get contrasting colour
Message-ID: <881edk$v27$1@scotty.tinet.ie>

and

Subject: complementary colors, how to derive?
Message-ID: <39593CF1.6E6A@xs4all.nl>

you'll note that even the people in comp.graphics.algorithms have
trouble coming up with a single definition on how to find the best
contrasting colour, or 'the' complementary color. Those terms are all
well defined when talking about fully saturated (pure) colors with full
brightness, _or_ about gray values (in the case of contrast), but not
when you start talking about colors that are not fully saturated or have
a brightness which isn't 100%.

There are some suggestions in the threads coming out of these two
articles, however, that may help the OP, as well as anyone else
interested in this subject.

The general conclusion is still that for very simple cases, the terms
complement and contrast are well defined. However, asking a question
like 'How do I find the complementary colour of any goven colour?', or
'How do I find the most contrasting colours, given an RGB value?' cannot
be answered in any unambiguous or generally accepted way. Especially
contrast depends on too many variables to make it simple to answer.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd.   | reflects this.
NSW, Australia                  | 


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

Date: Wed, 03 Jan 2001 20:26:56 GMT
From: Zusha P <terahippo@my-deja.com>
Subject: Re: bitwise operation to find the inversion of a color
Message-Id: <9301u6$mdt$1@nnrp1.deja.com>

In article <92r7dt$67d@junior.apk.net>,
  catfood@apk.net (Mark W. Schumann) wrote:
> In article <nadie3a4f2194624f@news.latino-2000.com>,
> El Nadie <nadie@latino-2000.com> wrote:
> >On 31 Dec 2000 03:11:48 GMT, Abigail <abigail@foad.org> wrote:
> >> Buy a book about basic colour theory and have someone read it to you.
> >
> >Buy a book about manners and respect for others, and have someone
> >read it to you while you try to grow up.
>
> Look, it's just the way Abigail is.  You will never change Abigail.
> Don't bother trying.

I can't speak for "El Nadie", but I certainly am not so naive
as to think that Abigail can be changed.  And I also believe
that Abigail should receive the same kinds of insults as she
likes to give.


> I happen to enjoy Abigail's wit--but if you don't, oh well, just set
> your newsreader to ignore Abigail's posts.  You'll miss out on the
> sarcasm and some genuinely cool Perl stuff.  Your choice.

Hmmm ... Abigail could choose to ignore the posts she doesn't
like, but instead, she often decides to goes out of her way to
insult the poster.  Therefore, I think it's just as valid for
those of us who don't like Abigail's posts to let her know in
a manner that's equally sarcastic.

What goes around comes around.

It's true that Abigail's J.A.P.H.'s are clever.  And maybe
3 to 5 percent of the time she seems to actually post some
reasonably useful Perl information that goes beyond the
J.A.P.H.'s in her signature, each of which is probably
selected automatically when she posts.  But I have to agree
with the other guy who said that her insults are just plain
childish.

--
 Zusha P
 terahippo@my-deja.com


Sent via Deja.com
http://www.deja.com/


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 5225
**************************************


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