Re: BoB

2002-03-06 Thread Stephen Turner

On Wed, 6 Mar 2002 [EMAIL PROTECTED] wrote:
 

 Actually, Stephen is my dark horse tip to win the tournament. Why?
 
 This is Turner's 3rd Golf Tournament, and he's only lost twice.
 

Tee hee.

Still, this morning's leaderboard makes me feel a bit out of my depth. I was
only 2 strokes behind last night, but now Ton's shot an eagle and a couple
of birdies to leave me 6 off the pace. I might be worth a punt at 50-1 if
you fancy backing an outsider, but don't accept any shorter odds. :-)

-- 
Stephen Turner, Cambridge, UKhttp://homepage.ntlworld.com/adelie/stephen/
This is Henman's 8th Wimbledon, and he's only lost 7 matches. BBC, 2/Jul/01




Re: is perl a reporting tool ?

2002-03-06 Thread Dave Cross

On Wed, Mar 06, 2002 at 12:06:14PM -0500, Selector, Lev Y ([EMAIL PROTECTED]) wrote:
 Hello,
 
 I searched for OLAP on perl.com and CPAN (and  perl olap on Google) - got
 no entries.
 Also there is nothing on data warehousing in the perl world.
 
 Am I missing something?
 I thought Perl is supposed to be a Practical Extraction and Reporting
 Language
 
 Today in corporate world people use all kinds of specialized software for
 reporting. Here are some major players: Business Objects, Cognos, Actuate,
 Brio Software, Crystal Decisions, MicroStrategy, Microsoft, Oracle, IBM.
 
 Some vendors have designed their own programming languages for this purpose.
 For example, Microsoft Analysis Services (part of MS SQL server) is taking
 the market recently. They have an elegant language (MDX) for
 multi-dimensional queries - similar to SQL, but designed to handle
 multidimensional objects - see the book Microsoft Olap Solutions (actually
 Microsoft bought a bunch of Israeli Jews with their development on that).
 
 I thought it would be nice to be able to do OLAP (multi-dimensional and
 hierarchical reporting) in Perl.
 Do you know of any development in this direction?

I don't know of any work going on in this specific area, but I wouldn't be
surprised if you could put something together out of already existing 
components from CPAN.

Could you tell me a bit more about what you'd like to be able to do. I'm
very interested in this idea.

Dave...

-- 

  Don't dream it... be it



Re: TPR course Beginner vs. Veteran

2002-03-06 Thread Jean-Pierre Vidal

Le Mercredi 6 Mars 2002 15:55, Chris Dolan a écrit :
 [...]
 However, I should say that the more I read the fwp archives, the more
 intimidated I get!  I didn't realize how much I had handicapped myself
 by not upgrading perl5.6.0-5.6.1!!! :-)

 Chris

I realize how much I had handicapped myself entering veteran's leaderboard 
(45th instead of 20th). And: I realize how much I'm handicapped on the road 
to walk from 80.52 to 53.58.
:-)

Jean-Pierre



Re: is perl a reporting tool ?

2002-03-06 Thread Michael G Schwern

On Wed, Mar 06, 2002 at 12:06:14PM -0500, Selector, Lev Y wrote:
 Hello,
 
 I searched for OLAP on perl.com and CPAN (and  perl olap on Google) - got
 no entries.
 Also there is nothing on data warehousing in the perl world.
 
 Am I missing something?

No, but I think we are.  What's OLAP?


 I thought Perl is supposed to be a Practical Extraction and Reporting
 Language

Practical is often shorthand for if there's sufficient call for it,
somebody will write a module to do it, even if that somebody is you
:)


 Some vendors have designed their own programming languages for this purpose.
 For example, Microsoft Analysis Services (part of MS SQL server) is taking
 the market recently. They have an elegant language (MDX) for
 multi-dimensional queries - similar to SQL, but designed to handle
 multidimensional objects - 

If you're looking for easy ways to store complex objects consider
Tangram, Alzabo, Class::DBI...

The Perl Object Oriented Persistence group might prove helpful.
http://poop.sourceforge.net/


 see the book Microsoft Olap Solutions (actually Microsoft bought a
 bunch of Israeli Jews with their development on that).

OLAP:  Now with 50% more chutzpah! :)


 I thought it would be nice to be able to do OLAP (multi-dimensional and
 hierarchical reporting) in Perl.
 Do you know of any development in this direction?


-- 

Michael G. Schwern   [EMAIL PROTECTED]http://www.pobox.com/~schwern/
Perl Quality Assurance  [EMAIL PROTECTED] Kwalitee Is Job One
Instant Cross-Platform CGI Programming in Visual Perl 5 with Object Oriented
Design in 7 Days Unleashed for Dummies Special Edition with Exclusive Java
Chapters for Developers.  Year 2000 compliant, Enterprise edition and ISO9000-
certified.  A Nutshell Handbook Designed For Windows 95/98/NT with a forward by
Larry Bud Melman. Interactive Multimedia CDROM included.  3rd revised editon,
covers Perl5.6.
Of course, it will be refered to by its simple acronym:
ICPCGIPiVP5wOODi7DU4DSEwEJC4DY2KCEedISO9000-cNHD4W9598NTLBMIMCDROM3edP5.6



Re: rethinking printf

2002-03-06 Thread Randal L. Schwartz

 Rich == Rich Morin [EMAIL PROTECTED] writes:

Rich This seems pretty ugly to me (Randal didn't like it much either :-)

Yup.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: rethinking printf

2002-03-06 Thread Paul Makepeace

On Wed, Mar 06, 2002 at 09:45:18AM -0800, Rich Morin wrote:
 He
 suggested, when asked, that folks could put in newlines as follows:
 
   'yada yada yada \qq{\n}'

I meant to add this in last time: There is also the option of having an
additional function that adds the newline in, e.g. WriteLine() v.
Write() as seen in many other languages (Pascal et al, Java, etc). I've
never really liked this but on the other hand, it seems the lesser of
two evils.

\qq{\n} as a newline strikes me as a joke. Was it profferred in jest?

Paul

--
Paul Makepeace ... http://paulm.com/

If we could fly to the moon, then monkies would be green.
   -- http://paulm.com/toys/surrealism/



Re: rethinking printf

2002-03-06 Thread Uri Guttman

 BC == Bernie Cosell [EMAIL PROTECTED] writes:

cced perl6-language

  BC I wonder if the solution is to look at it the other way: that you
  BC have to do something to get interpolation to happen.  If we look
  BC at it from the old adage of making the more common things simpler,
  BC at least in my code I very rarely interpolate arrays [and I
  BC suspect I'd even LESS often interpolate hashes], I wouldn't mind
  BC the syntax going the other way -- maybe @ never interpolates and
  BC you need to do \@ to make interpolation happen [and then
  BC similarly with '%']...  This is also simlar to the logic behind
  BC Perl's reversing the longstanding unix convention WRT to chars
  BC like '(' in REs.

that is a good idea. the @() and $() things will interplate any
expressions into strings. so use a method on the hash to get a string
out and wrap it in $().

printf %d hash is $(%foo.string), $bar ;

no ambiguity and no confusion. how often will you need to interpolate a
hash? so make it more cumbersome as it is a rare thing. that is larry's
credo from way back. breaking % in a s/printf format is not good as that
is the very common thing to do.

uri

-- 
Uri Guttman  --  [EMAIL PROTECTED]   http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
- Stem and Perl Development, Systems Architecture, Design and Coding 
Search or Offer Perl Jobs    http://jobs.perl.org



Re: rethinking printf

2002-03-06 Thread Bart Lateur

On Wed, 6 Mar 2002 17:57:07 -0500, Uri Guttman wrote:

how often will you need to interpolate a hash?

A whole hash: quite rarely. A hash item: a LOT. Don't forget that
$foo{BAR} will now become %foo{BAR}

-- 
Bart.



RE: rethinking printf

2002-03-06 Thread Brent Dax

Uri Guttman:
#   printf %d hash is $(%foo.string), $bar ;
#
# no ambiguity and no confusion. how often will you need to
# interpolate a
# hash?

As others have pointed out, %foo{BAR} has to work.  But I have another
question for you: what's wrong with

sprintf '%d hash is %s', $bar, %foo;

?  After all, interpolating into an sprintf is a bit dangerous anyway
(what if %foo=('%d' = '')?), and you avoid special cases.

--Brent Dax [EMAIL PROTECTED]
@roles=map {Parrot $_} qw(embedding regexen Configure)

#define private public
--Spotted in a C++ program just before a #include




Re: rethinking printf

2002-03-06 Thread Yitzchak Scott-Thoennes

In article p05100339b8abfb25cfdf@[192.168.254.205],
Rich Morin [EMAIL PROTECTED] wrote:
Note that I'm suggesting a new function
name because printf has a little-used capability that could conflict with
my proposed syntax:

   The format string is reused as often as necessary
to satisfy the arguments.

Where did you get that?  Not true for Perl or C.



Re: rethinking printf

2002-03-06 Thread Uri Guttman

 BD == Brent Dax [EMAIL PROTECTED] writes:

  BD Uri Guttman:
  BD # printf %d hash is $(%foo.string), $bar ;
  BD #
  BD # no ambiguity and no confusion. how often will you need to
  BD # interpolate a
  BD # hash?

  BD As others have pointed out, %foo{BAR} has to work.  But I have another
  BD question for you: what's wrong with

  BD   sprintf '%d hash is %s', $bar, %foo;

that is fine but if you want the format string to use %foo{bar} then you
need double quotes. the problem is deciding when to allow that and to
not make %s become broken. i proposed a possible solution in my previous
post. maybe it won't fall on deaf ears. :)

  BD ?  After all, interpolating into an sprintf is a bit dangerous anyway
  BD (what if %foo=('%d' = '')?), and you avoid special cases.

that is another point. not allowing a complete hash to interpolate. but
what defines that? what if you wanted %s{bar} and that was a format and
not a hash and in a double quoted string? my proposal handles that well
with no major noise factors. qn would be just like qq but not allow any
direct hash interpolations (%foo or %foo{bar}). you can always get those
with $() if needed. this solves the common case with a minimal of noise
and the uncommon case has a simple out of using $(). no need for wacko
ways to put in \n. it is double quotish in all ways but one and mainly
to be used for printf format strings.

uri

-- 
Uri Guttman  --  [EMAIL PROTECTED]   http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
- Stem and Perl Development, Systems Architecture, Design and Coding 
Search or Offer Perl Jobs    http://jobs.perl.org



Re: rethinking printf

2002-03-06 Thread Rich Morin

At 5:27 PM -0800 3/6/02, Yitzchak Scott-Thoennes wrote:
The format string is reused as often as necessary
 to satisfy the arguments.

Where did you get that?  Not true for Perl or C.

Apparently, when I did a man printf, I got the one in FreeBSD's Section 1:

PRINTF(1)   FreeBSD General Commands Manual  PRINTF(1)

NAME
   printf - formatted output

SYNOPSIS
   printf format [arguments ...]

DESCRIPTION
   Printf formats and prints its arguments, after the first, under control
   of the format.  The format is a character string which contains three
   types of objects: plain characters, which are simply copied to standard
   output, character escape sequences which are converted and copied to the
   standard output, and format specifications, each of which 
causes printing
   of the next successive argument.

   The arguments after the first are treated as strings if the 
corresponding
   format is either c or s; otherwise it is evaluated as a C constant, with
   the following extensions:

 o   A leading plus or minus sign is allowed.
 o   If the leading character is a single or double quote, or not a
 digit, plus, or minus sign, the value is the ASCII code of the
 next character.

   The format string is reused as often as necessary to satisfy the
   arguments.  Any extra format specifications are evaluated with zero or
   the null string.
  ...

I also think Fortran FORMAT statements acted this way, but it's been 
far too long
for me to remember for sure...  In any case, it seems that it isn't a 
problem...

-r
-- 
email: [EMAIL PROTECTED]; phone: +1 650-873-7841
http://www.cfcl.com/rdm- my home page, resume, etc.
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
http://www.ptf.com/tdc - Prime Time Freeware's Darwin Collection



Re: rethinking printf

2002-03-06 Thread Rich Morin

At 11:24 PM -0500 3/6/02, Uri Guttman wrote:
 qn would be just like qq but not allow any
direct hash interpolations (%foo or %foo{bar}). you can always get those
with $() if needed. this solves the common case with a minimal of noise
and the uncommon case has a simple out of using $(). no need for wacko
ways to put in \n. it is double quotish in all ways but one and mainly
to be used for printf format strings.

I also like this because it allows a typical format string to be converted
merely by adding a two-character prefix:

   printf(The value is %7.2f\n, $foo);
   ---
   printf(qnThe value is %7.2f\n, $foo);

-r
-- 
email: [EMAIL PROTECTED]; phone: +1 650-873-7841
http://www.cfcl.com/rdm- my home page, resume, etc.
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
http://www.ptf.com/tdc - Prime Time Freeware's Darwin Collection



Re: rethinking printf

2002-03-06 Thread Dmitry Kohmanyuk

On Wed, Mar 06, 2002 at 11:24:57PM -0500, Uri Guttman wrote:
 that is another point. not allowing a complete hash to interpolate. but
 what defines that? what if you wanted %s{bar} and that was a format and
 not a hash and in a double quoted string? my proposal handles that well
 with no major noise factors. qn would be just like qq but not allow any
 direct hash interpolations (%foo or %foo{bar}). you can always get those
 with $() if needed. this solves the common case with a minimal of noise
 and the uncommon case has a simple out of using $(). no need for wacko
 ways to put in \n. it is double quotish in all ways but one and mainly
 to be used for printf format strings.

why not qf for format strings then?

s/(printf)/\1 qf/g




Re: rethinking printf

2002-03-06 Thread Dmitry Kohmanyuk

On Wed, Mar 06, 2002 at 08:56:18PM -0800, Yitzchak Scott-Thoennes wrote:
 Apparently, when I did a man printf, I got the one in FreeBSD's Section 1:
The format string is reused as often as necessary to satisfy the
arguments.  Any extra format specifications are evaluated with zero or
the null string.
 
 Thats funky.

this is section *1* manual, for commands, right?  
It's possible that printf *program* does that, but that's really weird.

(yes, indeed: printf(1) FreeBSD 3.5, Linux 2.2.14, and SunOS 5.8 aka Solaris 8 
are
documented and work this way.)

 POSIX (IEEE 1003.1-2001) says:
 If the format is exhausted while arguments remain, the excess
 arguments shall be evaluated but are otherwise ignored.
 
 And C99 (ISO 9899-1999 section 7.19.6.1) says:
 If the format is exhausted while arguments remain, the excess
 arguments are evaluated (as always) but are otherwise ignored.
 
 Does it in fact reuse the format on your system?

If one remembers how C argument passing convention works on assembly level (and
different from Pascal conversion for example), it is that arguments are pushed
to stack by caller, last to first, then subroutine is called, and stack popped 
(possibly
delayed or combined with another stack operation down the road.)  Therefore, 
it is impossible for called function to know number of arguments it has passed.
(Unless printf() is implemented in the language compiler.)

For example, the following program (pardon terse style):

#include stdio.h
#define NARGS 10
int main() {
 int i; int n[NARGS];
 for (i = 0; i  NARGS; i++) { n[i] = i; }
 printf(%d,\n, n[0], n[1], n[2], n[3]);
 return 0;
}

produces the following output:
0,

and compiles to the following code, which does not pass 4 as number of 
non-format arguments to printf at any way:

.file   test-printf.c
.version01.01
gcc2_compiled.:
..section.rodata
..LC0:
.ascii %d,\12\0
..text
.p2align 2
..globl main
.typemain,function
main:
pushl %ebp
movl %esp,%ebp
subl $40,%esp
xorl %eax,%eax
.p2align 2,0x90
..L9:
movl %eax,-40(%ebp,%eax,4)
incl %eax
cmpl $9,%eax
jle .L9
pushl -28(%ebp)
pushl -32(%ebp)
pushl -36(%ebp)
pushl -40(%ebp)
pushl $.LC0
call printf
xorl %eax,%eax
leave
ret
..Lfe1:
.sizemain,.Lfe1-main
.ident  GCC: (GNU) 2.7.2.3




Re: rethinking printf

2002-03-06 Thread Ariel Scolnicov

Paul Makepeace [EMAIL PROTECTED] writes:

 On Wed, Mar 06, 2002 at 09:45:18AM -0800, Rich Morin wrote:
  He
  suggested, when asked, that folks could put in newlines as follows:
  
'yada yada yada \qq{\n}'
 
 I meant to add this in last time: There is also the option of having an
 additional function that adds the newline in, e.g. WriteLine() v.
 Write() as seen in many other languages (Pascal et al, Java, etc). I've
 never really liked this but on the other hand, it seems the lesser of
 two evils.

printf(%s\n %s\n%s\n, @haiku_line[0,1,2]);

-- 
Ariel Scolnicov|http://3w.compugen.co.il/~ariels
Compugen Ltd.  |[EMAIL PROTECTED]
72 Pinhas Rosen St.|Tel: +972-3-7658117  fast, good, and cheap;
Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555   pick any two!