[28450] in Perl-Users-Digest
Perl-Users Digest, Issue: 9814 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 6 18:06:04 2006
Date: Fri, 6 Oct 2006 15:05:11 -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 Fri, 6 Oct 2006 Volume: 10 Number: 9814
Today's topics:
Re: Complex regular expression <rvtol+news@isolution.nl>
Dealing with a STRANGE API <ignoramus7272@NOSPAM.7272.invalid>
Re: Hard or Easy? To find string, then grab criterion m <tadmc@augustmail.com>
Re: Hard or Easy? To find string, then grab criterion m samiam@mytrashmail.com
Re: Hard or Easy? To find string, then grab criterion m <tadmc@augustmail.com>
Re: Parsing HTML - using HTML::TreeBuilder olson_ord@yahoo.it
Re: perl print behavior different on window/unix <sherm@Sherm-Pendleys-Computer.local>
Re: Please help me pass an array from VBA to Perl and p <tadmc@augustmail.com>
Re: Please help me pass an array from VBA to Perl and p (reading news)
Re: Please help me pass an array from VBA to Perl and p (reading news)
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <rvtol+news@isolution.nl>
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <tadmc@augustmail.com>
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <nospam-abuse@ilyaz.org>
Re: Regarding numeric literals <tzz@lifelogs.com>
Re: Script that shows IP address of a server. <tony_curtis32@yahoo.com>
Re: Script that shows IP address of a server. yankeeinexile@gmail.com
Re: Script that shows IP address of a server. usenet@DavidFilmer.com
Re: trap <nospam@somewhere.com>
Re: Unique in-depth problem xhoster@gmail.com
Re: Unique in-depth problem <tadmc@augustmail.com>
Re: Unique in-depth problem <tzz@lifelogs.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 6 Oct 2006 21:49:31 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Complex regular expression
Message-Id: <eg6j8c.178.1@news.isolution.nl>
Ian Wilson schreef:
> all the solutions
> involving \d will also match far more than ASCII digits 0-9.
> For example: ??-???
>
> Of course, this may be acceptable for the OP.
I sometimes use
my $d = qr/[0-9]/
but using such a short name for such a global item is of course a bad
habit too.
(http://perl.abigail.be/Musings/coding_guidelines.html #21)
Where have all the ASCIIs gone?
Long time passing.
Where have all the ASCIIs gone?
Long time ago.
Where have all the ASCIIs gone?
They've gone to graveyards, every one.
Oh, when will they ever learn?
Oh, when will they ever learn?
http://www.fortunecity.com/tinpan/parton/2/where.html
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 06 Oct 2006 21:24:37 GMT
From: Ignoramus7272 <ignoramus7272@NOSPAM.7272.invalid>
Subject: Dealing with a STRANGE API
Message-Id: <pQzVg.236$eX5.177@fe19.usenetserver.com>
I am using PayPal API class
Business::PayPal::API::TransactionSearch
It uses some very weird code
my %response = ();
unless( $self->getBasic($som, $path, \%response) ) {
$self->getErrors($som, $path, \%response);
return %response;
}
return $self->getFieldsList( $som, $path . '/PaymentTransactions',
{ Timestamp => 'Timestamp',
Timezone => 'Timezone',
Type => 'Type',
Payer => 'Payer',
PayerDisplayName => 'PayerDisplayName',
TransactionID => 'TransactionID',
Status => 'Status',
GrossAmount => 'GrossAmount',
FeeAmount => 'FeeAmount',
NetAmount => 'NetAmount',
} );
that is, it returns a hash when there is error, and a list reference when there is not.
I am bewildered, just how can I get this result into one variable and
then figure out if I am dealing with success (so that I can print
results from the list reference), or failure (so that I can print a
hash element error message).
Any idea? I tried obvious things like setting a scalar to the result
of this function, and could not.
The man pages gloss over this issue. I did read them in their entirety.
i
------------------------------
Date: Fri, 6 Oct 2006 14:04:40 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Hard or Easy? To find string, then grab criterion matched lines above and below?
Message-Id: <slrneida68.228.tadmc@magna.augustmail.com>
Steve Kostecke <spamtrap@ntp.isc.org> wrote:
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrneib43v.9e3.tadmc@magna.augustmail.com...
>> samiam@mytrashmail.com <samiam@mytrashmail.com> wrote:
>>> At first I thought to use VBScript, but then I realized that Perl is
>>> portable, doesn't necessarily have to be installed on the server, and
>>
>>
>> What "server"?
>>
>> A server is not normally required to run Perl programs.
>>
>> Is this a stealth CGI question?
>
> His question was obviously pertaining to Perl being used for a file parsing
> solution. The question itself had nothing to do with CGI and I think you
> knew that.
Yes, I did.
But it appeared that the OP did not. Now he does.
>>> Summary: I need to find CSR numbers in FILE-A that map to registry key
>>> entries in FILE-B, and report the pertinent surrounding info.
>>
>>
>> None of the failed CSR numbers in your example FILE-A map to any registry
>> key entries in FILE-B, so the program must make no output...
>
> Maybe just a bad example and not necessarily the only data that'll be
> operated on?
My point was exactly that it _was_ a bad example.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Oct 2006 13:14:09 -0700
From: samiam@mytrashmail.com
Subject: Re: Hard or Easy? To find string, then grab criterion matched lines above and below?
Message-Id: <1160165649.891808.292630@m73g2000cwd.googlegroups.com>
But in subsequent posts I've clearly rectified the non-matching data
yes?
And I knew that Perl did not need to be installed for my purposes -
that's the first thing I checked since these are important production
servers.
At the end of this post is the sum of my initial research on that
matter.
If my last 2 posts are reviewed...at this point...I am simply looking
to modify my script to
1.) add the %%before and %%after registry sections to my CSV
2.) Add the detailed registry description to a csv field as well. Ergo,
I want to pull the "Checking IE Security Zones" elements into the CSV
as seen from a data snippet below.
dialog set,text2,"5.6.1.2 Checking IE Security Zones"
Any input on this?
Thanks!
L,
Sam
------------------------------------------------------------------------------------------------------
How to run perl without installing it
http://www.oreillynet.com/pub/a/network/2003/11/18/activedir_ckbk.html
* Perl Does not Require installation
This suggests perl needs to be installed on any machine a perl script
needs to run on. Not so.
Easiest way around this is to install Activestate perl on ONE machine
with all your favorite 3rd party modules and copy the "c:\perl" folder
to a shared network location and call your scripts from a oneliner
batch file like so.
\\server\perl\bin\perl.exe \\server\scripts\myscript.pl
or wrap it in a batch file like this:
@echo off
\\server\perl\bin\perl.exe -x %0 %*
:: the above command tells the perl interpreter to
:: strip off text before #!perl line and treat everything
:: afterward like a perl script!
goto endofperl
#!perl
print "this rocks, this portable script will \n";
print "run on any machine in the network. \n";
print "No perl install required on target machine \n";
__END__
:endofperl
Also, their are many ways to compile scripts into exe's for users and
make mini-perl interpreters (like a 2 meg perl.exe interpreter) so you
can send open-source scripts to other admins to edit/plagiarize. No
need to install 50+ megs of perl on any machine + modules unless you
are developing.
------------------------------
Date: Fri, 6 Oct 2006 16:09:50 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Hard or Easy? To find string, then grab criterion matched lines above and below?
Message-Id: <slrneidhgu.2r8.tadmc@magna.augustmail.com>
samiam@mytrashmail.com <samiam@mytrashmail.com> wrote:
> But in subsequent posts I've clearly rectified the non-matching data
> yes?
Yes.
But I only have time for 3-minute answers right now.
Maybe I can add something this evening or over the weekend.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Oct 2006 11:33:12 -0700
From: olson_ord@yahoo.it
Subject: Re: Parsing HTML - using HTML::TreeBuilder
Message-Id: <1160159592.383769.320440@m7g2000cwm.googlegroups.com>
Thanks DJ.
I had thought of using a while statement (from looking at the tutorial
I mentioned above). This would make my code look like a series of while
statements. I think I would stick to using HTML::TreeBuilder - i.e.
Just because I have almost got my code working using that.
Thanks to you and Paul for your help.
O.O.
P.S. To other readers (who are unfamiliar with Perl -like myself)
consider using a last statement in the while loop i.e.
while ( my $tag_ref = $tp->get_tag( 'h2' ) ) {
printf "%s: %s\n", $tag_ref->[0], $tp->get_trimmed_text;
last;
}
-- so that you can process the file further. (Perl calls the 'break'
statement 'last').
DJ Stunks wrote:
> olson_ord@yahoo.it wrote:
> > Thanks a lot Paul.
> > I looked at the documentation HTML::TokeParser and it does not tell me
> > if there is an easy way to find a certain token (e.g. "h2") i.e. It
> > seems that I would have to start from the beginning and then scan all
> > the tokens until I reach the required token. (I am basically looking
> > for a find() function - or something similar.)
>
> Look a little harder, dude. it's (basically) 2 lines of code:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use LWP::Simple;
> use HTML::TokeParser;
>
> my $url = 'http://wordlist.gredic.com/kaleidoscope';
> my $html = get( $url );
>
> my $p = HTML::TokeParser->new( \$html );
>
> while ( my $tag_ref = $p->get_tag( 'h2' ) ) {
> printf "%s: %s\n", $tag_ref->[0], $p->get_trimmed_text;
> }
>
> __END__
------------------------------
Date: Fri, 06 Oct 2006 14:12:01 -0400
From: Sherm Pendley <sherm@Sherm-Pendleys-Computer.local>
Subject: Re: perl print behavior different on window/unix
Message-Id: <m2hcyhtitq.fsf@Sherm-Pendleys-Computer.local>
jbilla2004@gmail.com writes:
> I'm getting some strange behavior with print in perl - it seems to
> mangle the strings on linux while printing (the strings are in
> iso-8859-15). Running the same script on WinXP (under cygwin) yields
> the expected behavior (not to mangle!). Any ideas?
> open( TST, "> test.dat" ) || die "Unable to open test.dat";
Try using a PerlIO layer to specify the encoding in your output file:
open (TST, '>:encoding(iso-8859-15)', 'test.dat')
or die "Unable to open test.dat: $!";
Without a specified encoding, you get the default encoding, which may be
different on your Linux and Windows systems.
"perldoc PerlIO" for details.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Fri, 6 Oct 2006 14:18:02 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Please help me pass an array from VBA to Perl and populate it. Newbie at wits' end!
Message-Id: <slrneidava.228.tadmc@magna.augustmail.com>
david.f.jenkins@usa.net <david.f.jenkins@usa.net> wrote:
>
> Dr.Ruud wrote:
>> david.f.jenkins@usa.net schreef:
>>
>> > I'm aware of that.
>>
>> Of what? Don't top-post.
>
> Let me request that you refrain from *telling* me what not to do. You
> might ask, instead -
OK, let's put it another way then.
Don't top-post, unless you don't mind being widely ignored forevermore.
> much more polite.
Top-posting is rude. You reap(ed) what you sow(ed).
A mother might say "look both ways before you cross the street"
instead off "look both ways before you cross the street so that
you don't get hit by a car".
Not looking both ways because the consequences were not spelled out
might make the independent-minded feel a little better, but being
underneath a car will make you feel really really bad...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 06 Oct 2006 19:27:57 GMT
From: "Mumia W. (reading news)" <paduille.4058.mumia.w@earthlink.net>
Subject: Re: Please help me pass an array from VBA to Perl and populate it. Newbie at wits' end!
Message-Id: <17yVg.5830$Y24.2813@newsread4.news.pas.earthlink.net>
On 10/06/2006 10:26 AM, david.f.jenkins@usa.net wrote:
> [...]
> Since I have *no* problem passing strings back and forth (my problem is
> arrays, remember? (See my previous posts for repeated references to
> arrays.)) I have generally seen fit to include "array" in most of my
> searching.
>
Have you considered the possibility that there is no direct way to pass
arrays between VBA and Perl?
Have you considered using Data::Dumper or Storable or FreezeThaw to
convert arrays to/from strings?
I'm tired of reading this thread. Bye bye thread.
--
paduille.4058.mumia.w@earthlink.net
Posting Guidelines for comp.lang.perl.misc:
http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Fri, 06 Oct 2006 20:50:36 GMT
From: "Mumia W. (reading news)" <paduille.4058.mumia.w@earthlink.net>
Subject: Re: Please help me pass an array from VBA to Perl and populate it. Newbie at wits' end!
Message-Id: <wkzVg.5868$Y24.3949@newsread4.news.pas.earthlink.net>
On 10/06/2006 02:27 PM, Mumia W. (reading news) wrote:
> On 10/06/2006 10:26 AM, david.f.jenkins@usa.net wrote:
>> [...]
>> Since I have *no* problem passing strings back and forth (my problem is
>> arrays, remember? (See my previous posts for repeated references to
>> arrays.)) I have generally seen fit to include "array" in most of my
>> searching.
>>
>
> Have you considered the possibility that there is no direct way to pass
> arrays between VBA and Perl?
>
> Have you considered using Data::Dumper or Storable or FreezeThaw to
> convert arrays to/from strings?
>
Doh! Of course you can't do that. Join the element into a string and
pass that instead.
> I'm tired of reading this thread. Bye bye thread.
>
>
Doh! I had to read some more of this thread because of my own mistake :-(
--
paduille.4058.mumia.w@earthlink.net
Posting Guidelines for comp.lang.perl.misc:
http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Fri, 6 Oct 2006 21:30:39 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.6 $)
Message-Id: <eg6i46.1gs.1@news.isolution.nl>
tadmc@augustmail.com schreef:
> A note to newsgroup "regulars":
>
> Do not use these guidelines as a "license to flame" or other
> meanness. It is possible that a poster is unaware of things
> discussed here. Give them the benefit of the doubt, and just
> help them learn how to post, rather than assume
Well, assume what?
;)
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 6 Oct 2006 16:15:18 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.6 $)
Message-Id: <slrneidhr6.2r8.tadmc@magna.augustmail.com>
Dr.Ruud <rvtol+news@isolution.nl> wrote:
> tadmc@augustmail.com schreef:
>
>> A note to newsgroup "regulars":
>>
>> Do not use these guidelines as a "license to flame" or other
>> meanness. It is possible that a poster is unaware of things
>> discussed here. Give them the benefit of the doubt, and just
>> help them learn how to post, rather than assume
>
> Well, assume what?
Yikes!
The rest of that sentence was lost way back at rev 1.2...
(that was 2001, doesn't anybody read these things?... :-)
I'll get it back in (for rev 1.7) this weekend.
Here is what it used to say:
just help them learn
how to post, rather than assume that they do know and are
being the "bad kind" of Lazy.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 6 Oct 2006 21:39:24 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.6 $)
Message-Id: <eg6iec$2pql$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
<tadmc@augustmail.com>], who wrote in article <45260435$0$47258$ae4e5890@news.nationwide.net>:
> Social faux pas to avoid
> - Asking a Frequently Asked Question
> - Asking a question easily answered by a cursory doc search
> - Asking for emailed answers
> - Beware of saying "doesn't work"
> - Sending a "stealth" Cc copy
This section assumes that faux pas are performed most often by
newbies; personally, I find this assumption unsubstantiated.
If you lurk around Usenet, you will find that people consider
c.l.p.misc a very bad neighbornood. I wish to disagree with them, but
I can't.
In my optinion, the rudeness level on this newsgroup increased very
much during the last 10 years; and most of this increase is, IMO, due
to (some) KNOWLEDGEABLE REGULARS being INTENTIONALLY rude. I do not
know what strategy they have in mind when doing this; neither do I
know whether their strategy works.
What I know is that I find this disgusting - even in the cases when
they know the technical side of relevant mechanics of Perl. And time
to time (maybe even quite often?) it turns out that they have less
clue (in the particular area) that the poster they flame...
Not all regulars are like this; actually, only a few persona jump to
mind - if you read clpm for a couple of weeks, you know who I mean.
Should not the FAQ concentrate on this, and not be just a tool to
denigrate clueless newbies?
Thanks,
Ilya
------------------------------
Date: Fri, 06 Oct 2006 21:34:43 +0100
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Regarding numeric literals
Message-Id: <g69hcyhw5cs.fsf@lifelogs.com>
On 5 Oct 2006, mritty@gmail.com wrote:
Ted Zlatanov wrote: >
On 5 Oct 2006, mritty@gmail.com wrote: >
>>> So, read in your values from whatever the operation is, get rid of the
>>> commas. Do whatever numeric computations you need, and then when you
>>> print your values out, commify them:
>>>
>>> my $disk_size = get_disk_size();
>>> $disk_size = tr/,//d;
>>> #do stuff with $disk_size;
>>> print "Disk size: ", commify($disk_size), "\n";
>>
>> Would it perhaps be better to remove all \D characters? Some locales
>> may use '.' to separate thousands, for example.
>>
>> $disk_size =~ s/\D//g;
>
> The OP did not specify if the numbers read in contained things such as
> decimals or even positive or negative signs.
Well, yes, they are disk sizes, we know they are positive usually :)
> All of those are valid numbers, and would change the meaning of the
> number if they were removed. All the OP specified is that the
> strings have commas, which are not valid (at least, not in this
> context).
OK. OP, just note that your code may mysteriously fail in European
locales for example.
Ted
------------------------------
Date: Fri, 06 Oct 2006 14:08:07 -0400
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Script that shows IP address of a server.
Message-Id: <eg6627$68d$1@knot.queensu.ca>
Blue wrote:
> First of all, I am not a Perl programmer. I have searched Google for 40
> minutes but could not find this simple code.
>
> I need a simple script that show the IP address of the server (where the
> script is residing).
>
> I believe this is something very simple but I just could not find it.
Which address? It's a network interface that has an address, not the
machine itself.
hth
t
------------------------------
Date: 06 Oct 2006 14:51:41 -0500
From: yankeeinexile@gmail.com
Subject: Re: Script that shows IP address of a server.
Message-Id: <87sli1b4tu.fsf@gmail.com>
Blue <superbaby@myjaring.net> writes:
> First of all, I am not a Perl programmer. I have searched Google for
> 40 minutes but could not find this simple code.
Because it is not simple.
> I need a simple script that show the IP address of the server (where
> the script is residing).
Your question is broken. A server does not have "an" IP address.
Most hosts have not less than two IP addresses, and many have more.
My development machine has five interfaces each with an IP address.
>
> I believe this is something very simple but I just could not find it.
Your belief is wrong.
>
> Can someone please help?
>
Finding "my interface addresses" is platform dependant. You'll have
to give us a clue where you want this to run.
> Thanks.
You're welcome.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Lawrence Statton - lawrenabae@abaluon.abaom s/aba/c/g
Computer software consists of only two components: ones and
zeros, in roughly equal proportions. All that is required is to
sort them into the correct order.
------------------------------
Date: 6 Oct 2006 14:49:28 -0700
From: usenet@DavidFilmer.com
Subject: Re: Script that shows IP address of a server.
Message-Id: <1160171368.583446.123390@b28g2000cwb.googlegroups.com>
Blue wrote:
> First of all, I am not a Perl programmer. I have searched Google for 40
> minutes but could not find this simple code.
Searching CPAN is often more direct and effective.
> I need a simple script that show the IP address of the server (where the
> script is residing).
You may wish to consider Sys::HostIP:
http://search.cpan.org/~bluelines/Sys-HostIP-1.3.1/HostIP.pm
--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Fri, 6 Oct 2006 16:16:24 -0400
From: "Thrill5" <nospam@somewhere.com>
Subject: Re: trap
Message-Id: <HdidnQ9w0qQeJLvYnZ2dnUVZ_vOdnZ2d@comcast.com>
"perlperl" <shahrahulb@gmail.com> wrote in message
news:1159975682.794301.255580@b28g2000cwb.googlegroups.com...
> I generate SNMP trap frequently on my hosts
>
> Is there a perl script i can write to receive the SNMP traps?
>
> i m using perl 5.6.1 (cannot upgrade to 5.8 due to restrictions)
>
>
> I found this useful
>
> http://search.cpan.org/~hardaker/NetSNMP-TrapReceiver-5.0301/TrapReceiver.pm
> but,
>
> 1) will it work on perl 5.6.1
> 2) I installded the above module on windows, but couldnot find the file
> snmptrapd.conf
>
> is it a part of Net::SNMP module, do i need to install that module also
>
NetSNMP is different than Net::SNMP. The former is an set of executables
and libraries that allow applications to use SNMP services and is an SNMP
agent, while the later is a Perl implementation that allows a you to ACCESS
an SNMP agent.
You need to install the "Net-SNMP" package on your system. The Perl module
you downloaded allows Perl to talk with the "Net-SNMP" application to allow
your Perl program to receive the traps. See http://www.net-snmp.org for
more info.
Scott
------------------------------
Date: 06 Oct 2006 18:41:20 GMT
From: xhoster@gmail.com
Subject: Re: Unique in-depth problem
Message-Id: <20061006144327.190$SX@newsreader.com>
"Idgarad" <idgarad@gmail.com> wrote:
> I have a real challenge:
>
> I need to work with, manage, and render a timeline. The problem? The
> dates range, in years, from 0 to 1452652!! So I have a few hurdles:
>
> 1: Standard date libraries don't work. These dates are vastly out of
> epoch ranges.
...
>
> Q1: What options do I have in Perl for handling dates of this nature
Are the events points in time or do they have durations? Is the database
dynamic or fairly static? If it is static points, how about just a sorted
list you can binary search into?
> Q2: What graphical format is going to be able to handle, assuming I
> dedicated 10px per day (so each year would be at leasy 3650px wide),
> handling something of that scale? (Lets assume a limited viewport is
> acceptable so we don't have to display the whole thing at once...)
I have no idea. This doesn't seem like much of a Perl question. Maybe
you can look at some "genome browsers" (largely written in java, it seems)
to get some ideas for dynamic zooming/panning of very large linear feature
sets.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Fri, 6 Oct 2006 14:10:32 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Unique in-depth problem
Message-Id: <slrneidah8.228.tadmc@magna.augustmail.com>
Idgarad <idgarad@gmail.com> wrote:
> I need to work with, manage, and render a timeline. The problem? The
> dates range, in years, from 0 to 1452652!!
I wonder how you determined the age of the universe to a resolution
of only 1 year.
:-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 06 Oct 2006 21:26:17 +0100
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Unique in-depth problem
Message-Id: <g69lkntw5qu.fsf@lifelogs.com>
On 6 Oct 2006, idgarad@gmail.com wrote:
> I need to work with, manage, and render a timeline. The problem? The
> dates range, in years, from 0 to 1452652!! So I have a few hurdles:
>
> 1: Standard date libraries don't work. These dates are vastly out of
> epoch ranges.
> 2: I have to render events on a timeline. Requirements are open but it
> has to be able to handle rendering the whole damn thing at once (i.e
> zooming in is ok.) but effectivly I have to either use SVG or Flash to
> do this. Resolution goes to the day so:
> YEAR|YEAR| etc..
> MONTH|MONTH|MONTH|MONTH| etc..
> 1|2|3|4|etc...
> -----------
> XXXXXXXXXXXXXX YYYYYYYYYY ZZZZZZZZZZZZZZZZZZZZ
>
> I originally did this via tables with colspans etc. but complicated
> entries with 800+ events in a month (I was only rendering a single
> year) could take up to 3 hours to display on a browser. SVG or Flash is
> gonna be needed.
>
> Dear God! What to do!? So the questions are really this:
>
> Q1: What options do I have in Perl for handling dates of this nature
You can easily write a class to handle these dates.
Precompute all the dates and put them in a database (file, SQL server,
etc.).
Look at Google Maps for inspiration. They deal with lots of pieces of
a huge data set, yet manage to retrieve and show only the interesting
ones quickly.
> Q2: What graphical format is going to be able to handle, assuming I
> dedicated 10px per day (so each year would be at leasy 3650px wide),
> handling something of that scale? (Lets assume a limited viewport is
> acceptable so we don't have to display the whole thing at once...)
PNG should work.
> Think of this as a History of the World Gnatt chart of sorts. I mean
> what options, if any, are there for this kind of problem? I can batch
> the process (It does not have to be real-time thank god!) but must be
> doable within an 16 hour window utilizing a standard desktop (p4, 2ghz
> lets say). This would eventually end up on a server but the constraint
> is can start a friday night and must be done before Sunday 11:30pm so I
> am working with Worst Case Scenario here.
s/Gnatt/Gantt/
Just generate the dates that have changed since the last build.
When dealing with large data sets, three things are always important:
1) cache data everywhere possible
2) precompute things when possible
3) buy as much RAM as possible for the server
With Perl, these are just as valid as with Java or any other language.
Also consider using something on the storage backend like a SQL server
(MySQL, Postgres, etc.) that can do efficient queries across your data.
Ted
------------------------------
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:
#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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 9814
***************************************