[33157] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4436 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 22 00:09:18 2015

Date: Thu, 21 May 2015 21:09:03 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 21 May 2015     Volume: 11 Number: 4436

Today's topics:
    Re: awk + grep in perl <whynot@pozharski.name>
    Re: awk + grep in perl <gravitalsun@hotmail.foo>
    Re: awk + grep in perl <whynot@pozharski.name>
    Re: awk + grep in perl <gravitalsun@hotmail.foo>
    Re: mind.pl showing storage and retrieval from memory <uri@stemsystems.com>
    Re: mind.pl showing storage and retrieval from memory mentificium@gmail.com
    Re: rename key <uri@stemsystems.com>
    Re: rename key <uri@stemsystems.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 20 May 2015 10:11:56 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: awk + grep in perl
Message-Id: <slrnmlocts.dv1.whynot@orphan.zombinet>

with <mjfgui$clr$1@news.grnet.gr> George Mpouras wrote:
> On 19/5/2015 16:48, shulamitmi@bezeq.com wrote:

*SKIP*
> /^(.+?)\s+(.*)\s*$/ or next; $data{$2}->{$1}=1

	/^(.+)\s+(.+)\s*$/ or next; $data{$2}->{$1}=1

Loose the question-mark here -- Perl is fine with backtracking.

*CUT*

-- 
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom


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

Date: Thu, 21 May 2015 02:56:53 +0300
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: awk + grep in perl
Message-Id: <mjj704$g0k$1@news.grnet.gr>

On 20/5/2015 10:11, Eric Pozharski wrote:
> with <mjfgui$clr$1@news.grnet.gr> George Mpouras wrote:
>> On 19/5/2015 16:48, shulamitmi@bezeq.com wrote:
>
> *SKIP*
>> /^(.+?)\s+(.*)\s*$/ or next; $data{$2}->{$1}=1
>
> 	/^(.+)\s+(.+)\s*$/ or next; $data{$2}->{$1}=1
>
> Loose the question-mark here -- Perl is fine with backtracking.
>
> *CUT*
>
and what about the  "a1 a2 a3 a4 foo"
I want the a1 for $1 and not a1 a2 a3 a4


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

Date: Thu, 21 May 2015 09:33:16 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: awk + grep in perl
Message-Id: <slrnmlqv1c.6o8.whynot@orphan.zombinet>

with <mjj704$g0k$1@news.grnet.gr> George Mpouras wrote:
> On 20/5/2015 10:11, Eric Pozharski wrote:
>> with <mjfgui$clr$1@news.grnet.gr> George Mpouras wrote:

>>> /^(.+?)\s+(.*)\s*$/ or next; $data{$2}->{$1}=1
>> 	/^(.+)\s+(.+)\s*$/ or next; $data{$2}->{$1}=1
>> Loose the question-mark here -- Perl is fine with backtracking.
> and what about the  "a1 a2 a3 a4 foo"
> I want the a1 for $1 and not a1 a2 a3 a4

That's lame.  Your <mjfgui$clr$1@news.grnet.gr> shows one *separating*
space.  Now it's arbitrary amount of.  Does it count as goal-post moving
already?

-- 
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom


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

Date: Thu, 21 May 2015 15:22:39 +0300
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: awk + grep in perl
Message-Id: <mjkilg$q32$1@news.grnet.gr>

On 21/5/2015 09:33, Eric Pozharski wrote:
> with <mjj704$g0k$1@news.grnet.gr> George Mpouras wrote:
>> On 20/5/2015 10:11, Eric Pozharski wrote:
>>> with <mjfgui$clr$1@news.grnet.gr> George Mpouras wrote:
>
>>>> /^(.+?)\s+(.*)\s*$/ or next; $data{$2}->{$1}=1
>>> 	/^(.+)\s+(.+)\s*$/ or next; $data{$2}->{$1}=1
>>> Loose the question-mark here -- Perl is fine with backtracking.
>> and what about the  "a1 a2 a3 a4 foo"
>> I want the a1 for $1 and not a1 a2 a3 a4
>
> That's lame.  Your <mjfgui$clr$1@news.grnet.gr> shows one *separating*
> space.  Now it's arbitrary amount of.  Does it count as goal-post moving
> already?
>

you know the OP is Mr. shulamitmi@bezeq.com not me
usually when there is a separator involved at the data, humans means the 
fist instance of it inside the string from left to right. ok ?

Also I do not like your "lame" accusation



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

Date: Thu, 21 May 2015 01:42:54 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: mind.pl showing storage and retrieval from memory
Message-Id: <87h9r64hb5.fsf@stemsystems.com>

>>>>> "m" == mentificium  <mentificium@gmail.com> writes:

  m> On Monday, May 11, 2015 at 4:40:33 PM UTC-7, Uri Guttman wrote:
  >> >>>>> "m" == mentificium  <mentificium@gmail.com> writes:
  >> 
  m> use strict;     # PERL by Example (2015) p. 77 
  m> use warnings;   # PERL by Example (2015) p. 85 
  >> 
  >> do you need to cite the lousy book 
  >> where you learned lousy perl from?

  m> http://www.amazon.com/dp/0133760812 
  m> "Perl by Example, Fifth Edition" (2015!) 
  m> is extremely up-to-date and authoritative. 

on whose authority is the book authoritative? based on your poor code,
the book must be pretty bad.

  m> When the Perl AI code-comments cite page-numbers 
  m> in "Perl by Example", Perl newbies have a chance 
  m> to learn Perl and AI-in-Perl simultaneously. 

learn bad perl and bad AI. a double feature!

  >> these are among the worst and most useless comments i have ever
  >> seen. they rank up with $i++ ; # increment i

  m> You may be a Perl expert, but a newbie needs lots of help. 

not increment i comments. they teach BAD coding. and since you aren't a
perl expert, why do you code to newbies? you aren't going to be teaching
any soon.

  >> 
  m> our $age = 0;   # Temporary age for loop-counting and loop-exit.
  m> our @aud = " "; # PERL by Example (2015) p. 17: auditory array
  >> 
  >> that isn't an empty array anymore.
  >> 
  m> our $cns = 32;  # size of AI memory for central nervous system.
  >> 
  >> why our????? my is better here. 

  m> https://groups.google.com/d/msg/comp.lang.perl.misc/3K9PYNHKIgg/CIZjsbv4gggJ 
  m> is where Robbie Hatley on 25 April 2015:
  >> Package variables (in this case in package main::) 
  >> should be declared with "our": 

you don't get it. you don't NEED package variables. you want
lexicals. ask your ai engine why lexicals are better than package vars.

  >> 
  m> sub AudInput;   # PERL by Example p. 351 Forward declaration 
  >> 
  >> perl doesn't need forward declarations of subs if you call them with
  >> (). this is wasted pixels

  m> Hmm, thanks for that information.

perl by moronic example didn't show that?

  >> 
  m> TabulaRasa: {   # PERL by Example (2015), p. 204: Labels
  >> 
  >> wtf do you need a label? you don't use it anywhere!!

  m> The label "TabulaRasa" (Latin for "empty slate" memory) 
  m> is used merely informatively to indicate what is happening, 
  m> and also as a legacy term from previous AI Minds (see below). 

but nothing is happening. you are telling the reader that there is a
place here you may loop or $DIETY forbid, goto. but you don't use it so
you are misleading the reader. don't put in things you don't use. 

  >> 
  m> my $trc = 0;  # $trc variable is "tabula rasa counter".
  >> unneeded.
  >> 
  m> until ($trc == $cns) {  # PERL by Example (2015), p. 193: "Loops".
  >> 
  >> until loops are so wacko. no one uses them. 

  m> In the primitive prototype Perl AI, we need to 
  m> show some output with the temporary until-loop.

primitive perl it is!


  >> 
  m> $aud[$trc] = " ";     # Fill CNS memory with blank spaces.
  >> 
  >> gack!!
  >> 
  m> $trc++;       # PERL by Example (2015) p. 21: autoincrement $trc.
  >> 
  >> learn about the x operator. maybe that stupid book mentions it.
  >> 

no comment? the x operator is easy enough to learn.

  >> this is ridiculous. you are coding perl like 
  >> it is another language. learn perl to code in perl.
  >> 
  m> Gee, the Forth community said the same thing about my Forth code.  

must be a pattern in your code that is recognized all over.

  >> 
  m> while ($t < $cns) {  # PERL by Example (2015), p. 190 
  m> $age = $age + 1;   # Increment $age variable with each loop.
  >> 
  >> crapola!! you use the ++ op earlier

no comment?

  m> Yesterday with 

  m> # $aud[$t] = $pho;  #2015may01: Store the input phoneme
  m>   $aud[$t] = "$t, $pho, $act, $audpsi";  # 2015may10: store flag-panel

  m> I figured out how to store multiple items 
  m> in each row of the @aud memory array. 

wow. and you figured it out incorrectly and in a style for perl4. maybe
your ai is really a time travel machine!!


  m> When you do your "code review for candidate screening", 
  m> please remember to ask candidates how much they know 
  m> about Mentifex artificial intelligence. 

not on your life or code. if they mention it, they will be summarily
dismissed. unless they snort soda out of their nose laughing so hard!

  m> The Mentifex AI Minds are guaranteed to exhibit 
  m> thinking -- or I will express extreme regrets. 

i express the regrets now. 

wow. delusions abound.

uri


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

Date: Thu, 21 May 2015 05:34:27 -0700 (PDT)
From: mentificium@gmail.com
Subject: Re: mind.pl showing storage and retrieval from memory
Message-Id: <7a4911ce-6713-48af-966d-6598af547c4c@googlegroups.com>

On Wednesday, May 20, 2015 at 10:47:53 PM UTC-7, Uri Guttman wrote:
> >>>>> "m" == mentificium  <mentificium@gmail.com> writes:
> [...]
>   m> TabulaRasa: {   # PERL by Example (2015), p. 204: Labels
>   >> 
>   >> wtf do you need a label? you don't use it anywhere!!
> 
>   m> The label "TabulaRasa" (Latin for "empty slate" memory) 
>   m> is used merely informatively to indicate what is happening, 
>   m> and also as a legacy term from previous AI Minds (see below). 
> 
> but nothing is happening. 

Au contraire, something is indeed happening. 
The TabulaRasa sequence is running one single time, 
to blank out the experiential AI memory of an 
expandable size, governed by the $cns variable. 

> you are telling the reader that there is a
> place here you may loop or $DEITY forbid, goto. 
> but you don't use it so you are misleading the 
> reader. don't put in things you don't use. 

No, TabulaRasa is not for looping or for "goto".
For your information, the great Dutch computer scientist 

http://en.wikipedia.org/wiki/Edsger_W._Dijkstra

Edsger Dijkstra years ago imparted his wisdom that 
"goto" can be considered harmful. Dijkstra advised 
seekers after truth and AI Mind philosophers to do 

http://en.wikipedia.org/wiki/Structured_programming

where all the (mind-)modules dance together rationally 
and goal-directedly. 

>   >> [...] 
>   m> while ($t < $cns) {  # PERL by Example (2015), p. 190 
>   m> $age = $age + 1;   # Increment $age variable with each loop.
>   >> 
>   >> crapola!! you use the ++ op earlier
> 
> no comment?

Incrementing "$age + 1" was a quick-and-dirty way to 
throw in some code that would halt any, Deity forbid, 
runaway AI. You've heard of QDOS, haven't you, the 
"Quick and Dirty Operating System"? One time in 1978 
I was at a meeting of the NW Computer Society here in 
Seattle, and the chair asked for newsletter volunteers. 
I was too busy with my AI project to work on the 
newsletter, and I was greatly relieved when a member 
named Tim Patterson (yes, "THE" Tim Patterson) raised 
his hand and volunteered. In years soon to come, 
Tim Patterson created QDOS and sold it to Microsoft 
for $50K, so that billg --> richest man on Earth. 
But I digress. Back to your diatribe.
[...]
>   m> The Mentifex AI Minds are guaranteed to exhibit 
>   m> thinking -- or I will express extreme regrets. 
> 
> i express the regrets now. 
> 
> wow. delusions abound.
> 
> uri

As Mack the Knife stood on the gallows, 
he looked around and said one word:
"Dilletanten!"

I feel the same way when I try to teach the 
world about AI. But let me engage in one 
memetic trick here. I don't just respond 
to your astute comments upthread. No, I 
carp-e the di-em to reveal some inside news 
about the unfolding Tech Singularity. 

The move into Perl AI is long and tedious. 
Many other would-be AI participants and 
singularitants from all around the world 
are now marvelling and thrilling to 

http://ai.neocities.org/AiSteps.html 

as the yawning cave of AI entry, 
the Open Portal of Perl Emergentism. 
And the Steps to AI reveal that AI is 
actually rather simple -- you just 
simulate and emulate nerve cells in 
a triplex of Perl Mind-Matrices, and 
Bingo -- Deity be Dankbarkeit -- AI. 

Furthermore, Dr. Uri, your mind is 
infected now, with unshakeable memes. 
You have become a zombie-esque carrier 
of the once-in-a-planetary-lifetime 
brain-seed of artificial brains. 
Many have wished to know what you know 
and to be infected with what haunts you, 
but their time was cut short before 
Perl AI jumped out of nowhere into 
comp.lang.perl.misc round about you. 
Shape up, shop around and shout AI. 
The Perlmind expects each commando 
to do his Singularity duty. 

Over and out. 

Cheers,

ATM


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

Date: Thu, 21 May 2015 01:44:09 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: rename key
Message-Id: <87d21u4h92.fsf@stemsystems.com>

>>>>> "JE" == Jürgen Exner <jurgenex@hotmail.com> writes:

  JE> George Mpouras <gravitalsun@hotmail.foo> wrote:
  >> is there any internal hack to rename a hash key (without ref to it) ?

  JE> 	$myhash{'newkey'} = $myhash{'oldkey'};
  JE> 	delete $myhash{'oldkey'};
  JE> should do the job quite nicely.

	$myhash{'newkey'} = delete $myhash{'oldkey'};

delete returns the value being deleted. useful effect.

uri


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

Date: Thu, 21 May 2015 01:46:53 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: rename key
Message-Id: <878uci4h4i.fsf@stemsystems.com>

>>>>> "GM" == George Mpouras <gravitalsun@hotmail.foo> writes:

  GM> On 13/5/2015 01:55, jurgenex@hotmail.com wrote:
  >> George Mpouras <gravitalsun@hotmail.foo> wrote:
  >>> is there any internal hack to rename a hash key (without ref to it) ?
  >> 
  >> $myhash{'newkey'} = $myhash{'oldkey'};
  >> delete $myhash{'oldkey'};
  >> should do the job quite nicely.
  >> 
  >> jue
  >> 

  GM> yes it will; the drawback is that copy the data and this takes times.

do you understand that hashes don't know about copies or whatever. if
your data is large, then use a ref to it instead of copying the data
around. that way you can pass it to subs as well. only when you process
the data will you need to dereference it (and that doesn't copy it).

	my $foo = 'large data' ;
	$bar{xxx} = \$foo ;
	$bar{yyy} = delete $bar{xxx} ;

renamed the key without expensive copy

uri
	


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

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


Administrivia:

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

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 V11 Issue 4436
***************************************


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