[33158] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4437 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 23 18:09:19 2015

Date: Sat, 23 May 2015 15: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           Sat, 23 May 2015     Volume: 11 Number: 4437

Today's topics:
    Re: awk + grep in perl sharma__r@hotmail.com
    Re: awk + grep in perl <rweikusat@mobileactivedefense.com>
    Re: awk + grep in perl <whynot@pozharski.name>
    Re: awk + grep in perl <rweikusat@mobileactivedefense.com>
    Re: mind.pl showing storage and retrieval from memory <uri@stemsystems.com>
        Why proxy the YouTube data in the following code. <cdalten@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 22 May 2015 06:04:06 -0700 (PDT)
From: sharma__r@hotmail.com
Subject: Re: awk + grep in perl
Message-Id: <9ac53ee6-c542-4bac-ae02-87a5d575f3bd@googlegroups.com>

On Wednesday, 20 May 2015 03:42:23 UTC+5:30, Rainer Weikusat  wrote:
> Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:
> > Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:
> 
> [...]
> 
> > perl -lpe '($_=%{{map{/(\S+)(.)*file1/}<>}})=~s/\/.*//'
> 
> [Hopefully] working:
> 
> perl -lpe '($_=%{{map{/(\S+)(.)*file1/}$_,<>}})=~s/\/.*//'


It's silly season that's you come up with silly responses that are absurd.

Hashes in a scalar context donot yield what you think.
  perldoc perldata
would yield info relevant for here(near around line #250)
You did this to avoid using key %{..}.

Also, the regex inside map{...} is downright wrong.
For an input line:   area2 myfile1
this will add to the final count (which it shouldn't)
There should also be a line anchor $ at the end of regex to
remove lines ending with file11 spoiling the count.

Instead of:

> perl -lpe '($_=%{{map{/(\S+)(.)*file1/}$_,<>}})=~s/\/.*//'

  perl -le 'print 0+keys%{{map{/(\S+)(\s)+file1$/}<>}}'

will suffice.


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

Date: Fri, 22 May 2015 16:09:40 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: awk + grep in perl
Message-Id: <87h9r4vebv.fsf@doppelsaurus.mobileactivedefense.com>

sharma__r@hotmail.com writes:
> On Wednesday, 20 May 2015 03:42:23 UTC+5:30, Rainer Weikusat  wrote:
>> Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:
>> > Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:
>> 
>> [...]
>> 
>> > perl -lpe '($_=%{{map{/(\S+)(.)*file1/}<>}})=~s/\/.*//'
>> 
>> [Hopefully] working:
>> 
>> perl -lpe '($_=%{{map{/(\S+)(.)*file1/}$_,<>}})=~s/\/.*//'
>
>
> It's silly season that's you come up with silly responses that are absurd.
>
> Hashes in a scalar context donot yield what you think.

You're right on that: I though a evaluating a hash in scalar context
would yield the number of keys / number of allocated buckets but it's
actually number of used buckets/ number of allocated buckets.

Nevertheless, it works for the example in question.

[...]

> Also, the regex inside map{...} is downright wrong.
> For an input line:   area2 myfile1
> this will add to the final count (which it shouldn't)

Such an input line didn't exist. 

> There should also be a line anchor $ at the end of regex to
> remove lines ending with file11 spoiling the count.

Neither did such lines exist.

> Instead of:
>
>> perl -lpe '($_=%{{map{/(\S+)(.)*file1/}$_,<>}})=~s/\/.*//'
>
>   perl -le 'print 0+keys%{{map{/(\S+)(\s)+file1$/}<>}}'
>
> will suffice.

Well, I was copying your silly trick of using -p to avoid an explicit
print statement, except in an even sillier/ more bizarre way by ignoring
the implicit loop instead of disabling it via 'cryptic command-line
argument'. In line with this idea,

perl -E'[%`=map{/(\S+)(\s)+file1$/}<>],say~~keys%`'

NB: I don't claim this is capable of processing anything but

a1      file1
a2      file1
a3      file2
a4      file1

BTW, you may want to Google the term 'parody' ...


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

Date: Fri, 22 May 2015 13:37:12 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: awk + grep in perl
Message-Id: <slrnmlu1mo.t42.whynot@orphan.zombinet>

with <mjkilg$q32$1@news.grnet.gr> George Mpouras wrote:

*SKIP*
> you know the OP is Mr. shulamitmi@bezeq.com not me

Now I see, OP indeed is GGer.  You know that there is no sense talking
to GGer -- they never come back.  Unless it's a necroposting maybe a
decade later.

> 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 ?

Presence of space on any side of separating middle space is mere
speculation.  For me, presence of space in a filename (what is on right
side of separating middle space) is utterly evil.  Thus I'm totally OK
with space on that mistic left side.  What, that area-whatever, might be
some filename too.  Thus space on the left side might be evil too.
After all, we're talking GGer -- it's just your speculation against
mine.

> Also I do not like your "lame" accusation

That's not an accusation, that's a statement (I've checked dictionary).
I'll put it simple:  neither you nor your perl is lame;  however,
goal-post moving is.  Inventing spaces clearly constitutes the goal-post
moving.  What's lame.

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


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

Date: Fri, 22 May 2015 20:00:11 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: awk + grep in perl
Message-Id: <878ucgv3no.fsf@doppelsaurus.mobileactivedefense.com>

Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:
> sharma__r@hotmail.com writes:
>> On Wednesday, 20 May 2015 03:42:23 UTC+5:30, Rainer Weikusat  wrote:
>>> Rainer Weikusat <rweikusat@mobileactivedefense.com> writes:

[...]

>>> perl -lpe '($_=%{{map{/(\S+)(.)*file1/}$_,<>}})=~s/\/.*//'
>>
>> It's silly season that's you come up with silly responses that are absurd.

[...]

>> Instead of:
>>
>>> perl -lpe '($_=%{{map{/(\S+)(.)*file1/}$_,<>}})=~s/\/.*//'
>>
>>   perl -le 'print 0+keys%{{map{/(\S+)(\s)+file1$/}<>}}'
>>
>> will suffice.

[...]

> In line with this idea,
>
> perl -E'[%`=map{/(\S+)(\s)+file1$/}<>],say~~keys%`'

Sort-of boring because it doesn't really do anything that's not
common-place, so here's another, albeit longer, one:

perl -p0e 's^(?{%@=/(\S+)\s+file1()$/mg}).*?$^keys%@^es'


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

Date: Sat, 23 May 2015 02:01:45 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: mind.pl showing storage and retrieval from memory
Message-Id: <874mn34yt2.fsf@stemsystems.com>

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

  m> 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. 

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

i said the LABEL IS NOT BEING USED. no label related op is inside that
block. so the label is noise.

  >> 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. 

  m> No, TabulaRasa is not for looping or for "goto".

then DON'T put a label on it!

  m> For your information, the great Dutch computer scientist 
  m> http://en.wikipedia.org/wiki/Edsger_W._Dijkstra

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

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

geez, i never knew that. please elucidate about structured
programming. i am sure i have much to learn about it from you. can you
do structured programming in assembler?

  >> 
  >> no comment?

  m> Incrementing "$age + 1" was a quick-and-dirty way to 
  m> throw in some code that would halt any, Deity forbid, 
  m> runaway AI. You've heard of QDOS, haven't you, the 
  m> "Quick and Dirty Operating System"? One time in 1978 

this has nothing to do with an OS. it has to do with stupid code when
you used the correct op earlier. this is a sign of lunacy

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

you can't teach what you don't understand. your coding skills are
childish at best. that implies your ai 'skills' are at the same level. 

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


wow. major delusions. please seek appropriate help.

  m> Over and out. 

if only you were really over and out.

uri


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

Date: Fri, 22 May 2015 15:38:41 -0700 (PDT)
From: Chad <cdalten@gmail.com>
Subject: Why proxy the YouTube data in the following code.
Message-Id: <d2cc3632-8b95-4296-a033-224e92582cb3@googlegroups.com>

I was reading the source code to a YouTube Downloader at the following url..

http://www.jwz.org/hacks/youtubedown

near the bottom of the code in the do_cgi() function he says

#Proxy the data, so that we can feed it to a non-browser agent.

The question is why proxy the data? Ie, why not access the data directly? 

Thanks in advance,
Chad


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

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


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