[31019] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2264 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 9 21:09:54 2009

Date: Mon, 9 Mar 2009 18:09:18 -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           Mon, 9 Mar 2009     Volume: 11 Number: 2264

Today's topics:
    Re: A globbing question (Tim McDaniel)
    Re: Ban Xah Lee <fakemail@xyz.de>
    Re: Ban Xah Lee <tim@burlyhost.com>
    Re: Ban Xah Lee <kentilton@gmail.com>
    Re: Ban Xah Lee <xahlee@gmail.com>
    Re: Ban Xah Lee <dirk.bruere@gmail.com>
    Re: Ban Xah Lee <tim@burlyhost.com>
        Hiding cell values via WriteExcel module dn.perl@gmail.com
    Re: Hiding cell values via WriteExcel module <smallpond@juno.com>
    Re: Hiding cell values via WriteExcel module <jimsgibson@gmail.com>
    Re: How to convert a floating point number to a 64 bit  <slsamliu@gmail.com>
    Re: How to convert a floating point number to a 64 bit  <ben@morrow.me.uk>
    Re: How to convert a floating point number to a 64 bit  <smallpond@juno.com>
    Re: How to convert a floating point number to a 64 bit  <hjp-usenet2@hjp.at>
    Re: How to convert a floating point number to a 64 bit  <slsamliu@gmail.com>
        perl 5.8 or perl 5.10 <stoupa@practisoft.cz>
    Re: perl 5.8 or perl 5.10 <tim@burlyhost.com>
    Re: perl 5.8 or perl 5.10 <ben@morrow.me.uk>
    Re: software design question <glennj@ncf.ca>
    Re: software design question <rvtol+usenet@xs4all.nl>
    Re: Which Lisp to Learn? <tim@burlyhost.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 9 Mar 2009 20:51:44 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Re: A globbing question
Message-Id: <gp3vh0$qep$1@reader1.panix.com>

In article <x7ab7xoyko.fsf@mail.sysarch.com>,
Uri Guttman  <uri@stemsystems.com> wrote:
>>>>>> "PJH" == Peter J Holzer <hjp-usenet2@hjp.at> writes:
>
>  PJH> On 2009-03-07 06:57, Uri Guttman <uri@stemsystems.com> wrote:
>
>  JWK> ITYM:  in regexes . is the same as ? in globs.
>  >> 
>  >> yeah. shows how often i use globs for filtering in perl! in
>  >> shells i use them as needed. but my point is valid. globs have
>  >> very little power and regexes can do the same with about as
>  >> little syntax.
>
>  PJH> One reason why you might want globs instead of regexes is that
>  PJH> the users are more familiar with globs. If you tell them that
>  PJH> they can use wildcards, there is a chance that they know what
>  PJH> you mean. If you talk about regexes, you'll just get blank
>  PJH> stares.

Another reason may be just a legacy interface.

>  PJH> That said, I think it is rather simple to convert (basic)
>  PJH> globs to regexes, and I suspect that this is just what
>  PJH> Text::Glob does (but I haven't checked).
>
>i am sure i have seen formulas to convert glob patterns to
>regexes. the basics are simple (if i get them correct this time :). ?
>is . and * is .*

Off the top of my head: in UNIXY shells, * doesn't match any name that
starts with ".", so if you want that behavior, ou'd have to account
for that.  And if the input is a full path rather than just a member
of a directory, then ? is [^/] and * is [^/]*.  (Or, instead of /,
whatever your path name delimiter is).

So Text::Glob is looking like a better choice, just because they may
have considered the edge cases and cases we haven't considered.

-- 
Tim McDaniel, tmcd@panix.com


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

Date: Mon, 09 Mar 2009 21:22:10 +0100
From: Christian <fakemail@xyz.de>
Subject: Re: Ban Xah Lee
Message-Id: <49b57a8b$0$6118$9b622d9e@news.freenet.de>

Xah Lee schrieb:
> Of interest:
> 
> • Why Can't You Be Normal?
>   http://xahlee.org/Netiquette_dir/why_cant_you_be_normal.html
IMHO the point that you never reply to responds is what makes it 
problematic.
I have  seen 10 or more threads started by you and in not a single one 
of those I have seen any sort of second post by you.

Also the other thing that makes you appear like a troll is that  the 
only posts where you are visible on the usenet are your own!

Usenet is there for discussion. What you do seems to be mostly doing a 
often highly intelligent monologue  and awaiting comment on it.

Its not the purpose of Usenet. Simply calling you a troll is wrong.
You are after all better than that. Though I think you are misusing the 
Usenet. For what you do you should rather write a weblog so people 
interested in your monologues could follow them in a place where they 
are by definition on topic.

Christian


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

Date: Mon, 09 Mar 2009 13:32:04 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Ban Xah Lee
Message-Id: <81ftl.32976$l71.17371@newsfe23.iad>

Christian wrote:

> Though I think you are misusing the
> Usenet. For what you do you should rather write a weblog so people
> interested in your monologues could follow them in a place where they
> are by definition on topic.

I would agree that is the issue in Xah Lee's case as well.  I don't know
that he realizes he's posting in off topic groups in what seems nothing
more than self gratification, but perhaps he's just confused and
doesn't realize that usenet is not the place to just randomly post a
thought or challenge about a topic (especially in irrelevant groups to
his ranting) and linking to his site and not usually following up to
his own posts (like a poor form of self promotion of his articles).  I
agree, I think he might just be confused and needs to consider setting
up a blog about his feelings and whatnot, and he needs to understand
that it's not appropriate to do it on usenet.  Problem is, I don't
think he's just confused altogether, but he'll probably ignore the
entire topic he started anyway and continue doing what he's doing (he
seems to think the lisc, perl, python, java and ruby groups are his
personal blog medium, so all of his thoughts and feelings are
continually posted in places they don't belong -- and he doesn't care).
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Mon, 09 Mar 2009 16:36:06 -0400
From: Kenneth Tilton <kentilton@gmail.com>
Subject: Re: Ban Xah Lee
Message-Id: <49b57db0$0$22503$607ed4bc@cv.net>

Dirk Bruere at NeoPax wrote:
> Larry Gates wrote:
>> On Sun, 08 Mar 2009 04:09:52 +0000, Dirk Bruere at NeoPax wrote:
>>
>>> Dirk Bruere at NeoPax wrote:
>>
>>>> Well, don't worry - nobody is going to ban you from Usenet (except 
>>>> possibly the Chinese govt).
>>>> OTOH, nobody here much cares.
>>>> So, rant on - it's what Usenet is for. ☄ <--- what is that char?????
>>
>> http://lomas-assault.net/usenet/z12.jpg
>>
>> I don't know how to answer the question.  Is the zeroeth character also
>> null?
> 
> Almost had me cleaning the screen.
> 

I confess. I moved the window to be sure. But I have an excuse: more 
than once I have tried to delete a bit of dried... well, never mind.

hth, kt


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

Date: Mon, 9 Mar 2009 17:29:52 -0700 (PDT)
From: Xah Lee <xahlee@gmail.com>
Subject: Re: Ban Xah Lee
Message-Id: <e3ee5a8e-dd12-421a-b2a1-c8847687c396@w24g2000prd.googlegroups.com>

Christian <fakem...@xyz.de> wrote:

On Mar 9, 1:22 pm, Christian <fakem...@xyz.de> wrote:
> XahLeeschrieb:> Of interest:
>
> > =E2=80=A2 Why Can't You Be Normal?
> >  http://xahlee.org/Netiquette_dir/why_cant_you_be_normal.html
>
> IMHO the point that you never reply to responds is what makes it
> problematic.
> I have  seen 10 or more threads started by you and in not a single one
> of those I have seen any sort of second post by you.
>
> Also the other thing that makes you appear like a troll is that  the
> only posts where you are visible on the usenet are your own!
>
> Usenet is there for discussion. What you do seems to be mostly doing a
> often highly intelligent monologue  and awaiting comment on it.
>
> Its not the purpose of Usenet. Simply calling you a troll is wrong.
> You are after all better than that. Though I think you are misusing the
> Usenet. For what you do you should rather write a weblog so people
> interested in your monologues could follow them in a place where they
> are by definition on topic.
>
> Christian

In the article you quoted:
 http://xahlee.org/Netiquette_dir/why_cant_you_be_normal.html

contains this passage:

=C2=AB
Some people says that i don't participate in discussion, and this is
part of the reason they think i'm a so-called =E2=80=9Ctroll=E2=80=9D. Actu=
ally i do,
and read every reply to my post, as well have replied to technical
questions other posted. Most replies to my posts are attacks or
trivial (of few sentences) i don't consider worthy to reply.

A few, maybe 10% replies to my unconventional posts, i consider having
some value. But if i don't have sufficiently remarkable opinion on
what they remarked, i don't reply. Also, if all i wanted to say is
=E2=80=9Cthanks=E2=80=9D, i tend to avoid posting such trivial posts too. (=
i used to
reply by personal email in such cases, I still do sometimes now, but
today that can be considered intrusive.)
=C2=BB

if you didn't start your message with =E2=80=9CIMHO=E2=80=9D, which indicat=
ed to me
that at least you are sincere, i would not have replied. (no offense
intended)  Btw, i'm not some kind of saint. You (guys) do whatever
chatty style you want, i write or choose to reply in my abstruse &
ascetic manners. Just don't accuse when my style is not compatible
your drivels. (insult intentional)

I have written quite a lot on netiquette issues in the past decade.
You can find many answers about my reasons or posting behavior here:

=E2=80=A2 Netiquette Anthropology
  http://xahlee.org/Netiquette_dir/troll.html

Recently i started a blog that is collection of my online posts. If
you need to talk about me, feel free to comment there. I am more
likely to reply there for questions pertaining just me. The url is
here: http://xah-forum.blogspot.com/

If anyone likes me to give answers particular to this thread, or
desire me to reply to all the messages directed to me in this thread,
i'll be more than happy to do so.

Also, thanks to many supporters over the past years.

Truly Your Superior,

  Xah
=E2=88=91 http://xahlee.org/

=E2=98=84



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

Date: Tue, 10 Mar 2009 00:37:50 +0000
From: Dirk Bruere at NeoPax <dirk.bruere@gmail.com>
Subject: Re: Ban Xah Lee
Message-Id: <71lr2eFlnjrhU2@mid.individual.net>

Kenneth Tilton wrote:
> Dirk Bruere at NeoPax wrote:
>> Larry Gates wrote:
>>> On Sun, 08 Mar 2009 04:09:52 +0000, Dirk Bruere at NeoPax wrote:
>>>
>>>> Dirk Bruere at NeoPax wrote:
>>>
>>>>> Well, don't worry - nobody is going to ban you from Usenet (except 
>>>>> possibly the Chinese govt).
>>>>> OTOH, nobody here much cares.
>>>>> So, rant on - it's what Usenet is for. ☄ <--- what is that char?????
>>>
>>> http://lomas-assault.net/usenet/z12.jpg
>>>
>>> I don't know how to answer the question.  Is the zeroeth character also
>>> null?
>>
>> Almost had me cleaning the screen.
>>
> 
> I confess. I moved the window to be sure. But I have an excuse: more 
> than once I have tried to delete a bit of dried... well, never mind.
> 
> hth, kt

Sneezing while eating while programming can be messy.

-- 
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff


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

Date: Mon, 09 Mar 2009 17:37:27 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Ban Xah Lee
Message-Id: <mDitl.68942$cI2.51040@newsfe09.iad>

Xah Lee wrote:

> Christian <fakem...@xyz.de> wrote:
> 
> On Mar 9, 1:22 pm, Christian <fakem...@xyz.de> wrote:
>> XahLeeschrieb:> Of interest:
>>
>> > • Why Can't You Be Normal?
>> >  http://xahlee.org/Netiquette_dir/why_cant_you_be_normal.html
>>
>> IMHO the point that you never reply to responds is what makes it
>> problematic.
>> I have  seen 10 or more threads started by you and in not a single
>> one of those I have seen any sort of second post by you.
>>
>> Also the other thing that makes you appear like a troll is that  the
>> only posts where you are visible on the usenet are your own!
>>
>> Usenet is there for discussion. What you do seems to be mostly doing
>> a
>> often highly intelligent monologue  and awaiting comment on it.
>>
>> Its not the purpose of Usenet. Simply calling you a troll is wrong.
>> You are after all better than that. Though I think you are misusing
>> the Usenet. For what you do you should rather write a weblog so
>> people interested in your monologues could follow them in a place
>> where they are by definition on topic.
>>
>> Christian
> 
> In the article you quoted:
>  http://xahlee.org/Netiquette_dir/........ugh

Apparently my usenet filter is broken.

> contains this passage:
> 
> «
 ...
> »
> 
> if you didn't start your message with “IMHO”, which indicated to me
> that at least you are sincere, i would not have replied. (no offense
> intended)  Btw, i'm not some kind of saint. You (guys) do whatever
> chatty style you want, i write or choose to reply in my abstruse &
> ascetic manners. Just don't accuse when my style is not compatible
> your drivels. (insult intentional)

Actually, people take issue with you posting to groups that hold no
relevance to your posts, especially when you post about your personal
issues and problems that don't relate to any single group.

> I have written quite a lot on netiquette issues in the past decade.

But you don't follow them?

> You can find many answers about my reasons or posting behavior here:
> 
> • Netiquette Anthropology
>   http://xahlee.org/Netiquette_dir/troll.html

I don't care for your reasons or behavior, but that you've been
repeatedly asked not to post your feelings about LISP in the Python,
Perl, and Ruby groups.

> Recently i started a blog that is collection of my online posts.

So, use that instead of posting to random, off topic groups on usenet.

> If 
> you need to talk about me, feel free to comment there.

You post here, I reply to you here.

> I am more 
> likely to reply there for questions pertaining just me. The url is
> here:

Irrevant to your posting here without relevance.  I have no desire to
talk to you and say anything else.  So, can you stop cross posting to
the same 5 groups every time you post something, unless it's actually
relevant to the group?
 
> 
> If anyone likes me to give answers particular to this thread, or
> desire me to reply to all the messages directed to me in this thread,
> i'll be more than happy to do so.

Just please stop posting to groups that hold no relevance, as if they
are your personal blog.  Usenet is not a blog.

> Also, thanks to many supporters over the past years.

I'm sure.
 
> Truly Your Superior,

I'd think anyone superior to me would understand how to use usenet
properly.

I'm being genuine and sincere, when I say that I'd like to ask that you
stop cross posting to irrelevant groups.  Thanks for your
consideration.

-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Mon, 9 Mar 2009 14:25:22 -0700 (PDT)
From: dn.perl@gmail.com
Subject: Hiding cell values via WriteExcel module
Message-Id: <59d5b498-c9ec-47b6-9ede-77b77ba2dbbf@v13g2000pro.googlegroups.com>


A quick search of the forum's archives shows that there might be a way
to hide a cell in an excel sheet via win32::ole module.
http://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/5e943e4d986307c2/7943a11cad6139dd?lnk=gst&q=excel+hidden+ole#7943a11cad6139dd

Excel's help for the topic 'Hide or display cell values' suggests that
if a cell's format is set to Number > Custom, and the type is set
to  ;;; (three semi-colons), the field is shown blank on the sheet but
the correct value remains associated with the cell. Can this hiding of
the data for a cell or an entire row or an entire column be achieved
through WriteExcel module?

Even if I could *actually* set a column's width to 0 via WriteExcel
module, it would do.
But if I use: set_column('B:B', 0) ;  the column B's width is set to
some non-zero default value which Excel seems to calculate internally.

TIA.



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

Date: Mon, 9 Mar 2009 14:35:29 -0700 (PDT)
From: smallpond <smallpond@juno.com>
Subject: Re: Hiding cell values via WriteExcel module
Message-Id: <cdda296c-1599-456d-b27b-cbd0e5f14983@e24g2000vbe.googlegroups.com>

On Mar 9, 5:25 pm, dn.p...@gmail.com wrote:

>
> Excel's help for the topic 'Hide or display cell values' suggests that
> if a cell's format is set to Number > Custom, and the type is set
> to  ;;; (three semi-colons), the field is shown blank on the sheet but
> the correct value remains associated with the cell. Can this hiding of
> the data for a cell or an entire row or an entire column be achieved
> through WriteExcel module?
>

Have you tried it?
$hide_cell = set_num_format(';;;');
$worksheet->write(0, 0, 3.1415926, $hide_cell);


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

Date: Mon, 09 Mar 2009 17:32:54 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: Hiding cell values via WriteExcel module
Message-Id: <090320091732540672%jimsgibson@gmail.com>

In article
<59d5b498-c9ec-47b6-9ede-77b77ba2dbbf@v13g2000pro.googlegroups.com>,
<dn.perl@gmail.com> wrote:

> A quick search of the forum's archives shows that there might be a way
> to hide a cell in an excel sheet via win32::ole module.
[...]
> 
> Even if I could *actually* set a column's width to 0 via WriteExcel
> module, it would do.
> But if I use: set_column('B:B', 0) ;  the column B's width is set to
> some non-zero default value which Excel seems to calculate internally.

The version of Spreadsheet::WriteExcel on my system (2.25) has a hidden
attribute in the set_column method:

    set_column($first_col, $last_col, $width, $format, $hidden, $level,
      $collapsed)

with examples:

    $worksheet->set_column('D:D', 20,    $format, 1);
    $worksheet->set_column('E:E', undef, undef,   1);

Have you tried that?

-- 
Jim Gibson


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

Date: Mon, 9 Mar 2009 14:05:27 -0700 (PDT)
From: SamL <slsamliu@gmail.com>
Subject: Re: How to convert a floating point number to a 64 bit integer?
Message-Id: <960c6528-5113-48a3-b26a-43157df1fc9a@q11g2000vbn.googlegroups.com>

On Mar 9, 3:04=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth SamL <slsam...@gmail.com>:
>
> > I need to convert a floating point number to a 64 bit integer (long
> > long). How to do that in perl? Thanks.
>
> You will need to specify a little more about where these numbers are
> coming from. Probably you want perldoc -f pack.
>
> Ben

The number comes from calculation. For example:

my $a =3D 2.0**37;

Here I cannot use 2**37 directly since the result is -1.

I have found a way to "convert" it although I think there should be a
better way:

my $b =3D sprintf ("%.0f", $a);



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

Date: Mon, 9 Mar 2009 22:17:16 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: How to convert a floating point number to a 64 bit integer?
Message-Id: <c4hg86-bnd1.ln1@osiris.mauzo.dyndns.org>


Quoth SamL <slsamliu@gmail.com>:
> On Mar 9, 3:04pm, Ben Morrow <b...@morrow.me.uk> wrote:
> > Quoth SamL <slsam...@gmail.com>:
> >
> > > I need to convert a floating point number to a 64 bit integer (long
> > > long). How to do that in perl? Thanks.
> >
> > You will need to specify a little more about where these numbers are
> > coming from. Probably you want perldoc -f pack.
> 
> The number comes from calculation. For example:
> 
> my $a = 2.0**37;
> 
> Here I cannot use 2**37 directly since the result is -1.

I don't know what you mean by this. Even on a perl with 32bit IVs, I get

    ~% perl -le'print 2.0**37'
    137438953472

since perl will auto-upgrade to a NV if necessary. (IV is perl's
internal integer type, NV is its internal floating type. Usually IV is
your compiler's int and NV is its double, though you can Configure perl
to use different types if desired.) Most machines have at least 53bit
doubles nowadays, so they can hold numbers up to 2^53 with integer
precision.

> I have found a way to "convert" it although I think there should be a
> better way:
> 
> my $b = sprintf ("%.0f", $a);

This converts it into a string. "$a" will do the same thing, if you
really need to. Nearly all the time you can just ignore the
integer/float/string distinction, and let perl handle it.

You need to tell us what you are actually doing. Post a *short*,
*complete* example program that doesn't do what you expect, and tell us
both what it does and what you wanted it to do.

You might want to read the Posting Guidelines that are posted here
fairly regularly.

Ben



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

Date: Mon, 9 Mar 2009 14:26:47 -0700 (PDT)
From: smallpond <smallpond@juno.com>
Subject: Re: How to convert a floating point number to a 64 bit integer?
Message-Id: <aa9baacf-d72b-4439-82ac-2486d5b20e14@y13g2000yqn.googlegroups.com>

On Mar 9, 5:05 pm, SamL <slsam...@gmail.com> wrote:
> On Mar 9, 3:04 pm, Ben Morrow <b...@morrow.me.uk> wrote:
>
> > Quoth SamL <slsam...@gmail.com>:
>
> > > I need to convert a floating point number to a 64 bit integer (long
> > > long). How to do that in perl? Thanks.
>
> > You will need to specify a little more about where these numbers are
> > coming from. Probably you want perldoc -f pack.
>
> > Ben
>
> The number comes from calculation. For example:
>
> my $a = 2.0**37;
>
> Here I cannot use 2**37 directly since the result is -1.
>
> I have found a way to "convert" it although I think there should be a
> better way:
>
> my $b = sprintf ("%.0f", $a);

use bigint;
$a = 2.0**37;
print int($a),"\n";

137438953472


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

Date: Mon, 9 Mar 2009 23:29:27 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: How to convert a floating point number to a 64 bit integer?
Message-Id: <slrngrb628.3dk.hjp-usenet2@hrunkner.hjp.at>

On 2009-03-09 21:26, smallpond <smallpond@juno.com> wrote:
> On Mar 9, 5:05 pm, SamL <slsam...@gmail.com> wrote:
>> On Mar 9, 3:04 pm, Ben Morrow <b...@morrow.me.uk> wrote:
>>
>> > Quoth SamL <slsam...@gmail.com>:
>>
>> > > I need to convert a floating point number to a 64 bit integer (long
>> > > long). How to do that in perl? Thanks.
>>
>> > You will need to specify a little more about where these numbers are
>> > coming from. Probably you want perldoc -f pack.
>>
That was my interpretation of the question, too. But it seems I was
mistaken.


>> The number comes from calculation. For example:
>>
>> my $a = 2.0**37;
>>
>> Here I cannot use 2**37 directly since the result is -1.
>>
>> I have found a way to "convert" it although I think there should be a
>> better way:
>>
>> my $b = sprintf ("%.0f", $a);

The result of this is a string, not a 64 bit integer.

> use bigint;
> $a = 2.0**37;
> print int($a),"\n";
>
> 137438953472

And the result of this is a bigint, which is also not the same as a 64
bit integer.

Perl can also be compiled to use 64 bit integers on most platforms.

But the real question is: What is the 64 bit integer for? Until
this is known, there is no way to tell whether a real 64 bit int is
needed or  string or a bigint (or
maybe even a float) can be used instead.

	hp


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

Date: Mon, 9 Mar 2009 15:47:09 -0700 (PDT)
From: SamL <slsamliu@gmail.com>
Subject: Re: How to convert a floating point number to a 64 bit integer?
Message-Id: <2b154bd5-ba8c-49d9-94b8-de1007d0ed41@v6g2000vbb.googlegroups.com>

On Mar 9, 6:29=A0pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
> On 2009-03-09 21:26, smallpond <smallp...@juno.com> wrote:> On Mar 9, 5:0=
5 pm, SamL <slsam...@gmail.com> wrote:
> >> On Mar 9, 3:04 pm, Ben Morrow <b...@morrow.me.uk> wrote:
>
> >> > Quoth SamL <slsam...@gmail.com>:
>
> >> > > I need to convert a floating point number to a 64 bit integer (lon=
g
> >> > > long). How to do that in perl? Thanks.
>
> >> > You will need to specify a little more about where these numbers are
> >> > coming from. Probably you want perldoc -f pack.
>
> That was my interpretation of the question, too. But it seems I was
> mistaken.
>
> >> The number comes from calculation. For example:
>
> >> my $a =3D 2.0**37;
>
> >> Here I cannot use 2**37 directly since the result is -1.
>
> >> I have found a way to "convert" it although I think there should be a
> >> better way:
>
> >> my $b =3D sprintf ("%.0f", $a);
>
> The result of this is a string, not a 64 bit integer.
>
> > use bigint;
> > $a =3D 2.0**37;
> > print int($a),"\n";
>
> > 137438953472
>
> And the result of this is a bigint, which is also not the same as a 64
> bit integer.
>
> Perl can also be compiled to use 64 bit integers on most platforms.
>
> But the real question is: What is the 64 bit integer for? Until
> this is known, there is no way to tell whether a real 64 bit int is
> needed or =A0string or a bigint (or
> maybe even a float) can be used instead.
>
> =A0 =A0 =A0 =A0 hp

Sorry, I did not make it clear. Actually I just need a string which is
the result of 2.0**37. So the simplest solution, as Ben said, is

perl -le'print 2.0**37'

That solved my problem. Thanks.


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

Date: Mon, 9 Mar 2009 12:53:09 +0100
From: "Petr Vileta \"fidokomik\"" <stoupa@practisoft.cz>
Subject: perl 5.8 or perl 5.10
Message-Id: <gp4bkj$tb0$1@ns.felk.cvut.cz>

Years ago I made a very little webhosting server on RedHat 7.3. This was 
intended for few domains of my friends but now my business expand, I have many 
domains and must upgrade my server (HW + SW).
The question is which verson of Perl to install. Perl 5.8 or Perl 5.10? Version 
5.10 look as logical solution but time to time I read about nasty bug ;-)
To understand me right: I like a stable solutions and not like to must patch 
(anything) every few days.

What do you recommend me? Which version and why?

-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail.
Send me your mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>



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

Date: Mon, 09 Mar 2009 17:38:59 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: perl 5.8 or perl 5.10
Message-Id: <DEitl.68944$cI2.41567@newsfe09.iad>

Petr Vileta "fidokomik" wrote:

> Years ago I made a very little webhosting server on RedHat 7.3. This
> was intended for few domains of my friends but now my business expand,
> I have many domains and must upgrade my server (HW + SW).
> The question is which verson of Perl to install. Perl 5.8 or Perl
> 5.10? Version 5.10 look as logical solution but time to time I read
> about nasty bug ;-) To understand me right: I like a stable solutions
> and not like to must patch (anything) every few days.
> 
> What do you recommend me? Which version and why?
> 

A lot of the bugs are in both, so I'd say 5.10.  If you want, use 5.8, I
don't think anyone will mind.  There might just be a few features you
can't use the same way.  Then upgrade to 5.10 (or whatever the next
stable release is) after that.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Tue, 10 Mar 2009 00:46:11 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: perl 5.8 or perl 5.10
Message-Id: <jrpg86-32f1.ln1@osiris.mauzo.dyndns.org>


Quoth "Petr Vileta \"fidokomik\"" <stoupa@practisoft.cz>:
> Years ago I made a very little webhosting server on RedHat 7.3. This was 
> intended for few domains of my friends but now my business expand, I have many 
> domains and must upgrade my server (HW + SW).
> The question is which verson of Perl to install. Perl 5.8 or Perl 5.10? Version 
> 5.10 look as logical solution but time to time I read about nasty bug ;-)
> To understand me right: I like a stable solutions and not like to must patch 
> (anything) every few days.
> 
> What do you recommend me? Which version and why?

If you can wait a while I would recommend using 5.10.1 when it comes
out. There were indeed a few rough edges with 5.10 which have since been
corrected. Otherwise, you should be aware that 5.8.9 is officially the
last release on the 5.8 track, excepting major security holes: I expect
that fairly soon p5p will consider 5.8 'somewhat unsupported' the way
5.6 has been for some time.

Of course, I don't speak for p5p in any capacity.

Ben



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

Date: 9 Mar 2009 20:49:27 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: software design question
Message-Id: <slrngrb06p.ijf.glennj@smeagol.ncf.ca>

At 2009-03-09 03:53PM, "Uri Guttman" wrote:
> >>>>> "bdf" == brian d foy <brian.d.foy@gmail.com> writes:
>   bdf>    emit_results( $fh, \@vars ); # $fh is any sort of handle
>  
>   bdf>    sub generate_results { ... }
>  
>   bdf>    sub emit_results {
>   bdf>       my( $fh, $vars ) = @_;
>  
>   bdf>       print $fh generate_results( $vars );
>   bdf>       }
>  
>  i don't see the major win having a separate emit routine. it is just the
>  one line print statement so you have more code for little benefit. if
>  you needed to print it in many places it could be a minor savings.

I'm operating on the assumption that the generate and/or emit routines
are large.  I prefer my "main" sub to be as concise as possible.

-- 
Glenn Jackman
    Write a wise saying and your name will live forever. -- Anonymous


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

Date: Tue, 10 Mar 2009 01:52:18 +0100
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: software design question
Message-Id: <49b5b9c2$0$184$e4fe514c@news.xs4all.nl>

Uri Guttman wrote:

> [printing late] but scalar refs
> solves the passing around big strings. you still need at least one large
> buffer for it though.

Or store the strings in an array (and pass around its ref) because

     print LIST

-- 
Ruud


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

Date: Mon, 09 Mar 2009 13:34:10 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Which Lisp to Learn?
Message-Id: <63ftl.32977$l71.21760@newsfe23.iad>

Michael Austin wrote:

> Arne Vajhøj wrote:
>> Xah Lee wrote:
>>> For those of you imperative programers who kept on hearing about
>>> lisp and is tempted to learn, then, ...
>> 
>> You:
>> * consider yourself unfairly treated by various communities
>> * post a long drivel about various Lisp flavors to newsgroups
>>   that are not in any way Lisp related
>> ?
>> 
>> There seems to be a disconnect somewhere.
>> 
>> Arne
> 
> Hey Arne - like he even knows what LISP is... ;)

I've not paid any attention to most of his posts, but I'd sure like to
know what crazy thing this guy is taking to believe that a his personal
feelings and post about lisp has any relation to groups I see this
nonsense in.  So, I'm not shocked to learn people question his lisp
skills anyway (he sure doesn't seem to know much about Perl or Python
and he posts a lisp post to these groups?  Sounds like he indeed
doesn't know what LISP is).
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

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


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