[30478] in Perl-Users-Digest
Perl-Users Digest, Issue: 1721 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 15 21:10:19 2008
Date: Tue, 15 Jul 2008 18:09:44 -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 Tue, 15 Jul 2008 Volume: 11 Number: 1721
Today's topics:
Re: comma quoted lists question <cartercc@gmail.com>
Re: comma quoted lists question <jimsgibson@gmail.com>
Re: comma quoted lists question <cartercc@gmail.com>
Re: comma quoted lists question <cartercc@gmail.com>
Re: comma quoted lists question xhoster@gmail.com
Re: comma quoted lists question <jurgenex@hotmail.com>
Re: comma quoted lists question <jimsgibson@gmail.com>
does Larry Wall knew lisp when perl was taking shape? <xahlee@gmail.com>
Re: does Larry Wall knew lisp when perl was taking shap <wahab@chemie.uni-halle.de>
Re: FAQ 1.12 What's the difference between "perl" and " <bmb@mail.libs.uga.edu>
Re: FAQ 1.12 What's the difference between "perl" and " <tzz@lifelogs.com>
Re: FAQ 1.12 What's the difference between "perl" and " <ly@gmail.com>
Re: FAQ 1.12 What's the difference between "perl" and " <ly@gmail.com>
Re: FAQ 1.12 What's the difference between "perl" and " <ly@gmail.com>
Re: FAQ 1.12 What's the difference between "perl" and " <bmb@mail.libs.uga.edu>
Re: Fastest way to remove common substrings from a list <ced@blv-sam-01.ca.boeing.com>
Re: Fastest way to remove common substrings from a list <fawaka@gmail.com>
Re: Fastest way to remove common substrings from a list <szrRE@szromanMO.comVE>
Re: Fastest way to remove common substrings from a list <freesoft12@gmail.com>
GromPerl persistent Perl interpreter <gromnospam@googlemail.com>
Re: GromPerl persistent Perl interpreter <fawaka@gmail.com>
Re: reliability problem with Finance::QuoteHist::Yahoo <r.ted.byers@gmail.com>
Re: remove previous lines of a log file (Jens Thoms Toerring)
Re: use/require, and variables <ben@morrow.me.uk>
Re: use/require, and variables <tadmc@seesig.invalid>
Re: use/require, and variables <tadmc@seesig.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 15 Jul 2008 11:46:57 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: Re: comma quoted lists question
Message-Id: <7ab1abcc-42c1-4ce1-a1c1-66405be8a660@m44g2000hsc.googlegroups.com>
On Jul 15, 10:23=A0am, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> >12345,John,Q,Public,123 Main Street,"Anywhere, Alaska",800-555-1212
> >My script will read this as an eight element array (splitting
> >"Anywhere, Alaska" on the comma).
>
> Which is correct and valid CSV format. It may be convenient to blame
> Microsoft for everything but in this case it is your program that is at
> fault.
I am aware of this.
> >Sometimes Excel will produce a tab delimited file like this:
> >12345 John Q Public 123 Main Street "Anywhere, Alaska" 800-555-1212
>
> This on the other hand is a problem between chair and keyboard caused by
> saving the file as "Text (tab delimited)". Maybe this user has this even
> set as his preference for saving work sheets, maybe even without
> realizing what he is doing.
They don't do this deliberately, but just don't think about file
formats. Nor should they have to, IMO.
> >My script will read this as a two element array.
>
> And correctly so.
Agreed.
> >My users like to use Excel and I am not inclined to tell them they
> >can't, nor am I inclined to 'educate' them on making sure that Excel
> >doesn't change the file format. They honestly need the filtering and
>
> Well, the education would be _NOT_ to select "Save As" -> "Text (tab
> delimited)" when saving the file. You wouldn't want to accept any of the
> other 24 possible file formats that Excel knows about, either, would
> you?
No, the only things that kill be input file are the non-quote
described strings and the whitespace delimited. Never had a problem
with any other kind of delimiters.
>
> >satisfactory, because I have the burden of reformatting the file.
>
> Then just reject files in "Text (tab delimited)" =A0format. If users
> deliberately save in a non-compatible format then it is their problem,
> neither yours nor Excel's. Don't make it yours.
I can't do this. It's my problem, and I should handle these different
formats gracefully.
>
> >Comments? Suggestions? Any module that automagically reformats files?
>
> As for fields not enclosed in quotes: that is completely valid CSV and I
> am very surprised that Text::CSV doesn't handle it. Could you please
> provide a short sample script that demonstrates this deficancy?
I didn't use this module, but hand rolled everything. After reading
these comments and exploring CPAN, I am going to try different
options, and I expect to find one that works.
Thanks for your input, CC.
------------------------------
Date: Tue, 15 Jul 2008 13:45:40 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: comma quoted lists question
Message-Id: <150720081345409636%jimsgibson@gmail.com>
In article
<7ab1abcc-42c1-4ce1-a1c1-66405be8a660@m44g2000hsc.googlegroups.com>,
cartercc <cartercc@gmail.com> wrote:
> On Jul 15, 10:23 am, Jürgen Exner <jurge...@hotmail.com> wrote:
> > As for fields not enclosed in quotes: that is completely valid CSV and I
> > am very surprised that Text::CSV doesn't handle it. Could you please
> > provide a short sample script that demonstrates this deficancy?
>
> I didn't use this module, but hand rolled everything. After reading
> these comments and exploring CPAN, I am going to try different
> options, and I expect to find one that works.
The best solution was already provided: don't ask your users to save
their spreadsheets as CSV, tab-delimited, or any other type of file.
Ask them to send you their Excel documents and extract the data using
the Spreadsheet::ParseExcel module. To me, this is a "no-brainer".
--
Jim Gibson
------------------------------
Date: Tue, 15 Jul 2008 14:41:14 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: Re: comma quoted lists question
Message-Id: <41e47561-d45c-4c08-bade-e96e783ecf88@8g2000hse.googlegroups.com>
On Jul 15, 11:39 am, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> >Unfortunately, '123 Main Street' produces three array elements, and
> >'P. O. Box 123' produces four elements.
>
> That's odd to say the least. Excel doesn't replace space with tab in
> data unless someone goes to great length to do so manually.
No, but \s doesn't distinguish between spaces, tabs, carriage returns,
and new lines.
CC
------------------------------
Date: Tue, 15 Jul 2008 14:43:50 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: Re: comma quoted lists question
Message-Id: <b15b26b2-defe-46e5-a2c1-81aa143e2176@z66g2000hsc.googlegroups.com>
On Jul 15, 4:45 pm, Jim Gibson <jimsgib...@gmail.com> wrote:
> The best solution was already provided: don't ask your users to save
> their spreadsheets as CSV, tab-delimited, or any other type of file.
> Ask them to send you their Excel documents and extract the data using
> the Spreadsheet::ParseExcel module. To me, this is a "no-brainer".
And perhaps I should also send them an Excel file to begin with and
thus avoid all the headaches. I'll try that. Thanks.
CC
------------------------------
Date: 15 Jul 2008 22:09:22 GMT
From: xhoster@gmail.com
Subject: Re: comma quoted lists question
Message-Id: <20080715180925.589$07@newsreader.com>
cartercc <cartercc@gmail.com> wrote:
> On Jul 15, 11:39 am, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> > >Unfortunately, '123 Main Street' produces three array elements, and
> > >'P. O. Box 123' produces four elements.
> >
> > That's odd to say the least. Excel doesn't replace space with tab in
> > data unless someone goes to great length to do so manually.
>
> No, but \s doesn't distinguish between spaces, tabs, carriage returns,
> and new lines.
Of course it doesn't. That is what it is there for. If you want tab,
you use \t (or a literal tab character, but I don't like them in
source-code)
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Tue, 15 Jul 2008 22:49:52 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: comma quoted lists question
Message-Id: <0aaq74lb5lc56tlc26ea2o8ognn9tkc3fs@4ax.com>
cartercc <cartercc@gmail.com> wrote:
>On Jul 15, 11:39 am, Jürgen Exner <jurge...@hotmail.com> wrote:
>> >Unfortunately, '123 Main Street' produces three array elements, and
>> >'P. O. Box 123' produces four elements.
>>
>> That's odd to say the least. Excel doesn't replace space with tab in
>> data unless someone goes to great length to do so manually.
>
>No, but \s doesn't distinguish between spaces, tabs, carriage returns,
>and new lines.
Well, ok, but, aehmmm, in this case, why are you insisting on shooting
yourself in the foot? If the data is tab delimited, then why on earth
are you using \s as separator?
jue
------------------------------
Date: Tue, 15 Jul 2008 17:28:08 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: comma quoted lists question
Message-Id: <150720081728081773%jimsgibson@gmail.com>
In article
<b15b26b2-defe-46e5-a2c1-81aa143e2176@z66g2000hsc.googlegroups.com>,
cartercc <cartercc@gmail.com> wrote:
> On Jul 15, 4:45 pm, Jim Gibson <jimsgib...@gmail.com> wrote:
> > The best solution was already provided: don't ask your users to save
> > their spreadsheets as CSV, tab-delimited, or any other type of file.
> > Ask them to send you their Excel documents and extract the data using
> > the Spreadsheet::ParseExcel module. To me, this is a "no-brainer".
>
> And perhaps I should also send them an Excel file to begin with and
> thus avoid all the headaches. I'll try that. Thanks.
You can generate the Excel spreadsheets you send them from Perl using
the Spreadsheet::WriteExcel module.
Good luck!
--
Jim Gibson
------------------------------
Date: Tue, 15 Jul 2008 12:24:19 -0700 (PDT)
From: "xahlee@gmail.com" <xahlee@gmail.com>
Subject: does Larry Wall knew lisp when perl was taking shape?
Message-Id: <0595982c-766c-468e-9e3a-70fbf477aab4@j22g2000hsf.googlegroups.com>
in Wikipedia's perl article:
http://en.wikipedia.org/wiki/Perl
It is said that the design of perl is influenced by lisp.
quote:
=E2=80=9CInfluenced by AWK, BASIC, BASIC-PLUS, C, C++, Lisp, Pascal, sed, U=
nix
shell=E2=80=9D.
Does anyone know any evidence, that Larry Wall (the creator of Perl)
knew any lisp before release of perl 4 (1991-1994)?
Xah
=E2=88=91 http://xahlee.org/
=E2=98=84
------------------------------
Date: Tue, 15 Jul 2008 21:44:47 +0200
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: does Larry Wall knew lisp when perl was taking shape?
Message-Id: <g5iunf$1pkk$1@nserver.hrz.tu-freiberg.de>
xahlee@gmail.com wrote:
> in Wikipedia's perl article:
> http://en.wikipedia.org/wiki/Perl
>
> It is said that the design of perl is influenced by lisp.
> quote:
> “Influenced by AWK, BASIC, BASIC-PLUS, C, C++, Lisp, Pascal, sed, Unix
> shell”.
>
> Does anyone know any evidence, that Larry Wall (the creator of Perl)
> knew any lisp before release of perl 4 (1991-1994)?
There's strong evidence:
http://www.perl.com/pub/a/2007/12/06/soto-11.html
[Larry says:]
...
For good or ill, when I went off to grad school, I studied
linguistics, so the only computer language I used there was
LISP. It was my own personal McCarthy era.
Is LISP a candidate for a scripting language? While you can
certainly write things rapidly in it, I cannot in good
conscience call LISP a scripting language. By policy, LISP
has never really catered to mere mortals.
And, of course, mere mortals have never really forgiven
LISP for not catering to them.
...
==> f'up c.l.p.m
Regards
M.
------------------------------
Date: Tue, 15 Jul 2008 14:19:22 -0400
From: Brad Baxter <bmb@mail.libs.uga.edu>
Subject: Re: FAQ 1.12 What's the difference between "perl" and "Perl"?
Message-Id: <WR5fk.1679$w93.892@bignews4.bellsouth.net>
Gunnar Hjalmarsson wrote:
> Uri Guttman wrote:
>> go to a yapc or oscon and say PERL all the time. look at the faces of
>> those who think you are not a worthy perl hacker.
>
> I guess that few would notice. Or is it a pronouncing matter besides the
> spelling matter? ;-)
>
You have to shout.
--
Brad
------------------------------
Date: Tue, 15 Jul 2008 16:32:01 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: FAQ 1.12 What's the difference between "perl" and "Perl"?
Message-Id: <86skuavnou.fsf@lifelogs.com>
On Tue, 15 Jul 2008 09:59:54 -0700 "Gordon Corbin Etly" <et@gmail.com> wrote:
GCE> All I ever tried to do was engage in a civil debate about it, but
GCE> unfortunately, there those who refuse to argue with fact and prefer
GCE> to spin and even sling mud instead, rather provide a true
GCE> explanation of why it's wrong.
You've been civil, polite, and firmly entrenched in your opinion.
Arguing with you is like arm-wrestling a coconut.
Ted
------------------------------
Date: Tue, 15 Jul 2008 16:26:49 -0700
From: "Gordon Corbin Etly" <ly@gmail.com>
Subject: Re: FAQ 1.12 What's the difference between "perl" and "Perl"?
Message-Id: <6e4q1rF580vuU1@mid.individual.net>
Uri Guttman wrote:
>>>>>> "GCE" == Gordon Corbin Etly <et@gmail.com> writes:
> > Ted Zlatanov wrote:
> > > On Sat, 12 Jul 2008 22:57:57 -0700 "Gordon Corbin Etly" wrote:
> > > > So why then is it in any way wrong to write "PERL", instead of
> > > > writing "Practical extraction and report language"?
> > > At this point, because you advocate it endlessly, we're all sick
> > > of hearing about it,
>
> > Has it ever occurred to you that some people are sick of hearing
> > "don't write 'PERL'"? Has it ever occurred to you that that view may
> > not be right, that that possibility exists? All I ever tried to do
> > was engage in a civil debate about it, but unfortunately, there
> > those who refuse to argue with fact and prefer to spin and even
> > sling mud instead, rather provide a true explanation of why it's
> > wrong.
> nah, we are just sick of you. and in the larger perl community which
> you don't seem to care about,
I care very much for this community and I hate what people like you
continue to do to it by attempting to force people into one belief.
> go to a yapc or oscon and say PERL all the time
Would you care to explain how, in oral speech, one would distinguish
that?
--
Gordon C. Etly
Email: perl -e "print q{}.reverse(q{moc.liamg@ylte.nodrog})"
------------------------------
Date: Tue, 15 Jul 2008 16:30:02 -0700
From: "Gordon Corbin Etly" <ly@gmail.com>
Subject: Re: FAQ 1.12 What's the difference between "perl" and "Perl"?
Message-Id: <6e4q7sF5c351U1@mid.individual.net>
Brad Baxter wrote:
> Gunnar Hjalmarsson wrote:
> > Uri Guttman wrote:
> > > go to a yapc or oscon and say PERL all the time. look at the faces
> > > of those who think you are not a worthy perl hacker.
> > I guess that few would notice. Or is it a pronouncing matter besides
> > the spelling matter? ;-)
> You have to shout.
One need not shout words which are short for longer meaning, but in
general, that's not done in oral speech anyways.
--
Gordon C. Etly
Email: perl -e "print q{}.reverse(q{moc.liamg@ylte.nodrog})"
------------------------------
Date: Tue, 15 Jul 2008 16:37:10 -0700
From: "Gordon Corbin Etly" <ly@gmail.com>
Subject: Re: FAQ 1.12 What's the difference between "perl" and "Perl"?
Message-Id: <6e4ql7F59lqqU1@mid.individual.net>
Ted Zlatanov wrote:
> On Tue, 15 Jul 2008 09:59:54 -0700 "Gordon Corbin Etly"
> <et@gmail.com> wrote:
> > All I ever tried to do was engage in a civil debate about it, but
> > unfortunately, there those who refuse to argue with fact and prefer
> > to spin and even sling mud instead, rather provide a true
> > explanation of why it's wrong.
> You've been civil, polite, and firmly entrenched in your opinion.
I see no reason not to be polite, therefore I am :)
> Arguing with you is like arm-wrestling a coconut.
Let me ask you something: if you are "arguing" with people who ignore
facts, who only provide excuses with little to no substance, which do
not disprove your central argument, and at the same time, refuse to see
reason, refuse to even acknowledge that there is some validity, what
would you do? Would you just feel it's right for people to push a
belief, that can easily be disproved, on others, or would you prefer to
allow people to freedom to express their own preferences?
--
Gordon C. Etly
Email: perl -e "print q{}.reverse(q{moc.liamg@ylte.nodrog})"
------------------------------
Date: Tue, 15 Jul 2008 19:51:38 -0400
From: Brad Baxter <bmb@mail.libs.uga.edu>
Subject: Re: FAQ 1.12 What's the difference between "perl" and "Perl"?
Message-Id: <qJafk.1808$w93.835@bignews4.bellsouth.net>
Gordon Corbin Etly wrote:
> Brad Baxter wrote:
>> Gunnar Hjalmarsson wrote:
>>> Uri Guttman wrote:
>
>>>> go to a yapc or oscon and say PERL all the time. look at the faces
>>>> of those who think you are not a worthy perl hacker.
>
>>> I guess that few would notice. Or is it a pronouncing matter besides
>>> the spelling matter? ;-)
>
>> You have to shout.
>
> One need not shout words which are short for longer meaning, but in
> general, that's not done in oral speech anyways.
I would rather proactively deliver impactful human capital.
--
Brad
------------------------------
Date: Tue, 15 Jul 2008 12:45:19 -0700 (PDT)
From: "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Fastest way to remove common substrings from a list of strings
Message-Id: <43ef4494-4f8d-4abb-bd34-7196757ed9a3@79g2000hsk.googlegroups.com>
On Jul 15, 8:02 am, Dave B <da...@addr.invalid> wrote:
> Dave B wrote:
> > push(@newlist,$s) unless /$s/;
>
> This is probably better and safer:
>
> push(@newlist,$s) unless /^\Q$s\E/;
>
here's a shorter (and tad more obfuscated)
variant:
my @list = sort qw( ... );
my ($s, @newlist);
for (@list, undef) {
push(@newlist,$s) unless /\Q$s\E/;
$s=$_;
}
--
Charles DeRykus
------------------------------
Date: Tue, 15 Jul 2008 22:54:28 +0200
From: Leon Timmermans <fawaka@gmail.com>
Subject: Re: Fastest way to remove common substrings from a list of strings
Message-Id: <35142$487d0e84$89e0e08f$3816@news1.tudelft.nl>
On Tue, 15 Jul 2008 17:51:59 +0200, Dave B wrote:
>
> I fixed both issues in a subsequent post.
Yeah, I saw that as soon as I had posted my previous post :-/.
------------------------------
Date: Tue, 15 Jul 2008 15:45:42 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: Fastest way to remove common substrings from a list of strings
Message-Id: <g5j9an0rl5@news4.newsguy.com>
Leon Timmermans wrote:
> On Tue, 15 Jul 2008 16:47:17 +0200, Dave B wrote:
>
>> freesoft12@gmail.com wrote:
>>
>> If your condition is "remove a string if it's a substring of another,
>> matching *at the beginning*", then the following code seems to work:
>>
>
>> push(@newlist,$s) unless /$s/;
>
> You should really quotemeta $s or else weird things can happen if it
> contains regexp meta characters. Better yet I would write that line
> as:
>
> push(@newlist, $s) if substr($_, 0, length $s) ne $s.
>
> Since that doesn't waste time looking for a substring if it isn't at
> the start.
Or he just change that regex from /$s/ to /^$s/ to also achor it at the
beginning. I think the substr might be ever so slightly faster though.
--
szr
------------------------------
Date: Tue, 15 Jul 2008 16:09:17 -0700 (PDT)
From: "freesoft12@gmail.com" <freesoft12@gmail.com>
Subject: Re: Fastest way to remove common substrings from a list of strings
Message-Id: <0fd6ddd7-0e45-4da2-8d91-d91468f12ddc@c65g2000hsa.googlegroups.com>
thanks for your help! I will try out your suggestions!
Regards
John
------------------------------
Date: Tue, 15 Jul 2008 22:10:45 +0200
From: "Gvdc" <gromnospam@googlemail.com>
Subject: GromPerl persistent Perl interpreter
Message-Id: <g5j0ch$h1$1@news.eunet.yu>
GromPerl persistent Perl interpreter
--------------------------------------------------------------------------------
GromPerl is persistent Perl interpreter for unix-like operating systems
provided by Bauk web server's Grom persistent interpreter connector library.
Perl interpreter compiled and linked with Grom persistent interpreter
connector library produces Perl interpreter capable of operating in
persistent mode and executing *.pl scripts in web directory.
Download:
http://www.bauk.ws/gromperl.html
http://www.bauk.ws/readme.html#gromconnector
GromPerl persistent Perl interpreter
Grom persistent interpreter connector library
------------------------------
Date: Tue, 15 Jul 2008 23:29:49 +0200
From: Leon Timmermans <fawaka@gmail.com>
Subject: Re: GromPerl persistent Perl interpreter
Message-Id: <b6026$487d16cd$89e0e08f$3816@news1.tudelft.nl>
On Tue, 15 Jul 2008 22:10:45 +0200, Gvdc wrote:
> GromPerl persistent Perl interpreter
>
--------------------------------------------------------------------------------
>
> GromPerl is persistent Perl interpreter for unix-like operating systems
> provided by Bauk web server's Grom persistent interpreter connector
> library.
>
> Perl interpreter compiled and linked with Grom persistent interpreter
> connector library produces Perl interpreter capable of operating in
> persistent mode and executing *.pl scripts in web directory.
>
>
>
>
> Download:
> http://www.bauk.ws/gromperl.html
> http://www.bauk.ws/readme.html#gromconnector
>
> GromPerl persistent Perl interpreter
> Grom persistent interpreter connector library
What's the point of this post? I mean, is this an announcement? An
attempt at discussion? A request for feedback. If it is the latter, I can
give you some...
This is from your installation instructions:
- copy "libgromcgi.a" from Bauk's src dir to Perl's src dir.
- copy files from Bauk's "gromconnector/gromperl" connector dir into
Perl's src dir. Perl's src dir should now contain files:
libperl.a
libgromcgi.a
Makefile.gromperl
gromperl_main.c
- change working dir to Perl src dir and execute command:
make -f Makefile.gromperl gromperl
to create "gromperl" executable.
If using Perl-5.10.0 version, compile by:
make -f Makefile.gromperl.perl-5.10.0 gromperl
Honestly, what were you thinking? That is no way to embed perl into your
webserver.
Also, your example scripts are totally 1996, please consider replacing
them with something - anything - else. Manually writing your headers is
not acceptable in the 21st century.
Leon Timmermans
------------------------------
Date: Tue, 15 Jul 2008 11:21:16 -0700 (PDT)
From: Ted Byers <r.ted.byers@gmail.com>
Subject: Re: reliability problem with Finance::QuoteHist::Yahoo
Message-Id: <f7d07b56-bd0b-40d3-9518-a4c01261ac99@e53g2000hsa.googlegroups.com>
On Jul 15, 12:41=A0pm, brian d foy <brian.d....@gmail.com> wrote:
> In article
> <139c6723-6a71-423c-9769-bbfc48fb2...@d45g2000hsc.googlegroups.com>,
>
> Ted Byers <r.ted.by...@gmail.com> wrote:
> > This project is at its beginning, proof of concept, stage. =A0 The plan
> > was to do an initial test using data from yahoo, and then proceed to
> > buying a datafeed from a commercial source.
>
> In that case you might make your own data source with whatever data you
> like (and that data doesn't have to represent anythign real). You can
> then test it and use it anyway that you like, and insert as many
> special cases as you like.
>
> These sorts of modules don't need to be anything fancy. It could be a
> big data structure witha single subroutine to return the right thing
> for each input. It doesn't need to think about it at all.
>
> Good luck :)
I have seen the same idea in three different sources (one a
professional trader, one an investor, and the third is Mandlebrot who
sited several examples of its sucess), but the investor did it
manually and thus undoubtedly missed countless opportunities, the
trader's implementation is far too brittle and slow to respond to
avoid significant drawdowns, and Mandlebrot talked about it in terms
of empirical evidence for memory in price data rather than in terms of
what a trader or investor might do (but then everything he's written
that I have read has avoided such practicalities). I think I have
found a way to apply it in a way that makes a profit even in bear
markets, and still have the ability to withdraw to T-Bills should
things get really bad, avoiding the major drawdowns the markets may
experience. I have a first version that limits the drawdowns during a
bear market and often beats the market during bull markets, but it
doesn't make a profit during a bear market and so a portfolio may
experience a number of years without making a profit (e.g. from 2000
through 2003). Of course, right now, it has all my simulated
portfolios in cash, and so is not making a profit despite the fact
that when I go through the data myself I see lots of opportunities to
make a profit. This algorithm depends on data representing systems
with short to medium term memory in order to be effective.
I have often used data source modules to provide simulated data for my
models, but I don't really want to try to simulate such data at this
time (unless there is a library that facilitates creationg of
multifractal brownian motion, along with routines to estimate the
relevant parameters of such motion from empirical data - both to test
them on data with known properties and to use with real world data).
I am out to exploit properties that Mandlebrot has convincingly show
to be present in market data; properties that a simple RNG will not
have. There are a number of outstanding RNGs out there, and I use
them routinely, but I have not found an algorithm to use them to
produce a multifractal time series (perhaps because of the nature and
extent of my search so far). The challenge of creating such a module
that produces data with the properties I am out to exploit seems at
present greater than the challenge of getting real data.
Thanks
Ted
------------------------------
Date: 16 Jul 2008 00:44:16 GMT
From: jt@toerring.de (Jens Thoms Toerring)
Subject: Re: remove previous lines of a log file
Message-Id: <6e4uj0F5bnimU1@mid.uni-berlin.de>
rajesh <sivarajesh.jarugula@gmail.com> wrote:
> I am unable to use this script. It gives the output file with
> the lines until the keyword is found. after the first occurance of the
> keyword, starting from there all lines are getting deleted.
> I am adding code for your reference. I want to find out ENUMERR which
> is there in the line no.11. my resultant output file should not have
> line no: 9,10,11. Remaining all should be intact.
> endtask : collect_e_daita
> 3 |
> 4 ncvlog: *W,LBLMAT (../_src/_hard/_vc/lcdport_vc/sv/
> nec_lcdport_vc_etype_monitor.sv,1 68|24): Label/name mismatch:
> collect_e_data - collect_e_daita.
> 5 (`include file: ../_src/_hard/_vc/lcdport_vc/sv/
> nec_lcdport_vc_etype_monitor.sv line 168, `include file: ../_src/
> _hard/_vc/lcdport_vc/sv/nec_lcdport_vc_top.sv line 47, `include
> file: ../_src/_hard/_tb/_lcdbif_top.sv line 26, file: ../_src/_hard/
> _tb/nec _lcdbif_tb_top.sv line 39)
> 6 apb_trans_cov.sample();
> 7 |
> 8 ncvlog: *W,ECSSDM (./INCA_libs/irun.lnx86.06.20.nc/svpplib/h/
> sivajar/lcdbif/_veri/_rando m/_src/_hard/_uvc/apb_uvc/sv/
> apb_uvc_master_monitor.sv,149|24): The 'sample' met hod is called
> upon a covergroup instance whose declaration has a default sampling
> condit ion associated with it.
> 9 `ovm_field_int (rd_wr, OVM_ALL_ON)
> 10 |
> 11 ncvlog: *W,ENUMERR (../_src/_hard/_uvc/apb_uvc/examples/../
> examples/dummy_memconfig_ types.sv,8|46): This assignment is a
> violation of SystemVerilog strong typing rules for enumeration
> datatypes.
> 12 `ovm_field_int (rdy_int, OVM_ALL_ON)
Did you try the corrected version (modulo the bug Leon Timmermans
pointed out)? Here it is with hopefully everything cleaned up:
-----8<------------------------------
#!/usr/bin/perl
use strict;
use warnings;
open my $in, '<', 'log' or die "Can't open log file.\n";
open my $out, '>', 'log.new' or die "Can't open replacement file.\n";
my @lines;
$lines[ 0 ] = <$in>;
$lines[ 1 ] = <$in>;
while ( <$in> ) {
if ( /ENUMERR/ ) {
@lines = ( );
last;
}
print $out shift @lines;
push @lines, $_;
}
if ( @lines ) {
print $out $_ for @lines;
} else {
while ( <$in> ) {
print $out $_;
}
}
rename 'log.new', 'log';
-----8<------------------------------
At least for your input file it deletes just the lines 9, 10 and
11, as you wanted to. But please note:
a) if 'ENUMERR' does appear in the first two lines nothing happens
to that lines, your specifications did not cover the case, so I
have no idea what you want to happen then
b) it does only remove the first instance 'ENUMERR' (and the two
lines before, you didn't tell what to do if it shows up a
second (or third etc.) time.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
------------------------------
Date: Tue, 15 Jul 2008 20:30:17 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: use/require, and variables
Message-Id: <9favk5-i4h.ln1@osiris.mauzo.dyndns.org>
Quoth "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>:
> Nick Wedd wrote:
> >
> > Ok. main.pl says, among other things,
> > require "freqs.pl";
> > $w += @{$indfreq{"foo"}}[5];
>
> IMHO that'd be a bit cleaner as:
>
> $indfreq{ 'foo' }[5]
Not just cleaner, more correct. @{...}[5] is an array slice, the same as
@a[5]; for some reason you don't get a 'Scalar value %s better written
as %s' warning if the array is not a simple array variable, but it still
applies. If you really want to avoid the arrow syntax (and the implicit
arrow in the above), you can use
${ $indfreq{"foo"} }[5]
(note the initial '$' rather than '@', since this is a single element).
Ben
>
> or if you like to have it be more explicit:
>
> $indfreq{ 'foo' }->[5]
>
> > and freqs.pl has many lines such as
> > $indfreq{"foo"} = [ 0, 0, 0, 0, 19440, 68160, 54960, 8640 ];
> > $indfreq{"bar"} = [ 0, 0, 0, 0, 14400, 67800, 59640, 9360 ];
> [...]
--
Raise your hand if you're invulnerable.
[ben@morrow.me.uk]
--
I touch the fire and it freezes me, [ben@morrow.me.uk]
I look into it and it's black.
Why can't I feel? My skin should crack and peel---
I want the fire back... BtVS, 'Once More With Feeling'
------------------------------
Date: Tue, 15 Jul 2008 18:11:31 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: use/require, and variables
Message-Id: <slrng7qbl3.qdt.tadmc@tadmc30.sbcglobal.net>
Nick Wedd <nick@maproom.co.uk> wrote:
> Thank you! Using "our" works and is compatible with "use strict". I
> must look up what "our" does,
Do that with:
perldoc -f our
then you will be reading documentation that matches whatever
version of perl you have.
> it seems to be more recent than my
> reference books.
Then your reference books must be more than 8 years old...
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Tue, 15 Jul 2008 18:07:26 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: use/require, and variables
Message-Id: <slrng7qbde.qdt.tadmc@tadmc30.sbcglobal.net>
Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
> Glenn Jackman wrote:
>> At 2008-07-15 05:48AM, "Nick Wedd" wrote:
>>> I have always found that putting "use strict" makes life easier for me.
>>>
>>> But now, I am trying to use what C programmers call "#include". I have
>>> a "main.pl" file, which needs to include another file where values are
>>
>> do 'otherfile';
>
> You need to declare the variable
... or use the fully-qualified variable name.
> under strict 'vars' whether you do() or
> require() the file.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
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 V11 Issue 1721
***************************************