[31960] in Perl-Users-Digest
Perl-Users Digest, Issue: 3224 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 1 21:09:25 2010
Date: Wed, 1 Dec 2010 18:09:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 1 Dec 2010 Volume: 11 Number: 3224
Today's topics:
ANNOUNCE: NHI1-0.10, PLMK-1.8 und libmsgque-4.8 <aotto1968@users.berlios.de>
Re: FAQ 3.10 Is there an IDE or Windows Perl Editor? <genomart@gmail.com>
mp3 to .swf (flash)? <todd@zoomcart.com>
Re: mp3 to .swf (flash)? <justin.1011@purestblue.com>
Re: Regex help sln@netherlands.com
Re: Regex help sln@netherlands.com
Re: Regex help sln@netherlands.com
Re: Regex help <erling.kopperdal@lyse.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 30 Nov 2010 12:59:34 +0100
From: Andreas Otto <aotto1968@users.berlios.de>
Subject: ANNOUNCE: NHI1-0.10, PLMK-1.8 und libmsgque-4.8
Message-Id: <id2p37$gfd$03$2@news.t-online.com>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Dear User,
ANNOUNCE: Major Feature Release
====================================
libmsgque: Application-Server-Toolkit for
C, C++, JAVA, C#, Go, TCL, PERL, PHP, PYTHON, RUBY, VB.NET
PLMK: Programming-Language-Microkernel
NHI1: Non-Human-Intelligence #1
STATEMENT
=========
"It takes 2 years"
"and a team of qualified software developers"
"to implement a new programming language,"
"but it takes only 2 weeks to add a micro-kernel"
- - aotto1968
SUMMARY
=======
Add support from the programming language "Go" from Google
LINKS
=====
UPDATE - PLMK definition
>
http://openfacts2.berlios.de/wikien/index.php/BerliosProject:NHI1_-_TheKernel
ChangeLog:
> http://nhi1.berlios.de/theLink/changelog.htm
libmsgque including PHP documentation:
> http://nhi1.berlios.de/theLink/index.htm
NHI1:
> http://nhi1.berlios.de/
DOWNLOAD:
> http://developer.berlios.de/projects/nhi1/
Go man pages:
> reference: gomsgqueref.n
> tutorial: gomsgquetut.n
mfg, Andreas Otto (aotto1968)
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJM9OcmAAoJEGTcPijNG3/AkLoIAJJAGELTVteePmH8BnvspqIT
FV+AETNlAPXXEq8rzrBveudDtt9qUI51INCF6Diq3PAuHVeGqAexKc7JdMg/FBC6
vXsBffWQLyeGNqnL2Hec8PessY01J++jIcKGXN6RYf8+6BjZOp9+39QMPoazGgHr
vys717bwBOWXB9BI7a5amu2CcZFn7DdzJLw3js9+hJRVvvDXLj4WiQQZz+tTF6yZ
6BOIPs0g8Q1Yw+/GptHBPM7cqHFkVgkV07HWmVKPdlfmxCjbqA/5vMb0Qz66t+xf
j8JhSlqtX0slV+kG8cmIH8Gjns523Mom+xrzVwA6lYrdEjSmVDelfwtYE6uhlFc=
=vKcm
-----END PGP SIGNATURE-----
------------------------------
Date: Tue, 30 Nov 2010 06:34:25 -0800 (PST)
From: perlgenome <genomart@gmail.com>
Subject: Re: FAQ 3.10 Is there an IDE or Windows Perl Editor?
Message-Id: <c7747e3e-64b5-4572-b6db-0acdbb30613a@i9g2000vby.googlegroups.com>
http://perl.developpez.com/outils/
------------------------------
Date: Tue, 30 Nov 2010 09:44:24 -0800 (PST)
From: asgweb <todd@zoomcart.com>
Subject: mp3 to .swf (flash)?
Message-Id: <6c5cd227-1b79-4e33-8de2-d0796be35b61@a17g2000yql.googlegroups.com>
Is there a .pm that will convert an mp3 to .swf (flash)?
If so, please include code to implement.
Thanks
------------------------------
Date: Wed, 1 Dec 2010 11:17:43 +0000
From: Justin C <justin.1011@purestblue.com>
Subject: Re: mp3 to .swf (flash)?
Message-Id: <nfnhs7-go8.ln1@zem.masonsmusic.co.uk>
On 2010-11-30, asgweb <todd@zoomcart.com> wrote:
> Is there a .pm that will convert an mp3 to .swf (flash)?
> If so, please include code to implement.
> Thanks
This is how I'd do it:
1. Search http://search.cpan.org/
2. Write a program using the tools there.
HTH.
Justin.
--
Justin C, by the sea.
------------------------------
Date: Tue, 30 Nov 2010 07:58:14 -0800
From: sln@netherlands.com
Subject: Re: Regex help
Message-Id: <5k7af6lbcre7sp6ev7dj0og3lda2lrdr7i@4ax.com>
On Mon, 29 Nov 2010 17:59:47 -0800, "John W. Krahn" <jwkrahn@example.com> wrote:
>This may work better (UNTESTED):
>
>#!/usr/bin/perl
>use warnings;
>use strict;
>
>open SYSCMD, '-|', 'dccmd', '-listmodes'
> or die "Cannot pipe from command 'dccmd' because: $!";
>
>my ( %data, @headers );
>while ( <SYSCMD> ) {
> next unless /\S/;
-------------------------------------------
> @headers = split unless /\d/;
> my @fields = split if /\d/;
unless ( /\d/ ) {
@headers = split();
next;
};
my @fields = split();
-------------------------------------------
>
> for my $index ( 0 .. $#headers ) {
> push @{ $data{ $headers[ $index ] } }, $fields[ $index ];
> }
> }
>
>close SYSCMD or warn $! ? "Error closing sort 'dccmd' because: $!"
> : "Exit status $? from 'dccmd'\n";
>
>for my $header ( @headers ) {
> print "$header:\n", map "$_\n", @{ $data{ $header } };
> }
>
>__END__
>
-sln
------------------------------
Date: Tue, 30 Nov 2010 08:01:41 -0800
From: sln@netherlands.com
Subject: Re: Regex help
Message-Id: <5t7af6dt7ofg70g09rt3m84fqi3ill1l5p@4ax.com>
On Mon, 29 Nov 2010 18:02:16 -0800, "John W. Krahn" <jwkrahn@example.com> wrote:
>This may work better (UNTESTED):
>
>#!/usr/bin/perl
>use warnings;
>use strict;
>
>open SYSCMD, '-|', 'dccmd', '-listmodes'
> or die "Cannot pipe from command 'dccmd' because: $!";
>
>my ( %data, @headers );
>while ( <SYSCMD> ) {
> next unless /\S/;
-------------------------------------------
> @headers = split unless /\d/;
> my @fields = split if /\d/;
unless ( /\d/ ) {
@headers = split();
next;
};
my @fields = split();
-------------------------------------------
>
> for my $index ( 0 .. $#headers ) {
> push @{ $data{ $headers[ $index ] } }, $fields[ $index ];
> }
> }
>
>close SYSCMD or warn $! ? "Error closing sort 'dccmd' because: $!"
> : "Exit status $? from 'dccmd'\n";
>
>for my $header ( @headers ) {
> print "$header:\n", map "$_\n", @{ $data{ $header } };
> }
>
>__END__
>
-sln
------------------------------
Date: Tue, 30 Nov 2010 08:26:04 -0800
From: sln@netherlands.com
Subject: Re: Regex help
Message-Id: <oj8af6lic9h95mi8pbh3jmljnk40dupek8@4ax.com>
On Tue, 30 Nov 2010 08:01:41 -0800, sln@netherlands.com wrote:
>On Mon, 29 Nov 2010 18:02:16 -0800, "John W. Krahn" <jwkrahn@example.com> wrote:
>
>>This may work better (UNTESTED):
>>
>>#!/usr/bin/perl
>>use warnings;
>>use strict;
>>
>>open SYSCMD, '-|', 'dccmd', '-listmodes'
>> or die "Cannot pipe from command 'dccmd' because: $!";
>>
>>my ( %data, @headers );
>>while ( <SYSCMD> ) {
>> next unless /\S/;
>-------------------------------------------
>> @headers = split unless /\d/;
>> my @fields = split if /\d/;
>
> unless ( /\d/ ) {
> @headers = split();
> next;
> };
> my @fields = split();
>-------------------------------------------
>>
>> for my $index ( 0 .. $#headers ) {
>> push @{ $data{ $headers[ $index ] } }, $fields[ $index ];
>> }
>> }
>>
>>close SYSCMD or warn $! ? "Error closing sort 'dccmd' because: $!"
>> : "Exit status $? from 'dccmd'\n";
>>
>>for my $header ( @headers ) {
>> print "$header:\n", map "$_\n", @{ $data{ $header } };
>> }
>>
>>__END__
>>
>
>-sln
Also, it looks like the predominate (natural) delimeter is a
tab on both the field header and field data lines.
To exclude the other lines, instead of:
next unless /\S/;
it might be better to do this:
next unless /\t/;
Then leave the other split() 's intact.
Otherwise /\d/ is too broad a brush, but if the output is
constant, it doesen't matter.
As it is, "Resolution Changer 3.12 from 12noon (12noon.com)"
gets down to 'my @fields = split if /\d/;' but since its
header follows this, it never gets to the push statement.
And that is a weak defense, but like said above, if its output never
changes, it don't really matter.
-sln
------------------------------
Date: Thu, 2 Dec 2010 00:14:55 +0100
From: "lennie" <erling.kopperdal@lyse.net>
Subject: Re: Regex help
Message-Id: <CqGdnQu6csdpS2vRnZ2dnUVZ8sOdnZ2d@lyse.net>
"king" <hara.acharya@gmail.com> skrev i melding
news:2e958e6c-5983-4161-a7be-eb4e87939a4c@c17g2000prm.googlegroups.com...
>I have the below text:
> Want to store it in array using regular expression.
>
> The script is as below.
> "
> open(SYSCMD, "dccmd -listmodes |");
>
> while(<SYSCMD>)
> {
> if(/^(\d+)[\s+](\d+)/)
> {
> chomp;
> push(@X_Cord, $1);
> }
> if(/[\s+](\d+)[\s+](.*)$/)
>
> {
> chomp;
> push(@Y_Cord, $1);
> }
> if(/(\d+)(\s+)(\d+)$/)
>
> {
> chomp;
> push(@depth, $1);
>
> }
> if(/(\s+)(\d+)$/)
> {
> chomp;
> push(@refresh, $1);
>
> }
>
> }
> close(SYSCMD);
>
> foreach(@X_Cord)
> {
> print "$_\n";
> }
> foreach(@Y_Cord)
> {
> print "$_\n";
> }
> foreach(@depth)
> {
> print "$_\n";
> }
> foreach(@refresh)
> {
> print "$_\n";
> }
> "
>
> The output of dccmd command is
> "Resolution Changer 3.12 from 12noon (12noon.com)
>
> Width Height Depth Rate
>
> 320 200 8 60
>
> 320 200 16 60
>
> 320 200 32 60
>
> 512 384 8 60
>
> 512 384 16 60
>
> 512 384 32 60
>
> 640 400 8 60
>
> 640 400 16 60
>
> 640 400 32 60
>
> 640 480 8 60
>
> 640 480 16 60
>
> 640 480 32 60
>
> 800 600 8 60
>
> 800 600 16 60
>
> 800 600 32 60
>
> 1024 768 8 60
>
> 1024 768 16 60
>
> 1024 768 32 60
>
> 1280 800 8 60
>
> 1280 800 16 60
>
> 1280 800 32 60
>
> "
> From the script I am getting only X_cord and Y_cord. But I am not
> getting the depth and refresh.
> Can anybody help me with the refresh rate.
>
>
Many good solutions, TIMTOWTDI :)
This is my suggestion:
while(<SYSCMD>)
{
if (/^(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/){
push(@X_Cord, $1);
push(@Y_Cord, $2);
push(@depth, $3);
push(@refresh, $4);
}
}
close(SYSCMD);
IMHO: Gives a good balance between what my poor head can read and input
control :)
Cheers
------------------------------
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 3224
***************************************