Re: The flaming X-wing secret operator

2007-11-30 Thread Yanick Champoux

shmem wrote:

in fact, shmem and Georg are the same guy, though 'Georg' just slipped ;-)


	One would think that the same sig and style and everything would have 
tipped me off.  But no... That was too suble for me still. :-P



Me likes. Lots.  I propose, as alternative names for those two tokens,
the fat bat (because it does look like a particularly rotund specimen of
that species, and in honor of the large value it yields) and thelaughing
joker (as in, just kidding, the rest of the line doesn't apply). :-)


Names OK. I'm glad you didn't come up with 'spacestation broken solar
panels' or such ;-D


	Oh, I considered it. But at the end, I thought that the other 
suggestions were rolling off the tongue a wee bit better. ;-)



Joy,
`/anick


Re: The flaming X-wing secret operator

2007-11-30 Thread Philippe Bruhat (BooK)
On Fri, Nov 30, 2007 at 09:43:36AM +0100, Philippe Bruhat (BooK) wrote:
 
  Me likes. Lots.  I propose, as alternative names for those two tokens, 
  the 
  fat bat (because it does look like a particularly rotund specimen of that 
  species, and in honor of the large value it yields) and thelaughing joker 
  (as in, just kidding, the rest of the line doesn't apply). :-)
 
 Of course, we now need canonical usage examples of those two.
 

One usage could combine them two. When you need to use the largest
possible integer on 32 bits, you can use them both. Of course, it's a
slight golf (1 character winned), but a real golfer will do much better.

2**32-1  # UINT_MAX
[EMAIL PROTECTED]@^   # fat bat  laughing joker
~0   # golf hole

-- 
 Philippe Bruhat (BooK)

 The right answer is worthless with the wrong question!
(Moral from Groo The Wanderer #88 (Epic))


Re: The flaming X-wing secret operator

2007-11-30 Thread Philippe Bruhat (BooK)
On Thu, Nov 29, 2007 at 08:01:45PM -0500, Yanick Champoux wrote:
 shmem wrote:
 To brighten up your day - here's the winged moon, which isn't an
 operator, but a constant:

 [EMAIL PROTECTED]

 Georg added:
 Similar to the winged moon - an operator (token?) which scares
 the hell out of the remainder of a list:

 [EMAIL PROTECTED]


   Me likes. Lots.  I propose, as alternative names for those two tokens, 
 the 
 fat bat (because it does look like a particularly rotund specimen of that 
 species, and in honor of the large value it yields) and thelaughing joker 
 (as in, just kidding, the rest of the line doesn't apply). :-)

Of course, we now need canonical usage examples of those two.

-- 
 Philippe Bruhat (BooK)

 Blood is thicker than water... so beware of thick relatives.
(Moral from Groo The Wanderer #18 (Epic))


Re: The flaming X-wing secret operator

2007-11-29 Thread José Alves de Castro


On Nov 28, 2007, at 4:16 PM, Philippe Bruhat (BooK) wrote:


Hi,

Just thought I should share this with the FWP crowd.

I had to do something special with the first line of a file, before
running the whole while() loop on it. I ended up with this:

@[EMAIL PROTECTED] ==~ $re;

Rafael helped me give this new operator a name (#perlfr transcript):

15:13 @BooK OMG c'est quoi ==~ comme secret op ?
15:14 @rgs le x-wing touché avec une aile en feu

Rough translation:

15:13 @BooK OMG what is ==~ for a secret op ?
15:14 @rgs the hit x-wing starfighter with a wing on fire

Cog, are you still writing this OGSOP book? ;-)


/me takes notes, as the answer is a yes.


--  
 Philippe Bruhat (BooK)


 No matter how many times you explain the big problem, some people  
see only

 their small problem.
   (Moral to the Sage story, in Groo The Wanderer  
#93 (Epic))


---
José Castro [EMAIL PROTECTED]
Applicational Development Leader
log www.log.pt

Tel:  +351 21 330 42 20
Fax:  +351 21 330 42 19
Calçada Marquês de Abrantes, 45 - 3º Dto
1200-718 Lisboa
---




Re: The flaming X-wing secret operator

2007-11-29 Thread Philippe Bruhat (BooK)
On Thu, Nov 29, 2007 at 09:54:25AM +0100, Philippe Bruhat (BooK) wrote:
 
 # DATA is the pilot, for the sake of the example
 @[EMAIL PROTECTED] =DATA=~ $re;
 

Did I just inadvertently make a Star Wars/Star Trek cross-over?

-- 
 Philippe Bruhat (BooK)

 He who revels in being bigger forgets that he is the larger target.
 (Moral from Groo #5 (Image))


Re: The flaming X-wing secret operator

2007-11-29 Thread Philippe Bruhat (BooK)
On Wed, Nov 28, 2007 at 05:09:57PM -0500, Mr. Shawn H. Corey wrote:
 Philippe Bruhat (BooK) wrote:
 Hi,

 Just thought I should share this with the FWP crowd.

 I had to do something special with the first line of a file, before
 running the whole while() loop on it. I ended up with this:

 @[EMAIL PROTECTED] ==~ $re;

 Rafael helped me give this new operator a name (#perlfr transcript):

 15:13 @BooK OMG c'est quoi ==~ comme secret op ?
 15:14 @rgs le x-wing touché avec une aile en feu

 Rough translation:

 15:13 @BooK OMG what is ==~ for a secret op ?
 15:14 @rgs the hit x-wing starfighter with a wing on fire

 Cog, are you still writing this OGSOP book? ;-)


 Actually, it's:

  @[EMAIL PROTECTED] = (  =~ $re );


Actually, it's not:

use strict;
use warnings;
use Data::Dumper;

my @fields = qw( H M S );
my $re = qr/(\d\d):(\d\d):(\d\d)/;
my %data;

# DATA is the pilot, for the sake of the example
@[EMAIL PROTECTED] =DATA=~ $re;

print Dumper \%data;

__DATA__
the time is now 03:14:15

Which outputs:

$VAR1 = {
  'H' = '03',
  'M' = '14',
  'S' = '15'
};

Why would I need parentheses, when the hash slice gives me a list
context already?

-- 
 Philippe Bruhat (BooK)

 For every winner, there must be one or more losers.
(Moral to the Sage story in Groo #111 (Epic))


Re: The flaming X-wing secret operator

2007-11-29 Thread Dmitry Karasik

 Philippe @[EMAIL PROTECTED] ==~ $re;

That gives me a reason to pick symmetrical names for my filehandles in the 
future:

 =W=~
 =O__O=~
 =IX000H000XI=~

that'll be an X-wing squadron :)

-- 
Sincerely,
Dmitry Karasik



Re: The flaming X-wing secret operator

2007-11-29 Thread Philippe Bruhat (BooK)
On Thu, Nov 29, 2007 at 01:09:20PM +0100, Dmitry Karasik wrote:
 
  Philippe @[EMAIL PROTECTED] ==~ $re;
 
 That gives me a reason to pick symmetrical names for my filehandles in the 
 future:
 
  =W=~
  =O__O=~
  =IX000H000XI=~
 
 that'll be an X-wing squadron :)
 

Or you could go down the fan fic way, and imagine the Empire is about
to win, now that the Red Squadron is severily hit:

 =Biggs_Darklighter=~
 =Jek_Porkins=~
 =Wedge_Antilles=~
 =Luke_Skywalker=~

-- 
 Philippe Bruhat (BooK)

 In war, the only winners are those who sell the weapons.
 (Moral from Groo #3 (Image))


Re: The flaming X-wing secret operator

2007-11-29 Thread Mr. Shawn H. Corey

Philippe Bruhat (BooK) wrote:

Why would I need parentheses, when the hash slice gives me a list
context already?



The parentheses, like the whitespace, are for clarification; to make it easier 
to understand what is happening.  Also, it is not one operator, it is three.

Why do you use so much whitespace in your program when most of it is not needed?


--
Just my 0.0002 million dollars worth,
 Shawn

+\
| Shangri La  \
| 40,000 km   /
+/


Re: The flaming X-wing secret operator

2007-11-29 Thread Philippe Bruhat (BooK)
On Thu, Nov 29, 2007 at 09:20:20AM -0500, Mr. Shawn H. Corey wrote:
 Philippe Bruhat (BooK) wrote:
 Why would I need parentheses, when the hash slice gives me a list
 context already?


 The parentheses, like the whitespace, are for clarification; to make
 it easier to understand what is happening.

Clarification is off-topic when you wander in the realm of golfing and
secret operators.

 Also, it is not one operator, it is three.

I don't think you fully understand what secret operators are, then. :-)

For some background on secret operators, you can read the following
thread in the archives:

http://groups.google.com/group/perl.fwp/browse_thread/thread/4416004e60b67101

-- 
 Philippe Bruhat (BooK)

 To flaunt your strength is to make it your weakness.
(Moral from Groo The Wanderer #25 (Epic))


Re: The flaming X-wing secret operator

2007-11-29 Thread yanick
On Thu, Nov 29, 2007 at 10:00:19AM +0100, Philippe Bruhat (BooK) wrote:
 On Wed, Nov 28, 2007 at 07:22:54PM -0500, Yanick Champoux wrote:
  Somehow, I think Philippe knew that. ;-)
 
 Even better, I knew I didn't need them.

I knew you knew. :-) I was more saying Philippe knows that 
it's not really one operator but a bag o' various stuff (as the 
parenthesizing shows). 

 Do you think I would have submitted a starfighter that looked like this?
 
 =(=~)

Only if you would have called it Tie Bomber with a sidecar.

  So we had the spaceship operator, and now the flaming x-wing... Hmmm... 
  I'm beginning to suspect that the '@' sigil doesn't stand for a moon, after 
  all...
 
 That's no moon! It's a space station.

Heh. That's the quote I had in mind too. But now that a Space
1999 reference has been made, I'm desperatly trying to come up with 
an Eagle operator.  Alas, so far the best I can find is 

$wosh =~ mm==mo

which is pretty sad. :-/

Joy,
`/anick


Re: The flaming X-wing secret operator

2007-11-29 Thread shmem
From the keyboard of [EMAIL PROTECTED] [29.11.07,11:11]:

 On Thu, Nov 29, 2007 at 10:00:19AM +0100, Philippe Bruhat (BooK) wrote:
  On Wed, Nov 28, 2007 at 07:22:54PM -0500, Yanick Champoux wrote:
 Somehow, I think Philippe knew that. ;-)
  
  Even better, I knew I didn't need them.
 
   I knew you knew. :-) I was more saying Philippe knows that 
 it's not really one operator but a bag o' various stuff (as the 
 parenthesizing shows). 
 
  Do you think I would have submitted a starfighter that looked like this?
  
  =(=~)
 
   Only if you would have called it Tie Bomber with a sidecar.
 
 So we had the spaceship operator, and now the flaming x-wing... Hmmm... 
   I'm beginning to suspect that the '@' sigil doesn't stand for a moon, 
   after 
   all...
  
  That's no moon! It's a space station.
 
   Heh. That's the quote I had in mind too. But now that a Space
 1999 reference has been made, I'm desperatly trying to come up with 
 an Eagle operator.  Alas, so far the best I can find is 
 
   $wosh =~ mm==mo
 
 which is pretty sad. :-/

To brighten up your day - here's the winged moon, which isn't an
operator, but a constant:

[EMAIL PROTECTED]

;-)

0--gg-

-- 
_($_= x(15).?\n.q·/)Oo.  G°\/
  /\_¯/(q/
  \__(m.·.(_(always off the crowd)).·
);sub _{s,/,($e='Itrs `mnsgdq Gdbj O`qkdq)=~y/-y/#-z/;$e,e  print}

Re: The flaming X-wing secret operator (moon 2)

2007-11-29 Thread Georg Moritz
From the keyboard of [EMAIL PROTECTED] [29.11.07,11:11]:

 On Thu, Nov 29, 2007 at 10:00:19AM +0100, Philippe Bruhat (BooK) wrote:
  On Wed, Nov 28, 2007 at 07:22:54PM -0500, Yanick Champoux wrote:
 Somehow, I think Philippe knew that. ;-)
  
  Even better, I knew I didn't need them.
 
   I knew you knew. :-) I was more saying Philippe knows that 
 it's not really one operator but a bag o' various stuff (as the 
 parenthesizing shows). 
 
  Do you think I would have submitted a starfighter that looked like this?
  
  =(=~)
 
   Only if you would have called it Tie Bomber with a sidecar.
 
 So we had the spaceship operator, and now the flaming x-wing... Hmmm... 
   I'm beginning to suspect that the '@' sigil doesn't stand for a moon, 
   after 
   all...
  
  That's no moon! It's a space station.
 
   Heh. That's the quote I had in mind too. But now that a Space
 1999 reference has been made, I'm desperatly trying to come up with 
 an Eagle operator.  Alas, so far the best I can find is 
 
   $wosh =~ mm==mo
 
 which is pretty sad. :-/

Similar to the winged moon - an operator (token?) which scares
the hell out of the remainder of a list:

[EMAIL PROTECTED]

qwurx [shmem] ~  perl -le 'print foo,bar, [EMAIL PROTECTED] ,we 
are,gone...'
foobar

;~)

0--gg-

-- 
_($_= x(15).?\n.q·/)Oo.  G°\/
  /\_¯/(q/
  \__(m.·.(_(always off the crowd)).·
);sub _{s,/,($e='Itrs `mnsgdq Gdbj O`qkdq)=~y/-y/#-z/;$e,e  print}

Re: The flaming X-wing secret operator

2007-11-29 Thread Yanick Champoux

shmem wrote:

To brighten up your day - here's the winged moon, which isn't an
operator, but a constant:

[EMAIL PROTECTED]


Georg added:

Similar to the winged moon - an operator (token?) which scares
the hell out of the remainder of a list:

[EMAIL PROTECTED]



	Me likes. Lots.  I propose, as alternative names for those two tokens, 
the fat bat (because it does look like a particularly rotund specimen 
of that species, and in honor of the large value it yields) and 
thelaughing joker (as in, just kidding, the rest of the line doesn't 
apply). :-)


Joy,
`/anick


Re: The flaming X-wing secret operator

2007-11-29 Thread shmem
From the keyboard of Yanick Champoux [29.11.07,20:01]:

 shmem wrote:
  To brighten up your day - here's the winged moon, which isn't an
  operator, but a constant:
  
  [EMAIL PROTECTED]
 
 Georg added:
  Similar to the winged moon - an operator (token?) which scares
  the hell out of the remainder of a list:
  
  [EMAIL PROTECTED]

in fact, shmem and Georg are the same guy, though 'Georg' just slipped ;-)

   Me likes. Lots.  I propose, as alternative names for those two tokens,
 the fat bat (because it does look like a particularly rotund specimen of
 that species, and in honor of the large value it yields) and thelaughing
 joker (as in, just kidding, the rest of the line doesn't apply). :-)

Names OK. I'm glad you didn't come up with 'spacestation broken solar
panels' or such ;-D

 Joy,
 `/anick
 

0--gg-

-- 
_($_= x(15).?\n.q·/)Oo.  G°\/
  /\_¯/(q/
  \__(m.·.(_(always off the crowd)).·
);sub _{s,/,($e='Itrs `mnsgdq Gdbj O`qkdq)=~y/-y/#-z/;$e,e  print}

Re: The flaming X-wing secret operator

2007-11-28 Thread Mr. Shawn H. Corey

Philippe Bruhat (BooK) wrote:

Hi,

Just thought I should share this with the FWP crowd.

I had to do something special with the first line of a file, before
running the whole while() loop on it. I ended up with this:

@[EMAIL PROTECTED] ==~ $re;

Rafael helped me give this new operator a name (#perlfr transcript):

15:13 @BooK OMG c'est quoi ==~ comme secret op ?
15:14 @rgs le x-wing touché avec une aile en feu

Rough translation:

15:13 @BooK OMG what is ==~ for a secret op ?
15:14 @rgs the hit x-wing starfighter with a wing on fire

Cog, are you still writing this OGSOP book? ;-)



Actually, it's:

 @[EMAIL PROTECTED] = (  =~ $re );


--
Just my 0.0002 million dollars worth,
 Shawn

+\
| Shangri La  \
| 40,000 km   /
+/



Re: The flaming X-wing secret operator

2007-11-28 Thread Mr. Shawn H. Corey

Yanick Champoux wrote:

Mr. Shawn H. Corey wrote:

Actually, it's:

 @[EMAIL PROTECTED] = (  =~ $re );


Somehow, I think Philippe knew that. ;-)


But, sadly, not everyone else who reads this list :(



So we had the spaceship operator, and now the flaming x-wing... 
Hmmm... I'm beginning to suspect that the '@' sigil doesn't stand for a 
moon, after all...


No, it stands for Tranquility base, where The Eagle has landed.  (That would 
be the bullseye in the center of the circle.  The outer circle is the moon.  ;)


--
Just my 0.0002 million dollars worth,
 Shawn

+\
| Shangri La  \
| 40,000 km   /
+/