[PHP] How to look for unused methods/functions and variables/constants.

2007-12-12 Thread Mathijs van Veluw

Hello there,

We have a large project with lots of classes.
Now i am wondering if there is a way to let something check all those 
files and tell me which methods/functions variables/constants etc.. 
arn't used anymore.


Or even which files arn't used anymore.

Is there already something like this?

Thx in advance.

Mathijs

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-12 Thread Per Jessen
Jochem Maas wrote:

>> Have you tried stracing it to see what's really happening when the
>> load goes that high?
> 
> am I correct that that would be done like so?:
> 
> strace -p 

Yep, that's it.  You'll probably want to record the output for analysis,
but sometimes it's very obvious what's happening.  Which doesn't mean
it's also easy to fix, but it could give you a clue. 


/Per Jessen, Zürich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mysqli support - test or complain? [SOLVED]

2007-12-12 Thread Per Jessen
Robert Cummings wrote:

>> I can't remember what sort of environment the OP was in, but if any
>> sort of organised testing is done, the use of two different APIs will
>> just about double the test-effort.  Which is why I still think the
>> best option is to mandate _one_ of the APIs and choose your hoster
>> accordingly.
> 
> Well if you write unit tests, having the unit tests applied to one or
> the other is the same amount of work since it just requires a switch
> to change between mysql and mysqli.

Regardless of how you do it, it's twice the amount of work to run a test
twice.  



/Per Jessen, Zürich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to look for unused methods/functions and variables/constants.

2007-12-12 Thread T . Lensselink
On Wed, 12 Dec 2007 10:21:58 +0100, Mathijs van Veluw
<[EMAIL PROTECTED]> wrote:
> Hello there,
> 
> We have a large project with lots of classes.
> Now i am wondering if there is a way to let something check all those
> files and tell me which methods/functions variables/constants etc..
> arn't used anymore.
> 
> Or even which files arn't used anymore.
> 
> Is there already something like this?
> 
> Thx in advance.
> 
> Mathijs
> 

You could use Xdebug's Code_Coverage. Or the "Analyze code" feature 
in Zend Studio if you're using that :)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to look for unused methods/functions and variables/constants.

2007-12-12 Thread T . Lensselink
On Wed, 12 Dec 2007 10:21:58 +0100, Mathijs van Veluw
<[EMAIL PROTECTED]> wrote:
> Hello there,
> 
> We have a large project with lots of classes.
> Now i am wondering if there is a way to let something check all those
> files and tell me which methods/functions variables/constants etc..
> arn't used anymore.
> 
> Or even which files arn't used anymore.
> 
> Is there already something like this?
> 
> Thx in advance.
> 
> Mathijs
> 

Somehow my subject got stripped. I hope this reply doesn't break the
thread.

You can use Xdebug's Code_Coverage. 
Or the "Analyze code" feature in Zend Studio if you're using that.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 2:22 PM -0600 12/10/07, Jay Blanchard wrote:


Without order there cannot be randomness.


Without randomness, you wouldn't know what order was.

This is one of those yin-yang things.

There is simply order and randomness existing in our minds. There is 
no order, nor randomness, existing in nature, it's our perception, 
clarification, and categorization of nature that demands attributes 
be assigned to artificial groupings of identity threshold exceeding 
objects. In other words, we decide on what IT is and then assign 
order to IT.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Jochem Maas
tedd wrote:
> At 5:15 PM -0500 12/10/07, Daniel Brown wrote:
>>Just for fun, I decided to write out an algorithm to randomize
>> with a never-known seed that would update constantly, with no human or
>> external script intervention required to initiate or maintain it.
> 
> 
> My guess is that if there was a time that this  did not exist,
> but now does exist, then it cannot be random. It may be random for a
> billion years, or more, but it would eventually repeat.
> 
> However, it something started at the instant of the big-bang, then its
> repeat cycle would be at least equal-to, or greater-than, known time and
> thus random.
> 
> Cheers,
> 
> tedd

tedd your as sick as Rob :-)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 2:46 PM -0500 12/10/07, Robert Cummings wrote:

On Mon, 2007-12-10 at 11:37 -0800, Stephen Johnson wrote:

 True randomization is only really possible in nature.


Can you say for certain nature is truly random? Just because the seed
may have occurred 13.7 billion years ago and we don't know what that
initial state was and we couldn't possibly calculate all the
interactions since, doesn't mean that everything since hasn't been
happening in accordance with some universal formula and in absence of
randomness. We know that there appear to be certain laws in physics,
would they not have applied to that initial state in a non random
manner? It may just be that due to the hugantic sample space from which
to draw arbitrary values that we think things are random.

Food for thought :)

Cheers,
Rob.


Rob:

You most certainly have a point there. Our identification, 
classification, and definition of order is really what's at issue. 
Order and randomness are simply our perceptions of the world around 
us and our perception is pretty limited


Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 2:32 PM -0500 12/10/07, Nathan Nobbe wrote:

Random numbers with Gauss distribution (normal distribution).
A correct alghoritm. Without aproximations, like Smaaps'
It is specially usefull for simulations in physics.
Check yourself, and have a fun.
-snip-

JanS
student of astronomy
on Warsaw University


Thanks -- I am sure I will use that some time.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Incorporating a PHP/MySQL based search

2007-12-12 Thread tedd

At 5:36 PM -0500 12/8/07, Steve Finkelstein wrote:

Hey folks,

One area I lack experience in is writting a solution to index/search on a
site. Would anyone be kind enough and point me in the right direction as far
as any books which discuss some simple solutions or articles/blogs on the
web? Clearly I'm not looking for anything as complex as Google's engine, ;-)
but would love just to be able to understand/incorporate a decent level of
search capabilities.

Cheers all,

- sf



Steve:

If you don't want to do it yourself , try this:

http://sperling.com/examples/search/

It's very simple to do.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 5:15 PM -0500 12/10/07, Daniel Brown wrote:

   Just for fun, I decided to write out an algorithm to randomize
with a never-known seed that would update constantly, with no human or
external script intervention required to initiate or maintain it.



My guess is that if there was a time that this  did not 
exist, but now does exist, then it cannot be random. It may be random 
for a billion years, or more, but it would eventually repeat.


However, it something started at the instant of the big-bang, then 
its repeat cycle would be at least equal-to, or greater-than, known 
time and thus random.


Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regular expressions

2007-12-12 Thread tedd

At 2:04 AM -0500 12/12/07, Robert Cummings wrote:



Cheers,
Rob.


Rob:

You are a never ending supply for great snip-its!

Thanks,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 3:04 PM -0500 12/10/07, Daniel Brown wrote:

On Dec 10, 2007 2:28 PM, AmirBehzad Eslami <[EMAIL PROTECTED]> wrote:

 For some computer-based simulation, i need to
 generate random numbers that have a normal distribution.

[snip!]

Unfortunately, because computers are logical, there's no such
thing (at least as of yet) as a truly random number being generated by
a machine.

--
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]


Unless the computer is tied to a peripheral that samples nature.

In my ancient past I worked with a x-ray detector and we simply 
truncated to the tens digit -- that was pretty random.


tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Daniel Brown
On Dec 12, 2007 9:00 AM, tedd <[EMAIL PROTECTED]> wrote:
> At 3:04 PM -0500 12/10/07, Daniel Brown wrote:
> > Unfortunately, because computers are logical, there's no such
> >thing (at least as of yet) as a truly random number being generated by
> >a machine.

> Unless the computer is tied to a peripheral that samples nature.

In which case the random number is not being generated by the
computer, but rather derived from data interpreted from nature.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: running cmd via php

2007-12-12 Thread Daniel Brown
On Dec 11, 2007 9:20 PM, Stephen Johnson <[EMAIL PROTECTED]> wrote:
> Google : php exexcute windows commands
>
> You can even hit the "I'm feeling lucky button." ;)

I was actually going to say the exact same thing. ;-P

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mysqli support - test or complain? [SOLVED]

2007-12-12 Thread Nathan Nobbe
On Dec 12, 2007 4:47 AM, Per Jessen <[EMAIL PROTECTED]> wrote:

> Robert Cummings wrote:
>
> >> I can't remember what sort of environment the OP was in, but if any
> >> sort of organised testing is done, the use of two different APIs will
> >> just about double the test-effort.  Which is why I still think the
> >> best option is to mandate _one_ of the APIs and choose your hoster
> >> accordingly.
> >
> > Well if you write unit tests, having the unit tests applied to one or
> > the other is the same amount of work since it just requires a switch
> > to change between mysql and mysqli.
>
> Regardless of how you do it, it's twice the amount of work to run a test
> twice.
>

actually its really not a big deal to actually run a test a couple of times.
supporting multiple libraries will add flexibility, but always with
flexibility there
is the cost of additional complexity (this can take many forms).
in regard to unit tests, the extra effort would be spent actually writing
both
unit tests.  however, once the first one is written the second one should be
pretty easy, especially if they are both coded against an abstract database
interface.  it could even make sense to write one test against an abstract
class
then create concrete subclasses for each specific library.  then in the
future
adding a test for, say postgre, would be trivial.

-nathan


Re: [PHP] Mysqli support - test or complain? [SOLVED]

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 10:47 +0100, Per Jessen wrote:
> Robert Cummings wrote:
> 
> >> I can't remember what sort of environment the OP was in, but if any
> >> sort of organised testing is done, the use of two different APIs will
> >> just about double the test-effort.  Which is why I still think the
> >> best option is to mandate _one_ of the APIs and choose your hoster
> >> accordingly.
> > 
> > Well if you write unit tests, having the unit tests applied to one or
> > the other is the same amount of work since it just requires a switch
> > to change between mysql and mysqli.
> 
> Regardless of how you do it, it's twice the amount of work to run a test
> twice.

No, it's twice the amount of time to run the test a second time. But if
it's a unit test it's time you can be doing something else... or maybe
when you install PHP from source you sit there and watch the unit tests
run at the end? I go and do something else in another window. The whole
point of unit tests is to automate testing things so that there's "less"
work to do.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to install ISAPI version on Vista IIS 6

2007-12-12 Thread SED
That's right. I'm running IIS 7 not IIS 6. I was to fast reading the
"version 6" in the about box.

I found out I needed to setup the IIS 7 with ISAPImodule specially. I found
that out by expanding the IIS7-setup-option-tree to the bottom. They at
Microsoft are very clever to "hide" this, ASP vs. PHP

Maybe I'll make a webpage to explain this and post it here. This took to
much time to find out and I found no throughout guidance on the web.

SED

-Original Message-
From: Andrés Robinet [mailto:[EMAIL PROTECTED] 
Sent: 12. desember 2007 05:05
To: 'SED'
Cc: php-general@lists.php.net
Subject: RE: [PHP] How to install ISAPI version on Vista IIS 6

I think I found a solution for you... or at least a step closer. One
correction though, you are likely running IIS 7.0 and not IIS 6.0, right?

Check this out
http://www.phpbuilder.com/board/showthread.php?t=10344435&highlight=php+5.2.
3 It seems that the default installation of windows IIS 7.0 for Vista does
not include the CGI and ISAPI modules. You need to include at least the one
you'll be using for PHP, I guess ISAPI but I've read about some problems
with extensions, so... give it a try, it's a pity I don't have a Vista box
to try it and tell you.

Anyway... hope you manage to get it installed, and when you do... POST IT
BACK, there will surely be other people willing to know about it in this
list.

Rob


Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308
| TEL 954-607-4207 | FAX 954-337-2695
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
bestplace |  Web: http://www.bestplace.biz | Web: http://www.seo-diy.com

> -Original Message-
> From: SED [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 12, 2007 1:44 AM
> To: 'Andrés Robinet'
> Cc: php-general@lists.php.net
> Subject: RE: [PHP] How to install ISAPI version on Vista IIS 6
> 
> Hi Rob,
> 
> I'm not offended, I'm pistoff with Microsoft. Paying so much for VISTA
> and
> so many troubles and so litle support...  I have other computers
> running
> various others systems but I need to solve this case.
> 
> Your comment, only makes me smile, over how stupid I was to pay for
> Vista.
> 
> Regards,
> SED
> 
> -Original Message-
> From: Andrés Robinet [mailto:[EMAIL PROTECTED]
> Sent: 12. desember 2007 04:08
> To: php-general@lists.php.net
> Subject: RE: [PHP] How to install ISAPI version on Vista IIS 6
> 
> > -Original Message-
> > From: SED [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, December 12, 2007 12:25 AM
> > To: php-general@lists.php.net
> > Subject: [PHP] How to install ISAPI version on Vista IIS 6
> >
> > Hello,
> >
> >
> >
> > I'm running Vista Ultimate on my computer with IIS 6.0.
> >
> >
> >
> > I'm trying to manually install PHP 5 (ISAPI) on IIS but in the
> "Handler
> > mappings" I get this message:
> >
> >
> >
> > "One or more of the modules specified for this handler does not exist
> > in the
> > modules list. If you are trying to add a script map the IsapiModule
> or
> > the
> > CgiModule is not prensent in the modules list."
> >
> >
> >
> > I have Googled this but did not find any answers. Even on php.net
> there
> > is
> > no mention on Vista.
> >
> >
> >
> > Can you point me to guidance for installing PHP 5 on Vista running
> IIS
> > 6.0?
> >
> >
> >
> > Regards,
> >
> > SED
> >
> 
> Hope you don't get offended but... check
> http://www.apple.com/getamac/ads/
> (the last one "choose a vista" is very instructive).
> I've never had a Mac, but I've laughed a lot... and I'm every day
> thinking
> more and more certain of not upgrading my XP. Hope you smile at least
> for 30
> seconds. :)
> 
> Rob
> 
> 
> Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
> 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL
> 33308
> | TEL 954-607-4207 | FAX 954-337-2695
> Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
> bestplace |  Web: http://www.bestplace.biz | Web: http://www.seo-
> diy.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 09:00 -0500, tedd wrote:
> At 3:04 PM -0500 12/10/07, Daniel Brown wrote:
> >On Dec 10, 2007 2:28 PM, AmirBehzad Eslami <[EMAIL PROTECTED]> wrote:
> >>  For some computer-based simulation, i need to
> >>  generate random numbers that have a normal distribution.
> >[snip!]
> >
> > Unfortunately, because computers are logical, there's no such
> >thing (at least as of yet) as a truly random number being generated by
> >a machine.
> >
> >--
> >Daniel P. Brown
> >[Phone Numbers Go Here!]
> >[They're Hidden From View!]
> 
> Unless the computer is tied to a peripheral that samples nature.
> 
> In my ancient past I worked with a x-ray detector and we simply 
> truncated to the tens digit -- that was pretty random.

Random seeming you mean. As mentioned in the original post, just because
the timeline and sample space is immense doesn't make it random, it just
makes it difficult to guess. In fact, someone already mentioned the case
of computers in casinos that can predict the landing spot of a roulette
ball.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 09:00 -0500, tedd wrote:
> At 2:22 PM -0600 12/10/07, Jay Blanchard wrote:
> >
> >Without order there cannot be randomness.
> 
> Without randomness, you wouldn't know what order was.

You're random with disorder.

> This is one of those yin-yang things.

Not really :)

> There is simply order and randomness existing in our minds. There is 
> no order, nor randomness, existing in nature, it's our perception, 
> clarification, and categorization of nature that demands attributes 
> be assigned to artificial groupings of identity threshold exceeding 
> objects. In other words, we decide on what IT is and then assign 
> order to IT.

Your statement is contradictory. If there is no randomness in nature
then there is no randomness in our minds since we are inherently a part
of nature-- yes even when we leave plastic lying around everywhere. We
aren't the only creatures in nature to make toxic messes (there's a
reason that you can't gain a higher alcohol concentration than about 18%
through the fermentation process).

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 09:15 -0500, tedd wrote:
> At 2:46 PM -0500 12/10/07, Robert Cummings wrote:
> >On Mon, 2007-12-10 at 11:37 -0800, Stephen Johnson wrote:
> >>  True randomization is only really possible in nature.
> >
> >Can you say for certain nature is truly random? Just because the seed
> >may have occurred 13.7 billion years ago and we don't know what that
> >initial state was and we couldn't possibly calculate all the
> >interactions since, doesn't mean that everything since hasn't been
> >happening in accordance with some universal formula and in absence of
> >randomness. We know that there appear to be certain laws in physics,
> >would they not have applied to that initial state in a non random
> >manner? It may just be that due to the hugantic sample space from which
> >to draw arbitrary values that we think things are random.
> >
> >Food for thought :)
> >
> >Cheers,
> >Rob.
> 
> Rob:
> 
> You most certainly have a point there. Our identification, 
> classification, and definition of order is really what's at issue. 
> Order and randomness are simply our perceptions of the world around 
> us and our perception is pretty limited

Did you just answer your queue of posts in reverse chronological
order? :)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robin Vickery
On 12/12/2007, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On Dec 12, 2007 9:00 AM, tedd <[EMAIL PROTECTED]> wrote:
> > At 3:04 PM -0500 12/10/07, Daniel Brown wrote:
> > > Unfortunately, because computers are logical, there's no such
> > >thing (at least as of yet) as a truly random number being generated by
> > >a machine.
>
> > Unless the computer is tied to a peripheral that samples nature.
>
> In which case the random number is not being generated by the
> computer, but rather derived from data interpreted from nature.

Can you define for me where the machine stops and nature starts?

I mean, if I make a clock that uses the physical properties of a
pendulum to demarcate units of time then the pendulum is obviously
part of the machine.

But if I make a computer that uses the physical properties of a
radio-isotope to generate random numbers, you seem to be be saying
that the radio-isotope is not part of the machine, but instead part of
nature.

-robin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 08:59 -0500, tedd wrote:
> At 5:15 PM -0500 12/10/07, Daniel Brown wrote:
> >Just for fun, I decided to write out an algorithm to randomize
> >with a never-known seed that would update constantly, with no human or
> >external script intervention required to initiate or maintain it.
> 
> 
> My guess is that if there was a time that this  did not 
> exist, but now does exist, then it cannot be random. It may be random 
> for a billion years, or more, but it would eventually repeat.
> 
> However, it something started at the instant of the big-bang, then 
> its repeat cycle would be at least equal-to, or greater-than, known 
> time and thus random.

Just because something doesn't repeat doesn't make it random. It may be
that Pi never repeats and yet we know it is not random.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 10:15 -0500, Robert Cummings wrote:
> On Wed, 2007-12-12 at 09:00 -0500, tedd wrote:
> > At 2:22 PM -0600 12/10/07, Jay Blanchard wrote:
> > >
> > >Without order there cannot be randomness.
> > 
> > Without randomness, you wouldn't know what order was.
> 
> You're random with disorder.

That should have said "You're confusing random with disorder.". But
maybe Tedd is also a bit random and disorderly ;)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Jay Blanchard
[snip]
But maybe Tedd is also a bit random and disorderly ;)
[/snip]

Maybe? 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Daniel Brown
On Dec 12, 2007 10:53 AM, Robin Vickery <[EMAIL PROTECTED]> wrote:
> Can you define for me where the machine stops and nature starts?
>
> I mean, if I make a clock that uses the physical properties of a
> pendulum to demarcate units of time then the pendulum is obviously
> part of the machine.
>
> But if I make a computer that uses the physical properties of a
> radio-isotope to generate random numbers, you seem to be be saying
> that the radio-isotope is not part of the machine, but instead part of
> nature.

When a pendulum swings, it's slowed, stopped, and reverses
direction based upon the equal-opposite force from a combination of
gravity and the machine to which it's attached.  It is then a part of
the machine.

A radioactive isotope will decay on its own, regardless of
influence from the machine with which it is being monitored.

So your argument, creating a likeness between two unrelated parts,
is equivalent to saying that all of nature is potentially part of all
machines.

If I want to turn on a light at random, I could attach an X10
motion detector to a tree in the woods.  When a deer happens to walk
by, it would trip the motion detector and activate the receiver, which
would then allow electricity to flow and power the lamp.  By your
definition (and please don't take this message as accusatory, it's
simply for the love of argument, not a personal attack as some would
believe), the deer is then part of the machine, despite it's
predetermined and/or externally-influenced (hunting season!) choice of
path.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Daniel Brown
On Dec 12, 2007 11:04 AM, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> [snip]
> But maybe Tedd is also a bit random and disorderly ;)
> [/snip]
>
> Maybe?
>

In Tedd's defense, there's a fine line between genius and
insanity, and he keeps getting closer and closer to that genius side.
;-P

I don't think any of us have the right to claim insanity for
another when we ourselves are probably not very well-balanced.  If the
pot calls the kettle black, then it's time to get a new pot that
doesn't talk, because that would kinda' freak me out a bit.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] issues with imap_qprint()

2007-12-12 Thread Max Frigge

Hey there,

I try to decode the subjects of an email with German umlaute (öäü ..),
which are encoded in in quoted printable.

For Example ... the string "Gr=FC=DFen" has to be converted to "Grüßen".

I tried it with a little example and it worked fine:



But when i implement the imap_qprint function into the real script,
in which i read the email header information it writes something like  
this:


"=?ISO-8859-1?Q?Grüßen?"

So it decodes right but it puts this ugly iso code info
around the result. It's kinda wired because i use it exactly
the way I did in the example shown above.

Is there any way to avoid this or a build in function to strip
that crap??

greets,
Max

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 11:16 -0500, Daniel Brown wrote:
> On Dec 12, 2007 10:53 AM, Robin Vickery <[EMAIL PROTECTED]> wrote:
> > Can you define for me where the machine stops and nature starts?
> >
> > I mean, if I make a clock that uses the physical properties of a
> > pendulum to demarcate units of time then the pendulum is obviously
> > part of the machine.
> >
> > But if I make a computer that uses the physical properties of a
> > radio-isotope to generate random numbers, you seem to be be saying
> > that the radio-isotope is not part of the machine, but instead part of
> > nature.
> 
> When a pendulum swings, it's slowed, stopped, and reverses
> direction based upon the equal-opposite force from a combination of
> gravity and the machine to which it's attached.  It is then a part of
> the machine.
> 
> A radioactive isotope will decay on its own, regardless of
> influence from the machine with which it is being monitored.
> 
> So your argument, creating a likeness between two unrelated parts,
> is equivalent to saying that all of nature is potentially part of all
> machines.
> 
> If I want to turn on a light at random, I could attach an X10
> motion detector to a tree in the woods.  When a deer happens to walk
> by, it would trip the motion detector and activate the receiver, which
> would then allow electricity to flow and power the lamp.  By your
> definition (and please don't take this message as accusatory, it's
> simply for the love of argument, not a personal attack as some would
> believe), the deer is then part of the machine, despite it's
> predetermined and/or externally-influenced (hunting season!) choice of
> path.

The universe is the machine... all sub machines are part of the greater
machine that is the universe.

As such, the deer is indeed part of the machine as are the decaying
isotopes that were probably formed in some process of the universe.
Whether that be the internal reactor of a star or some other event.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Jochem Maas
Robert Cummings wrote:


> 
> The universe is the machine... all sub machines are part of the greater
> machine that is the universe.
> 

heh, that makes me a browser. :-P

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mysql DATE_FORMAT() question

2007-12-12 Thread Adam Williams

nevermind, I see I had a mistake in my mysql statement,  I should of been:

select DATE_FORMAT(testdate, '%m\-%d\-%Y') as date_column from testtable;

please disregard.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mysql DATE_FORMAT() question

2007-12-12 Thread Adam Williams

I ran the commands:

CREATE TABLE testtable ( testdate DATETIME);

INSERT INTO testtable (testdate) VALUES (now());

and then I want to select it but format it to show the date only (not 
the time, and yes I know I could use DATE instead of DATETIME, but there 
may be cases where I need to show the time also).  So I run:


select DATE_FORMAT(testdate, '%m\-%d\-%Y') from testtable AS date_column;
+-+
| DATE_FORMAT(testdate, '%m\-%d\-%Y') |
+-+
| 12-12-2007  |
+-+


now my question is, why is the column heading DATE_FORMAT(testdate, 
'%m\-%d\-%Y') even though I told it to be called date_column?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Daniel Brown
On Dec 12, 2007 11:26 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> The universe is the machine... all sub machines are part of the greater
> machine that is the universe.
>
> As such, the deer is indeed part of the machine as are the decaying
> isotopes that were probably formed in some process of the universe.
> Whether that be the internal reactor of a star or some other event.

I completely agree, and I was waiting for someone to throw in the
Grand Scheme concept (no surprise that it's you, Cummings!  ;-P), but
that's beyond the scope of the "machine" we're discussing.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] determine date range

2007-12-12 Thread slith
I'm working on hotel type booking script where prices will vary 
depending on the season. prices are updated every year so i need to take 
a user inputed date and determine which season the date falls under.


i figured i can convert all dates into a timestamp and then run a series 
conditional statements to see which returns true.


something like this:

// date ranges
$dates[1]['start'] = mktime(0, 0, 0, '01', '04', date('Y'));
$dates[1]['end'] = mktime(0, 0, 0, '04', '14', date('Y'));  

$dates[2]['start'] = mktime(0, 0, 0, '04', '15', date('Y'));
$dates[2]['end'] = mktime(0, 0, 0, '08', '18', date('Y'));  

$dates[3]['start'] = mktime(0, 0, 0, '08', '19', date('Y'));
$dates[3]['end'] = mktime(0, 0, 0, '12', '23', date('Y'));  

$dates[4]['start'] = mktime(0, 0, 0, '12', '14', date('Y'));
$dates[4]['end'] = mktime(0, 0, 0, '01', '03', date('Y') + 1);  

// tstamp is user inputed date
if($tstamp >= $dates[1]['start'] && $tstamp <= $dates[1]['end']){
return 1;
}

if($tstamp >= $dates[2]['start'] && $tstamp <= $dates[2]['end']){
return 2;   
}

if($tstamp >= $dates[3]['start'] && $tstamp <= $dates[3]['end']){
return 3;
}

if($tstamp >= $dates[4]['start'] && $tstamp <= $dates[4]['end']){
return 4;   
}


now, not sure why this isn't working...but it's not returning true for 
any of these.


also i'm realizing i need to account for people who decide to book a 
date a year ahead, in which case this approach will break since all 
timestamp date ranges (except for $date[4]['end']) are set to the 
current year.


any suggestions on how i should approach this problem?




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Jason Pruim


On Dec 12, 2007, at 11:31 AM, Daniel Brown wrote:

On Dec 12, 2007 11:26 AM, Robert Cummings <[EMAIL PROTECTED]>  
wrote:
The universe is the machine... all sub machines are part of the  
greater

machine that is the universe.

As such, the deer is indeed part of the machine as are the decaying
isotopes that were probably formed in some process of the universe.
Whether that be the internal reactor of a star or some other event.


   I completely agree, and I was waiting for someone to throw in the
Grand Scheme concept (no surprise that it's you, Cummings!  ;-P), but
that's beyond the scope of the "machine" we're discussing.



And since when did "scope" ever stop anything on this list?

BTW Deer taste good *Gets ready to duck from all the non-deer eating  
people*



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 11:43 -0500, Jason Pruim wrote:
> On Dec 12, 2007, at 11:31 AM, Daniel Brown wrote:
> 
> > On Dec 12, 2007 11:26 AM, Robert Cummings <[EMAIL PROTECTED]>  
> > wrote:
> >> The universe is the machine... all sub machines are part of the  
> >> greater
> >> machine that is the universe.
> >>
> >> As such, the deer is indeed part of the machine as are the decaying
> >> isotopes that were probably formed in some process of the universe.
> >> Whether that be the internal reactor of a star or some other event.
> >
> >I completely agree, and I was waiting for someone to throw in the
> > Grand Scheme concept (no surprise that it's you, Cummings!  ;-P), but
> > that's beyond the scope of the "machine" we're discussing.
> >
> 
> And since when did "scope" ever stop anything on this list?
> 
> BTW Deer taste good *Gets ready to duck from all the non-deer eating  
> people*

I have some deer sirloins in the freezer, great on the BBQ.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] determine date range

2007-12-12 Thread Andrew Ballard
On Dec 12, 2007 11:39 AM, slith <[EMAIL PROTECTED]> wrote:
> I'm working on hotel type booking script where prices will vary
> depending on the season. prices are updated every year so i need to take
> a user inputed date and determine which season the date falls under.
>
> i figured i can convert all dates into a timestamp and then run a series
> conditional statements to see which returns true.
>
> something like this:
>
> // date ranges
> $dates[1]['start'] = mktime(0, 0, 0, '01', '04', date('Y'));
> $dates[1]['end'] = mktime(0, 0, 0, '04', '14', date('Y'));
>
> $dates[2]['start'] = mktime(0, 0, 0, '04', '15', date('Y'));
> $dates[2]['end'] = mktime(0, 0, 0, '08', '18', date('Y'));
>
> $dates[3]['start'] = mktime(0, 0, 0, '08', '19', date('Y'));
> $dates[3]['end'] = mktime(0, 0, 0, '12', '23', date('Y'));
>
> $dates[4]['start'] = mktime(0, 0, 0, '12', '14', date('Y'));
> $dates[4]['end'] = mktime(0, 0, 0, '01', '03', date('Y') + 1);
>
> // tstamp is user inputed date
> if($tstamp >= $dates[1]['start'] && $tstamp <= $dates[1]['end']){
> return 1;
> }
>
> if($tstamp >= $dates[2]['start'] && $tstamp <= $dates[2]['end']){
> return 2;
> }
>
> if($tstamp >= $dates[3]['start'] && $tstamp <= $dates[3]['end']){
> return 3;
> }
>
> if($tstamp >= $dates[4]['start'] && $tstamp <= $dates[4]['end']){
> return 4;
> }
>
>
> now, not sure why this isn't working...but it's not returning true for
> any of these.
>
> also i'm realizing i need to account for people who decide to book a
> date a year ahead, in which case this approach will break since all
> timestamp date ranges (except for $date[4]['end']) are set to the
> current year.
>
> any suggestions on how i should approach this problem?
>
>
>
>

Will the boundary dates for each season change from one year to the
next? If so, I would probably store the seasons in a database table
and then just query from that table where the user-entered date is
between the season start and end dates. The table of seasons could
have dates configured as far out into the future as desired. If the
boundary dates are the same every year, you can ignore the year and
just compare the month/day of the user-entered date with the month/day
of the season boundaries.

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 17:50 +0100, Jochem Maas wrote:
> Robert Cummings wrote:
> 
> 
> > 
> > The universe is the machine... all sub machines are part of the greater
> > machine that is the universe.
> > 
> 
> heh, that makes me a browser. :-P

Not IE I hope :B

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Install syck on PHP4

2007-12-12 Thread GoWtHaM NaRiSiPaLli
I am trying to install php4-syck but there is no package for it on apt
repository on ubuntu. So I got the .deb package and did
#dpkg -i php4-syck.x.deb
it installed the package and I restarted the apache webserver and tried to
run syck_load() function. It throws me an error that the function is not
found.

What else needs to be done to make this work.

Thanks
GTM


Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 3:13 PM +0100 12/12/07, Jochem Maas wrote:

tedd wrote:

 At 5:15 PM -0500 12/10/07, Daniel Brown wrote:

Just for fun, I decided to write out an algorithm to randomize
 with a never-known seed that would update constantly, with no human or
 external script intervention required to initiate or maintain it.



 My guess is that if there was a time that this  did not exist,
 but now does exist, then it cannot be random. It may be random for a
 billion years, or more, but it would eventually repeat.

 However, it something started at the instant of the big-bang, then its
 repeat cycle would be at least equal-to, or greater-than, known time and
 thus random.

 Cheers,

 tedd


tedd your as sick as Rob :-)


Thank you. That puts me in good company.

Sick minds think alike.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] determine date range

2007-12-12 Thread slith
yes, i was trying to keep things simple and avoid using a database but i 
think may go that route like you suggested.


Andrew Ballard wrote:



Will the boundary dates for each season change from one year to the
next? If so, I would probably store the seasons in a database table
and then just query from that table where the user-entered date is
between the season start and end dates. The table of seasons could
have dates configured as far out into the future as desired. If the
boundary dates are the same every year, you can ignore the year and
just compare the month/day of the user-entered date with the month/day
of the season boundaries.

Andrew


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Incorporating a PHP/MySQL based search

2007-12-12 Thread Steve Finkelstein
Thanks Tedd... looks like a promising link. I'll take a look!

On 12/12/07, tedd <[EMAIL PROTECTED]> wrote:
>
> At 5:36 PM -0500 12/8/07, Steve Finkelstein wrote:
> >Hey folks,
> >
> >One area I lack experience in is writting a solution to index/search on a
> >site. Would anyone be kind enough and point me in the right direction as
> far
> >as any books which discuss some simple solutions or articles/blogs on the
> >web? Clearly I'm not looking for anything as complex as Google's engine,
> ;-)
> >but would love just to be able to understand/incorporate a decent level
> of
> >search capabilities.
> >
> >Cheers all,
> >
> >- sf
>
>
> Steve:
>
> If you don't want to do it yourself , try this:
>
> http://sperling.com/examples/search/
>
> It's very simple to do.
>
> Cheers,
>
> tedd
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>


Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 10:12 AM -0500 12/12/07, Robert Cummings wrote:

On Wed, 2007-12-12 at 08:59 -0500, tedd wrote:

 At 5:15 PM -0500 12/10/07, Daniel Brown wrote:
 >Just for fun, I decided to write out an algorithm to randomize
 >with a never-known seed that would update constantly, with no human or
 >external script intervention required to initiate or maintain it.


 [1]My guess is that if there was a time that this  did not
 exist, but now does exist, then it cannot be random. It may be random
 for a billion years, or more, but it would eventually repeat.

 [2]However, it something started at the instant of the big-bang, then
 its repeat cycle would be at least equal-to, or greater-than, known
 time and thus random.


Just because something doesn't repeat doesn't make it random. It may be
that Pi never repeats and yet we know it is not random.

Cheers,
Rob.



Yes, that's a good observation, but look to rule [1] -- when did Pi come about?

Again, it's one of those food for thought arguments.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] zlib and fopen and stream_filter_append, prebuffer read errors help

2007-12-12 Thread Bob Sabiston

Hello,

  I'm trying to read some zlib-compressed data from a regular binary  
file.  When I try to attach the zlib compression filter, I am getting  
an error:  something about how the prebuffered data didn't work with  
the filter and so the filter wasn't added to the filter chain.



I looked and found a way to turn off buffering for stream *writes*,  
but not for stream reads.  Can anyone help with ideas for why this  
isn't working?  I posted questions to comp.lang.php and received no  
response.


Thanks
Bob

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 11:43 AM -0500 12/12/07, Jason Pruim wrote:

*Gets ready to duck from all the non-deer eating people*


Drat!

There are lot's of things that are non-deer -- even ducks. But they 
don't all eat people.


The world is getting out of whack again.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 10:04 AM -0600 12/12/07, Jay Blanchard wrote:

[snip]
But maybe Tedd is also a bit random and disorderly ;)
[/snip]

Maybe?


Hey!  I resemble that remark.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 11:00 AM -0500 12/12/07, Robert Cummings wrote:

On Wed, 2007-12-12 at 10:15 -0500, Robert Cummings wrote:

 On Wed, 2007-12-12 at 09:00 -0500, tedd wrote:
 > At 2:22 PM -0600 12/10/07, Jay Blanchard wrote:
 > >
 > >Without order there cannot be randomness.
 >
 > Without randomness, you wouldn't know what order was.

 You're random with disorder.


That should have said "You're confusing random with disorder.". But
maybe Tedd is also a bit random and disorderly ;)

Cheers,
Rob.


Yes, but what if my disorder was random?

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 10:18 AM -0500 12/12/07, Robert Cummings wrote:

On Wed, 2007-12-12 at 09:15 -0500, tedd wrote:
 > You most certainly have a point there. Our identification,

 classification, and definition of order is really what's at issue.
 Order and randomness are simply our perceptions of the world around
 us and our perception is pretty limited


Did you just answer your queue of posts in reverse chronological
order? :)


It doesn't make any difference -- I'm stateless.

My opinion is always the same regardless of how many times I change it.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 10:17 AM -0500 12/12/07, Robert Cummings wrote:

 > In my ancient past I worked with a x-ray detector and we simply

 truncated to the tens digit -- that was pretty random.


Random seeming you mean. As mentioned in the original post, just because
the timeline and sample space is immense doesn't make it random, it just
makes it difficult to guess. In fact, someone already mentioned the case
of computers in casinos that can predict the landing spot of a roulette
ball.


Just because someone said it, doesn't mean it's true.

I remember in the old days where they used roulette wheels to 
generate random lists.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 10:15 AM -0500 12/12/07, Robert Cummings wrote:

On Wed, 2007-12-12 at 09:00 -0500, tedd wrote:
 > There is simply order and randomness existing in our minds. There is

 no order, nor randomness, existing in nature, it's our perception,
 clarification, and categorization of nature that demands attributes
 be assigned to artificial groupings of identity threshold exceeding
 objects. In other words, we decide on what IT is and then assign
 order to IT.


Your statement is contradictory. If there is no randomness in nature
then there is no randomness in our minds since we are inherently a part
of nature-- yes even when we leave plastic lying around everywhere. We
aren't the only creatures in nature to make toxic messes (there's a
reason that you can't gain a higher alcohol concentration than about 18%
through the fermentation process).

Cheers,
Rob.


Just because we come from nature, does not mean that our perception 
of randomness and order is forced upon Nature -- Nature is what 
Nature does.


Our minds are not complete (some less than others) and we do not have 
everything solved. It is part of our survival mechanism to understand 
the world around us and we are continually adding to our collective 
knowledge -- it's the great equalizer between us and other critters.


We've developed a system for observation and it's that system that is 
problematic in trying to determine and apply artificial terms for 
order and randomness. Granted it's a pretty good system, better than 
any other critters, but certainly not flawless.


I can look out over the Mojave desert and see tumbleweeds growing in 
cubic-closest packing (as I've done). I can reason and postulate why 
they grow that way, but the tumbleweeds don't give a hoot -- they 
just grow that way.


Just because we think, does not prove randomness, nor order, in 
nature -- it only proves that we think about it.


As for  plastic -- either Mother Nature will deal with plastic or 
we'll add another rock-type to the stratigraphic record.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Nathan Nobbe
On Dec 12, 2007 1:16 PM, tedd <[EMAIL PROTECTED]> wrote:

> At 10:17 AM -0500 12/12/07, Robert Cummings wrote:
> >  > In my ancient past I worked with a x-ray detector and we simply
> >>  truncated to the tens digit -- that was pretty random.
> >
> >Random seeming you mean. As mentioned in the original post, just because
> >the timeline and sample space is immense doesn't make it random, it just
> >makes it difficult to guess. In fact, someone already mentioned the case
> >of computers in casinos that can predict the landing spot of a roulette
> >ball.
>
> Just because someone said it, doesn't mean it's true.
>

pfft; just because you dont believe it doenst mean its false.  the show was
on
pbs.  there were 2 guys studying chaos theory.  its a typical story.  one
guy thinks
he can do it.. talks the other guy into dropping out of college, then they
really dig in.
basically they way it worked is, they could predict a portion of the wheel
where the
ball would land, not the exact position.  in fact they could get the result
within 1/8 of
the wheel.  this turned out to be very convenient, because they would bet on
an eighth
of the table size every time, whereas others would be on an exact position
of the table.
this appeared inconspicuous.  they then trained their people to make
conservative bets to
further avert attention.
if pbs had a database that actually worked, i would find the name of the
program and have
more specific details for you.

I remember in the old days where they used roulette wheels to
> generate random lists.
>

get with the times; these are the days of decaying isotopes :-O

-nathan


[PHP] apc and cli

2007-12-12 Thread Ravi Menon
Hi,

We have long running daemons written in php ( cli, non-apache
contexts) with the typical pattern:

while( !$shutdown )
{
$c = new SomeClass;

$c->process();
}

For performance reasons, would it help if apc.enable_cli is turned on:

  apc.enable_cli  integer

Mostly for testing and debugging. Setting this enables APC for the
CLI version of PHP. Normally you wouldn't want to create, populate and
tear down the APC cache on every CLI request, but for various test
scenarios it is handy to be able to enable APC for the CLI version of
APC easily.


I am slightly confused by the statement - 'Mostly for testing and
debugging.' .

On each loop iteration, does php recompile the code in 'SomeClass' (
and all its dependencies ) or it is really cached ( as it has seen the
class code once ).

If there is a php internals document on such issues, do let me know.

Thanks,
Ravi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] apc and cli

2007-12-12 Thread Nathan Nobbe
On Dec 12, 2007 2:33 PM, Ravi Menon <[EMAIL PROTECTED]> wrote:

> Hi,
>
> We have long running daemons written in php ( cli, non-apache
> contexts) with the typical pattern:
>
> while( !$shutdown )
> {
>$c = new SomeClass;
>
>$c->process();
> }
>
> For performance reasons, would it help if apc.enable_cli is turned on:
>
>  apc.enable_cli  integer
>
>Mostly for testing and debugging. Setting this enables APC for the
> CLI version of PHP. Normally you wouldn't want to create, populate and
> tear down the APC cache on every CLI request, but for various test
> scenarios it is handy to be able to enable APC for the CLI version of
> APC easily.
>
>
> I am slightly confused by the statement - 'Mostly for testing and
> debugging.' .
>
> On each loop iteration, does php recompile the code in 'SomeClass' (
> and all its dependencies ) or it is really cached ( as it has seen the
> class code once ).
>
> If there is a php internals document on such issues, do let me know.
>

i think the cache is alive for the duration of the parent process.
typically cli
scripts are brief.  however, if you have a long running cli script apc might
be
useful in the context of the cli.
ive been curious about this myself.  if anyone has a definitive answer, im
looking forward to it.

-nathan


Re: [PHP] Install syck on PHP4

2007-12-12 Thread Richard Lynch
On Wed, December 12, 2007 11:35 am, GoWtHaM NaRiSiPaLli wrote:
> I am trying to install php4-syck but there is no package for it on apt
> repository on ubuntu. So I got the .deb package and did
> #dpkg -i php4-syck.x.deb
> it installed the package and I restarted the apache webserver and
> tried to
> run syck_load() function. It throws me an error that the function is
> not
> found.
>
> What else needs to be done to make this work.

Always start by looking at output of:


I would make a WILD GUESS that you need to edit the php.ini mentioned
there and add a new line to enable the extension 'syck'

You'd think the fancy package installers would do that for you, but
they often make invalid assumptions about where your php.ini file
lives, and edit the wrong file, and...

If you get it right (don't forget to re-start Apace!) then you SHOULD
see 'syck' listed as an extension in your 

If it ain't listed, you didn't install it right.

You may also want to try to compile PHP and syck from source:
http://trac.symfony-project.com/wiki/InstallingSyck

I never even heard of syck until now, and only did the Google for you,
really...

The syck people and/or the Ubunty/Debian folks may be better prepared
to help you, depending on what is actually going wrong, as I doubt too
many readers here ever heard of syck either...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] apc and cli

2007-12-12 Thread Richard Lynch
On Wed, December 12, 2007 1:33 pm, Ravi Menon wrote:
> We have long running daemons written in php ( cli, non-apache
> contexts) with the typical pattern:
>
> while( !$shutdown )
> {
> $c = new SomeClass;
>
> $c->process();
> }
>
> For performance reasons, would it help if apc.enable_cli is turned on:
>
>   apc.enable_cli  integer
>
> Mostly for testing and debugging. Setting this enables APC for the
> CLI version of PHP. Normally you wouldn't want to create, populate and
> tear down the APC cache on every CLI request, but for various test
> scenarios it is handy to be able to enable APC for the CLI version of
> APC easily.
>
>
> I am slightly confused by the statement - 'Mostly for testing and
> debugging.' .
>
> On each loop iteration, does php recompile the code in 'SomeClass' (
> and all its dependencies ) or it is really cached ( as it has seen the
> class code once ).
>
> If there is a php internals document on such issues, do let me know.

The following is almost-for-sure correct, but I wouldn't swear in
court...

Step 0. Read PHP/HTML source code.
Step 1. PHP uses a 2-pass compiler and generates byte-code.
Step 2. The byte-code is then feed to the executer.
Step 3. Executer spews output (or crashes or whatever)

APC and other caches add a Step 1A., which stores the byte-code in RAM
under the filename (or full path, depending on config) as a key.

Therefore, adding APC will not affect in any way the "while" loop --
It's compiled once in Step 1, and that's it.

If you re-run the same script again and again, however, APC in CLI
might be able to keep the script around and avoid a hit to the disk to
LOAD the script (Step 0 above) as well as avoiding the 2-pass
compilation to byte-code (Step 1 above).

NOTE:
Step 0 is the REALLY expensive step where APC et al are REALLY
boosting performance.

APC et al *could* just insert step 0A and store the PHP source, and
have ALMOST the same benefits.

However, storing the compiled version at Step 1A gets you some free
gravy in not re-compiling the PHP source to byte-code, so they do that
because, well, it's essentially FREE and saves a few more cpu cycles.

But the REAL boost, again, is from not hammering the hard drive (slow)
to load PHP source into RAM, Step 0.

PS
If you are really concerned about the constructor of SomeClass being
expensive, time it and see.

YOU may be doing something incredibly expensive there like
re-connecting to the database (slow!) each time.

You may also not even NEED a whole new SomeClass every time -- Perhaps
you could just make a singleton and then reset its values and call
process() with the new values instead of building up a whole new
instance each time.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] safe_mode_include_dir

2007-12-12 Thread Tony Beyers
I'm running php 5.2.5 with these settings in a virtualhost block in apache
2.0.61:

php_admin_flag safe_mode on
php_admin_value include_path "/afs/msu.edu/.../web"
php_admin_value safe_mode_include_dir "/afs/msu.edu/.../web"

I've got an index.php file in web/support/ that does a
require_once("../includes/support.php");

Being in afs with write access from multiple people, the uids of the files
do not match and I get an error stating that. So I put the
safe_mode_include_dir line above in but it did not fix the problem until I
used the absolute path in the require_once line.

Is there a way to include files with relative paths?

-- 
Tony


[PHP] safe_mode_include_dir

2007-12-12 Thread Tony Beyers
I'm running php 5.2.5 with these settings in a virtualhost block in
apache 2.0.61:
php_admin_flag safe_mode on
php_admin_value include_path "/afs/msu.edu/.../web"
php_admin_value safe_mode_include_dir "/afs/msu.edu/.../web"
I've got an index.php file in web/support/ that does a
require_once("../includes/support.php");
Being in afs with write access from multiple people, the uids of the
files do not match and I get an error stating that. So I put the
safe_mode_include_dir line above in but it did not fix the problem
until I used the absolute path in the require_once line.
Is there a way to include files with relative paths?

-- 
Tony

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 12:40 -0500, tedd wrote:
> At 10:12 AM -0500 12/12/07, Robert Cummings wrote:
> >On Wed, 2007-12-12 at 08:59 -0500, tedd wrote:
> >>  At 5:15 PM -0500 12/10/07, Daniel Brown wrote:
> >>  >Just for fun, I decided to write out an algorithm to randomize
> >>  >with a never-known seed that would update constantly, with no human or
> >>  >external script intervention required to initiate or maintain it.
> >>
> >>
> >>  [1]My guess is that if there was a time that this  did not
> >>  exist, but now does exist, then it cannot be random. It may be random
> >>  for a billion years, or more, but it would eventually repeat.
> >>
> >>  [2]However, it something started at the instant of the big-bang, then
> >>  its repeat cycle would be at least equal-to, or greater-than, known
> >>  time and thus random.
> >
> >Just because something doesn't repeat doesn't make it random. It may be
> >that Pi never repeats and yet we know it is not random.
> >
> >Cheers,
> >Rob.
> 
> 
> Yes, that's a good observation, but look to rule [1] -- when did Pi come 
> about?

You mean guess [1] :) At any rate I'm not sure how assertion [1] affects
the observation.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 13:16 -0500, tedd wrote:
> At 10:17 AM -0500 12/12/07, Robert Cummings wrote:
> >  > In my ancient past I worked with a x-ray detector and we simply
> >>  truncated to the tens digit -- that was pretty random.
> >
> >Random seeming you mean. As mentioned in the original post, just because
> >the timeline and sample space is immense doesn't make it random, it just
> >makes it difficult to guess. In fact, someone already mentioned the case
> >of computers in casinos that can predict the landing spot of a roulette
> >ball.
> 
> Just because someone said it, doesn't mean it's true.
> 
> I remember in the old days where they used roulette wheels to 
> generate random lists.

Seemingly random lists... We haven't proven random yet ;)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 13:18 -0500, tedd wrote:
> At 10:18 AM -0500 12/12/07, Robert Cummings wrote:
> >On Wed, 2007-12-12 at 09:15 -0500, tedd wrote:
> >  > You most certainly have a point there. Our identification,
> >>  classification, and definition of order is really what's at issue.
> >>  Order and randomness are simply our perceptions of the world around
> >>  us and our perception is pretty limited
> >
> >Did you just answer your queue of posts in reverse chronological
> >order? :)
> 
> It doesn't make any difference -- I'm stateless.
> 
> My opinion is always the same regardless of how many times I change it.

Contradiction. Change implies not the same. I'm sure your tongue was in
your cheek though when you wrote it :)

Cheers,
Rob
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 13:21 -0500, tedd wrote:
> At 11:00 AM -0500 12/12/07, Robert Cummings wrote:
> >On Wed, 2007-12-12 at 10:15 -0500, Robert Cummings wrote:
> >>  On Wed, 2007-12-12 at 09:00 -0500, tedd wrote:
> >>  > At 2:22 PM -0600 12/10/07, Jay Blanchard wrote:
> >>  > >
> >>  > >Without order there cannot be randomness.
> >>  >
> >>  > Without randomness, you wouldn't know what order was.
> >>
> >>  You're random with disorder.
> >
> >That should have said "You're confusing random with disorder.". But
> >maybe Tedd is also a bit random and disorderly ;)
> >
> >Cheers,
> >Rob.
> 
> Yes, but what if my disorder was random?

How could you prove it is random? Give me an example of something you
can put into disorder that doesn't use the premise of order? For
instance throwing a handful of sand into the air is expected to obey the
establish laws of physics. These laws of physics suggest order in the
universe even when we perceive disorder.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zlib and fopen and stream_filter_append, prebuffer read errors help

2007-12-12 Thread Richard Lynch
On Wed, December 12, 2007 11:28 am, Bob Sabiston wrote:
>I'm trying to read some zlib-compressed data from a regular binary
> file.  When I try to attach the zlib compression filter, I am getting
> an error:  something about how the prebuffered data didn't work with
> the filter and so the filter wasn't added to the filter chain.
>
>
> I looked and found a way to turn off buffering for stream *writes*,
> but not for stream reads.  Can anyone help with ideas for why this
> isn't working?  I posted questions to comp.lang.php and received no
> response.

If all else fails, you could just not use the fancy-pants new stream
and filter functions, and just use http://php.net/zlib directly on the
file.

It's also possible your zlib file is just plain corrupt, and neither
will work...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] safe_mode_include_dir

2007-12-12 Thread Daniel Brown
Tony,

Calm down.  It may take us 21 minutes to respond sometimes, but we
will.  No need to repost.  ;-P

On Dec 12, 2007 3:26 PM, Tony Beyers <[EMAIL PROTECTED]> wrote:
> I'm running php 5.2.5 with these settings in a virtualhost block in
> apache 2.0.61:
> php_admin_flag safe_mode on
> php_admin_value include_path "/afs/msu.edu/.../web"
> php_admin_value safe_mode_include_dir "/afs/msu.edu/.../web"
> I've got an index.php file in web/support/ that does a
> require_once("../includes/support.php");

Is there a specific reason you're using require_once() instead of
include_once() ?  There actually is a difference include() and
include_once() will only include the file if that line of code is
executed, whereas require() and require_once() will include the file
even if the line is inside of an if() {} block for which the
condition(s) are never matched.

> Being in afs with write access from multiple people, the uids of the
> files do not match and I get an error stating that. So I put the
> safe_mode_include_dir line above in but it did not fix the problem
> until I used the absolute path in the require_once line.
> Is there a way to include files with relative paths?

Of course there is.  For example, say you're in a laterally-equal
directory as one from which you want to include a file.



As long as you have permissions to read the files, you're good to
go.  My guess is that you may have done the relative linking
improperly.  Is the file actually `web/includes/support.php` called
from `web/index.php`?

The other thing I would suggest is making sure your target include
directory is a real directory and not a symlinked directory.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 13:13 -0500, tedd wrote:
> At 10:15 AM -0500 12/12/07, Robert Cummings wrote:
> >On Wed, 2007-12-12 at 09:00 -0500, tedd wrote:
> >  > There is simply order and randomness existing in our minds. There is
> >>  no order, nor randomness, existing in nature, it's our perception,
> >>  clarification, and categorization of nature that demands attributes
> >>  be assigned to artificial groupings of identity threshold exceeding
> >>  objects. In other words, we decide on what IT is and then assign
> >>  order to IT.
> >
> >Your statement is contradictory. If there is no randomness in nature
> >then there is no randomness in our minds since we are inherently a part
> >of nature-- yes even when we leave plastic lying around everywhere. We
> >aren't the only creatures in nature to make toxic messes (there's a
> >reason that you can't gain a higher alcohol concentration than about 18%
> >through the fermentation process).
> >
> >Cheers,
> >Rob.

> Just because we think, does not prove randomness, nor order, in 
> nature -- it only proves that we think about it.

Actually, order is proven. The fact that I can re-arrange objects into
an order proves it exists, the accuracy of the ordering may fall into
question, but not that they are ordered. It's random that can't be
proven.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zlib and fopen and stream_filter_append, prebuffer read errors help

2007-12-12 Thread Bob Sabiston


On Dec 12, 2007, at 2:31 PM, Richard Lynch wrote:


On Wed, December 12, 2007 11:28 am, Bob Sabiston wrote:

 I'm trying to read some zlib-compressed data from a regular binary
file.  When I try to attach the zlib compression filter, I am getting
an error:  something about how the prebuffered data didn't work with
the filter and so the filter wasn't added to the filter chain.


I looked and found a way to turn off buffering for stream *writes*,
but not for stream reads.  Can anyone help with ideas for why this
isn't working?  I posted questions to comp.lang.php and received no
response.


If all else fails, you could just not use the fancy-pants new stream
and filter functions, and just use http://php.net/zlib directly on the
file.

Sorry Richard for the double mail, I didn't have the list cc'd before...

How could I do that?  I thought the only way to use zlib in PHP was  
through the stream functions.





It's also possible your zlib file is just plain corrupt, and neither
will work...


But I am getting the error before I start to read -- it is not a zlib  
'file', it is a stretch of data within

an ordinary file that has been compressed with zlib.

Thanks
Bob


Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 1:33 PM -0500 12/12/07, Nathan Nobbe wrote:
On Dec 12, 2007 1:16 PM, tedd 
<[EMAIL PROTECTED]> wrote:

Just because someone said it, doesn't mean it's true.


pfft; just because you dont believe it doenst mean its false.


Nope, but I find it difficult o believe.


I remember in the old days where they used roulette wheels to
generate random lists.


get with the times; these are the days of decaying isotopes :-O


Just because I remember it, doesn't mean that I'm not with it. When I 
start forgetting, then you can say that.  :-)


I'm adding that the people who put the first man on the moon with 
their slide rules also used roulette wheels as random number 
generators.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 3:36 PM -0500 12/12/07, Robert Cummings wrote:

On Wed, 2007-12-12 at 13:18 -0500, tedd wrote:
 > My opinion is always the same regardless of how many times I change it.

Contradiction. Change implies not the same. I'm sure your tongue was in
your cheek though when you wrote it :)

Cheers,
Rob


Rob:

Yep, that's what it was meant to be.

When I worked for AT&T, we used to run cable from equipment bays to 
other equipment bays. I used to delight in telling the foreman "No 
matter how many times I cut this cable, it's still too short!"


Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 3:42 PM -0500 12/12/07, Robert Cummings wrote:

 > Yes, but what if my disorder was random?

How could you prove it is random? Give me an example of something you
can put into disorder that doesn't use the premise of order? For
instance throwing a handful of sand into the air is expected to obey the
establish laws of physics. These laws of physics suggest order in the
universe even when we perceive disorder.

Cheers,
Rob.


Yes, but now we're getting back to artificial rules of the mind. We 
perceive the laws of physics to work a certain way because we have 
established rules as to how they should work. But, what happens when 
they don't work? Then we change the rules. We are now at string 
theory and things still remain disordered. All our efforts to put 
order to things still fall short.


Also, when we do change our rules, nature hasn't changed. Nature 
hasn't suddenly changed to our view, but rather we change our 
thinking to adapt to observation. And it's in those terms of 
observation that order and disorder of things comes about and not in 
nature.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 3:35 PM -0500 12/12/07, Robert Cummings wrote:

On Wed, 2007-12-12 at 13:16 -0500, tedd wrote:

 At 10:17 AM -0500 12/12/07, Robert Cummings wrote:
 >  > In my ancient past I worked with a x-ray detector and we simply
 >>  truncated to the tens digit -- that was pretty random.
 >
 >Random seeming you mean. As mentioned in the original post, just because
 >the timeline and sample space is immense doesn't make it random, it just
 >makes it difficult to guess. In fact, someone already mentioned the case
 >of computers in casinos that can predict the landing spot of a roulette
 >ball.

 Just because someone said it, doesn't mean it's true.

 I remember in the old days where they used roulette wheels to
 generate random lists.


Seemingly random lists... We haven't proven random yet ;)

Cheers,
Rob.


Yeah, but we haven't proven order yet either. :-)

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread tedd

At 3:34 PM -0500 12/12/07, Robert Cummings wrote:

On Wed, 2007-12-12 at 13:13 -0500, tedd wrote:
 > Just because we think, does not prove randomness, nor order, in

 nature -- it only proves that we think about it.


Actually, order is proven. The fact that I can re-arrange objects into
an order proves it exists, the accuracy of the ordering may fall into
question, but not that they are ordered. It's random that can't be
proven.

Cheers,
Rob.


No, just because you can "re-arrange objects" to your definition of 
order does not mean they are ordered -- unless you are making one of 
those "begging the question" arguments (i.e., "I ordered it, 
therefore it's ordered").


Instead, I claim that you perceive order, when there is not, other 
than in your mind, and that's the point. One might claim that if you 
could order things, then they would remain ordered -- but nothing 
remains stagnant.


Furthermore, what you claim as ordered will not necessarily be "in 
order" by another observer. As such, "order" is an abstract concept 
of the mind, nothing else.


Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Daniel Brown
On Dec 12, 2007 3:42 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> How could you prove it is random? Give me an example of something you
> can put into disorder that doesn't use the premise of order? For
> instance throwing a handful of sand into the air is expected to obey the
> establish laws of physics. These laws of physics suggest order in the
> universe even when we perceive disorder.

Quite honestly, with as much as we're disproving about the laws of
physics, they should probably first be introduced as bills and then
voted upon by the community.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] safe_mode_include_dir

2007-12-12 Thread Tony Beyers
Sorry about the double posting. I thought I sent the first email
before I was subscribed.

I definitely should've pointed out that the code works with safe_mode
off so I know the paths are correct.

I'm actually not the author of the code. I'm a sys admin trying to
upgrade the site with safe_mode on.

The target directory is a real world readable directory.

On Dec 12, 2007 3:43 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
>Tony,
>
>Calm down.  It may take us 21 minutes to respond sometimes, but we
> will.  No need to repost.  ;-P
>
> On Dec 12, 2007 3:26 PM, Tony Beyers <[EMAIL PROTECTED]> wrote:
> > I'm running php 5.2.5 with these settings in a virtualhost block in
> > apache 2.0.61:
> > php_admin_flag safe_mode on
> > php_admin_value include_path "/afs/msu.edu/.../web"
> > php_admin_value safe_mode_include_dir "/afs/msu.edu/.../web"
> > I've got an index.php file in web/support/ that does a
> > require_once("../includes/support.php");
>
>Is there a specific reason you're using require_once() instead of
> include_once() ?  There actually is a difference include() and
> include_once() will only include the file if that line of code is
> executed, whereas require() and require_once() will include the file
> even if the line is inside of an if() {} block for which the
> condition(s) are never matched.
>
> > Being in afs with write access from multiple people, the uids of the
> > files do not match and I get an error stating that. So I put the
> > safe_mode_include_dir line above in but it did not fix the problem
> > until I used the absolute path in the require_once line.
> > Is there a way to include files with relative paths?
>
>Of course there is.  For example, say you're in a laterally-equal
> directory as one from which you want to include a file.
>
>
>
>As long as you have permissions to read the files, you're good to
> go.  My guess is that you may have done the relative linking
> improperly.  Is the file actually `web/includes/support.php` called
> from `web/index.php`?
>
>The other thing I would suggest is making sure your target include
> directory is a real directory and not a symlinked directory.
>
> --
> Daniel P. Brown
> [Phone Numbers Go Here!]
> [They're Hidden From View!]
>
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] safe_mode_include_dir

2007-12-12 Thread Andrés Robinet
> -Original Message-
> From: Tony Beyers [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 12, 2007 5:55 PM
> To: PHP General list
> Subject: Re: [PHP] safe_mode_include_dir
> 
> Sorry about the double posting. I thought I sent the first email
> before I was subscribed.
> 
> I definitely should've pointed out that the code works with safe_mode
> off so I know the paths are correct.
> 
> I'm actually not the author of the code. I'm a sys admin trying to
> upgrade the site with safe_mode on.
> 
> The target directory is a real world readable directory.
> 
> On Dec 12, 2007 3:43 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
> >Tony,
> >
> >Calm down.  It may take us 21 minutes to respond sometimes, but we
> > will.  No need to repost.  ;-P
> >
> > On Dec 12, 2007 3:26 PM, Tony Beyers <[EMAIL PROTECTED]> wrote:
> > > I'm running php 5.2.5 with these settings in a virtualhost block in
> > > apache 2.0.61:
> > > php_admin_flag safe_mode on
> > > php_admin_value include_path "/afs/msu.edu/.../web"
> > > php_admin_value safe_mode_include_dir
> "/afs/msu.edu/.../web"
> > > I've got an index.php file in web/support/ that does a
> > > require_once("../includes/support.php");
> >
> >Is there a specific reason you're using require_once() instead of
> > include_once() ?  There actually is a difference include() and
> > include_once() will only include the file if that line of code is
> > executed, whereas require() and require_once() will include the file
> > even if the line is inside of an if() {} block for which the
> > condition(s) are never matched.
> >
> > > Being in afs with write access from multiple people, the uids of
> the
> > > files do not match and I get an error stating that. So I put the
> > > safe_mode_include_dir line above in but it did not fix the problem
> > > until I used the absolute path in the require_once line.
> > > Is there a way to include files with relative paths?
> >
> >Of course there is.  For example, say you're in a laterally-equal
> > directory as one from which you want to include a file.
> >
> >
> >
> >As long as you have permissions to read the files, you're good to
> > go.  My guess is that you may have done the relative linking
> > improperly.  Is the file actually `web/includes/support.php` called
> > from `web/index.php`?
> >
> >The other thing I would suggest is making sure your target include
> > directory is a real directory and not a symlinked directory.
> >
> > --
> > Daniel P. Brown
> > [Phone Numbers Go Here!]
> > [They're Hidden From View!]
> >
> > If at first you don't succeed, stick to what you know best so that
> you
> > can make enough money to pay someone else to do it for you.
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Hi Tony,

Please keep in mind that the use of

php_admin_value include_path "/afs/msu.edu/.../web"

...will prevent a user from changing the include_path because of the "admin"
part (this is ok for the safe mode include dir, but not for the include_path
setting I think). So, I'd say you keep the safe_mode_include_dir, and change
the include path to:

php_value include_path "/afs/msu.edu/.../web"

Also, it is likely that while using relative paths you run into problems
because the "current directory" can be anything except the expected one, so
I'd rather use absolute paths (if it's my own code) or fix it using
.htaccess files (this is your case as you are a sysadmin) like this:

php_value include_path "/one/path;/another/path;./"

... but for that to work you must not use php_admin_value in the virtualhost
config (notice that this is not related to safe mode security, if safe_mode
is well configured, it doesn't mind what you are using as include_dir).

If anyone has more ideas... please throw them (and fix my errors).

Rob


Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308
| TEL 954-607-4207 | FAX 954-337-2695
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
bestplace |  Web: http://www.bestplace.biz | Web: http://www.seo-diy.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Andrés Robinet
> -Original Message-
> From: tedd [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 12, 2007 6:35 PM
> To: PHP General list
> Subject: RE: [PHP] Generating Random Numbers with Normal Distribution
> 
> At 3:42 PM -0500 12/12/07, Robert Cummings wrote:
> >  > Yes, but what if my disorder was random?
> >
> >How could you prove it is random? Give me an example of something you
> >can put into disorder that doesn't use the premise of order? For
> >instance throwing a handful of sand into the air is expected to obey
> the
> >establish laws of physics. These laws of physics suggest order in the
> >universe even when we perceive disorder.
> >
> >Cheers,
> >Rob.
> 
> Yes, but now we're getting back to artificial rules of the mind. We
> perceive the laws of physics to work a certain way because we have
> established rules as to how they should work. But, what happens when
> they don't work? Then we change the rules. We are now at string
> theory and things still remain disordered. All our efforts to put
> order to things still fall short.
> 
> Also, when we do change our rules, nature hasn't changed. Nature
> hasn't suddenly changed to our view, but rather we change our
> thinking to adapt to observation. And it's in those terms of
> observation that order and disorder of things comes about and not in
> nature.
> 
> Cheers,
> 
> tedd
> 
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


Ok... I guess you have too much free time to run into such a philosophical
meditation, lol. Anyway, being an existentialist and empiricist... I won't
believe in a random number until I see it, smell it, hear it, taste it and
touch it here and now! lol

Rob  

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308
| TEL 954-607-4207 | FAX 954-337-2695
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
bestplace |  Web: http://www.bestplace.biz | Web: http://www.seo-diy.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] temp tables mysql OT

2007-12-12 Thread tedd

Hi gang:

Another mysql question.

I would like to create a temporary table to perform searches.

From my main table, I need to exclude records that have certain 
fields that are null or empty; and then sort the final result.


I've spent over an hour looking at "How do I set up a temporary table 
in MySQL?" questions via Google with little help. My eyes and brain 
are blurry -- giving it up for tonight.


Anyone have a sample or a clear reference for me to review?

Thanks in advance guys.

Cheers,

tedd

PS: Watch someone (maybe everyone) jump on "This ain't a MySQL list."

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] zlib and fopen and stream_filter_append, prebuffer read errors help

2007-12-12 Thread Casey

Try gzuncompress();



On Dec 12, 2007, at 1:03 PM, Bob Sabiston <[EMAIL PROTECTED]>  
wrote:




On Dec 12, 2007, at 2:31 PM, Richard Lynch wrote:


On Wed, December 12, 2007 11:28 am, Bob Sabiston wrote:

I'm trying to read some zlib-compressed data from a regular binary
file.  When I try to attach the zlib compression filter, I am  
getting

an error:  something about how the prebuffered data didn't work with
the filter and so the filter wasn't added to the filter chain.


I looked and found a way to turn off buffering for stream *writes*,
but not for stream reads.  Can anyone help with ideas for why this
isn't working?  I posted questions to comp.lang.php and received no
response.


If all else fails, you could just not use the fancy-pants new stream
and filter functions, and just use http://php.net/zlib directly on  
the

file.
Sorry Richard for the double mail, I didn't have the list cc'd  
before...


How could I do that?  I thought the only way to use zlib in PHP was  
through the stream functions.





It's also possible your zlib file is just plain corrupt, and neither
will work...


But I am getting the error before I start to read -- it is not a  
zlib 'file', it is a stretch of data within

an ordinary file that has been compressed with zlib.

Thanks
Bob


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] temp tables mysql OT

2007-12-12 Thread Chris

tedd wrote:

Hi gang:

Another mysql question.

I would like to create a temporary table to perform searches.

 From my main table, I need to exclude records that have certain fields 
that are null or empty; and then sort the final result.


Should be possible without a temp table I think..

I've spent over an hour looking at "How do I set up a temporary table in 
MySQL?" questions via Google with little help. My eyes and brain are 
blurry -- giving it up for tonight.


create temporary table tablename (
 
);

same as normal but put the 'temporary' in there :)

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] apc and cli

2007-12-12 Thread Ravi Menon
Thanks for clarifying my doubts - the steps below sounds right to me.

I was just considering the overall perf. of such php daemons and
whether we can get some free perf. boost
with that apc setting.

Ravi


On Dec 12, 2007 12:19 PM, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> On Wed, December 12, 2007 1:33 pm, Ravi Menon wrote:
> > We have long running daemons written in php ( cli, non-apache
> > contexts) with the typical pattern:
> >
> > while( !$shutdown )
> > {
> > $c = new SomeClass;
> >
> > $c->process();
> > }
> >
> > For performance reasons, would it help if apc.enable_cli is turned on:
> >
> >   apc.enable_cli  integer
> >
> > Mostly for testing and debugging. Setting this enables APC for the
> > CLI version of PHP. Normally you wouldn't want to create, populate and
> > tear down the APC cache on every CLI request, but for various test
> > scenarios it is handy to be able to enable APC for the CLI version of
> > APC easily.
> >
> >
> > I am slightly confused by the statement - 'Mostly for testing and
> > debugging.' .
> >
> > On each loop iteration, does php recompile the code in 'SomeClass' (
> > and all its dependencies ) or it is really cached ( as it has seen the
> > class code once ).
> >
> > If there is a php internals document on such issues, do let me know.
>
> The following is almost-for-sure correct, but I wouldn't swear in
> court...
>
> Step 0. Read PHP/HTML source code.
> Step 1. PHP uses a 2-pass compiler and generates byte-code.
> Step 2. The byte-code is then feed to the executer.
> Step 3. Executer spews output (or crashes or whatever)
>
> APC and other caches add a Step 1A., which stores the byte-code in RAM
> under the filename (or full path, depending on config) as a key.
>
> Therefore, adding APC will not affect in any way the "while" loop --
> It's compiled once in Step 1, and that's it.
>
> If you re-run the same script again and again, however, APC in CLI
> might be able to keep the script around and avoid a hit to the disk to
> LOAD the script (Step 0 above) as well as avoiding the 2-pass
> compilation to byte-code (Step 1 above).
>
> NOTE:
> Step 0 is the REALLY expensive step where APC et al are REALLY
> boosting performance.
>
> APC et al *could* just insert step 0A and store the PHP source, and
> have ALMOST the same benefits.
>
> However, storing the compiled version at Step 1A gets you some free
> gravy in not re-compiling the PHP source to byte-code, so they do that
> because, well, it's essentially FREE and saves a few more cpu cycles.
>
> But the REAL boost, again, is from not hammering the hard drive (slow)
> to load PHP source into RAM, Step 0.
>
> PS
> If you are really concerned about the constructor of SomeClass being
> expensive, time it and see.
>
> YOU may be doing something incredibly expensive there like
> re-connecting to the database (slow!) each time.
>
> You may also not even NEED a whole new SomeClass every time -- Perhaps
> you could just make a singleton and then reset its values and call
> process() with the new values instead of building up a whole new
> instance each time.
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 16:20 -0500, tedd wrote:
> At 3:34 PM -0500 12/12/07, Robert Cummings wrote:
> >On Wed, 2007-12-12 at 13:13 -0500, tedd wrote:
> >  > Just because we think, does not prove randomness, nor order, in
> >>  nature -- it only proves that we think about it.
> >
> >Actually, order is proven. The fact that I can re-arrange objects into
> >an order proves it exists, the accuracy of the ordering may fall into
> >question, but not that they are ordered. It's random that can't be
> >proven.
> >
> >Cheers,
> >Rob.
> 
> No, just because you can "re-arrange objects" to your definition of 
> order does not mean they are ordered -- unless you are making one of 
> those "begging the question" arguments (i.e., "I ordered it, 
> therefore it's ordered").

Actually it does mean they're ordered. I re-arranged them from their
previous order/disorder. As such I exerted control. Control facilitates
order. The fact that I moved it from A to B means I controlled it, since
I controlled it I ordered it. This is not begging the question.

> Instead, I claim that you perceive order, when there is not, other 
> than in your mind, and that's the point. One might claim that if you 
> could order things, then they would remain ordered -- but nothing 
> remains stagnant.
> 
> Furthermore, what you claim as ordered will not necessarily be "in 
> order" by another observer. As such, "order" is an abstract concept 
> of the mind, nothing else.

Other observers aren't important since reality is what *I* observe.
Additionally, the fact that I order something for any moment of time,
however infinitely small, still means I ordered it. The fact that the
order decays due to other influences just reinforces the fact that there
are other rules at play that order the universe according to the
execution of those rules... aka physics. This brings us back to the
greater machine at play-- the universe, and how we are just machines
within the large machine. We can order things, but the greater machine
has final say since it is already running and we are within its
influence.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 16:21 -0500, tedd wrote:
> At 3:35 PM -0500 12/12/07, Robert Cummings wrote:
> >On Wed, 2007-12-12 at 13:16 -0500, tedd wrote:
> >>  At 10:17 AM -0500 12/12/07, Robert Cummings wrote:
> >>  >  > In my ancient past I worked with a x-ray detector and we simply
> >>  >>  truncated to the tens digit -- that was pretty random.
> >>  >
> >>  >Random seeming you mean. As mentioned in the original post, just because
> >>  >the timeline and sample space is immense doesn't make it random, it just
> >>  >makes it difficult to guess. In fact, someone already mentioned the case
> >>  >of computers in casinos that can predict the landing spot of a roulette
> >>  >ball.
> >>
> >>  Just because someone said it, doesn't mean it's true.
> >>
> >>  I remember in the old days where they used roulette wheels to
> >>  generate random lists.
> >
> >Seemingly random lists... We haven't proven random yet ;)
> >
> >Cheers,
> >Rob.
> 
> Yeah, but we haven't proven order yet either. :-)

Order exists all around us. I only need to look around me to see the
order that exists. A desk, a table, the structure of crystals, etc, etc.
Random on the other hand is the one to be proven. I look around and I
can also see disorder, but is it random, or is it just messy order. THAT
is the question.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Generating Random Numbers with Normal Distribution

2007-12-12 Thread Robert Cummings
On Wed, 2007-12-12 at 16:34 -0500, tedd wrote:
> At 3:42 PM -0500 12/12/07, Robert Cummings wrote:
> >  > Yes, but what if my disorder was random?
> >
> >How could you prove it is random? Give me an example of something you
> >can put into disorder that doesn't use the premise of order? For
> >instance throwing a handful of sand into the air is expected to obey the
> >establish laws of physics. These laws of physics suggest order in the
> >universe even when we perceive disorder.
> >
> >Cheers,
> >Rob.
> 
> Yes, but now we're getting back to artificial rules of the mind. We 
> perceive the laws of physics to work a certain way because we have 
> established rules as to how they should work. But, what happens when 
> they don't work? Then we change the rules. We are now at string 
> theory and things still remain disordered. All our efforts to put 
> order to things still fall short.
> 
> Also, when we do change our rules, nature hasn't changed. Nature 
> hasn't suddenly changed to our view, but rather we change our 
> thinking to adapt to observation. And it's in those terms of 
> observation that order and disorder of things comes about and not in 
> nature.

Once again, we're not trying to prove order. Order obviously exists. But
does random? Do the laws of physics randomly change? Just because we're
wrong about something doesn't change the machine. The machine is the
same, our understanding is the only thing that has changed. Even if the
machine changes has it done so randomly? Or according to some rule?

Anyways, this thread could go on forever. Order obviously exists, our
interpretation of what causes that order may be right or wrong, but it
doesn't change the existence of that order. That said we have no obvious
proof that random exists. Looking around I can't say look there, that
certainly is random. All I can say is that it is seemingly random, it
appears very disordered "to me".

I'm going to bail on this thread now... it's gone on too long :) Fun
though. Where's Crayon?

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Session call not creating file in session_save_path - perms? (newbie)

2007-12-12 Thread Robert Erbaron
OK, I've read every message on the list for the last year that contains
'sessions'. I've read through (bleary eyed, admittedly)
http://us2.php.net/session. And I swear, honest, that I had this working on
another box (which is no longer available to me.) I've checked phpinfo -
session support is on, session.use_cookie is On. PHP 5.1.6 or thereabouts.

';
echo 'save path:'.session_save_path().':';

$ip = ' '.$_SERVER['REMOTE_ADDR'];
echo '$ip is:'.$ip.':';
$_SESSION['ipx']=$ip;
echo 'ipx (session) is:'.$_SESSION['ipx'].':';
if (!isset($_SESSION['ipx'])) echo 'whoa nelly';
echo 'This is the main page';
?>

Output looks like this:
sessionid:8klvud4o186lme7n6v84lhfjl2:
save path:/home/rob/Sites/zphpsessions:
$ip is: 127.0.0.1:
ipx (session) is: 127.0.0.1:
This is the main page

No data is being dumped into /home/rob/Sites/zphpsessions. The best I can
guess is permissions. If I change save_path to /tmp, no difference - still
nothing being written there. I bet I'm doing something ignorant about apache
users or something, huh?

-- 
RE, Chicago


Re: [PHP] Session call not creating file in session_save_path - perms? (newbie)

2007-12-12 Thread Casey
Read manual please.

http://us.php.net/session_save_path

On Dec 12, 2007 9:27 PM, Robert Erbaron <[EMAIL PROTECTED]> wrote:
> OK, I've read every message on the list for the last year that contains
> 'sessions'. I've read through (bleary eyed, admittedly)
> http://us2.php.net/session. And I swear, honest, that I had this working on
> another box (which is no longer available to me.) I've checked phpinfo -
> session support is on, session.use_cookie is On. PHP 5.1.6 or thereabouts.
>
>  session_save_path('/home/rob//Sites/zphpsessions');
> echo 'sessionid:'.session_id().':';
> echo 'save path:'.session_save_path().':';
>
> $ip = ' '.$_SERVER['REMOTE_ADDR'];
> echo '$ip is:'.$ip.':';
> $_SESSION['ipx']=$ip;
> echo 'ipx (session) is:'.$_SESSION['ipx'].':';
> if (!isset($_SESSION['ipx'])) echo 'whoa nelly';
> echo 'This is the main page';
> ?>
>
> Output looks like this:
> sessionid:8klvud4o186lme7n6v84lhfjl2:
> save path:/home/rob/Sites/zphpsessions:
> $ip is: 127.0.0.1:
> ipx (session) is: 127.0.0.1:
> This is the main page
>
> No data is being dumped into /home/rob/Sites/zphpsessions. The best I can
> guess is permissions. If I change save_path to /tmp, no difference - still
> nothing being written there. I bet I'm doing something ignorant about apache
> users or something, huh?
>
> --
> RE, Chicago
>



-- 
-Casey

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Session call not creating file in session_save_path - perms? (newbie)

2007-12-12 Thread Chris

Robert Erbaron wrote:

OK, I've read every message on the list for the last year that contains
'sessions'. I've read through (bleary eyed, admittedly)
http://us2.php.net/session. And I swear, honest, that I had this working on
another box (which is no longer available to me.) I've checked phpinfo -
session support is on, session.use_cookie is On. PHP 5.1.6 or thereabouts.



You need to set the session_save_path before you call session_start.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Session call not creating file in session_save_path - perms? (newbie)

2007-12-12 Thread Robert Erbaron
Aw crap. :)

(session_save_path BEFORE session_start.)

Works fine now... now to clean the egg off face.

Thx,

On Dec 12, 2007 11:31 PM, Casey <[EMAIL PROTECTED]> wrote:

> Read manual please.
>
> http://us.php.net/session_save_path
>
>
-- 
RE, Chicago